nfets 0.0.107 → 0.0.109

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,2 +1,229 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import"../chunk-23RWB4QQ.mjs";import{$ as U,A as w,B as x,C as y,E as z,F as A,I as B,J as C,K as D,L as E,M as F,N as G,O as H,P as I,Q as J,R as K,S as L,T as M,U as N,V as O,W as P,X as Q,Y as R,Z as S,_ as T,a,aa as V,b,ba as W,c,ca as X,d,da as Y,e,ea as Z,f,fa as _,g,ga as $,h,ha as aa,ia as ba,j as i,ja as ca,k as j,ka as da,la as ea,m as k,ma as fa,p as l,q as m,r as n,s as o,t as p,u as q,v as r,w as s,x as t,y as u,z as v}from"../chunk-GG3KUX2D.mjs";import"../chunk-W6MRGYXP.mjs";export{z as ASN1,b as CanonicalizationMethod,E as Choice,v as Decimal,e as DigestAlgorithm,l as EntitySigner,h as Environment,D as IsDecimal,x as MemoryCacheAdapter,i as NFeTsError,A as NativeCertificateRepository,y as NullCacheAdapter,w as PdfkitPdfBuilder,d as SignatureAlgorithm,c as SignatureMethod,a as SignatureNamespace,k as Signer,p as SkipAllValidations,o as SkipValidation,n as SkipValidationMetadata,B as SoapRemoteTransmissionRepository,g as StateAcronyms,H as StateCodeAcValidator,I as StateCodeAlValidator,J as StateCodeAmValidator,K as StateCodeApValidator,L as StateCodeBaValidator,M as StateCodeCeValidator,N as StateCodeDfValidator,O as StateCodeEsValidator,P as StateCodeGoValidator,Q as StateCodeMaValidator,R as StateCodeMgValidator,S as StateCodeMsValidator,T as StateCodeMtValidator,U as StateCodePaValidator,V as StateCodePbValidator,W as StateCodePeValidator,X as StateCodePiValidator,Y as StateCodePrValidator,Z as StateCodeRjValidator,_ as StateCodeRnValidator,$ as StateCodeRoValidator,aa as StateCodeRrValidator,ba as StateCodeRsValidator,ca as StateCodeScValidator,da as StateCodeSeValidator,ea as StateCodeSpValidator,fa as StateCodeToValidator,f as StateCodes,G as TransformDateString,F as TransformDecimal,s as ValidateErrorsMetadata,u as Validates,j as ValidationError,C as Xml2JsToolkit,m as XmlSigner,q as clearEmptyValues,t as mapConstraintsToErrors,r as plainToInstance};
2
+ import{a as Iy,b as yV,c as vV,d as dI}from"../chunk-24AGSZQQ.mjs";import{a as u,b as st,d as ue,f as Ty}from"../chunk-W6MRGYXP.mjs";var bt=ue((KZ,FI)=>{"use strict";FI.exports={options:{usePureJavaScript:!1}}});var jI=ue((XZ,MI)=>{"use strict";var EA={};MI.exports=EA;var UI={};EA.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=m6(r,e);else{var s=0,i=e.length,a=e.charAt(0),o=[0];for(s=0;s<r.length;++s){for(var l=0,c=r[s];l<o.length;++l)c+=o[l]<<8,o[l]=c%i,c=c/i|0;for(;c>0;)o.push(c%i),c=c/i|0}for(s=0;r[s]===0&&s<r.length-1;++s)n+=a;for(s=o.length-1;s>=0;--s)n+=e[o[s]]}if(t){var f=new RegExp(".{1,"+t+"}","g");n=n.match(f).join(`\r
3
+ `)}return n};EA.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=UI[e];if(!t){t=UI[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 o=t[r.charCodeAt(n)];if(o===void 0)return;for(var l=0,c=o;l<a.length;++l)c+=a[l]*s,a[l]=c&255,c>>=8;for(;c>0;)a.push(c&255),c>>=8}for(var f=0;r[f]===i&&f<r.length-1;++f)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function m6(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,o=r.at(t);a<i.length;++a)o+=i[a]<<8,i[a]=o%n,o=o/n|0;for(;o>0;)i.push(o%n),o=o/n|0}var l="";for(t=0;r.at(t)===0&&t<r.length()-1;++t)l+=s;for(t=i.length-1;t>=0;--t)l+=e[i[t]];return l}u(m6,"_encodeWithByteBuffer")});var jt=ue(($Z,XI)=>{"use strict";var qI=bt(),HI=jI(),Y=XI.exports=qI.util=qI.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){Y.nextTick=process.nextTick,typeof setImmediate=="function"?Y.setImmediate=setImmediate:Y.setImmediate=Y.nextTick;return}if(typeof setImmediate=="function"){Y.setImmediate=function(){return setImmediate.apply(void 0,arguments)},Y.nextTick=function(o){return setImmediate(o)};return}if(Y.setImmediate=function(o){setTimeout(o,0)},typeof window<"u"&&typeof window.postMessage=="function"){let o=function(l){if(l.source===window&&l.data===r){l.stopPropagation();var c=e.slice();e.length=0,c.forEach(function(f){f()})}};var a=o;u(o,"handler");var r="forge.setImmediate",e=[];Y.setImmediate=function(l){e.push(l),e.length===1&&window.postMessage(r,"*")},window.addEventListener("message",o,!0)}if(typeof MutationObserver<"u"){var t=Date.now(),n=!0,s=document.createElement("div"),e=[];new MutationObserver(function(){var l=e.slice();e.length=0,l.forEach(function(c){c()})}).observe(s,{attributes:!0});var i=Y.setImmediate;Y.setImmediate=function(l){Date.now()-t>15?(t=Date.now(),i(l)):(e.push(l),e.length===1&&s.setAttribute("a",n=!n))}}Y.nextTick=Y.setImmediate})();Y.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;Y.globalScope=(function(){return Y.isNodejs?global:typeof self>"u"?window:self})();Y.isArray=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};Y.isArrayBuffer=function(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer};Y.isArrayBufferView=function(r){return r&&Y.isArrayBuffer(r.buffer)&&r.byteLength!==void 0};function Y0(r){if(!(r===8||r===16||r===24||r===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+r)}u(Y0,"_checkBitsParam");Y.ByteBuffer=wA;function wA(r){if(this.data="",this.read=0,typeof r=="string")this.data=r;else if(Y.isArrayBuffer(r)||Y.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 wA||typeof r=="object"&&typeof r.data=="string"&&typeof r.read=="number")&&(this.data=r.data,this.read=r.read);this._constructedStringLength=0}u(wA,"ByteStringBuffer");Y.ByteStringBuffer=wA;var g6=4096;Y.ByteStringBuffer.prototype._optimizeConstructedString=function(r){this._constructedStringLength+=r,this._constructedStringLength>g6&&(this.data.substr(0,1),this._constructedStringLength=0)};Y.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};Y.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};Y.ByteStringBuffer.prototype.putByte=function(r){return this.putBytes(String.fromCharCode(r))};Y.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};Y.ByteStringBuffer.prototype.putBytes=function(r){return this.data+=r,this._optimizeConstructedString(r.length),this};Y.ByteStringBuffer.prototype.putString=function(r){return this.putBytes(Y.encodeUtf8(r))};Y.ByteStringBuffer.prototype.putInt16=function(r){return this.putBytes(String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};Y.ByteStringBuffer.prototype.putInt24=function(r){return this.putBytes(String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};Y.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))};Y.ByteStringBuffer.prototype.putInt16Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255))};Y.ByteStringBuffer.prototype.putInt24Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255))};Y.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))};Y.ByteStringBuffer.prototype.putInt=function(r,e){Y0(e);var t="";do e-=8,t+=String.fromCharCode(r>>e&255);while(e>0);return this.putBytes(t)};Y.ByteStringBuffer.prototype.putSignedInt=function(r,e){return r<0&&(r+=2<<e-1),this.putInt(r,e)};Y.ByteStringBuffer.prototype.putBuffer=function(r){return this.putBytes(r.getBytes())};Y.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};Y.ByteStringBuffer.prototype.getInt16=function(){var r=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,r};Y.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};Y.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};Y.ByteStringBuffer.prototype.getInt16Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,r};Y.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};Y.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};Y.ByteStringBuffer.prototype.getInt=function(r){Y0(r);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),r-=8;while(r>0);return e};Y.ByteStringBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};Y.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};Y.ByteStringBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};Y.ByteStringBuffer.prototype.at=function(r){return this.data.charCodeAt(this.read+r)};Y.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};Y.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};Y.ByteStringBuffer.prototype.copy=function(){var r=Y.createBuffer(this.data);return r.read=this.read,r};Y.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};Y.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};Y.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};Y.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};Y.ByteStringBuffer.prototype.toString=function(){return Y.decodeUtf8(this.bytes())};function y6(r,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var t=Y.isArrayBuffer(r),n=Y.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)}u(y6,"DataBuffer");Y.DataBuffer=y6;Y.DataBuffer.prototype.length=function(){return this.write-this.read};Y.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};Y.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};Y.DataBuffer.prototype.putByte=function(r){return this.accommodate(1),this.data.setUint8(this.write++,r),this};Y.DataBuffer.prototype.fillWithByte=function(r,e){this.accommodate(e);for(var t=0;t<e;++t)this.data.setUint8(r);return this};Y.DataBuffer.prototype.putBytes=function(r,e){if(Y.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(Y.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 Y.DataBuffer||typeof r=="object"&&typeof r.read=="number"&&typeof r.write=="number"&&Y.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 Y.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+=Y.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+=Y.binary.base64.decode(r,i,this.write),this;if(e==="utf8"&&(r=Y.encodeUtf8(r),e="binary"),e==="binary"||e==="raw")return this.accommodate(r.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=Y.binary.raw.decode(i),this;if(e==="utf16")return this.accommodate(r.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=Y.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+r)};Y.DataBuffer.prototype.putBuffer=function(r){return this.putBytes(r),r.clear(),this};Y.DataBuffer.prototype.putString=function(r){return this.putBytes(r,"utf16")};Y.DataBuffer.prototype.putInt16=function(r){return this.accommodate(2),this.data.setInt16(this.write,r),this.write+=2,this};Y.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};Y.DataBuffer.prototype.putInt32=function(r){return this.accommodate(4),this.data.setInt32(this.write,r),this.write+=4,this};Y.DataBuffer.prototype.putInt16Le=function(r){return this.accommodate(2),this.data.setInt16(this.write,r,!0),this.write+=2,this};Y.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};Y.DataBuffer.prototype.putInt32Le=function(r){return this.accommodate(4),this.data.setInt32(this.write,r,!0),this.write+=4,this};Y.DataBuffer.prototype.putInt=function(r,e){Y0(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,r>>e&255);while(e>0);return this};Y.DataBuffer.prototype.putSignedInt=function(r,e){return Y0(e),this.accommodate(e/8),r<0&&(r+=2<<e-1),this.putInt(r,e)};Y.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};Y.DataBuffer.prototype.getInt16=function(){var r=this.data.getInt16(this.read);return this.read+=2,r};Y.DataBuffer.prototype.getInt24=function(){var r=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,r};Y.DataBuffer.prototype.getInt32=function(){var r=this.data.getInt32(this.read);return this.read+=4,r};Y.DataBuffer.prototype.getInt16Le=function(){var r=this.data.getInt16(this.read,!0);return this.read+=2,r};Y.DataBuffer.prototype.getInt24Le=function(){var r=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,r};Y.DataBuffer.prototype.getInt32Le=function(){var r=this.data.getInt32(this.read,!0);return this.read+=4,r};Y.DataBuffer.prototype.getInt=function(r){Y0(r);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),r-=8;while(r>0);return e};Y.DataBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};Y.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};Y.DataBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};Y.DataBuffer.prototype.at=function(r){return this.data.getUint8(this.read+r)};Y.DataBuffer.prototype.setAt=function(r,e){return this.data.setUint8(r,e),this};Y.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};Y.DataBuffer.prototype.copy=function(){return new Y.DataBuffer(this)};Y.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};Y.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};Y.DataBuffer.prototype.truncate=function(r){return this.write=Math.max(0,this.length()-r),this.read=Math.min(this.read,this.write),this};Y.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};Y.DataBuffer.prototype.toString=function(r){var e=new Uint8Array(this.data,this.read,this.length());if(r=r||"utf8",r==="binary"||r==="raw")return Y.binary.raw.encode(e);if(r==="hex")return Y.binary.hex.encode(e);if(r==="base64")return Y.binary.base64.encode(e);if(r==="utf8")return Y.text.utf8.decode(e);if(r==="utf16")return Y.text.utf16.decode(e);throw new Error("Invalid encoding: "+r)};Y.createBuffer=function(r,e){return e=e||"raw",r!==void 0&&e==="utf8"&&(r=Y.encodeUtf8(r)),new Y.ByteBuffer(r)};Y.fillString=function(r,e){for(var t="";e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return t};Y.xorBytes=function(r,e,t){for(var n="",s="",i="",a=0,o=0;t>0;--t,++a)s=r.charCodeAt(a)^e.charCodeAt(a),o>=10&&(n+=i,i="",o=0),i+=String.fromCharCode(s),++o;return n+=i,n};Y.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};Y.bytesToHex=function(r){return Y.createBuffer(r).toHex()};Y.int32ToBytes=function(r){return String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255)};var io="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ao=[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],KI="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";Y.encode64=function(r,e){for(var t="",n="",s,i,a,o=0;o<r.length;)s=r.charCodeAt(o++),i=r.charCodeAt(o++),a=r.charCodeAt(o++),t+=io.charAt(s>>2),t+=io.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=io.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":io.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
4
+ `,t=t.substr(e));return n+=t,n};Y.decode64=function(r){r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",t,n,s,i,a=0;a<r.length;)t=ao[r.charCodeAt(a++)-43],n=ao[r.charCodeAt(a++)-43],s=ao[r.charCodeAt(a++)-43],i=ao[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};Y.encodeUtf8=function(r){return unescape(encodeURIComponent(r))};Y.decodeUtf8=function(r){return decodeURIComponent(escape(r))};Y.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:HI.encode,decode:HI.decode}};Y.binary.raw.encode=function(r){return String.fromCharCode.apply(null,r)};Y.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};Y.binary.hex.encode=Y.bytesToHex;Y.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};Y.binary.base64.encode=function(r,e){for(var t="",n="",s,i,a,o=0;o<r.byteLength;)s=r[o++],i=r[o++],a=r[o++],t+=io.charAt(s>>2),t+=io.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=io.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":io.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
5
+ `,t=t.substr(e));return n+=t,n};Y.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,o,l=0,c=t;l<r.length;)s=ao[r.charCodeAt(l++)-43],i=ao[r.charCodeAt(l++)-43],a=ao[r.charCodeAt(l++)-43],o=ao[r.charCodeAt(l++)-43],n[c++]=s<<2|i>>4,a!==64&&(n[c++]=(i&15)<<4|a>>2,o!==64&&(n[c++]=(a&3)<<6|o));return e?c-t:n.subarray(0,c)};Y.binary.base58.encode=function(r,e){return Y.binary.baseN.encode(r,KI,e)};Y.binary.base58.decode=function(r,e){return Y.binary.baseN.decode(r,KI,e)};Y.text={utf8:{},utf16:{}};Y.text.utf8.encode=function(r,e,t){r=Y.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};Y.text.utf8.decode=function(r){return Y.decodeUtf8(String.fromCharCode.apply(null,r))};Y.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,o=0;o<r.length;++o)s[a++]=r.charCodeAt(o),i+=2;return e?i-t:n};Y.text.utf16.decode=function(r){return String.fromCharCode.apply(null,new Uint16Array(r.buffer))};Y.deflate=function(r,e,t){if(e=Y.decode64(r.deflate(Y.encode64(e)).rval),t){var n=2,s=e.charCodeAt(1);s&32&&(n=6),e=e.substring(n,e.length-4)}return e};Y.inflate=function(r,e,t){var n=r.inflate(Y.encode64(e)).rval;return n===null?null:Y.decode64(n)};var SA=u(function(r,e,t){if(!r)throw new Error("WebStorage not available.");var n;if(t===null?n=r.removeItem(e):(t=Y.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"),AA=u(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(Y.decode64(t))),t},"_getStorageObject"),v6=u(function(r,e,t,n){var s=AA(r,e);s===null&&(s={}),s[t]=n,SA(r,e,s)},"_setItem"),E6=u(function(r,e,t){var n=AA(r,e);return n!==null&&(n=t in n?n[t]:null),n},"_getItem"),w6=u(function(r,e,t){var n=AA(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),SA(r,e,n)}},"_removeItem"),S6=u(function(r,e){SA(r,e,null)},"_clearItems"),My=u(function(r,e,t){var n=null;typeof t>"u"&&(t=["web","flash"]);var s,i=!1,a=null;for(var o in t){s=t[o];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(l){a=l}if(i)break}if(!i)throw a;return n},"_callStorageFunction");Y.setItem=function(r,e,t,n,s){My(v6,arguments,s)};Y.getItem=function(r,e,t,n){return My(E6,arguments,n)};Y.removeItem=function(r,e,t,n){My(w6,arguments,n)};Y.clearItems=function(r,e,t){My(S6,arguments,t)};Y.isEmpty=function(r){for(var e in r)if(r.hasOwnProperty(e))return!1;return!0};Y.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 o=t[0][1];switch(o){case"s":case"o":s<arguments.length?i.push(arguments[s+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+o+"?>")}}return i.push(r.substring(a)),i.join("")};Y.formatNumber=function(r,e,t,n){var s=r,i=isNaN(e=Math.abs(e))?2:e,a=t===void 0?",":t,o=n===void 0?".":n,l=s<0?"-":"",c=parseInt(s=Math.abs(+s||0).toFixed(i),10)+"",f=c.length>3?c.length%3:0;return l+(f?c.substr(0,f)+o:"")+c.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+o)+(i?a+Math.abs(s-c).toFixed(i).slice(2):"")};Y.formatSize=function(r){return r>=1073741824?r=Y.formatNumber(r/1073741824,2,".","")+" GiB":r>=1048576?r=Y.formatNumber(r/1048576,2,".","")+" MiB":r>=1024?r=Y.formatNumber(r/1024,0)+" KiB":r=Y.formatNumber(r,0)+" bytes",r};Y.bytesFromIP=function(r){return r.indexOf(".")!==-1?Y.bytesFromIPv4(r):r.indexOf(":")!==-1?Y.bytesFromIPv6(r):null};Y.bytesFromIPv4=function(r){if(r=r.split("."),r.length!==4)return null;for(var e=Y.createBuffer(),t=0;t<r.length;++t){var n=parseInt(r[t],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};Y.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=Y.createBuffer(),s=0;s<8;++s){if(!r[s]||r[s].length===0){n.fillWithByte(0,t),t=0;continue}var i=Y.hexToBytes(r[s]);i.length<2&&n.putByte(0),n.putBytes(i)}return n.getBytes()};Y.bytesToIP=function(r){return r.length===4?Y.bytesToIPv4(r):r.length===16?Y.bytesToIPv6(r):null};Y.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(".")};Y.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=Y.bytesToHex(r[s]+r[s+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var a=t[t.length-1],o=e.length;!a||o!==a.end+1?t.push({start:o,end:o}):(a.end=o,a.end-a.start>t[n].end-t[n].start&&(n=t.length-1))}e.push(i)}if(t.length>0){var l=t[n];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),l.start===0&&e.unshift(""),l.end===7&&e.push(""))}return e.join(":")};Y.estimateCores=function(r,e){if(typeof r=="function"&&(e=r,r={}),r=r||{},"cores"in Y&&!r.update)return e(null,Y.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return Y.cores=navigator.hardwareConcurrency,e(null,Y.cores);if(typeof Worker>"u")return Y.cores=1,e(null,Y.cores);if(typeof Blob>"u")return Y.cores=2,e(null,Y.cores);var t=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(a){for(var o=Date.now(),l=o+4;Date.now()<l;);self.postMessage({st:o,et:l})})}).toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(a,o,l){if(o===0){var c=Math.floor(a.reduce(function(f,p){return f+p},0)/a.length);return Y.cores=Math.max(1,c),URL.revokeObjectURL(t),e(null,Y.cores)}s(l,function(f,p){a.push(i(l,p)),n(a,o-1,l)})}u(n,"sample");function s(a,o){for(var l=[],c=[],f=0;f<a;++f){var p=new Worker(t);p.addEventListener("message",function(d){if(c.push(d.data),c.length===a){for(var g=0;g<a;++g)l[g].terminate();o(null,c)}}),l.push(p)}for(var f=0;f<a;++f)l[f].postMessage(f)}u(s,"map");function i(a,o){for(var l=[],c=0;c<a;++c)for(var f=o[c],p=l[c]=[],d=0;d<a;++d)if(c!==d){var g=o[d];(f.st>g.st&&f.st<g.et||g.st>f.st&&g.st<f.et)&&p.push(d)}return l.reduce(function(m,v){return Math.max(m,v.length)},0)}u(i,"reduce")}});var jy=ue((zZ,GI)=>{"use strict";var Qr=bt();jt();GI.exports=Qr.cipher=Qr.cipher||{};Qr.cipher.algorithms=Qr.cipher.algorithms||{};Qr.cipher.createCipher=function(r,e){var t=r;if(typeof t=="string"&&(t=Qr.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new Qr.cipher.BlockCipher({algorithm:t,key:e,decrypt:!1})};Qr.cipher.createDecipher=function(r,e){var t=r;if(typeof t=="string"&&(t=Qr.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new Qr.cipher.BlockCipher({algorithm:t,key:e,decrypt:!0})};Qr.cipher.registerAlgorithm=function(r,e){r=r.toUpperCase(),Qr.cipher.algorithms[r]=e};Qr.cipher.getAlgorithm=function(r){return r=r.toUpperCase(),r in Qr.cipher.algorithms?Qr.cipher.algorithms[r]:null};var CA=Qr.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)};CA.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=Qr.util.createBuffer(),this.output=r.output||Qr.util.createBuffer(),this.mode.start(e)};CA.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()};CA.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 bA=ue((JZ,$I)=>{"use strict";var Zr=bt();jt();Zr.cipher=Zr.cipher||{};var It=$I.exports=Zr.cipher.modes=Zr.cipher.modes||{};It.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)};It.ecb.prototype.start=function(r){};It.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])};It.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])};It.ecb.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};It.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)};It.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)};It.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=qy(r.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};It.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};It.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)};It.cbc.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};It.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)};It.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=Zr.util.createBuffer(),this._partialBytes=0};It.cfb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=qy(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};It.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};It.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};It.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=Zr.util.createBuffer(),this._partialBytes=0};It.ofb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=qy(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};It.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};It.ofb.prototype.decrypt=It.ofb.prototype.encrypt;It.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=Zr.util.createBuffer(),this._partialBytes=0};It.ctr.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=qy(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};It.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}Hy(this._inBlock)};It.ctr.prototype.decrypt=It.ctr.prototype.encrypt;It.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=Zr.util.createBuffer(),this._partialBytes=0,this._R=3774873600};It.gcm.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");var e=Zr.util.createBuffer(r.iv);this._cipherLength=0;var t;if("additionalData"in r?t=Zr.util.createBuffer(r.additionalData):t=Zr.util.createBuffer(),"tagLength"in r?this._tagLength=r.tagLength:this._tagLength=128,this._tag=null,r.decrypt&&(this._tag=Zr.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(xA(n*8)))}this._inBlock=this._j0.slice(0),Hy(this._inBlock),this._partialBytes=0,t=Zr.util.createBuffer(t),this._aDataLength=xA(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()])};It.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),Hy(this._inBlock)};It.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),Hy(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};It.gcm.prototype.afterFinish=function(r,e){var t=!0;e.decrypt&&e.overflow&&r.truncate(this.blockSize-e.overflow),this.tag=Zr.util.createBuffer();var n=this._aDataLength.concat(xA(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};It.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};It.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)};It.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};It.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)};It.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 o=[0,0,0,0],l=a/n|0,c=(n-1-a%n)*e;o[l]=1<<e-1<<c,i[a]=this.generateSubHashTable(this.multiply(o,r),e)}return i};It.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 o=s[i],l=s[a];s[i+a]=[o[0]^l[0],o[1]^l[1],o[2]^l[2],o[3]^l[3]]}i*=2}for(s[0]=[0,0,0,0],i=n+1;i<t;++i){var c=s[i^n];s[i]=[r[0]^c[0],r[1]^c[1],r[2]^c[2],r[3]^c[3]]}return s};function qy(r,e){if(typeof r=="string"&&(r=Zr.util.createBuffer(r)),Zr.util.isArray(r)&&r.length>4){var t=r;r=Zr.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(!Zr.util.isArray(r)){for(var s=[],i=e/4,n=0;n<i;++n)s.push(r.getInt32());r=s}return r}u(qy,"transformIV");function Hy(r){r[r.length-1]=r[r.length-1]+1&4294967295}u(Hy,"inc32");function xA(r){return[r/4294967296|0,r&4294967295]}u(xA,"from64To32")});var oo=ue((QZ,YI)=>{"use strict";var cr=bt();jy();bA();jt();YI.exports=cr.aes=cr.aes||{};cr.aes.startEncrypting=function(r,e,t,n){var s=Ky({key:r,output:t,decrypt:!1,mode:n});return s.start(e),s};cr.aes.createEncryptionCipher=function(r,e){return Ky({key:r,output:null,decrypt:!1,mode:e})};cr.aes.startDecrypting=function(r,e,t,n){var s=Ky({key:r,output:t,decrypt:!0,mode:n});return s.start(e),s};cr.aes.createDecryptionCipher=function(r,e){return Ky({key:r,output:null,decrypt:!0,mode:e})};cr.aes.Algorithm=function(r,e){IA||zI();var t=this;t.name=r,t.mode=new e({blockSize:16,cipher:{encrypt:u(function(n,s){return TA(t._w,n,s,!1)},"encrypt"),decrypt:u(function(n,s){return TA(t._w,n,s,!0)},"decrypt")}}),t._init=!1};cr.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=cr.util.createBuffer(e);else if(cr.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){t=e,e=cr.util.createBuffer();for(var n=0;n<t.length;++n)e.putByte(t[n])}if(!cr.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(!cr.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=JI(e,r.decrypt&&!a),this._init=!0}};cr.aes._expandKey=function(r,e){return IA||zI(),JI(r,e)};cr.aes._updateBlock=TA;mf("AES-ECB",cr.cipher.modes.ecb);mf("AES-CBC",cr.cipher.modes.cbc);mf("AES-CFB",cr.cipher.modes.cfb);mf("AES-OFB",cr.cipher.modes.ofb);mf("AES-CTR",cr.cipher.modes.ctr);mf("AES-GCM",cr.cipher.modes.gcm);function mf(r,e){var t=u(function(){return new cr.aes.Algorithm(r,e)},"factory");cr.cipher.registerAlgorithm(r,t)}u(mf,"registerAlgorithm");var IA=!1,df=4,On,NA,WI,Wu,zs;function zI(){IA=!0,WI=[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;On=new Array(256),NA=new Array(256),Wu=new Array(4),zs=new Array(4);for(var e=0;e<4;++e)Wu[e]=new Array(256),zs[e]=new Array(256);for(var t=0,n=0,s,i,a,o,l,c,f,e=0;e<256;++e){o=n^n<<1^n<<2^n<<3^n<<4,o=o>>8^o&255^99,On[t]=o,NA[o]=t,l=r[o],s=r[t],i=r[s],a=r[i],c=l<<24^o<<16^o<<8^(o^l),f=(s^i^a)<<24^(t^a)<<16^(t^i^a)<<8^(t^s^a);for(var p=0;p<4;++p)Wu[p][t]=c,zs[p][o]=f,c=c<<24|c>>>8,f=f<<24|f>>>8;t===0?t=n=1:(t=s^r[r[r[s^a]]],n^=r[r[n]])}}u(zI,"initialize");function JI(r,e){for(var t=r.slice(0),n,s=1,i=t.length,a=i+6+1,o=df*a,l=i;l<o;++l)n=t[l-1],l%i===0?(n=On[n>>>16&255]<<24^On[n>>>8&255]<<16^On[n&255]<<8^On[n>>>24]^WI[s]<<24,s++):i>6&&l%i===4&&(n=On[n>>>24]<<24^On[n>>>16&255]<<16^On[n>>>8&255]<<8^On[n&255]),t[l]=t[l-i]^n;if(e){var c,f=zs[0],p=zs[1],d=zs[2],g=zs[3],m=t.slice(0);o=t.length;for(var l=0,v=o-df;l<o;l+=df,v-=df)if(l===0||l===o-df)m[l]=t[v],m[l+1]=t[v+3],m[l+2]=t[v+2],m[l+3]=t[v+1];else for(var y=0;y<df;++y)c=t[v+y],m[l+(3&-y)]=f[On[c>>>24]]^p[On[c>>>16&255]]^d[On[c>>>8&255]]^g[On[c&255]];t=m}return t}u(JI,"_expandKey");function TA(r,e,t,n){var s=r.length/4-1,i,a,o,l,c;n?(i=zs[0],a=zs[1],o=zs[2],l=zs[3],c=NA):(i=Wu[0],a=Wu[1],o=Wu[2],l=Wu[3],c=On);var f,p,d,g,m,v,y;f=e[0]^r[0],p=e[n?3:1]^r[1],d=e[2]^r[2],g=e[n?1:3]^r[3];for(var S=3,C=1;C<s;++C)m=i[f>>>24]^a[p>>>16&255]^o[d>>>8&255]^l[g&255]^r[++S],v=i[p>>>24]^a[d>>>16&255]^o[g>>>8&255]^l[f&255]^r[++S],y=i[d>>>24]^a[g>>>16&255]^o[f>>>8&255]^l[p&255]^r[++S],g=i[g>>>24]^a[f>>>16&255]^o[p>>>8&255]^l[d&255]^r[++S],f=m,p=v,d=y;t[0]=c[f>>>24]<<24^c[p>>>16&255]<<16^c[d>>>8&255]<<8^c[g&255]^r[++S],t[n?3:1]=c[p>>>24]<<24^c[d>>>16&255]<<16^c[g>>>8&255]<<8^c[f&255]^r[++S],t[2]=c[d>>>24]<<24^c[g>>>16&255]<<16^c[f>>>8&255]<<8^c[p&255]^r[++S],t[n?1:3]=c[g>>>24]<<24^c[f>>>16&255]<<16^c[p>>>8&255]<<8^c[d&255]^r[++S]}u(TA,"_updateBlock");function Ky(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="AES-"+e,n;r.decrypt?n=cr.cipher.createDecipher(t,r.key):n=cr.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var o=null;a instanceof cr.util.ByteBuffer&&(o=a,a={}),a=a||{},a.output=o,a.iv=i,s.call(n,a)},n}u(Ky,"_createCipher")});var uo=ue((eee,QI)=>{"use strict";var Q0=bt();Q0.pki=Q0.pki||{};var DA=QI.exports=Q0.pki.oids=Q0.oids=Q0.oids||{};function Te(r,e){DA[r]=e,DA[e]=r}u(Te,"_IN");function Wt(r,e){DA[r]=e}u(Wt,"_I_");Te("1.2.840.113549.1.1.1","rsaEncryption");Te("1.2.840.113549.1.1.4","md5WithRSAEncryption");Te("1.2.840.113549.1.1.5","sha1WithRSAEncryption");Te("1.2.840.113549.1.1.7","RSAES-OAEP");Te("1.2.840.113549.1.1.8","mgf1");Te("1.2.840.113549.1.1.9","pSpecified");Te("1.2.840.113549.1.1.10","RSASSA-PSS");Te("1.2.840.113549.1.1.11","sha256WithRSAEncryption");Te("1.2.840.113549.1.1.12","sha384WithRSAEncryption");Te("1.2.840.113549.1.1.13","sha512WithRSAEncryption");Te("1.3.101.112","EdDSA25519");Te("1.2.840.10040.4.3","dsa-with-sha1");Te("1.3.14.3.2.7","desCBC");Te("1.3.14.3.2.26","sha1");Te("1.3.14.3.2.29","sha1WithRSASignature");Te("2.16.840.1.101.3.4.2.1","sha256");Te("2.16.840.1.101.3.4.2.2","sha384");Te("2.16.840.1.101.3.4.2.3","sha512");Te("2.16.840.1.101.3.4.2.4","sha224");Te("2.16.840.1.101.3.4.2.5","sha512-224");Te("2.16.840.1.101.3.4.2.6","sha512-256");Te("1.2.840.113549.2.2","md2");Te("1.2.840.113549.2.5","md5");Te("1.2.840.113549.1.7.1","data");Te("1.2.840.113549.1.7.2","signedData");Te("1.2.840.113549.1.7.3","envelopedData");Te("1.2.840.113549.1.7.4","signedAndEnvelopedData");Te("1.2.840.113549.1.7.5","digestedData");Te("1.2.840.113549.1.7.6","encryptedData");Te("1.2.840.113549.1.9.1","emailAddress");Te("1.2.840.113549.1.9.2","unstructuredName");Te("1.2.840.113549.1.9.3","contentType");Te("1.2.840.113549.1.9.4","messageDigest");Te("1.2.840.113549.1.9.5","signingTime");Te("1.2.840.113549.1.9.6","counterSignature");Te("1.2.840.113549.1.9.7","challengePassword");Te("1.2.840.113549.1.9.8","unstructuredAddress");Te("1.2.840.113549.1.9.14","extensionRequest");Te("1.2.840.113549.1.9.20","friendlyName");Te("1.2.840.113549.1.9.21","localKeyId");Te("1.2.840.113549.1.9.22.1","x509Certificate");Te("1.2.840.113549.1.12.10.1.1","keyBag");Te("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");Te("1.2.840.113549.1.12.10.1.3","certBag");Te("1.2.840.113549.1.12.10.1.4","crlBag");Te("1.2.840.113549.1.12.10.1.5","secretBag");Te("1.2.840.113549.1.12.10.1.6","safeContentsBag");Te("1.2.840.113549.1.5.13","pkcs5PBES2");Te("1.2.840.113549.1.5.12","pkcs5PBKDF2");Te("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");Te("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");Te("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");Te("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");Te("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");Te("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");Te("1.2.840.113549.2.7","hmacWithSHA1");Te("1.2.840.113549.2.8","hmacWithSHA224");Te("1.2.840.113549.2.9","hmacWithSHA256");Te("1.2.840.113549.2.10","hmacWithSHA384");Te("1.2.840.113549.2.11","hmacWithSHA512");Te("1.2.840.113549.3.7","des-EDE3-CBC");Te("2.16.840.1.101.3.4.1.2","aes128-CBC");Te("2.16.840.1.101.3.4.1.22","aes192-CBC");Te("2.16.840.1.101.3.4.1.42","aes256-CBC");Te("2.5.4.3","commonName");Te("2.5.4.4","surname");Te("2.5.4.5","serialNumber");Te("2.5.4.6","countryName");Te("2.5.4.7","localityName");Te("2.5.4.8","stateOrProvinceName");Te("2.5.4.9","streetAddress");Te("2.5.4.10","organizationName");Te("2.5.4.11","organizationalUnitName");Te("2.5.4.12","title");Te("2.5.4.13","description");Te("2.5.4.15","businessCategory");Te("2.5.4.17","postalCode");Te("2.5.4.42","givenName");Te("2.5.4.65","pseudonym");Te("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");Te("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");Te("2.16.840.1.113730.1.1","nsCertType");Te("2.16.840.1.113730.1.13","nsComment");Wt("2.5.29.1","authorityKeyIdentifier");Wt("2.5.29.2","keyAttributes");Wt("2.5.29.3","certificatePolicies");Wt("2.5.29.4","keyUsageRestriction");Wt("2.5.29.5","policyMapping");Wt("2.5.29.6","subtreesConstraint");Wt("2.5.29.7","subjectAltName");Wt("2.5.29.8","issuerAltName");Wt("2.5.29.9","subjectDirectoryAttributes");Wt("2.5.29.10","basicConstraints");Wt("2.5.29.11","nameConstraints");Wt("2.5.29.12","policyConstraints");Wt("2.5.29.13","basicConstraints");Te("2.5.29.14","subjectKeyIdentifier");Te("2.5.29.15","keyUsage");Wt("2.5.29.16","privateKeyUsagePeriod");Te("2.5.29.17","subjectAltName");Te("2.5.29.18","issuerAltName");Te("2.5.29.19","basicConstraints");Wt("2.5.29.20","cRLNumber");Wt("2.5.29.21","cRLReason");Wt("2.5.29.22","expirationDate");Wt("2.5.29.23","instructionCode");Wt("2.5.29.24","invalidityDate");Wt("2.5.29.25","cRLDistributionPoints");Wt("2.5.29.26","issuingDistributionPoint");Wt("2.5.29.27","deltaCRLIndicator");Wt("2.5.29.28","issuingDistributionPoint");Wt("2.5.29.29","certificateIssuer");Wt("2.5.29.30","nameConstraints");Te("2.5.29.31","cRLDistributionPoints");Te("2.5.29.32","certificatePolicies");Wt("2.5.29.33","policyMappings");Wt("2.5.29.34","policyConstraints");Te("2.5.29.35","authorityKeyIdentifier");Wt("2.5.29.36","policyConstraints");Te("2.5.29.37","extKeyUsage");Wt("2.5.29.46","freshestCRL");Wt("2.5.29.54","inhibitAnyPolicy");Te("1.3.6.1.4.1.11129.2.4.2","timestampList");Te("1.3.6.1.5.5.7.1.1","authorityInfoAccess");Te("1.3.6.1.5.5.7.3.1","serverAuth");Te("1.3.6.1.5.5.7.3.2","clientAuth");Te("1.3.6.1.5.5.7.3.3","codeSigning");Te("1.3.6.1.5.5.7.3.4","emailProtection");Te("1.3.6.1.5.5.7.3.8","timeStamping")});var Js=ue((ree,eD)=>{"use strict";var yr=bt();jt();uo();var Ue=eD.exports=yr.asn1=yr.asn1||{};Ue.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};Ue.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};Ue.maxDepth=256;Ue.create=function(r,e,t,n,s){if(yr.util.isArray(n)){for(var i=[],a=0;a<n.length;++a)n[a]!==void 0&&i.push(n[a]);n=i}var o={tagClass:r,type:e,constructed:t,composed:t||yr.util.isArray(n),value:n};return s&&"bitStringContents"in s&&(o.bitStringContents=s.bitStringContents,o.original=Ue.copy(o)),o};Ue.copy=function(r,e){var t;if(yr.util.isArray(r)){t=[];for(var n=0;n<r.length;++n)t.push(Ue.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:Ue.copy(r.value,e)},e&&!e.excludeBitStringContents&&(t.bitStringContents=r.bitStringContents),t)};Ue.equals=function(r,e,t){if(yr.util.isArray(r)){if(!yr.util.isArray(e)||r.length!==e.length)return!1;for(var n=0;n<r.length;++n)if(!Ue.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&&Ue.equals(r.value,e.value);return t&&t.includeBitStringContents&&(s=s&&r.bitStringContents===e.bitStringContents),s};Ue.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}}u(Z0,"_checkBufferLength");var A6=u(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");Ue.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),"maxDepth"in e||(e.maxDepth=Ue.maxDepth),typeof r=="string"&&(r=yr.util.createBuffer(r));var t=r.length(),n=Xy(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 Xy(r,e,t,n){if(t>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var s;Z0(r,e,2);var i=r.getByte();e--;var a=i&192,o=i&31;s=r.length();var l=A6(r,e);if(e-=s-r.length(),l!==void 0&&l>e){if(n.strict){var c=new Error("Too few bytes to read ASN.1 value.");throw c.available=r.length(),c.remaining=e,c.requested=l,c}l=e}var f,p,d=(i&32)===32;if(d)if(f=[],l===void 0)for(;;){if(Z0(r,e,2),r.bytes(2)==="\0\0"){r.getBytes(2),e-=2;break}s=r.length(),f.push(Xy(r,e,t+1,n)),e-=s-r.length()}else for(;l>0;)s=r.length(),f.push(Xy(r,l,t+1,n)),e-=s-r.length(),l-=s-r.length();if(f===void 0&&a===Ue.Class.UNIVERSAL&&o===Ue.Type.BITSTRING&&(p=r.bytes(l)),f===void 0&&n.decodeBitStrings&&a===Ue.Class.UNIVERSAL&&o===Ue.Type.BITSTRING&&l>1){var g=r.read,m=e,v=0;if(o===Ue.Type.BITSTRING&&(Z0(r,e,1),v=r.getByte(),e--),v===0)try{s=r.length();var y={strict:!0,decodeBitStrings:!0},S=Xy(r,e,t+1,y),C=s-r.length();e-=C,o==Ue.Type.BITSTRING&&C++;var w=S.tagClass;C===l&&(w===Ue.Class.UNIVERSAL||w===Ue.Class.CONTEXT_SPECIFIC)&&(f=[S])}catch{}f===void 0&&(r.read=g,e=m)}if(f===void 0){if(l===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=e}if(o===Ue.Type.BMPSTRING)for(f="";l>0;l-=2)Z0(r,e,2),f+=String.fromCharCode(r.getInt16()),e-=2;else f=r.getBytes(l),e-=l}var E=p===void 0?null:{bitStringContents:p};return Ue.create(a,o,d,f,E)}u(Xy,"_fromDer");Ue.toDer=function(r){var e=yr.util.createBuffer(),t=r.tagClass|r.type,n=yr.util.createBuffer(),s=!1;if("bitStringContents"in r&&(s=!0,r.original&&(s=Ue.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(Ue.toDer(r.value[i]))}else if(r.type===Ue.Type.BMPSTRING)for(var i=0;i<r.value.length;++i)n.putInt16(r.value.charCodeAt(i));else r.type===Ue.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(),o="";do o+=String.fromCharCode(a&255),a=a>>>8;while(a>0);e.putByte(o.length|128);for(var i=o.length-1;i>=0;--i)e.putByte(o.charCodeAt(i))}return e.putBuffer(n),e};Ue.oidToDer=function(r){var e=r.split("."),t=yr.util.createBuffer();t.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,s,i,a,o=2;o<e.length;++o){if(n=!0,s=[],i=parseInt(e[o],10),i>4294967295)throw new Error("OID value too large; max is 32-bits.");do a=i&127,i=i>>>7,n||(a|=128),s.push(a),n=!1;while(i>0);for(var l=s.length-1;l>=0;--l)t.putByte(s[l])}return t};Ue.derToOid=function(r){var e;typeof r=="string"&&(r=yr.util.createBuffer(r));var t=r.getByte();e=Math.floor(t/40)+"."+t%40;for(var n=0;r.length()>0;){if(n>70368744177663)throw new Error("OID value too large; max is 53-bits.");t=r.getByte(),n=n*128,t&128?n+=t&127:(e+="."+(n+t),n=0)}return e};Ue.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),o=0;if(r.length>11){var l=r.charAt(10),c=10;l!=="+"&&l!=="-"&&(o=parseInt(r.substr(10,2),10),c+=2)}if(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,o,0),c&&(l=r.charAt(c),l==="+"||l==="-")){var f=parseInt(r.substr(c+1,2),10),p=parseInt(r.substr(c+4,2),10),d=f*60+p;d*=6e4,l==="+"?e.setTime(+e-d):e.setTime(+e+d)}return e};Ue.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),o=parseInt(r.substr(12,2),10),l=0,c=0,f=!1;r.charAt(r.length-1)==="Z"&&(f=!0);var p=r.length-5,d=r.charAt(p);if(d==="+"||d==="-"){var g=parseInt(r.substr(p+1,2),10),m=parseInt(r.substr(p+4,2),10);c=g*60+m,c*=6e4,d==="+"&&(c*=-1),f=!0}return r.charAt(14)==="."&&(l=parseFloat(r.substr(14),10)*1e3),f?(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,o,l),e.setTime(+e+c)):(e.setFullYear(t,n,s),e.setHours(i,a,o,l)),e};Ue.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};Ue.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};Ue.integerToDer=function(r){var e=yr.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};Ue.derToInteger=function(r){typeof r=="string"&&(r=yr.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)};Ue.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&&yr.util.isArray(e.value))for(var i=0,a=0;s&&a<e.value.length;++a){var o=e.value[a];s=!!o.optional;var l=r.value[i];if(!l){o.optional||(s=!1,n&&n.push("["+e.name+'] Missing required element. Expected tag class "'+o.tagClass+'", type "'+o.type+'"'));continue}var c=typeof o.tagClass<"u"&&typeof o.type<"u";if(c&&(l.tagClass!==o.tagClass||l.type!==o.type))if(o.optional){s=!0;continue}else{s=!1,n&&n.push("["+e.name+"] Tag mismatch. Expected ("+o.tagClass+","+o.type+"), got ("+l.tagClass+","+l.type+")");break}var f=Ue.validate(l,o,t,n);if(f)++i,s=!0;else if(o.optional)s=!0;else{s=!1;break}}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 p;if(r.bitStringContents.length<2)t[e.captureBitStringValue]="";else{var d=r.bitStringContents.charCodeAt(0);if(d!==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 ZI=/[^\\u0000-\\u00ff]/;Ue.prettyPrint=function(r,e,t){var n="";e=e||0,t=t||2,e>0&&(n+=`
6
+ `);for(var s="",i=0;i<e*t;++i)s+=" ";switch(n+=s+"Tag: ",r.tagClass){case Ue.Class.UNIVERSAL:n+="Universal:";break;case Ue.Class.APPLICATION:n+="Application:";break;case Ue.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case Ue.Class.PRIVATE:n+="Private:";break}if(r.tagClass===Ue.Class.UNIVERSAL)switch(n+=r.type,r.type){case Ue.Type.NONE:n+=" (None)";break;case Ue.Type.BOOLEAN:n+=" (Boolean)";break;case Ue.Type.INTEGER:n+=" (Integer)";break;case Ue.Type.BITSTRING:n+=" (Bit string)";break;case Ue.Type.OCTETSTRING:n+=" (Octet string)";break;case Ue.Type.NULL:n+=" (Null)";break;case Ue.Type.OID:n+=" (Object Identifier)";break;case Ue.Type.ODESC:n+=" (Object Descriptor)";break;case Ue.Type.EXTERNAL:n+=" (External or Instance of)";break;case Ue.Type.REAL:n+=" (Real)";break;case Ue.Type.ENUMERATED:n+=" (Enumerated)";break;case Ue.Type.EMBEDDED:n+=" (Embedded PDV)";break;case Ue.Type.UTF8:n+=" (UTF8)";break;case Ue.Type.ROID:n+=" (Relative Object Identifier)";break;case Ue.Type.SEQUENCE:n+=" (Sequence)";break;case Ue.Type.SET:n+=" (Set)";break;case Ue.Type.PRINTABLESTRING:n+=" (Printable String)";break;case Ue.Type.IA5String:n+=" (IA5String (ASCII))";break;case Ue.Type.UTCTIME:n+=" (UTC time)";break;case Ue.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case Ue.Type.BMPSTRING:n+=" (BMP String)";break}else n+=r.type;if(n+=`
7
+ `,n+=s+"Constructed: "+r.constructed+`
8
+ `,r.composed){for(var a=0,o="",i=0;i<r.value.length;++i)r.value[i]!==void 0&&(a+=1,o+=Ue.prettyPrint(r.value[i],e+1,t),i+1<r.value.length&&(o+=","));n+=s+"Sub values: "+a+o}else{if(n+=s+"Value: ",r.type===Ue.Type.OID){var l=Ue.derToOid(r.value);n+=l,yr.pki&&yr.pki.oids&&l in yr.pki.oids&&(n+=" ("+yr.pki.oids[l]+") ")}if(r.type===Ue.Type.INTEGER)try{n+=Ue.derToInteger(r.value)}catch{n+="0x"+yr.util.bytesToHex(r.value)}else if(r.type===Ue.Type.BITSTRING){if(r.value.length>1?n+="0x"+yr.util.bytesToHex(r.value.slice(1)):n+="(none)",r.value.length>0){var c=r.value.charCodeAt(0);c==1?n+=" (1 unused bit shown)":c>1&&(n+=" ("+c+" unused bits shown)")}}else if(r.type===Ue.Type.OCTETSTRING)ZI.test(r.value)||(n+="("+r.value+") "),n+="0x"+yr.util.bytesToHex(r.value);else if(r.type===Ue.Type.UTF8)try{n+=yr.util.decodeUtf8(r.value)}catch(f){if(f.message==="URI malformed")n+="0x"+yr.util.bytesToHex(r.value)+" (malformed UTF8)";else throw f}else r.type===Ue.Type.PRINTABLESTRING||r.type===Ue.Type.IA5String?n+=r.value:ZI.test(r.value)?n+="0x"+yr.util.bytesToHex(r.value):r.value.length===0?n+="[null]":n+=r.value}return n}});var yi=ue((see,tD)=>{"use strict";var Gy=bt();tD.exports=Gy.md=Gy.md||{};Gy.md.algorithms=Gy.md.algorithms||{}});var gf=ue((iee,rD)=>{"use strict";var na=bt();yi();jt();var C6=rD.exports=na.hmac=na.hmac||{};C6.create=function(){var r=null,e=null,t=null,n=null,s={};return s.start=function(i,a){if(i!==null)if(typeof i=="string")if(i=i.toLowerCase(),i in na.md.algorithms)e=na.md.algorithms[i].create();else throw new Error('Unknown hash algorithm "'+i+'"');else e=i;if(a===null)a=r;else{if(typeof a=="string")a=na.util.createBuffer(a);else if(na.util.isArray(a)){var o=a;a=na.util.createBuffer();for(var l=0;l<o.length;++l)a.putByte(o[l])}var c=a.length();c>e.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),t=na.util.createBuffer(),n=na.util.createBuffer(),c=a.length();for(var l=0;l<c;++l){var o=a.at(l);t.putByte(54^o),n.putByte(92^o)}if(c<e.blockLength)for(var o=e.blockLength-c,l=0;l<o;++l)t.putByte(54),n.putByte(92);r=a,t=t.bytes(),n=n.bytes()}e.start(),e.update(t)},s.update=function(i){e.update(i)},s.getMac=function(){var i=e.digest().bytes();return e.start(),e.update(n),e.update(i),e.digest()},s.digest=s.getMac,s}});var Wy=ue((aee,aD)=>{"use strict";var vi=bt();yi();jt();var sD=aD.exports=vi.md5=vi.md5||{};vi.md.md5=vi.md.algorithms.md5=sD;sD.create=function(){iD||x6();var r=null,e=vi.util.createBuffer(),t=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=vi.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=vi.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),nD(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=vi.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(BA.substr(0,n.blockLength-a));for(var o,l=0,c=n.fullMessageLength.length-1;c>=0;--c)o=n.fullMessageLength[c]*8+l,l=o/4294967296>>>0,s.putInt32Le(o>>>0);var f={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3};nD(f,t,s);var p=vi.util.createBuffer();return p.putInt32Le(f.h0),p.putInt32Le(f.h1),p.putInt32Le(f.h2),p.putInt32Le(f.h3),p},n};var BA=null,$y=null,ed=null,yf=null,iD=!1;function x6(){BA="\x80",BA+=vi.util.fillString("\0",64),$y=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],ed=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],yf=new Array(64);for(var r=0;r<64;++r)yf[r]=Math.floor(Math.abs(Math.sin(r+1))*4294967296);iD=!0}u(x6,"_init");function nD(r,e,t){for(var n,s,i,a,o,l,c,f,p=t.length();p>=64;){for(s=r.h0,i=r.h1,a=r.h2,o=r.h3,f=0;f<16;++f)e[f]=t.getInt32Le(),l=o^i&(a^o),n=s+l+yf[f]+e[f],c=ed[f],s=o,o=a,a=i,i+=n<<c|n>>>32-c;for(;f<32;++f)l=a^o&(i^a),n=s+l+yf[f]+e[$y[f]],c=ed[f],s=o,o=a,a=i,i+=n<<c|n>>>32-c;for(;f<48;++f)l=i^a^o,n=s+l+yf[f]+e[$y[f]],c=ed[f],s=o,o=a,a=i,i+=n<<c|n>>>32-c;for(;f<64;++f)l=a^(i|~o),n=s+l+yf[f]+e[$y[f]],c=ed[f],s=o,o=a,a=i,i+=n<<c|n>>>32-c;r.h0=r.h0+s|0,r.h1=r.h1+i|0,r.h2=r.h2+a|0,r.h3=r.h3+o|0,p-=64}}u(nD,"_update")});var zu=ue((uee,uD)=>{"use strict";var Jy=bt();jt();var oD=uD.exports=Jy.pem=Jy.pem||{};oD.encode=function(r,e){e=e||{};var t="-----BEGIN "+r.type+`-----\r
9
+ `,n;if(r.procType&&(n={name:"Proc-Type",values:[String(r.procType.version),r.procType.type]},t+=zy(n)),r.contentDomain&&(n={name:"Content-Domain",values:[r.contentDomain]},t+=zy(n)),r.dekInfo&&(n={name:"DEK-Info",values:[r.dekInfo.algorithm]},r.dekInfo.parameters&&n.values.push(r.dekInfo.parameters),t+=zy(n)),r.headers)for(var s=0;s<r.headers.length;++s)t+=zy(r.headers[s]);return r.procType&&(t+=`\r
10
+ `),t+=Jy.util.encode64(r.body,e.maxline||64)+`\r
11
+ `,t+="-----END "+r.type+`-----\r
12
+ `,t};oD.decode=function(r){for(var e=[],t=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/,i;i=t.exec(r),!!i;){var a=i[1];a==="NEW CERTIFICATE REQUEST"&&(a="CERTIFICATE REQUEST");var o={type:a,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Jy.util.decode64(i[3])};if(e.push(o),!!i[2]){for(var l=i[2].split(s),c=0;i&&c<l.length;){for(var f=l[c].replace(/\s+$/,""),p=c+1;p<l.length;++p){var d=l[p];if(!/\s/.test(d[0]))break;f+=d,c=p}if(i=f.match(n),i){for(var g={name:i[1],values:[]},m=i[2].split(","),v=0;v<m.length;++v)g.values.push(b6(m[v]));if(o.procType)if(!o.contentDomain&&g.name==="Content-Domain")o.contentDomain=m[0]||"";else if(!o.dekInfo&&g.name==="DEK-Info"){if(g.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');o.dekInfo={algorithm:m[0],parameters:m[1]||null}}else o.headers.push(g);else{if(g.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(g.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');o.procType={version:m[0],type:m[1]}}}++c}if(o.procType==="ENCRYPTED"&&!o.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(e.length===0)throw new Error("Invalid PEM formatted message.");return e};function zy(r){for(var e=r.name+": ",t=[],n=u(function(l,c){return" "+c},"insertSpace"),s=0;s<r.values.length;++s)t.push(r.values[s].replace(/^(\S+\r\n)/,n));e+=t.join(",")+`\r
13
+ `;for(var i=0,a=-1,s=0;s<e.length;++s,++i)if(i>65&&a!==-1){var o=e[a];o===","?(++a,e=e.substr(0,a)+`\r
14
+ `+e.substr(a)):e=e.substr(0,a)+`\r
15
+ `+o+e.substr(a+1),i=s-a-1,a=-1,++s}else(e[s]===" "||e[s]===" "||e[s]===",")&&(a=s);return e}u(zy,"foldHeader");function b6(r){return r.replace(/^\s+/,"")}u(b6,"ltrim")});var td=ue((cee,cD)=>{"use strict";var wr=bt();jy();bA();jt();cD.exports=wr.des=wr.des||{};wr.des.startEncrypting=function(r,e,t,n){var s=Yy({key:r,output:t,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};wr.des.createEncryptionCipher=function(r,e){return Yy({key:r,output:null,decrypt:!1,mode:e})};wr.des.startDecrypting=function(r,e,t,n){var s=Yy({key:r,output:t,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};wr.des.createDecryptionCipher=function(r,e){return Yy({key:r,output:null,decrypt:!0,mode:e})};wr.des.Algorithm=function(r,e){var t=this;t.name=r,t.mode=new e({blockSize:8,cipher:{encrypt:u(function(n,s){return lD(t._keys,n,s,!1)},"encrypt"),decrypt:u(function(n,s){return lD(t._keys,n,s,!0)},"decrypt")}}),t._init=!1};wr.des.Algorithm.prototype.initialize=function(r){if(!this._init){var e=wr.util.createBuffer(r.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=P6(e),this._init=!0}};Ei("DES-ECB",wr.cipher.modes.ecb);Ei("DES-CBC",wr.cipher.modes.cbc);Ei("DES-CFB",wr.cipher.modes.cfb);Ei("DES-OFB",wr.cipher.modes.ofb);Ei("DES-CTR",wr.cipher.modes.ctr);Ei("3DES-ECB",wr.cipher.modes.ecb);Ei("3DES-CBC",wr.cipher.modes.cbc);Ei("3DES-CFB",wr.cipher.modes.cfb);Ei("3DES-OFB",wr.cipher.modes.ofb);Ei("3DES-CTR",wr.cipher.modes.ctr);function Ei(r,e){var t=u(function(){return new wr.des.Algorithm(r,e)},"factory");wr.cipher.registerAlgorithm(r,t)}u(Ei,"registerAlgorithm");var N6=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],T6=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],I6=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],D6=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],B6=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],R6=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],O6=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],_6=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function P6(r){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],t=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],s=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],i=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],a=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],o=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=r.length()>8?3:1,y=[],S=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,w,E=0;E<v;E++){var A=r.getInt32(),b=r.getInt32();w=(A>>>4^b)&252645135,b^=w,A^=w<<4,w=(b>>>-16^A)&65535,A^=w,b^=w<<-16,w=(A>>>2^b)&858993459,b^=w,A^=w<<2,w=(b>>>-16^A)&65535,A^=w,b^=w<<-16,w=(A>>>1^b)&1431655765,b^=w,A^=w<<1,w=(b>>>8^A)&16711935,A^=w,b^=w<<8,w=(A>>>1^b)&1431655765,b^=w,A^=w<<1,w=A<<8|b>>>20&240,A=b<<24|b<<8&16711680|b>>>8&65280|b>>>24&240,b=w;for(var V=0;V<S.length;++V){S[V]?(A=A<<2|A>>>26,b=b<<2|b>>>26):(A=A<<1|A>>>27,b=b<<1|b>>>27),A&=-15,b&=-15;var I=e[A>>>28]|t[A>>>24&15]|n[A>>>20&15]|s[A>>>16&15]|i[A>>>12&15]|a[A>>>8&15]|o[A>>>4&15],D=l[b>>>28]|c[b>>>24&15]|f[b>>>20&15]|p[b>>>16&15]|d[b>>>12&15]|g[b>>>8&15]|m[b>>>4&15];w=(D>>>16^I)&65535,y[C++]=I^w,y[C++]=D^w<<16}}return y}u(P6,"_createKeys");function lD(r,e,t,n){var s=r.length===32?3:9,i;s===3?i=n?[30,-2,-2]:[0,32,2]:i=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var a,o=e[0],l=e[1];a=(o>>>4^l)&252645135,l^=a,o^=a<<4,a=(o>>>16^l)&65535,l^=a,o^=a<<16,a=(l>>>2^o)&858993459,o^=a,l^=a<<2,a=(l>>>8^o)&16711935,o^=a,l^=a<<8,a=(o>>>1^l)&1431655765,l^=a,o^=a<<1,o=o<<1|o>>>31,l=l<<1|l>>>31;for(var c=0;c<s;c+=3){for(var f=i[c+1],p=i[c+2],d=i[c];d!=f;d+=p){var g=l^r[d],m=(l>>>4|l<<28)^r[d+1];a=o,o=l,l=a^(T6[g>>>24&63]|D6[g>>>16&63]|R6[g>>>8&63]|_6[g&63]|N6[m>>>24&63]|I6[m>>>16&63]|B6[m>>>8&63]|O6[m&63])}a=o,o=l,l=a}o=o>>>1|o<<31,l=l>>>1|l<<31,a=(o>>>1^l)&1431655765,l^=a,o^=a<<1,a=(l>>>8^o)&16711935,o^=a,l^=a<<8,a=(l>>>2^o)&858993459,o^=a,l^=a<<2,a=(o>>>16^l)&65535,l^=a,o^=a<<16,a=(o>>>4^l)&252645135,l^=a,o^=a<<4,t[0]=o,t[1]=l}u(lD,"_updateBlock");function Yy(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="DES-"+e,n;r.decrypt?n=wr.cipher.createDecipher(t,r.key):n=wr.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var o=null;a instanceof wr.util.ByteBuffer&&(o=a,a={}),a=a||{},a.output=o,a.iv=i,s.call(n,a)},n}u(Yy,"_createCipher")});var Qy=ue((hee,fD)=>{"use strict";var _n=bt();gf();yi();jt();var k6=_n.pkcs5=_n.pkcs5||{},sa;_n.util.isNodejs&&!_n.options.usePureJavaScript&&(sa=st("crypto"));fD.exports=_n.pbkdf2=k6.pbkdf2=function(r,e,t,n,s,i){if(typeof s=="function"&&(i=s,s=null),_n.util.isNodejs&&!_n.options.usePureJavaScript&&sa.pbkdf2&&(s===null||typeof s!="object")&&(sa.pbkdf2Sync.length>4||!s||s==="sha1"))return typeof s!="string"&&(s="sha1"),r=Buffer.from(r,"binary"),e=Buffer.from(e,"binary"),i?sa.pbkdf2Sync.length===4?sa.pbkdf2(r,e,t,n,function(w,E){if(w)return i(w);i(null,E.toString("binary"))}):sa.pbkdf2(r,e,t,n,s,function(w,E){if(w)return i(w);i(null,E.toString("binary"))}):sa.pbkdf2Sync.length===4?sa.pbkdf2Sync(r,e,t,n).toString("binary"):sa.pbkdf2Sync(r,e,t,n,s).toString("binary");if((typeof s>"u"||s===null)&&(s="sha1"),typeof s=="string"){if(!(s in _n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=_n.md[s].create()}var a=s.digestLength;if(n>4294967295*a){var o=new Error("Derived key is too long.");if(i)return i(o);throw o}var l=Math.ceil(n/a),c=n-(l-1)*a,f=_n.hmac.create();f.start(s,r);var p="",d,g,m;if(!i){for(var v=1;v<=l;++v){f.start(null,null),f.update(e),f.update(_n.util.int32ToBytes(v)),d=m=f.digest().getBytes();for(var y=2;y<=t;++y)f.start(null,null),f.update(m),g=f.digest().getBytes(),d=_n.util.xorBytes(d,g,a),m=g;p+=v<l?d:d.substr(0,c)}return p}var v=1,y;function S(){if(v>l)return i(null,p);f.start(null,null),f.update(e),f.update(_n.util.int32ToBytes(v)),d=m=f.digest().getBytes(),y=2,C()}u(S,"outer");function C(){if(y<=t)return f.start(null,null),f.update(m),g=f.digest().getBytes(),d=_n.util.xorBytes(d,g,a),m=g,++y,_n.util.setImmediate(C);p+=v<l?d:d.substr(0,c),++v,S()}u(C,"inner"),S()}});var OA=ue((dee,gD)=>{"use strict";var wi=bt();yi();jt();var pD=gD.exports=wi.sha256=wi.sha256||{};wi.md.sha256=wi.md.algorithms.sha256=pD;pD.create=function(){dD||L6();var r=null,e=wi.util.createBuffer(),t=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=wi.util.createBuffer(),r={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=wi.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),hD(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=wi.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(RA.substr(0,n.blockLength-a));for(var o,l,c=n.fullMessageLength[0]*8,f=0;f<n.fullMessageLength.length-1;++f)o=n.fullMessageLength[f+1]*8,l=o/4294967296>>>0,c+=l,s.putInt32(c>>>0),c=o>>>0;s.putInt32(c);var p={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4,h5:r.h5,h6:r.h6,h7:r.h7};hD(p,t,s);var d=wi.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d.putInt32(p.h5),d.putInt32(p.h6),d.putInt32(p.h7),d},n};var RA=null,dD=!1,mD=null;function L6(){RA="\x80",RA+=wi.util.fillString("\0",64),mD=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],dD=!0}u(L6,"_init");function hD(r,e,t){for(var n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C=t.length();C>=64;){for(c=0;c<16;++c)e[c]=t.getInt32();for(;c<64;++c)n=e[c-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,s=e[c-15],s=(s>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,e[c]=n+e[c-7]+s+e[c-16]|0;for(f=r.h0,p=r.h1,d=r.h2,g=r.h3,m=r.h4,v=r.h5,y=r.h6,S=r.h7,c=0;c<64;++c)a=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),o=y^m&(v^y),i=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),l=f&p|d&(f^p),n=S+a+o+mD[c]+e[c],s=i+l,S=y,y=v,v=m,m=g+n>>>0,g=d,d=p,p=f,f=n+s>>>0;r.h0=r.h0+f|0,r.h1=r.h1+p|0,r.h2=r.h2+d|0,r.h3=r.h3+g|0,r.h4=r.h4+m|0,r.h5=r.h5+v|0,r.h6=r.h6+y|0,r.h7=r.h7+S|0,C-=64}}u(hD,"_update")});var _A=ue((gee,yD)=>{"use strict";var Si=bt();jt();var Zy=null;Si.util.isNodejs&&!Si.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Zy=st("crypto"));var V6=yD.exports=Si.prng=Si.prng||{};V6.create=function(r){for(var e={plugin:r,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},t=r.md,n=new Array(32),s=0;s<32;++s)n[s]=t.create();e.pools=n,e.pool=0,e.generate=function(c,f){if(!f)return e.generateSync(c);var p=e.plugin.cipher,d=e.plugin.increment,g=e.plugin.formatKey,m=e.plugin.formatSeed,v=Si.util.createBuffer();e.key=null,y();function y(S){if(S)return f(S);if(v.length()>=c)return f(null,v.getBytes(c));if(e.generated>1048575&&(e.key=null),e.key===null)return Si.util.nextTick(function(){i(y)});var C=p(e.key,e.seed);e.generated+=C.length,v.putBytes(C),e.key=g(p(e.key,d(e.seed))),e.seed=m(p(e.key,e.seed)),Si.util.setImmediate(y)}u(y,"generate")},e.generateSync=function(c){var f=e.plugin.cipher,p=e.plugin.increment,d=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var m=Si.util.createBuffer();m.length()<c;){e.generated>1048575&&(e.key=null),e.key===null&&a();var v=f(e.key,e.seed);e.generated+=v.length,m.putBytes(v),e.key=d(f(e.key,p(e.seed))),e.seed=g(f(e.key,e.seed))}return m.getBytes(c)};function i(c){if(e.pools[0].messageLength>=32)return o(),c();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(p,d){if(p)return c(p);e.collect(d),o(),c()})}u(i,"_reseed");function a(){if(e.pools[0].messageLength>=32)return o();var c=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(c)),o()}u(a,"_reseedSync");function o(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var c=e.plugin.md.create();c.update(e.keyBytes);for(var f=1,p=0;p<32;++p)e.reseeds%f===0&&(c.update(e.pools[p].digest().getBytes()),e.pools[p].start()),f=f<<1;e.keyBytes=c.digest().getBytes(),c.start(),c.update(e.keyBytes);var d=c.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(d),e.generated=0}u(o,"_seed");function l(c){var f=null,p=Si.util.globalScope,d=p.crypto||p.msCrypto;d&&d.getRandomValues&&(f=u(function(A){return d.getRandomValues(A)},"getRandomValues"));var g=Si.util.createBuffer();if(f)for(;g.length()<c;){var m=Math.max(1,Math.min(c-g.length(),65536)/4),v=new Uint32Array(Math.floor(m));try{f(v);for(var y=0;y<v.length;++y)g.putInt32(v[y])}catch(A){if(!(typeof QuotaExceededError<"u"&&A instanceof QuotaExceededError))throw A}}if(g.length()<c)for(var S,C,w,E=Math.floor(Math.random()*65536);g.length()<c;){C=16807*(E&65535),S=16807*(E>>16),C+=(S&32767)<<16,C+=S>>15,C=(C&2147483647)+(C>>31),E=C&4294967295;for(var y=0;y<3;++y)w=E>>>(y<<3),w^=Math.floor(Math.random()*256),g.putByte(w&255)}return g.getBytes(c)}return u(l,"defaultSeedFile"),Zy?(e.seedFile=function(c,f){Zy.randomBytes(c,function(p,d){if(p)return f(p);f(null,d.toString())})},e.seedFileSync=function(c){return Zy.randomBytes(c).toString()}):(e.seedFile=function(c,f){try{f(null,l(c))}catch(p){f(p)}},e.seedFileSync=l),e.collect=function(c){for(var f=c.length,p=0;p<f;++p)e.pools[e.pool].update(c.substr(p,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(c,f){for(var p="",d=0;d<f;d+=8)p+=String.fromCharCode(c>>d&255);e.collect(p)},e.registerWorker=function(c){if(c===self)e.seedFile=function(p,d){function g(m){var v=m.data;v.forge&&v.forge.prng&&(self.removeEventListener("message",g),d(v.forge.prng.err,v.forge.prng.bytes))}u(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:p}}})};else{var f=u(function(p){var d=p.data;d.forge&&d.forge.prng&&e.seedFile(d.forge.prng.needed,function(g,m){c.postMessage({forge:{prng:{err:g,bytes:m}}})})},"listener");c.addEventListener("message",f)}},e}});var Es=ue((vee,PA)=>{"use strict";var en=bt();oo();OA();_A();jt();(function(){if(en.random&&en.random.getBytes){PA.exports=en.random;return}(function(r){var e={},t=new Array(4),n=en.util.createBuffer();e.formatKey=function(p){var d=en.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),en.aes._expandKey(p,!1)},e.formatSeed=function(p){var d=en.util.createBuffer(p);return p=new Array(4),p[0]=d.getInt32(),p[1]=d.getInt32(),p[2]=d.getInt32(),p[3]=d.getInt32(),p},e.cipher=function(p,d){return en.aes._updateBlock(p,d,t,!1),n.putInt32(t[0]),n.putInt32(t[1]),n.putInt32(t[2]),n.putInt32(t[3]),n.getBytes()},e.increment=function(p){return++p[3],p},e.md=en.md.sha256;function s(){var p=en.prng.create(e);return p.getBytes=function(d,g){return p.generate(d,g)},p.getBytesSync=function(d){return p.generate(d)},p}u(s,"spawnPrng");var i=s(),a=null,o=en.util.globalScope,l=o.crypto||o.msCrypto;if(l&&l.getRandomValues&&(a=u(function(p){return l.getRandomValues(p)},"getRandomValues")),en.options.usePureJavaScript||!en.util.isNodejs&&!a){if(typeof window>"u"||window.document,i.collectInt(+new Date,32),typeof navigator<"u"){var c="";for(var f in navigator)try{typeof navigator[f]=="string"&&(c+=navigator[f])}catch{}i.collect(c),c=null}r&&(r().mousemove(function(p){i.collectInt(p.clientX,16),i.collectInt(p.clientY,16)}),r().keypress(function(p){i.collectInt(p.charCode,8)}))}if(!en.random)en.random=i;else for(var f in i)en.random[f]=i[f];en.random.createInstance=s,PA.exports=en.random})(typeof jQuery<"u"?jQuery:null)})()});var LA=ue((wee,wD)=>{"use strict";var qn=bt();jt();var kA=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],vD=[1,2,3,5],F6=u(function(r,e){return r<<e&65535|(r&65535)>>16-e},"rol"),U6=u(function(r,e){return(r&65535)>>e|r<<16-e&65535},"ror");wD.exports=qn.rc2=qn.rc2||{};qn.rc2.expandKey=function(r,e){typeof r=="string"&&(r=qn.util.createBuffer(r)),e=e||128;var t=r,n=r.length(),s=e,i=Math.ceil(s/8),a=255>>(s&7),o;for(o=n;o<128;o++)t.putByte(kA[t.at(o-1)+t.at(o-n)&255]);for(t.setAt(128-i,kA[t.at(128-i)&a]),o=127-i;o>=0;o--)t.setAt(o,kA[t.at(o+1)^t.at(o+i)]);return t};var ED=u(function(r,e,t){var n=!1,s=null,i=null,a=null,o,l,c,f,p=[];for(r=qn.rc2.expandKey(r,e),c=0;c<64;c++)p.push(r.getInt16Le());t?(o=u(function(m){for(c=0;c<4;c++)m[c]+=p[f]+(m[(c+3)%4]&m[(c+2)%4])+(~m[(c+3)%4]&m[(c+1)%4]),m[c]=F6(m[c],vD[c]),f++},"mixRound"),l=u(function(m){for(c=0;c<4;c++)m[c]+=p[m[(c+3)%4]&63]},"mashRound")):(o=u(function(m){for(c=3;c>=0;c--)m[c]=U6(m[c],vD[c]),m[c]-=p[f]+(m[(c+3)%4]&m[(c+2)%4])+(~m[(c+3)%4]&m[(c+1)%4]),f--},"mixRound"),l=u(function(m){for(c=3;c>=0;c--)m[c]-=p[m[(c+3)%4]&63]},"mashRound"));var d=u(function(m){var v=[];for(c=0;c<4;c++){var y=s.getInt16Le();a!==null&&(t?y^=a.getInt16Le():a.putInt16Le(y)),v.push(y&65535)}f=t?0:63;for(var S=0;S<m.length;S++)for(var C=0;C<m[S][0];C++)m[S][1](v);for(c=0;c<4;c++)a!==null&&(t?a.putInt16Le(v[c]):v[c]^=a.getInt16Le()),i.putInt16Le(v[c])},"runPlan"),g=null;return g={start:u(function(m,v){m&&typeof m=="string"&&(m=qn.util.createBuffer(m)),n=!1,s=qn.util.createBuffer(),i=v||new qn.util.createBuffer,a=m,g.output=i},"start"),update:u(function(m){for(n||s.putBuffer(m);s.length()>=8;)d([[5,o],[1,l],[6,o],[1,l],[5,o]])},"update"),finish:u(function(m){var v=!0;if(t)if(m)v=m(8,s,!t);else{var y=s.length()===8?8:8-s.length();s.fillWithByte(y,y)}if(v&&(n=!0,g.update()),!t&&(v=s.length()===0,v))if(m)v=m(8,i,!t);else{var S=i.length(),C=i.at(S-1);C>S?v=!1:i.truncate(C)}return v},"finish")},g},"createCipher");qn.rc2.startEncrypting=function(r,e,t){var n=qn.rc2.createEncryptionCipher(r,128);return n.start(e,t),n};qn.rc2.createEncryptionCipher=function(r,e){return ED(r,e,!0)};qn.rc2.startDecrypting=function(r,e,t){var n=qn.rc2.createDecryptionCipher(r,128);return n.start(e,t),n};qn.rc2.createDecryptionCipher=function(r,e){return ED(r,e,!1)}});var nd=ue((Aee,ID)=>{"use strict";var VA=bt();ID.exports=VA.jsbn=VA.jsbn||{};var ia,M6=0xdeadbeefcafe,SD=(M6&16777215)==15715070;function Ae(r,e,t){this.data=[],r!=null&&(typeof r=="number"?this.fromNumber(r,e,t):e==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,e))}u(Ae,"BigInteger");VA.jsbn.BigInteger=Ae;function kt(){return new Ae(null)}u(kt,"nbi");function j6(r,e,t,n,s,i){for(;--i>=0;){var a=e*this.data[r++]+t.data[n]+s;s=Math.floor(a/67108864),t.data[n++]=a&67108863}return s}u(j6,"am1");function q6(r,e,t,n,s,i){for(var a=e&32767,o=e>>15;--i>=0;){var l=this.data[r]&32767,c=this.data[r++]>>15,f=o*l+c*a;l=a*l+((f&32767)<<15)+t.data[n]+(s&1073741823),s=(l>>>30)+(f>>>15)+o*c+(s>>>30),t.data[n++]=l&1073741823}return s}u(q6,"am2");function AD(r,e,t,n,s,i){for(var a=e&16383,o=e>>14;--i>=0;){var l=this.data[r]&16383,c=this.data[r++]>>14,f=o*l+c*a;l=a*l+((f&16383)<<14)+t.data[n]+s,s=(l>>28)+(f>>14)+o*c,t.data[n++]=l&268435455}return s}u(AD,"am3");typeof navigator>"u"?(Ae.prototype.am=AD,ia=28):SD&&navigator.appName=="Microsoft Internet Explorer"?(Ae.prototype.am=q6,ia=30):SD&&navigator.appName!="Netscape"?(Ae.prototype.am=j6,ia=26):(Ae.prototype.am=AD,ia=28);Ae.prototype.DB=ia;Ae.prototype.DM=(1<<ia)-1;Ae.prototype.DV=1<<ia;var FA=52;Ae.prototype.FV=Math.pow(2,FA);Ae.prototype.F1=FA-ia;Ae.prototype.F2=2*ia-FA;var H6="0123456789abcdefghijklmnopqrstuvwxyz",ev=new Array,vf,ws;vf=48;for(ws=0;ws<=9;++ws)ev[vf++]=ws;vf=97;for(ws=10;ws<36;++ws)ev[vf++]=ws;vf=65;for(ws=10;ws<36;++ws)ev[vf++]=ws;function CD(r){return H6.charAt(r)}u(CD,"int2char");function xD(r,e){var t=ev[r.charCodeAt(e)];return t??-1}u(xD,"intAt");function K6(r){for(var e=this.t-1;e>=0;--e)r.data[e]=this.data[e];r.t=this.t,r.s=this.s}u(K6,"bnpCopyTo");function X6(r){this.t=1,this.s=r<0?-1:0,r>0?this.data[0]=r:r<-1?this.data[0]=r+this.DV:this.t=0}u(X6,"bnpFromInt");function lo(r){var e=kt();return e.fromInt(r),e}u(lo,"nbv");function G6(r,e){var t;if(e==16)t=4;else if(e==8)t=3;else if(e==256)t=8;else if(e==2)t=1;else if(e==32)t=5;else if(e==4)t=2;else{this.fromRadix(r,e);return}this.t=0,this.s=0;for(var n=r.length,s=!1,i=0;--n>=0;){var a=t==8?r[n]&255:xD(r,n);if(a<0){r.charAt(n)=="-"&&(s=!0);continue}s=!1,i==0?this.data[this.t++]=a:i+t>this.DB?(this.data[this.t-1]|=(a&(1<<this.DB-i)-1)<<i,this.data[this.t++]=a>>this.DB-i):this.data[this.t-1]|=a<<i,i+=t,i>=this.DB&&(i-=this.DB)}t==8&&(r[0]&128)!=0&&(this.s=-1,i>0&&(this.data[this.t-1]|=(1<<this.DB-i)-1<<i)),this.clamp(),s&&Ae.ZERO.subTo(this,this)}u(G6,"bnpFromString");function $6(){for(var r=this.s&this.DM;this.t>0&&this.data[this.t-1]==r;)--this.t}u($6,"bnpClamp");function W6(r){if(this.s<0)return"-"+this.negate().toString(r);var e;if(r==16)e=4;else if(r==8)e=3;else if(r==2)e=1;else if(r==32)e=5;else if(r==4)e=2;else return this.toRadix(r);var t=(1<<e)-1,n,s=!1,i="",a=this.t,o=this.DB-a*this.DB%e;if(a-- >0)for(o<this.DB&&(n=this.data[a]>>o)>0&&(s=!0,i=CD(n));a>=0;)o<e?(n=(this.data[a]&(1<<o)-1)<<e-o,n|=this.data[--a]>>(o+=this.DB-e)):(n=this.data[a]>>(o-=e)&t,o<=0&&(o+=this.DB,--a)),n>0&&(s=!0),s&&(i+=CD(n));return s?i:"0"}u(W6,"bnToString");function z6(){var r=kt();return Ae.ZERO.subTo(this,r),r}u(z6,"bnNegate");function J6(){return this.s<0?this.negate():this}u(J6,"bnAbs");function Y6(r){var e=this.s-r.s;if(e!=0)return e;var t=this.t;if(e=t-r.t,e!=0)return this.s<0?-e:e;for(;--t>=0;)if((e=this.data[t]-r.data[t])!=0)return e;return 0}u(Y6,"bnCompareTo");function tv(r){var e=1,t;return(t=r>>>16)!=0&&(r=t,e+=16),(t=r>>8)!=0&&(r=t,e+=8),(t=r>>4)!=0&&(r=t,e+=4),(t=r>>2)!=0&&(r=t,e+=2),(t=r>>1)!=0&&(r=t,e+=1),e}u(tv,"nbits");function Q6(){return this.t<=0?0:this.DB*(this.t-1)+tv(this.data[this.t-1]^this.s&this.DM)}u(Q6,"bnBitLength");function Z6(r,e){var t;for(t=this.t-1;t>=0;--t)e.data[t+r]=this.data[t];for(t=r-1;t>=0;--t)e.data[t]=0;e.t=this.t+r,e.s=this.s}u(Z6,"bnpDLShiftTo");function eF(r,e){for(var t=r;t<this.t;++t)e.data[t-r]=this.data[t];e.t=Math.max(this.t-r,0),e.s=this.s}u(eF,"bnpDRShiftTo");function tF(r,e){var t=r%this.DB,n=this.DB-t,s=(1<<n)-1,i=Math.floor(r/this.DB),a=this.s<<t&this.DM,o;for(o=this.t-1;o>=0;--o)e.data[o+i+1]=this.data[o]>>n|a,a=(this.data[o]&s)<<t;for(o=i-1;o>=0;--o)e.data[o]=0;e.data[i]=a,e.t=this.t+i+1,e.s=this.s,e.clamp()}u(tF,"bnpLShiftTo");function rF(r,e){e.s=this.s;var t=Math.floor(r/this.DB);if(t>=this.t){e.t=0;return}var n=r%this.DB,s=this.DB-n,i=(1<<n)-1;e.data[0]=this.data[t]>>n;for(var a=t+1;a<this.t;++a)e.data[a-t-1]|=(this.data[a]&i)<<s,e.data[a-t]=this.data[a]>>n;n>0&&(e.data[this.t-t-1]|=(this.s&i)<<s),e.t=this.t-t,e.clamp()}u(rF,"bnpRShiftTo");function nF(r,e){for(var t=0,n=0,s=Math.min(r.t,this.t);t<s;)n+=this.data[t]-r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n-=r.s;t<this.t;)n+=this.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;t<r.t;)n-=r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n-=r.s}e.s=n<0?-1:0,n<-1?e.data[t++]=this.DV+n:n>0&&(e.data[t++]=n),e.t=t,e.clamp()}u(nF,"bnpSubTo");function sF(r,e){var t=this.abs(),n=r.abs(),s=t.t;for(e.t=s+n.t;--s>=0;)e.data[s]=0;for(s=0;s<n.t;++s)e.data[s+t.t]=t.am(0,n.data[s],e,s,0,t.t);e.s=0,e.clamp(),this.s!=r.s&&Ae.ZERO.subTo(e,e)}u(sF,"bnpMultiplyTo");function iF(r){for(var e=this.abs(),t=r.t=2*e.t;--t>=0;)r.data[t]=0;for(t=0;t<e.t-1;++t){var n=e.am(t,e.data[t],r,2*t,0,1);(r.data[t+e.t]+=e.am(t+1,2*e.data[t],r,2*t+1,n,e.t-t-1))>=e.DV&&(r.data[t+e.t]-=e.DV,r.data[t+e.t+1]=1)}r.t>0&&(r.data[r.t-1]+=e.am(t,e.data[t],r,2*t,0,1)),r.s=0,r.clamp()}u(iF,"bnpSquareTo");function aF(r,e,t){var n=r.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),t!=null&&this.copyTo(t);return}t==null&&(t=kt());var i=kt(),a=this.s,o=r.s,l=this.DB-tv(n.data[n.t-1]);l>0?(n.lShiftTo(l,i),s.lShiftTo(l,t)):(n.copyTo(i),s.copyTo(t));var c=i.t,f=i.data[c-1];if(f!=0){var p=f*(1<<this.F1)+(c>1?i.data[c-2]>>this.F2:0),d=this.FV/p,g=(1<<this.F1)/p,m=1<<this.F2,v=t.t,y=v-c,S=e??kt();for(i.dlShiftTo(y,S),t.compareTo(S)>=0&&(t.data[t.t++]=1,t.subTo(S,t)),Ae.ONE.dlShiftTo(c,S),S.subTo(i,i);i.t<c;)i.data[i.t++]=0;for(;--y>=0;){var C=t.data[--v]==f?this.DM:Math.floor(t.data[v]*d+(t.data[v-1]+m)*g);if((t.data[v]+=i.am(0,C,t,y,0,c))<C)for(i.dlShiftTo(y,S),t.subTo(S,t);t.data[v]<--C;)t.subTo(S,t)}e!=null&&(t.drShiftTo(c,e),a!=o&&Ae.ZERO.subTo(e,e)),t.t=c,t.clamp(),l>0&&t.rShiftTo(l,t),a<0&&Ae.ZERO.subTo(t,t)}}}u(aF,"bnpDivRemTo");function oF(r){var e=kt();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(Ae.ZERO)>0&&r.subTo(e,e),e}u(oF,"bnMod");function Ju(r){this.m=r}u(Ju,"Classic");function uF(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}u(uF,"cConvert");function lF(r){return r}u(lF,"cRevert");function cF(r){r.divRemTo(this.m,null,r)}u(cF,"cReduce");function fF(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(fF,"cMulTo");function hF(r,e){r.squareTo(e),this.reduce(e)}u(hF,"cSqrTo");Ju.prototype.convert=uF;Ju.prototype.revert=lF;Ju.prototype.reduce=cF;Ju.prototype.mulTo=fF;Ju.prototype.sqrTo=hF;function pF(){if(this.t<1)return 0;var r=this.data[0];if((r&1)==0)return 0;var e=r&3;return e=e*(2-(r&15)*e)&15,e=e*(2-(r&255)*e)&255,e=e*(2-((r&65535)*e&65535))&65535,e=e*(2-r*e%this.DV)%this.DV,e>0?this.DV-e:-e}u(pF,"bnpInvDigit");function Yu(r){this.m=r,this.mp=r.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}u(Yu,"Montgomery");function dF(r){var e=kt();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(Ae.ZERO)>0&&this.m.subTo(e,e),e}u(dF,"montConvert");function mF(r){var e=kt();return r.copyTo(e),this.reduce(e),e}u(mF,"montRevert");function gF(r){for(;r.t<=this.mt2;)r.data[r.t++]=0;for(var e=0;e<this.m.t;++e){var t=r.data[e]&32767,n=t*this.mpl+((t*this.mph+(r.data[e]>>15)*this.mpl&this.um)<<15)&r.DM;for(t=e+this.m.t,r.data[t]+=this.m.am(0,n,r,e,0,this.m.t);r.data[t]>=r.DV;)r.data[t]-=r.DV,r.data[++t]++}r.clamp(),r.drShiftTo(this.m.t,r),r.compareTo(this.m)>=0&&r.subTo(this.m,r)}u(gF,"montReduce");function yF(r,e){r.squareTo(e),this.reduce(e)}u(yF,"montSqrTo");function vF(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(vF,"montMulTo");Yu.prototype.convert=dF;Yu.prototype.revert=mF;Yu.prototype.reduce=gF;Yu.prototype.mulTo=vF;Yu.prototype.sqrTo=yF;function EF(){return(this.t>0?this.data[0]&1:this.s)==0}u(EF,"bnpIsEven");function wF(r,e){if(r>4294967295||r<1)return Ae.ONE;var t=kt(),n=kt(),s=e.convert(this),i=tv(r)-1;for(s.copyTo(t);--i>=0;)if(e.sqrTo(t,n),(r&1<<i)>0)e.mulTo(n,s,t);else{var a=t;t=n,n=a}return e.revert(t)}u(wF,"bnpExp");function SF(r,e){var t;return r<256||e.isEven()?t=new Ju(e):t=new Yu(e),this.exp(r,t)}u(SF,"bnModPowInt");Ae.prototype.copyTo=K6;Ae.prototype.fromInt=X6;Ae.prototype.fromString=G6;Ae.prototype.clamp=$6;Ae.prototype.dlShiftTo=Z6;Ae.prototype.drShiftTo=eF;Ae.prototype.lShiftTo=tF;Ae.prototype.rShiftTo=rF;Ae.prototype.subTo=nF;Ae.prototype.multiplyTo=sF;Ae.prototype.squareTo=iF;Ae.prototype.divRemTo=aF;Ae.prototype.invDigit=pF;Ae.prototype.isEven=EF;Ae.prototype.exp=wF;Ae.prototype.toString=W6;Ae.prototype.negate=z6;Ae.prototype.abs=J6;Ae.prototype.compareTo=Y6;Ae.prototype.bitLength=Q6;Ae.prototype.mod=oF;Ae.prototype.modPowInt=SF;Ae.ZERO=lo(0);Ae.ONE=lo(1);function AF(){var r=kt();return this.copyTo(r),r}u(AF,"bnClone");function CF(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]}u(CF,"bnIntValue");function xF(){return this.t==0?this.s:this.data[0]<<24>>24}u(xF,"bnByteValue");function bF(){return this.t==0?this.s:this.data[0]<<16>>16}u(bF,"bnShortValue");function NF(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}u(NF,"bnpChunkSize");function TF(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}u(TF,"bnSigNum");function IF(r){if(r==null&&(r=10),this.signum()==0||r<2||r>36)return"0";var e=this.chunkSize(r),t=Math.pow(r,e),n=lo(t),s=kt(),i=kt(),a="";for(this.divRemTo(n,s,i);s.signum()>0;)a=(t+i.intValue()).toString(r).substr(1)+a,s.divRemTo(n,s,i);return i.intValue().toString(r)+a}u(IF,"bnpToRadix");function DF(r,e){this.fromInt(0),e==null&&(e=10);for(var t=this.chunkSize(e),n=Math.pow(e,t),s=!1,i=0,a=0,o=0;o<r.length;++o){var l=xD(r,o);if(l<0){r.charAt(o)=="-"&&this.signum()==0&&(s=!0);continue}a=e*a+l,++i>=t&&(this.dMultiply(n),this.dAddOffset(a,0),i=0,a=0)}i>0&&(this.dMultiply(Math.pow(e,i)),this.dAddOffset(a,0)),s&&Ae.ZERO.subTo(this,this)}u(DF,"bnpFromRadix");function BF(r,e,t){if(typeof e=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,t),this.testBit(r-1)||this.bitwiseTo(Ae.ONE.shiftLeft(r-1),UA,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(Ae.ONE.shiftLeft(r-1),this);else{var n=new Array,s=r&7;n.length=(r>>3)+1,e.nextBytes(n),s>0?n[0]&=(1<<s)-1:n[0]=0,this.fromString(n,256)}}u(BF,"bnpFromNumber");function RF(){var r=this.t,e=new Array;e[0]=this.s;var t=this.DB-r*this.DB%8,n,s=0;if(r-- >0)for(t<this.DB&&(n=this.data[r]>>t)!=(this.s&this.DM)>>t&&(e[s++]=n|this.s<<this.DB-t);r>=0;)t<8?(n=(this.data[r]&(1<<t)-1)<<8-t,n|=this.data[--r]>>(t+=this.DB-8)):(n=this.data[r]>>(t-=8)&255,t<=0&&(t+=this.DB,--r)),(n&128)!=0&&(n|=-256),s==0&&(this.s&128)!=(n&128)&&++s,(s>0||n!=this.s)&&(e[s++]=n);return e}u(RF,"bnToByteArray");function OF(r){return this.compareTo(r)==0}u(OF,"bnEquals");function _F(r){return this.compareTo(r)<0?this:r}u(_F,"bnMin");function PF(r){return this.compareTo(r)>0?this:r}u(PF,"bnMax");function kF(r,e,t){var n,s,i=Math.min(r.t,this.t);for(n=0;n<i;++n)t.data[n]=e(this.data[n],r.data[n]);if(r.t<this.t){for(s=r.s&this.DM,n=i;n<this.t;++n)t.data[n]=e(this.data[n],s);t.t=this.t}else{for(s=this.s&this.DM,n=i;n<r.t;++n)t.data[n]=e(s,r.data[n]);t.t=r.t}t.s=e(this.s,r.s),t.clamp()}u(kF,"bnpBitwiseTo");function LF(r,e){return r&e}u(LF,"op_and");function VF(r){var e=kt();return this.bitwiseTo(r,LF,e),e}u(VF,"bnAnd");function UA(r,e){return r|e}u(UA,"op_or");function FF(r){var e=kt();return this.bitwiseTo(r,UA,e),e}u(FF,"bnOr");function bD(r,e){return r^e}u(bD,"op_xor");function UF(r){var e=kt();return this.bitwiseTo(r,bD,e),e}u(UF,"bnXor");function ND(r,e){return r&~e}u(ND,"op_andnot");function MF(r){var e=kt();return this.bitwiseTo(r,ND,e),e}u(MF,"bnAndNot");function jF(){for(var r=kt(),e=0;e<this.t;++e)r.data[e]=this.DM&~this.data[e];return r.t=this.t,r.s=~this.s,r}u(jF,"bnNot");function qF(r){var e=kt();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}u(qF,"bnShiftLeft");function HF(r){var e=kt();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}u(HF,"bnShiftRight");function KF(r){if(r==0)return-1;var e=0;return(r&65535)==0&&(r>>=16,e+=16),(r&255)==0&&(r>>=8,e+=8),(r&15)==0&&(r>>=4,e+=4),(r&3)==0&&(r>>=2,e+=2),(r&1)==0&&++e,e}u(KF,"lbit");function XF(){for(var r=0;r<this.t;++r)if(this.data[r]!=0)return r*this.DB+KF(this.data[r]);return this.s<0?this.t*this.DB:-1}u(XF,"bnGetLowestSetBit");function GF(r){for(var e=0;r!=0;)r&=r-1,++e;return e}u(GF,"cbit");function $F(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=GF(this.data[t]^e);return r}u($F,"bnBitCount");function WF(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<r%this.DB)!=0}u(WF,"bnTestBit");function zF(r,e){var t=Ae.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}u(zF,"bnpChangeBit");function JF(r){return this.changeBit(r,UA)}u(JF,"bnSetBit");function YF(r){return this.changeBit(r,ND)}u(YF,"bnClearBit");function QF(r){return this.changeBit(r,bD)}u(QF,"bnFlipBit");function ZF(r,e){for(var t=0,n=0,s=Math.min(r.t,this.t);t<s;)n+=this.data[t]+r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;if(r.t<this.t){for(n+=r.s;t<this.t;)n+=this.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;t<r.t;)n+=r.data[t],e.data[t++]=n&this.DM,n>>=this.DB;n+=r.s}e.s=n<0?-1:0,n>0?e.data[t++]=n:n<-1&&(e.data[t++]=this.DV+n),e.t=t,e.clamp()}u(ZF,"bnpAddTo");function eU(r){var e=kt();return this.addTo(r,e),e}u(eU,"bnAdd");function tU(r){var e=kt();return this.subTo(r,e),e}u(tU,"bnSubtract");function rU(r){var e=kt();return this.multiplyTo(r,e),e}u(rU,"bnMultiply");function nU(){var r=kt();return this.squareTo(r),r}u(nU,"bnSquare");function sU(r){var e=kt();return this.divRemTo(r,e,null),e}u(sU,"bnDivide");function iU(r){var e=kt();return this.divRemTo(r,null,e),e}u(iU,"bnRemainder");function aU(r){var e=kt(),t=kt();return this.divRemTo(r,e,t),new Array(e,t)}u(aU,"bnDivideAndRemainder");function oU(r){this.data[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}u(oU,"bnpDMultiply");function uU(r,e){if(r!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=r;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}u(uU,"bnpDAddOffset");function rd(){}u(rd,"NullExp");function TD(r){return r}u(TD,"nNop");function lU(r,e,t){r.multiplyTo(e,t)}u(lU,"nMulTo");function cU(r,e){r.squareTo(e)}u(cU,"nSqrTo");rd.prototype.convert=TD;rd.prototype.revert=TD;rd.prototype.mulTo=lU;rd.prototype.sqrTo=cU;function fU(r){return this.exp(r,new rd)}u(fU,"bnPow");function hU(r,e,t){var n=Math.min(this.t+r.t,e);for(t.s=0,t.t=n;n>0;)t.data[--n]=0;var s;for(s=t.t-this.t;n<s;++n)t.data[n+this.t]=this.am(0,r.data[n],t,n,0,this.t);for(s=Math.min(r.t,e);n<s;++n)this.am(0,r.data[n],t,n,0,e-n);t.clamp()}u(hU,"bnpMultiplyLowerTo");function pU(r,e,t){--e;var n=t.t=this.t+r.t-e;for(t.s=0;--n>=0;)t.data[n]=0;for(n=Math.max(e-this.t,0);n<r.t;++n)t.data[this.t+n-e]=this.am(e-n,r.data[n],t,0,0,this.t+n-e);t.clamp(),t.drShiftTo(1,t)}u(pU,"bnpMultiplyUpperTo");function Ef(r){this.r2=kt(),this.q3=kt(),Ae.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}u(Ef,"Barrett");function dU(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var e=kt();return r.copyTo(e),this.reduce(e),e}u(dU,"barrettConvert");function mU(r){return r}u(mU,"barrettRevert");function gU(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);r.compareTo(this.m)>=0;)r.subTo(this.m,r)}u(gU,"barrettReduce");function yU(r,e){r.squareTo(e),this.reduce(e)}u(yU,"barrettSqrTo");function vU(r,e,t){r.multiplyTo(e,t),this.reduce(t)}u(vU,"barrettMulTo");Ef.prototype.convert=dU;Ef.prototype.revert=mU;Ef.prototype.reduce=gU;Ef.prototype.mulTo=vU;Ef.prototype.sqrTo=yU;function EU(r,e){var t=r.bitLength(),n,s=lo(1),i;if(t<=0)return s;t<18?n=1:t<48?n=3:t<144?n=4:t<768?n=5:n=6,t<8?i=new Ju(e):e.isEven()?i=new Ef(e):i=new Yu(e);var a=new Array,o=3,l=n-1,c=(1<<n)-1;if(a[1]=i.convert(this),n>1){var f=kt();for(i.sqrTo(a[1],f);o<=c;)a[o]=kt(),i.mulTo(f,a[o-2],a[o]),o+=2}var p=r.t-1,d,g=!0,m=kt(),v;for(t=tv(r.data[p])-1;p>=0;){for(t>=l?d=r.data[p]>>t-l&c:(d=(r.data[p]&(1<<t+1)-1)<<l-t,p>0&&(d|=r.data[p-1]>>this.DB+t-l)),o=n;(d&1)==0;)d>>=1,--o;if((t-=o)<0&&(t+=this.DB,--p),g)a[d].copyTo(s),g=!1;else{for(;o>1;)i.sqrTo(s,m),i.sqrTo(m,s),o-=2;o>0?i.sqrTo(s,m):(v=s,s=m,m=v),i.mulTo(m,a[d],s)}for(;p>=0&&(r.data[p]&1<<t)==0;)i.sqrTo(s,m),v=s,s=m,m=v,--t<0&&(t=this.DB-1,--p)}return i.revert(s)}u(EU,"bnModPow");function wU(r){var e=this.s<0?this.negate():this.clone(),t=r.s<0?r.negate():r.clone();if(e.compareTo(t)<0){var n=e;e=t,t=n}var s=e.getLowestSetBit(),i=t.getLowestSetBit();if(i<0)return e;for(s<i&&(i=s),i>0&&(e.rShiftTo(i,e),t.rShiftTo(i,t));e.signum()>0;)(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),(s=t.getLowestSetBit())>0&&t.rShiftTo(s,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return i>0&&t.lShiftTo(i,t),t}u(wU,"bnGCD");function SU(r){if(r<=0)return 0;var e=this.DV%r,t=this.s<0?r-1:0;if(this.t>0)if(e==0)t=this.data[0]%r;else for(var n=this.t-1;n>=0;--n)t=(e*t+this.data[n])%r;return t}u(SU,"bnpModInt");function AU(r){if(this.signum()==0)return Ae.ZERO;var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return Ae.ZERO;for(var t=r.clone(),n=this.clone(),s=lo(1),i=lo(0),a=lo(0),o=lo(1);t.signum()!=0;){for(;t.isEven();)t.rShiftTo(1,t),e?((!s.isEven()||!i.isEven())&&(s.addTo(this,s),i.subTo(r,i)),s.rShiftTo(1,s)):i.isEven()||i.subTo(r,i),i.rShiftTo(1,i);for(;n.isEven();)n.rShiftTo(1,n),e?((!a.isEven()||!o.isEven())&&(a.addTo(this,a),o.subTo(r,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(r,o),o.rShiftTo(1,o);t.compareTo(n)>=0?(t.subTo(n,t),e&&s.subTo(a,s),i.subTo(o,i)):(n.subTo(t,n),e&&a.subTo(s,a),o.subTo(i,o))}if(n.compareTo(Ae.ONE)!=0)return Ae.ZERO;if(o.compareTo(r)>=0)return o.subtract(r);if(o.signum()<0)o.addTo(r,o);else return o;return o.signum()<0?o.add(r):o}u(AU,"bnModInverse");var Ys=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],CU=(1<<26)/Ys[Ys.length-1];function xU(r){var e,t=this.abs();if(t.t==1&&t.data[0]<=Ys[Ys.length-1]){for(e=0;e<Ys.length;++e)if(t.data[0]==Ys[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<Ys.length;){for(var n=Ys[e],s=e+1;s<Ys.length&&n<CU;)n*=Ys[s++];for(n=t.modInt(n);e<s;)if(n%Ys[e++]==0)return!1}return t.millerRabin(r)}u(xU,"bnIsProbablePrime");function bU(r){var e=this.subtract(Ae.ONE),t=e.getLowestSetBit();if(t<=0)return!1;for(var n=e.shiftRight(t),s=NU(),i,a=0;a<r;++a){do i=new Ae(this.bitLength(),s);while(i.compareTo(Ae.ONE)<=0||i.compareTo(e)>=0);var o=i.modPow(n,this);if(o.compareTo(Ae.ONE)!=0&&o.compareTo(e)!=0){for(var l=1;l++<t&&o.compareTo(e)!=0;)if(o=o.modPowInt(2,this),o.compareTo(Ae.ONE)==0)return!1;if(o.compareTo(e)!=0)return!1}}return!0}u(bU,"bnpMillerRabin");function NU(){return{nextBytes:u(function(r){for(var e=0;e<r.length;++e)r[e]=Math.floor(Math.random()*256)},"nextBytes")}}u(NU,"bnGetPrng");Ae.prototype.chunkSize=NF;Ae.prototype.toRadix=IF;Ae.prototype.fromRadix=DF;Ae.prototype.fromNumber=BF;Ae.prototype.bitwiseTo=kF;Ae.prototype.changeBit=zF;Ae.prototype.addTo=ZF;Ae.prototype.dMultiply=oU;Ae.prototype.dAddOffset=uU;Ae.prototype.multiplyLowerTo=hU;Ae.prototype.multiplyUpperTo=pU;Ae.prototype.modInt=SU;Ae.prototype.millerRabin=bU;Ae.prototype.clone=AF;Ae.prototype.intValue=CF;Ae.prototype.byteValue=xF;Ae.prototype.shortValue=bF;Ae.prototype.signum=TF;Ae.prototype.toByteArray=RF;Ae.prototype.equals=OF;Ae.prototype.min=_F;Ae.prototype.max=PF;Ae.prototype.and=VF;Ae.prototype.or=FF;Ae.prototype.xor=UF;Ae.prototype.andNot=MF;Ae.prototype.not=jF;Ae.prototype.shiftLeft=qF;Ae.prototype.shiftRight=HF;Ae.prototype.getLowestSetBit=XF;Ae.prototype.bitCount=$F;Ae.prototype.testBit=WF;Ae.prototype.setBit=JF;Ae.prototype.clearBit=YF;Ae.prototype.flipBit=QF;Ae.prototype.add=eU;Ae.prototype.subtract=tU;Ae.prototype.multiply=rU;Ae.prototype.divide=sU;Ae.prototype.remainder=iU;Ae.prototype.divideAndRemainder=aU;Ae.prototype.modPow=EU;Ae.prototype.modInverse=AU;Ae.prototype.pow=fU;Ae.prototype.gcd=wU;Ae.prototype.isProbablePrime=xU;Ae.prototype.square=nU});var wf=ue((xee,OD)=>{"use strict";var Ai=bt();yi();jt();var BD=OD.exports=Ai.sha1=Ai.sha1||{};Ai.md.sha1=Ai.md.algorithms.sha1=BD;BD.create=function(){RD||TU();var r=null,e=Ai.util.createBuffer(),t=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var s=n.messageLengthSize/4,i=0;i<s;++i)n.fullMessageLength.push(0);return e=Ai.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=Ai.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=n.fullMessageLength.length-1;o>=0;--o)n.fullMessageLength[o]+=a[1],a[1]=a[0]+(n.fullMessageLength[o]/4294967296>>>0),n.fullMessageLength[o]=n.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),DD(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=Ai.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(MA.substr(0,n.blockLength-a));for(var o,l,c=n.fullMessageLength[0]*8,f=0;f<n.fullMessageLength.length-1;++f)o=n.fullMessageLength[f+1]*8,l=o/4294967296>>>0,c+=l,s.putInt32(c>>>0),c=o>>>0;s.putInt32(c);var p={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4};DD(p,t,s);var d=Ai.util.createBuffer();return d.putInt32(p.h0),d.putInt32(p.h1),d.putInt32(p.h2),d.putInt32(p.h3),d.putInt32(p.h4),d},n};var MA=null,RD=!1;function TU(){MA="\x80",MA+=Ai.util.fillString("\0",64),RD=!0}u(TU,"_init");function DD(r,e,t){for(var n,s,i,a,o,l,c,f,p=t.length();p>=64;){for(s=r.h0,i=r.h1,a=r.h2,o=r.h3,l=r.h4,f=0;f<16;++f)n=t.getInt32(),e[f]=n,c=o^i&(a^o),n=(s<<5|s>>>27)+c+l+1518500249+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,c=o^i&(a^o),n=(s<<5|s>>>27)+c+l+1518500249+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+1859775393+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+1859775393+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i&a|o&(i^a),n=(s<<5|s>>>27)+c+l+2400959708+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,c=i^a^o,n=(s<<5|s>>>27)+c+l+3395469782+n,l=o,o=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;r.h0=r.h0+s|0,r.h1=r.h1+i|0,r.h2=r.h2+a|0,r.h3=r.h3+o|0,r.h4=r.h4+l|0,p-=64}}u(DD,"_update")});var jA=ue((Nee,PD)=>{"use strict";var Ci=bt();jt();Es();wf();var _D=PD.exports=Ci.pkcs1=Ci.pkcs1||{};_D.encode_rsa_oaep=function(r,e,t){var n,s,i,a;typeof t=="string"?(n=t,s=arguments[3]||void 0,i=arguments[4]||void 0):t&&(n=t.label||void 0,s=t.seed||void 0,i=t.md||void 0,t.mgf1&&t.mgf1.md&&(a=t.mgf1.md)),i?i.start():i=Ci.md.sha1.create(),a||(a=i);var o=Math.ceil(r.n.bitLength()/8),l=o-2*i.digestLength-2;if(e.length>l){var c=new Error("RSAES-OAEP input message length is too long.");throw c.length=e.length,c.maxLength=l,c}n||(n=""),i.update(n,"raw");for(var f=i.digest(),p="",d=l-e.length,g=0;g<d;g++)p+="\0";var m=f.getBytes()+p+""+e;if(!s)s=Ci.random.getBytes(i.digestLength);else if(s.length!==i.digestLength){var c=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw c.seedLength=s.length,c.digestLength=i.digestLength,c}var v=rv(s,o-i.digestLength-1,a),y=Ci.util.xorBytes(m,v,m.length),S=rv(y,i.digestLength,a),C=Ci.util.xorBytes(s,S,s.length);return"\0"+C+y};_D.decode_rsa_oaep=function(r,e,t){var n,s,i;typeof t=="string"?(n=t,s=arguments[3]||void 0):t&&(n=t.label||void 0,s=t.md||void 0,t.mgf1&&t.mgf1.md&&(i=t.mgf1.md));var a=Math.ceil(r.n.bitLength()/8);if(e.length!==a){var y=new Error("RSAES-OAEP encoded message length is invalid.");throw y.length=e.length,y.expectedLength=a,y}if(s===void 0?s=Ci.md.sha1.create():s.start(),i||(i=s),a<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");n||(n=""),s.update(n,"raw");for(var o=s.digest().getBytes(),l=e.charAt(0),c=e.substring(1,s.digestLength+1),f=e.substring(1+s.digestLength),p=rv(f,s.digestLength,i),d=Ci.util.xorBytes(c,p,c.length),g=rv(d,a-s.digestLength-1,i),m=Ci.util.xorBytes(f,g,f.length),v=m.substring(0,s.digestLength),y=l!=="\0",S=0;S<s.digestLength;++S)y|=o.charAt(S)!==v.charAt(S);for(var C=1,w=s.digestLength,E=s.digestLength;E<m.length;E++){var A=m.charCodeAt(E),b=A&1^1,V=C?65534:0;y|=A&V,C=C&b,w+=C}if(y||m.charCodeAt(w)!==1)throw new Error("Invalid RSAES-OAEP padding.");return m.substring(w+1)};function rv(r,e,t){t||(t=Ci.md.sha1.create());for(var n="",s=Math.ceil(e/t.digestLength),i=0;i<s;++i){var a=String.fromCharCode(i>>24&255,i>>16&255,i>>8&255,i&255);t.start(),t.update(r+a),n+=t.digest().getBytes()}return n.substring(0,e)}u(rv,"rsa_mgf1")});var HA=ue((Iee,qA)=>{"use strict";var co=bt();jt();nd();Es();(function(){if(co.prime){qA.exports=co.prime;return}var r=qA.exports=co.prime=co.prime||{},e=co.jsbn.BigInteger,t=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var s=u(function(p,d){return p|d},"op_or");r.generateProbablePrime=function(p,d,g){typeof d=="function"&&(g=d,d={}),d=d||{};var m=d.algorithm||"PRIMEINC";typeof m=="string"&&(m={name:m}),m.options=m.options||{};var v=d.prng||co.random,y={nextBytes:u(function(S){for(var C=v.getBytesSync(S.length),w=0;w<S.length;++w)S[w]=C.charCodeAt(w)},"nextBytes")};if(m.name==="PRIMEINC")return i(p,y,m.options,g);throw new Error("Invalid prime generation algorithm: "+m.name)};function i(p,d,g,m){return"workers"in g?l(p,d,g,m):a(p,d,g,m)}u(i,"primeincFindPrime");function a(p,d,g,m){var v=c(p,d),y=0,S=f(v.bitLength());"millerRabinTests"in g&&(S=g.millerRabinTests);var C=10;"maxBlockTime"in g&&(C=g.maxBlockTime),o(v,p,d,y,S,C,m)}u(a,"primeincFindPrimeWithoutWorkers");function o(p,d,g,m,v,y,S){var C=+new Date;do{if(p.bitLength()>d&&(p=c(d,g)),p.isProbablePrime(v))return S(null,p);p.dAddOffset(t[m++%8],0)}while(y<0||+new Date-C<y);co.util.setImmediate(function(){o(p,d,g,m,v,y,S)})}u(o,"_primeinc");function l(p,d,g,m){if(typeof Worker>"u")return a(p,d,g,m);var v=c(p,d),y=g.workers,S=g.workLoad||100,C=S*30/8,w=g.workerScript||"forge/prime.worker.js";if(y===-1)return co.util.estimateCores(function(A,b){A&&(b=2),y=b-1,E()});E();function E(){y=Math.max(1,y);for(var A=[],b=0;b<y;++b)A[b]=new Worker(w);for(var V=y,b=0;b<y;++b)A[b].addEventListener("message",D);var I=!1;function D(U){if(!I){--V;var F=U.data;if(F.found){for(var M=0;M<A.length;++M)A[M].terminate();return I=!0,m(null,new e(F.prime,16))}v.bitLength()>p&&(v=c(p,d));var se=v.toString(16);U.target.postMessage({hex:se,workLoad:S}),v.dAddOffset(C,0)}}u(D,"workerMessage")}u(E,"generate")}u(l,"primeincFindPrimeWithWorkers");function c(p,d){var g=new e(p,d),m=p-1;return g.testBit(m)||g.bitwiseTo(e.ONE.shiftLeft(m),s,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}u(c,"generateRandom");function f(p){return p<=100?27:p<=150?18:p<=200?15:p<=250?12:p<=300?9:p<=350?8:p<=400?7:p<=500?6:p<=600?5:p<=800?4:p<=1250?3:2}u(f,"getMillerRabinTests")})()});var sd=ue((Bee,jD)=>{"use strict";var tt=bt();Js();nd();uo();jA();HA();Es();jt();typeof Lt>"u"&&(Lt=tt.jsbn.BigInteger);var Lt,KA=tt.util.isNodejs?st("crypto"):null,ae=tt.asn1,Ss=tt.util;tt.pki=tt.pki||{};jD.exports=tt.pki.rsa=tt.rsa=tt.rsa||{};var mt=tt.pki,IU=[6,4,2,4,2,4,6,2],DU={name:"PrivateKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},BU={name:"RSAPrivateKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},RU={name:"RSAPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:ae.Class.UNIVERSAL,type:ae.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},OU=tt.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},_U={name:"DigestInfo",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:ae.Class.UNIVERSAL,type:ae.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:ae.Class.UNIVERSAL,type:ae.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:ae.Class.UNIVERSAL,type:ae.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},PU=u(function(r){var e;if(r.algorithm in mt.oids)e=mt.oids[r.algorithm];else{var t=new Error("Unknown message digest algorithm.");throw t.algorithm=r.algorithm,t}var n=ae.oidToDer(e).getBytes(),s=ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[]),i=ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[]);i.value.push(ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,n)),i.value.push(ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,""));var a=ae.create(ae.Class.UNIVERSAL,ae.Type.OCTETSTRING,!1,r.digest().getBytes());return s.value.push(i),s.value.push(a),ae.toDer(s).getBytes()},"emsaPkcs1v15encode"),UD=u(function(r,e,t){if(t)return r.modPow(e.e,e.n);if(!e.p||!e.q)return r.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(Lt.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Lt.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Lt(tt.util.bytesToHex(tt.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Lt.ONE));r=r.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var s=r.mod(e.p).modPow(e.dP,e.p),i=r.mod(e.q).modPow(e.dQ,e.q);s.compareTo(i)<0;)s=s.add(e.p);var a=s.subtract(i).multiply(e.qInv).mod(e.p).multiply(e.q).add(i);return a=a.multiply(n.modInverse(e.n)).mod(e.n),a},"_modPow");mt.rsa.encrypt=function(r,e,t){var n=t,s,i=Math.ceil(e.n.bitLength()/8);t!==!1&&t!==!0?(n=t===2,s=MD(r,e,t)):(s=tt.util.createBuffer(),s.putBytes(r));for(var a=new Lt(s.toHex(),16),o=UD(a,e,n),l=o.toString(16),c=tt.util.createBuffer(),f=i-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(tt.util.hexToBytes(l)),c.getBytes()};mt.rsa.decrypt=function(r,e,t,n){var s=Math.ceil(e.n.bitLength()/8);if(r.length!==s){var i=new Error("Encrypted message length is invalid.");throw i.length=r.length,i.expected=s,i}var a=new Lt(tt.util.createBuffer(r).toHex(),16);if(a.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var o=UD(a,e,t),l=o.toString(16),c=tt.util.createBuffer(),f=s-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(tt.util.hexToBytes(l)),n!==!1?nv(c.getBytes(),e,t):c.getBytes()};mt.rsa.createKeyPairGenerationState=function(r,e,t){typeof r=="string"&&(r=parseInt(r,10)),r=r||2048,t=t||{};var n=t.prng||tt.random,s={nextBytes:u(function(o){for(var l=n.getBytesSync(o.length),c=0;c<o.length;++c)o[c]=l.charCodeAt(c)},"nextBytes")},i=t.algorithm||"PRIMEINC",a;if(i==="PRIMEINC")a={algorithm:i,state:0,bits:r,rng:s,eInt:e||65537,e:new Lt(null),p:null,q:null,qBits:r>>1,pBits:r-(r>>1),pqState:0,num:null,keys:null},a.e.fromInt(a.eInt);else throw new Error("Invalid key generation algorithm: "+i);return a};mt.rsa.stepKeyPairGenerationState=function(r,e){"algorithm"in r||(r.algorithm="PRIMEINC");var t=new Lt(null);t.fromInt(30);for(var n=0,s=u(function(p,d){return p|d},"op_or"),i=+new Date,a,o=0;r.keys===null&&(e<=0||o<e);){if(r.state===0){var l=r.p===null?r.pBits:r.qBits,c=l-1;r.pqState===0?(r.num=new Lt(l,r.rng),r.num.testBit(c)||r.num.bitwiseTo(Lt.ONE.shiftLeft(c),s,r.num),r.num.dAddOffset(31-r.num.mod(t).byteValue(),0),n=0,++r.pqState):r.pqState===1?r.num.bitLength()>l?r.pqState=0:r.num.isProbablePrime(LU(r.num.bitLength()))?++r.pqState:r.num.dAddOffset(IU[n++%8],0):r.pqState===2?r.pqState=r.num.subtract(Lt.ONE).gcd(r.e).compareTo(Lt.ONE)===0?3:0:r.pqState===3&&(r.pqState=0,r.p===null?r.p=r.num:r.q=r.num,r.p!==null&&r.q!==null&&++r.state,r.num=null)}else if(r.state===1)r.p.compareTo(r.q)<0&&(r.num=r.p,r.p=r.q,r.q=r.num),++r.state;else if(r.state===2)r.p1=r.p.subtract(Lt.ONE),r.q1=r.q.subtract(Lt.ONE),r.phi=r.p1.multiply(r.q1),++r.state;else if(r.state===3)r.phi.gcd(r.e).compareTo(Lt.ONE)===0?++r.state:(r.p=null,r.q=null,r.state=0);else if(r.state===4)r.n=r.p.multiply(r.q),r.n.bitLength()===r.bits?++r.state:(r.q=null,r.state=0);else if(r.state===5){var f=r.e.modInverse(r.phi);r.keys={privateKey:mt.rsa.setPrivateKey(r.n,r.e,f,r.p,r.q,f.mod(r.p1),f.mod(r.q1),r.q.modInverse(r.p)),publicKey:mt.rsa.setPublicKey(r.n,r.e)}}a=+new Date,o+=a-i,i=a}return r.keys!==null};mt.rsa.generateKeyPair=function(r,e,t,n){if(arguments.length===1?typeof r=="object"?(t=r,r=void 0):typeof r=="function"&&(n=r,r=void 0):arguments.length===2?typeof r=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(t=e,e=void 0):(t=r,n=e,r=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof t=="function"&&(n=t,t=void 0):(n=t,t=e,e=void 0)),t=t||{},r===void 0&&(r=t.bits||2048),e===void 0&&(e=t.e||65537),!tt.options.usePureJavaScript&&!t.prng&&r>=256&&r<=16384&&(e===65537||e===3)){if(n){if(kD("generateKeyPair"))return KA.generateKeyPair("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(o,l,c){if(o)return n(o);n(null,{privateKey:mt.privateKeyFromPem(c),publicKey:mt.publicKeyFromPem(l)})});if(LD("generateKey")&&LD("exportKey"))return Ss.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:FD(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(o){return Ss.globalScope.crypto.subtle.exportKey("pkcs8",o.privateKey)}).then(void 0,function(o){n(o)}).then(function(o){if(o){var l=mt.privateKeyFromAsn1(ae.fromDer(tt.util.createBuffer(o)));n(null,{privateKey:l,publicKey:mt.setRsaPublicKey(l.n,l.e)})}});if(VD("generateKey")&&VD("exportKey")){var s=Ss.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:FD(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);s.oncomplete=function(o){var l=o.target.result,c=Ss.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);c.oncomplete=function(f){var p=f.target.result,d=mt.privateKeyFromAsn1(ae.fromDer(tt.util.createBuffer(p)));n(null,{privateKey:d,publicKey:mt.setRsaPublicKey(d.n,d.e)})},c.onerror=function(f){n(f)}},s.onerror=function(o){n(o)};return}}else if(kD("generateKeyPairSync")){var i=KA.generateKeyPairSync("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:mt.privateKeyFromPem(i.privateKey),publicKey:mt.publicKeyFromPem(i.publicKey)}}}var a=mt.rsa.createKeyPairGenerationState(r,e,t);if(!n)return mt.rsa.stepKeyPairGenerationState(a,0),a.keys;kU(a,t,n)};mt.setRsaPublicKey=mt.rsa.setPublicKey=function(r,e){var t={n:r,e};return t.encrypt=function(n,s,i){if(typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSAES-PKCS1-V1_5"),s==="RSAES-PKCS1-V1_5")s={encode:u(function(o,l,c){return MD(o,l,2).getBytes()},"encode")};else if(s==="RSA-OAEP"||s==="RSAES-OAEP")s={encode:u(function(o,l){return tt.pkcs1.encode_rsa_oaep(l,o,i)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(s)!==-1)s={encode:u(function(o){return o},"encode")};else if(typeof s=="string")throw new Error('Unsupported encryption scheme: "'+s+'".');var a=s.encode(n,t,!0);return mt.rsa.encrypt(a,t,!0)},t.verify=function(n,s,i,a){typeof i=="string"?i=i.toUpperCase():i===void 0&&(i="RSASSA-PKCS1-V1_5"),a===void 0&&(a={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),"_skipPaddingChecks"in a||(a._skipPaddingChecks=!1),i==="RSASSA-PKCS1-V1_5"?i={verify:u(function(l,c){c=nv(c,t,!0,void 0,a);var f=ae.fromDer(c,{parseAllBytes:a._parseAllDigestBytes}),p={},d=[];if(!ae.validate(f,_U,p,d)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=d,g}var m=ae.derToOid(p.algorithmIdentifier);if(!(m===tt.oids.md2||m===tt.oids.md5||m===tt.oids.sha1||m===tt.oids.sha224||m===tt.oids.sha256||m===tt.oids.sha384||m===tt.oids.sha512||m===tt.oids["sha512-224"]||m===tt.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=m,g}if((m===tt.oids.md2||m===tt.oids.md5)&&!("parameters"in p))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return l===p.digest},"verify")}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:u(function(l,c){return c=nv(c,t,!0,void 0,a),l===c},"verify")});var o=mt.rsa.decrypt(s,t,!0,!1);return i.verify(n,o,t.n.bitLength())},t};mt.setRsaPrivateKey=mt.rsa.setPrivateKey=function(r,e,t,n,s,i,a,o){var l={n:r,e,d:t,p:n,q:s,dP:i,dQ:a,qInv:o};return l.decrypt=function(c,f,p){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var d=mt.rsa.decrypt(c,l,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:nv};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:u(function(g,m){return tt.pkcs1.decode_rsa_oaep(m,g,p)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:u(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(d,l,!1)},l.sign=function(c,f){var p=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:PU},p=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:u(function(){return c},"encode")},p=1);var d=f.encode(c,l.n.bitLength());return mt.rsa.encrypt(d,l,p)},l};mt.wrapRsaPrivateKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,ae.integerToDer(0).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,ae.oidToDer(mt.oids.rsaEncryption).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,"")]),ae.create(ae.Class.UNIVERSAL,ae.Type.OCTETSTRING,!1,ae.toDer(r).getBytes())])};mt.privateKeyFromAsn1=function(r){var e={},t=[];if(ae.validate(r,DU,e,t)&&(r=ae.fromDer(tt.util.createBuffer(e.privateKey))),e={},t=[],!ae.validate(r,BU,e,t)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=t,n}var s,i,a,o,l,c,f,p;return s=tt.util.createBuffer(e.privateKeyModulus).toHex(),i=tt.util.createBuffer(e.privateKeyPublicExponent).toHex(),a=tt.util.createBuffer(e.privateKeyPrivateExponent).toHex(),o=tt.util.createBuffer(e.privateKeyPrime1).toHex(),l=tt.util.createBuffer(e.privateKeyPrime2).toHex(),c=tt.util.createBuffer(e.privateKeyExponent1).toHex(),f=tt.util.createBuffer(e.privateKeyExponent2).toHex(),p=tt.util.createBuffer(e.privateKeyCoefficient).toHex(),mt.setRsaPrivateKey(new Lt(s,16),new Lt(i,16),new Lt(a,16),new Lt(o,16),new Lt(l,16),new Lt(c,16),new Lt(f,16),new Lt(p,16))};mt.privateKeyToAsn1=mt.privateKeyToRSAPrivateKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,ae.integerToDer(0).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.n)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.e)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.d)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.p)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.q)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.dP)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.dQ)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.qInv))])};mt.publicKeyFromAsn1=function(r){var e={},t=[];if(ae.validate(r,OU,e,t)){var n=ae.derToOid(e.publicKeyOid);if(n!==mt.oids.rsaEncryption){var s=new Error("Cannot read public key. Unknown OID.");throw s.oid=n,s}r=e.rsaPublicKey}if(t=[],!ae.validate(r,RU,e,t)){var s=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw s.errors=t,s}var i=tt.util.createBuffer(e.publicKeyModulus).toHex(),a=tt.util.createBuffer(e.publicKeyExponent).toHex();return mt.setRsaPublicKey(new Lt(i,16),new Lt(a,16))};mt.publicKeyToAsn1=mt.publicKeyToSubjectPublicKeyInfo=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.OID,!1,ae.oidToDer(mt.oids.rsaEncryption).getBytes()),ae.create(ae.Class.UNIVERSAL,ae.Type.NULL,!1,"")]),ae.create(ae.Class.UNIVERSAL,ae.Type.BITSTRING,!1,[mt.publicKeyToRSAPublicKey(r)])])};mt.publicKeyToRSAPublicKey=function(r){return ae.create(ae.Class.UNIVERSAL,ae.Type.SEQUENCE,!0,[ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.n)),ae.create(ae.Class.UNIVERSAL,ae.Type.INTEGER,!1,xi(r.e))])};function MD(r,e,t){var n=tt.util.createBuffer(),s=Math.ceil(e.n.bitLength()/8);if(r.length>s-11){var i=new Error("Message is too long for PKCS#1 v1.5 padding.");throw i.length=r.length,i.max=s-11,i}n.putByte(0),n.putByte(t);var a=s-3-r.length,o;if(t===0||t===1){o=t===0?0:255;for(var l=0;l<a;++l)n.putByte(o)}else for(;a>0;){for(var c=0,f=tt.random.getBytes(a),l=0;l<a;++l)o=f.charCodeAt(l),o===0?++c:n.putByte(o);a=c}return n.putByte(0),n.putBytes(r),n}u(MD,"_encodePkcs1_v1_5");function nv(r,e,t,n,s){var i=Math.ceil(e.n.bitLength()/8),a=tt.util.createBuffer(r),o=a.getByte(),l=a.getByte();if(o!==0||t&&l!==0&&l!==1||!t&&l!==2||t&&l===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var c=0;if(l===0){c=i-3-n;for(var f=0;f<c;++f)if(a.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(l===1){for(c=0;a.length()>1;){if(a.getByte()!==255){--a.read;break}++c}if(c<8&&!(s&&s._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(l===2){for(c=0;a.length()>1;){if(a.getByte()===0){--a.read;break}++c}if(c<8&&!(s&&s._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var p=a.getByte();if(p!==0||c!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}u(nv,"_decodePkcs1_v1_5");function kU(r,e,t){typeof e=="function"&&(t=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),s();function s(){i(r.pBits,function(o,l){if(o)return t(o);if(r.p=l,r.q!==null)return a(o,r.q);i(r.qBits,a)})}u(s,"generate");function i(o,l){tt.prime.generateProbablePrime(o,n,l)}u(i,"getPrime");function a(o,l){if(o)return t(o);if(r.q=l,r.p.compareTo(r.q)<0){var c=r.p;r.p=r.q,r.q=c}if(r.p.subtract(Lt.ONE).gcd(r.e).compareTo(Lt.ONE)!==0){r.p=null,s();return}if(r.q.subtract(Lt.ONE).gcd(r.e).compareTo(Lt.ONE)!==0){r.q=null,i(r.qBits,a);return}if(r.p1=r.p.subtract(Lt.ONE),r.q1=r.q.subtract(Lt.ONE),r.phi=r.p1.multiply(r.q1),r.phi.gcd(r.e).compareTo(Lt.ONE)!==0){r.p=r.q=null,s();return}if(r.n=r.p.multiply(r.q),r.n.bitLength()!==r.bits){r.q=null,i(r.qBits,a);return}var f=r.e.modInverse(r.phi);r.keys={privateKey:mt.rsa.setPrivateKey(r.n,r.e,f,r.p,r.q,f.mod(r.p1),f.mod(r.q1),r.q.modInverse(r.p)),publicKey:mt.rsa.setPublicKey(r.n,r.e)},t(null,r.keys)}u(a,"finish")}u(kU,"_generateKeyPair");function xi(r){var e=r.toString(16);e[0]>="8"&&(e="00"+e);var t=tt.util.hexToBytes(e);return t.length>1&&(t.charCodeAt(0)===0&&(t.charCodeAt(1)&128)===0||t.charCodeAt(0)===255&&(t.charCodeAt(1)&128)===128)?t.substr(1):t}u(xi,"_bnToBytes");function LU(r){return r<=100?27:r<=150?18:r<=200?15:r<=250?12:r<=300?9:r<=350?8:r<=400?7:r<=500?6:r<=600?5:r<=800?4:r<=1250?3:2}u(LU,"_getMillerRabinTests");function kD(r){return tt.util.isNodejs&&typeof KA[r]=="function"}u(kD,"_detectNodeCrypto");function LD(r){return typeof Ss.globalScope<"u"&&typeof Ss.globalScope.crypto=="object"&&typeof Ss.globalScope.crypto.subtle=="object"&&typeof Ss.globalScope.crypto.subtle[r]=="function"}u(LD,"_detectSubtleCrypto");function VD(r){return typeof Ss.globalScope<"u"&&typeof Ss.globalScope.msCrypto=="object"&&typeof Ss.globalScope.msCrypto.subtle=="object"&&typeof Ss.globalScope.msCrypto.subtle[r]=="function"}u(VD,"_detectSubtleMsCrypto");function FD(r){for(var e=tt.util.hexToBytes(r.toString(16)),t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}u(FD,"_intToUint8Array")});var XA=ue((Oee,GD)=>{"use strict";var Ke=bt();oo();Js();td();yi();uo();Qy();zu();Es();LA();sd();jt();typeof qD>"u"&&(qD=Ke.jsbn.BigInteger);var qD,de=Ke.asn1,St=Ke.pki=Ke.pki||{};GD.exports=St.pbe=Ke.pbe=Ke.pbe||{};var Qu=St.oids,VU={name:"EncryptedPrivateKeyInfo",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},FU={name:"PBES2Algorithms",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:de.Class.UNIVERSAL,type:de.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},UU={name:"pkcs-12PbeParams",tagClass:de.Class.UNIVERSAL,type:de.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:de.Class.UNIVERSAL,type:de.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:de.Class.UNIVERSAL,type:de.Type.INTEGER,constructed:!1,capture:"iterations"}]};St.encryptPrivateKeyInfo=function(r,e,t){t=t||{},t.saltSize=t.saltSize||8,t.count=t.count||2048,t.algorithm=t.algorithm||"aes128",t.prfAlgorithm=t.prfAlgorithm||"sha1";var n=Ke.random.getBytesSync(t.saltSize),s=t.count,i=de.integerToDer(s),a,o,l;if(t.algorithm.indexOf("aes")===0||t.algorithm==="des"){var c,f,p;switch(t.algorithm){case"aes128":a=16,c=16,f=Qu["aes128-CBC"],p=Ke.aes.createEncryptionCipher;break;case"aes192":a=24,c=16,f=Qu["aes192-CBC"],p=Ke.aes.createEncryptionCipher;break;case"aes256":a=32,c=16,f=Qu["aes256-CBC"],p=Ke.aes.createEncryptionCipher;break;case"des":a=8,c=8,f=Qu.desCBC,p=Ke.des.createEncryptionCipher;break;default:var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=t.algorithm,d}var g="hmacWith"+t.prfAlgorithm.toUpperCase(),m=XD(g),v=Ke.pkcs5.pbkdf2(e,n,s,a,m),y=Ke.random.getBytesSync(c),S=p(v);S.start(y),S.update(de.toDer(r)),S.finish(),l=S.output.getBytes();var C=MU(n,i,a,g);o=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu.pkcs5PBES2).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu.pkcs5PBKDF2).getBytes()),C]),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(f).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,y)])])])}else if(t.algorithm==="3des"){a=24;var w=new Ke.util.ByteBuffer(n),v=St.pbe.generatePkcs12Key(e,w,1,s,a),y=St.pbe.generatePkcs12Key(e,w,2,s,a),S=Ke.des.createEncryptionCipher(v);S.start(y),S.update(de.toDer(r)),S.finish(),l=S.output.getBytes(),o=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(Qu["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,n),de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,i.getBytes())])])}else{var d=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw d.algorithm=t.algorithm,d}var E=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[o,de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,l)]);return E};St.decryptPrivateKeyInfo=function(r,e){var t=null,n={},s=[];if(!de.validate(r,VU,n,s)){var i=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}var a=de.derToOid(n.encryptionOid),o=St.pbe.getCipher(a,n.encryptionParams,e),l=Ke.util.createBuffer(n.encryptedData);return o.update(l),o.finish()&&(t=de.fromDer(o.output)),t};St.encryptedPrivateKeyToPem=function(r,e){var t={type:"ENCRYPTED PRIVATE KEY",body:de.toDer(r).getBytes()};return Ke.pem.encode(t,{maxline:e})};St.encryptedPrivateKeyFromPem=function(r){var e=Ke.pem.decode(r)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var t=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return de.fromDer(e.body)};St.encryptRsaPrivateKey=function(r,e,t){if(t=t||{},!t.legacy){var n=St.wrapRsaPrivateKey(St.privateKeyToAsn1(r));return n=St.encryptPrivateKeyInfo(n,e,t),St.encryptedPrivateKeyToPem(n)}var s,i,a,o;switch(t.algorithm){case"aes128":s="AES-128-CBC",a=16,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",a=24,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",a=32,i=Ke.random.getBytesSync(16),o=Ke.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",a=24,i=Ke.random.getBytesSync(8),o=Ke.des.createEncryptionCipher;break;case"des":s="DES-CBC",a=8,i=Ke.random.getBytesSync(8),o=Ke.des.createEncryptionCipher;break;default:var l=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+t.algorithm+'".');throw l.algorithm=t.algorithm,l}var c=Ke.pbe.opensslDeriveBytes(e,i.substr(0,8),a),f=o(c);f.start(i),f.update(de.toDer(St.privateKeyToAsn1(r))),f.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:Ke.util.bytesToHex(i).toUpperCase()},body:f.output.getBytes()};return Ke.pem.encode(p)};St.decryptRsaPrivateKey=function(r,e){var t=null,n=Ke.pem.decode(r)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var s=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw s.headerType=s,s}if(n.procType&&n.procType.type==="ENCRYPTED"){var i,a;switch(n.dekInfo.algorithm){case"DES-CBC":i=8,a=Ke.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=Ke.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=Ke.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=Ke.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=Ke.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,40)},"cipherFn");break;case"RC2-64-CBC":i=8,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,64)},"cipherFn");break;case"RC2-128-CBC":i=16,a=u(function(p){return Ke.rc2.createDecryptionCipher(p,128)},"cipherFn");break;default:var s=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw s.algorithm=n.dekInfo.algorithm,s}var o=Ke.util.hexToBytes(n.dekInfo.parameters),l=Ke.pbe.opensslDeriveBytes(e,o.substr(0,8),i),c=a(l);if(c.start(o),c.update(Ke.util.createBuffer(n.body)),c.finish())t=c.output.getBytes();else return t}else t=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?t=St.decryptPrivateKeyInfo(de.fromDer(t),e):t=de.fromDer(t),t!==null&&(t=St.privateKeyFromAsn1(t)),t};St.pbe.generatePkcs12Key=function(r,e,t,n,s,i){var a,o;if(typeof i>"u"||i===null){if(!("sha1"in Ke.md))throw new Error('"sha1" hash algorithm unavailable.');i=Ke.md.sha1.create()}var l=i.digestLength,c=i.blockLength,f=new Ke.util.ByteBuffer,p=new Ke.util.ByteBuffer;if(r!=null){for(o=0;o<r.length;o++)p.putInt16(r.charCodeAt(o));p.putInt16(0)}var d=p.length(),g=e.length(),m=new Ke.util.ByteBuffer;m.fillWithByte(t,c);var v=c*Math.ceil(g/c),y=new Ke.util.ByteBuffer;for(o=0;o<v;o++)y.putByte(e.at(o%g));var S=c*Math.ceil(d/c),C=new Ke.util.ByteBuffer;for(o=0;o<S;o++)C.putByte(p.at(o%d));var w=y;w.putBuffer(C);for(var E=Math.ceil(s/l),A=1;A<=E;A++){var b=new Ke.util.ByteBuffer;b.putBytes(m.bytes()),b.putBytes(w.bytes());for(var V=0;V<n;V++)i.start(),i.update(b.getBytes()),b=i.digest();var I=new Ke.util.ByteBuffer;for(o=0;o<c;o++)I.putByte(b.at(o%l));var D=Math.ceil(g/c)+Math.ceil(d/c),U=new Ke.util.ByteBuffer;for(a=0;a<D;a++){var F=new Ke.util.ByteBuffer(w.getBytes(c)),M=511;for(o=I.length()-1;o>=0;o--)M=M>>8,M+=I.at(o)+F.at(o),F.setAt(o,M&255);U.putBuffer(F)}w=U,f.putBuffer(b)}return f.truncate(f.length()-s),f};St.pbe.getCipher=function(r,e,t){switch(r){case St.oids.pkcs5PBES2:return St.pbe.getCipherForPBES2(r,e,t);case St.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case St.oids["pbewithSHAAnd40BitRC2-CBC"]:return St.pbe.getCipherForPKCS12PBE(r,e,t);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=r,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};St.pbe.getCipherForPBES2=function(r,e,t){var n={},s=[];if(!de.validate(e,FU,n,s)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}if(r=de.derToOid(n.kdfOid),r!==St.oids.pkcs5PBKDF2){var i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw i.oid=r,i.supportedOids=["pkcs5PBKDF2"],i}if(r=de.derToOid(n.encOid),r!==St.oids["aes128-CBC"]&&r!==St.oids["aes192-CBC"]&&r!==St.oids["aes256-CBC"]&&r!==St.oids["des-EDE3-CBC"]&&r!==St.oids.desCBC){var i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw i.oid=r,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i}var a=n.kdfSalt,o=Ke.util.createBuffer(n.kdfIterationCount);o=o.getInt(o.length()<<3);var l,c;switch(St.oids[r]){case"aes128-CBC":l=16,c=Ke.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,c=Ke.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,c=Ke.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,c=Ke.des.createDecryptionCipher;break;case"desCBC":l=8,c=Ke.des.createDecryptionCipher;break}var f=KD(n.prfOid),p=Ke.pkcs5.pbkdf2(t,a,o,l,f),d=n.encIv,g=c(p);return g.start(d),g};St.pbe.getCipherForPKCS12PBE=function(r,e,t){var n={},s=[];if(!de.validate(e,UU,n,s)){var i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw i.errors=s,i}var a=Ke.util.createBuffer(n.salt),o=Ke.util.createBuffer(n.iterations);o=o.getInt(o.length()<<3);var l,c,f;switch(r){case St.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,c=8,f=Ke.des.startDecrypting;break;case St.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,c=8,f=u(function(v,y){var S=Ke.rc2.createDecryptionCipher(v,40);return S.start(y,null),S},"cipherFn");break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=r,i}var p=KD(n.prfOid),d=St.pbe.generatePkcs12Key(t,a,1,o,l,p);p.start();var g=St.pbe.generatePkcs12Key(t,a,2,o,c,p);return f(d,g)};St.pbe.opensslDeriveBytes=function(r,e,t,n){if(typeof n>"u"||n===null){if(!("md5"in Ke.md))throw new Error('"md5" hash algorithm unavailable.');n=Ke.md.md5.create()}e===null&&(e="");for(var s=[HD(n,r+e)],i=16,a=1;i<t;++a,i+=16)s.push(HD(n,s[a-1]+r+e));return s.join("").substr(0,t)};function HD(r,e){return r.start().update(e).digest().getBytes()}u(HD,"hash");function KD(r){var e;if(!r)e="hmacWithSHA1";else if(e=St.oids[de.derToOid(r)],!e){var t=new Error("Unsupported PRF OID.");throw t.oid=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}return XD(e)}u(KD,"prfOidToMessageDigest");function XD(r){var e=Ke.md;switch(r){case"hmacWithSHA224":e=Ke.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":r=r.substr(8).toLowerCase();break;default:var t=new Error("Unsupported PRF algorithm.");throw t.algorithm=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}if(!e||!(r in e))throw new Error("Unknown hash algorithm: "+r);return e[r].create()}u(XD,"prfAlgorithmToMessageDigest");function MU(r,e,t,n){var s=de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OCTETSTRING,!1,r),de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&s.value.push(de.create(de.Class.UNIVERSAL,de.Type.INTEGER,!1,Ke.util.hexToBytes(t.toString(16))),de.create(de.Class.UNIVERSAL,de.Type.SEQUENCE,!0,[de.create(de.Class.UNIVERSAL,de.Type.OID,!1,de.oidToDer(St.oids[n]).getBytes()),de.create(de.Class.UNIVERSAL,de.Type.NULL,!1,"")])),s}u(MU,"createPbkdf2Params")});var GA=ue((Pee,zD)=>{"use strict";var Sf=bt();Js();jt();var Me=Sf.asn1,Af=zD.exports=Sf.pkcs7asn1=Sf.pkcs7asn1||{};Sf.pkcs7=Sf.pkcs7||{};Sf.pkcs7.asn1=Af;var $D={name:"ContentInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Af.contentInfoValidator=$D;var WD={name:"EncryptedContentInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Af.envelopedDataValidator={name:"EnvelopedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(WD)};Af.encryptedDataValidator={name:"EncryptedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"}].concat(WD)};var jU={name:"SignerInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:Me.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Af.signedDataValidator={name:"SignedData",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},$D,{name:"SignedData.Certificates",tagClass:Me.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:Me.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SET,capture:"signerInfos",optional:!0,value:[jU]}]};Af.recipientInfoValidator={name:"RecipientInfo",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:Me.Class.UNIVERSAL,type:Me.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:Me.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:Me.Class.UNIVERSAL,type:Me.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var $A=ue((kee,JD)=>{"use strict";var Zu=bt();jt();Zu.mgf=Zu.mgf||{};var qU=JD.exports=Zu.mgf.mgf1=Zu.mgf1=Zu.mgf1||{};qU.create=function(r){var e={generate:u(function(t,n){for(var s=new Zu.util.ByteBuffer,i=Math.ceil(n/r.digestLength),a=0;a<i;a++){var o=new Zu.util.ByteBuffer;o.putInt32(a),r.start(),r.update(t+o.getBytes()),s.putBuffer(r.digest())}return s.truncate(s.length()-n),s.getBytes()},"generate")};return e}});var QD=ue((Vee,YD)=>{"use strict";var sv=bt();$A();YD.exports=sv.mgf=sv.mgf||{};sv.mgf.mgf1=sv.mgf1});var iv=ue((Fee,ZD)=>{"use strict";var el=bt();Es();jt();var HU=ZD.exports=el.pss=el.pss||{};HU.create=function(r){arguments.length===3&&(r={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=r.md,t=r.mgf,n=e.digestLength,s=r.salt||null;typeof s=="string"&&(s=el.util.createBuffer(s));var i;if("saltLength"in r)i=r.saltLength;else if(s!==null)i=s.length();else throw new Error("Salt length not specified or specific salt not given.");if(s!==null&&s.length()!==i)throw new Error("Given salt length does not match length of given salt.");var a=r.prng||el.random,o={};return o.encode=function(l,c){var f,p=c-1,d=Math.ceil(p/8),g=l.digest().getBytes();if(d<n+i+2)throw new Error("Message is too long to encrypt.");var m;s===null?m=a.getBytesSync(i):m=s.bytes();var v=new el.util.ByteBuffer;v.fillWithByte(0,8),v.putBytes(g),v.putBytes(m),e.start(),e.update(v.getBytes());var y=e.digest().getBytes(),S=new el.util.ByteBuffer;S.fillWithByte(0,d-i-n-2),S.putByte(1),S.putBytes(m);var C=S.getBytes(),w=d-n-1,E=t.generate(y,w),A="";for(f=0;f<w;f++)A+=String.fromCharCode(C.charCodeAt(f)^E.charCodeAt(f));var b=65280>>8*d-p&255;return A=String.fromCharCode(A.charCodeAt(0)&~b)+A.substr(1),A+y+"\xBC"},o.verify=function(l,c,f){var p,d=f-1,g=Math.ceil(d/8);if(c=c.substr(-g),g<n+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(c.charCodeAt(g-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var m=g-n-1,v=c.substr(0,m),y=c.substr(m,n),S=65280>>8*g-d&255;if((v.charCodeAt(0)&S)!==0)throw new Error("Bits beyond keysize not zero as expected.");var C=t.generate(y,m),w="";for(p=0;p<m;p++)w+=String.fromCharCode(v.charCodeAt(p)^C.charCodeAt(p));w=String.fromCharCode(w.charCodeAt(0)&~S)+w.substr(1);var E=g-n-i-2;for(p=0;p<E;p++)if(w.charCodeAt(p)!==0)throw new Error("Leftmost octets not zero as expected");if(w.charCodeAt(E)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var A=w.substr(-i),b=new el.util.ByteBuffer;b.fillWithByte(0,8),b.putBytes(l),b.putBytes(A),e.start(),e.update(b.getBytes());var V=e.digest().getBytes();return y===V},o}});var uv=ue((Uee,sB)=>{"use strict";var rt=bt();oo();Js();td();yi();QD();uo();zu();iv();sd();jt();var _=rt.asn1,ke=sB.exports=rt.pki=rt.pki||{},Vt=ke.oids,Dr={};Dr.CN=Vt.commonName;Dr.commonName="CN";Dr.C=Vt.countryName;Dr.countryName="C";Dr.L=Vt.localityName;Dr.localityName="L";Dr.ST=Vt.stateOrProvinceName;Dr.stateOrProvinceName="ST";Dr.O=Vt.organizationName;Dr.organizationName="O";Dr.OU=Vt.organizationalUnitName;Dr.organizationalUnitName="OU";Dr.E=Vt.emailAddress;Dr.emailAddress="E";var tB=rt.pki.rsa.publicKeyValidator,KU={name:"Certificate",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:_.Class.UNIVERSAL,type:_.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:_.Class.UNIVERSAL,type:_.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:_.Class.UNIVERSAL,type:_.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:_.Class.UNIVERSAL,type:_.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},tB,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:_.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:_.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:_.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},XU={name:"rsapss",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:_.Class.UNIVERSAL,type:_.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:_.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:_.Class.UNIVERSAL,type:_.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:_.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:_.Class.UNIVERSAL,type:_.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:_.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:_.Class.UNIVERSAL,type:_.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},GU={name:"CertificationRequestInfo",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:_.Class.UNIVERSAL,type:_.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},tB,{name:"CertificationRequestInfo.attributes",tagClass:_.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:_.Class.UNIVERSAL,type:_.Type.SET,constructed:!0}]}]}]},$U={name:"CertificationRequest",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[GU,{name:"CertificationRequest.signatureAlgorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:_.Class.UNIVERSAL,type:_.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:_.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:_.Class.UNIVERSAL,type:_.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};ke.RDNAttributesAsArray=function(r,e){for(var t=[],n,s,i,a=0;a<r.value.length;++a){n=r.value[a];for(var o=0;o<n.value.length;++o)i={},s=n.value[o],i.type=_.derToOid(s.value[0].value),i.value=s.value[1].value,i.valueTagClass=s.value[1].type,i.type in Vt&&(i.name=Vt[i.type],i.name in Dr&&(i.shortName=Dr[i.name])),e&&(e.update(i.type),e.update(i.value)),t.push(i)}return t};ke.CRIAttributesAsArray=function(r){for(var e=[],t=0;t<r.length;++t)for(var n=r[t],s=_.derToOid(n.value[0].value),i=n.value[1].value,a=0;a<i.length;++a){var o={};if(o.type=s,o.value=i[a].value,o.valueTagClass=i[a].type,o.type in Vt&&(o.name=Vt[o.type],o.name in Dr&&(o.shortName=Dr[o.name])),o.type===Vt.extensionRequest){o.extensions=[];for(var l=0;l<o.value.length;++l)o.extensions.push(ke.certificateExtensionFromAsn1(o.value[l]))}e.push(o)}return e};function fo(r,e){typeof e=="string"&&(e={shortName:e});for(var t=null,n,s=0;t===null&&s<r.attributes.length;++s)n=r.attributes[s],(e.type&&e.type===n.type||e.name&&e.name===n.name||e.shortName&&e.shortName===n.shortName)&&(t=n);return t}u(fo,"_getAttribute");var av=u(function(r,e,t){var n={};if(r!==Vt["RSASSA-PSS"])return n;t&&(n={hash:{algorithmOid:Vt.sha1},mgf:{algorithmOid:Vt.mgf1,hash:{algorithmOid:Vt.sha1}},saltLength:20});var s={},i=[];if(!_.validate(e,XU,s,i)){var a=new Error("Cannot read RSASSA-PSS parameter block.");throw a.errors=i,a}return s.hashOid!==void 0&&(n.hash=n.hash||{},n.hash.algorithmOid=_.derToOid(s.hashOid)),s.maskGenOid!==void 0&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=_.derToOid(s.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=_.derToOid(s.maskGenHashOid)),s.saltLength!==void 0&&(n.saltLength=s.saltLength.charCodeAt(0)),n},"_readSignatureParameters"),ov=u(function(r){switch(Vt[r.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return rt.md.sha1.create();case"md5WithRSAEncryption":return rt.md.md5.create();case"sha256WithRSAEncryption":return rt.md.sha256.create();case"sha384WithRSAEncryption":return rt.md.sha384.create();case"sha512WithRSAEncryption":return rt.md.sha512.create();case"RSASSA-PSS":return rt.md.sha256.create();default:var e=new Error("Could not compute "+r.type+" digest. Unknown signature OID.");throw e.signatureOid=r.signatureOid,e}},"_createSignatureDigest"),rB=u(function(r){var e=r.certificate,t;switch(e.signatureOid){case Vt.sha1WithRSAEncryption:case Vt.sha1WithRSASignature:break;case Vt["RSASSA-PSS"]:var n,s;if(n=Vt[e.signatureParameters.mgf.hash.algorithmOid],n===void 0||rt.md[n]===void 0){var i=new Error("Unsupported MGF hash function.");throw i.oid=e.signatureParameters.mgf.hash.algorithmOid,i.name=n,i}if(s=Vt[e.signatureParameters.mgf.algorithmOid],s===void 0||rt.mgf[s]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=e.signatureParameters.mgf.algorithmOid,i.name=s,i}if(s=rt.mgf[s].create(rt.md[n].create()),n=Vt[e.signatureParameters.hash.algorithmOid],n===void 0||rt.md[n]===void 0){var i=new Error("Unsupported RSASSA-PSS hash function.");throw i.oid=e.signatureParameters.hash.algorithmOid,i.name=n,i}t=rt.pss.create(rt.md[n].create(),s,e.signatureParameters.saltLength);break}return e.publicKey.verify(r.md.digest().getBytes(),r.signature,t)},"_verifySignature");ke.certificateFromPem=function(r,e,t){var n=rt.pem.decode(r)[0];if(n.type!=="CERTIFICATE"&&n.type!=="X509 CERTIFICATE"&&n.type!=="TRUSTED CERTIFICATE"){var s=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw s.headerType=n.type,s}if(n.procType&&n.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var i=_.fromDer(n.body,t);return ke.certificateFromAsn1(i,e)};ke.certificateToPem=function(r,e){var t={type:"CERTIFICATE",body:_.toDer(ke.certificateToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.publicKeyFromPem=function(r){var e=rt.pem.decode(r)[0];if(e.type!=="PUBLIC KEY"&&e.type!=="RSA PUBLIC KEY"){var t=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert public key from PEM; PEM is encrypted.");var n=_.fromDer(e.body);return ke.publicKeyFromAsn1(n)};ke.publicKeyToPem=function(r,e){var t={type:"PUBLIC KEY",body:_.toDer(ke.publicKeyToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.publicKeyToRSAPublicKeyPem=function(r,e){var t={type:"RSA PUBLIC KEY",body:_.toDer(ke.publicKeyToRSAPublicKey(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||rt.md.sha1.create(),n=e.type||"RSAPublicKey",s;switch(n){case"RSAPublicKey":s=_.toDer(ke.publicKeyToRSAPublicKey(r)).getBytes();break;case"SubjectPublicKeyInfo":s=_.toDer(ke.publicKeyToAsn1(r)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+e.type+'".')}t.start(),t.update(s);var i=t.digest();if(e.encoding==="hex"){var a=i.toHex();return e.delimiter?a.match(/.{2}/g).join(e.delimiter):a}else{if(e.encoding==="binary")return i.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return i};ke.certificationRequestFromPem=function(r,e,t){var n=rt.pem.decode(r)[0];if(n.type!=="CERTIFICATE REQUEST"){var s=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw s.headerType=n.type,s}if(n.procType&&n.procType.type==="ENCRYPTED")throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var i=_.fromDer(n.body,t);return ke.certificationRequestFromAsn1(i,e)};ke.certificationRequestToPem=function(r,e){var t={type:"CERTIFICATE REQUEST",body:_.toDer(ke.certificationRequestToAsn1(r)).getBytes()};return rt.pem.encode(t,{maxline:e})};ke.createCertificate=function(){var r={};return r.version=2,r.serialNumber="00",r.signatureOid=null,r.signature=null,r.siginfo={},r.siginfo.algorithmOid=null,r.validity={},r.validity.notBefore=new Date,r.validity.notAfter=new Date,r.issuer={},r.issuer.getField=function(e){return fo(r.issuer,e)},r.issuer.addField=function(e){As([e]),r.issuer.attributes.push(e)},r.issuer.attributes=[],r.issuer.hash=null,r.subject={},r.subject.getField=function(e){return fo(r.subject,e)},r.subject.addField=function(e){As([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.extensions=[],r.publicKey=null,r.md=null,r.setSubject=function(e,t){As(e),r.subject.attributes=e,delete r.subject.uniqueId,t&&(r.subject.uniqueId=t),r.subject.hash=null},r.setIssuer=function(e,t){As(e),r.issuer.attributes=e,delete r.issuer.uniqueId,t&&(r.issuer.uniqueId=t),r.issuer.hash=null},r.setExtensions=function(e){for(var t=0;t<e.length;++t)nB(e[t],{cert:r});r.extensions=e},r.getExtension=function(e){typeof e=="string"&&(e={name:e});for(var t=null,n,s=0;t===null&&s<r.extensions.length;++s)n=r.extensions[s],(e.id&&n.id===e.id||e.name&&n.name===e.name)&&(t=n);return t},r.sign=function(e,t){r.md=t||rt.md.sha1.create();var n=Vt[r.md.algorithm+"WithRSAEncryption"];if(!n){var s=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw s.algorithm=r.md.algorithm,s}r.signatureOid=r.siginfo.algorithmOid=n,r.tbsCertificate=ke.getTBSCertificate(r);var i=_.toDer(r.tbsCertificate);r.md.update(i.getBytes()),r.signature=e.sign(r.md)},r.verify=function(e){var t=!1;if(!r.issued(e)){var n=e.issuer,s=r.subject,i=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw i.expectedIssuer=s.attributes,i.actualIssuer=n.attributes,i}var a=e.md;if(a===null){a=ov({signatureOid:e.signatureOid,type:"certificate"});var o=e.tbsCertificate||ke.getTBSCertificate(e),l=_.toDer(o);a.update(l.getBytes())}return a!==null&&(t=rB({certificate:r,md:a,signature:e.signature})),t},r.isIssuer=function(e){var t=!1,n=r.issuer,s=e.subject;if(n.hash&&s.hash)t=n.hash===s.hash;else if(n.attributes.length===s.attributes.length){t=!0;for(var i,a,o=0;t&&o<n.attributes.length;++o)i=n.attributes[o],a=s.attributes[o],(i.type!==a.type||i.value!==a.value)&&(t=!1)}return t},r.issued=function(e){return e.isIssuer(r)},r.generateSubjectKeyIdentifier=function(){return ke.getPublicKeyFingerprint(r.publicKey,{type:"RSAPublicKey"})},r.verifySubjectKeyIdentifier=function(){for(var e=Vt.subjectKeyIdentifier,t=0;t<r.extensions.length;++t){var n=r.extensions[t];if(n.id===e){var s=r.generateSubjectKeyIdentifier().getBytes();return rt.util.hexToBytes(n.subjectKeyIdentifier)===s}}return!1},r};ke.certificateFromAsn1=function(r,e){var t={},n=[];if(!_.validate(r,KU,t,n)){var s=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw s.errors=n,s}var i=_.derToOid(t.publicKeyOid);if(i!==ke.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=ke.createCertificate();a.version=t.certVersion?t.certVersion.charCodeAt(0):0;var o=rt.util.createBuffer(t.certSerialNumber);a.serialNumber=o.toHex(),a.signatureOid=rt.asn1.derToOid(t.certSignatureOid),a.signatureParameters=av(a.signatureOid,t.certSignatureParams,!0),a.siginfo.algorithmOid=rt.asn1.derToOid(t.certinfoSignatureOid),a.siginfo.parameters=av(a.siginfo.algorithmOid,t.certinfoSignatureParams,!1),a.signature=t.certSignature;var l=[];if(t.certValidity1UTCTime!==void 0&&l.push(_.utcTimeToDate(t.certValidity1UTCTime)),t.certValidity2GeneralizedTime!==void 0&&l.push(_.generalizedTimeToDate(t.certValidity2GeneralizedTime)),t.certValidity3UTCTime!==void 0&&l.push(_.utcTimeToDate(t.certValidity3UTCTime)),t.certValidity4GeneralizedTime!==void 0&&l.push(_.generalizedTimeToDate(t.certValidity4GeneralizedTime)),l.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(a.validity.notBefore=l[0],a.validity.notAfter=l[1],a.tbsCertificate=t.tbsCertificate,e){a.md=ov({signatureOid:a.signatureOid,type:"certificate"});var c=_.toDer(a.tbsCertificate);a.md.update(c.getBytes())}var f=rt.md.sha1.create(),p=_.toDer(t.certIssuer);f.update(p.getBytes()),a.issuer.getField=function(m){return fo(a.issuer,m)},a.issuer.addField=function(m){As([m]),a.issuer.attributes.push(m)},a.issuer.attributes=ke.RDNAttributesAsArray(t.certIssuer),t.certIssuerUniqueId&&(a.issuer.uniqueId=t.certIssuerUniqueId),a.issuer.hash=f.digest().toHex();var d=rt.md.sha1.create(),g=_.toDer(t.certSubject);return d.update(g.getBytes()),a.subject.getField=function(m){return fo(a.subject,m)},a.subject.addField=function(m){As([m]),a.subject.attributes.push(m)},a.subject.attributes=ke.RDNAttributesAsArray(t.certSubject),t.certSubjectUniqueId&&(a.subject.uniqueId=t.certSubjectUniqueId),a.subject.hash=d.digest().toHex(),t.certExtensions?a.extensions=ke.certificateExtensionsFromAsn1(t.certExtensions):a.extensions=[],a.publicKey=ke.publicKeyFromAsn1(t.subjectPublicKeyInfo),a};ke.certificateExtensionsFromAsn1=function(r){for(var e=[],t=0;t<r.value.length;++t)for(var n=r.value[t],s=0;s<n.value.length;++s)e.push(ke.certificateExtensionFromAsn1(n.value[s]));return e};ke.certificateExtensionFromAsn1=function(r){var e={};if(e.id=_.derToOid(r.value[0].value),e.critical=!1,r.value[1].type===_.Type.BOOLEAN?(e.critical=r.value[1].value.charCodeAt(0)!==0,e.value=r.value[2].value):e.value=r.value[1].value,e.id in Vt){if(e.name=Vt[e.id],e.name==="keyUsage"){var t=_.fromDer(e.value),n=0,s=0;t.value.length>1&&(n=t.value.charCodeAt(1),s=t.value.length>2?t.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(s&128)===128}else if(e.name==="basicConstraints"){var t=_.fromDer(e.value);t.value.length>0&&t.value[0].type===_.Type.BOOLEAN?e.cA=t.value[0].value.charCodeAt(0)!==0:e.cA=!1;var i=null;t.value.length>0&&t.value[0].type===_.Type.INTEGER?i=t.value[0].value:t.value.length>1&&(i=t.value[1].value),i!==null&&(e.pathLenConstraint=_.derToInteger(i))}else if(e.name==="extKeyUsage")for(var t=_.fromDer(e.value),a=0;a<t.value.length;++a){var o=_.derToOid(t.value[a].value);o in Vt?e[Vt[o]]=!0:e[o]=!0}else if(e.name==="nsCertType"){var t=_.fromDer(e.value),n=0;t.value.length>1&&(n=t.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var l,t=_.fromDer(e.value),c=0;c<t.value.length;++c){l=t.value[c];var f={type:l.type,value:l.value};switch(e.altNames.push(f),l.type){case 1:case 2:case 6:break;case 7:f.ip=rt.util.bytesToIP(l.value);break;case 8:f.oid=_.derToOid(l.value);break;default:}}}else if(e.name==="subjectKeyIdentifier"){var t=_.fromDer(e.value);e.subjectKeyIdentifier=rt.util.bytesToHex(t.value)}}return e};ke.certificationRequestFromAsn1=function(r,e){var t={},n=[];if(!_.validate(r,$U,t,n)){var s=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw s.errors=n,s}var i=_.derToOid(t.publicKeyOid);if(i!==ke.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=ke.createCertificationRequest();if(a.version=t.csrVersion?t.csrVersion.charCodeAt(0):0,a.signatureOid=rt.asn1.derToOid(t.csrSignatureOid),a.signatureParameters=av(a.signatureOid,t.csrSignatureParams,!0),a.siginfo.algorithmOid=rt.asn1.derToOid(t.csrSignatureOid),a.siginfo.parameters=av(a.siginfo.algorithmOid,t.csrSignatureParams,!1),a.signature=t.csrSignature,a.certificationRequestInfo=t.certificationRequestInfo,e){a.md=ov({signatureOid:a.signatureOid,type:"certification request"});var o=_.toDer(a.certificationRequestInfo);a.md.update(o.getBytes())}var l=rt.md.sha1.create();return a.subject.getField=function(c){return fo(a.subject,c)},a.subject.addField=function(c){As([c]),a.subject.attributes.push(c)},a.subject.attributes=ke.RDNAttributesAsArray(t.certificationRequestInfoSubject,l),a.subject.hash=l.digest().toHex(),a.publicKey=ke.publicKeyFromAsn1(t.subjectPublicKeyInfo),a.getAttribute=function(c){return fo(a,c)},a.addAttribute=function(c){As([c]),a.attributes.push(c)},a.attributes=ke.CRIAttributesAsArray(t.certificationRequestInfoAttributes||[]),a};ke.createCertificationRequest=function(){var r={};return r.version=0,r.signatureOid=null,r.signature=null,r.siginfo={},r.siginfo.algorithmOid=null,r.subject={},r.subject.getField=function(e){return fo(r.subject,e)},r.subject.addField=function(e){As([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.publicKey=null,r.attributes=[],r.getAttribute=function(e){return fo(r,e)},r.addAttribute=function(e){As([e]),r.attributes.push(e)},r.md=null,r.setSubject=function(e){As(e),r.subject.attributes=e,r.subject.hash=null},r.setAttributes=function(e){As(e),r.attributes=e},r.sign=function(e,t){r.md=t||rt.md.sha1.create();var n=Vt[r.md.algorithm+"WithRSAEncryption"];if(!n){var s=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw s.algorithm=r.md.algorithm,s}r.signatureOid=r.siginfo.algorithmOid=n,r.certificationRequestInfo=ke.getCertificationRequestInfo(r);var i=_.toDer(r.certificationRequestInfo);r.md.update(i.getBytes()),r.signature=e.sign(r.md)},r.verify=function(){var e=!1,t=r.md;if(t===null){t=ov({signatureOid:r.signatureOid,type:"certification request"});var n=r.certificationRequestInfo||ke.getCertificationRequestInfo(r),s=_.toDer(n);t.update(s.getBytes())}return t!==null&&(e=rB({certificate:r,md:t,signature:r.signature})),e},r};function Cf(r){for(var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),t,n,s=r.attributes,i=0;i<s.length;++i){t=s[i];var a=t.value,o=_.Type.PRINTABLESTRING;"valueTagClass"in t&&(o=t.valueTagClass,o===_.Type.UTF8&&(a=rt.util.encodeUtf8(a))),n=_.create(_.Class.UNIVERSAL,_.Type.SET,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(t.type).getBytes()),_.create(_.Class.UNIVERSAL,o,!1,a)])]),e.value.push(n)}return e}u(Cf,"_dnToAsn1");function As(r){for(var e,t=0;t<r.length;++t){if(e=r[t],typeof e.name>"u"&&(e.type&&e.type in ke.oids?e.name=ke.oids[e.type]:e.shortName&&e.shortName in Dr&&(e.name=ke.oids[Dr[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in ke.oids)e.type=ke.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in Dr&&(e.shortName=Dr[e.name]),e.type===Vt.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=_.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var s=0;s<e.extensions.length;++s)e.value.push(ke.certificateExtensionToAsn1(nB(e.extensions[s])))}if(typeof e.value>"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}u(As,"_fillMissingFields");function nB(r,e){if(e=e||{},typeof r.name>"u"&&r.id&&r.id in ke.oids&&(r.name=ke.oids[r.id]),typeof r.id>"u")if(r.name&&r.name in ke.oids)r.id=ke.oids[r.name];else{var t=new Error("Extension ID not specified.");throw t.extension=r,t}if(typeof r.value<"u")return r;if(r.name==="keyUsage"){var n=0,s=0,i=0;r.digitalSignature&&(s|=128,n=7),r.nonRepudiation&&(s|=64,n=6),r.keyEncipherment&&(s|=32,n=5),r.dataEncipherment&&(s|=16,n=4),r.keyAgreement&&(s|=8,n=3),r.keyCertSign&&(s|=4,n=2),r.cRLSign&&(s|=2,n=1),r.encipherOnly&&(s|=1,n=0),r.decipherOnly&&(i|=128,n=7);var a=String.fromCharCode(n);i!==0?a+=String.fromCharCode(s)+String.fromCharCode(i):s!==0&&(a+=String.fromCharCode(s)),r.value=_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,a)}else if(r.name==="basicConstraints")r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),r.cA&&r.value.value.push(_.create(_.Class.UNIVERSAL,_.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in r&&r.value.value.push(_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.pathLenConstraint).getBytes()));else if(r.name==="extKeyUsage"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);var o=r.value.value;for(var l in r)r[l]===!0&&(l in Vt?o.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(Vt[l]).getBytes())):l.indexOf(".")!==-1&&o.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(l).getBytes())))}else if(r.name==="nsCertType"){var n=0,s=0;r.client&&(s|=128,n=7),r.server&&(s|=64,n=6),r.email&&(s|=32,n=5),r.objsign&&(s|=16,n=4),r.reserved&&(s|=8,n=3),r.sslCA&&(s|=4,n=2),r.emailCA&&(s|=2,n=1),r.objCA&&(s|=1,n=0);var a=String.fromCharCode(n);s!==0&&(a+=String.fromCharCode(s)),r.value=_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,a)}else if(r.name==="subjectAltName"||r.name==="issuerAltName"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);for(var c,f=0;f<r.altNames.length;++f){c=r.altNames[f];var a=c.value;if(c.type===7&&c.ip){if(a=rt.util.bytesFromIP(c.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else c.type===8&&(c.oid?a=_.oidToDer(_.oidToDer(c.oid)):a=_.oidToDer(a));r.value.value.push(_.create(_.Class.CONTEXT_SPECIFIC,c.type,!1,a))}}else if(r.name==="nsComment"&&e.cert){if(!/^[\x00-\x7F]*$/.test(r.comment)||r.comment.length<1||r.comment.length>128)throw new Error('Invalid "nsComment" content.');r.value=_.create(_.Class.UNIVERSAL,_.Type.IA5STRING,!1,r.comment)}else if(r.name==="subjectKeyIdentifier"&&e.cert){var p=e.cert.generateSubjectKeyIdentifier();r.subjectKeyIdentifier=p.toHex(),r.value=_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,p.getBytes())}else if(r.name==="authorityKeyIdentifier"&&e.cert){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);var o=r.value.value;if(r.keyIdentifier){var d=r.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():r.keyIdentifier;o.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!1,d))}if(r.authorityCertIssuer){var g=[_.create(_.Class.CONTEXT_SPECIFIC,4,!0,[Cf(r.authorityCertIssuer===!0?e.cert.issuer:r.authorityCertIssuer)])];o.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,g))}if(r.serialNumber){var m=rt.util.hexToBytes(r.serialNumber===!0?e.cert.serialNumber:r.serialNumber);o.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if(r.name==="cRLDistributionPoints"){r.value=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);for(var o=r.value.value,v=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]),y=_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[]),c,f=0;f<r.altNames.length;++f){c=r.altNames[f];var a=c.value;if(c.type===7&&c.ip){if(a=rt.util.bytesFromIP(c.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else c.type===8&&(c.oid?a=_.oidToDer(_.oidToDer(c.oid)):a=_.oidToDer(a));y.value.push(_.create(_.Class.CONTEXT_SPECIFIC,c.type,!1,a))}v.value.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[y])),o.push(v)}if(typeof r.value>"u"){var t=new Error("Extension value not specified.");throw t.extension=r,t}return r}u(nB,"_fillMissingExtensionFields");function WA(r,e){switch(r){case Vt["RSASSA-PSS"]:var t=[];return e.hash.algorithmOid!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.hash.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,[_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.mgf.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(e.mgf.hash.algorithmOid).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&t.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(e.saltLength).getBytes())])),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,t);default:return _.create(_.Class.UNIVERSAL,_.Type.NULL,!1,"")}}u(WA,"_signatureParametersToAsn1");function WU(r){var e=_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[]);if(r.attributes.length===0)return e;for(var t=r.attributes,n=0;n<t.length;++n){var s=t[n],i=s.value,a=_.Type.UTF8;"valueTagClass"in s&&(a=s.valueTagClass),a===_.Type.UTF8&&(i=rt.util.encodeUtf8(i));var o=!1;"valueConstructed"in s&&(o=s.valueConstructed);var l=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(s.type).getBytes()),_.create(_.Class.UNIVERSAL,_.Type.SET,!0,[_.create(_.Class.UNIVERSAL,a,o,i)])]);e.value.push(l)}return e}u(WU,"_CRIAttributesToAsn1");var zU=new Date("1950-01-01T00:00:00Z"),JU=new Date("2050-01-01T00:00:00Z");function eB(r){return r>=zU&&r<JU?_.create(_.Class.UNIVERSAL,_.Type.UTCTIME,!1,_.dateToUtcTime(r)):_.create(_.Class.UNIVERSAL,_.Type.GENERALIZEDTIME,!1,_.dateToGeneralizedTime(r))}u(eB,"_dateToAsn1");ke.getTBSCertificate=function(r){var e=eB(r.validity.notBefore),t=eB(r.validity.notAfter),n=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.CONTEXT_SPECIFIC,0,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.version).getBytes())]),_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,rt.util.hexToBytes(r.serialNumber)),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.siginfo.algorithmOid).getBytes()),WA(r.siginfo.algorithmOid,r.siginfo.parameters)]),Cf(r.issuer),_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,t]),Cf(r.subject),ke.publicKeyToAsn1(r.publicKey)]);return r.issuer.uniqueId&&n.value.push(_.create(_.Class.CONTEXT_SPECIFIC,1,!0,[_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.issuer.uniqueId)])),r.subject.uniqueId&&n.value.push(_.create(_.Class.CONTEXT_SPECIFIC,2,!0,[_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.subject.uniqueId)])),r.extensions.length>0&&n.value.push(ke.certificateExtensionsToAsn1(r.extensions)),n};ke.getCertificationRequestInfo=function(r){var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.INTEGER,!1,_.integerToDer(r.version).getBytes()),Cf(r.subject),ke.publicKeyToAsn1(r.publicKey),WU(r)]);return e};ke.distinguishedNameToAsn1=function(r){return Cf(r)};ke.certificateToAsn1=function(r){var e=r.tbsCertificate||ke.getTBSCertificate(r);return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.signatureOid).getBytes()),WA(r.signatureOid,r.signatureParameters)]),_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.signature)])};ke.certificateExtensionsToAsn1=function(r){var e=_.create(_.Class.CONTEXT_SPECIFIC,3,!0,[]),t=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);e.value.push(t);for(var n=0;n<r.length;++n)t.value.push(ke.certificateExtensionToAsn1(r[n]));return e};ke.certificateExtensionToAsn1=function(r){var e=_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[]);e.value.push(_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.id).getBytes())),r.critical&&e.value.push(_.create(_.Class.UNIVERSAL,_.Type.BOOLEAN,!1,"\xFF"));var t=r.value;return typeof r.value!="string"&&(t=_.toDer(t).getBytes()),e.value.push(_.create(_.Class.UNIVERSAL,_.Type.OCTETSTRING,!1,t)),e};ke.certificationRequestToAsn1=function(r){var e=r.certificationRequestInfo||ke.getCertificationRequestInfo(r);return _.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[e,_.create(_.Class.UNIVERSAL,_.Type.SEQUENCE,!0,[_.create(_.Class.UNIVERSAL,_.Type.OID,!1,_.oidToDer(r.signatureOid).getBytes()),WA(r.signatureOid,r.signatureParameters)]),_.create(_.Class.UNIVERSAL,_.Type.BITSTRING,!1,"\0"+r.signature)])};ke.createCaStore=function(r){var e={certs:{}};e.getIssuer=function(a){var o=t(a.issuer);return o},e.addCertificate=function(a){if(typeof a=="string"&&(a=rt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))if(a.subject.hash in e.certs){var o=e.certs[a.subject.hash];rt.util.isArray(o)||(o=[o]),o.push(a),e.certs[a.subject.hash]=o}else e.certs[a.subject.hash]=a},e.hasCertificate=function(a){typeof a=="string"&&(a=rt.pki.certificateFromPem(a));var o=t(a.subject);if(!o)return!1;rt.util.isArray(o)||(o=[o]);for(var l=_.toDer(ke.certificateToAsn1(a)).getBytes(),c=0;c<o.length;++c){var f=_.toDer(ke.certificateToAsn1(o[c])).getBytes();if(l===f)return!0}return!1},e.listAllCertificates=function(){var a=[];for(var o in e.certs)if(e.certs.hasOwnProperty(o)){var l=e.certs[o];if(!rt.util.isArray(l))a.push(l);else for(var c=0;c<l.length;++c)a.push(l[c])}return a},e.removeCertificate=function(a){var o;if(typeof a=="string"&&(a=rt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))return null;var l=t(a.subject);if(!rt.util.isArray(l))return o=e.certs[a.subject.hash],delete e.certs[a.subject.hash],o;for(var c=_.toDer(ke.certificateToAsn1(a)).getBytes(),f=0;f<l.length;++f){var p=_.toDer(ke.certificateToAsn1(l[f])).getBytes();c===p&&(o=l[f],l.splice(f,1))}return l.length===0&&delete e.certs[a.subject.hash],o};function t(a){return n(a),e.certs[a.hash]||null}u(t,"getBySubject");function n(a){if(!a.hash){var o=rt.md.sha1.create();a.attributes=ke.RDNAttributesAsArray(Cf(a),o),a.hash=o.digest().toHex()}}if(u(n,"ensureSubjectHasHash"),r)for(var s=0;s<r.length;++s){var i=r[s];e.addCertificate(i)}return e};ke.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};ke.verifyCertificateChain=function(r,e,t){typeof t=="function"&&(t={verify:t}),t=t||{},e=e.slice(0);var n=e.slice(0),s=t.validityCheckDate;typeof s>"u"&&(s=new Date);var i=!0,a=null,o=0;do{var l=e.shift(),c=null,f=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(a={message:"Certificate is not valid yet or has expired.",error:ke.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),a===null){if(c=e[0]||r.getIssuer(l),c===null&&l.isIssuer(l)&&(f=!0,c=l),c){var p=c;rt.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){c=p.shift();try{d=c.verify(l)}catch{}}d||(a={message:"Certificate signature is invalid.",error:ke.certificateError.bad_certificate})}a===null&&(!c||f)&&!r.hasCertificate(l)&&(a={message:"Certificate is not trusted.",error:ke.certificateError.unknown_ca})}if(a===null&&c&&!l.isIssuer(c)&&(a={message:"Certificate issuer is invalid.",error:ke.certificateError.bad_certificate}),a===null)for(var g={keyUsage:!0,basicConstraints:!0},m=0;a===null&&m<l.extensions.length;++m){var v=l.extensions[m];v.critical&&!(v.name in g)&&(a={message:"Certificate has an unsupported critical extension.",error:ke.certificateError.unsupported_certificate})}if(a===null&&(!i||e.length===0&&(!c||f))){var y=l.getExtension("basicConstraints"),S=l.getExtension("keyUsage");if(S!==null&&(!S.keyCertSign||y===null)&&(a={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:ke.certificateError.bad_certificate}),a===null&&y===null&&(a={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:ke.certificateError.bad_certificate}),a===null&&y!==null&&!y.cA&&(a={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:ke.certificateError.bad_certificate}),a===null&&S!==null&&"pathLenConstraint"in y){var C=o-1;C>y.pathLenConstraint&&(a={message:"Certificate basicConstraints pathLenConstraint violated.",error:ke.certificateError.bad_certificate})}}var w=a===null?!0:a.error,E=t.verify?t.verify(w,o,n):w;if(E===!0)a=null;else throw w===!0&&(a={message:"The application rejected the certificate.",error:ke.certificateError.bad_certificate}),(E||E===0)&&(typeof E=="object"&&!rt.util.isArray(E)?(E.message&&(a.message=E.message),E.error&&(a.error=E.error)):typeof E=="string"&&(a.error=E)),a;i=!1,++o}while(e.length>0);return!0}});var JA=ue((jee,aB)=>{"use strict";var fr=bt();Js();gf();uo();GA();XA();Es();sd();wf();jt();uv();var G=fr.asn1,Dt=fr.pki,ad=aB.exports=fr.pkcs12=fr.pkcs12||{},iB={name:"ContentInfo",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},YU={name:"PFX",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,capture:"version"},iB,{name:"PFX.macData",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:G.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:G.Class.UNIVERSAL,type:G.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:G.Class.UNIVERSAL,type:G.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},QU={name:"SafeBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},ZU={name:"Attribute",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:G.Class.UNIVERSAL,type:G.Type.SET,constructed:!0,capture:"values"}]},eM={name:"CertBag",tagClass:G.Class.UNIVERSAL,type:G.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:G.Class.UNIVERSAL,type:G.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:G.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:G.Class.UNIVERSAL,type:G.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function id(r,e,t,n){for(var s=[],i=0;i<r.length;i++)for(var a=0;a<r[i].safeBags.length;a++){var o=r[i].safeBags[a];if(!(n!==void 0&&o.type!==n)){if(e===null){s.push(o);continue}o.attributes[e]!==void 0&&o.attributes[e].indexOf(t)>=0&&s.push(o)}}return s}u(id,"_getBagsByAttribute");ad.pkcs12FromAsn1=function(r,e,t){typeof e=="string"?(t=e,e=!0):e===void 0&&(e=!0);var n={},s=[];if(!G.validate(r,YU,n,s)){var i=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw i.errors=i,i}var a={version:n.version.charCodeAt(0),safeContents:[],getBags:u(function(y){var S={},C;return"localKeyId"in y?C=y.localKeyId:"localKeyIdHex"in y&&(C=fr.util.hexToBytes(y.localKeyIdHex)),C===void 0&&!("friendlyName"in y)&&"bagType"in y&&(S[y.bagType]=id(a.safeContents,null,null,y.bagType)),C!==void 0&&(S.localKeyId=id(a.safeContents,"localKeyId",C,y.bagType)),"friendlyName"in y&&(S.friendlyName=id(a.safeContents,"friendlyName",y.friendlyName,y.bagType)),S},"getBags"),getBagsByFriendlyName:u(function(y,S){return id(a.safeContents,"friendlyName",y,S)},"getBagsByFriendlyName"),getBagsByLocalKeyId:u(function(y,S){return id(a.safeContents,"localKeyId",y,S)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var i=new Error("PKCS#12 PFX of version other than 3 not supported.");throw i.version=n.version.charCodeAt(0),i}if(G.derToOid(n.contentType)!==Dt.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=G.derToOid(n.contentType),i}var o=n.content.value[0];if(o.tagClass!==G.Class.UNIVERSAL||o.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(o=zA(o),n.mac){var l=null,c=0,f=G.derToOid(n.macAlgorithm);switch(f){case Dt.oids.sha1:l=fr.md.sha1.create(),c=20;break;case Dt.oids.sha256:l=fr.md.sha256.create(),c=32;break;case Dt.oids.sha384:l=fr.md.sha384.create(),c=48;break;case Dt.oids.sha512:l=fr.md.sha512.create(),c=64;break;case Dt.oids.md5:l=fr.md.md5.create(),c=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var p=new fr.util.ByteBuffer(n.macSalt),d="macIterations"in n?parseInt(fr.util.bytesToHex(n.macIterations),16):1,g=ad.generateKey(t,p,3,d,c,l),m=fr.hmac.create();m.start(l,g),m.update(o.value);var v=m.getMac();if(v.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(r.value)&&r.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return tM(a,o.value,e,t),a};function zA(r){if(r.composed||r.constructed){for(var e=fr.util.createBuffer(),t=0;t<r.value.length;++t)e.putBytes(r.value[t].value);r.composed=r.constructed=!1,r.value=e.getBytes()}return r}u(zA,"_decodePkcs7Data");function tM(r,e,t,n){if(e=G.fromDer(e,t),e.tagClass!==G.Class.UNIVERSAL||e.type!==G.Type.SEQUENCE||e.constructed!==!0)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var s=0;s<e.value.length;s++){var i=e.value[s],a={},o=[];if(!G.validate(i,iB,a,o)){var l=new Error("Cannot read ContentInfo.");throw l.errors=o,l}var c={encrypted:!1},f=null,p=a.content.value[0];switch(G.derToOid(a.contentType)){case Dt.oids.data:if(p.tagClass!==G.Class.UNIVERSAL||p.type!==G.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");f=zA(p).value;break;case Dt.oids.encryptedData:f=rM(p,n),c.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=G.derToOid(a.contentType),l}c.safeBags=nM(f,t,n),r.safeContents.push(c)}}u(tM,"_decodeAuthenticatedSafe");function rM(r,e){var t={},n=[];if(!G.validate(r,fr.pkcs7.asn1.encryptedDataValidator,t,n)){var s=new Error("Cannot read EncryptedContentInfo.");throw s.errors=n,s}var i=G.derToOid(t.contentType);if(i!==Dt.oids.data){var s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw s.oid=i,s}i=G.derToOid(t.encAlgorithm);var a=Dt.pbe.getCipher(i,t.encParameter,e),o=zA(t.encryptedContentAsn1),l=fr.util.createBuffer(o.value);if(a.update(l),!a.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return a.output.getBytes()}u(rM,"_decryptSafeContents");function nM(r,e,t){if(!e&&r.length===0)return[];if(r=G.fromDer(r,e),r.tagClass!==G.Class.UNIVERSAL||r.type!==G.Type.SEQUENCE||r.constructed!==!0)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],s=0;s<r.value.length;s++){var i=r.value[s],a={},o=[];if(!G.validate(i,QU,a,o)){var l=new Error("Cannot read SafeBag.");throw l.errors=o,l}var c={type:G.derToOid(a.bagId),attributes:sM(a.bagAttributes)};n.push(c);var f,p,d=a.bagValue.value[0];switch(c.type){case Dt.oids.pkcs8ShroudedKeyBag:if(d=Dt.decryptPrivateKeyInfo(d,t),d===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Dt.oids.keyBag:try{c.key=Dt.privateKeyFromAsn1(d)}catch{c.key=null,c.asn1=d}continue;case Dt.oids.certBag:f=eM,p=u(function(){if(G.derToOid(a.certId)!==Dt.oids.x509Certificate){var m=new Error("Unsupported certificate type, only X.509 supported.");throw m.oid=G.derToOid(a.certId),m}var v=G.fromDer(a.cert,e);try{c.cert=Dt.certificateFromAsn1(v,!0)}catch{c.cert=null,c.asn1=v}},"decoder");break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=c.type,l}if(f!==void 0&&!G.validate(d,f,a,o)){var l=new Error("Cannot read PKCS#12 "+f.name);throw l.errors=o,l}p()}return n}u(nM,"_decodeSafeContents");function sM(r){var e={};if(r!==void 0)for(var t=0;t<r.length;++t){var n={},s=[];if(!G.validate(r[t],ZU,n,s)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=s,i}var a=G.derToOid(n.oid);if(Dt.oids[a]!==void 0){e[Dt.oids[a]]=[];for(var o=0;o<n.values.length;++o)e[Dt.oids[a]].push(n.values[o].value)}}return e}u(sM,"_decodeBagAttributes");ad.toPkcs12Asn1=function(r,e,t,n){n=n||{},n.saltSize=n.saltSize||8,n.count=n.count||2048,n.algorithm=n.algorithm||n.encAlgorithm||"aes128","useMac"in n||(n.useMac=!0),"localKeyId"in n||(n.localKeyId=null),"generateLocalKeyId"in n||(n.generateLocalKeyId=!0);var s=n.localKeyId,i;if(s!==null)s=fr.util.hexToBytes(s);else if(n.generateLocalKeyId)if(e){var a=fr.util.isArray(e)?e[0]:e;typeof a=="string"&&(a=Dt.certificateFromPem(a));var o=fr.md.sha1.create();o.update(G.toDer(Dt.certificateToAsn1(a)).getBytes()),s=o.digest().getBytes()}else s=fr.random.getBytes(20);var l=[];s!==null&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.localKeyId).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,s)])])),"friendlyName"in n&&l.push(G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.friendlyName).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SET,!0,[G.create(G.Class.UNIVERSAL,G.Type.BMPSTRING,!1,n.friendlyName)])])),l.length>0&&(i=G.create(G.Class.UNIVERSAL,G.Type.SET,!0,l));var c=[],f=[];e!==null&&(fr.util.isArray(e)?f=e:f=[e]);for(var p=[],d=0;d<f.length;++d){e=f[d],typeof e=="string"&&(e=Dt.certificateFromPem(e));var g=d===0?i:void 0,m=Dt.certificateToAsn1(e),v=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.certBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.x509Certificate).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(m).getBytes())])])]),g]);p.push(v)}if(p.length>0){var y=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,p),S=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(y).getBytes())])]);c.push(S)}var C=null;if(r!==null){var w=Dt.wrapRsaPrivateKey(Dt.privateKeyToAsn1(r));t===null?C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.keyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[w]),i]):C=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.pkcs8ShroudedKeyBag).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[Dt.encryptPrivateKeyInfo(w,t,n)]),i]);var E=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[C]),A=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(E).getBytes())])]);c.push(A)}var b=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,c),V;if(n.useMac){var o=fr.md.sha1.create(),I=new fr.util.ByteBuffer(fr.random.getBytes(n.saltSize)),D=n.count,r=ad.generateKey(t,I,3,D,20),U=fr.hmac.create();U.start(o,r),U.update(G.toDer(b).getBytes());var F=U.getMac();V=G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.sha1).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.NULL,!1,"")]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,F.getBytes())]),G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,I.getBytes()),G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(D).getBytes())])}return G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.INTEGER,!1,G.integerToDer(3).getBytes()),G.create(G.Class.UNIVERSAL,G.Type.SEQUENCE,!0,[G.create(G.Class.UNIVERSAL,G.Type.OID,!1,G.oidToDer(Dt.oids.data).getBytes()),G.create(G.Class.CONTEXT_SPECIFIC,0,!0,[G.create(G.Class.UNIVERSAL,G.Type.OCTETSTRING,!1,G.toDer(b).getBytes())])]),V])};ad.generateKey=fr.pbe.generatePkcs12Key});var QA=ue((Hee,oB)=>{"use strict";var ho=bt();Js();uo();XA();zu();Qy();JA();iv();sd();jt();uv();var YA=ho.asn1,xf=oB.exports=ho.pki=ho.pki||{};xf.pemToDer=function(r){var e=ho.pem.decode(r)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return ho.util.createBuffer(e.body)};xf.privateKeyFromPem=function(r){var e=ho.pem.decode(r)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var t=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=YA.fromDer(e.body);return xf.privateKeyFromAsn1(n)};xf.privateKeyToPem=function(r,e){var t={type:"RSA PRIVATE KEY",body:YA.toDer(xf.privateKeyToAsn1(r)).getBytes()};return ho.pem.encode(t,{maxline:e})};xf.privateKeyInfoToPem=function(r,e){var t={type:"PRIVATE KEY",body:YA.toDer(r).getBytes()};return ho.pem.encode(t,{maxline:e})}});var sC=ue((Kee,mB)=>{"use strict";var be=bt();Js();gf();Wy();zu();QA();Es();wf();jt();var hv=u(function(r,e,t,n){var s=be.util.createBuffer(),i=r.length>>1,a=i+(r.length&1),o=r.substr(0,a),l=r.substr(i,a),c=be.util.createBuffer(),f=be.hmac.create();t=e+t;var p=Math.ceil(n/16),d=Math.ceil(n/20);f.start("MD5",o);var g=be.util.createBuffer();c.putBytes(t);for(var m=0;m<p;++m)f.start(null,null),f.update(c.getBytes()),c.putBuffer(f.digest()),f.start(null,null),f.update(c.bytes()+t),g.putBuffer(f.digest());f.start("SHA1",l);var v=be.util.createBuffer();c.clear(),c.putBytes(t);for(var m=0;m<d;++m)f.start(null,null),f.update(c.getBytes()),c.putBuffer(f.digest()),f.start(null,null),f.update(c.bytes()+t),v.putBuffer(f.digest());return s.putBytes(be.util.xorBytes(g.getBytes(),v.getBytes(),n)),s},"prf_TLS1"),iM=u(function(r,e,t){var n=be.hmac.create();n.start("SHA1",r);var s=be.util.createBuffer();return s.putInt32(e[0]),s.putInt32(e[1]),s.putByte(t.type),s.putByte(t.version.major),s.putByte(t.version.minor),s.putInt16(t.length),s.putBytes(t.fragment.bytes()),n.update(s.getBytes()),n.digest().getBytes()},"hmac_sha1"),aM=u(function(r,e,t){var n=!1;try{var s=r.deflate(e.fragment.getBytes());e.fragment=be.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"deflate"),oM=u(function(r,e,t){var n=!1;try{var s=r.inflate(e.fragment.getBytes());e.fragment=be.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"inflate"),us=u(function(r,e){var t=0;switch(e){case 1:t=r.getByte();break;case 2:t=r.getInt16();break;case 3:t=r.getInt24();break;case 4:t=r.getInt32();break}return be.util.createBuffer(r.getBytes(t))},"readVector"),Cs=u(function(r,e,t){r.putInt(t.length(),e<<3),r.putBuffer(t)},"writeVector"),L={};L.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};L.SupportedVersions=[L.Versions.TLS_1_1,L.Versions.TLS_1_0];L.Version=L.SupportedVersions[0];L.MaxFragment=15360;L.ConnectionEnd={server:0,client:1};L.PRFAlgorithm={tls_prf_sha256:0};L.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};L.CipherType={stream:0,block:1,aead:2};L.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};L.CompressionMethod={none:0,deflate:1};L.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};L.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};L.Alert={};L.Alert.Level={warning:1,fatal:2};L.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};L.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};L.CipherSuites={};L.getCipherSuite=function(r){var e=null;for(var t in L.CipherSuites){var n=L.CipherSuites[t];if(n.id[0]===r.charCodeAt(0)&&n.id[1]===r.charCodeAt(1)){e=n;break}}return e};L.handleUnexpected=function(r,e){var t=!r.open&&r.entity===L.ConnectionEnd.client;t||r.error(r,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})};L.handleHelloRequest=function(r,e,t){!r.handshaking&&r.handshakes>0&&(L.queue(r,L.createAlert(r,{level:L.Alert.Level.warning,description:L.Alert.Description.no_renegotiation})),L.flush(r)),r.process()};L.parseHelloMessage=function(r,e,t){var n=null,s=r.entity===L.ConnectionEnd.client;if(t<38)r.error(r,{message:s?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});else{var i=e.fragment,a=i.length();if(n={version:{major:i.getByte(),minor:i.getByte()},random:be.util.createBuffer(i.getBytes(32)),session_id:us(i,1),extensions:[]},s?(n.cipher_suite=i.getBytes(2),n.compression_method=i.getByte()):(n.cipher_suites=us(i,2),n.compression_methods=us(i,1)),a=t-(a-i.length()),a>0){for(var o=us(i,2);o.length()>0;)n.extensions.push({type:[o.getByte(),o.getByte()],data:us(o,2)});if(!s)for(var l=0;l<n.extensions.length;++l){var c=n.extensions[l];if(c.type[0]===0&&c.type[1]===0)for(var f=us(c.data,2);f.length()>0;){var p=f.getByte();if(p!==0)break;r.session.extensions.server_name.serverNameList.push(us(f,2).getBytes())}}}if(r.session.version&&(n.version.major!==r.session.version.major||n.version.minor!==r.session.version.minor))return r.error(r,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});if(s)r.session.cipherSuite=L.getCipherSuite(n.cipher_suite);else for(var d=be.util.createBuffer(n.cipher_suites.bytes());d.length()>0&&(r.session.cipherSuite=L.getCipherSuite(d.getBytes(2)),r.session.cipherSuite===null););if(r.session.cipherSuite===null)return r.error(r,{message:"No cipher suites in common.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure},cipherSuite:be.util.bytesToHex(n.cipher_suite)});s?r.session.compressionMethod=n.compression_method:r.session.compressionMethod=L.CompressionMethod.none}return n};L.createSecurityParameters=function(r,e){var t=r.entity===L.ConnectionEnd.client,n=e.random.bytes(),s=t?r.session.sp.client_random:n,i=t?n:L.createRandom().getBytes();r.session.sp={entity:r.entity,prf_algorithm:L.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:r.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:s,server_random:i}};L.handleServerHello=function(r,e,t){var n=L.parseHelloMessage(r,e,t);if(!r.fail){if(n.version.minor<=r.version.minor)r.version.minor=n.version.minor;else return r.error(r,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}});r.session.version=r.version;var s=n.session_id.bytes();s.length>0&&s===r.session.id?(r.expect=cB,r.session.resuming=!0,r.session.sp.server_random=n.random.bytes()):(r.expect=lM,r.session.resuming=!1,L.createSecurityParameters(r,n)),r.session.id=s,r.process()}};L.handleClientHello=function(r,e,t){var n=L.parseHelloMessage(r,e,t);if(!r.fail){var s=n.session_id.bytes(),i=null;if(r.sessionCache&&(i=r.sessionCache.getSession(s),i===null?s="":(i.version.major!==n.version.major||i.version.minor>n.version.minor)&&(i=null,s="")),s.length===0&&(s=be.random.getBytes(32)),r.session.id=s,r.session.clientHelloVersion=n.version,r.session.sp={},i)r.version=r.session.version=i.version,r.session.sp=i.sp;else{for(var a,o=1;o<L.SupportedVersions.length&&(a=L.SupportedVersions[o],!(a.minor<=n.version.minor));++o);r.version={major:a.major,minor:a.minor},r.session.version=r.version}i!==null?(r.expect=rC,r.session.resuming=!0,r.session.sp.client_random=n.random.bytes()):(r.expect=r.verifyClient!==!1?gM:tC,r.session.resuming=!1,L.createSecurityParameters(r,n)),r.open=!0,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerHello(r)})),r.session.resuming?(L.queue(r,L.createRecord(r,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),r.state.pending=L.createConnectionState(r),r.state.current.write=r.state.pending.write,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createFinished(r)}))):(L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificate(r)})),r.fail||(L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerKeyExchange(r)})),r.verifyClient!==!1&&L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificateRequest(r)})),L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createServerHelloDone(r)})))),L.flush(r),r.process()}};L.handleCertificate=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_list:us(n,3)},i,a,o=[];try{for(;s.certificate_list.length()>0;)i=us(s.certificate_list,3),a=be.asn1.fromDer(i),i=be.pki.certificateFromAsn1(a,!0),o.push(i)}catch(c){return r.error(r,{message:"Could not parse certificate list.",cause:c,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var l=r.entity===L.ConnectionEnd.client;(l||r.verifyClient===!0)&&o.length===0?r.error(r,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}}):o.length===0?r.expect=l?uB:tC:(l?r.session.serverCertificate=o[0]:r.session.clientCertificate=o[0],L.verifyCertificateChain(r,o)&&(r.expect=l?uB:tC)),r.process()};L.handleServerKeyExchange=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});r.expect=cM,r.process()};L.handleClientKeyExchange=function(r,e,t){if(t<48)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unsupported_certificate}});var n=e.fragment,s={enc_pre_master_secret:us(n,2).getBytes()},i=null;if(r.getPrivateKey)try{i=r.getPrivateKey(r,r.session.serverCertificate),i=be.pki.privateKeyFromPem(i)}catch(l){r.error(r,{message:"Could not get private key.",cause:l,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}if(i===null)return r.error(r,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}});try{var a=r.session.sp;a.pre_master_secret=i.decrypt(s.enc_pre_master_secret);var o=r.session.clientHelloVersion;if(o.major!==a.pre_master_secret.charCodeAt(0)||o.minor!==a.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{a.pre_master_secret=be.random.getBytes(48)}r.expect=rC,r.session.clientCertificate!==null&&(r.expect=yM),r.process()};L.handleCertificateRequest=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_types:us(n,1),certificate_authorities:us(n,2)};r.session.certificateRequest=s,r.expect=fM,r.process()};L.handleCertificateVerify=function(r,e,t){if(t<2)return r.error(r,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i={signature:us(n,2).getBytes()},a=be.util.createBuffer();a.putBuffer(r.session.md5.digest()),a.putBuffer(r.session.sha1.digest()),a=a.getBytes();try{var o=r.session.clientCertificate;if(!o.publicKey.verify(a,i.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");r.session.md5.update(s),r.session.sha1.update(s)}catch{return r.error(r,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.handshake_failure}})}r.expect=rC,r.process()};L.handleServerHelloDone=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.record_overflow}});if(r.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.insufficient_security}},s=0,i=r.verify(r,n.alert.description,s,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!be.util.isArray(i)?(i.message&&(n.message=i.message),i.alert&&(n.alert.description=i.alert)):typeof i=="number"&&(n.alert.description=i)),r.error(r,n)}r.session.certificateRequest!==null&&(e=L.createRecord(r,{type:L.ContentType.handshake,data:L.createCertificate(r)}),L.queue(r,e)),e=L.createRecord(r,{type:L.ContentType.handshake,data:L.createClientKeyExchange(r)}),L.queue(r,e),r.expect=dM;var a=u(function(o,l){o.session.certificateRequest!==null&&o.session.clientCertificate!==null&&L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createCertificateVerify(o,l)})),L.queue(o,L.createRecord(o,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),o.state.pending=L.createConnectionState(o),o.state.current.write=o.state.pending.write,L.queue(o,L.createRecord(o,{type:L.ContentType.handshake,data:L.createFinished(o)})),o.expect=cB,L.flush(o),o.process()},"callback");if(r.session.certificateRequest===null||r.session.clientCertificate===null)return a(r,null);L.getClientSignature(r,a)};L.handleChangeCipherSpec=function(r,e){if(e.fragment.getByte()!==1)return r.error(r,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.illegal_parameter}});var t=r.entity===L.ConnectionEnd.client;(r.session.resuming&&t||!r.session.resuming&&!t)&&(r.state.pending=L.createConnectionState(r)),r.state.current.read=r.state.pending.read,(!r.session.resuming&&t||r.session.resuming&&!t)&&(r.state.pending=null),r.expect=t?hM:vM,r.process()};L.handleFinished=function(r,e,t){var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i=e.fragment.getBytes();n=be.util.createBuffer(),n.putBuffer(r.session.md5.digest()),n.putBuffer(r.session.sha1.digest());var a=r.entity===L.ConnectionEnd.client,o=a?"server finished":"client finished",l=r.session.sp,c=12,f=hv;if(n=f(l.master_secret,o,n.getBytes(),c),n.getBytes()!==i)return r.error(r,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decrypt_error}});r.session.md5.update(s),r.session.sha1.update(s),(r.session.resuming&&a||!r.session.resuming&&!a)&&(L.queue(r,L.createRecord(r,{type:L.ContentType.change_cipher_spec,data:L.createChangeCipherSpec()})),r.state.current.write=r.state.pending.write,r.state.pending=null,L.queue(r,L.createRecord(r,{type:L.ContentType.handshake,data:L.createFinished(r)}))),r.expect=a?pM:EM,r.handshaking=!1,++r.handshakes,r.peerCertificate=a?r.session.serverCertificate:r.session.clientCertificate,L.flush(r),r.isConnected=!0,r.connected(r),r.process()};L.handleAlert=function(r,e){var t=e.fragment,n={level:t.getByte(),description:t.getByte()},s;switch(n.description){case L.Alert.Description.close_notify:s="Connection closed.";break;case L.Alert.Description.unexpected_message:s="Unexpected message.";break;case L.Alert.Description.bad_record_mac:s="Bad record MAC.";break;case L.Alert.Description.decryption_failed:s="Decryption failed.";break;case L.Alert.Description.record_overflow:s="Record overflow.";break;case L.Alert.Description.decompression_failure:s="Decompression failed.";break;case L.Alert.Description.handshake_failure:s="Handshake failure.";break;case L.Alert.Description.bad_certificate:s="Bad certificate.";break;case L.Alert.Description.unsupported_certificate:s="Unsupported certificate.";break;case L.Alert.Description.certificate_revoked:s="Certificate revoked.";break;case L.Alert.Description.certificate_expired:s="Certificate expired.";break;case L.Alert.Description.certificate_unknown:s="Certificate unknown.";break;case L.Alert.Description.illegal_parameter:s="Illegal parameter.";break;case L.Alert.Description.unknown_ca:s="Unknown certificate authority.";break;case L.Alert.Description.access_denied:s="Access denied.";break;case L.Alert.Description.decode_error:s="Decode error.";break;case L.Alert.Description.decrypt_error:s="Decrypt error.";break;case L.Alert.Description.export_restriction:s="Export restriction.";break;case L.Alert.Description.protocol_version:s="Unsupported protocol version.";break;case L.Alert.Description.insufficient_security:s="Insufficient security.";break;case L.Alert.Description.internal_error:s="Internal error.";break;case L.Alert.Description.user_canceled:s="User canceled.";break;case L.Alert.Description.no_renegotiation:s="Renegotiation not supported.";break;default:s="Unknown error.";break}if(n.description===L.Alert.Description.close_notify)return r.close();r.error(r,{message:s,send:!1,origin:r.entity===L.ConnectionEnd.client?"server":"client",alert:n}),r.process()};L.handleHandshake=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt24();if(s>t.length())return r.fragmented=e,e.fragment=be.util.createBuffer(),t.read-=4,r.process();r.fragmented=null,t.read-=4;var i=t.bytes(s+4);t.read+=4,n in fv[r.entity][r.expect]?(r.entity===L.ConnectionEnd.server&&!r.open&&!r.fail&&(r.handshaking=!0,r.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:be.md.md5.create(),sha1:be.md.sha1.create()}),n!==L.HandshakeType.hello_request&&n!==L.HandshakeType.certificate_verify&&n!==L.HandshakeType.finished&&(r.session.md5.update(i),r.session.sha1.update(i)),fv[r.entity][r.expect][n](r,e,s)):L.handleUnexpected(r,e)};L.handleApplicationData=function(r,e){r.data.putBuffer(e.fragment),r.dataReady(r),r.process()};L.handleHeartbeat=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt16(),i=t.getBytes(s);if(n===L.HeartbeatMessageType.heartbeat_request){if(r.handshaking||s>i.length)return r.process();L.queue(r,L.createRecord(r,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_response,i)})),L.flush(r)}else if(n===L.HeartbeatMessageType.heartbeat_response){if(i!==r.expectedHeartbeatPayload)return r.process();r.heartbeatReceived&&r.heartbeatReceived(r,be.util.createBuffer(i))}r.process()};var uM=0,lM=1,uB=2,cM=3,fM=4,cB=5,hM=6,pM=7,dM=8,mM=0,gM=1,tC=2,yM=3,rC=4,vM=5,EM=6,k=L.handleUnexpected,fB=L.handleChangeCipherSpec,pn=L.handleAlert,Pn=L.handleHandshake,hB=L.handleApplicationData,dn=L.handleHeartbeat,nC=[];nC[L.ConnectionEnd.client]=[[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[fB,pn,k,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,hB,dn],[k,pn,Pn,k,dn]];nC[L.ConnectionEnd.server]=[[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,k,dn],[fB,pn,k,k,dn],[k,pn,Pn,k,dn],[k,pn,Pn,hB,dn],[k,pn,Pn,k,dn]];var po=L.handleHelloRequest,wM=L.handleServerHello,pB=L.handleCertificate,lB=L.handleServerKeyExchange,ZA=L.handleCertificateRequest,lv=L.handleServerHelloDone,dB=L.handleFinished,fv=[];fv[L.ConnectionEnd.client]=[[k,k,wM,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,pB,lB,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,lB,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,ZA,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,lv,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,dB],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[po,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]];var SM=L.handleClientHello,AM=L.handleClientKeyExchange,CM=L.handleCertificateVerify;fv[L.ConnectionEnd.server]=[[k,SM,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,pB,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,AM,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,CM,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,dB],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]];L.generateKeys=function(r,e){var t=hv,n=e.client_random+e.server_random;r.session.resuming||(e.master_secret=t(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var s=2*e.mac_key_length+2*e.enc_key_length,i=r.version.major===L.Versions.TLS_1_0.major&&r.version.minor===L.Versions.TLS_1_0.minor;i&&(s+=2*e.fixed_iv_length);var a=t(e.master_secret,"key expansion",n,s),o={client_write_MAC_key:a.getBytes(e.mac_key_length),server_write_MAC_key:a.getBytes(e.mac_key_length),client_write_key:a.getBytes(e.enc_key_length),server_write_key:a.getBytes(e.enc_key_length)};return i&&(o.client_write_IV=a.getBytes(e.fixed_iv_length),o.server_write_IV=a.getBytes(e.fixed_iv_length)),o};L.createConnectionState=function(r){var e=r.entity===L.ConnectionEnd.client,t=u(function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:u(function(a){return!0},"cipherFunction"),compressionState:null,compressFunction:u(function(a){return!0},"compressFunction"),updateSequenceNumber:u(function(){i.sequenceNumber[1]===4294967295?(i.sequenceNumber[1]=0,++i.sequenceNumber[0]):++i.sequenceNumber[1]},"updateSequenceNumber")};return i},"createMode"),n={read:t(),write:t()};if(n.read.update=function(i,a){return n.read.cipherFunction(a,n.read)?n.read.compressFunction(i,a,n.read)||i.error(i,{message:"Could not decompress record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_record_mac}}),!i.fail},n.write.update=function(i,a){return n.write.compressFunction(i,a,n.write)?n.write.cipherFunction(a,n.write)||i.error(i,{message:"Could not encrypt record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}),!i.fail},r.session){var s=r.session.sp;switch(r.session.cipherSuite.initSecurityParameters(s),s.keys=L.generateKeys(r,s),n.read.macKey=e?s.keys.server_write_MAC_key:s.keys.client_write_MAC_key,n.write.macKey=e?s.keys.client_write_MAC_key:s.keys.server_write_MAC_key,r.session.cipherSuite.initConnectionState(n,r,s),s.compression_algorithm){case L.CompressionMethod.none:break;case L.CompressionMethod.deflate:n.read.compressFunction=oM,n.write.compressFunction=aM;break;default:throw new Error("Unsupported compression algorithm.")}}return n};L.createRandom=function(){var r=new Date,e=+r+r.getTimezoneOffset()*6e4,t=be.util.createBuffer();return t.putInt32(e),t.putBytes(be.random.getBytes(28)),t};L.createRecord=function(r,e){if(!e.data)return null;var t={type:e.type,version:{major:r.version.major,minor:r.version.minor},length:e.data.length(),fragment:e.data};return t};L.createAlert=function(r,e){var t=be.util.createBuffer();return t.putByte(e.level),t.putByte(e.description),L.createRecord(r,{type:L.ContentType.alert,data:t})};L.createClientHello=function(r){r.session.clientHelloVersion={major:r.version.major,minor:r.version.minor};for(var e=be.util.createBuffer(),t=0;t<r.cipherSuites.length;++t){var n=r.cipherSuites[t];e.putByte(n.id[0]),e.putByte(n.id[1])}var s=e.length(),i=be.util.createBuffer();i.putByte(L.CompressionMethod.none);var a=i.length(),o=be.util.createBuffer();if(r.virtualHost){var l=be.util.createBuffer();l.putByte(0),l.putByte(0);var c=be.util.createBuffer();c.putByte(0),Cs(c,2,be.util.createBuffer(r.virtualHost));var f=be.util.createBuffer();Cs(f,2,c),Cs(l,2,f),o.putBuffer(l)}var p=o.length();p>0&&(p+=2);var d=r.session.id,g=d.length+1+2+4+28+2+s+1+a+p,m=be.util.createBuffer();return m.putByte(L.HandshakeType.client_hello),m.putInt24(g),m.putByte(r.version.major),m.putByte(r.version.minor),m.putBytes(r.session.sp.client_random),Cs(m,1,be.util.createBuffer(d)),Cs(m,2,e),Cs(m,1,i),p>0&&Cs(m,2,o),m};L.createServerHello=function(r){var e=r.session.id,t=e.length+1+2+4+28+2+1,n=be.util.createBuffer();return n.putByte(L.HandshakeType.server_hello),n.putInt24(t),n.putByte(r.version.major),n.putByte(r.version.minor),n.putBytes(r.session.sp.server_random),Cs(n,1,be.util.createBuffer(e)),n.putByte(r.session.cipherSuite.id[0]),n.putByte(r.session.cipherSuite.id[1]),n.putByte(r.session.compressionMethod),n};L.createCertificate=function(r){var e=r.entity===L.ConnectionEnd.client,t=null;if(r.getCertificate){var n;e?n=r.session.certificateRequest:n=r.session.extensions.server_name.serverNameList,t=r.getCertificate(r,n)}var s=be.util.createBuffer();if(t!==null)try{be.util.isArray(t)||(t=[t]);for(var i=null,a=0;a<t.length;++a){var o=be.pem.decode(t[a])[0];if(o.type!=="CERTIFICATE"&&o.type!=="X509 CERTIFICATE"&&o.type!=="TRUSTED CERTIFICATE"){var l=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw l.headerType=o.type,l}if(o.procType&&o.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var c=be.util.createBuffer(o.body);i===null&&(i=be.asn1.fromDer(c.bytes(),!1));var f=be.util.createBuffer();Cs(f,3,c),s.putBuffer(f)}t=be.pki.certificateFromAsn1(i),e?r.session.clientCertificate=t:r.session.serverCertificate=t}catch(g){return r.error(r,{message:"Could not send certificate list.",cause:g,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate}})}var p=3+s.length(),d=be.util.createBuffer();return d.putByte(L.HandshakeType.certificate),d.putInt24(p),Cs(d,3,s),d};L.createClientKeyExchange=function(r){var e=be.util.createBuffer();e.putByte(r.session.clientHelloVersion.major),e.putByte(r.session.clientHelloVersion.minor),e.putBytes(be.random.getBytes(46));var t=r.session.sp;t.pre_master_secret=e.getBytes();var n=r.session.serverCertificate.publicKey;e=n.encrypt(t.pre_master_secret);var s=e.length+2,i=be.util.createBuffer();return i.putByte(L.HandshakeType.client_key_exchange),i.putInt24(s),i.putInt16(e.length),i.putBytes(e),i};L.createServerKeyExchange=function(r){var e=0,t=be.util.createBuffer();return e>0&&(t.putByte(L.HandshakeType.server_key_exchange),t.putInt24(e)),t};L.getClientSignature=function(r,e){var t=be.util.createBuffer();t.putBuffer(r.session.md5.digest()),t.putBuffer(r.session.sha1.digest()),t=t.getBytes(),r.getSignature=r.getSignature||function(n,s,i){var a=null;if(n.getPrivateKey)try{a=n.getPrivateKey(n,n.session.clientCertificate),a=be.pki.privateKeyFromPem(a)}catch(o){n.error(n,{message:"Could not get private key.",cause:o,send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}})}a===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.internal_error}}):s=a.sign(s,null),i(n,s)},r.getSignature(r,t,e)};L.createCertificateVerify=function(r,e){var t=e.length+2,n=be.util.createBuffer();return n.putByte(L.HandshakeType.certificate_verify),n.putInt24(t),n.putInt16(e.length),n.putBytes(e),n};L.createCertificateRequest=function(r){var e=be.util.createBuffer();e.putByte(1);var t=be.util.createBuffer();for(var n in r.caStore.certs){var s=r.caStore.certs[n],i=be.pki.distinguishedNameToAsn1(s.subject),a=be.asn1.toDer(i);t.putInt16(a.length()),t.putBuffer(a)}var o=1+e.length()+2+t.length(),l=be.util.createBuffer();return l.putByte(L.HandshakeType.certificate_request),l.putInt24(o),Cs(l,1,e),Cs(l,2,t),l};L.createServerHelloDone=function(r){var e=be.util.createBuffer();return e.putByte(L.HandshakeType.server_hello_done),e.putInt24(0),e};L.createChangeCipherSpec=function(){var r=be.util.createBuffer();return r.putByte(1),r};L.createFinished=function(r){var e=be.util.createBuffer();e.putBuffer(r.session.md5.digest()),e.putBuffer(r.session.sha1.digest());var t=r.entity===L.ConnectionEnd.client,n=r.session.sp,s=12,i=hv,a=t?"client finished":"server finished";e=i(n.master_secret,a,e.getBytes(),s);var o=be.util.createBuffer();return o.putByte(L.HandshakeType.finished),o.putInt24(e.length()),o.putBuffer(e),o};L.createHeartbeat=function(r,e,t){typeof t>"u"&&(t=e.length);var n=be.util.createBuffer();n.putByte(r),n.putInt16(t),n.putBytes(e);var s=n.length(),i=Math.max(16,s-t-3);return n.putBytes(be.random.getBytes(i)),n};L.queue=function(r,e){if(e&&!(e.fragment.length()===0&&(e.type===L.ContentType.handshake||e.type===L.ContentType.alert||e.type===L.ContentType.change_cipher_spec))){if(e.type===L.ContentType.handshake){var t=e.fragment.bytes();r.session.md5.update(t),r.session.sha1.update(t),t=null}var n;if(e.fragment.length()<=L.MaxFragment)n=[e];else{n=[];for(var s=e.fragment.bytes();s.length>L.MaxFragment;)n.push(L.createRecord(r,{type:e.type,data:be.util.createBuffer(s.slice(0,L.MaxFragment))})),s=s.slice(L.MaxFragment);s.length>0&&n.push(L.createRecord(r,{type:e.type,data:be.util.createBuffer(s)}))}for(var i=0;i<n.length&&!r.fail;++i){var a=n[i],o=r.state.current.write;o.update(r,a)&&r.records.push(a)}}};L.flush=function(r){for(var e=0;e<r.records.length;++e){var t=r.records[e];r.tlsData.putByte(t.type),r.tlsData.putByte(t.version.major),r.tlsData.putByte(t.version.minor),r.tlsData.putInt16(t.fragment.length()),r.tlsData.putBuffer(r.records[e].fragment)}return r.records=[],r.tlsDataReady(r)};var eC=u(function(r){switch(r){case!0:return!0;case be.pki.certificateError.bad_certificate:return L.Alert.Description.bad_certificate;case be.pki.certificateError.unsupported_certificate:return L.Alert.Description.unsupported_certificate;case be.pki.certificateError.certificate_revoked:return L.Alert.Description.certificate_revoked;case be.pki.certificateError.certificate_expired:return L.Alert.Description.certificate_expired;case be.pki.certificateError.certificate_unknown:return L.Alert.Description.certificate_unknown;case be.pki.certificateError.unknown_ca:return L.Alert.Description.unknown_ca;default:return L.Alert.Description.bad_certificate}},"_certErrorToAlertDesc"),xM=u(function(r){switch(r){case!0:return!0;case L.Alert.Description.bad_certificate:return be.pki.certificateError.bad_certificate;case L.Alert.Description.unsupported_certificate:return be.pki.certificateError.unsupported_certificate;case L.Alert.Description.certificate_revoked:return be.pki.certificateError.certificate_revoked;case L.Alert.Description.certificate_expired:return be.pki.certificateError.certificate_expired;case L.Alert.Description.certificate_unknown:return be.pki.certificateError.certificate_unknown;case L.Alert.Description.unknown_ca:return be.pki.certificateError.unknown_ca;default:return be.pki.certificateError.bad_certificate}},"_alertDescToCertError");L.verifyCertificateChain=function(r,e){try{var t={};for(var n in r.verifyOptions)t[n]=r.verifyOptions[n];t.verify=function(i,a,o){var l=eC(i),c=r.verify(r,i,a,o);if(c!==!0){if(typeof c=="object"&&!be.util.isArray(c)){var f=new Error("The application rejected the certificate.");throw f.send=!0,f.alert={level:L.Alert.Level.fatal,description:L.Alert.Description.bad_certificate},c.message&&(f.message=c.message),c.alert&&(f.alert.description=c.alert),f}c!==i&&(c=xM(c))}return c},be.pki.verifyCertificateChain(r.caStore,e,t)}catch(i){var s=i;(typeof s!="object"||be.util.isArray(s))&&(s={send:!0,alert:{level:L.Alert.Level.fatal,description:eC(i)}}),"send"in s||(s.send=!0),"alert"in s||(s.alert={level:L.Alert.Level.fatal,description:eC(s.error)}),r.error(r,s)}return!r.fail};L.createSessionCache=function(r,e){var t=null;if(r&&r.getSession&&r.setSession&&r.order)t=r;else{t={},t.cache=r||{},t.capacity=Math.max(e||100,1),t.order=[];for(var n in r)t.order.length<=e?t.order.push(n):delete r[n];t.getSession=function(s){var i=null,a=null;if(s?a=be.util.bytesToHex(s):t.order.length>0&&(a=t.order[0]),a!==null&&a in t.cache){i=t.cache[a],delete t.cache[a];for(var o in t.order)if(t.order[o]===a){t.order.splice(o,1);break}}return i},t.setSession=function(s,i){if(t.order.length===t.capacity){var a=t.order.shift();delete t.cache[a]}var a=be.util.bytesToHex(s);t.order.push(a),t.cache[a]=i}}return t};L.createConnection=function(r){var e=null;r.caStore?be.util.isArray(r.caStore)?e=be.pki.createCaStore(r.caStore):e=r.caStore:e=be.pki.createCaStore();var t=r.cipherSuites||null;if(t===null){t=[];for(var n in L.CipherSuites)t.push(L.CipherSuites[n])}var s=r.server?L.ConnectionEnd.server:L.ConnectionEnd.client,i=r.sessionCache?L.createSessionCache(r.sessionCache):null,a={version:{major:L.Version.major,minor:L.Version.minor},entity:s,sessionId:r.sessionId,caStore:e,sessionCache:i,cipherSuites:t,connected:r.connected,virtualHost:r.virtualHost||null,verifyClient:r.verifyClient||!1,verify:r.verify||function(f,p,d,g){return p},verifyOptions:r.verifyOptions||{},getCertificate:r.getCertificate||null,getPrivateKey:r.getPrivateKey||null,getSignature:r.getSignature||null,input:be.util.createBuffer(),tlsData:be.util.createBuffer(),data:be.util.createBuffer(),tlsDataReady:r.tlsDataReady,dataReady:r.dataReady,heartbeatReceived:r.heartbeatReceived,closed:r.closed,error:u(function(f,p){p.origin=p.origin||(f.entity===L.ConnectionEnd.client?"client":"server"),p.send&&(L.queue(f,L.createAlert(f,p.alert)),L.flush(f));var d=p.fatal!==!1;d&&(f.fail=!0),r.error(f,p),d&&f.close(!1)},"error"),deflate:r.deflate||null,inflate:r.inflate||null};a.reset=function(f){a.version={major:L.Version.major,minor:L.Version.minor},a.record=null,a.session=null,a.peerCertificate=null,a.state={pending:null,current:null},a.expect=a.entity===L.ConnectionEnd.client?uM:mM,a.fragmented=null,a.records=[],a.open=!1,a.handshakes=0,a.handshaking=!1,a.isConnected=!1,a.fail=!(f||typeof f>"u"),a.input.clear(),a.tlsData.clear(),a.data.clear(),a.state.current=L.createConnectionState(a)},a.reset();var o=u(function(f,p){var d=p.type-L.ContentType.change_cipher_spec,g=nC[f.entity][f.expect];d in g?g[d](f,p):L.handleUnexpected(f,p)},"_update"),l=u(function(f){var p=0,d=f.input,g=d.length();if(g<5)p=5-g;else{f.record={type:d.getByte(),version:{major:d.getByte(),minor:d.getByte()},length:d.getInt16(),fragment:be.util.createBuffer(),ready:!1};var m=f.record.version.major===f.version.major;m&&f.session&&f.session.version&&(m=f.record.version.minor===f.version.minor),m||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.protocol_version}})}return p},"_readRecordHeader"),c=u(function(f){var p=0,d=f.input,g=d.length();if(g<f.record.length)p=f.record.length-g;else{f.record.fragment.putBytes(d.getBytes(f.record.length)),d.compact();var m=f.state.current.read;m.update(f,f.record)&&(f.fragmented!==null&&(f.fragmented.type===f.record.type?(f.fragmented.fragment.putBuffer(f.record.fragment),f.record=f.fragmented):f.error(f,{message:"Invalid fragmented record.",send:!0,alert:{level:L.Alert.Level.fatal,description:L.Alert.Description.unexpected_message}})),f.record.ready=!0)}return p},"_readRecord");return a.handshake=function(f){if(a.entity!==L.ConnectionEnd.client)a.error(a,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(a.handshaking)a.error(a,{message:"Handshake already in progress.",fatal:!1});else{a.fail&&!a.open&&a.handshakes===0&&(a.fail=!1),a.handshaking=!0,f=f||"";var p=null;f.length>0&&(a.sessionCache&&(p=a.sessionCache.getSession(f)),p===null&&(f="")),f.length===0&&a.sessionCache&&(p=a.sessionCache.getSession(),p!==null&&(f=p.id)),a.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:be.md.md5.create(),sha1:be.md.sha1.create()},p&&(a.version=p.version,a.session.sp=p.sp),a.session.sp.client_random=L.createRandom().getBytes(),a.open=!0,L.queue(a,L.createRecord(a,{type:L.ContentType.handshake,data:L.createClientHello(a)})),L.flush(a)}},a.process=function(f){var p=0;return f&&a.input.putBytes(f),a.fail||(a.record!==null&&a.record.ready&&a.record.fragment.isEmpty()&&(a.record=null),a.record===null&&(p=l(a)),!a.fail&&a.record!==null&&!a.record.ready&&(p=c(a)),!a.fail&&a.record!==null&&a.record.ready&&o(a,a.record)),p},a.prepare=function(f){return L.queue(a,L.createRecord(a,{type:L.ContentType.application_data,data:be.util.createBuffer(f)})),L.flush(a)},a.prepareHeartbeatRequest=function(f,p){return f instanceof be.util.ByteBuffer&&(f=f.bytes()),typeof p>"u"&&(p=f.length),a.expectedHeartbeatPayload=f,L.queue(a,L.createRecord(a,{type:L.ContentType.heartbeat,data:L.createHeartbeat(L.HeartbeatMessageType.heartbeat_request,f,p)})),L.flush(a)},a.close=function(f){if(!a.fail&&a.sessionCache&&a.session){var p={id:a.session.id,version:a.session.version,sp:a.session.sp};p.sp.keys=null,a.sessionCache.setSession(p.id,p)}a.open&&(a.open=!1,a.input.clear(),(a.isConnected||a.handshaking)&&(a.isConnected=a.handshaking=!1,L.queue(a,L.createAlert(a,{level:L.Alert.Level.warning,description:L.Alert.Description.close_notify})),L.flush(a)),a.closed(a)),a.reset(f)},a};mB.exports=be.tls=be.tls||{};for(cv in L)typeof L[cv]!="function"&&(be.tls[cv]=L[cv]);var cv;be.tls.prf_tls1=hv;be.tls.hmac_sha1=iM;be.tls.createSessionCache=L.createSessionCache;be.tls.createConnection=L.createConnection});var vB=ue((Gee,yB)=>{"use strict";var mo=bt();oo();sC();var xs=yB.exports=mo.tls;xs.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:u(function(r){r.bulk_cipher_algorithm=xs.BulkCipherAlgorithm.aes,r.cipher_type=xs.CipherType.block,r.enc_key_length=16,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=xs.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:gB};xs.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:u(function(r){r.bulk_cipher_algorithm=xs.BulkCipherAlgorithm.aes,r.cipher_type=xs.CipherType.block,r.enc_key_length=32,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=xs.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:gB};function gB(r,e,t){var n=e.entity===mo.tls.ConnectionEnd.client;r.read.cipherState={init:!1,cipher:mo.cipher.createDecipher("AES-CBC",n?t.keys.server_write_key:t.keys.client_write_key),iv:n?t.keys.server_write_IV:t.keys.client_write_IV},r.write.cipherState={init:!1,cipher:mo.cipher.createCipher("AES-CBC",n?t.keys.client_write_key:t.keys.server_write_key),iv:n?t.keys.client_write_IV:t.keys.server_write_IV},r.read.cipherFunction=IM,r.write.cipherFunction=bM,r.read.macLength=r.write.macLength=t.mac_length,r.read.macFunction=r.write.macFunction=xs.hmac_sha1}u(gB,"initConnectionState");function bM(r,e){var t=!1,n=e.macFunction(e.macKey,e.sequenceNumber,r);r.fragment.putBytes(n),e.updateSequenceNumber();var s;r.version.minor===xs.Versions.TLS_1_0.minor?s=e.cipherState.init?null:e.cipherState.iv:s=mo.random.getBytesSync(16),e.cipherState.init=!0;var i=e.cipherState.cipher;return i.start({iv:s}),r.version.minor>=xs.Versions.TLS_1_1.minor&&i.output.putBytes(s),i.update(r.fragment),i.finish(NM)&&(r.fragment=i.output,r.length=r.fragment.length(),t=!0),t}u(bM,"encrypt_aes_cbc_sha1");function NM(r,e,t){if(!t){var n=r-e.length()%r;e.fillWithByte(n-1,n)}return!0}u(NM,"encrypt_aes_cbc_sha1_padding");function TM(r,e,t){var n=!0;if(t){for(var s=e.length(),i=e.last(),a=s-1-i;a<s-1;++a)n=n&&e.at(a)==i;n&&e.truncate(i+1)}return n}u(TM,"decrypt_aes_cbc_sha1_padding");function IM(r,e){var t=!1,n;r.version.minor===xs.Versions.TLS_1_0.minor?n=e.cipherState.init?null:e.cipherState.iv:n=r.fragment.getBytes(16),e.cipherState.init=!0;var s=e.cipherState.cipher;s.start({iv:n}),s.update(r.fragment),t=s.finish(TM);var i=e.macLength,a=mo.random.getBytesSync(i),o=s.output.length();o>=i?(r.fragment=s.output.getBytes(o-i),a=s.output.getBytes(i)):r.fragment=s.output.getBytes(),r.fragment=mo.util.createBuffer(r.fragment),r.length=r.fragment.length();var l=e.macFunction(e.macKey,e.sequenceNumber,r);return e.updateSequenceNumber(),t=DM(e.macKey,a,l)&&t,t}u(IM,"decrypt_aes_cbc_sha1");function DM(r,e,t){var n=mo.hmac.create();return n.start("SHA1",r),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(t),t=n.digest().getBytes(),e===t}u(DM,"compareMacs")});var oC=ue((Wee,AB)=>{"use strict";var vr=bt();yi();jt();var od=AB.exports=vr.sha512=vr.sha512||{};vr.md.sha512=vr.md.algorithms.sha512=od;var wB=vr.sha384=vr.sha512.sha384=vr.sha512.sha384||{};wB.create=function(){return od.create("SHA-384")};vr.md.sha384=vr.md.algorithms.sha384=wB;vr.sha512.sha256=vr.sha512.sha256||{create:u(function(){return od.create("SHA-512/256")},"create")};vr.md["sha512/256"]=vr.md.algorithms["sha512/256"]=vr.sha512.sha256;vr.sha512.sha224=vr.sha512.sha224||{create:u(function(){return od.create("SHA-512/224")},"create")};vr.md["sha512/224"]=vr.md.algorithms["sha512/224"]=vr.sha512.sha224;od.create=function(r){if(SB||BM(),typeof r>"u"&&(r="SHA-512"),!(r in tl))throw new Error("Invalid SHA-512 algorithm: "+r);for(var e=tl[r],t=null,n=vr.util.createBuffer(),s=new Array(80),i=0;i<80;++i)s[i]=new Array(2);var a=64;switch(r){case"SHA-384":a=48;break;case"SHA-512/256":a=32;break;case"SHA-512/224":a=28;break}var o={algorithm:r.replace("-","").toLowerCase(),blockLength:128,digestLength:a,messageLength:0,fullMessageLength:null,messageLengthSize:16};return o.start=function(){o.messageLength=0,o.fullMessageLength=o.messageLength128=[];for(var l=o.messageLengthSize/4,c=0;c<l;++c)o.fullMessageLength.push(0);n=vr.util.createBuffer(),t=new Array(e.length);for(var c=0;c<e.length;++c)t[c]=e[c].slice(0);return o},o.start(),o.update=function(l,c){c==="utf8"&&(l=vr.util.encodeUtf8(l));var f=l.length;o.messageLength+=f,f=[f/4294967296>>>0,f>>>0];for(var p=o.fullMessageLength.length-1;p>=0;--p)o.fullMessageLength[p]+=f[1],f[1]=f[0]+(o.fullMessageLength[p]/4294967296>>>0),o.fullMessageLength[p]=o.fullMessageLength[p]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(l),EB(t,s,n),(n.read>2048||n.length()===0)&&n.compact(),o},o.digest=function(){var l=vr.util.createBuffer();l.putBytes(n.bytes());var c=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize,f=c&o.blockLength-1;l.putBytes(iC.substr(0,o.blockLength-f));for(var p,d,g=o.fullMessageLength[0]*8,m=0;m<o.fullMessageLength.length-1;++m)p=o.fullMessageLength[m+1]*8,d=p/4294967296>>>0,g+=d,l.putInt32(g>>>0),g=p>>>0;l.putInt32(g);for(var v=new Array(t.length),m=0;m<t.length;++m)v[m]=t[m].slice(0);EB(v,s,l);var y=vr.util.createBuffer(),S;r==="SHA-512"?S=v.length:r==="SHA-384"?S=v.length-2:S=v.length-4;for(var m=0;m<S;++m)y.putInt32(v[m][0]),(m!==S-1||r!=="SHA-512/224")&&y.putInt32(v[m][1]);return y},o};var iC=null,SB=!1,aC=null,tl=null;function BM(){iC="\x80",iC+=vr.util.fillString("\0",128),aC=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],tl={},tl["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],tl["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],tl["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],tl["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],SB=!0}u(BM,"_init");function EB(r,e,t){for(var n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C,w,E,A,b,V,I,D,U,F,M,se,ee,ie,X,he,Ce,xe,pe,W,fe=t.length();fe>=128;){for(ie=0;ie<16;++ie)e[ie][0]=t.getInt32()>>>0,e[ie][1]=t.getInt32()>>>0;for(;ie<80;++ie)Ce=e[ie-2],X=Ce[0],he=Ce[1],n=((X>>>19|he<<13)^(he>>>29|X<<3)^X>>>6)>>>0,s=((X<<13|he>>>19)^(he<<3|X>>>29)^(X<<26|he>>>6))>>>0,pe=e[ie-15],X=pe[0],he=pe[1],i=((X>>>1|he<<31)^(X>>>8|he<<24)^X>>>7)>>>0,a=((X<<31|he>>>1)^(X<<24|he>>>8)^(X<<25|he>>>7))>>>0,xe=e[ie-7],W=e[ie-16],he=s+xe[1]+a+W[1],e[ie][0]=n+xe[0]+i+W[0]+(he/4294967296>>>0)>>>0,e[ie][1]=he>>>0;for(v=r[0][0],y=r[0][1],S=r[1][0],C=r[1][1],w=r[2][0],E=r[2][1],A=r[3][0],b=r[3][1],V=r[4][0],I=r[4][1],D=r[5][0],U=r[5][1],F=r[6][0],M=r[6][1],se=r[7][0],ee=r[7][1],ie=0;ie<80;++ie)c=((V>>>14|I<<18)^(V>>>18|I<<14)^(I>>>9|V<<23))>>>0,f=((V<<18|I>>>14)^(V<<14|I>>>18)^(I<<23|V>>>9))>>>0,p=(F^V&(D^F))>>>0,d=(M^I&(U^M))>>>0,o=((v>>>28|y<<4)^(y>>>2|v<<30)^(y>>>7|v<<25))>>>0,l=((v<<4|y>>>28)^(y<<30|v>>>2)^(y<<25|v>>>7))>>>0,g=(v&S|w&(v^S))>>>0,m=(y&C|E&(y^C))>>>0,he=ee+f+d+aC[ie][1]+e[ie][1],n=se+c+p+aC[ie][0]+e[ie][0]+(he/4294967296>>>0)>>>0,s=he>>>0,he=l+m,i=o+g+(he/4294967296>>>0)>>>0,a=he>>>0,se=F,ee=M,F=D,M=U,D=V,U=I,he=b+s,V=A+n+(he/4294967296>>>0)>>>0,I=he>>>0,A=w,b=E,w=S,E=C,S=v,C=y,he=s+a,v=n+i+(he/4294967296>>>0)>>>0,y=he>>>0;he=r[0][1]+y,r[0][0]=r[0][0]+v+(he/4294967296>>>0)>>>0,r[0][1]=he>>>0,he=r[1][1]+C,r[1][0]=r[1][0]+S+(he/4294967296>>>0)>>>0,r[1][1]=he>>>0,he=r[2][1]+E,r[2][0]=r[2][0]+w+(he/4294967296>>>0)>>>0,r[2][1]=he>>>0,he=r[3][1]+b,r[3][0]=r[3][0]+A+(he/4294967296>>>0)>>>0,r[3][1]=he>>>0,he=r[4][1]+I,r[4][0]=r[4][0]+V+(he/4294967296>>>0)>>>0,r[4][1]=he>>>0,he=r[5][1]+U,r[5][0]=r[5][0]+D+(he/4294967296>>>0)>>>0,r[5][1]=he>>>0,he=r[6][1]+M,r[6][0]=r[6][0]+F+(he/4294967296>>>0)>>>0,r[6][1]=he>>>0,he=r[7][1]+ee,r[7][0]=r[7][0]+se+(he/4294967296>>>0)>>>0,r[7][1]=he>>>0,fe-=128}}u(EB,"_update")});var CB=ue(uC=>{"use strict";var RM=bt();Js();var tn=RM.asn1;uC.privateKeyValidator={name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:tn.Class.UNIVERSAL,type:tn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};uC.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:tn.Class.UNIVERSAL,type:tn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:tn.Class.UNIVERSAL,type:tn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:tn.Class.UNIVERSAL,type:tn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var LB=ue((Yee,kB)=>{"use strict";var mn=bt();nd();Es();oC();jt();var DB=CB(),OM=DB.publicKeyValidator,_M=DB.privateKeyValidator;typeof xB>"u"&&(xB=mn.jsbn.BigInteger);var xB,cC=mn.util.ByteBuffer,Hn=typeof Buffer>"u"?Uint8Array:Buffer;mn.pki=mn.pki||{};kB.exports=mn.pki.ed25519=mn.ed25519=mn.ed25519||{};var Bt=mn.ed25519;Bt.constants={};Bt.constants.PUBLIC_KEY_BYTE_LENGTH=32;Bt.constants.PRIVATE_KEY_BYTE_LENGTH=64;Bt.constants.SEED_BYTE_LENGTH=32;Bt.constants.SIGN_BYTE_LENGTH=64;Bt.constants.HASH_BYTE_LENGTH=64;Bt.generateKeyPair=function(r){r=r||{};var e=r.seed;if(e===void 0)e=mn.random.getBytesSync(Bt.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Bt.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Bt.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=aa({message:e,encoding:"binary"});for(var t=new Hn(Bt.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Hn(Bt.constants.PRIVATE_KEY_BYTE_LENGTH),s=0;s<32;++s)n[s]=e[s];return VM(t,n),{publicKey:t,privateKey:n}};Bt.privateKeyFromAsn1=function(r){var e={},t=[],n=mn.asn1.validate(r,_M,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=mn.asn1.derToOid(e.privateKeyOid),a=mn.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=e.privateKey,l=aa({message:mn.asn1.fromDer(o).value,encoding:"binary"});return{privateKeyBytes:l}};Bt.publicKeyFromAsn1=function(r){var e={},t=[],n=mn.asn1.validate(r,OM,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=mn.asn1.derToOid(e.publicKeyOid),a=mn.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var o=e.ed25519PublicKey;if(o.length!==Bt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return aa({message:o,encoding:"binary"})};Bt.publicKeyFromPrivateKey=function(r){r=r||{};var e=aa({message:r.privateKey,encoding:"binary"});if(e.length!==Bt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Bt.constants.PRIVATE_KEY_BYTE_LENGTH);for(var t=new Hn(Bt.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<t.length;++n)t[n]=e[32+n];return t};Bt.sign=function(r){r=r||{};var e=aa(r),t=aa({message:r.privateKey,encoding:"binary"});if(t.length===Bt.constants.SEED_BYTE_LENGTH){var n=Bt.generateKeyPair({seed:t});t=n.privateKey}else if(t.length!==Bt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Bt.constants.SEED_BYTE_LENGTH+" or "+Bt.constants.PRIVATE_KEY_BYTE_LENGTH);var s=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length);FM(s,e,e.length,t);for(var i=new Hn(Bt.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=s[a];return i};Bt.verify=function(r){r=r||{};var e=aa(r);if(r.signature===void 0)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var t=aa({message:r.signature,encoding:"binary"});if(t.length!==Bt.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Bt.constants.SIGN_BYTE_LENGTH);var n=aa({message:r.publicKey,encoding:"binary"});if(n.length!==Bt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Bt.constants.PUBLIC_KEY_BYTE_LENGTH);var s=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length),i=new Hn(Bt.constants.SIGN_BYTE_LENGTH+e.length),a;for(a=0;a<Bt.constants.SIGN_BYTE_LENGTH;++a)s[a]=t[a];for(a=0;a<e.length;++a)s[a+Bt.constants.SIGN_BYTE_LENGTH]=e[a];return UM(i,s,s.length,n)>=0};function aa(r){var e=r.message;if(e instanceof Uint8Array||e instanceof Hn)return e;var t=r.encoding;if(e===void 0)if(r.md)e=r.md.digest().getBytes(),t="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!t)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,t);e=new cC(e,t)}else if(!(e instanceof cC))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new Hn(e.length()),s=0;s<n.length;++s)n[s]=e.at(s);return n}u(aa,"messageToNativeBuffer");var fC=ot(),pv=ot([1]),PM=ot([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),kM=ot([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),bB=ot([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),NB=ot([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ud=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),LM=ot([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function ld(r,e){var t=mn.md.sha512.create(),n=new cC(r);t.update(n.getBytes(e),"binary");var s=t.digest().getBytes();if(typeof Buffer<"u")return Buffer.from(s,"binary");for(var i=new Hn(Bt.constants.HASH_BYTE_LENGTH),a=0;a<64;++a)i[a]=s.charCodeAt(a);return i}u(ld,"sha512");function VM(r,e){var t=[ot(),ot(),ot(),ot()],n,s=ld(e,32);for(s[0]&=248,s[31]&=127,s[31]|=64,mC(t,s),dC(r,t),n=0;n<32;++n)e[n+32]=r[n];return 0}u(VM,"crypto_sign_keypair");function FM(r,e,t,n){var s,i,a=new Float64Array(64),o=[ot(),ot(),ot(),ot()],l=ld(n,32);l[0]&=248,l[31]&=127,l[31]|=64;var c=t+64;for(s=0;s<t;++s)r[64+s]=e[s];for(s=0;s<32;++s)r[32+s]=l[32+s];var f=ld(r.subarray(32),t+32);for(hC(f),mC(o,f),dC(r,o),s=32;s<64;++s)r[s]=n[s];var p=ld(r,t+64);for(hC(p),s=32;s<64;++s)a[s]=0;for(s=0;s<32;++s)a[s]=f[s];for(s=0;s<32;++s)for(i=0;i<32;i++)a[s+i]+=p[s]*l[i];return BB(r.subarray(32),a),c}u(FM,"crypto_sign");function UM(r,e,t,n){var s,i,a=new Hn(32),o=[ot(),ot(),ot(),ot()],l=[ot(),ot(),ot(),ot()];if(i=-1,t<64||jM(l,n)||!MM(e,32))return-1;for(s=0;s<t;++s)r[s]=e[s];for(s=0;s<32;++s)r[s+32]=n[s];var c=ld(r,t);if(hC(c),_B(o,l,c),mC(l,e.subarray(32)),pC(o,l),dC(a,o),t-=64,RB(e,0,a,0)){for(s=0;s<t;++s)r[s]=0;return-1}for(s=0;s<t;++s)r[s]=e[s+64];return i=t,i}u(UM,"crypto_sign_open");function MM(r,e){var t;for(t=31;t>=0;--t){if(r[e+t]<ud[t])return!0;if(r[e+t]>ud[t])return!1}return!1}u(MM,"_isCanonicalSignatureScalar");function BB(r,e){var t,n,s,i;for(n=63;n>=32;--n){for(t=0,s=n-32,i=n-12;s<i;++s)e[s]+=t-16*e[n]*ud[s-(n-32)],t=e[s]+128>>8,e[s]-=t*256;e[s]+=t,e[n]=0}for(t=0,s=0;s<32;++s)e[s]+=t-(e[31]>>4)*ud[s],t=e[s]>>8,e[s]&=255;for(s=0;s<32;++s)e[s]-=t*ud[s];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,r[n]=e[n]&255}u(BB,"modL");function hC(r){for(var e=new Float64Array(64),t=0;t<64;++t)e[t]=r[t],r[t]=0;BB(r,e)}u(hC,"reduce");function pC(r,e){var t=ot(),n=ot(),s=ot(),i=ot(),a=ot(),o=ot(),l=ot(),c=ot(),f=ot();Nf(t,r[1],r[0]),Nf(f,e[1],e[0]),ur(t,t,f),bf(n,r[0],r[1]),bf(f,e[0],e[1]),ur(n,n,f),ur(s,r[3],e[3]),ur(s,s,kM),ur(i,r[2],e[2]),bf(i,i,i),Nf(a,n,t),Nf(o,i,s),bf(l,i,s),bf(c,n,t),ur(r[0],a,o),ur(r[1],c,l),ur(r[2],l,o),ur(r[3],a,c)}u(pC,"add");function TB(r,e,t){for(var n=0;n<4;++n)PB(r[n],e[n],t)}u(TB,"cswap");function dC(r,e){var t=ot(),n=ot(),s=ot();XM(s,e[2]),ur(t,e[0],s),ur(n,e[1],s),dv(r,n),r[31]^=OB(t)<<7}u(dC,"pack");function dv(r,e){var t,n,s,i=ot(),a=ot();for(t=0;t<16;++t)a[t]=e[t];for(lC(a),lC(a),lC(a),n=0;n<2;++n){for(i[0]=a[0]-65517,t=1;t<15;++t)i[t]=a[t]-65535-(i[t-1]>>16&1),i[t-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),s=i[15]>>16&1,i[14]&=65535,PB(a,i,1-s)}for(t=0;t<16;t++)r[2*t]=a[t]&255,r[2*t+1]=a[t]>>8}u(dv,"pack25519");function jM(r,e){var t=ot(),n=ot(),s=ot(),i=ot(),a=ot(),o=ot(),l=ot();return go(r[2],pv),qM(r[1],e),rl(s,r[1]),ur(i,s,PM),Nf(s,s,r[2]),bf(i,r[2],i),rl(a,i),rl(o,a),ur(l,o,a),ur(t,l,s),ur(t,t,i),HM(t,t),ur(t,t,s),ur(t,t,i),ur(t,t,i),ur(r[0],t,i),rl(n,r[0]),ur(n,n,i),IB(n,s)&&ur(r[0],r[0],LM),rl(n,r[0]),ur(n,n,i),IB(n,s)?-1:(OB(r[0])===e[31]>>7&&Nf(r[0],fC,r[0]),ur(r[3],r[0],r[1]),0)}u(jM,"unpackneg");function qM(r,e){var t;for(t=0;t<16;++t)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}u(qM,"unpack25519");function HM(r,e){var t=ot(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=250;n>=0;--n)rl(t,t),n!==1&&ur(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}u(HM,"pow2523");function IB(r,e){var t=new Hn(32),n=new Hn(32);return dv(t,r),dv(n,e),RB(t,0,n,0)}u(IB,"neq25519");function RB(r,e,t,n){return KM(r,e,t,n,32)}u(RB,"crypto_verify_32");function KM(r,e,t,n,s){var i,a=0;for(i=0;i<s;++i)a|=r[e+i]^t[n+i];return(1&a-1>>>8)-1}u(KM,"vn");function OB(r){var e=new Hn(32);return dv(e,r),e[0]&1}u(OB,"par25519");function _B(r,e,t){var n,s;for(go(r[0],fC),go(r[1],pv),go(r[2],pv),go(r[3],fC),s=255;s>=0;--s)n=t[s/8|0]>>(s&7)&1,TB(r,e,n),pC(e,r),pC(r,r),TB(r,e,n)}u(_B,"scalarmult");function mC(r,e){var t=[ot(),ot(),ot(),ot()];go(t[0],bB),go(t[1],NB),go(t[2],pv),ur(t[3],bB,NB),_B(r,t,e)}u(mC,"scalarbase");function go(r,e){var t;for(t=0;t<16;t++)r[t]=e[t]|0}u(go,"set25519");function XM(r,e){var t=ot(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=253;n>=0;--n)rl(t,t),n!==2&&n!==4&&ur(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}u(XM,"inv25519");function lC(r){var e,t,n=1;for(e=0;e<16;++e)t=r[e]+n+65535,n=Math.floor(t/65536),r[e]=t-n*65536;r[0]+=n-1+37*(n-1)}u(lC,"car25519");function PB(r,e,t){for(var n,s=~(t-1),i=0;i<16;++i)n=s&(r[i]^e[i]),r[i]^=n,e[i]^=n}u(PB,"sel25519");function ot(r){var e,t=new Float64Array(16);if(r)for(e=0;e<r.length;++e)t[e]=r[e];return t}u(ot,"gf");function bf(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]+t[n]}u(bf,"A");function Nf(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]-t[n]}u(Nf,"Z");function rl(r,e){ur(r,e,e)}u(rl,"S");function ur(r,e,t){var n,s,i=0,a=0,o=0,l=0,c=0,f=0,p=0,d=0,g=0,m=0,v=0,y=0,S=0,C=0,w=0,E=0,A=0,b=0,V=0,I=0,D=0,U=0,F=0,M=0,se=0,ee=0,ie=0,X=0,he=0,Ce=0,xe=0,pe=t[0],W=t[1],fe=t[2],Ie=t[3],Ve=t[4],Le=t[5],O=t[6],B=t[7],Q=t[8],K=t[9],_e=t[10],R=t[11],N=t[12],J=t[13],$=t[14],ge=t[15];n=e[0],i+=n*pe,a+=n*W,o+=n*fe,l+=n*Ie,c+=n*Ve,f+=n*Le,p+=n*O,d+=n*B,g+=n*Q,m+=n*K,v+=n*_e,y+=n*R,S+=n*N,C+=n*J,w+=n*$,E+=n*ge,n=e[1],a+=n*pe,o+=n*W,l+=n*fe,c+=n*Ie,f+=n*Ve,p+=n*Le,d+=n*O,g+=n*B,m+=n*Q,v+=n*K,y+=n*_e,S+=n*R,C+=n*N,w+=n*J,E+=n*$,A+=n*ge,n=e[2],o+=n*pe,l+=n*W,c+=n*fe,f+=n*Ie,p+=n*Ve,d+=n*Le,g+=n*O,m+=n*B,v+=n*Q,y+=n*K,S+=n*_e,C+=n*R,w+=n*N,E+=n*J,A+=n*$,b+=n*ge,n=e[3],l+=n*pe,c+=n*W,f+=n*fe,p+=n*Ie,d+=n*Ve,g+=n*Le,m+=n*O,v+=n*B,y+=n*Q,S+=n*K,C+=n*_e,w+=n*R,E+=n*N,A+=n*J,b+=n*$,V+=n*ge,n=e[4],c+=n*pe,f+=n*W,p+=n*fe,d+=n*Ie,g+=n*Ve,m+=n*Le,v+=n*O,y+=n*B,S+=n*Q,C+=n*K,w+=n*_e,E+=n*R,A+=n*N,b+=n*J,V+=n*$,I+=n*ge,n=e[5],f+=n*pe,p+=n*W,d+=n*fe,g+=n*Ie,m+=n*Ve,v+=n*Le,y+=n*O,S+=n*B,C+=n*Q,w+=n*K,E+=n*_e,A+=n*R,b+=n*N,V+=n*J,I+=n*$,D+=n*ge,n=e[6],p+=n*pe,d+=n*W,g+=n*fe,m+=n*Ie,v+=n*Ve,y+=n*Le,S+=n*O,C+=n*B,w+=n*Q,E+=n*K,A+=n*_e,b+=n*R,V+=n*N,I+=n*J,D+=n*$,U+=n*ge,n=e[7],d+=n*pe,g+=n*W,m+=n*fe,v+=n*Ie,y+=n*Ve,S+=n*Le,C+=n*O,w+=n*B,E+=n*Q,A+=n*K,b+=n*_e,V+=n*R,I+=n*N,D+=n*J,U+=n*$,F+=n*ge,n=e[8],g+=n*pe,m+=n*W,v+=n*fe,y+=n*Ie,S+=n*Ve,C+=n*Le,w+=n*O,E+=n*B,A+=n*Q,b+=n*K,V+=n*_e,I+=n*R,D+=n*N,U+=n*J,F+=n*$,M+=n*ge,n=e[9],m+=n*pe,v+=n*W,y+=n*fe,S+=n*Ie,C+=n*Ve,w+=n*Le,E+=n*O,A+=n*B,b+=n*Q,V+=n*K,I+=n*_e,D+=n*R,U+=n*N,F+=n*J,M+=n*$,se+=n*ge,n=e[10],v+=n*pe,y+=n*W,S+=n*fe,C+=n*Ie,w+=n*Ve,E+=n*Le,A+=n*O,b+=n*B,V+=n*Q,I+=n*K,D+=n*_e,U+=n*R,F+=n*N,M+=n*J,se+=n*$,ee+=n*ge,n=e[11],y+=n*pe,S+=n*W,C+=n*fe,w+=n*Ie,E+=n*Ve,A+=n*Le,b+=n*O,V+=n*B,I+=n*Q,D+=n*K,U+=n*_e,F+=n*R,M+=n*N,se+=n*J,ee+=n*$,ie+=n*ge,n=e[12],S+=n*pe,C+=n*W,w+=n*fe,E+=n*Ie,A+=n*Ve,b+=n*Le,V+=n*O,I+=n*B,D+=n*Q,U+=n*K,F+=n*_e,M+=n*R,se+=n*N,ee+=n*J,ie+=n*$,X+=n*ge,n=e[13],C+=n*pe,w+=n*W,E+=n*fe,A+=n*Ie,b+=n*Ve,V+=n*Le,I+=n*O,D+=n*B,U+=n*Q,F+=n*K,M+=n*_e,se+=n*R,ee+=n*N,ie+=n*J,X+=n*$,he+=n*ge,n=e[14],w+=n*pe,E+=n*W,A+=n*fe,b+=n*Ie,V+=n*Ve,I+=n*Le,D+=n*O,U+=n*B,F+=n*Q,M+=n*K,se+=n*_e,ee+=n*R,ie+=n*N,X+=n*J,he+=n*$,Ce+=n*ge,n=e[15],E+=n*pe,A+=n*W,b+=n*fe,V+=n*Ie,I+=n*Ve,D+=n*Le,U+=n*O,F+=n*B,M+=n*Q,se+=n*K,ee+=n*_e,ie+=n*R,X+=n*N,he+=n*J,Ce+=n*$,xe+=n*ge,i+=38*A,a+=38*b,o+=38*V,l+=38*I,c+=38*D,f+=38*U,p+=38*F,d+=38*M,g+=38*se,m+=38*ee,v+=38*ie,y+=38*X,S+=38*he,C+=38*Ce,w+=38*xe,s=1,n=i+s+65535,s=Math.floor(n/65536),i=n-s*65536,n=a+s+65535,s=Math.floor(n/65536),a=n-s*65536,n=o+s+65535,s=Math.floor(n/65536),o=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=c+s+65535,s=Math.floor(n/65536),c=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=p+s+65535,s=Math.floor(n/65536),p=n-s*65536,n=d+s+65535,s=Math.floor(n/65536),d=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=v+s+65535,s=Math.floor(n/65536),v=n-s*65536,n=y+s+65535,s=Math.floor(n/65536),y=n-s*65536,n=S+s+65535,s=Math.floor(n/65536),S=n-s*65536,n=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,i+=s-1+37*(s-1),s=1,n=i+s+65535,s=Math.floor(n/65536),i=n-s*65536,n=a+s+65535,s=Math.floor(n/65536),a=n-s*65536,n=o+s+65535,s=Math.floor(n/65536),o=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=c+s+65535,s=Math.floor(n/65536),c=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=p+s+65535,s=Math.floor(n/65536),p=n-s*65536,n=d+s+65535,s=Math.floor(n/65536),d=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=v+s+65535,s=Math.floor(n/65536),v=n-s*65536,n=y+s+65535,s=Math.floor(n/65536),y=n-s*65536,n=S+s+65535,s=Math.floor(n/65536),S=n-s*65536,n=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=n-s*65536,n=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,i+=s-1+37*(s-1),r[0]=i,r[1]=a,r[2]=o,r[3]=l,r[4]=c,r[5]=f,r[6]=p,r[7]=d,r[8]=g,r[9]=m,r[10]=v,r[11]=y,r[12]=S,r[13]=C,r[14]=w,r[15]=E}u(ur,"M")});var MB=ue((Zee,UB)=>{"use strict";var ls=bt();jt();Es();nd();UB.exports=ls.kem=ls.kem||{};var VB=ls.jsbn.BigInteger;ls.kem.rsa={};ls.kem.rsa.create=function(r,e){e=e||{};var t=e.prng||ls.random,n={};return n.encrypt=function(s,i){var a=Math.ceil(s.n.bitLength()/8),o;do o=new VB(ls.util.bytesToHex(t.getBytesSync(a)),16).mod(s.n);while(o.compareTo(VB.ONE)<=0);o=ls.util.hexToBytes(o.toString(16));var l=a-o.length;l>0&&(o=ls.util.fillString("\0",l)+o);var c=s.encrypt(o,"NONE"),f=r.generate(o,i);return{encapsulation:c,key:f}},n.decrypt=function(s,i,a){var o=s.decrypt(i,"NONE");return r.generate(o,a)},n};ls.kem.kdf1=function(r,e){FB(this,r,0,e||r.digestLength)};ls.kem.kdf2=function(r,e){FB(this,r,1,e||r.digestLength)};function FB(r,e,t,n){r.generate=function(s,i){for(var a=new ls.util.ByteBuffer,o=Math.ceil(i/n)+t,l=new ls.util.ByteBuffer,c=t;c<o;++c){l.putInt32(c),e.start(),e.update(s+l.getBytes());var f=e.digest();a.putBytes(f.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}u(FB,"_createKDF")});var KB=ue((tte,HB)=>{"use strict";var Ot=bt();jt();HB.exports=Ot.log=Ot.log||{};Ot.log.levels=["none","error","warning","info","debug","verbose","max"];var mv={},vC=[],fd=null;Ot.log.LEVEL_LOCKED=2;Ot.log.NO_LEVEL_CHECK=4;Ot.log.INTERPOLATE=8;for(bi=0;bi<Ot.log.levels.length;++bi)gC=Ot.log.levels[bi],mv[gC]={index:bi,name:gC.toUpperCase()};var gC,bi;Ot.log.logMessage=function(r){for(var e=mv[r.level].index,t=0;t<vC.length;++t){var n=vC[t];if(n.flags&Ot.log.NO_LEVEL_CHECK)n.f(r);else{var s=mv[n.level].index;e<=s&&n.f(n,r)}}};Ot.log.prepareStandard=function(r){"standard"in r||(r.standard=mv[r.level].name+" ["+r.category+"] "+r.message)};Ot.log.prepareFull=function(r){if(!("full"in r)){var e=[r.message];e=e.concat([]),r.full=Ot.util.format.apply(this,e)}};Ot.log.prepareStandardFull=function(r){"standardFull"in r||(Ot.log.prepareStandard(r),r.standardFull=r.standard)};for(yC=["error","warning","info","debug","verbose"],bi=0;bi<yC.length;++bi)(function(e){Ot.log[e]=function(t,n){var s=Array.prototype.slice.call(arguments).slice(2),i={timestamp:new Date,level:e,category:t,message:n,arguments:s};Ot.log.logMessage(i)}})(yC[bi]);var yC,bi;Ot.log.makeLogger=function(r){var e={flags:0,f:r};return Ot.log.setLevel(e,"none"),e};Ot.log.setLevel=function(r,e){var t=!1;if(r&&!(r.flags&Ot.log.LEVEL_LOCKED))for(var n=0;n<Ot.log.levels.length;++n){var s=Ot.log.levels[n];if(e==s){r.level=e,t=!0;break}}return t};Ot.log.lock=function(r,e){typeof e>"u"||e?r.flags|=Ot.log.LEVEL_LOCKED:r.flags&=~Ot.log.LEVEL_LOCKED};Ot.log.addLogger=function(r){vC.push(r)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(jB={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},hd=u(function(r,e){Ot.log.prepareStandard(e);var t=jB[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),t.apply(console,n)},"f"),Tf=Ot.log.makeLogger(hd)):(hd=u(function(e,t){Ot.log.prepareStandardFull(t),console.log(t.standardFull)},"f"),Tf=Ot.log.makeLogger(hd)),Ot.log.setLevel(Tf,"debug"),Ot.log.addLogger(Tf),fd=Tf):console={log:u(function(){},"log")};var Tf,jB,hd;fd!==null&&typeof window<"u"&&window.location&&(cd=new URL(window.location.href).searchParams,cd.has("console.level")&&Ot.log.setLevel(fd,cd.get("console.level").slice(-1)[0]),cd.has("console.lock")&&(qB=cd.get("console.lock").slice(-1)[0],qB=="true"&&Ot.log.lock(fd)));var cd,qB;Ot.log.consoleLogger=fd});var GB=ue((nte,XB)=>{"use strict";XB.exports=yi();Wy();wf();OA();oC()});var zB=ue((ste,WB)=>{"use strict";var Fe=bt();oo();Js();td();uo();zu();GA();Es();jt();uv();var z=Fe.asn1,kn=WB.exports=Fe.pkcs7=Fe.pkcs7||{};kn.messageFromPem=function(r){var e=Fe.pem.decode(r)[0];if(e.type!=="PKCS7"){var t=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw t.headerType=e.type,t}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=z.fromDer(e.body);return kn.messageFromAsn1(n)};kn.messageToPem=function(r,e){var t={type:"PKCS7",body:z.toDer(r.toAsn1()).getBytes()};return Fe.pem.encode(t,{maxline:e})};kn.messageFromAsn1=function(r){var e={},t=[];if(!z.validate(r,kn.asn1.contentInfoValidator,e,t)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=t,n}var s=z.derToOid(e.contentType),i;switch(s){case Fe.pki.oids.envelopedData:i=kn.createEnvelopedData();break;case Fe.pki.oids.encryptedData:i=kn.createEncryptedData();break;case Fe.pki.oids.signedData:i=kn.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+s+" is not (yet) supported.")}return i.fromAsn1(e.content.value[0]),i};kn.createSignedData=function(){var r=null;return r={type:Fe.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:u(function(n){if(wC(r,n,kn.asn1.signedDataValidator),r.certificates=[],r.crls=[],r.digestAlgorithmIdentifiers=[],r.contentInfo=null,r.signerInfos=[],r.rawCapture.certificates)for(var s=r.rawCapture.certificates.value,i=0;i<s.length;++i)r.certificates.push(Fe.pki.certificateFromAsn1(s[i]))},"fromAsn1"),toAsn1:u(function(){r.contentInfo||r.sign();for(var n=[],s=0;s<r.certificates.length;++s)n.push(Fe.pki.certificateToAsn1(r.certificates[s]));var i=[],a=z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,r.digestAlgorithmIdentifiers),r.contentInfo])]);return n.length>0&&a.value[0].value.push(z.create(z.Class.CONTEXT_SPECIFIC,0,!0,n)),i.length>0&&a.value[0].value.push(z.create(z.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(z.create(z.Class.UNIVERSAL,z.Type.SET,!0,r.signerInfos)),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),a])},"toAsn1"),addSigner:u(function(n){var s=n.issuer,i=n.serialNumber;if(n.certificate){var a=n.certificate;typeof a=="string"&&(a=Fe.pki.certificateFromPem(a)),s=a.issuer.attributes,i=a.serialNumber}var o=n.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof o=="string"&&(o=Fe.pki.privateKeyFromPem(o));var l=n.digestAlgorithm||Fe.pki.oids.sha1;switch(l){case Fe.pki.oids.sha1:case Fe.pki.oids.sha256:case Fe.pki.oids.sha384:case Fe.pki.oids.sha512:case Fe.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var c=n.authenticatedAttributes||[];if(c.length>0){for(var f=!1,p=!1,d=0;d<c.length;++d){var g=c[d];if(!f&&g.type===Fe.pki.oids.contentType){if(f=!0,p)break;continue}if(!p&&g.type===Fe.pki.oids.messageDigest){if(p=!0,f)break;continue}}if(!f||!p)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}r.signers.push({key:o,version:1,issuer:s,serialNumber:i,digestAlgorithm:l,signatureAlgorithm:Fe.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},"addSigner"),sign:u(function(n){if(n=n||{},(typeof r.content!="object"||r.contentInfo===null)&&(r.contentInfo=z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(Fe.pki.oids.data).getBytes())]),"content"in r)){var s;r.content instanceof Fe.util.ByteBuffer?s=r.content.bytes():typeof r.content=="string"&&(s=Fe.util.encodeUtf8(r.content)),n.detached?r.detachedContent=z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,s):r.contentInfo.value.push(z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,s)]))}if(r.signers.length!==0){var i=e();t(i)}},"sign"),verify:u(function(){throw new Error("PKCS#7 signature verification not yet implemented.")},"verify"),addCertificate:u(function(n){typeof n=="string"&&(n=Fe.pki.certificateFromPem(n)),r.certificates.push(n)},"addCertificate"),addCertificateRevokationList:u(function(n){throw new Error("PKCS#7 CRL support not yet implemented.")},"addCertificateRevokationList")},r;function e(){for(var n={},s=0;s<r.signers.length;++s){var i=r.signers[s],a=i.digestAlgorithm;a in n||(n[a]=Fe.md[Fe.pki.oids[a]].create()),i.authenticatedAttributes.length===0?i.md=n[a]:i.md=Fe.md[Fe.pki.oids[a]].create()}r.digestAlgorithmIdentifiers=[];for(var a in n)r.digestAlgorithmIdentifiers.push(z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(a).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")]));return n}u(e,"addDigestAlgorithmIds");function t(n){var s;if(r.detachedContent?s=r.detachedContent:(s=r.contentInfo.value[1],s=s.value[0]),!s)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var i=z.derToOid(r.contentInfo.value[0].value),a=z.toDer(s);a.getByte(),z.getBerValueLength(a),a=a.getBytes();for(var o in n)n[o].start().update(a);for(var l=new Date,c=0;c<r.signers.length;++c){var f=r.signers[c];if(f.authenticatedAttributes.length===0){if(i!==Fe.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=z.create(z.Class.UNIVERSAL,z.Type.SET,!0,[]),d=0;d<f.authenticatedAttributes.length;++d){var g=f.authenticatedAttributes[d];g.type===Fe.pki.oids.messageDigest?g.value=n[f.digestAlgorithm].digest():g.type===Fe.pki.oids.signingTime&&(g.value||(g.value=l)),p.value.push(EC(g)),f.authenticatedAttributesAsn1.value.push(EC(g))}a=z.toDer(p).getBytes(),f.md.start().update(a)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}r.signerInfos=YM(r.signers)}u(t,"addSignerInfos")};kn.createEncryptedData=function(){var r=null;return r={type:Fe.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:Fe.pki.oids["aes256-CBC"]},fromAsn1:u(function(e){wC(r,e,kn.asn1.encryptedDataValidator)},"fromAsn1"),decrypt:u(function(e){e!==void 0&&(r.encryptedContent.key=e),$B(r)},"decrypt")},r};kn.createEnvelopedData=function(){var r=null;return r={type:Fe.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:Fe.pki.oids["aes256-CBC"]},fromAsn1:u(function(e){var t=wC(r,e,kn.asn1.envelopedDataValidator);r.recipients=WM(t.recipientInfos.value)},"fromAsn1"),toAsn1:u(function(){return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,zM(r.recipients)),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,QM(r.encryptedContent))])])])},"toAsn1"),findRecipient:u(function(e){for(var t=e.issuer.attributes,n=0;n<r.recipients.length;++n){var s=r.recipients[n],i=s.issuer;if(s.serialNumber===e.serialNumber&&i.length===t.length){for(var a=!0,o=0;o<t.length;++o)if(i[o].type!==t[o].type||i[o].value!==t[o].value){a=!1;break}if(a)return s}}return null},"findRecipient"),decrypt:u(function(e,t){if(r.encryptedContent.key===void 0&&e!==void 0&&t!==void 0)switch(e.encryptedContent.algorithm){case Fe.pki.oids.rsaEncryption:case Fe.pki.oids.desCBC:var n=t.decrypt(e.encryptedContent.content);r.encryptedContent.key=Fe.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+e.encryptedContent.algorithm)}$B(r)},"decrypt"),addRecipient:u(function(e){r.recipients.push({version:0,issuer:e.issuer.attributes,serialNumber:e.serialNumber,encryptedContent:{algorithm:Fe.pki.oids.rsaEncryption,key:e.publicKey}})},"addRecipient"),encrypt:u(function(e,t){if(r.encryptedContent.content===void 0){t=t||r.encryptedContent.algorithm,e=e||r.encryptedContent.key;var n,s,i;switch(t){case Fe.pki.oids["aes128-CBC"]:n=16,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["aes192-CBC"]:n=24,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["aes256-CBC"]:n=32,s=16,i=Fe.aes.createEncryptionCipher;break;case Fe.pki.oids["des-EDE3-CBC"]:n=24,s=8,i=Fe.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+t)}if(e===void 0)e=Fe.util.createBuffer(Fe.random.getBytes(n));else if(e.length()!=n)throw new Error("Symmetric key has wrong length; got "+e.length()+" bytes, expected "+n+".");r.encryptedContent.algorithm=t,r.encryptedContent.key=e,r.encryptedContent.parameter=Fe.util.createBuffer(Fe.random.getBytes(s));var a=i(e);if(a.start(r.encryptedContent.parameter.copy()),a.update(r.content),!a.finish())throw new Error("Symmetric encryption failed.");r.encryptedContent.content=a.output}for(var o=0;o<r.recipients.length;++o){var l=r.recipients[o];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case Fe.pki.oids.rsaEncryption:l.encryptedContent.content=l.encryptedContent.key.encrypt(r.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+l.encryptedContent.algorithm)}}},"encrypt")},r};function GM(r){var e={},t=[];if(!z.validate(r,kn.asn1.recipientInfoValidator,e,t)){var n=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw n.errors=t,n}return{version:e.version.charCodeAt(0),issuer:Fe.pki.RDNAttributesAsArray(e.issuer),serialNumber:Fe.util.createBuffer(e.serial).toHex(),encryptedContent:{algorithm:z.derToOid(e.encAlgorithm),parameter:e.encParameter?e.encParameter.value:void 0,content:e.encKey}}}u(GM,"_recipientFromAsn1");function $M(r){return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[Fe.pki.distinguishedNameToAsn1({attributes:r.issuer}),z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,Fe.util.hexToBytes(r.serialNumber))]),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.encryptedContent.algorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")]),z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.encryptedContent.content)])}u($M,"_recipientToAsn1");function WM(r){for(var e=[],t=0;t<r.length;++t)e.push(GM(r[t]));return e}u(WM,"_recipientsFromAsn1");function zM(r){for(var e=[],t=0;t<r.length;++t)e.push($M(r[t]));return e}u(zM,"_recipientsToAsn1");function JM(r){var e=z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,z.integerToDer(r.version).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[Fe.pki.distinguishedNameToAsn1({attributes:r.issuer}),z.create(z.Class.UNIVERSAL,z.Type.INTEGER,!1,Fe.util.hexToBytes(r.serialNumber))]),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.digestAlgorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")])]);if(r.authenticatedAttributesAsn1&&e.value.push(r.authenticatedAttributesAsn1),e.value.push(z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.signatureAlgorithm).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.NULL,!1,"")])),e.value.push(z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.signature)),r.unauthenticatedAttributes.length>0){for(var t=z.create(z.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<r.unauthenticatedAttributes.length;++n){var s=r.unauthenticatedAttributes[n];t.values.push(EC(s))}e.value.push(t)}return e}u(JM,"_signerToAsn1");function YM(r){for(var e=[],t=0;t<r.length;++t)e.push(JM(r[t]));return e}u(YM,"_signersToAsn1");function EC(r){var e;if(r.type===Fe.pki.oids.contentType)e=z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.value).getBytes());else if(r.type===Fe.pki.oids.messageDigest)e=z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.value.bytes());else if(r.type===Fe.pki.oids.signingTime){var t=new Date("1950-01-01T00:00:00Z"),n=new Date("2050-01-01T00:00:00Z"),s=r.value;if(typeof s=="string"){var i=Date.parse(s);isNaN(i)?s.length===13?s=z.utcTimeToDate(s):s=z.generalizedTimeToDate(s):s=new Date(i)}s>=t&&s<n?e=z.create(z.Class.UNIVERSAL,z.Type.UTCTIME,!1,z.dateToUtcTime(s)):e=z.create(z.Class.UNIVERSAL,z.Type.GENERALIZEDTIME,!1,z.dateToGeneralizedTime(s))}return z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.type).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SET,!0,[e])])}u(EC,"_attributeToAsn1");function QM(r){return[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(Fe.pki.oids.data).getBytes()),z.create(z.Class.UNIVERSAL,z.Type.SEQUENCE,!0,[z.create(z.Class.UNIVERSAL,z.Type.OID,!1,z.oidToDer(r.algorithm).getBytes()),r.parameter?z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.parameter.getBytes()):void 0]),z.create(z.Class.CONTEXT_SPECIFIC,0,!0,[z.create(z.Class.UNIVERSAL,z.Type.OCTETSTRING,!1,r.content.getBytes())])]}u(QM,"_encryptedContentToAsn1");function wC(r,e,t){var n={},s=[];if(!z.validate(e,t,n,s)){var i=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw i.errors=i,i}var a=z.derToOid(n.contentType);if(a!==Fe.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var o="";if(Fe.util.isArray(n.encryptedContent))for(var l=0;l<n.encryptedContent.length;++l){if(n.encryptedContent[l].type!==z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=n.encryptedContent[l].value}else o=n.encryptedContent;r.encryptedContent={algorithm:z.derToOid(n.encAlgorithm),parameter:Fe.util.createBuffer(n.encParameter.value),content:Fe.util.createBuffer(o)}}if(n.content){var o="";if(Fe.util.isArray(n.content))for(var l=0;l<n.content.length;++l){if(n.content[l].type!==z.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=n.content[l].value}else o=n.content;r.content=Fe.util.createBuffer(o)}return r.version=n.version.charCodeAt(0),r.rawCapture=n,n}u(wC,"_fromAsn1");function $B(r){if(r.encryptedContent.key===void 0)throw new Error("Symmetric key not available.");if(r.content===void 0){var e;switch(r.encryptedContent.algorithm){case Fe.pki.oids["aes128-CBC"]:case Fe.pki.oids["aes192-CBC"]:case Fe.pki.oids["aes256-CBC"]:e=Fe.aes.createDecryptionCipher(r.encryptedContent.key);break;case Fe.pki.oids.desCBC:case Fe.pki.oids["des-EDE3-CBC"]:e=Fe.des.createDecryptionCipher(r.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+r.encryptedContent.algorithm)}if(e.start(r.encryptedContent.parameter),e.update(r.encryptedContent.content),!e.finish())throw new Error("Symmetric decryption failed.");r.content=e.output}}u($B,"_decryptContent")});var YB=ue((ate,JB)=>{"use strict";var Mr=bt();oo();gf();Wy();wf();jt();var yv=JB.exports=Mr.ssh=Mr.ssh||{};yv.privateKeyToPutty=function(r,e,t){t=t||"",e=e||"";var n="ssh-rsa",s=e===""?"none":"aes256-cbc",i="PuTTY-User-Key-File-2: "+n+`\r
16
+ `;i+="Encryption: "+s+`\r
17
+ `,i+="Comment: "+t+`\r
18
+ `;var a=Mr.util.createBuffer();If(a,n),Ni(a,r.e),Ni(a,r.n);var o=Mr.util.encode64(a.bytes(),64),l=Math.floor(o.length/66)+1;i+="Public-Lines: "+l+`\r
19
+ `,i+=o;var c=Mr.util.createBuffer();Ni(c,r.d),Ni(c,r.p),Ni(c,r.q),Ni(c,r.qInv);var f;if(!e)f=Mr.util.encode64(c.bytes(),64);else{var p=c.length()+16-1;p-=p%16;var d=gv(c.bytes());d.truncate(d.length()-p+c.length()),c.putBuffer(d);var g=Mr.util.createBuffer();g.putBuffer(gv("\0\0\0\0",e)),g.putBuffer(gv("\0\0\0",e));var m=Mr.aes.createEncryptionCipher(g.truncate(8),"CBC");m.start(Mr.util.createBuffer().fillWithByte(0,16)),m.update(c.copy()),m.finish();var v=m.output;v.truncate(16),f=Mr.util.encode64(v.bytes(),64)}l=Math.floor(f.length/66)+1,i+=`\r
20
+ Private-Lines: `+l+`\r
21
+ `,i+=f;var y=gv("putty-private-key-file-mac-key",e),S=Mr.util.createBuffer();If(S,n),If(S,s),If(S,t),S.putInt32(a.length()),S.putBuffer(a),S.putInt32(c.length()),S.putBuffer(c);var C=Mr.hmac.create();return C.start("sha1",y),C.update(S.bytes()),i+=`\r
22
+ Private-MAC: `+C.digest().toHex()+`\r
23
+ `,i};yv.publicKeyToOpenSSH=function(r,e){var t="ssh-rsa";e=e||"";var n=Mr.util.createBuffer();return If(n,t),Ni(n,r.e),Ni(n,r.n),t+" "+Mr.util.encode64(n.bytes())+" "+e};yv.privateKeyToOpenSSH=function(r,e){return e?Mr.pki.encryptRsaPrivateKey(r,e,{legacy:!0,algorithm:"aes128"}):Mr.pki.privateKeyToPem(r)};yv.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||Mr.md.md5.create(),n="ssh-rsa",s=Mr.util.createBuffer();If(s,n),Ni(s,r.e),Ni(s,r.n),t.start(),t.update(s.getBytes());var i=t.digest();if(e.encoding==="hex"){var a=i.toHex();return e.delimiter?a.match(/.{2}/g).join(e.delimiter):a}else{if(e.encoding==="binary")return i.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return i};function Ni(r,e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var n=Mr.util.hexToBytes(t);r.putInt32(n.length),r.putBytes(n)}u(Ni,"_addBigIntegerToBuffer");function If(r,e){r.putInt32(e.length),r.putString(e)}u(If,"_addStringToBuffer");function gv(){for(var r=Mr.md.sha1.create(),e=arguments.length,t=0;t<e;++t)r.update(arguments[t]);return r.digest()}u(gv,"_sha1")});var ZB=ue((ute,QB)=>{"use strict";QB.exports=bt();oo();vB();Js();jy();td();LB();gf();MB();KB();GB();$A();Qy();zu();jA();JA();zB();QA();HA();_A();iv();Es();LA();YB();sC();jt()});var KC=ue((lre,nO)=>{"use strict";var _R=yV(),y9=st("crypto"),v9=st("url"),E9=st("http"),w9=st("https"),PR=st("http2"),UC=st("util"),S9=vV(),Eo=st("zlib"),Kn=st("stream"),A9=st("events");function kR(r,e){return u(function(){return r.apply(e,arguments)},"wrap")}u(kR,"bind");var{toString:C9}=Object.prototype,{getPrototypeOf:Rv}=Object,{iterator:Ov,toStringTag:LR}=Symbol,_v=(r=>e=>{let t=C9.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Qs=u(r=>(r=r.toLowerCase(),e=>_v(e)===r),"kindOfTest"),Pv=u(r=>e=>typeof e===r,"typeOfTest"),{isArray:Lf}=Array,Pf=Pv("undefined");function yd(r){return r!==null&&!Pf(r)&&r.constructor!==null&&!Pf(r.constructor)&&Xn(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}u(yd,"isBuffer");var VR=Qs("ArrayBuffer");function x9(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&VR(r.buffer),e}u(x9,"isArrayBufferView");var b9=Pv("string"),Xn=Pv("function"),FR=Pv("number"),vd=u(r=>r!==null&&typeof r=="object","isObject"),N9=u(r=>r===!0||r===!1,"isBoolean"),Cv=u(r=>{if(_v(r)!=="object")return!1;let e=Rv(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(LR in r)&&!(Ov in r)},"isPlainObject"),T9=u(r=>{if(!vd(r)||yd(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},"isEmptyObject"),I9=Qs("Date"),D9=Qs("File"),B9=u(r=>!!(r&&typeof r.uri<"u"),"isReactNativeBlob"),R9=u(r=>r&&typeof r.getParts<"u","isReactNative"),O9=Qs("Blob"),_9=Qs("FileList"),P9=u(r=>vd(r)&&Xn(r.pipe),"isStream");function k9(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}u(k9,"getGlobal");var cR=k9(),fR=typeof cR.FormData<"u"?cR.FormData:void 0,L9=u(r=>{if(!r)return!1;if(fR&&r instanceof fR)return!0;let e=Rv(r);if(!e||e===Object.prototype||!Xn(r.append))return!1;let t=_v(r);return t==="formdata"||t==="object"&&Xn(r.toString)&&r.toString()==="[object FormData]"},"isFormData"),V9=Qs("URLSearchParams"),[F9,U9,M9,j9]=["ReadableStream","Request","Response","Headers"].map(Qs),q9=u(r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function Ed(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,s;if(typeof r!="object"&&(r=[r]),Lf(r))for(n=0,s=r.length;n<s;n++)e.call(null,r[n],n,r);else{if(yd(r))return;let i=t?Object.getOwnPropertyNames(r):Object.keys(r),a=i.length,o;for(n=0;n<a;n++)o=i[n],e.call(null,r[o],o,r)}}u(Ed,"forEach");function UR(r,e){if(yd(r))return null;e=e.toLowerCase();let t=Object.keys(r),n=t.length,s;for(;n-- >0;)if(s=t[n],e===s.toLowerCase())return s;return null}u(UR,"findKey");var sl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,MR=u(r=>!Pf(r)&&r!==sl,"isContextDefined");function BC(){let{caseless:r,skipUndefined:e}=MR(this)&&this||{},t={},n=u((s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;let a=r&&UR(t,i)||i;Cv(t[a])&&Cv(s)?t[a]=BC(t[a],s):Cv(s)?t[a]=BC({},s):Lf(s)?t[a]=s.slice():(!e||!Pf(s))&&(t[a]=s)},"assignValue");for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Ed(arguments[s],n);return t}u(BC,"merge");var H9=u((r,e,t,{allOwnKeys:n}={})=>(Ed(e,(s,i)=>{t&&Xn(s)?Object.defineProperty(r,i,{value:kR(s,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,i,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),r),"extend"),K9=u(r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),"stripBOM"),X9=u((r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),Object.defineProperty(r.prototype,"constructor",{value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},"inherits"),G9=u((r,e,t,n)=>{let s,i,a,o={};if(e=e||{},r==null)return e;do{for(s=Object.getOwnPropertyNames(r),i=s.length;i-- >0;)a=s[i],(!n||n(a,r,e))&&!o[a]&&(e[a]=r[a],o[a]=!0);r=t!==!1&&Rv(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},"toFlatObject"),$9=u((r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;let n=r.indexOf(e,t);return n!==-1&&n===t},"endsWith"),W9=u(r=>{if(!r)return null;if(Lf(r))return r;let e=r.length;if(!FR(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},"toArray"),z9=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&Rv(Uint8Array)),J9=u((r,e)=>{let n=(r&&r[Ov]).call(r),s;for(;(s=n.next())&&!s.done;){let i=s.value;e.call(r,i[0],i[1])}},"forEachEntry"),Y9=u((r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},"matchAll"),Q9=Qs("HTMLFormElement"),Z9=u(r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,u(function(t,n,s){return n.toUpperCase()+s},"replacer")),"toCamelCase"),hR=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),ej=Qs("RegExp"),jR=u((r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};Ed(t,(s,i)=>{let a;(a=e(s,i,r))!==!1&&(n[i]=a||s)}),Object.defineProperties(r,n)},"reduceDescriptors"),tj=u(r=>{jR(r,(e,t)=>{if(Xn(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(Xn(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},"freezeMethods"),rj=u((r,e)=>{let t={},n=u(s=>{s.forEach(i=>{t[i]=!0})},"define");return Lf(r)?n(r):n(String(r).split(e)),t},"toObjectSet"),nj=u(()=>{},"noop"),sj=u((r,e)=>r!=null&&Number.isFinite(r=+r)?r:e,"toFiniteNumber");function ij(r){return!!(r&&Xn(r.append)&&r[LR]==="FormData"&&r[Ov])}u(ij,"isSpecCompliantForm");var aj=u(r=>{let e=new Array(10),t=u((n,s)=>{if(vd(n)){if(e.indexOf(n)>=0)return;if(yd(n))return n;if(!("toJSON"in n)){e[s]=n;let i=Lf(n)?[]:{};return Ed(n,(a,o)=>{let l=t(a,s+1);!Pf(l)&&(i[o]=l)}),e[s]=void 0,i}}return n},"visit");return t(r,0)},"toJSONObject"),oj=Qs("AsyncFunction"),uj=u(r=>r&&(vd(r)||Xn(r))&&Xn(r.then)&&Xn(r.catch),"isThenable"),qR=((r,e)=>r?setImmediate:e?((t,n)=>(sl.addEventListener("message",({source:s,data:i})=>{s===sl&&i===t&&n.length&&n.shift()()},!1),s=>{n.push(s),sl.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Xn(sl.postMessage)),lj=typeof queueMicrotask<"u"?queueMicrotask.bind(sl):typeof process<"u"&&process.nextTick||qR,cj=u(r=>r!=null&&Xn(r[Ov]),"isIterable"),te={isArray:Lf,isArrayBuffer:VR,isBuffer:yd,isFormData:L9,isArrayBufferView:x9,isString:b9,isNumber:FR,isBoolean:N9,isObject:vd,isPlainObject:Cv,isEmptyObject:T9,isReadableStream:F9,isRequest:U9,isResponse:M9,isHeaders:j9,isUndefined:Pf,isDate:I9,isFile:D9,isReactNativeBlob:B9,isReactNative:R9,isBlob:O9,isRegExp:ej,isFunction:Xn,isStream:P9,isURLSearchParams:V9,isTypedArray:z9,isFileList:_9,forEach:Ed,merge:BC,extend:H9,trim:q9,stripBOM:K9,inherits:X9,toFlatObject:G9,kindOf:_v,kindOfTest:Qs,endsWith:$9,toArray:W9,forEachEntry:J9,matchAll:Y9,isHTMLForm:Q9,hasOwnProperty:hR,hasOwnProp:hR,reduceDescriptors:jR,freezeMethods:tj,toObjectSet:rj,toCamelCase:Z9,noop:nj,toFiniteNumber:sj,findKey:UR,global:sl,isContextDefined:MR,isSpecCompliantForm:ij,toJSONObject:aj,isAsyncFn:oj,isThenable:uj,setImmediate:qR,asap:lj,isIterable:cj},Re=class r extends Error{static{u(this,"AxiosError")}static from(e,t,n,s,i,a){let o=new r(e.message,t||e.code,n,s,i);return o.cause=e,o.name=e.name,e.status!=null&&o.status==null&&(o.status=e.status),a&&Object.assign(o,a),o}constructor(e,t,n,s,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){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:te.toJSONObject(this.config),code:this.code,status:this.status}}};Re.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Re.ERR_BAD_OPTION="ERR_BAD_OPTION";Re.ECONNABORTED="ECONNABORTED";Re.ETIMEDOUT="ETIMEDOUT";Re.ERR_NETWORK="ERR_NETWORK";Re.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Re.ERR_DEPRECATED="ERR_DEPRECATED";Re.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Re.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Re.ERR_CANCELED="ERR_CANCELED";Re.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Re.ERR_INVALID_URL="ERR_INVALID_URL";Re.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function RC(r){return te.isPlainObject(r)||te.isArray(r)}u(RC,"isVisitable");function HR(r){return te.endsWith(r,"[]")?r.slice(0,-2):r}u(HR,"removeBrackets");function xC(r,e,t){return r?r.concat(e).map(u(function(s,i){return s=HR(s),!t&&i?"["+s+"]":s},"each")).join(t?".":""):e}u(xC,"renderKey");function fj(r){return te.isArray(r)&&!r.some(RC)}u(fj,"isFlatArray");var hj=te.toFlatObject(te,{},null,u(function(e){return/^is[A-Z]/.test(e)},"filter"));function kv(r,e,t){if(!te.isObject(r))throw new TypeError("target must be an object");e=e||new(_R||FormData),t=te.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,u(function(y,S){return!te.isUndefined(S[y])},"defined"));let n=t.metaTokens,s=t.visitor||p,i=t.dots,a=t.indexes,o=t.Blob||typeof Blob<"u"&&Blob,l=t.maxDepth===void 0?100:t.maxDepth,c=o&&te.isSpecCompliantForm(e);if(!te.isFunction(s))throw new TypeError("visitor must be a function");function f(v){if(v===null)return"";if(te.isDate(v))return v.toISOString();if(te.isBoolean(v))return v.toString();if(!c&&te.isBlob(v))throw new Re("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(v)||te.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}u(f,"convertValue");function p(v,y,S){let C=v;if(te.isReactNative(e)&&te.isReactNativeBlob(v))return e.append(xC(S,y,i),f(v)),!1;if(v&&!S&&typeof v=="object"){if(te.endsWith(y,"{}"))y=n?y:y.slice(0,-2),v=JSON.stringify(v);else if(te.isArray(v)&&fj(v)||(te.isFileList(v)||te.endsWith(y,"[]"))&&(C=te.toArray(v)))return y=HR(y),C.forEach(u(function(E,A){!(te.isUndefined(E)||E===null)&&e.append(a===!0?xC([y],A,i):a===null?y:y+"[]",f(E))},"each")),!1}return RC(v)?!0:(e.append(xC(S,y,i),f(v)),!1)}u(p,"defaultVisitor");let d=[],g=Object.assign(hj,{defaultVisitor:p,convertValue:f,isVisitable:RC});function m(v,y,S=0){if(!te.isUndefined(v)){if(S>l)throw new Re("Object is too deeply nested ("+S+" levels). Max depth: "+l,Re.ERR_FORM_DATA_DEPTH_EXCEEDED);if(d.indexOf(v)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(v),te.forEach(v,u(function(w,E){(!(te.isUndefined(w)||w===null)&&s.call(e,w,te.isString(E)?E.trim():E,y,g))===!0&&m(w,y?y.concat(E):[E],S+1)},"each")),d.pop()}}if(u(m,"build"),!te.isObject(r))throw new TypeError("data must be an object");return m(r),e}u(kv,"toFormData");function pR(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(r).replace(/[!'()~]|%20/g,u(function(n){return e[n]},"replacer"))}u(pR,"encode$1");function KR(r,e){this._pairs=[],r&&kv(r,this,e)}u(KR,"AxiosURLSearchParams");var XR=KR.prototype;XR.append=u(function(e,t){this._pairs.push([e,t])},"append");XR.toString=u(function(e){let t=e?function(n){return e.call(this,n,pR)}:pR;return this._pairs.map(u(function(s){return t(s[0])+"="+t(s[1])},"each"),"").join("&")},"toString");function pj(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}u(pj,"encode");function MC(r,e,t){if(!e)return r;let n=t&&t.encode||pj,s=te.isFunction(t)?{serialize:t}:t,i=s&&s.serialize,a;if(i?a=i(e,s):a=te.isURLSearchParams(e)?e.toString():new KR(e,s).toString(n),a){let o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}u(MC,"buildURL");var Nv=class{static{u(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,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){te.forEach(this.handlers,u(function(n){n!==null&&e(n)},"forEachHandler"))}},Lv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},dj=v9.URLSearchParams,bC="abcdefghijklmnopqrstuvwxyz",dR="0123456789",GR={DIGIT:dR,ALPHA:bC,ALPHA_DIGIT:bC+bC.toUpperCase()+dR},mj=u((r=16,e=GR.ALPHA_DIGIT)=>{let t="",{length:n}=e,s=new Uint32Array(r);y9.randomFillSync(s);for(let i=0;i<r;i++)t+=e[s[i]%n];return t},"generateString"),gj={isNode:!0,classes:{URLSearchParams:dj,FormData:_R,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:GR,generateString:mj,protocols:["http","https","file","data"]},jC=typeof window<"u"&&typeof document<"u",OC=typeof navigator=="object"&&navigator||void 0,yj=jC&&(!OC||["ReactNative","NativeScript","NS"].indexOf(OC.product)<0),vj=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ej=jC&&window.location.href||"http://localhost",wj=Object.freeze({__proto__:null,hasBrowserEnv:jC,hasStandardBrowserEnv:yj,hasStandardBrowserWebWorkerEnv:vj,navigator:OC,origin:Ej}),Br={...wj,...gj};function Sj(r,e){return kv(r,new Br.classes.URLSearchParams,{visitor:u(function(t,n,s,i){return Br.isNode&&te.isBuffer(t)?(this.append(n,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},"visitor"),...e})}u(Sj,"toURLEncodedForm");function Aj(r){return te.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}u(Aj,"parsePropPath");function Cj(r){let e={},t=Object.keys(r),n,s=t.length,i;for(n=0;n<s;n++)i=t[n],e[i]=r[i];return e}u(Cj,"arrayToObject");function $R(r){function e(t,n,s,i){let a=t[i++];if(a==="__proto__")return!0;let o=Number.isFinite(+a),l=i>=t.length;return a=!a&&te.isArray(s)?s.length:a,l?(te.hasOwnProp(s,a)?s[a]=te.isArray(s[a])?s[a].concat(n):[s[a],n]:s[a]=n,!o):((!s[a]||!te.isObject(s[a]))&&(s[a]=[]),e(t,n,s[a],i)&&te.isArray(s[a])&&(s[a]=Cj(s[a])),!o)}if(u(e,"buildPath"),te.isFormData(r)&&te.isFunction(r.entries)){let t={};return te.forEachEntry(r,(n,s)=>{e(Aj(n),s,t,0)}),t}return null}u($R,"formDataToJSON");var Of=u((r,e)=>r!=null&&te.hasOwnProp(r,e)?r[e]:void 0,"own");function xj(r,e,t){if(te.isString(r))try{return(e||JSON.parse)(r),te.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}u(xj,"stringifySafely");var wd={transitional:Lv,adapter:["xhr","http","fetch"],transformRequest:[u(function(e,t){let n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=te.isObject(e);if(i&&te.isHTMLForm(e)&&(e=new FormData(e)),te.isFormData(e))return s?JSON.stringify($R(e)):e;if(te.isArrayBuffer(e)||te.isBuffer(e)||te.isStream(e)||te.isFile(e)||te.isBlob(e)||te.isReadableStream(e))return e;if(te.isArrayBufferView(e))return e.buffer;if(te.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){let l=Of(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return Sj(e,l).toString();if((o=te.isFileList(e))||n.indexOf("multipart/form-data")>-1){let c=Of(this,"env"),f=c&&c.FormData;return kv(o?{"files[]":e}:e,f&&new f,l)}}return i||s?(t.setContentType("application/json",!1),xj(e)):e},"transformRequest")],transformResponse:[u(function(e){let t=Of(this,"transitional")||wd.transitional,n=t&&t.forcedJSONParsing,s=Of(this,"responseType"),i=s==="json";if(te.isResponse(e)||te.isReadableStream(e))return e;if(e&&te.isString(e)&&(n&&!s||i)){let o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Of(this,"parseReviver"))}catch(l){if(o)throw l.name==="SyntaxError"?Re.from(l,Re.ERR_BAD_RESPONSE,this,null,Of(this,"response")):l}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Br.classes.FormData,Blob:Br.classes.Blob},validateStatus:u(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};te.forEach(["delete","get","head","post","put","patch"],r=>{wd.headers[r]={}});var bj=te.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"]),Nj=u(r=>{let e={},t,n,s;return r&&r.split(`
24
+ `).forEach(u(function(a){s=a.indexOf(":"),t=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!t||e[t]&&bj[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)},"parser")),e},"parseHeaders"),mR=Symbol("internals"),Tj=/[^\x09\x20-\x7E\x80-\xFF]/g;function Ij(r){let e=0,t=r.length;for(;e<t;){let n=r.charCodeAt(e);if(n!==9&&n!==32)break;e+=1}for(;t>e;){let n=r.charCodeAt(t-1);if(n!==9&&n!==32)break;t-=1}return e===0&&t===r.length?r:r.slice(e,t)}u(Ij,"trimSPorHTAB");function md(r){return r&&String(r).trim().toLowerCase()}u(md,"normalizeHeader");function Dj(r){return Ij(r.replace(Tj,""))}u(Dj,"sanitizeHeaderValue");function xv(r){return r===!1||r==null?r:te.isArray(r)?r.map(xv):Dj(String(r))}u(xv,"normalizeValue");function Bj(r){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}u(Bj,"parseTokens");var Rj=u(r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()),"isValidHeaderName");function NC(r,e,t,n,s){if(te.isFunction(n))return n.call(this,e,t);if(s&&(e=t),!!te.isString(e)){if(te.isString(n))return e.indexOf(n)!==-1;if(te.isRegExp(n))return n.test(e)}}u(NC,"matchHeaderValue");function Oj(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}u(Oj,"formatHeader");function _j(r,e){let t=te.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:u(function(s,i,a){return this[n].call(this,e,s,i,a)},"value"),configurable:!0})})}u(_j,"buildAccessors");var Xr=class{static{u(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,t,n){let s=this;function i(o,l,c){let f=md(l);if(!f)throw new Error("header name must be a non-empty string");let p=te.findKey(s,f);(!p||s[p]===void 0||c===!0||c===void 0&&s[p]!==!1)&&(s[p||l]=xv(o))}u(i,"setHeader");let a=u((o,l)=>te.forEach(o,(c,f)=>i(c,f,l)),"setHeaders");if(te.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(te.isString(e)&&(e=e.trim())&&!Rj(e))a(Nj(e),t);else if(te.isObject(e)&&te.isIterable(e)){let o={},l,c;for(let f of e){if(!te.isArray(f))throw TypeError("Object iterator must return a key-value pair");o[c=f[0]]=(l=o[c])?te.isArray(l)?[...l,f[1]]:[l,f[1]]:f[1]}a(o,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=md(e),e){let n=te.findKey(this,e);if(n){let s=this[n];if(!t)return s;if(t===!0)return Bj(s);if(te.isFunction(t))return t.call(this,s,n);if(te.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=md(e),e){let n=te.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||NC(this,this[n],n,t)))}return!1}delete(e,t){let n=this,s=!1;function i(a){if(a=md(a),a){let o=te.findKey(n,a);o&&(!t||NC(n,n[o],o,t))&&(delete n[o],s=!0)}}return u(i,"deleteHeader"),te.isArray(e)?e.forEach(i):i(e),s}clear(e){let t=Object.keys(this),n=t.length,s=!1;for(;n--;){let i=t[n];(!e||NC(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){let t=this,n={};return te.forEach(this,(s,i)=>{let a=te.findKey(n,i);if(a){t[a]=xv(s),delete t[i];return}let o=e?Oj(i):String(i).trim();o!==i&&delete t[i],t[o]=xv(s),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return te.forEach(this,(n,s)=>{n!=null&&n!==!1&&(t[s]=e&&te.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
25
+ `)}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,...t){let n=new this(e);return t.forEach(s=>n.set(s)),n}static accessor(e){let n=(this[mR]=this[mR]={accessors:{}}).accessors,s=this.prototype;function i(a){let o=md(a);n[o]||(_j(s,a),n[o]=!0)}return u(i,"defineAccessor"),te.isArray(e)?e.forEach(i):i(e),this}};Xr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);te.reduceDescriptors(Xr.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:u(()=>r,"get"),set(n){this[t]=n}}});te.freezeMethods(Xr);function TC(r,e){let t=this||wd,n=e||t,s=Xr.from(n.headers),i=n.data;return te.forEach(r,u(function(o){i=o.call(t,i,s.normalize(),e?e.status:void 0)},"transform")),s.normalize(),i}u(TC,"transformData");function WR(r){return!!(r&&r.__CANCEL__)}u(WR,"isCancel");var ua=class extends Re{static{u(this,"CanceledError")}constructor(e,t,n){super(e??"canceled",Re.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function _f(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new Re("Request failed with status code "+t.status,[Re.ERR_BAD_REQUEST,Re.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}u(_f,"settle");function Pj(r){return typeof r!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}u(Pj,"isAbsoluteURL");function kj(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}u(kj,"combineURLs");function qC(r,e,t){let n=!Pj(e);return r&&(n||t===!1)?kj(r,e):e}u(qC,"buildFullPath");var Lj={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Vj(r){try{return new URL(r)}catch{return null}}u(Vj,"parseUrl");function Fj(r){var e=(typeof r=="string"?Vj(r):r)||{},t=e.protocol,n=e.host,s=e.port;if(typeof n!="string"||!n||typeof t!="string"||(t=t.split(":",1)[0],n=n.replace(/:\d*$/,""),s=parseInt(s)||Lj[t]||0,!Uj(n,s)))return"";var i=_C(t+"_proxy")||_C("all_proxy");return i&&i.indexOf("://")===-1&&(i=t+"://"+i),i}u(Fj,"getProxyForUrl");function Uj(r,e){var t=_C("no_proxy").toLowerCase();return t?t==="*"?!1:t.split(/[,\s]/).every(function(n){if(!n)return!0;var s=n.match(/^(.+):(\d+)$/),i=s?s[1]:n,a=s?parseInt(s[2]):0;return a&&a!==e?!0:/^[.*]/.test(i)?(i.charAt(0)==="*"&&(i=i.slice(1)),!r.endsWith(i)):r!==i}):!0}u(Uj,"shouldProxy");function _C(r){return process.env[r.toLowerCase()]||process.env[r.toUpperCase()]||""}u(_C,"getEnv");var Tv="1.15.1";function zR(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}u(zR,"parseProtocol");var Mj=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function jj(r,e,t){let n=t&&t.Blob||Br.classes.Blob,s=zR(r);if(e===void 0&&n&&(e=!0),s==="data"){r=s.length?r.slice(s.length+1):r;let i=Mj.exec(r);if(!i)throw new Re("Invalid URL",Re.ERR_INVALID_URL);let a=i[1],o=i[2],l=i[3],c=Buffer.from(decodeURIComponent(l),o?"base64":"utf8");if(e){if(!n)throw new Re("Blob is not supported",Re.ERR_NOT_SUPPORT);return new n([c],{type:a})}return c}throw new Re("Unsupported protocol "+s,Re.ERR_NOT_SUPPORT)}u(jj,"fromDataURI");var IC=Symbol("internals"),Iv=class extends Kn.Transform{static{u(this,"AxiosTransformStream")}constructor(e){e=te.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,s)=>!te.isUndefined(s[n])),super({readableHighWaterMark:e.chunkSize});let t=this[IC]={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"&&(t.isCaptured||(t.isCaptured=!0))})}_read(e){let t=this[IC];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let s=this[IC],i=s.maxRate,a=this.readableHighWaterMark,o=s.timeWindow,l=1e3/o,c=i/l,f=s.minChunkSize!==!1?Math.max(s.minChunkSize,c*.01):0,p=u((g,m)=>{let v=Buffer.byteLength(g);s.bytesSeen+=v,s.bytes+=v,s.isCaptured&&this.emit("progress",s.bytesSeen),this.push(g)?process.nextTick(m):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(m)}},"pushChunk"),d=u((g,m)=>{let v=Buffer.byteLength(g),y=null,S=a,C,w=0;if(i){let E=Date.now();(!s.ts||(w=E-s.ts)>=o)&&(s.ts=E,C=c-s.bytes,s.bytes=C<0?-C:0,w=0),C=c-s.bytes}if(i){if(C<=0)return setTimeout(()=>{m(null,g)},o-w);C<S&&(S=C)}S&&v>S&&v-S>f&&(y=g.subarray(S),g=g.subarray(0,S)),p(g,y?()=>{process.nextTick(m,null,y)}:m)},"transformChunk");d(e,u(function g(m,v){if(m)return n(m);v?d(v,g):n(null)},"transformNextChunk"))}},{asyncIterator:gR}=Symbol,JR=u(async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[gR]?yield*r[gR]():yield r},"readBlob"),qj=Br.ALPHABET.ALPHA_DIGIT+"-_",gd=typeof TextEncoder=="function"?new TextEncoder:new UC.TextEncoder,il=`\r
26
+ `,Hj=gd.encode(il),Kj=2,PC=class{static{u(this,"FormDataPart")}constructor(e,t){let{escapeName:n}=this.constructor,s=te.isString(t),i=`Content-Disposition: form-data; name="${n(e)}"${!s&&t.name?`; filename="${n(t.name)}"`:""}${il}`;if(s)t=gd.encode(String(t).replace(/\r?\n|\r\n?/g,il));else{let a=String(t.type||"application/octet-stream").replace(/[\r\n]/g,"");i+=`Content-Type: ${a}${il}`}this.headers=gd.encode(i+il),this.contentLength=s?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+Kj,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;te.isTypedArray(e)?yield e:yield*JR(e),yield Hj}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},Xj=u((r,e,t)=>{let{tag:n="form-data-boundary",size:s=25,boundary:i=n+"-"+Br.generateString(s,qj)}=t||{};if(!te.isFormData(r))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let a=gd.encode("--"+i+il),o=gd.encode("--"+i+"--"+il),l=o.byteLength,c=Array.from(r.entries()).map(([p,d])=>{let g=new PC(p,d);return l+=g.size,g});l+=a.byteLength*c.length,l=te.toFiniteNumber(l);let f={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(l)&&(f["Content-Length"]=l),e&&e(f),Kn.Readable.from((async function*(){for(let p of c)yield a,yield*p.encode();yield o})())},"formDataToStream"),kC=class extends Kn.Transform{static{u(this,"ZlibHeaderTransformStream")}__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let s=Buffer.alloc(2);s[0]=120,s[1]=156,this.push(s,t)}this.__transform(e,t,n)}},Gj=u((r,e)=>te.isAsyncFn(r)?function(...t){let n=t.pop();r.apply(this,t).then(s=>{try{e?n(null,...e(s)):n(null,s)}catch(i){n(i)}},n)}:r,"callbackify"),$j=new Set(["localhost"]),YR=u(r=>{let e=r.split(".");return e.length!==4||e[0]!=="127"?!1:e.every(t=>/^\d+$/.test(t)&&Number(t)>=0&&Number(t)<=255)},"isIPv4Loopback"),Wj=u(r=>{if(r==="::1")return!0;let e=r.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(e)return YR(e[1]);let t=r.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(t){let s=parseInt(t[1],16);return s>=32512&&s<=32767}let n=r.split(":");if(n.length===8){for(let s=0;s<7;s++)if(!/^0+$/.test(n[s]))return!1;return/^0*1$/.test(n[7])}return!1},"isIPv6Loopback"),yR=u(r=>r?$j.has(r)||YR(r)?!0:Wj(r):!1,"isLoopback"),zj={http:80,https:443,ws:80,wss:443,ftp:21},Jj=u(r=>{let e=r,t=0;if(e.charAt(0)==="["){let i=e.indexOf("]");if(i!==-1){let a=e.slice(1,i),o=e.slice(i+1);return o.charAt(0)===":"&&/^\d+$/.test(o.slice(1))&&(t=Number.parseInt(o.slice(1),10)),[a,t]}}let n=e.indexOf(":"),s=e.lastIndexOf(":");return n!==-1&&n===s&&/^\d+$/.test(e.slice(s+1))&&(t=Number.parseInt(e.slice(s+1),10),e=e.slice(0,s)),[e,t]},"parseNoProxyEntry"),vR=u(r=>r&&(r.charAt(0)==="["&&r.charAt(r.length-1)==="]"&&(r=r.slice(1,-1)),r.replace(/\.+$/,"")),"normalizeNoProxyHost");function Yj(r){let e;try{e=new URL(r)}catch{return!1}let t=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!t)return!1;if(t==="*")return!0;let n=Number.parseInt(e.port,10)||zj[e.protocol.split(":",1)[0]]||0,s=vR(e.hostname.toLowerCase());return t.split(/[\s,]+/).some(i=>{if(!i)return!1;let[a,o]=Jj(i);return a=vR(a),!a||o&&o!==n?!1:(a.charAt(0)==="*"&&(a=a.slice(1)),a.charAt(0)==="."?s.endsWith(a):s===a||yR(s)&&yR(a))})}u(Yj,"shouldBypassProxy");function Qj(r,e){r=r||10;let t=new Array(r),n=new Array(r),s=0,i=0,a;return e=e!==void 0?e:1e3,u(function(l){let c=Date.now(),f=n[i];a||(a=c),t[s]=l,n[s]=c;let p=i,d=0;for(;p!==s;)d+=t[p++],p=p%r;if(s=(s+1)%r,s===i&&(i=(i+1)%r),c-a<e)return;let g=f&&c-f;return g?Math.round(d*1e3/g):void 0},"push")}u(Qj,"speedometer");function Zj(r,e){let t=0,n=1e3/e,s,i,a=u((c,f=Date.now())=>{t=f,s=null,i&&(clearTimeout(i),i=null),r(...c)},"invoke");return[u((...c)=>{let f=Date.now(),p=f-t;p>=n?a(c,f):(s=c,i||(i=setTimeout(()=>{i=null,a(s)},n-p)))},"throttled"),u(()=>s&&a(s),"flush")]}u(Zj,"throttle");var kf=u((r,e,t=3)=>{let n=0,s=Qj(50,250);return Zj(i=>{let a=i.loaded,o=i.lengthComputable?i.total:void 0,l=o!=null?Math.min(a,o):a,c=Math.max(0,l-n),f=s(c);n=Math.max(n,l);let p={loaded:l,total:o,progress:o?l/o:void 0,bytes:c,rate:f||void 0,estimated:f&&o?(o-l)/f:void 0,event:i,lengthComputable:o!=null,[e?"download":"upload"]:!0};r(p)},t)},"progressEventReducer"),Dv=u((r,e)=>{let t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},"progressEventDecorator"),Bv=u(r=>(...e)=>te.asap(()=>r(...e)),"asyncDecorator");function eq(r){if(!r||typeof r!="string"||!r.startsWith("data:"))return 0;let e=r.indexOf(",");if(e<0)return 0;let t=r.slice(5,e),n=r.slice(e+1);if(/;base64/i.test(t)){let i=n.length,a=n.length;for(let d=0;d<a;d++)if(n.charCodeAt(d)===37&&d+2<a){let g=n.charCodeAt(d+1),m=n.charCodeAt(d+2);(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102)&&(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102)&&(i-=2,d+=2)}let o=0,l=a-1,c=u(d=>d>=2&&n.charCodeAt(d-2)===37&&n.charCodeAt(d-1)===51&&(n.charCodeAt(d)===68||n.charCodeAt(d)===100),"tailIsPct3D");l>=0&&(n.charCodeAt(l)===61?(o++,l--):c(l)&&(o++,l-=3)),o===1&&l>=0&&(n.charCodeAt(l)===61||c(l))&&o++;let p=Math.floor(i/4)*3-(o||0);return p>0?p:0}return Buffer.byteLength(n,"utf8")}u(eq,"estimateDataURLDecodedBytes");var ER={flush:Eo.constants.Z_SYNC_FLUSH,finishFlush:Eo.constants.Z_SYNC_FLUSH},tq={flush:Eo.constants.BROTLI_OPERATION_FLUSH,finishFlush:Eo.constants.BROTLI_OPERATION_FLUSH},wR=te.isFunction(Eo.createBrotliDecompress),{http:rq,https:nq}=S9,sq=/https:?/,SR=Br.protocols.map(r=>r+":"),AR=u((r,[e,t])=>(r.on("end",t).on("error",t),e),"flushOnFinish"),LC=class{static{u(this,"Http2Sessions")}constructor(){this.sessions=Object.create(null)}getSession(e,t){t=Object.assign({sessionTimeout:1e3},t);let n=this.sessions[e];if(n){let f=n.length;for(let p=0;p<f;p++){let[d,g]=n[p];if(!d.destroyed&&!d.closed&&UC.isDeepStrictEqual(g,t))return d}}let s=PR.connect(e,t),i,a=u(()=>{if(i)return;i=!0;let f=n,p=f.length,d=p;for(;d--;)if(f[d][0]===s){p===1?delete this.sessions[e]:f.splice(d,1),s.closed||s.close();return}},"removeSession"),o=s.request,{sessionTimeout:l}=t;if(l!=null){let f,p=0;s.request=function(){let d=o.apply(this,arguments);return p++,f&&(clearTimeout(f),f=null),d.once("close",()=>{--p||(f=setTimeout(()=>{f=null,a()},l))}),d}}s.once("close",a);let c=[s,t];return n?n.push(c):n=this.sessions[e]=[c],s}},iq=new LC;function aq(r,e){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r,e)}u(aq,"dispatchBeforeRedirect");function QR(r,e,t){let n=e;if(!n&&n!==!1){let s=Fj(t);s&&(Yj(t)||(n=new URL(s)))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){if(!!(n.auth.username||n.auth.password))n.auth=(n.auth.username||"")+":"+(n.auth.password||"");else if(typeof n.auth=="object")throw new Re("Invalid proxy authorization",Re.ERR_BAD_OPTION,{proxy:n});let a=Buffer.from(n.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+a}r.headers.host=r.hostname+(r.port?":"+r.port:"");let s=n.hostname||n.host;r.hostname=s,r.host=s,r.port=n.port,r.path=t,n.protocol&&(r.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}r.beforeRedirects.proxy=u(function(i){QR(i,e,i.href)},"beforeRedirect")}u(QR,"setProxy");var oq=typeof process<"u"&&te.kindOf(process)==="process",uq=u(r=>new Promise((e,t)=>{let n,s,i=u((l,c)=>{s||(s=!0,n&&n(l,c))},"done"),a=u(l=>{i(l),e(l)},"_resolve"),o=u(l=>{i(l,!0),t(l)},"_reject");r(a,o,l=>n=l).catch(o)}),"wrapAsync"),lq=u(({address:r,family:e})=>{if(!te.isString(r))throw TypeError("address must be a string");return{address:r,family:e||(r.indexOf(".")<0?6:4)}},"resolveFamily"),CR=u((r,e)=>lq(te.isObject(r)?r:{address:r,family:e}),"buildAddressEntry"),cq={request(r,e){let t=r.protocol+"//"+r.hostname+":"+(r.port||(r.protocol==="https:"?443:80)),{http2Options:n,headers:s}=r,i=iq.getSession(t,n),{HTTP2_HEADER_SCHEME:a,HTTP2_HEADER_METHOD:o,HTTP2_HEADER_PATH:l,HTTP2_HEADER_STATUS:c}=PR.constants,f={[a]:r.protocol.replace(":",""),[o]:r.method,[l]:r.path};te.forEach(s,(d,g)=>{g.charAt(0)!==":"&&(f[g]=d)});let p=i.request(f);return p.once("response",d=>{let g=p;d=Object.assign({},d);let m=d[c];delete d[c],g.headers=d,g.statusCode=+m,e(g)}),p}},fq=oq&&u(function(e){return uq(u(async function(n,s,i){let a=u(W=>te.hasOwnProp(e,W)?e[W]:void 0,"own"),o=a("data"),l=a("lookup"),c=a("family"),f=a("httpVersion");f===void 0&&(f=1);let p=a("http2Options"),d=a("responseType"),g=a("responseEncoding"),m=e.method.toUpperCase(),v,y=!1,S;if(f=+f,Number.isNaN(f))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(f!==1&&f!==2)throw TypeError(`Unsupported protocol version '${f}'`);let C=f===2;if(l){let W=Gj(l,fe=>te.isArray(fe)?fe:[fe]);l=u((fe,Ie,Ve)=>{W(fe,Ie,(Le,O,B)=>{if(Le)return Ve(Le);let Q=te.isArray(O)?O.map(K=>CR(K)):[CR(O,B)];Ie.all?Ve(Le,Q):Ve(Le,Q[0].address,Q[0].family)})},"lookup")}let w=new A9.EventEmitter;function E(W){try{w.emit("abort",!W||W.type?new ua(null,e,S):W)}catch(fe){console.warn("emit error",fe)}}u(E,"abort"),w.once("abort",s);let A=u(()=>{e.cancelToken&&e.cancelToken.unsubscribe(E),e.signal&&e.signal.removeEventListener("abort",E),w.removeAllListeners()},"onFinished");(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(E),e.signal&&(e.signal.aborted?E():e.signal.addEventListener("abort",E))),i((W,fe)=>{if(v=!0,fe){y=!0,A();return}let{data:Ie}=W;if(Ie instanceof Kn.Readable||Ie instanceof Kn.Duplex){let Ve=Kn.finished(Ie,()=>{Ve(),A()})}else A()});let b=qC(e.baseURL,e.url,e.allowAbsoluteUrls),V=new URL(b,Br.hasBrowserEnv?Br.origin:void 0),I=V.protocol||SR[0];if(I==="data:"){if(e.maxContentLength>-1){let fe=String(e.url||b||"");if(eq(fe)>e.maxContentLength)return s(new Re("maxContentLength size of "+e.maxContentLength+" exceeded",Re.ERR_BAD_RESPONSE,e))}let W;if(m!=="GET")return _f(n,s,{status:405,statusText:"method not allowed",headers:{},config:e});try{W=jj(e.url,d==="blob",{Blob:e.env&&e.env.Blob})}catch(fe){throw Re.from(fe,Re.ERR_BAD_REQUEST,e)}return d==="text"?(W=W.toString(g),(!g||g==="utf8")&&(W=te.stripBOM(W))):d==="stream"&&(W=Kn.Readable.from(W)),_f(n,s,{data:W,status:200,statusText:"OK",headers:new Xr,config:e})}if(SR.indexOf(I)===-1)return s(new Re("Unsupported protocol "+I,Re.ERR_BAD_REQUEST,e));let D=Xr.from(e.headers).normalize();D.set("User-Agent","axios/"+Tv,!1);let{onUploadProgress:U,onDownloadProgress:F}=e,M=e.maxRate,se,ee;if(te.isSpecCompliantForm(o)){let W=D.getContentType(/boundary=([-_\w\d]{10,70})/i);o=Xj(o,fe=>{D.set(fe)},{tag:`axios-${Tv}-boundary`,boundary:W&&W[1]||void 0})}else if(te.isFormData(o)&&te.isFunction(o.getHeaders)&&o.getHeaders!==Object.prototype.getHeaders){if(D.set(o.getHeaders()),!D.hasContentLength())try{let W=await UC.promisify(o.getLength).call(o);Number.isFinite(W)&&W>=0&&D.setContentLength(W)}catch{}}else if(te.isBlob(o)||te.isFile(o))o.size&&D.setContentType(o.type||"application/octet-stream"),D.setContentLength(o.size||0),o=Kn.Readable.from(JR(o));else if(o&&!te.isStream(o)){if(!Buffer.isBuffer(o))if(te.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else if(te.isString(o))o=Buffer.from(o,"utf-8");else return s(new Re("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Re.ERR_BAD_REQUEST,e));if(D.setContentLength(o.length,!1),e.maxBodyLength>-1&&o.length>e.maxBodyLength)return s(new Re("Request body larger than maxBodyLength limit",Re.ERR_BAD_REQUEST,e))}let ie=te.toFiniteNumber(D.getContentLength());te.isArray(M)?(se=M[0],ee=M[1]):se=ee=M,o&&(U||se)&&(te.isStream(o)||(o=Kn.Readable.from(o,{objectMode:!1})),o=Kn.pipeline([o,new Iv({maxRate:te.toFiniteNumber(se)})],te.noop),U&&o.on("progress",AR(o,Dv(ie,kf(Bv(U),!1,3)))));let X;if(e.auth){let W=e.auth.username||"",fe=e.auth.password||"";X=W+":"+fe}if(!X&&V.username){let W=V.username,fe=V.password;X=W+":"+fe}X&&D.delete("authorization");let he;try{he=MC(V.pathname+V.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(W){let fe=new Error(W.message);return fe.config=e,fe.url=e.url,fe.exists=!0,s(fe)}D.set("Accept-Encoding","gzip, compress, deflate"+(wR?", br":""),!1);let Ce={path:he,method:m,headers:D.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:X,protocol:I,family:c,beforeRedirect:aq,beforeRedirects:{},http2Options:p};!te.isUndefined(l)&&(Ce.lookup=l),e.socketPath?Ce.socketPath=e.socketPath:(Ce.hostname=V.hostname.startsWith("[")?V.hostname.slice(1,-1):V.hostname,Ce.port=V.port,QR(Ce,e.proxy,I+"//"+V.hostname+(V.port?":"+V.port:"")+Ce.path));let xe,pe=sq.test(Ce.protocol);if(Ce.agent=pe?e.httpsAgent:e.httpAgent,C)xe=cq;else{let W=a("transport");W?xe=W:e.maxRedirects===0?xe=pe?w9:E9:(e.maxRedirects&&(Ce.maxRedirects=e.maxRedirects),e.beforeRedirect&&(Ce.beforeRedirects.config=e.beforeRedirect),xe=pe?nq:rq)}if(e.maxBodyLength>-1?Ce.maxBodyLength=e.maxBodyLength:Ce.maxBodyLength=1/0,e.insecureHTTPParser&&(Ce.insecureHTTPParser=e.insecureHTTPParser),S=xe.request(Ce,u(function(fe){if(S.destroyed)return;let Ie=[fe],Ve=te.toFiniteNumber(fe.headers["content-length"]);if(F||ee){let Q=new Iv({maxRate:te.toFiniteNumber(ee)});F&&Q.on("progress",AR(Q,Dv(Ve,kf(Bv(F),!0,3)))),Ie.push(Q)}let Le=fe,O=fe.req||S;if(e.decompress!==!1&&fe.headers["content-encoding"])switch((m==="HEAD"||fe.statusCode===204)&&delete fe.headers["content-encoding"],(fe.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Ie.push(Eo.createUnzip(ER)),delete fe.headers["content-encoding"];break;case"deflate":Ie.push(new kC),Ie.push(Eo.createUnzip(ER)),delete fe.headers["content-encoding"];break;case"br":wR&&(Ie.push(Eo.createBrotliDecompress(tq)),delete fe.headers["content-encoding"])}Le=Ie.length>1?Kn.pipeline(Ie,te.noop):Ie[0];let B={status:fe.statusCode,statusText:fe.statusMessage,headers:new Xr(fe.headers),config:e,request:O};if(d==="stream"){if(e.maxContentLength>-1){let Q=e.maxContentLength,K=Le;async function*_e(){let R=0;for await(let N of K){if(R+=N.length,R>Q)throw new Re("maxContentLength size of "+Q+" exceeded",Re.ERR_BAD_RESPONSE,e,O);yield N}}u(_e,"enforceMaxContentLength"),Le=Kn.Readable.from(_e(),{objectMode:!1})}B.data=Le,_f(n,s,B)}else{let Q=[],K=0;Le.on("data",u(function(R){Q.push(R),K+=R.length,e.maxContentLength>-1&&K>e.maxContentLength&&(y=!0,Le.destroy(),E(new Re("maxContentLength size of "+e.maxContentLength+" exceeded",Re.ERR_BAD_RESPONSE,e,O)))},"handleStreamData")),Le.on("aborted",u(function(){if(y)return;let R=new Re("stream has been aborted",Re.ERR_BAD_RESPONSE,e,O);Le.destroy(R),s(R)},"handlerStreamAborted")),Le.on("error",u(function(R){S.destroyed||s(Re.from(R,null,e,O))},"handleStreamError")),Le.on("end",u(function(){try{let R=Q.length===1?Q[0]:Buffer.concat(Q);d!=="arraybuffer"&&(R=R.toString(g),(!g||g==="utf8")&&(R=te.stripBOM(R))),B.data=R}catch(R){return s(Re.from(R,null,e,B.request,B))}_f(n,s,B)},"handleStreamEnd"))}w.once("abort",Q=>{Le.destroyed||(Le.emit("error",Q),Le.destroy())})},"handleResponse")),w.once("abort",W=>{S.close?S.close():S.destroy(W)}),S.on("error",u(function(fe){s(Re.from(fe,null,e,S))},"handleRequestError")),S.on("socket",u(function(fe){fe.setKeepAlive(!0,1e3*60);let Ie=u(()=>{fe.removeListener("error",Ve)},"removeSocketErrorListener");function Ve(Le){Ie(),S.destroyed||S.destroy(Le)}u(Ve,"handleRequestSocketError"),fe.on("error",Ve),S.once("close",Ie)},"handleRequestSocket")),e.timeout){let W=parseInt(e.timeout,10);if(Number.isNaN(W)){E(new Re("error trying to parse `config.timeout` to int",Re.ERR_BAD_OPTION_VALUE,e,S));return}S.setTimeout(W,u(function(){if(v)return;let Ie=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",Ve=e.transitional||Lv;e.timeoutErrorMessage&&(Ie=e.timeoutErrorMessage),E(new Re(Ie,Ve.clarifyTimeoutError?Re.ETIMEDOUT:Re.ECONNABORTED,e,S))},"handleRequestTimeout"))}else S.setTimeout(0);if(te.isStream(o)){let W=!1,fe=!1;o.on("end",()=>{W=!0}),o.once("error",Ve=>{fe=!0,S.destroy(Ve)}),o.on("close",()=>{!W&&!fe&&E(new ua("Request stream has been aborted",e,S))});let Ie=o;if(e.maxBodyLength>-1&&e.maxRedirects===0){let Ve=e.maxBodyLength,Le=0;Ie=Kn.pipeline([o,new Kn.Transform({transform(O,B,Q){if(Le+=O.length,Le>Ve)return Q(new Re("Request body larger than maxBodyLength limit",Re.ERR_BAD_REQUEST,e,S));Q(null,O)}})],te.noop),Ie.on("error",O=>{S.destroyed||S.destroy(O)})}Ie.pipe(S)}else o&&S.write(o),S.end()},"dispatchHttpRequest"))},"httpAdapter"),hq=Br.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,Br.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(Br.origin),Br.navigator&&/(msie|trident)/i.test(Br.navigator.userAgent)):()=>!0,pq=Br.hasStandardBrowserEnv?{write(r,e,t,n,s,i,a){if(typeof document>"u")return;let o=[`${r}=${encodeURIComponent(e)}`];te.isNumber(t)&&o.push(`expires=${new Date(t).toUTCString()}`),te.isString(n)&&o.push(`path=${n}`),te.isString(s)&&o.push(`domain=${s}`),i===!0&&o.push("secure"),te.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.join("; ")},read(r){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(r){this.write(r,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}},xR=u(r=>r instanceof Xr?{...r}:r,"headersToObject");function al(r,e){e=e||{};let t={};function n(c,f,p,d){return te.isPlainObject(c)&&te.isPlainObject(f)?te.merge.call({caseless:d},c,f):te.isPlainObject(f)?te.merge({},f):te.isArray(f)?f.slice():f}u(n,"getMergedValue");function s(c,f,p,d){if(te.isUndefined(f)){if(!te.isUndefined(c))return n(void 0,c,p,d)}else return n(c,f,p,d)}u(s,"mergeDeepProperties");function i(c,f){if(!te.isUndefined(f))return n(void 0,f)}u(i,"valueFromConfig2");function a(c,f){if(te.isUndefined(f)){if(!te.isUndefined(c))return n(void 0,c)}else return n(void 0,f)}u(a,"defaultToConfig2");function o(c,f,p){if(te.hasOwnProp(e,p))return n(c,f);if(te.hasOwnProp(r,p))return n(void 0,c)}u(o,"mergeDirectKeys");let l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:u((c,f,p)=>s(xR(c),xR(f),p,!0),"headers")};return te.forEach(Object.keys({...r,...e}),u(function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;let p=te.hasOwnProp(l,f)?l[f]:s,d=te.hasOwnProp(r,f)?r[f]:void 0,g=te.hasOwnProp(e,f)?e[f]:void 0,m=p(d,g,f);te.isUndefined(m)&&p!==o||(t[f]=m)},"computeConfigValue")),t}u(al,"mergeConfig");var ZR=u(r=>{let e=al({},r),{data:t,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:o}=e;if(e.headers=a=Xr.from(a),e.url=MC(qC(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),te.isFormData(t)){if(Br.hasStandardBrowserEnv||Br.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(te.isFunction(t.getHeaders)){let l=t.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([f,p])=>{c.includes(f.toLowerCase())&&a.set(f,p)})}}if(Br.hasStandardBrowserEnv&&(te.isFunction(n)&&(n=n(e)),n===!0||n==null&&hq(e.url))){let c=s&&i&&pq.read(i);c&&a.set(s,c)}return e},"resolveConfig"),dq=typeof XMLHttpRequest<"u",mq=dq&&function(r){return new Promise(u(function(t,n){let s=ZR(r),i=s.data,a=Xr.from(s.headers).normalize(),{responseType:o,onUploadProgress:l,onDownloadProgress:c}=s,f,p,d,g,m;function v(){g&&g(),m&&m(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}u(v,"done");let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function S(){if(!y)return;let w=Xr.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),A={data:!o||o==="text"||o==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:w,config:r,request:y};_f(u(function(V){t(V),v()},"_resolve"),u(function(V){n(V),v()},"_reject"),A),y=null}u(S,"onloadend"),"onloadend"in y?y.onloadend=S:y.onreadystatechange=u(function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(S)},"handleLoad"),y.onabort=u(function(){y&&(n(new Re("Request aborted",Re.ECONNABORTED,r,y)),y=null)},"handleAbort"),y.onerror=u(function(E){let A=E&&E.message?E.message:"Network Error",b=new Re(A,Re.ERR_NETWORK,r,y);b.event=E||null,n(b),y=null},"handleError"),y.ontimeout=u(function(){let E=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",A=s.transitional||Lv;s.timeoutErrorMessage&&(E=s.timeoutErrorMessage),n(new Re(E,A.clarifyTimeoutError?Re.ETIMEDOUT:Re.ECONNABORTED,r,y)),y=null},"handleTimeout"),i===void 0&&a.setContentType(null),"setRequestHeader"in y&&te.forEach(a.toJSON(),u(function(E,A){y.setRequestHeader(A,E)},"setRequestHeader")),te.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),o&&o!=="json"&&(y.responseType=s.responseType),c&&([d,m]=kf(c,!0),y.addEventListener("progress",d)),l&&y.upload&&([p,g]=kf(l),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(f=u(w=>{y&&(n(!w||w.type?new ua(null,r,y):w),y.abort(),y=null)},"onCanceled"),s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));let C=zR(s.url);if(C&&Br.protocols.indexOf(C)===-1){n(new Re("Unsupported protocol "+C+":",Re.ERR_BAD_REQUEST,r));return}y.send(i||null)},"dispatchXhrRequest"))},gq=u((r,e)=>{let{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,s,i=u(function(c){if(!s){s=!0,o();let f=c instanceof Error?c:this.reason;n.abort(f instanceof Re?f:new ua(f instanceof Error?f.message:f))}},"onabort"),a=e&&setTimeout(()=>{a=null,i(new Re(`timeout of ${e}ms exceeded`,Re.ETIMEDOUT))},e),o=u(()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),r=null)},"unsubscribe");r.forEach(c=>c.addEventListener("abort",i));let{signal:l}=n;return l.unsubscribe=()=>te.asap(o),l}},"composeSignals"),yq=u(function*(r,e){let t=r.byteLength;if(t<e){yield r;return}let n=0,s;for(;n<t;)s=n+e,yield r.slice(n,s),n=s},"streamChunk"),vq=u(async function*(r,e){for await(let t of Eq(r))yield*yq(t,e)},"readBytes"),Eq=u(async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}let e=r.getReader();try{for(;;){let{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},"readStream"),bR=u((r,e,t,n)=>{let s=vq(r,e),i=0,a,o=u(l=>{a||(a=!0,n&&n(l))},"_onFinish");return new ReadableStream({async pull(l){try{let{done:c,value:f}=await s.next();if(c){o(),l.close();return}let p=f.byteLength;if(t){let d=i+=p;t(d)}l.enqueue(new Uint8Array(f))}catch(c){throw o(c),c}},cancel(l){return o(l),s.return()}},{highWaterMark:2})},"trackStream"),NR=64*1024,{isFunction:Av}=te,wq=(({Request:r,Response:e})=>({Request:r,Response:e}))(te.global),{ReadableStream:TR,TextEncoder:IR}=te.global,DR=u((r,...e)=>{try{return!!r(...e)}catch{return!1}},"test"),Sq=u(r=>{r=te.merge.call({skipUndefined:!0},wq,r);let{fetch:e,Request:t,Response:n}=r,s=e?Av(e):typeof fetch=="function",i=Av(t),a=Av(n);if(!s)return!1;let o=s&&Av(TR),l=s&&(typeof IR=="function"?(m=>v=>m.encode(v))(new IR):async m=>new Uint8Array(await new t(m).arrayBuffer())),c=i&&o&&DR(()=>{let m=!1,v=new t(Br.origin,{body:new TR,method:"POST",get duplex(){return m=!0,"half"}}),y=v.headers.has("Content-Type");return v.body!=null&&v.body.cancel(),m&&!y}),f=a&&o&&DR(()=>te.isReadableStream(new n("").body)),p={stream:f&&(m=>m.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!p[m]&&(p[m]=(v,y)=>{let S=v&&v[m];if(S)return S.call(v);throw new Re(`Response type '${m}' is not supported`,Re.ERR_NOT_SUPPORT,y)})});let d=u(async m=>{if(m==null)return 0;if(te.isBlob(m))return m.size;if(te.isSpecCompliantForm(m))return(await new t(Br.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(te.isArrayBufferView(m)||te.isArrayBuffer(m))return m.byteLength;if(te.isURLSearchParams(m)&&(m=m+""),te.isString(m))return(await l(m)).byteLength},"getBodyLength"),g=u(async(m,v)=>{let y=te.toFiniteNumber(m.getContentLength());return y??d(v)},"resolveBodyLength");return async m=>{let{url:v,method:y,data:S,signal:C,cancelToken:w,timeout:E,onDownloadProgress:A,onUploadProgress:b,responseType:V,headers:I,withCredentials:D="same-origin",fetchOptions:U}=ZR(m),F=e||fetch;V=V?(V+"").toLowerCase():"text";let M=gq([C,w&&w.toAbortSignal()],E),se=null,ee=M&&M.unsubscribe&&(()=>{M.unsubscribe()}),ie;try{if(b&&c&&y!=="get"&&y!=="head"&&(ie=await g(I,S))!==0){let W=new t(v,{method:"POST",body:S,duplex:"half"}),fe;if(te.isFormData(S)&&(fe=W.headers.get("content-type"))&&I.setContentType(fe),W.body){let[Ie,Ve]=Dv(ie,kf(Bv(b)));S=bR(W.body,NR,Ie,Ve)}}te.isString(D)||(D=D?"include":"omit");let X=i&&"credentials"in t.prototype;if(te.isFormData(S)){let W=I.getContentType();W&&/^multipart\/form-data/i.test(W)&&!/boundary=/i.test(W)&&I.delete("content-type")}let he={...U,signal:M,method:y.toUpperCase(),headers:I.normalize().toJSON(),body:S,duplex:"half",credentials:X?D:void 0};se=i&&new t(v,he);let Ce=await(i?F(se,U):F(v,he)),xe=f&&(V==="stream"||V==="response");if(f&&(A||xe&&ee)){let W={};["status","statusText","headers"].forEach(Le=>{W[Le]=Ce[Le]});let fe=te.toFiniteNumber(Ce.headers.get("content-length")),[Ie,Ve]=A&&Dv(fe,kf(Bv(A),!0))||[];Ce=new n(bR(Ce.body,NR,Ie,()=>{Ve&&Ve(),ee&&ee()}),W)}V=V||"text";let pe=await p[te.findKey(p,V)||"text"](Ce,m);return!xe&&ee&&ee(),await new Promise((W,fe)=>{_f(W,fe,{data:pe,headers:Xr.from(Ce.headers),status:Ce.status,statusText:Ce.statusText,config:m,request:se})})}catch(X){throw ee&&ee(),X&&X.name==="TypeError"&&/Load failed|fetch/i.test(X.message)?Object.assign(new Re("Network Error",Re.ERR_NETWORK,m,se,X&&X.response),{cause:X.cause||X}):Re.from(X,X&&X.code,m,se,X&&X.response)}}},"factory"),Aq=new Map,eO=u(r=>{let e=r&&r.env||{},{fetch:t,Request:n,Response:s}=e,i=[n,s,t],a=i.length,o=a,l,c,f=Aq;for(;o--;)l=i[o],c=f.get(l),c===void 0&&f.set(l,c=o?new Map:Sq(e)),f=c;return c},"getFetch");eO();var HC={http:fq,xhr:mq,fetch:{get:eO}};te.forEach(HC,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var BR=u(r=>`- ${r}`,"renderReason"),Cq=u(r=>te.isFunction(r)||r===null||r===!1,"isResolvedHandle");function xq(r,e){r=te.isArray(r)?r:[r];let{length:t}=r,n,s,i={};for(let a=0;a<t;a++){n=r[a];let o;if(s=n,!Cq(n)&&(s=HC[(o=String(n)).toLowerCase()],s===void 0))throw new Re(`Unknown adapter '${o}'`);if(s&&(te.isFunction(s)||(s=s.get(e))))break;i[o||"#"+a]=s}if(!s){let a=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build")),o=t?a.length>1?`since :
27
+ `+a.map(BR).join(`
28
+ `):" "+BR(a[0]):"as no adapter specified";throw new Re("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s}u(xq,"getAdapter");var tO={getAdapter:xq,adapters:HC};function DC(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new ua(null,r)}u(DC,"throwIfCancellationRequested");function RR(r){return DC(r),r.headers=Xr.from(r.headers),r.data=TC.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),tO.getAdapter(r.adapter||wd.adapter,r)(r).then(u(function(n){return DC(r),n.data=TC.call(r,r.transformResponse,n),n.headers=Xr.from(n.headers),n},"onAdapterResolution"),u(function(n){return WR(n)||(DC(r),n&&n.response&&(n.response.data=TC.call(r,r.transformResponse,n.response),n.response.headers=Xr.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}u(RR,"dispatchRequest");var Vv={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{Vv[r]=u(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var OR={};Vv.transitional=u(function(e,t,n){function s(i,a){return"[Axios v"+Tv+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return u(s,"formatMessage"),(i,a,o)=>{if(e===!1)throw new Re(s(a," has been removed"+(t?" in "+t:"")),Re.ERR_DEPRECATED);return t&&!OR[a]&&(OR[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,o):!0}},"transitional");Vv.spelling=u(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function bq(r,e,t){if(typeof r!="object")throw new Re("options must be an object",Re.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 o=r[i],l=o===void 0||a(o,i,r);if(l!==!0)throw new Re("option "+i+" must be "+l,Re.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Re("Unknown option "+i,Re.ERR_BAD_OPTION)}}u(bq,"assertOptions");var bv={assertOptions:bq,validators:Vv},bs=bv.validators,oa=class{static{u(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new Nv,response:new Nv}}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=(()=>{if(!s.stack)return"";let a=s.stack.indexOf(`
29
+ `);return a===-1?"":s.stack.slice(a+1)})();try{if(!n.stack)n.stack=i;else if(i){let a=i.indexOf(`
30
+ `),o=a===-1?-1:i.indexOf(`
31
+ `,a+1),l=o===-1?"":i.slice(o+1);String(n.stack).endsWith(l)||(n.stack+=`
32
+ `+i)}}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=al(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&bv.assertOptions(n,{silentJSONParsing:bs.transitional(bs.boolean),forcedJSONParsing:bs.transitional(bs.boolean),clarifyTimeoutError:bs.transitional(bs.boolean),legacyInterceptorReqResOrdering:bs.transitional(bs.boolean)},!1),s!=null&&(te.isFunction(s)?t.paramsSerializer={serialize:s}:bv.assertOptions(s,{encode:bs.function,serialize:bs.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),bv.assertOptions(t,{baseUrl:bs.spelling("baseURL"),withXsrfToken:bs.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&te.merge(i.common,i[t.method]);i&&te.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),t.headers=Xr.concat(a,i);let o=[],l=!0;this.interceptors.request.forEach(u(function(v){if(typeof v.runWhen=="function"&&v.runWhen(t)===!1)return;l=l&&v.synchronous;let y=t.transitional||Lv;y&&y.legacyInterceptorReqResOrdering?o.unshift(v.fulfilled,v.rejected):o.push(v.fulfilled,v.rejected)},"unshiftRequestInterceptors"));let c=[];this.interceptors.response.forEach(u(function(v){c.push(v.fulfilled,v.rejected)},"pushResponseInterceptors"));let f,p=0,d;if(!l){let m=[RR.bind(this),void 0];for(m.unshift(...o),m.push(...c),d=m.length,f=Promise.resolve(t);p<d;)f=f.then(m[p++],m[p++]);return f}d=o.length;let g=t;for(;p<d;){let m=o[p++],v=o[p++];try{g=m(g)}catch(y){v.call(this,y);break}}try{f=RR.call(this,g)}catch(m){return Promise.reject(m)}for(p=0,d=c.length;p<d;)f=f.then(c[p++],c[p++]);return f}getUri(e){e=al(this.defaults,e);let t=qC(e.baseURL,e.url,e.allowAbsoluteUrls);return MC(t,e.params,e.paramsSerializer)}};te.forEach(["delete","get","head","options"],u(function(e){oa.prototype[e]=function(t,n){return this.request(al(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));te.forEach(["post","put","patch"],u(function(e){function t(n){return u(function(i,a,o){return this.request(al(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}u(t,"generateHTTPMethod"),oa.prototype[e]=t(),oa.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var VC=class r{static{u(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(u(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(o=>{n.subscribe(o),i=o}).then(s);return a.cancel=u(function(){n.unsubscribe(i)},"reject"),a},e(u(function(i,a,o){n.reason||(n.reason=new ua(i,a,o),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=u(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(u(function(s){e=s},"executor")),cancel:e}}};function Nq(r){return u(function(t){return r.apply(null,t)},"wrap")}u(Nq,"spread");function Tq(r){return te.isObject(r)&&r.isAxiosError===!0}u(Tq,"isAxiosError");var FC={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(FC).forEach(([r,e])=>{FC[e]=r});function rO(r){let e=new oa(r),t=kR(oa.prototype.request,e);return te.extend(t,oa.prototype,e,{allOwnKeys:!0}),te.extend(t,e,null,{allOwnKeys:!0}),t.create=u(function(s){return rO(al(r,s))},"create"),t}u(rO,"createInstance");var jr=rO(wd);jr.Axios=oa;jr.CanceledError=ua;jr.CancelToken=VC;jr.isCancel=WR;jr.VERSION=Tv;jr.toFormData=kv;jr.AxiosError=Re;jr.Cancel=jr.CanceledError;jr.all=u(function(e){return Promise.all(e)},"all");jr.spread=Nq;jr.isAxiosError=Tq;jr.mergeConfig=al;jr.AxiosHeaders=Xr;jr.formToJSON=r=>$R(te.isHTMLForm(r)?new FormData(r):r);jr.getAdapter=tO.getAdapter;jr.HttpStatusCode=FC;jr.default=jr;nO.exports=jr});var sO=ue((fre,hr)=>{"use strict";hr.exports.NTLMFLAG_NEGOTIATE_UNICODE=1;hr.exports.NTLMFLAG_NEGOTIATE_OEM=2;hr.exports.NTLMFLAG_REQUEST_TARGET=4;hr.exports.NTLMFLAG_NEGOTIATE_SIGN=16;hr.exports.NTLMFLAG_NEGOTIATE_SEAL=32;hr.exports.NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE=64;hr.exports.NTLMFLAG_NEGOTIATE_LM_KEY=128;hr.exports.NTLMFLAG_NEGOTIATE_NETWARE=256;hr.exports.NTLMFLAG_NEGOTIATE_NTLM_KEY=512;hr.exports.NTLMFLAG_NEGOTIATE_ANONYMOUS=2048;hr.exports.NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED=4096;hr.exports.NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED=8192;hr.exports.NTLMFLAG_NEGOTIATE_LOCAL_CALL=16384;hr.exports.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN=32768;hr.exports.NTLMFLAG_TARGET_TYPE_DOMAIN=65536;hr.exports.NTLMFLAG_TARGET_TYPE_SERVER=1<<17;hr.exports.NTLMFLAG_TARGET_TYPE_SHARE=1<<18;hr.exports.NTLMFLAG_NEGOTIATE_NTLM2_KEY=1<<19;hr.exports.NTLMFLAG_REQUEST_INIT_RESPONSE=1<<20;hr.exports.NTLMFLAG_REQUEST_ACCEPT_RESPONSE=1<<21;hr.exports.NTLMFLAG_REQUEST_NONNT_SESSION_KEY=1<<22;hr.exports.NTLMFLAG_NEGOTIATE_TARGET_INFO=1<<23;hr.exports.NTLMFLAG_NEGOTIATE_128=1<<29;hr.exports.NTLMFLAG_NEGOTIATE_KEY_EXCHANGE=1<<30;hr.exports.NTLMFLAG_NEGOTIATE_56=1<<31});var XC=ue(Ns=>{"use strict";Ns.readUInt32BE=u(function(e,t){var n=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return n>>>0},"readUInt32BE");Ns.writeUInt32BE=u(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");Ns.ip=u(function(e,t,n,s){for(var i=0,a=0,o=6;o>=0;o-=2){for(var l=0;l<=24;l+=8)i<<=1,i|=t>>>l+o&1;for(var l=0;l<=24;l+=8)i<<=1,i|=e>>>l+o&1}for(var o=6;o>=0;o-=2){for(var l=1;l<=25;l+=8)a<<=1,a|=t>>>l+o&1;for(var l=1;l<=25;l+=8)a<<=1,a|=e>>>l+o&1}n[s+0]=i>>>0,n[s+1]=a>>>0},"ip");Ns.rip=u(function(e,t,n,s){for(var i=0,a=0,o=0;o<4;o++)for(var l=24;l>=0;l-=8)i<<=1,i|=t>>>l+o&1,i<<=1,i|=e>>>l+o&1;for(var o=4;o<8;o++)for(var l=24;l>=0;l-=8)a<<=1,a|=t>>>l+o&1,a<<=1,a|=e>>>l+o&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"rip");Ns.pc1=u(function(e,t,n,s){for(var i=0,a=0,o=7;o>=5;o--){for(var l=0;l<=24;l+=8)i<<=1,i|=t>>l+o&1;for(var l=0;l<=24;l+=8)i<<=1,i|=e>>l+o&1}for(var l=0;l<=24;l+=8)i<<=1,i|=t>>l+o&1;for(var o=1;o<=3;o++){for(var l=0;l<=24;l+=8)a<<=1,a|=t>>l+o&1;for(var l=0;l<=24;l+=8)a<<=1,a|=e>>l+o&1}for(var l=0;l<=24;l+=8)a<<=1,a|=e>>l+o&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc1");Ns.r28shl=u(function(e,t){return e<<t&268435455|e>>>28-t},"r28shl");var Fv=[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];Ns.pc2=u(function(e,t,n,s){for(var i=0,a=0,o=Fv.length>>>1,l=0;l<o;l++)i<<=1,i|=e>>>Fv[l]&1;for(var l=o;l<Fv.length;l++)a<<=1,a|=t>>>Fv[l]&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc2");Ns.expand=u(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 iO=[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];Ns.substitute=u(function(e,t){for(var n=0,s=0;s<4;s++){var i=e>>>18-s*6&63,a=iO[s*64+i];n<<=4,n|=a}for(var s=0;s<4;s++){var i=t>>>18-s*6&63,a=iO[256+s*64+i];n<<=4,n|=a}return n>>>0},"substitute");var aO=[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];Ns.permute=u(function(e){for(var t=0,n=0;n<aO.length;n++)t<<=1,t|=e>>>aO[n]&1;return t>>>0},"permute");Ns.padSplit=u(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 Sd=ue((dre,uO)=>{"use strict";uO.exports=oO;function oO(r,e){if(!r)throw new Error(e||"Assertion failed")}u(oO,"assert");oO.equal=u(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var Uv=ue((gre,lO)=>{"use strict";var Iq=Sd();function Ts(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}u(Ts,"Cipher");lO.exports=Ts;Ts.prototype._init=u(function(){},"_init");Ts.prototype.update=u(function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)},"update");Ts.prototype._buffer=u(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");Ts.prototype._flushBuffer=u(function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},"_flushBuffer");Ts.prototype._updateEncrypt=u(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");Ts.prototype._updateDecrypt=u(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");Ts.prototype.final=u(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");Ts.prototype._pad=u(function(e,t){if(t===0)return!1;for(;t<e.length;)e[t++]=0;return!0},"_pad");Ts.prototype._finalEncrypt=u(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");Ts.prototype._unpad=u(function(e){return e},"_unpad");Ts.prototype._finalDecrypt=u(function(){Iq.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 cO=ue((vre,GC)=>{"use strict";typeof Object.create=="function"?GC.exports=u(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):GC.exports=u(function(e,t){if(t){e.super_=t;var n=u(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var Mv=ue((wre,WC)=>{"use strict";try{if($C=st("util"),typeof $C.inherits!="function")throw"";WC.exports=$C.inherits}catch{WC.exports=cO()}var $C});var zC=ue((Sre,pO)=>{"use strict";var fO=Sd(),Dq=Mv(),Gr=XC(),hO=Uv();function Bq(){this.tmp=new Array(2),this.keys=null}u(Bq,"DESState");function Ti(r){hO.call(this,r);var e=new Bq;this._desState=e,this.deriveKeys(e,r.key)}u(Ti,"DES");Dq(Ti,hO);pO.exports=Ti;Ti.create=u(function(e){return new Ti(e)},"create");var Rq=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Ti.prototype.deriveKeys=u(function(e,t){e.keys=new Array(32),fO.equal(t.length,this.blockSize,"Invalid key length");var n=Gr.readUInt32BE(t,0),s=Gr.readUInt32BE(t,4);Gr.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=Rq[i>>>1];n=Gr.r28shl(n,a),s=Gr.r28shl(s,a),Gr.pc2(n,s,e.keys,i)}},"deriveKeys");Ti.prototype._update=u(function(e,t,n,s){var i=this._desState,a=Gr.readUInt32BE(e,t),o=Gr.readUInt32BE(e,t+4);Gr.ip(a,o,i.tmp,0),a=i.tmp[0],o=i.tmp[1],this.type==="encrypt"?this._encrypt(i,a,o,i.tmp,0):this._decrypt(i,a,o,i.tmp,0),a=i.tmp[0],o=i.tmp[1],Gr.writeUInt32BE(n,a,s),Gr.writeUInt32BE(n,o,s+4)},"_update");Ti.prototype._pad=u(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");Ti.prototype._unpad=u(function(e){if(this.padding===!1)return e;for(var t=e[e.length-1],n=e.length-t;n<e.length;n++)fO.equal(e[n],t);return e.slice(0,e.length-t)},"_unpad");Ti.prototype._encrypt=u(function(e,t,n,s,i){for(var a=t,o=n,l=0;l<e.keys.length;l+=2){var c=e.keys[l],f=e.keys[l+1];Gr.expand(o,e.tmp,0),c^=e.tmp[0],f^=e.tmp[1];var p=Gr.substitute(c,f),d=Gr.permute(p),g=o;o=(a^d)>>>0,a=g}Gr.rip(o,a,s,i)},"_encrypt");Ti.prototype._decrypt=u(function(e,t,n,s,i){for(var a=n,o=t,l=e.keys.length-2;l>=0;l-=2){var c=e.keys[l],f=e.keys[l+1];Gr.expand(a,e.tmp,0),c^=e.tmp[0],f^=e.tmp[1];var p=Gr.substitute(c,f),d=Gr.permute(p),g=a;a=(o^d)>>>0,o=g}Gr.rip(a,o,s,i)},"_decrypt")});var mO=ue(dO=>{"use strict";var Oq=Sd(),_q=Mv(),jv={};function Pq(r){Oq.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]}u(Pq,"CBCState");function kq(r){function e(i){r.call(this,i),this._cbcInit()}u(e,"CBC"),_q(e,r);for(var t=Object.keys(jv),n=0;n<t.length;n++){var s=t[n];e.prototype[s]=jv[s]}return e.create=u(function(a){return new e(a)},"create"),e}u(kq,"instantiate");dO.instantiate=kq;jv._cbcInit=u(function(){var e=new Pq(this.options.iv);this._cbcState=e},"_cbcInit");jv._update=u(function(e,t,n,s){var i=this._cbcState,a=this.constructor.super_.prototype,o=i.iv;if(this.type==="encrypt"){for(var l=0;l<this.blockSize;l++)o[l]^=e[t+l];a._update.call(this,o,0,n,s);for(var l=0;l<this.blockSize;l++)o[l]=n[s+l]}else{a._update.call(this,e,t,n,s);for(var l=0;l<this.blockSize;l++)n[s+l]^=o[l];for(var l=0;l<this.blockSize;l++)o[l]=e[t+l]}},"_update")});var vO=ue((bre,yO)=>{"use strict";var Lq=Sd(),Vq=Mv(),gO=Uv(),wo=zC();function Fq(r,e){Lq.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=[wo.create({type:"encrypt",key:t}),wo.create({type:"decrypt",key:n}),wo.create({type:"encrypt",key:s})]:this.ciphers=[wo.create({type:"decrypt",key:s}),wo.create({type:"encrypt",key:n}),wo.create({type:"decrypt",key:t})]}u(Fq,"EDEState");function ol(r){gO.call(this,r);var e=new Fq(this.type,this.options.key);this._edeState=e}u(ol,"EDE");Vq(ol,gO);yO.exports=ol;ol.create=u(function(e){return new ol(e)},"create");ol.prototype._update=u(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");ol.prototype._pad=wo.prototype._pad;ol.prototype._unpad=wo.prototype._unpad});var EO=ue(Vf=>{"use strict";Vf.utils=XC();Vf.Cipher=Uv();Vf.DES=zC();Vf.CBC=mO();Vf.EDE=vO()});var wO=ue((Ire,qv)=>{"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 qv=="object"&&qv.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],o=[0,8,16,24],l=["hex","array","digest","buffer","arrayBuffer"],c=[],f;if(s){var p=new ArrayBuffer(68);f=new Uint8Array(p),c=new Uint32Array(p)}var d=u(function(S){return function(C){return new v(!0).update(C)[S]()}},"createOutputMethod"),g=u(function(){var S=d("hex");e&&(S=m(S)),S.create=function(){return new v},S.update=function(E){return S.create().update(E)};for(var C=0;C<l.length;++C){var w=l[C];S[w]=d(w)}return S},"createMethod"),m=u(function(S){var C=st("crypto"),w=st("buffer").Buffer,E=u(function(A){if(typeof A=="string")return C.createHash("md4").update(A,"utf8").digest("hex");if(s&&A instanceof ArrayBuffer)A=new Uint8Array(A);else if(A.length===void 0)return S(A);return C.createHash("md4").update(new w(A)).digest("hex")},"nodeMethod");return E},"nodeWrap");function v(S){if(S)c[0]=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0,this.blocks=c,this.buffer8=f;else if(s){var C=new ArrayBuffer(68);this.buffer8=new Uint8Array(C),this.blocks=new Uint32Array(C)}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}u(v,"Md4"),v.prototype.update=function(S){if(!this.finalized){var C=typeof S!="string";C&&s&&S instanceof ArrayBuffer&&(S=new Uint8Array(S));for(var w,E=0,A,b=S.length||0,V=this.blocks,I=this.buffer8;E<b;){if(this.hashed&&(this.hashed=!1,V[0]=V[16],V[16]=V[1]=V[2]=V[3]=V[4]=V[5]=V[6]=V[7]=V[8]=V[9]=V[10]=V[11]=V[12]=V[13]=V[14]=V[15]=0),C)if(s)for(A=this.start;E<b&&A<64;++E)I[A++]=S[E];else for(A=this.start;E<b&&A<64;++E)V[A>>2]|=S[E]<<o[A++&3];else if(s)for(A=this.start;E<b&&A<64;++E)w=S.charCodeAt(E),w<128?I[A++]=w:w<2048?(I[A++]=192|w>>6,I[A++]=128|w&63):w<55296||w>=57344?(I[A++]=224|w>>12,I[A++]=128|w>>6&63,I[A++]=128|w&63):(w=65536+((w&1023)<<10|S.charCodeAt(++E)&1023),I[A++]=240|w>>18,I[A++]=128|w>>12&63,I[A++]=128|w>>6&63,I[A++]=128|w&63);else for(A=this.start;E<b&&A<64;++E)w=S.charCodeAt(E),w<128?V[A>>2]|=w<<o[A++&3]:w<2048?(V[A>>2]|=(192|w>>6)<<o[A++&3],V[A>>2]|=(128|w&63)<<o[A++&3]):w<55296||w>=57344?(V[A>>2]|=(224|w>>12)<<o[A++&3],V[A>>2]|=(128|w>>6&63)<<o[A++&3],V[A>>2]|=(128|w&63)<<o[A++&3]):(w=65536+((w&1023)<<10|S.charCodeAt(++E)&1023),V[A>>2]|=(240|w>>18)<<o[A++&3],V[A>>2]|=(128|w>>12&63)<<o[A++&3],V[A>>2]|=(128|w>>6&63)<<o[A++&3],V[A>>2]|=(128|w&63)<<o[A++&3]);this.lastByteIndex=A,this.bytes+=A-this.start,A>=64?(this.start=A-64,this.hash(),this.hashed=!0):this.start=A}return this}},v.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var S=this.blocks,C=this.lastByteIndex;S[C>>2]|=a[C&3],C>=56&&(this.hashed||this.hash(),S[0]=S[16],S[16]=S[1]=S[2]=S[3]=S[4]=S[5]=S[6]=S[7]=S[8]=S[9]=S[10]=S[11]=S[12]=S[13]=S[14]=S[15]=0),S[14]=this.bytes<<3,this.hash()}},v.prototype.hash=function(){var S,C,w,E,A,b,V,I,D=this.blocks;this.first?(S=D[0]-1,S=S<<3|S>>>29,E=(S&4023233417|~S&2562383102)+D[1]+271733878,E=E<<7|E>>>25,w=(E&S|~E&4023233417)+D[2]-1732584194,w=w<<11|w>>>21,C=(w&E|~w&S)+D[3]-271733879,C=C<<19|C>>>13):(S=this.h0,C=this.h1,w=this.h2,E=this.h3,S+=(C&w|~C&E)+D[0],S=S<<3|S>>>29,E+=(S&C|~S&w)+D[1],E=E<<7|E>>>25,w+=(E&S|~E&C)+D[2],w=w<<11|w>>>21,C+=(w&E|~w&S)+D[3],C=C<<19|C>>>13),S+=(C&w|~C&E)+D[4],S=S<<3|S>>>29,E+=(S&C|~S&w)+D[5],E=E<<7|E>>>25,w+=(E&S|~E&C)+D[6],w=w<<11|w>>>21,C+=(w&E|~w&S)+D[7],C=C<<19|C>>>13,S+=(C&w|~C&E)+D[8],S=S<<3|S>>>29,E+=(S&C|~S&w)+D[9],E=E<<7|E>>>25,w+=(E&S|~E&C)+D[10],w=w<<11|w>>>21,C+=(w&E|~w&S)+D[11],C=C<<19|C>>>13,S+=(C&w|~C&E)+D[12],S=S<<3|S>>>29,E+=(S&C|~S&w)+D[13],E=E<<7|E>>>25,w+=(E&S|~E&C)+D[14],w=w<<11|w>>>21,C+=(w&E|~w&S)+D[15],C=C<<19|C>>>13,b=C&w,S+=(b|C&E|w&E)+D[0]+1518500249,S=S<<3|S>>>29,A=S&C,E+=(A|S&w|b)+D[4]+1518500249,E=E<<5|E>>>27,I=E&S,w+=(I|E&C|A)+D[8]+1518500249,w=w<<9|w>>>23,V=w&E,C+=(V|w&S|I)+D[12]+1518500249,C=C<<13|C>>>19,b=C&w,S+=(b|C&E|V)+D[1]+1518500249,S=S<<3|S>>>29,A=S&C,E+=(A|S&w|b)+D[5]+1518500249,E=E<<5|E>>>27,I=E&S,w+=(I|E&C|A)+D[9]+1518500249,w=w<<9|w>>>23,V=w&E,C+=(V|w&S|I)+D[13]+1518500249,C=C<<13|C>>>19,b=C&w,S+=(b|C&E|V)+D[2]+1518500249,S=S<<3|S>>>29,A=S&C,E+=(A|S&w|b)+D[6]+1518500249,E=E<<5|E>>>27,I=E&S,w+=(I|E&C|A)+D[10]+1518500249,w=w<<9|w>>>23,V=w&E,C+=(V|w&S|I)+D[14]+1518500249,C=C<<13|C>>>19,b=C&w,S+=(b|C&E|V)+D[3]+1518500249,S=S<<3|S>>>29,A=S&C,E+=(A|S&w|b)+D[7]+1518500249,E=E<<5|E>>>27,I=E&S,w+=(I|E&C|A)+D[11]+1518500249,w=w<<9|w>>>23,C+=(w&E|w&S|I)+D[15]+1518500249,C=C<<13|C>>>19,b=C^w,S+=(b^E)+D[0]+1859775393,S=S<<3|S>>>29,E+=(b^S)+D[8]+1859775393,E=E<<9|E>>>23,I=E^S,w+=(I^C)+D[4]+1859775393,w=w<<11|w>>>21,C+=(I^w)+D[12]+1859775393,C=C<<15|C>>>17,b=C^w,S+=(b^E)+D[2]+1859775393,S=S<<3|S>>>29,E+=(b^S)+D[10]+1859775393,E=E<<9|E>>>23,I=E^S,w+=(I^C)+D[6]+1859775393,w=w<<11|w>>>21,C+=(I^w)+D[14]+1859775393,C=C<<15|C>>>17,b=C^w,S+=(b^E)+D[1]+1859775393,S=S<<3|S>>>29,E+=(b^S)+D[9]+1859775393,E=E<<9|E>>>23,I=E^S,w+=(I^C)+D[5]+1859775393,w=w<<11|w>>>21,C+=(I^w)+D[13]+1859775393,C=C<<15|C>>>17,b=C^w,S+=(b^E)+D[3]+1859775393,S=S<<3|S>>>29,E+=(b^S)+D[11]+1859775393,E=E<<9|E>>>23,I=E^S,w+=(I^C)+D[7]+1859775393,w=w<<11|w>>>21,C+=(I^w)+D[15]+1859775393,C=C<<15|C>>>17,this.first?(this.h0=S+1732584193<<0,this.h1=C-271733879<<0,this.h2=w-1732584194<<0,this.h3=E+271733878<<0,this.first=!1):(this.h0=this.h0+S<<0,this.h1=this.h1+C<<0,this.h2=this.h2+w<<0,this.h3=this.h3+E<<0)},v.prototype.hex=function(){this.finalize();var S=this.h0,C=this.h1,w=this.h2,E=this.h3;return i[S>>4&15]+i[S&15]+i[S>>12&15]+i[S>>8&15]+i[S>>20&15]+i[S>>16&15]+i[S>>28&15]+i[S>>24&15]+i[C>>4&15]+i[C&15]+i[C>>12&15]+i[C>>8&15]+i[C>>20&15]+i[C>>16&15]+i[C>>28&15]+i[C>>24&15]+i[w>>4&15]+i[w&15]+i[w>>12&15]+i[w>>8&15]+i[w>>20&15]+i[w>>16&15]+i[w>>28&15]+i[w>>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]},v.prototype.toString=v.prototype.hex,v.prototype.digest=function(){this.finalize();var S=this.h0,C=this.h1,w=this.h2,E=this.h3;return[S&255,S>>8&255,S>>16&255,S>>24&255,C&255,C>>8&255,C>>16&255,C>>24&255,w&255,w>>8&255,w>>16&255,w>>24&255,E&255,E>>8&255,E>>16&255,E>>24&255]},v.prototype.array=v.prototype.digest,v.prototype.arrayBuffer=function(){this.finalize();var S=new ArrayBuffer(16),C=new Uint32Array(S);return C[0]=this.h0,C[1]=this.h1,C[2]=this.h2,C[3]=this.h3,S},v.prototype.buffer=v.prototype.arrayBuffer;var y=g();t?qv.exports=y:(r.md4=y,n&&define(function(){return y}))})()});var CO=ue((Rre,AO)=>{"use strict";var JC=st("crypto"),Bre=EO(),Uq=wO();function Mq(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),So(n.slice(0,7),r).copy(t),So(n.slice(7,14),r).copy(t,8),So(n.slice(14),r).copy(t,16),t}u(Mq,"createLMResponse");function jq(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([So(t.slice(0,7),n),So(t.slice(7),n)]))}u(jq,"createLMHash");function So(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)}u(So,"calculateDES");function qq(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),So(n.slice(0,7),r).copy(t),So(n.slice(7,14),r).copy(t,8),So(n.slice(14),r).copy(t,16),t}u(qq,"createNTLMResponse");function Hq(r){var e=Uq.create();return e.update(new Buffer.from(r,"ucs2")),e.buffer()}u(Hq,"createNTLMHash");function SO(r,e,t){var n=JC.createHmac("md5",r);return n.update(new Buffer.from(e.toUpperCase()+t,"ucs2")),n.digest()}u(SO,"createNTLMv2Hash");function Kq(r,e,t,n,s){var i=new Buffer.alloc(24),a=SO(t,e,s),o=JC.createHmac("md5",a);r.challenge.copy(i,8),i.write(n||YC(16),16,"hex"),o.update(i.slice(8));var l=o.digest();return l.copy(i),i}u(Kq,"createLMv2Response");function Xq(r,e,t,n,s){var i=new Buffer.alloc(48+r.targetInfo.buffer.length),a=SO(t,e,s),o=JC.createHmac("md5",a);r.challenge.copy(i,8),i.writeUInt32BE(16842752,16),i.writeUInt32LE(0,20);var l=((Date.now()+116444736e5)*1e4).toString(16),c=+("0x"+l.substring(Math.max(0,l.length-8))),f=+("0x"+l.substring(0,Math.max(0,l.length-8)));i.writeUInt32LE(c,24,!1),i.writeUInt32LE(f,28,!1),i.write(n||YC(16),32,"hex"),i.writeUInt32LE(0,40),r.targetInfo.buffer.copy(i,44),i.writeUInt32LE(0,44+r.targetInfo.buffer.length),o.update(i.slice(8));var p=o.digest();return p.copy(i),i}u(Xq,"createNTLMv2Response");function YC(r){for(var e="";e.length<r;)e+=Math.floor(Math.random()*16).toString(16);return e}u(YC,"createPseudoRandomValue");AO.exports={createLMHash:jq,createNTLMHash:Hq,createLMResponse:Mq,createNTLMResponse:qq,createLMv2Response:Kq,createNTLMv2Response:Xq,createPseudoRandomValue:YC}});var NO=ue((_re,bO)=>{"use strict";var xO=st("os"),Co=sO(),Ao=CO(),xo="NTLMSSP\0";function Gq(r,e){var t=32,n=0,s=new Buffer.alloc(1024);return r=r===void 0?xO.hostname():r,e=e===void 0?"":e,s.write(xo,n,xo.length,"ascii"),n+=xo.length,s.writeUInt32LE(1,n),n+=4,s.writeUInt32LE(Co.NTLMFLAG_NEGOTIATE_OEM|Co.NTLMFLAG_REQUEST_TARGET|Co.NTLMFLAG_NEGOTIATE_NTLM_KEY|Co.NTLMFLAG_NEGOTIATE_NTLM2_KEY|Co.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)}u(Gq,"createType1Message");function $q(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,xo.length)!==xo)throw new Error("Invalid message signature: "+r);if(t.readUInt32LE(xo.length)!==2)throw new Error("Invalid message type (no type 2)");return n.flags=t.readUInt32LE(20),n.encoding=n.flags&Co.NTLMFLAG_NEGOTIATE_OEM?"ascii":"ucs2",n.version=n.flags&Co.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&Co.NTLMFLAG_NEGOTIATE_TARGET_INFO&&(n.targetInfo=(function(){var s={},i=t.readUInt16LE(40),a=t.readUInt32LE(44),o=new Buffer.alloc(i);if(t.copy(o,0,a,a+i),i===0)return s;if(a+i>t.length||a<32)throw new Error("Bad type 2 message");for(var l=a;l<a+i;){var c=t.readUInt16LE(l);l+=2;var f=t.readUInt16LE(l);if(l+=2,c===0)break;var p=void 0;switch(c){case 1:p="SERVER";break;case 2:p="DOMAIN";break;case 3:p="FQDN";break;case 4:p="DNS";break;case 5:p="PARENT_DNS";break;default:p="";break}p&&(s[p]=t.toString("ucs2",l,l+f)),l+=f}return{parsed:s,buffer:o}})()),n}u($q,"decodeType2Message");function Wq(r,e,t,n,s){var i=52,a=new Buffer.alloc(1024);if(n===void 0&&(n=xO.hostname()),s===void 0&&(s=r.targetName),a.write(xo,0,xo.length,"ascii"),a.writeUInt32LE(3,8),r.version===2){i=64;var o=Ao.createNTLMHash(t),l=Ao.createPseudoRandomValue(16),c=Ao.createLMv2Response(r,e,o,l,s),f=Ao.createNTLMv2Response(r,e,o,l,s);a.writeUInt16LE(c.length,12),a.writeUInt16LE(c.length,14),a.writeUInt32LE(i,16),c.copy(a,i),i+=c.length,a.writeUInt16LE(f.length,20),a.writeUInt16LE(f.length,22),a.writeUInt32LE(i,24),f.copy(a,i),i+=f.length}else{var p=Ao.createLMHash(t),o=Ao.createNTLMHash(t),d=Ao.createLMResponse(r.challenge,p),g=Ao.createNTLMResponse(r.challenge,o);a.writeUInt16LE(d.length,12),a.writeUInt16LE(d.length,14),a.writeUInt32LE(i,16),d.copy(a,i),i+=d.length,a.writeUInt16LE(g.length,20),a.writeUInt16LE(g.length,22),a.writeUInt32LE(i,24),g.copy(a,i),i+=g.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)}u(Wq,"createType3Message");bO.exports={createType1Message:Gq,decodeType2Message:$q,createType3Message:Wq}});var BO=ue((kre,DO)=>{"use strict";var zq=st("util"),Jq=st("stream"),TO=Jq.Writable,IO=IO||function(r){setTimeout(r,0)};DO.exports=Ad;zq.inherits(Ad,TO);function Ad(r){if(!(this instanceof Ad))return new Ad(r);r=r||{},TO.call(this,r)}u(Ad,"DevNull");Ad.prototype._write=function(r,e,t){IO(t)}});var OO=ue(gn=>{"use strict";var Yq=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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Qq=gn&&gn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Hv=gn&&gn.__importStar||(function(){var r=u(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"&&Yq(t,e,n[s]);return Qq(t,e),t}})(),Zq=gn&&gn.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return u(s,"adopt"),new(t||(t=Promise))(function(i,a){function o(f){try{c(n.next(f))}catch(p){a(p)}}u(o,"fulfilled");function l(f){try{c(n.throw(f))}catch(p){a(p)}}u(l,"rejected");function c(f){f.done?i(f.value):s(f.value).then(o,l)}u(c,"step"),c((n=n.apply(r,e||[])).next())})},e7=gn&&gn.__generator||function(r,e){var t={label:0,sent:u(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=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(f){return l([c,f])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(t=0)),t;)try{if(n=1,s&&(i=c[0]&2?s.return:c[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,c[1])).done)return i;switch(s=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(f){c=[6,f],s=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},t7=gn&&gn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gn,"__esModule",{value:!0});gn.AxiosError=void 0;gn.NtlmClient=i7;var RO=Hv(KC());Object.defineProperty(gn,"AxiosError",{enumerable:!0,get:u(function(){return RO.AxiosError},"get")});var QC=Hv(NO()),r7=Hv(st("https")),n7=Hv(st("http")),s7=t7(BO());function i7(r,e){var t=this,n=e??{};n.httpAgent||(n.httpAgent=new n7.Agent({keepAlive:!0})),n.httpsAgent||(n.httpsAgent=new r7.Agent({keepAlive:!0}));var s=RO.default.create(n);return s.interceptors.response.use(function(i){return i},function(i){return Zq(t,void 0,void 0,function(){var a,o,l,c,f,p,d,g;return e7(this,function(m){switch(m.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")?(o=((d=a.headers["www-authenticate"].split(",").find(function(v){return v.match(/ *NTLM/)}))===null||d===void 0?void 0:d.trim())||"",a.config.headers||(a.config.headers={}),o.length<50?(l=QC.createType1Message(r.workstation,r.domain),a.config.headers.Authorization=l):(c=QC.decodeType2Message((o.match(/^NTLM\s+(.+?)(,|\s+|$)/)||[])[1]),f=QC.createType3Message(c,r.username,r.password,r.workstation,r.domain),a.config.headers["X-retry"]="false",a.config.headers.Authorization=f),a.config.responseType!=="stream"?[3,2]:(p=(g=i.response)===null||g===void 0?void 0:g.data,p&&!p.readableEnded?[4,new Promise(function(v){p.pipe((0,s7.default)()),p.once("close",v)})]:[3,2])):[3,3];case 1:m.sent(),m.label=2;case 2:return[2,s(a.config)];case 3:throw i}})})}),s}u(i7,"NtlmClient")});var Cd=ue(bo=>{"use strict";bo.removeLeadingAndTrailingHTTPWhitespace=r=>r.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,"");bo.removeTrailingHTTPWhitespace=r=>r.replace(/[ \t\n\r]+$/u,"");bo.isHTTPWhitespaceChar=r=>r===" "||r===" "||r===`
33
+ `||r==="\r";bo.solelyContainsHTTPTokenCodePoints=r=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(r);bo.soleyContainsHTTPQuotedStringTokenCodePoints=r=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(r);bo.asciiLowercase=r=>r.replace(/[A-Z]/ug,e=>e.toLowerCase());bo.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 PO=ue((jre,_O)=>{"use strict";var{asciiLowercase:Kv,solelyContainsHTTPTokenCodePoints:a7,soleyContainsHTTPQuotedStringTokenCodePoints:o7}=Cd();_O.exports=class{static{u(this,"MIMETypeParameters")}constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=Kv(String(e)),this._map.get(e)}has(e){return e=Kv(String(e)),this._map.has(e)}set(e,t){if(e=Kv(String(e)),t=String(t),!a7(e))throw new Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!o7(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=Kv(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 VO=ue((Hre,LO)=>{"use strict";var{removeLeadingAndTrailingHTTPWhitespace:u7,removeTrailingHTTPWhitespace:kO,isHTTPWhitespaceChar:l7,solelyContainsHTTPTokenCodePoints:ZC,soleyContainsHTTPQuotedStringTokenCodePoints:c7,asciiLowercase:ex,collectAnHTTPQuotedString:f7}=Cd();LO.exports=r=>{r=u7(r);let e=0,t="";for(;e<r.length&&r[e]!=="/";)t+=r[e],++e;if(t.length===0||!ZC(t)||e>=r.length)return null;++e;let n="";for(;e<r.length&&r[e]!==";";)n+=r[e],++e;if(n=kO(n),n.length===0||!ZC(n))return null;let s={type:ex(t),subtype:ex(n),parameters:new Map};for(;e<r.length;){for(++e;l7(r[e]);)++e;let i="";for(;e<r.length&&r[e]!==";"&&r[e]!=="=";)i+=r[e],++e;if(i=ex(i),e<r.length){if(r[e]===";")continue;++e}let a=null;if(r[e]==='"')for([a,e]=f7(r,e);e<r.length&&r[e]!==";";)++e;else{for(a="";e<r.length&&r[e]!==";";)a+=r[e],++e;if(a=kO(a),a==="")continue}i.length>0&&ZC(i)&&c7(a)&&!s.parameters.has(i)&&s.parameters.set(i,a)}return s}});var UO=ue((Kre,FO)=>{"use strict";var{solelyContainsHTTPTokenCodePoints:h7}=Cd();FO.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+="=",(!h7(n)||n.length===0)&&(n=n.replace(/(["\\])/ug,"\\$1"),n=`"${n}"`),e+=n;return e}});var tx=ue((Gre,qO)=>{"use strict";var p7=PO(),d7=VO(),m7=UO(),{asciiLowercase:MO,solelyContainsHTTPTokenCodePoints:jO}=Cd();qO.exports=class{static{u(this,"MIMEType")}constructor(e){e=String(e);let t=d7(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 p7(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=MO(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!jO(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=MO(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!jO(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return m7(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 ZO=ue((Wre,QO)=>{"use strict";var xd=tx();function HO(r){return xd.parse(`${r}`)}u(HO,"normalizeMIMEType");function g7(r){return r.subtype.endsWith("+xml")||r.type==="text"&&r.subtype==="xml"||r.type==="application"&&r.subtype==="xml"}u(g7,"isXMLMIMEType");function y7(r){return r.type==="text"&&r.subtype==="html"}u(y7,"isHTMLMIMEType");var KO=1445;function v7(r){return r.length<=KO?r:r.subarray(0,KO)}u(v7,"getResourceHeader");function E7(r){return r.type==="image"}u(E7,"isImageMIMEType");function w7(r){return r.type==="audio"||r.type==="video"||r.type==="application"&&r.subtype==="ogg"}u(w7,"isAudioOrVideoMIMEType");function rn(r){return r===9||r===10||r===12||r===13||r===32}u(rn,"isWhitespaceByte");function GO(r){return r>=0&&r<=8||r===11||r>=14&&r<=26||r>=28&&r<=31}u(GO,"isBinaryDataByte");function ul(r,e){let{pattern:t,mask:n,ignoredLeadingBytes:s,mimeType:i}=e,a=0;if(s)for(;a<r.length&&s(r[a]);)a++;if(r.length<a+t.length)return null;for(let o=0;o<t.length;o++)if((r[a+o]&n[o])!==(t[o]&n[o]))return null;return i}u(ul,"matchesSignature");var S7=[{pattern:[60,33,68,79,67,84,89,80,69,32,72,84,77,76,32],mask:[255,255,223,223,223,223,223,223,223,255,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,72,84,77,76,32],mask:[255,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,72,69,65,68,32],mask:[255,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,83,67,82,73,80,84,32],mask:[255,223,223,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,73,70,82,65,77,69,32],mask:[255,223,223,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,72,49,32],mask:[255,223,255,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,68,73,86,32],mask:[255,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,70,79,78,84,32],mask:[255,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,84,65,66,76,69,32],mask:[255,223,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,65,32],mask:[255,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,83,84,89,76,69,32],mask:[255,223,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,84,73,84,76,69,32],mask:[255,223,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,66,32],mask:[255,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,66,79,68,89,32],mask:[255,223,223,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,66,82,32],mask:[255,223,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,80,32],mask:[255,223,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,33,45,45,32],mask:[255,255,255,255,225],ignoredLeadingBytes:rn,mimeType:"text/html"},{pattern:[60,63,120,109,108],mask:[255,255,255,255,255],ignoredLeadingBytes:rn,mimeType:"text/xml"},{pattern:[37,80,68,70,45],mask:[255,255,255,255,255],mimeType:"application/pdf"}],A7=[{pattern:[37,33,80,83,45,65,100,111,98,101,45],mask:[255,255,255,255,255,255,255,255,255,255,255],mimeType:"application/postscript"},{pattern:[254,255,0,0],mask:[255,255,0,0],mimeType:"text/plain"},{pattern:[255,254,0,0],mask:[255,255,0,0],mimeType:"text/plain"},{pattern:[239,187,191,0],mask:[255,255,255,0],mimeType:"text/plain"}],$O=[{pattern:[0,0,1,0],mask:[255,255,255,255],mimeType:"image/x-icon"},{pattern:[0,0,2,0],mask:[255,255,255,255],mimeType:"image/x-icon"},{pattern:[66,77],mask:[255,255],mimeType:"image/bmp"},{pattern:[71,73,70,56,55,97],mask:[255,255,255,255,255,255],mimeType:"image/gif"},{pattern:[71,73,70,56,57,97],mask:[255,255,255,255,255,255],mimeType:"image/gif"},{pattern:[82,73,70,70,0,0,0,0,87,69,66,80,86,80],mask:[255,255,255,255,0,0,0,0,255,255,255,255,255,255],mimeType:"image/webp"},{pattern:[137,80,78,71,13,10,26,10],mask:[255,255,255,255,255,255,255,255],mimeType:"image/png"},{pattern:[255,216,255],mask:[255,255,255],mimeType:"image/jpeg"}],WO=[{pattern:[70,79,82,77,0,0,0,0,65,73,70,70],mask:[255,255,255,255,0,0,0,0,255,255,255,255],mimeType:"audio/aiff"},{pattern:[73,68,51],mask:[255,255,255],mimeType:"audio/mpeg"},{pattern:[79,103,103,83,0],mask:[255,255,255,255,255],mimeType:"application/ogg"},{pattern:[77,84,104,100,0,0,0,6],mask:[255,255,255,255,255,255,255,255],mimeType:"audio/midi"},{pattern:[82,73,70,70,0,0,0,0,65,86,73,32],mask:[255,255,255,255,0,0,0,0,255,255,255,255],mimeType:"video/avi"},{pattern:[82,73,70,70,0,0,0,0,87,65,86,69],mask:[255,255,255,255,0,0,0,0,255,255,255,255],mimeType:"audio/wave"}];function zO(r){if(r.length<12||r[4]!==102||r[5]!==116||r[6]!==121||r[7]!==112)return null;let e=r[0]<<24|r[1]<<16|r[2]<<8|r[3];if(e<12||e>r.length)return null;let t=String.fromCharCode(r[8],r[9],r[10],r[11]),n=["mp41","mp42","isom","iso2","mmp4","M4V ","M4A ","M4P ","avc1"];if(n.includes(t))return"video/mp4";for(let s=16;s+4<=e&&s+4<=r.length;s+=4){let i=String.fromCharCode(r[s],r[s+1],r[s+2],r[s+3]);if(n.includes(i))return"video/mp4"}return null}u(zO,"matchMP4");function C7(r,e){let t=128,n=8,s=1;for(;s<n&&s<r.length&&(r[e]&t)===0;)t>>=1,++s;return s}u(C7,"parseVint");function x7(r,e,t){for(;e<r.length&&r[e]===0;)e++;if(r.length<e+t.length)return!1;for(let n=0;n<t.length;n++)if(r[e+n]!==t[n])return!1;return!0}u(x7,"matchPaddedSequence");function JO(r){let{length:e}=r;if(e<4||r[0]!==26||r[1]!==69||r[2]!==223||r[3]!==163)return null;let t=4;for(;t<e&&t<38;){if(t+1<e&&r[t]===66&&r[t+1]===130){if(t+=2,t>=e)break;let n=C7(r,t);if(t+=n,t>=e-4)break;if(x7(r,t,[119,101,98,109]))return"video/webm"}t++}return null}u(JO,"matchWebM");var b7=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,0],N7=[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160,0],T7=[44100,48e3,32e3,0];function XO(r,e){let{length:t}=r;if(t<e+4||r[e]!==255||(r[e+1]&224)!==224)return!1;let n=(r[e+1]&6)>>1;return!(n===0||(r[e+2]&240)>>4===15||(r[e+2]&12)>>2===3||(4-n&3)!==3)}u(XO,"matchMP3Header");function I7(r,e){let t=(r[e+1]&24)>>3,n=(r[e+2]&240)>>4,s=(t&1)!==0?b7[n]:N7[n],i=(r[e+2]&12)>>2,a=T7[i],o=(r[e+2]&2)>>1;return{version:t,bitrate:s,samplerate:a,pad:o}}u(I7,"parseMP3Frame");function D7(r,e,t,n){let s=r===1?72:144,i=Math.floor(e*1e3*s/t);return n!==0&&(i+=1),i}u(D7,"computeMP3FrameSize");function YO(r){let{length:e}=r,t=0;if(!XO(r,t))return null;let{version:n,bitrate:s,samplerate:i,pad:a}=I7(r,t),o=D7(n,s,i,a);return o<4||o>e-t||(t+=o,!XO(r,t))?null:"audio/mpeg"}u(YO,"matchMP3WithoutID3");var B7=[{pattern:[31,139,8],mask:[255,255,255],mimeType:"application/x-gzip"},{pattern:[80,75,3,4],mask:[255,255,255,255],mimeType:"application/zip"},{pattern:[82,97,114,33,26,7,0],mask:[255,255,255,255,255,255,255],mimeType:"application/x-rar-compressed"}];function R7(r){for(let e of $O){let t=ul(r,e);if(t)return t}return null}u(R7,"matchImageType");function O7(r){for(let s of WO){let i=ul(r,s);if(i)return i}let e=zO(r);if(e)return e;let t=JO(r);if(t)return t;let n=YO(r);return n||null}u(O7,"matchAudioOrVideoType");function _7(r){let{length:e}=r;if(e>=2&&(r[0]===254&&r[1]===255||r[0]===255&&r[1]===254)||e>=3&&r[0]===239&&r[1]===187&&r[2]===191)return"text/plain";for(let t=0;t<e;t++)if(GO(r[t]))return"application/octet-stream";return"text/plain"}u(_7,"distinguishTextOrBinary");function P7(r,{sniffScriptable:e=!1}={}){if(e)for(let i of S7){let a=ul(r,i);if(a)return a}for(let i of A7){let a=ul(r,i);if(a)return a}for(let i of $O){let a=ul(r,i);if(a)return a}for(let i of WO){let a=ul(r,i);if(a)return a}let t=zO(r);if(t)return t;let n=JO(r);if(n)return n;let s=YO(r);if(s)return s;for(let i of B7){let a=ul(r,i);if(a)return a}for(let i=0;i<r.length;i++)if(GO(r[i]))return"application/octet-stream";return"text/plain"}u(P7,"identifyAnUnknownMIMEType");var k7=new Set(["text/plain","text/plain; charset=ISO-8859-1","text/plain; charset=iso-8859-1","text/plain; charset=UTF-8"]);function L7({contentTypeHeader:r,providedType:e}){let t=null,n=!1;return r!==void 0?(t=HO(r),t!==null&&typeof r=="string"&&(n=k7.has(r))):e!==void 0&&(t=HO(e)),{suppliedMIMEType:t,checkForApacheBug:n}}u(L7,"detectSuppliedMIMEType");QO.exports=u(function(e,{contentTypeHeader:t,providedType:n,noSniff:s=!1,isSupported:i=u(()=>!0,"isSupported")}={}){let a=v7(e),{suppliedMIMEType:o,checkForApacheBug:l}=L7({contentTypeHeader:t,providedType:n});if(o!==null&&(g7(o)||y7(o)))return o;if(o===null||o.essence==="unknown/unknown"||o.essence==="application/unknown"||o.essence==="*/*")return new xd(P7(a,{sniffScriptable:!s}));if(s)return o;if(l)return new xd(_7(a));if(E7(o)&&i(o)){let c=R7(a);if(c!==null)return new xd(c)}if(w7(o)&&i(o)){let c=O7(a);if(c!==null)return new xd(c)}return o},"computedMIMEType")});var e3=ue(rx=>{"use strict";rx.MIMEType=tx();rx.computedMIMEType=ZO()});var Gn=ue($t=>{"use strict";var V7=$t&&$t.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),F7=$t&&$t.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),U7=$t&&$t.__importStar||(function(){var r=u(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"&&V7(t,e,n[s]);return F7(t,e),t}})();Object.defineProperty($t,"__esModule",{value:!0});$t.wsdlCacheSingleton=$t.TNS_PREFIX=void 0;$t.isObject=j7;$t.isPlainObject=ll;$t.merge=nx;$t.mergeWith=t3;$t.defaults=q7;$t.defaultsDeep=n3;$t.pickBy=H7;$t.once=K7;$t.getByPath=X7;$t.passwordDigest=G7;$t.findPrefix=$7;$t.splitQName=W7;$t.xmlEscape=z7;$t.parseMTOMResp=J7;$t.streamToText=Y7;$t.stripBom=Q7;var M7=U7(st("crypto"));function j7(r){let e=typeof r;return r!=null&&(e==="object"||e==="function")}u(j7,"isObject");function ll(r){if(r===null||typeof r!="object")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}u(ll,"isPlainObject");function nx(r,...e){return t3(r,...e,void 0)}u(nx,"merge");function t3(r,...e){let t=e.pop(),n=e;for(let s of n)if(s!=null)for(let i of Object.keys(s))r3(r,s,i,t);return r}u(t3,"mergeWith");function r3(r,e,t,n){let s=e[t],i=r[t];if(n){let a=n(i,s,t);if(a!==void 0){r[t]=a;return}}if(s!==void 0)if(ll(s))if(ll(i))for(let a of Object.keys(s))r3(i,s,a,n);else r[t]=nx({},s);else if(Array.isArray(s))if(Array.isArray(i))for(let a=0;a<s.length;a++)ll(s[a])&&ll(i[a])?nx(i[a],s[a]):s[a]!==void 0&&(i[a]=s[a]);else r[t]=s.slice();else r[t]=s}u(r3,"baseMergeValue");function q7(r,...e){for(let t of e)if(t!=null)for(let n of Object.keys(t))r[n]===void 0&&(r[n]=t[n]);return r}u(q7,"defaults");function n3(r,...e){for(let t of e)if(t!=null)for(let n of Object.keys(t)){let s=r[n],i=t[n];ll(s)&&ll(i)?n3(s,i):s===void 0&&(r[n]=i)}return r}u(n3,"defaultsDeep");function H7(r,e){let t={};for(let n of Object.keys(r))e(r[n],n)&&(t[n]=r[n]);return t}u(H7,"pickBy");function K7(r){let e=!1,t;return function(...n){return e||(e=!0,t=r.apply(this,n)),t}}u(K7,"once");function X7(r,e){return e.split(".").reduce(function(t,n){return t&&t[n]},r)}u(X7,"getByPath");function G7(r,e,t){let n=M7.createHash("sha1"),s=Buffer.from(r||"","base64"),i=Buffer.from(e||"","utf8"),a=Buffer.from(t||"","utf8"),o=Buffer.concat([s,i,a]);return n.update(o),n.digest("base64")}u(G7,"passwordDigest");$t.TNS_PREFIX="__tns__";function $7(r,e){for(let t in r)if(t!==$t.TNS_PREFIX&&r[t]===e)return t}u($7,"findPrefix");function W7(r){if(typeof r!="string")return{prefix:$t.TNS_PREFIX,name:r};let[e]=r.split("|",1),t=e.indexOf(":");return{prefix:e.substring(0,t)||$t.TNS_PREFIX,name:e.substring(t+1)}}u(W7,"splitQName");function z7(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}u(z7,"xmlEscape");function J7(r,e,t){return import("../src-NRIPS2N7.mjs").then(({MultipartParser:n})=>{let s={parts:[]},i="",a="",o,l=0,c=new n;return c.initWithBoundary(e),c.on("data",({name:f,buffer:p,start:d,end:g})=>{switch(f){case"partBegin":s.parts[l]={body:null,headers:{}},o=Buffer.from("");break;case"headerField":i=p.slice(d,g).toString();break;case"headerValue":a=p.slice(d,g).toString();break;case"headerEnd":s.parts[l].headers[i.toLowerCase()]=a;break;case"partData":o=Buffer.concat([o,p.slice(d,g)]);break;case"partEnd":s.parts[l].body=o,l++;break}}),c.write(r),t(null,s)}).catch(t)}u(J7,"parseMTOMResp");async function Y7(r){let e=[];for await(let t of r)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e).toString("utf8")}u(Y7,"streamToText");function Q7(r){return r.charCodeAt(0)===65279?r.slice(1):r}u(Q7,"stripBom");var Z7=class{static{u(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={}}};$t.wsdlCacheSingleton=new Z7});var s3=ue((ene,eH)=>{eH.exports={name:"soap",version:"1.9.1",description:"A minimal node SOAP client",engines:{node:">=20.19.0"},author:"Vinay Pulim <v@pulim.com>",dependencies:{axios:"^1.15.0","axios-ntlm":"^1.4.6",debug:"^4.4.3","follow-redirects":"^1.15.11",formidable:"^3.5.4",sax:"^1.6.0","whatwg-mimetype":"5.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 TZ=UTC 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:"TZ=UTC mocha --timeout 15000 --bail --exit test/*-test.js test/security/*.js"},keywords:["soap"],license:"MIT",devDependencies:{"@eslint/js":"^10.0.1","@types/debug":"^4.1.12","@types/formidable":"^3.4.6","@types/node":"^14.0.0","@types/sax":"^1.2.7","@types/whatwg-mimetype":"^5.0.0","body-parser":"^2.2.0",colors:"^1.4.0",diff:"^8.0.2",doctoc:"^2.3.0",duplexer:"~0.1.2",eslint:"^10.0.1",express:"^5.1.0",finalhandler:"^2.1.0",glob:"^13.0.0",mocha:"^11.7.4",nyc:"^18.0.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.56.1"}}});var Xv=ue(Is=>{"use strict";var tH=Is&&Is.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),rH=Is&&Is.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),nH=Is&&Is.__importStar||(function(){var r=u(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"&&tH(t,e,n[s]);return rH(t,e),t}})(),sH=Is&&Is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Is,"__esModule",{value:!0});Is.HttpClient=void 0;var iH=nH(KC()),aH=OO(),i3=st("crypto"),oH=sH(Iy()),uH=e3(),lH=st("zlib"),cH=Gn(),a3=(0,oH.default)("node-soap"),fH=s3();function hH(r){return r.port?r.port:r.protocol.toLowerCase()==="https:"?"443":r.protocol.toLowerCase()==="http:"?"80":""}u(hH,"getPortFromUrl");var pH=class{static{u(this,"HttpClient")}constructor(e){e=e||{},this.options=e,this._request=e.request||iH.create()}buildRequest(e,t,n,s={}){let i=new URL(e),a=t?"POST":"GET",o=i.hostname,l=hH(i),c={"User-Agent":"node-soap/"+fH.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:o+(l?":"+l:"")},f=["headers"],{attachments:p,...d}=s,g=p||[];typeof t=="string"&&g.length===0&&!s.forceMTOM&&(c["Content-Length"]=Buffer.byteLength(t,"utf8"),c["Content-Type"]="application/x-www-form-urlencoded"),n=n||{};for(let v in n)c[v]=n[v];let m={url:i.href,method:a,headers:c,transformResponse:u(v=>v,"transformResponse")};if(s.ntlm||(m.validateStatus=null),s.forceMTOM||g.length>0){let v=(0,i3.randomUUID)(),y=null;if(c["Content-Type"].indexOf("action")>-1)for(let E of c["Content-Type"].split("; "))E.indexOf("action")>-1&&(y=E);let S=(0,i3.randomUUID)();c["Content-Type"]='multipart/related; type="application/xop+xml"; start="<'+v+'>"; start-info="text/xml"; boundary='+S,y&&(c["Content-Type"]=c["Content-Type"]+"; "+y);let C=[{"Content-Type":'application/xop+xml; charset=UTF-8; type="text/xml"',"Content-ID":"<"+v+">",body:t}];g.forEach(E=>{C.push({"Content-Type":E.mimetype,"Content-Transfer-Encoding":"binary","Content-ID":"<"+E.contentId+">","Content-Disposition":'attachment; filename="'+E.name+'"',body:E.body})}),m.data=[Buffer.from(`--${S}\r
34
+ `)];let w=0;C.forEach(E=>{Object.keys(E).forEach(A=>{A!=="body"&&m.data.push(Buffer.from(`${A}: ${E[A]}\r
35
+ `))}),m.data.push(Buffer.from(`\r
36
+ `),Buffer.from(E.body),Buffer.from(`\r
37
+ --${S}${w===C.length-1?"--":""}\r
38
+ `)),w++}),m.data=Buffer.concat(m.data)}else m.data=t;s.forceGzip&&(m.decompress=!0,m.data=(0,lH.gzipSync)(m.data),m.headers["Accept-Encoding"]="gzip,deflate",m.headers["Content-Encoding"]="gzip");for(let v in d)if(f.indexOf(v)!==-1)for(let y in s[v])m[v][y]=s[v][y];else m[v]=s[v];return a3("Http request: %j",m),m}handleResponse(e,t,n){if(a3("Http response body: %j",n),typeof n=="string"){let s=/(?:<\?[^?]*\?>[\s]*)?<([^:]*):Envelope([\S\s]*)<\/\1:Envelope>/i,i=n.replace(/<!--[\s\S]*?-->/,"").match(s);i&&(n=i[0])}return n}request(e,t,n,s,i){let a=this.buildRequest(e,t,s,i),o;i!==void 0&&i.ntlm?o=(0,aH.NtlmClient)({username:i.username,password:i.password,workstation:i.workstation||"",domain:i.domain||""},a)(a):(this.options.parseReponseAttachments&&(a.responseType="arraybuffer",a.responseEncoding="binary"),o=this._request(a));let l=this;return o.then(c=>{let f=u(p=>(c.data=this.handleResponse(o,c,p||c.data),n(null,c,c.data),c),"handleBody");if(l.options.parseReponseAttachments)if(c.headers["content-type"]&&c.headers["content-type"].toLowerCase().indexOf("multipart/related")>-1){let d,g=new uH.MIMEType(c.headers["content-type"]);return g&&(d=g.parameters.get("boundary")),d?(0,cH.parseMTOMResp)(c.data,d,(m,v)=>{if(m)return n(m);let y=v.parts.shift();return!y||!y.body?n(new Error("Cannot parse multipart response")):(c.mtomResponseAttachments=v,f(y.body.toString(l.options.encoding||"utf8")))}):n(new Error("Missing boundary from content-type"))}else return f(c.data.toString(l.options.encoding||"utf8"));else return f()},c=>n(c)),o}requestStream(e,t,n,s){let i=this.buildRequest(e,t,n,s);i.responseType="stream";let a=this._request(i).then(o=>(o.data=this.handleResponse(a,o,o.data),o));return a}};Is.HttpClient=pH});var sx=ue(Ds=>{"use strict";var dH=Ds&&Ds.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),mH=Ds&&Ds.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),gH=Ds&&Ds.__importStar||(function(){var r=u(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"&&dH(t,e,n[s]);return mH(t,e),t}})(),yH=Ds&&Ds.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.Client=void 0;var o3=gH(st("assert")),vH=st("crypto"),EH=yH(Iy()),wH=st("events"),SH=Xv(),Gv=Gn(),AH=(0,EH.default)("node-soap"),u3=/[^a-z$_0-9]/i,CH=class extends wH.EventEmitter{static{u(this,"Client")}constructor(e,t,n){super(),n=n||{},this.wsdl=e,this._initializeOptions(n),this._initializeServices(t),this.httpClient=n.httpClient||new SH.HttpClient(n)}addSoapHeader(e,t,n,s){return this.soapHeaders||(this.soapHeaders=[]),e=this._processSoapHeader(e,t,n,s),this.soapHeaders.push(e)-1}changeSoapHeader(e,t,n,s,i){this.soapHeaders||(this.soapHeaders=[]),t=this._processSoapHeader(t,n,s,i),this.soapHeaders[e]=t}getSoapHeaders(){return this.soapHeaders}clearSoapHeaders(){this.soapHeaders=null}addHttpHeader(e,t){this.httpHeaders||(this.httpHeaders={}),this.httpHeaders[e]=t}getHttpHeaders(){return this.httpHeaders}clearHttpHeaders(){this.httpHeaders=null}addBodyAttribute(e){if(this.bodyAttributes||(this.bodyAttributes=[]),typeof e=="object"){let t="";Object.getOwnPropertyNames(e).forEach(n=>{t+=" "+n+'="'+e[n]+'"'}),e=t}e.substr(0,1)!==" "&&(e=" "+e),this.bodyAttributes.push(e)}getBodyAttributes(){return this.bodyAttributes}clearBodyAttributes(){this.bodyAttributes=null}setEndpoint(e){this.endpoint=e,this._initializeServices(e)}describe(){return this.wsdl.describeServices()}setSecurity(e){this.security=e}setSOAPAction(e){this.SOAPAction=e}_initializeServices(e){let n=this.wsdl.definitions.services;for(let s in n)this[s]=this._defineService(n[s],e)}_initializeOptions(e){this.streamAllowed=e.stream,this.returnSaxStream=e.returnSaxStream,this.normalizeNames=e.normalizeNames,this.overridePromiseSuffix=e.overridePromiseSuffix||"Async",this.wsdl.options.attributesKey=e.attributesKey||"attributes",this.wsdl.options.envelopeKey=e.envelopeKey||"soap",this.wsdl.options.envelopeSoapUrl=e.envelopeSoapUrl||"http://schemas.xmlsoap.org/soap/envelope/",this.wsdl.options.preserveWhitespace=!!e.preserveWhitespace,this.wsdl.options.forceUseSchemaXmlns=!!e.forceUseSchemaXmlns;let t=e.ignoredNamespaces;t!==void 0&&typeof t=="object"&&"override"in t&&t.override===!0&&t.namespaces!==void 0&&(this.wsdl.options.ignoredNamespaces=t.namespaces),e.overrideElementKey!==void 0&&(this.wsdl.options.overrideElementKey=e.overrideElementKey),e.overrideRootElement!==void 0&&(this.wsdl.options.overrideRootElement=e.overrideRootElement),this.wsdl.options.forceSoap12Headers=!!e.forceSoap12Headers}_defineService(e,t){let n=e.ports,s={};for(let i in n)s[i]=this._definePort(n[i],t||n[i].location);return s}_definePort(e,t){let n=t,i=e.binding.methods,a={};for(let o in i){a[o]=this._defineMethod(i[o],n);let l=this.normalizeNames?o.replace(u3,"_"):o;if(this[l]=a[o],!u3.test(l)){let c=this.overridePromiseSuffix;this[l+c]=this._promisifyMethod(a[o])}}return a}_promisifyMethod(e){return(t,n,s)=>new Promise((i,a)=>{e(t,u((l,c,f,p,d,g)=>{l?a(l):i([c,f,p,d,g])},"callback"),n,s)})}_defineMethod(e,t){let n;return(s,i,a,o)=>{typeof s=="function"?(i=s,s={}):typeof a=="function"?(n=i,i=a,a=n):typeof o=="function"&&(n=i,i=o,o=a,a=n),this._invoke(e,s,t,(l,c,f,p,d,g)=>{i(l,c,f,p,d,g)},a,o)}}_processSoapHeader(e,t,n,s){switch(typeof e){case"object":return this.wsdl.objectToXML(e,t,n,s,!0);case"function":{let i=this;return(...a)=>{let o=e.apply(null,[...a]);return typeof o=="object"?i.wsdl.objectToXML(o,t,n,s,!0):o}}default:return e}}_invoke(e,t,n,s,i,a){let o=e.$name,l=e.input,c=e.output,f=e.style,p=this.wsdl.definitions,d=this.wsdl.options.envelopeKey,g=this.wsdl.options.envelopeSoapUrl,m=p.$targetNamespace,v="",y="",S=null,C,w=(0,Gv.findPrefix)(p.xmlns,m),E={"Content-Type":"text/xml; charset=utf-8"},A="xmlns:"+d+'="'+g+'"',b=u((M,se,ee)=>{let ie;if(!c)return s(null,null,se,M.Header,S,ee.mtomResponseAttachments);if(!M.html&&!M.Body){if(ee.status>=400){let X=new Error("Error http status codes");return X.response=ee,X.body=se,this.emit("soapError",X,D),s(X,M,se,M.Header)}return s(null,M,se,M.Header)}if(typeof M.Body!="object"){let X=new Error("Cannot parse response");return X.response=ee,X.body=se,s(X,M,se,void 0,S)}ie=M.Body[c.$name],ie||(ie=M.Body[c.$name.replace(/(?:Out(?:put)?|Response)$/,"")]),ie||["Response","Out","Output"].forEach(X=>{if(Object.hasOwnProperty.call(M.Body,o+X))return ie=M.Body[o+X]}),s(null,ie,se,M.Header,S,ee.mtomResponseAttachments)},"finish"),V=u((M,se)=>{let ee;try{ee=this.wsdl.xmlToObject(M)}catch(ie){if(!c||!c.$lookupTypes){AH("Response element is not present. Unable to convert response xml to json.");let X=(0,Gv.isObject)(M)?M:U(M);if(X)return s(null,se,X,void 0,S)}return ie.response=se,ie.body=M,this.emit("soapError",ie,D),s(ie,se,M,void 0,S,se.mtomResponseAttachments)}return b(ee,M,se)},"parseSync");this.SOAPAction?C=this.SOAPAction:e.soapAction!==void 0&&e.soapAction!==null?C=e.soapAction:C=(m.lastIndexOf("/")!==m.length-1?m+"/":m)+o,this.wsdl.options.forceSoap12Headers?(E["Content-Type"]=`application/soap+xml; charset=utf-8; action="${C}"`,A="xmlns:"+d+'="http://www.w3.org/2003/05/soap-envelope"'):E.SOAPAction='"'+C+'"',i=i||{},this.security&&this.security.addHeaders&&this.security.addHeaders(E),this.security&&this.security.addOptions&&this.security.addOptions(i),this.security&&typeof this.security?.toXML!="function"&&(this.security.toXML=()=>""),f==="rpc"&&(l.parts||l.name==="element"||t===null)?(o3.ok(!f||f==="rpc","invalid message definition for document style binding"),y=this.wsdl.objectToRpcXML(o,t,w,m,l.name!=="element"),e.inputSoap==="encoded"&&(v='soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ')):(o3.ok(!f||f==="document","invalid message definition for rpc style binding"),y=this.wsdl.objectToDocumentXML(l.$name,t,l.targetNSAlias,l.targetNamespace,l.$type||l.$lookupType));let I;this.soapHeaders&&(I=this.soapHeaders.map(M=>typeof M=="function"?M(e,n,C,t):M).join(" ")),S='<?xml version="1.0" encoding="utf-8"?><'+d+":Envelope "+A+' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '+v+this.wsdl.xmlnsInEnvelope+">"+(I||this.security&&this.security.toXML()?"<"+d+":Header"+(this.wsdl.xmlnsInHeader?" "+this.wsdl.xmlnsInHeader:"")+">"+(I||"")+(this.security&&!this.security.postProcess?this.security.toXML():"")+"</"+d+":Header>":"")+"<"+d+":Body"+(this.bodyAttributes?this.bodyAttributes.join(" "):"")+">"+y+"</"+d+":Body></"+d+":Envelope>",this.security&&this.security.postProcess&&(S=this.security.postProcess(S,d)),i&&i.postProcess&&(S=i.postProcess(S)),this.lastMessage=y,this.lastRequest=S,this.lastEndpoint=n;let D=i.exchangeId||(0,vH.randomUUID)();if(this.emit("message",y,D),this.emit("request",S,D),this.httpHeaders===null)E={};else{for(let M in this.httpHeaders)E[M]=this.httpHeaders[M];for(let M in a)E[M]=a[M]}let U=u(M=>{try{return JSON.parse(M)}catch{return}},"tryJSONparse");if(this.streamAllowed&&typeof this.httpClient.requestStream=="function"){s=(0,Gv.once)(s);let M=Date.now(),se=u(ee=>{this.lastResponse=null,this.lastResponseHeaders=null,this.lastElapsedTime=null,this.lastRequestHeaders=ee.config&&ee.config.headers,this.emit("response",null,null,D),this.returnSaxStream||!ee.response||!ee.response.data?s(ee,void 0,void 0,void 0,S):(ee.response.data.on("close",()=>{s(ee,void 0,void 0,void 0,S)}),ee.response.data.on("data",ie=>{ee.response.data=ie.toString()}))},"onError");this.httpClient.requestStream(n,S,E,i,this).then(ee=>{if(this.lastRequestHeaders=ee.headers,ee.data.on&&ee.data.on("error",ie=>se(ie)),ee.status!==200||!c||!c.$lookupTypes){(0,Gv.streamToText)(ee.data).then(ie=>(this.lastResponse=ie,this.lastElapsedTime=Date.now()-M,this.lastResponseHeaders=ee&&ee.headers,this.lastRequestHeaders=ee.config&&ee.config.headers||ee.headers,this.emit("response",ie,ee,D),V(ie,ee)));return}if(this.returnSaxStream){let ie=this.wsdl.getSaxStream(ee.data);return b({saxStream:ie},"<stream>",ee.data)}else this.wsdl.xmlToObject(ee.data,(ie,X)=>(this.lastResponse=ee,this.lastElapsedTime=Date.now()-M,this.lastResponseHeaders=ee&&ee.headers,this.lastRequestHeaders=ee.config.headers,this.emit("response","<stream>",ee.data,D),ie?(ie.response=ee,ie.body="<stream>",this.emit("soapError",ie,D),s(ie,ee,void 0,void 0,S)):b(X,"<stream>",ee)))},se);return}let F=Date.now();return this.httpClient.request(n,S,(M,se,ee)=>{if(this.lastResponse=ee,se&&(this.lastResponseHeaders=se.headers,this.lastElapsedTime=Date.now()-F,this.lastResponseAttachments=se.mtomResponseAttachments,this.lastRequestHeaders=se.config&&se.config.headers),this.emit("response",ee,se,D),M){this.lastRequestHeaders=M.config&&M.config.headers;try{M.response&&M.response.data&&this.wsdl.xmlToObject(M.response.data)}catch(ie){M.root=ie.root||ie}s(M,void 0,void 0,void 0,S)}else return V(ee,se)},E,i,this)}};Ds.Client=CH});var c3=ue($v=>{"use strict";Object.defineProperty($v,"__esModule",{value:!0});$v.BasicAuthSecurity=void 0;var l3=Gn(),xH=class{static{u(this,"BasicAuthSecurity")}constructor(e,t,n){this._username=e,this._password=t,this.defaults={},(0,l3.merge)(this.defaults,n)}addHeaders(e){e.Authorization="Basic "+Buffer.from(this._username+":"+this._password||"").toString("base64")}toXML(){return""}addOptions(e){(0,l3.merge)(e,this.defaults)}};$v.BasicAuthSecurity=xH});var h3=ue(Wv=>{"use strict";Object.defineProperty(Wv,"__esModule",{value:!0});Wv.BearerSecurity=void 0;var f3=Gn(),bH=class{static{u(this,"BearerSecurity")}constructor(e,t){this._token=e,this.defaults={},(0,f3.merge)(this.defaults,t)}addHeaders(e){e.Authorization="Bearer "+this._token}toXML(){return""}addOptions(e){(0,f3.merge)(e,this.defaults)}};Wv.BearerSecurity=bH});var g3=ue(Ii=>{"use strict";var NH=Ii&&Ii.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),TH=Ii&&Ii.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),m3=Ii&&Ii.__importStar||(function(){var r=u(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"&&NH(t,e,n[s]);return TH(t,e),t}})();Object.defineProperty(Ii,"__esModule",{value:!0});Ii.ClientSSLSecurity=void 0;var ix=m3(st("fs")),p3=m3(st("https")),d3=Gn(),IH=class{static{u(this,"ClientSSLSecurity")}constructor(e,t,n,s){if(e)if(Buffer.isBuffer(e))this.key=e;else if(typeof e=="string")this.key=ix.readFileSync(e);else throw new Error("key should be a buffer or a string!");if(t)if(Buffer.isBuffer(t))this.cert=t;else if(typeof t=="string")this.cert=ix.readFileSync(t);else throw new Error("cert should be a buffer or a string!");n&&(Buffer.isBuffer(n)||Array.isArray(n)?this.ca=n:typeof n=="string"?this.ca=ix.readFileSync(n):(s=n,this.ca=null)),this.defaults={},(0,d3.merge)(this.defaults,s),this.agent=null}toXML(){return""}addOptions(e){let t=null;e.key=this.key,e.cert=this.cert,e.ca=this.ca,(0,d3.merge)(e,this.defaults),e.forever?(this.agent||(e.keepAlive=!0,this.agent=new p3.Agent(e)),t=this.agent):t=new p3.Agent(e),e.httpsAgent=t}};Ii.ClientSSLSecurity=IH});var E3=ue(Di=>{"use strict";var DH=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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),BH=Di&&Di.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),v3=Di&&Di.__importStar||(function(){var r=u(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"&&DH(t,e,n[s]);return BH(t,e),t}})();Object.defineProperty(Di,"__esModule",{value:!0});Di.ClientSSLSecurityPFX=void 0;var RH=v3(st("fs")),OH=v3(st("https")),y3=Gn(),_H=class{static{u(this,"ClientSSLSecurityPFX")}constructor(e,t,n){if(typeof t=="object"&&(n=t),e)if(Buffer.isBuffer(e))this.pfx=e;else if(typeof e=="string")this.pfx=RH.readFileSync(e);else throw new Error("supplied pfx file should be a buffer or a file location");t&&typeof t=="string"&&(this.passphrase=t),this.defaults={},(0,y3.merge)(this.defaults,n)}toXML(){return""}addOptions(e){e.pfx=this.pfx,this.passphrase&&(e.passphrase=this.passphrase),(0,y3.merge)(e,this.defaults),e.httpsAgent=new OH.Agent(e)}};Di.ClientSSLSecurityPFX=_H});var w3=ue(zv=>{"use strict";Object.defineProperty(zv,"__esModule",{value:!0});zv.NTLMSecurity=void 0;var PH=Gn(),kH=class{static{u(this,"NTLMSecurity")}constructor(e,t,n,s){typeof e=="object"?(this.defaults=e,this.defaults.ntlm=!0):this.defaults={ntlm:!0,username:e,password:t,domain:n,workstation:s}}addHeaders(e){e.Connection="keep-alive"}toXML(){return""}addOptions(e){(0,PH.merge)(e,this.defaults)}};zv.NTLMSecurity=kH});var S3=ue(Bi=>{"use strict";var LH=Bi&&Bi.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),VH=Bi&&Bi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),FH=Bi&&Bi.__importStar||(function(){var r=u(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"&&LH(t,e,n[s]);return VH(t,e),t}})();Object.defineProperty(Bi,"__esModule",{value:!0});Bi.WSSecurity=void 0;var UH=FH(st("crypto")),ax=Gn(),MH=["PasswordDigest","PasswordText"],jH=class{static{u(this,"WSSecurity")}constructor(e,t,n){n=n||{},this._username=e,this._password=t,this._envelopeKey="soap",this._appendElement="",typeof n=="string"?(this._passwordType=n||"PasswordText",n={}):this._passwordType=n.passwordType?n.passwordType:"PasswordText",MH.indexOf(this._passwordType)===-1&&(this._passwordType="PasswordText"),this._hasTimeStamp=n.hasTimeStamp||typeof n.hasTimeStamp=="boolean"?!!n.hasTimeStamp:!0,n.hasNonce!=null&&(this._hasNonce=!!n.hasNonce),this._hasTokenCreated=n.hasTokenCreated||typeof n.hasTokenCreated=="boolean"?!!n.hasTokenCreated:!0,n.actor!=null&&(this._actor=n.actor),n.mustUnderstand!=null&&(this._mustUnderstand=!!n.mustUnderstand),n.envelopeKey&&(this._envelopeKey=n.envelopeKey),n.appendElement&&(this._appendElement=n.appendElement)}toXML(){function e(o){function l(c){return c<10?"0"+c:c}return u(l,"pad"),o.getUTCFullYear()+"-"+l(o.getUTCMonth()+1)+"-"+l(o.getUTCDate())+"T"+l(o.getUTCHours())+":"+l(o.getUTCMinutes())+":"+l(o.getUTCSeconds())+"Z"}u(e,"getDate");let t=new Date,n=e(t),s="";if(this._hasTimeStamp){let o=e(new Date(t.getTime()+6e5));s='<wsu:Timestamp wsu:Id="Timestamp-'+n+'"><wsu:Created>'+n+"</wsu:Created><wsu:Expires>"+o+"</wsu:Expires></wsu:Timestamp>"}let i,a;if(this._hasNonce||this._passwordType!=="PasswordText"){let o=UH.createHash("sha1");o.update(n+Math.random()),a=o.digest("base64")}return this._passwordType==="PasswordText"?(i='<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">'+(0,ax.xmlEscape)(this._password)+"</wsse:Password>",a&&(i+='<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+a+"</wsse:Nonce>")):i='<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">'+(0,ax.passwordDigest)(a,n,this._password)+'</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">'+a+"</wsse:Nonce>","<wsse:Security "+(this._actor?`${this._envelopeKey}:actor="${this._actor}" `:"")+(this._mustUnderstand?`${this._envelopeKey}:mustUnderstand="1" `:"")+'xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">'+s+'<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SecurityToken-'+n+'"><wsse:Username>'+(0,ax.xmlEscape)(this._username)+"</wsse:Username>"+i+(this._hasTokenCreated?"<wsu:Created>"+n+"</wsu:Created>":"")+"</wsse:UsernameToken>"+this._appendElement+"</wsse:Security>"}};Bi.WSSecurity=jH});var Jv=ue(ox=>{"use strict";var qH=typeof ox>"u"?{}:ox;(function(r){"use strict";function e(h){var x=Array.prototype.slice,j=h.length,Z=u(function(q,Xe){return function(){return Xe.apply(this,q.concat(x.call(arguments)))}},"partial"),ne=u(function(){var q=x.call(arguments);return q.length<j?Z(q,ne):h.apply(this,x.apply(arguments,[0,j]))},"fn1");return ne}u(e,"curry");var t=u(function(h,x){for(var j=0;j<x.length;j+=1)h(x[j],j,x)},"forEach"),n=u(function(h,x,j){var Z=x;return t(function(ne,q){Z=h(Z,ne,q)},j),Z},"reduce"),s=u(function(h,x){var j=new Array(x.length);return t(function(Z,ne){j[ne]=h(Z)},x),j},"map"),i=u(function(h,x){var j=[];return t(function(Z,ne){h(Z,ne)&&j.push(Z)},x),j},"filter"),a=u(function(h,x){for(var j=0;j<h.length;j+=1)if(h[j]===x)return!0;return!1},"includes");function o(h){return function(){return h}}u(o,"always");function l(h){return h.toString()}u(l,"toString");var c=u(function(h,x){return x.join(h)},"join"),f=u(function(h,x,j){return h+j+x},"wrap"),p=Array.prototype.concat,d=32767;function g(h){for(var x=[],j=0;j<h.length;j+=d){var Z=h.slice(j,j+d);x=p.apply(x,Z)}return x}u(g,"flatten");function m(h,x){for(var j=Object(h),Z=1;Z<arguments.length;Z++){var ne=arguments[Z];if(ne!=null)for(var q in ne)Object.prototype.hasOwnProperty.call(ne,q)&&(j[q]=ne[q])}return j}u(m,"assign");var v={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11};y.prototype=new Object,y.prototype.constructor=y,y.superclass=Object.prototype;function y(){this.init()}u(y,"XPathParser"),y.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(h){return new V(h[0],h[2])},this.reduceActions[5]=function(h){return new I(h[0],h[2])},this.reduceActions[7]=function(h){return new D(h[0],h[2])},this.reduceActions[8]=function(h){return new U(h[0],h[2])},this.reduceActions[10]=function(h){return new F(h[0],h[2])},this.reduceActions[11]=function(h){return new M(h[0],h[2])},this.reduceActions[12]=function(h){return new se(h[0],h[2])},this.reduceActions[13]=function(h){return new ee(h[0],h[2])},this.reduceActions[15]=function(h){return new ie(h[0],h[2])},this.reduceActions[16]=function(h){return new X(h[0],h[2])},this.reduceActions[18]=function(h){return new he(h[0],h[2])},this.reduceActions[19]=function(h){return new Ce(h[0],h[2])},this.reduceActions[20]=function(h){return new xe(h[0],h[2])},this.reduceActions[22]=function(h){return new A(h[1])},this.reduceActions[24]=function(h){return new pe(h[0],h[2])},this.reduceActions[25]=function(h){return new W(void 0,void 0,h[0])},this.reduceActions[27]=function(h){return h[0].locationPath=h[2],h[0]},this.reduceActions[28]=function(h){return h[0].locationPath=h[2],h[0].locationPath.steps.unshift(new O(O.DESCENDANTORSELF,B.nodeTest,[])),h[0]},this.reduceActions[29]=function(h){return new W(h[0],[],void 0)},this.reduceActions[30]=function(h){return qe.instance_of(h[0],W)?(h[0].filterPredicates==null&&(h[0].filterPredicates=[]),h[0].filterPredicates.push(h[1]),h[0]):new W(h[0],[h[1]],void 0)},this.reduceActions[32]=function(h){return h[1]},this.reduceActions[33]=function(h){return new R(h[0])},this.reduceActions[34]=function(h){return new N(h[0])},this.reduceActions[36]=function(h){return new K(h[0],[])},this.reduceActions[37]=function(h){return new K(h[0],h[2])},this.reduceActions[38]=function(h){return[h[0]]},this.reduceActions[39]=function(h){return h[2].unshift(h[0]),h[2]},this.reduceActions[43]=function(h){return new Le(!0,[])},this.reduceActions[44]=function(h){return h[1].absolute=!0,h[1]},this.reduceActions[46]=function(h){return new Le(!1,[h[0]])},this.reduceActions[47]=function(h){return h[0].steps.push(h[2]),h[0]},this.reduceActions[49]=function(h){return new O(h[0],h[1],[])},this.reduceActions[50]=function(h){return new O(O.CHILD,h[0],[])},this.reduceActions[51]=function(h){return new O(h[0],h[1],h[2])},this.reduceActions[52]=function(h){return new O(O.CHILD,h[0],h[1])},this.reduceActions[54]=function(h){return[h[0]]},this.reduceActions[55]=function(h){return h[1].unshift(h[0]),h[1]},this.reduceActions[56]=function(h){return h[0]=="ancestor"?O.ANCESTOR:h[0]=="ancestor-or-self"?O.ANCESTORORSELF:h[0]=="attribute"?O.ATTRIBUTE:h[0]=="child"?O.CHILD:h[0]=="descendant"?O.DESCENDANT:h[0]=="descendant-or-self"?O.DESCENDANTORSELF:h[0]=="following"?O.FOLLOWING:h[0]=="following-sibling"?O.FOLLOWINGSIBLING:h[0]=="namespace"?O.NAMESPACE:h[0]=="parent"?O.PARENT:h[0]=="preceding"?O.PRECEDING:h[0]=="preceding-sibling"?O.PRECEDINGSIBLING:h[0]=="self"?O.SELF:-1},this.reduceActions[57]=function(h){return O.ATTRIBUTE},this.reduceActions[59]=function(h){return h[0]=="comment"?B.commentTest:h[0]=="text"?B.textTest:h[0]=="processing-instruction"?B.anyPiTest:h[0]=="node"?B.nodeTest:new B(-1,void 0)},this.reduceActions[60]=function(h){return new B.PITest(h[2])},this.reduceActions[61]=function(h){return h[1]},this.reduceActions[63]=function(h){return h[1].absolute=!0,h[1].steps.unshift(new O(O.DESCENDANTORSELF,B.nodeTest,[])),h[1]},this.reduceActions[64]=function(h){return h[0].steps.push(new O(O.DESCENDANTORSELF,B.nodeTest,[])),h[0].steps.push(h[2]),h[0]},this.reduceActions[65]=function(h){return new O(O.SELF,B.nodeTest,[])},this.reduceActions[66]=function(h){return new O(O.PARENT,B.nodeTest,[])},this.reduceActions[67]=function(h){return new Q(h[1])},this.reduceActions[68]=function(h){return B.nameTestAny},this.reduceActions[69]=function(h){return new B.NameTestPrefixAny(h[0].split(":")[0])},this.reduceActions[70]=function(h){return new B.NameTestQName(h[0])}},y.actionTable=[" s s sssssssss s ss s ss"," s ","r rrrrrrrrr rrrrrrr rr r "," rrrrr "," s s sssssssss s ss s ss","rs rrrrrrrr s sssssrrrrrr rrs rs "," s s sssssssss s ss s ss"," s "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s "," s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr r ","a ","r s rr r ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrs rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r srrrrrrrr rrrrrrs rr sr ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrr rrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r "," sssss ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrr rrrrr rr r "," s "," s "," rrrrr "," s s sssssssss s sss s ss","r srrrrrrrr rrrrrrs rr r "," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss s ss s ss"," s s sssssssss ss s ss"," s s sssssssss s ss s ss"," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr rr "," s s sssss s s "," s s sssss s s ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr sr ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr "," s ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," rr "," s "," rs ","r sr rr r ","r s rr s rr r ","r rssrr rss rr r ","r rssrr rss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrr rrrss rr r ","r rrrrrsss rrrrr rr r ","r rrrrrsss rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrr rr r ","r rrrrrrrr rrrrrr rr r "," r "," s ","r srrrrrrrr rrrrrrs rr r ","r srrrrrrrr rrrrrrs rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr r ","r rrrrrrrrr rrrrrrr rr rr ","r rrrrrrrrr rrrrrrr rr rr "," s s sssssssss s ss s ss","r rrrrrrrrr rrrrrrr rr rr "," r "],y.actionTableNumber=[` 1 0 /.-,+*)(' & %$ # "!`," J ","a aaaaaaaaa aaaaaaa aa a "," YYYYY ",` 1 0 /.-,+*)(' & %$ # "!`,`K1 KKKKKKKK . +*)('KKKKKK KK# K" `,` 1 0 /.-,+*)(' & %$ # "!`," N "," O ","e eeeeeeeee eeeeeee ee ee ","f fffffffff fffffff ff ff ","d ddddddddd ddddddd dd dd ","B BBBBBBBBB BBBBBBB BB BB ","A AAAAAAAAA AAAAAAA AA AA "," P "," Q ",` 1 . +*)(' # " `,"b bbbbbbbbb bbbbbbb bb b "," ","! S !! ! ",'" T" "" " ',"$ V $$ U $$ $ ","& &ZY&& &XW && & ",") ))))) )))\\[ )) ) ",". ....._^] ..... .. . ","1 11111111 11111 11 1 ","5 55555555 55555` 55 5 ","7 77777777 777777 77 7 ","9 99999999 999999 99 9 ",": c:::::::: ::::::b :: a: ","I fIIIIIIII IIIIIIe II I ","= ========= ======= == == ","? ????????? ??????? ?? ?? ","C CCCCCCCCC CCCCCCC CC CC ","J JJJJJJJJ JJJJJJ JJ J ","M MMMMMMMM MMMMMM MM M ","N NNNNNNNNN NNNNNNN NN N ","P PPPPPPPPP PPPPPPP PP P "," +*)(' ","R RRRRRRRRR RRRRRRR RR aR ","U UUUUUUUUU UUUUUUU UU U ","Z ZZZZZZZZZ ZZZZZZZ ZZ ZZ ","c ccccccccc ccccccc cc cc "," j ","L fLLLLLLLL LLLLLLe LL L ","6 66666666 66666 66 6 "," k "," l "," XXXXX ",` 1 0 /.-,+*)(' & %$m # "!`,"_ f________ ______e __ _ ",` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 0 /.-,+*)(' %$ # "!`,` 1 0 /.-,+*)(' & %$ # "!`,` 1 . +*)(' # " `,` 1 . +*)(' # " `,"> >>>>>>>>> >>>>>>> >> >> ",` 1 . +*)(' # " `,` 1 . +*)(' # " `,"Q QQQQQQQQQ QQQQQQQ QQ aQ ","V VVVVVVVVV VVVVVVV VV aV ","T TTTTTTTTT TTTTTTT TT T ","@ @@@@@@@@@ @@@@@@@ @@ @@ "," \x87 ","[ [[[[[[[[[ [[[[[[[ [[ [[ ","D DDDDDDDDD DDDDDDD DD DD "," HH "," \x88 "," F\x89 ","# T# ## # ","% V %% U %% % ","' 'ZY'' 'XW '' ' ","( (ZY(( (XW (( ( ","+ +++++ +++\\[ ++ + ","* ***** ***\\[ ** * ","- ----- ---\\[ -- - ",", ,,,,, ,,,\\[ ,, , ","0 00000_^] 00000 00 0 ","/ /////_^] ///// // / ","2 22222222 22222 22 2 ","3 33333333 33333 33 3 ","4 44444444 44444 44 4 ","8 88888888 888888 88 8 "," ^ "," \x8A ","; f;;;;;;;; ;;;;;;e ;; ; ","< f<<<<<<<< <<<<<<e << < ","O OOOOOOOOO OOOOOOO OO O ","` ````````` ``````` `` ` ","S SSSSSSSSS SSSSSSS SS S ","W WWWWWWWWW WWWWWWW WW W ","\\ \\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\ \\\\ \\\\ ","E EEEEEEEEE EEEEEEE EE EE ",` 1 0 /.-,+*)(' & %$ # "!`,"] ]]]]]]]]] ]]]]]]] ]] ]] "," G "],y.gotoTable=["3456789:;<=>?@ AB CDEFGH IJ "," "," "," ","L456789:;<=>?@ AB CDEFGH IJ "," M EFGH IJ "," N;<=>?@ AB CDEFGH IJ "," "," "," "," "," "," "," "," "," "," S EFGH IJ "," "," "," "," "," "," "," "," "," "," "," "," "," e "," "," "," "," "," "," "," "," "," h J "," i j "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ ABpqCDEFGH IJ "," "," r6789:;<=>?@ AB CDEFGH IJ "," s789:;<=>?@ AB CDEFGH IJ "," t89:;<=>?@ AB CDEFGH IJ "," u89:;<=>?@ AB CDEFGH IJ "," v9:;<=>?@ AB CDEFGH IJ "," w9:;<=>?@ AB CDEFGH IJ "," x9:;<=>?@ AB CDEFGH IJ "," y9:;<=>?@ AB CDEFGH IJ "," z:;<=>?@ AB CDEFGH IJ "," {:;<=>?@ AB CDEFGH IJ "," |;<=>?@ AB CDEFGH IJ "," };<=>?@ AB CDEFGH IJ "," ~;<=>?@ AB CDEFGH IJ "," \x7F=>?@ AB CDEFGH IJ ","\x80456789:;<=>?@ AB CDEFGH IJ\x81"," \x82 EFGH IJ "," \x83 EFGH IJ "," "," \x84 GH IJ "," \x85 GH IJ "," i \x86 "," i \x87 "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","o456789:;<=>?@ AB\x8CqCDEFGH IJ "," "," "],y.productions=[[1,1,2],[2,1,3],[3,1,4],[3,3,3,-9,4],[4,1,5],[4,3,4,-8,5],[5,1,6],[5,3,5,-22,6],[5,3,5,-5,6],[6,1,7],[6,3,6,-23,7],[6,3,6,-24,7],[6,3,6,-6,7],[6,3,6,-7,7],[7,1,8],[7,3,7,-25,8],[7,3,7,-26,8],[8,1,9],[8,3,8,-12,9],[8,3,8,-11,9],[8,3,8,-10,9],[9,1,10],[9,2,-26,9],[10,1,11],[10,3,10,-27,11],[11,1,12],[11,1,13],[11,3,13,-28,14],[11,3,13,-4,14],[13,1,15],[13,2,13,16],[15,1,17],[15,3,-29,2,-30],[15,1,-15],[15,1,-16],[15,1,18],[18,3,-13,-29,-30],[18,4,-13,-29,19,-30],[19,1,20],[19,3,20,-31,19],[20,1,2],[12,1,14],[12,1,21],[21,1,-28],[21,2,-28,14],[21,1,22],[14,1,23],[14,3,14,-28,23],[14,1,24],[23,2,25,26],[23,1,26],[23,3,25,26,27],[23,2,26,27],[23,1,28],[27,1,16],[27,2,16,27],[25,2,-14,-3],[25,1,-32],[26,1,29],[26,3,-20,-29,-30],[26,4,-21,-29,-15,-30],[16,3,-33,30,-34],[30,1,2],[22,2,-4,14],[24,3,14,-4,23],[28,1,-35],[28,1,-2],[17,2,-36,-18],[29,1,-17],[29,1,-19],[29,1,-18]],y.DOUBLEDOT=2,y.DOUBLECOLON=3,y.DOUBLESLASH=4,y.NOTEQUAL=5,y.LESSTHANOREQUAL=6,y.GREATERTHANOREQUAL=7,y.AND=8,y.OR=9,y.MOD=10,y.DIV=11,y.MULTIPLYOPERATOR=12,y.FUNCTIONNAME=13,y.AXISNAME=14,y.LITERAL=15,y.NUMBER=16,y.ASTERISKNAMETEST=17,y.QNAME=18,y.NCNAMECOLONASTERISK=19,y.NODETYPE=20,y.PROCESSINGINSTRUCTIONWITHLITERAL=21,y.EQUALS=22,y.LESSTHAN=23,y.GREATERTHAN=24,y.PLUS=25,y.MINUS=26,y.BAR=27,y.SLASH=28,y.LEFTPARENTHESIS=29,y.RIGHTPARENTHESIS=30,y.COMMA=31,y.AT=32,y.LEFTBRACKET=33,y.RIGHTBRACKET=34,y.DOT=35,y.DOLLAR=36,y.prototype.tokenize=function(h){for(var x=[],j=[],Z=h+"\0",ne=0,q=Z.charAt(ne++);;){for(;q==" "||q==" "||q=="\r"||q==`
39
+ `;)q=Z.charAt(ne++);if(q=="\0"||ne>=Z.length)break;if(q=="("){x.push(y.LEFTPARENTHESIS),j.push(q),q=Z.charAt(ne++);continue}if(q==")"){x.push(y.RIGHTPARENTHESIS),j.push(q),q=Z.charAt(ne++);continue}if(q=="["){x.push(y.LEFTBRACKET),j.push(q),q=Z.charAt(ne++);continue}if(q=="]"){x.push(y.RIGHTBRACKET),j.push(q),q=Z.charAt(ne++);continue}if(q=="@"){x.push(y.AT),j.push(q),q=Z.charAt(ne++);continue}if(q==","){x.push(y.COMMA),j.push(q),q=Z.charAt(ne++);continue}if(q=="|"){x.push(y.BAR),j.push(q),q=Z.charAt(ne++);continue}if(q=="+"){x.push(y.PLUS),j.push(q),q=Z.charAt(ne++);continue}if(q=="-"){x.push(y.MINUS),j.push(q),q=Z.charAt(ne++);continue}if(q=="="){x.push(y.EQUALS),j.push(q),q=Z.charAt(ne++);continue}if(q=="$"){x.push(y.DOLLAR),j.push(q),q=Z.charAt(ne++);continue}if(q=="."){if(q=Z.charAt(ne++),q=="."){x.push(y.DOUBLEDOT),j.push(".."),q=Z.charAt(ne++);continue}if(q>="0"&&q<="9"){var Xe="."+q;for(q=Z.charAt(ne++);q>="0"&&q<="9";)Xe+=q,q=Z.charAt(ne++);x.push(y.NUMBER),j.push(Xe);continue}x.push(y.DOT),j.push(".");continue}if(q=="'"||q=='"'){for(var wt=q,_t="";ne<Z.length&&(q=Z.charAt(ne))!==wt;)_t+=q,ne+=1;if(q!==wt)throw os.fromMessage("Unterminated string literal: "+wt+_t);ne+=1,x.push(y.LITERAL),j.push(_t),q=Z.charAt(ne++);continue}if(q>="0"&&q<="9"){var Xe=q;for(q=Z.charAt(ne++);q>="0"&&q<="9";)Xe+=q,q=Z.charAt(ne++);if(q=="."&&Z.charAt(ne)>="0"&&Z.charAt(ne)<="9")for(Xe+=q,Xe+=Z.charAt(ne++),q=Z.charAt(ne++);q>="0"&&q<="9";)Xe+=q,q=Z.charAt(ne++);x.push(y.NUMBER),j.push(Xe);continue}if(q=="*"){if(x.length>0){var He=x[x.length-1];if(He!=y.AT&&He!=y.DOUBLECOLON&&He!=y.LEFTPARENTHESIS&&He!=y.LEFTBRACKET&&He!=y.AND&&He!=y.OR&&He!=y.MOD&&He!=y.DIV&&He!=y.MULTIPLYOPERATOR&&He!=y.SLASH&&He!=y.DOUBLESLASH&&He!=y.BAR&&He!=y.PLUS&&He!=y.MINUS&&He!=y.EQUALS&&He!=y.NOTEQUAL&&He!=y.LESSTHAN&&He!=y.LESSTHANOREQUAL&&He!=y.GREATERTHAN&&He!=y.GREATERTHANOREQUAL){x.push(y.MULTIPLYOPERATOR),j.push(q),q=Z.charAt(ne++);continue}}x.push(y.ASTERISKNAMETEST),j.push(q),q=Z.charAt(ne++);continue}if(q==":"&&Z.charAt(ne)==":"){x.push(y.DOUBLECOLON),j.push("::"),ne++,q=Z.charAt(ne++);continue}if(q=="/"){if(q=Z.charAt(ne++),q=="/"){x.push(y.DOUBLESLASH),j.push("//"),q=Z.charAt(ne++);continue}x.push(y.SLASH),j.push("/");continue}if(q=="!"&&Z.charAt(ne)=="="){x.push(y.NOTEQUAL),j.push("!="),ne++,q=Z.charAt(ne++);continue}if(q=="<"){if(Z.charAt(ne)=="="){x.push(y.LESSTHANOREQUAL),j.push("<="),ne++,q=Z.charAt(ne++);continue}x.push(y.LESSTHAN),j.push("<"),q=Z.charAt(ne++);continue}if(q==">"){if(Z.charAt(ne)=="="){x.push(y.GREATERTHANOREQUAL),j.push(">="),ne++,q=Z.charAt(ne++);continue}x.push(y.GREATERTHAN),j.push(">"),q=Z.charAt(ne++);continue}if(q=="_"||qe.isLetter(q.charCodeAt(0))){var dt=q;for(q=Z.charAt(ne++);qe.isNCNameChar(q.charCodeAt(0));)dt+=q,q=Z.charAt(ne++);if(x.length>0){var He=x[x.length-1];if(He!=y.AT&&He!=y.DOUBLECOLON&&He!=y.LEFTPARENTHESIS&&He!=y.LEFTBRACKET&&He!=y.AND&&He!=y.OR&&He!=y.MOD&&He!=y.DIV&&He!=y.MULTIPLYOPERATOR&&He!=y.SLASH&&He!=y.DOUBLESLASH&&He!=y.BAR&&He!=y.PLUS&&He!=y.MINUS&&He!=y.EQUALS&&He!=y.NOTEQUAL&&He!=y.LESSTHAN&&He!=y.LESSTHANOREQUAL&&He!=y.GREATERTHAN&&He!=y.GREATERTHANOREQUAL){if(dt=="and"){x.push(y.AND),j.push(dt);continue}if(dt=="or"){x.push(y.OR),j.push(dt);continue}if(dt=="mod"){x.push(y.MOD),j.push(dt);continue}if(dt=="div"){x.push(y.DIV),j.push(dt);continue}}}if(q==":"){if(Z.charAt(ne)=="*"){x.push(y.NCNAMECOLONASTERISK),j.push(dt+":*"),ne++,q=Z.charAt(ne++);continue}if(Z.charAt(ne)=="_"||qe.isLetter(Z.charCodeAt(ne))){for(dt+=":",q=Z.charAt(ne++);qe.isNCNameChar(q.charCodeAt(0));)dt+=q,q=Z.charAt(ne++);if(q=="("){x.push(y.FUNCTIONNAME),j.push(dt);continue}x.push(y.QNAME),j.push(dt);continue}if(Z.charAt(ne)==":"){x.push(y.AXISNAME),j.push(dt);continue}}if(q=="("){if(dt=="comment"||dt=="text"||dt=="node"){x.push(y.NODETYPE),j.push(dt);continue}if(dt=="processing-instruction"){Z.charAt(ne)==")"?x.push(y.NODETYPE):x.push(y.PROCESSINGINSTRUCTIONWITHLITERAL),j.push(dt);continue}x.push(y.FUNCTIONNAME),j.push(dt);continue}x.push(y.QNAME),j.push(dt);continue}throw new Error("Unexpected character "+q)}return x.push(1),j.push("[EOF]"),[x,j]},y.SHIFT="s",y.REDUCE="r",y.ACCEPT="a",y.prototype.parse=function(_t){var x,j,Z=this.tokenize(_t);if(Z!=null){x=Z[0],j=Z[1];var ne=0,q=[],Xe=[],wt=[],_t,He,dt;for(q.push(0),Xe.push(1),wt.push("_S"),He=x[ne],dt=j[ne++];;)switch(_t=q[q.length-1],y.actionTable[_t].charAt(He-1)){case y.SHIFT:Xe.push(-He),wt.push(dt),q.push(y.actionTableNumber[_t].charCodeAt(He-1)-32),He=x[ne],dt=j[ne++];break;case y.REDUCE:for(var Rn=y.productions[y.actionTableNumber[_t].charCodeAt(He-1)-32][1],di=[],Yt=0;Yt<Rn;Yt++)Xe.pop(),di.unshift(wt.pop()),q.pop();var Qa=q[q.length-1];Xe.push(y.productions[y.actionTableNumber[_t].charCodeAt(He-1)-32][0]),this.reduceActions[y.actionTableNumber[_t].charCodeAt(He-1)-32]==null?wt.push(di[0]):wt.push(this.reduceActions[y.actionTableNumber[_t].charCodeAt(He-1)-32](di)),q.push(y.gotoTable[Qa].charCodeAt(y.productions[y.actionTableNumber[_t].charCodeAt(He-1)-32][0]-2)-33);break;case y.ACCEPT:return new S(wt.pop());default:throw new Error("XPath parse error")}}},S.prototype=new Object,S.prototype.constructor=S,S.superclass=Object.prototype;function S(h){this.expression=h}u(S,"XPath"),S.prototype.toString=function(){return this.expression.toString()};function C(h,x,j){x in h||(h[x]=j)}u(C,"setIfUnset"),S.prototype.evaluate=function(h){return h.contextNode=h.expressionContextNode,h.contextSize=1,h.contextPosition=1,h.isHtml&&(C(h,"caseInsensitive",!0),C(h,"allowAnyNamespaceForNoPrefix",!0)),C(h,"caseInsensitive",!1),this.expression.evaluate(h)},S.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",S.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",w.prototype=new Object,w.prototype.constructor=w,w.superclass=Object.prototype;function w(){}u(w,"Expression"),w.prototype.init=function(){},w.prototype.toString=function(){return"<Expression>"},w.prototype.evaluate=function(h){throw new Error("Could not evaluate expression.")},E.prototype=new w,E.prototype.constructor=E,E.superclass=w.prototype;function E(h){arguments.length>0&&this.init(h)}u(E,"UnaryOperation"),E.prototype.init=function(h){this.rhs=h},A.prototype=new E,A.prototype.constructor=A,A.superclass=E.prototype;function A(h){arguments.length>0&&this.init(h)}u(A,"UnaryMinusOperation"),A.prototype.init=function(h){A.superclass.init.call(this,h)},A.prototype.evaluate=function(h){return this.rhs.evaluate(h).number().negate()},A.prototype.toString=function(){return"-"+this.rhs.toString()},b.prototype=new w,b.prototype.constructor=b,b.superclass=w.prototype;function b(h,x){arguments.length>0&&this.init(h,x)}u(b,"BinaryOperation"),b.prototype.init=function(h,x){this.lhs=h,this.rhs=x},V.prototype=new b,V.prototype.constructor=V,V.superclass=b.prototype;function V(h,x){arguments.length>0&&this.init(h,x)}u(V,"OrOperation"),V.prototype.init=function(h,x){V.superclass.init.call(this,h,x)},V.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},V.prototype.evaluate=function(h){var x=this.lhs.evaluate(h).bool();return x.booleanValue()?x:this.rhs.evaluate(h).bool()},I.prototype=new b,I.prototype.constructor=I,I.superclass=b.prototype;function I(h,x){arguments.length>0&&this.init(h,x)}u(I,"AndOperation"),I.prototype.init=function(h,x){I.superclass.init.call(this,h,x)},I.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},I.prototype.evaluate=function(h){var x=this.lhs.evaluate(h).bool();return x.booleanValue()?this.rhs.evaluate(h).bool():x},D.prototype=new b,D.prototype.constructor=D,D.superclass=b.prototype;function D(h,x){arguments.length>0&&this.init(h,x)}u(D,"EqualsOperation"),D.prototype.init=function(h,x){D.superclass.init.call(this,h,x)},D.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},D.prototype.evaluate=function(h){return this.lhs.evaluate(h).equals(this.rhs.evaluate(h))},U.prototype=new b,U.prototype.constructor=U,U.superclass=b.prototype;function U(h,x){arguments.length>0&&this.init(h,x)}u(U,"NotEqualOperation"),U.prototype.init=function(h,x){U.superclass.init.call(this,h,x)},U.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},U.prototype.evaluate=function(h){return this.lhs.evaluate(h).notequal(this.rhs.evaluate(h))},F.prototype=new b,F.prototype.constructor=F,F.superclass=b.prototype;function F(h,x){arguments.length>0&&this.init(h,x)}u(F,"LessThanOperation"),F.prototype.init=function(h,x){F.superclass.init.call(this,h,x)},F.prototype.evaluate=function(h){return this.lhs.evaluate(h).lessthan(this.rhs.evaluate(h))},F.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},M.prototype=new b,M.prototype.constructor=M,M.superclass=b.prototype;function M(h,x){arguments.length>0&&this.init(h,x)}u(M,"GreaterThanOperation"),M.prototype.init=function(h,x){M.superclass.init.call(this,h,x)},M.prototype.evaluate=function(h){return this.lhs.evaluate(h).greaterthan(this.rhs.evaluate(h))},M.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},se.prototype=new b,se.prototype.constructor=se,se.superclass=b.prototype;function se(h,x){arguments.length>0&&this.init(h,x)}u(se,"LessThanOrEqualOperation"),se.prototype.init=function(h,x){se.superclass.init.call(this,h,x)},se.prototype.evaluate=function(h){return this.lhs.evaluate(h).lessthanorequal(this.rhs.evaluate(h))},se.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},ee.prototype=new b,ee.prototype.constructor=ee,ee.superclass=b.prototype;function ee(h,x){arguments.length>0&&this.init(h,x)}u(ee,"GreaterThanOrEqualOperation"),ee.prototype.init=function(h,x){ee.superclass.init.call(this,h,x)},ee.prototype.evaluate=function(h){return this.lhs.evaluate(h).greaterthanorequal(this.rhs.evaluate(h))},ee.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},ie.prototype=new b,ie.prototype.constructor=ie,ie.superclass=b.prototype;function ie(h,x){arguments.length>0&&this.init(h,x)}u(ie,"PlusOperation"),ie.prototype.init=function(h,x){ie.superclass.init.call(this,h,x)},ie.prototype.evaluate=function(h){return this.lhs.evaluate(h).number().plus(this.rhs.evaluate(h).number())},ie.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},X.prototype=new b,X.prototype.constructor=X,X.superclass=b.prototype;function X(h,x){arguments.length>0&&this.init(h,x)}u(X,"MinusOperation"),X.prototype.init=function(h,x){X.superclass.init.call(this,h,x)},X.prototype.evaluate=function(h){return this.lhs.evaluate(h).number().minus(this.rhs.evaluate(h).number())},X.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},he.prototype=new b,he.prototype.constructor=he,he.superclass=b.prototype;function he(h,x){arguments.length>0&&this.init(h,x)}u(he,"MultiplyOperation"),he.prototype.init=function(h,x){he.superclass.init.call(this,h,x)},he.prototype.evaluate=function(h){return this.lhs.evaluate(h).number().multiply(this.rhs.evaluate(h).number())},he.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},Ce.prototype=new b,Ce.prototype.constructor=Ce,Ce.superclass=b.prototype;function Ce(h,x){arguments.length>0&&this.init(h,x)}u(Ce,"DivOperation"),Ce.prototype.init=function(h,x){Ce.superclass.init.call(this,h,x)},Ce.prototype.evaluate=function(h){return this.lhs.evaluate(h).number().div(this.rhs.evaluate(h).number())},Ce.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},xe.prototype=new b,xe.prototype.constructor=xe,xe.superclass=b.prototype;function xe(h,x){arguments.length>0&&this.init(h,x)}u(xe,"ModOperation"),xe.prototype.init=function(h,x){xe.superclass.init.call(this,h,x)},xe.prototype.evaluate=function(h){return this.lhs.evaluate(h).number().mod(this.rhs.evaluate(h).number())},xe.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},pe.prototype=new b,pe.prototype.constructor=pe,pe.superclass=b.prototype;function pe(h,x){arguments.length>0&&this.init(h,x)}u(pe,"BarOperation"),pe.prototype.init=function(h,x){pe.superclass.init.call(this,h,x)},pe.prototype.evaluate=function(h){return this.lhs.evaluate(h).nodeset().union(this.rhs.evaluate(h).nodeset())},pe.prototype.toString=function(){return s(l,[this.lhs,this.rhs]).join(" | ")},W.prototype=new w,W.prototype.constructor=W,W.superclass=w.prototype;function W(h,x,j){arguments.length>0&&this.init(h,x,j)}u(W,"PathExpr"),W.prototype.init=function(h,x,j){W.superclass.init.call(this),this.filter=h,this.filterPredicates=x,this.locationPath=j};function fe(h){for(;h&&h.parentNode;)h=h.parentNode;return h}u(fe,"findRoot"),W.applyPredicates=function(h,x,j){if(h.length===0)return j;var Z=x.extend({});return n(function(ne,q){return Z.contextSize=ne.length,i(function(Xe,wt){return Z.contextNode=Xe,Z.contextPosition=wt+1,W.predicateMatches(q,Z)},ne)},j,h)},W.getRoot=function(h,x){var j=x[0];if(j.nodeType===v.DOCUMENT_NODE)return j;if(h.virtualRoot)return h.virtualRoot;var Z=j.ownerDocument;if(Z)return Z;for(var ne=j;ne.parentNode!=null;)ne=ne.parentNode;return ne},W.applyStep=function(h,x,j){var Z=this,ne=[];switch(x.contextNode=j,h.axis){case O.ANCESTOR:if(x.contextNode===x.virtualRoot)break;var q;for(x.contextNode.nodeType==v.ATTRIBUTE_NODE?q=W.getOwnerElement(x.contextNode):q=x.contextNode.parentNode;q!=null&&(h.nodeTest.matches(q,x)&&ne.push(q),q!==x.virtualRoot);)q=q.parentNode;break;case O.ANCESTORORSELF:for(var q=x.contextNode;q!=null&&(h.nodeTest.matches(q,x)&&ne.push(q),q!==x.virtualRoot);q=q.nodeType==v.ATTRIBUTE_NODE?W.getOwnerElement(q):q.parentNode);break;case O.ATTRIBUTE:var Xe=x.contextNode.attributes;if(Xe!=null)for(var wt=0;wt<Xe.length;wt++){var q=Xe.item(wt);h.nodeTest.matches(q,x)&&ne.push(q)}break;case O.CHILD:for(var q=x.contextNode.firstChild;q!=null;q=q.nextSibling)h.nodeTest.matches(q,x)&&ne.push(q);break;case O.DESCENDANT:for(var Yt=[x.contextNode.firstChild];Yt.length>0;)for(var q=Yt.pop();q!=null;)h.nodeTest.matches(q,x)&&ne.push(q),q.firstChild!=null?(Yt.push(q.nextSibling),q=q.firstChild):q=q.nextSibling;break;case O.DESCENDANTORSELF:h.nodeTest.matches(x.contextNode,x)&&ne.push(x.contextNode);for(var Yt=[x.contextNode.firstChild];Yt.length>0;)for(var q=Yt.pop();q!=null;)h.nodeTest.matches(q,x)&&ne.push(q),q.firstChild!=null?(Yt.push(q.nextSibling),q=q.firstChild):q=q.nextSibling;break;case O.FOLLOWING:if(x.contextNode===x.virtualRoot)break;var Yt=[];x.contextNode.firstChild!=null?Yt.unshift(x.contextNode.firstChild):Yt.unshift(x.contextNode.nextSibling);for(var q=x.contextNode.parentNode;q!=null&&q.nodeType!=v.DOCUMENT_NODE&&q!==x.virtualRoot;q=q.parentNode)Yt.unshift(q.nextSibling);do for(var q=Yt.pop();q!=null;)h.nodeTest.matches(q,x)&&ne.push(q),q.firstChild!=null?(Yt.push(q.nextSibling),q=q.firstChild):q=q.nextSibling;while(Yt.length>0);break;case O.FOLLOWINGSIBLING:if(x.contextNode===x.virtualRoot)break;for(var q=x.contextNode.nextSibling;q!=null;q=q.nextSibling)h.nodeTest.matches(q,x)&&ne.push(q);break;case O.NAMESPACE:var _t={};if(x.contextNode.nodeType==v.ELEMENT_NODE){_t.xml=S.XML_NAMESPACE_URI,_t.xmlns=S.XMLNS_NAMESPACE_URI;for(var q=x.contextNode;q!=null&&q.nodeType==v.ELEMENT_NODE;q=q.parentNode)for(var wt=0;wt<q.attributes.length;wt++){var He=q.attributes.item(wt),dt=String(He.name);if(dt=="xmlns")_t[""]==null&&(_t[""]=He.value);else if(dt.length>6&&dt.substring(0,6)=="xmlns:"){var Rn=dt.substring(6,dt.length);_t[Rn]==null&&(_t[Rn]=He.value)}}for(var Rn in _t){var di=new ar(Rn,_t[Rn],x.contextNode);h.nodeTest.matches(di,x)&&ne.push(di)}}break;case O.PARENT:q=null,x.contextNode!==x.virtualRoot&&(x.contextNode.nodeType==v.ATTRIBUTE_NODE?q=W.getOwnerElement(x.contextNode):q=x.contextNode.parentNode),q!=null&&h.nodeTest.matches(q,x)&&ne.push(q);break;case O.PRECEDING:var Yt;x.virtualRoot!=null?Yt=[x.virtualRoot]:Yt=[fe(x.contextNode)];e:for(;Yt.length>0;)for(var q=Yt.pop();q!=null;){if(q==x.contextNode)break e;h.nodeTest.matches(q,x)&&ne.unshift(q),q.firstChild!=null?(Yt.push(q.nextSibling),q=q.firstChild):q=q.nextSibling}break;case O.PRECEDINGSIBLING:if(x.contextNode===x.virtualRoot)break;for(var q=x.contextNode.previousSibling;q!=null;q=q.previousSibling)h.nodeTest.matches(q,x)&&ne.push(q);break;case O.SELF:h.nodeTest.matches(x.contextNode,x)&&ne.push(x.contextNode);break;default:}return ne};function Ie(h,x,j){return W.applyPredicates(h.predicates,x,W.applyStep(h,x,j))}u(Ie,"applyStepWithPredicates");function Ve(h,x,j){return g(s(Ie.bind(null,j,h),x))}u(Ve,"applyStepToNodes"),W.applySteps=function(h,x,j){return n(Ve.bind(null,x),j,h)},W.prototype.applyFilter=function(h,x){if(!this.filter)return{nodes:[h.contextNode]};var j=this.filter.evaluate(h);if(!qe.instance_of(j,Be)){if(this.filterPredicates!=null&&this.filterPredicates.length>0||this.locationPath!=null)throw new Error("Path expression filter must evaluate to a nodeset if predicates or location path are used");return{nonNodes:j}}return{nodes:W.applyPredicates(this.filterPredicates||[],x,j.toUnsortedArray())}},W.applyLocationPath=function(h,x,j){if(!h)return j;var Z=h.absolute?[W.getRoot(x,j)]:j;return W.applySteps(h.steps,x,Z)},W.prototype.evaluate=function(h){var x=m(new Er,h),j=this.applyFilter(h,x);if("nonNodes"in j)return j.nonNodes;var Z=new Be;return Z.addArray(W.applyLocationPath(this.locationPath,x,j.nodes)),Z},W.predicateMatches=function(h,x){var j=h.evaluate(x);return qe.instance_of(j,N)?x.contextPosition===j.numberValue():j.booleanValue()},W.predicateString=function(h){return f("[","]",h.toString())},W.predicatesString=function(h){return c("",s(W.predicateString,h))},W.prototype.toString=function(){if(this.filter!=null){var h=l(this.filter);return qe.instance_of(this.filter,R)?f("'","'",h):this.filterPredicates!=null&&this.filterPredicates.length?f("(",")",h)+W.predicatesString(this.filterPredicates):this.locationPath!=null?h+(this.locationPath.absolute?"":"/")+l(this.locationPath):h}return l(this.locationPath)},W.getOwnerElement=function(h){if(h.ownerElement)return h.ownerElement;try{if(h.selectSingleNode)return h.selectSingleNode("..")}catch{}for(var x=h.nodeType==v.DOCUMENT_NODE?h:h.ownerDocument,j=x.getElementsByTagName("*"),Z=0;Z<j.length;Z++)for(var ne=j.item(Z),q=ne.attributes,Xe=0;Xe<q.length;Xe++){var wt=q.item(Xe);if(wt===h)return ne}return null},Le.prototype=new Object,Le.prototype.constructor=Le,Le.superclass=Object.prototype;function Le(h,x){arguments.length>0&&this.init(h,x)}u(Le,"LocationPath"),Le.prototype.init=function(h,x){this.absolute=h,this.steps=x},Le.prototype.toString=function(){return(this.absolute?"/":"")+s(l,this.steps).join("/")},O.prototype=new Object,O.prototype.constructor=O,O.superclass=Object.prototype;function O(h,x,j){arguments.length>0&&this.init(h,x,j)}u(O,"Step"),O.prototype.init=function(h,x,j){this.axis=h,this.nodeTest=x,this.predicates=j},O.prototype.toString=function(){return O.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+W.predicatesString(this.predicates)},O.ANCESTOR=0,O.ANCESTORORSELF=1,O.ATTRIBUTE=2,O.CHILD=3,O.DESCENDANT=4,O.DESCENDANTORSELF=5,O.FOLLOWING=6,O.FOLLOWINGSIBLING=7,O.NAMESPACE=8,O.PARENT=9,O.PRECEDING=10,O.PRECEDINGSIBLING=11,O.SELF=12,O.STEPNAMES=n(function(h,x){return h[x[0]]=x[1],h},{},[[O.ANCESTOR,"ancestor"],[O.ANCESTORORSELF,"ancestor-or-self"],[O.ATTRIBUTE,"attribute"],[O.CHILD,"child"],[O.DESCENDANT,"descendant"],[O.DESCENDANTORSELF,"descendant-or-self"],[O.FOLLOWING,"following"],[O.FOLLOWINGSIBLING,"following-sibling"],[O.NAMESPACE,"namespace"],[O.PARENT,"parent"],[O.PRECEDING,"preceding"],[O.PRECEDINGSIBLING,"preceding-sibling"],[O.SELF,"self"]]),B.prototype=new Object,B.prototype.constructor=B,B.superclass=Object.prototype;function B(h,x){arguments.length>0&&this.init(h,x)}u(B,"NodeTest"),B.prototype.init=function(h,x){this.type=h,this.value=x},B.prototype.toString=function(){return"<unknown nodetest type>"},B.prototype.matches=function(h,x){console.warn("unknown node test type")},B.NAMETESTANY=0,B.NAMETESTPREFIXANY=1,B.NAMETESTQNAME=2,B.COMMENT=3,B.TEXT=4,B.PI=5,B.NODE=6,B.isNodeType=function(h){return function(x){return a(h,x.nodeType)}},B.makeNodeTestType=function(h,x,j){var Z=j||function(){};return Z.prototype=new B(h),Z.prototype.constructor=Z,m(Z.prototype,x),Z},B.makeNodeTypeTest=function(h,x,j){return new(B.makeNodeTestType(h,{matches:B.isNodeType(x),toString:o(j)}))},B.hasPrefix=function(h){return h.prefix||(h.nodeName||h.tagName).indexOf(":")!==-1},B.isElementOrAttribute=B.isNodeType([1,2]),B.nameSpaceMatches=function(h,x,j){var Z=j.namespaceURI||"";if(!h)return!Z||x.allowAnyNamespaceForNoPrefix&&!B.hasPrefix(j);var ne=x.namespaceResolver.getNamespace(h,x.expressionContextNode);if(ne==null)throw new Error("Cannot resolve QName "+h);return ne===Z},B.localNameMatches=function(h,x,j){var Z=j.localName||j.nodeName;return x.caseInsensitive?h.toLowerCase()===Z.toLowerCase():h===Z},B.NameTestPrefixAny=B.makeNodeTestType(B.NAMETESTPREFIXANY,{matches:u(function(h,x){return B.isElementOrAttribute(h)&&B.nameSpaceMatches(this.prefix,x,h)},"matches"),toString:u(function(){return this.prefix+":*"},"toString")},u(function(x){this.prefix=x},"NameTestPrefixAny")),B.NameTestQName=B.makeNodeTestType(B.NAMETESTQNAME,{matches:u(function(h,x){return B.isNodeType([v.ELEMENT_NODE,v.ATTRIBUTE_NODE,ar.XPATH_NAMESPACE_NODE])(h)&&B.nameSpaceMatches(this.prefix,x,h)&&B.localNameMatches(this.localName,x,h)},"matches"),toString:u(function(){return this.name},"toString")},u(function(x){var j=x.split(":");this.name=x,this.prefix=j.length>1?j[0]:null,this.localName=j[j.length>1?1:0]},"NameTestQName")),B.PITest=B.makeNodeTestType(B.PI,{matches:u(function(h,x){return B.isNodeType([v.PROCESSING_INSTRUCTION_NODE])(h)&&(h.target||h.nodeName)===this.name},"matches"),toString:u(function(){return f('processing-instruction("','")',this.name)},"toString")},function(h){this.name=h}),B.nameTestAny=B.makeNodeTypeTest(B.NAMETESTANY,[v.ELEMENT_NODE,v.ATTRIBUTE_NODE,ar.XPATH_NAMESPACE_NODE],"*"),B.textTest=B.makeNodeTypeTest(B.TEXT,[v.TEXT_NODE,v.CDATA_SECTION_NODE],"text()"),B.commentTest=B.makeNodeTypeTest(B.COMMENT,[v.COMMENT_NODE],"comment()"),B.nodeTest=B.makeNodeTypeTest(B.NODE,[v.ELEMENT_NODE,v.ATTRIBUTE_NODE,v.TEXT_NODE,v.CDATA_SECTION_NODE,v.PROCESSING_INSTRUCTION_NODE,v.COMMENT_NODE,v.DOCUMENT_NODE],"node()"),B.anyPiTest=B.makeNodeTypeTest(B.PI,[v.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),Q.prototype=new w,Q.prototype.constructor=Q,Q.superclass=w.prototype;function Q(h){arguments.length>0&&this.init(h)}u(Q,"VariableReference"),Q.prototype.init=function(h){this.variable=h},Q.prototype.toString=function(){return"$"+this.variable},Q.prototype.evaluate=function(h){var x=qe.resolveQName(this.variable,h.namespaceResolver,h.contextNode,!1);if(x[0]==null)throw new Error("Cannot resolve QName "+fn);var j=h.variableResolver.getVariable(x[1],x[0]);if(!j)throw os.fromMessage("Undeclared variable: "+this.toString());return j},K.prototype=new w,K.prototype.constructor=K,K.superclass=w.prototype;function K(h,x){arguments.length>0&&this.init(h,x)}u(K,"FunctionCall"),K.prototype.init=function(h,x){this.functionName=h,this.arguments=x},K.prototype.toString=function(){for(var h=this.functionName+"(",x=0;x<this.arguments.length;x++)x>0&&(h+=", "),h+=this.arguments[x].toString();return h+")"},K.prototype.evaluate=function(h){var x=Ir.getFunctionFromContext(this.functionName,h);if(!x)throw new Error("Unknown function "+this.functionName);var j=[h].concat(this.arguments);return x.apply(h.functionResolver.thisArg,j)};var _e=new Object;_e.equals=function(h,x){return h.equals(x)},_e.notequal=function(h,x){return h.notequal(x)},_e.lessthan=function(h,x){return h.lessthan(x)},_e.greaterthan=function(h,x){return h.greaterthan(x)},_e.lessthanorequal=function(h,x){return h.lessthanorequal(x)},_e.greaterthanorequal=function(h,x){return h.greaterthanorequal(x)},R.prototype=new w,R.prototype.constructor=R,R.superclass=w.prototype;function R(h){arguments.length>0&&this.init(h)}u(R,"XString"),R.prototype.init=function(h){this.str=String(h)},R.prototype.toString=function(){return this.str},R.prototype.evaluate=function(h){return this},R.prototype.string=function(){return this},R.prototype.number=function(){return new N(this.str)},R.prototype.bool=function(){return new ge(this.str)},R.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},R.prototype.stringValue=function(){return this.str},R.prototype.numberValue=function(){return this.number().numberValue()},R.prototype.booleanValue=function(){return this.bool().booleanValue()},R.prototype.equals=function(h){return qe.instance_of(h,ge)?this.bool().equals(h):qe.instance_of(h,N)?this.number().equals(h):qe.instance_of(h,Be)?h.compareWithString(this,_e.equals):new ge(this.str==h.str)},R.prototype.notequal=function(h){return qe.instance_of(h,ge)?this.bool().notequal(h):qe.instance_of(h,N)?this.number().notequal(h):qe.instance_of(h,Be)?h.compareWithString(this,_e.notequal):new ge(this.str!=h.str)},R.prototype.lessthan=function(h){return this.number().lessthan(h)},R.prototype.greaterthan=function(h){return this.number().greaterthan(h)},R.prototype.lessthanorequal=function(h){return this.number().lessthanorequal(h)},R.prototype.greaterthanorequal=function(h){return this.number().greaterthanorequal(h)},N.prototype=new w,N.prototype.constructor=N,N.superclass=w.prototype;function N(h){arguments.length>0&&this.init(h)}u(N,"XNumber"),N.prototype.init=function(h){this.num=typeof h=="string"?this.parse(h):Number(h)},N.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/,N.prototype.parse=function(h){return this.numberFormat.test(h)?parseFloat(h):Number.NaN};function J(h){for(var x=h.split("e-"),j=x[0].replace(".",""),Z=Number(x[1]),ne=0;ne<Z-1;ne+=1)j="0"+j;return"0."+j}u(J,"padSmallNumber");function $(h){for(var x=h.split("e"),j=x[0].replace(".",""),Z=Number(x[1]),ne=Z+1-j.length,q=0;q<ne;q+=1)j+="0";return j}u($,"padLargeNumber"),N.prototype.toString=function(){var h=this.num.toString();return h.indexOf("e-")!==-1?J(h):h.indexOf("e")!==-1?$(h):h},N.prototype.evaluate=function(h){return this},N.prototype.string=function(){return new R(this.toString())},N.prototype.number=function(){return this},N.prototype.bool=function(){return new ge(this.num)},N.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},N.prototype.stringValue=function(){return this.string().stringValue()},N.prototype.numberValue=function(){return this.num},N.prototype.booleanValue=function(){return this.bool().booleanValue()},N.prototype.negate=function(){return new N(-this.num)},N.prototype.equals=function(h){return qe.instance_of(h,ge)?this.bool().equals(h):qe.instance_of(h,R)?this.equals(h.number()):qe.instance_of(h,Be)?h.compareWithNumber(this,_e.equals):new ge(this.num==h.num)},N.prototype.notequal=function(h){return qe.instance_of(h,ge)?this.bool().notequal(h):qe.instance_of(h,R)?this.notequal(h.number()):qe.instance_of(h,Be)?h.compareWithNumber(this,_e.notequal):new ge(this.num!=h.num)},N.prototype.lessthan=function(h){return qe.instance_of(h,Be)?h.compareWithNumber(this,_e.greaterthan):qe.instance_of(h,ge)||qe.instance_of(h,R)?this.lessthan(h.number()):new ge(this.num<h.num)},N.prototype.greaterthan=function(h){return qe.instance_of(h,Be)?h.compareWithNumber(this,_e.lessthan):qe.instance_of(h,ge)||qe.instance_of(h,R)?this.greaterthan(h.number()):new ge(this.num>h.num)},N.prototype.lessthanorequal=function(h){return qe.instance_of(h,Be)?h.compareWithNumber(this,_e.greaterthanorequal):qe.instance_of(h,ge)||qe.instance_of(h,R)?this.lessthanorequal(h.number()):new ge(this.num<=h.num)},N.prototype.greaterthanorequal=function(h){return qe.instance_of(h,Be)?h.compareWithNumber(this,_e.lessthanorequal):qe.instance_of(h,ge)||qe.instance_of(h,R)?this.greaterthanorequal(h.number()):new ge(this.num>=h.num)},N.prototype.plus=function(h){return new N(this.num+h.num)},N.prototype.minus=function(h){return new N(this.num-h.num)},N.prototype.multiply=function(h){return new N(this.num*h.num)},N.prototype.div=function(h){return new N(this.num/h.num)},N.prototype.mod=function(h){return new N(this.num%h.num)},ge.prototype=new w,ge.prototype.constructor=ge,ge.superclass=w.prototype;function ge(h){arguments.length>0&&this.init(h)}u(ge,"XBoolean"),ge.prototype.init=function(h){this.b=!!h},ge.prototype.toString=function(){return this.b.toString()},ge.prototype.evaluate=function(h){return this},ge.prototype.string=function(){return new R(this.b)},ge.prototype.number=function(){return new N(this.b)},ge.prototype.bool=function(){return this},ge.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},ge.prototype.stringValue=function(){return this.string().stringValue()},ge.prototype.numberValue=function(){return this.number().numberValue()},ge.prototype.booleanValue=function(){return this.b},ge.prototype.not=function(){return new ge(!this.b)},ge.prototype.equals=function(h){return qe.instance_of(h,R)||qe.instance_of(h,N)?this.equals(h.bool()):qe.instance_of(h,Be)?h.compareWithBoolean(this,_e.equals):new ge(this.b==h.b)},ge.prototype.notequal=function(h){return qe.instance_of(h,R)||qe.instance_of(h,N)?this.notequal(h.bool()):qe.instance_of(h,Be)?h.compareWithBoolean(this,_e.notequal):new ge(this.b!=h.b)},ge.prototype.lessthan=function(h){return this.number().lessthan(h)},ge.prototype.greaterthan=function(h){return this.number().greaterthan(h)},ge.prototype.lessthanorequal=function(h){return this.number().lessthanorequal(h)},ge.prototype.greaterthanorequal=function(h){return this.number().greaterthanorequal(h)},ge.true_=new ge(!0),ge.false_=new ge(!1),et.prototype=new Object,et.prototype.constructor=et,et.superclass=Object.prototype;function et(h){this.init(h)}u(et,"AVLTree"),et.prototype.init=function(h){this.left=null,this.right=null,this.node=h,this.depth=1},et.prototype.balance=function(){var h=this.left==null?0:this.left.depth,x=this.right==null?0:this.right.depth;if(h>x+1){var j=this.left.left==null?0:this.left.left.depth,Z=this.left.right==null?0:this.left.right.depth;j<Z&&this.left.rotateRR(),this.rotateLL()}else if(h+1<x){var ne=this.right.right==null?0:this.right.right.depth,q=this.right.left==null?0:this.right.left.depth;q>ne&&this.right.rotateLL(),this.rotateRR()}},et.prototype.rotateLL=function(){var h=this.node,x=this.right;this.node=this.left.node,this.right=this.left,this.left=this.left.left,this.right.left=this.right.right,this.right.right=x,this.right.node=h,this.right.updateInNewLocation(),this.updateInNewLocation()},et.prototype.rotateRR=function(){var h=this.node,x=this.left;this.node=this.right.node,this.left=this.right,this.right=this.right.right,this.left.right=this.left.left,this.left.left=x,this.left.node=h,this.left.updateInNewLocation(),this.updateInNewLocation()},et.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},et.prototype.getDepthFromChildren=function(){this.depth=this.node==null?0:1,this.left!=null&&(this.depth=this.left.depth+1),this.right!=null&&this.depth<=this.right.depth&&(this.depth=this.right.depth+1)};function Gt(h,x){if(h===x)return 0;if(h.compareDocumentPosition){var j=h.compareDocumentPosition(x);return j&1||j&10?1:j&20?-1:0}for(var Z=0,ne=0,q=h;q!=null;q=q.parentNode||q.ownerElement)Z++;for(var Xe=x;Xe!=null;Xe=Xe.parentNode||Xe.ownerElement)ne++;if(Z>ne){for(;Z>ne;)h=h.parentNode||h.ownerElement,Z--;if(h===x)return 1}else if(ne>Z){for(;ne>Z;)x=x.parentNode||x.ownerElement,ne--;if(h===x)return-1}for(var wt=h.parentNode||h.ownerElement,_t=x.parentNode||x.ownerElement;wt!==_t;)h=wt,x=_t,wt=h.parentNode||h.ownerElement,_t=x.parentNode||x.ownerElement;var He=qe.isAttribute(h),dt=qe.isAttribute(x);if(He&&!dt)return-1;if(!He&&dt)return 1;if(wt)for(var Rn=He?wt.attributes:wt.childNodes,di=Rn.length,Yt=0;Yt<di;Yt+=1){var Qa=Rn[Yt];if(Qa===h)return-1;if(Qa===x)return 1}throw new Error("Unexpected: could not determine node order")}u(Gt,"nodeOrder"),et.prototype.add=function(h){if(h===this.node)return!1;var x=Gt(h,this.node),j=!1;return x==-1?this.left==null?(this.left=new et(h),j=!0):(j=this.left.add(h),j&&this.balance()):x==1&&(this.right==null?(this.right=new et(h),j=!0):(j=this.right.add(h),j&&this.balance())),j&&this.getDepthFromChildren(),j},Be.prototype=new w,Be.prototype.constructor=Be,Be.superclass=w.prototype;function Be(){this.init()}u(Be,"XNodeSet"),Be.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},Be.prototype.toString=function(){var h=this.first();return h==null?"":this.stringForNode(h)},Be.prototype.evaluate=function(h){return this},Be.prototype.string=function(){return new R(this.toString())},Be.prototype.stringValue=function(){return this.toString()},Be.prototype.number=function(){return new N(this.string())},Be.prototype.numberValue=function(){return Number(this.string())},Be.prototype.bool=function(){return new ge(this.booleanValue())},Be.prototype.booleanValue=function(){return!!this.size},Be.prototype.nodeset=function(){return this},Be.prototype.stringForNode=function(h){return h.nodeType==v.DOCUMENT_NODE||h.nodeType==v.ELEMENT_NODE||h.nodeType===v.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(h):h.nodeType===v.ATTRIBUTE_NODE?h.value||h.nodeValue:h.isNamespaceNode?h.namespace:h.nodeValue},Be.prototype.stringForContainerNode=function(h){for(var x="",j=h.firstChild;j!=null;j=j.nextSibling){var Z=j.nodeType;(Z===1||Z===3||Z===4||Z===9||Z===11)&&(x+=this.stringForNode(j))}return x},Be.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new et(this.nodes[0]);for(var h=1;h<this.nodes.length;h+=1)this.tree.add(this.nodes[h])}return this.tree},Be.prototype.first=function(){var h=this.buildTree();if(h==null)return null;for(;h.left!=null;)h=h.left;return h.node},Be.prototype.add=function(h){for(var x=0;x<this.nodes.length;x+=1)if(h===this.nodes[x])return;this.tree=null,this.nodes.push(h),this.size+=1},Be.prototype.addArray=function(h){var x=this;t(function(j){x.add(j)},h)},Be.prototype.toArray=function(){var h=[];return this.toArrayRec(this.buildTree(),h),h},Be.prototype.toArrayRec=function(h,x){h!=null&&(this.toArrayRec(h.left,x),x.push(h.node),this.toArrayRec(h.right,x))},Be.prototype.toUnsortedArray=function(){return this.nodes.slice()},Be.prototype.compareWithString=function(h,x){for(var j=this.toUnsortedArray(),Z=0;Z<j.length;Z++){var ne=j[Z],q=new R(this.stringForNode(ne)),Xe=x(q,h);if(Xe.booleanValue())return Xe}return new ge(!1)},Be.prototype.compareWithNumber=function(h,x){for(var j=this.toUnsortedArray(),Z=0;Z<j.length;Z++){var ne=j[Z],q=new N(this.stringForNode(ne)),Xe=x(q,h);if(Xe.booleanValue())return Xe}return new ge(!1)},Be.prototype.compareWithBoolean=function(h,x){return x(this.bool(),h)},Be.prototype.compareWithNodeSet=function(h,x){for(var j=this.toUnsortedArray(),Z=u(function(wt,_t){return x(_t,wt)},"oInvert"),ne=0;ne<j.length;ne++){var q=new R(this.stringForNode(j[ne])),Xe=h.compareWithString(q,Z);if(Xe.booleanValue())return Xe}return new ge(!1)},Be.compareWith=e(function(h,x){return qe.instance_of(x,R)?this.compareWithString(x,h):qe.instance_of(x,N)?this.compareWithNumber(x,h):qe.instance_of(x,ge)?this.compareWithBoolean(x,h):this.compareWithNodeSet(x,h)}),Be.prototype.equals=Be.compareWith(_e.equals),Be.prototype.notequal=Be.compareWith(_e.notequal),Be.prototype.lessthan=Be.compareWith(_e.lessthan),Be.prototype.greaterthan=Be.compareWith(_e.greaterthan),Be.prototype.lessthanorequal=Be.compareWith(_e.lessthanorequal),Be.prototype.greaterthanorequal=Be.compareWith(_e.greaterthanorequal),Be.prototype.union=function(h){var x=new Be;return x.addArray(this.toUnsortedArray()),x.addArray(h.toUnsortedArray()),x},ar.prototype=new Object,ar.prototype.constructor=ar,ar.superclass=Object.prototype;function ar(h,x,j){this.isXPathNamespace=!0,this.ownerDocument=j.ownerDocument,this.nodeName="#namespace",this.prefix=h,this.localName=h,this.namespaceURI=x,this.nodeValue=x,this.ownerElement=j,this.nodeType=ar.XPATH_NAMESPACE_NODE}u(ar,"XPathNamespace"),ar.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},Er.prototype=new Object,Er.prototype.constructor=Er,Er.superclass=Object.prototype;function Er(h,x,j){this.variableResolver=h??new Jt,this.namespaceResolver=x??new Gs,this.functionResolver=j??new Ir}u(Er,"XPathContext"),Er.prototype.extend=function(h){return m(new Er,this,h)},Jt.prototype=new Object,Jt.prototype.constructor=Jt,Jt.superclass=Object.prototype;function Jt(){}u(Jt,"VariableResolver"),Jt.prototype.getVariable=function(h,x){return null},Ir.prototype=new Object,Ir.prototype.constructor=Ir,Ir.superclass=Object.prototype;function Ir(h){this.thisArg=h??Je,this.functions=new Object,this.addStandardFunctions()}u(Ir,"FunctionResolver"),Ir.prototype.addStandardFunctions=function(){this.functions["{}last"]=Je.last,this.functions["{}position"]=Je.position,this.functions["{}count"]=Je.count,this.functions["{}id"]=Je.id,this.functions["{}local-name"]=Je.localName,this.functions["{}namespace-uri"]=Je.namespaceURI,this.functions["{}name"]=Je.name,this.functions["{}string"]=Je.string,this.functions["{}concat"]=Je.concat,this.functions["{}starts-with"]=Je.startsWith,this.functions["{}contains"]=Je.contains,this.functions["{}substring-before"]=Je.substringBefore,this.functions["{}substring-after"]=Je.substringAfter,this.functions["{}substring"]=Je.substring,this.functions["{}string-length"]=Je.stringLength,this.functions["{}normalize-space"]=Je.normalizeSpace,this.functions["{}translate"]=Je.translate,this.functions["{}boolean"]=Je.boolean_,this.functions["{}not"]=Je.not,this.functions["{}true"]=Je.true_,this.functions["{}false"]=Je.false_,this.functions["{}lang"]=Je.lang,this.functions["{}number"]=Je.number,this.functions["{}sum"]=Je.sum,this.functions["{}floor"]=Je.floor,this.functions["{}ceiling"]=Je.ceiling,this.functions["{}round"]=Je.round},Ir.prototype.addFunction=function(h,x,j){this.functions["{"+h+"}"+x]=j},Ir.getFunctionFromContext=function(h,x){var j=qe.resolveQName(h,x.namespaceResolver,x.contextNode,!1);if(j[0]===null)throw new Error("Cannot resolve QName "+name);return x.functionResolver.getFunction(j[1],j[0])},Ir.prototype.getFunction=function(h,x){return this.functions["{"+x+"}"+h]},Gs.prototype=new Object,Gs.prototype.constructor=Gs,Gs.superclass=Object.prototype;function Gs(){}u(Gs,"NamespaceResolver"),Gs.prototype.getNamespace=function(h,x){if(h=="xml")return S.XML_NAMESPACE_URI;if(h=="xmlns")return S.XMLNS_NAMESPACE_URI;for(x.nodeType==v.DOCUMENT_NODE?x=x.documentElement:x.nodeType==v.ATTRIBUTE_NODE?x=W.getOwnerElement(x):x.nodeType!=v.ELEMENT_NODE&&(x=x.parentNode);x!=null&&x.nodeType==v.ELEMENT_NODE;){for(var j=x.attributes,Z=0;Z<j.length;Z++){var ne=j.item(Z),q=ne.name||ne.nodeName;if(q==="xmlns"&&h===""||q==="xmlns:"+h)return String(ne.value||ne.nodeValue)}x=x.parentNode}return null};var Je=new Object;Je.last=function(h){if(arguments.length!=1)throw new Error("Function last expects ()");return new N(h.contextSize)},Je.position=function(h){if(arguments.length!=1)throw new Error("Function position expects ()");return new N(h.contextPosition)},Je.count=function(){var h=arguments[0],x;if(arguments.length!=2||!qe.instance_of(x=arguments[1].evaluate(h),Be))throw new Error("Function count expects (node-set)");return new N(x.size)},Je.id=function(){var h=arguments[0],x;if(arguments.length!=2)throw new Error("Function id expects (object)");x=arguments[1].evaluate(h),qe.instance_of(x,Be)?x=x.toArray().join(" "):x=x.stringValue();for(var j=x.split(/[\x0d\x0a\x09\x20]+/),Z=0,ne=new Be,q=h.contextNode.nodeType==v.DOCUMENT_NODE?h.contextNode:h.contextNode.ownerDocument,Xe=0;Xe<j.length;Xe++){var wt;q.getElementById?wt=q.getElementById(j[Xe]):wt=qe.getElementById(q,j[Xe]),wt!=null&&(ne.add(wt),Z++)}return ne},Je.localName=function(h,x){var j;if(arguments.length==1)j=h.contextNode;else if(arguments.length==2)j=x.evaluate(h).first();else throw new Error("Function local-name expects (node-set?)");return j==null?new R(""):new R(j.localName||j.baseName||j.target||j.nodeName||"")},Je.namespaceURI=function(){var h=arguments[0],x;if(arguments.length==1)x=h.contextNode;else if(arguments.length==2)x=arguments[1].evaluate(h).first();else throw new Error("Function namespace-uri expects (node-set?)");return x==null?new R(""):new R(x.namespaceURI)},Je.name=function(){var h=arguments[0],x;if(arguments.length==1)x=h.contextNode;else if(arguments.length==2)x=arguments[1].evaluate(h).first();else throw new Error("Function name expects (node-set?)");return x==null?new R(""):x.nodeType==v.ELEMENT_NODE?new R(x.nodeName):x.nodeType==v.ATTRIBUTE_NODE?new R(x.name||x.nodeName):x.nodeType===v.PROCESSING_INSTRUCTION_NODE?new R(x.target||x.nodeName):x.localName==null?new R(""):new R(x.localName)},Je.string=function(){var h=arguments[0];if(arguments.length==1)return new R(Be.prototype.stringForNode(h.contextNode));if(arguments.length==2)return arguments[1].evaluate(h).string();throw new Error("Function string expects (object?)")},Je.concat=function(h){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var x="",j=1;j<arguments.length;j++)x+=arguments[j].evaluate(h).stringValue();return new R(x)},Je.startsWith=function(){var h=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var x=arguments[1].evaluate(h).stringValue(),j=arguments[2].evaluate(h).stringValue();return new ge(x.substring(0,j.length)==j)},Je.contains=function(){var h=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var x=arguments[1].evaluate(h).stringValue(),j=arguments[2].evaluate(h).stringValue();return new ge(x.indexOf(j)!==-1)},Je.substringBefore=function(){var h=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var x=arguments[1].evaluate(h).stringValue(),j=arguments[2].evaluate(h).stringValue();return new R(x.substring(0,x.indexOf(j)))},Je.substringAfter=function(){var h=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var x=arguments[1].evaluate(h).stringValue(),j=arguments[2].evaluate(h).stringValue();if(j.length==0)return new R(x);var Z=x.indexOf(j);return Z==-1?new R(""):new R(x.substring(Z+j.length))},Je.substring=function(){var h=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var x=arguments[1].evaluate(h).stringValue(),j=Math.round(arguments[2].evaluate(h).numberValue())-1,Z=arguments.length==4?j+Math.round(arguments[3].evaluate(h).numberValue()):void 0;return new R(x.substring(j,Z))},Je.stringLength=function(){var h=arguments[0],x;if(arguments.length==1)x=Be.prototype.stringForNode(h.contextNode);else if(arguments.length==2)x=arguments[1].evaluate(h).stringValue();else throw new Error("Function string-length expects (string?)");return new N(x.length)},Je.normalizeSpace=function(){var h=arguments[0],x;if(arguments.length==1)x=Be.prototype.stringForNode(h.contextNode);else if(arguments.length==2)x=arguments[1].evaluate(h).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var j=0,Z=x.length-1;qe.isSpace(x.charCodeAt(Z));)Z--;for(var ne="";j<=Z&&qe.isSpace(x.charCodeAt(j));)j++;for(;j<=Z;)if(qe.isSpace(x.charCodeAt(j)))for(ne+=" ";j<=Z&&qe.isSpace(x.charCodeAt(j));)j++;else ne+=x.charAt(j),j++;return new R(ne)},Je.translate=function(h,x,j,Z){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var ne=x.evaluate(h).stringValue(),q=j.evaluate(h).stringValue(),Xe=Z.evaluate(h).stringValue(),wt=n(function(He,dt,Rn){return dt in He||(He[dt]=Rn>Xe.length?"":Xe[Rn]),He},{},q),_t=c("",s(function(He){return He in wt?wt[He]:He},ne));return new R(_t)},Je.boolean_=function(){var h=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(h).bool()},Je.not=function(h,x){if(arguments.length!=2)throw new Error("Function not expects (object)");return x.evaluate(h).bool().not()},Je.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return ge.true_},Je.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return ge.false_},Je.lang=function(){var h=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var x,j=h.contextNode;j!=null&&j.nodeType!=v.DOCUMENT_NODE;j=j.parentNode){var Z=j.getAttributeNS(S.XML_NAMESPACE_URI,"lang");if(Z!=null){x=String(Z);break}}if(x==null)return ge.false_;var ne=arguments[1].evaluate(h).stringValue();return new ge(x.substring(0,ne.length)==ne&&(x.length==ne.length||x.charAt(ne.length)=="-"))},Je.number=function(){var h=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new N(Be.prototype.stringForNode(h.contextNode)):arguments[1].evaluate(h).number()},Je.sum=function(){var h=arguments[0],x;if(arguments.length!=2||!qe.instance_of(x=arguments[1].evaluate(h),Be))throw new Error("Function sum expects (node-set)");x=x.toUnsortedArray();for(var j=0,Z=0;Z<x.length;Z++)j+=new N(Be.prototype.stringForNode(x[Z])).numberValue();return new N(j)},Je.floor=function(){var h=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new N(Math.floor(arguments[1].evaluate(h).numberValue()))},Je.ceiling=function(){var h=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new N(Math.ceil(arguments[1].evaluate(h).numberValue()))},Je.round=function(){var h=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new N(Math.round(arguments[1].evaluate(h).numberValue()))};var qe=new Object;qe.isAttribute=function(h){return h&&(h.nodeType===v.ATTRIBUTE_NODE||h.ownerElement)},qe.splitQName=function(h){var x=h.indexOf(":");return x==-1?[null,h]:[h.substring(0,x),h.substring(x+1)]},qe.resolveQName=function(h,x,j,Z){var ne=qe.splitQName(h);return ne[0]!=null?ne[0]=x.getNamespace(ne[0],j):Z?(ne[0]=x.getNamespace("",j),ne[0]==null&&(ne[0]="")):ne[0]="",ne},qe.isSpace=function(h){return h==9||h==13||h==10||h==32},qe.isLetter=function(h){return h>=65&&h<=90||h>=97&&h<=122||h>=192&&h<=214||h>=216&&h<=246||h>=248&&h<=255||h>=256&&h<=305||h>=308&&h<=318||h>=321&&h<=328||h>=330&&h<=382||h>=384&&h<=451||h>=461&&h<=496||h>=500&&h<=501||h>=506&&h<=535||h>=592&&h<=680||h>=699&&h<=705||h==902||h>=904&&h<=906||h==908||h>=910&&h<=929||h>=931&&h<=974||h>=976&&h<=982||h==986||h==988||h==990||h==992||h>=994&&h<=1011||h>=1025&&h<=1036||h>=1038&&h<=1103||h>=1105&&h<=1116||h>=1118&&h<=1153||h>=1168&&h<=1220||h>=1223&&h<=1224||h>=1227&&h<=1228||h>=1232&&h<=1259||h>=1262&&h<=1269||h>=1272&&h<=1273||h>=1329&&h<=1366||h==1369||h>=1377&&h<=1414||h>=1488&&h<=1514||h>=1520&&h<=1522||h>=1569&&h<=1594||h>=1601&&h<=1610||h>=1649&&h<=1719||h>=1722&&h<=1726||h>=1728&&h<=1742||h>=1744&&h<=1747||h==1749||h>=1765&&h<=1766||h>=2309&&h<=2361||h==2365||h>=2392&&h<=2401||h>=2437&&h<=2444||h>=2447&&h<=2448||h>=2451&&h<=2472||h>=2474&&h<=2480||h==2482||h>=2486&&h<=2489||h>=2524&&h<=2525||h>=2527&&h<=2529||h>=2544&&h<=2545||h>=2565&&h<=2570||h>=2575&&h<=2576||h>=2579&&h<=2600||h>=2602&&h<=2608||h>=2610&&h<=2611||h>=2613&&h<=2614||h>=2616&&h<=2617||h>=2649&&h<=2652||h==2654||h>=2674&&h<=2676||h>=2693&&h<=2699||h==2701||h>=2703&&h<=2705||h>=2707&&h<=2728||h>=2730&&h<=2736||h>=2738&&h<=2739||h>=2741&&h<=2745||h==2749||h==2784||h>=2821&&h<=2828||h>=2831&&h<=2832||h>=2835&&h<=2856||h>=2858&&h<=2864||h>=2866&&h<=2867||h>=2870&&h<=2873||h==2877||h>=2908&&h<=2909||h>=2911&&h<=2913||h>=2949&&h<=2954||h>=2958&&h<=2960||h>=2962&&h<=2965||h>=2969&&h<=2970||h==2972||h>=2974&&h<=2975||h>=2979&&h<=2980||h>=2984&&h<=2986||h>=2990&&h<=2997||h>=2999&&h<=3001||h>=3077&&h<=3084||h>=3086&&h<=3088||h>=3090&&h<=3112||h>=3114&&h<=3123||h>=3125&&h<=3129||h>=3168&&h<=3169||h>=3205&&h<=3212||h>=3214&&h<=3216||h>=3218&&h<=3240||h>=3242&&h<=3251||h>=3253&&h<=3257||h==3294||h>=3296&&h<=3297||h>=3333&&h<=3340||h>=3342&&h<=3344||h>=3346&&h<=3368||h>=3370&&h<=3385||h>=3424&&h<=3425||h>=3585&&h<=3630||h==3632||h>=3634&&h<=3635||h>=3648&&h<=3653||h>=3713&&h<=3714||h==3716||h>=3719&&h<=3720||h==3722||h==3725||h>=3732&&h<=3735||h>=3737&&h<=3743||h>=3745&&h<=3747||h==3749||h==3751||h>=3754&&h<=3755||h>=3757&&h<=3758||h==3760||h>=3762&&h<=3763||h==3773||h>=3776&&h<=3780||h>=3904&&h<=3911||h>=3913&&h<=3945||h>=4256&&h<=4293||h>=4304&&h<=4342||h==4352||h>=4354&&h<=4355||h>=4357&&h<=4359||h==4361||h>=4363&&h<=4364||h>=4366&&h<=4370||h==4412||h==4414||h==4416||h==4428||h==4430||h==4432||h>=4436&&h<=4437||h==4441||h>=4447&&h<=4449||h==4451||h==4453||h==4455||h==4457||h>=4461&&h<=4462||h>=4466&&h<=4467||h==4469||h==4510||h==4520||h==4523||h>=4526&&h<=4527||h>=4535&&h<=4536||h==4538||h>=4540&&h<=4546||h==4587||h==4592||h==4601||h>=7680&&h<=7835||h>=7840&&h<=7929||h>=7936&&h<=7957||h>=7960&&h<=7965||h>=7968&&h<=8005||h>=8008&&h<=8013||h>=8016&&h<=8023||h==8025||h==8027||h==8029||h>=8031&&h<=8061||h>=8064&&h<=8116||h>=8118&&h<=8124||h==8126||h>=8130&&h<=8132||h>=8134&&h<=8140||h>=8144&&h<=8147||h>=8150&&h<=8155||h>=8160&&h<=8172||h>=8178&&h<=8180||h>=8182&&h<=8188||h==8486||h>=8490&&h<=8491||h==8494||h>=8576&&h<=8578||h>=12353&&h<=12436||h>=12449&&h<=12538||h>=12549&&h<=12588||h>=44032&&h<=55203||h>=19968&&h<=40869||h==12295||h>=12321&&h<=12329},qe.isNCNameChar=function(h){return h>=48&&h<=57||h>=1632&&h<=1641||h>=1776&&h<=1785||h>=2406&&h<=2415||h>=2534&&h<=2543||h>=2662&&h<=2671||h>=2790&&h<=2799||h>=2918&&h<=2927||h>=3047&&h<=3055||h>=3174&&h<=3183||h>=3302&&h<=3311||h>=3430&&h<=3439||h>=3664&&h<=3673||h>=3792&&h<=3801||h>=3872&&h<=3881||h==46||h==45||h==95||qe.isLetter(h)||h>=768&&h<=837||h>=864&&h<=865||h>=1155&&h<=1158||h>=1425&&h<=1441||h>=1443&&h<=1465||h>=1467&&h<=1469||h==1471||h>=1473&&h<=1474||h==1476||h>=1611&&h<=1618||h==1648||h>=1750&&h<=1756||h>=1757&&h<=1759||h>=1760&&h<=1764||h>=1767&&h<=1768||h>=1770&&h<=1773||h>=2305&&h<=2307||h==2364||h>=2366&&h<=2380||h==2381||h>=2385&&h<=2388||h>=2402&&h<=2403||h>=2433&&h<=2435||h==2492||h==2494||h==2495||h>=2496&&h<=2500||h>=2503&&h<=2504||h>=2507&&h<=2509||h==2519||h>=2530&&h<=2531||h==2562||h==2620||h==2622||h==2623||h>=2624&&h<=2626||h>=2631&&h<=2632||h>=2635&&h<=2637||h>=2672&&h<=2673||h>=2689&&h<=2691||h==2748||h>=2750&&h<=2757||h>=2759&&h<=2761||h>=2763&&h<=2765||h>=2817&&h<=2819||h==2876||h>=2878&&h<=2883||h>=2887&&h<=2888||h>=2891&&h<=2893||h>=2902&&h<=2903||h>=2946&&h<=2947||h>=3006&&h<=3010||h>=3014&&h<=3016||h>=3018&&h<=3021||h==3031||h>=3073&&h<=3075||h>=3134&&h<=3140||h>=3142&&h<=3144||h>=3146&&h<=3149||h>=3157&&h<=3158||h>=3202&&h<=3203||h>=3262&&h<=3268||h>=3270&&h<=3272||h>=3274&&h<=3277||h>=3285&&h<=3286||h>=3330&&h<=3331||h>=3390&&h<=3395||h>=3398&&h<=3400||h>=3402&&h<=3405||h==3415||h==3633||h>=3636&&h<=3642||h>=3655&&h<=3662||h==3761||h>=3764&&h<=3769||h>=3771&&h<=3772||h>=3784&&h<=3789||h>=3864&&h<=3865||h==3893||h==3895||h==3897||h==3902||h==3903||h>=3953&&h<=3972||h>=3974&&h<=3979||h>=3984&&h<=3989||h==3991||h>=3993&&h<=4013||h>=4017&&h<=4023||h==4025||h>=8400&&h<=8412||h==8417||h>=12330&&h<=12335||h==12441||h==12442||h==183||h==720||h==721||h==903||h==1600||h==3654||h==3782||h==12293||h>=12337&&h<=12341||h>=12445&&h<=12446||h>=12540&&h<=12542},qe.coalesceText=function(h){for(var x=h.firstChild;x!=null;x=x.nextSibling)if(x.nodeType==v.TEXT_NODE||x.nodeType==v.CDATA_SECTION_NODE){var j=x.nodeValue,Z=x;for(x=x.nextSibling;x!=null&&(x.nodeType==v.TEXT_NODE||x.nodeType==v.CDATA_SECTION_NODE);){j+=x.nodeValue;var ne=x;x=x.nextSibling,ne.parentNode.removeChild(ne)}if(Z.nodeType==v.CDATA_SECTION_NODE){var q=Z.parentNode;if(Z.nextSibling==null)q.removeChild(Z),q.appendChild(q.ownerDocument.createTextNode(j));else{var Xe=Z.nextSibling;q.removeChild(Z),q.insertBefore(q.ownerDocument.createTextNode(j),Xe)}}else Z.nodeValue=j;if(x==null)break}else x.nodeType==v.ELEMENT_NODE&&qe.coalesceText(x)},qe.instance_of=function(h,x){for(;h!=null;){if(h.constructor===x)return!0;if(h===Object)return!1;h=h.constructor.superclass}return!1},qe.getElementById=function(h,x){if(h.nodeType==v.ELEMENT_NODE&&(h.getAttribute("id")==x||h.getAttributeNS(null,"id")==x))return h;for(var j=h.firstChild;j!=null;j=j.nextSibling){var Z=qe.getElementById(j,x);if(Z!=null)return Z}return null};var os=(function(){function h(j,Z){var ne=Z?": "+Z.toString():"";switch(j){case x.INVALID_EXPRESSION_ERR:return"Invalid expression"+ne;case x.TYPE_ERR:return"Type error"+ne}return null}u(h,"getMessage");function x(j,Z,ne){var q=Error.call(this,h(j,Z)||ne);return q.code=j,q.exception=Z,q}return u(x,"XPathException"),x.prototype=Object.create(Error.prototype),x.prototype.constructor=x,x.superclass=Error,x.prototype.toString=function(){return this.message},x.fromMessage=function(j,Z){return new x(null,Z,j)},x.INVALID_EXPRESSION_ERR=51,x.TYPE_ERR=52,x})();$s.prototype={},$s.prototype.constructor=$s,$s.superclass=Object.prototype;function $s(h,x,j){this.xpath=j.parse(h),this.context=new Er,this.context.namespaceResolver=new af(x)}u($s,"XPathExpression"),$s.getOwnerDocument=function(h){return h.nodeType===v.DOCUMENT_NODE?h:h.ownerDocument},$s.detectHtmlDom=function(h){if(!h)return!1;var x=$s.getOwnerDocument(h);try{return x.implementation.hasFeature("HTML","2.0")}catch{return!0}},$s.prototype.evaluate=function(h,x,j){this.context.expressionContextNode=h,this.context.caseInsensitive=$s.detectHtmlDom(h);var Z=this.xpath.evaluate(this.context);return new xt(Z,x)},af.prototype={},af.prototype.constructor=af,af.superclass=Object.prototype;function af(h){this.xpathNSResolver=h}u(af,"XPathNSResolverWrapper"),af.prototype.getNamespace=function(h,x){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(h)},of.prototype={},of.prototype.constructor=of,of.superclass=Object.prototype;function of(h){this.node=h,this.namespaceResolver=new Gs}u(of,"NodeXPathNSResolver"),of.prototype.lookupNamespaceURI=function(h){return this.namespaceResolver.getNamespace(h,this.node)},xt.prototype={},xt.prototype.constructor=xt,xt.superclass=Object.prototype;function xt(h,x){switch(x==xt.ANY_TYPE&&(h.constructor===R?x=xt.STRING_TYPE:h.constructor===N?x=xt.NUMBER_TYPE:h.constructor===ge?x=xt.BOOLEAN_TYPE:h.constructor===Be&&(x=xt.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=x,x){case xt.NUMBER_TYPE:this.numberValue=h.numberValue();return;case xt.STRING_TYPE:this.stringValue=h.stringValue();return;case xt.BOOLEAN_TYPE:this.booleanValue=h.booleanValue();return;case xt.ANY_UNORDERED_NODE_TYPE:case xt.FIRST_ORDERED_NODE_TYPE:if(h.constructor===Be){this.singleNodeValue=h.first();return}break;case xt.UNORDERED_NODE_ITERATOR_TYPE:case xt.ORDERED_NODE_ITERATOR_TYPE:if(h.constructor===Be){this.invalidIteratorState=!1,this.nodes=h.toArray(),this.iteratorIndex=0;return}break;case xt.UNORDERED_NODE_SNAPSHOT_TYPE:case xt.ORDERED_NODE_SNAPSHOT_TYPE:if(h.constructor===Be){this.nodes=h.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new os(os.TYPE_ERR)}u(xt,"XPathResult"),xt.prototype.iterateNext=function(){if(this.resultType!=xt.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=xt.ORDERED_NODE_ITERATOR_TYPE)throw new os(os.TYPE_ERR);return this.nodes[this.iteratorIndex++]},xt.prototype.snapshotItem=function(h){if(this.resultType!=xt.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=xt.ORDERED_NODE_SNAPSHOT_TYPE)throw new os(os.TYPE_ERR);return this.nodes[h]},xt.ANY_TYPE=0,xt.NUMBER_TYPE=1,xt.STRING_TYPE=2,xt.BOOLEAN_TYPE=3,xt.UNORDERED_NODE_ITERATOR_TYPE=4,xt.ORDERED_NODE_ITERATOR_TYPE=5,xt.UNORDERED_NODE_SNAPSHOT_TYPE=6,xt.ORDERED_NODE_SNAPSHOT_TYPE=7,xt.ANY_UNORDERED_NODE_TYPE=8,xt.FIRST_ORDERED_NODE_TYPE=9;function fI(h,x){h.createExpression=function(j,Z){try{return new $s(j,Z,x)}catch(ne){throw new os(os.INVALID_EXPRESSION_ERR,ne)}},h.createNSResolver=function(j){return new of(j)},h.evaluate=function(j,Z,ne,q,Xe){if(q<0||q>9)throw{code:0,toString:u(function(){return"Request type not supported"},"toString")};return h.createExpression(j,ne,x).evaluate(Z,q,Xe)}}u(fI,"installDOM3XPathSupport");try{var hI=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(hI=!1)}catch{}hI&&fI(document,new y)}catch{}fI(r,new y),(function(){var h=new y,x=new Gs,j=new Ir,Z=new Jt;function ne(Pe){return{getNamespace:u(function(Pt,Mn){var Za=Pe(Pt,Mn);return Za||x.getNamespace(Pt,Mn)},"getNamespace")}}u(ne,"makeNSResolverFromFunction");function q(Pe){return ne(Pe.getNamespace.bind(Pe))}u(q,"makeNSResolverFromObject");function Xe(Pe){return ne(function(Pt){return Pe[Pt]})}u(Xe,"makeNSResolverFromMap");function wt(Pe){return Pe&&typeof Pe.getNamespace=="function"?q(Pe):typeof Pe=="function"?ne(Pe):typeof Pe=="object"?Xe(Pe):x}u(wt,"makeNSResolver");function _t(Pe){if(Pe===null||typeof Pe>"u"||Pe instanceof R||Pe instanceof ge||Pe instanceof N||Pe instanceof Be)return Pe;switch(typeof Pe){case"string":return new R(Pe);case"boolean":return new ge(Pe);case"number":return new N(Pe)}var Pt=new Be;return Pt.addArray([].concat(Pe)),Pt}u(_t,"convertValue");function He(Pe){return function(Pt){var Mn=Array.prototype.slice.call(arguments,1).map(function(gV){return gV.evaluate(Pt)}),Za=Pe.apply(this,[].concat(Pt,Mn));return _t(Za)}}u(He,"makeEvaluator");function dt(Pe){return{getFunction:u(function(Pt,Mn){var Za=Pe(Pt,Mn);return Za?He(Za):j.getFunction(Pt,Mn)},"getFunction")}}u(dt,"makeFunctionResolverFromFunction");function Rn(Pe){return dt(Pe.getFunction.bind(Pe))}u(Rn,"makeFunctionResolverFromObject");function di(Pe){return dt(function(Pt){return Pe[Pt]})}u(di,"makeFunctionResolverFromMap");function Yt(Pe){return Pe&&typeof Pe.getFunction=="function"?Rn(Pe):typeof Pe=="function"?dt(Pe):typeof Pe=="object"?di(Pe):j}u(Yt,"makeFunctionResolver");function Qa(Pe){return{getVariable:u(function(Pt,Mn){var Za=Pe(Pt,Mn);return _t(Za)},"getVariable")}}u(Qa,"makeVariableResolverFromFunction");function fV(Pe){if(Pe){if(typeof Pe.getVariable=="function")return Qa(Pe.getVariable.bind(Pe));if(typeof Pe=="function")return Qa(Pe);if(typeof Pe=="object")return Qa(function(Pt){return Pe[Pt]})}return Z}u(fV,"makeVariableResolver");function pI(Pe,Pt,Mn){Pe in Mn&&(Pt[Pe]=Mn[Pe])}u(pI,"copyIfPresent");function hV(Pe){var Pt=new Er;return Pe?(Pt.namespaceResolver=wt(Pe.namespaces),Pt.functionResolver=Yt(Pe.functions),Pt.variableResolver=fV(Pe.variables),Pt.expressionContextNode=Pe.node,pI("allowAnyNamespaceForNoPrefix",Pt,Pe),pI("isHtml",Pt,Pe)):Pt.namespaceResolver=x,Pt}u(hV,"makeContext");function pV(Pe,Pt){var Mn=hV(Pt);return Pe.evaluate(Mn)}u(pV,"evaluate");var dV={evaluate:u(function(Pe){return pV(this.expression,Pe)},"evaluate"),evaluateNumber:u(function(Pe){return this.evaluate(Pe).numberValue()},"evaluateNumber"),evaluateString:u(function(Pe){return this.evaluate(Pe).stringValue()},"evaluateString"),evaluateBoolean:u(function(Pe){return this.evaluate(Pe).booleanValue()},"evaluateBoolean"),evaluateNodeSet:u(function(Pe){return this.evaluate(Pe).nodeset()},"evaluateNodeSet"),select:u(function(Pe){return this.evaluateNodeSet(Pe).toArray()},"select"),select1:u(function(Pe){return this.select(Pe)[0]},"select1")};function mV(Pe){var Pt=h.parse(Pe);return Object.create(dV,{expression:{value:Pt}})}u(mV,"parse"),r.parse=mV})(),m(r,{XPath:S,XPathParser:y,XPathResult:xt,Step:O,PathExpr:W,NodeTest:B,LocationPath:Le,OrOperation:V,AndOperation:I,BarOperation:pe,EqualsOperation:D,NotEqualOperation:U,LessThanOperation:F,GreaterThanOperation:M,LessThanOrEqualOperation:se,GreaterThanOrEqualOperation:ee,PlusOperation:ie,MinusOperation:X,MultiplyOperation:he,DivOperation:Ce,ModOperation:xe,UnaryMinusOperation:A,FunctionCall:K,VariableReference:Q,XPathContext:Er,XNodeSet:Be,XBoolean:ge,XString:R,XNumber:N,NamespaceResolver:Gs,FunctionResolver:Ir,VariableResolver:Jt,Utilities:qe}),r.select=function(h,x,j){return r.selectWithResolver(h,x,null,j)},r.useNamespaces=function(h){var x={mappings:h||{},lookupNamespaceURI:u(function(j){return this.mappings[j]},"lookupNamespaceURI")};return function(j,Z,ne){return r.selectWithResolver(j,Z,x,ne)}},r.selectWithResolver=function(h,x,j,Z){var ne=new $s(h,j,new y),q=xt.ANY_TYPE,Xe=ne.evaluate(x,q,null);return Xe.resultType==xt.STRING_TYPE?Xe=Xe.stringValue:Xe.resultType==xt.NUMBER_TYPE?Xe=Xe.numberValue:Xe.resultType==xt.BOOLEAN_TYPE?Xe=Xe.booleanValue:(Xe=Xe.nodes,Z&&(Xe=Xe[0])),Xe},r.select1=function(h,x){return r.select(h,x,!0)};var uA=u(function(h){return h&&typeof h.nodeType=="number"&&Number.isInteger(h.nodeType)&&h.nodeType>=1&&h.nodeType<=11&&typeof h.nodeName=="string"},"isNodeLike"),cV=u(function(h){return Array.isArray(h)&&h.every(uA)},"isArrayOfNodes"),ta=u(function(h){return function(x){return uA(x)&&x.nodeType===h}},"isNodeOfType");m(r,{isNodeLike:uA,isArrayOfNodes:cV,isElement:ta(v.ELEMENT_NODE),isAttribute:ta(v.ATTRIBUTE_NODE),isTextNode:ta(v.TEXT_NODE),isCDATASection:ta(v.CDATA_SECTION_NODE),isProcessingInstruction:ta(v.PROCESSING_INSTRUCTION_NODE),isComment:ta(v.COMMENT_NODE),isDocumentNode:ta(v.DOCUMENT_NODE),isDocumentTypeNode:ta(v.DOCUMENT_TYPE_NODE),isDocumentFragment:ta(v.DOCUMENT_FRAGMENT_NODE)})})(qH)});var Ff=ue(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.assertIsDocumentFragmentNode=lt.assertIsDocumentTypeNode=lt.assertIsDocumentNode=lt.assertIsCommentNode=lt.assertIsProcessingInstructionNode=lt.assertIsCDATASectionNode=lt.assertIsTextNode=lt.assertIsAttributeNode=lt.assertIsElementNode=lt.isDocumentFragmentNode=lt.isDocumentTypeNode=lt.isDocumentNode=lt.isCommentNode=lt.isProcessingInstructionNode=lt.isCDATASectionNode=lt.isTextNode=lt.isAttributeNode=lt.isElementNode=lt.assertIsArrayOfNodes=lt.isArrayOfNodes=lt.assertIsNodeLike=lt.isNodeLike=lt.NodeTypes=void 0;var Rr;(function(r){r[r.ELEMENT_NODE=1]="ELEMENT_NODE",r[r.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",r[r.TEXT_NODE=3]="TEXT_NODE",r[r.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",r[r.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",r[r.COMMENT_NODE=8]="COMMENT_NODE",r[r.DOCUMENT_NODE=9]="DOCUMENT_NODE",r[r.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",r[r.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"})(Rr||(lt.NodeTypes=Rr={}));function Yv(r){return r&&typeof r=="object"&&Number.isInteger(r.nodeType)&&r.nodeType>=1&&r.nodeType<=11&&typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.removeChild=="function"}u(Yv,"isNodeLike");lt.isNodeLike=Yv;function HH(r){if(!Yv(r))throw new Error(`Value is not a Node-like object. Received: ${r}`)}u(HH,"assertIsNodeLike");lt.assertIsNodeLike=HH;function A3(r){return Array.isArray(r)&&r.every(Yv)}u(A3,"isArrayOfNodes");lt.isArrayOfNodes=A3;function KH(r){if(!A3(r))throw new Error("Value is not an array of Nodes")}u(KH,"assertIsArrayOfNodes");lt.assertIsArrayOfNodes=KH;function Ri(r,e){return Yv(e)&&e.nodeType===r}u(Ri,"isNodeOfType");function la(r,e){let t=Object.keys(Rr).find(n=>Rr[n]===r);if(!Ri(r,e))throw new Error(`Value is not of type ${t}`)}u(la,"assertIsNodeOfType");var XH=u(r=>Ri(Rr.ELEMENT_NODE,r),"isElementNode");lt.isElementNode=XH;var GH=u(r=>Ri(Rr.ATTRIBUTE_NODE,r),"isAttributeNode");lt.isAttributeNode=GH;var $H=u(r=>Ri(Rr.TEXT_NODE,r),"isTextNode");lt.isTextNode=$H;var WH=u(r=>Ri(Rr.CDATA_SECTION_NODE,r),"isCDATASectionNode");lt.isCDATASectionNode=WH;var zH=u(r=>Ri(Rr.PROCESSING_INSTRUCTION_NODE,r),"isProcessingInstructionNode");lt.isProcessingInstructionNode=zH;var JH=u(r=>Ri(Rr.COMMENT_NODE,r),"isCommentNode");lt.isCommentNode=JH;var YH=u(r=>Ri(Rr.DOCUMENT_NODE,r),"isDocumentNode");lt.isDocumentNode=YH;var QH=u(r=>Ri(Rr.DOCUMENT_TYPE_NODE,r),"isDocumentTypeNode");lt.isDocumentTypeNode=QH;var ZH=u(r=>Ri(Rr.DOCUMENT_FRAGMENT_NODE,r),"isDocumentFragmentNode");lt.isDocumentFragmentNode=ZH;var eK=u(r=>{la(Rr.ELEMENT_NODE,r)},"assertIsElementNode");lt.assertIsElementNode=eK;var tK=u(r=>la(Rr.ATTRIBUTE_NODE,r),"assertIsAttributeNode");lt.assertIsAttributeNode=tK;var rK=u(r=>la(Rr.TEXT_NODE,r),"assertIsTextNode");lt.assertIsTextNode=rK;var nK=u(r=>la(Rr.CDATA_SECTION_NODE,r),"assertIsCDATASectionNode");lt.assertIsCDATASectionNode=nK;var sK=u(r=>la(Rr.PROCESSING_INSTRUCTION_NODE,r),"assertIsProcessingInstructionNode");lt.assertIsProcessingInstructionNode=sK;var iK=u(r=>la(Rr.COMMENT_NODE,r),"assertIsCommentNode");lt.assertIsCommentNode=iK;var aK=u(r=>la(Rr.DOCUMENT_NODE,r),"assertIsDocumentNode");lt.assertIsDocumentNode=aK;var oK=u(r=>la(Rr.DOCUMENT_TYPE_NODE,r),"assertIsDocumentTypeNode");lt.assertIsDocumentTypeNode=oK;var uK=u(r=>la(Rr.DOCUMENT_FRAGMENT_NODE,r),"assertIsDocumentFragmentNode");lt.assertIsDocumentFragmentNode=uK});var bd=ue(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.validateDigestValue=qt.findAncestorNs=qt.derToPem=qt.pemToDer=qt.normalizePem=qt.BASE64_REGEX=qt.EXTRACT_X509_CERTS=qt.PEM_FORMAT_REGEX=qt.encodeSpecialCharactersInText=qt.encodeSpecialCharactersInAttribute=qt.findChilds=qt.findChildren=qt.findAttr=qt.isArrayHasLength=void 0;var lK=Jv(),lx=Ff();function C3(r){return Array.isArray(r)&&r.length>0}u(C3,"isArrayHasLength");qt.isArrayHasLength=C3;function cK(r,e,t){return r.localName===e&&(r.namespaceURI===t||t==null)}u(cK,"attrEqualsExplicitly");function fK(r,e,t,n){return r.localName===e&&(!r.namespaceURI&&n?.namespaceURI===t||t==null)}u(fK,"attrEqualsImplicitly");function hK(r,e,t){for(let n=0;n<r.attributes.length;n++){let s=r.attributes[n];if(cK(s,e,t)||fK(s,e,t,r))return s}return null}u(hK,"findAttr");qt.findAttr=hK;function x3(r,e,t){let n=r.documentElement??r,s=[];for(let i=0;i<n.childNodes.length;i++){let a=n.childNodes[i];lx.isElementNode(a)&&a.localName===e&&(a.namespaceURI===t||t==null)&&s.push(a)}return s}u(x3,"findChildren");qt.findChildren=x3;function pK(r,e,t){return x3(r,e,t)}u(pK,"findChilds");qt.findChilds=pK;var dK={"&":"&amp;","<":"&lt;",'"':"&quot;","\r":"&#xD;","\n":"&#xA;"," ":"&#x9;"},mK={"&":"&amp;","<":"&lt;",">":"&gt;","\r":"&#xD;"};function gK(r){return r.replace(/([&<"\r\n\t])/g,function(e,t){return dK[t]})}u(gK,"encodeSpecialCharactersInAttribute");qt.encodeSpecialCharactersInAttribute=gK;function yK(r){return r.replace(/([&<>\r])/g,function(e,t){return mK[t]})}u(yK,"encodeSpecialCharactersInText");qt.encodeSpecialCharactersInText=yK;qt.PEM_FORMAT_REGEX=new RegExp("^-----BEGIN [A-Z ]{1,48}-----([^-]*)-----END [A-Z ]{1,48}-----$","s");qt.EXTRACT_X509_CERTS=new RegExp("-----BEGIN CERTIFICATE-----[^-]*-----END CERTIFICATE-----","g");qt.BASE64_REGEX=new RegExp("^(?:[A-Za-z0-9\\+\\/]{4}\\n{0,1})*(?:[A-Za-z0-9\\+\\/]{2}==|[A-Za-z0-9\\+\\/]{3}=)?$","s");function ux(r){return`${(r.trim().replace(/(\r\n|\r)/g,`
40
+ `).match(/.{1,64}/g)??[]).join(`
41
+ `)}
42
+ `}u(ux,"normalizePem");qt.normalizePem=ux;function vK(r){if(!qt.PEM_FORMAT_REGEX.test(r.trim()))throw new Error("Invalid PEM format.");return Buffer.from(r.replace(/(\r\n|\r)/g,"").replace(/-----BEGIN [A-Z\x20]{1,48}-----\n?/,"").replace(/-----END [A-Z\x20]{1,48}-----\n?/,""),"base64")}u(vK,"pemToDer");qt.pemToDer=vK;function EK(r,e){let t=Buffer.isBuffer(r)?r.toString("base64").trim():r.replace(/(\r\n|\r)/g,"").trim();if(qt.PEM_FORMAT_REGEX.test(t))return ux(t);if(qt.BASE64_REGEX.test(t.replace(/ /g,""))){if(e==null)throw new Error("PEM label is required when DER is given.");let n=`-----BEGIN ${e}-----
43
+ ${t.replace(/ /g,"")}
44
+ -----END ${e}-----`;return ux(n)}throw new Error("Unknown DER format.")}u(EK,"derToPem");qt.derToPem=EK;function b3(r,e=[]){if(!lx.isElementNode(r.parentNode))return e;let t=r.parentNode;if(!t)return e;if(t.attributes&&t.attributes.length>0)for(let n=0;n<t.attributes.length;n++){let s=t.attributes[n];s&&s.nodeName&&s.nodeName.search(/^xmlns:?/)!==-1&&e.push({prefix:s.nodeName.replace(/^xmlns:?/,""),namespaceURI:s.nodeValue||""})}return b3(t,e)}u(b3,"collectAncestorNamespaces");function wK(r){let e=r.attributes;for(let t=0;t<e.length;t++){let n=e[t].nodeName;if(n.search(/^xmlns:?/)!==-1)return n.replace(/^xmlns:?/,"")}return r.prefix||""}u(wK,"findNSPrefix");function SK(r){return r.every(e=>lx.isElementNode(e))}u(SK,"isElementSubset");function AK(r,e,t){if(e==null)return[];let n=lK.selectWithResolver(e,r,t);if(!C3(n))return[];if(!SK(n))throw new Error("Document subset must be list of elements");let s=b3(n[0]),i=[];for(let l=0;l<s.length;l++){let c=!0;for(let f in i)if(i[f].prefix===s[l].prefix){c=!1;break}c&&i.push(s[l])}let a=[],o=wK(n[0]);for(let l of i)l.prefix!==o&&a.push(l);return a}u(AK,"findAncestorNs");qt.findAncestorNs=AK;function CK(r,e){let t=Buffer.from(r,"base64"),n=Buffer.from(e,"base64");if(typeof t.equals=="function")return t.equals(n);if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}u(CK,"validateDigestValue");qt.validateDigestValue=CK});var fx=ue(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.C14nCanonicalizationWithComments=Uf.C14nCanonicalization=void 0;var Qv=bd(),cx=Ff(),N3=class{static{u(this,"C14nCanonicalization")}constructor(){this.includeComments=!1,this.includeComments=!1}attrCompare(e,t){if(!e.namespaceURI&&t.namespaceURI)return-1;if(!t.namespaceURI&&e.namespaceURI)return 1;let n=e.namespaceURI+e.localName,s=t.namespaceURI+t.localName;return n===s?0:n<s?-1:1}nsCompare(e,t){let n=e.prefix,s=t.prefix;return n===s?0:n.localeCompare(s)}renderAttrs(e){let t,n,s=[];if(cx.isCommentNode(e))return this.renderComment(e);if(e.attributes)for(t=0;t<e.attributes.length;++t)n=e.attributes[t],n.name.indexOf("xmlns")!==0&&s.push(n);return s.sort(this.attrCompare),s.map(a=>` ${a.name}="${Qv.encodeSpecialCharactersInAttribute(a.value)}"`).join("")}renderNs(e,t,n,s,i){let a,o,l=[],c=n,f=[],p=e.namespaceURI||"";if(e.prefix?t.indexOf(e.prefix)===-1&&(f.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push(e.prefix)):n!==p&&(c=e.namespaceURI||"",l.push(' xmlns="',c,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)o=e.attributes[a],o.prefix==="xmlns"&&t.indexOf(o.localName)===-1&&(f.push({prefix:o.localName,namespaceURI:o.value}),t.push(o.localName)),o.prefix&&t.indexOf(o.prefix)===-1&&o.prefix!=="xmlns"&&o.prefix!=="xml"&&(f.push({prefix:o.prefix,namespaceURI:o.namespaceURI}),t.push(o.prefix));if(Qv.isArrayHasLength(i))for(let d of i){let g=!1;for(let m of f)m.prefix===d.prefix&&m.namespaceURI===d.namespaceURI&&(g=!0);g||f.push(d)}return f.sort(this.nsCompare),l.push(...f.map(d=>d.prefix?` xmlns:${d.prefix}="${d.namespaceURI}"`:` xmlns="${d.namespaceURI}"`)),{rendered:l.join(""),newDefaultNs:c}}processInner(e,t,n,s,i){if(cx.isCommentNode(e))return this.renderComment(e);if(e.data)return Qv.encodeSpecialCharactersInText(e.data);if(cx.isElementNode(e)){let a,o,l=this.renderNs(e,t,n,s,i),c=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)o=t.slice(0),c.push(this.processInner(e.childNodes[a],o,l.newDefaultNs,s,[]));return c.push("</",e.tagName,">"),c.join("")}throw new Error(`Unable to canonicalize node type: ${e.nodeType}`)}renderComment(e){if(!this.includeComments)return"";let t=e.ownerDocument===e.parentNode,n=!1,s=!1;if(t){let l=e,c=e;for(;l!==null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;c!==null;){if(c===e.ownerDocument.documentElement){s=!0;break}c=c.previousSibling}}let i=s?`
45
+ `:"",a=n?`
46
+ `:"",o=Qv.encodeSpecialCharactersInText(e.data);return`${i}<!--${o}-->${a}`}process(e,t){t=t||{};let n=t.defaultNs||"",s=t.defaultNsForPrefix||{},i=t.ancestorNamespaces||[],a=[];for(let l=0;l<i.length;l++)a.push(i[l].prefix);return this.processInner(e,a,n,s,i)}getAlgorithmName(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}};Uf.C14nCanonicalization=N3;var xK=class extends N3{static{u(this,"C14nCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"}};Uf.C14nCanonicalizationWithComments=xK});var dx=ue(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});Mf.ExclusiveCanonicalizationWithComments=Mf.ExclusiveCanonicalization=void 0;var cl=bd(),hx=Ff();function px(r,e,t){let n=!1;return r.forEach(function(s){s.prefix===e&&s.namespaceURI===t&&(n=!0)}),n}u(px,"isPrefixInScope");var T3=class{static{u(this,"ExclusiveCanonicalization")}constructor(){this.includeComments=!1,this.includeComments=!1}attrCompare(e,t){if(!e.namespaceURI&&t.namespaceURI)return-1;if(!t.namespaceURI&&e.namespaceURI)return 1;let n=e.namespaceURI+e.localName,s=t.namespaceURI+t.localName;return n===s?0:n<s?-1:1}nsCompare(e,t){let n=e.prefix,s=t.prefix;return n===s?0:n.localeCompare(s)}renderAttrs(e){let t,n,s=[],i=[];if(hx.isCommentNode(e))return this.renderComment(e);if(e.attributes)for(t=0;t<e.attributes.length;++t)n=e.attributes[t],n.name.indexOf("xmlns")!==0&&i.push(n);i.sort(this.attrCompare);for(n of i)s.push(" ",n.name,'="',cl.encodeSpecialCharactersInAttribute(n.value),'"');return s.join("")}renderNs(e,t,n,s,i){let a,o,l=[],c=n,f=[],p=e.namespaceURI||"";if(e.prefix?px(t,e.prefix,e.namespaceURI||s[e.prefix])||(f.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]})):n!==p&&(c=e.namespaceURI,l.push(' xmlns="',c,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)o=e.attributes[a],o.prefix&&!px(t,o.localName,o.value)&&i.indexOf(o.localName)>=0&&(f.push({prefix:o.localName,namespaceURI:o.value}),t.push({prefix:o.localName,namespaceURI:o.value})),o.prefix&&!px(t,o.prefix,o.namespaceURI)&&o.prefix!=="xmlns"&&o.prefix!=="xml"&&(f.push({prefix:o.prefix,namespaceURI:o.namespaceURI}),t.push({prefix:o.prefix,namespaceURI:o.namespaceURI}));f.sort(this.nsCompare);for(let d of f)l.push(" xmlns:",d.prefix,'="',d.namespaceURI,'"');return{rendered:l.join(""),newDefaultNs:c}}processInner(e,t,n,s,i){if(hx.isCommentNode(e))return this.renderComment(e);if(e.data)return cl.encodeSpecialCharactersInText(e.data);if(hx.isElementNode(e)){let a,o,l=this.renderNs(e,t,n,s,i),c=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)o=t.slice(0),c.push(this.processInner(e.childNodes[a],o,l.newDefaultNs,s,i));return c.push("</",e.tagName,">"),c.join("")}throw new Error(`Unable to exclusive canonicalize node type: ${e.nodeType}`)}renderComment(e){if(!this.includeComments)return"";let t=e.ownerDocument===e.parentNode,n=!1,s=!1;if(t){let l=e,c=e;for(;l!=null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;c!=null;){if(c===e.ownerDocument.documentElement){s=!0;break}c=c.previousSibling}}let i=s?`
47
+ `:"",a=n?`
48
+ `:"",o=cl.encodeSpecialCharactersInText(e.data);return`${i}<!--${o}-->${a}`}process(e,t){t=t||{};let n=t.inclusiveNamespacesPrefixList||[],s=t.defaultNs||"",i=t.defaultNsForPrefix||{},a=t.ancestorNamespaces||[];if(!cl.isArrayHasLength(n)){let l=cl.findChildren(e,"CanonicalizationMethod");if(l.length!==0){let c=cl.findChildren(l[0],"InclusiveNamespaces");c.length!==0&&(n=(c[0].getAttribute("PrefixList")||"").split(" "))}}return cl.isArrayHasLength(n)&&n.forEach(function(l){a&&a.forEach(function(c){l===c.prefix&&e.setAttributeNS("http://www.w3.org/2000/xmlns/",`xmlns:${l}`,c.namespaceURI)})}),this.processInner(e,[],s,i,n)}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#"}};Mf.ExclusiveCanonicalization=T3;var bK=class extends T3{static{u(this,"ExclusiveCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#WithComments"}};Mf.ExclusiveCanonicalizationWithComments=bK});var Nd=ue(jf=>{"use strict";function NK(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var n=0;n<r.length;n++)if(Object.prototype.hasOwnProperty.call(r,n)){var s=r[n];if(e.call(void 0,s,n,r))return s}}u(NK,"find");function mx(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}u(mx,"freeze");function TK(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}u(TK,"assign");var I3=mx({HTML:"text/html",isHTML:u(function(r){return r===I3.HTML},"isHTML"),XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),D3=mx({HTML:"http://www.w3.org/1999/xhtml",isHTML:u(function(r){return r===D3.HTML},"isHTML"),SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});jf.assign=TK;jf.find=NK;jf.freeze=mx;jf.MIME_TYPE=I3;jf.NAMESPACE=D3});var Tx=ue(pa=>{"use strict";var V3=Nd(),Oi=V3.find,Td=V3.NAMESPACE;function IK(r){return r!==""}u(IK,"notEmptyString");function DK(r){return r?r.split(/[\t\n\f\r ]+/).filter(IK):[]}u(DK,"splitOnASCIIWhitespace");function BK(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}u(BK,"orderedSetReducer");function B3(r){if(!r)return[];var e=DK(r);return Object.keys(e.reduce(BK,{}))}u(B3,"toOrderedSet");function RK(r){return function(e){return r&&r.indexOf(e)!==-1}}u(RK,"arrayIncludes");function Dd(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}u(Dd,"copy");function Wn(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};var n=s;u(s,"t"),s.prototype=e.prototype,s=new s,Dd(t,s),r.prototype=t=s}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}u(Wn,"_extends");var zn={},Bs=zn.ELEMENT_NODE=1,Hf=zn.ATTRIBUTE_NODE=2,e2=zn.TEXT_NODE=3,F3=zn.CDATA_SECTION_NODE=4,U3=zn.ENTITY_REFERENCE_NODE=5,OK=zn.ENTITY_NODE=6,gx=zn.PROCESSING_INSTRUCTION_NODE=7,yx=zn.COMMENT_NODE=8,M3=zn.DOCUMENT_NODE=9,j3=zn.DOCUMENT_TYPE_NODE=10,ca=zn.DOCUMENT_FRAGMENT_NODE=11,_K=zn.NOTATION_NODE=12,bn={},sn={},jne=bn.INDEX_SIZE_ERR=(sn[1]="Index size error",1),qne=bn.DOMSTRING_SIZE_ERR=(sn[2]="DOMString size error",2),$n=bn.HIERARCHY_REQUEST_ERR=(sn[3]="Hierarchy request error",3),Hne=bn.WRONG_DOCUMENT_ERR=(sn[4]="Wrong document",4),PK=bn.INVALID_CHARACTER_ERR=(sn[5]="Invalid character",5),Kne=bn.NO_DATA_ALLOWED_ERR=(sn[6]="No data allowed",6),Xne=bn.NO_MODIFICATION_ALLOWED_ERR=(sn[7]="No modification allowed",7),q3=bn.NOT_FOUND_ERR=(sn[8]="Not found",8),Gne=bn.NOT_SUPPORTED_ERR=(sn[9]="Not supported",9),R3=bn.INUSE_ATTRIBUTE_ERR=(sn[10]="Attribute in use",10),qf=bn.INVALID_STATE_ERR=(sn[11]="Invalid state",11),$ne=bn.SYNTAX_ERR=(sn[12]="Syntax error",12),Wne=bn.INVALID_MODIFICATION_ERR=(sn[13]="Invalid modification",13),zne=bn.NAMESPACE_ERR=(sn[14]="Invalid namespace",14),Jne=bn.INVALID_ACCESS_ERR=(sn[15]="Invalid access",15);function nr(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,sn[r]),this.message=sn[r],Error.captureStackTrace&&Error.captureStackTrace(this,nr);return t.code=r,e&&(this.message=this.message+": "+e),t}u(nr,"DOMException");nr.prototype=Error.prototype;Dd(bn,nr);function fa(){}u(fa,"NodeList");fa.prototype={length:0,item:u(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:u(function(r,e,t){for(var n=!!t&&!!t.requireWellFormed,s=[],i=0;i<this.length;i++)Nx(this[i],s,r,e,null,n);return s.join("")},"toString"),filter:u(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:u(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};function Kf(r,e){this._node=r,this._refresh=e,vx(this)}u(Kf,"LiveNodeList");function vx(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(e_(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];Dd(t,r),r._inc=e}}u(vx,"_updateLiveList");Kf.prototype.item=function(r){return vx(this),this[r]||null};Wn(Kf,fa);function t2(){}u(t2,"NamedNodeMap");function H3(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}u(H3,"_findNodeIndex");function O3(r,e,t,n){if(n?e[H3(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&G3(s,r,n),kK(s,r,t))}}u(O3,"_addNamedNode");function _3(r,e,t){var n=H3(e,t);if(n>=0){for(var s=e.length-1;n<s;)e[n]=e[++n];if(e.length=s,r){var i=r.ownerDocument;i&&(G3(i,r,t),t.ownerElement=null)}}else throw new nr(q3,new Error(r.tagName+"@"+t))}u(_3,"_removeNamedNode");t2.prototype={length:0,item:fa.prototype.item,getNamedItem:u(function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},"getNamedItem"),setNamedItem:u(function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new nr(R3);var t=this.getNamedItem(r.nodeName);return O3(this._ownerElement,this,r,t),t},"setNamedItem"),setNamedItemNS:u(function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new nr(R3);return t=this.getNamedItemNS(r.namespaceURI,r.localName),O3(this._ownerElement,this,r,t),t},"setNamedItemNS"),removeNamedItem:u(function(r){var e=this.getNamedItem(r);return _3(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:u(function(r,e){var t=this.getNamedItemNS(r,e);return _3(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:u(function(r,e){for(var t=this.length;t--;){var n=this[t];if(n.localName==e&&n.namespaceURI==r)return n}return null},"getNamedItemNS")};function K3(){}u(K3,"DOMImplementation");K3.prototype={hasFeature:u(function(r,e){return!0},"hasFeature"),createDocument:u(function(r,e,t){var n=new Bd;if(n.implementation=this,n.childNodes=new fa,n.doctype=t||null,t&&n.appendChild(t),e){var s=n.createElementNS(r,e);n.appendChild(s)}return n},"createDocument"),createDocumentType:u(function(r,e,t){var n=new i2;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n},"createDocumentType")};function Zt(){}u(Zt,"Node");Zt.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:u(function(r,e){return n2(this,r,e)},"insertBefore"),replaceChild:u(function(r,e){n2(this,r,e,W3),e&&this.removeChild(e)},"replaceChild"),removeChild:u(function(r){return $3(this,r)},"removeChild"),appendChild:u(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:u(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:u(function(r){return Z3(this.ownerDocument||this,this,r)},"cloneNode"),normalize:u(function(){nn(this,null,{enter:u(function(r){for(var e=r.firstChild;e;){var t=e.nextSibling;t!==null&&t.nodeType===e2&&e.nodeType===e2?(r.removeChild(t),e.appendData(t.data)):e=t}return!0},"enter")})},"normalize"),isSupported:u(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),hasAttributes:u(function(){return this.attributes.length>0},"hasAttributes"),lookupPrefix:u(function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===r)return n}e=e.nodeType==Hf?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:u(function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==Hf?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:u(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace")};function X3(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}u(X3,"_xmlEncoder");Dd(zn,Zt);Dd(zn,Zt.prototype);function r2(r,e){return nn(r,null,{enter:u(function(t){return e(t)?nn.STOP:!0},"enter")})===nn.STOP}u(r2,"_visitNode");function nn(r,e,t){for(var n=[{node:r,context:e,phase:nn.ENTER}];n.length>0;){var s=n.pop();if(s.phase===nn.ENTER){var i=t.enter(s.node,s.context);if(i===nn.STOP)return nn.STOP;if(n.push({node:s.node,context:i,phase:nn.EXIT}),i==null)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:i,phase:nn.ENTER}),a=a.previousSibling}else t.exit&&t.exit(s.node,s.context)}}u(nn,"walkDOM");nn.STOP=Symbol("walkDOM.STOP");nn.ENTER=0;nn.EXIT=1;function Bd(){this.ownerDocument=this}u(Bd,"Document");function kK(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===Td.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}u(kK,"_onAddAttribute");function G3(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===Td.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}u(G3,"_onRemoveAttribute");function Ex(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t)n[n.length++]=t;else{for(var s=e.firstChild,i=0;s;)n[i++]=s,s=s.nextSibling;n.length=i,delete n[n.length]}}}u(Ex,"_onUpdateChild");function $3(r,e){var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Ex(r.ownerDocument,r),e}u($3,"_removeChild");function LK(r){return r&&(r.nodeType===Zt.DOCUMENT_NODE||r.nodeType===Zt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Zt.ELEMENT_NODE)}u(LK,"hasValidParentNodeType");function VK(r){return r&&(_i(r)||wx(r)||ha(r)||r.nodeType===Zt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Zt.COMMENT_NODE||r.nodeType===Zt.PROCESSING_INSTRUCTION_NODE)}u(VK,"hasInsertableNodeType");function ha(r){return r&&r.nodeType===Zt.DOCUMENT_TYPE_NODE}u(ha,"isDocTypeNode");function _i(r){return r&&r.nodeType===Zt.ELEMENT_NODE}u(_i,"isElementNode");function wx(r){return r&&r.nodeType===Zt.TEXT_NODE}u(wx,"isTextNode");function P3(r,e){var t=r.childNodes||[];if(Oi(t,_i)||ha(e))return!1;var n=Oi(t,ha);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}u(P3,"isElementInsertionPossible");function k3(r,e){var t=r.childNodes||[];function n(i){return _i(i)&&i!==e}if(u(n,"hasElementChildThatIsNotChild"),Oi(t,n))return!1;var s=Oi(t,ha);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}u(k3,"isElementReplacementPossible");function FK(r,e,t){if(!LK(r))throw new nr($n,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new nr(q3,"child not in parent");if(!VK(e)||ha(e)&&r.nodeType!==Zt.DOCUMENT_NODE)throw new nr($n,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}u(FK,"assertPreInsertionValidity1to5");function UK(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Zt.DOCUMENT_FRAGMENT_NODE){var i=s.filter(_i);if(i.length>1||Oi(s,wx))throw new nr($n,"More than one element or text in fragment");if(i.length===1&&!P3(r,t))throw new nr($n,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!P3(r,t))throw new nr($n,"Only one element can be added and only after doctype");if(ha(e)){if(Oi(n,ha))throw new nr($n,"Only one doctype is allowed");var a=Oi(n,_i);if(t&&n.indexOf(a)<n.indexOf(t))throw new nr($n,"Doctype can only be inserted before an element");if(!t&&a)throw new nr($n,"Doctype can not be appended since element is present")}}u(UK,"assertPreInsertionValidityInDocument");function W3(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Zt.DOCUMENT_FRAGMENT_NODE){var i=s.filter(_i);if(i.length>1||Oi(s,wx))throw new nr($n,"More than one element or text in fragment");if(i.length===1&&!k3(r,t))throw new nr($n,"Element in fragment can not be inserted before doctype")}if(_i(e)&&!k3(r,t))throw new nr($n,"Only one element can be added and only after doctype");if(ha(e)){let l=function(c){return ha(c)&&c!==t};var o=l;if(u(l,"hasDoctypeChildThatIsNotChild"),Oi(n,l))throw new nr($n,"Only one doctype is allowed");var a=Oi(n,_i);if(t&&n.indexOf(a)<n.indexOf(t))throw new nr($n,"Doctype can only be inserted before an element")}}u(W3,"assertPreReplacementValidityInDocument");function n2(r,e,t,n){FK(r,e,t),r.nodeType===Zt.DOCUMENT_NODE&&(n||UK)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===ca){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var o=t?t.previousSibling:r.lastChild;i.previousSibling=o,a.nextSibling=t,o?o.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do{i.parentNode=r;var l=r.ownerDocument||r;Id(i,l)}while(i!==a&&(i=i.nextSibling));return Ex(r.ownerDocument||r,r),e.nodeType==ca&&(e.firstChild=e.lastChild=null),e}u(n2,"_insertBefore");function Id(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===Bs&&r.attributes)for(var t=0;t<r.attributes.length;t++){var n=r.attributes.item(t);n&&(n.ownerDocument=e)}for(var s=r.firstChild;s;)Id(s,e),s=s.nextSibling}}u(Id,"_updateOwnerDocument");function MK(r,e){e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,Ex(r.ownerDocument,r,e);var t=r.ownerDocument||r;return Id(e,t),e}u(MK,"_appendSingleChild");Bd.prototype={nodeName:"#document",nodeType:M3,doctype:null,documentElement:null,_inc:1,insertBefore:u(function(r,e){if(r.nodeType==ca){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return n2(this,r,e),Id(r,this),this.documentElement===null&&r.nodeType===Bs&&(this.documentElement=r),r},"insertBefore"),removeChild:u(function(r){return this.documentElement==r&&(this.documentElement=null),$3(this,r)},"removeChild"),replaceChild:u(function(r,e){n2(this,r,e,W3),Id(r,this),e&&this.removeChild(e),_i(r)&&(this.documentElement=r)},"replaceChild"),importNode:u(function(r,e){return jK(this,r,e)},"importNode"),getElementById:u(function(r){var e=null;return r2(this.documentElement,function(t){if(t.nodeType==Bs&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),getElementsByClassName:u(function(r){var e=B3(r);return new Kf(this,function(t){var n=[];return e.length>0&&r2(t.documentElement,function(s){if(s!==t&&s.nodeType===Bs){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var o=B3(i);a=e.every(RK(o))}a&&n.push(s)}}}),n})},"getElementsByClassName"),createElement:u(function(r){var e=new fl;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new fa;var t=e.attributes=new t2;return t._ownerElement=e,e},"createElement"),createDocumentFragment:u(function(){var r=new a2;return r.ownerDocument=this,r.childNodes=new fa,r},"createDocumentFragment"),createTextNode:u(function(r){var e=new Sx;return e.ownerDocument=this,e.appendData(r),e},"createTextNode"),createComment:u(function(r){var e=new Ax;return e.ownerDocument=this,e.appendData(r),e},"createComment"),createCDATASection:u(function(r){if(r.indexOf("]]>")!==-1)throw new nr(PK,'data contains "]]>"');var e=new Cx;return e.ownerDocument=this,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:u(function(r,e){var t=new bx;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:u(function(r){var e=new s2;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"createAttribute"),createEntityReference:u(function(r){var e=new xx;return e.ownerDocument=this,e.nodeName=r,e},"createEntityReference"),createElementNS:u(function(r,e){var t=new fl,n=e.split(":"),s=t.attributes=new t2;return t.childNodes=new fa,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,s._ownerElement=t,t},"createElementNS"),createAttributeNS:u(function(r,e){var t=new s2,n=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=!0,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,t},"createAttributeNS")};Wn(Bd,Zt);function fl(){this._nsMap={}}u(fl,"Element");fl.prototype={nodeType:Bs,hasAttribute:u(function(r){return this.getAttributeNode(r)!=null},"hasAttribute"),getAttribute:u(function(r){var e=this.getAttributeNode(r);return e&&e.value||""},"getAttribute"),getAttributeNode:u(function(r){return this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:u(function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},"setAttribute"),removeAttribute:u(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),appendChild:u(function(r){return r.nodeType===ca?this.insertBefore(r,null):MK(this,r)},"appendChild"),setAttributeNode:u(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:u(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:u(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:u(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},"getAttributeNS"),setAttributeNS:u(function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},"setAttributeNS"),getAttributeNodeNS:u(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByTagName:u(function(r){return new Kf(this,function(e){var t=[];return r2(e,function(n){n!==e&&n.nodeType==Bs&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},"getElementsByTagName"),getElementsByTagNameNS:u(function(r,e){return new Kf(this,function(t){var n=[];return r2(t,function(s){s!==t&&s.nodeType===Bs&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Bd.prototype.getElementsByTagName=fl.prototype.getElementsByTagName;Bd.prototype.getElementsByTagNameNS=fl.prototype.getElementsByTagNameNS;Wn(fl,Zt);function s2(){}u(s2,"Attr");s2.prototype.nodeType=Hf;Wn(s2,Zt);function Rd(){}u(Rd,"CharacterData");Rd.prototype={data:"",substringData:u(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:u(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:u(function(r,e){this.replaceData(r,0,e)},"insertData"),appendChild:u(function(r){throw new Error(sn[$n])},"appendChild"),deleteData:u(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:u(function(r,e,t){var n=this.data.substring(0,r),s=this.data.substring(r+e);t=n+t+s,this.nodeValue=this.data=t,this.length=t.length},"replaceData")};Wn(Rd,Zt);function Sx(){}u(Sx,"Text");Sx.prototype={nodeName:"#text",nodeType:e2,splitText:u(function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n},"splitText")};Wn(Sx,Rd);function Ax(){}u(Ax,"Comment");Ax.prototype={nodeName:"#comment",nodeType:yx};Wn(Ax,Rd);function Cx(){}u(Cx,"CDATASection");Cx.prototype={nodeName:"#cdata-section",nodeType:F3};Wn(Cx,Rd);function i2(){}u(i2,"DocumentType");i2.prototype.nodeType=j3;Wn(i2,Zt);function z3(){}u(z3,"Notation");z3.prototype.nodeType=_K;Wn(z3,Zt);function J3(){}u(J3,"Entity");J3.prototype.nodeType=OK;Wn(J3,Zt);function xx(){}u(xx,"EntityReference");xx.prototype.nodeType=U3;Wn(xx,Zt);function a2(){}u(a2,"DocumentFragment");a2.prototype.nodeName="#document-fragment";a2.prototype.nodeType=ca;Wn(a2,Zt);function bx(){}u(bx,"ProcessingInstruction");bx.prototype.nodeType=gx;Wn(bx,Zt);function Y3(){}u(Y3,"XMLSerializer");Y3.prototype.serializeToString=function(r,e,t,n){return Q3.call(r,e,t,n)};Zt.prototype.toString=Q3;function Q3(r,e,t){var n=!!t&&!!t.requireWellFormed,s=[],i=this.nodeType==9&&this.documentElement||this,a=i.prefix,o=i.namespaceURI;if(o&&a==null){var a=i.lookupPrefix(o);if(a==null)var l=[{namespace:o,prefix:null}]}return Nx(this,s,r,e,l,n),s.join("")}u(Q3,"nodeSerializeToString");function L3(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===Td.XML||s===Td.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}u(L3,"needNamespaceDefine");function Zv(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,X3),'"')}u(Zv,"addSerializedAttribute");function Nx(r,e,t,n,s,i){s||(s=[]),nn(r,{ns:s,isHTML:t},{enter:u(function(a,o){var l=o.ns,c=o.isHTML;if(n)if(a=n(a),a){if(typeof a=="string")return e.push(a),null}else return null;switch(a.nodeType){case Bs:var f=a.attributes,p=f.length,d=a.tagName;c=Td.isHTML(a.namespaceURI)||c;var g=d;if(!c&&!a.prefix&&a.namespaceURI){for(var m,v=0;v<f.length;v++)if(f.item(v).name==="xmlns"){m=f.item(v).value;break}if(!m)for(var y=l.length-1;y>=0;y--){var S=l[y];if(S.prefix===""&&S.namespace===a.namespaceURI){m=S.namespace;break}}if(m!==a.namespaceURI)for(var y=l.length-1;y>=0;y--){var S=l[y];if(S.namespace===a.namespaceURI){S.prefix&&(g=S.prefix+":"+d);break}}}e.push("<",g);for(var C=l.slice(),w=0;w<p;w++){var E=f.item(w);E.prefix=="xmlns"?C.push({prefix:E.localName,namespace:E.value}):E.nodeName=="xmlns"&&C.push({prefix:"",namespace:E.value})}for(var w=0;w<p;w++){var E=f.item(w);if(L3(E,c,C)){var A=E.prefix||"",b=E.namespaceURI;Zv(e,A?"xmlns:"+A:"xmlns",b),C.push({prefix:A,namespace:b})}var V=n?n(E):E;V&&(typeof V=="string"?e.push(V):Zv(e,V.name,V.value))}if(d===g&&L3(a,c,C)){var I=a.prefix||"",b=a.namespaceURI;Zv(e,I?"xmlns:"+I:"xmlns",b),C.push({prefix:I,namespace:b})}var D=a.firstChild;if(D||c&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(e.push(">"),c&&/^script$/i.test(d)){for(;D;)D.data?e.push(D.data):Nx(D,e,c,n,C.slice(),i),D=D.nextSibling;return e.push("</",d,">"),null}return{ns:C,isHTML:c,tag:g}}else return e.push("/>"),null;case M3:case ca:return{ns:l.slice(),isHTML:c,tag:null};case Hf:return Zv(e,a.name,a.value),null;case e2:return e.push(a.data.replace(/[<&>]/g,X3)),null;case F3:if(i&&a.data.indexOf("]]>")!==-1)throw new nr(qf,'The CDATASection data contains "]]>"');return e.push("<![CDATA[",a.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case yx:if(i&&a.data.indexOf("-->")!==-1)throw new nr(qf,'The comment node data contains "-->"');return e.push("<!--",a.data,"-->"),null;case j3:if(i){if(a.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(a.publicId))throw new nr(qf,"DocumentType publicId is not a valid PubidLiteral");if(a.systemId&&!/^("[^"]*"|'[^']*')$/.test(a.systemId))throw new nr(qf,"DocumentType systemId is not a valid SystemLiteral");if(a.internalSubset&&a.internalSubset.indexOf("]>")!==-1)throw new nr(qf,'DocumentType internalSubset contains "]>"')}var U=a.publicId,F=a.systemId;if(e.push("<!DOCTYPE ",a.name),U)e.push(" PUBLIC ",U),F&&F!="."&&e.push(" ",F),e.push(">");else if(F&&F!=".")e.push(" SYSTEM ",F,">");else{var M=a.internalSubset;M&&e.push(" [",M,"]"),e.push(">")}return null;case gx:if(i&&a.data.indexOf("?>")!==-1)throw new nr(qf,'The ProcessingInstruction data contains "?>"');return e.push("<?",a.target," ",a.data,"?>"),null;case U3:return e.push("&",a.nodeName,";"),null;default:return e.push("??",a.nodeName),null}},"enter"),exit:u(function(a,o){o&&o.tag&&e.push("</",o.tag,">")},"exit")})}u(Nx,"serializeToString");function jK(r,e,t){var n;return nn(e,null,{enter:u(function(s,i){var a=s.cloneNode(!1);a.ownerDocument=r,a.parentNode=null,i===null?n=a:i.appendChild(a);var o=s.nodeType===Hf||t;return o?a:null},"enter")}),n}u(jK,"importNode");function Z3(r,e,t){var n;return nn(e,null,{enter:u(function(s,i){var a=new s.constructor;for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o)){var l=s[o];typeof l!="object"&&l!=a[o]&&(a[o]=l)}s.childNodes&&(a.childNodes=new fa),a.ownerDocument=r;var c=t;switch(a.nodeType){case Bs:var f=s.attributes,p=a.attributes=new t2,d=f.length;p._ownerElement=a;for(var g=0;g<d;g++)a.setAttributeNode(Z3(r,f.item(g),!0));break;case Hf:c=!0}return i!==null?i.appendChild(a):n=a,c?a:null},"enter")}),n}u(Z3,"cloneNode");function e_(r,e,t){r[e]=t}u(e_,"__set__");try{Object.defineProperty&&(Object.defineProperty(Kf.prototype,"length",{get:u(function(){return vx(this),this.$$length},"get")}),Object.defineProperty(Zt.prototype,"textContent",{get:u(function(){if(this.nodeType===Bs||this.nodeType===ca){var r=[];return nn(this,null,{enter:u(function(e){if(e.nodeType===Bs||e.nodeType===ca)return!0;if(e.nodeType===gx||e.nodeType===yx)return null;r.push(e.nodeValue)},"enter")}),r.join("")}return this.nodeValue},"get"),set:u(function(r){switch(this.nodeType){case Bs:case ca:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}},"set")}),e_=u(function(r,e,t){r["$$"+e]=t},"__set__"))}catch{}pa.DocumentType=i2;pa.DOMException=nr;pa.DOMImplementation=K3;pa.Element=fl;pa.Node=Zt;pa.NodeList=fa;pa.walkDOM=nn;pa.XMLSerializer=Y3});var r_=ue(Od=>{"use strict";var t_=Nd().freeze;Od.XML_ENTITIES=t_({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Od.HTML_ENTITIES=t_({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
49
+ `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Od.entityMap=Od.HTML_ENTITIES});var c_=ue(Dx=>{"use strict";var Ld=Nd().NAMESPACE,Ix=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,n_=new RegExp("[\\-\\.0-9"+Ix.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),s_=new RegExp("^"+Ix.source+n_.source+"*(?::"+Ix.source+n_.source+"*)?$"),_d=0,No=1,Xf=2,Pd=3,Gf=4,$f=5,kd=6,o2=7;function Wf(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Wf)}u(Wf,"ParseError");Wf.prototype=new Error;Wf.prototype.name=Wf.name;function o_(){}u(o_,"XMLReader");o_.prototype={parse:u(function(r,e,t){var n=this.domBuilder;n.startDocument(),u_(e,e={}),qK(r,e,t,n,this.errorHandler),n.endDocument()},"parse")};function qK(r,e,t,n,s){function i(X){if(X>65535){X-=65536;var he=55296+(X>>10),Ce=56320+(X&1023);return String.fromCharCode(he,Ce)}else return String.fromCharCode(X)}u(i,"fixedFromCharCode");function a(X){var he=X.slice(1,-1);return Object.hasOwnProperty.call(t,he)?t[he]:he.charAt(0)==="#"?i(parseInt(he.substr(1).replace("x","0x"))):(s.error("entity not found:"+X),X)}u(a,"entityReplacer");function o(X){if(X>v){var he=r.substring(v,X).replace(/&#?\w+;/g,a);d&&l(v),n.characters(he,0,X-v),v=X}}u(o,"appendText");function l(X,he){for(;X>=f&&(he=p.exec(r));)c=he.index,f=c+he[0].length,d.lineNumber++;d.columnNumber=X-c+1}u(l,"position");for(var c=0,f=0,p=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,g=[{currentNSMap:e}],m={},v=0;;){try{var y=r.indexOf("<",v);if(y<0){if(!r.substr(v).match(/^\s*$/)){var S=n.doc,C=S.createTextNode(r.substr(v));S.appendChild(C),n.currentElement=C}return}switch(y>v&&o(y),r.charAt(y+1)){case"/":var F=r.indexOf(">",y+3),w=r.substring(y+2,F).replace(/[ \t\n\r]+$/g,""),E=g.pop();F<0?(w=r.substring(y+2).replace(/[\s<].*/,""),s.error("end tag name: "+w+" is not complete:"+E.tagName),F=y+1+w.length):w.match(/\s</)&&(w=w.replace(/[\s<].*/,""),s.error("end tag name: "+w+" maybe not complete"),F=y+1+w.length);var A=E.localNSMap,b=E.tagName==w,V=b||E.tagName&&E.tagName.toLowerCase()==w.toLowerCase();if(V){if(n.endElement(E.uri,E.localName,w),A)for(var I in A)Object.prototype.hasOwnProperty.call(A,I)&&n.endPrefixMapping(I);b||s.fatalError("end tag name: "+w+" is not match the current start tagName:"+E.tagName)}else g.push(E);F++;break;case"?":d&&l(y),F=$K(r,y,n);break;case"!":d&&l(y),F=GK(r,y,n,s);break;default:d&&l(y);var D=new l_,U=g[g.length-1].currentNSMap,F=HK(r,y,D,U,a,s),M=D.length;if(!D.closed&&XK(r,F,D.tagName,m)&&(D.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&M){for(var se=i_(d,{}),ee=0;ee<M;ee++){var ie=D[ee];l(ie.offset),ie.locator=i_(d,{})}n.locator=se,a_(D,n,U)&&g.push(D),n.locator=d}else a_(D,n,U)&&g.push(D);Ld.isHTML(D.uri)&&!D.closed?F=KK(r,F,D.tagName,a,n):F++}}catch(X){if(X instanceof Wf)throw X;s.error("element parse error: "+X),F=-1}F>v?v=F:o(Math.max(y,v)+1)}}u(qK,"parse");function i_(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}u(i_,"copyLocator");function HK(r,e,t,n,s,i){function a(g,m,v){t.attributeNames.hasOwnProperty(g)&&i.fatalError("Attribute "+g+" redefined"),t.addValue(g,m.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),v)}u(a,"addAttribute");for(var o,l,c=++e,f=_d;;){var p=r.charAt(c);switch(p){case"=":if(f===No)o=r.slice(e,c),f=Pd;else if(f===Xf)f=Pd;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===Pd||f===No)if(f===No&&(i.warning('attribute value must after "="'),o=r.slice(e,c)),e=c+1,c=r.indexOf(p,e),c>0)l=r.slice(e,c),a(o,l,e-1),f=$f;else throw new Error("attribute value no end '"+p+"' match");else if(f==Gf)l=r.slice(e,c),a(o,l,e),i.warning('attribute "'+o+'" missed start quot('+p+")!!"),e=c+1,f=$f;else throw new Error('attribute value must after "="');break;case"/":switch(f){case _d:t.setTagName(r.slice(e,c));case $f:case kd:case o2:f=o2,t.closed=!0;case Gf:case No:break;case Xf:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),f==_d&&t.setTagName(r.slice(e,c)),c;case">":switch(f){case _d:t.setTagName(r.slice(e,c));case $f:case kd:case o2:break;case Gf:case No:l=r.slice(e,c),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case Xf:f===Xf&&(l=o),f==Gf?(i.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):((!Ld.isHTML(n[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Pd:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(f){case _d:t.setTagName(r.slice(e,c)),f=kd;break;case No:o=r.slice(e,c),f=Xf;break;case Gf:var l=r.slice(e,c);i.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case $f:f=kd;break}else switch(f){case Xf:var d=t.tagName;(!Ld.isHTML(n[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=c,f=No;break;case $f:i.warning('attribute space is required"'+o+'"!!');case kd:f=No,e=c;break;case Pd:f=Gf,e=c;break;case o2:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}u(HK,"parseElementStartPart");function a_(r,e,t){for(var n=r.tagName,s=null,p=r.length;p--;){var i=r[p],a=i.qName,o=i.value,d=a.indexOf(":");if(d>0)var l=i.prefix=a.slice(0,d),c=a.slice(d+1),f=l==="xmlns"&&c;else c=a,l=null,f=a==="xmlns"&&"";i.localName=c,f!==!1&&(s==null&&(s={},u_(t,t={})),t[f]=s[f]=o,i.uri=Ld.XMLNS,e.startPrefixMapping(f,o))}for(var p=r.length;p--;){i=r[p];var l=i.prefix;l&&(l==="xml"&&(i.uri=Ld.XML),l!=="xmlns"&&(i.uri=t[l||""]))}var d=n.indexOf(":");d>0?(l=r.prefix=n.slice(0,d),c=r.localName=n.slice(d+1)):(l=null,c=r.localName=n);var g=r.uri=t[l||""];if(e.startElement(g,c,n,r),r.closed){if(e.endElement(g,c,n),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=s,!0}u(a_,"appendElement");function KK(r,e,t,n,s){if(/^(?:script|textarea)$/i.test(t)){var i=r.indexOf("</"+t+">",e),a=r.substring(e+1,i);if(/[&<]/.test(a))return/^script$/i.test(t)?(s.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,n),s.characters(a,0,a.length),i)}return e+1}u(KK,"parseHtmlSpecialContent");function XK(r,e,t,n){var s=n[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),n[t]=s),s<e}u(XK,"fixSelfClosed");function u_(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}u(u_,"_copy");function GK(r,e,t,n){var s=r.charAt(e+2);switch(s){case"-":if(r.charAt(e+3)==="-"){var i=r.indexOf("-->",e+4);return i>e?(t.comment(r,e+4,i-e-4),i+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(e+3,6)=="CDATA["){var i=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,i-e-9),t.endCDATA(),i+3}var a=WK(r,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],c=!1,f=!1;o>3&&(/^public$/i.test(a[2][0])?(c=a[3][0],f=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(f=a[3][0]));var p=a[o-1];return t.startDTD(l,c,f),t.endDTD(),p.index+p[0].length}}return-1}u(GK,"parseDCC");function $K(r,e,t){var n=r.indexOf("?>",e);if(n){var s=r.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(s){var i=s[0].length;return t.processingInstruction(s[1],s[2]),n+2}else return-1}return-1}u($K,"parseInstruction");function l_(){this.attributeNames={}}u(l_,"ElementAttributes");l_.prototype={setTagName:u(function(r){if(!s_.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},"setTagName"),addValue:u(function(r,e,t){if(!s_.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},"addValue"),length:0,getLocalName:u(function(r){return this[r].localName},"getLocalName"),getLocator:u(function(r){return this[r].locator},"getLocator"),getQName:u(function(r){return this[r].qName},"getQName"),getURI:u(function(r){return this[r].uri},"getURI"),getValue:u(function(r){return this[r].value},"getValue")};function WK(r,e){var t,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(n.push(t),t[1])return n}u(WK,"split");Dx.XMLReader=o_;Dx.ParseError=Wf});var y_=ue(l2=>{"use strict";var zK=Nd(),JK=Tx(),f_=r_(),d_=c_(),YK=JK.DOMImplementation,h_=zK.NAMESPACE,QK=d_.ParseError,ZK=d_.XMLReader;function m_(r){return r.replace(/\r[\n\u0085]/g,`
50
+ `).replace(/[\r\u0085\u2028]/g,`
51
+ `)}u(m_,"normalizeLineEndings");function g_(r){this.options=r||{locator:{}}}u(g_,"DOMParser");g_.prototype.parseFromString=function(r,e){var t=this.options,n=new ZK,s=t.domBuilder||new Vd,i=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),c=l?f_.HTML_ENTITIES:f_.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=eX(i,s,a),n.domBuilder=t.domBuilder||s,l&&(o[""]=h_.HTML),o.xml=o.xml||h_.XML;var f=t.normalizeLineEndings||m_;return r&&typeof r=="string"?n.parse(f(r),o,c):n.errorHandler.error("invalid doc source"),s.doc};function eX(r,e,t){if(!r){if(e instanceof Vd)return e;r=e}var n={},s=r instanceof Function;t=t||{};function i(a){var o=r[a];!o&&s&&(o=r.length==2?function(l){r(a,l)}:r),n[a]=o&&function(l){o("[xmldom "+a+"] "+l+Bx(t))}||function(){}}return u(i,"build"),i("warning"),i("error"),i("fatalError"),n}u(eX,"buildErrorHandler");function Vd(){this.cdata=!1}u(Vd,"DOMHandler");function zf(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}u(zf,"position");Vd.prototype={startDocument:u(function(){this.doc=new YK().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},"startDocument"),startElement:u(function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;u2(this,i),this.currentElement=i,this.locator&&zf(this.locator,i);for(var o=0;o<a;o++){var r=n.getURI(o),l=n.getValue(o),t=n.getQName(o),c=s.createAttributeNS(r,t);this.locator&&zf(n.getLocator(o),c),c.value=c.nodeValue=l,i.setAttributeNode(c)}},"startElement"),endElement:u(function(r,e,t){var n=this.currentElement,s=n.tagName;this.currentElement=n.parentNode},"endElement"),startPrefixMapping:u(function(r,e){},"startPrefixMapping"),endPrefixMapping:u(function(r){},"endPrefixMapping"),processingInstruction:u(function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&zf(this.locator,t),u2(this,t)},"processingInstruction"),ignorableWhitespace:u(function(r,e,t){},"ignorableWhitespace"),characters:u(function(r,e,t){if(r=p_.apply(this,arguments),r){if(this.cdata)var n=this.doc.createCDATASection(r);else var n=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(r)&&this.doc.appendChild(n),this.locator&&zf(this.locator,n)}},"characters"),skippedEntity:u(function(r){},"skippedEntity"),endDocument:u(function(){this.doc.normalize()},"endDocument"),setDocumentLocator:u(function(r){(this.locator=r)&&(r.lineNumber=0)},"setDocumentLocator"),comment:u(function(r,e,t){r=p_.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&zf(this.locator,n),u2(this,n)},"comment"),startCDATA:u(function(){this.cdata=!0},"startCDATA"),endCDATA:u(function(){this.cdata=!1},"endCDATA"),startDTD:u(function(r,e,t){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(r,e,t);this.locator&&zf(this.locator,s),u2(this,s),this.doc.doctype=s}},"startDTD"),warning:u(function(r){console.warn("[xmldom warning] "+r,Bx(this.locator))},"warning"),error:u(function(r){console.error("[xmldom error] "+r,Bx(this.locator))},"error"),fatalError:u(function(r){throw new QK(r,this.locator)},"fatalError")};function Bx(r){if(r)return`
52
+ @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}u(Bx,"_locator");function p_(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}u(p_,"_toString");"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Vd.prototype[r]=function(){return null}});function u2(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}u(u2,"appendElement");l2.__DOMHandler=Vd;l2.normalizeLineEndings=m_;l2.DOMParser=g_});var E_=ue(c2=>{"use strict";var v_=Tx();c2.DOMImplementation=v_.DOMImplementation;c2.XMLSerializer=v_.XMLSerializer;c2.DOMParser=y_().DOMParser});var w_=ue(h2=>{"use strict";Object.defineProperty(h2,"__esModule",{value:!0});h2.EnvelopedSignature=void 0;var f2=Jv(),Rx=Ff(),tX=class{static{u(this,"EnvelopedSignature")}constructor(){this.includeComments=!1,this.includeComments=!1}process(e,t){if(t.signatureNode==null){let i=f2.select1("./*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);return Rx.isNodeLike(i)&&i.parentNode&&i.parentNode.removeChild(i),e}let n=t.signatureNode,s=f2.select1(".//*[local-name(.)='SignatureValue']/text()",n);if(Rx.isTextNode(s)){let i=s.data,a=f2.select(".//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);for(let o of Array.isArray(a)?a:[]){let l=f2.select1(".//*[local-name(.)='SignatureValue']/text()",o);if(Rx.isTextNode(l)){let c=l.data;i===c&&o.parentNode&&o.parentNode.removeChild(o)}}}return e}getAlgorithmName(){return"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}};h2.EnvelopedSignature=tX});var S_=ue(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.Sha512=To.Sha256=To.Sha1=void 0;var Ox=st("crypto"),rX=class{static{u(this,"Sha1")}constructor(){this.getHash=function(e){let t=Ox.createHash("sha1");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2000/09/xmldsig#sha1"}}};To.Sha1=rX;var nX=class{static{u(this,"Sha256")}constructor(){this.getHash=function(e){let t=Ox.createHash("sha256");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha256"}}};To.Sha256=nX;var sX=class{static{u(this,"Sha512")}constructor(){this.getHash=function(e){let t=Ox.createHash("sha512");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha512"}}};To.Sha512=sX});var _x=ue(p2=>{"use strict";Object.defineProperty(p2,"__esModule",{value:!0});p2.createOptionalCallbackFunction=void 0;function iX(r){return typeof r=="function"}u(iX,"isErrorFirstCallback");function aX(r){return(...e)=>{let t=e[e.length-1];if(iX(t))try{let n=r(...e.slice(0,-1));t(null,n)}catch(n){t(n instanceof Error?n:new Error("Unknown error"))}else return r(...e)}}u(aX,"createOptionalCallbackFunction");p2.createOptionalCallbackFunction=aX});var A_=ue(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.HmacSha1=Pi.RsaSha512=Pi.RsaSha256=Pi.RsaSha1=void 0;var Io=st("crypto"),Do=_x(),oX=class{static{u(this,"RsaSha1")}constructor(){this.getSignature=(0,Do.createOptionalCallbackFunction)((e,t)=>{let n=Io.createSign("RSA-SHA1");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Do.createOptionalCallbackFunction)((e,t,n)=>{let s=Io.createVerify("RSA-SHA1");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2000/09/xmldsig#rsa-sha1"}};Pi.RsaSha1=oX;var uX=class{static{u(this,"RsaSha256")}constructor(){this.getSignature=(0,Do.createOptionalCallbackFunction)((e,t)=>{let n=Io.createSign("RSA-SHA256");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Do.createOptionalCallbackFunction)((e,t,n)=>{let s=Io.createVerify("RSA-SHA256");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"}};Pi.RsaSha256=uX;var lX=class{static{u(this,"RsaSha512")}constructor(){this.getSignature=(0,Do.createOptionalCallbackFunction)((e,t)=>{let n=Io.createSign("RSA-SHA512");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,Do.createOptionalCallbackFunction)((e,t,n)=>{let s=Io.createVerify("RSA-SHA512");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"}};Pi.RsaSha512=lX;var cX=class{static{u(this,"HmacSha1")}constructor(){this.getSignature=(0,Do.createOptionalCallbackFunction)((e,t)=>{let n=Io.createHmac("SHA1",t);return n.update(e),n.digest("base64")}),this.verifySignature=(0,Do.createOptionalCallbackFunction)((e,t,n)=>{let s=Io.createHmac("SHA1",t);return s.update(e),s.digest("base64")===n}),this.getAlgorithmName=()=>"http://www.w3.org/2000/09/xmldsig#hmac-sha1"}};Pi.HmacSha1=cX});var b_=ue(m2=>{"use strict";Object.defineProperty(m2,"__esModule",{value:!0});m2.SignedXml=void 0;var fs=Ff(),hl=E_(),fX=st("util"),Rs=Jv(),C_=fx(),hX=w_(),x_=dx(),Px=S_(),d2=A_(),Kt=bd(),kx=class Jf{static{u(this,"SignedXml")}constructor(e={}){this.signatureAlgorithm=void 0,this.canonicalizationAlgorithm=void 0,this.inclusiveNamespacesPrefixList=[],this.namespaceResolver={lookupNamespaceURI:u(function(){throw new Error("Not implemented")},"lookupNamespaceURI")},this.implicitTransforms=[],this.keyInfoAttributes={},this.getKeyInfoContent=Jf.getKeyInfoContent,this.getCertFromKeyInfo=Jf.getCertFromKeyInfo,this.id=0,this.signedXml="",this.signatureXml="",this.signatureNode=null,this.signatureValue="",this.originalXmlWithIds="",this.keyInfo=null,this.references=[],this.signedReferences=[],this.CanonicalizationAlgorithms={"http://www.w3.org/TR/2001/REC-xml-c14n-20010315":C_.C14nCanonicalization,"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":C_.C14nCanonicalizationWithComments,"http://www.w3.org/2001/10/xml-exc-c14n#":x_.ExclusiveCanonicalization,"http://www.w3.org/2001/10/xml-exc-c14n#WithComments":x_.ExclusiveCanonicalizationWithComments,"http://www.w3.org/2000/09/xmldsig#enveloped-signature":hX.EnvelopedSignature},this.HashAlgorithms={"http://www.w3.org/2000/09/xmldsig#sha1":Px.Sha1,"http://www.w3.org/2001/04/xmlenc#sha256":Px.Sha256,"http://www.w3.org/2001/04/xmlenc#sha512":Px.Sha512},this.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#rsa-sha1":d2.RsaSha1,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":d2.RsaSha256,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":d2.RsaSha512};let{idMode:t,idAttribute:n,privateKey:s,publicCert:i,signatureAlgorithm:a,canonicalizationAlgorithm:o,inclusiveNamespacesPrefixList:l,implicitTransforms:c,keyInfoAttributes:f,getKeyInfoContent:p,getCertFromKeyInfo:d}=e;this.idMode=t,this.idAttributes=["Id","ID","id"],n&&this.idAttributes.unshift(n),this.privateKey=s,this.publicCert=i,this.signatureAlgorithm=a??this.signatureAlgorithm,this.canonicalizationAlgorithm=o,typeof l=="string"?this.inclusiveNamespacesPrefixList=l.split(" "):Kt.isArrayHasLength(l)&&(this.inclusiveNamespacesPrefixList=l),this.implicitTransforms=c??this.implicitTransforms,this.keyInfoAttributes=f??this.keyInfoAttributes,this.getKeyInfoContent=p??this.getKeyInfoContent,this.getCertFromKeyInfo=d??Jf.noop,this.CanonicalizationAlgorithms,this.HashAlgorithms,this.SignatureAlgorithms}enableHMAC(){this.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#hmac-sha1":d2.HmacSha1},this.getKeyInfoContent=Jf.noop}static getKeyInfoContent({publicCert:e,prefix:t}){if(e==null)return null;t=t?`${t}:`:"";let n="";Buffer.isBuffer(e)&&(e=e.toString("latin1"));let s=[];return typeof e=="string"&&(s=e.match(Kt.EXTRACT_X509_CERTS)||[]),s.length>0&&(n=s.map(i=>`<${t}X509Certificate>${Kt.pemToDer(i).toString("base64")}</${t}X509Certificate>`).join("")),`<${t}X509Data>${n}</${t}X509Data>`}static getCertFromKeyInfo(e){if(e!=null){let t=Rs.select1(".//*[local-name(.)='X509Certificate']",e);if(fs.isNodeLike(t))return Kt.derToPem(t.textContent??"","CERTIFICATE")}return null}checkSignature(e,t){if(t!=null&&typeof t!="function")throw new Error("Last parameter must be a callback function");this.signedXml=e;let n=new hl.DOMParser().parseFromString(e);this.references=[];let s=this.getCanonSignedInfoXml(n);if(!s){if(t){t(new Error("Canonical signed info cannot be empty"),!1);return}throw new Error("Canonical signed info cannot be empty")}let a=new hl.DOMParser().parseFromString(s,"text/xml").documentElement;if(!a){if(t){t(new Error("Could not parse unverifiedSignedInfoCanon into a document"),!1);return}throw new Error("Could not parse unverifiedSignedInfoCanon into a document")}let o=Kt.findChildren(a,"Reference");if(!Kt.isArrayHasLength(o)){if(t){t(new Error("could not find any Reference elements"),!1);return}throw new Error("could not find any Reference elements")}for(let p of o)this.loadReference(p);if(!this.getReferences().every(p=>this.validateReference(p,n))){if(this.signedReferences=[],this.references.forEach(p=>{p.signedReference=void 0}),t){t(new Error("Could not validate all references"),!1);return}return!1}let l=this.findSignatureAlgorithm(this.signatureAlgorithm),c=this.getCertFromKeyInfo(this.keyInfo)||this.publicCert||this.privateKey;if(c==null)throw new Error("KeyInfo or publicCert or privateKey is required to validate signature");if(l.verifySignature(s,c,this.signatureValue)===!0)if(t)t(null,!0);else return!0;else if(this.signedReferences=[],this.references.forEach(p=>{p.signedReference=void 0}),t){t(new Error(`invalid signature: the signature value ${this.signatureValue} is incorrect`));return}else throw new Error(`invalid signature: the signature value ${this.signatureValue} is incorrect`)}getCanonSignedInfoXml(e){if(this.signatureNode==null)throw new Error("No signature found.");if(typeof this.canonicalizationAlgorithm!="string")throw new Error("Missing canonicalizationAlgorithm when trying to get signed info for XML");let t=Kt.findChildren(this.signatureNode,"SignedInfo");if(t.length===0)throw new Error("could not find SignedInfo element in the message");if(t.length>1)throw new Error("could not get canonicalized signed info for a signature that contains multiple SignedInfo nodes");if((this.canonicalizationAlgorithm==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"||this.canonicalizationAlgorithm==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments")&&(!e||typeof e!="object"))throw new Error("When canonicalization method is non-exclusive, whole xml dom must be provided as an argument");let s={ancestorNamespaces:Kt.findAncestorNs(e,"//*[local-name()='SignedInfo']")};return this.getCanonXml([this.canonicalizationAlgorithm],t[0],s)}getCanonReferenceXml(e,t,n){Array.isArray(t.transforms)&&(t.ancestorNamespaces=Kt.findAncestorNs(e,t.xpath,this.namespaceResolver));let s={inclusiveNamespacesPrefixList:t.inclusiveNamespacesPrefixList,ancestorNamespaces:t.ancestorNamespaces};return this.getCanonXml(t.transforms,n,s)}calculateSignatureValue(e,t){let n=this.getCanonSignedInfoXml(e),s=this.findSignatureAlgorithm(this.signatureAlgorithm);if(this.privateKey==null)throw new Error("Private key is required to compute signature");typeof t=="function"?s.getSignature(n,this.privateKey,t):this.signatureValue=s.getSignature(n,this.privateKey)}findSignatureAlgorithm(e){if(e==null)throw new Error("signatureAlgorithm is required");let t=this.SignatureAlgorithms[e];if(t)return new t;throw new Error(`signature algorithm '${e}' is not supported`)}findCanonicalizationAlgorithm(e){if(e!=null){let t=this.CanonicalizationAlgorithms[e];if(t)return new t}throw new Error(`canonicalization algorithm '${e}' is not supported`)}findHashAlgorithm(e){let t=this.HashAlgorithms[e];if(t)return new t;throw new Error(`hash algorithm '${e}' is not supported`)}validateElementAgainstReferences(e,t){let n;if(typeof e=="string"){let s=Rs.select1(e,t);fs.assertIsElementNode(s),n=s}else n=e;for(let s of this.getReferences()){let i=s.uri?.[0]==="#"?s.uri.substring(1):s.uri;for(let c of this.idAttributes){let f=n.getAttribute(c);if(i===f){s.xpath=`//*[@*[local-name(.)='${c}']='${i}']`;break}}let a=this.getCanonReferenceXml(t,s,n),l=this.findHashAlgorithm(s.digestAlgorithm).getHash(a);if(Kt.validateDigestValue(l,s.digestValue))return s}throw new Error("No references passed validation")}validateReference(e,t){let n=e.uri?.[0]==="#"?e.uri.substring(1):e.uri,s=null;if(n==="")s=Rs.select1("//*",t);else{if(n?.indexOf("'")!==-1)throw new Error("Cannot validate a uri with quotes inside it");{let l=0;for(let c of this.idAttributes){let f=`//*[@*[local-name(.)='${c}']='${n}']`,p=Rs.select(f,t);if(Kt.isArrayHasLength(p)){if(l+=p.length,l>1)throw new Error("Cannot validate a document which contains multiple elements with the same value for the ID / Id / Id attributes, in order to prevent signature wrapping attack.");s=p[0],e.xpath=f}}}}if(e.getValidatedNode=(0,fX.deprecate)(l=>{if(l=l||e.xpath,typeof l!="string"||e.validationError!=null)return null;let c=Rs.select1(l,t);return fs.isNodeLike(c)?c:null},"`ref.getValidatedNode()` is deprecated and insecure. Use `ref.signedReference` or `this.getSignedReferences()` instead."),!fs.isNodeLike(s)){let l=new Error(`invalid signature: the signature references an element with uri ${e.uri} but could not find such element in the xml`);return e.validationError=l,!1}let i=this.getCanonReferenceXml(t,e,s),o=this.findHashAlgorithm(e.digestAlgorithm).getHash(i);if(!Kt.validateDigestValue(o,e.digestValue)){let l=new Error(`invalid signature: for uri ${e.uri} calculated digest is ${o} but the xml to validate supplies digest ${e.digestValue}`);return e.validationError=l,!1}return this.signedReferences.push(i),e.signedReference=i,!0}findSignatures(e){let t=Rs.select("//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);return fs.isArrayOfNodes(t)?t:[]}loadSignature(e){typeof e=="string"?this.signatureNode=e=new hl.DOMParser().parseFromString(e):this.signatureNode=e,this.signatureXml=e.toString();let t=Rs.select1(".//*[local-name(.)='CanonicalizationMethod']/@Algorithm",e);if(!fs.isNodeLike(t))throw new Error("could not find CanonicalizationMethod/@Algorithm element");fs.isAttributeNode(t)&&(this.canonicalizationAlgorithm=t.value);let n=Rs.select1(".//*[local-name(.)='SignatureMethod']/@Algorithm",e);fs.isAttributeNode(n)&&(this.signatureAlgorithm=n.value);let s=Kt.findChildren(this.signatureNode,"SignedInfo");if(!Kt.isArrayHasLength(s))throw new Error("no signed info node found");if(s.length>1)throw new Error("could not load signature that contains multiple SignedInfo nodes");let i=this.canonicalizationAlgorithm;(!i||i==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"||i==="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments")&&(i="http://www.w3.org/2001/10/xml-exc-c14n#");let a=this.getCanonXml([i],s[0]),l=new hl.DOMParser().parseFromString(a,"text/xml").documentElement;this.references=[];let c=Kt.findChildren(l,"Reference");if(!Kt.isArrayHasLength(c))throw new Error("could not find any Reference elements");for(let d of c)this.loadReference(d);let f=Rs.select1(".//*[local-name(.)='SignatureValue']/text()",e);fs.isTextNode(f)&&(this.signatureValue=f.data.replace(/\r?\n/g,""));let p=Rs.select1(".//*[local-name(.)='KeyInfo']",e);fs.isNodeLike(p)&&(this.keyInfo=p)}loadReference(e){let t=Kt.findChildren(e,"DigestMethod");if(t.length===0)throw new Error(`could not find DigestMethod in reference ${e.toString()}`);let n=t[0],s=Kt.findAttr(n,"Algorithm");if(!s)throw new Error(`could not find Algorithm attribute in node ${n.toString()}`);let i=s.value;if(t=Kt.findChildren(e,"DigestValue"),t.length===0)throw new Error(`could not find DigestValue node in reference ${e.toString()}`);if(t.length>1)throw new Error(`could not load reference for a node that contains multiple DigestValue nodes: ${e.toString()}`);let a=t[0].textContent;if(!a)throw new Error(`could not find the value of DigestValue in ${e.toString()}`);let o=[],l=[];if(t=Kt.findChildren(e,"Transforms"),t.length!==0){let f=t[0],p=Kt.findChildren(f,"Transform");for(let g of p){let m=Kt.findAttr(g,"Algorithm");m&&o.push(m.value)}let d=Kt.findChildren(p[p.length-1],"InclusiveNamespaces");Kt.isArrayHasLength(d)&&(l=d.flatMap(g=>(g.getAttribute("PrefixList")??"").split(" ")).filter(g=>g.length>0))}Kt.isArrayHasLength(this.implicitTransforms)&&this.implicitTransforms.forEach(function(f){o.push(f)}),(o.length===0||o[o.length-1]==="http://www.w3.org/2000/09/xmldsig#enveloped-signature")&&o.push("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");let c=fs.isElementNode(e)&&e.getAttribute("URI")||void 0;this.addReference({transforms:o,digestAlgorithm:i,uri:c,digestValue:a,inclusiveNamespacesPrefixList:l,isEmptyUri:!1})}addReference({xpath:e,transforms:t,digestAlgorithm:n,uri:s="",digestValue:i,inclusiveNamespacesPrefixList:a=[],isEmptyUri:o=!1}){if(n==null)throw new Error("digestAlgorithm is required");if(!Kt.isArrayHasLength(t))throw new Error("transforms must contain at least one transform algorithm");this.references.push({xpath:e,transforms:t,digestAlgorithm:n,uri:s,digestValue:i,inclusiveNamespacesPrefixList:a,isEmptyUri:o,getValidatedNode:u(()=>{throw new Error("Reference has not been validated yet; Did you call `sig.checkSignature()`?")},"getValidatedNode")})}getReferences(){return this.references}getSignedReferences(){return[...this.signedReferences]}computeSignature(e,t,n){let s;typeof t=="function"&&n==null?(s=t,t={}):(s=n,t=t??{});let i=new hl.DOMParser().parseFromString(e),a="xmlns",o=[],l,c=["append","prepend","before","after"],f=t.prefix,p=t.attrs||{},d=t.location||{},g=t.existingPrefixes||{};if(this.namespaceResolver={lookupNamespaceURI:u(function(b){return b?g[b]:null},"lookupNamespaceURI")},d.reference=d.reference||"/*",d.action=d.action||"append",c.indexOf(d.action)===-1){let b=new Error(`location.action option has an invalid action: ${d.action}, must be any of the following values: ${c.join(", ")}`);if(s){s(b);return}else throw b}f?(a+=`:${f}`,l=`${f}:`):l="",Object.keys(p).forEach(function(b){b!=="xmlns"&&b!==a&&o.push(`${b}="${p[b]}"`)}),o.push(`${a}="http://www.w3.org/2000/09/xmldsig#"`);let m=`<${l}Signature ${o.join(" ")}>`;m+=this.createSignedInfo(i,f),m+=this.getKeyInfo(f),m+=`</${l}Signature>`,this.originalXmlWithIds=i.toString();let v="";Object.keys(g).forEach(function(b){v+=`xmlns:${b}="${g[b]}" `});let y=`<Dummy ${v}>${m}</Dummy>`,C=new hl.DOMParser().parseFromString(y).documentElement.firstChild,w=Rs.select1(d.reference,i);if(!fs.isNodeLike(w)){let b=new Error(`the following xpath cannot be used because it was not found: ${d.reference}`);if(s){s(b);return}else throw b}if(d.action==="append")w.appendChild(C);else if(d.action==="prepend")w.insertBefore(C,w.firstChild);else if(d.action==="before"){if(w.parentNode==null)throw new Error("`location.reference` refers to the root node (by default), so we can't insert `before`");w.parentNode.insertBefore(C,w)}else if(d.action==="after"){if(w.parentNode==null)throw new Error("`location.reference` refers to the root node (by default), so we can't insert `after`");w.parentNode.insertBefore(C,w.nextSibling)}this.signatureNode=C;let E=Kt.findChildren(this.signatureNode,"SignedInfo");if(E.length===0){let b=new Error("could not find SignedInfo element in the message");if(s){s(b);return}else throw b}let A=E[0];typeof s=="function"?this.calculateSignatureValue(i,(b,V)=>{b?s(b):(this.signatureValue=V||"",C.insertBefore(this.createSignature(f),A.nextSibling),this.signatureXml=C.toString(),this.signedXml=i.toString(),s(null,this))}):(this.calculateSignatureValue(i),C.insertBefore(this.createSignature(f),A.nextSibling),this.signatureXml=C.toString(),this.signedXml=i.toString())}getKeyInfo(e){let t=e?`${e}:`:"",n="";this.keyInfoAttributes&&Object.keys(this.keyInfoAttributes).forEach(i=>{n+=` ${i}="${this.keyInfoAttributes[i]}"`});let s=this.getKeyInfoContent({publicCert:this.publicCert,prefix:e});return n||s?`<${t}KeyInfo${n}>${s}</${t}KeyInfo>`:""}createReferences(e,t){let n="";t=t||"",t=t&&`${t}:`;for(let s of this.getReferences()){let i=Rs.selectWithResolver(s.xpath??"",e,this.namespaceResolver);if(!Kt.isArrayHasLength(i))throw new Error(`the following xpath cannot be signed because it was not found: ${s.xpath}`);for(let a of i){if(s.isEmptyUri)n+=`<${t}Reference URI="">`;else{let c=this.ensureHasId(a);s.uri=c,n+=`<${t}Reference URI="#${c}">`}n+=`<${t}Transforms>`;for(let c of s.transforms||[]){let f=this.findCanonicalizationAlgorithm(c);n+=`<${t}Transform Algorithm="${f.getAlgorithmName()}"`,Kt.isArrayHasLength(s.inclusiveNamespacesPrefixList)?(n+=">",n+=`<InclusiveNamespaces PrefixList="${s.inclusiveNamespacesPrefixList.join(" ")}" xmlns="${f.getAlgorithmName()}"/>`,n+=`</${t}Transform>`):n+=" />"}let o=this.getCanonReferenceXml(e,s,a),l=this.findHashAlgorithm(s.digestAlgorithm);n+=`</${t}Transforms><${t}DigestMethod Algorithm="${l.getAlgorithmName()}" /><${t}DigestValue>${l.getHash(o)}</${t}DigestValue></${t}Reference>`}}return n}getCanonXml(e,t,n={}){n.defaultNsForPrefix=n.defaultNsForPrefix??Jf.defaultNsForPrefix,n.signatureNode=this.signatureNode;let i=t.cloneNode(!0);return e.forEach(a=>{fs.isNodeLike(i)&&(i=this.findCanonicalizationAlgorithm(a).process(i,n))}),i.toString()}ensureHasId(e){let t;if(this.idMode==="wssecurity"?t=Kt.findAttr(e,"Id","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"):this.idAttributes.some(s=>(t=Kt.findAttr(e,s),!!t)),t)return t.value;let n=`_${this.id++}`;return this.idMode==="wssecurity"?(e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:wsu","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"),e.setAttributeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd","wsu:Id",n)):e.setAttribute("Id",n),n}createSignedInfo(e,t){if(typeof this.canonicalizationAlgorithm!="string")throw new Error("Missing canonicalizationAlgorithm when trying to create signed info for XML");let n=this.findCanonicalizationAlgorithm(this.canonicalizationAlgorithm),s=this.findSignatureAlgorithm(this.signatureAlgorithm),i;i=t||"",i=i&&`${i}:`;let a=`<${i}SignedInfo>`;return a+=`<${i}CanonicalizationMethod Algorithm="${n.getAlgorithmName()}"`,Kt.isArrayHasLength(this.inclusiveNamespacesPrefixList)?(a+=">",a+=`<InclusiveNamespaces PrefixList="${this.inclusiveNamespacesPrefixList.join(" ")}" xmlns="${n.getAlgorithmName()}"/>`,a+=`</${i}CanonicalizationMethod>`):a+=" />",a+=`<${i}SignatureMethod Algorithm="${s.getAlgorithmName()}" />`,a+=this.createReferences(e,t),a+=`</${i}SignedInfo>`,a}createSignature(e){let t="xmlns";e?(t+=`:${e}`,e+=":"):e="";let n=`<${e}SignatureValue>${this.signatureValue}</${e}SignatureValue>`,s=`<${e}Signature ${t}="http://www.w3.org/2000/09/xmldsig#">${n}</${e}Signature>`;return new hl.DOMParser().parseFromString(s).documentElement.firstChild}getSignatureXml(){return this.signatureXml}getOriginalXmlWithIds(){return this.originalXmlWithIds}getSignedXml(){return this.signedXml}};m2.SignedXml=kx;kx.defaultNsForPrefix={ds:"http://www.w3.org/2000/09/xmldsig#"};kx.noop=()=>null});var Lx=ue(an=>{"use strict";var pX=an&&an.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),N_=an&&an.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&pX(e,r,t)};Object.defineProperty(an,"__esModule",{value:!0});an.SignedXml=an.ExclusiveCanonicalizationWithComments=an.ExclusiveCanonicalization=an.C14nCanonicalizationWithComments=an.C14nCanonicalization=void 0;var T_=fx();Object.defineProperty(an,"C14nCanonicalization",{enumerable:!0,get:u(function(){return T_.C14nCanonicalization},"get")});Object.defineProperty(an,"C14nCanonicalizationWithComments",{enumerable:!0,get:u(function(){return T_.C14nCanonicalizationWithComments},"get")});var I_=dx();Object.defineProperty(an,"ExclusiveCanonicalization",{enumerable:!0,get:u(function(){return I_.ExclusiveCanonicalization},"get")});Object.defineProperty(an,"ExclusiveCanonicalizationWithComments",{enumerable:!0,get:u(function(){return I_.ExclusiveCanonicalizationWithComments},"get")});var dX=b_();Object.defineProperty(an,"SignedXml",{enumerable:!0,get:u(function(){return dX.SignedXml},"get")});N_(_x(),an);N_(bd(),an)});var R_=ue(y2=>{"use strict";Object.defineProperty(y2,"__esModule",{value:!0});y2.WSSecurityCert=void 0;var mX=st("crypto"),gX=Lx();function yX(r,e){return new Date(r.getTime()+e*6e4)}u(yX,"addMinutes");function D_(r){return r.getUTCFullYear()+"-"+("0"+(r.getUTCMonth()+1)).slice(-2)+"-"+("0"+r.getUTCDate()).slice(-2)+"T"+("0"+r.getUTCHours()).slice(-2)+":"+("0"+r.getUTCMinutes()).slice(-2)+":"+("0"+r.getUTCSeconds()).slice(-2)+"Z"}u(D_,"dateStringForSOAP");function vX(){return D_(new Date)}u(vX,"generateCreated");function EX(){return D_(yX(new Date,10))}u(EX,"generateExpires");function g2(r,e,t){return[e.slice(0,t),r,e.slice(t)].join("")}u(g2,"insertStr");function wX(){return(0,mX.randomUUID)().replace(/-/gm,"")}u(wX,"generateId");function SX(r,e){for(let t of r)t.xpath===B_&&(t.xpath=e)}u(SX,"resolvePlaceholderInReferences");var Bo="http://docs.oasis-open.org/wss/2004/01",B_="[[bodyXpath]]",AX=class{static{u(this,"WSSecurityCert")}constructor(e,t,n,s={}){if(this.signerOptions={},this.additionalReferences=[],this.excludeReferencesFromSigning=[],this.publicP12PEM=t.toString().replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/(\r\n|\n|\r)/gm,""),this.signer=new gX.SignedXml({idMode:s?.signerOptions?.idMode,signatureAlgorithm:s?.signatureAlgorithm}),this.signer.digestAlgorithm=s.digestAlgorithm??"http://www.w3.org/2001/04/xmlenc#sha256",this.appendElement="",s.appendElement&&(this.appendElement=s.appendElement),s.signatureAlgorithm==="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"&&(this.signer.signatureAlgorithm=s.signatureAlgorithm,this.signer.addReference({xpath:B_,transforms:["http://www.w3.org/2001/10/xml-exc-c14n#"],digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})),s.signatureAlgorithm||(this.signer.signatureAlgorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"),this.signer.canonicalizationAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#",s.additionalReferences&&s.additionalReferences.length>0&&(this.additionalReferences=s.additionalReferences),s.excludeReferencesFromSigning&&s.excludeReferencesFromSigning.length>0&&(this.excludeReferencesFromSigning=s.excludeReferencesFromSigning),s.signerOptions){let{signerOptions:i}=s;this.signerOptions=i,this.signerOptions.existingPrefixes||(this.signerOptions.existingPrefixes={}),this.signerOptions.existingPrefixes&&!this.signerOptions.existingPrefixes.wsse&&(this.signerOptions.existingPrefixes.wsse=`${Bo}/oasis-200401-wss-wssecurity-secext-1.0.xsd`)}else this.signerOptions={existingPrefixes:{wsse:`${Bo}/oasis-200401-wss-wssecurity-secext-1.0.xsd`}};this.signer.privateKey={key:e,passphrase:n},this.x509Id=`x509-${wX()}`,this.hasTimeStamp=typeof s.hasTimeStamp>"u"?!0:!!s.hasTimeStamp,this.signatureTransformations=Array.isArray(s.signatureTransformations)?s.signatureTransformations:["http://www.w3.org/2000/09/xmldsig#enveloped-signature","http://www.w3.org/2001/10/xml-exc-c14n#"],this.signer.getKeyInfoContent=()=>`<wsse:SecurityTokenReference><wsse:Reference URI="#${this.x509Id}" ValueType="${Bo}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>`}postProcess(e,t){this.created=vX(),this.expires=EX();let n="";this.hasTimeStamp&&(n=`<Timestamp xmlns="${Bo}/oasis-200401-wss-wssecurity-utility-1.0.xsd"><Created>${this.created}</Created><Expires>${this.expires}</Expires></Timestamp>`);let s=`<wsse:BinarySecurityToken EncodingType="${Bo}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="${Bo}/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>`+n+this.appendElement,i,a=`xmlns:wsse="${Bo}/oasis-200401-wss-wssecurity-secext-1.0.xsd"`,o=`xmlns:wsu="${Bo}/oasis-200401-wss-wssecurity-utility-1.0.xsd"`,l=e.indexOf("</wsse:Security>");if(l>-1){let m=/<wsse:Security( [^>]*)?>/,v=e.match(m),y="";v[0].includes(` ${t}:mustUnderstand="`)||(y+=`${t}:mustUnderstand="1" `),v[0].includes(a.substring(0,a.indexOf("=")))||(y+=`${a} `),v[0].includes(o.substring(0,a.indexOf("=")))||(y+=`${o} `);let S="<wsse:Security ",C=e.indexOf(S);e=g2(s,e,l),i=g2(y,e,C+S.length)}else{let m=`<wsse:Security ${a} ${o} ${t}:mustUnderstand="1">`+s+"</wsse:Security>";i=g2(m,e,e.indexOf(`</${t}:Header>`))}let c=this.signatureTransformations,f=`//*[name(.)='${t}:Body']`;SX(this.signer.references,f),!this.excludeReferencesFromSigning.some(m=>m==="Body")&&!(this.signer.references.filter(m=>m.xpath===f).length>0)&&this.signer.addReference({xpath:f,transforms:c,digestAlgorithm:this.signer.digestAlgorithm});for(let m of this.additionalReferences){let v=`//*[name(.)='${m}']`;!this.excludeReferencesFromSigning.some(y=>y===m)&&!(this.signer.references.filter(y=>y.xpath===v).length>0)&&this.signer.addReference({xpath:v,transforms:c,digestAlgorithm:this.signer.digestAlgorithm})}let p="//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']";!this.excludeReferencesFromSigning.some(m=>m==="Timestamp")&&this.hasTimeStamp&&!(this.signer.references.filter(m=>m.xpath===p).length>0)&&this.signer.addReference({xpath:p,transforms:c,digestAlgorithm:this.signer.digestAlgorithm}),this.signer.computeSignature(i,this.signerOptions);let d=this.signer.getOriginalXmlWithIds(),g=this.signer.getSignatureXml();return g2(g,d,d.indexOf("</wsse:Security>"))}};y2.WSSecurityCert=AX});var k_=ue(v2=>{"use strict";Object.defineProperty(v2,"__esModule",{value:!0});v2.WSSecurityCertWithToken=void 0;var CX=st("crypto"),xX=Lx();function bX(r,e){return new Date(r.getTime()+e*6e4)}u(bX,"addMinutes");function __(r){return r.getUTCFullYear()+"-"+("0"+(r.getUTCMonth()+1)).slice(-2)+"-"+("0"+r.getUTCDate()).slice(-2)+"T"+("0"+r.getUTCHours()).slice(-2)+":"+("0"+r.getUTCMinutes()).slice(-2)+":"+("0"+r.getUTCSeconds()).slice(-2)+"Z"}u(__,"dateStringForSOAP");function NX(){return __(new Date)}u(NX,"generateCreated");function TX(){return __(bX(new Date,10))}u(TX,"generateExpires");function O_(r,e,t){return[e.slice(0,t),r,e.slice(t)].join("")}u(O_,"insertStr");function IX(){return(0,CX.randomUUID)().replace(/-/gm,"")}u(IX,"generateId");function DX(r,e){for(let t of r)t.xpath===P_&&(t.xpath=e)}u(DX,"resolvePlaceholderInReferences");var Ro="http://docs.oasis-open.org/wss/2004/01",P_="[[bodyXpath]]",BX=class{static{u(this,"WSSecurityCertWithToken")}constructor(e){this.signerOptions={},this.additionalReferences=[],this.publicP12PEM=e.publicKey.toString().replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/(\r\n|\n|\r)/gm,""),this.username=e.username,this.password=e.password,this.signer=new xX.SignedXml;let t=e.options||{};if(this.appendElement="",t.appendElement&&(this.appendElement=t.appendElement),t.signatureAlgorithm==="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"&&(this.signer.signatureAlgorithm=t.signatureAlgorithm,this.signer.addReference({xpath:P_,transforms:["http://www.w3.org/2001/10/xml-exc-c14n#"],digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})),t.signatureAlgorithm||(this.signer.signatureAlgorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"),this.signer.canonicalizationAlgorithm="http://www.w3.org/2001/10/xml-exc-c14n#",t.additionalReferences&&t.additionalReferences.length>0&&(this.additionalReferences=t.additionalReferences),t.signerOptions){let{signerOptions:n}=e.options;this.signerOptions=n,this.signerOptions.existingPrefixes||(this.signerOptions.existingPrefixes={}),this.signerOptions.existingPrefixes&&!this.signerOptions.existingPrefixes.wsse&&(this.signerOptions.existingPrefixes.wsse=`${Ro}/oasis-200401-wss-wssecurity-secext-1.0.xsd`)}else this.signerOptions={existingPrefixes:{wsse:`${Ro}/oasis-200401-wss-wssecurity-secext-1.0.xsd`}};this.signer.privateKey={key:e.privateKey,passphrase:e.keyPassword},this.x509Id=`x509-${IX()}`,this.hasTimeStamp=typeof t.hasTimeStamp>"u"?!0:!!t.hasTimeStamp,this.signatureTransformations=Array.isArray(t.signatureTransformations)?t.signatureTransformations:["http://www.w3.org/2000/09/xmldsig#enveloped-signature","http://www.w3.org/2001/10/xml-exc-c14n#"],this.signer.keyInfoProvider={},this.signer.getKeyInfo=()=>`<wsse:SecurityTokenReference><wsse:Reference URI="#${this.x509Id}" ValueType="${Ro}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>`}postProcess(e,t){this.created=NX(),this.expires=TX();let n="";this.hasTimeStamp&&(n=`<Timestamp xmlns="${Ro}/oasis-200401-wss-wssecurity-utility-1.0.xsd" Id="_1"><Created>${this.created}</Created><Expires>${this.expires}</Expires></Timestamp>`);let s="";this.username&&(s=`<wsse:UsernameToken wsu:Id="SecurityToken-${this.created}" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:Username>${this.username}</wsse:Username> <wsse:Password>${this.password}</wsse:Password> </wsse:UsernameToken>`);let i=`<wsse:Security xmlns:wsse="${Ro}/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="${Ro}/oasis-200401-wss-wssecurity-utility-1.0.xsd" ${t}:mustUnderstand="1"><wsse:BinarySecurityToken EncodingType="${Ro}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="${Ro}/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>`+s+n+this.appendElement+"</wsse:Security>",a=O_(i,e,e.indexOf(`</${t}:Header>`)),o=this.signatureTransformations,l=`//*[name(.)='${t}:Body']`;DX(this.signer.references,l),this.signer.references.filter(f=>f.xpath===l).length>0||this.signer.addReference({xpath:l,transforms:o,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"});for(let f of this.additionalReferences){let p=`//*[name(.)='${f}']`;this.signer.references.filter(d=>d.xpath===p).length>0||this.signer.addReference({xpath:p,transforms:o,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})}let c="//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']";return this.hasTimeStamp&&!(this.signer.references.filter(f=>f.xpath===c).length>0)&&this.signer.addReference({xpath:c,transforms:o,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"}),this.signer.computeSignature(a,this.signerOptions),O_(this.signer.getSignatureXml(),a,a.indexOf("</wsse:Security>"))}};v2.WSSecurityCertWithToken=BX});var L_=ue(E2=>{"use strict";Object.defineProperty(E2,"__esModule",{value:!0});E2.WSSecurityPlusCert=void 0;var RX=class{static{u(this,"WSSecurityPlusCert")}constructor(e,t){this.wsSecurity=e,this.wsSecurityCert=t}postProcess(e,t){let n=this.wsSecurity.toXML(),s=e.indexOf(`</${t}:Header>`);return e=[e.slice(0,s),n,e.slice(s)].join(""),this.wsSecurityCert.postProcess(e,t)}};E2.WSSecurityPlusCert=RX});var Vx=ue(Ln=>{"use strict";var OX=Ln&&Ln.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),da=Ln&&Ln.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&OX(e,r,t)};Object.defineProperty(Ln,"__esModule",{value:!0});da(c3(),Ln);da(h3(),Ln);da(g3(),Ln);da(E3(),Ln);da(w3(),Ln);da(S3(),Ln);da(R_(),Ln);da(k_(),Ln);da(L_(),Ln)});var Fx=ue(Yf=>{"use strict";var _X=Yf&&Yf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yf,"__esModule",{value:!0});Yf.Server=void 0;var PX=st("events"),kX=_X(st("zlib"));function LX(r){return typeof r.route=="function"&&typeof r.use=="function"}u(LX,"isExpress");function V_(r){return!!r&&typeof r.then=="function"}u(V_,"isPromiseLike");function F_(r){function e(t){return t<10?"0"+t:t}return u(e,"pad"),r.getUTCFullYear()+"-"+e(r.getUTCMonth()+1)+"-"+e(r.getUTCDate())+"T"+e(r.getUTCHours())+":"+e(r.getUTCMinutes())+":"+e(r.getUTCSeconds())+"Z"}u(F_,"getDateString");function VX(r){if(!r)return"http://localhost:8080";if(typeof r.address!="function")return`http://${r.address}`;let e=r.address();return e===null?"http://localhost:8080":typeof e=="string"?`http://${e}`:e.family.toLowerCase()==="ipv6"?`http://localhost:${e.port}`:`http://${e.address}:${e.port}`}u(VX,"getServerBaseUrl");var FX=class extends PX.EventEmitter{static{u(this,"Server")}constructor(e,t,n,s,i){super(),i=i||{path:t,services:n},this.path=t,this.services=n,this.wsdl=s,this.suppressStack=i&&i.suppressStack,this.returnFault=i&&i.returnFault,this.onewayOptions=i&&i.oneWay||{},this.enableChunkedEncoding=i.enableChunkedEncoding===void 0?!0:!!i.enableChunkedEncoding,this.callback=i.callback?i.callback:()=>{},this.baseUrl=VX(e),typeof t=="string"&&t[t.length-1]!=="/"?t+="/":t instanceof RegExp&&t.source[t.source.length-1]!=="/"&&(t=new RegExp(t.source+"(?:\\/|)")),s.onReady(a=>{if(!e){this.callback(a,this);return}if(LX(e))e.route(t).all((o,l)=>{if(typeof this.authorizeConnection=="function"&&!this.authorizeConnection(o,l)){l.end();return}this._requestListener(o,l)}),this.callback(a,this);else{let o=e.listeners("request").slice();e.removeAllListeners("request"),e.addListener("request",(l,c)=>{if(typeof this.authorizeConnection=="function"&&!this.authorizeConnection(l,c)){c.end();return}let f=new URL(l.url,this.baseUrl).pathname;if(f[f.length-1]!=="/"&&(f+="/"),t===f||t instanceof RegExp&&f.match(t))this._requestListener(l,c);else for(let p=0,d=o.length;p<d;p++)o[p].call(this,l,c)}),this.callback(a,this)}}),this._initializeOptions(i)}addSoapHeader(e,t,n,s){return this.soapHeaders||(this.soapHeaders=[]),e=this._processSoapHeader(e,t,n,s),this.soapHeaders.push(e)-1}changeSoapHeader(e,t,n,s,i){this.soapHeaders||(this.soapHeaders=[]),t=this._processSoapHeader(t,n,s,i),this.soapHeaders[e]=t}getSoapHeaders(){return this.soapHeaders}clearSoapHeaders(){this.soapHeaders=null}processRequest(e,t={}){let n=this._createServerlessRequest(t),s={body:"",statusCode:200,headers:{}};return new Promise(i=>{let a={statusCode:200,setHeader:u((o,l)=>{s.headers[o.toLowerCase()]=l},"setHeader"),write:u(o=>(typeof o<"u"&&(s.body+=Buffer.isBuffer(o)?o.toString():String(o)),!0),"write"),end:u(o=>{typeof o<"u"&&a.write(o),s.statusCode=a.statusCode||200,i(s)},"end")};typeof n.headers["content-type"]<"u"?a.setHeader("Content-Type",n.headers["content-type"]):a.setHeader("Content-Type","application/xml"),this._processRequestXml(n,a,e)})}_createServerlessRequest(e={}){let t=typeof this.path=="string"?this.path:"/";return{method:e.method||"POST",headers:e.headers||{},url:e.url||t,connection:e.connection||{remoteAddress:void 0}}}_processSoapHeader(e,t,n,s){switch(typeof e){case"object":return this.wsdl.objectToXML(e,t,n,s,!0);case"function":{let i=this;return(...a)=>{let o=e.apply(null,[...a]);return typeof o=="object"?i.wsdl.objectToXML(o,t,n,s,!0):o}}default:return e}}_initializeOptions(e){this.wsdl.options.attributesKey=e.attributesKey||"attributes",this.onewayOptions.statusCode=this.onewayOptions.responseCode||200,this.onewayOptions.emptyBody=!!this.onewayOptions.emptyBody,this.wsdl.options.envelopeKey=e.envelopeKey||"soap"}_processRequestXml(e,t,n){let s;try{typeof this.log=="function"&&this.log("received",n,e),this._process(n,e,t,(i,a)=>{this._sendHttpResponse(t,a,i),typeof this.log=="function"&&this.log("replied",i,e)})}catch(i){if(i.Fault!==void 0)return this._sendError(i.Fault,(a,o)=>{this._sendHttpResponse(t,o||500,a),typeof this.log=="function"&&this.log("error",i,e)},new Date().toISOString());s=i.stack?this.suppressStack===!0?i.message:i.stack:i,this._sendHttpResponse(t,500,s),typeof this.log=="function"&&this.log("error",i,e)}}_requestListener(e,t){let s=new URL(e.url,this.baseUrl).search;if(typeof this.log=="function"&&this.log("info","Handling "+e.method+" on "+e.url,e),e.method==="GET")s&&s.toLowerCase().startsWith("?wsdl")&&(typeof this.log=="function"&&this.log("info","Wants the WSDL",e),t.setHeader("Content-Type","application/xml"),t.write(this.wsdl.toXML())),t.end();else if(e.method==="POST"){if(typeof e.headers["content-type"]<"u"?t.setHeader("Content-Type",e.headers["content-type"]):t.setHeader("Content-Type","application/xml"),e.body&&e.body.length>0)return this._processRequestXml(e,t,e.body.toString());let i=[],a,o=e;e.headers["content-encoding"]==="gzip"&&(a=kX.default.createGunzip(),e.pipe(a),o=a),o.on("data",l=>{i.push(l)}),o.on("end",()=>{let l=Buffer.concat(i).toString();this._processRequestXml(e,t,l)})}else t.end()}_getSoapAction(e){if(typeof e.headers.soapaction>"u")return;let t=e.headers.soapaction;return t.indexOf('"')===0?t.slice(1,-1):t}_process(e,t,n,s){let i=new URL(t.url,this.baseUrl).pathname.replace(/\/$/,""),a=this.wsdl.xmlToObject(e),o=a.Body?a.Body:a,l=a.Header,c,f,p,d,g=a.Header&&a.Header.Security&&a.Header.Security.Timestamp,m=this.authenticate||u(function(){return!0},"defaultAuthenticate"),v=u((S,C)=>{let w={result:S};this.emit("response",w,f),s(w.result,C)},"callback"),y=u(()=>{if(typeof this.log=="function"&&this.log("info","Attempting to bind to "+i,t),!o)throw new Error("Failed to parse the SOAP Message body");if(c=(()=>{let S=this.wsdl.definitions.services,C,w;for(w in S){p=w;let A=S[p].ports;for(w in A){d=w;let b=A[d],V=new URL(b.location,"http://localhost").pathname.replace(/\/$/,"");if(typeof this.log=="function"&&this.log("info","Trying "+d+" from path "+V,t),V===i)return b.binding;C||(C=b)}}return C?C.binding:void 0})(),!c)throw new Error("Failed to bind to WSDL");try{let S=this._getSoapAction(t),C=Object.keys(o)[0]==="attributes"?Object.keys(o)[1]:Object.keys(o)[0],w=c.topElements[C]?c.topElements[C]:c.topElements[S];S?f=this._getMethodNameBySoapActionSuffix(c,S):f=w?w.methodName:C;let E=c.methods[f].style||c.style;this.emit("request",a,f),l&&this.emit("headers",l,f),E==="rpc"?this._executeMethod({serviceName:p,portName:d,methodName:f,outputName:C+"Response",args:o[C],headers:l,style:"rpc"},t,n,v):this._executeMethod({serviceName:p,portName:d,methodName:f,outputName:w.outputName,args:o[C],headers:l,style:"document"},t,n,v,g)}catch(S){if(S.Fault!==void 0)return this._sendError(S.Fault,v,g);throw S}},"process");if(typeof m=="function"){let S=!1,C=u(E=>{if(!S){if(S=!0,E instanceof Error)return this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:E.toString()},statusCode:500},v,g);if(typeof E=="boolean")if(E===!0)try{y()}catch(A){return A.Fault!==void 0?this._sendError(A.Fault,v,g):this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:A.toString()},statusCode:500},v,g)}else return this._sendError({Code:{Value:"SOAP-ENV:Client",Subcode:{Value:"AuthenticationFailure"}},Reason:{Text:"Invalid username or password"},statusCode:401},v,g)}},"processAuthResult"),w=m(a.Header&&a.Header.Security,C,t,a);V_(w)&&w.then(E=>{C(E)},E=>{C(E)}),typeof w=="boolean"&&C(w)}else throw new Error("Invalid authenticate function (not a function)")}_getMethodNameBySoapActionSuffix(e,t){let n=this._getMethodNameBySoapAction(e,t);if(n)return n;for(let s in e.methods)if(e.methods[s].soapAction.split("/").reverse()[0]===t)return s}_getMethodNameBySoapAction(e,t){for(let n in e.methods)if(e.methods[n].soapAction===t)return n;return null}_executeMethod(e,t,n,s,i){e=e||{};let a,o,l,c=e.serviceName,f=e.portName,p=this.wsdl.definitions.services[c].ports[f].binding,d=e.methodName,g=e.outputName,m=e.args,v=e.style;this.soapHeaders&&(l=this.soapHeaders.map(E=>typeof E=="function"?E(d,m,e.headers,t,n,this):E).join(`
53
+ `));try{a=this.services[c][f][d]}catch{return s(this._envelope("",l,i))}let y=!1,S=u((E,A)=>{if(!y){if(y=!0,E)return E.Fault!==void 0?this._sendError(E.Fault,s,i):this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:E.toString()},statusCode:500},s,i);if(v==="rpc")o=this.wsdl.objectToRpcXML(g,A,"",this.wsdl.definitions.$targetNamespace);else if(v==="document"){let b=p.methods[d].output;o=this.wsdl.objectToDocumentXML(g,A,b.targetNSAlias,b.targetNamespace)}else{let b=p.methods[d].output,V=b.$targetNamespace,I=g;V&&(I=`${V}:${I}`),o=this.wsdl.objectToDocumentXML(I,A,b.targetNSAlias,b.targetNamespace)}s(this._envelope(o,l,i))}},"handleResult");p.methods[d].output||(y=!0,o="",this.onewayOptions.emptyBody&&(o=this._envelope("",l,i)),s(o,this.onewayOptions.responseCode));let C=u((E,A)=>{E&&E.Fault!==void 0||A===void 0&&(A=E,E=null),S(E,A)},"methodCallback"),w=a.apply(this,[m,C,e.headers,t,n]);typeof w<"u"&&(V_(w)?w.then(E=>{S(null,E)},E=>{S(E)}):S(null,w))}_envelope(e,t,n){let i=this.wsdl.options.envelopeKey,a=this.wsdl.options.forceSoap12Headers?"http://www.w3.org/2003/05/soap-envelope":"http://schemas.xmlsoap.org/soap/envelope/",o='<?xml version="1.0" encoding="utf-8"?><'+i+":Envelope xmlns:"+i+'="'+a+'" '+this.wsdl.xmlnsInEnvelope+">";if(t=t||"",n){let l=new Date,c=F_(l),f=F_(new Date(l.getTime()+1e3*600));t+='<o:Security soap:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <u:Timestamp u:Id="_0"> <u:Created>'+c+"</u:Created> <u:Expires>"+f+`</u:Expires> </u:Timestamp> </o:Security>
54
+ `}return t!==""&&(o+="<"+i+":Header>"+t+"</"+i+":Header>"),o+=e?"<"+i+":Body>"+e+"</"+i+":Body>":"<"+i+":Body/>",o+="</"+i+":Envelope>",o}_sendError(e,t,n){let s,i=this.wsdl.options.envelopeKey,a;return e.statusCode&&(a=e.statusCode,e.statusCode=void 0),"faultcode"in e?s=this.wsdl.objectToDocumentXML(i+":Fault",e,void 0):s=this.wsdl.objectToDocumentXML("Fault",e,i),t(this._envelope(s,"",n),a)}_sendHttpResponse(e,t,n){t&&(e.statusCode=t),this.enableChunkedEncoding?(e.write(n),e.end()):e.end(n)}};Yf.Server=FX});var U_=ue(w2=>{"use strict";(function(r){r.parser=function(R,N){return new t(R,N)},r.SAXParser=t,r.SAXStream=f,r.createStream=l,r.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function t(R,N){if(!(this instanceof t))return new t(R,N);var J=this;s(J),J.q=J.c="",J.bufferCheckPosition=r.MAX_BUFFER_LENGTH,J.encoding=null,J.opt=N||{},J.opt.lowercase=J.opt.lowercase||J.opt.lowercasetags,J.looseCase=J.opt.lowercase?"toLowerCase":"toUpperCase",J.opt.maxEntityCount=J.opt.maxEntityCount||512,J.opt.maxEntityDepth=J.opt.maxEntityDepth||4,J.entityCount=J.entityDepth=0,J.tags=[],J.closed=J.closedRoot=J.sawRoot=!1,J.tag=J.error=null,J.strict=!!R,J.noscript=!!(R||J.opt.noscript),J.state=D.BEGIN,J.strictEntities=J.opt.strictEntities,J.ENTITIES=J.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES),J.attribList=[],J.opt.xmlns&&(J.ns=Object.create(v)),J.opt.unquotedAttributeValues===void 0&&(J.opt.unquotedAttributeValues=!R),J.trackPosition=J.opt.position!==!1,J.trackPosition&&(J.position=J.line=J.column=0),F(J,"onready")}u(t,"SAXParser"),Object.create||(Object.create=function(R){function N(){}u(N,"F"),N.prototype=R;var J=new N;return J}),Object.keys||(Object.keys=function(R){var N=[];for(var J in R)R.hasOwnProperty(J)&&N.push(J);return N});function n(R){for(var N=Math.max(r.MAX_BUFFER_LENGTH,10),J=0,$=0,ge=e.length;$<ge;$++){var et=R[e[$]].length;if(et>N)switch(e[$]){case"textNode":he(R);break;case"cdata":X(R,"oncdata",R.cdata),R.cdata="";break;case"script":X(R,"onscript",R.script),R.script="";break;default:xe(R,"Max buffer length exceeded: "+e[$])}J=Math.max(J,et)}var Gt=r.MAX_BUFFER_LENGTH-J;R.bufferCheckPosition=Gt+R.position}u(n,"checkBufferLength");function s(R){for(var N=0,J=e.length;N<J;N++)R[e[N]]=""}u(s,"clearBuffers");function i(R){he(R),R.cdata!==""&&(X(R,"oncdata",R.cdata),R.cdata=""),R.script!==""&&(X(R,"onscript",R.script),R.script="")}u(i,"flushBuffers"),t.prototype={end:u(function(){pe(this)},"end"),write:_e,resume:u(function(){return this.error=null,this},"resume"),close:u(function(){return this.write(null)},"close"),flush:u(function(){i(this)},"flush")};var a;try{a=st("stream").Stream}catch{a=u(function(){},"Stream")}a||(a=u(function(){},"Stream"));var o=r.EVENTS.filter(function(R){return R!=="error"&&R!=="end"});function l(R,N){return new f(R,N)}u(l,"createStream");function c(R,N){if(R.length>=2){if(R[0]===255&&R[1]===254)return"utf-16le";if(R[0]===254&&R[1]===255)return"utf-16be"}return R.length>=3&&R[0]===239&&R[1]===187&&R[2]===191?"utf8":R.length>=4?R[0]===60&&R[1]===0&&R[2]===63&&R[3]===0?"utf-16le":R[0]===0&&R[1]===60&&R[2]===0&&R[3]===63?"utf-16be":"utf8":N?"utf8":null}u(c,"determineBufferEncoding");function f(R,N){if(!(this instanceof f))return new f(R,N);a.apply(this),this._parser=new t(R,N),this.writable=!0,this.readable=!0;var J=this;this._parser.onend=function(){J.emit("end")},this._parser.onerror=function($){J.emit("error",$),J._parser.error=null},this._decoder=null,this._decoderBuffer=null,o.forEach(function($){Object.defineProperty(J,"on"+$,{get:u(function(){return J._parser["on"+$]},"get"),set:u(function(ge){if(!ge)return J.removeAllListeners($),J._parser["on"+$]=ge,ge;J.on($,ge)},"set"),enumerable:!0,configurable:!1})})}u(f,"SAXStream"),f.prototype=Object.create(a.prototype,{constructor:{value:f}}),f.prototype._decodeBuffer=function(R,N){if(this._decoderBuffer&&(R=Buffer.concat([this._decoderBuffer,R]),this._decoderBuffer=null),!this._decoder){var J=c(R,N);if(!J)return this._decoderBuffer=R,"";this._parser.encoding=J,this._decoder=new TextDecoder(J)}return this._decoder.decode(R,{stream:!N})},f.prototype.write=function(R){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(R))R=this._decodeBuffer(R,!1);else if(this._decoderBuffer){var N=this._decodeBuffer(Buffer.alloc(0),!0);N&&(this._parser.write(N),this.emit("data",N))}return this._parser.write(R.toString()),this.emit("data",R),!0},f.prototype.end=function(R){if(R&&R.length&&this.write(R),this._decoderBuffer){var N=this._decodeBuffer(Buffer.alloc(0),!0);N&&(this._parser.write(N),this.emit("data",N))}else if(this._decoder){var J=this._decoder.decode();J&&(this._parser.write(J),this.emit("data",J))}return this._parser.end(),!0},f.prototype.on=function(R,N){var J=this;return!J._parser["on"+R]&&o.indexOf(R)!==-1&&(J._parser["on"+R]=function(){var $=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);$.splice(0,0,R),J.emit.apply(J,$)}),a.prototype.on.call(J,R,N)};var p="[CDATA[",d="DOCTYPE",g="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/2000/xmlns/",v={xml:g,xmlns:m},y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,C=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,w=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function E(R){return R===" "||R===`
55
+ `||R==="\r"||R===" "}u(E,"isWhitespace");function A(R){return R==='"'||R==="'"}u(A,"isQuote");function b(R){return R===">"||E(R)}u(b,"isAttribEnd");function V(R,N){return R.test(N)}u(V,"isMatch");function I(R,N){return!V(R,N)}u(I,"notMatch");var D=0;r.STATE={BEGIN:D++,BEGIN_WHITESPACE:D++,TEXT:D++,TEXT_ENTITY:D++,OPEN_WAKA:D++,SGML_DECL:D++,SGML_DECL_QUOTED:D++,DOCTYPE:D++,DOCTYPE_QUOTED:D++,DOCTYPE_DTD:D++,DOCTYPE_DTD_QUOTED:D++,COMMENT_STARTING:D++,COMMENT:D++,COMMENT_ENDING:D++,COMMENT_ENDED:D++,CDATA:D++,CDATA_ENDING:D++,CDATA_ENDING_2:D++,PROC_INST:D++,PROC_INST_BODY:D++,PROC_INST_ENDING:D++,OPEN_TAG:D++,OPEN_TAG_SLASH:D++,ATTRIB:D++,ATTRIB_NAME:D++,ATTRIB_NAME_SAW_WHITE:D++,ATTRIB_VALUE:D++,ATTRIB_VALUE_QUOTED:D++,ATTRIB_VALUE_CLOSED:D++,ATTRIB_VALUE_UNQUOTED:D++,ATTRIB_VALUE_ENTITY_Q:D++,ATTRIB_VALUE_ENTITY_U:D++,CLOSE_TAG:D++,CLOSE_TAG_SAW_WHITE:D++,SCRIPT:D++,SCRIPT_ENDING:D++},r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(r.ENTITIES).forEach(function(R){var N=r.ENTITIES[R],J=typeof N=="number"?String.fromCharCode(N):N;r.ENTITIES[R]=J});for(var U in r.STATE)r.STATE[r.STATE[U]]=U;D=r.STATE;function F(R,N,J){R[N]&&R[N](J)}u(F,"emit");function M(R){var N=R&&R.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return N?N[2]:null}u(M,"getDeclaredEncoding");function se(R){return R?R.toLowerCase().replace(/[^a-z0-9]/g,""):null}u(se,"normalizeEncodingName");function ee(R,N){let J=se(R),$=se(N);return!J||!$?!0:$==="utf16"?J==="utf16le"||J==="utf16be":J===$}u(ee,"encodingsMatch");function ie(R,N){if(!(!R.strict||!R.encoding||!N||N.name!=="xml")){var J=M(N.body);J&&!ee(R.encoding,J)&&W(R,"XML declaration encoding "+J+" does not match detected stream encoding "+R.encoding.toUpperCase())}}u(ie,"validateXmlDeclarationEncoding");function X(R,N,J){R.textNode&&he(R),F(R,N,J)}u(X,"emitNode");function he(R){R.textNode=Ce(R.opt,R.textNode),R.textNode&&F(R,"ontext",R.textNode),R.textNode=""}u(he,"closeText");function Ce(R,N){return R.trim&&(N=N.trim()),R.normalize&&(N=N.replace(/\s+/g," ")),N}u(Ce,"textopts");function xe(R,N){return he(R),R.trackPosition&&(N+=`
56
+ Line: `+R.line+`
57
+ Column: `+R.column+`
58
+ Char: `+R.c),N=new Error(N),R.error=N,F(R,"onerror",N),R}u(xe,"error");function pe(R){return R.sawRoot&&!R.closedRoot&&W(R,"Unclosed root tag"),R.state!==D.BEGIN&&R.state!==D.BEGIN_WHITESPACE&&R.state!==D.TEXT&&xe(R,"Unexpected end"),he(R),R.c="",R.closed=!0,F(R,"onend"),t.call(R,R.strict,R.opt),R}u(pe,"end");function W(R,N){if(typeof R!="object"||!(R instanceof t))throw new Error("bad call to strictFail");R.strict&&xe(R,N)}u(W,"strictFail");function fe(R){R.strict||(R.tagName=R.tagName[R.looseCase]());var N=R.tags[R.tags.length-1]||R,J=R.tag={name:R.tagName,attributes:{}};R.opt.xmlns&&(J.ns=N.ns),R.attribList.length=0,X(R,"onopentagstart",J)}u(fe,"newTag");function Ie(R,N){var J=R.indexOf(":"),$=J<0?["",R]:R.split(":"),ge=$[0],et=$[1];return N&&R==="xmlns"&&(ge="xmlns",et=""),{prefix:ge,local:et}}u(Ie,"qname");function Ve(R){if(R.strict||(R.attribName=R.attribName[R.looseCase]()),R.attribList.indexOf(R.attribName)!==-1||R.tag.attributes.hasOwnProperty(R.attribName)){R.attribName=R.attribValue="";return}if(R.opt.xmlns){var N=Ie(R.attribName,!0),J=N.prefix,$=N.local;if(J==="xmlns")if($==="xml"&&R.attribValue!==g)W(R,"xml: prefix must be bound to "+g+`
59
+ Actual: `+R.attribValue);else if($==="xmlns"&&R.attribValue!==m)W(R,"xmlns: prefix must be bound to "+m+`
60
+ Actual: `+R.attribValue);else{var ge=R.tag,et=R.tags[R.tags.length-1]||R;ge.ns===et.ns&&(ge.ns=Object.create(et.ns)),ge.ns[$]=R.attribValue}R.attribList.push([R.attribName,R.attribValue])}else R.tag.attributes[R.attribName]=R.attribValue,X(R,"onattribute",{name:R.attribName,value:R.attribValue});R.attribName=R.attribValue=""}u(Ve,"attrib");function Le(R,N){if(R.opt.xmlns){var J=R.tag,$=Ie(R.tagName);J.prefix=$.prefix,J.local=$.local,J.uri=J.ns[$.prefix]||"",J.prefix&&!J.uri&&(W(R,"Unbound namespace prefix: "+JSON.stringify(R.tagName)),J.uri=$.prefix);var ge=R.tags[R.tags.length-1]||R;J.ns&&ge.ns!==J.ns&&Object.keys(J.ns).forEach(function(os){X(R,"onopennamespace",{prefix:os,uri:J.ns[os]})});for(var et=0,Gt=R.attribList.length;et<Gt;et++){var Be=R.attribList[et],ar=Be[0],Er=Be[1],Jt=Ie(ar,!0),Ir=Jt.prefix,Gs=Jt.local,Je=Ir===""?"":J.ns[Ir]||"",qe={name:ar,value:Er,prefix:Ir,local:Gs,uri:Je};Ir&&Ir!=="xmlns"&&!Je&&(W(R,"Unbound namespace prefix: "+JSON.stringify(Ir)),qe.uri=Ir),R.tag.attributes[ar]=qe,X(R,"onattribute",qe)}R.attribList.length=0}R.tag.isSelfClosing=!!N,R.sawRoot=!0,R.tags.push(R.tag),X(R,"onopentag",R.tag),N||(!R.noscript&&R.tagName.toLowerCase()==="script"?R.state=D.SCRIPT:R.state=D.TEXT,R.tag=null,R.tagName=""),R.attribName=R.attribValue="",R.attribList.length=0}u(Le,"openTag");function O(R){if(!R.tagName){W(R,"Weird empty close tag."),R.textNode+="</>",R.state=D.TEXT;return}if(R.script){if(R.tagName!=="script"){R.script+="</"+R.tagName+">",R.tagName="",R.state=D.SCRIPT;return}X(R,"onscript",R.script),R.script=""}var N=R.tags.length,J=R.tagName;R.strict||(J=J[R.looseCase]());for(var $=J;N--;){var ge=R.tags[N];if(ge.name!==$)W(R,"Unexpected close tag");else break}if(N<0){W(R,"Unmatched closing tag: "+R.tagName),R.textNode+="</"+R.tagName+">",R.state=D.TEXT;return}R.tagName=J;for(var et=R.tags.length;et-- >N;){var Gt=R.tag=R.tags.pop();R.tagName=R.tag.name,X(R,"onclosetag",R.tagName);var Be={};for(var ar in Gt.ns)Be[ar]=Gt.ns[ar];var Er=R.tags[R.tags.length-1]||R;R.opt.xmlns&&Gt.ns!==Er.ns&&Object.keys(Gt.ns).forEach(function(Jt){var Ir=Gt.ns[Jt];X(R,"onclosenamespace",{prefix:Jt,uri:Ir})})}N===0&&(R.closedRoot=!0),R.tagName=R.attribValue=R.attribName="",R.attribList.length=0,R.state=D.TEXT}u(O,"closeTag");function B(R){var N=R.entity,J=N.toLowerCase(),$,ge="";return R.ENTITIES[N]?R.ENTITIES[N]:R.ENTITIES[J]?R.ENTITIES[J]:(N=J,N.charAt(0)==="#"&&(N.charAt(1)==="x"?(N=N.slice(2),$=parseInt(N,16),ge=$.toString(16)):(N=N.slice(1),$=parseInt(N,10),ge=$.toString(10))),N=N.replace(/^0+/,""),isNaN($)||ge.toLowerCase()!==N||$<0||$>1114111?(W(R,"Invalid character entity"),"&"+R.entity+";"):String.fromCodePoint($))}u(B,"parseEntity");function Q(R,N){N==="<"?(R.state=D.OPEN_WAKA,R.startTagPosition=R.position):E(N)||(W(R,"Non-whitespace before first tag."),R.textNode=N,R.state=D.TEXT)}u(Q,"beginWhiteSpace");function K(R,N){var J="";return N<R.length&&(J=R.charAt(N)),J}u(K,"charAt");function _e(R){var N=this;if(this.error)throw this.error;if(N.closed)return xe(N,"Cannot write after close. Assign an onready handler.");if(R===null)return pe(N);typeof R=="object"&&(R=R.toString());for(var J=0,$="";$=K(R,J++),N.c=$,!!$;)switch(N.trackPosition&&(N.position++,$===`
61
+ `?(N.line++,N.column=0):N.column++),N.state){case D.BEGIN:if(N.state=D.BEGIN_WHITESPACE,$==="\uFEFF")continue;Q(N,$);continue;case D.BEGIN_WHITESPACE:Q(N,$);continue;case D.TEXT:if(N.sawRoot&&!N.closedRoot){for(var et=J-1;$&&$!=="<"&&$!=="&";)$=K(R,J++),$&&N.trackPosition&&(N.position++,$===`
62
+ `?(N.line++,N.column=0):N.column++);N.textNode+=R.substring(et,J-1)}$==="<"&&!(N.sawRoot&&N.closedRoot&&!N.strict)?(N.state=D.OPEN_WAKA,N.startTagPosition=N.position):(!E($)&&(!N.sawRoot||N.closedRoot)&&W(N,"Text data outside of root node."),$==="&"?N.state=D.TEXT_ENTITY:N.textNode+=$);continue;case D.SCRIPT:$==="<"?N.state=D.SCRIPT_ENDING:N.script+=$;continue;case D.SCRIPT_ENDING:$==="/"?N.state=D.CLOSE_TAG:(N.script+="<"+$,N.state=D.SCRIPT);continue;case D.OPEN_WAKA:if($==="!")N.state=D.SGML_DECL,N.sgmlDecl="";else if(!E($))if(V(y,$))N.state=D.OPEN_TAG,N.tagName=$;else if($==="/")N.state=D.CLOSE_TAG,N.tagName="";else if($==="?")N.state=D.PROC_INST,N.procInstName=N.procInstBody="";else{if(W(N,"Unencoded <"),N.startTagPosition+1<N.position){var ge=N.position-N.startTagPosition;$=new Array(ge).join(" ")+$}N.textNode+="<"+$,N.state=D.TEXT}continue;case D.SGML_DECL:if(N.sgmlDecl+$==="--"){N.state=D.COMMENT,N.comment="",N.sgmlDecl="";continue}N.doctype&&N.doctype!==!0&&N.sgmlDecl?(N.state=D.DOCTYPE_DTD,N.doctype+="<!"+N.sgmlDecl+$,N.sgmlDecl=""):(N.sgmlDecl+$).toUpperCase()===p?(X(N,"onopencdata"),N.state=D.CDATA,N.sgmlDecl="",N.cdata=""):(N.sgmlDecl+$).toUpperCase()===d?(N.state=D.DOCTYPE,(N.doctype||N.sawRoot)&&W(N,"Inappropriately located doctype declaration"),N.doctype="",N.sgmlDecl=""):$===">"?(X(N,"onsgmldeclaration",N.sgmlDecl),N.sgmlDecl="",N.state=D.TEXT):(A($)&&(N.state=D.SGML_DECL_QUOTED),N.sgmlDecl+=$);continue;case D.SGML_DECL_QUOTED:$===N.q&&(N.state=D.SGML_DECL,N.q=""),N.sgmlDecl+=$;continue;case D.DOCTYPE:$===">"?(N.state=D.TEXT,X(N,"ondoctype",N.doctype),N.doctype=!0):(N.doctype+=$,$==="["?N.state=D.DOCTYPE_DTD:A($)&&(N.state=D.DOCTYPE_QUOTED,N.q=$));continue;case D.DOCTYPE_QUOTED:N.doctype+=$,$===N.q&&(N.q="",N.state=D.DOCTYPE);continue;case D.DOCTYPE_DTD:$==="]"?(N.doctype+=$,N.state=D.DOCTYPE):$==="<"?(N.state=D.OPEN_WAKA,N.startTagPosition=N.position):A($)?(N.doctype+=$,N.state=D.DOCTYPE_DTD_QUOTED,N.q=$):N.doctype+=$;continue;case D.DOCTYPE_DTD_QUOTED:N.doctype+=$,$===N.q&&(N.state=D.DOCTYPE_DTD,N.q="");continue;case D.COMMENT:$==="-"?N.state=D.COMMENT_ENDING:N.comment+=$;continue;case D.COMMENT_ENDING:$==="-"?(N.state=D.COMMENT_ENDED,N.comment=Ce(N.opt,N.comment),N.comment&&X(N,"oncomment",N.comment),N.comment=""):(N.comment+="-"+$,N.state=D.COMMENT);continue;case D.COMMENT_ENDED:$!==">"?(W(N,"Malformed comment"),N.comment+="--"+$,N.state=D.COMMENT):N.doctype&&N.doctype!==!0?N.state=D.DOCTYPE_DTD:N.state=D.TEXT;continue;case D.CDATA:for(var et=J-1;$&&$!=="]";)$=K(R,J++),$&&N.trackPosition&&(N.position++,$===`
63
+ `?(N.line++,N.column=0):N.column++);N.cdata+=R.substring(et,J-1),$==="]"&&(N.state=D.CDATA_ENDING);continue;case D.CDATA_ENDING:$==="]"?N.state=D.CDATA_ENDING_2:(N.cdata+="]"+$,N.state=D.CDATA);continue;case D.CDATA_ENDING_2:$===">"?(N.cdata&&X(N,"oncdata",N.cdata),X(N,"onclosecdata"),N.cdata="",N.state=D.TEXT):$==="]"?N.cdata+="]":(N.cdata+="]]"+$,N.state=D.CDATA);continue;case D.PROC_INST:$==="?"?N.state=D.PROC_INST_ENDING:E($)?N.state=D.PROC_INST_BODY:N.procInstName+=$;continue;case D.PROC_INST_BODY:if(!N.procInstBody&&E($))continue;$==="?"?N.state=D.PROC_INST_ENDING:N.procInstBody+=$;continue;case D.PROC_INST_ENDING:if($===">"){let Er={name:N.procInstName,body:N.procInstBody};ie(N,Er),X(N,"onprocessinginstruction",Er),N.procInstName=N.procInstBody="",N.state=D.TEXT}else N.procInstBody+="?"+$,N.state=D.PROC_INST_BODY;continue;case D.OPEN_TAG:V(S,$)?N.tagName+=$:(fe(N),$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:(E($)||W(N,"Invalid character in tag name"),N.state=D.ATTRIB));continue;case D.OPEN_TAG_SLASH:$===">"?(Le(N,!0),O(N)):(W(N,"Forward-slash in opening tag not followed by >"),N.state=D.ATTRIB);continue;case D.ATTRIB:if(E($))continue;$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:V(y,$)?(N.attribName=$,N.attribValue="",N.state=D.ATTRIB_NAME):W(N,"Invalid attribute name");continue;case D.ATTRIB_NAME:$==="="?N.state=D.ATTRIB_VALUE:$===">"?(W(N,"Attribute without value"),N.attribValue=N.attribName,Ve(N),Le(N)):E($)?N.state=D.ATTRIB_NAME_SAW_WHITE:V(S,$)?N.attribName+=$:W(N,"Invalid attribute name");continue;case D.ATTRIB_NAME_SAW_WHITE:if($==="=")N.state=D.ATTRIB_VALUE;else{if(E($))continue;W(N,"Attribute without value"),N.tag.attributes[N.attribName]="",N.attribValue="",X(N,"onattribute",{name:N.attribName,value:""}),N.attribName="",$===">"?Le(N):V(y,$)?(N.attribName=$,N.state=D.ATTRIB_NAME):(W(N,"Invalid attribute name"),N.state=D.ATTRIB)}continue;case D.ATTRIB_VALUE:if(E($))continue;A($)?(N.q=$,N.state=D.ATTRIB_VALUE_QUOTED):(N.opt.unquotedAttributeValues||xe(N,"Unquoted attribute value"),N.state=D.ATTRIB_VALUE_UNQUOTED,N.attribValue=$);continue;case D.ATTRIB_VALUE_QUOTED:if($!==N.q){$==="&"?N.state=D.ATTRIB_VALUE_ENTITY_Q:N.attribValue+=$;continue}Ve(N),N.q="",N.state=D.ATTRIB_VALUE_CLOSED;continue;case D.ATTRIB_VALUE_CLOSED:E($)?N.state=D.ATTRIB:$===">"?Le(N):$==="/"?N.state=D.OPEN_TAG_SLASH:V(y,$)?(W(N,"No whitespace between attributes"),N.attribName=$,N.attribValue="",N.state=D.ATTRIB_NAME):W(N,"Invalid attribute name");continue;case D.ATTRIB_VALUE_UNQUOTED:if(!b($)){$==="&"?N.state=D.ATTRIB_VALUE_ENTITY_U:N.attribValue+=$;continue}Ve(N),$===">"?Le(N):N.state=D.ATTRIB;continue;case D.CLOSE_TAG:if(N.tagName)$===">"?O(N):V(S,$)?N.tagName+=$:N.script?(N.script+="</"+N.tagName+$,N.tagName="",N.state=D.SCRIPT):(E($)||W(N,"Invalid tagname in closing tag"),N.state=D.CLOSE_TAG_SAW_WHITE);else{if(E($))continue;I(y,$)?N.script?(N.script+="</"+$,N.state=D.SCRIPT):W(N,"Invalid tagname in closing tag."):N.tagName=$}continue;case D.CLOSE_TAG_SAW_WHITE:if(E($))continue;$===">"?O(N):W(N,"Invalid characters in closing tag");continue;case D.TEXT_ENTITY:case D.ATTRIB_VALUE_ENTITY_Q:case D.ATTRIB_VALUE_ENTITY_U:var Gt,Be;switch(N.state){case D.TEXT_ENTITY:Gt=D.TEXT,Be="textNode";break;case D.ATTRIB_VALUE_ENTITY_Q:Gt=D.ATTRIB_VALUE_QUOTED,Be="attribValue";break;case D.ATTRIB_VALUE_ENTITY_U:Gt=D.ATTRIB_VALUE_UNQUOTED,Be="attribValue";break}if($===";"){var ar=B(N);N.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes(ar)?((N.entityCount+=1)>N.opt.maxEntityCount&&xe(N,"Parsed entity count exceeds max entity count"),(N.entityDepth+=1)>N.opt.maxEntityDepth&&xe(N,"Parsed entity depth exceeds max entity depth"),N.entity="",N.state=Gt,N.write(ar),N.entityDepth-=1):(N[Be]+=ar,N.entity="",N.state=Gt)}else V(N.entity.length?w:C,$)?N.entity+=$:(W(N,"Invalid character in entity name"),N[Be]+="&"+N.entity+$,N.entity="",N.state=Gt);continue;default:throw new Error(N,"Unknown state: "+N.state)}return N.position>=N.bufferCheckPosition&&n(N),N}u(_e,"write");String.fromCodePoint||(function(){var R=String.fromCharCode,N=Math.floor,J=u(function(){var $=16384,ge=[],et,Gt,Be=-1,ar=arguments.length;if(!ar)return"";for(var Er="";++Be<ar;){var Jt=Number(arguments[Be]);if(!isFinite(Jt)||Jt<0||Jt>1114111||N(Jt)!==Jt)throw RangeError("Invalid code point: "+Jt);Jt<=65535?ge.push(Jt):(Jt-=65536,et=(Jt>>10)+55296,Gt=Jt%1024+56320,ge.push(et,Gt)),(Be+1===ar||ge.length>$)&&(Er+=R.apply(null,ge),ge.length=0)}return Er},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:J,configurable:!0,writable:!0}):String.fromCodePoint=J})()})(typeof w2>"u"?w2.sax={}:w2)});var M_=ue(S2=>{"use strict";Object.defineProperty(S2,"__esModule",{value:!0});S2.NamespaceContext=void 0;var UX=class{static{u(this,"NamespaceScope")}constructor(e){this.parent=e,this.namespaces={}}getNamespaceURI(e,t){switch(e){case"xml":return"http://www.w3.org/XML/1998/namespace";case"xmlns":return"http://www.w3.org/2000/xmlns/";default:{let n=this.namespaces[e];return n!=null?n.uri:!t&&this.parent?this.parent.getNamespaceURI(e):null}}}getNamespaceMapping(e){switch(e){case"xml":return{uri:"http://www.w3.org/XML/1998/namespace",prefix:"xml",declared:!0};case"xmlns":return{uri:"http://www.w3.org/2000/xmlns/",prefix:"xmlns",declared:!0};default:{let t=this.namespaces[e];return t??(this.parent?this.parent.getNamespaceMapping(e):null)}}}getPrefix(e,t){switch(e){case"http://www.w3.org/XML/1998/namespace":return"xml";case"http://www.w3.org/2000/xmlns/":return"xmlns";default:for(let n in this.namespaces)if(this.namespaces[n].uri===e)return n;return!t&&this.parent?this.parent.getPrefix(e):null}}},MX=class{static{u(this,"NamespaceContext")}constructor(){this.scopes=[],this.pushContext(),this.prefixCount=0}addNamespace(e,t,n){return this.getNamespaceURI(e,n)===t?!1:this.currentScope?(this.currentScope.namespaces[e]={uri:t,prefix:e,declared:!1},!0):!1}pushContext(){let e=new UX(this.currentScope);return this.scopes.push(e),this.currentScope=e,e}popContext(){let e=this.scopes.pop();return e?this.currentScope=e.parent:this.currentScope=null,e}getNamespaceURI(e,t){return this.currentScope&&this.currentScope.getNamespaceURI(e,t)}getPrefix(e,t){return this.currentScope&&this.currentScope.getPrefix(e,t)}registerNamespace(e){let t=this.getPrefix(e);if(t)return t;for(;t="ns"+ ++this.prefixCount,!!this.getNamespaceURI(t););return this.addNamespace(t,e,!0),t}declareNamespace(e,t){if(this.currentScope){let n=this.currentScope.getNamespaceMapping(e);return n&&n.uri===t&&n.declared?!1:(this.currentScope.namespaces[e]={uri:t,prefix:e,declared:!0},!0)}return!1}};S2.NamespaceContext=MX});var Y_=ue($e=>{"use strict";var jX=$e&&$e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($e,"__esModule",{value:!0});$e.ImportElement=$e.IncludeElement=$e.BodyElement=$e.DefinitionsElement=$e.ServiceElement=$e.PortElement=$e.BindingElement=$e.PortTypeElement=$e.OperationElement=$e.TypesElement=$e.SchemaElement=$e.DocumentationElement=$e.MessageElement=$e.AllElement=$e.AttributeElement=$e.SequenceElement=$e.SimpleContentElement=$e.ComplexContentElement=$e.ComplexTypeElement=$e.EnumerationElement=$e.ChoiceElement=$e.ExtensionElement=$e.RestrictionElement=$e.SimpleTypeElement=$e.OutputElement=$e.InputElement=$e.AnyElement=$e.ElementElement=$e.UnexpectedElement=$e.Element=void 0;var Ux=st("assert"),qX=jX(Iy()),lr=Gn(),HX=(0,qX.default)("node-soap"),A2={string:1,boolean:1,decimal:1,float:1,double:1,anyType:1,byte:1,int:1,long:1,short:1,negativeInteger:1,nonNegativeInteger:1,positiveInteger:1,nonPositiveInteger:1,unsignedByte:1,unsignedInt:1,unsignedLong:1,unsignedShort:1,duration:0,dateTime:0,time:0,date:0,gYearMonth:0,gYear:0,gMonthDay:0,gDay:0,gMonth:0,hexBinary:0,base64Binary:0,anyURI:0,QName:0,NOTATION:0},Xt=class{static{u(this,"Element")}constructor(e,t,n,s){this.allowedChildren={},this.children=[];let i=(0,lr.splitQName)(e);this.nsName=e,this.prefix=i.prefix,this.name=i.name,this.children=[],this.xmlns={},this.schemaXmlns={},this._initializeOptions(n);for(let a in t){let o=/^xmlns:?(.*)$/.exec(a);o?this.xmlns[o[1]?o[1]:lr.TNS_PREFIX]=t[a]:a==="value"?this[this.valueKey]=t[a]:this["$"+a]=t[a]}for(let a in s){let o=/^xmlns:?(.*)$/.exec(a);o&&o[1]&&(this.schemaXmlns[o[1]]=s[a])}this.$targetNamespace!==void 0&&(this.xmlns[lr.TNS_PREFIX]=this.$targetNamespace),this.init()}deleteFixedAttrs(){this.children&&this.children.length===0&&delete this.children,this.xmlns&&Object.keys(this.xmlns).length===0&&delete this.xmlns,delete this.nsName,delete this.prefix,delete this.name}startElement(e,t,n,s,i){if(!this.allowedChildren)return;let a=this.allowedChildren[(0,lr.splitQName)(t).name];if(a==null&&!this.strict&&(a=j_),a){let o=new a(t,n,s,i);o.init();let l=e[0];l instanceof zx&&(o.definitionsXmlns=l.xmlns),e.push(o)}else this.unexpected(t)}endElement(e,t){if(this.nsName===t){if(e.length<2)return;let n=e[e.length-2];this!==e[0]&&((0,lr.defaultsDeep)(e[0].xmlns,this.xmlns),n.children.push(this),n.addChild(this)),e.pop()}}addChild(e){}unexpected(e){throw new Error("Found unexpected element ("+e+") inside "+this.nsName)}description(e,t){return this.$name||this.name}init(){}_initializeOptions(e){e?(this.valueKey=e.valueKey||"$value",this.xmlKey=e.xmlKey||"$xml",this.ignoredNamespaces=e.ignoredNamespaces||[],this.strict=e.strict||!1,this.forceUseSchemaXmlns=e.forceUseSchemaXmlns||!1):(this.valueKey="$value",this.xmlKey="$xml",this.ignoredNamespaces=[],this.strict=!1,this.forceUseSchemaXmlns=!1)}};$e.Element=Xt;var j_=class q_ extends Xt{static{u(this,"UnexpectedElement")}startElement(e,t,n,s,i){let a=new q_(t,n,s,i);a.init(),e.push(a)}};$e.UnexpectedElement=j_;var Mx=class extends Xt{static{u(this,"ElementElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["annotation","complexType","simpleType"])}description(e,t){let n={},s=this.$name,i=1,a=1;this.$maxOccurs==="unbounded"?a=1/0:this.$maxOccurs&&(a=parseInt(this.$maxOccurs,10)),this.$minOccurs&&(i=parseInt(this.$minOccurs,10));let o=a>1;o&&s&&(s+="[]"),t&&t[lr.TNS_PREFIX]&&(this.$targetNamespace=t[lr.TNS_PREFIX]);let l=this.$type||this.$ref;if(l){l=(0,lr.splitQName)(l);let c=l.name,f=!!Oo(l.prefix,this.definitionsXmlns,e.xmlns)||!!Oo(this.targetNSAlias,this.definitionsXmlns,e.xmlns)||this.forceUseSchemaXmlns,p=Oo(l.prefix,t,this.xmlns,f?this.schemaXmlns:void 0,this.definitionsXmlns,e.xmlns),d=e.schemas[p],g=d&&(this.$type?d.complexTypes[c]||d.types[c]:d.elements[c]),m=this.$type?e.descriptions.types:e.descriptions.elements,v=p?`${p}::${c}`:c;if(p&&e.schemas[p]&&(t=e.schemas[p].xmlns),g&&!(c in A2))if(v in m)if(this.$ref)if(o){let y=c+"[]",S=p?`${p}::${y}`:y;m[S]=m[v],n[y]=m[S]}else n=m[v];else n[s]=m[v];else{let y={};m[v]=y,o&&"maxOccurs"in g&&(g.maxOccurs=this.$maxOccurs),this.$minOccurs&&"minOccurs"in g&&(g.minOccurs=this.$minOccurs);let S=g.description(e,t);if(typeof S=="string")y=S;else{Object.keys(S).forEach(w=>{y[w]=S[w]});let C=S[Zs.Symbol];C&&(y[Zs.Symbol]=C)}this.$ref?n=y:n[s]=y,typeof y=="object"&&(y.targetNSAlias=l.prefix,y.targetNamespace=p),m[v]=y}else n[s]=this.$type}else{let c=this.children;n[s]={};for(let f of c)(f instanceof T2||f instanceof x2)&&(n[s]=f.description(e,t))}return n}};$e.ElementElement=Mx;var C2=class extends Xt{static{u(this,"AnyElement")}};$e.AnyElement=C2;var H_=class extends Xt{static{u(this,"InputElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof I2&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};$e.InputElement=H_;var K_=class extends Xt{static{u(this,"OutputElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof I2&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};$e.OutputElement=K_;var x2=class extends Xt{static{u(this,"SimpleTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["restriction"])}description(e){for(let t of this.children)if(t instanceof b2)return[this.$name,t.description()].filter(Boolean).join("|");return{}}};$e.SimpleTypeElement=x2;var b2=class extends Xt{static{u(this,"RestrictionElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","choice","enumeration","sequence","attribute"])}description(e,t){let n=this.children,s,i=!1,a={};for(let l of n){if(l instanceof Zs){a[l.$name]=l.description(e);continue}!i&&(l instanceof Md||l instanceof Ud)&&(i=!0,s=l.description(e,t))}if(Object.keys(a).length>0&&(s=s??{},s[Zs.Symbol]=a),s&&this.$base){let l=(0,lr.splitQName)(this.$base),c=l.name,f=Oo(l.prefix,t,this.definitionsXmlns,e.xmlns),p=e.schemas[f],d=p&&(p.complexTypes[c]||p.types[c]||p.elements[c]);if(s.getBase=()=>d.description(e,p.xmlns),d){let g=d.description(e,p.xmlns);g[Zs.Symbol]&&(0,lr.defaults)(a,g[Zs.Symbol]),s=(0,lr.defaults)(s,g)}return s}let o=this.children.map(l=>l.description()).join(",");return[this.$base,o].filter(Boolean).join("|")}};$e.RestrictionElement=b2;var N2=class extends Xt{static{u(this,"ExtensionElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","choice","sequence"])}description(e,t){let n={};for(let s of this.children)(s instanceof Md||s instanceof Ud)&&(n=s.description(e,t));if(this.$base){let s=(0,lr.splitQName)(this.$base),i=s.name,a=Oo(s.prefix,t,this.definitionsXmlns,e.xmlns),o=e.schemas[a];if(i in A2)return this.$base;{let l=o&&(o.complexTypes[i]||o.types[i]||o.elements[i]);if(l){let c=l.description(e,o.xmlns);n=typeof c=="string"?c:(0,lr.defaults)(c,n)}}}return n}};$e.ExtensionElement=N2;var Ud=class extends Xt{static{u(this,"ChoiceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};$e.ChoiceElement=Ud;var X_=class extends Xt{static{u(this,"EnumerationElement")}description(){return this[this.valueKey]}};$e.EnumerationElement=X_;var T2=class extends Xt{static{u(this,"ComplexTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["all","annotation","choice","complexContent","sequence","simpleContent","attribute"])}description(e,t){let n={},s=!1,i={},a=this.children||[];for(let o of a){if(o instanceof Zs){i[o.$name]=o.description(e);continue}!s&&(o instanceof Ud||o instanceof Md||o instanceof Hx||o instanceof qx||o instanceof jx)&&(s=!0,n=o.description(e,t))}return Object.keys(i).length>0&&(n[Zs.Symbol]=i),n}};$e.ComplexTypeElement=T2;var jx=class extends Xt{static{u(this,"ComplexContentElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["extension","restriction"])}description(e,t){for(let n of this.children)if(n instanceof N2||n instanceof b2)return n.description(e,t);return{}}};$e.ComplexContentElement=jx;var qx=class extends Xt{static{u(this,"SimpleContentElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["extension"])}description(e,t){for(let n of this.children)if(n instanceof N2)return n.description(e,t);return{}}};$e.SimpleContentElement=qx;var Md=class extends Xt{static{u(this,"SequenceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){if(s instanceof C2)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};$e.SequenceElement=Md;var Zs=class extends Xt{static{u(this,"AttributeElement")}description(e){return{type:this.$type,required:this.$use==="required"}}};$e.AttributeElement=Zs;Zs.Symbol=Symbol("$attributes");var Hx=class extends Xt{static{u(this,"AllElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["choice","element"])}description(e,t){let n={};for(let s of this.children){if(s instanceof C2)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};$e.AllElement=Hx;var Kx=class extends Xt{static{u(this,"MessageElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["part","documentation"]),this.element=null,this.parts=null}postProcess(e){let t=null,n=this.children||[];for(let s of n)if(s.name==="part"){t=s;break}if(t){if(t.$element){let s=[];delete this.parts;let i=(0,lr.splitQName)(t.$element),a=Oo(i.prefix,this.definitionsXmlns,e.xmlns),o=e.schemas[a];if(this.element=o.elements[i.name],!this.element){HX(i.name+" is not present in wsdl and cannot be processed correctly.");return}this.element.targetNSAlias=i.prefix,this.element.targetNamespace=a,this.element.$lookupType=t.$element;let l=this.element.children;if(l.length>0)for(let c of l)s.push(this._getNestedLookupTypeString(c));if(s.length>0){s=s.join("_").split("_").filter(u(function(p){return p!=="^"},"removeEmptyLookupTypes"));let c=e.schemas[this.element.targetNamespace].xmlns;for(let f=0;f<s.length;f++)s[f]=this._createLookupTypeObject(s[f],c)}if(this.element.$lookupTypes=s,this.element.$type){let c=(0,lr.splitQName)(this.element.$type),f=Oo(c.prefix,o.xmlns,this.definitionsXmlns,e.xmlns);if(f&&!(c.name in A2)){o=e.schemas[f];let p=o.complexTypes[c.name]||o.types[c.name]||o.elements[c.name];p&&(this.parts=p.description(e,o.xmlns))}}else{let c=this.element.description(e,o.xmlns);this.parts=c[i.name]}this.children.splice(0,1)}else{this.parts={},delete this.element;for(let s=0;s<this.children.length;s++){let i=this.children[s];if(i.name==="documentation")continue;(0,Ux.ok)(i.name==="part","Expected part element");let a=(0,lr.splitQName)(i.$type),o=Oo(a.prefix,this.definitionsXmlns,e.xmlns),l=a.name;typeof e.schemas[o]<"u"?this.parts[i.$name]=e.schemas[o].types[l]||e.schemas[o].complexTypes[l]:this.parts[i.$name]=i.$type,typeof this.parts[i.$name]=="object"&&(this.parts[i.$name].prefix=a.prefix,this.parts[i.$name].xmlns=o),this.children.splice(s--,1)}}this.deleteFixedAttrs()}}description(e){if(this.element)return this.element&&this.element.description(e);let t={};return t[this.$name]=this.parts,t}_createLookupTypeObject(e,t){let n=(0,lr.splitQName)(e),s=n.prefix,i=n.name.split("#"),a=i[0],o=i[1];return{$namespace:t[s],$type:s+":"+a,$name:o}}_getNestedLookupTypeString(e){let t="^",n=this.ignoredNamespaces.concat("xs");return Object.hasOwnProperty.call(e,"$type")&&typeof e.$type=="string"&&n.indexOf(e.$type.split(":")[0])===-1&&(t+="_"+e.$type+"#"+e.$name),e.children.length>0&&e.children.forEach(s=>{let i=this._getNestedLookupTypeString(s).replace(/\^_/,"");i&&typeof i=="string"&&(t+="_"+i)}),t}};$e.MessageElement=Kx;var G_=class extends Xt{static{u(this,"DocumentationElement")}};$e.DocumentationElement=G_;var Fd=class $_ extends Xt{static{u(this,"SchemaElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["complexType","element","import","include","simpleType"]),this.complexTypes={},this.types={},this.elements={},this.includes=[]}merge(e){return(0,Ux.ok)(e instanceof $_),(0,lr.merge)(this.complexTypes,e.complexTypes),(0,lr.merge)(this.types,e.types),(0,lr.merge)(this.elements,e.elements),(0,lr.merge)(this.xmlns,e.xmlns),(0,lr.merge)(this,(0,lr.pickBy)(e,(t,n)=>n.startsWith("$")&&!Object.hasOwnProperty.call(this,n))),this}addChild(e){if(!(e.$name in A2)){if(e instanceof Jx||e instanceof Yx){let t=e.$schemaLocation||e.$location;t&&this.includes.push({namespace:e.$namespace||e.$targetNamespace||this.$targetNamespace,location:t})}else e instanceof T2?this.complexTypes[e.$name]=e:e instanceof Mx?this.elements[e.$name]=e:e instanceof x2&&(this.types[e.$name]=e);this.children.pop()}}};$e.SchemaElement=Fd;var Xx=class extends Xt{static{u(this,"TypesElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["documentation","schema"]),this.schemas={}}addChild(e){(0,Ux.ok)(e instanceof Fd);let t=e.includes.find(i=>Object.hasOwnProperty.call(i,"namespace")),n=typeof t<"u"&&Object.hasOwnProperty.call(t,"namespace")&&e instanceof Fd?t.namespace:void 0,s=e.$targetNamespace||e.includes[0]?.namespace||n;Object.hasOwnProperty.call(this.schemas,s)?s===e.$targetNamespace?this.schemas[s]=e:console.error('Target-Namespace "'+s+'" already in use by another Schema!'):this.schemas[s]=e}};$e.TypesElement=Xx;var W_=class z_ extends Xt{static{u(this,"OperationElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["documentation","fault","input","operation","output"]),this.input=null,this.output=null,this.inputSoap=null,this.outputSoap=null,this.style="",this.soapAction=""}addChild(e){e instanceof z_&&(this.soapAction=e.$soapAction||"",this.style=e.$style||"",this.children.pop())}postProcess(e,t){let n=this.children;for(let s=0;s<n.length;s++){let i=n[s];if(i.name!=="input"&&i.name!=="output")continue;if(t==="binding"){this[i.name]=i,n.splice(s--,1);continue}let a=(0,lr.splitQName)(i.$message).name,o=e.messages[a];o&&(o.postProcess(e),o.element?(e.messages[o.element.$name]=o,this[i.name]=o.element):this[i.name]=o,n.splice(s--,1))}this.deleteFixedAttrs()}description(e){let t=this.input?this.input.description(e):null,n=this.output?this.output.description(e):null;return{input:t&&t[Object.keys(t)[0]],output:n&&n[Object.keys(n)[0]]}}};$e.OperationElement=W_;var Gx=class extends Xt{static{u(this,"PortTypeElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["documentation","operation"]),this.methods={}}postProcess(e){let t=this.children;if(!(typeof t>"u")){for(let n=0;n<t.length;n++){let s=t[n];s.name==="operation"&&(s.postProcess(e,"portType"),this.methods[s.$name]=s,t.splice(n--,1))}delete this.$name,this.deleteFixedAttrs()}}description(e){let t={};for(let n in this.methods){let s=this.methods[n];t[n]=s.description(e)}return t}};$e.PortTypeElement=Gx;var $x=class extends Xt{static{u(this,"BindingElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["binding","documentation","operation","SecuritySpec"]),this.transport="",this.style="",this.methods={}}addChild(e){e.name==="binding"&&(this.transport=e.$transport,this.style=e.$style,this.children.pop())}postProcess(e){let t=(0,lr.splitQName)(this.$type).name,n=e.portTypes[t],s=this.style,i=this.children;if(n){n.postProcess(e),this.methods=n.methods;for(let a=0;a<i.length;a++){let o=i[a];if(o.name!=="operation")continue;o.postProcess(e,"binding"),i.splice(a--,1),o.style||(o.style=s);let l=this.methods[o.$name];l&&(l.style=o.style,l.soapAction=o.soapAction,l.inputSoap=o.input||null,l.outputSoap=o.output||null,l.inputSoap&&l.inputSoap.deleteFixedAttrs(),l.outputSoap&&l.outputSoap.deleteFixedAttrs())}}delete this.$name,delete this.$type,this.deleteFixedAttrs()}description(e){let t={};for(let n in this.methods){let s=this.methods[n];t[n]=s.description(e)}return t}};$e.BindingElement=$x;var J_=class extends Xt{static{u(this,"PortElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["address","documentation"]),this.location=null}addChild(e){e.name==="address"&&typeof e.$location<"u"&&(this.location=e.$location)}};$e.PortElement=J_;var Wx=class extends Xt{static{u(this,"ServiceElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["documentation","port"]),this.ports={}}postProcess(e){let t=this.children,n=e.bindings;if(t&&t.length>0)for(let s=0;s<t.length;s++){let i=t[s];if(i.name!=="port")continue;let a=(0,lr.splitQName)(i.$binding).name,o=n[a];o&&(o.postProcess(e),this.ports[i.$name]={location:i.location,binding:o},t.splice(s--,1))}delete this.$name,this.deleteFixedAttrs()}description(e){let t={};for(let n in this.ports){let s=this.ports[n];t[n]=s.binding.description(e)}return t}};$e.ServiceElement=Wx;var zx=class extends Xt{static{u(this,"DefinitionsElement")}constructor(){super(...arguments),this.allowedChildren=Lr(["binding","documentation","import","message","portType","service","types"]),this.messages={},this.portTypes={},this.bindings={},this.services={},this.schemas={},this.descriptions={types:{},elements:{}}}init(){this.name!=="definitions"&&this.unexpected(this.nsName)}addChild(e){if(e instanceof Xx)(0,lr.merge)(this.schemas,e.schemas);else if(e instanceof Kx)this.messages[e.$name]=e;else if(e.name==="import"){let t=new Fd(e.$namespace,{});t.init(),this.schemas[e.$namespace]=t,this.schemas[e.$namespace].addChild(e)}else e instanceof Gx?this.portTypes[e.$name]=e:e instanceof $x?(e.transport==="http://schemas.xmlsoap.org/soap/http"||e.transport==="http://www.w3.org/2003/05/soap/bindings/HTTP/")&&(this.bindings[e.$name]=e):e instanceof Wx&&(this.services[e.$name]=e);this.children.pop()}};$e.DefinitionsElement=zx;var I2=class extends Xt{static{u(this,"BodyElement")}};$e.BodyElement=I2;var Jx=class extends Xt{static{u(this,"IncludeElement")}};$e.IncludeElement=Jx;var Yx=class extends Xt{static{u(this,"ImportElement")}};$e.ImportElement=Yx;var KX={all:Hx,any:C2,binding:$x,body:I2,choice:Ud,complexContent:jx,complexType:T2,definitions:zx,documentation:G_,element:Mx,enumeration:X_,extension:N2,fault:Xt,import:Yx,include:Jx,input:H_,message:Kx,operation:W_,output:K_,port:J_,portType:Gx,restriction:b2,schema:Fd,sequence:Md,service:Wx,simpleContent:qx,simpleType:x2,types:Xx,attribute:Zs};function Lr(r){let e={};for(let t of r)e[t.replace(/^_/,"")]=KX[t]||Xt;return e}u(Lr,"buildAllowedChildren");function Oo(r,...e){for(let t of e)if(t?.[r])return t[r]}u(Oo,"findNs")});var eb=ue(Jn=>{"use strict";var XX=Jn&&Jn.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),GX=Jn&&Jn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),O2=Jn&&Jn.__importStar||(function(){var r=u(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"&&XX(t,e,n[s]);return GX(t,e),t}})(),$X=Jn&&Jn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WSDL=void 0;Jn.trim=Zx;Jn.open_wsdl=tP;var WX=st("assert"),zX=$X(Iy()),JX=O2(st("fs")),Q_=Gn(),jd=O2(st("path")),D2=O2(U_()),YX=Xv(),QX=M_(),er=Gn(),pl=O2(Y_()),Z_=(0,zX.default)("node-soap"),eP="http://www.w3.org/2001/XMLSchema-instance",ZX="http://schemas.xmlsoap.org/soap/envelope/";function Zx(r){return r.trim()}u(Zx,"trim");function B2(r){return r&&r.charAt(r.length-1)!==":"?r+":":r}u(B2,"appendColon");function Qx(r){return r&&r.charAt(r.length-1)===":"?r.substring(0,r.length-1):r}u(Qx,"noColonNameSpace");var R2=class{static{u(this,"WSDL")}constructor(e,t,n){this.ignoredNamespaces=["tns","targetNamespace","typedNamespace"],this.ignoreBaseNameSpaces=!1,this.valueKey="$value",this.xmlKey="$xml";let s;if(this.uri=t,this.callback=()=>{},this._includesWsdl=[],this.WSDL_CACHE={},n&&n.WSDL_CACHE&&(this.WSDL_CACHE=n.WSDL_CACHE),this._initializeOptions(n),typeof e=="string")e=(0,er.stripBom)(e),s=this._fromXML;else if(typeof e=="object")s=this._fromServices;else throw new Error("WSDL constructor takes either an XML string or service definition");process.nextTick(()=>{try{s.call(this,e)}catch(i){return this.callback(i)}this.processIncludes(i=>{let a;if(i)return this.callback(i);try{this.definitions.deleteFixedAttrs();let o=this.services=this.definitions.services;if(o)for(a in o)o[a].postProcess(this.definitions);let l=this.definitions.complexTypes;if(l)for(a in l)l[a].deleteFixedAttrs();let c=this.definitions.bindings;for(let f in c){let p=c[f];typeof p.style>"u"&&(p.style="document");let d=p.methods,g=p.topElements={};for(let m in d)if((d[m].style||p.style)==="document"&&d[m].input){let v=d[m].input.$name,y="";d[m].output&&(y=d[m].output.$name),g[v]={methodName:m,outputName:y}}}this.xmlnsInEnvelope=this._xmlnsMap(),this.callback(i,this)}catch(o){this.callback(o)}})})}onReady(e){e&&(this.callback=e)}processIncludes(e){let t=this.definitions.schemas,n=[];for(let s in t){let i=t[s];n=n.concat(i.includes||[])}this._processNextInclude(n,e)}describeServices(){let e={};for(let t in this.services){let n=this.services[t];e[t]=n.description(this.definitions)}return e}toXML(){return this.xml||""}getSaxStream(e){let t=D2.createStream(!0,null);return e.pipe(t),t}xmlToObject(e,t){let n=typeof t=="function"?{}:D2.parser(!0,null),s=null,i={},o=[{name:null,object:i,schema:{Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}}}],l=new Map,c="soap",f={},p={};if(n.onopentag=g=>{let m=g.name,v=g.attributes,y=(0,er.splitQName)(m).name,S,C=o[o.length-1],w=C.schema,E={},A=!1,b=!1,V={},I=y;if(v.href){let F=v.href.substr(1);p[F]||(p[F]={hrefs:[],obj:null}),p[F].hrefs.push({par:C.object,key:y,obj:V})}v.id&&(p[v.id]||(p[v.id]={hrefs:[],obj:null}));for(S in v){let F=v[S];if(/^xmlns:|^xmlns$/.test(S)){let M=(0,er.splitQName)(S).name;f[M]=F,F===eP&&l.set(M,F),F===ZX&&(c=M);continue}A=!0,E[S]=F}for(S in E){let F=(0,er.splitQName)(S);if(F.name==="nil"&&f[F.prefix]===eP&&E[S]&&(E[S].toLowerCase()==="true"||E[S]==="1")){b=!0;break}}if(A&&(V[this.options.attributesKey]=E),!s&&f[c]&&C.name==="Body"&&y!=="Fault"){let F=this.definitions.messages[y];if(!F)try{let M=!1;/Response$/.test(y)?y=y.replace(/Response$/,""):/Request$/.test(y)?(M=!0,y=y.replace(/Request$/,"")):/Solicit$/.test(y)&&(M=!0,y=y.replace(/Solicit$/,""));let se=this.definitions.portTypes,ee=Object.keys(se);for(let ie of ee){let X=se[ie];if(X.methods[y])try{M?y=X.methods[y].input.$name:y=X.methods[y].output.$name,F=this.definitions.messages[y];break}catch{throw new Error(`Failed to lookup message ${y} in methods`)}}if(!F)throw new Error(`Could not find message ${y}`);this.definitions.messages[I]=F}catch(M){this.options.returnFault&&n.onerror(M)}w=F.description(this.definitions),s=I}let D,U;for(let F of l.keys())if(`${F}:type`in E){U=E[`${F}:type`];break}if(U){let F=(0,er.splitQName)(U),M;F.prefix===er.TNS_PREFIX?M=f[F.prefix]||f.xmlns:M=f[F.prefix];let se=this.findSchemaObject(M,F.name);se&&(D=se.description(this.definitions))}w&&w[y+"[]"]&&(y=y+"[]"),o.push({name:I,object:V,schema:D||w&&w[y],id:v.id,nil:b})},n.onclosetag=g=>{let m=o.pop(),v=m.object,y=o[o.length-1],S=y.object,C=y.schema,w=(0,er.splitQName)(g).name;if(typeof m.schema=="string"&&(0,er.splitQName)(m.schema).name==="string"&&typeof v=="object"&&Object.keys(v).length===0&&(v=m.object=this.options.preserveWhitespace&&m.text||""),m.nil===!0)if(this.options.handleNilAsNull)v=null;else return;(0,Q_.isPlainObject)(v)&&!Object.keys(v).length&&(v=null),C&&C[w+"[]"]?(S[w]||(S[w]=[]),S[w].push(v)):w in S?(Array.isArray(S[w])||(S[w]=[S[w]]),S[w].push(v)):S[w]=v,m.id&&(p[m.id].obj=v)},n.oncdata=g=>{let m=g;if(g=Zx(g),!!g.length)if(/<\?xml[\s\S]+\?>/.test(g)){let v=o[o.length-1],y=this.xmlToObject(g);v.object[this.options.attributesKey]?v.object[this.options.valueKey]=y:v.object=y}else n.ontext(m)},n.onerror=g=>{throw n.resume(),{Fault:{faultcode:500,faultstring:"Invalid XML",detail:new Error(g).message,statusCode:500}}},n.ontext=g=>{let m=o[o.length-1],v=g;if(g=Zx(g),!g.length){this.options.preserveWhitespace&&(m.text=(m.text||"")+v);return}let y=(0,er.splitQName)(m.schema).name,S;this.options&&this.options.customDeserializer&&this.options.customDeserializer[y]?S=this.options.customDeserializer[y](g,m):y==="int"||y==="integer"||y==="short"||y==="long"?S=parseInt(g,10):y==="double"||y==="float"||y==="decimal"?S=Number(g):y==="bool"||y==="boolean"?S=g.toLowerCase()==="true"||g==="1":y==="dateTime"||y==="date"?S=new Date(g):(this.options.preserveWhitespace&&(g=v),typeof m.object!="string"?S=g:S=m.object+g),m.object[this.options.attributesKey]?m.object[this.options.valueKey]=S:m.object=S},typeof t=="function"){let g=D2.createStream(!0,null);g.on("opentag",n.onopentag),g.on("closetag",n.onclosetag),g.on("cdata",n.oncdata),g.on("text",n.ontext),e.pipe(g).on("error",m=>{t(m)}).on("end",()=>{let m;try{m=d()}catch(v){return t(v)}t(null,m)});return}return n.write(e).close(),d();function d(){for(let g in p){let m=p[g];for(let v of m.hrefs)Object.assign(v.obj,m.obj)}if(i.Envelope){let g=i.Envelope.Body;if(g&&g.Fault){let m=g.Fault,v=m.faultcode&&m.faultcode.$value,y=m.faultstring&&m.faultstring.$value,S=m.detail&&m.detail.$value;v=v||m.faultcode,y=y||m.faultstring,S=S||m.detail,v=v||m.Code&&`${m.Code.Value}: ${m.Code.Subcode&&m.Code.Subcode.Value}`,y=y||m.Reason&&m.Reason.Text.$value,y=y||m.Reason&&m.Reason.Text,S=S||m.Detail;let C=new Error(v+": "+y+(S?": "+JSON.stringify(S):""));throw C.root=i,C}return i.Envelope}return i}u(d,"finish")}findSchemaObject(e,t){if(!e||!t)return null;let n=null;if(this.definitions.schemas){let s=this.definitions.schemas[e];s&&(t.indexOf(":")!==-1&&(t=t.substring(t.indexOf(":")+1,t.length)),n=s.complexTypes[t]||s.types[t]||s.elements[t])}return n}objectToDocumentXML(e,t,n,s,i){if(t&&t._xml)return t._xml;let a={};a[e]=t;let o=i?this.findSchemaObject(s,i):null;return this.objectToXML(a,null,n,s,!0,null,o)}objectToRpcXML(e,t,n,s,i){let a=[],o=this.definitions,l="_xmlns";n=n||(0,er.findPrefix)(o.xmlns,s),s=s||o.xmlns[n],n=n===er.TNS_PREFIX?"":n+":",a.push(["<",n,e,">"].join(""));for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&c!==l){let f=t[c];if(c===this.options.xmlKey)a.push(this.objectToXML({[c]:f},null,n,s));else{let p=(i?"":n)+c,d=[];if(typeof f=="object"&&Object.prototype.hasOwnProperty.call(f,this.options.attributesKey)){let g=f[this.options.attributesKey];for(let m in g)d.push(" "+m+'="'+g[m]+'"')}a.push(["<",p].concat(d).concat(">").join("")),a.push(typeof f=="object"?this.objectToXML(f,c,n,s):(0,er.xmlEscape)(f)),a.push(["</",p,">"].join(""))}}return a.push(["</",n,e,">"].join("")),a.join("")}isIgnoredNameSpace(e){return this.options.ignoredNamespaces.indexOf(e)>-1}filterOutIgnoredNameSpace(e){let t=Qx(e);return this.isIgnoredNameSpace(t)?"":t}objectToXML(e,t,n,s,i,a,o,l){let c=this.definitions.schemas[s];if(this.options.overrideElementKey&&Object.keys(this.options.overrideElementKey).length>0)for(let w in this.options.overrideElementKey){let E=this.options.overrideElementKey[w];e&&e[w]&&(Object.defineProperty(e,E,Object.getOwnPropertyDescriptor(e,w)),delete e[w])}let f=n?n.parent:void 0;typeof f<"u"&&(n=n.current),f=Qx(f),this.isIgnoredNameSpace(f)&&(f="");let p=!c,d=c&&c.$elementFormDefault==="qualified",g=[],m=(n||d)&&n!==er.TNS_PREFIX,v="";s&&i&&(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes?this.options.overrideRootElement.xmlnsAttributes.forEach(w=>{v+=" "+w.name+'="'+w.value+'"'}):(m&&!this.isIgnoredNameSpace(n)&&(v+=" xmlns:"+n+'="'+s+'"'),(d||p)&&(v+=' xmlns="'+s+'"'))),l?l.pushContext():(l=new QX.NamespaceContext,l.declareNamespace(n,s)),a&&!(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes)&&(v=a);let y="";this.options.overrideRootElement&&i?y=this.options.overrideRootElement.namespace:m&&(d||i||p)&&!this.isIgnoredNameSpace(n)&&(y=n);let S,C;if(Array.isArray(e)){let w="",E=!1,A=/^([^:]+):([^:]+)$/.exec(t);for(A?(w=A[1],t=A[2]):t[0]===":"&&(E=!0,t=t.substr(1)),S=0,C=e.length;S<C;S++){let b=e[S],V=this.processAttributes(b,l),I=w||f||y,D=this.objectToXML(b,t,n,s,!1,null,o,l),U=["<",t,V,v];E||(U=["<",B2(I),t,V,v]),D===""&&this.options.useEmptyTag?(U.push(" />"),g.push(U.join(""))):(U.push(">"),(this.options.namespaceArrayElements||S===0)&&g.push(U.join("")),g.push(D),(this.options.namespaceArrayElements||S===C-1)&&(E?g.push(["</",t,">"].join("")):g.push(["</",B2(I),t,">"].join(""))))}}else if(typeof e=="object"){let w="";for(t in e){if(e.hasOwnProperty||(e=Object.assign({},e)),!Object.prototype.hasOwnProperty.call(e,t)||t===this.options.attributesKey)continue;if(t===this.options.xmlKey)return l.popContext(),e[t];if(t===this.options.valueKey)return l.popContext(),(0,er.xmlEscape)(e[t]);let E=e[t];if(typeof E>"u")continue;let A=this.processAttributes(E,l),b="",V="",I=!1,D=/^([^:]+):([^:]+)$/.exec(t);if(D?(V=D[1]+":",t=D[2]):t[0]===":"&&(I=!0,t=t.substr(1)),i)b=this.objectToXML(E,t,n,s,!1,null,o,l);else if(this.definitions.schemas)if(c){let F=this.findChildSchemaObject(o,t);if(F&&(F.$type&&F.$type.indexOf("xsd:")===-1||F.$ref||F.$name)){let M="",se="",ee,ie="",X=F.$ref||F.$name;if(X){X=(0,er.splitQName)(X),se=X.name,X.prefix===er.TNS_PREFIX?(ee=F.$targetNamespace,M=l.registerNamespace(ee),this.isIgnoredNameSpace(M)&&(M=n)):(M=X.prefix,this.isIgnoredNameSpace(M)&&(M=n),ee=c.xmlns[M]||this.definitions.xmlns[M]);let Ce=!1;F.$name&&F.targetNamespace===void 0&&(F.$form==="unqualified"?Ce=!0:F.$form==="qualified"?Ce=!1:Ce=c.$elementFormDefault!=="qualified"),Ce&&(M=""),ee&&M&&l.declareNamespace(M,ee)&&(ie=" xmlns:"+M+'="'+ee+'"',v.includes(M)||(w=ie,v+=ie))}let he;if(F.$type){let Ce=(0,er.splitQName)(F.$type),xe=F.$baseNameSpace||Ce.prefix,pe=c.xmlns[xe]||this.definitions.xmlns[xe];ee=pe,pe!=="http://www.w3.org/2001/XMLSchema"&&xe!==er.TNS_PREFIX&&l.addNamespace(xe,pe),he=this.findSchemaType(Ce.name,pe)||F}else he=this.findSchemaObject(ee,se)||F;F.$baseNameSpace&&this.options.ignoreBaseNameSpaces&&(M=n,ee=s),this.options.ignoreBaseNameSpaces&&(M="",ee=""),y=M,Array.isArray(E)?(M={current:M,parent:y},ie=ie&&ie.length?ie:w):ie=null,b=this.objectToXML(E,t,M,ee,!1,ie,he,l)}else e[this.options.attributesKey]&&e[this.options.attributesKey].xsi_type?(V=e[this.options.attributesKey].xsi_type.prefix,l.addNamespace(e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns),b=this.objectToXML(E,t,e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns,!1,null,null,l)):(Array.isArray(E)&&(I?t=":"+t:t=V+t),b=this.objectToXML(E,t,n,s,!1,null,null,l))}else b=this.objectToXML(E,t,n,s,!1,null,null,l);y=Qx(y),m&&!d&&i&&!this.options.overrideRootElement?y=n:this.isIgnoredNameSpace(y)&&(y="");let U=!b&&this.options.useEmptyTag;Array.isArray(E)||g.push(["<",I?"":B2(V||y),t,A,v,E===null?' xsi:nil="true"':"",U?" />":">"].join("")),U||(g.push(b),Array.isArray(E)||g.push(["</",I?"":B2(V||y),t,">"].join("")))}}else e!==void 0&&g.push(this.options.escapeXML?(0,er.xmlEscape)(e):e);return l.popContext(),g.join("")}processAttributes(e,t){let n="";e==null&&(e=[]);let s=e[this.options.attributesKey]||{};if(s&&s.xsi_type){let i=s.xsi_type,a=i.prefix||i.namespace;i.xmlns&&(a?t.declareNamespace(a,i.xmlns):a=t.registerNamespace(i.xmlns),i.prefix=a)}return Object.keys(s).forEach(i=>{let a=s[i];if(i==="xsi_type"){let o=a.type;a.prefix&&(o=`${a.prefix}:${o}`),n+=` xsi:type="${o}"`,a.xmlns&&(n+=` xmlns:${a.prefix}="${a.xmlns}"`)}else n+=` ${i}="${(0,er.xmlEscape)(a)}"`}),n}findSchemaType(e,t){if(!this.definitions.schemas||!e||!t)return null;let n=this.definitions.schemas[t];return!n||!n.complexTypes?null:n.complexTypes[e]}findChildSchemaObject(e,t,n){if(!e||!t||(n||(n=[]),n.indexOf(e)>=0))return null;n=n.concat([e]);let s=null,i=0,a;if(Array.isArray(e.$lookupTypes)&&e.$lookupTypes.length){let c=e.$lookupTypes;for(i=0;i<c.length;i++){let f=c[i];if(f.$name===t){s=f;break}}}let o=e;if(o.$name===t&&o.name==="element"||o.$ref&&(a=(0,er.splitQName)(o.$ref),a.name===t))return o;let l;if(o.$type&&n.length===1){let c=(0,er.splitQName)(o.$type);c.prefix===er.TNS_PREFIX?l=e.$targetNamespace:l=this.definitions.xmlns[c.prefix];let f=this.findSchemaType(c.name,l);if(f)return this.findChildSchemaObject(f,t,n)}if(o.$base&&(!Array.isArray(o.children)||!o.children.length)){let c=(0,er.splitQName)(o.$base);l=e.$targetNamespace,c.prefix!==er.TNS_PREFIX&&(l=this.definitions.xmlns[c.prefix]);let f=this.findSchemaType(c.name,l);if(f)return this.findChildSchemaObject(f,t,n)}if(Array.isArray(o.children)&&o.children.length>0)for(let c of o.children){if(s=this.findChildSchemaObject(c,t,n),s)break;if(c.$base){let f=(0,er.splitQName)(c.$base),p=f.prefix===er.TNS_PREFIX?"":f.prefix;l=c.xmlns[f.prefix]||c.schemaXmlns[f.prefix];let d=this.findSchemaType(f.name,l);if(d&&(s=this.findChildSchemaObject(d,t,n),s)){s.$baseNameSpace=p;break}}}return!s&&o.$name===t?o:s}_initializeOptions(e){this._originalIgnoredNamespaces=(e||{}).ignoredNamespaces,this.options={};let t=e?e.ignoredNamespaces:null;t&&(Array.isArray(t.namespaces)||typeof t.namespaces=="string")?t.override?this.options.ignoredNamespaces=t.namespaces:this.options.ignoredNamespaces=this.ignoredNamespaces.concat(t.namespaces):this.options.ignoredNamespaces=this.ignoredNamespaces,this.options.valueKey=e.valueKey||this.valueKey,this.options.xmlKey=e.xmlKey||this.xmlKey,e.escapeXML!==void 0?this.options.escapeXML=e.escapeXML:this.options.escapeXML=!0,e.returnFault!==void 0?this.options.returnFault=e.returnFault:this.options.returnFault=!1,this.options.handleNilAsNull=!!e.handleNilAsNull,e.namespaceArrayElements!==void 0?this.options.namespaceArrayElements=e.namespaceArrayElements:this.options.namespaceArrayElements=!0,this.options.wsdl_headers=e.wsdl_headers,this.options.wsdl_options=e.wsdl_options,e.httpClient&&(this.options.httpClient=e.httpClient),e.request&&(this.options.request=e.request);let n=e?e.ignoreBaseNameSpaces:null;n!==null&&typeof n<"u"?this.options.ignoreBaseNameSpaces=n:this.options.ignoreBaseNameSpaces=this.ignoreBaseNameSpaces,this.options.forceSoap12Headers=e.forceSoap12Headers,this.options.customDeserializer=e.customDeserializer,this.options.forceUseSchemaXmlns=e.forceUseSchemaXmlns,e.overrideElementKey!==void 0&&(this.options.overrideElementKey=e.overrideElementKey),e.overrideRootElement!==void 0&&(this.options.overrideRootElement=e.overrideRootElement),this.options.useEmptyTag=!!e.useEmptyTag}_processNextInclude(e,t){let n=e.shift();if(!n)return t();let s;if(!/^https?:/i.test(this.uri)&&!/^https?:/i.test(n.location))(this.options.wsdl_options!==void 0&&Object.prototype.hasOwnProperty.call(this.options.wsdl_options,"fixedPath")?this.options.wsdl_options.fixedPath:!1)?s=jd.resolve(jd.dirname(this.uri),jd.parse(n.location).base):s=jd.resolve(jd.dirname(this.uri),n.location);else if(/^https?:/i.test(n.location))s=n.location;else try{s=new URL(n.location,this.uri||"").toString()}catch{s=n.location}let i=Object.assign({},this.options);if(i.ignoredNamespaces=this._originalIgnoredNamespaces||this.options.ignoredNamespaces,i.WSDL_CACHE=this.WSDL_CACHE,this.options.wsdl_options!==void 0&&typeof this.options.wsdl_options.overrideImportLocation=="function")try{s=this.options.wsdl_options.overrideImportLocation(s,this.uri,n.location,i)}catch(a){return t(a)}eG(s,i,(a,o)=>{if(a)return t(a);if(this._includesWsdl.push(o),o.definitions instanceof pl.DefinitionsElement)(0,Q_.mergeWith)(this.definitions,o.definitions,(l,c)=>l instanceof pl.SchemaElement?l.merge(c):void 0);else return t(new Error("wsdl.defintions is not an instance of elements.DefinitionsElement"));this._processNextInclude(e,l=>{t(l)})})}_parse(e){let t=D2.parser(!0,null),n=[],s=null,i=null,a=null,o=null,l=this.options;return t.onopentag=c=>{let f=c.name,p=c.attributes,d=n[n.length-1],g=(0,er.splitQName)(f).name;if(g==="schema"&&(o=p),d)try{d.startElement(n,f,p,l,o)}catch(m){if(this.options.strict)throw m;n.push(new pl.Element(f,p,l,o))}else if(g==="definitions")s=new pl.DefinitionsElement(f,p,l),n.push(s);else if(g==="schema")s=new pl.DefinitionsElement("definitions",{},{}),i=new pl.TypesElement("types",{},{}),a=new pl.SchemaElement(f,p,l),i.addChild(a),s.addChild(i),n.push(a);else throw g==="html"?new Error("Root element of WSDL was <html>. This is likely an authentication issue."):new Error("Unexpected root element of WSDL or include")},t.onclosetag=c=>{let f=n[n.length-1];(0,WX.ok)(f,"Unmatched close tag: "+c),f.endElement(n,c)},t.write(e).close(),s}_fromXML(e){this.definitions=this._parse(e),this.definitions.descriptions={types:{},elements:{}},this.xml=e}_fromServices(e){}_xmlnsMap(){let e=this.definitions.xmlns,t="";for(let n in e){if(n===""||n===er.TNS_PREFIX)continue;let s=e[n];switch(s){case"http://xml.apache.org/xml-soap":case"http://schemas.xmlsoap.org/wsdl/":case"http://schemas.xmlsoap.org/wsdl/soap/":case"http://schemas.xmlsoap.org/wsdl/soap12/":case"http://schemas.xmlsoap.org/soap/encoding/":case"http://www.w3.org/2001/XMLSchema":continue}~s.indexOf("http://schemas.xmlsoap.org/")||~s.indexOf("http://www.w3.org/")||~s.indexOf("http://xml.apache.org/")||(t+=" xmlns:"+n+'="'+s+'"')}return t}};Jn.WSDL=R2;function eG(r,e,t){let n,s;typeof e=="function"?(n={},s=e):(n=e,s=t);let i=n.WSDL_CACHE[r];return i?s.call(i,null,i):tP(r,n,s)}u(eG,"open_wsdl_recursive");function tP(r,e,t){let n,s;typeof e=="function"?(n={},s=e):typeof t=="function"&&(n=e,s=t);let i=n.WSDL_CACHE||{},a=n.wsdl_headers,o=n.wsdl_options,l;return/^<\?xml[^>]*?>/i.test(r)?(l=new R2(r,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):/^https?:/i.test(r)?(Z_("Reading url: %s",r),(n.httpClient||new YX.HttpClient(n)).request(r,null,(f,p,d)=>{f?s(f):p&&p.status===200?(l=new R2(d,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):s(new Error("Invalid WSDL URL: "+r+`
64
+
65
+ \r Code: `+p.status+`
66
+
67
+ \r Response Body: `+p.data))},a,o)):(Z_("Reading file: %s",r),JX.readFile(r,"utf8",(c,f)=>{c?s(c):(l=new R2(f,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s))})),l}u(tP,"open_wsdl")});var nP=ue(rP=>{"use strict";Object.defineProperty(rP,"__esModule",{value:!0})});var uP=ue(ht=>{"use strict";var sP=ht&&ht.__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:u(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tG=ht&&ht.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),rG=ht&&ht.__importStar||(function(){var r=u(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"&&sP(t,e,n[s]);return tG(t,e),t}})(),nG=ht&&ht.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&sP(e,r,t)};Object.defineProperty(ht,"__esModule",{value:!0});ht.WSDL=ht.passwordDigest=ht.Server=ht.WSSecurityCertWithToken=ht.WSSecurityPlusCert=ht.WSSecurityCert=ht.WSSecurity=ht.NTLMSecurity=ht.ClientSSLSecurityPFX=ht.ClientSSLSecurity=ht.BearerSecurity=ht.BasicAuthSecurity=ht.HttpClient=ht.Client=ht.security=void 0;ht.createClient=aP;ht.createClientAsync=mG;ht.listen=oP;ht.createServerless=gG;var sG=sx(),iG=rG(Vx()),aG=Fx(),oG=Gn(),iP=eb();ht.security=iG;var uG=sx();Object.defineProperty(ht,"Client",{enumerable:!0,get:u(function(){return uG.Client},"get")});var lG=Xv();Object.defineProperty(ht,"HttpClient",{enumerable:!0,get:u(function(){return lG.HttpClient},"get")});var ma=Vx();Object.defineProperty(ht,"BasicAuthSecurity",{enumerable:!0,get:u(function(){return ma.BasicAuthSecurity},"get")});Object.defineProperty(ht,"BearerSecurity",{enumerable:!0,get:u(function(){return ma.BearerSecurity},"get")});Object.defineProperty(ht,"ClientSSLSecurity",{enumerable:!0,get:u(function(){return ma.ClientSSLSecurity},"get")});Object.defineProperty(ht,"ClientSSLSecurityPFX",{enumerable:!0,get:u(function(){return ma.ClientSSLSecurityPFX},"get")});Object.defineProperty(ht,"NTLMSecurity",{enumerable:!0,get:u(function(){return ma.NTLMSecurity},"get")});Object.defineProperty(ht,"WSSecurity",{enumerable:!0,get:u(function(){return ma.WSSecurity},"get")});Object.defineProperty(ht,"WSSecurityCert",{enumerable:!0,get:u(function(){return ma.WSSecurityCert},"get")});Object.defineProperty(ht,"WSSecurityPlusCert",{enumerable:!0,get:u(function(){return ma.WSSecurityPlusCert},"get")});Object.defineProperty(ht,"WSSecurityCertWithToken",{enumerable:!0,get:u(function(){return ma.WSSecurityCertWithToken},"get")});var cG=Fx();Object.defineProperty(ht,"Server",{enumerable:!0,get:u(function(){return cG.Server},"get")});var fG=Gn();Object.defineProperty(ht,"passwordDigest",{enumerable:!0,get:u(function(){return fG.passwordDigest},"get")});nG(nP(),ht);var hG=eb();Object.defineProperty(ht,"WSDL",{enumerable:!0,get:u(function(){return hG.WSDL},"get")});function pG(r,e,t,n){e.has(r)?process.nextTick(()=>{n(null,e.get(r))}):t((s,i)=>{if(s)return n(s);e.set(r,i),n(null,i)})}u(pG,"getFromCache");function dG(r,e,t){typeof e=="function"&&(t=e,e={});let n=u(s=>{(0,iP.open_wsdl)(r,e,s)},"openWsdl");if(e.disableCache===!0)n(t);else{let s;e.wsdlCache?s=e.wsdlCache:s=oG.wsdlCacheSingleton,pG(r,s,n,t)}}u(dG,"_requestWSDL");function aP(r,e,t,n){let s=n,i,a;typeof e=="function"?(i=e,s=t,a={}):typeof t=="function"&&(a=e,i=t,s=n),s=a.endpoint||s,dG(r,a,(o,l)=>{i(o,l&&new sG.Client(l,s,a))})}u(aP,"createClient");function mG(r,e,t){return typeof e>"u"&&(e={}),new Promise((n,s)=>{aP(r,e,(i,a)=>{i&&s(i),n(a)},t)})}u(mG,"createClientAsync");function oP(r,e,t,n,s){let i,a,o="";typeof e=="object"&&!(e instanceof RegExp)?(i=e,a=i.path,t=i.services,n=i.xml,o=i.uri):(a=e,i={path:e,services:t,callback:s});let l=new iP.WSDL(n||t,o,i);return new aG.Server(r,a,t,l,i)}u(oP,"listen");async function gG(r){return oP(null,r)}u(gG,"createServerless")});var P2=ue(nb=>{"use strict";(function(){nb.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
68
+ `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(nb)});var ki=ue((dP,_o)=>{"use strict";(function(){var r,e,t,n,s,i,a,o=[].slice,l={}.hasOwnProperty;r=u(function(){var c,f,p,d,g,m;if(m=arguments[0],g=2<=arguments.length?o.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(c=0,p=g.length;c<p;c++)if(d=g[c],d!=null)for(f in d)l.call(d,f)&&(m[f]=d[f]);return m},"assign"),s=u(function(c){return!!c&&Object.prototype.toString.call(c)==="[object Function]"},"isFunction"),i=u(function(c){var f;return!!c&&((f=typeof c)=="function"||f==="object")},"isObject"),t=u(function(c){return s(Array.isArray)?Array.isArray(c):Object.prototype.toString.call(c)==="[object Array]"},"isArray"),n=u(function(c){var f;if(t(c))return!c.length;for(f in c)if(l.call(c,f))return!1;return!0},"isEmpty"),a=u(function(c){var f,p;return i(c)&&(p=Object.getPrototypeOf(c))&&(f=p.constructor)&&typeof f=="function"&&f instanceof f&&Function.prototype.toString.call(f)===Function.prototype.toString.call(Object)},"isPlainObject"),e=u(function(c){return s(c.valueOf)?c.valueOf():c},"getValue"),_o.exports.assign=r,_o.exports.isFunction=s,_o.exports.isObject=i,_o.exports.isArray=t,_o.exports.isEmpty=n,_o.exports.isPlainObject=a,_o.exports.getValue=e}).call(dP)});var sb=ue((mP,gP)=>{"use strict";(function(){var r;gP.exports=r=(function(){function e(){}return u(e,"XMLDOMImplementation"),e.prototype.hasFeature=function(t,n){return!0},e.prototype.createDocumentType=function(t,n,s){throw new Error("This DOM method is not implemented.")},e.prototype.createDocument=function(t,n,s){throw new Error("This DOM method is not implemented.")},e.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.getFeature=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(mP)});var EP=ue((yP,vP)=>{"use strict";(function(){var r;vP.exports=r=(function(){function e(){}return u(e,"XMLDOMErrorHandler"),e.prototype.handleError=function(t){throw new Error(t)},e})()}).call(yP)});var AP=ue((wP,SP)=>{"use strict";(function(){var r;SP.exports=r=(function(){function e(t){this.arr=t||[]}return u(e,"XMLDOMStringList"),Object.defineProperty(e.prototype,"length",{get:u(function(){return this.arr.length},"get")}),e.prototype.item=function(t){return this.arr[t]||null},e.prototype.contains=function(t){return this.arr.indexOf(t)!==-1},e})()}).call(wP)});var bP=ue((CP,xP)=>{"use strict";(function(){var r,e,t;e=EP(),t=AP(),xP.exports=r=(function(){function n(){var s;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=s=Object.create(this.defaultParams)}return u(n,"XMLDOMConfiguration"),Object.defineProperty(n.prototype,"parameterNames",{get:u(function(){return new t(Object.keys(this.defaultParams))},"get")}),n.prototype.getParameter=function(s){return this.params.hasOwnProperty(s)?this.params[s]:null},n.prototype.canSetParameter=function(s,i){return!0},n.prototype.setParameter=function(s,i){return i!=null?this.params[s]=i:delete this.params[s]},n})()}).call(CP)});var Vr=ue((NP,TP)=>{"use strict";(function(){TP.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(NP)});var ib=ue((IP,DP)=>{"use strict";(function(){var r,e,t;r=Vr(),t=hs(),DP.exports=e=(function(){function n(s,i,a){if(this.parent=s,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),i==null)throw new Error("Missing attribute name. "+this.debugInfo(i));this.name=this.stringify.name(i),this.value=this.stringify.attValue(a),this.type=r.Attribute,this.isId=!1,this.schemaTypeInfo=null}return u(n,"XMLAttribute"),Object.defineProperty(n.prototype,"nodeType",{get:u(function(){return this.type},"get")}),Object.defineProperty(n.prototype,"ownerElement",{get:u(function(){return this.parent},"get")}),Object.defineProperty(n.prototype,"textContent",{get:u(function(){return this.value},"get"),set:u(function(s){return this.value=s||""},"set")}),Object.defineProperty(n.prototype,"namespaceURI",{get:u(function(){return""},"get")}),Object.defineProperty(n.prototype,"prefix",{get:u(function(){return""},"get")}),Object.defineProperty(n.prototype,"localName",{get:u(function(){return this.name},"get")}),Object.defineProperty(n.prototype,"specified",{get:u(function(){return!0},"get")}),n.prototype.clone=function(){return Object.create(this)},n.prototype.toString=function(s){return this.options.writer.attribute(this,this.options.writer.filterOptions(s))},n.prototype.debugInfo=function(s){return s=s||this.name,s==null?"parent: <"+this.parent.name+">":"attribute: {"+s+"}, parent: <"+this.parent.name+">"},n.prototype.isEqualNode=function(s){return!(s.namespaceURI!==this.namespaceURI||s.prefix!==this.prefix||s.localName!==this.localName||s.value!==this.value)},n})()}).call(IP)});var k2=ue((BP,RP)=>{"use strict";(function(){var r;RP.exports=r=(function(){function e(t){this.nodes=t}return u(e,"XMLNamedNodeMap"),Object.defineProperty(e.prototype,"length",{get:u(function(){return Object.keys(this.nodes).length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.getNamedItem=function(t){return this.nodes[t]},e.prototype.setNamedItem=function(t){var n;return n=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,n||null},e.prototype.removeNamedItem=function(t){var n;return n=this.nodes[t],delete this.nodes[t],n||null},e.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},e.prototype.getNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},e.prototype.removeNamedItemNS=function(t,n){throw new Error("This DOM method is not implemented.")},e})()}).call(BP)});var L2=ue((OP,_P)=>{"use strict";(function(){var r,e,t,n,s,i,a,o,l,c=u(function(p,d){for(var g in d)f.call(d,g)&&(p[g]=d[g]);function m(){this.constructor=p}return u(m,"ctor"),m.prototype=d.prototype,p.prototype=new m,p.__super__=d.prototype,p},"extend"),f={}.hasOwnProperty;l=ki(),o=l.isObject,a=l.isFunction,i=l.getValue,s=hs(),r=Vr(),e=ib(),n=k2(),_P.exports=t=(function(p){c(d,p);function d(g,m,v){var y,S,C,w;if(d.__super__.constructor.call(this,g),m==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(m),this.type=r.Element,this.attribs={},this.schemaTypeInfo=null,v!=null&&this.attribute(v),g.type===r.Document&&(this.isRoot=!0,this.documentObject=g,g.rootObject=this,g.children)){for(w=g.children,S=0,C=w.length;S<C;S++)if(y=w[S],y.type===r.DocType){y.name=this.name;break}}}return u(d,"XMLElement"),Object.defineProperty(d.prototype,"tagName",{get:u(function(){return this.name},"get")}),Object.defineProperty(d.prototype,"namespaceURI",{get:u(function(){return""},"get")}),Object.defineProperty(d.prototype,"prefix",{get:u(function(){return""},"get")}),Object.defineProperty(d.prototype,"localName",{get:u(function(){return this.name},"get")}),Object.defineProperty(d.prototype,"id",{get:u(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(d.prototype,"className",{get:u(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(d.prototype,"classList",{get:u(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(d.prototype,"attributes",{get:u(function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new n(this.attribs)),this.attributeMap},"get")}),d.prototype.clone=function(){var g,m,v,y;v=Object.create(this),v.isRoot&&(v.documentObject=null),v.attribs={},y=this.attribs;for(m in y)f.call(y,m)&&(g=y[m],v.attribs[m]=g.clone());return v.children=[],this.children.forEach(function(S){var C;return C=S.clone(),C.parent=v,v.children.push(C)}),v},d.prototype.attribute=function(g,m){var v,y;if(g!=null&&(g=i(g)),o(g))for(v in g)f.call(g,v)&&(y=g[v],this.attribute(v,y));else a(m)&&(m=m.apply()),this.options.keepNullAttributes&&m==null?this.attribs[g]=new e(this,g,""):m!=null&&(this.attribs[g]=new e(this,g,m));return this},d.prototype.removeAttribute=function(g){var m,v,y;if(g==null)throw new Error("Missing attribute name. "+this.debugInfo());if(g=i(g),Array.isArray(g))for(v=0,y=g.length;v<y;v++)m=g[v],delete this.attribs[m];else delete this.attribs[g];return this},d.prototype.toString=function(g){return this.options.writer.element(this,this.options.writer.filterOptions(g))},d.prototype.att=function(g,m){return this.attribute(g,m)},d.prototype.a=function(g,m){return this.attribute(g,m)},d.prototype.getAttribute=function(g){return this.attribs.hasOwnProperty(g)?this.attribs[g].value:null},d.prototype.setAttribute=function(g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNode=function(g){return this.attribs.hasOwnProperty(g)?this.attribs[g]:null},d.prototype.setAttributeNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.removeAttributeNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNS=function(g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setAttributeNS=function(g,m,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.removeAttributeNS=function(g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getAttributeNodeNS=function(g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setAttributeNodeNS=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagNameNS=function(g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.hasAttribute=function(g){return this.attribs.hasOwnProperty(g)},d.prototype.hasAttributeNS=function(g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setIdAttribute=function(g,m){return this.attribs.hasOwnProperty(g)?this.attribs[g].isId:m},d.prototype.setIdAttributeNS=function(g,m,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.setIdAttributeNode=function(g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByTagNameNS=function(g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.isEqualNode=function(g){var m,v,y;if(!d.__super__.isEqualNode.apply(this,arguments).isEqualNode(g)||g.namespaceURI!==this.namespaceURI||g.prefix!==this.prefix||g.localName!==this.localName||g.attribs.length!==this.attribs.length)return!1;for(m=v=0,y=this.attribs.length-1;0<=y?v<=y:v>=y;m=0<=y?++v:--v)if(!this.attribs[m].isEqualNode(g.attribs[m]))return!1;return!0},d})(s)}).call(OP)});var Hd=ue((PP,kP)=>{"use strict";(function(){var r,e,t=u(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function o(){this.constructor=s}return u(o,"ctor"),o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=hs(),kP.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a),this.value=""}return u(i,"XMLCharacterData"),Object.defineProperty(i.prototype,"data",{get:u(function(){return this.value},"get"),set:u(function(a){return this.value=a||""},"set")}),Object.defineProperty(i.prototype,"length",{get:u(function(){return this.value.length},"get")}),Object.defineProperty(i.prototype,"textContent",{get:u(function(){return this.value},"get"),set:u(function(a){return this.value=a||""},"set")}),i.prototype.clone=function(){return Object.create(this)},i.prototype.substringData=function(a,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.appendData=function(a){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.insertData=function(a,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.deleteData=function(a,o){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceData=function(a,o,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(a){return!(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(a)||a.data!==this.data)},i})(e)}).call(PP)});var V2=ue((LP,VP)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=Vr(),t=Hd(),VP.exports=e=(function(i){n(a,i);function a(o,l){if(a.__super__.constructor.call(this,o),l==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=r.CData,this.value=this.stringify.cdata(l)}return u(a,"XMLCData"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(o){return this.options.writer.cdata(this,this.options.writer.filterOptions(o))},a})(t)}).call(LP)});var F2=ue((FP,UP)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=Vr(),e=Hd(),UP.exports=t=(function(i){n(a,i);function a(o,l){if(a.__super__.constructor.call(this,o),l==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=r.Comment,this.value=this.stringify.comment(l)}return u(a,"XMLComment"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(o){return this.options.writer.comment(this,this.options.writer.filterOptions(o))},a})(e)}).call(FP)});var U2=ue((MP,jP)=>{"use strict";(function(){var r,e,t,n,s=u(function(a,o){for(var l in o)i.call(o,l)&&(a[l]=o[l]);function c(){this.constructor=a}return u(c,"ctor"),c.prototype=o.prototype,a.prototype=new c,a.__super__=o.prototype,a},"extend"),i={}.hasOwnProperty;n=ki().isObject,t=hs(),r=Vr(),jP.exports=e=(function(a){s(o,a);function o(l,c,f,p){var d;o.__super__.constructor.call(this,l),n(c)&&(d=c,c=d.version,f=d.encoding,p=d.standalone),c||(c="1.0"),this.type=r.Declaration,this.version=this.stringify.xmlVersion(c),f!=null&&(this.encoding=this.stringify.xmlEncoding(f)),p!=null&&(this.standalone=this.stringify.xmlStandalone(p))}return u(o,"XMLDeclaration"),o.prototype.toString=function(l){return this.options.writer.declaration(this,this.options.writer.filterOptions(l))},o})(t)}).call(MP)});var M2=ue((qP,HP)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=hs(),r=Vr(),HP.exports=e=(function(i){n(a,i);function a(o,l,c,f,p,d){if(a.__super__.constructor.call(this,o),l==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(c==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(l));if(!f)throw new Error("Missing DTD attribute type. "+this.debugInfo(l));if(!p)throw new Error("Missing DTD attribute default. "+this.debugInfo(l));if(p.indexOf("#")!==0&&(p="#"+p),!p.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(l));if(d&&!p.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(l));this.elementName=this.stringify.name(l),this.type=r.AttributeDeclaration,this.attributeName=this.stringify.name(c),this.attributeType=this.stringify.dtdAttType(f),d&&(this.defaultValue=this.stringify.dtdAttDefault(d)),this.defaultValueType=p}return u(a,"XMLDTDAttList"),a.prototype.toString=function(o){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(o))},a})(t)}).call(qP)});var j2=ue((KP,XP)=>{"use strict";(function(){var r,e,t,n,s=u(function(a,o){for(var l in o)i.call(o,l)&&(a[l]=o[l]);function c(){this.constructor=a}return u(c,"ctor"),c.prototype=o.prototype,a.prototype=new c,a.__super__=o.prototype,a},"extend"),i={}.hasOwnProperty;n=ki().isObject,t=hs(),r=Vr(),XP.exports=e=(function(a){s(o,a);function o(l,c,f,p){if(o.__super__.constructor.call(this,l),f==null)throw new Error("Missing DTD entity name. "+this.debugInfo(f));if(p==null)throw new Error("Missing DTD entity value. "+this.debugInfo(f));if(this.pe=!!c,this.name=this.stringify.name(f),this.type=r.EntityDeclaration,!n(p))this.value=this.stringify.dtdEntityValue(p),this.internal=!0;else{if(!p.pubID&&!p.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(f));if(p.pubID&&!p.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(f));if(this.internal=!1,p.pubID!=null&&(this.pubID=this.stringify.dtdPubID(p.pubID)),p.sysID!=null&&(this.sysID=this.stringify.dtdSysID(p.sysID)),p.nData!=null&&(this.nData=this.stringify.dtdNData(p.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(f))}}return u(o,"XMLDTDEntity"),Object.defineProperty(o.prototype,"publicId",{get:u(function(){return this.pubID},"get")}),Object.defineProperty(o.prototype,"systemId",{get:u(function(){return this.sysID},"get")}),Object.defineProperty(o.prototype,"notationName",{get:u(function(){return this.nData||null},"get")}),Object.defineProperty(o.prototype,"inputEncoding",{get:u(function(){return null},"get")}),Object.defineProperty(o.prototype,"xmlEncoding",{get:u(function(){return null},"get")}),Object.defineProperty(o.prototype,"xmlVersion",{get:u(function(){return null},"get")}),o.prototype.toString=function(l){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(l))},o})(t)}).call(KP)});var q2=ue((GP,$P)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=hs(),r=Vr(),$P.exports=e=(function(i){n(a,i);function a(o,l,c){if(a.__super__.constructor.call(this,o),l==null)throw new Error("Missing DTD element name. "+this.debugInfo());c||(c="(#PCDATA)"),Array.isArray(c)&&(c="("+c.join(",")+")"),this.name=this.stringify.name(l),this.type=r.ElementDeclaration,this.value=this.stringify.dtdElementValue(c)}return u(a,"XMLDTDElement"),a.prototype.toString=function(o){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(o))},a})(t)}).call(GP)});var H2=ue((WP,zP)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=hs(),r=Vr(),zP.exports=e=(function(i){n(a,i);function a(o,l,c){if(a.__super__.constructor.call(this,o),l==null)throw new Error("Missing DTD notation name. "+this.debugInfo(l));if(!c.pubID&&!c.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(l));this.name=this.stringify.name(l),this.type=r.NotationDeclaration,c.pubID!=null&&(this.pubID=this.stringify.dtdPubID(c.pubID)),c.sysID!=null&&(this.sysID=this.stringify.dtdSysID(c.sysID))}return u(a,"XMLDTDNotation"),Object.defineProperty(a.prototype,"publicId",{get:u(function(){return this.pubID},"get")}),Object.defineProperty(a.prototype,"systemId",{get:u(function(){return this.sysID},"get")}),a.prototype.toString=function(o){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(o))},a})(t)}).call(WP)});var K2=ue((JP,YP)=>{"use strict";(function(){var r,e,t,n,s,i,a,o,l,c=u(function(p,d){for(var g in d)f.call(d,g)&&(p[g]=d[g]);function m(){this.constructor=p}return u(m,"ctor"),m.prototype=d.prototype,p.prototype=new m,p.__super__=d.prototype,p},"extend"),f={}.hasOwnProperty;l=ki().isObject,o=hs(),r=Vr(),e=M2(),n=j2(),t=q2(),s=H2(),a=k2(),YP.exports=i=(function(p){c(d,p);function d(g,m,v){var y,S,C,w,E,A;if(d.__super__.constructor.call(this,g),this.type=r.DocType,g.children){for(w=g.children,S=0,C=w.length;S<C;S++)if(y=w[S],y.type===r.Element){this.name=y.name;break}}this.documentObject=g,l(m)&&(E=m,m=E.pubID,v=E.sysID),v==null&&(A=[m,v],v=A[0],m=A[1]),m!=null&&(this.pubID=this.stringify.dtdPubID(m)),v!=null&&(this.sysID=this.stringify.dtdSysID(v))}return u(d,"XMLDocType"),Object.defineProperty(d.prototype,"entities",{get:u(function(){var g,m,v,y,S;for(y={},S=this.children,m=0,v=S.length;m<v;m++)g=S[m],g.type===r.EntityDeclaration&&!g.pe&&(y[g.name]=g);return new a(y)},"get")}),Object.defineProperty(d.prototype,"notations",{get:u(function(){var g,m,v,y,S;for(y={},S=this.children,m=0,v=S.length;m<v;m++)g=S[m],g.type===r.NotationDeclaration&&(y[g.name]=g);return new a(y)},"get")}),Object.defineProperty(d.prototype,"publicId",{get:u(function(){return this.pubID},"get")}),Object.defineProperty(d.prototype,"systemId",{get:u(function(){return this.sysID},"get")}),Object.defineProperty(d.prototype,"internalSubset",{get:u(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),d.prototype.element=function(g,m){var v;return v=new t(this,g,m),this.children.push(v),this},d.prototype.attList=function(g,m,v,y,S){var C;return C=new e(this,g,m,v,y,S),this.children.push(C),this},d.prototype.entity=function(g,m){var v;return v=new n(this,!1,g,m),this.children.push(v),this},d.prototype.pEntity=function(g,m){var v;return v=new n(this,!0,g,m),this.children.push(v),this},d.prototype.notation=function(g,m){var v;return v=new s(this,g,m),this.children.push(v),this},d.prototype.toString=function(g){return this.options.writer.docType(this,this.options.writer.filterOptions(g))},d.prototype.ele=function(g,m){return this.element(g,m)},d.prototype.att=function(g,m,v,y,S){return this.attList(g,m,v,y,S)},d.prototype.ent=function(g,m){return this.entity(g,m)},d.prototype.pent=function(g,m){return this.pEntity(g,m)},d.prototype.not=function(g,m){return this.notation(g,m)},d.prototype.up=function(){return this.root()||this.documentObject},d.prototype.isEqualNode=function(g){return!(!d.__super__.isEqualNode.apply(this,arguments).isEqualNode(g)||g.name!==this.name||g.publicId!==this.publicId||g.systemId!==this.systemId)},d})(o)}).call(JP)});var X2=ue((QP,ZP)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=Vr(),e=hs(),ZP.exports=t=(function(i){n(a,i);function a(o,l){if(a.__super__.constructor.call(this,o),l==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=r.Raw,this.value=this.stringify.raw(l)}return u(a,"XMLRaw"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(o){return this.options.writer.raw(this,this.options.writer.filterOptions(o))},a})(e)}).call(QP)});var G2=ue((e4,t4)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=Vr(),e=Hd(),t4.exports=t=(function(i){n(a,i);function a(o,l){if(a.__super__.constructor.call(this,o),l==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=r.Text,this.value=this.stringify.text(l)}return u(a,"XMLText"),Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:u(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(a.prototype,"wholeText",{get:u(function(){var o,l,c;for(c="",l=this.previousSibling;l;)c=l.data+c,l=l.previousSibling;for(c+=this.data,o=this.nextSibling;o;)c=c+o.data,o=o.nextSibling;return c},"get")}),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(o){return this.options.writer.text(this,this.options.writer.filterOptions(o))},a.prototype.splitText=function(o){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(o){throw new Error("This DOM method is not implemented."+this.debugInfo())},a})(e)}).call(e4)});var $2=ue((r4,n4)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=Vr(),e=Hd(),n4.exports=t=(function(i){n(a,i);function a(o,l,c){if(a.__super__.constructor.call(this,o),l==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=r.ProcessingInstruction,this.target=this.stringify.insTarget(l),this.name=this.target,c&&(this.value=this.stringify.insValue(c))}return u(a,"XMLProcessingInstruction"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(o){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(o))},a.prototype.isEqualNode=function(o){return!(!a.__super__.isEqualNode.apply(this,arguments).isEqualNode(o)||o.target!==this.target)},a})(e)}).call(r4)});var ab=ue((s4,i4)=>{"use strict";(function(){var r,e,t,n=u(function(i,a){for(var o in a)s.call(a,o)&&(i[o]=a[o]);function l(){this.constructor=i}return u(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=hs(),r=Vr(),i4.exports=e=(function(i){n(a,i);function a(o){a.__super__.constructor.call(this,o),this.type=r.Dummy}return u(a,"XMLDummy"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(o){return""},a})(t)}).call(s4)});var u4=ue((a4,o4)=>{"use strict";(function(){var r;o4.exports=r=(function(){function e(t){this.nodes=t}return u(e,"XMLNodeList"),Object.defineProperty(e.prototype,"length",{get:u(function(){return this.nodes.length||0},"get")}),e.prototype.clone=function(){return this.nodes=null},e.prototype.item=function(t){return this.nodes[t]||null},e})()}).call(a4)});var f4=ue((l4,c4)=>{"use strict";(function(){c4.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(l4)});var hs=ue((h4,p4)=>{"use strict";(function(){var r,e,t,n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C,w={}.hasOwnProperty;C=ki(),S=C.isObject,y=C.isFunction,v=C.isEmpty,m=C.getValue,o=null,t=null,n=null,s=null,i=null,d=null,g=null,p=null,a=null,e=null,f=null,l=null,r=null,p4.exports=c=(function(){function E(A){this.parent=A,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,o||(o=L2(),t=V2(),n=F2(),s=U2(),i=K2(),d=X2(),g=G2(),p=$2(),a=ab(),e=Vr(),f=u4(),l=k2(),r=f4())}return u(E,"XMLNode"),Object.defineProperty(E.prototype,"nodeName",{get:u(function(){return this.name},"get")}),Object.defineProperty(E.prototype,"nodeType",{get:u(function(){return this.type},"get")}),Object.defineProperty(E.prototype,"nodeValue",{get:u(function(){return this.value},"get")}),Object.defineProperty(E.prototype,"parentNode",{get:u(function(){return this.parent},"get")}),Object.defineProperty(E.prototype,"childNodes",{get:u(function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new f(this.children)),this.childNodeList},"get")}),Object.defineProperty(E.prototype,"firstChild",{get:u(function(){return this.children[0]||null},"get")}),Object.defineProperty(E.prototype,"lastChild",{get:u(function(){return this.children[this.children.length-1]||null},"get")}),Object.defineProperty(E.prototype,"previousSibling",{get:u(function(){var A;return A=this.parent.children.indexOf(this),this.parent.children[A-1]||null},"get")}),Object.defineProperty(E.prototype,"nextSibling",{get:u(function(){var A;return A=this.parent.children.indexOf(this),this.parent.children[A+1]||null},"get")}),Object.defineProperty(E.prototype,"ownerDocument",{get:u(function(){return this.document()||null},"get")}),Object.defineProperty(E.prototype,"textContent",{get:u(function(){var A,b,V,I,D;if(this.nodeType===e.Element||this.nodeType===e.DocumentFragment){for(D="",I=this.children,b=0,V=I.length;b<V;b++)A=I[b],A.textContent&&(D+=A.textContent);return D}else return null},"get"),set:u(function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},"set")}),E.prototype.setParent=function(A){var b,V,I,D,U;for(this.parent=A,A&&(this.options=A.options,this.stringify=A.stringify),D=this.children,U=[],V=0,I=D.length;V<I;V++)b=D[V],U.push(b.setParent(this));return U},E.prototype.element=function(A,b,V){var I,D,U,F,M,se,ee,ie,X,he,Ce;if(se=null,b===null&&V==null&&(X=[{},null],b=X[0],V=X[1]),b==null&&(b={}),b=m(b),S(b)||(he=[b,V],V=he[0],b=he[1]),A!=null&&(A=m(A)),Array.isArray(A))for(U=0,ee=A.length;U<ee;U++)D=A[U],se=this.element(D);else if(y(A))se=this.element(A.apply());else if(S(A)){for(M in A)if(w.call(A,M))if(Ce=A[M],y(Ce)&&(Ce=Ce.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&M.indexOf(this.stringify.convertAttKey)===0)se=this.attribute(M.substr(this.stringify.convertAttKey.length),Ce);else if(!this.options.separateArrayItems&&Array.isArray(Ce)&&v(Ce))se=this.dummy();else if(S(Ce)&&v(Ce))se=this.element(M);else if(!this.options.keepNullNodes&&Ce==null)se=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(Ce))for(F=0,ie=Ce.length;F<ie;F++)D=Ce[F],I={},I[M]=D,se=this.element(I);else S(Ce)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&M.indexOf(this.stringify.convertTextKey)===0?se=this.element(Ce):(se=this.element(M),se.element(Ce)):se=this.element(M,Ce)}else!this.options.keepNullNodes&&V===null?se=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&A.indexOf(this.stringify.convertTextKey)===0?se=this.text(V):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&A.indexOf(this.stringify.convertCDataKey)===0?se=this.cdata(V):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&A.indexOf(this.stringify.convertCommentKey)===0?se=this.comment(V):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&A.indexOf(this.stringify.convertRawKey)===0?se=this.raw(V):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&A.indexOf(this.stringify.convertPIKey)===0?se=this.instruction(A.substr(this.stringify.convertPIKey.length),V):se=this.node(A,b,V);if(se==null)throw new Error("Could not create any elements with: "+A+". "+this.debugInfo());return se},E.prototype.insertBefore=function(A,b,V){var I,D,U,F,M;if(A?.type)return U=A,F=b,U.setParent(this),F?(D=children.indexOf(F),M=children.splice(D),children.push(U),Array.prototype.push.apply(children,M)):children.push(U),U;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(A));return D=this.parent.children.indexOf(this),M=this.parent.children.splice(D),I=this.parent.element(A,b,V),Array.prototype.push.apply(this.parent.children,M),I},E.prototype.insertAfter=function(A,b,V){var I,D,U;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(A));return D=this.parent.children.indexOf(this),U=this.parent.children.splice(D+1),I=this.parent.element(A,b,V),Array.prototype.push.apply(this.parent.children,U),I},E.prototype.remove=function(){var A,b;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return A=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[A,A-A+1].concat(b=[])),this.parent},E.prototype.node=function(A,b,V){var I,D;return A!=null&&(A=m(A)),b||(b={}),b=m(b),S(b)||(D=[b,V],V=D[0],b=D[1]),I=new o(this,A,b),V!=null&&I.text(V),this.children.push(I),I},E.prototype.text=function(A){var b;return S(A)&&this.element(A),b=new g(this,A),this.children.push(b),this},E.prototype.cdata=function(A){var b;return b=new t(this,A),this.children.push(b),this},E.prototype.comment=function(A){var b;return b=new n(this,A),this.children.push(b),this},E.prototype.commentBefore=function(A){var b,V,I;return V=this.parent.children.indexOf(this),I=this.parent.children.splice(V),b=this.parent.comment(A),Array.prototype.push.apply(this.parent.children,I),this},E.prototype.commentAfter=function(A){var b,V,I;return V=this.parent.children.indexOf(this),I=this.parent.children.splice(V+1),b=this.parent.comment(A),Array.prototype.push.apply(this.parent.children,I),this},E.prototype.raw=function(A){var b;return b=new d(this,A),this.children.push(b),this},E.prototype.dummy=function(){var A;return A=new a(this),A},E.prototype.instruction=function(A,b){var V,I,D,U,F;if(A!=null&&(A=m(A)),b!=null&&(b=m(b)),Array.isArray(A))for(U=0,F=A.length;U<F;U++)V=A[U],this.instruction(V);else if(S(A))for(V in A)w.call(A,V)&&(I=A[V],this.instruction(V,I));else y(b)&&(b=b.apply()),D=new p(this,A,b),this.children.push(D);return this},E.prototype.instructionBefore=function(A,b){var V,I,D;return I=this.parent.children.indexOf(this),D=this.parent.children.splice(I),V=this.parent.instruction(A,b),Array.prototype.push.apply(this.parent.children,D),this},E.prototype.instructionAfter=function(A,b){var V,I,D;return I=this.parent.children.indexOf(this),D=this.parent.children.splice(I+1),V=this.parent.instruction(A,b),Array.prototype.push.apply(this.parent.children,D),this},E.prototype.declaration=function(A,b,V){var I,D;return I=this.document(),D=new s(I,A,b,V),I.children.length===0?I.children.unshift(D):I.children[0].type===e.Declaration?I.children[0]=D:I.children.unshift(D),I.root()||I},E.prototype.dtd=function(A,b){var V,I,D,U,F,M,se,ee,ie,X;for(I=this.document(),D=new i(I,A,b),ie=I.children,U=F=0,se=ie.length;F<se;U=++F)if(V=ie[U],V.type===e.DocType)return I.children[U]=D,D;for(X=I.children,U=M=0,ee=X.length;M<ee;U=++M)if(V=X[U],V.isRoot)return I.children.splice(U,0,D),D;return I.children.push(D),D},E.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},E.prototype.root=function(){var A;for(A=this;A;){if(A.type===e.Document)return A.rootObject;if(A.isRoot)return A;A=A.parent}},E.prototype.document=function(){var A;for(A=this;A;){if(A.type===e.Document)return A;A=A.parent}},E.prototype.end=function(A){return this.document().end(A)},E.prototype.prev=function(){var A;if(A=this.parent.children.indexOf(this),A<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[A-1]},E.prototype.next=function(){var A;if(A=this.parent.children.indexOf(this),A===-1||A===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[A+1]},E.prototype.importDocument=function(A){var b;return b=A.root().clone(),b.parent=this,b.isRoot=!1,this.children.push(b),this},E.prototype.debugInfo=function(A){var b,V;return A=A||this.name,A==null&&!((b=this.parent)!=null&&b.name)?"":A==null?"parent: <"+this.parent.name+">":(V=this.parent)!=null&&V.name?"node: <"+A+">, parent: <"+this.parent.name+">":"node: <"+A+">"},E.prototype.ele=function(A,b,V){return this.element(A,b,V)},E.prototype.nod=function(A,b,V){return this.node(A,b,V)},E.prototype.txt=function(A){return this.text(A)},E.prototype.dat=function(A){return this.cdata(A)},E.prototype.com=function(A){return this.comment(A)},E.prototype.ins=function(A,b){return this.instruction(A,b)},E.prototype.doc=function(){return this.document()},E.prototype.dec=function(A,b,V){return this.declaration(A,b,V)},E.prototype.e=function(A,b,V){return this.element(A,b,V)},E.prototype.n=function(A,b,V){return this.node(A,b,V)},E.prototype.t=function(A){return this.text(A)},E.prototype.d=function(A){return this.cdata(A)},E.prototype.c=function(A){return this.comment(A)},E.prototype.r=function(A){return this.raw(A)},E.prototype.i=function(A,b){return this.instruction(A,b)},E.prototype.u=function(){return this.up()},E.prototype.importXMLBuilder=function(A){return this.importDocument(A)},E.prototype.replaceChild=function(A,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.removeChild=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.appendChild=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.hasChildNodes=function(){return this.children.length!==0},E.prototype.cloneNode=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isSupported=function(A,b){return!0},E.prototype.hasAttributes=function(){return this.attribs.length!==0},E.prototype.compareDocumentPosition=function(A){var b,V;return b=this,b===A?0:this.document()!==A.document()?(V=r.Disconnected|r.ImplementationSpecific,Math.random()<.5?V|=r.Preceding:V|=r.Following,V):b.isAncestor(A)?r.Contains|r.Preceding:b.isDescendant(A)?r.Contains|r.Following:b.isPreceding(A)?r.Preceding:r.Following},E.prototype.isSameNode=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupPrefix=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isDefaultNamespace=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.lookupNamespaceURI=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isEqualNode=function(A){var b,V,I;if(A.nodeType!==this.nodeType||A.children.length!==this.children.length)return!1;for(b=V=0,I=this.children.length-1;0<=I?V<=I:V>=I;b=0<=I?++V:--V)if(!this.children[b].isEqualNode(A.children[b]))return!1;return!0},E.prototype.getFeature=function(A,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setUserData=function(A,b,V){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getUserData=function(A){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.contains=function(A){return A?A===this||this.isDescendant(A):!1},E.prototype.isDescendant=function(A){var b,V,I,D,U;for(U=this.children,I=0,D=U.length;I<D;I++)if(b=U[I],A===b||(V=b.isDescendant(A),V))return!0;return!1},E.prototype.isAncestor=function(A){return A.isDescendant(this)},E.prototype.isPreceding=function(A){var b,V;return b=this.treePosition(A),V=this.treePosition(this),b===-1||V===-1?!1:b<V},E.prototype.isFollowing=function(A){var b,V;return b=this.treePosition(A),V=this.treePosition(this),b===-1||V===-1?!1:b>V},E.prototype.treePosition=function(A){var b,V;return V=0,b=!1,this.foreachTreeNode(this.document(),function(I){if(V++,!b&&I===A)return b=!0}),b?V:-1},E.prototype.foreachTreeNode=function(A,b){var V,I,D,U,F;for(A||(A=this.document()),U=A.children,I=0,D=U.length;I<D;I++){if(V=U[I],F=b(V))return F;if(F=this.foreachTreeNode(V,b),F)return F}},E})()}).call(h4)});var ob=ue((d4,m4)=>{"use strict";(function(){var r,e=u(function(n,s){return function(){return n.apply(s,arguments)}},"bind"),t={}.hasOwnProperty;m4.exports=r=(function(){function n(s){this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this);var i,a,o;s||(s={}),this.options=s,this.options.version||(this.options.version="1.0"),a=s.stringify||{};for(i in a)t.call(a,i)&&(o=a[i],this[i]=o)}return u(n,"XMLStringifier"),n.prototype.name=function(s){return this.options.noValidation?s:this.assertLegalName(""+s||"")},n.prototype.text=function(s){return this.options.noValidation?s:this.assertLegalChar(this.textEscape(""+s||""))},n.prototype.cdata=function(s){return this.options.noValidation?s:(s=""+s||"",s=s.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(s))},n.prototype.comment=function(s){if(this.options.noValidation)return s;if(s=""+s||"",s.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+s);return this.assertLegalChar(s)},n.prototype.raw=function(s){return this.options.noValidation?s:""+s||""},n.prototype.attValue=function(s){return this.options.noValidation?s:this.assertLegalChar(this.attEscape(s=""+s||""))},n.prototype.insTarget=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.insValue=function(s){if(this.options.noValidation)return s;if(s=""+s||"",s.match(/\?>/))throw new Error("Invalid processing instruction value: "+s);return this.assertLegalChar(s)},n.prototype.xmlVersion=function(s){if(this.options.noValidation)return s;if(s=""+s||"",!s.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+s);return s},n.prototype.xmlEncoding=function(s){if(this.options.noValidation)return s;if(s=""+s||"",!s.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+s);return this.assertLegalChar(s)},n.prototype.xmlStandalone=function(s){return this.options.noValidation?s:s?"yes":"no"},n.prototype.dtdPubID=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdSysID=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdElementValue=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdAttType=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdAttDefault=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdEntityValue=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.dtdNData=function(s){return this.options.noValidation?s:this.assertLegalChar(""+s||"")},n.prototype.convertAttKey="@",n.prototype.convertPIKey="?",n.prototype.convertTextKey="#text",n.prototype.convertCDataKey="#cdata",n.prototype.convertCommentKey="#comment",n.prototype.convertRawKey="#raw",n.prototype.assertLegalChar=function(s){var i,a;if(this.options.noValidation)return s;if(i="",this.options.version==="1.0"){if(i=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=s.match(i))throw new Error("Invalid character in string: "+s+" at index "+a.index)}else if(this.options.version==="1.1"&&(i=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,a=s.match(i)))throw new Error("Invalid character in string: "+s+" at index "+a.index);return s},n.prototype.assertLegalName=function(s){var i;if(this.options.noValidation)return s;if(this.assertLegalChar(s),i=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!s.match(i))throw new Error("Invalid character in name");return s},n.prototype.textEscape=function(s){var i;return this.options.noValidation?s:(i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,s.replace(i,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},n.prototype.attEscape=function(s){var i;return this.options.noValidation?s:(i=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,s.replace(i,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},n})()}).call(d4)});var Kd=ue((g4,y4)=>{"use strict";(function(){y4.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(g4)});var ub=ue((v4,E4)=>{"use strict";(function(){var r,e,t,n,s,i,a,o,l,c,f,p,d,g,m,v,y,S={}.hasOwnProperty;y=ki().assign,r=Vr(),l=U2(),c=K2(),t=V2(),n=F2(),p=L2(),g=X2(),m=G2(),d=$2(),f=ab(),s=M2(),i=q2(),a=j2(),o=H2(),e=Kd(),E4.exports=v=(function(){function C(w){var E,A,b;w||(w={}),this.options=w,A=w.writer||{};for(E in A)S.call(A,E)&&(b=A[E],this["_"+E]=this[E],this[E]=b)}return u(C,"XMLWriterBase"),C.prototype.filterOptions=function(w){var E,A,b,V,I,D,U,F;return w||(w={}),w=y({},this.options,w),E={writer:this},E.pretty=w.pretty||!1,E.allowEmpty=w.allowEmpty||!1,E.indent=(A=w.indent)!=null?A:" ",E.newline=(b=w.newline)!=null?b:`
69
+ `,E.offset=(V=w.offset)!=null?V:0,E.dontPrettyTextNodes=(I=(D=w.dontPrettyTextNodes)!=null?D:w.dontprettytextnodes)!=null?I:0,E.spaceBeforeSlash=(U=(F=w.spaceBeforeSlash)!=null?F:w.spacebeforeslash)!=null?U:"",E.spaceBeforeSlash===!0&&(E.spaceBeforeSlash=" "),E.suppressPrettyCount=0,E.user={},E.state=e.None,E},C.prototype.indent=function(w,E,A){var b;return!E.pretty||E.suppressPrettyCount?"":E.pretty&&(b=(A||0)+E.offset+1,b>0)?new Array(b).join(E.indent):""},C.prototype.endline=function(w,E,A){return!E.pretty||E.suppressPrettyCount?"":E.newline},C.prototype.attribute=function(w,E,A){var b;return this.openAttribute(w,E,A),b=" "+w.name+'="'+w.value+'"',this.closeAttribute(w,E,A),b},C.prototype.cdata=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A)+"<![CDATA[",E.state=e.InsideTag,b+=w.value,E.state=e.CloseTag,b+="]]>"+this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.comment=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A)+"<!-- ",E.state=e.InsideTag,b+=w.value,E.state=e.CloseTag,b+=" -->"+this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.declaration=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A)+"<?xml",E.state=e.InsideTag,b+=' version="'+w.version+'"',w.encoding!=null&&(b+=' encoding="'+w.encoding+'"'),w.standalone!=null&&(b+=' standalone="'+w.standalone+'"'),E.state=e.CloseTag,b+=E.spaceBeforeSlash+"?>",b+=this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.docType=function(w,E,A){var b,V,I,D,U;if(A||(A=0),this.openNode(w,E,A),E.state=e.OpenTag,D=this.indent(w,E,A),D+="<!DOCTYPE "+w.root().name,w.pubID&&w.sysID?D+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(D+=' SYSTEM "'+w.sysID+'"'),w.children.length>0){for(D+=" [",D+=this.endline(w,E,A),E.state=e.InsideTag,U=w.children,V=0,I=U.length;V<I;V++)b=U[V],D+=this.writeChildNode(b,E,A+1);E.state=e.CloseTag,D+="]"}return E.state=e.CloseTag,D+=E.spaceBeforeSlash+">",D+=this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),D},C.prototype.element=function(w,E,A){var b,V,I,D,U,F,M,se,ee,ie,X,he,Ce,xe;A||(A=0),ie=!1,X="",this.openNode(w,E,A),E.state=e.OpenTag,X+=this.indent(w,E,A)+"<"+w.name,he=w.attribs;for(ee in he)S.call(he,ee)&&(b=he[ee],X+=this.attribute(b,E,A));if(I=w.children.length,D=I===0?null:w.children[0],I===0||w.children.every(function(pe){return(pe.type===r.Text||pe.type===r.Raw)&&pe.value===""}))E.allowEmpty?(X+=">",E.state=e.CloseTag,X+="</"+w.name+">"+this.endline(w,E,A)):(E.state=e.CloseTag,X+=E.spaceBeforeSlash+"/>"+this.endline(w,E,A));else if(E.pretty&&I===1&&(D.type===r.Text||D.type===r.Raw)&&D.value!=null)X+=">",E.state=e.InsideTag,E.suppressPrettyCount++,ie=!0,X+=this.writeChildNode(D,E,A+1),E.suppressPrettyCount--,ie=!1,E.state=e.CloseTag,X+="</"+w.name+">"+this.endline(w,E,A);else{if(E.dontPrettyTextNodes){for(Ce=w.children,U=0,M=Ce.length;U<M;U++)if(V=Ce[U],(V.type===r.Text||V.type===r.Raw)&&V.value!=null){E.suppressPrettyCount++,ie=!0;break}}for(X+=">"+this.endline(w,E,A),E.state=e.InsideTag,xe=w.children,F=0,se=xe.length;F<se;F++)V=xe[F],X+=this.writeChildNode(V,E,A+1);E.state=e.CloseTag,X+=this.indent(w,E,A)+"</"+w.name+">",ie&&E.suppressPrettyCount--,X+=this.endline(w,E,A),E.state=e.None}return this.closeNode(w,E,A),X},C.prototype.writeChildNode=function(w,E,A){switch(w.type){case r.CData:return this.cdata(w,E,A);case r.Comment:return this.comment(w,E,A);case r.Element:return this.element(w,E,A);case r.Raw:return this.raw(w,E,A);case r.Text:return this.text(w,E,A);case r.ProcessingInstruction:return this.processingInstruction(w,E,A);case r.Dummy:return"";case r.Declaration:return this.declaration(w,E,A);case r.DocType:return this.docType(w,E,A);case r.AttributeDeclaration:return this.dtdAttList(w,E,A);case r.ElementDeclaration:return this.dtdElement(w,E,A);case r.EntityDeclaration:return this.dtdEntity(w,E,A);case r.NotationDeclaration:return this.dtdNotation(w,E,A);default:throw new Error("Unknown XML node type: "+w.constructor.name)}},C.prototype.processingInstruction=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A)+"<?",E.state=e.InsideTag,b+=w.target,w.value&&(b+=" "+w.value),E.state=e.CloseTag,b+=E.spaceBeforeSlash+"?>",b+=this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.raw=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A),E.state=e.InsideTag,b+=w.value,E.state=e.CloseTag,b+=this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.text=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A),E.state=e.InsideTag,b+=w.value,E.state=e.CloseTag,b+=this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.dtdAttList=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A)+"<!ATTLIST",E.state=e.InsideTag,b+=" "+w.elementName+" "+w.attributeName+" "+w.attributeType,w.defaultValueType!=="#DEFAULT"&&(b+=" "+w.defaultValueType),w.defaultValue&&(b+=' "'+w.defaultValue+'"'),E.state=e.CloseTag,b+=E.spaceBeforeSlash+">"+this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.dtdElement=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A)+"<!ELEMENT",E.state=e.InsideTag,b+=" "+w.name+" "+w.value,E.state=e.CloseTag,b+=E.spaceBeforeSlash+">"+this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.dtdEntity=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A)+"<!ENTITY",E.state=e.InsideTag,w.pe&&(b+=" %"),b+=" "+w.name,w.value?b+=' "'+w.value+'"':(w.pubID&&w.sysID?b+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(b+=' SYSTEM "'+w.sysID+'"'),w.nData&&(b+=" NDATA "+w.nData)),E.state=e.CloseTag,b+=E.spaceBeforeSlash+">"+this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.dtdNotation=function(w,E,A){var b;return this.openNode(w,E,A),E.state=e.OpenTag,b=this.indent(w,E,A)+"<!NOTATION",E.state=e.InsideTag,b+=" "+w.name,w.pubID&&w.sysID?b+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.pubID?b+=' PUBLIC "'+w.pubID+'"':w.sysID&&(b+=' SYSTEM "'+w.sysID+'"'),E.state=e.CloseTag,b+=E.spaceBeforeSlash+">"+this.endline(w,E,A),E.state=e.None,this.closeNode(w,E,A),b},C.prototype.openNode=function(w,E,A){},C.prototype.closeNode=function(w,E,A){},C.prototype.openAttribute=function(w,E,A){},C.prototype.closeAttribute=function(w,E,A){},C})()}).call(v4)});var W2=ue((w4,S4)=>{"use strict";(function(){var r,e,t=u(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function o(){this.constructor=s}return u(o,"ctor"),o.prototype=i.prototype,s.prototype=new o,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=ub(),S4.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a)}return u(i,"XMLStringWriter"),i.prototype.document=function(a,o){var l,c,f,p,d;for(o=this.filterOptions(o),p="",d=a.children,c=0,f=d.length;c<f;c++)l=d[c],p+=this.writeChildNode(l,o,0);return o.pretty&&p.slice(-o.newline.length)===o.newline&&(p=p.slice(0,-o.newline.length)),p},i})(e)}).call(w4)});var lb=ue((A4,C4)=>{"use strict";(function(){var r,e,t,n,s,i,a,o,l=u(function(f,p){for(var d in p)c.call(p,d)&&(f[d]=p[d]);function g(){this.constructor=f}return u(g,"ctor"),g.prototype=p.prototype,f.prototype=new g,f.__super__=p.prototype,f},"extend"),c={}.hasOwnProperty;o=ki().isPlainObject,t=sb(),e=bP(),s=hs(),r=Vr(),a=ob(),i=W2(),C4.exports=n=(function(f){l(p,f);function p(d){p.__super__.constructor.call(this,null),this.name="#document",this.type=r.Document,this.documentURI=null,this.domConfig=new e,d||(d={}),d.writer||(d.writer=new i),this.options=d,this.stringify=new a(d)}return u(p,"XMLDocument"),Object.defineProperty(p.prototype,"implementation",{value:new t}),Object.defineProperty(p.prototype,"doctype",{get:u(function(){var d,g,m,v;for(v=this.children,g=0,m=v.length;g<m;g++)if(d=v[g],d.type===r.DocType)return d;return null},"get")}),Object.defineProperty(p.prototype,"documentElement",{get:u(function(){return this.rootObject||null},"get")}),Object.defineProperty(p.prototype,"inputEncoding",{get:u(function(){return null},"get")}),Object.defineProperty(p.prototype,"strictErrorChecking",{get:u(function(){return!1},"get")}),Object.defineProperty(p.prototype,"xmlEncoding",{get:u(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].encoding:null},"get")}),Object.defineProperty(p.prototype,"xmlStandalone",{get:u(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].standalone==="yes":!1},"get")}),Object.defineProperty(p.prototype,"xmlVersion",{get:u(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].version:"1.0"},"get")}),Object.defineProperty(p.prototype,"URL",{get:u(function(){return this.documentURI},"get")}),Object.defineProperty(p.prototype,"origin",{get:u(function(){return null},"get")}),Object.defineProperty(p.prototype,"compatMode",{get:u(function(){return null},"get")}),Object.defineProperty(p.prototype,"characterSet",{get:u(function(){return null},"get")}),Object.defineProperty(p.prototype,"contentType",{get:u(function(){return null},"get")}),p.prototype.end=function(d){var g;return g={},d?o(d)&&(g=d,d=this.options.writer):d=this.options.writer,d.document(this,d.filterOptions(g))},p.prototype.toString=function(d){return this.options.writer.document(this,this.options.writer.filterOptions(d))},p.prototype.createElement=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createTextNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createComment=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createCDATASection=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createProcessingInstruction=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createAttribute=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createEntityReference=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.importNode=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createElementNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createAttributeNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByTagNameNS=function(d,g){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementById=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.adoptNode=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.renameNode=function(d,g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.getElementsByClassName=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createEvent=function(d){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createNodeIterator=function(d,g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},p.prototype.createTreeWalker=function(d,g,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},p})(s)}).call(A4)});var N4=ue((x4,b4)=>{"use strict";(function(){var r,e,t,n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C,w,E,A,b,V,I={}.hasOwnProperty;V=ki(),A=V.isObject,E=V.isFunction,b=V.isPlainObject,w=V.getValue,r=Vr(),p=lb(),g=L2(),n=V2(),s=F2(),v=X2(),C=G2(),m=$2(),c=U2(),f=K2(),i=M2(),o=j2(),a=q2(),l=H2(),t=ib(),S=ob(),y=W2(),e=Kd(),b4.exports=d=(function(){function D(U,F,M){var se;this.name="?xml",this.type=r.Document,U||(U={}),se={},U.writer?b(U.writer)&&(se=U.writer,U.writer=new y):U.writer=new y,this.options=U,this.writer=U.writer,this.writerOptions=this.writer.filterOptions(se),this.stringify=new S(U),this.onDataCallback=F||function(){},this.onEndCallback=M||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return u(D,"XMLDocumentCB"),D.prototype.createChildNode=function(U){var F,M,se,ee,ie,X,he,Ce;switch(U.type){case r.CData:this.cdata(U.value);break;case r.Comment:this.comment(U.value);break;case r.Element:se={},he=U.attribs;for(M in he)I.call(he,M)&&(F=he[M],se[M]=F.value);this.node(U.name,se);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(U.value);break;case r.Text:this.text(U.value);break;case r.ProcessingInstruction:this.instruction(U.target,U.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+U.constructor.name)}for(Ce=U.children,ie=0,X=Ce.length;ie<X;ie++)ee=Ce[ie],this.createChildNode(ee),ee.type===r.Element&&this.up();return this},D.prototype.dummy=function(){return this},D.prototype.node=function(U,F,M){var se;if(U==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(U));return this.openCurrent(),U=w(U),F==null&&(F={}),F=w(F),A(F)||(se=[F,M],M=se[0],F=se[1]),this.currentNode=new g(this,U,F),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,M!=null&&this.text(M),this},D.prototype.element=function(U,F,M){var se,ee,ie,X,he,Ce;if(this.currentNode&&this.currentNode.type===r.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(U)||A(U)||E(U))for(X=this.options.noValidation,this.options.noValidation=!0,Ce=new p(this.options).element("TEMP_ROOT"),Ce.element(U),this.options.noValidation=X,he=Ce.children,ee=0,ie=he.length;ee<ie;ee++)se=he[ee],this.createChildNode(se),se.type===r.Element&&this.up();else this.node(U,F,M);return this},D.prototype.attribute=function(U,F){var M,se;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(U));if(U!=null&&(U=w(U)),A(U))for(M in U)I.call(U,M)&&(se=U[M],this.attribute(M,se));else E(F)&&(F=F.apply()),this.options.keepNullAttributes&&F==null?this.currentNode.attribs[U]=new t(this,U,""):F!=null&&(this.currentNode.attribs[U]=new t(this,U,F));return this},D.prototype.text=function(U){var F;return this.openCurrent(),F=new C(this,U),this.onData(this.writer.text(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.cdata=function(U){var F;return this.openCurrent(),F=new n(this,U),this.onData(this.writer.cdata(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.comment=function(U){var F;return this.openCurrent(),F=new s(this,U),this.onData(this.writer.comment(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.raw=function(U){var F;return this.openCurrent(),F=new v(this,U),this.onData(this.writer.raw(F,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.instruction=function(U,F){var M,se,ee,ie,X;if(this.openCurrent(),U!=null&&(U=w(U)),F!=null&&(F=w(F)),Array.isArray(U))for(M=0,ie=U.length;M<ie;M++)se=U[M],this.instruction(se);else if(A(U))for(se in U)I.call(U,se)&&(ee=U[se],this.instruction(se,ee));else E(F)&&(F=F.apply()),X=new m(this,U,F),this.onData(this.writer.processingInstruction(X,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},D.prototype.declaration=function(U,F,M){var se;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return se=new c(this,U,F,M),this.onData(this.writer.declaration(se,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.doctype=function(U,F,M){if(this.openCurrent(),U==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new f(this,F,M),this.currentNode.rootNodeName=U,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},D.prototype.dtdElement=function(U,F){var M;return this.openCurrent(),M=new a(this,U,F),this.onData(this.writer.dtdElement(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.attList=function(U,F,M,se,ee){var ie;return this.openCurrent(),ie=new i(this,U,F,M,se,ee),this.onData(this.writer.dtdAttList(ie,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.entity=function(U,F){var M;return this.openCurrent(),M=new o(this,!1,U,F),this.onData(this.writer.dtdEntity(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.pEntity=function(U,F){var M;return this.openCurrent(),M=new o(this,!0,U,F),this.onData(this.writer.dtdEntity(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.notation=function(U,F){var M;return this.openCurrent(),M=new l(this,U,F),this.onData(this.writer.dtdNotation(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},D.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},D.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},D.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},D.prototype.openNode=function(U){var F,M,se,ee;if(!U.isOpen){if(!this.root&&this.currentLevel===0&&U.type===r.Element&&(this.root=U),M="",U.type===r.Element){this.writerOptions.state=e.OpenTag,M=this.writer.indent(U,this.writerOptions,this.currentLevel)+"<"+U.name,ee=U.attribs;for(se in ee)I.call(ee,se)&&(F=ee[se],M+=this.writer.attribute(F,this.writerOptions,this.currentLevel));M+=(U.children?">":"/>")+this.writer.endline(U,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,M=this.writer.indent(U,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+U.rootNodeName,U.pubID&&U.sysID?M+=' PUBLIC "'+U.pubID+'" "'+U.sysID+'"':U.sysID&&(M+=' SYSTEM "'+U.sysID+'"'),U.children?(M+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,M+=">"),M+=this.writer.endline(U,this.writerOptions,this.currentLevel);return this.onData(M,this.currentLevel),U.isOpen=!0}},D.prototype.closeNode=function(U){var F;if(!U.isClosed)return F="",this.writerOptions.state=e.CloseTag,U.type===r.Element?F=this.writer.indent(U,this.writerOptions,this.currentLevel)+"</"+U.name+">"+this.writer.endline(U,this.writerOptions,this.currentLevel):F=this.writer.indent(U,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(U,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(F,this.currentLevel),U.isClosed=!0},D.prototype.onData=function(U,F){return this.documentStarted=!0,this.onDataCallback(U,F+1)},D.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},D.prototype.debugInfo=function(U){return U==null?"":"node: <"+U+">"},D.prototype.ele=function(){return this.element.apply(this,arguments)},D.prototype.nod=function(U,F,M){return this.node(U,F,M)},D.prototype.txt=function(U){return this.text(U)},D.prototype.dat=function(U){return this.cdata(U)},D.prototype.com=function(U){return this.comment(U)},D.prototype.ins=function(U,F){return this.instruction(U,F)},D.prototype.dec=function(U,F,M){return this.declaration(U,F,M)},D.prototype.dtd=function(U,F,M){return this.doctype(U,F,M)},D.prototype.e=function(U,F,M){return this.element(U,F,M)},D.prototype.n=function(U,F,M){return this.node(U,F,M)},D.prototype.t=function(U){return this.text(U)},D.prototype.d=function(U){return this.cdata(U)},D.prototype.c=function(U){return this.comment(U)},D.prototype.r=function(U){return this.raw(U)},D.prototype.i=function(U,F){return this.instruction(U,F)},D.prototype.att=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},D.prototype.a=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},D.prototype.ent=function(U,F){return this.entity(U,F)},D.prototype.pent=function(U,F){return this.pEntity(U,F)},D.prototype.not=function(U,F){return this.notation(U,F)},D})()}).call(x4)});var D4=ue((T4,I4)=>{"use strict";(function(){var r,e,t,n,s=u(function(a,o){for(var l in o)i.call(o,l)&&(a[l]=o[l]);function c(){this.constructor=a}return u(c,"ctor"),c.prototype=o.prototype,a.prototype=new c,a.__super__=o.prototype,a},"extend"),i={}.hasOwnProperty;r=Vr(),n=ub(),e=Kd(),I4.exports=t=(function(a){s(o,a);function o(l,c){this.stream=l,o.__super__.constructor.call(this,c)}return u(o,"XMLStreamWriter"),o.prototype.endline=function(l,c,f){return l.isLastRootNode&&c.state===e.CloseTag?"":o.__super__.endline.call(this,l,c,f)},o.prototype.document=function(l,c){var f,p,d,g,m,v,y,S,C;for(y=l.children,p=d=0,m=y.length;d<m;p=++d)f=y[p],f.isLastRootNode=p===l.children.length-1;for(c=this.filterOptions(c),S=l.children,C=[],g=0,v=S.length;g<v;g++)f=S[g],C.push(this.writeChildNode(f,c,0));return C},o.prototype.attribute=function(l,c,f){return this.stream.write(o.__super__.attribute.call(this,l,c,f))},o.prototype.cdata=function(l,c,f){return this.stream.write(o.__super__.cdata.call(this,l,c,f))},o.prototype.comment=function(l,c,f){return this.stream.write(o.__super__.comment.call(this,l,c,f))},o.prototype.declaration=function(l,c,f){return this.stream.write(o.__super__.declaration.call(this,l,c,f))},o.prototype.docType=function(l,c,f){var p,d,g,m;if(f||(f=0),this.openNode(l,c,f),c.state=e.OpenTag,this.stream.write(this.indent(l,c,f)),this.stream.write("<!DOCTYPE "+l.root().name),l.pubID&&l.sysID?this.stream.write(' PUBLIC "'+l.pubID+'" "'+l.sysID+'"'):l.sysID&&this.stream.write(' SYSTEM "'+l.sysID+'"'),l.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(l,c,f)),c.state=e.InsideTag,m=l.children,d=0,g=m.length;d<g;d++)p=m[d],this.writeChildNode(p,c,f+1);c.state=e.CloseTag,this.stream.write("]")}return c.state=e.CloseTag,this.stream.write(c.spaceBeforeSlash+">"),this.stream.write(this.endline(l,c,f)),c.state=e.None,this.closeNode(l,c,f)},o.prototype.element=function(l,c,f){var p,d,g,m,v,y,S,C,w,E;f||(f=0),this.openNode(l,c,f),c.state=e.OpenTag,this.stream.write(this.indent(l,c,f)+"<"+l.name),w=l.attribs;for(S in w)i.call(w,S)&&(p=w[S],this.attribute(p,c,f));if(g=l.children.length,m=g===0?null:l.children[0],g===0||l.children.every(function(A){return(A.type===r.Text||A.type===r.Raw)&&A.value===""}))c.allowEmpty?(this.stream.write(">"),c.state=e.CloseTag,this.stream.write("</"+l.name+">")):(c.state=e.CloseTag,this.stream.write(c.spaceBeforeSlash+"/>"));else if(c.pretty&&g===1&&(m.type===r.Text||m.type===r.Raw)&&m.value!=null)this.stream.write(">"),c.state=e.InsideTag,c.suppressPrettyCount++,C=!0,this.writeChildNode(m,c,f+1),c.suppressPrettyCount--,C=!1,c.state=e.CloseTag,this.stream.write("</"+l.name+">");else{for(this.stream.write(">"+this.endline(l,c,f)),c.state=e.InsideTag,E=l.children,v=0,y=E.length;v<y;v++)d=E[v],this.writeChildNode(d,c,f+1);c.state=e.CloseTag,this.stream.write(this.indent(l,c,f)+"</"+l.name+">")}return this.stream.write(this.endline(l,c,f)),c.state=e.None,this.closeNode(l,c,f)},o.prototype.processingInstruction=function(l,c,f){return this.stream.write(o.__super__.processingInstruction.call(this,l,c,f))},o.prototype.raw=function(l,c,f){return this.stream.write(o.__super__.raw.call(this,l,c,f))},o.prototype.text=function(l,c,f){return this.stream.write(o.__super__.text.call(this,l,c,f))},o.prototype.dtdAttList=function(l,c,f){return this.stream.write(o.__super__.dtdAttList.call(this,l,c,f))},o.prototype.dtdElement=function(l,c,f){return this.stream.write(o.__super__.dtdElement.call(this,l,c,f))},o.prototype.dtdEntity=function(l,c,f){return this.stream.write(o.__super__.dtdEntity.call(this,l,c,f))},o.prototype.dtdNotation=function(l,c,f){return this.stream.write(o.__super__.dtdNotation.call(this,l,c,f))},o})(n)}).call(T4)});var R4=ue((B4,Po)=>{"use strict";(function(){var r,e,t,n,s,i,a,o,l,c;c=ki(),o=c.assign,l=c.isFunction,t=sb(),n=lb(),s=N4(),a=W2(),i=D4(),r=Vr(),e=Kd(),Po.exports.create=function(f,p,d,g){var m,v;if(f==null)throw new Error("Root element needs a name.");return g=o({},p,d,g),m=new n(g),v=m.element(f),g.headless||(m.declaration(g),(g.pubID!=null||g.sysID!=null)&&m.dtd(g)),v},Po.exports.begin=function(f,p,d){var g;return l(f)&&(g=[f,p],p=g[0],d=g[1],f={}),p?new s(f,p,d):new n(f)},Po.exports.stringWriter=function(f){return new a(f)},Po.exports.streamWriter=function(f,p){return new i(f,p)},Po.exports.implementation=new t,Po.exports.nodeType=r,Po.exports.writerState=e}).call(B4)});var O4=ue(cb=>{"use strict";(function(){"use strict";var r,e,t,n,s,i={}.hasOwnProperty;r=R4(),e=P2().defaults,n=u(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),s=u(function(a){return"<![CDATA["+t(a)+"]]>"},"wrapCDATA"),t=u(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),cb.Builder=(function(){function a(o){var l,c,f;this.options={},c=e["0.2"];for(l in c)i.call(c,l)&&(f=c[l],this.options[l]=f);for(l in o)i.call(o,l)&&(f=o[l],this.options[l]=f)}return u(a,"Builder"),a.prototype.buildObject=function(o){var l,c,f,p,d;return l=this.options.attrkey,c=this.options.charkey,Object.keys(o).length===1&&this.options.rootName===e["0.2"].rootName?(d=Object.keys(o)[0],o=o[d]):d=this.options.rootName,f=(function(g){return function(m,v){var y,S,C,w,E,A;if(typeof v!="object")g.options.cdata&&n(v)?m.raw(s(v)):m.txt(v);else if(Array.isArray(v)){for(w in v)if(i.call(v,w)){S=v[w];for(E in S)C=S[E],m=f(m.ele(E),C).up()}}else for(E in v)if(i.call(v,E))if(S=v[E],E===l){if(typeof S=="object")for(y in S)A=S[y],m=m.att(y,A)}else if(E===c)g.options.cdata&&n(S)?m=m.raw(s(S)):m=m.txt(S);else if(Array.isArray(S))for(w in S)i.call(S,w)&&(C=S[w],typeof C=="string"?g.options.cdata&&n(C)?m=m.ele(E).raw(s(C)).up():m=m.ele(E,C).up():m=f(m.ele(E),C).up());else typeof S=="object"?m=f(m.ele(E),S).up():typeof S=="string"&&g.options.cdata&&n(S)?m=m.ele(E).raw(s(S)).up():(S==null&&(S=""),m=m.ele(E,S.toString()).up());return m}})(this),p=r.create(d,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),f(p,o).end(this.options.renderOpts)},a})()}).call(cb)});var _4=ue(z2=>{"use strict";(function(r){r.parser=function(O,B){return new t(O,B)},r.SAXParser=t,r.SAXStream=c,r.createStream=l,r.MAX_BUFFER_LENGTH=64*1024;var e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function t(O,B){if(!(this instanceof t))return new t(O,B);var Q=this;s(Q),Q.q=Q.c="",Q.bufferCheckPosition=r.MAX_BUFFER_LENGTH,Q.opt=B||{},Q.opt.lowercase=Q.opt.lowercase||Q.opt.lowercasetags,Q.looseCase=Q.opt.lowercase?"toLowerCase":"toUpperCase",Q.tags=[],Q.closed=Q.closedRoot=Q.sawRoot=!1,Q.tag=Q.error=null,Q.strict=!!O,Q.noscript=!!(O||Q.opt.noscript),Q.state=I.BEGIN,Q.strictEntities=Q.opt.strictEntities,Q.ENTITIES=Q.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES),Q.attribList=[],Q.opt.xmlns&&(Q.ns=Object.create(m)),Q.opt.unquotedAttributeValues===void 0&&(Q.opt.unquotedAttributeValues=!O),Q.trackPosition=Q.opt.position!==!1,Q.trackPosition&&(Q.position=Q.line=Q.column=0),U(Q,"onready")}u(t,"SAXParser"),Object.create||(Object.create=function(O){function B(){}u(B,"F"),B.prototype=O;var Q=new B;return Q}),Object.keys||(Object.keys=function(O){var B=[];for(var Q in O)O.hasOwnProperty(Q)&&B.push(Q);return B});function n(O){for(var B=Math.max(r.MAX_BUFFER_LENGTH,10),Q=0,K=0,_e=e.length;K<_e;K++){var R=O[e[K]].length;if(R>B)switch(e[K]){case"textNode":M(O);break;case"cdata":F(O,"oncdata",O.cdata),O.cdata="";break;case"script":F(O,"onscript",O.script),O.script="";break;default:ee(O,"Max buffer length exceeded: "+e[K])}Q=Math.max(Q,R)}var N=r.MAX_BUFFER_LENGTH-Q;O.bufferCheckPosition=N+O.position}u(n,"checkBufferLength");function s(O){for(var B=0,Q=e.length;B<Q;B++)O[e[B]]=""}u(s,"clearBuffers");function i(O){M(O),O.cdata!==""&&(F(O,"oncdata",O.cdata),O.cdata=""),O.script!==""&&(F(O,"onscript",O.script),O.script="")}u(i,"flushBuffers"),t.prototype={end:u(function(){ie(this)},"end"),write:Le,resume:u(function(){return this.error=null,this},"resume"),close:u(function(){return this.write(null)},"close"),flush:u(function(){i(this)},"flush")};var a;try{a=st("stream").Stream}catch{a=u(function(){},"Stream")}a||(a=u(function(){},"Stream"));var o=r.EVENTS.filter(function(O){return O!=="error"&&O!=="end"});function l(O,B){return new c(O,B)}u(l,"createStream");function c(O,B){if(!(this instanceof c))return new c(O,B);a.apply(this),this._parser=new t(O,B),this.writable=!0,this.readable=!0;var Q=this;this._parser.onend=function(){Q.emit("end")},this._parser.onerror=function(K){Q.emit("error",K),Q._parser.error=null},this._decoder=null,o.forEach(function(K){Object.defineProperty(Q,"on"+K,{get:u(function(){return Q._parser["on"+K]},"get"),set:u(function(_e){if(!_e)return Q.removeAllListeners(K),Q._parser["on"+K]=_e,_e;Q.on(K,_e)},"set"),enumerable:!0,configurable:!1})})}u(c,"SAXStream"),c.prototype=Object.create(a.prototype,{constructor:{value:c}}),c.prototype.write=function(O){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(O)){if(!this._decoder){var B=st("string_decoder").StringDecoder;this._decoder=new B("utf8")}O=this._decoder.write(O)}return this._parser.write(O.toString()),this.emit("data",O),!0},c.prototype.end=function(O){return O&&O.length&&this.write(O),this._parser.end(),!0},c.prototype.on=function(O,B){var Q=this;return!Q._parser["on"+O]&&o.indexOf(O)!==-1&&(Q._parser["on"+O]=function(){var K=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);K.splice(0,0,O),Q.emit.apply(Q,K)}),a.prototype.on.call(Q,O,B)};var f="[CDATA[",p="DOCTYPE",d="http://www.w3.org/XML/1998/namespace",g="http://www.w3.org/2000/xmlns/",m={xml:d,xmlns:g},v=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,S=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,C=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function w(O){return O===" "||O===`
70
+ `||O==="\r"||O===" "}u(w,"isWhitespace");function E(O){return O==='"'||O==="'"}u(E,"isQuote");function A(O){return O===">"||w(O)}u(A,"isAttribEnd");function b(O,B){return O.test(B)}u(b,"isMatch");function V(O,B){return!b(O,B)}u(V,"notMatch");var I=0;r.STATE={BEGIN:I++,BEGIN_WHITESPACE:I++,TEXT:I++,TEXT_ENTITY:I++,OPEN_WAKA:I++,SGML_DECL:I++,SGML_DECL_QUOTED:I++,DOCTYPE:I++,DOCTYPE_QUOTED:I++,DOCTYPE_DTD:I++,DOCTYPE_DTD_QUOTED:I++,COMMENT_STARTING:I++,COMMENT:I++,COMMENT_ENDING:I++,COMMENT_ENDED:I++,CDATA:I++,CDATA_ENDING:I++,CDATA_ENDING_2:I++,PROC_INST:I++,PROC_INST_BODY:I++,PROC_INST_ENDING:I++,OPEN_TAG:I++,OPEN_TAG_SLASH:I++,ATTRIB:I++,ATTRIB_NAME:I++,ATTRIB_NAME_SAW_WHITE:I++,ATTRIB_VALUE:I++,ATTRIB_VALUE_QUOTED:I++,ATTRIB_VALUE_CLOSED:I++,ATTRIB_VALUE_UNQUOTED:I++,ATTRIB_VALUE_ENTITY_Q:I++,ATTRIB_VALUE_ENTITY_U:I++,CLOSE_TAG:I++,CLOSE_TAG_SAW_WHITE:I++,SCRIPT:I++,SCRIPT_ENDING:I++},r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(r.ENTITIES).forEach(function(O){var B=r.ENTITIES[O],Q=typeof B=="number"?String.fromCharCode(B):B;r.ENTITIES[O]=Q});for(var D in r.STATE)r.STATE[r.STATE[D]]=D;I=r.STATE;function U(O,B,Q){O[B]&&O[B](Q)}u(U,"emit");function F(O,B,Q){O.textNode&&M(O),U(O,B,Q)}u(F,"emitNode");function M(O){O.textNode=se(O.opt,O.textNode),O.textNode&&U(O,"ontext",O.textNode),O.textNode=""}u(M,"closeText");function se(O,B){return O.trim&&(B=B.trim()),O.normalize&&(B=B.replace(/\s+/g," ")),B}u(se,"textopts");function ee(O,B){return M(O),O.trackPosition&&(B+=`
71
+ Line: `+O.line+`
72
+ Column: `+O.column+`
73
+ Char: `+O.c),B=new Error(B),O.error=B,U(O,"onerror",B),O}u(ee,"error");function ie(O){return O.sawRoot&&!O.closedRoot&&X(O,"Unclosed root tag"),O.state!==I.BEGIN&&O.state!==I.BEGIN_WHITESPACE&&O.state!==I.TEXT&&ee(O,"Unexpected end"),M(O),O.c="",O.closed=!0,U(O,"onend"),t.call(O,O.strict,O.opt),O}u(ie,"end");function X(O,B){if(typeof O!="object"||!(O instanceof t))throw new Error("bad call to strictFail");O.strict&&ee(O,B)}u(X,"strictFail");function he(O){O.strict||(O.tagName=O.tagName[O.looseCase]());var B=O.tags[O.tags.length-1]||O,Q=O.tag={name:O.tagName,attributes:{}};O.opt.xmlns&&(Q.ns=B.ns),O.attribList.length=0,F(O,"onopentagstart",Q)}u(he,"newTag");function Ce(O,B){var Q=O.indexOf(":"),K=Q<0?["",O]:O.split(":"),_e=K[0],R=K[1];return B&&O==="xmlns"&&(_e="xmlns",R=""),{prefix:_e,local:R}}u(Ce,"qname");function xe(O){if(O.strict||(O.attribName=O.attribName[O.looseCase]()),O.attribList.indexOf(O.attribName)!==-1||O.tag.attributes.hasOwnProperty(O.attribName)){O.attribName=O.attribValue="";return}if(O.opt.xmlns){var B=Ce(O.attribName,!0),Q=B.prefix,K=B.local;if(Q==="xmlns")if(K==="xml"&&O.attribValue!==d)X(O,"xml: prefix must be bound to "+d+`
74
+ Actual: `+O.attribValue);else if(K==="xmlns"&&O.attribValue!==g)X(O,"xmlns: prefix must be bound to "+g+`
75
+ Actual: `+O.attribValue);else{var _e=O.tag,R=O.tags[O.tags.length-1]||O;_e.ns===R.ns&&(_e.ns=Object.create(R.ns)),_e.ns[K]=O.attribValue}O.attribList.push([O.attribName,O.attribValue])}else O.tag.attributes[O.attribName]=O.attribValue,F(O,"onattribute",{name:O.attribName,value:O.attribValue});O.attribName=O.attribValue=""}u(xe,"attrib");function pe(O,B){if(O.opt.xmlns){var Q=O.tag,K=Ce(O.tagName);Q.prefix=K.prefix,Q.local=K.local,Q.uri=Q.ns[K.prefix]||"",Q.prefix&&!Q.uri&&(X(O,"Unbound namespace prefix: "+JSON.stringify(O.tagName)),Q.uri=K.prefix);var _e=O.tags[O.tags.length-1]||O;Q.ns&&_e.ns!==Q.ns&&Object.keys(Q.ns).forEach(function(Jt){F(O,"onopennamespace",{prefix:Jt,uri:Q.ns[Jt]})});for(var R=0,N=O.attribList.length;R<N;R++){var J=O.attribList[R],$=J[0],ge=J[1],et=Ce($,!0),Gt=et.prefix,Be=et.local,ar=Gt===""?"":Q.ns[Gt]||"",Er={name:$,value:ge,prefix:Gt,local:Be,uri:ar};Gt&&Gt!=="xmlns"&&!ar&&(X(O,"Unbound namespace prefix: "+JSON.stringify(Gt)),Er.uri=Gt),O.tag.attributes[$]=Er,F(O,"onattribute",Er)}O.attribList.length=0}O.tag.isSelfClosing=!!B,O.sawRoot=!0,O.tags.push(O.tag),F(O,"onopentag",O.tag),B||(!O.noscript&&O.tagName.toLowerCase()==="script"?O.state=I.SCRIPT:O.state=I.TEXT,O.tag=null,O.tagName=""),O.attribName=O.attribValue="",O.attribList.length=0}u(pe,"openTag");function W(O){if(!O.tagName){X(O,"Weird empty close tag."),O.textNode+="</>",O.state=I.TEXT;return}if(O.script){if(O.tagName!=="script"){O.script+="</"+O.tagName+">",O.tagName="",O.state=I.SCRIPT;return}F(O,"onscript",O.script),O.script=""}var B=O.tags.length,Q=O.tagName;O.strict||(Q=Q[O.looseCase]());for(var K=Q;B--;){var _e=O.tags[B];if(_e.name!==K)X(O,"Unexpected close tag");else break}if(B<0){X(O,"Unmatched closing tag: "+O.tagName),O.textNode+="</"+O.tagName+">",O.state=I.TEXT;return}O.tagName=Q;for(var R=O.tags.length;R-- >B;){var N=O.tag=O.tags.pop();O.tagName=O.tag.name,F(O,"onclosetag",O.tagName);var J={};for(var $ in N.ns)J[$]=N.ns[$];var ge=O.tags[O.tags.length-1]||O;O.opt.xmlns&&N.ns!==ge.ns&&Object.keys(N.ns).forEach(function(et){var Gt=N.ns[et];F(O,"onclosenamespace",{prefix:et,uri:Gt})})}B===0&&(O.closedRoot=!0),O.tagName=O.attribValue=O.attribName="",O.attribList.length=0,O.state=I.TEXT}u(W,"closeTag");function fe(O){var B=O.entity,Q=B.toLowerCase(),K,_e="";return O.ENTITIES[B]?O.ENTITIES[B]:O.ENTITIES[Q]?O.ENTITIES[Q]:(B=Q,B.charAt(0)==="#"&&(B.charAt(1)==="x"?(B=B.slice(2),K=parseInt(B,16),_e=K.toString(16)):(B=B.slice(1),K=parseInt(B,10),_e=K.toString(10))),B=B.replace(/^0+/,""),isNaN(K)||_e.toLowerCase()!==B?(X(O,"Invalid character entity"),"&"+O.entity+";"):String.fromCodePoint(K))}u(fe,"parseEntity");function Ie(O,B){B==="<"?(O.state=I.OPEN_WAKA,O.startTagPosition=O.position):w(B)||(X(O,"Non-whitespace before first tag."),O.textNode=B,O.state=I.TEXT)}u(Ie,"beginWhiteSpace");function Ve(O,B){var Q="";return B<O.length&&(Q=O.charAt(B)),Q}u(Ve,"charAt");function Le(O){var B=this;if(this.error)throw this.error;if(B.closed)return ee(B,"Cannot write after close. Assign an onready handler.");if(O===null)return ie(B);typeof O=="object"&&(O=O.toString());for(var Q=0,K="";K=Ve(O,Q++),B.c=K,!!K;)switch(B.trackPosition&&(B.position++,K===`
76
+ `?(B.line++,B.column=0):B.column++),B.state){case I.BEGIN:if(B.state=I.BEGIN_WHITESPACE,K==="\uFEFF")continue;Ie(B,K);continue;case I.BEGIN_WHITESPACE:Ie(B,K);continue;case I.TEXT:if(B.sawRoot&&!B.closedRoot){for(var _e=Q-1;K&&K!=="<"&&K!=="&";)K=Ve(O,Q++),K&&B.trackPosition&&(B.position++,K===`
77
+ `?(B.line++,B.column=0):B.column++);B.textNode+=O.substring(_e,Q-1)}K==="<"&&!(B.sawRoot&&B.closedRoot&&!B.strict)?(B.state=I.OPEN_WAKA,B.startTagPosition=B.position):(!w(K)&&(!B.sawRoot||B.closedRoot)&&X(B,"Text data outside of root node."),K==="&"?B.state=I.TEXT_ENTITY:B.textNode+=K);continue;case I.SCRIPT:K==="<"?B.state=I.SCRIPT_ENDING:B.script+=K;continue;case I.SCRIPT_ENDING:K==="/"?B.state=I.CLOSE_TAG:(B.script+="<"+K,B.state=I.SCRIPT);continue;case I.OPEN_WAKA:if(K==="!")B.state=I.SGML_DECL,B.sgmlDecl="";else if(!w(K))if(b(v,K))B.state=I.OPEN_TAG,B.tagName=K;else if(K==="/")B.state=I.CLOSE_TAG,B.tagName="";else if(K==="?")B.state=I.PROC_INST,B.procInstName=B.procInstBody="";else{if(X(B,"Unencoded <"),B.startTagPosition+1<B.position){var R=B.position-B.startTagPosition;K=new Array(R).join(" ")+K}B.textNode+="<"+K,B.state=I.TEXT}continue;case I.SGML_DECL:if(B.sgmlDecl+K==="--"){B.state=I.COMMENT,B.comment="",B.sgmlDecl="";continue}B.doctype&&B.doctype!==!0&&B.sgmlDecl?(B.state=I.DOCTYPE_DTD,B.doctype+="<!"+B.sgmlDecl+K,B.sgmlDecl=""):(B.sgmlDecl+K).toUpperCase()===f?(F(B,"onopencdata"),B.state=I.CDATA,B.sgmlDecl="",B.cdata=""):(B.sgmlDecl+K).toUpperCase()===p?(B.state=I.DOCTYPE,(B.doctype||B.sawRoot)&&X(B,"Inappropriately located doctype declaration"),B.doctype="",B.sgmlDecl=""):K===">"?(F(B,"onsgmldeclaration",B.sgmlDecl),B.sgmlDecl="",B.state=I.TEXT):(E(K)&&(B.state=I.SGML_DECL_QUOTED),B.sgmlDecl+=K);continue;case I.SGML_DECL_QUOTED:K===B.q&&(B.state=I.SGML_DECL,B.q=""),B.sgmlDecl+=K;continue;case I.DOCTYPE:K===">"?(B.state=I.TEXT,F(B,"ondoctype",B.doctype),B.doctype=!0):(B.doctype+=K,K==="["?B.state=I.DOCTYPE_DTD:E(K)&&(B.state=I.DOCTYPE_QUOTED,B.q=K));continue;case I.DOCTYPE_QUOTED:B.doctype+=K,K===B.q&&(B.q="",B.state=I.DOCTYPE);continue;case I.DOCTYPE_DTD:K==="]"?(B.doctype+=K,B.state=I.DOCTYPE):K==="<"?(B.state=I.OPEN_WAKA,B.startTagPosition=B.position):E(K)?(B.doctype+=K,B.state=I.DOCTYPE_DTD_QUOTED,B.q=K):B.doctype+=K;continue;case I.DOCTYPE_DTD_QUOTED:B.doctype+=K,K===B.q&&(B.state=I.DOCTYPE_DTD,B.q="");continue;case I.COMMENT:K==="-"?B.state=I.COMMENT_ENDING:B.comment+=K;continue;case I.COMMENT_ENDING:K==="-"?(B.state=I.COMMENT_ENDED,B.comment=se(B.opt,B.comment),B.comment&&F(B,"oncomment",B.comment),B.comment=""):(B.comment+="-"+K,B.state=I.COMMENT);continue;case I.COMMENT_ENDED:K!==">"?(X(B,"Malformed comment"),B.comment+="--"+K,B.state=I.COMMENT):B.doctype&&B.doctype!==!0?B.state=I.DOCTYPE_DTD:B.state=I.TEXT;continue;case I.CDATA:K==="]"?B.state=I.CDATA_ENDING:B.cdata+=K;continue;case I.CDATA_ENDING:K==="]"?B.state=I.CDATA_ENDING_2:(B.cdata+="]"+K,B.state=I.CDATA);continue;case I.CDATA_ENDING_2:K===">"?(B.cdata&&F(B,"oncdata",B.cdata),F(B,"onclosecdata"),B.cdata="",B.state=I.TEXT):K==="]"?B.cdata+="]":(B.cdata+="]]"+K,B.state=I.CDATA);continue;case I.PROC_INST:K==="?"?B.state=I.PROC_INST_ENDING:w(K)?B.state=I.PROC_INST_BODY:B.procInstName+=K;continue;case I.PROC_INST_BODY:if(!B.procInstBody&&w(K))continue;K==="?"?B.state=I.PROC_INST_ENDING:B.procInstBody+=K;continue;case I.PROC_INST_ENDING:K===">"?(F(B,"onprocessinginstruction",{name:B.procInstName,body:B.procInstBody}),B.procInstName=B.procInstBody="",B.state=I.TEXT):(B.procInstBody+="?"+K,B.state=I.PROC_INST_BODY);continue;case I.OPEN_TAG:b(y,K)?B.tagName+=K:(he(B),K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:(w(K)||X(B,"Invalid character in tag name"),B.state=I.ATTRIB));continue;case I.OPEN_TAG_SLASH:K===">"?(pe(B,!0),W(B)):(X(B,"Forward-slash in opening tag not followed by >"),B.state=I.ATTRIB);continue;case I.ATTRIB:if(w(K))continue;K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:b(v,K)?(B.attribName=K,B.attribValue="",B.state=I.ATTRIB_NAME):X(B,"Invalid attribute name");continue;case I.ATTRIB_NAME:K==="="?B.state=I.ATTRIB_VALUE:K===">"?(X(B,"Attribute without value"),B.attribValue=B.attribName,xe(B),pe(B)):w(K)?B.state=I.ATTRIB_NAME_SAW_WHITE:b(y,K)?B.attribName+=K:X(B,"Invalid attribute name");continue;case I.ATTRIB_NAME_SAW_WHITE:if(K==="=")B.state=I.ATTRIB_VALUE;else{if(w(K))continue;X(B,"Attribute without value"),B.tag.attributes[B.attribName]="",B.attribValue="",F(B,"onattribute",{name:B.attribName,value:""}),B.attribName="",K===">"?pe(B):b(v,K)?(B.attribName=K,B.state=I.ATTRIB_NAME):(X(B,"Invalid attribute name"),B.state=I.ATTRIB)}continue;case I.ATTRIB_VALUE:if(w(K))continue;E(K)?(B.q=K,B.state=I.ATTRIB_VALUE_QUOTED):(B.opt.unquotedAttributeValues||ee(B,"Unquoted attribute value"),B.state=I.ATTRIB_VALUE_UNQUOTED,B.attribValue=K);continue;case I.ATTRIB_VALUE_QUOTED:if(K!==B.q){K==="&"?B.state=I.ATTRIB_VALUE_ENTITY_Q:B.attribValue+=K;continue}xe(B),B.q="",B.state=I.ATTRIB_VALUE_CLOSED;continue;case I.ATTRIB_VALUE_CLOSED:w(K)?B.state=I.ATTRIB:K===">"?pe(B):K==="/"?B.state=I.OPEN_TAG_SLASH:b(v,K)?(X(B,"No whitespace between attributes"),B.attribName=K,B.attribValue="",B.state=I.ATTRIB_NAME):X(B,"Invalid attribute name");continue;case I.ATTRIB_VALUE_UNQUOTED:if(!A(K)){K==="&"?B.state=I.ATTRIB_VALUE_ENTITY_U:B.attribValue+=K;continue}xe(B),K===">"?pe(B):B.state=I.ATTRIB;continue;case I.CLOSE_TAG:if(B.tagName)K===">"?W(B):b(y,K)?B.tagName+=K:B.script?(B.script+="</"+B.tagName,B.tagName="",B.state=I.SCRIPT):(w(K)||X(B,"Invalid tagname in closing tag"),B.state=I.CLOSE_TAG_SAW_WHITE);else{if(w(K))continue;V(v,K)?B.script?(B.script+="</"+K,B.state=I.SCRIPT):X(B,"Invalid tagname in closing tag."):B.tagName=K}continue;case I.CLOSE_TAG_SAW_WHITE:if(w(K))continue;K===">"?W(B):X(B,"Invalid characters in closing tag");continue;case I.TEXT_ENTITY:case I.ATTRIB_VALUE_ENTITY_Q:case I.ATTRIB_VALUE_ENTITY_U:var N,J;switch(B.state){case I.TEXT_ENTITY:N=I.TEXT,J="textNode";break;case I.ATTRIB_VALUE_ENTITY_Q:N=I.ATTRIB_VALUE_QUOTED,J="attribValue";break;case I.ATTRIB_VALUE_ENTITY_U:N=I.ATTRIB_VALUE_UNQUOTED,J="attribValue";break}if(K===";"){var $=fe(B);B.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes($)?(B.entity="",B.state=N,B.write($)):(B[J]+=$,B.entity="",B.state=N)}else b(B.entity.length?C:S,K)?B.entity+=K:(X(B,"Invalid character in entity name"),B[J]+="&"+B.entity+K,B.entity="",B.state=N);continue;default:throw new Error(B,"Unknown state: "+B.state)}return B.position>=B.bufferCheckPosition&&n(B),B}u(Le,"write");String.fromCodePoint||(function(){var O=String.fromCharCode,B=Math.floor,Q=u(function(){var K=16384,_e=[],R,N,J=-1,$=arguments.length;if(!$)return"";for(var ge="";++J<$;){var et=Number(arguments[J]);if(!isFinite(et)||et<0||et>1114111||B(et)!==et)throw RangeError("Invalid code point: "+et);et<=65535?_e.push(et):(et-=65536,R=(et>>10)+55296,N=et%1024+56320,_e.push(R,N)),(J+1===$||_e.length>K)&&(ge+=O.apply(null,_e),_e.length=0)}return ge},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:Q,configurable:!0,writable:!0}):String.fromCodePoint=Q})()})(typeof z2>"u"?z2.sax={}:z2)});var P4=ue(fb=>{"use strict";(function(){"use strict";fb.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(fb)});var hb=ue(dl=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),dl.normalize=function(e){return e.toLowerCase()},dl.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},dl.stripPrefix=function(e){return e.replace(r,"")},dl.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},dl.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(dl)});var k4=ue(ga=>{"use strict";(function(){"use strict";var r,e,t,n,s,i,a,o,l,c=u(function(d,g){return function(){return d.apply(g,arguments)}},"bind"),f=u(function(d,g){for(var m in g)p.call(g,m)&&(d[m]=g[m]);function v(){this.constructor=d}return u(v,"ctor"),v.prototype=g.prototype,d.prototype=new v,d.__super__=g.prototype,d},"extend"),p={}.hasOwnProperty;o=_4(),n=st("events"),r=P4(),a=hb(),l=st("timers").setImmediate,e=P2().defaults,s=u(function(d){return typeof d=="object"&&d!=null&&Object.keys(d).length===0},"isEmpty"),i=u(function(d,g,m){var v,y,S;for(v=0,y=d.length;v<y;v++)S=d[v],g=S(g,m);return g},"processItem"),t=u(function(d,g,m){var v;return v=Object.create(null),v.value=m,v.writable=!0,v.enumerable=!0,v.configurable=!0,Object.defineProperty(d,g,v)},"defineProperty"),ga.Parser=(function(d){f(g,d);function g(m){this.parseStringPromise=c(this.parseStringPromise,this),this.parseString=c(this.parseString,this),this.reset=c(this.reset,this),this.assignOrPush=c(this.assignOrPush,this),this.processAsync=c(this.processAsync,this);var v,y,S;if(!(this instanceof ga.Parser))return new ga.Parser(m);this.options={},y=e["0.2"];for(v in y)p.call(y,v)&&(S=y[v],this.options[v]=S);for(v in m)p.call(m,v)&&(S=m[v],this.options[v]=S);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(a.normalize)),this.reset()}return u(g,"Parser"),g.prototype.processAsync=function(){var m,v;try{return this.remaining.length<=this.options.chunkSize?(m=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(m),this.saxParser.close()):(m=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(m),l(this.processAsync))}catch(y){if(v=y,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(v)}},g.prototype.assignOrPush=function(m,v,y){return v in m?(m[v]instanceof Array||t(m,v,[m[v]]),m[v].push(y)):this.options.explicitArray?t(m,v,[y]):t(m,v,y)},g.prototype.reset=function(){var m,v,y,S;return this.removeAllListeners(),this.saxParser=o.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(C){return function(w){if(C.saxParser.resume(),!C.saxParser.errThrown)return C.saxParser.errThrown=!0,C.emit("error",w)}})(this),this.saxParser.onend=(function(C){return function(){if(!C.saxParser.ended)return C.saxParser.ended=!0,C.emit("end",C.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,S=[],m=this.options.attrkey,v=this.options.charkey,this.saxParser.onopentag=(function(C){return function(w){var E,A,b,V,I;if(b={},b[v]="",!C.options.ignoreAttrs){I=w.attributes;for(E in I)p.call(I,E)&&(!(m in b)&&!C.options.mergeAttrs&&(b[m]={}),A=C.options.attrValueProcessors?i(C.options.attrValueProcessors,w.attributes[E],E):w.attributes[E],V=C.options.attrNameProcessors?i(C.options.attrNameProcessors,E):E,C.options.mergeAttrs?C.assignOrPush(b,V,A):t(b[m],V,A))}return b["#name"]=C.options.tagNameProcessors?i(C.options.tagNameProcessors,w.name):w.name,C.options.xmlns&&(b[C.options.xmlnskey]={uri:w.uri,local:w.local}),S.push(b)}})(this),this.saxParser.onclosetag=(function(C){return function(){var w,E,A,b,V,I,D,U,F,M;if(I=S.pop(),V=I["#name"],(!C.options.explicitChildren||!C.options.preserveChildrenOrder)&&delete I["#name"],I.cdata===!0&&(w=I.cdata,delete I.cdata),F=S[S.length-1],I[v].match(/^\s*$/)&&!w?(E=I[v],delete I[v]):(C.options.trim&&(I[v]=I[v].trim()),C.options.normalize&&(I[v]=I[v].replace(/\s{2,}/g," ").trim()),I[v]=C.options.valueProcessors?i(C.options.valueProcessors,I[v],V):I[v],Object.keys(I).length===1&&v in I&&!C.EXPLICIT_CHARKEY&&(I=I[v])),s(I)&&(typeof C.options.emptyTag=="function"?I=C.options.emptyTag():I=C.options.emptyTag!==""?C.options.emptyTag:E),C.options.validator!=null&&(M="/"+(function(){var se,ee,ie;for(ie=[],se=0,ee=S.length;se<ee;se++)b=S[se],ie.push(b["#name"]);return ie})().concat(V).join("/"),(function(){var se;try{return I=C.options.validator(M,F&&F[V],I)}catch(ee){return se=ee,C.emit("error",se)}})()),C.options.explicitChildren&&!C.options.mergeAttrs&&typeof I=="object"){if(!C.options.preserveChildrenOrder)b={},C.options.attrkey in I&&(b[C.options.attrkey]=I[C.options.attrkey],delete I[C.options.attrkey]),!C.options.charsAsChildren&&C.options.charkey in I&&(b[C.options.charkey]=I[C.options.charkey],delete I[C.options.charkey]),Object.getOwnPropertyNames(I).length>0&&(b[C.options.childkey]=I),I=b;else if(F){F[C.options.childkey]=F[C.options.childkey]||[],D={};for(A in I)p.call(I,A)&&t(D,A,I[A]);F[C.options.childkey].push(D),delete I["#name"],Object.keys(I).length===1&&v in I&&!C.EXPLICIT_CHARKEY&&(I=I[v])}}return S.length>0?C.assignOrPush(F,V,I):(C.options.explicitRoot&&(U=I,I={},t(I,V,U)),C.resultObject=I,C.saxParser.ended=!0,C.emit("end",C.resultObject))}})(this),y=(function(C){return function(w){var E,A;if(A=S[S.length-1],A)return A[v]+=w,C.options.explicitChildren&&C.options.preserveChildrenOrder&&C.options.charsAsChildren&&(C.options.includeWhiteChars||w.replace(/\\n/g,"").trim()!=="")&&(A[C.options.childkey]=A[C.options.childkey]||[],E={"#name":"__text__"},E[v]=w,C.options.normalize&&(E[v]=E[v].replace(/\s{2,}/g," ").trim()),A[C.options.childkey].push(E)),A}})(this),this.saxParser.ontext=y,this.saxParser.oncdata=(function(C){return function(w){var E;if(E=y(w),E)return E.cdata=!0}})(this)},g.prototype.parseString=function(m,v){var y;v!=null&&typeof v=="function"&&(this.on("end",function(S){return this.reset(),v(null,S)}),this.on("error",function(S){return this.reset(),v(S)}));try{return m=m.toString(),m.trim()===""?(this.emit("end",null),!0):(m=r.stripBOM(m),this.options.async?(this.remaining=m,l(this.processAsync),this.saxParser):this.saxParser.write(m).close())}catch(S){if(y=S,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw y}else return this.emit("error",y),this.saxParser.errThrown=!0}},g.prototype.parseStringPromise=function(m){return new Promise((function(v){return function(y,S){return v.parseString(m,function(C,w){return C?S(C):y(w)})}})(this))},g})(n),ga.parseString=function(d,g,m){var v,y,S;return m!=null?(typeof m=="function"&&(v=m),typeof g=="object"&&(y=g)):(typeof g=="function"&&(v=g),y={}),S=new ga.Parser(y),S.parseString(d,v)},ga.parseStringPromise=function(d,g){var m,v;return typeof g=="object"&&(m=g),v=new ga.Parser(m),v.parseStringPromise(d)}}).call(ga)});var L4=ue(ya=>{"use strict";(function(){"use strict";var r,e,t,n,s=u(function(a,o){for(var l in o)i.call(o,l)&&(a[l]=o[l]);function c(){this.constructor=a}return u(c,"ctor"),c.prototype=o.prototype,a.prototype=new c,a.__super__=o.prototype,a},"extend"),i={}.hasOwnProperty;e=P2(),r=O4(),t=k4(),n=hb(),ya.defaults=e.defaults,ya.processors=n,ya.ValidationError=(function(a){s(o,a);function o(l){this.message=l}return u(o,"ValidationError"),o})(Error),ya.Builder=r.Builder,ya.Parser=t.Parser,ya.parseString=t.parseString,ya.parseStringPromise=t.parseStringPromise}).call(ya)});var tf=ue(Sn=>{"use strict";function CJ(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var n=0;n<r.length;n++)if(ef(r,n)){var s=r[n];if(e.call(void 0,s,n,r))return s}}u(CJ,"find");function T0(r,e){return e===void 0&&(e=Object),e&&typeof e.getOwnPropertyDescriptors=="function"&&(r=e.create(null,e.getOwnPropertyDescriptors(r))),e&&typeof e.freeze=="function"?e.freeze(r):r}u(T0,"freeze");function ef(r,e){return Object.prototype.hasOwnProperty.call(r,e)}u(ef,"hasOwn");function xJ(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)ef(e,t)&&(r[t]=e[t]);return r}u(xJ,"assign");var C5=T0({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function bJ(r){return ef(C5,r.toLowerCase())}u(bJ,"isHTMLBooleanAttribute");var x5=T0({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function NJ(r){return ef(x5,r.toLowerCase())}u(NJ,"isHTMLVoidElement");var uy=T0({script:!1,style:!1,textarea:!0,title:!0});function TJ(r){var e=r.toLowerCase();return ef(uy,e)&&!uy[e]}u(TJ,"isHTMLRawTextElement");function IJ(r){var e=r.toLowerCase();return ef(uy,e)&&uy[e]}u(IJ,"isHTMLEscapableRawTextElement");function b5(r){return r===ly.HTML}u(b5,"isHTMLMimeType");function DJ(r){return b5(r)||r===ly.XML_XHTML_APPLICATION}u(DJ,"hasDefaultHTMLNamespace");var ly=T0({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),BJ=Object.keys(ly).map(function(r){return ly[r]});function RJ(r){return BJ.indexOf(r)>-1}u(RJ,"isValidMimeType");var OJ=T0({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Sn.assign=xJ;Sn.find=CJ;Sn.freeze=T0;Sn.HTML_BOOLEAN_ATTRIBUTES=C5;Sn.HTML_RAW_TEXT_ELEMENTS=uy;Sn.HTML_VOID_ELEMENTS=x5;Sn.hasDefaultHTMLNamespace=DJ;Sn.hasOwn=ef;Sn.isHTMLBooleanAttribute=bJ;Sn.isHTMLRawTextElement=TJ;Sn.isHTMLEscapableRawTextElement=IJ;Sn.isHTMLMimeType=b5;Sn.isHTMLVoidElement=NJ;Sn.isValidMimeType=RJ;Sn.MIME_TYPE=ly;Sn.NAMESPACE=OJ});var dy=ue(py=>{"use strict";var _J=tf();function T5(r,e){r.prototype=Object.create(Error.prototype,{constructor:{value:r},name:{value:r.name,enumerable:!0,writable:e}})}u(T5,"extendError");var fy=_J.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),I5=Object.keys(fy);function D5(r){return typeof r=="number"&&r>=1&&r<=25}u(D5,"isValidDomExceptionCode");function PJ(r){return typeof r=="string"&&r.substring(r.length-fy.Error.length)===fy.Error}u(PJ,"endsWithError");function hy(r,e){D5(r)?(this.name=I5[r],this.message=e||""):(this.message=r,this.name=PJ(e)?e:fy.Error),Error.captureStackTrace&&Error.captureStackTrace(this,hy)}u(hy,"DOMException");T5(hy,!0);Object.defineProperties(hy.prototype,{code:{enumerable:!0,get:u(function(){var r=I5.indexOf(this.name);return D5(r)?r:0},"get")}});var B5={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},GT=Object.entries(B5);for(cy=0;cy<GT.length;cy++)N5=GT[cy][0],hy[N5]=GT[cy][1];var N5,cy;function $T(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,$T)}u($T,"ParseError");T5($T);py.DOMException=hy;py.DOMExceptionName=fy;py.ExceptionCode=B5;py.ParseError=$T});var eI=ue(vt=>{"use strict";function V5(r){try{typeof r!="function"&&(r=RegExp);var e=new r("\u{1D306}","u").exec("\u{1D306}");return!!e&&e[0].length===2}catch{}return!1}u(V5,"detectUnicodeSupport");var B0=V5();function Hu(r){if(r.source[0]!=="[")throw new Error(r+" can not be used with chars");return r.source.slice(1,r.source.lastIndexOf("]"))}u(Hu,"chars");function I0(r,e){if(r.source[0]!=="[")throw new Error("/"+r.source+"/ can not be used with chars_without");if(!e||typeof e!="string")throw new Error(JSON.stringify(e)+" is not a valid search");if(r.source.indexOf(e)===-1)throw new Error('"'+e+'" is not is /'+r.source+"/");if(e==="-"&&r.source.indexOf(e)!==1)throw new Error('"'+e+'" is not at the first postion of /'+r.source+"/");return new RegExp(r.source.replace(e,""),B0?"u":"")}u(I0,"chars_without");function Tt(r){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var n=typeof t=="string";if(n&&e===void 0&&t==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?t:t.source}).join(""),B0?"mu":"m")}u(Tt,"reg");function ct(r){if(arguments.length===0)throw new Error("no parameters provided");return Tt.apply(ct,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}u(ct,"regg");var kJ="\uFFFD",Ku=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;B0&&(Ku=Tt("[",Hu(Ku),"\\u{10000}-\\u{10FFFF}","]"));var LJ=new RegExp("[^"+Hu(Ku)+"]",B0?"u":""),zT=/[\x20\x09\x0D\x0A]/,VJ=Hu(zT),tr=Tt(zT,"+"),Tr=Tt(zT,"*"),my=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;B0&&(my=Tt("[",Hu(my),"\\u{10000}-\\u{10FFFF}","]"));var FJ=Hu(my),JT=Tt("[",FJ,Hu(/[-.0-9\xB7]/),Hu(/[\u0300-\u036F\u203F-\u2040]/),"]"),qs=Tt(my,JT,"*"),R5=Tt(JT,"+"),UJ=Tt("&",qs,";"),MJ=ct(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),gy=ct(UJ,"|",MJ),yy=Tt("%",qs,";"),YT=ct(Tt('"',ct(/[^%&"]/,"|",yy,"|",gy),"*",'"'),"|",Tt("'",ct(/[^%&']/,"|",yy,"|",gy),"*","'")),jJ=ct('"',ct(/[^<&"]/,"|",gy),"*",'"',"|","'",ct(/[^<&']/,"|",gy),"*","'"),qJ=I0(my,":"),HJ=I0(JT,":"),O5=Tt(qJ,HJ,"*"),vy=Tt(O5,ct(":",O5),"?"),KJ=Tt("^",vy,"$"),XJ=Tt("(",vy,")"),D0=ct(/"[^"]*"|'[^']*'/),GJ=Tt(/^<\?/,"(",qs,")",ct(tr,"(",Ku,"*?)"),"?",/\?>/),_5=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Ey=ct('"',_5,'*"',"|","'",I0(_5,"'"),"*'"),F5="<!--",U5="-->",$J=Tt(F5,ct(I0(Ku,"-"),"|",Tt("-",I0(Ku,"-"))),"*",U5),P5="#PCDATA",WJ=ct(Tt(/\(/,Tr,P5,ct(Tr,/\|/,Tr,vy),"*",Tr,/\)\*/),"|",Tt(/\(/,Tr,P5,Tr,/\)/)),zJ=/[?*+]?/,JJ=Tt(/\([^>]+\)/,zJ),YJ=ct("EMPTY","|","ANY","|",WJ,"|",JJ),QJ="<!ELEMENT",ZJ=Tt(QJ,tr,ct(vy,"|",yy),tr,ct(YJ,"|",yy),Tr,">"),eY=Tt("NOTATION",tr,/\(/,Tr,qs,ct(Tr,/\|/,Tr,qs),"*",Tr,/\)/),tY=Tt(/\(/,Tr,R5,ct(Tr,/\|/,Tr,R5),"*",Tr,/\)/),rY=ct(eY,"|",tY),nY=ct(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",rY),sY=ct(/#REQUIRED|#IMPLIED/,"|",ct(ct("#FIXED",tr),"?",jJ)),iY=ct(tr,qs,tr,nY,tr,sY),aY="<!ATTLIST",oY=Tt(aY,tr,qs,iY,"*",Tr,">"),WT="about:legacy-compat",uY=ct('"'+WT+'"',"|","'"+WT+"'"),QT="SYSTEM",KS="PUBLIC",XS=ct(ct(QT,tr,D0),"|",ct(KS,tr,Ey,tr,D0)),lY=Tt("^",ct(ct(QT,tr,"(?<SystemLiteralOnly>",D0,")"),"|",ct(KS,tr,"(?<PubidLiteral>",Ey,")",tr,"(?<SystemLiteral>",D0,")"))),cY=Tt("^",Ey,"$"),fY=Tt("^",D0,"$"),hY=ct(tr,"NDATA",tr,qs),pY=ct(YT,"|",ct(XS,hY,"?")),M5="<!ENTITY",dY=Tt(M5,tr,qs,tr,pY,Tr,">"),mY=ct(YT,"|",XS),gY=Tt(M5,tr,"%",tr,qs,tr,mY,Tr,">"),yY=ct(dY,"|",gY),vY=Tt(KS,tr,Ey),EY=Tt("<!NOTATION",tr,qs,tr,ct(XS,"|",vY),Tr,">"),ZT=Tt(Tr,"=",Tr),k5=/1[.]\d+/,wY=Tt(tr,"version",ZT,ct("'",k5,"'","|",'"',k5,'"')),L5=/[A-Za-z][-A-Za-z0-9._]*/,SY=ct(tr,"encoding",ZT,ct('"',L5,'"',"|","'",L5,"'")),AY=ct(tr,"standalone",ZT,ct("'",ct("yes","|","no"),"'","|",'"',ct("yes","|","no"),'"')),CY=Tt(/^<\?xml/,wY,SY,"?",AY,"?",Tr,/\?>/),xY="<!DOCTYPE",bY="<![CDATA[",NY="]]>",TY=/<!\[CDATA\[/,IY=/\]\]>/,DY=Tt(Ku,"*?",IY),BY=Tt(TY,DY);vt.chars=Hu;vt.chars_without=I0;vt.detectUnicodeSupport=V5;vt.reg=Tt;vt.regg=ct;vt.ABOUT_LEGACY_COMPAT=WT;vt.ABOUT_LEGACY_COMPAT_SystemLiteral=uY;vt.AttlistDecl=oY;vt.CDATA_START=bY;vt.CDATA_END=NY;vt.CDSect=BY;vt.Char=Ku;vt.Comment=$J;vt.COMMENT_START=F5;vt.COMMENT_END=U5;vt.DOCTYPE_DECL_START=xY;vt.elementdecl=ZJ;vt.EntityDecl=yY;vt.EntityValue=YT;vt.ExternalID=XS;vt.ExternalID_match=lY;vt.Name=qs;vt.NotationDecl=EY;vt.Reference=gy;vt.PEReference=yy;vt.PI=GJ;vt.PUBLIC=KS;vt.PubidLiteral=Ey;vt.PubidLiteral_match=cY;vt.QName=vy;vt.QName_exact=KJ;vt.QName_group=XJ;vt.S=tr;vt.SChar_s=VJ;vt.S_OPT=Tr;vt.SYSTEM=QT;vt.SystemLiteral=D0;vt.SystemLiteral_match=fY;vt.InvalidChar=LJ;vt.UNICODE_REPLACEMENT_CHARACTER=kJ;vt.UNICODE_SUPPORT=B0;vt.XMLDecl=CY});var uI=ue(kr=>{"use strict";var Xs=tf(),Zi=Xs.find,RY=Xs.hasDefaultHTMLNamespace,O0=Xs.hasOwn,OY=Xs.isHTMLMimeType,_Y=Xs.isHTMLRawTextElement,PY=Xs.isHTMLVoidElement,wy=Xs.MIME_TYPE,ea=Xs.NAMESPACE,Un=Symbol(),$5=dy(),We=$5.DOMException,Hs=$5.DOMExceptionName,An=eI();function ss(r){if(r!==Un)throw new TypeError("Illegal constructor")}u(ss,"checkSymbol");function kY(r){return r!==""}u(kY,"notEmptyString");function LY(r){return r?r.split(/[\t\n\f\r ]+/).filter(kY):[]}u(LY,"splitOnASCIIWhitespace");function VY(r,e){return O0(r,e)||(r[e]=!0),r}u(VY,"orderedSetReducer");function j5(r){if(!r)return[];var e=LY(r);return Object.keys(e.reduce(VY,{}))}u(j5,"toOrderedSet");function FY(r){return function(e){return r&&r.indexOf(e)!==-1}}u(FY,"arrayIncludes");function W5(r){if(!An.QName_exact.test(r))throw new We(We.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+r+'"')}u(W5,"validateQualifiedName");function rI(r,e){W5(e),r=r||null;var t=null,n=e;if(e.indexOf(":")>=0){var s=e.split(":");t=s[0],n=s[1]}if(t!==null&&r===null)throw new We(We.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(t==="xml"&&r!==Xs.NAMESPACE.XML)throw new We(We.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((t==="xmlns"||e==="xmlns")&&r!==Xs.NAMESPACE.XMLNS)throw new We(We.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(r===Xs.NAMESPACE.XMLNS&&t!=="xmlns"&&e!=="xmlns")throw new We(We.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[r,t,n]}u(rI,"validateAndExtract");function k0(r,e){for(var t in r)O0(r,t)&&(e[t]=r[t])}u(k0,"copy");function is(r,e){var t=r.prototype;if(!(t instanceof e)){let n=function(){};u(n,"t"),n.prototype=e.prototype,n=new n,k0(t,n),r.prototype=t=n}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}u(is,"_extends");var as={},Ks=as.ELEMENT_NODE=1,_0=as.ATTRIBUTE_NODE=2,WS=as.TEXT_NODE=3,z5=as.CDATA_SECTION_NODE=4,J5=as.ENTITY_REFERENCE_NODE=5,UY=as.ENTITY_NODE=6,nI=as.PROCESSING_INSTRUCTION_NODE=7,sI=as.COMMENT_NODE=8,R0=as.DOCUMENT_NODE=9,Y5=as.DOCUMENT_TYPE_NODE=10,Xu=as.DOCUMENT_FRAGMENT_NODE=11,MY=as.NOTATION_NODE=12,Pr=Xs.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function Q5(r,e){if(e.length<r.length)return Q5(e,r);var t=null;for(var n in r){if(r[n]!==e[n])return t;t=r[n]}return t}u(Q5,"commonAncestor");function q5(r){return r.guid||(r.guid=Math.random()),r.guid}u(q5,"docGUID");function Jr(){}u(Jr,"NodeList");Jr.prototype={length:0,item:u(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:u(function(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var t=[],n=0;n<this.length;n++)oI(this[n],t,null,e);return t.join("")},"toString"),filter:u(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:u(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};Jr.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:u(function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},"next"),return:u(function(){return{done:!0}},"return")}};function Qi(r,e){this._node=r,this._refresh=e,JS(this)}u(Qi,"LiveNodeList");function JS(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(cL(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)O0(r,n)&&delete r[n];k0(t,r),r._inc=e}}u(JS,"_updateLiveList");Qi.prototype.item=function(r){return JS(this),this[r]||null};is(Qi,Jr);function P0(){}u(P0,"NamedNodeMap");function Z5(r,e){for(var t=0;t<r.length;){if(r[t]===e)return t;t++}}u(Z5,"_findNodeIndex");function jY(r,e,t,n){if(n?e[Z5(e,n)]=t:(e[e.length]=t,e.length++),r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&rL(s,r,n),qY(s,r,t))}}u(jY,"_addNamedNode");function H5(r,e,t){var n=Z5(e,t);if(n>=0){for(var s=e.length-1;n<=s;)e[n]=e[++n];if(e.length=s,r){var i=r.ownerDocument;i&&rL(i,r,t),t.ownerElement=null}}}u(H5,"_removeNamedNode");P0.prototype={length:0,item:Jr.prototype.item,getNamedItem:u(function(r){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());for(var e=0;e<this.length;){var t=this[e];if(t.nodeName===r)return t;e++}return null},"getNamedItem"),setNamedItem:u(function(r){var e=r.ownerElement;if(e&&e!==this._ownerElement)throw new We(We.INUSE_ATTRIBUTE_ERR);var t=this.getNamedItemNS(r.namespaceURI,r.localName);return t===r?r:(jY(this._ownerElement,this,r,t),t)},"setNamedItem"),setNamedItemNS:u(function(r){return this.setNamedItem(r)},"setNamedItemNS"),removeNamedItem:u(function(r){var e=this.getNamedItem(r);if(!e)throw new We(We.NOT_FOUND_ERR,r);return H5(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:u(function(r,e){var t=this.getNamedItemNS(r,e);if(!t)throw new We(We.NOT_FOUND_ERR,r?r+" : "+e:e);return H5(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:u(function(r,e){r||(r=null);for(var t=0;t<this.length;){var n=this[t];if(n.localName===e&&n.namespaceURI===r)return n;t++}return null},"getNamedItemNS")};P0.prototype[Symbol.iterator]=function(){var r=this,e=0;return{next:u(function(){return e<r.length?{value:r[e++],done:!1}:{done:!0}},"next"),return:u(function(){return{done:!0}},"return")}};function eL(){}u(eL,"DOMImplementation");eL.prototype={hasFeature:u(function(r,e){return!0},"hasFeature"),createDocument:u(function(r,e,t){var n=wy.XML_APPLICATION;r===ea.HTML?n=wy.XML_XHTML_APPLICATION:r===ea.SVG&&(n=wy.XML_SVG_IMAGE);var s=new Ja(Un,{contentType:n});if(s.implementation=this,s.childNodes=new Jr,s.doctype=t||null,t&&s.appendChild(t),e){var i=s.createElementNS(r,e);s.appendChild(i)}return s},"createDocument"),createDocumentType:u(function(r,e,t,n){W5(r);var s=new ZS(Un);return s.name=r,s.nodeName=r,s.publicId=e||"",s.systemId=t||"",s.internalSubset=n||"",s.childNodes=new Jr,s},"createDocumentType"),createHTMLDocument:u(function(r){var e=new Ja(Un,{contentType:wy.HTML});if(e.implementation=this,e.childNodes=new Jr,r!==!1){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var t=e.createElement("html");e.appendChild(t);var n=e.createElement("head");if(t.appendChild(n),typeof r=="string"){var s=e.createElement("title");s.appendChild(e.createTextNode(r)),n.appendChild(s)}t.appendChild(e.createElement("body"))}return e},"createHTMLDocument")};function Ft(r){ss(r)}u(Ft,"Node");Ft.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var r=this.getRootNode();return r&&r.nodeType===r.DOCUMENT_NODE},contains:u(function(r){if(!r)return!1;var e=r;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},"contains"),getRootNode:u(function(r){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},"getRootNode"),isEqualNode:u(function(r){if(!r)return!1;for(var e=[{node:this,other:r}];e.length>0;){var t=e.pop(),n=t.node,s=t.other;if(n.nodeType!==s.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==s.name||n.publicId!==s.publicId||n.systemId!==s.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==s.namespaceURI||n.prefix!==s.prefix||n.localName!==s.localName||n.attributes.length!==s.attributes.length)return!1;for(var i=0;i<n.attributes.length;i++){var a=n.attributes.item(i),o=s.getAttributeNodeNS(a.namespaceURI,a.localName);if(!o)return!1;e.push({node:a,other:o})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==s.namespaceURI||n.localName!==s.localName||n.value!==s.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==s.target||n.data!==s.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==s.data)return!1;break}if(n.childNodes.length!==s.childNodes.length)return!1;for(var i=n.childNodes.length-1;i>=0;i--)e.push({node:n.childNodes[i],other:s.childNodes[i]})}return!0},"isEqualNode"),isSameNode:u(function(r){return this===r},"isSameNode"),insertBefore:u(function(r,e){return zS(this,r,e)},"insertBefore"),replaceChild:u(function(r,e){zS(this,r,e,aL),e&&this.removeChild(e)},"replaceChild"),removeChild:u(function(r){return sL(this,r)},"removeChild"),appendChild:u(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:u(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:u(function(r){return lL(this.ownerDocument||this,this,r)},"cloneNode"),normalize:u(function(){Cn(this,null,{enter:u(function(r){for(var e=r.firstChild;e;){var t=e.nextSibling;t!==null&&t.nodeType===WS&&e.nodeType===WS?(r.removeChild(t),e.appendData(t.data)):e=t}return!0},"enter")})},"normalize"),isSupported:u(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),lookupPrefix:u(function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(O0(t,n)&&t[n]===r)return n}e=e.nodeType==_0?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:u(function(r){for(var e=this;e;){var t=e._nsMap;if(t&&O0(t,r))return t[r];e=e.nodeType==_0?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:u(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace"),compareDocumentPosition:u(function(r){if(this===r)return 0;var e=r,t=this,n=null,s=null;if(e instanceof rf&&(n=e,e=n.ownerElement),t instanceof rf&&(s=t,t=s.ownerElement,n&&e&&t===e))for(var i=0,a;a=t.attributes[i];i++){if(a===n)return Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+Pr.DOCUMENT_POSITION_PRECEDING;if(a===s)return Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+Pr.DOCUMENT_POSITION_FOLLOWING}if(!e||!t||t.ownerDocument!==e.ownerDocument)return Pr.DOCUMENT_POSITION_DISCONNECTED+Pr.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(q5(t.ownerDocument)>q5(e.ownerDocument)?Pr.DOCUMENT_POSITION_FOLLOWING:Pr.DOCUMENT_POSITION_PRECEDING);if(s&&e===t)return Pr.DOCUMENT_POSITION_CONTAINS+Pr.DOCUMENT_POSITION_PRECEDING;if(n&&e===t)return Pr.DOCUMENT_POSITION_CONTAINED_BY+Pr.DOCUMENT_POSITION_FOLLOWING;for(var o=[],l=e.parentNode;l;){if(!s&&l===t)return Pr.DOCUMENT_POSITION_CONTAINED_BY+Pr.DOCUMENT_POSITION_FOLLOWING;o.push(l),l=l.parentNode}o.reverse();for(var c=[],f=t.parentNode;f;){if(!n&&f===e)return Pr.DOCUMENT_POSITION_CONTAINS+Pr.DOCUMENT_POSITION_PRECEDING;c.push(f),f=f.parentNode}c.reverse();var p=Q5(o,c);for(var d in p.childNodes){var g=p.childNodes[d];if(g===t)return Pr.DOCUMENT_POSITION_FOLLOWING;if(g===e)return Pr.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(g)>=0)return Pr.DOCUMENT_POSITION_FOLLOWING;if(o.indexOf(g)>=0)return Pr.DOCUMENT_POSITION_PRECEDING}return 0},"compareDocumentPosition")};function tL(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}u(tL,"_xmlEncoder");k0(as,Ft);k0(as,Ft.prototype);k0(Pr,Ft);k0(Pr,Ft.prototype);function $S(r,e){Cn(r,null,{enter:u(function(t){return e(t)?Cn.STOP:!0},"enter")})}u($S,"_visitNode");function Cn(r,e,t){for(var n=[{node:r,context:e,phase:Cn.ENTER}];n.length>0;){var s=n.pop();if(s.phase===Cn.ENTER){var i=t.enter(s.node,s.context);if(i===Cn.STOP)return Cn.STOP;if(n.push({node:s.node,context:i,phase:Cn.EXIT}),i==null)continue;for(var a=s.node.lastChild;a;)n.push({node:a,context:i,phase:Cn.ENTER}),a=a.previousSibling}else t.exit&&t.exit(s.node,s.context)}}u(Cn,"walkDOM");Cn.STOP=Symbol("walkDOM.STOP");Cn.ENTER=0;Cn.EXIT=1;function Ja(r,e){ss(r);var t=e||{};this.ownerDocument=this,this.contentType=t.contentType||wy.XML_APPLICATION,this.type=OY(this.contentType)?"html":"xml"}u(Ja,"Document");function qY(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===ea.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}u(qY,"_onAddAttribute");function rL(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===ea.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}u(rL,"_onRemoveAttribute");function nL(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t&&!t.nextSibling)n[n.length++]=t;else{for(var s=e.firstChild,i=0;s;)n[i++]=s,s=s.nextSibling;n.length=i,delete n[n.length]}}}u(nL,"_onUpdateChild");function sL(r,e){if(r!==e.parentNode)throw new We(We.NOT_FOUND_ERR,"child's parent is not parent");var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,nL(r.ownerDocument,r),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}u(sL,"_removeChild");function HY(r){return r&&(r.nodeType===Ft.DOCUMENT_NODE||r.nodeType===Ft.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ft.ELEMENT_NODE)}u(HY,"hasValidParentNodeType");function KY(r){return r&&(r.nodeType===Ft.CDATA_SECTION_NODE||r.nodeType===Ft.COMMENT_NODE||r.nodeType===Ft.DOCUMENT_FRAGMENT_NODE||r.nodeType===Ft.DOCUMENT_TYPE_NODE||r.nodeType===Ft.ELEMENT_NODE||r.nodeType===Ft.PROCESSING_INSTRUCTION_NODE||r.nodeType===Ft.TEXT_NODE)}u(KY,"hasInsertableNodeType");function Gu(r){return r&&r.nodeType===Ft.DOCUMENT_TYPE_NODE}u(Gu,"isDocTypeNode");function za(r){return r&&r.nodeType===Ft.ELEMENT_NODE}u(za,"isElementNode");function iL(r){return r&&r.nodeType===Ft.TEXT_NODE}u(iL,"isTextNode");function K5(r,e){var t=r.childNodes||[];if(Zi(t,za)||Gu(e))return!1;var n=Zi(t,Gu);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}u(K5,"isElementInsertionPossible");function X5(r,e){var t=r.childNodes||[];function n(i){return za(i)&&i!==e}if(u(n,"hasElementChildThatIsNotChild"),Zi(t,n))return!1;var s=Zi(t,Gu);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}u(X5,"isElementReplacementPossible");function XY(r,e,t){if(!HY(r))throw new We(We.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new We(We.NOT_FOUND_ERR,"child not in parent");if(!KY(e)||Gu(e)&&r.nodeType!==Ft.DOCUMENT_NODE)throw new We(We.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}u(XY,"assertPreInsertionValidity1to5");function GY(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ft.DOCUMENT_FRAGMENT_NODE){var i=s.filter(za);if(i.length>1||Zi(s,iL))throw new We(We.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!K5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(za(e)&&!K5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Gu(e)){if(Zi(n,Gu))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Zi(n,za);if(t&&n.indexOf(a)<n.indexOf(t))throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!t&&a)throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}u(GY,"assertPreInsertionValidityInDocument");function aL(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Ft.DOCUMENT_FRAGMENT_NODE){var i=s.filter(za);if(i.length>1||Zi(s,iL))throw new We(We.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!X5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(za(e)&&!X5(r,t))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Gu(e)){let o=function(l){return Gu(l)&&l!==t};if(u(o,"hasDoctypeChildThatIsNotChild"),Zi(n,o))throw new We(We.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Zi(n,za);if(t&&n.indexOf(a)<n.indexOf(t))throw new We(We.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}u(aL,"assertPreReplacementValidityInDocument");function zS(r,e,t,n){XY(r,e,t),r.nodeType===Ft.DOCUMENT_NODE&&(n||GY)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===Xu){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var o=t?t.previousSibling:r.lastChild;i.previousSibling=o,a.nextSibling=t,o?o.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do i.parentNode=r;while(i!==a&&(i=i.nextSibling));return nL(r.ownerDocument||r,r,e),e.nodeType==Xu&&(e.firstChild=e.lastChild=null),e}u(zS,"_insertBefore");Ja.prototype={implementation:null,nodeName:"#document",nodeType:R0,doctype:null,documentElement:null,_inc:1,insertBefore:u(function(r,e){if(r.nodeType===Xu){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return zS(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===Ks&&(this.documentElement=r),r},"insertBefore"),removeChild:u(function(r){var e=sL(this,r);return e===this.documentElement&&(this.documentElement=null),e},"removeChild"),replaceChild:u(function(r,e){zS(this,r,e,aL),r.ownerDocument=this,e&&this.removeChild(e),za(r)&&(this.documentElement=r)},"replaceChild"),importNode:u(function(r,e){return $Y(this,r,e)},"importNode"),getElementById:u(function(r){var e=null;return $S(this.documentElement,function(t){if(t.nodeType==Ks&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),createElement:u(function(r){var e=new Ya(Un);e.ownerDocument=this,this.type==="html"&&(r=r.toLowerCase()),RY(this.contentType)&&(e.namespaceURI=ea.HTML),e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new Jr;var t=e.attributes=new P0;return t._ownerElement=e,e},"createElement"),createDocumentFragment:u(function(){var r=new V0(Un);return r.ownerDocument=this,r.childNodes=new Jr,r},"createDocumentFragment"),createTextNode:u(function(r){var e=new Sy(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createTextNode"),createComment:u(function(r){var e=new YS(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createComment"),createCDATASection:u(function(r){if(r.indexOf("]]>")!==-1)throw new We(We.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new QS(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:u(function(r,e){var t=new tA(Un);return t.ownerDocument=this,t.childNodes=new Jr,t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:u(function(r){if(!An.QName_exact.test(r))throw new We(We.INVALID_CHARACTER_ERR,'invalid character in name "'+r+'"');return this.type==="html"&&(r=r.toLowerCase()),this._createAttribute(r)},"createAttribute"),_createAttribute:u(function(r){var e=new rf(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"_createAttribute"),createEntityReference:u(function(r){if(!An.Name.test(r))throw new We(We.INVALID_CHARACTER_ERR,'not a valid xml name "'+r+'"');if(this.type==="html")throw new We("document is an html document",Hs.NotSupportedError);var e=new eA(Un);return e.ownerDocument=this,e.childNodes=new Jr,e.nodeName=r,e},"createEntityReference"),createElementNS:u(function(r,e){var t=rI(r,e),n=new Ya(Un),s=n.attributes=new P0;return n.childNodes=new Jr,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],s._ownerElement=n,n},"createElementNS"),createAttributeNS:u(function(r,e){var t=rI(r,e),n=new rf(Un);return n.ownerDocument=this,n.childNodes=new Jr,n.nodeName=e,n.name=e,n.specified=!0,n.namespaceURI=t[0],n.prefix=t[1],n.localName=t[2],n},"createAttributeNS")};is(Ja,Ft);function Ya(r){ss(r),this._nsMap=Object.create(null)}u(Ya,"Element");Ya.prototype={nodeType:Ks,attributes:null,getQualifiedName:u(function(){return this.prefix?this.prefix+":"+this.localName:this.localName},"getQualifiedName"),_isInHTMLDocumentAndNamespace:u(function(){return this.ownerDocument.type==="html"&&this.namespaceURI===ea.HTML},"_isInHTMLDocumentAndNamespace"),hasAttributes:u(function(){return!!(this.attributes&&this.attributes.length)},"hasAttributes"),hasAttribute:u(function(r){return!!this.getAttributeNode(r)},"hasAttribute"),getAttribute:u(function(r){var e=this.getAttributeNode(r);return e?e.value:null},"getAttribute"),getAttributeNode:u(function(r){return this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase()),this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:u(function(r,e){this._isInHTMLDocumentAndNamespace()&&(r=r.toLowerCase());var t=this.getAttributeNode(r);t?t.value=t.nodeValue=""+e:(t=this.ownerDocument._createAttribute(r),t.value=t.nodeValue=""+e,this.setAttributeNode(t))},"setAttribute"),removeAttribute:u(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),setAttributeNode:u(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:u(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:u(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:u(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:u(function(r,e){var t=this.getAttributeNodeNS(r,e);return t?t.value:null},"getAttributeNS"),setAttributeNS:u(function(r,e,t){var n=rI(r,e),s=n[2],i=this.getAttributeNodeNS(r,s);i?i.value=i.nodeValue=""+t:(i=this.ownerDocument.createAttributeNS(r,e),i.value=i.nodeValue=""+t,this.setAttributeNode(i))},"setAttributeNS"),getAttributeNodeNS:u(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByClassName:u(function(r){var e=j5(r);return new Qi(this,function(t){var n=[];return e.length>0&&$S(t,function(s){if(s!==t&&s.nodeType===Ks){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var o=j5(i);a=e.every(FY(o))}a&&n.push(s)}}}),n})},"getElementsByClassName"),getElementsByTagName:u(function(r){var e=(this.nodeType===R0?this:this.ownerDocument).type==="html",t=r.toLowerCase();return new Qi(this,function(n){var s=[];return $S(n,function(i){if(!(i===n||i.nodeType!==Ks))if(r==="*")s.push(i);else{var a=i.getQualifiedName(),o=e&&i.namespaceURI===ea.HTML?t:r;a===o&&s.push(i)}}),s})},"getElementsByTagName"),getElementsByTagNameNS:u(function(r,e){return new Qi(this,function(t){var n=[];return $S(t,function(s){s!==t&&s.nodeType===Ks&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Ja.prototype.getElementsByClassName=Ya.prototype.getElementsByClassName;Ja.prototype.getElementsByTagName=Ya.prototype.getElementsByTagName;Ja.prototype.getElementsByTagNameNS=Ya.prototype.getElementsByTagNameNS;is(Ya,Ft);function rf(r){ss(r),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}u(rf,"Attr");rf.prototype.nodeType=_0;is(rf,Ft);function L0(r){ss(r)}u(L0,"CharacterData");L0.prototype={data:"",substringData:u(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:u(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:u(function(r,e){this.replaceData(r,0,e)},"insertData"),deleteData:u(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:u(function(r,e,t){var n=this.data.substring(0,r),s=this.data.substring(r+e);t=n+t+s,this.nodeValue=this.data=t,this.length=t.length},"replaceData")};is(L0,Ft);function Sy(r){ss(r)}u(Sy,"Text");Sy.prototype={nodeName:"#text",nodeType:WS,splitText:u(function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n},"splitText")};is(Sy,L0);function YS(r){ss(r)}u(YS,"Comment");YS.prototype={nodeName:"#comment",nodeType:sI};is(YS,L0);function QS(r){ss(r)}u(QS,"CDATASection");QS.prototype={nodeName:"#cdata-section",nodeType:z5};is(QS,Sy);function ZS(r){ss(r)}u(ZS,"DocumentType");ZS.prototype.nodeType=Y5;is(ZS,Ft);function iI(r){ss(r)}u(iI,"Notation");iI.prototype.nodeType=MY;is(iI,Ft);function aI(r){ss(r)}u(aI,"Entity");aI.prototype.nodeType=UY;is(aI,Ft);function eA(r){ss(r)}u(eA,"EntityReference");eA.prototype.nodeType=J5;is(eA,Ft);function V0(r){ss(r)}u(V0,"DocumentFragment");V0.prototype.nodeName="#document-fragment";V0.prototype.nodeType=Xu;is(V0,Ft);function tA(r){ss(r)}u(tA,"ProcessingInstruction");tA.prototype.nodeType=nI;is(tA,L0);function oL(){}u(oL,"XMLSerializer");oL.prototype.serializeToString=function(r,e){return uL.call(r,e)};Ft.prototype.toString=uL;function uL(r){var e;typeof r=="function"?e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:r}:r!=null?e={requireWellFormed:!!r.requireWellFormed,splitCDATASections:r.splitCDATASections!==!1,nodeFilter:r.nodeFilter||null}:e={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var t=[],n=this.nodeType===R0&&this.documentElement||this,s=n.prefix,i=n.namespaceURI;if(i&&s==null){var s=n.lookupPrefix(i);if(s==null)var a=[{namespace:i,prefix:null}]}return oI(this,t,a,e),t.join("")}u(uL,"nodeSerializeToString");function G5(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===ea.XML||s===ea.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}u(G5,"needNamespaceDefine");function GS(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,tL),'"')}u(GS,"addSerializedAttribute");function oI(r,e,t,n){t||(t=[]);var s=n.nodeFilter,i=n.requireWellFormed,a=n.splitCDATASections,o=r.nodeType===R0?r:r.ownerDocument,l=o.type==="html";Cn(r,{ns:t},{enter:u(function(c,f){var p=f.ns;if(s)if(c=s(c),c){if(typeof c=="string")return e.push(c),null}else return null;switch(c.nodeType){case Ks:var d=c.attributes,g=d.length,m=c.tagName,v=m;if(!l&&!c.prefix&&c.namespaceURI){for(var y,S=0;S<d.length;S++)if(d.item(S).name==="xmlns"){y=d.item(S).value;break}if(!y)for(var C=p.length-1;C>=0;C--){var w=p[C];if(w.prefix===""&&w.namespace===c.namespaceURI){y=w.namespace;break}}if(y!==c.namespaceURI)for(var C=p.length-1;C>=0;C--){var w=p[C];if(w.namespace===c.namespaceURI){w.prefix&&(v=w.prefix+":"+m);break}}}e.push("<",v);for(var E=p.slice(),A=0;A<g;A++){var b=d.item(A);b.prefix=="xmlns"?E.push({prefix:b.localName,namespace:b.value}):b.nodeName=="xmlns"&&E.push({prefix:"",namespace:b.value})}for(var A=0;A<g;A++){var b=d.item(A);if(G5(b,l,E)){var V=b.prefix||"",I=b.namespaceURI;GS(e,V?"xmlns:"+V:"xmlns",I),E.push({prefix:V,namespace:I})}var D=s?s(b):b;D&&(typeof D=="string"?e.push(D):GS(e,D.name,D.value))}if(m===v&&G5(c,l,E)){var U=c.prefix||"",I=c.namespaceURI;GS(e,U?"xmlns:"+U:"xmlns",I),E.push({prefix:U,namespace:I})}var F=!c.firstChild;if(F&&(l||c.namespaceURI===ea.HTML)&&(F=PY(m)),F)return e.push("/>"),null;if(e.push(">"),l&&_Y(m)){for(var M=c.firstChild;M;)M.data?e.push(M.data):oI(M,e,E.slice(),n),M=M.nextSibling;return e.push("</",v,">"),null}return{ns:E,tag:v};case R0:case Xu:if(i&&c.nodeType===R0&&c.documentElement==null)throw new We("The Document has no documentElement",Hs.InvalidStateError);return{ns:p};case _0:return GS(e,c.name,c.value),null;case WS:if(i&&An.InvalidChar.test(c.data))throw new We("The Text node data contains characters outside the XML Char production",Hs.InvalidStateError);return e.push(c.data.replace(/[<&>]/g,tL)),null;case z5:if(i&&c.data.indexOf("]]>")!==-1)throw new We('The CDATASection data contains "]]>"',Hs.InvalidStateError);return a?e.push(An.CDATA_START,c.data.replace(/]]>/g,"]]]]><![CDATA[>"),An.CDATA_END):e.push(An.CDATA_START,c.data,An.CDATA_END),null;case sI:if(i){if(An.InvalidChar.test(c.data))throw new We("The comment node data contains characters outside the XML Char production",Hs.InvalidStateError);if(c.data.indexOf("--")!==-1||c.data[c.data.length-1]==="-")throw new We('The comment node data contains "--" or ends with "-"',Hs.InvalidStateError)}return e.push(An.COMMENT_START,c.data,An.COMMENT_END),null;case Y5:var se=c.publicId,ee=c.systemId;if(i){if(se&&!An.PubidLiteral_match.test(se))throw new We("DocumentType publicId is not a valid PubidLiteral",Hs.InvalidStateError);if(ee&&ee!=="."&&!An.SystemLiteral_match.test(ee))throw new We("DocumentType systemId is not a valid SystemLiteral",Hs.InvalidStateError);if(c.internalSubset&&c.internalSubset.indexOf("]>")!==-1)throw new We('DocumentType internalSubset contains "]>"',Hs.InvalidStateError)}return e.push(An.DOCTYPE_DECL_START," ",c.name),se?(e.push(" ",An.PUBLIC," ",se),ee&&ee!=="."&&e.push(" ",ee)):ee&&ee!=="."&&e.push(" ",An.SYSTEM," ",ee),c.internalSubset&&e.push(" [",c.internalSubset,"]"),e.push(">"),null;case nI:if(i){if(c.target.indexOf(":")!==-1||c.target.toLowerCase()==="xml")throw new We("The ProcessingInstruction target is not well-formed",Hs.InvalidStateError);if(An.InvalidChar.test(c.data))throw new We("The ProcessingInstruction data contains characters outside the XML Char production",Hs.InvalidStateError);if(c.data.indexOf("?>")!==-1)throw new We('The ProcessingInstruction data contains "?>"',Hs.InvalidStateError)}return e.push("<?",c.target," ",c.data,"?>"),null;case J5:return e.push("&",c.nodeName,";"),null;default:return e.push("??",c.nodeName),null}},"enter"),exit:u(function(c,f){f&&f.tag&&e.push("</",f.tag,">")},"exit")})}u(oI,"serializeToString");function $Y(r,e,t){var n;return Cn(e,null,{enter:u(function(s,i){var a=s.cloneNode(!1);a.ownerDocument=r,a.parentNode=null,i===null?n=a:i.appendChild(a);var o=s.nodeType===_0||t;return o?a:null},"enter")}),n}u($Y,"importNode");function lL(r,e,t){var n;return Cn(e,null,{enter:u(function(s,i){var a=new s.constructor(Un);for(var o in s)if(O0(s,o)){var l=s[o];typeof l!="object"&&l!=a[o]&&(a[o]=l)}s.childNodes&&(a.childNodes=new Jr),a.ownerDocument=r;var c=t;switch(a.nodeType){case Ks:var f=s.attributes,p=a.attributes=new P0,d=f.length;p._ownerElement=a;for(var g=0;g<d;g++)a.setAttributeNode(lL(r,f.item(g),!0));break;case _0:c=!0}return i!==null?i.appendChild(a):n=a,c?a:null},"enter")}),n}u(lL,"cloneNode");function cL(r,e,t){r[e]=t}u(cL,"__set__");function tI(r){for(var e=[],t=r.firstChild;t;)t.nodeType===Ks&&e.push(t),t=t.nextSibling;return e}u(tI,"childrenRefresh");try{Object.defineProperty&&(Object.defineProperty(Qi.prototype,"length",{get:u(function(){return JS(this),this.$$length},"get")}),Object.defineProperty(Ft.prototype,"textContent",{get:u(function(){if(this.nodeType===Ks||this.nodeType===Xu){var r=[];return Cn(this,null,{enter:u(function(e){if(e.nodeType===Ks||e.nodeType===Xu)return!0;if(e.nodeType===nI||e.nodeType===sI)return null;r.push(e.nodeValue)},"enter")}),r.join("")}return this.nodeValue},"get"),set:u(function(r){switch(this.nodeType){case Ks:case Xu:for(;this.firstChild;)this.removeChild(this.firstChild);(r||String(r))&&this.appendChild(this.ownerDocument.createTextNode(r));break;default:this.data=r,this.value=r,this.nodeValue=r}},"set")}),Object.defineProperty(Ya.prototype,"children",{get:u(function(){return new Qi(this,tI)},"get")}),Object.defineProperty(Ja.prototype,"children",{get:u(function(){return new Qi(this,tI)},"get")}),Object.defineProperty(V0.prototype,"children",{get:u(function(){return new Qi(this,tI)},"get")}),cL=u(function(r,e,t){r["$$"+e]=t},"__set__"))}catch{}kr._updateLiveList=JS;kr.Attr=rf;kr.CDATASection=QS;kr.CharacterData=L0;kr.Comment=YS;kr.Document=Ja;kr.DocumentFragment=V0;kr.DocumentType=ZS;kr.DOMImplementation=eL;kr.Element=Ya;kr.Entity=aI;kr.EntityReference=eA;kr.LiveNodeList=Qi;kr.NamedNodeMap=P0;kr.Node=Ft;kr.NodeList=Jr;kr.Notation=iI;kr.Text=Sy;kr.ProcessingInstruction=tA;kr.walkDOM=Cn;kr.XMLSerializer=oL});var hL=ue(Ay=>{"use strict";var fL=tf().freeze;Ay.XML_ENTITIES=fL({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Ay.HTML_ENTITIES=fL({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
78
+ `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Ay.entityMap=Ay.HTML_ENTITIES});var CL=ue(nA=>{"use strict";var j0=tf(),Et=eI(),yL=dy(),WY=j0.isHTMLEscapableRawTextElement,zY=j0.isHTMLMimeType,JY=j0.isHTMLRawTextElement,Ny=j0.hasOwn,pL=j0.NAMESPACE,dL=yL.ParseError,YY=yL.DOMException,Cy=0,$u=1,F0=2,xy=3,U0=4,M0=5,by=6,rA=7;function vL(){}u(vL,"XMLReader");vL.prototype={parse:u(function(r,e,t){var n=this.domBuilder;n.startDocument(),EL(e,e=Object.create(null)),QY(r,e,t,n,this.errorHandler),n.endDocument()},"parse")};var lI=/&#?\w+;?/g;function QY(r,e,t,n,s){var i=zY(n.mimeType);r.indexOf(Et.UNICODE_REPLACEMENT_CHARACTER)>=0&&s.warning("Unicode replacement character detected, source encoding issues?");function a(xe){if(xe>65535){xe-=65536;var pe=55296+(xe>>10),W=56320+(xe&1023);return String.fromCharCode(pe,W)}else return String.fromCharCode(xe)}u(a,"fixedFromCharCode");function o(xe){var pe=xe[xe.length-1]===";"?xe:xe+";";if(!i&&pe!==xe)return s.error("EntityRef: expecting ;"),xe;var W=Et.Reference.exec(pe);if(!W||W[0].length!==pe.length)return s.error("entity not matching Reference production: "+xe),xe;var fe=pe.slice(1,-1);return Ny(t,fe)?t[fe]:fe.charAt(0)==="#"?a(parseInt(fe.substring(1).replace("x","0x"))):(s.error("entity not found:"+xe),xe)}u(o,"entityReplacer");function l(xe){if(xe>y){var pe=r.substring(y,xe).replace(lI,o);d&&g(y),n.characters(pe,0,xe-y),y=xe}}u(l,"appendText");var c=0,f=0,p=/\r\n?|\n|$/g,d=n.locator;function g(xe,pe){for(;xe>=f&&(pe=p.exec(r));)c=f,f=pe.index+pe[0].length,d.lineNumber++;d.columnNumber=xe-c+1}u(g,"position");for(var m=[{currentNSMap:e}],v=[],y=0;;){try{var S=r.indexOf("<",y);if(S<0){if(!i&&v.length>0)return s.fatalError("unclosed xml tag(s): "+v.join(", "));if(!r.substring(y).match(/^\s*$/)){var C=n.doc,w=C.createTextNode(r.substring(y));if(C.documentElement)return s.error("Extra content at the end of the document");C.appendChild(w),n.currentElement=w}return}if(S>y){var E=r.substring(y,S);!i&&v.length===0&&(E=E.replace(new RegExp(Et.S_OPT.source,"g"),""),E&&s.error("Unexpected content outside root element: '"+E+"'")),l(S)}switch(r.charAt(S+1)){case"/":var ee=r.indexOf(">",S+2),A=r.substring(S+2,ee>0?ee:void 0);if(!A)return s.fatalError("end tag name missing");var b=ee>0&&Et.reg("^",Et.QName_group,Et.S_OPT,"$").exec(A);if(!b)return s.fatalError('end tag name contains invalid characters: "'+A+'"');if(!n.currentElement&&!n.doc.documentElement)return;var V=v[v.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(V!==b[1]){var I=b[1].toLowerCase();if(!i||V.toLowerCase()!==I)return s.fatalError('Opening and ending tag mismatch: "'+V+'" != "'+A+'"')}var D=m.pop();v.pop();var U=D.localNSMap;if(n.endElement(D.uri,D.localName,V),U)for(var F in U)Ny(U,F)&&n.endPrefixMapping(F);ee++;break;case"?":d&&g(S),ee=rQ(r,S,n,s);break;case"!":d&&g(S),ee=SL(r,S,n,s,i);break;default:d&&g(S);var M=new AL,se=m[m.length-1].currentNSMap,ee=ZY(r,S,M,se,o,s,i),ie=M.length;if(M.closed||(i&&j0.isHTMLVoidElement(M.tagName)?M.closed=!0:v.push(M.tagName)),d&&ie){for(var X=mL(d,{}),he=0;he<ie;he++){var Ce=M[he];g(Ce.offset),Ce.locator=mL(d,{})}n.locator=X,gL(M,n,se)&&m.push(M),n.locator=d}else gL(M,n,se)&&m.push(M);i&&!M.closed?ee=eQ(r,ee,M.tagName,o,n):ee++}}catch(xe){if(xe instanceof dL)throw xe;if(xe instanceof YY)throw new dL(xe.name+": "+xe.message,n.locator,xe);s.error("element parse error: "+xe),ee=-1}ee>y?y=ee:l(Math.max(S,y)+1)}}u(QY,"parse");function mL(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}u(mL,"copyLocator");function ZY(r,e,t,n,s,i,a){function o(g,m,v){if(Ny(t.attributeNames,g))return i.fatalError("Attribute "+g+" redefined");if(!a&&m.indexOf("<")>=0)return i.fatalError("Unescaped '<' not allowed in attributes values");t.addValue(g,m.replace(/[\t\n\r]/g," ").replace(lI,s),v)}u(o,"addAttribute");for(var l,c,f=++e,p=Cy;;){var d=r.charAt(f);switch(d){case"=":if(p===$u)l=r.slice(e,f),p=xy;else if(p===F0)p=xy;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(p===xy||p===$u)if(p===$u&&(i.warning('attribute value must after "="'),l=r.slice(e,f)),e=f+1,f=r.indexOf(d,e),f>0)c=r.slice(e,f),o(l,c,e-1),p=M0;else throw new Error("attribute value no end '"+d+"' match");else if(p==U0)c=r.slice(e,f),o(l,c,e),i.warning('attribute "'+l+'" missed start quot('+d+")!!"),e=f+1,p=M0;else throw new Error('attribute value must after "="');break;case"/":switch(p){case Cy:t.setTagName(r.slice(e,f));case M0:case by:case rA:p=rA,t.closed=!0;case U0:case $u:break;case F0:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),p==Cy&&t.setTagName(r.slice(e,f)),f;case">":switch(p){case Cy:t.setTagName(r.slice(e,f));case M0:case by:case rA:break;case U0:case $u:c=r.slice(e,f),c.slice(-1)==="/"&&(t.closed=!0,c=c.slice(0,-1));case F0:p===F0&&(c=l),p==U0?(i.warning('attribute "'+c+'" missed quot(")!'),o(l,c,e)):(a||i.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),o(c,c,e));break;case xy:if(!a)return i.fatalError(`AttValue: ' or " expected`)}return f;case"\x80":d=" ";default:if(d<=" ")switch(p){case Cy:t.setTagName(r.slice(e,f)),p=by;break;case $u:l=r.slice(e,f),p=F0;break;case U0:var c=r.slice(e,f);i.warning('attribute "'+c+'" missed quot(")!!'),o(l,c,e);case M0:p=by;break}else switch(p){case F0:a||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,e),e=f,p=$u;break;case M0:i.warning('attribute space is required"'+l+'"!!');case by:p=$u,e=f;break;case xy:p=U0,e=f;break;case rA:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}u(ZY,"parseElementStartPart");function gL(r,e,t){for(var n=r.tagName,s=null,p=r.length;p--;){var i=r[p],a=i.qName,o=i.value,d=a.indexOf(":");if(d>0)var l=i.prefix=a.slice(0,d),c=a.slice(d+1),f=l==="xmlns"&&c;else c=a,l=null,f=a==="xmlns"&&"";i.localName=c,f!==!1&&(s==null&&(s=Object.create(null),EL(t,t=Object.create(null))),t[f]=s[f]=o,i.uri=pL.XMLNS,e.startPrefixMapping(f,o))}for(var p=r.length;p--;)i=r[p],i.prefix&&(i.prefix==="xml"&&(i.uri=pL.XML),i.prefix!=="xmlns"&&(i.uri=t[i.prefix]));var d=n.indexOf(":");d>0?(l=r.prefix=n.slice(0,d),c=r.localName=n.slice(d+1)):(l=null,c=r.localName=n);var g=r.uri=t[l||""];if(e.startElement(g,c,n,r),r.closed){if(e.endElement(g,c,n),s)for(l in s)Ny(s,l)&&e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=s,!0}u(gL,"appendElement");function eQ(r,e,t,n,s){var i=WY(t);if(i||JY(t)){var a=r.indexOf("</"+t+">",e),o=r.substring(e+1,a);return i&&(o=o.replace(lI,n)),s.characters(o,0,o.length),a}return e+1}u(eQ,"parseHtmlSpecialContent");function EL(r,e){for(var t in r)Ny(r,t)&&(e[t]=r[t])}u(EL,"_copy");function wL(r,e){var t=e;function n(f){return f=f||0,r.charAt(t+f)}u(n,"char");function s(f){f=f||1,t+=f}u(s,"skip");function i(){for(var f=0;t<r.length;){var p=n();if(p!==" "&&p!==`
79
+ `&&p!==" "&&p!=="\r")return f;f++,s()}return-1}u(i,"skipBlanks");function a(){return r.substring(t)}u(a,"substringFromIndex");function o(f){return r.substring(t,t+f.length)===f}u(o,"substringStartsWith");function l(f){return r.substring(t,t+f.length).toUpperCase()===f.toUpperCase()}u(l,"substringStartsWithCaseInsensitive");function c(f){var p=Et.reg("^",f),d=p.exec(a());return d?(s(d[0].length),d[0]):null}return u(c,"getMatch"),{char:n,getIndex:u(function(){return t},"getIndex"),getMatch:c,getSource:u(function(){return r},"getSource"),skip:s,skipBlanks:i,substringFromIndex:a,substringStartsWith:o,substringStartsWithCaseInsensitive:l}}u(wL,"parseUtils");function tQ(r,e){function t(o,l){var c=Et.PI.exec(o.substringFromIndex());return c?c[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+o.getIndex()):(o.skip(c[0].length),c[0]):l.fatalError("processing instruction is not well-formed at position "+o.getIndex())}u(t,"parsePI");var n=r.getSource();if(r.char()==="["){r.skip(1);for(var s=r.getIndex();r.getIndex()<n.length;){if(r.skipBlanks(),r.char()==="]"){var i=n.substring(s,r.getIndex());return r.skip(1),i}var a=null;if(r.char()==="<"&&r.char(1)==="!")switch(r.char(2)){case"E":r.char(3)==="L"?a=r.getMatch(Et.elementdecl):r.char(3)==="N"&&(a=r.getMatch(Et.EntityDecl));break;case"A":a=r.getMatch(Et.AttlistDecl);break;case"N":a=r.getMatch(Et.NotationDecl);break;case"-":a=r.getMatch(Et.Comment);break}else if(r.char()==="<"&&r.char(1)==="?")a=t(r,e);else if(r.char()==="%")a=r.getMatch(Et.PEReference);else return e.fatalError("Error detected in Markup declaration");if(!a)return e.fatalError("Error in internal subset at position "+r.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}u(tQ,"parseDoctypeInternalSubset");function SL(r,e,t,n,s){var i=wL(r,e);switch(s?i.char(2).toUpperCase():i.char(2)){case"-":var a=i.getMatch(Et.Comment);return a?(t.comment(a,Et.COMMENT_START.length,a.length-Et.COMMENT_START.length-Et.COMMENT_END.length),i.getIndex()):n.fatalError("comment is not well-formed at position "+i.getIndex());case"[":var o=i.getMatch(Et.CDSect);return o?!s&&!t.currentElement?n.fatalError("CDATA outside of element"):(t.startCDATA(),t.characters(o,Et.CDATA_START.length,o.length-Et.CDATA_START.length-Et.CDATA_END.length),t.endCDATA(),i.getIndex()):n.fatalError("Invalid CDATA starting at position "+e);case"D":{if(t.doc&&t.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+i.getIndex());if(s?!i.substringStartsWithCaseInsensitive(Et.DOCTYPE_DECL_START):!i.substringStartsWith(Et.DOCTYPE_DECL_START))return n.fatalError("Expected "+Et.DOCTYPE_DECL_START+" at position "+i.getIndex());if(i.skip(Et.DOCTYPE_DECL_START.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+Et.DOCTYPE_DECL_START+" at position "+i.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=i.getMatch(Et.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+i.getIndex());if(s&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+i.getIndex()),i.skipBlanks(),i.substringStartsWith(Et.PUBLIC)||i.substringStartsWith(Et.SYSTEM)){var c=Et.ExternalID_match.exec(i.substringFromIndex());if(!c)return n.fatalError("doctype external id is not well-formed at position "+i.getIndex());c.groups.SystemLiteralOnly!==void 0?l.systemId=c.groups.SystemLiteralOnly:(l.systemId=c.groups.SystemLiteral,l.publicId=c.groups.PubidLiteral),i.skip(c[0].length)}else if(s&&i.substringStartsWithCaseInsensitive(Et.SYSTEM)){if(i.skip(Et.SYSTEM.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+Et.SYSTEM+" at position "+i.getIndex());if(l.systemId=i.getMatch(Et.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+Et.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+Et.SYSTEM+" at position "+i.getIndex())}return s&&l.systemId&&!Et.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+i.getIndex()),s||(i.skipBlanks(),l.internalSubset=tQ(i,n)),i.skipBlanks(),i.char()!==">"?n.fatalError("doctype not terminated with > at position "+i.getIndex()):(i.skip(1),t.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),t.endDTD(),i.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+e)}}u(SL,"parseDoctypeCommentOrCData");function rQ(r,e,t,n){var s=r.substring(e).match(Et.PI);if(!s)return n.fatalError("Invalid processing instruction starting at position "+e);if(s[1].toLowerCase()==="xml"){if(e>0)return n.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!Et.XMLDecl.test(r.substring(e)))return n.fatalError("xml declaration is not well-formed")}return t.processingInstruction(s[1],s[2]),e+s[0].length}u(rQ,"parseProcessingInstruction");function AL(){this.attributeNames=Object.create(null)}u(AL,"ElementAttributes");AL.prototype={setTagName:u(function(r){if(!Et.QName_exact.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},"setTagName"),addValue:u(function(r,e,t){if(!Et.QName_exact.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},"addValue"),length:0,getLocalName:u(function(r){return this[r].localName},"getLocalName"),getLocator:u(function(r){return this[r].locator},"getLocator"),getQName:u(function(r){return this[r].qName},"getQName"),getURI:u(function(r){return this[r].uri},"getURI"),getValue:u(function(r){return this[r].value},"getValue")};nA.XMLReader=vL;nA.parseUtils=wL;nA.parseDoctypeCommentOrCData=SL});var BL=ue(H0=>{"use strict";var nf=tf(),nQ=uI(),sQ=dy(),xL=hL(),iQ=CL(),aQ=nQ.DOMImplementation,oQ=nf.hasDefaultHTMLNamespace,uQ=nf.isHTMLMimeType,lQ=nf.isValidMimeType,TL=nf.MIME_TYPE,cI=nf.NAMESPACE,bL=sQ.ParseError,cQ=iQ.XMLReader;function IL(r){return r.replace(/\r[\n\u0085]/g,`
80
+ `).replace(/[\r\u0085\u2028\u2029]/g,`
81
+ `)}u(IL,"normalizeLineEndings");function DL(r){if(r=r||{},r.locator===void 0&&(r.locator=!0),this.assign=r.assign||nf.assign,this.domHandler=r.domHandler||iA,this.onError=r.onError||r.errorHandler,r.errorHandler&&typeof r.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");r.errorHandler&&r.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=r.normalizeLineEndings||IL,this.locator=!!r.locator,this.xmlns=this.assign(Object.create(null),r.xmlns)}u(DL,"DOMParser");DL.prototype.parseFromString=function(r,e){if(!lQ(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var t=this.assign(Object.create(null),this.xmlns),n=xL.XML_ENTITIES,s=t[""]||null;oQ(e)?(n=xL.HTML_ENTITIES,s=cI.HTML):e===TL.XML_SVG_IMAGE&&(s=cI.SVG),t[""]=s,t.xml=t.xml||cI.XML;var i=new this.domHandler({mimeType:e,defaultNamespace:s,onError:this.onError}),a=this.locator?{}:void 0;this.locator&&i.setDocumentLocator(a);var o=new cQ;o.errorHandler=i,o.domBuilder=i;var l=!nf.isHTMLMimeType(e);return l&&typeof r!="string"&&o.errorHandler.fatalError("source is not a string"),o.parse(this.normalizeLineEndings(String(r)),t,n),i.doc.documentElement||o.errorHandler.fatalError("missing root element"),i.doc};function iA(r){var e=r||{};this.mimeType=e.mimeType||TL.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}u(iA,"DOMHandler");function q0(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}u(q0,"position");iA.prototype={startDocument:u(function(){var r=new aQ;this.doc=uQ(this.mimeType)?r.createHTMLDocument(!1):r.createDocument(this.defaultNamespace,"")},"startDocument"),startElement:u(function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;sA(this,i),this.currentElement=i,this.locator&&q0(this.locator,i);for(var o=0;o<a;o++){var r=n.getURI(o),l=n.getValue(o),t=n.getQName(o),c=s.createAttributeNS(r,t);this.locator&&q0(n.getLocator(o),c),c.value=c.nodeValue=l,i.setAttributeNode(c)}},"startElement"),endElement:u(function(r,e,t){this.currentElement=this.currentElement.parentNode},"endElement"),startPrefixMapping:u(function(r,e){},"startPrefixMapping"),endPrefixMapping:u(function(r){},"endPrefixMapping"),processingInstruction:u(function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&q0(this.locator,t),sA(this,t)},"processingInstruction"),ignorableWhitespace:u(function(r,e,t){},"ignorableWhitespace"),characters:u(function(r,e,t){if(r=NL.apply(this,arguments),r){if(this.cdata)var n=this.doc.createCDATASection(r);else var n=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(r)&&this.doc.appendChild(n),this.locator&&q0(this.locator,n)}},"characters"),skippedEntity:u(function(r){},"skippedEntity"),endDocument:u(function(){this.doc.normalize()},"endDocument"),setDocumentLocator:u(function(r){r&&(r.lineNumber=0),this.locator=r},"setDocumentLocator"),comment:u(function(r,e,t){r=NL.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&q0(this.locator,n),sA(this,n)},"comment"),startCDATA:u(function(){this.cdata=!0},"startCDATA"),endCDATA:u(function(){this.cdata=!1},"endCDATA"),startDTD:u(function(r,e,t,n){var s=this.doc.implementation;if(s&&s.createDocumentType){var i=s.createDocumentType(r,e,t,n);this.locator&&q0(this.locator,i),sA(this,i),this.doc.doctype=i}},"startDTD"),reportError:u(function(r,e){if(typeof this.onError=="function")try{this.onError(r,e,this)}catch(t){throw new bL("Reporting "+r+' "'+e+'" caused '+t,this.locator)}else console.error("[xmldom "+r+"] "+e,fQ(this.locator))},"reportError"),warning:u(function(r){this.reportError("warning",r)},"warning"),error:u(function(r){this.reportError("error",r)},"error"),fatalError:u(function(r){throw this.reportError("fatalError",r),new bL(r,this.locator)},"fatalError")};function fQ(r){if(r)return`
82
+ @#[line:`+r.lineNumber+",col:"+r.columnNumber+"]"}u(fQ,"_locator");function NL(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}u(NL,"_toString");"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){iA.prototype[r]=function(){return null}});function sA(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}u(sA,"appendElement");function hQ(r){if(r==="error")throw"onErrorStopParsing"}u(hQ,"onErrorStopParsing");function pQ(){throw"onWarningStopParsing"}u(pQ,"onWarningStopParsing");H0.__DOMHandler=iA;H0.DOMParser=DL;H0.normalizeLineEndings=IL;H0.onErrorStopParsing=hQ;H0.onWarningStopParsing=pQ});var RL=ue(Ut=>{"use strict";var K0=tf();Ut.assign=K0.assign;Ut.hasDefaultHTMLNamespace=K0.hasDefaultHTMLNamespace;Ut.isHTMLMimeType=K0.isHTMLMimeType;Ut.isValidMimeType=K0.isValidMimeType;Ut.MIME_TYPE=K0.MIME_TYPE;Ut.NAMESPACE=K0.NAMESPACE;var aA=dy();Ut.DOMException=aA.DOMException;Ut.DOMExceptionName=aA.DOMExceptionName;Ut.ExceptionCode=aA.ExceptionCode;Ut.ParseError=aA.ParseError;var Yr=uI();Ut.Attr=Yr.Attr;Ut.CDATASection=Yr.CDATASection;Ut.CharacterData=Yr.CharacterData;Ut.Comment=Yr.Comment;Ut.Document=Yr.Document;Ut.DocumentFragment=Yr.DocumentFragment;Ut.DocumentType=Yr.DocumentType;Ut.DOMImplementation=Yr.DOMImplementation;Ut.Element=Yr.Element;Ut.Entity=Yr.Entity;Ut.EntityReference=Yr.EntityReference;Ut.LiveNodeList=Yr.LiveNodeList;Ut.NamedNodeMap=Yr.NamedNodeMap;Ut.Node=Yr.Node;Ut.NodeList=Yr.NodeList;Ut.Notation=Yr.Notation;Ut.ProcessingInstruction=Yr.ProcessingInstruction;Ut.Text=Yr.Text;Ut.XMLSerializer=Yr.XMLSerializer;var oA=BL();Ut.DOMParser=oA.DOMParser;Ut.normalizeLineEndings=oA.normalizeLineEndings;Ut.onErrorStopParsing=oA.onErrorStopParsing;Ut.onWarningStopParsing=oA.onWarningStopParsing});var lA="http://www.w3.org/2000/09/xmldsig#",mI="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",cA=(function(r){return r.RSA_SHA1="http://www.w3.org/2000/09/xmldsig#rsa-sha1",r.RSA_SHA256="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",r})({}),eo=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),fA=(function(r){return r.SHA1="http://www.w3.org/2000/09/xmldsig#sha1",r.SHA256="http://www.w3.org/2001/04/xmlenc#sha256",r})({});var Qt={AC:"12",AL:"27",AM:"13",AP:"16",BA:"29",CE:"23",DF:"53",ES:"32",GO:"52",MA:"21",MG:"31",MS:"50",MT:"51",PA:"15",PB:"25",PE:"26",PI:"22",PR:"41",RJ:"33",RN:"24",RO:"11",RR:"14",RS:"43",SC:"42",SE:"28",SP:"35",TO:"17"},SQ=Object.keys(Qt);var CQ={Production:"1",Homolog:"2"};var NQ={[Qt.AC]:"America/Rio_Branco",[Qt.AL]:"America/Maceio",[Qt.AM]:"America/Manaus",[Qt.AP]:"America/Belem",[Qt.BA]:"America/Bahia",[Qt.CE]:"America/Fortaleza",[Qt.DF]:"America/Sao_Paulo",[Qt.ES]:"America/Sao_Paulo",[Qt.GO]:"America/Sao_Paulo",[Qt.MA]:"America/Fortaleza",[Qt.MG]:"America/Sao_Paulo",[Qt.MS]:"America/Campo_Grande",[Qt.MT]:"America/Cuiaba",[Qt.PA]:"America/Belem",[Qt.PB]:"America/Fortaleza",[Qt.PE]:"America/Recife",[Qt.PI]:"America/Fortaleza",[Qt.PR]:"America/Sao_Paulo",[Qt.RJ]:"America/Sao_Paulo",[Qt.RN]:"America/Fortaleza",[Qt.RO]:"America/Porto_Velho",[Qt.RR]:"America/Boa_Vista",[Qt.RS]:"America/Sao_Paulo",[Qt.SC]:"America/Sao_Paulo",[Qt.SE]:"America/Maceio",[Qt.SP]:"America/Sao_Paulo",[Qt.TO]:"America/Araguaina"};var Mt=class extends Error{static{u(this,"NFeTsError")}};var Dy=class extends Mt{static{u(this,"TransmissionError")}},$0=class extends Dy{static{u(this,"TransmissionHostNotFoundError")}},uf=class extends Dy{static{u(this,"TransmissionTimeoutError")}};var gI=class extends Mt{static{u(this,"ValidationError")}};var W0={includeComments:!1,exclusive:!0};var hA=u(r=>{throw new Mt("Didn't expect to get here")},"unreachable");var lf=class{static{u(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=eo.SHA1,s=W0){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=s}assemble(e,t,n){let s=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:lA},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:s}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:mI}},SignatureMethod:{$:{Algorithm:this.signatureMethod}},Reference:{$:{URI:`#${this.toolkit.getAttribute(e,t)}`},Transforms:this.transforms,DigestMethod:{$:{Algorithm:this.digestAlgorithm}},DigestValue:this.digest(e)}}}digest(e){return this.toolkit.digest(e,this.algorithm,this.canonical)}async signOrLeft(e,t){let n=this.toolkit.canonicalize(await this.toolkit.build({$:{xmlns:lA},...e},{rootName:"SignedInfo"}),this.canonical);return this.certificateRepository.sign(n,t,this.algorithm)}get transforms(){return{Transform:[{$:{Algorithm:"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}},{$:{Algorithm:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315"}}]}}get digestAlgorithm(){switch(this.algorithm){case eo.SHA256:return fA.SHA256;case eo.SHA1:return fA.SHA1;default:return hA(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case eo.SHA256:return cA.RSA_SHA256;case eo.SHA1:return cA.RSA_SHA1;default:return hA(this.algorithm)}}};var pA=class{static{u(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},By=class{static{u(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},rr=u(r=>new pA(r),"left"),Hr=u(r=>r===void 0?new By(void 0):new By(r),"right");var yI=class extends lf{static{u(this,"EntitySigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{certificate:a}=n;if(!e[s])return rr(new Mt(`Node ${String(s)} not found`));let o=await this.toolkit.build(this.ns(e,s),{headless:!0,rootName:String(s),renderOpts:{pretty:!1}}),l=this.signedInfo(o,i),c=await this.signOrLeft(l,n);if(c.isLeft())return c;let f=e;return f.Signature=this.assemble(l,c.value,a),Hr(f)}ns(e,t){let n=e.$?.xmlns,{$:s,...i}=e[t],{xmlns:a,...o}=s??{};return{$:{xmlns:n,...o},...i}}};var vI=class extends lf{static{u(this,"XmlSigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{certificate:a}=n,o=this.toolkit.getNode(e,s);if(!o)return rr(new Mt(`Node ${s} not found`));let l=this.signedInfo(o,i),c=await this.signOrLeft(l,n);if(c.isLeft())return c;let f=await this.toolkit.build(this.assemble(l,c.value,a),{rootName:"Signature"});return Hr(this.toolkit.appendNode(e,f))}};import"reflect-metadata";import{validateSync as wV}from"class-validator";import"reflect-metadata";var z0="__SkipValidation__",wZ=u(()=>(r,e)=>{Reflect.defineMetadata(z0,!0,r,e.toString())},"SkipValidation"),SZ=u(()=>r=>{Reflect.defineMetadata(z0,!0,r)},"SkipAllValidations");import{plainToInstance as EV}from"class-transformer";var Ry=u(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&Ry(t)},"clearEmptyValues"),EI=u((r,e,t={})=>{let n=EV(e,r);return t.clearEmptyValues&&Ry(n),n},"plainToInstance");var wI="__ValidateErrors__",SI=u((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(SI(n.children,e?`${e}.${n.property}`:n.property));let s=Object.values(n.constraints??{}).map(i=>e?`${e}.${i}`:i).join(", ");return s?t.concat(s):t},[]),"mapConstraintsToErrors"),RZ=u(r=>(e,t,n)=>{let s=n.value;n.value=function(...i){let a=Reflect.getMetadata(z0,this.constructor);if(Reflect.getMetadata(z0,this.constructor.prototype,t.toString())===!0||a===!0)return s?.apply(this,i);let[l,...c]=i;if(!l)return s?.apply(this,i);let f=EI(l,r),p=wV(f,{whitelist:!0});if(Ry(f),p.length){let d=Reflect.getMetadata(wI,this)??[];Reflect.defineMetadata(wI,d.concat(SI(p,s?.name)),this)}return s?.apply(this,[f,...c])}},"Validates");import"reflect-metadata";var cf=9e15,so=1e9,dA="0123456789abcdef",Py="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ky="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",mA={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-cf,maxE:cf,crypto:!1},bI,ra,ft=!0,Vy="[DecimalError] ",no=Vy+"Invalid argument: ",NI=Vy+"Precision limit exceeded",TI=Vy+"crypto unavailable",II="[object Decimal]",xn=Math.floor,Kr=Math.pow,SV=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,AV=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,CV=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,DI=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ws=1e7,it=7,xV=9007199254740991,bV=Py.length-1,gA=ky.length-1,Se={toStringTag:II};Se.absoluteValue=Se.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),Qe(r)};Se.ceil=function(){return Qe(new this.constructor(this),this.e+1,2)};Se.clampedTo=Se.clamp=function(r,e){var t,n=this,s=n.constructor;if(r=new s(r),e=new s(e),!r.s||!e.s)return new s(NaN);if(r.gt(e))throw Error(no+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};Se.comparedTo=Se.cmp=function(r){var e,t,n,s,i=this,a=i.d,o=(r=new i.constructor(r)).d,l=i.s,c=r.s;if(!a||!o)return!l||!c?NaN:l!==c?l:a===o?0:!a^l<0?1:-1;if(!a[0]||!o[0])return a[0]?l:o[0]?-c:0;if(l!==c)return l;if(i.e!==r.e)return i.e>r.e^l<0?1:-1;for(n=a.length,s=o.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==o[e])return a[e]>o[e]^l<0?1:-1;return n===s?0:n>s^l<0?1:-1};Se.cosine=Se.cos=function(){var r,e,t=this,n=t.constructor;return t.d?t.d[0]?(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+it,n.rounding=1,t=NV(n,PI(n,t)),n.precision=r,n.rounding=e,Qe(ra==2||ra==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};Se.cubeRoot=Se.cbrt=function(){var r,e,t,n,s,i,a,o,l,c,f=this,p=f.constructor;if(!f.isFinite()||f.isZero())return new p(f);for(ft=!1,i=f.s*Kr(f.s*f,1/3),!i||Math.abs(i)==1/0?(t=hn(f.d),r=f.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=Kr(t,1/3),r=xn((r+1)/3)-(r%3==(r<0?-1:2)),i==1/0?t="5e"+r:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+r),n=new p(t),n.s=f.s):n=new p(i.toString()),a=(r=p.precision)+3;;)if(o=n,l=o.times(o).times(o),c=l.plus(f),n=or(c.plus(f).times(o),c.plus(l),a+2,1),hn(o.d).slice(0,a)===(t=hn(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(Qe(o,r+1,0),o.times(o).times(o).eq(f))){n=o;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Qe(n,r+1,1),e=!n.times(n).times(n).eq(f));break}return ft=!0,Qe(n,r,p.rounding,e)};Se.decimalPlaces=Se.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-xn(this.e/it))*it,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};Se.dividedBy=Se.div=function(r){return or(this,new this.constructor(r))};Se.dividedToIntegerBy=Se.divToInt=function(r){var e=this,t=e.constructor;return Qe(or(e,new t(r),0,1,1),t.precision,t.rounding)};Se.equals=Se.eq=function(r){return this.cmp(r)===0};Se.floor=function(){return Qe(new this.constructor(this),this.e+1,3)};Se.greaterThan=Se.gt=function(r){return this.cmp(r)>0};Se.greaterThanOrEqualTo=Se.gte=function(r){var e=this.cmp(r);return e==1||e===0};Se.hyperbolicCosine=Se.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,o=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return o;t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,s=i.d.length,s<32?(r=Math.ceil(s/3),e=(1/Uy(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=ff(a,1,i.times(e),new a(1),!0);for(var l,c=r,f=new a(8);c--;)l=i.times(i),i=o.minus(l.times(f.minus(l.times(f))));return Qe(i,a.precision=t,a.rounding=n,!0)};Se.hyperbolicSine=Se.sinh=function(){var r,e,t,n,s=this,i=s.constructor;if(!s.isFinite()||s.isZero())return new i(s);if(e=i.precision,t=i.rounding,i.precision=e+Math.max(s.e,s.sd())+4,i.rounding=1,n=s.d.length,n<3)s=ff(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/Uy(5,r)),s=ff(i,2,s,s,!0);for(var a,o=new i(5),l=new i(16),c=new i(20);r--;)a=s.times(s),s=s.times(o.plus(a.times(l.times(a).plus(c))))}return i.precision=e,i.rounding=t,Qe(s,e,t,!0)};Se.hyperbolicTangent=Se.tanh=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+7,n.rounding=1,or(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};Se.inverseCosine=Se.acos=function(){var r=this,e=r.constructor,t=r.abs().cmp(1),n=e.precision,s=e.rounding;return t!==-1?t===0?r.isNeg()?mi(e,n,s):new e(0):new e(NaN):r.isZero()?mi(e,n+4,s).times(.5):(e.precision=n+6,e.rounding=1,r=new e(1).minus(r).div(r.plus(1)).sqrt().atan(),e.precision=n,e.rounding=s,r.times(2))};Se.inverseHyperbolicCosine=Se.acosh=function(){var r,e,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(r=n.precision,e=n.rounding,n.precision=r+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,ft=!1,t=t.times(t).minus(1).sqrt().plus(t),ft=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};Se.inverseHyperbolicSine=Se.asinh=function(){var r,e,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,ft=!1,t=t.times(t).plus(1).sqrt().plus(t),ft=!0,n.precision=r,n.rounding=e,t.ln())};Se.inverseHyperbolicTangent=Se.atanh=function(){var r,e,t,n,s=this,i=s.constructor;return s.isFinite()?s.e>=0?new i(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(r=i.precision,e=i.rounding,n=s.sd(),Math.max(n,r)<2*-s.e-1?Qe(new i(s),r,e,!0):(i.precision=t=n-s.e,s=or(s.plus(1),new i(1).minus(s),t+r,1),i.precision=r+4,i.rounding=1,s=s.ln(),i.precision=r,i.rounding=e,s.times(.5))):new i(NaN)};Se.inverseSine=Se.asin=function(){var r,e,t,n,s=this,i=s.constructor;return s.isZero()?new i(s):(e=s.abs().cmp(1),t=i.precision,n=i.rounding,e!==-1?e===0?(r=mi(i,t+4,n).times(.5),r.s=s.s,r):new i(NaN):(i.precision=t+6,i.rounding=1,s=s.div(new i(1).minus(s.times(s)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,s.times(2)))};Se.inverseTangent=Se.atan=function(){var r,e,t,n,s,i,a,o,l,c=this,f=c.constructor,p=f.precision,d=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&p+4<=gA)return a=mi(f,p+4,d).times(.25),a.s=c.s,a}else{if(!c.s)return new f(NaN);if(p+4<=gA)return a=mi(f,p+4,d).times(.5),a.s=c.s,a}for(f.precision=o=p+10,f.rounding=1,t=Math.min(28,o/it+2|0),r=t;r;--r)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(ft=!1,e=Math.ceil(o/it),n=1,l=c.times(c),a=new f(c),s=c;r!==-1;)if(s=s.times(l),i=a.minus(s.div(n+=2)),s=s.times(l),a=i.plus(s.div(n+=2)),a.d[e]!==void 0)for(r=e;a.d[r]===i.d[r]&&r--;);return t&&(a=a.times(2<<t-1)),ft=!0,Qe(a,f.precision=p,f.rounding=d,!0)};Se.isFinite=function(){return!!this.d};Se.isInteger=Se.isInt=function(){return!!this.d&&xn(this.e/it)>this.d.length-2};Se.isNaN=function(){return!this.s};Se.isNegative=Se.isNeg=function(){return this.s<0};Se.isPositive=Se.isPos=function(){return this.s>0};Se.isZero=function(){return!!this.d&&this.d[0]===0};Se.lessThan=Se.lt=function(r){return this.cmp(r)<0};Se.lessThanOrEqualTo=Se.lte=function(r){return this.cmp(r)<1};Se.logarithm=Se.log=function(r){var e,t,n,s,i,a,o,l,c=this,f=c.constructor,p=f.precision,d=f.rounding,g=5;if(r==null)r=new f(10),e=!0;else{if(r=new f(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new f(NaN);e=r.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new f(t&&!t[0]?-1/0:c.s!=1?NaN:t?0:1/0);if(e)if(t.length>1)i=!0;else{for(s=t[0];s%10===0;)s/=10;i=s!==1}if(ft=!1,o=p+g,a=ro(c,o),n=e?Ly(f,o+10):ro(r,o),l=or(a,n,o,1),J0(l.d,s=p,d))do if(o+=10,a=ro(c,o),n=e?Ly(f,o+10):ro(r,o),l=or(a,n,o,1),!i){+hn(l.d).slice(s+1,s+15)+1==1e14&&(l=Qe(l,p+1,0));break}while(J0(l.d,s+=10,d));return ft=!0,Qe(l,p,d)};Se.minus=Se.sub=function(r){var e,t,n,s,i,a,o,l,c,f,p,d,g=this,m=g.constructor;if(r=new m(r),!g.d||!r.d)return!g.s||!r.s?r=new m(NaN):g.d?r.s=-r.s:r=new m(r.d||g.s!==r.s?g:NaN),r;if(g.s!=r.s)return r.s=-r.s,g.plus(r);if(c=g.d,d=r.d,o=m.precision,l=m.rounding,!c[0]||!d[0]){if(d[0])r.s=-r.s;else if(c[0])r=new m(g);else return new m(l===3?-0:0);return ft?Qe(r,o,l):r}if(t=xn(r.e/it),f=xn(g.e/it),c=c.slice(),i=f-t,i){for(p=i<0,p?(e=c,i=-i,a=d.length):(e=d,t=f,a=c.length),n=Math.max(Math.ceil(o/it),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=c.length,a=d.length,p=n<a,p&&(a=n),n=0;n<a;n++)if(c[n]!=d[n]){p=c[n]<d[n];break}i=0}for(p&&(e=c,c=d,d=e,r.s=-r.s),a=c.length,n=d.length-a;n>0;--n)c[a++]=0;for(n=d.length;n>i;){if(c[--n]<d[n]){for(s=n;s&&c[--s]===0;)c[s]=Ws-1;--c[s],c[n]+=Ws}c[n]-=d[n]}for(;c[--a]===0;)c.pop();for(;c[0]===0;c.shift())--t;return c[0]?(r.d=c,r.e=Fy(c,t),ft?Qe(r,o,l):r):new m(l===3?-0:0)};Se.modulo=Se.mod=function(r){var e,t=this,n=t.constructor;return r=new n(r),!t.d||!r.s||r.d&&!r.d[0]?new n(NaN):!r.d||t.d&&!t.d[0]?Qe(new n(t),n.precision,n.rounding):(ft=!1,n.modulo==9?(e=or(t,r.abs(),0,3,1),e.s*=r.s):e=or(t,r,0,n.modulo,1),e=e.times(r),ft=!0,t.minus(e))};Se.naturalExponential=Se.exp=function(){return yA(this)};Se.naturalLogarithm=Se.ln=function(){return ro(this)};Se.negated=Se.neg=function(){var r=new this.constructor(this);return r.s=-r.s,Qe(r)};Se.plus=Se.add=function(r){var e,t,n,s,i,a,o,l,c,f,p=this,d=p.constructor;if(r=new d(r),!p.d||!r.d)return!p.s||!r.s?r=new d(NaN):p.d||(r=new d(r.d||p.s===r.s?p:NaN)),r;if(p.s!=r.s)return r.s=-r.s,p.minus(r);if(c=p.d,f=r.d,o=d.precision,l=d.rounding,!c[0]||!f[0])return f[0]||(r=new d(p)),ft?Qe(r,o,l):r;if(i=xn(p.e/it),n=xn(r.e/it),c=c.slice(),s=i-n,s){for(s<0?(t=c,s=-s,a=f.length):(t=f,n=i,a=c.length),i=Math.ceil(o/it),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=c.length,s=f.length,a-s<0&&(s=a,t=f,f=c,c=t),e=0;s;)e=(c[--s]=c[s]+f[s]+e)/Ws|0,c[s]%=Ws;for(e&&(c.unshift(e),++n),a=c.length;c[--a]==0;)c.pop();return r.d=c,r.e=Fy(c,n),ft?Qe(r,o,l):r};Se.precision=Se.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(no+r);return t.d?(e=BI(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Se.round=function(){var r=this,e=r.constructor;return Qe(new e(r),r.e+1,e.rounding)};Se.sine=Se.sin=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+Math.max(t.e,t.sd())+it,n.rounding=1,t=IV(n,PI(n,t)),n.precision=r,n.rounding=e,Qe(ra>2?t.neg():t,r,e,!0)):new n(NaN)};Se.squareRoot=Se.sqrt=function(){var r,e,t,n,s,i,a=this,o=a.d,l=a.e,c=a.s,f=a.constructor;if(c!==1||!o||!o[0])return new f(!c||c<0&&(!o||o[0])?NaN:o?a:1/0);for(ft=!1,c=Math.sqrt(+a),c==0||c==1/0?(e=hn(o),(e.length+l)%2==0&&(e+="0"),c=Math.sqrt(e),l=xn((l+1)/2)-(l<0||l%2),c==1/0?e="5e"+l:(e=c.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new f(e)):n=new f(c.toString()),t=(l=f.precision)+3;;)if(i=n,n=i.plus(or(a,i,t+2,1)).times(.5),hn(i.d).slice(0,t)===(e=hn(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(Qe(i,l+1,0),i.times(i).eq(a))){n=i;break}t+=4,s=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Qe(n,l+1,1),r=!n.times(n).eq(a));break}return ft=!0,Qe(n,l,f.rounding,r)};Se.tangent=Se.tan=function(){var r,e,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(r=n.precision,e=n.rounding,n.precision=r+10,n.rounding=1,t=t.sin(),t.s=1,t=or(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,Qe(ra==2||ra==4?t.neg():t,r,e,!0)):new n(NaN)};Se.times=Se.mul=function(r){var e,t,n,s,i,a,o,l,c,f=this,p=f.constructor,d=f.d,g=(r=new p(r)).d;if(r.s*=f.s,!d||!d[0]||!g||!g[0])return new p(!r.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?r.s/0:r.s*0);for(t=xn(f.e/it)+xn(r.e/it),l=d.length,c=g.length,l<c&&(i=d,d=g,g=i,a=l,l=c,c=a),i=[],a=l+c,n=a;n--;)i.push(0);for(n=c;--n>=0;){for(e=0,s=l+n;s>n;)o=i[s]+g[n]*d[s-n-1]+e,i[s--]=o%Ws|0,e=o/Ws|0;i[s]=(i[s]+e)%Ws|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=Fy(i,t),ft?Qe(r,p.precision,p.rounding):r};Se.toBinary=function(r,e){return vA(this,2,r,e)};Se.toDecimalPlaces=Se.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(jn(r,0,so),e===void 0?e=n.rounding:jn(e,0,8),Qe(t,r+t.e+1,e))};Se.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=gi(n,!0):(jn(r,0,so),e===void 0?e=s.rounding:jn(e,0,8),n=Qe(new s(n),r+1,e),t=gi(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Se.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=gi(s):(jn(r,0,so),e===void 0?e=i.rounding:jn(e,0,8),n=Qe(new i(s),r+s.e+1,e),t=gi(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Se.toFraction=function(r){var e,t,n,s,i,a,o,l,c,f,p,d,g=this,m=g.d,v=g.constructor;if(!m)return new v(g);if(c=t=new v(1),n=l=new v(0),e=new v(n),i=e.e=BI(m)-g.e-1,a=i%it,e.d[0]=Kr(10,a<0?it+a:a),r==null)r=i>0?e:c;else{if(o=new v(r),!o.isInt()||o.lt(c))throw Error(no+o);r=o.gt(e)?i>0?e:c:o}for(ft=!1,o=new v(hn(m)),f=v.precision,v.precision=i=m.length*it*2;p=or(o,e,0,1,1),s=t.plus(p.times(n)),s.cmp(r)!=1;)t=n,n=s,s=c,c=l.plus(p.times(s)),l=s,s=e,e=o.minus(p.times(s)),o=s;return s=or(r.minus(t),n,0,1,1),l=l.plus(s.times(c)),t=t.plus(s.times(n)),l.s=c.s=g.s,d=or(c,n,i,1).minus(g).abs().cmp(or(l,t,i,1).minus(g).abs())<1?[c,n]:[l,t],v.precision=f,ft=!0,d};Se.toHexadecimal=Se.toHex=function(r,e){return vA(this,16,r,e)};Se.toNearest=function(r,e){var t=this,n=t.constructor;if(t=new n(t),r==null){if(!t.d)return t;r=new n(1),e=n.rounding}else{if(r=new n(r),e===void 0?e=n.rounding:jn(e,0,8),!t.d)return r.s?t:r;if(!r.d)return r.s&&(r.s=t.s),r}return r.d[0]?(ft=!1,t=or(t,r,0,e,1).times(r),ft=!0,Qe(t)):(r.s=t.s,t=r),t};Se.toNumber=function(){return+this};Se.toOctal=function(r,e){return vA(this,8,r,e)};Se.toPower=Se.pow=function(r){var e,t,n,s,i,a,o=this,l=o.constructor,c=+(r=new l(r));if(!o.d||!r.d||!o.d[0]||!r.d[0])return new l(Kr(+o,c));if(o=new l(o),o.eq(1))return o;if(n=l.precision,i=l.rounding,r.eq(1))return Qe(o,n,i);if(e=xn(r.e/it),e>=r.d.length-1&&(t=c<0?-c:c)<=xV)return s=RI(l,o,t,n),r.s<0?new l(1).div(s):Qe(s,n,i);if(a=o.s,a<0){if(e<r.d.length-1)return new l(NaN);if((r.d[e]&1)==0&&(a=1),o.e==0&&o.d[0]==1&&o.d.length==1)return o.s=a,o}return t=Kr(+o,c),e=t==0||!isFinite(t)?xn(c*(Math.log("0."+hn(o.d))/Math.LN10+o.e+1)):new l(t+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(ft=!1,l.rounding=o.s=1,t=Math.min(12,(e+"").length),s=yA(r.times(ro(o,n+t)),n),s.d&&(s=Qe(s,n+5,1),J0(s.d,n,i)&&(e=n+10,s=Qe(yA(r.times(ro(o,e+t)),e),e+5,1),+hn(s.d).slice(n+1,n+15)+1==1e14&&(s=Qe(s,n+1,0)))),s.s=a,ft=!0,l.rounding=i,Qe(s,n,i))};Se.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=gi(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(jn(r,1,so),e===void 0?e=s.rounding:jn(e,0,8),n=Qe(new s(n),r,e),t=gi(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};Se.toSignificantDigits=Se.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(jn(r,1,so),e===void 0?e=n.rounding:jn(e,0,8)),Qe(new n(t),r,e)};Se.toString=function(){var r=this,e=r.constructor,t=gi(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};Se.truncated=Se.trunc=function(){return Qe(new this.constructor(this),this.e+1,1)};Se.valueOf=Se.toJSON=function(){var r=this,e=r.constructor,t=gi(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function hn(r){var e,t,n,s=r.length-1,i="",a=r[0];if(s>0){for(i+=a,e=1;e<s;e++)n=r[e]+"",t=it-n.length,t&&(i+=to(t)),i+=n;a=r[e],n=a+"",t=it-n.length,t&&(i+=to(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}u(hn,"digitsToString");function jn(r,e,t){if(r!==~~r||r<e||r>t)throw Error(no+r)}u(jn,"checkInt32");function J0(r,e,t,n){var s,i,a,o;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=it,s=0):(s=Math.ceil((e+1)/it),e%=it),i=Kr(10,it-e),o=r[s]%i|0,n==null?e<3?(e==0?o=o/100|0:e==1&&(o=o/10|0),a=t<4&&o==99999||t>3&&o==49999||o==5e4||o==0):a=(t<4&&o+1==i||t>3&&o+1==i/2)&&(r[s+1]/i/100|0)==Kr(10,e-2)-1||(o==i/2||o==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?o=o/1e3|0:e==1?o=o/100|0:e==2&&(o=o/10|0),a=(n||t<4)&&o==9999||!n&&t>3&&o==4999):a=((n||t<4)&&o+1==i||!n&&t>3&&o+1==i/2)&&(r[s+1]/i/1e3|0)==Kr(10,e-3)-1,a}u(J0,"checkRoundingDigits");function Oy(r,e,t){for(var n,s=[0],i,a=0,o=r.length;a<o;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=dA.indexOf(r.charAt(a++)),n=0;n<s.length;n++)s[n]>t-1&&(s[n+1]===void 0&&(s[n+1]=0),s[n+1]+=s[n]/t|0,s[n]%=t)}return s.reverse()}u(Oy,"convertBase");function NV(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/Uy(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=ff(r,1,e.times(s),new r(1));for(var i=t;i--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return r.precision-=t,e}u(NV,"cosine");var or=(function(){function r(n,s,i){var a,o=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+o,n[l]=a%i|0,o=a/i|0;return o&&n.unshift(o),n}u(r,"multiplyInteger");function e(n,s,i,a){var o,l;if(i!=a)l=i>a?1:-1;else for(o=l=0;o<i;o++)if(n[o]!=s[o]){l=n[o]>s[o]?1:-1;break}return l}u(e,"compare");function t(n,s,i,a){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return u(t,"subtract"),function(n,s,i,a,o,l){var c,f,p,d,g,m,v,y,S,C,w,E,A,b,V,I,D,U,F,M,se=n.constructor,ee=n.s==s.s?1:-1,ie=n.d,X=s.d;if(!ie||!ie[0]||!X||!X[0])return new se(!n.s||!s.s||(ie?X&&ie[0]==X[0]:!X)?NaN:ie&&ie[0]==0||!X?ee*0:ee/0);for(l?(g=1,f=n.e-s.e):(l=Ws,g=it,f=xn(n.e/g)-xn(s.e/g)),F=X.length,D=ie.length,S=new se(ee),C=S.d=[],p=0;X[p]==(ie[p]||0);p++);if(X[p]>(ie[p]||0)&&f--,i==null?(b=i=se.precision,a=se.rounding):o?b=i+(n.e-s.e)+1:b=i,b<0)C.push(1),m=!0;else{if(b=b/g+2|0,p=0,F==1){for(d=0,X=X[0],b++;(p<D||d)&&b--;p++)V=d*l+(ie[p]||0),C[p]=V/X|0,d=V%X|0;m=d||p<D}else{for(d=l/(X[0]+1)|0,d>1&&(X=r(X,d,l),ie=r(ie,d,l),F=X.length,D=ie.length),I=F,w=ie.slice(0,F),E=w.length;E<F;)w[E++]=0;M=X.slice(),M.unshift(0),U=X[0],X[1]>=l/2&&++U;do d=0,c=e(X,w,F,E),c<0?(A=w[0],F!=E&&(A=A*l+(w[1]||0)),d=A/U|0,d>1?(d>=l&&(d=l-1),v=r(X,d,l),y=v.length,E=w.length,c=e(v,w,y,E),c==1&&(d--,t(v,F<y?M:X,y,l))):(d==0&&(c=d=1),v=X.slice()),y=v.length,y<E&&v.unshift(0),t(w,v,E,l),c==-1&&(E=w.length,c=e(X,w,F,E),c<1&&(d++,t(w,F<E?M:X,E,l))),E=w.length):c===0&&(d++,w=[0]),C[p++]=d,c&&w[0]?w[E++]=ie[I]||0:(w=[ie[I]],E=1);while((I++<D||w[0]!==void 0)&&b--);m=w[0]!==void 0}C[0]||C.shift()}if(g==1)S.e=f,bI=m;else{for(p=1,d=C[0];d>=10;d/=10)p++;S.e=p+f*g-1,Qe(S,o?i+S.e+1:i,a,m)}return S}})();function Qe(r,e,t,n){var s,i,a,o,l,c,f,p,d,g=r.constructor;e:if(e!=null){if(p=r.d,!p)return r;for(s=1,o=p[0];o>=10;o/=10)s++;if(i=e-s,i<0)i+=it,a=e,f=p[d=0],l=f/Kr(10,s-a-1)%10|0;else if(d=Math.ceil((i+1)/it),o=p.length,d>=o)if(n){for(;o++<=d;)p.push(0);f=l=0,s=1,i%=it,a=i-it+1}else break e;else{for(f=o=p[d],s=1;o>=10;o/=10)s++;i%=it,a=i-it+s,l=a<0?0:f/Kr(10,s-a-1)%10|0}if(n=n||e<0||p[d+1]!==void 0||(a<0?f:f%Kr(10,s-a-1)),c=t<4?(l||n)&&(t==0||t==(r.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(i>0?a>0?f/Kr(10,s-a):0:p[d-1])%10&1||t==(r.s<0?8:7)),e<1||!p[0])return p.length=0,c?(e-=r.e+1,p[0]=Kr(10,(it-e%it)%it),r.e=-e||0):p[0]=r.e=0,r;if(i==0?(p.length=d,o=1,d--):(p.length=d+1,o=Kr(10,it-i),p[d]=a>0?(f/Kr(10,s-a)%Kr(10,a)|0)*o:0),c)for(;;)if(d==0){for(i=1,a=p[0];a>=10;a/=10)i++;for(a=p[0]+=o,o=1;a>=10;a/=10)o++;i!=o&&(r.e++,p[0]==Ws&&(p[0]=1));break}else{if(p[d]+=o,p[d]!=Ws)break;p[d--]=0,o=1}for(i=p.length;p[--i]===0;)p.pop()}return ft&&(r.e>g.maxE?(r.d=null,r.e=NaN):r.e<g.minE&&(r.e=0,r.d=[0])),r}u(Qe,"finalise");function gi(r,e,t){if(!r.isFinite())return _I(r);var n,s=r.e,i=hn(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+to(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+to(-s-1)+i,t&&(n=t-a)>0&&(i+=to(n))):s>=a?(i+=to(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+to(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=to(n))),i}u(gi,"finiteToString");function Fy(r,e){var t=r[0];for(e*=it;t>=10;t/=10)e++;return e}u(Fy,"getBase10Exponent");function Ly(r,e,t){if(e>bV)throw ft=!0,t&&(r.precision=t),Error(NI);return Qe(new r(Py),e,1,!0)}u(Ly,"getLn10");function mi(r,e,t){if(e>gA)throw Error(NI);return Qe(new r(ky),e,t,!0)}u(mi,"getPi");function BI(r){var e=r.length-1,t=e*it+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}u(BI,"getPrecision");function to(r){for(var e="";r--;)e+="0";return e}u(to,"getZeroString");function RI(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/it+4);for(ft=!1;;){if(t%2&&(i=i.times(e),CI(i.d,a)&&(s=!0)),t=xn(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),CI(e.d,a)}return ft=!0,i}u(RI,"intPow");function AI(r){return r.d[r.d.length-1]&1}u(AI,"isOdd");function OI(r,e,t){for(var n,s,i=new r(e[0]),a=0;++a<e.length;){if(s=new r(e[a]),!s.s){i=s;break}n=i.cmp(s),(n===t||n===0&&i.s===t)&&(i=s)}return i}u(OI,"maxOrMin");function yA(r,e){var t,n,s,i,a,o,l,c=0,f=0,p=0,d=r.constructor,g=d.rounding,m=d.precision;if(!r.d||!r.d[0]||r.e>17)return new d(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(ft=!1,l=m):l=e,o=new d(.03125);r.e>-2;)r=r.times(o),p+=5;for(n=Math.log(Kr(2,p))/Math.LN10*2+5|0,l+=n,t=i=a=new d(1),d.precision=l;;){if(i=Qe(i.times(r),l,1),t=t.times(++f),o=a.plus(or(i,t,l,1)),hn(o.d).slice(0,l)===hn(a.d).slice(0,l)){for(s=p;s--;)a=Qe(a.times(a),l,1);if(e==null)if(c<3&&J0(a.d,l-n,g,c))d.precision=l+=10,t=i=o=new d(1),f=0,c++;else return Qe(a,d.precision=m,g,ft=!0);else return d.precision=m,a}a=o}}u(yA,"naturalExponential");function ro(r,e){var t,n,s,i,a,o,l,c,f,p,d,g=1,m=10,v=r,y=v.d,S=v.constructor,C=S.rounding,w=S.precision;if(v.s<0||!y||!y[0]||!v.e&&y[0]==1&&y.length==1)return new S(y&&!y[0]?-1/0:v.s!=1?NaN:y?0:v);if(e==null?(ft=!1,f=w):f=e,S.precision=f+=m,t=hn(y),n=t.charAt(0),Math.abs(i=v.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)v=v.times(r),t=hn(v.d),n=t.charAt(0),g++;i=v.e,n>1?(v=new S("0."+t),i++):v=new S(n+"."+t.slice(1))}else return c=Ly(S,f+2,w).times(i+""),v=ro(new S(n+"."+t.slice(1)),f-m).plus(c),S.precision=w,e==null?Qe(v,w,C,ft=!0):v;for(p=v,l=a=v=or(v.minus(1),v.plus(1),f,1),d=Qe(v.times(v),f,1),s=3;;){if(a=Qe(a.times(d),f,1),c=l.plus(or(a,new S(s),f,1)),hn(c.d).slice(0,f)===hn(l.d).slice(0,f))if(l=l.times(2),i!==0&&(l=l.plus(Ly(S,f+2,w).times(i+""))),l=or(l,new S(g),f,1),e==null)if(J0(l.d,f-m,C,o))S.precision=f+=m,c=a=v=or(p.minus(1),p.plus(1),f,1),d=Qe(v.times(v),f,1),s=o=1;else return Qe(l,S.precision=w,C,ft=!0);else return S.precision=w,l;l=c,s+=2}}u(ro,"naturalLogarithm");function _I(r){return String(r.s*r.s/0)}u(_I,"nonFiniteToString");function _y(r,e){var t,n,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),n=0;e.charCodeAt(n)===48;n++);for(s=e.length;e.charCodeAt(s-1)===48;--s);if(e=e.slice(n,s),e){if(s-=n,r.e=t=t-n-1,r.d=[],n=(t+1)%it,t<0&&(n+=it),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=it;n<s;)r.d.push(+e.slice(n,n+=it));e=e.slice(n),n=it-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),ft&&(r.e>r.constructor.maxE?(r.d=null,r.e=NaN):r.e<r.constructor.minE&&(r.e=0,r.d=[0]))}else r.e=0,r.d=[0];return r}u(_y,"parseDecimal");function TV(r,e){var t,n,s,i,a,o,l,c,f;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),DI.test(e))return _y(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(AV.test(e))t=16,e=e.toLowerCase();else if(SV.test(e))t=2;else if(CV.test(e))t=8;else throw Error(no+e);for(i=e.search(/p/i),i>0?(l=+e.slice(i+1),e=e.substring(2,i)):e=e.slice(2),i=e.indexOf("."),a=i>=0,n=r.constructor,a&&(e=e.replace(".",""),o=e.length,i=o-i,s=RI(n,new n(t),i,i*2)),c=Oy(e,t,Ws),f=c.length-1,i=f;c[i]===0;--i)c.pop();return i<0?new n(r.s*0):(r.e=Fy(c,f),r.d=c,ft=!1,a&&(r=or(r,s,o*4)),l&&(r=r.times(Math.abs(l)<54?Kr(2,l):hf.pow(2,l))),ft=!0,r)}u(TV,"parseOther");function IV(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:ff(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/Uy(5,t)),e=ff(r,2,e,e);for(var s,i=new r(5),a=new r(16),o=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(o))));return e}u(IV,"sine");function ff(r,e,t,n,s){var i,a,o,l,c=1,f=r.precision,p=Math.ceil(f/it);for(ft=!1,l=t.times(t),o=new r(n);;){if(a=or(o.times(l),new r(e++*e++),f,1),o=s?n.plus(a):n.minus(a),n=or(a.times(l),new r(e++*e++),f,1),a=o.plus(n),a.d[p]!==void 0){for(i=p;a.d[i]===o.d[i]&&i--;);if(i==-1)break}i=o,o=n,n=a,a=i,c++}return ft=!0,a.d.length=p+1,a}u(ff,"taylorSeries");function Uy(r,e){for(var t=r;--e;)t*=r;return t}u(Uy,"tinyPow");function PI(r,e){var t,n=e.s<0,s=mi(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return ra=n?4:1,e;if(t=e.divToInt(s),t.isZero())ra=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return ra=AI(t)?n?2:3:n?4:1,e;ra=AI(t)?n?1:4:n?3:2}return e.minus(s).abs()}u(PI,"toLessThanHalfPi");function vA(r,e,t,n){var s,i,a,o,l,c,f,p,d,g=r.constructor,m=t!==void 0;if(m?(jn(t,1,so),n===void 0?n=g.rounding:jn(n,0,8)):(t=g.precision,n=g.rounding),!r.isFinite())f=_I(r);else{for(f=gi(r),a=f.indexOf("."),m?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(f=f.replace(".",""),d=new g(1),d.e=f.length-a,d.d=Oy(gi(d),10,s),d.e=d.d.length),p=Oy(f,10,s),i=l=p.length;p[--l]==0;)p.pop();if(!p[0])f=m?"0p+0":"0";else{if(a<0?i--:(r=new g(r),r.d=p,r.e=i,r=or(r,d,t,n,0,s),p=r.d,i=r.e,c=bI),a=p[t],o=s/2,c=c||p[t+1]!==void 0,c=n<4?(a!==void 0||c)&&(n===0||n===(r.s<0?3:2)):a>o||a===o&&(n===4||c||n===6&&p[t-1]&1||n===(r.s<0?8:7)),p.length=t,c)for(;++p[--t]>s-1;)p[t]=0,t||(++i,p.unshift(1));for(l=p.length;!p[l-1];--l);for(a=0,f="";a<l;a++)f+=dA.charAt(p[a]);if(m){if(l>1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)f+="0";for(p=Oy(f,s,e),l=p.length;!p[l-1];--l);for(a=1,f="1.";a<l;a++)f+=dA.charAt(p[a])}else f=f.charAt(0)+"."+f.slice(1);f=f+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)f="0"+f;f="0."+f}else if(++i>l)for(i-=l;i--;)f+="0";else i<l&&(f=f.slice(0,i)+"."+f.slice(i))}f=(e==16?"0x":e==2?"0b":e==8?"0o":"")+f}return r.s<0?"-"+f:f}u(vA,"toStringBinary");function CI(r,e){if(r.length>e)return r.length=e,!0}u(CI,"truncate");function DV(r){return new this(r).abs()}u(DV,"abs");function BV(r){return new this(r).acos()}u(BV,"acos");function RV(r){return new this(r).acosh()}u(RV,"acosh");function OV(r,e){return new this(r).plus(e)}u(OV,"add");function _V(r){return new this(r).asin()}u(_V,"asin");function PV(r){return new this(r).asinh()}u(PV,"asinh");function kV(r){return new this(r).atan()}u(kV,"atan");function LV(r){return new this(r).atanh()}u(LV,"atanh");function VV(r,e){r=new this(r),e=new this(e);var t,n=this.precision,s=this.rounding,i=n+4;return!r.s||!e.s?t=new this(NaN):!r.d&&!e.d?(t=mi(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?mi(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=mi(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(or(r,e,i,1)),e=mi(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(or(r,e,i,1)),t}u(VV,"atan2");function FV(r){return new this(r).cbrt()}u(FV,"cbrt");function UV(r){return Qe(r=new this(r),r.e+1,2)}u(UV,"ceil");function MV(r,e,t){return new this(r).clamp(e,t)}u(MV,"clamp");function jV(r){if(!r||typeof r!="object")throw Error(Vy+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,so,"rounding",0,8,"toExpNeg",-cf,0,"toExpPos",0,cf,"maxE",0,cf,"minE",-cf,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=mA[t]),(n=r[t])!==void 0)if(xn(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(no+t+": "+n);if(t="crypto",s&&(this[t]=mA[t]),(n=r[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(TI);else this[t]=!1;else throw Error(no+t+": "+n);return this}u(jV,"config");function qV(r){return new this(r).cos()}u(qV,"cos");function HV(r){return new this(r).cosh()}u(HV,"cosh");function kI(r){var e,t,n;function s(i){var a,o,l,c=this;if(!(c instanceof s))return new s(i);if(c.constructor=s,xI(i)){c.s=i.s,ft?!i.d||i.e>s.maxE?(c.e=NaN,c.d=null):i.e<s.minE?(c.e=0,c.d=[0]):(c.e=i.e,c.d=i.d.slice()):(c.e=i.e,c.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){c.s=1/i<0?-1:1,c.e=0,c.d=[0];return}if(i<0?(i=-i,c.s=-1):c.s=1,i===~~i&&i<1e7){for(a=0,o=i;o>=10;o/=10)a++;ft?a>s.maxE?(c.e=NaN,c.d=null):a<s.minE?(c.e=0,c.d=[0]):(c.e=a,c.d=[i]):(c.e=a,c.d=[i]);return}if(i*0!==0){i||(c.s=NaN),c.e=NaN,c.d=null;return}return _y(c,i.toString())}if(l==="string")return(o=i.charCodeAt(0))===45?(i=i.slice(1),c.s=-1):(o===43&&(i=i.slice(1)),c.s=1),DI.test(i)?_y(c,i):TV(c,i);if(l==="bigint")return i<0?(i=-i,c.s=-1):c.s=1,_y(c,i.toString());throw Error(no+i)}if(u(s,"Decimal"),s.prototype=Se,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=jV,s.clone=kI,s.isDecimal=xI,s.abs=DV,s.acos=BV,s.acosh=RV,s.add=OV,s.asin=_V,s.asinh=PV,s.atan=kV,s.atanh=LV,s.atan2=VV,s.cbrt=FV,s.ceil=UV,s.clamp=MV,s.cos=qV,s.cosh=HV,s.div=KV,s.exp=XV,s.floor=GV,s.hypot=$V,s.ln=WV,s.log=zV,s.log10=YV,s.log2=JV,s.max=QV,s.min=ZV,s.mod=e6,s.mul=t6,s.pow=r6,s.random=n6,s.round=s6,s.sign=i6,s.sin=a6,s.sinh=o6,s.sqrt=u6,s.sub=l6,s.sum=c6,s.tan=f6,s.tanh=h6,s.trunc=p6,r===void 0&&(r={}),r&&r.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<n.length;)r.hasOwnProperty(t=n[e++])||(r[t]=this[t]);return s.config(r),s}u(kI,"clone");function KV(r,e){return new this(r).div(e)}u(KV,"div");function XV(r){return new this(r).exp()}u(XV,"exp");function GV(r){return Qe(r=new this(r),r.e+1,3)}u(GV,"floor");function $V(){var r,e,t=new this(0);for(ft=!1,r=0;r<arguments.length;)if(e=new this(arguments[r++]),e.d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return ft=!0,new this(1/0);t=e}return ft=!0,t.sqrt()}u($V,"hypot");function xI(r){return r instanceof hf||r&&r.toStringTag===II||!1}u(xI,"isDecimalInstance");function WV(r){return new this(r).ln()}u(WV,"ln");function zV(r,e){return new this(r).log(e)}u(zV,"log");function JV(r){return new this(r).log(2)}u(JV,"log2");function YV(r){return new this(r).log(10)}u(YV,"log10");function QV(){return OI(this,arguments,-1)}u(QV,"max");function ZV(){return OI(this,arguments,1)}u(ZV,"min");function e6(r,e){return new this(r).mod(e)}u(e6,"mod");function t6(r,e){return new this(r).mul(e)}u(t6,"mul");function r6(r,e){return new this(r).pow(e)}u(r6,"pow");function n6(r){var e,t,n,s,i=0,a=new this(1),o=[];if(r===void 0?r=this.precision:jn(r,1,so),n=Math.ceil(r/it),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(n));i<n;)s=e[i],s>=429e7?e[i]=crypto.getRandomValues(new Uint32Array(1))[0]:o[i++]=s%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(n*=4);i<n;)s=e[i]+(e[i+1]<<8)+(e[i+2]<<16)+((e[i+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(e,i):(o.push(s%1e7),i+=4);i=n/4}else throw Error(TI);else for(;i<n;)o[i++]=Math.random()*1e7|0;for(n=o[--i],r%=it,n&&r&&(s=Kr(10,it-r),o[i]=(n/s|0)*s);o[i]===0;i--)o.pop();if(i<0)t=0,o=[0];else{for(t=-1;o[0]===0;t-=it)o.shift();for(n=1,s=o[0];s>=10;s/=10)n++;n<it&&(t-=it-n)}return a.e=t,a.d=o,a}u(n6,"random");function s6(r){return Qe(r=new this(r),r.e+1,this.rounding)}u(s6,"round");function i6(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}u(i6,"sign");function a6(r){return new this(r).sin()}u(a6,"sin");function o6(r){return new this(r).sinh()}u(o6,"sinh");function u6(r){return new this(r).sqrt()}u(u6,"sqrt");function l6(r,e){return new this(r).sub(e)}u(l6,"sub");function c6(){var r=0,e=arguments,t=new this(e[r]);for(ft=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return ft=!0,Qe(t,this.precision,this.rounding)}u(c6,"sum");function f6(r){return new this(r).tan()}u(f6,"tan");function h6(r){return new this(r).tanh()}u(h6,"tanh");function p6(r){return Qe(r=new this(r),r.e+1,1)}u(p6,"trunc");Se[Symbol.for("nodejs.util.inspect.custom")]=Se.toString;Se[Symbol.toStringTag]="Decimal";var hf=Se.constructor=kI(mA);Py=new hf(Py);ky=new hf(ky);var pf=class r extends hf{static{u(this,"Decimal")}static from(e){return new r(e)}static newOrZero(e){return e===void 0?r.from(0):r.from(e)}static newOrUndefined(e){if(e!==void 0)return r.from(e)}};import d6 from"pdfkit";var LI=class r{static{u(this,"PdfkitPdfBuilder")}defaults={autoFirstPage:!1};doc=new d6(this.defaults);constructor(e){e&&this.configure(e)}static new(e){return new r(e)}configure(e){return this.doc.options={...this.doc.options,...e},this}pipe(e){return this.doc.pipe(e),this}end(){return this.doc.end()}restore(){return this.doc.restore(),this}save(){return this.doc.save(),this}stroke(e){return this.doc.stroke(e),this}page(e){return this.doc.addPage(e),this}table(e){return this.doc.table(e),this}text(e,t){let{x:n,y:s,...i}=t??{};return n||s?(this.doc.text(e,n,s,i),this):(this.doc.text(e,t),this)}fontSize(e){return this.doc.fontSize(e),this}font(e,t,n){return typeof t=="string"?(this.doc.font(e,t,n),this):typeof t=="number"?(this.doc.font(e,t),this):(this.doc.font(e),this)}image(e,t,n,s){return typeof t=="number"&&typeof n=="number"?(this.doc.image(e,t,n,s),this):(this.doc.image(e,t),this)}rect(e,t,n,s){return this.doc.rect(e,t,n,s),this}path(e){return this.doc.path(e),this}translate(e,t){return this.doc.translate(e,t),this}scale(e,t){return this.doc.scale(e,t),this}fill(e,t){return this.doc.fill(e,t),this}pageWidth(){return this.doc.page.width}pageHeight(){return this.doc.page.height}heightOfString(e,t){return this.doc.heightOfString(e,t)}widthOfString(e,t){return this.doc.widthOfString(e,t)}pageMargins(){return this.doc.page.margins}currentLineHeight(e){return this.doc.currentLineHeight(e)}x(){return this.doc.x}y(){return this.doc.y}moveDown(e){return this.doc.moveDown(e),this}row(e,...t){let n,s;typeof e=="function"?(n={},s=[e,...t]):(n=e??{},s=t),n.columns??=1;let i=this.y(),a=n.right??0,o=n.left??0,l=n.gap??0,c=this.pageWidth(),f=c-o-a-l*(n.columns-1);n.size??=Array(n.columns).fill(12/n.columns);let p=[];for(let d=0;d<n.columns;d++){let g=n.size[d]/12;p[d]=f*g}for(let d=0,g=o;d<n.columns;d++){let m=d===n.columns-1,v=p[d];if(m&&n.columns>1){let C=c-a-g;C>0&&Math.abs(C-v)>.01&&(v=C)}let y={y:i,x:g,width:v};s[d](y),g+=v,l>0&&!m&&(g+=l)}return this}};var VI=class{static{u(this,"MemoryCacheAdapter")}cache=new Map;async get(e){return Promise.resolve(this.cache.get(e)??null)}has(e){return Promise.resolve(this.cache.has(e))}set(e,t){return this.cache.set(e,t),Promise.resolve(!0)}};var vo=Ty(ZB(),1);import p9 from"os";import uR from"fs";import d9 from"path";import pd from"crypto";var ZM=u(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),cs=u(r=>typeof r=="string"?rr(new Mt(r)):r instanceof Error?rr(new Mt(r.message,{cause:r.cause})):ZM(r)?rr(new Mt(r.message)):rr(new Mt("unexpected error")),"leftFromError");var vv=class{static{u(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};import{arch as i9,platform as aR}from"os";import{dirname as a9,join as o9,resolve as u9,normalize as l9,delimiter as c9}from"path";import{resolve as tR}from"path";import{createRequire as eR}from"module";import{fileURLToPath as e9,pathToFileURL as t9}from"url";var r9=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Df,rR=u(()=>{if(Df!==void 0)return Df;if(r9){Df=void 0;return}try{Df=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Df=void 0}return Df},"getImportMetaUrl"),nR=u(()=>{if(typeof st<"u")return st;let r=rR();if(r)return eR(r);let e=t9(tR(process.cwd(),"package.json")).href;return eR(e)},"getRequireFn"),sR=u(()=>{if(typeof __filename<"u")return __filename;let r=rR();return r?e9(r):tR(process.cwd())},"getCurrentFile");import{dirname as Ev,resolve as nl}from"path";import{existsSync as Bf}from"fs";var iR=u(()=>typeof process<"u"&&typeof process.versions<"u"&&"electron"in process.versions,"isElectron"),n9=u(()=>{if(!iR())return null;try{let e=st("electron").app;if(e?.getAppPath&&typeof e.getAppPath=="function")return{getAppPath:e.getAppPath}}catch{}return null},"getElectronApp"),s9=u(()=>{if(!iR())return null;let r=process;if(r.resourcesPath)return r.resourcesPath;let e=n9();if(e)try{let t=e.getAppPath();if(typeof t=="string")return Ev(t.replace(/\.asar$/,""))}catch{}return null},"getElectronResourcesPath"),SC=u((r,{onFound:e,onNotFound:t})=>{let n=s9();if(n){let c=nl(n,"node_modules","nfets",r);if(Bf(c))return e(c);let f=nl(n,"app.asar.unpacked","node_modules","nfets",r);if(Bf(f))return e(f)}let s=sR(),i=s.includes(".asar")?process.cwd():s,a=nl(i,"../../../../"),o=nl(a,r);if(Bf(o))return e(o);let l=i;for(let c=0;c<5;c++){let f=nl(l,r);if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}l=i;for(let c=0;c<5;c++){let f=nl(l,"node_modules","nfets",r);if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}l=i;for(let c=0;c<5;c++){let f=nl(l,r.replace(/^build\//,"Release/"));if(Bf(f))return e(f);let p=Ev(l);if(p===l)break;l=p}return t()},"search");var f9=u(r=>{let e=r.replace(/^\\\\\?\\/,"");return u9(l9(e))},"normalizePath"),h9=u(r=>{aR()==="win32"&&(process.env.PATH=`${a9(r)}${c9}${process.env.PATH}`)},"addAddonDirToPath"),AC=u(r=>{let e=f9(r);return h9(e),nR()(e)},"exportRequireModule"),Rf=u(r=>{if(r=`${r}.node`,process.env.NFETS_ADDONS_DIR)return AC(o9(process.env.NFETS_ADDONS_DIR,r));let e=`${aR()}-${i9()}`;try{return SC(`build/addons/${e}/${r}`,{onFound:u(t=>AC(t),"onFound"),onNotFound:u(()=>{throw new Error(`Addon ${e}/${r} not found`)},"onNotFound")})}catch{return SC(`build/Release/${r}`,{onFound:u(t=>AC(t),"onFound"),onNotFound:u(()=>{throw new Error(`Addon ${e}/${r} not found`)},"onNotFound")})}},"addon");var yo=class{static{u(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
83
+ `).reduce((i,a)=>{let[o,l]=a.split("=").map(c=>c.trim());return!o||!l?i:i.set(o,l)},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"),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 o=i[0].subarray(-4),l=o.subarray(-2);o[0]===48?l=o:o[1]===48&&(l=o.subarray(-3));let c=Buffer.concat([l,n,i[1]]),f=this.length(c),p=n.length,d=c.subarray(2+p,2+p+f),g=d.length-l.length-2;if(g<=0||g>d.length)return;let v=d.subarray(-g).toString("utf8");return v.substring(Buffer.from(v).findIndex((y,S)=>v.charCodeAt(S)>=32&&v.charCodeAt(S)<=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 wv=class{static{u(this,"WincryptSignerRepository")}async sign(e,t,n){try{let s=Rf("wincrypt_certificate_store"),i=new yo,{CN:a}=i.extractCertificateInfo(t.certificate),o=await s.sign(a??"",Buffer.from(e),n),l=Buffer.from(o).toString("base64");return await Promise.resolve(Hr(l))}catch(s){return Promise.resolve(cs(s))}}};import oR from"crypto";var Sv=class{static{u(this,"CryptoSignerRepository")}async sign(e,t,n){try{if(!t.privateKey)return rr(new Mt("Certificate private key not found"));let i=oR.sign(n,Buffer.from(e),{key:t.privateKey,padding:oR.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(Hr(i))}catch(s){return Promise.resolve(cs(s))}}};var lR=class{static{u(this,"NativeCertificateRepository")}httpClient;cache;signer;constructor(e,t=new vv,n=p9.platform()==="win32"?new wv:new Sv){this.httpClient=e,this.cache=t,this.signer=n}async read(e){try{let{password:t,pfxPathOrBase64:n,publicCertDerBase64:s}=e,i=s?.trim(),a=n?.trim();if(i&&a)return rr(new Mt("Use either pfxPathOrBase64 or publicCertDerBase64, not both"));if(i)try{let S=Buffer.from(i,"base64"),C=new pd.X509Certificate(S);return Hr({ca:[],password:t,certificate:C,privateKey:void 0})}catch(S){return cs(S)}if(!a)return rr(new Mt("Certificate path (pfxPathOrBase64) is required"));let o=await this.getPfxBuffer({...e,pfxPathOrBase64:a});if(o.isLeft())return o;let l=vo.default.asn1.fromDer(o.value.toString("binary")),c=vo.default.pkcs12.pkcs12FromAsn1(l,t),{certBag:f}=vo.default.pki.oids,d=c.getBags({bagType:f})[f];if(!d?.length)return rr(new Mt("Cannot read certificate"));let[{cert:g},...m]=d;if(!g)return rr(new Mt("Issuer Certificate not found"));let v=m.reduce((S,{cert:C})=>(C&&S.push(new pd.X509Certificate(vo.default.pki.certificateToPem(C))),S),[]),y=new pd.X509Certificate(vo.default.pki.certificateToPem(g));return Hr({ca:v,password:t,certificate:y,privateKey:this.getPrivateKey(c)})}catch(t){return cs(t)}}getPrivateKey(e){let{pkcs8ShroudedKeyBag:t}=vo.default.pki.oids,s=e.getBags({bagType:t})[t]?.[0]?.key;if(s)return pd.createPrivateKey(vo.default.pki.privateKeyToPem(s))}async sign(e,t,n=eo.SHA1){return this.signer.sign(e,t,n)}getCertificateInfo(e){return new yo().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"})}catch{throw new Mt("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 Hr(i);if(d9.isAbsolute(t)||uR.existsSync(t))return this.hitBufferOnCache(s,uR.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 cs(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return pd.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),Hr(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};import NG from"os";import CC from"dayjs";import m9 from"dayjs/plugin/utc.js";import g9 from"dayjs/plugin/timezone.js";CC.extend(m9);CC.extend(g9);var dd=CC;var hP=Ty(uP(),1);import{constants as TG}from"crypto";import{Agent as rb}from"https";var yG=new Set(["ENOTFOUND","EAI_AGAIN","EAI_FAIL","EAI_NONAME"]),vG=new Set(["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNABORTED"]),EG=u(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessage"),wG=u(r=>{if(!r||typeof r!="object"||!("code"in r))return;let{code:e}=r;return typeof e=="string"?e:void 0},"getCode"),SG=u(r=>{if(!r||typeof r!="object"||!("hostname"in r))return;let{hostname:e}=r;return typeof e=="string"?e:void 0},"getHostname"),tb=u(r=>{if(typeof r=="string")return r;if(r instanceof Error||EG(r))return r.message},"getMessage"),lP=u(r=>{let e=r.toLowerCase();return e.includes("timeout")||e.includes("timed out")||e.includes("time-out")},"isTimeoutMessage"),AG=u(r=>/getaddrinfo\s+ENOTFOUND/i.test(r)||/\bENOTFOUND\b/i.test(r),"isHostNotFoundMessage"),CG=u(r=>{let e=[],t=new Set,n=r;for(;n!=null&&!t.has(n);){if(t.add(n),e.push(n),n instanceof AggregateError)for(let i of n.errors)t.has(i)||e.push(i);n=n instanceof Error?n.cause:void 0}return e},"collectErrorChain"),qd=u(r=>r instanceof Error?{cause:r}:void 0,"errorOptions"),xG=u(r=>{let e=CG(r),t=tb(r)??e.map(tb).find(n=>!!n);for(let n of e){let s=wG(n);if(s&&yG.has(s))return rr(new $0(t??`Host not found (${SG(n)??s})`,qd(r)));if(s&&vG.has(s))return rr(new uf(t??"Transmission timeout",qd(r)));let i=tb(n);if(i&&lP(i))return rr(new uf(i,qd(r)))}return t?AG(t)?rr(new $0(t,qd(r))):lP(t)?rr(new uf(t,qd(r))):cs(r):cs(r)},"mapTransmissionError"),cP=u(r=>xG(r),"leftFromTransmissionError");import bG from"os";var _2=class r{static{u(this,"WinHttpClient")}certificate;interceptors={request:{use:u(()=>0,"use"),eject:u(()=>{},"eject"),clear:u(()=>{},"clear")},response:{use:u(()=>0,"use"),eject:u(()=>{},"eject"),clear:u(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(bG.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
84
+ `).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=Rf("winhttp_ssl_client"),{CN:i}=new yo().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var fP=class{static{u(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}validateCertificatePeriod(){if(!this.certificate)return Hr(void 0);let{certificate:e}=this.certificate,t=new Date;return t>new Date(e.validTo)?rr(new Mt(`Certificado expirado (${dd(e.validTo).format("DD/MM/YYYY")}). Renove o certificado.`)):t<new Date(e.validFrom)?rr(new Mt(`O certificado ainda n\xE3o est\xE1 v\xE1lido (${dd(e.validFrom).format("DD/MM/YYYY")}).`)):Hr(void 0)}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:TG.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new rb({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new rb({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new rb({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(e){let t=dI.create({timeout:e.timeout});return t.defaults.httpsAgent=this.httpsAgent,t}request(e){if(NG.platform()==="win32")try{return this.certificate?_2.create(this.certificate):this.getDefaultRequest({timeout:e.timeout})}catch{return this.getDefaultRequest({timeout:e.timeout})}return this.getDefaultRequest({timeout:e.timeout})}async send(e){let t=this.validateCertificatePeriod();if(t.isLeft())return t;try{let n=this.request({timeout:e.timeout}),s=await(0,hP.createClientAsync)(`${e.url}?wsdl`,{request:n,attributesKey:"$",wsdl_options:{request:n,timeout:e.timeout},forceSoap12Headers:!0});e.payload.$={xmlns:s.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),a=this.toolkit.getFirstNode(i)??"",o=e.xsd,l=await this.toolkit.validate(a,o);if(l.isLeft())return l;let[c]=await s[`${e.method}Async`]({_xml:i},{request:n,timeout:e.timeout});return Hr(c)}catch(n){return cP(n)}}};var IG=Rf("xml_validator"),pP=IG;var mQ=Ty(L4(),1);import dQ from"crypto";var V4="application/xml";var gt;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(gt||(gt={}));function DG(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}u(DG,"SelectNodesEx");function BG(r,e){let t=Zf("xpath").select;return t(e,r)}u(BG,"SelectNodesNode");var F4=typeof self<"u"?DG:BG;function Xd(r){r=r.replace(/\r\n/g,`
85
+ `).replace(/\r/g,`
86
+ `);let e;return typeof DOMParser<"u"?e=DOMParser:e=Zf("DOMParser"),new e().parseFromString(r,V4)}u(Xd,"Parse");function Qf(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Zf("XMLSerializer"),new e().serializeToString(r)}u(Qf,"Stringify");function J2(r,e){let t=F4(r,e);return t&&t.length>0?t[0]:null}u(J2,"SelectSingleNode");function U4(r,e){return r&&r.nodeType===e}u(U4,"isNodeType");function ps(r){return U4(r,gt.Element)}u(ps,"isElement");function ml(r){return U4(r,gt.Document)}u(ml,"isDocument");var M4=new Map;function j4(r){for(let e in r)M4.set(e,r[e])}u(j4,"setNodeDependencies");function Zf(r){let e=M4.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}u(Zf,"getNodeDependency");var Gd="element",$d="attribute",Y2="content";var RG=1e9;function pb(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}u(pb,"assign");function yt(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=pb({},t.items)),t.target=e}}u(yt,"XmlElement");function Nt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=pb({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||RG,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,o=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||o||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:Gd},H4(e,s,r)}}u(Nt,"XmlChildElement");function pr(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,s=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=pb({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=$d,H4(e,s,r)}}u(pr,"XmlAttribute");function H4(r,e,t){let n=`_${e}`,s={set:u(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:u(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}u(H4,"defineProperty");var ko=class r{static{u(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function OG(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}u(OG,"printf");function _G(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}u(_G,"padNum");var De=class{static{u(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=OG(Fr[e],...t);this.message=`${this.prefix}${_G(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},ye;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(ye||(ye={}));var Fr={};Fr[ye.NONE]="No description";Fr[ye.NULL_REFERENCE]="Null reference";Fr[ye.NULL_PARAM]="'%1' has empty '%2' object";Fr[ye.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";Fr[ye.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";Fr[ye.METHOD_NOT_IMPLEMENTED]="Method is not implemented";Fr[ye.METHOD_NOT_SUPPORTED]="Method is not supported";Fr[ye.PARAM_REQUIRED]="Required parameter is missing '%1'";Fr[ye.CONVERTER_UNSUPPORTED]="Converter is not supported";Fr[ye.ELEMENT_MALFORMED]="Malformed element '%1'";Fr[ye.ELEMENT_MISSING]="Element '%1' is missing in '%2'";Fr[ye.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";Fr[ye.CONTENT_MISSING]="Content is missing in '%1'";Fr[ye.CRYPTOGRAPHIC]="Cryptographic error: %1";Fr[ye.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";Fr[ye.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";Fr[ye.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";Fr[ye.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";Fr[ye.XML_EXCEPTION]="XML exception: %1";Fr[ye.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var zt=class{static{u(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new De(ye.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new De(ye.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new De(ye.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new De(ye.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let s=0;s<e.length;s++){let i=e[s].toString(16);n.push(i.length===1?"0"+i:i)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let s=e.slice(n,n+2);t[n/2]=parseInt(s,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var Os={get:u(r=>{if(r)return zt.ToBase64(r)},"get"),set:u(r=>zt.FromBase64(r),"set")},Wd={get:u(r=>r?r.toString():"0","get"),set:u(r=>Number(r),"set")};var PG="xml_root",Yn=class r{static{u(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new De(ye.ELEMENT_MISSING,t,e.localName);return s[0]||null}static GetAttribute(e,t,n,s=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(s)throw new De(ye.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return ml(e)&&(n=e.getElementById(t)),n==null&&(n=J2(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=J2(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=J2(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=PG,t=null,n=null){if(n&&!t)throw new De(ye.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let o=`${s}${e}`;return Xd(`<${o}${a}></${o}>`)}static GetChildren(e,t,n){e=ml(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];ps(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=ml(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(ps(i)&&i.localName===t&&(i.namespaceURI===n||!n))return i}return null}static GetChild(e,t,n,s=!0){for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(ps(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new De(ye.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let o in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,o))continue;let l=t[o],c=i.items[o];switch(c.type){case Y2:{let f=c,p=f.converter?f.converter.get(l):l;if(f.required&&p==null)throw new De(ye.CONTENT_MISSING,a);(f.defaultValue!==l||f.required)&&(s.textContent=p);break}case $d:{let f=c,p=f.converter?f.converter.get(l):l;if(f.required&&p==null)throw new De(ye.ATTRIBUTE_MISSING,f.localName,a);(f.defaultValue!==l||f.required)&&(f.namespaceURI?s.setAttributeNS(f.namespaceURI,f.localName||"",p):s.setAttribute(f.localName||"",p));break}case Gd:{let f=c,p=null;if(f.parser){if(f.required&&!l||f.minOccurs&&!l.Count){let d=l?.localName||f.localName;throw new De(ye.ELEMENT_MISSING,d,a)}l&&(p=l.GetXml(l.element===void 0&&(f.required||l.Count)))}else{let d=f.converter?f.converter.get(l):l;if(f.required&&d===void 0)throw new De(ye.ELEMENT_MISSING,f.localName,a);if(l!==f.defaultValue||f.required)if(f.namespaceURI?p=n.createElementNS(f.namespaceURI,`${f.prefix?f.prefix+":":""}${f.localName}`):p=n.createElement(`${f.prefix?f.prefix+":":""}${f.localName}`),Array.isArray(d))for(let g of d){let m=g instanceof r?g.GetXml(!0):g;m!==null&&p&&p.appendChild(m)}else if(d instanceof r){let g=d.GetXml(!0);g&&p&&p.appendChild(g)}else p&&(p.textContent=d)}if(p)if(f.noRoot){let d=[];for(let v=0;v<p.childNodes.length;v++){let y=p.childNodes.item(v);ps(y)&&d.push(y)}let g=f.minOccurs||0,m=f.maxOccurs||1/0;if(d.length<g||d.length>m)throw new De(ye.COLLECTION_LIMIT,l.localName,i.localName);d.forEach(v=>s.appendChild(v.cloneNode(!0)))}else{if(p.childNodes.length<(f.minOccurs||0)||p.childNodes.length>(f.maxOccurs||1/0))throw new De(ye.COLLECTION_LIMIT,l.localName,i.localName);s.appendChild(p)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Xd(e).documentElement:t=e,!t)throw new De(ye.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new De(ye.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let o=s.items[a];switch(o.type){case Y2:{let l=o;if(l.required&&!t.textContent)throw new De(ye.CONTENT_MISSING,i);if(!t.textContent)n[a]=l.defaultValue;else{let c=l.converter?l.converter.set(t.textContent):t.textContent;n[a]=c}break}case $d:{let l=o,c,f;if(!l.localName)throw new De(ye.PARAM_REQUIRED,"localName");if(l.namespaceURI?(c=t.hasAttributeNS.bind(t,l.namespaceURI,l.localName),f=t.getAttributeNS.bind(t,l.namespaceURI,l.localName)):(c=t.hasAttribute.bind(t,l.localName),f=t.getAttribute.bind(t,l.localName)),l.required&&!c())throw new De(ye.ATTRIBUTE_MISSING,l.localName,i);if(!c())n[a]=l.defaultValue;else{let p=f(),d=l.converter&&p?l.converter.set(p):p;n[a]=d}break}case Gd:{let l=o;if(l.noRoot){if(!l.parser)throw new De(ye.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser'`);let f=new l.parser;if(!(f instanceof eh))throw new De(ye.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);f.OnLoadXml(t),delete f.element;let p=l.minOccurs||0,d=l.maxOccurs||1/0;if(f.Count<p||f.Count>d)throw new De(ye.COLLECTION_LIMIT,l.parser.localName,i);n[a]=f;continue}let c=null;for(let f=0;f<t.childNodes.length;f++){let p=t.childNodes.item(f);if(!ps(p))continue;let d=p;if(d.localName===l.localName&&d.namespaceURI==l.namespaceURI){c=d;break}}if(l.required&&!c)throw new De(ye.ELEMENT_MISSING,l.parser?l.parser.localName:l.localName,i);if(l.parser){if(c){let f=new l.parser;f.localName=l.localName,f.namespaceURI=l.namespaceURI,n[a]=f,f.LoadXml(c)}}else if(!c)n[a]=l.defaultValue;else{let f=c.textContent||"",p=l.converter?l.converter.set(f):f;n[a]=p}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Qf(e):""}GetElement(e,t=!0){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new De(ye.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let o=this.CreateDocument();if(o)e=o;else throw new De(ye.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,s=s||this.prefix;let i=(s?`${s}:`:"")+t,a=n&&e?e.createElementNS(n,i):e?.createElement(i);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var eh=class extends Yn{static{u(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new ko(this.GetIterator().map(e))}Filter(e){return new ko(this.GetIterator().filter(e))}Sort(e){return new ko(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new De(ye.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let s=e.childNodes.item(n);if(!(ps(s)&&s.localName===t.parser.localName&&s.namespaceURI==t.namespaceURI))continue;let i=s,a=new t.parser;a.LoadXml(i),this.Add(a)}}};var th=class extends ko{static{u(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var kG="[object ArrayBuffer]",Ye=class gb{static{u(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===kG}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=gb.toUint8Array(e),s=gb.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let o=this.toUint8Array(a);s.set(o,i),i+=o.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},mb="string",LG=/^[0-9a-f\s]+$/i,VG=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,FG=/^[a-zA-Z0-9-_]+$/,K4=class{static{u(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=Ye.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},Li=class{static{u(this,"Utf16Converter")}static toString(e,t=!1){let n=Ye.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let o=s.getUint16(a,t);i+=String.fromCharCode(o)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},at=class rh{static{u(this,"Convert")}static isHex(e){return typeof e===mb&&LG.test(e)}static isBase64(e){return typeof e===mb&&VG.test(e)}static isBase64Url(e){return typeof e===mb&&FG.test(e)}static ToString(e,t="utf8"){let n=Ye.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return Li.toString(n,!0);case"utf16":case"utf16be":return Li.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Li.fromString(e,!0);case"utf16":case"utf16be":return Li.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=Ye.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!rh.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!rh.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=rh.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return K4.fromString(e);case"utf16":case"utf16be":return Li.fromString(e);case"utf16le":case"usc2":return Li.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=rh.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return K4.toString(e);case"utf16":case"utf16be":return Li.toString(e);case"utf16le":case"usc2":return Li.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n.buffer}static ToBinary(e){let t=Ye.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=Ye.toUint8Array(e),n="",s=t.length;for(let i=0;i<s;i++){let a=t[i];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!rh.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let s=0;s<t.length;s=s+2){let i=t.slice(s,s+2);n[s/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,t=!1){return Li.toString(e,t)}static FromUtf16String(e,t=!1){return Li.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};at.DEFAULT_UTF8_ENCODING="utf8";function T(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}u(T,"getParametersValue");function Q2(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}u(Q2,"bufferToHexCodes");function va(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}u(va,"utilFromBase");function ei(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let o=1;o<8;o++){if(r<a){let l;if(n<0)l=new ArrayBuffer(o),i=o;else{if(n<o)return new ArrayBuffer(0);l=new ArrayBuffer(n),i=n}let c=new Uint8Array(l);for(let f=o-1;f>=0;f--){let p=Math.pow(2,f*e);c[i-f-1]=Math.floor(s/p),s-=c[i-f-1]*p}return l}a*=Math.pow(2,e)}return new ArrayBuffer(0)}u(ei,"utilToBase");function gl(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}u(gl,"utilConcatBuf");function Z2(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}u(Z2,"utilConcatView");function yb(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let o=r[0]===255&&r[1]&128,l=r[0]===0&&(r[1]&128)===0;(o||l)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let o=0;o<this.valueHex.byteLength;o++)t[o]=0;t[0]=r[0]&128;let n=va(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let o=0;o<this.valueHex.byteLength;o++)i[o]=r[o];return i[0]&=127,va(i,8)-n}u(yb,"utilDecodeTC");function G4(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,o=ei(a,8,n),l=new Uint8Array(o);return l[0]|=128,o}let s=ei(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),o=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let l=0;l<a.byteLength;l++)i[l+1]=o[l];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}u(G4,"utilEncodeTC");function Lo(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}u(Lo,"isEqualBuffer");function Qn(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}u(Qn,"padNumber");var $4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",W4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function eE(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,o="",l=e?W4:$4;if(n){let c=0;for(let f=0;f<r.length;f++)if(r.charCodeAt(f)!==0){c=f;break}r=r.slice(c)}for(;s<r.length;){let c=r.charCodeAt(s++);s>=r.length&&(i=1);let f=r.charCodeAt(s++);s>=r.length&&(a=1);let p=r.charCodeAt(s++),d=c>>2,g=(c&3)<<4|f>>4,m=(f&15)<<2|p>>6,v=p&63;i===1?m=v=64:a===1&&(v=64),t?m===64?o+=`${l.charAt(d)}${l.charAt(g)}`:v===64?o+=`${l.charAt(d)}${l.charAt(g)}${l.charAt(m)}`:o+=`${l.charAt(d)}${l.charAt(g)}${l.charAt(m)}${l.charAt(v)}`:o+=`${l.charAt(d)}${l.charAt(g)}${l.charAt(m)}${l.charAt(v)}`}return o}u(eE,"toBase64");function nh(r,e=!1,t=!1){let n=e?W4:$4;function s(l){for(let c=0;c<64;c++)if(n.charAt(c)===l)return c;return 64}u(s,"indexOf");function i(l){return l===64?0:l}u(i,"test");let a=0,o="";for(;a<r.length;){let l=s(r.charAt(a++)),c=a>=r.length?0:s(r.charAt(a++)),f=a>=r.length?0:s(r.charAt(a++)),p=a>=r.length?0:s(r.charAt(a++)),d=i(l)<<2|i(c)>>4,g=(i(c)&15)<<4|i(f)>>2,m=(i(f)&3)<<6|i(p);o+=String.fromCharCode(d),f!==64&&(o+=String.fromCharCode(g)),p!==64&&(o+=String.fromCharCode(m))}if(t){let l=o.length,c=-1;for(let f=l-1;f>=0;f--)if(o.charCodeAt(f)!==0){c=f;break}c!==-1?o=o.slice(0,c+1):o=""}return o}u(nh,"fromBase64");function zd(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}u(zd,"arrayBufferToString");function yl(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}u(yl,"stringToArrayBuffer");var UG=Math.log(2);function z4(r){let e=Math.log(r)/UG,t=Math.floor(e),n=Math.round(e);return t===n?t:n}u(z4,"nearestPowerOf2");function we(r,e){for(let t of e)delete r[t]}u(we,"clearProps");function tE(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}u(tE,"assertBigInt");function Sb(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}u(Sb,"concat");function Ea(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}u(Ea,"checkBufferParams");var Ab=class{static{u(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Sb(this.items)}},Jd=[new Uint8Array([1])],Y4="0123456789",vb="name",Q4="valueHexView",MG="isHexOnly",jG="idBlock",qG="tagClass",HG="tagNumber",KG="isConstructed",XG="fromBER",GG="toBER",$G="local",Zn="",Vi=new ArrayBuffer(0),rE=new Uint8Array(0),Qd="EndOfContent",ek="OCTET STRING",tk="BIT STRING";function wa(r){var e;return e=class extends r{static{u(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?Ye.toUint8Array(i.valueHex):rE}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!Ea(this,a,s,i))return-1;let o=s+i;return this.valueHexView=a.subarray(s,o),this.valueHexView.length?(this.blockLength=i,o):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Vi)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:at.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}u(wa,"HexBlock");var vl=class{static{u(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Zn,warnings:n=[],valueBeforeDecode:s=rE}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=Ye.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:at.ToHex(this.valueBeforeDecodeView)}}};vl.NAME="baseBlock";var es=class extends vl{static{u(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};es.NAME="valueBlock";var rk=class extends wa(vl){static{u(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?Ye.toUint8Array(e.valueHex):rE,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(s=e.tagNumber)!==null&&s!==void 0?s:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Vi}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let s=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,t|=i,s[0]=t}return s.buffer}if(!this.isHexOnly){let s=ei(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,o=new Uint8Array(a+1);if(o[0]=t|31,!e){for(let l=0;l<a-1;l++)o[l+1]=i[l]|128;o[a]=i[a-1]}return o.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=Ye.toUint8Array(e);if(!Ea(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let o=i[0]&31;if(o!==31)this.tagNumber=o,this.blockLength=1;else{let l=1,c=this.valueHexView=new Uint8Array(255),f=255;for(;i[l]&128;){if(c[l-1]=i[l]&127,l++,l>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(l===f){f+=255;let d=new Uint8Array(f);for(let g=0;g<c.length;g++)d[g]=c[g];c=this.valueHexView=new Uint8Array(f)}}this.blockLength=l+1,c[l-1]=i[l]&127;let p=new Uint8Array(l);for(let d=0;d<l;d++)p[d]=c[d];c=this.valueHexView=new Uint8Array(l),c.set(p),this.blockLength<=9?this.tagNumber=va(c,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};rk.NAME="identificationBlock";var nk=class extends vl{static{u(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=Ye.toUint8Array(e);if(!Ea(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let o=t+1,l=s.subarray(o,o+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=va(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let s=ei(this.length,8);if(s.byteLength>127)return this.error="Too big length",Vi;if(t=new ArrayBuffer(s.byteLength+1),e)return t;let i=new Uint8Array(s);n=new Uint8Array(t),n[0]=s.byteLength|128;for(let a=0;a<s.byteLength;a++)n[a+1]=i[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};nk.NAME="lengthBlock";var Ge={},Vn=class extends vl{static{u(this,"BaseBlock")}constructor({name:e=Zn,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new rk(s),this.lenBlock=new nk(s),this.valueBlock=i?new i(s):new es(s)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new Ab;t||sk(this);let s=this.idBlock.toBER(e);if(n.write(s),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(i)}return t?Vi:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():at.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=at.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Lo(t,n)}};Vn.NAME="BaseBlock";function sk(r){var e;if(r instanceof Ge.Constructed)for(let t of r.valueBlock.value)sk(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}u(sk,"prepareIndefiniteForm");var ik=class extends Vn{static{u(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Zn,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};ik.NAME="BaseStringBlock";var ak=class extends wa(es){static{u(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};ak.NAME="PrimitiveValueBlock";var ok,Ze=class extends Vn{static{u(this,"Primitive")}constructor(e={}){super(e,ak),this.idBlock.isConstructed=!1}};ok=Ze;Ge.Primitive=ok;Ze.NAME="PRIMITIVE";function WG(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}u(WG,"localChangeType");function Zd(r,e=0,t=r.length){let n=e,s=new Vn({},es),i=new vl;if(!Ea(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let o=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),o===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=o,t-=s.idBlock.blockLength,o=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),o===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=o,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let l=Vn;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};l=Ge.EndOfContent;break;case 1:l=Ge.Boolean;break;case 2:l=Ge.Integer;break;case 3:l=Ge.BitString;break;case 4:l=Ge.OctetString;break;case 5:l=Ge.Null;break;case 6:l=Ge.ObjectIdentifier;break;case 10:l=Ge.Enumerated;break;case 12:l=Ge.Utf8String;break;case 13:l=Ge.RelativeObjectIdentifier;break;case 14:l=Ge.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:l=Ge.Sequence;break;case 17:l=Ge.Set;break;case 18:l=Ge.NumericString;break;case 19:l=Ge.PrintableString;break;case 20:l=Ge.TeletexString;break;case 21:l=Ge.VideotexString;break;case 22:l=Ge.IA5String;break;case 23:l=Ge.UTCTime;break;case 24:l=Ge.GeneralizedTime;break;case 25:l=Ge.GraphicString;break;case 26:l=Ge.VisibleString;break;case 27:l=Ge.GeneralString;break;case 28:l=Ge.UniversalString;break;case 29:l=Ge.CharacterString;break;case 30:l=Ge.BmpString;break;case 31:l=Ge.DATE;break;case 32:l=Ge.TimeOfDay;break;case 33:l=Ge.DateTime;break;case 34:l=Ge.Duration;break;default:{let c=s.idBlock.isConstructed?new Ge.Constructed:new Ge.Primitive;c.idBlock=s.idBlock,c.lenBlock=s.lenBlock,c.warnings=s.warnings,s=c}}break;case 2:case 3:case 4:default:l=s.idBlock.isConstructed?Ge.Constructed:Ge.Primitive}return s=WG(s,l),o=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:o,result:s}}u(Zd,"localFromBER");function Ar(r){if(!r.byteLength){let e=new Vn({},es);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Zd(Ye.toUint8Array(r).slice(),0,r.byteLength)}u(Ar,"fromBER");function zG(r,e){return r?1:e}u(zG,"checkLen");var Vo=class extends es{static{u(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=Ye.toUint8Array(e);if(!Ea(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;zG(this.isIndefiniteForm,n)>0;){let a=Zd(s,i,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Qd)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Qd?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new Ab;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?Vi:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Vo.NAME="ConstructedValueBlock";var uk,re=class extends Vn{static{u(this,"Constructed")}constructor(e={}){super(e,Vo),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
87
+ `).map(s=>` ${s}`).join(`
88
+ `));let t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
89
+ ${e.join(`
90
+ `)}`:`${t} :`}};uk=re;Ge.Constructed=uk;re.NAME="CONSTRUCTED";var lk=class extends es{static{u(this,"LocalEndOfContentValueBlock")}fromBER(e,t,n){return t}toBER(e){return Vi}};lk.override="EndOfContentValueBlock";var ck,fk=class extends Vn{static{u(this,"EndOfContent")}constructor(e={}){super(e,lk),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};ck=fk;Ge.EndOfContent=ck;fk.NAME=Qd;var hk,Cr=class extends Vn{static{u(this,"Null")}constructor(e={}){super(e,es),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){let n=new ArrayBuffer(2);if(!e){let s=new Uint8Array(n);s[0]=5,s[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}};hk=Cr;Ge.Null=hk;Cr.NAME="NULL";var pk=class extends wa(es){static{u(this,"LocalBooleanValueBlock")}get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=Ye.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,n){let s=Ye.toUint8Array(e);return Ea(this,s,t,n)?(this.valueHexView=s.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,yb.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};pk.NAME="BooleanValueBlock";var dk,ti=class extends Vn{static{u(this,"Boolean")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,pk),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};dk=ti;Ge.Boolean=dk;ti.NAME="BOOLEAN";var mk=class extends wa(Vo){static{u(this,"LocalOctetStringValueBlock")}constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n){let s=0;if(this.isConstructed){if(this.isHexOnly=!1,s=Vo.prototype.fromBER.call(this,e,t,n),s===-1)return s;for(let i=0;i<this.value.length;i++){let a=this.value[i].constructor.NAME;if(a===Qd){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==ek)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,s=super.fromBER(e,t,n),this.blockLength=n;return s}toBER(e,t){return this.isConstructed?Vo.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};mk.NAME="OctetStringValueBlock";var Cb,Ne=class extends Vn{static{u(this,"OctetString")}constructor({idBlock:e={},lenBlock:t={},...n}={}){var s,i;(s=n.isConstructed)!==null&&s!==void 0||(n.isConstructed=!!(!((i=n.value)===null||i===void 0)&&i.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},mk),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){let i=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+n);try{if(i.byteLength){let a=Zd(i,0,i.byteLength);a.offset!==-1&&a.offset===n&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return re.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,t=at.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof Cb&&e.push(t.valueBlock.valueHexView);return Ye.concat(e)}};Cb=Ne;Ge.OctetString=Cb;Ne.NAME=ek;var gk=class extends wa(Vo){static{u(this,"LocalBitStringValueBlock")}constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n){if(!n)return t;let s=-1;if(this.isConstructed){if(s=Vo.prototype.fromBER.call(this,e,t,n),s===-1)return s;for(let o of this.value){let l=o.constructor.NAME;if(l===Qd){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==tk)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let c=o.valueBlock;if(this.unusedBits>0&&c.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=c.unusedBits}return s}let i=Ye.toUint8Array(e);if(!Ea(this,i,t,n))return-1;let a=i.subarray(t,t+n);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let o=a.subarray(1);try{if(o.byteLength){let l=Zd(o,0,o.byteLength);l.offset!==-1&&l.offset===n-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,t+n}toBER(e,t){if(this.isConstructed)return Vo.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){let s=new Uint8Array(1);return s[0]=0,s.buffer}let n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};gk.NAME="BitStringValueBlock";var yk,At=class extends Vn{static{u(this,"BitString")}constructor({idBlock:e={},lenBlock:t={},...n}={}){var s,i;(s=n.isConstructed)!==null&&s!==void 0||(n.isConstructed=!!(!((i=n.value)===null||i===void 0)&&i.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},gk),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return re.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let a of t)e.push(a.toString(2).padStart(8,"0"));let n=e.join(""),s=this.constructor.NAME,i=n.substring(0,n.length-this.valueBlock.unusedBits);return`${s} : ${i}`}}};yk=At;Ge.BitString=yk;At.NAME=tk;var vk;function JG(r,e){let t=new Uint8Array([0]),n=new Uint8Array(r),s=new Uint8Array(e),i=n.slice(0),a=i.length-1,o=s.slice(0),l=o.length-1,c=0,f=l<a?a:l,p=0;for(let d=f;d>=0;d--,p++){switch(!0){case p<o.length:c=i[a-p]+o[l-p]+t[0];break;default:c=i[a-p]+t[0]}switch(t[0]=c/10,!0){case p>=i.length:i=Z2(new Uint8Array([c%10]),i);break;default:i[a-p]=c%10}}return t[0]>0&&(i=Z2(t,i)),i}u(JG,"viewAdd");function Z4(r){if(r>=Jd.length)for(let e=Jd.length;e<=r;e++){let t=new Uint8Array([0]),n=Jd[e-1].slice(0);for(let s=n.length-1;s>=0;s--){let i=new Uint8Array([(n[s]<<1)+t[0]]);t[0]=i[0]/10,n[s]=i[0]%10}t[0]>0&&(n=Z2(t,n)),Jd.push(n)}return Jd[r]}u(Z4,"power2");function YG(r,e){let t=0,n=new Uint8Array(r),s=new Uint8Array(e),i=n.slice(0),a=i.length-1,o=s.slice(0),l=o.length-1,c,f=0;for(let p=l;p>=0;p--,f++)switch(c=i[a-f]-o[l-f]-t,!0){case c<0:t=1,i[a-f]=c+10;break;default:t=0,i[a-f]=c}if(t>0)for(let p=a-l+1;p>=0;p--,f++)if(c=i[a-f]-t,c<0)t=1,i[a-f]=c+10;else{t=0,i[a-f]=c;break}return i.slice()}u(YG,"viewSub");var xb=class extends wa(es){static{u(this,"LocalIntegerValueBlock")}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=yb.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(G4(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,s=0){let i=this.fromBER(e,t,n);if(i===-1)return i;let a=this.valueHexView;return a[0]===0&&(a[1]&128)!==0?this.valueHexView=a.subarray(1):s!==0&&a.length<s&&(s-a.length>1&&(s=a.length+1),this.valueHexView=a.subarray(s-a.length)),i}toDER(e=!1){let t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){let s=super.fromBER(e,t,n);return s===-1||this.setValueHex(),s}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){let e=this.valueHexView.length*8-1,t=new Uint8Array(this.valueHexView.length*8/3),n=0,s,i=this.valueHexView,a="",o=!1;for(let l=i.byteLength-1;l>=0;l--){s=i[l];for(let c=0;c<8;c++){if((s&1)===1)switch(n){case e:t=YG(Z4(n),t),a="-";break;default:t=JG(t,Z4(n))}n++,s>>=1}}for(let l=0;l<t.length;l++)t[l]&&(o=!0),o&&(a+=Y4.charAt(t[l]));return o===!1&&(a+=Y4.charAt(0)),a}};vk=xb;xb.NAME="IntegerValueBlock";Object.defineProperty(vk.prototype,"valueHex",{set:u(function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},"set"),get:u(function(){return this.valueHexView.slice().buffer},"get")});var Yd,le=class extends Vn{static{u(this,"Integer")}constructor(e={}){super(e,xb),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return tE(),BigInt(this.valueBlock.toString())}static fromBigInt(e){tE();let t=BigInt(e),n=new Ab,s=t.toString(16).replace(/^-/,""),i=new Uint8Array(at.FromHex(s));if(t<0){let o=new Uint8Array(i.length+(i[0]&128?1:0));o[0]|=128;let c=BigInt(`0x${at.ToHex(o)}`)+t,f=Ye.toUint8Array(at.FromHex(c.toString(16)));f[0]|=128,n.write(f)}else i[0]&128&&n.write(new Uint8Array([0])),n.write(i);return new Yd({valueHex:n.final()})}convertToDER(){let e=new Yd({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Yd({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};Yd=le;Ge.Integer=Yd;le.NAME="INTEGER";var Ek,Fo=class extends le{static{u(this,"Enumerated")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};Ek=Fo;Ge.Enumerated=Ek;Fo.NAME="ENUMERATED";var Eb=class extends wa(es){static{u(this,"LocalSidValueBlock")}constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;let s=Ye.toUint8Array(e);if(!Ea(this,s,t,n))return-1;let i=s.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let o=0;o<n&&(this.valueHexView[o]=i[o]&127,this.blockLength++,(i[o]&128)!==0);o++);let a=new Uint8Array(this.blockLength);for(let o=0;o<this.blockLength;o++)a[o]=this.valueHexView[o];return this.valueHexView=a,(i[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=va(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){tE();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let n=new Uint8Array(t.length/7);for(let s=0;s<n.length;s++)n[s]=parseInt(t.slice(s*7,s*7+7),2)+(s+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let s=this.valueHexView,i=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)i[a]=s[a]|128;return i[this.blockLength-1]=s[this.blockLength-1],i.buffer}let t=ei(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Vi;let n=new Uint8Array(t.byteLength);if(!e){let s=new Uint8Array(t),i=t.byteLength-1;for(let a=0;a<i;a++)n[a]=s[a]|128;n[i]=s[i]}return n}toString(){let e="";if(this.isHexOnly)e=at.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};Eb.NAME="sidBlock";var wk=class extends es{static{u(this,"LocalObjectIdentifierValueBlock")}constructor({value:e=Zn,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let s=t;for(;n>0;){let i=new Eb;if(s=i.fromBER(e,s,n),s===-1)return this.blockLength=0,this.error=i.error,s;this.value.length===0&&(i.isFirstSid=!0),this.blockLength+=i.blockLength,n-=i.blockLength,this.value.push(i)}return s}toBER(e){let t=[];for(let n=0;n<this.value.length;n++){let s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,Vi;t.push(s)}return Sb(t)}fromString(e){this.value=[];let t=0,n=0,s="",i=!1;do if(n=e.indexOf(".",t),n===-1?s=e.substring(t):s=e.substring(t,n),t=n+1,i){let a=this.value[0],o=0;switch(a.valueDec){case 0:break;case 1:o=40;break;case 2:o=80;break;default:this.value=[];return}let l=parseInt(s,10);if(isNaN(l))return;a.valueDec=l+o,i=!1}else{let a=new Eb;if(s>Number.MAX_SAFE_INTEGER){tE();let o=BigInt(s);a.valueBigInt=o}else if(a.valueDec=parseInt(s,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,i=!0),this.value.push(a)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let s=this.value[n].toString();n!==0&&(e=`${e}.`),t?(s=`{${s}}`,this.value[n].isFirstSid?e=`2.{${s} - 80}`:e+=s):e+=s}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};wk.NAME="ObjectIdentifierValueBlock";var Sk,je=class extends Vn{static{u(this,"ObjectIdentifier")}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,wk),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Sk=je;Ge.ObjectIdentifier=Sk;je.NAME="OBJECT IDENTIFIER";var wb=class extends wa(vl){static{u(this,"LocalRelativeSidValueBlock")}constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;let s=Ye.toUint8Array(e);if(!Ea(this,s,t,n))return-1;let i=s.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let o=0;o<n&&(this.valueHexView[o]=i[o]&127,this.blockLength++,(i[o]&128)!==0);o++);let a=new Uint8Array(this.blockLength);for(let o=0;o<this.blockLength;o++)a[o]=this.valueHexView[o];return this.valueHexView=a,(i[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=va(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let s=this.valueHexView,i=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)i[a]=s[a]|128;return i[this.blockLength-1]=s[this.blockLength-1],i.buffer}let t=ei(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Vi;let n=new Uint8Array(t.byteLength);if(!e){let s=new Uint8Array(t),i=t.byteLength-1;for(let a=0;a<i;a++)n[a]=s[a]|128;n[i]=s[i]}return n.buffer}toString(){let e="";return this.isHexOnly?e=at.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};wb.NAME="relativeSidBlock";var Ak=class extends es{static{u(this,"LocalRelativeObjectIdentifierValueBlock")}constructor({value:e=Zn,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let s=t;for(;n>0;){let i=new wb;if(s=i.fromBER(e,s,n),s===-1)return this.blockLength=0,this.error=i.error,s;this.blockLength+=i.blockLength,n-=i.blockLength,this.value.push(i)}return s}toBER(e,t){let n=[];for(let s=0;s<this.value.length;s++){let i=this.value[s].toBER(e);if(i.byteLength===0)return this.error=this.value[s].error,Vi;n.push(i)}return Sb(n)}fromString(e){this.value=[];let t=0,n=0,s="";do{n=e.indexOf(".",t),n===-1?s=e.substring(t):s=e.substring(t,n),t=n+1;let i=new wb;if(i.valueDec=parseInt(s,10),isNaN(i.valueDec))return!0;this.value.push(i)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let s=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(s=`{${s}}`),e+=s}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};Ak.NAME="RelativeObjectIdentifierValueBlock";var Ck,xk=class extends Vn{static{u(this,"RelativeObjectIdentifier")}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Ak),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Ck=xk;Ge.RelativeObjectIdentifier=Ck;xk.NAME="RelativeObjectIdentifier";var bk,H=class extends re{static{u(this,"Sequence")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};bk=H;Ge.Sequence=bk;H.NAME="SEQUENCE";var Nk,xr=class extends re{static{u(this,"Set")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Nk=xr;Ge.Set=Nk;xr.NAME="SET";var Tk=class extends wa(es){static{u(this,"LocalStringValueBlock")}constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Zn}toJSON(){return{...super.toJSON(),value:this.value}}};Tk.NAME="StringValueBlock";var Ik=class extends Tk{static{u(this,"LocalSimpleStringValueBlock")}};Ik.NAME="SimpleStringValueBlock";var ds=class extends ik{static{u(this,"LocalSimpleStringBlock")}constructor({...e}={}){super(e,Ik)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,Ye.toUint8Array(e))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);this.valueBlock.value=e}};ds.NAME="SIMPLE STRING";var Dk=class extends ds{static{u(this,"LocalUtf8StringValueBlock")}fromBuffer(e){this.valueBlock.valueHexView=Ye.toUint8Array(e);try{this.valueBlock.value=at.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=at.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(at.FromUtf8String(e)),this.valueBlock.value=e}};Dk.NAME="Utf8StringValueBlock";var Bk,_s=class extends Dk{static{u(this,"Utf8String")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};Bk=_s;Ge.Utf8String=Bk;_s.NAME="UTF8String";var Rk=class extends ds{static{u(this,"LocalBmpStringValueBlock")}fromBuffer(e){this.valueBlock.value=at.ToUtf16String(e),this.valueBlock.valueHexView=Ye.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(at.FromUtf16String(e))}};Rk.NAME="BmpStringValueBlock";var Ok,sh=class extends Rk{static{u(this,"BmpString")}constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};Ok=sh;Ge.BmpString=Ok;sh.NAME="BMPString";var _k=class extends ds{static{u(this,"LocalUniversalStringValueBlock")}fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let s=0;s<n.length;s+=4)n[s]=n[s+3],n[s+1]=n[s+2],n[s+2]=0,n[s+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){let t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let s=0;s<t;s++){let i=ei(e.charCodeAt(s),8),a=new Uint8Array(i);if(a.length>4)continue;let o=4-a.length;for(let l=a.length-1;l>=0;l--)n[s*4+l+o]=a[l]}this.valueBlock.value=e}};_k.NAME="UniversalStringValueBlock";var Pk,ih=class extends _k{static{u(this,"UniversalString")}constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};Pk=ih;Ge.UniversalString=Pk;ih.NAME="UniversalString";var kk,El=class extends ds{static{u(this,"NumericString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};kk=El;Ge.NumericString=kk;El.NAME="NumericString";var Lk,Ps=class extends ds{static{u(this,"PrintableString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};Lk=Ps;Ge.PrintableString=Lk;Ps.NAME="PrintableString";var Vk,ah=class extends ds{static{u(this,"TeletexString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};Vk=ah;Ge.TeletexString=Vk;ah.NAME="TeletexString";var Fk,nE=class extends ds{static{u(this,"VideotexString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};Fk=nE;Ge.VideotexString=Fk;nE.NAME="VideotexString";var Uk,em=class extends ds{static{u(this,"IA5String")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};Uk=em;Ge.IA5String=Uk;em.NAME="IA5String";var Mk,sE=class extends ds{static{u(this,"GraphicString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};Mk=sE;Ge.GraphicString=Mk;sE.NAME="GraphicString";var jk,tm=class extends ds{static{u(this,"VisibleString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};jk=tm;Ge.VisibleString=jk;tm.NAME="VisibleString";var qk,iE=class extends ds{static{u(this,"GeneralString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};qk=iE;Ge.GeneralString=qk;iE.NAME="GeneralString";var Hk,aE=class extends ds{static{u(this,"CharacterString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};Hk=aE;Ge.CharacterString=Hk;aE.NAME="CharacterString";var Kk,wl=class extends tm{static{u(this,"UTCTime")}constructor({value:e,valueDate:t,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let s=0;s<e.length;s++)this.valueBlock.valueHexView[s]=e.charCodeAt(s)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,Ye.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}let s=parseInt(n[1],10);s>=50?this.year=1900+s:this.year=2e3+s,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){let t=new Array(7);return t[0]=Qn(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Qn(this.month,2),t[2]=Qn(this.day,2),t[3]=Qn(this.hour,2),t[4]=Qn(this.minute,2),t[5]=Qn(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};Kk=wl;Ge.UTCTime=Kk;wl.NAME="UTCTime";var Xk,dr=class extends wl{static{u(this,"GeneralizedTime")}constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){let e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,n="",s="",i=0,a,o=0,l=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{let p=new Number(e[e.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,d=n.indexOf("+"),g="";if(d===-1&&(d=n.indexOf("-"),p=-1),d!==-1){if(g=n.substring(d+1),n=n.substring(0,d),g.length!==2&&g.length!==4)throw new Error("Wrong input string for conversion");let m=parseInt(g.substring(0,2),10);if(isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");if(o=p*m,g.length===4){if(m=parseInt(g.substring(2,4),10),isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");l=p*m}}}let c=n.indexOf(".");if(c===-1&&(c=n.indexOf(",")),c!==-1){let p=new Number(`0${n.substring(c)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=p.valueOf(),s=n.substring(0,c)}else s=n;switch(!0){case s.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,c!==-1)throw new Error("Wrong input string for conversion");break;case s.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,c!==-1){let p=60*i;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case s.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,c!==-1){let p=60*i;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case s.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,c!==-1){let p=1e3*i;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}let f=a.exec(s);if(f===null)throw new Error("Wrong input string for conversion");for(let p=1;p<f.length;p++)switch(p){case 1:this.year=parseInt(f[p],10);break;case 2:this.month=parseInt(f[p],10);break;case 3:this.day=parseInt(f[p],10);break;case 4:this.hour=parseInt(f[p],10)+o;break;case 5:this.minute=parseInt(f[p],10)+l;break;case 6:this.second=parseInt(f[p],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(Qn(this.year,4)),t.push(Qn(this.month,2)),t.push(Qn(this.day,2)),t.push(Qn(this.hour,2)),t.push(Qn(this.minute,2)),t.push(Qn(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(Qn(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};Xk=dr;Ge.GeneralizedTime=Xk;dr.NAME="GeneralizedTime";var Gk,$k=class extends _s{static{u(this,"DATE")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};Gk=$k;Ge.DATE=Gk;$k.NAME="DATE";var Wk,zk=class extends _s{static{u(this,"TimeOfDay")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};Wk=zk;Ge.TimeOfDay=Wk;zk.NAME="TimeOfDay";var Jk,Yk=class extends _s{static{u(this,"DateTime")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};Jk=Yk;Ge.DateTime=Jk;Yk.NAME="DateTime";var Qk,Zk=class extends _s{static{u(this,"Duration")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};Qk=Zk;Ge.Duration=Qk;Zk.NAME="Duration";var e8,t8=class extends _s{static{u(this,"TIME")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};e8=t8;Ge.TIME=e8;t8.NAME="TIME";var nt=class{static{u(this,"Any")}constructor({name:e=Zn,optional:t=!1}={}){this.name=e,this.optional=t}},mr=class extends nt{static{u(this,"Choice")}constructor({value:e=[],...t}={}){super(t),this.value=e}},ut=class extends nt{static{u(this,"Repeated")}constructor({value:e=new nt,local:t=!1,...n}={}){super(n),this.value=e,this.local=t}},rm=class{static{u(this,"RawData")}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=Ye.toUint8Array(e)}constructor({data:e=rE}={}){this.dataView=Ye.toUint8Array(e)}fromBER(e,t,n){let s=t+n;return this.dataView=Ye.toUint8Array(e).subarray(t,s),s}toBER(e){return this.dataView.slice().buffer}};function ve(r,e,t){if(t instanceof mr){for(let i of t.value)if(ve(r,e,i).verified)return{verified:!0,result:r};{let i={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(vb)&&(i.name=t.name),i}}if(t instanceof nt)return t.hasOwnProperty(vb)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(jG in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(XG in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(GG in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let n=t.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(qG)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(HG)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(KG)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(MG in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(Q4 in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let i=t.idBlock.valueHexView,a=e.idBlock.valueHexView;if(i.length!==a.length)return{verified:!1,result:r};for(let o=0;o<i.length;o++)if(i[o]!==a[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Zn),t.name&&(r[t.name]=e)),t instanceof Ge.Constructed){let i=0,a={verified:!1,result:{error:"Unknown error"}},o=t.valueBlock.value.length;if(o>0&&t.valueBlock.value[0]instanceof ut&&(o=e.valueBlock.value.length),o===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let l=!0;for(let c=0;c<t.valueBlock.value.length;c++)l=l&&(t.valueBlock.value[c].optional||!1);return l?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Zn),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let l=0;l<o;l++)if(l-i>=e.valueBlock.value.length){if(t.valueBlock.value[l].optional===!1){let c={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Zn),t.name&&(delete r[t.name],c.name=t.name)),c}}else if(t.valueBlock.value[0]instanceof ut){if(a=ve(r,e.valueBlock.value[l],t.valueBlock.value[0].value),a.verified===!1)if(t.valueBlock.value[0].optional)i++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Zn),t.name&&delete r[t.name]),a;if(vb in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let c={};$G in t.valueBlock.value[0]&&t.valueBlock.value[0].local?c=e:c=r,typeof c[t.valueBlock.value[0].name]>"u"&&(c[t.valueBlock.value[0].name]=[]),c[t.valueBlock.value[0].name].push(e.valueBlock.value[l])}}else if(a=ve(r,e.valueBlock.value[l-i],t.valueBlock.value[l]),a.verified===!1)if(t.valueBlock.value[l].optional)i++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Zn),t.name&&delete r[t.name]),a;if(a.verified===!1){let l={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Zn),t.name&&(delete r[t.name],l.name=t.name)),l}return{verified:!0,result:r}}if(t.primitiveSchema&&Q4 in e.valueBlock){let i=Zd(e.valueBlock.valueHexView);if(i.offset===-1){let a={verified:!1,result:i.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Zn),t.name&&(delete r[t.name],a.name=t.name)),a}return ve(r,i.result,t.primitiveSchema)}return{verified:!0,result:r}}u(ve,"compareSchema");var yn=class r{static{u(this,"ByteStream")}constructor(e={}){if("view"in e)this.fromUint8Array(e.view);else if("buffer"in e)this.fromArrayBuffer(e.buffer);else if("string"in e)this.fromString(e.string);else if("hexstring"in e)this.fromHexString(e.hexstring);else if("length"in e&&e.length>0){if(this.length=e.length,e.stub)for(let t=0;t<this._view.length;t++)this._view[t]=e.stub}else this.length=0}set buffer(e){this._buffer=e,this._view=new Uint8Array(this._buffer)}get buffer(){return this._buffer}set view(e){this._buffer=new ArrayBuffer(e.length),this._view=new Uint8Array(this._buffer),this._view.set(e)}get view(){return this._view}get length(){return this.view.byteLength}set length(e){this._buffer=new ArrayBuffer(e),this._view=new Uint8Array(this._buffer)}clear(){this._buffer=new ArrayBuffer(0),this._view=new Uint8Array(this._buffer)}fromArrayBuffer(e){this._buffer=e,this._view=new Uint8Array(this._buffer)}fromUint8Array(e){this.fromArrayBuffer(new Uint8Array(e).buffer)}fromString(e){let t=e.length;this.length=t;for(let n=0;n<t;n++)this.view[n]=e.charCodeAt(n)}toString(e=0,t=this.view.length-e){let n="";(e>=this.view.length||e<0)&&(e=0),(t>=this.view.length||t<0)&&(t=this.view.length-e);for(let s=e;s<e+t;s++)n+=String.fromCharCode(this.view[s]);return n}fromHexString(e){let t=e.length;this.buffer=new ArrayBuffer(t>>1),this.view=new Uint8Array(this.buffer);let n=new Map;n.set("0",0),n.set("1",1),n.set("2",2),n.set("3",3),n.set("4",4),n.set("5",5),n.set("6",6),n.set("7",7),n.set("8",8),n.set("9",9),n.set("A",10),n.set("a",10),n.set("B",11),n.set("b",11),n.set("C",12),n.set("c",12),n.set("D",13),n.set("d",13),n.set("E",14),n.set("e",14),n.set("F",15),n.set("f",15);let s=0,i=0;for(let a=0;a<t;a++)a%2?(i|=n.get(e.charAt(a)),this.view[s]=i,s++):i=n.get(e.charAt(a))<<4}toHexString(e=0,t=this.view.length-e){let n="";(e>=this.view.length||e<0)&&(e=0),(t>=this.view.length||t<0)&&(t=this.view.length-e);for(let s=e;s<e+t;s++){let i=this.view[s].toString(16).toUpperCase();n=n+(i.length==1?"0":"")+i}return n}copy(e=0,t=this.length-e){if(!e&&!this.length)return new r;if(e<0||e>this.length-1)throw new Error(`Wrong start position: ${e}`);return new r({buffer:this._buffer.slice(e,e+t)})}slice(e=0,t=this.length){if(!e&&!this.length)return new r;if(e<0||e>this.length-1)throw new Error(`Wrong start position: ${e}`);return new r({buffer:this._buffer.slice(e,t)})}realloc(e){let t=new ArrayBuffer(e),n=new Uint8Array(t);e>this._view.length?n.set(this._view):n.set(new Uint8Array(this._buffer,0,e)),this._buffer=t,this._view=new Uint8Array(this._buffer)}append(e){let t=this.length,n=e.length,s=e._view.subarray();this.realloc(t+n),this._view.set(s,t)}insert(e,t=0,n=this.length-t){return t>this.length-1?!1:(n>this.length-t&&(n=this.length-t),n>e.length&&(n=e.length),n==e.length?this._view.set(e._view,t):this._view.set(e._view.subarray(0,n),t),!0)}isEqual(e){if(this.length!=e.length)return!1;for(let t=0;t<e.length;t++)if(this.view[t]!=e.view[t])return!1;return!0}isEqualView(e){if(e.length!=this.view.length)return!1;for(let t=0;t<e.length;t++)if(this.view[t]!=e[t])return!1;return!0}findPattern(e,t,n,s){let{start:i,length:a,backward:o}=this.prepareFindParameters(t,n,s),l=e.length;if(l>a)return-1;let c=[];for(let f=0;f<l;f++)c.push(e.view[f]);for(let f=0;f<=a-l;f++){let p=!0,d=o?i-l-f:i+f;for(let g=0;g<l;g++)if(this.view[g+d]!=c[g]){p=!1;break}if(p)return o?i-l-f:i+l+f}return-1}findFirstIn(e,t,n,s){let{start:i,length:a,backward:o}=this.prepareFindParameters(t,n,s),l={id:-1,position:o?0:i+a,length:0};for(let c=0;c<e.length;c++){let f=this.findPattern(e[c],i,a,o);if(f!=-1){let p=!1,d=e[c].length;o?f-d>=l.position-l.length&&(p=!0):f-d<=l.position-l.length&&(p=!0),p&&(l.position=f,l.id=c,l.length=d)}}return l}findAllIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],o={id:-1,position:s};do{let l=o.position;if(o=this.findFirstIn(e,o.position,i),o.id==-1)break;i-=o.position-l,a.push({id:o.id,position:o.position})}while(!0);return a}findAllPatternIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],o=e.length;if(o>i)return-1;let l=Array.from(e.view);for(let c=0;c<=i-o;c++){let f=!0,p=s+c;for(let d=0;d<o;d++)if(this.view[d+p]!=l[d]){f=!1;break}f&&(a.push(s+o+c),c+=o-1)}return a}findFirstNotIn(e,t,n,s){let{start:i,length:a,backward:o}=this.prepareFindParameters(t,n,s),l={left:{id:-1,position:i},right:{id:-1,position:0},value:new r},c=a;for(;c>0;){if(l.right=this.findFirstIn(e,o?i-a+c:i+a-c,c,o),l.right.id==-1){a=c,o?i-=a:i=l.left.position,l.value=new r({buffer:this._buffer.slice(i,i+a)});break}if(l.right.position!=(o?l.left.position-e[l.right.id].length:l.left.position+e[l.right.id].length)){o?(i=l.right.position+e[l.right.id].length,a=l.left.position-l.right.position-e[l.right.id].length):(i=l.left.position,a=l.right.position-l.left.position-e[l.right.id].length),l.value=new r({buffer:this._buffer.slice(i,i+a)});break}l.left=l.right,c-=e[l.right.id].length}if(o){let f=l.right;l.right=l.left,l.left=f}return l}findAllNotIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],o={left:{id:-1,position:s},right:{id:-1,position:s},value:new r};do{let l=o.right.position;o=this.findFirstNotIn(e,o.right.position,i),i-=o.right.position-l,a.push({left:{id:o.left.id,position:o.left.position},right:{id:o.right.id,position:o.right.position},value:o.value})}while(o.right.id!=-1);return a}findFirstSequence(e,t,n,s){let{start:i,length:a,backward:o}=this.prepareFindParameters(t,n,s),l=this.skipNotPatterns(e,i,a,o);if(l==-1)return{position:-1,value:new r};let c=this.skipPatterns(e,l,a-(o?i-l:l-i),o);o?(i=c,a=l-c):(i=l,a=c-l);let f=new r({buffer:this._buffer.slice(i,i+a)});return{position:c,value:f}}findAllSequences(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],o={position:s,value:new r};do{let l=o.position;o=this.findFirstSequence(e,o.position,i),o.position!=-1&&(i-=o.position-l,a.push({position:o.position,value:o.value}))}while(o.position!=-1);return a}findPairedPatterns(e,t,n,s){let i=[];if(e.isEqual(t))return i;let{start:a,length:o}=this.prepareFindParameters(n,s),l=0,c=this.findAllPatternIn(e,a,o);if(!Array.isArray(c)||c.length==0)return i;let f=this.findAllPatternIn(t,a,o);if(!Array.isArray(f)||f.length==0)return i;for(;l<c.length&&f.length!=0;){if(c[0]==f[0]){i.push({left:c[0],right:f[0]}),c.splice(0,1),f.splice(0,1);continue}if(c[l]>f[0])break;for(;c[l]<f[0]&&(l++,!(l>=c.length)););i.push({left:c[l-1],right:f[0]}),c.splice(l-1,1),f.splice(0,1),l=0}return i.sort((p,d)=>p.left-d.left),i}findPairedArrays(e,t,n,s){let{start:i,length:a}=this.prepareFindParameters(n,s),o=[],l=0,c=this.findAllIn(e,i,a);if(c.length==0)return o;let f=this.findAllIn(t,i,a);if(f.length==0)return o;for(;l<c.length&&f.length!=0;){if(c[0].position==f[0].position){o.push({left:c[0],right:f[0]}),c.splice(0,1),f.splice(0,1);continue}if(c[l].position>f[0].position)break;for(;c[l].position<f[0].position&&(l++,!(l>=c.length)););o.push({left:c[l-1],right:f[0]}),c.splice(l-1,1),f.splice(0,1),l=0}return o.sort((p,d)=>p.left.position-d.left.position),o}replacePattern(e,t,n,s,i=null){let a=[],o,l={status:-1,searchPatternPositions:[],replacePatternPositions:[]},{start:c,length:f}=this.prepareFindParameters(n,s);if(i==null){if(a=this.findAllIn([e],c,f),a.length==0)return l}else a=i;l.searchPatternPositions.push(...Array.from(a,m=>m.position));let p=e.length-t.length,d=new ArrayBuffer(this.view.length-a.length*p),g=new Uint8Array(d);for(g.set(new Uint8Array(this.buffer,0,c)),o=0;o<a.length;o++){let m=o==0?c:a[o-1].position;g.set(new Uint8Array(this.buffer,m,a[o].position-e.length-m),m-o*p),g.set(t.view,a[o].position-e.length-o*p),l.replacePatternPositions.push(a[o].position-e.length-o*p)}return o--,g.set(new Uint8Array(this.buffer,a[o].position,this.length-a[o].position),a[o].position-e.length+t.length-o*p),this.buffer=d,this.view=new Uint8Array(this.buffer),l.status=1,l}skipPatterns(e,t,n,s){let{start:i,length:a,backward:o}=this.prepareFindParameters(t,n,s),l=i;for(let c=0;c<e.length;c++){let f=e[c].length,p=o?l-f:l,d=!0;for(let g=0;g<f;g++)if(this.view[g+p]!=e[c].view[g]){d=!1;break}if(d){if(c=-1,o){if(l-=f,l<=0)return l}else if(l+=f,l>=i+a)return l}}return l}skipNotPatterns(e,t,n,s){let{start:i,length:a,backward:o}=this.prepareFindParameters(t,n,s),l=-1;for(let c=0;c<a;c++){for(let f=0;f<e.length;f++){let p=e[f].length,d=o?i-c-p:i+c,g=!0;for(let m=0;m<p;m++)if(this.view[m+d]!=e[f].view[m]){g=!1;break}if(g){l=o?i-c:i+c;break}}if(l!=-1)break}return l}prepareFindParameters(e=null,t=null,n=!1){return e===null&&(e=n?this.length:0),e>this.length&&(e=this.length),n?(t===null&&(t=e),t>e&&(t=e)):(t===null&&(t=this.length-e),t>this.length-e&&(t=this.length-e)),{start:e,length:t,backward:n}}};var QG=16777216,Sa=class r{static{u(this,"SeqStream")}constructor(e={}){this._stream=new yn,this._length=0,this._start=0,this.backward=!1,this.appendBlock=0,this.prevLength=0,this.prevStart=0,"view"in e?this.stream=new yn({view:e.view}):"buffer"in e?this.stream=new yn({buffer:e.buffer}):"string"in e?this.stream=new yn({string:e.string}):"hexstring"in e?this.stream=new yn({hexstring:e.hexstring}):"stream"in e?this.stream=e.stream.slice():this.stream=new yn,"backward"in e&&e.backward&&(this.backward=e.backward,this._start=this.stream.length),"length"in e&&e.length>0&&(this._length=e.length),"start"in e&&e.start&&e.start>0&&(this._start=e.start),"appendBlock"in e&&e.appendBlock&&e.appendBlock>0&&(this.appendBlock=e.appendBlock)}set stream(e){this._stream=e,this.prevLength=this._length,this._length=e.length,this.prevStart=this._start,this._start=0}get stream(){return this._stream}set length(e){this.prevLength=this._length,this._length=e}get length(){return this.appendBlock?this.start:this._length}set start(e){e>this.stream.length||(this.prevStart=this._start,this.prevLength=this._length,this._length-=this.backward?this._start-e:e-this._start,this._start=e)}get start(){return this._start}get buffer(){return this._stream.buffer.slice(0,this._length)}resetPosition(){this._start=this.prevStart,this._length=this.prevLength}findPattern(e,t=null){(t==null||t>this.length)&&(t=this.length);let n=this.stream.findPattern(e,this.start,this.length,this.backward);if(n==-1)return n;if(this.backward){if(n<this.start-e.length-t)return-1}else if(n>this.start+e.length+t)return-1;return this.start=n,n}findFirstIn(e,t=null){(t==null||t>this.length)&&(t=this.length);let n=this.stream.findFirstIn(e,this.start,this.length,this.backward);if(n.id==-1)return n;if(this.backward){if(n.position<this.start-e[n.id].length-t)return{id:-1,position:this.backward?0:this.start+this.length}}else if(n.position>this.start+e[n.id].length+t)return{id:-1,position:this.backward?0:this.start+this.length};return this.start=n.position,n}findAllIn(e){let t=this.backward?this.start-this.length:this.start;return this.stream.findAllIn(e,t,this.length)}findFirstNotIn(e,t=null){(t==null||t>this._length)&&(t=this._length);let n=this._stream.findFirstNotIn(e,this._start,this._length,this.backward);if(n.left.id==-1&&n.right.id==-1)return n;if(this.backward){if(n.right.id!=-1&&n.right.position<this._start-e[n.right.id].length-t)return{left:{id:-1,position:this._start},right:{id:-1,position:0},value:new yn}}else if(n.left.id!=-1&&n.left.position>this._start+e[n.left.id].length+t)return{left:{id:-1,position:this._start},right:{id:-1,position:0},value:new yn};return this.backward?n.left.id==-1?this.start=0:this.start=n.left.position:n.right.id==-1?this.start=this._start+this._length:this.start=n.right.position,n}findAllNotIn(e){let t=this.backward?this._start-this._length:this._start;return this._stream.findAllNotIn(e,t,this._length)}findFirstSequence(e,t=null,n=null){(t==null||t>this._length)&&(t=this._length),(n==null||n>t)&&(n=t);let s=this._stream.findFirstSequence(e,this._start,t,this.backward);if(s.value.length==0)return s;if(this.backward){if(s.position<this._start-s.value.length-n)return{position:-1,value:new yn}}else if(s.position>this._start+s.value.length+n)return{position:-1,value:new yn};return this.start=s.position,s}findAllSequences(e){let t=this.backward?this.start-this.length:this.start;return this.stream.findAllSequences(e,t,this.length)}findPairedPatterns(e,t,n=null){(n==null||n>this.length)&&(n=this.length);let s=this.backward?this.start-this.length:this.start,i=this.stream.findPairedPatterns(e,t,s,this.length);if(i.length){if(this.backward){if(i[0].right<this.start-t.length-n)return[]}else if(i[0].left>this.start+e.length+n)return[]}return i}findPairedArrays(e,t,n=null){(n==null||n>this.length)&&(n=this.length);let s=this.backward?this.start-this.length:this.start,i=this.stream.findPairedArrays(e,t,s,this.length);if(i.length){if(this.backward){if(i[0].right.position<this.start-t[i[0].right.id].length-n)return[]}else if(i[0].left.position>this.start+e[i[0].left.id].length+n)return[]}return i}replacePattern(e,t){let n=this.backward?this.start-this.length:this.start;return this.stream.replacePattern(e,t,n,this.length)}skipPatterns(e){let t=this.stream.skipPatterns(e,this.start,this.length,this.backward);return this.start=t,t}skipNotPatterns(e){let t=this.stream.skipNotPatterns(e,this.start,this.length,this.backward);return t==-1?-1:(this.start=t,t)}append(e){this.beforeAppend(e.length),this._stream.view.set(e.view,this._start),this._length+=e.length*2,this.start=this._start+e.length,this.prevLength-=e.length*2}appendView(e){this.beforeAppend(e.length),this._stream.view.set(e,this._start),this._length+=e.length*2,this.start=this._start+e.length,this.prevLength-=e.length*2}appendChar(e){this.beforeAppend(1),this._stream.view[this._start]=e,this._length+=2,this.start=this._start+1,this.prevLength-=2}appendUint16(e){this.beforeAppend(2);let t=new Uint16Array([e]),n=new Uint8Array(t.buffer);this.stream.view[this._start]=n[1],this._stream.view[this._start+1]=n[0],this._length+=4,this.start=this._start+2,this.prevLength-=4}appendUint24(e){this.beforeAppend(3);let t=new Uint32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[2],this._stream.view[this._start+1]=n[1],this._stream.view[this._start+2]=n[0],this._length+=6,this.start=this._start+3,this.prevLength-=6}appendUint32(e){this.beforeAppend(4);let t=new Uint32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[3],this._stream.view[this._start+1]=n[2],this._stream.view[this._start+2]=n[1],this._stream.view[this._start+3]=n[0],this._length+=8,this.start=this._start+4,this.prevLength-=8}appendInt16(e){this.beforeAppend(2);let t=new Int16Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[1],this._stream.view[this._start+1]=n[0],this._length+=4,this.start=this._start+2,this.prevLength-=4}appendInt32(e){this.beforeAppend(4);let t=new Int32Array([e]),n=new Uint8Array(t.buffer);this._stream.view[this._start]=n[3],this._stream.view[this._start+1]=n[2],this._stream.view[this._start+2]=n[1],this._stream.view[this._start+3]=n[0],this._length+=8,this.start=this._start+4,this.prevLength-=8}getBlock(e,t=!0){if(this._length<=0)return new Uint8Array(0);this._length<e&&(e=this._length);let n;if(this.backward){let s=this._stream.view.subarray(this._length-e,this._length);n=new Uint8Array(e);for(let i=0;i<e;i++)n[e-1-i]=s[i]}else n=this._stream.view.subarray(this._start,this._start+e);return t&&(this.start+=this.backward?-1*e:e),n}getUint16(e=!0){let t=this.getBlock(2,e);return t.length<2?0:t[0]<<8|t[1]}getInt16(e=!0){let t=this.getUint16(e),n=32768;return t&n?-(n-(t^n)):t}getUint24(e=!0){let t=this.getBlock(4,e);return t.length<3?0:t[0]<<16|t[1]<<8|t[2]}getUint32(e=!0){let t=this.getBlock(4,e);return t.length<4?0:t[0]*QG+(t[1]<<16)+(t[2]<<8)+t[3]}getInt32(e=!0){let t=this.getUint32(e),n=2147483648;return t&n?-(n-(t^n)):t}beforeAppend(e){this._start+e>this._stream.length&&(e>this.appendBlock&&(this.appendBlock=e+r.APPEND_BLOCK),this._stream.realloc(this._stream.length+this.appendBlock))}};Sa.APPEND_BLOCK=1e3;function e$(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}u(e$,"isBytes");function bb(r,...e){if(!e$(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}u(bb,"bytes");function Nb(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}u(Nb,"exists");function n8(r,e){bb(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}u(n8,"output");var uE=u(r=>new DataView(r.buffer,r.byteOffset,r.byteLength),"createView"),ri=u((r,e)=>r<<32-e|r>>>e,"rotr"),lE=u((r,e)=>r<<e|r>>>32-e>>>0,"rotl"),ile=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function t$(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}u(t$,"utf8ToBytes");function Tb(r){return typeof r=="string"&&(r=t$(r)),bb(r),r}u(Tb,"toBytes");var oE=class{static{u(this,"Hash")}clone(){return this._cloneInto()}},ale={}.toString;function Sl(r){let e=u(n=>r().update(Tb(n)).digest(),"hashC"),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}u(Sl,"wrapConstructor");function r$(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),a=Number(t>>s&i),o=Number(t&i),l=n?4:0,c=n?0:4;r.setUint32(e+l,a,n),r.setUint32(e+c,o,n)}u(r$,"setBigUint64");var cE=u((r,e,t)=>r&e^~r&t,"Chi"),fE=u((r,e,t)=>r&e^r&t^e&t,"Maj"),Uo=class extends oE{static{u(this,"HashMD")}constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=uE(this.buffer)}update(e){Nb(this);let{view:t,buffer:n,blockLen:s}=this;e=Tb(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(s-this.pos,i-a);if(o===s){let l=uE(e);for(;s<=i-a;a+=s)this.process(l,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Nb(this),n8(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(n,0),a=0);for(let p=a;p<s;p++)t[p]=0;r$(n,s-8,BigInt(this.length*8),i),this.process(n,0);let o=uE(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let c=l/4,f=this.get();if(c>f.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<c;p++)o.setUint32(4*p,f[p],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:a,pos:o}=this;return e.length=s,e.pos=o,e.finished=i,e.destroyed=a,s%t&&e.buffer.set(n),e}};var nm=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Mo=new Uint32Array(80),n$=class extends Uo{static{u(this,"SHA1")}constructor(){super(64,20,8,!1),this.A=nm[0]|0,this.B=nm[1]|0,this.C=nm[2]|0,this.D=nm[3]|0,this.E=nm[4]|0}get(){let{A:e,B:t,C:n,D:s,E:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0}process(e,t){for(let l=0;l<16;l++,t+=4)Mo[l]=e.getUint32(t,!1);for(let l=16;l<80;l++)Mo[l]=lE(Mo[l-3]^Mo[l-8]^Mo[l-14]^Mo[l-16],1);let{A:n,B:s,C:i,D:a,E:o}=this;for(let l=0;l<80;l++){let c,f;l<20?(c=cE(s,i,a),f=1518500249):l<40?(c=s^i^a,f=1859775393):l<60?(c=fE(s,i,a),f=2400959708):(c=s^i^a,f=3395469782);let p=lE(n,5)+c+o+f+Mo[l]|0;o=a,a=i,i=lE(s,30),s=n,n=p}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,this.set(n,s,i,a,o)}roundClean(){Mo.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}},s8=Sl(()=>new n$);var s$=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),jo=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qo=new Uint32Array(64),i$=class extends Uo{static{u(this,"SHA256")}constructor(){super(64,32,8,!1),this.A=jo[0]|0,this.B=jo[1]|0,this.C=jo[2]|0,this.D=jo[3]|0,this.E=jo[4]|0,this.F=jo[5]|0,this.G=jo[6]|0,this.H=jo[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:a,G:o,H:l}=this;return[e,t,n,s,i,a,o,l]}set(e,t,n,s,i,a,o,l){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=l|0}process(e,t){for(let p=0;p<16;p++,t+=4)qo[p]=e.getUint32(t,!1);for(let p=16;p<64;p++){let d=qo[p-15],g=qo[p-2],m=ri(d,7)^ri(d,18)^d>>>3,v=ri(g,17)^ri(g,19)^g>>>10;qo[p]=v+qo[p-7]+m+qo[p-16]|0}let{A:n,B:s,C:i,D:a,E:o,F:l,G:c,H:f}=this;for(let p=0;p<64;p++){let d=ri(o,6)^ri(o,11)^ri(o,25),g=f+d+cE(o,l,c)+s$[p]+qo[p]|0,v=(ri(n,2)^ri(n,13)^ri(n,22))+fE(n,s,i)|0;f=c,c=l,l=o,o=a+g|0,a=i,i=s,s=n,n=g+v|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,c=c+this.G|0,f=f+this.H|0,this.set(n,s,i,a,o,l,c,f)}roundClean(){qo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Ib=Sl(()=>new i$);var hE=BigInt(4294967295),Db=BigInt(32);function i8(r,e=!1){return e?{h:Number(r&hE),l:Number(r>>Db&hE)}:{h:Number(r>>Db&hE)|0,l:Number(r&hE)|0}}u(i8,"fromBig");function a$(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:a}=i8(r[s],e);[t[s],n[s]]=[i,a]}return[t,n]}u(a$,"split");var o$=u((r,e)=>BigInt(r>>>0)<<Db|BigInt(e>>>0),"toBig"),u$=u((r,e,t)=>r>>>t,"shrSH"),l$=u((r,e,t)=>r<<32-t|e>>>t,"shrSL"),c$=u((r,e,t)=>r>>>t|e<<32-t,"rotrSH"),f$=u((r,e,t)=>r<<32-t|e>>>t,"rotrSL"),h$=u((r,e,t)=>r<<64-t|e>>>t-32,"rotrBH"),p$=u((r,e,t)=>r>>>t-32|e<<64-t,"rotrBL"),d$=u((r,e)=>e,"rotr32H"),m$=u((r,e)=>r,"rotr32L"),g$=u((r,e,t)=>r<<t|e>>>32-t,"rotlSH"),y$=u((r,e,t)=>e<<t|r>>>32-t,"rotlSL"),v$=u((r,e,t)=>e<<t-32|r>>>64-t,"rotlBH"),E$=u((r,e,t)=>r<<t-32|e>>>64-t,"rotlBL");function w$(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}u(w$,"add");var S$=u((r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),"add3L"),A$=u((r,e,t,n)=>e+t+n+(r/2**32|0)|0,"add3H"),C$=u((r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),"add4L"),x$=u((r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0,"add4H"),b$=u((r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0),"add5L"),N$=u((r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0,"add5H");var T$={fromBig:i8,split:a$,toBig:o$,shrSH:u$,shrSL:l$,rotrSH:c$,rotrSL:f$,rotrBH:h$,rotrBL:p$,rotr32H:d$,rotr32L:m$,rotlSH:g$,rotlSL:y$,rotlBH:v$,rotlBL:E$,add:w$,add3L:S$,add3H:A$,add4L:C$,add4H:x$,add5H:N$,add5L:b$},Ct=T$;var[I$,D$]=Ct.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),Ho=new Uint32Array(80),Ko=new Uint32Array(80),pE=class extends Uo{static{u(this,"SHA512")}constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:a,Dh:o,Dl:l,Eh:c,El:f,Fh:p,Fl:d,Gh:g,Gl:m,Hh:v,Hl:y}=this;return[e,t,n,s,i,a,o,l,c,f,p,d,g,m,v,y]}set(e,t,n,s,i,a,o,l,c,f,p,d,g,m,v,y){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=l|0,this.Eh=c|0,this.El=f|0,this.Fh=p|0,this.Fl=d|0,this.Gh=g|0,this.Gl=m|0,this.Hh=v|0,this.Hl=y|0}process(e,t){for(let w=0;w<16;w++,t+=4)Ho[w]=e.getUint32(t),Ko[w]=e.getUint32(t+=4);for(let w=16;w<80;w++){let E=Ho[w-15]|0,A=Ko[w-15]|0,b=Ct.rotrSH(E,A,1)^Ct.rotrSH(E,A,8)^Ct.shrSH(E,A,7),V=Ct.rotrSL(E,A,1)^Ct.rotrSL(E,A,8)^Ct.shrSL(E,A,7),I=Ho[w-2]|0,D=Ko[w-2]|0,U=Ct.rotrSH(I,D,19)^Ct.rotrBH(I,D,61)^Ct.shrSH(I,D,6),F=Ct.rotrSL(I,D,19)^Ct.rotrBL(I,D,61)^Ct.shrSL(I,D,6),M=Ct.add4L(V,F,Ko[w-7],Ko[w-16]),se=Ct.add4H(M,b,U,Ho[w-7],Ho[w-16]);Ho[w]=se|0,Ko[w]=M|0}let{Ah:n,Al:s,Bh:i,Bl:a,Ch:o,Cl:l,Dh:c,Dl:f,Eh:p,El:d,Fh:g,Fl:m,Gh:v,Gl:y,Hh:S,Hl:C}=this;for(let w=0;w<80;w++){let E=Ct.rotrSH(p,d,14)^Ct.rotrSH(p,d,18)^Ct.rotrBH(p,d,41),A=Ct.rotrSL(p,d,14)^Ct.rotrSL(p,d,18)^Ct.rotrBL(p,d,41),b=p&g^~p&v,V=d&m^~d&y,I=Ct.add5L(C,A,V,D$[w],Ko[w]),D=Ct.add5H(I,S,E,b,I$[w],Ho[w]),U=I|0,F=Ct.rotrSH(n,s,28)^Ct.rotrBH(n,s,34)^Ct.rotrBH(n,s,39),M=Ct.rotrSL(n,s,28)^Ct.rotrBL(n,s,34)^Ct.rotrBL(n,s,39),se=n&i^n&o^i&o,ee=s&a^s&l^a&l;S=v|0,C=y|0,v=g|0,y=m|0,g=p|0,m=d|0,{h:p,l:d}=Ct.add(c|0,f|0,D|0,U|0),c=o|0,f=l|0,o=i|0,l=a|0,i=n|0,a=s|0;let ie=Ct.add3L(U,M,ee);n=Ct.add3H(ie,D,F,se),s=ie|0}({h:n,l:s}=Ct.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:a}=Ct.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l}=Ct.add(this.Ch|0,this.Cl|0,o|0,l|0),{h:c,l:f}=Ct.add(this.Dh|0,this.Dl|0,c|0,f|0),{h:p,l:d}=Ct.add(this.Eh|0,this.El|0,p|0,d|0),{h:g,l:m}=Ct.add(this.Fh|0,this.Fl|0,g|0,m|0),{h:v,l:y}=Ct.add(this.Gh|0,this.Gl|0,v|0,y|0),{h:S,l:C}=Ct.add(this.Hh|0,this.Hl|0,S|0,C|0),this.set(n,s,i,a,o,l,c,f,p,d,g,m,v,y,S,C)}roundClean(){Ho.fill(0),Ko.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var B$=class extends pE{static{u(this,"SHA384")}constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},Bb=Sl(()=>new pE);var Rb=Sl(()=>new B$);var Or=new ArrayBuffer(0),P="",sr=class oN extends TypeError{static{u(this,"ArgumentError")}constructor(){super(...arguments),this.name=oN.NAME}static isType(e,t){if(typeof t=="string"){if(t==="Array"&&Array.isArray(e))return!0;if(t==="ArrayBuffer"&&e instanceof ArrayBuffer)return!0;if(t==="ArrayBufferView"&&ArrayBuffer.isView(e))return!0;if(typeof e===t)return!0}else if(e instanceof t)return!0;return!1}static assert(e,t,...n){for(let i of n)if(this.isType(e,i))return;let s=n.map(i=>i instanceof Function&&"name"in i?i.name:`${i}`);throw new oN(`Parameter '${t}' is not of type ${s.length>1?`(${s.join(" or ")})`:s[0]}`)}};sr.NAME="ArgumentError";var Ht=class ME extends TypeError{static{u(this,"ParameterError")}static assert(...e){let t=null,n,s;typeof e[0]=="string"?(t=e[0],n=e[1],s=e.slice(2)):(n=e[0],s=e.slice(1)),sr.assert(n,"parameters","object");for(let i of s){let a=n[i];if(a==null)throw new ME(i,t)}}static assertEmpty(e,t,n){if(e==null)throw new ME(t,n)}constructor(e,t=null,n){super(),this.name=ME.NAME,this.field=e,t&&(this.target=t),n?this.message=n:this.message=`Absent mandatory parameter '${e}' ${t?` in '${t}'`:P}`}};Ht.NAME="ParameterError";var me=class B8 extends Error{static{u(this,"AsnError")}static assertSchema(e,t){if(!e.verified)throw new Error(`Object's schema was not verified against input data for ${t}`)}static assert(e,t){if(e.offset===-1)throw new B8(`Error during parsing of ASN.1 data. Data is not correct for '${t}'.`)}constructor(e){super(e),this.name="AsnError"}},Ee=class{static{u(this,"PkiObject")}static blockName(){return this.CLASS_NAME}static fromBER(e){let t=Ar(e);me.assert(t,this.name);try{return new this({schema:t.result})}catch{throw new me(`Cannot create '${this.CLASS_NAME}' from ASN.1 object`)}}static defaultValues(e){throw new Error(`Invalid member name for ${this.CLASS_NAME} class: ${e}`)}static schema(e={}){throw new Error(`Method '${this.CLASS_NAME}.schema' should be overridden`)}get className(){return this.constructor.CLASS_NAME}toString(e="hex"){let t;try{t=this.toSchema()}catch{t=this.toSchema(!0)}return at.ToString(t.toBER(),e)}};Ee.CLASS_NAME="PkiObject";function Vu(r){let e=!1,t=P,n=r.trim();for(let s=0;s<n.length;s++)n.charCodeAt(s)===32?e===!1&&(e=!0):(e&&(t+=" ",e=!1),t+=n[s]);return t.toLowerCase()}u(Vu,"stringPrep");var sm="type",Ob="value",uN=class ym extends Ee{static{u(this,"AttributeTypeAndValue")}constructor(e={}){super(),this.type=T(e,sm,ym.defaultValues(sm)),this.value=T(e,Ob,ym.defaultValues(Ob)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case sm:return P;case Ob:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.type||P}),new nt({name:t.value||P})]})}fromSchema(e){we(e,[sm,"typeValue"]);let t=ve(e,e,ym.schema({names:{type:sm,value:"typeValue"}}));me.assertSchema(t,this.className),this.type=t.result.type.valueBlock.toString(),this.value=t.result.typeValue}toSchema(){return new H({value:[new je({value:this.type}),this.value]})}toJSON(){let e={type:this.type};return Object.keys(this.value).length!==0?e.value=this.value.toJSON():e.value=this.value,e}isEqual(e){let t=[_s.blockName(),sh.blockName(),ih.blockName(),El.blockName(),Ps.blockName(),ah.blockName(),nE.blockName(),em.blockName(),sE.blockName(),tm.blockName(),iE.blockName(),aE.blockName()];if(e instanceof ArrayBuffer)return Ye.isEqual(this.value.valueBeforeDecodeView,e);if(e.constructor.blockName()===ym.blockName()){if(this.type!==e.type)return!1;let n=[!1,!1],s=this.value.constructor.blockName();for(let a of t)s===a&&(n[0]=!0),e.value.constructor.blockName()===a&&(n[1]=!0);if(n[0]!==n[1])return!1;if(n[0]&&n[1]){let a=Vu(this.value.valueBlock.value),o=Vu(e.value.valueBlock.value);if(a.localeCompare(o)!==0)return!1}else if(!Ye.isEqual(this.value.valueBeforeDecodeView,e.value.valueBeforeDecodeView))return!1;return!0}return!1}};uN.CLASS_NAME="AttributeTypeAndValue";var Al="typesAndValues",dE="valueBeforeDecode",a8="RDN",gr=class vm extends Ee{static{u(this,"RelativeDistinguishedNames")}constructor(e={}){super(),this.typesAndValues=T(e,Al,vm.defaultValues(Al)),this.valueBeforeDecode=T(e,dE,vm.defaultValues(dE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Al:return[];case dE:return Or;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Al:return t.length===0;case dE:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.repeatedSequence||P,value:new xr({value:[new ut({name:t.repeatedSet||P,value:uN.schema(t.typeAndValue||{})})]})})]})}fromSchema(e){we(e,[a8,Al]);let t=ve(e,e,vm.schema({names:{blockName:a8,repeatedSet:Al}}));me.assertSchema(t,this.className),Al in t.result&&(this.typesAndValues=Array.from(t.result.typesAndValues,n=>new uN({schema:n}))),this.valueBeforeDecode=t.result.RDN.valueBeforeDecodeView.slice().buffer}toSchema(){if(this.valueBeforeDecode.byteLength===0)return new H({value:[new xr({value:Array.from(this.typesAndValues,t=>t.toSchema())})]});let e=Ar(this.valueBeforeDecode);if(me.assert(e,"RelativeDistinguishedNames"),!(e.result instanceof H))throw new Error("ASN.1 result should be SEQUENCE");return e.result}toJSON(){return{typesAndValues:Array.from(this.typesAndValues,e=>e.toJSON())}}isEqual(e){if(e instanceof vm){if(this.typesAndValues.length!==e.typesAndValues.length)return!1;for(let[t,n]of this.typesAndValues.entries())if(n.isEqual(e.typesAndValues[t])===!1)return!1;return!0}return e instanceof ArrayBuffer?Lo(this.valueBeforeDecode,e):!1}};gr.CLASS_NAME="RelativeDistinguishedNames";var Em="type",wm="value";function R$(r={},e=!1){let t=T(r,"names",{});return new H({optional:e,value:[new re({optional:!0,idBlock:{tagClass:2,tagNumber:1},name:t.country_name||P,value:[new mr({value:[new El,new Ps]})]}),new re({optional:!0,idBlock:{tagClass:2,tagNumber:2},name:t.administration_domain_name||P,value:[new mr({value:[new El,new Ps]})]}),new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:0},name:t.network_address||P,isHexOnly:!0}),new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:1},name:t.terminal_identifier||P,isHexOnly:!0}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:2},name:t.private_domain_name||P,value:[new mr({value:[new El,new Ps]})]}),new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:3},name:t.organization_name||P,isHexOnly:!0}),new Ze({optional:!0,name:t.numeric_user_identifier||P,idBlock:{tagClass:3,tagNumber:4},isHexOnly:!0}),new re({optional:!0,name:t.personal_name||P,idBlock:{tagClass:3,tagNumber:5},value:[new Ze({idBlock:{tagClass:3,tagNumber:0},isHexOnly:!0}),new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:1},isHexOnly:!0}),new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:2},isHexOnly:!0}),new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:3},isHexOnly:!0})]}),new re({optional:!0,name:t.organizational_unit_names||P,idBlock:{tagClass:3,tagNumber:6},value:[new ut({value:new Ps})]})]})}u(R$,"builtInStandardAttributes");function O$(r=!1){return new H({optional:r,value:[new Ps,new Ps]})}u(O$,"builtInDomainDefinedAttributes");function _$(r=!1){return new xr({optional:r,value:[new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:0},isHexOnly:!0}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new nt]})]})}u(_$,"extensionAttributes");var ir=class dh extends Ee{static{u(this,"GeneralName")}constructor(e={}){super(),this.type=T(e,Em,dh.defaultValues(Em)),this.value=T(e,wm,dh.defaultValues(wm)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Em:return 9;case wm:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Em:return t===dh.defaultValues(e);case wm:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new mr({value:[new re({idBlock:{tagClass:3,tagNumber:0},name:t.blockName||P,value:[new je,new re({idBlock:{tagClass:3,tagNumber:0},value:[new nt]})]}),new Ze({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:1}}),new Ze({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:2}}),new re({idBlock:{tagClass:3,tagNumber:3},name:t.blockName||P,value:[R$(t.builtInStandardAttributes||{},!1),O$(!0),_$(!0)]}),new re({idBlock:{tagClass:3,tagNumber:4},name:t.blockName||P,value:[gr.schema(t.directoryName||{})]}),new re({idBlock:{tagClass:3,tagNumber:5},name:t.blockName||P,value:[new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new mr({value:[new ah,new Ps,new ih,new _s,new sh]})]}),new re({idBlock:{tagClass:3,tagNumber:1},value:[new mr({value:[new ah,new Ps,new ih,new _s,new sh]})]})]}),new Ze({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:6}}),new Ze({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:7}}),new Ze({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:8}})]})}fromSchema(e){we(e,["blockName","otherName","rfc822Name","dNSName","x400Address","directoryName","ediPartyName","uniformResourceIdentifier","iPAddress","registeredID"]);let t=ve(e,e,dh.schema({names:{blockName:"blockName",otherName:"otherName",rfc822Name:"rfc822Name",dNSName:"dNSName",x400Address:"x400Address",directoryName:{names:{blockName:"directoryName"}},ediPartyName:"ediPartyName",uniformResourceIdentifier:"uniformResourceIdentifier",iPAddress:"iPAddress",registeredID:"registeredID"}}));switch(me.assertSchema(t,this.className),this.type=t.result.blockName.idBlock.tagNumber,this.type){case 0:this.value=t.result.blockName;break;case 1:case 2:case 6:{let n=t.result.blockName;n.idBlock.tagClass=1,n.idBlock.tagNumber=22;let s=n.toBER(!1),i=Ar(s);me.assert(i,"GeneralName value"),this.value=i.result.valueBlock.value}break;case 3:this.value=t.result.blockName;break;case 4:this.value=new gr({schema:t.result.directoryName});break;case 5:this.value=t.result.ediPartyName;break;case 7:this.value=new Ne({valueHex:t.result.blockName.valueBlock.valueHex});break;case 8:{let n=t.result.blockName;n.idBlock.tagClass=1,n.idBlock.tagNumber=6;let s=n.toBER(!1),i=Ar(s);me.assert(i,"GeneralName registeredID"),this.value=i.result.valueBlock.toString()}break}}toSchema(){switch(this.type){case 0:case 3:case 5:return new re({idBlock:{tagClass:3,tagNumber:this.type},value:[this.value]});case 1:case 2:case 6:{let e=new em({value:this.value});return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}case 4:return new re({idBlock:{tagClass:3,tagNumber:4},value:[this.value.toSchema()]});case 7:{let e=this.value;return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}case 8:{let e=new je({value:this.value});return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}default:return dh.schema()}}toJSON(){let e={type:this.type,value:P};if(typeof this.value=="string")e.value=this.value;else try{e.value=this.value.toJSON()}catch{}return e}};ir.CLASS_NAME="GeneralName";var Sm="accessMethod",Am="accessLocation",P$=[Sm,Am],lN=class jE extends Ee{static{u(this,"AccessDescription")}constructor(e={}){super(),this.accessMethod=T(e,Sm,jE.defaultValues(Sm)),this.accessLocation=T(e,Am,jE.defaultValues(Am)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Sm:return P;case Am:return new ir;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.accessMethod||P}),ir.schema(t.accessLocation||{})]})}fromSchema(e){we(e,P$);let t=ve(e,e,jE.schema({names:{accessMethod:Sm,accessLocation:{names:{blockName:Am}}}}));me.assertSchema(t,this.className),this.accessMethod=t.result.accessMethod.valueBlock.toString(),this.accessLocation=new ir({schema:t.result.accessLocation})}toSchema(){return new H({value:[new je({value:this.accessMethod}),this.accessLocation.toSchema()]})}toJSON(){return{accessMethod:this.accessMethod,accessLocation:this.accessLocation.toJSON()}}};lN.CLASS_NAME="AccessDescription";var Go="seconds",$o="millis",Wo="micros",Nl=class mh extends Ee{static{u(this,"Accuracy")}constructor(e={}){super(),Go in e&&(this.seconds=T(e,Go,mh.defaultValues(Go))),$o in e&&(this.millis=T(e,$o,mh.defaultValues($o))),Wo in e&&(this.micros=T(e,Wo,mh.defaultValues(Wo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Go:case $o:case Wo:return 0;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Go:case $o:case Wo:return t===mh.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,optional:!0,value:[new le({optional:!0,name:t.seconds||P}),new Ze({name:t.millis||P,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new Ze({name:t.micros||P,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){we(e,[Go,$o,Wo]);let t=ve(e,e,mh.schema({names:{seconds:Go,millis:$o,micros:Wo}}));if(me.assertSchema(t,this.className),"seconds"in t.result&&(this.seconds=t.result.seconds.valueBlock.valueDec),"millis"in t.result){let n=new le({valueHex:t.result.millis.valueBlock.valueHex});this.millis=n.valueBlock.valueDec}if("micros"in t.result){let n=new le({valueHex:t.result.micros.valueBlock.valueHex});this.micros=n.valueBlock.valueDec}}toSchema(){let e=[];if(this.seconds!==void 0&&e.push(new le({value:this.seconds})),this.millis!==void 0){let t=new le({value:this.millis});e.push(new Ze({idBlock:{tagClass:3,tagNumber:0},valueHex:t.valueBlock.valueHexView}))}if(this.micros!==void 0){let t=new le({value:this.micros});e.push(new Ze({idBlock:{tagClass:3,tagNumber:1},valueHex:t.valueBlock.valueHexView}))}return new H({value:e})}toJSON(){let e={};return this.seconds!==void 0&&(e.seconds=this.seconds),this.millis!==void 0&&(e.millis=this.millis),this.micros!==void 0&&(e.micros=this.micros),e}};Nl.CLASS_NAME="Accuracy";var mE="algorithmId",im="algorithmParams",R8="algorithm",cN="params",k$=[R8,cN],ce=class Cm extends Ee{static{u(this,"AlgorithmIdentifier")}constructor(e={}){super(),this.algorithmId=T(e,mE,Cm.defaultValues(mE)),im in e&&(this.algorithmParams=T(e,im,Cm.defaultValues(im))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case mE:return P;case im:return new nt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case mE:return t===P;case im:return t instanceof nt;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,optional:t.optional||!1,value:[new je({name:t.algorithmIdentifier||P}),new nt({name:t.algorithmParams||P,optional:!0})]})}fromSchema(e){we(e,k$);let t=ve(e,e,Cm.schema({names:{algorithmIdentifier:R8,algorithmParams:cN}}));me.assertSchema(t,this.className),this.algorithmId=t.result.algorithm.valueBlock.toString(),cN in t.result&&(this.algorithmParams=t.result.params)}toSchema(){let e=[];return e.push(new je({value:this.algorithmId})),this.algorithmParams&&!(this.algorithmParams instanceof nt)&&e.push(this.algorithmParams),new H({value:e})}toJSON(){let e={algorithmId:this.algorithmId};return this.algorithmParams&&!(this.algorithmParams instanceof nt)&&(e.algorithmParams=this.algorithmParams.toJSON()),e}isEqual(e){return!(e instanceof Cm)||this.algorithmId!==e.algorithmId?!1:this.algorithmParams?e.algorithmParams?JSON.stringify(this.algorithmParams)===JSON.stringify(e.algorithmParams):!1:!e.algorithmParams}};ce.CLASS_NAME="AlgorithmIdentifier";var gh="altNames",L$=[gh],fN=class hN extends Ee{static{u(this,"AltName")}constructor(e={}){super(),this.altNames=T(e,gh,hN.defaultValues(gh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case gh:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.altNames||P,value:ir.schema()})]})}fromSchema(e){we(e,L$);let t=ve(e,e,hN.schema({names:{altNames:gh}}));me.assertSchema(t,this.className),gh in t.result&&(this.altNames=Array.from(t.result.altNames,n=>new ir({schema:n})))}toSchema(){return new H({value:Array.from(this.altNames,e=>e.toSchema())})}toJSON(){return{altNames:Array.from(this.altNames,e=>e.toJSON())}}};fN.CLASS_NAME="AltName";var yh="type",vh="values",V$=[yh,vh],_r=class qE extends Ee{static{u(this,"Attribute")}constructor(e={}){super(),this.type=T(e,yh,qE.defaultValues(yh)),this.values=T(e,vh,qE.defaultValues(vh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case yh:return P;case vh:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case yh:return t===P;case vh:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.type||P}),new xr({name:t.setName||P,value:[new ut({name:t.values||P,value:new nt})]})]})}fromSchema(e){we(e,V$);let t=ve(e,e,qE.schema({names:{type:yh,values:vh}}));me.assertSchema(t,this.className),this.type=t.result.type.valueBlock.toString(),this.values=t.result.values}toSchema(){return new H({value:[new je({value:this.type}),new xr({value:this.values})]})}toJSON(){return{type:this.type,values:Array.from(this.values,e=>e.toJSON())}}};_r.CLASS_NAME="Attribute";var xm="notBeforeTime",bm="notAfterTime",F$=[xm,bm],jc=class HE extends Ee{static{u(this,"AttCertValidityPeriod")}constructor(e={}){super(),this.notBeforeTime=T(e,xm,HE.defaultValues(xm)),this.notAfterTime=T(e,bm,HE.defaultValues(bm)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case xm:case bm:return new Date(0,0,0);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new dr({name:t.notBeforeTime||P}),new dr({name:t.notAfterTime||P})]})}fromSchema(e){we(e,F$);let t=ve(e,e,HE.schema({names:{notBeforeTime:xm,notAfterTime:bm}}));me.assertSchema(t,this.className),this.notBeforeTime=t.result.notBeforeTime.toDate(),this.notAfterTime=t.result.notAfterTime.toDate()}toSchema(){return new H({value:[new dr({valueDate:this.notBeforeTime}),new dr({valueDate:this.notAfterTime})]})}toJSON(){return{notBeforeTime:this.notBeforeTime,notAfterTime:this.notAfterTime}}};jc.CLASS_NAME="AttCertValidityPeriod";var am="names",o8="generalNames",vn=class pN extends Ee{static{u(this,"GeneralNames")}constructor(e={}){super(),this.names=T(e,am,pN.defaultValues(am)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case"names":return[];default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=T(e,am,{});return new H({optional:t,name:n.blockName||P,value:[new ut({name:n.generalNames||P,value:ir.schema()})]})}fromSchema(e){we(e,[am,o8]);let t=ve(e,e,pN.schema({names:{blockName:am,generalNames:o8}}));me.assertSchema(t,this.className),this.names=Array.from(t.result.generalNames,n=>new ir({schema:n}))}toSchema(){return new H({value:Array.from(this.names,e=>e.toSchema())})}toJSON(){return{names:Array.from(this.names,e=>e.toJSON())}}};vn.CLASS_NAME="GeneralNames";var U$="2.5.29.9",M$="2.5.29.14",j$="2.5.29.15",q$="2.5.29.16",O8="2.5.29.17",_8="2.5.29.18",dT="2.5.29.19",H$="2.5.29.20",K$="2.5.29.27",X$="2.5.29.21",G$="2.5.29.24",P8="2.5.29.28",k8="2.5.29.29",L8="2.5.29.30",V8="2.5.29.31",mT="2.5.29.46",F8="2.5.29.32",ks="2.5.29.32.0",$$="1.3.6.1.4.1.311.21.10",U8="2.5.29.33",gT="2.5.29.35",M8="2.5.29.36",W$="2.5.29.37",z$="2.5.29.54",yT="1.3.6.1.5.5.7.1.1",J$="1.3.6.1.5.5.7.1.11",Y$="1.3.6.1.4.1.11129.2.4.2";var Q$="1.3.6.1.4.1.311.21.7",Z$="1.3.6.1.4.1.311.21.1",eW="1.3.6.1.5.5.7.1.3",vT="1.2.840.113549.1.7.1",j8="1.2.840.113549.1.7.2",q8="1.2.840.113549.1.7.3",H8="1.2.840.113549.1.7.6",tW="1.2.840.113549.1.9.16.1.4",u8="1.2.840.113549.1.9.22.1",rW="1.2.840.113549.1.9.22.2",l8="1.2.840.113549.1.9.22.3",c8="1.2.840.113549.1.9.23.1",nW="1.3.6.1.5.5.7",ET=`${nW}.48`,KE=`${ET}.1.1`,jle=`${ET}.2`,qle=`${ET}.1`;var Tl="keyIdentifier",Il="authorityCertIssuer",Dl="authorityCertSerialNumber",sW=[Tl,Il,Dl],wT=class Nm extends Ee{static{u(this,"AuthorityKeyIdentifier")}constructor(e={}){super(),Tl in e&&(this.keyIdentifier=T(e,Tl,Nm.defaultValues(Tl))),Il in e&&(this.authorityCertIssuer=T(e,Il,Nm.defaultValues(Il))),Dl in e&&(this.authorityCertSerialNumber=T(e,Dl,Nm.defaultValues(Dl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Tl:return new Ne;case Il:return[];case Dl:return new le;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new Ze({name:t.keyIdentifier||P,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new ut({name:t.authorityCertIssuer||P,value:ir.schema()})]}),new Ze({name:t.authorityCertSerialNumber||P,optional:!0,idBlock:{tagClass:3,tagNumber:2}})]})}fromSchema(e){we(e,sW);let t=ve(e,e,Nm.schema({names:{keyIdentifier:Tl,authorityCertIssuer:Il,authorityCertSerialNumber:Dl}}));me.assertSchema(t,this.className),Tl in t.result&&(this.keyIdentifier=new Ne({valueHex:t.result.keyIdentifier.valueBlock.valueHex})),Il in t.result&&(this.authorityCertIssuer=Array.from(t.result.authorityCertIssuer,n=>new ir({schema:n}))),Dl in t.result&&(this.authorityCertSerialNumber=new le({valueHex:t.result.authorityCertSerialNumber.valueBlock.valueHex}))}toSchema(){let e=[];return this.keyIdentifier&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:0},valueHex:this.keyIdentifier.valueBlock.valueHexView})),this.authorityCertIssuer&&e.push(new re({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.authorityCertIssuer,t=>t.toSchema())})),this.authorityCertSerialNumber&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:2},valueHex:this.authorityCertSerialNumber.valueBlock.valueHexView})),new H({value:e})}toJSON(){let e={};return this.keyIdentifier&&(e.keyIdentifier=this.keyIdentifier.toJSON()),this.authorityCertIssuer&&(e.authorityCertIssuer=Array.from(this.authorityCertIssuer,t=>t.toJSON())),this.authorityCertSerialNumber&&(e.authorityCertSerialNumber=this.authorityCertSerialNumber.toJSON()),e}};wT.CLASS_NAME="AuthorityKeyIdentifier";var Cl="pathLenConstraint",xl="cA",ST=class XE extends Ee{static{u(this,"BasicConstraints")}constructor(e={}){super(),this.cA=T(e,xl,!1),Cl in e&&(this.pathLenConstraint=T(e,Cl,0)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case xl:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ti({optional:!0,name:t.cA||P}),new le({optional:!0,name:t.pathLenConstraint||P})]})}fromSchema(e){we(e,[xl,Cl]);let t=ve(e,e,XE.schema({names:{cA:xl,pathLenConstraint:Cl}}));me.assertSchema(t,this.className),xl in t.result&&(this.cA=t.result.cA.valueBlock.value),Cl in t.result&&(t.result.pathLenConstraint.valueBlock.isHexOnly?this.pathLenConstraint=t.result.pathLenConstraint:this.pathLenConstraint=t.result.pathLenConstraint.valueBlock.valueDec)}toSchema(){let e=[];return this.cA!==XE.defaultValues(xl)&&e.push(new ti({value:this.cA})),Cl in this&&(this.pathLenConstraint instanceof le?e.push(this.pathLenConstraint):e.push(new le({value:this.pathLenConstraint}))),new H({value:e})}toJSON(){let e={};return this.cA!==XE.defaultValues(xl)&&(e.cA=this.cA),Cl in this&&(this.pathLenConstraint instanceof le?e.pathLenConstraint=this.pathLenConstraint.toJSON():e.pathLenConstraint=this.pathLenConstraint),e}};ST.CLASS_NAME="BasicConstraints";var _b="certificateIndex",Pb="keyIndex",K8=class dN extends Ee{static{u(this,"CAVersion")}constructor(e={}){super(),this.certificateIndex=T(e,_b,dN.defaultValues(_b)),this.keyIndex=T(e,Pb,dN.defaultValues(Pb)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case _b:case Pb:return 0;default:return super.defaultValues(e)}}static schema(){return new le}fromSchema(e){if(e.constructor.blockName()!==le.blockName())throw new Error("Object's schema was not verified against input data for CAVersion");let t=e.valueBlock.valueHex.slice(0),n=new Uint8Array(t);switch(!0){case t.byteLength<4:{let p=new ArrayBuffer(4);new Uint8Array(p).set(n,4-t.byteLength),t=p.slice(0)}break;case t.byteLength>4:{let p=new ArrayBuffer(4);new Uint8Array(p).set(n.slice(0,4)),t=p.slice(0)}break}let s=t.slice(0,2),i=new Uint8Array(s),a=i[0];i[0]=i[1],i[1]=a;let o=new Uint16Array(s);this.keyIndex=o[0];let l=t.slice(2),c=new Uint8Array(l);a=c[0],c[0]=c[1],c[1]=a;let f=new Uint16Array(l);this.certificateIndex=f[0]}toSchema(){let e=new ArrayBuffer(2),t=new Uint16Array(e);t[0]=this.certificateIndex;let n=new Uint8Array(e),s=n[0];n[0]=n[1],n[1]=s;let i=new ArrayBuffer(2),a=new Uint16Array(i);a[0]=this.keyIndex;let o=new Uint8Array(i);return s=o[0],o[0]=o[1],o[1]=s,new le({valueHex:gl(i,e)})}toJSON(){return{certificateIndex:this.certificateIndex,keyIndex:this.keyIndex}}};K8.CLASS_NAME="CAVersion";var Tm="policyQualifierId",Im="qualifier",iW=[Tm,Im],mN=class GE extends Ee{static{u(this,"PolicyQualifierInfo")}constructor(e={}){super(),this.policyQualifierId=T(e,Tm,GE.defaultValues(Tm)),this.qualifier=T(e,Im,GE.defaultValues(Im)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Tm:return P;case Im:return new nt;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.policyQualifierId||P}),new nt({name:t.qualifier||P})]})}fromSchema(e){we(e,iW);let t=ve(e,e,GE.schema({names:{policyQualifierId:Tm,qualifier:Im}}));me.assertSchema(t,this.className),this.policyQualifierId=t.result.policyQualifierId.valueBlock.toString(),this.qualifier=t.result.qualifier}toSchema(){return new H({value:[new je({value:this.policyQualifierId}),this.qualifier]})}toJSON(){return{policyQualifierId:this.policyQualifierId,qualifier:this.qualifier.toJSON()}}};mN.CLASS_NAME="PolicyQualifierInfo";var Dm="policyIdentifier",Bl="policyQualifiers",aW=[Dm,Bl],gN=class $E extends Ee{static{u(this,"PolicyInformation")}constructor(e={}){super(),this.policyIdentifier=T(e,Dm,$E.defaultValues(Dm)),Bl in e&&(this.policyQualifiers=T(e,Bl,$E.defaultValues(Bl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Dm:return P;case Bl:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.policyIdentifier||P}),new H({optional:!0,value:[new ut({name:t.policyQualifiers||P,value:mN.schema()})]})]})}fromSchema(e){we(e,aW);let t=ve(e,e,$E.schema({names:{policyIdentifier:Dm,policyQualifiers:Bl}}));me.assertSchema(t,this.className),this.policyIdentifier=t.result.policyIdentifier.valueBlock.toString(),Bl in t.result&&(this.policyQualifiers=Array.from(t.result.policyQualifiers,n=>new mN({schema:n})))}toSchema(){let e=[];return e.push(new je({value:this.policyIdentifier})),this.policyQualifiers&&e.push(new H({value:Array.from(this.policyQualifiers,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={policyIdentifier:this.policyIdentifier};return this.policyQualifiers&&(e.policyQualifiers=Array.from(this.policyQualifiers,t=>t.toJSON())),e}};gN.CLASS_NAME="PolicyInformation";var Bm="certificatePolicies",oW=[Bm],yN=class vN extends Ee{static{u(this,"CertificatePolicies")}constructor(e={}){super(),this.certificatePolicies=T(e,Bm,vN.defaultValues(Bm)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Bm:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.certificatePolicies||P,value:gN.schema()})]})}fromSchema(e){we(e,oW);let t=ve(e,e,vN.schema({names:{certificatePolicies:Bm}}));me.assertSchema(t,this.className),this.certificatePolicies=Array.from(t.result.certificatePolicies,n=>new gN({schema:n}))}toSchema(){return new H({value:Array.from(this.certificatePolicies,e=>e.toSchema())})}toJSON(){return{certificatePolicies:Array.from(this.certificatePolicies,e=>e.toJSON())}}};yN.CLASS_NAME="CertificatePolicies";var Rm="templateID",Ca="templateMajorVersion",xa="templateMinorVersion",uW=[Rm,Ca,xa],lW=class Om extends Ee{static{u(this,"CertificateTemplate")}constructor(e={}){super(),this.templateID=T(e,Rm,Om.defaultValues(Rm)),Ca in e&&(this.templateMajorVersion=T(e,Ca,Om.defaultValues(Ca))),xa in e&&(this.templateMinorVersion=T(e,xa,Om.defaultValues(xa))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Rm:return P;case Ca:case xa:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.templateID||P}),new le({name:t.templateMajorVersion||P,optional:!0}),new le({name:t.templateMinorVersion||P,optional:!0})]})}fromSchema(e){we(e,uW);let t=ve(e,e,Om.schema({names:{templateID:Rm,templateMajorVersion:Ca,templateMinorVersion:xa}}));me.assertSchema(t,this.className),this.templateID=t.result.templateID.valueBlock.toString(),Ca in t.result&&(this.templateMajorVersion=t.result.templateMajorVersion.valueBlock.valueDec),xa in t.result&&(this.templateMinorVersion=t.result.templateMinorVersion.valueBlock.valueDec)}toSchema(){let e=[];return e.push(new je({value:this.templateID})),Ca in this&&e.push(new le({value:this.templateMajorVersion})),xa in this&&e.push(new le({value:this.templateMinorVersion})),new H({value:e})}toJSON(){let e={templateID:this.templateID};return Ca in this&&(e.templateMajorVersion=this.templateMajorVersion),xa in this&&(e.templateMinorVersion=this.templateMinorVersion),e}},Rl="distributionPoint",X8="distributionPointNames",Ol="reasons",_l="cRLIssuer",G8="cRLIssuerNames",cW=[Rl,X8,Ol,_l,G8],EN=class _m extends Ee{static{u(this,"DistributionPoint")}constructor(e={}){super(),Rl in e&&(this.distributionPoint=T(e,Rl,_m.defaultValues(Rl))),Ol in e&&(this.reasons=T(e,Ol,_m.defaultValues(Ol))),_l in e&&(this.cRLIssuer=T(e,_l,_m.defaultValues(_l))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Rl:return[];case Ol:return new At;case _l:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new mr({value:[new re({name:t.distributionPoint||P,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new ut({name:t.distributionPointNames||P,value:ir.schema()})]}),new re({name:t.distributionPoint||P,optional:!0,idBlock:{tagClass:3,tagNumber:1},value:gr.schema().valueBlock.value})]})]}),new Ze({name:t.reasons||P,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new re({name:t.cRLIssuer||P,optional:!0,idBlock:{tagClass:3,tagNumber:2},value:[new ut({name:t.cRLIssuerNames||P,value:ir.schema()})]})]})}fromSchema(e){we(e,cW);let t=ve(e,e,_m.schema({names:{distributionPoint:Rl,distributionPointNames:X8,reasons:Ol,cRLIssuer:_l,cRLIssuerNames:G8}}));me.assertSchema(t,this.className),Rl in t.result&&(t.result.distributionPoint.idBlock.tagNumber===0&&(this.distributionPoint=Array.from(t.result.distributionPointNames,n=>new ir({schema:n}))),t.result.distributionPoint.idBlock.tagNumber===1&&(this.distributionPoint=new gr({schema:new H({value:t.result.distributionPoint.valueBlock.value})}))),Ol in t.result&&(this.reasons=new At({valueHex:t.result.reasons.valueBlock.valueHex})),_l in t.result&&(this.cRLIssuer=Array.from(t.result.cRLIssuerNames,n=>new ir({schema:n})))}toSchema(){let e=[];if(this.distributionPoint){let t;this.distributionPoint instanceof Array?t=new re({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.distributionPoint,n=>n.toSchema())}):t=new re({idBlock:{tagClass:3,tagNumber:1},value:[this.distributionPoint.toSchema()]}),e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[t]}))}return this.reasons&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:1},valueHex:this.reasons.valueBlock.valueHexView})),this.cRLIssuer&&e.push(new re({idBlock:{tagClass:3,tagNumber:2},value:Array.from(this.cRLIssuer,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={};return this.distributionPoint&&(this.distributionPoint instanceof Array?e.distributionPoint=Array.from(this.distributionPoint,t=>t.toJSON()):e.distributionPoint=this.distributionPoint.toJSON()),this.reasons&&(e.reasons=this.reasons.toJSON()),this.cRLIssuer&&(e.cRLIssuer=Array.from(this.cRLIssuer,t=>t.toJSON())),e}};EN.CLASS_NAME="DistributionPoint";var Pm="distributionPoints",fW=[Pm],wN=class SN extends Ee{static{u(this,"CRLDistributionPoints")}constructor(e={}){super(),this.distributionPoints=T(e,Pm,SN.defaultValues(Pm)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pm:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.distributionPoints||P,value:EN.schema()})]})}fromSchema(e){we(e,fW);let t=ve(e,e,SN.schema({names:{distributionPoints:Pm}}));me.assertSchema(t,this.className),this.distributionPoints=Array.from(t.result.distributionPoints,n=>new EN({schema:n}))}toSchema(){return new H({value:Array.from(this.distributionPoints,e=>e.toSchema())})}toJSON(){return{distributionPoints:Array.from(this.distributionPoints,e=>e.toJSON())}}};wN.CLASS_NAME="CRLDistributionPoints";var km="keyPurposes",hW=[km],$8=class AN extends Ee{static{u(this,"ExtKeyUsage")}constructor(e={}){super(),this.keyPurposes=T(e,km,AN.defaultValues(km)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case km:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.keyPurposes||P,value:new je})]})}fromSchema(e){we(e,hW);let t=ve(e,e,AN.schema({names:{keyPurposes:km}}));me.assertSchema(t,this.className),this.keyPurposes=Array.from(t.result.keyPurposes,n=>n.valueBlock.toString())}toSchema(){return new H({value:Array.from(this.keyPurposes,e=>new je({value:e}))})}toJSON(){return{keyPurposes:Array.from(this.keyPurposes)}}};$8.CLASS_NAME="ExtKeyUsage";var om="accessDescriptions",CN=class xN extends Ee{static{u(this,"InfoAccess")}constructor(e={}){super(),this.accessDescriptions=T(e,om,xN.defaultValues(om)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case om:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.accessDescriptions||P,value:lN.schema()})]})}fromSchema(e){we(e,[om]);let t=ve(e,e,xN.schema({names:{accessDescriptions:om}}));me.assertSchema(t,this.className),this.accessDescriptions=Array.from(t.result.accessDescriptions,n=>new lN({schema:n}))}toSchema(){return new H({value:Array.from(this.accessDescriptions,e=>e.toSchema())})}toJSON(){return{accessDescriptions:Array.from(this.accessDescriptions,e=>e.toJSON())}}};CN.CLASS_NAME="InfoAccess";var Pl="distributionPoint",W8="distributionPointNames",zo="onlyContainsUserCerts",Jo="onlyContainsCACerts",Yo="onlySomeReasons",Qo="indirectCRL",Zo="onlyContainsAttributeCerts",pW=[Pl,W8,zo,Jo,Yo,Qo,Zo],z8=class Tn extends Ee{static{u(this,"IssuingDistributionPoint")}constructor(e={}){super(),Pl in e&&(this.distributionPoint=T(e,Pl,Tn.defaultValues(Pl))),this.onlyContainsUserCerts=T(e,zo,Tn.defaultValues(zo)),this.onlyContainsCACerts=T(e,Jo,Tn.defaultValues(Jo)),Yo in e&&(this.onlySomeReasons=T(e,Yo,Tn.defaultValues(Yo))),this.indirectCRL=T(e,Qo,Tn.defaultValues(Qo)),this.onlyContainsAttributeCerts=T(e,Zo,Tn.defaultValues(Zo)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pl:return[];case zo:return!1;case Jo:return!1;case Yo:return 0;case Qo:return!1;case Zo:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new mr({value:[new re({name:t.distributionPoint||P,idBlock:{tagClass:3,tagNumber:0},value:[new ut({name:t.distributionPointNames||P,value:ir.schema()})]}),new re({name:t.distributionPoint||P,idBlock:{tagClass:3,tagNumber:1},value:gr.schema().valueBlock.value})]})]}),new Ze({name:t.onlyContainsUserCerts||P,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new Ze({name:t.onlyContainsCACerts||P,optional:!0,idBlock:{tagClass:3,tagNumber:2}}),new Ze({name:t.onlySomeReasons||P,optional:!0,idBlock:{tagClass:3,tagNumber:3}}),new Ze({name:t.indirectCRL||P,optional:!0,idBlock:{tagClass:3,tagNumber:4}}),new Ze({name:t.onlyContainsAttributeCerts||P,optional:!0,idBlock:{tagClass:3,tagNumber:5}})]})}fromSchema(e){we(e,pW);let t=ve(e,e,Tn.schema({names:{distributionPoint:Pl,distributionPointNames:W8,onlyContainsUserCerts:zo,onlyContainsCACerts:Jo,onlySomeReasons:Yo,indirectCRL:Qo,onlyContainsAttributeCerts:Zo}}));if(me.assertSchema(t,this.className),Pl in t.result)switch(!0){case t.result.distributionPoint.idBlock.tagNumber===0:this.distributionPoint=Array.from(t.result.distributionPointNames,n=>new ir({schema:n}));break;case t.result.distributionPoint.idBlock.tagNumber===1:this.distributionPoint=new gr({schema:new H({value:t.result.distributionPoint.valueBlock.value})});break;default:throw new Error("Unknown tagNumber for distributionPoint: {$asn1.result.distributionPoint.idBlock.tagNumber}")}if(zo in t.result){let n=new Uint8Array(t.result.onlyContainsUserCerts.valueBlock.valueHex);this.onlyContainsUserCerts=n[0]!==0}if(Jo in t.result){let n=new Uint8Array(t.result.onlyContainsCACerts.valueBlock.valueHex);this.onlyContainsCACerts=n[0]!==0}if(Yo in t.result){let n=new Uint8Array(t.result.onlySomeReasons.valueBlock.valueHex);this.onlySomeReasons=n[0]}if(Qo in t.result){let n=new Uint8Array(t.result.indirectCRL.valueBlock.valueHex);this.indirectCRL=n[0]!==0}if(Zo in t.result){let n=new Uint8Array(t.result.onlyContainsAttributeCerts.valueBlock.valueHex);this.onlyContainsAttributeCerts=n[0]!==0}}toSchema(){let e=[];if(this.distributionPoint){let t;this.distributionPoint instanceof Array?t=new re({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.distributionPoint,n=>n.toSchema())}):(t=this.distributionPoint.toSchema(),t.idBlock.tagClass=3,t.idBlock.tagNumber=1),e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[t]}))}if(this.onlyContainsUserCerts!==Tn.defaultValues(zo)&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:1},valueHex:new Uint8Array([255]).buffer})),this.onlyContainsCACerts!==Tn.defaultValues(Jo)&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:2},valueHex:new Uint8Array([255]).buffer})),this.onlySomeReasons!==void 0){let t=new ArrayBuffer(1),n=new Uint8Array(t);n[0]=this.onlySomeReasons,e.push(new Ze({idBlock:{tagClass:3,tagNumber:3},valueHex:t}))}return this.indirectCRL!==Tn.defaultValues(Qo)&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:4},valueHex:new Uint8Array([255]).buffer})),this.onlyContainsAttributeCerts!==Tn.defaultValues(Zo)&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:5},valueHex:new Uint8Array([255]).buffer})),new H({value:e})}toJSON(){let e={};return this.distributionPoint&&(this.distributionPoint instanceof Array?e.distributionPoint=Array.from(this.distributionPoint,t=>t.toJSON()):e.distributionPoint=this.distributionPoint.toJSON()),this.onlyContainsUserCerts!==Tn.defaultValues(zo)&&(e.onlyContainsUserCerts=this.onlyContainsUserCerts),this.onlyContainsCACerts!==Tn.defaultValues(Jo)&&(e.onlyContainsCACerts=this.onlyContainsCACerts),Yo in this&&(e.onlySomeReasons=this.onlySomeReasons),this.indirectCRL!==Tn.defaultValues(Qo)&&(e.indirectCRL=this.indirectCRL),this.onlyContainsAttributeCerts!==Tn.defaultValues(Zo)&&(e.onlyContainsAttributeCerts=this.onlyContainsAttributeCerts),e}};z8.CLASS_NAME="IssuingDistributionPoint";var Lm="base",Eh="minimum",eu="maximum",dW=[Lm,Eh,eu],Vm=class Fm extends Ee{static{u(this,"GeneralSubtree")}constructor(e={}){super(),this.base=T(e,Lm,Fm.defaultValues(Lm)),this.minimum=T(e,Eh,Fm.defaultValues(Eh)),eu in e&&(this.maximum=T(e,eu,Fm.defaultValues(eu))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Lm:return new ir;case Eh:return 0;case eu:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ir.schema(t.base||{}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new le({name:t.minimum||P})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new le({name:t.maximum||P})]})]})}fromSchema(e){we(e,dW);let t=ve(e,e,Fm.schema({names:{base:{names:{blockName:Lm}},minimum:Eh,maximum:eu}}));me.assertSchema(t,this.className),this.base=new ir({schema:t.result.base}),Eh in t.result&&(t.result.minimum.valueBlock.isHexOnly?this.minimum=t.result.minimum:this.minimum=t.result.minimum.valueBlock.valueDec),eu in t.result&&(t.result.maximum.valueBlock.isHexOnly?this.maximum=t.result.maximum:this.maximum=t.result.maximum.valueBlock.valueDec)}toSchema(){let e=[];if(e.push(this.base.toSchema()),this.minimum!==0){let t=0;this.minimum instanceof le?t=this.minimum:t=new le({value:this.minimum}),e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[t]}))}if(eu in this){let t=0;this.maximum instanceof le?t=this.maximum:t=new le({value:this.maximum}),e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[t]}))}return new H({value:e})}toJSON(){let e={base:this.base.toJSON()};return this.minimum!==0&&(typeof this.minimum=="number"?e.minimum=this.minimum:e.minimum=this.minimum.toJSON()),this.maximum!==void 0&&(typeof this.maximum=="number"?e.maximum=this.maximum:e.maximum=this.maximum.toJSON()),e}};Vm.CLASS_NAME="GeneralSubtree";var kl="permittedSubtrees",Ll="excludedSubtrees",mW=[kl,Ll],J8=class WE extends Ee{static{u(this,"NameConstraints")}constructor(e={}){super(),kl in e&&(this.permittedSubtrees=T(e,kl,WE.defaultValues(kl))),Ll in e&&(this.excludedSubtrees=T(e,Ll,WE.defaultValues(Ll))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case kl:case Ll:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new ut({name:t.permittedSubtrees||P,value:Vm.schema()})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new ut({name:t.excludedSubtrees||P,value:Vm.schema()})]})]})}fromSchema(e){we(e,mW);let t=ve(e,e,WE.schema({names:{permittedSubtrees:kl,excludedSubtrees:Ll}}));me.assertSchema(t,this.className),kl in t.result&&(this.permittedSubtrees=Array.from(t.result.permittedSubtrees,n=>new Vm({schema:n}))),Ll in t.result&&(this.excludedSubtrees=Array.from(t.result.excludedSubtrees,n=>new Vm({schema:n})))}toSchema(){let e=[];return this.permittedSubtrees&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.permittedSubtrees,t=>t.toSchema())})),this.excludedSubtrees&&e.push(new re({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.excludedSubtrees,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={};return this.permittedSubtrees&&(e.permittedSubtrees=Array.from(this.permittedSubtrees,t=>t.toJSON())),this.excludedSubtrees&&(e.excludedSubtrees=Array.from(this.excludedSubtrees,t=>t.toJSON())),e}};J8.CLASS_NAME="NameConstraints";var ba="requireExplicitPolicy",Na="inhibitPolicyMapping",gW=[ba,Na],Y8=class zE extends Ee{static{u(this,"PolicyConstraints")}constructor(e={}){super(),ba in e&&(this.requireExplicitPolicy=T(e,ba,zE.defaultValues(ba))),Na in e&&(this.inhibitPolicyMapping=T(e,Na,zE.defaultValues(Na))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ba:return 0;case Na:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new Ze({name:t.requireExplicitPolicy||P,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new Ze({name:t.inhibitPolicyMapping||P,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){we(e,gW);let t=ve(e,e,zE.schema({names:{requireExplicitPolicy:ba,inhibitPolicyMapping:Na}}));if(me.assertSchema(t,this.className),ba in t.result){let n=t.result.requireExplicitPolicy;n.idBlock.tagClass=1,n.idBlock.tagNumber=2;let s=n.toBER(!1),i=Ar(s);me.assert(i,"Integer"),this.requireExplicitPolicy=i.result.valueBlock.valueDec}if(Na in t.result){let n=t.result.inhibitPolicyMapping;n.idBlock.tagClass=1,n.idBlock.tagNumber=2;let s=n.toBER(!1),i=Ar(s);me.assert(i,"Integer"),this.inhibitPolicyMapping=i.result.valueBlock.valueDec}}toSchema(){let e=[];if(ba in this){let t=new le({value:this.requireExplicitPolicy});t.idBlock.tagClass=3,t.idBlock.tagNumber=0,e.push(t)}if(Na in this){let t=new le({value:this.inhibitPolicyMapping});t.idBlock.tagClass=3,t.idBlock.tagNumber=1,e.push(t)}return new H({value:e})}toJSON(){let e={};return ba in this&&(e.requireExplicitPolicy=this.requireExplicitPolicy),Na in this&&(e.inhibitPolicyMapping=this.inhibitPolicyMapping),e}};Y8.CLASS_NAME="PolicyConstraints";var Um="issuerDomainPolicy",Mm="subjectDomainPolicy",yW=[Um,Mm],bN=class JE extends Ee{static{u(this,"PolicyMapping")}constructor(e={}){super(),this.issuerDomainPolicy=T(e,Um,JE.defaultValues(Um)),this.subjectDomainPolicy=T(e,Mm,JE.defaultValues(Mm)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Um:return P;case Mm:return P;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.issuerDomainPolicy||P}),new je({name:t.subjectDomainPolicy||P})]})}fromSchema(e){we(e,yW);let t=ve(e,e,JE.schema({names:{issuerDomainPolicy:Um,subjectDomainPolicy:Mm}}));me.assertSchema(t,this.className),this.issuerDomainPolicy=t.result.issuerDomainPolicy.valueBlock.toString(),this.subjectDomainPolicy=t.result.subjectDomainPolicy.valueBlock.toString()}toSchema(){return new H({value:[new je({value:this.issuerDomainPolicy}),new je({value:this.subjectDomainPolicy})]})}toJSON(){return{issuerDomainPolicy:this.issuerDomainPolicy,subjectDomainPolicy:this.subjectDomainPolicy}}};bN.CLASS_NAME="PolicyMapping";var jm="mappings",vW=[jm],Q8=class NN extends Ee{static{u(this,"PolicyMappings")}constructor(e={}){super(),this.mappings=T(e,jm,NN.defaultValues(jm)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case jm:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.mappings||P,value:bN.schema()})]})}fromSchema(e){we(e,vW);let t=ve(e,e,NN.schema({names:{mappings:jm}}));me.assertSchema(t,this.className),this.mappings=Array.from(t.result.mappings,n=>new bN({schema:n}))}toSchema(){return new H({value:Array.from(this.mappings,e=>e.toSchema())})}toJSON(){return{mappings:Array.from(this.mappings,e=>e.toJSON())}}};Q8.CLASS_NAME="PolicyMappings";var tu="notBefore",ru="notAfter",EW=[tu,ru],Z8=class YE extends Ee{static{u(this,"PrivateKeyUsagePeriod")}constructor(e={}){super(),tu in e&&(this.notBefore=T(e,tu,YE.defaultValues(tu))),ru in e&&(this.notAfter=T(e,ru,YE.defaultValues(ru))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case tu:return new Date;case ru:return new Date;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new Ze({name:t.notBefore||P,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new Ze({name:t.notAfter||P,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){we(e,EW);let t=ve(e,e,YE.schema({names:{notBefore:tu,notAfter:ru}}));if(me.assertSchema(t,this.className),tu in t.result){let n=new dr;n.fromBuffer(t.result.notBefore.valueBlock.valueHex),this.notBefore=n.toDate()}if(ru in t.result){let n=new dr({valueHex:t.result.notAfter.valueBlock.valueHex});n.fromBuffer(t.result.notAfter.valueBlock.valueHex),this.notAfter=n.toDate()}}toSchema(){let e=[];return tu in this&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:0},valueHex:new dr({valueDate:this.notBefore}).valueBlock.valueHexView})),ru in this&&e.push(new Ze({idBlock:{tagClass:3,tagNumber:1},valueHex:new dr({valueDate:this.notAfter}).valueBlock.valueHexView})),new H({value:e})}toJSON(){let e={};return this.notBefore&&(e.notBefore=this.notBefore),this.notAfter&&(e.notAfter=this.notAfter),e}};Z8.CLASS_NAME="PrivateKeyUsagePeriod";var wh="id",Ta="type",Sh="values",wW=[wh,Ta],SW=[Sh],TN=class QE extends Ee{static{u(this,"QCStatement")}constructor(e={}){super(),this.id=T(e,wh,QE.defaultValues(wh)),Ta in e&&(this.type=T(e,Ta,QE.defaultValues(Ta))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wh:return P;case Ta:return new Cr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case wh:return t===P;case Ta:return t instanceof Cr;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.id||P}),new nt({name:t.type||P,optional:!0})]})}fromSchema(e){we(e,wW);let t=ve(e,e,QE.schema({names:{id:wh,type:Ta}}));me.assertSchema(t,this.className),this.id=t.result.id.valueBlock.toString(),Ta in t.result&&(this.type=t.result.type)}toSchema(){let e=[new je({value:this.id})];return Ta in this&&e.push(this.type),new H({value:e})}toJSON(){let e={id:this.id};return this.type&&(e.type=this.type.toJSON()),e}};TN.CLASS_NAME="QCStatement";var e5=class IN extends Ee{static{u(this,"QCStatements")}constructor(e={}){super(),this.values=T(e,Sh,IN.defaultValues(Sh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Sh:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Sh:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.values||P,value:TN.schema(t.value||{})})]})}fromSchema(e){we(e,SW);let t=ve(e,e,IN.schema({names:{values:Sh}}));me.assertSchema(t,this.className),this.values=Array.from(t.result.values,n=>new TN({schema:n}))}toSchema(){return new H({value:Array.from(this.values,e=>e.toSchema())})}toJSON(){return{values:Array.from(this.values,e=>e.toJSON())}}};e5.CLASS_NAME="QCStatements";var Vl,Uu=class{static{u(this,"ECNamedCurves")}static register(e,t,n){this.namedCurves[e.toLowerCase()]=this.namedCurves[t]={name:e,id:t,size:n}}static find(e){return this.namedCurves[e.toLowerCase()]||null}};Vl=Uu;Uu.namedCurves={};Vl.register("P-256","1.2.840.10045.3.1.7",32),Vl.register("P-384","1.3.132.0.34",48),Vl.register("P-521","1.3.132.0.35",66),Vl.register("brainpoolP256r1","1.3.36.3.3.2.8.1.1.7",32),Vl.register("brainpoolP384r1","1.3.36.3.3.2.8.1.1.11",48),Vl.register("brainpoolP512r1","1.3.36.3.3.2.8.1.1.13",64);var gE="x",yE="y",vE="namedCurve",ja=class Ah extends Ee{static{u(this,"ECPublicKey")}constructor(e={}){super(),this.x=T(e,gE,Ah.defaultValues(gE)),this.y=T(e,yE,Ah.defaultValues(yE)),this.namedCurve=T(e,vE,Ah.defaultValues(vE)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case gE:case yE:return Or;case vE:return P;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case gE:case yE:return t instanceof ArrayBuffer&&Lo(t,Ah.defaultValues(e));case vE:return typeof t=="string"&&t===Ah.defaultValues(e);default:return super.defaultValues(e)}}static schema(){return new rm}fromSchema(e){let t=Ye.toUint8Array(e);if(t[0]!==4)throw new Error("Object's schema was not verified against input data for ECPublicKey");let n=Uu.find(this.namedCurve);if(!n)throw new Error(`Incorrect curve OID: ${this.namedCurve}`);let s=n.size;if(t.byteLength!==s*2+1)throw new Error("Object's schema was not verified against input data for ECPublicKey");this.namedCurve=n.name,this.x=t.slice(1,s+1).buffer,this.y=t.slice(1+s,s*2+1).buffer}toSchema(){return new rm({data:gl(new Uint8Array([4]).buffer,this.x,this.y)})}toJSON(){let e=Uu.find(this.namedCurve);return{crv:e?e.name:this.namedCurve,x:eE(zd(this.x),!0,!0,!1),y:eE(zd(this.y),!0,!0,!1)}}fromJSON(e){Ht.assert("json",e,"crv","x","y");let t=0,n=Uu.find(e.crv);n&&(this.namedCurve=n.id,t=n.size);let s=yl(nh(e.x,!0));if(s.byteLength<t){this.x=new ArrayBuffer(t);let a=new Uint8Array(this.x),o=new Uint8Array(s);a.set(o,1)}else this.x=s.slice(0,t);let i=yl(nh(e.y,!0));if(i.byteLength<t){this.y=new ArrayBuffer(t);let a=new Uint8Array(this.y),o=new Uint8Array(i);a.set(o,1)}else this.y=i.slice(0,t)}};ja.CLASS_NAME="ECPublicKey";var qm="modulus",Hm="publicExponent",AW=[qm,Hm],DN=class ZE extends Ee{static{u(this,"RSAPublicKey")}constructor(e={}){super(),this.modulus=T(e,qm,ZE.defaultValues(qm)),this.publicExponent=T(e,Hm,ZE.defaultValues(Hm)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qm:return new le;case Hm:return new le;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.modulus||P}),new le({name:t.publicExponent||P})]})}fromSchema(e){we(e,AW);let t=ve(e,e,ZE.schema({names:{modulus:qm,publicExponent:Hm}}));me.assertSchema(t,this.className),this.modulus=t.result.modulus.convertFromDER(256),this.publicExponent=t.result.publicExponent}toSchema(){return new H({value:[this.modulus.convertToDER(),this.publicExponent]})}toJSON(){return{n:at.ToBase64Url(this.modulus.valueBlock.valueHexView),e:at.ToBase64Url(this.publicExponent.valueBlock.valueHexView)}}fromJSON(e){Ht.assert("json",e,"n","e");let t=yl(nh(e.n,!0));this.modulus=new le({valueHex:t.slice(0,Math.pow(2,z4(t.byteLength)))}),this.publicExponent=new le({valueHex:yl(nh(e.e,!0)).slice(0,3)})}};DN.CLASS_NAME="RSAPublicKey";var Km="algorithm",Xm="subjectPublicKey",CW=[Km,Xm],ci=class ew extends Ee{static{u(this,"PublicKeyInfo")}get parsedKey(){if(this._parsedKey===void 0){switch(this.algorithm.algorithmId){case"1.2.840.10045.2.1":if("algorithmParams"in this.algorithm&&this.algorithm.algorithmParams.constructor.blockName()===je.blockName())try{this._parsedKey=new ja({namedCurve:this.algorithm.algorithmParams.valueBlock.toString(),schema:this.subjectPublicKey.valueBlock.valueHexView})}catch{}break;case"1.2.840.113549.1.1.1":case"1.2.840.113549.1.1.10":{let e=Ar(this.subjectPublicKey.valueBlock.valueHexView);if(e.offset!==-1)try{this._parsedKey=new DN({schema:e.result})}catch{}}break}this._parsedKey||(this._parsedKey=null)}return this._parsedKey||void 0}set parsedKey(e){this._parsedKey=e}constructor(e={}){super(),this.algorithm=T(e,Km,ew.defaultValues(Km)),this.subjectPublicKey=T(e,Xm,ew.defaultValues(Xm));let t=T(e,"parsedKey",null);t&&(this.parsedKey=t),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Km:return new ce;case Xm:return new At;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.algorithm||{}),new At({name:t.subjectPublicKey||P})]})}fromSchema(e){we(e,CW);let t=ve(e,e,ew.schema({names:{algorithm:{names:{blockName:Km}},subjectPublicKey:Xm}}));me.assertSchema(t,this.className),this.algorithm=new ce({schema:t.result.algorithm}),this.subjectPublicKey=t.result.subjectPublicKey}toSchema(){return new H({value:[this.algorithm.toSchema(),this.subjectPublicKey]})}toJSON(){if(!this.parsedKey)return{algorithm:this.algorithm.toJSON(),subjectPublicKey:this.subjectPublicKey.toJSON()};let e={};switch(this.algorithm.algorithmId){case"1.2.840.10045.2.1":e.kty="EC";break;case"1.2.840.113549.1.1.1":case"1.2.840.113549.1.1.10":e.kty="RSA";break}let t=this.parsedKey.toJSON();return Object.assign(e,t),e}fromJSON(e){if("kty"in e){switch(e.kty.toUpperCase()){case"EC":this.parsedKey=new ja({json:e}),this.algorithm=new ce({algorithmId:"1.2.840.10045.2.1",algorithmParams:new je({value:this.parsedKey.namedCurve})});break;case"RSA":this.parsedKey=new DN({json:e}),this.algorithm=new ce({algorithmId:"1.2.840.113549.1.1.1",algorithmParams:new Cr});break;default:throw new Error(`Invalid value for "kty" parameter: ${e.kty}`)}this.subjectPublicKey=new At({valueHex:this.parsedKey.toSchema().toBER(!1)})}}async importKey(e,t=pt(!0)){try{if(!e)throw new Error("Need to provide publicKey input parameter");let n=await t.exportKey("spki",e),s=Ar(n);try{this.fromSchema(s.result)}catch{throw new Error("Error during initializing object from schema")}}catch(n){let s=n instanceof Error?n.message:`${n}`;throw new Error(`Error during exporting public key: ${s}`)}}};ci.CLASS_NAME="PublicKeyInfo";var Ch="version",xh="privateKey",ni="namedCurve",nu="publicKey",xW=[Ch,xh,ni,nu],BN=class Ia extends Ee{static{u(this,"ECPrivateKey")}constructor(e={}){super(),this.version=T(e,Ch,Ia.defaultValues(Ch)),this.privateKey=T(e,xh,Ia.defaultValues(xh)),ni in e&&(this.namedCurve=T(e,ni,Ia.defaultValues(ni))),nu in e&&(this.publicKey=T(e,nu,Ia.defaultValues(nu))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ch:return 1;case xh:return new Ne;case ni:return P;case nu:return new ja;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ch:return t===Ia.defaultValues(e);case xh:return t.isEqual(Ia.defaultValues(e));case ni:return t===P;case nu:return ja.compareWithDefault(ni,t.namedCurve)&&ja.compareWithDefault("x",t.x)&&ja.compareWithDefault("y",t.y);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),new Ne({name:t.privateKey||P}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new je({name:t.namedCurve||P})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new At({name:t.publicKey||P})]})]})}fromSchema(e){we(e,xW);let t=ve(e,e,Ia.schema({names:{version:Ch,privateKey:xh,namedCurve:ni,publicKey:nu}}));if(me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.privateKey=t.result.privateKey,ni in t.result&&(this.namedCurve=t.result.namedCurve.valueBlock.toString()),nu in t.result){let n={schema:t.result.publicKey.valueBlock.valueHex};ni in this&&(n.namedCurve=this.namedCurve),this.publicKey=new ja(n)}}toSchema(){let e=[new le({value:this.version}),this.privateKey];return this.namedCurve&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[new je({value:this.namedCurve})]})),this.publicKey&&e.push(new re({idBlock:{tagClass:3,tagNumber:1},value:[new At({valueHex:this.publicKey.toSchema().toBER(!1)})]})),new H({value:e})}toJSON(){if(!this.namedCurve||Ia.compareWithDefault(ni,this.namedCurve))throw new Error('Not enough information for making JSON: absent "namedCurve" value');let e=Uu.find(this.namedCurve),t={crv:e?e.name:this.namedCurve,d:at.ToBase64Url(this.privateKey.valueBlock.valueHexView)};if(this.publicKey){let n=this.publicKey.toJSON();t.x=n.x,t.y=n.y}return t}fromJSON(e){Ht.assert("json",e,"crv","d");let t=0,n=Uu.find(e.crv);n&&(this.namedCurve=n.id,t=n.size);let s=at.FromBase64Url(e.d);if(s.byteLength<t){let i=new ArrayBuffer(t),a=new Uint8Array(i),o=new Uint8Array(s);a.set(o,1),this.privateKey=new Ne({valueHex:i})}else this.privateKey=new Ne({valueHex:s.slice(0,t)});e.x&&e.y&&(this.publicKey=new ja({json:e}))}};BN.CLASS_NAME="ECPrivateKey";var Gm="prime",$m="exponent",Wm="coefficient",bW=[Gm,$m,Wm],tw=class zm extends Ee{static{u(this,"OtherPrimeInfo")}constructor(e={}){super(),this.prime=T(e,Gm,zm.defaultValues(Gm)),this.exponent=T(e,$m,zm.defaultValues($m)),this.coefficient=T(e,Wm,zm.defaultValues(Wm)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Gm:return new le;case $m:return new le;case Wm:return new le;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.prime||P}),new le({name:t.exponent||P}),new le({name:t.coefficient||P})]})}fromSchema(e){we(e,bW);let t=ve(e,e,zm.schema({names:{prime:Gm,exponent:$m,coefficient:Wm}}));me.assertSchema(t,this.className),this.prime=t.result.prime.convertFromDER(),this.exponent=t.result.exponent.convertFromDER(),this.coefficient=t.result.coefficient.convertFromDER()}toSchema(){return new H({value:[this.prime.convertToDER(),this.exponent.convertToDER(),this.coefficient.convertToDER()]})}toJSON(){return{r:at.ToBase64Url(this.prime.valueBlock.valueHexView),d:at.ToBase64Url(this.exponent.valueBlock.valueHexView),t:at.ToBase64Url(this.coefficient.valueBlock.valueHexView)}}fromJSON(e){Ht.assert("json",e,"r","d","r"),this.prime=new le({valueHex:at.FromBase64Url(e.r)}),this.exponent=new le({valueHex:at.FromBase64Url(e.d)}),this.coefficient=new le({valueHex:at.FromBase64Url(e.t)})}};tw.CLASS_NAME="OtherPrimeInfo";var Jm="version",Ym="modulus",Qm="publicExponent",Zm="privateExponent",eg="prime1",tg="prime2",rg="exponent1",ng="exponent2",sg="coefficient",Fl="otherPrimeInfos",NW=[Jm,Ym,Qm,Zm,eg,tg,rg,ng,sg,Fl],RN=class Ls extends Ee{static{u(this,"RSAPrivateKey")}constructor(e={}){super(),this.version=T(e,Jm,Ls.defaultValues(Jm)),this.modulus=T(e,Ym,Ls.defaultValues(Ym)),this.publicExponent=T(e,Qm,Ls.defaultValues(Qm)),this.privateExponent=T(e,Zm,Ls.defaultValues(Zm)),this.prime1=T(e,eg,Ls.defaultValues(eg)),this.prime2=T(e,tg,Ls.defaultValues(tg)),this.exponent1=T(e,rg,Ls.defaultValues(rg)),this.exponent2=T(e,ng,Ls.defaultValues(ng)),this.coefficient=T(e,sg,Ls.defaultValues(sg)),Fl in e&&(this.otherPrimeInfos=T(e,Fl,Ls.defaultValues(Fl))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Jm:return 0;case Ym:return new le;case Qm:return new le;case Zm:return new le;case eg:return new le;case tg:return new le;case rg:return new le;case ng:return new le;case sg:return new le;case Fl:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),new le({name:t.modulus||P}),new le({name:t.publicExponent||P}),new le({name:t.privateExponent||P}),new le({name:t.prime1||P}),new le({name:t.prime2||P}),new le({name:t.exponent1||P}),new le({name:t.exponent2||P}),new le({name:t.coefficient||P}),new H({optional:!0,value:[new ut({name:t.otherPrimeInfosName||P,value:tw.schema(t.otherPrimeInfo||{})})]})]})}fromSchema(e){we(e,NW);let t=ve(e,e,Ls.schema({names:{version:Jm,modulus:Ym,publicExponent:Qm,privateExponent:Zm,prime1:eg,prime2:tg,exponent1:rg,exponent2:ng,coefficient:sg,otherPrimeInfo:{names:{blockName:Fl}}}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.modulus=t.result.modulus.convertFromDER(256),this.publicExponent=t.result.publicExponent,this.privateExponent=t.result.privateExponent.convertFromDER(256),this.prime1=t.result.prime1.convertFromDER(128),this.prime2=t.result.prime2.convertFromDER(128),this.exponent1=t.result.exponent1.convertFromDER(128),this.exponent2=t.result.exponent2.convertFromDER(128),this.coefficient=t.result.coefficient.convertFromDER(128),Fl in t.result&&(this.otherPrimeInfos=Array.from(t.result.otherPrimeInfos,n=>new tw({schema:n})))}toSchema(){let e=[];return e.push(new le({value:this.version})),e.push(this.modulus.convertToDER()),e.push(this.publicExponent),e.push(this.privateExponent.convertToDER()),e.push(this.prime1.convertToDER()),e.push(this.prime2.convertToDER()),e.push(this.exponent1.convertToDER()),e.push(this.exponent2.convertToDER()),e.push(this.coefficient.convertToDER()),this.otherPrimeInfos&&e.push(new H({value:Array.from(this.otherPrimeInfos,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={n:at.ToBase64Url(this.modulus.valueBlock.valueHexView),e:at.ToBase64Url(this.publicExponent.valueBlock.valueHexView),d:at.ToBase64Url(this.privateExponent.valueBlock.valueHexView),p:at.ToBase64Url(this.prime1.valueBlock.valueHexView),q:at.ToBase64Url(this.prime2.valueBlock.valueHexView),dp:at.ToBase64Url(this.exponent1.valueBlock.valueHexView),dq:at.ToBase64Url(this.exponent2.valueBlock.valueHexView),qi:at.ToBase64Url(this.coefficient.valueBlock.valueHexView)};return this.otherPrimeInfos&&(e.oth=Array.from(this.otherPrimeInfos,t=>t.toJSON())),e}fromJSON(e){Ht.assert("json",e,"n","e","d","p","q","dp","dq","qi"),this.modulus=new le({valueHex:at.FromBase64Url(e.n)}),this.publicExponent=new le({valueHex:at.FromBase64Url(e.e)}),this.privateExponent=new le({valueHex:at.FromBase64Url(e.d)}),this.prime1=new le({valueHex:at.FromBase64Url(e.p)}),this.prime2=new le({valueHex:at.FromBase64Url(e.q)}),this.exponent1=new le({valueHex:at.FromBase64Url(e.dp)}),this.exponent2=new le({valueHex:at.FromBase64Url(e.dq)}),this.coefficient=new le({valueHex:at.FromBase64Url(e.qi)}),e.oth&&(this.otherPrimeInfos=Array.from(e.oth,t=>new tw({json:t})))}};RN.CLASS_NAME="RSAPrivateKey";var ig="version",ag="privateKeyAlgorithm",og="privateKey",Ul="attributes",EE="parsedKey",TW=[ig,ag,og,Ul],W1=class Ml extends Ee{static{u(this,"PrivateKeyInfo")}constructor(e={}){super(),this.version=T(e,ig,Ml.defaultValues(ig)),this.privateKeyAlgorithm=T(e,ag,Ml.defaultValues(ag)),this.privateKey=T(e,og,Ml.defaultValues(og)),Ul in e&&(this.attributes=T(e,Ul,Ml.defaultValues(Ul))),EE in e&&(this.parsedKey=T(e,EE,Ml.defaultValues(EE))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ig:return 0;case ag:return new ce;case og:return new Ne;case Ul:return[];case EE:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),ce.schema(t.privateKeyAlgorithm||{}),new Ne({name:t.privateKey||P}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new ut({name:t.attributes||P,value:_r.schema()})]})]})}fromSchema(e){we(e,TW);let t=ve(e,e,Ml.schema({names:{version:ig,privateKeyAlgorithm:{names:{blockName:ag}},privateKey:og,attributes:Ul}}));switch(me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.privateKeyAlgorithm=new ce({schema:t.result.privateKeyAlgorithm}),this.privateKey=t.result.privateKey,Ul in t.result&&(this.attributes=Array.from(t.result.attributes,n=>new _r({schema:n}))),this.privateKeyAlgorithm.algorithmId){case"1.2.840.113549.1.1.1":{let n=Ar(this.privateKey.valueBlock.valueHexView);n.offset!==-1&&(this.parsedKey=new RN({schema:n.result}))}break;case"1.2.840.10045.2.1":if("algorithmParams"in this.privateKeyAlgorithm&&this.privateKeyAlgorithm.algorithmParams instanceof je){let n=Ar(this.privateKey.valueBlock.valueHexView);n.offset!==-1&&(this.parsedKey=new BN({namedCurve:this.privateKeyAlgorithm.algorithmParams.valueBlock.toString(),schema:n.result}))}break}}toSchema(){let e=[new le({value:this.version}),this.privateKeyAlgorithm.toSchema(),this.privateKey];return this.attributes&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.attributes,t=>t.toSchema())})),new H({value:e})}toJSON(){if(!this.parsedKey){let n={version:this.version,privateKeyAlgorithm:this.privateKeyAlgorithm.toJSON(),privateKey:this.privateKey.toJSON()};return this.attributes&&(n.attributes=Array.from(this.attributes,s=>s.toJSON())),n}let e={};switch(this.privateKeyAlgorithm.algorithmId){case"1.2.840.10045.2.1":e.kty="EC";break;case"1.2.840.113549.1.1.1":e.kty="RSA";break}let t=this.parsedKey.toJSON();return Object.assign(e,t),e}fromJSON(e){if("kty"in e){switch(e.kty.toUpperCase()){case"EC":this.parsedKey=new BN({json:e}),this.privateKeyAlgorithm=new ce({algorithmId:"1.2.840.10045.2.1",algorithmParams:new je({value:this.parsedKey.namedCurve})});break;case"RSA":this.parsedKey=new RN({json:e}),this.privateKeyAlgorithm=new ce({algorithmId:"1.2.840.113549.1.1.1",algorithmParams:new Cr});break;default:throw new Error(`Invalid value for "kty" parameter: ${e.kty}`)}this.privateKey=new Ne({valueHex:this.parsedKey.toSchema().toBER(!1)})}}};W1.CLASS_NAME="PrivateKeyInfo";var bh="contentType",Nh="contentEncryptionAlgorithm",jl="encryptedContent",IW=[bh,Nh,jl],f8=1024,In=class ug extends Ee{static{u(this,"EncryptedContentInfo")}constructor(e={}){if(super(),this.contentType=T(e,bh,ug.defaultValues(bh)),this.contentEncryptionAlgorithm=T(e,Nh,ug.defaultValues(Nh)),jl in e&&e.encryptedContent&&(this.encryptedContent=e.encryptedContent,this.encryptedContent.idBlock.tagClass===1&&this.encryptedContent.idBlock.tagNumber===4&&this.encryptedContent.idBlock.isConstructed===!1&&!e.disableSplit)){let t=new Ne({idBlock:{isConstructed:!0},isConstructed:!0}),n=0,s=this.encryptedContent.valueBlock.valueHexView.slice().buffer,i=s.byteLength;for(;i>0;){let a=new Uint8Array(s,n,n+f8>s.byteLength?s.byteLength-n:f8),o=new ArrayBuffer(a.length),l=new Uint8Array(o);for(let c=0;c<l.length;c++)l[c]=a[c];t.valueBlock.value.push(new Ne({valueHex:o})),i-=a.length,n+=a.length}this.encryptedContent=t}e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case bh:return P;case Nh:return new ce;case jl:return new Ne;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case bh:return t===P;case Nh:return t.algorithmId===P&&!("algorithmParams"in t);case jl:return t.isEqual(ug.defaultValues(jl));default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.contentType||P}),ce.schema(t.contentEncryptionAlgorithm||{}),new mr({value:[new re({name:t.encryptedContent||P,idBlock:{tagClass:3,tagNumber:0},value:[new ut({value:new Ne})]}),new Ze({name:t.encryptedContent||P,idBlock:{tagClass:3,tagNumber:0}})]})]})}fromSchema(e){we(e,IW);let t=ve(e,e,ug.schema({names:{contentType:bh,contentEncryptionAlgorithm:{names:{blockName:Nh}},encryptedContent:jl}}));me.assertSchema(t,this.className),this.contentType=t.result.contentType.valueBlock.toString(),this.contentEncryptionAlgorithm=new ce({schema:t.result.contentEncryptionAlgorithm}),jl in t.result&&(this.encryptedContent=t.result.encryptedContent,this.encryptedContent.idBlock.tagClass=1,this.encryptedContent.idBlock.tagNumber=4)}toSchema(){let e={isIndefiniteForm:!1},t=[];if(t.push(new je({value:this.contentType})),t.push(this.contentEncryptionAlgorithm.toSchema()),this.encryptedContent){e.isIndefiniteForm=this.encryptedContent.idBlock.isConstructed;let n=this.encryptedContent;n.idBlock.tagClass=3,n.idBlock.tagNumber=0,n.lenBlock.isIndefiniteForm=this.encryptedContent.idBlock.isConstructed,t.push(n)}return new H({lenBlock:e,value:t})}toJSON(){let e={contentType:this.contentType,contentEncryptionAlgorithm:this.contentEncryptionAlgorithm.toJSON()};return this.encryptedContent&&(e.encryptedContent=this.encryptedContent.toJSON()),e}getEncryptedContent(){if(!this.encryptedContent)throw new Error("Parameter 'encryptedContent' is undefined");return Ne.prototype.getValue.call(this.encryptedContent)}};In.CLASS_NAME="EncryptedContentInfo";var su="hashAlgorithm",iu="maskGenAlgorithm",au="saltLength",ou="trailerField",DW=[su,iu,au,ou],rw=class ts extends Ee{static{u(this,"RSASSAPSSParams")}constructor(e={}){super(),this.hashAlgorithm=T(e,su,ts.defaultValues(su)),this.maskGenAlgorithm=T(e,iu,ts.defaultValues(iu)),this.saltLength=T(e,au,ts.defaultValues(au)),this.trailerField=T(e,ou,ts.defaultValues(ou)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case su:return new ce({algorithmId:"1.3.14.3.2.26",algorithmParams:new Cr});case iu:return new ce({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:new ce({algorithmId:"1.3.14.3.2.26",algorithmParams:new Cr}).toSchema()});case au:return 20;case ou:return 1;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new re({idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[ce.schema(t.hashAlgorithm||{})]}),new re({idBlock:{tagClass:3,tagNumber:1},optional:!0,value:[ce.schema(t.maskGenAlgorithm||{})]}),new re({idBlock:{tagClass:3,tagNumber:2},optional:!0,value:[new le({name:t.saltLength||P})]}),new re({idBlock:{tagClass:3,tagNumber:3},optional:!0,value:[new le({name:t.trailerField||P})]})]})}fromSchema(e){we(e,DW);let t=ve(e,e,ts.schema({names:{hashAlgorithm:{names:{blockName:su}},maskGenAlgorithm:{names:{blockName:iu}},saltLength:au,trailerField:ou}}));me.assertSchema(t,this.className),su in t.result&&(this.hashAlgorithm=new ce({schema:t.result.hashAlgorithm})),iu in t.result&&(this.maskGenAlgorithm=new ce({schema:t.result.maskGenAlgorithm})),au in t.result&&(this.saltLength=t.result.saltLength.valueBlock.valueDec),ou in t.result&&(this.trailerField=t.result.trailerField.valueBlock.valueDec)}toSchema(){let e=[];return this.hashAlgorithm.isEqual(ts.defaultValues(su))||e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[this.hashAlgorithm.toSchema()]})),this.maskGenAlgorithm.isEqual(ts.defaultValues(iu))||e.push(new re({idBlock:{tagClass:3,tagNumber:1},value:[this.maskGenAlgorithm.toSchema()]})),this.saltLength!==ts.defaultValues(au)&&e.push(new re({idBlock:{tagClass:3,tagNumber:2},value:[new le({value:this.saltLength})]})),this.trailerField!==ts.defaultValues(ou)&&e.push(new re({idBlock:{tagClass:3,tagNumber:3},value:[new le({value:this.trailerField})]})),new H({value:e})}toJSON(){let e={};return this.hashAlgorithm.isEqual(ts.defaultValues(su))||(e.hashAlgorithm=this.hashAlgorithm.toJSON()),this.maskGenAlgorithm.isEqual(ts.defaultValues(iu))||(e.maskGenAlgorithm=this.maskGenAlgorithm.toJSON()),this.saltLength!==ts.defaultValues(au)&&(e.saltLength=this.saltLength),this.trailerField!==ts.defaultValues(ou)&&(e.trailerField=this.trailerField),e}};rw.CLASS_NAME="RSASSAPSSParams";var Th="salt",lg="iterationCount",si="keyLength",Da="prf",BW=[Th,lg,si,Da],$p=class Fi extends Ee{static{u(this,"PBKDF2Params")}constructor(e={}){super(),this.salt=T(e,Th,Fi.defaultValues(Th)),this.iterationCount=T(e,lg,Fi.defaultValues(lg)),si in e&&(this.keyLength=T(e,si,Fi.defaultValues(si))),Da in e&&(this.prf=T(e,Da,Fi.defaultValues(Da))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Th:return{};case lg:return-1;case si:return 0;case Da:return new ce({algorithmId:"1.3.14.3.2.26",algorithmParams:new Cr});default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new mr({value:[new Ne({name:t.saltPrimitive||P}),ce.schema(t.saltConstructed||{})]}),new le({name:t.iterationCount||P}),new le({name:t.keyLength||P,optional:!0}),ce.schema(t.prf||{names:{optional:!0}})]})}fromSchema(e){we(e,BW);let t=ve(e,e,Fi.schema({names:{saltPrimitive:Th,saltConstructed:{names:{blockName:Th}},iterationCount:lg,keyLength:si,prf:{names:{blockName:Da,optional:!0}}}}));me.assertSchema(t,this.className),this.salt=t.result.salt,this.iterationCount=t.result.iterationCount.valueBlock.valueDec,si in t.result&&(this.keyLength=t.result.keyLength.valueBlock.valueDec),Da in t.result&&(this.prf=new ce({schema:t.result.prf}))}toSchema(){let e=[];return e.push(this.salt),e.push(new le({value:this.iterationCount})),si in this&&Fi.defaultValues(si)!==this.keyLength&&e.push(new le({value:this.keyLength})),this.prf&&Fi.defaultValues(Da).isEqual(this.prf)===!1&&e.push(this.prf.toSchema()),new H({value:e})}toJSON(){let e={salt:this.salt.toJSON(),iterationCount:this.iterationCount};return si in this&&Fi.defaultValues(si)!==this.keyLength&&(e.keyLength=this.keyLength),this.prf&&Fi.defaultValues(Da).isEqual(this.prf)===!1&&(e.prf=this.prf.toJSON()),e}};$p.CLASS_NAME="PBKDF2Params";var cg="keyDerivationFunc",fg="encryptionScheme",RW=[cg,fg],ON=class nw extends Ee{static{u(this,"PBES2Params")}constructor(e={}){super(),this.keyDerivationFunc=T(e,cg,nw.defaultValues(cg)),this.encryptionScheme=T(e,fg,nw.defaultValues(fg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case cg:return new ce;case fg:return new ce;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.keyDerivationFunc||{}),ce.schema(t.encryptionScheme||{})]})}fromSchema(e){we(e,RW);let t=ve(e,e,nw.schema({names:{keyDerivationFunc:{names:{blockName:cg}},encryptionScheme:{names:{blockName:fg}}}}));me.assertSchema(t,this.className),this.keyDerivationFunc=new ce({schema:t.result.keyDerivationFunc}),this.encryptionScheme=new ce({schema:t.result.encryptionScheme})}toSchema(){return new H({value:[this.keyDerivationFunc.toSchema(),this.encryptionScheme.toSchema()]})}toJSON(){return{keyDerivationFunc:this.keyDerivationFunc.toJSON(),encryptionScheme:this.encryptionScheme.toJSON()}}};ON.CLASS_NAME="PBES2Params";var OW=class{static{u(this,"AbstractCryptoEngine")}constructor(e){this.crypto=e.crypto,this.subtle="webkitSubtle"in e.crypto?e.crypto.webkitSubtle:e.crypto.subtle,this.name=T(e,"name",P)}async encrypt(...e){return this.subtle.encrypt(...e)}async decrypt(...e){return this.subtle.decrypt(...e)}sign(...e){return this.subtle.sign(...e)}async verify(...e){return this.subtle.verify(...e)}async digest(...e){return this.subtle.digest(...e)}async generateKey(...e){return this.subtle.generateKey(...e)}async deriveKey(...e){return this.subtle.deriveKey(...e)}async deriveBits(...e){return this.subtle.deriveBits(...e)}async wrapKey(...e){return this.subtle.wrapKey(...e)}async unwrapKey(...e){return this.subtle.unwrapKey(...e)}exportKey(...e){return this.subtle.exportKey(...e)}importKey(...e){return this.subtle.importKey(...e)}getRandomValues(e){if(e===null)throw new Error('Argument "array" must not be null');return this.crypto.getRandomValues(e)}};async function h8(r,e,t,n,s){let i,a,o;switch(r.toUpperCase()){case"SHA-1":i=20,a=64,o=s8;break;case"SHA-256":i=32,a=64,o=Ib;break;case"SHA-384":i=48,a=128,o=Rb;break;case"SHA-512":i=64,a=128,o=Bb;break;default:throw new Error("Unsupported hashing algorithm")}let l=new Uint8Array(t),c=new TextDecoder().decode(t);new TextEncoder().encode(c).some((E,A)=>E!==l[A])&&(c=String.fromCharCode(...l));let p=new Uint8Array(c.length*2+2),d=new DataView(p.buffer);for(let E=0;E<c.length;E++)d.setUint16(E*2,c.charCodeAt(E),!1);d.setUint16(c.length*2,0,!1);let g=new Uint8Array(a).fill(3),m=new Uint8Array(n),v=new Uint8Array(a*Math.ceil(m.length/a)).map((E,A)=>m[A%m.length]),y=new Uint8Array(a*Math.ceil(p.length/a)).map((E,A)=>p[A%p.length]),S=new Uint8Array(v.length+y.length);S.set(v),S.set(y,v.length);let C=Math.ceil((e>>3)/i),w=[];for(let E=0;E<C;E++){let A=new Uint8Array(g.length+S.length);A.set(g),A.set(S,g.length);for(let D=0;D<s;D++)A=o(A);let b=new Uint8Array(a).map((D,U)=>A[U%A.length]),V=Math.ceil(m.length/a)+Math.ceil(p.length/a),I=[];for(let D=0;D<V;D++){let U=Array.from(S.slice(D*a,(D+1)*a)),F=511;for(let M=b.length-1;M>=0;M--)F>>=8,F+=b[M]+(U[M]||0),U[M]=F&255;I.push(...U)}S=new Uint8Array(I),w.push(...A)}return new Uint8Array(w.slice(0,e>>3)).buffer}u(h8,"makePKCS12B2Key");function t5(r){let e=typeof r=="string"?{name:r}:r;return"hash"in e?{...e,hash:t5(e.hash)}:e}u(t5,"prepareAlgorithm");var zp=class extends OW{static{u(this,"CryptoEngine")}async importKey(e,t,n,s,i){var a,o,l,c,f,p;let d={},g=t5(n);switch(e.toLowerCase()){case"raw":return this.subtle.importKey("raw",t,n,s,i);case"spki":{let m=Ar(Ye.toArrayBuffer(t));me.assert(m,"keyData");let v=new ci;try{v.fromSchema(m.result)}catch{throw new sr("Incorrect keyData")}switch(g.name.toUpperCase()){case"RSA-PSS":{if(i=["verify"],d.kty="RSA",d.ext=s,d.key_ops=i,!["1.2.840.113549.1.1.1","1.2.840.113549.1.1.10"].includes(v.algorithm.algorithmId))throw new Error(`Incorrect public key algorithm: ${v.algorithm.algorithmId}`);if(!g.hash)throw new Ht("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(g.hash.name.toUpperCase()){case"SHA-1":d.alg="PS1";break;case"SHA-256":d.alg="PS256";break;case"SHA-384":d.alg="PS384";break;case"SHA-512":d.alg="PS512";break;default:throw new Error(`Incorrect hash algorithm: ${g.hash.name.toUpperCase()}`)}let y=v.toJSON();Object.assign(d,y)}break;case"RSASSA-PKCS1-V1_5":{if(i=["verify"],d.kty="RSA",d.ext=s,d.key_ops=i,v.algorithm.algorithmId!=="1.2.840.113549.1.1.1")throw new Error(`Incorrect public key algorithm: ${v.algorithm.algorithmId}`);if(!g.hash)throw new Ht("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(g.hash.name.toUpperCase()){case"SHA-1":d.alg="RS1";break;case"SHA-256":d.alg="RS256";break;case"SHA-384":d.alg="RS384";break;case"SHA-512":d.alg="RS512";break;default:throw new Error(`Incorrect hash algorithm: ${g.hash.name.toUpperCase()}`)}let y=v.toJSON();Object.assign(d,y)}break;case"ECDSA":i=["verify"];case"ECDH":{if(d={kty:"EC",ext:s,key_ops:i},v.algorithm.algorithmId!=="1.2.840.10045.2.1")throw new Error(`Incorrect public key algorithm: ${v.algorithm.algorithmId}`);let y=v.toJSON();Object.assign(d,y)}break;case"RSA-OAEP":{if(d.kty="RSA",d.ext=s,d.key_ops=i,this.name.toLowerCase()==="safari")d.alg="RSA-OAEP";else{if(!g.hash)throw new Ht("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(g.hash.name.toUpperCase()){case"SHA-1":d.alg="RSA-OAEP";break;case"SHA-256":d.alg="RSA-OAEP-256";break;case"SHA-384":d.alg="RSA-OAEP-384";break;case"SHA-512":d.alg="RSA-OAEP-512";break;default:throw new Error(`Incorrect hash algorithm: ${g.hash.name.toUpperCase()}`)}}let y=v.toJSON();Object.assign(d,y)}break;case"RSAES-PKCS1-V1_5":{d.kty="RSA",d.ext=s,d.key_ops=i,d.alg="PS1";let y=v.toJSON();Object.assign(d,y)}break;default:throw new Error(`Incorrect algorithm name: ${g.name.toUpperCase()}`)}}break;case"pkcs8":{let m=new W1,v=Ar(Ye.toArrayBuffer(t));me.assert(v,"keyData");try{m.fromSchema(v.result)}catch{throw new Error("Incorrect keyData")}if(!m.parsedKey)throw new Error("Incorrect keyData");switch(g.name.toUpperCase()){case"RSA-PSS":switch((a=g.hash)===null||a===void 0?void 0:a.name.toUpperCase()){case"SHA-1":d.alg="PS1";break;case"SHA-256":d.alg="PS256";break;case"SHA-384":d.alg="PS384";break;case"SHA-512":d.alg="PS512";break;default:throw new Error(`Incorrect hash algorithm: ${(o=g.hash)===null||o===void 0?void 0:o.name.toUpperCase()}`)}case"RSASSA-PKCS1-V1_5":{if(i=["sign"],d.kty="RSA",d.ext=s,d.key_ops=i,m.privateKeyAlgorithm.algorithmId!=="1.2.840.113549.1.1.1")throw new Error(`Incorrect private key algorithm: ${m.privateKeyAlgorithm.algorithmId}`);if(!("alg"in d))switch((l=g.hash)===null||l===void 0?void 0:l.name.toUpperCase()){case"SHA-1":d.alg="RS1";break;case"SHA-256":d.alg="RS256";break;case"SHA-384":d.alg="RS384";break;case"SHA-512":d.alg="RS512";break;default:throw new Error(`Incorrect hash algorithm: ${(c=g.hash)===null||c===void 0?void 0:c.name.toUpperCase()}`)}let y=m.toJSON();Object.assign(d,y)}break;case"ECDSA":i=["sign"];case"ECDH":{if(d={kty:"EC",ext:s,key_ops:i},m.privateKeyAlgorithm.algorithmId!=="1.2.840.10045.2.1")throw new Error(`Incorrect algorithm: ${m.privateKeyAlgorithm.algorithmId}`);let y=m.toJSON();Object.assign(d,y)}break;case"RSA-OAEP":{if(d.kty="RSA",d.ext=s,d.key_ops=i,this.name.toLowerCase()==="safari")d.alg="RSA-OAEP";else switch((f=g.hash)===null||f===void 0?void 0:f.name.toUpperCase()){case"SHA-1":d.alg="RSA-OAEP";break;case"SHA-256":d.alg="RSA-OAEP-256";break;case"SHA-384":d.alg="RSA-OAEP-384";break;case"SHA-512":d.alg="RSA-OAEP-512";break;default:throw new Error(`Incorrect hash algorithm: ${(p=g.hash)===null||p===void 0?void 0:p.name.toUpperCase()}`)}let y=m.toJSON();Object.assign(d,y)}break;case"RSAES-PKCS1-V1_5":{i=["decrypt"],d.kty="RSA",d.ext=s,d.key_ops=i,d.alg="PS1";let y=m.toJSON();Object.assign(d,y)}break;default:throw new Error(`Incorrect algorithm name: ${g.name.toUpperCase()}`)}}break;case"jwk":d=t;break;default:throw new Error(`Incorrect format: ${e}`)}if(this.name.toLowerCase()==="safari")try{return this.subtle.importKey("jwk",yl(JSON.stringify(d)),n,s,i)}catch{return this.subtle.importKey("jwk",d,n,s,i)}return this.subtle.importKey("jwk",d,n,s,i)}async exportKey(e,t){let n=await this.subtle.exportKey("jwk",t);switch(this.name.toLowerCase()==="safari"&&n instanceof ArrayBuffer&&(n=JSON.parse(zd(n))),e.toLowerCase()){case"raw":return this.subtle.exportKey("raw",t);case"spki":{let s=new ci;try{s.fromJSON(n)}catch{throw new Error("Incorrect key data")}return s.toSchema().toBER(!1)}case"pkcs8":{let s=new W1;try{s.fromJSON(n)}catch{throw new Error("Incorrect key data")}return s.toSchema().toBER(!1)}case"jwk":return n;default:throw new Error(`Incorrect format: ${e}`)}}async convert(e,t,n,s,i,a){if(e.toLowerCase()===t.toLowerCase())return n;let o=await this.importKey(e,n,s,i,a);return this.exportKey(t,o)}getAlgorithmByOID(e,t=!1,n){switch(e){case"1.2.840.113549.1.1.1":return{name:"RSAES-PKCS1-v1_5"};case"1.2.840.113549.1.1.5":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case"1.2.840.113549.1.1.11":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"1.2.840.113549.1.1.12":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case"1.2.840.113549.1.1.13":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case"1.2.840.113549.1.1.10":return{name:"RSA-PSS"};case"1.2.840.113549.1.1.7":return{name:"RSA-OAEP"};case"1.2.840.10045.2.1":case"1.2.840.10045.4.1":return{name:"ECDSA",hash:{name:"SHA-1"}};case"1.2.840.10045.4.3.2":return{name:"ECDSA",hash:{name:"SHA-256"}};case"1.2.840.10045.4.3.3":return{name:"ECDSA",hash:{name:"SHA-384"}};case"1.2.840.10045.4.3.4":return{name:"ECDSA",hash:{name:"SHA-512"}};case"1.3.133.16.840.63.0.2":return{name:"ECDH",kdf:"SHA-1"};case"1.3.132.1.11.1":return{name:"ECDH",kdf:"SHA-256"};case"1.3.132.1.11.2":return{name:"ECDH",kdf:"SHA-384"};case"1.3.132.1.11.3":return{name:"ECDH",kdf:"SHA-512"};case"2.16.840.1.101.3.4.1.2":return{name:"AES-CBC",length:128};case"2.16.840.1.101.3.4.1.22":return{name:"AES-CBC",length:192};case"2.16.840.1.101.3.4.1.42":return{name:"AES-CBC",length:256};case"2.16.840.1.101.3.4.1.6":return{name:"AES-GCM",length:128};case"2.16.840.1.101.3.4.1.26":return{name:"AES-GCM",length:192};case"2.16.840.1.101.3.4.1.46":return{name:"AES-GCM",length:256};case"2.16.840.1.101.3.4.1.4":return{name:"AES-CFB",length:128};case"2.16.840.1.101.3.4.1.24":return{name:"AES-CFB",length:192};case"2.16.840.1.101.3.4.1.44":return{name:"AES-CFB",length:256};case"2.16.840.1.101.3.4.1.5":return{name:"AES-KW",length:128};case"2.16.840.1.101.3.4.1.25":return{name:"AES-KW",length:192};case"2.16.840.1.101.3.4.1.45":return{name:"AES-KW",length:256};case"1.2.840.113549.2.7":return{name:"HMAC",hash:{name:"SHA-1"}};case"1.2.840.113549.2.9":return{name:"HMAC",hash:{name:"SHA-256"}};case"1.2.840.113549.2.10":return{name:"HMAC",hash:{name:"SHA-384"}};case"1.2.840.113549.2.11":return{name:"HMAC",hash:{name:"SHA-512"}};case"1.2.840.113549.1.9.16.3.5":return{name:"DH"};case"1.3.14.3.2.26":return{name:"SHA-1"};case"2.16.840.1.101.3.4.2.1":return{name:"SHA-256"};case"2.16.840.1.101.3.4.2.2":return{name:"SHA-384"};case"2.16.840.1.101.3.4.2.3":return{name:"SHA-512"};case"1.2.840.113549.1.5.12":return{name:"PBKDF2"};case"1.2.840.10045.3.1.7":return{name:"P-256"};case"1.3.132.0.34":return{name:"P-384"};case"1.3.132.0.35":return{name:"P-521"}}if(t)throw new Error(`Unsupported algorithm identifier ${n?`for ${n} `:P}: ${e}`);return{}}getOIDByAlgorithm(e,t=!1,n){let s=P;switch(e.name.toUpperCase()){case"RSAES-PKCS1-V1_5":s="1.2.840.113549.1.1.1";break;case"RSASSA-PKCS1-V1_5":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.113549.1.1.5";break;case"SHA-256":s="1.2.840.113549.1.1.11";break;case"SHA-384":s="1.2.840.113549.1.1.12";break;case"SHA-512":s="1.2.840.113549.1.1.13";break}break;case"RSA-PSS":s="1.2.840.113549.1.1.10";break;case"RSA-OAEP":s="1.2.840.113549.1.1.7";break;case"ECDSA":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.10045.4.1";break;case"SHA-256":s="1.2.840.10045.4.3.2";break;case"SHA-384":s="1.2.840.10045.4.3.3";break;case"SHA-512":s="1.2.840.10045.4.3.4";break}break;case"ECDH":switch(e.kdf.toUpperCase()){case"SHA-1":s="1.3.133.16.840.63.0.2";break;case"SHA-256":s="1.3.132.1.11.1";break;case"SHA-384":s="1.3.132.1.11.2";break;case"SHA-512":s="1.3.132.1.11.3";break}break;case"AES-CTR":break;case"AES-CBC":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.2";break;case 192:s="2.16.840.1.101.3.4.1.22";break;case 256:s="2.16.840.1.101.3.4.1.42";break}break;case"AES-CMAC":break;case"AES-GCM":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.6";break;case 192:s="2.16.840.1.101.3.4.1.26";break;case 256:s="2.16.840.1.101.3.4.1.46";break}break;case"AES-CFB":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.4";break;case 192:s="2.16.840.1.101.3.4.1.24";break;case 256:s="2.16.840.1.101.3.4.1.44";break}break;case"AES-KW":switch(e.length){case 128:s="2.16.840.1.101.3.4.1.5";break;case 192:s="2.16.840.1.101.3.4.1.25";break;case 256:s="2.16.840.1.101.3.4.1.45";break}break;case"HMAC":switch(e.hash.name.toUpperCase()){case"SHA-1":s="1.2.840.113549.2.7";break;case"SHA-256":s="1.2.840.113549.2.9";break;case"SHA-384":s="1.2.840.113549.2.10";break;case"SHA-512":s="1.2.840.113549.2.11";break}break;case"DH":s="1.2.840.113549.1.9.16.3.5";break;case"SHA-1":s="1.3.14.3.2.26";break;case"SHA-256":s="2.16.840.1.101.3.4.2.1";break;case"SHA-384":s="2.16.840.1.101.3.4.2.2";break;case"SHA-512":s="2.16.840.1.101.3.4.2.3";break;case"CONCAT":break;case"HKDF":break;case"PBKDF2":s="1.2.840.113549.1.5.12";break;case"P-256":s="1.2.840.10045.3.1.7";break;case"P-384":s="1.3.132.0.34";break;case"P-521":s="1.3.132.0.35";break}if(!s&&t)throw new Error(`Unsupported algorithm ${n?`for ${n} `:P}: ${e.name}`);return s}getAlgorithmParameters(e,t){let n={algorithm:{},usages:[]};switch(e.toUpperCase()){case"RSAES-PKCS1-V1_5":case"RSASSA-PKCS1-V1_5":switch(t.toLowerCase()){case"generatekey":n={algorithm:{name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},usages:["sign","verify"]};break;case"verify":case"sign":case"importkey":n={algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]};break;case"exportkey":default:return{algorithm:{name:"RSASSA-PKCS1-v1_5"},usages:[]}}break;case"RSA-PSS":switch(t.toLowerCase()){case"sign":case"verify":n={algorithm:{name:"RSA-PSS",hash:{name:"SHA-1"},saltLength:20},usages:["sign","verify"]};break;case"generatekey":n={algorithm:{name:"RSA-PSS",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-1"}},usages:["sign","verify"]};break;case"importkey":n={algorithm:{name:"RSA-PSS",hash:{name:"SHA-1"}},usages:["verify"]};break;case"exportkey":default:return{algorithm:{name:"RSA-PSS"},usages:[]}}break;case"RSA-OAEP":switch(t.toLowerCase()){case"encrypt":case"decrypt":n={algorithm:{name:"RSA-OAEP"},usages:["encrypt","decrypt"]};break;case"generatekey":n={algorithm:{name:"RSA-OAEP",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"importkey":n={algorithm:{name:"RSA-OAEP",hash:{name:"SHA-256"}},usages:["encrypt"]};break;case"exportkey":default:return{algorithm:{name:"RSA-OAEP"},usages:[]}}break;case"ECDSA":switch(t.toLowerCase()){case"generatekey":n={algorithm:{name:"ECDSA",namedCurve:"P-256"},usages:["sign","verify"]};break;case"importkey":n={algorithm:{name:"ECDSA",namedCurve:"P-256"},usages:["verify"]};break;case"verify":case"sign":n={algorithm:{name:"ECDSA",hash:{name:"SHA-256"}},usages:["sign"]};break;default:return{algorithm:{name:"ECDSA"},usages:[]}}break;case"ECDH":switch(t.toLowerCase()){case"exportkey":case"importkey":case"generatekey":n={algorithm:{name:"ECDH",namedCurve:"P-256"},usages:["deriveKey","deriveBits"]};break;case"derivekey":case"derivebits":n={algorithm:{name:"ECDH",namedCurve:"P-256",public:[]},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"ECDH"},usages:[]}}break;case"AES-CTR":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-CTR",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-CTR",counter:new Uint8Array(16),length:10},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-CTR"},usages:[]}}break;case"AES-CBC":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-CBC",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-CBC",iv:this.getRandomValues(new Uint8Array(16))},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-CBC"},usages:[]}}break;case"AES-GCM":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"AES-GCM",length:256},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;case"decrypt":case"encrypt":n={algorithm:{name:"AES-GCM",iv:this.getRandomValues(new Uint8Array(16))},usages:["encrypt","decrypt","wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-GCM"},usages:[]}}break;case"AES-KW":switch(t.toLowerCase()){case"importkey":case"exportkey":case"generatekey":case"wrapkey":case"unwrapkey":n={algorithm:{name:"AES-KW",length:256},usages:["wrapKey","unwrapKey"]};break;default:return{algorithm:{name:"AES-KW"},usages:[]}}break;case"HMAC":switch(t.toLowerCase()){case"sign":case"verify":n={algorithm:{name:"HMAC"},usages:["sign","verify"]};break;case"importkey":case"exportkey":case"generatekey":n={algorithm:{name:"HMAC",length:32,hash:{name:"SHA-256"}},usages:["sign","verify"]};break;default:return{algorithm:{name:"HMAC"},usages:[]}}break;case"HKDF":switch(t.toLowerCase()){case"derivekey":n={algorithm:{name:"HKDF",hash:"SHA-256",salt:new Uint8Array([]),info:new Uint8Array([])},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"HKDF"},usages:[]}}break;case"PBKDF2":switch(t.toLowerCase()){case"derivekey":n={algorithm:{name:"PBKDF2",hash:{name:"SHA-256"},salt:new Uint8Array([]),iterations:1e4},usages:["encrypt","decrypt"]};break;default:return{algorithm:{name:"PBKDF2"},usages:[]}}break}return n}getHashAlgorithm(e){let t=P;switch(e.algorithmId){case"1.2.840.10045.4.1":case"1.2.840.113549.1.1.5":t="SHA-1";break;case"1.2.840.10045.4.3.2":case"1.2.840.113549.1.1.11":t="SHA-256";break;case"1.2.840.10045.4.3.3":case"1.2.840.113549.1.1.12":t="SHA-384";break;case"1.2.840.10045.4.3.4":case"1.2.840.113549.1.1.13":t="SHA-512";break;case"1.2.840.113549.1.1.10":try{let n=new rw({schema:e.algorithmParams});if(n.hashAlgorithm){let s=this.getAlgorithmByOID(n.hashAlgorithm.algorithmId);if("name"in s)t=s.name;else return P}else t="SHA-1"}catch{}break}return t}async encryptEncryptedContentInfo(e){Ht.assert(e,"password","contentEncryptionAlgorithm","hmacHashAlgorithm","iterationCount","contentToEncrypt","contentToEncrypt","contentType");let t=this.getOIDByAlgorithm(e.contentEncryptionAlgorithm,!0,"contentEncryptionAlgorithm"),n=this.getOIDByAlgorithm({name:"PBKDF2"},!0,"PBKDF2"),s=this.getOIDByAlgorithm({name:"HMAC",hash:{name:e.hmacHashAlgorithm}},!0,"hmacHashAlgorithm"),i=new ArrayBuffer(16),a=new Uint8Array(i);this.getRandomValues(a);let o=new ArrayBuffer(64),l=new Uint8Array(o);this.getRandomValues(l);let c=new Uint8Array(e.contentToEncrypt),f=new $p({salt:new Ne({valueHex:o}),iterationCount:e.iterationCount,prf:new ce({algorithmId:s,algorithmParams:new Cr})}),p=new Uint8Array(e.password),d=await this.importKey("raw",p,"PBKDF2",!1,["deriveKey"]),g=await this.deriveKey({name:"PBKDF2",hash:{name:e.hmacHashAlgorithm},salt:l,iterations:e.iterationCount},d,e.contentEncryptionAlgorithm,!1,["encrypt"]),m=await this.encrypt({name:e.contentEncryptionAlgorithm.name,iv:a},g,c),v=new ON({keyDerivationFunc:new ce({algorithmId:n,algorithmParams:f.toSchema()}),encryptionScheme:new ce({algorithmId:t,algorithmParams:new Ne({valueHex:i})})});return new In({contentType:e.contentType,contentEncryptionAlgorithm:new ce({algorithmId:"1.2.840.113549.1.5.13",algorithmParams:v.toSchema()}),encryptedContent:new Ne({valueHex:m})})}async decryptEncryptedContentInfo(e){if(Ht.assert(e,"password","encryptedContentInfo"),e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId!=="1.2.840.113549.1.5.13")throw new Error(`Unknown "contentEncryptionAlgorithm": ${e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId}`);let t;try{t=new ON({schema:e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "pbes2Parameters"')}let n;try{n=new $p({schema:t.keyDerivationFunc.algorithmParams})}catch{throw new Error('Incorrectly encoded "pbkdf2Params"')}let s=this.getAlgorithmByOID(t.encryptionScheme.algorithmId,!0),i=t.encryptionScheme.algorithmParams.valueBlock.valueHex,a=new Uint8Array(i),o=n.salt.valueBlock.valueHex,l=new Uint8Array(o),c=n.iterationCount,f="SHA-1";n.prf&&(f=this.getAlgorithmByOID(n.prf.algorithmId,!0).hash.name);let p=await this.importKey("raw",e.password,"PBKDF2",!1,["deriveKey"]),d=await this.deriveKey({name:"PBKDF2",hash:{name:f},salt:l,iterations:c},p,s,!1,["decrypt"]),g=e.encryptedContentInfo.getEncryptedContent();return this.decrypt({name:s.name,iv:a},d,g)}async stampDataWithPassword(e){if(!(e instanceof Object))throw new Error('Parameters must have type "Object"');Ht.assert(e,"password","hashAlgorithm","iterationCount","salt","contentToStamp");let t;switch(e.hashAlgorithm.toLowerCase()){case"sha-1":t=160;break;case"sha-256":t=256;break;case"sha-384":t=384;break;case"sha-512":t=512;break;default:throw new Error(`Incorrect "parameters.hashAlgorithm" parameter: ${e.hashAlgorithm}`)}let n={name:"HMAC",length:t,hash:{name:e.hashAlgorithm}},s=await h8(e.hashAlgorithm,t,e.password,e.salt,e.iterationCount),i=await this.importKey("raw",new Uint8Array(s),n,!1,["sign"]);return this.sign(n,i,new Uint8Array(e.contentToStamp))}async verifyDataStampedWithPassword(e){Ht.assert(e,"password","hashAlgorithm","salt","iterationCount","contentToVerify","signatureToVerify");let t=0;switch(e.hashAlgorithm.toLowerCase()){case"sha-1":t=160;break;case"sha-256":t=256;break;case"sha-384":t=384;break;case"sha-512":t=512;break;default:throw new Error(`Incorrect "parameters.hashAlgorithm" parameter: ${e.hashAlgorithm}`)}let n={name:"HMAC",length:t,hash:{name:e.hashAlgorithm}},s=await h8(e.hashAlgorithm,t,e.password,e.salt,e.iterationCount),i=await this.importKey("raw",new Uint8Array(s),n,!1,["verify"]);return this.verify(n,i,new Uint8Array(e.signatureToVerify),new Uint8Array(e.contentToVerify))}async getSignatureParameters(e,t="SHA-1"){this.getOIDByAlgorithm({name:t},!0,"hashAlgorithm");let n=new ce,s=this.getAlgorithmParameters(e.algorithm.name,"sign");if(!Object.keys(s.algorithm).length)throw new Error("Parameter 'algorithm' is empty");let i=s.algorithm;switch("hash"in e.algorithm&&e.algorithm.hash&&e.algorithm.hash.name?i.hash.name=e.algorithm.hash.name:i.hash.name=t,e.algorithm.name.toUpperCase()){case"RSASSA-PKCS1-V1_5":case"ECDSA":n.algorithmId=this.getOIDByAlgorithm(i,!0);break;case"RSA-PSS":{switch(i.hash.name.toUpperCase()){case"SHA-256":i.saltLength=32;break;case"SHA-384":i.saltLength=48;break;case"SHA-512":i.saltLength=64;break}let a={};if(i.hash.name.toUpperCase()!=="SHA-1"){let l=this.getOIDByAlgorithm({name:i.hash.name},!0,"hashAlgorithm");a.hashAlgorithm=new ce({algorithmId:l,algorithmParams:new Cr}),a.maskGenAlgorithm=new ce({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:a.hashAlgorithm.toSchema()})}i.saltLength!==20&&(a.saltLength=i.saltLength);let o=new rw(a);n.algorithmId="1.2.840.113549.1.1.10",n.algorithmParams=o.toSchema()}break;default:throw new Error(`Unsupported signature algorithm: ${e.algorithm.name}`)}return{signatureAlgorithm:n,parameters:s}}async signWithPrivateKey(e,t,n){let s=await this.sign(n.algorithm,t,e);return n.algorithm.name==="ECDSA"?PW(s):s}fillPublicKeyParameters(e,t){let n={},s=this.getHashAlgorithm(t);if(s===P)throw new Error(`Unsupported signature algorithm: ${t.algorithmId}`);let i;t.algorithmId==="1.2.840.113549.1.1.10"?i=t.algorithmId:i=e.algorithm.algorithmId;let a=this.getAlgorithmByOID(i,!0);if(n.algorithm=this.getAlgorithmParameters(a.name,"importKey"),"hash"in n.algorithm.algorithm&&(n.algorithm.algorithm.hash.name=s),a.name==="ECDSA"){let o=e.algorithm;if(!o.algorithmParams)throw new Error("Algorithm parameters for ECDSA public key are missed");let l=o.algorithmParams;if("idBlock"in o.algorithmParams&&!(l.idBlock.tagClass===1&&l.idBlock.tagNumber===6))throw new Error("Incorrect type for ECDSA public key parameters");let c=this.getAlgorithmByOID(l.valueBlock.toString(),!0);n.algorithm.algorithm.namedCurve=c.name}return n}async getPublicKey(e,t,n){n||(n=this.fillPublicKeyParameters(e,t));let s=e.toSchema().toBER(!1);return this.importKey("spki",s,n.algorithm.algorithm,!0,n.algorithm.usages)}async verifyWithPublicKey(e,t,n,s,i){let a;if(i){let c={},f;s.algorithmId==="1.2.840.113549.1.1.10"?f=s.algorithmId:f=n.algorithm.algorithmId;let p=this.getAlgorithmByOID(f,!0);if(c.algorithm=this.getAlgorithmParameters(p.name,"importKey"),"hash"in c.algorithm.algorithm&&(c.algorithm.algorithm.hash.name=i),p.name==="ECDSA"){let d=!1;if("algorithmParams"in n.algorithm&&"idBlock"in n.algorithm.algorithmParams&&n.algorithm.algorithmParams.idBlock.tagClass===1&&n.algorithm.algorithmParams.idBlock.tagNumber===6&&(d=!0),d===!1)throw new Error("Incorrect type for ECDSA public key parameters");let g=this.getAlgorithmByOID(n.algorithm.algorithmParams.valueBlock.toString(),!0);c.algorithm.algorithm.namedCurve=g.name}a=await this.getPublicKey(n,null,c)}else{if(i=this.getHashAlgorithm(s),!i)throw new Error(`Unsupported signature algorithm: ${s.algorithmId}`);a=await this.getPublicKey(n,s)}let o=this.getAlgorithmParameters(a.algorithm.name,"verify");"hash"in o.algorithm&&(o.algorithm.hash.name=i);let l=t.valueBlock.valueHexView;if(a.algorithm.name==="ECDSA"){let c=Uu.find(a.algorithm.namedCurve);if(!c)throw new Error("Unsupported named curve in use");let f=Ar(l);me.assert(f,"Signature value"),l=kW(f.result,c.size)}if(a.algorithm.name==="RSA-PSS"){let c=new rw({schema:s.algorithmParams});"saltLength"in c?o.algorithm.saltLength=c.saltLength:o.algorithm.saltLength=20;let f="SHA-1";"hashAlgorithm"in c&&(f=this.getAlgorithmByOID(c.hashAlgorithm.algorithmId,!0).name),o.algorithm.hash.name=f}return this.verify(o.algorithm,a,l,e)}},r5={name:"none",crypto:null};function p8(r){return!!(r&&typeof r=="object"&&"crypto"in r)}u(p8,"isCryptoEngine");function eS(r,...e){let t=null;if(e.length<2)e.length?t=e[0]:t=typeof self<"u"&&self.crypto?new zp({name:"browser",crypto:self.crypto}):null;else{let n=e[0],s=e[1];p8(s)?t=s:p8(n)?t=n:"subtle"in n&&"getRandomValues"in n&&(t=new zp({crypto:n}))}if(typeof process<"u"&&"pid"in process&&typeof global<"u"&&typeof window>"u"){if(typeof global[process.pid]>"u")global[process.pid]={};else if(typeof global[process.pid]!="object")throw new Error(`Name global.${process.pid} already exists and it is not an object`);if(typeof global[process.pid].pkijs>"u")global[process.pid].pkijs={};else if(typeof global[process.pid].pkijs!="object")throw new Error(`Name global.${process.pid}.pkijs already exists and it is not an object`);global[process.pid].pkijs.engine={name:r,crypto:t}}else r5={name:r,crypto:t}}u(eS,"setEngine");function _W(){if(typeof process<"u"&&"pid"in process&&typeof global<"u"&&typeof window>"u"){let r;try{r=global[process.pid].pkijs.engine}catch{throw new Error("Please call 'setEngine' before call to 'getEngine'")}return r}return r5}u(_W,"getEngine");function pt(r=!1){let e=_W();if(!e.crypto&&r)throw new Error("Unable to create WebCrypto object");return e.crypto}u(pt,"getCrypto");function PW(r){if(r.byteLength%2!==0)return Or;let e=r.byteLength/2,t=new ArrayBuffer(e);new Uint8Array(t).set(new Uint8Array(r,0,e));let s=new le({valueHex:t}),i=new ArrayBuffer(e);new Uint8Array(i).set(new Uint8Array(r,e,e));let o=new le({valueHex:i});return new H({value:[s.convertToDER(),o.convertToDER()]}).toBER(!1)}u(PW,"createCMSECDSASignature");function kW(r,e){if(!(r instanceof H&&r.valueBlock.value.length===2&&r.valueBlock.value[0]instanceof le&&r.valueBlock.value[1]instanceof le))return Or;let t=r.valueBlock.value[0].convertFromDER().valueBlock.valueHexView,n=r.valueBlock.value[1].convertFromDER().valueBlock.valueHexView,s=new Uint8Array(e*2);return s.set(t,e-t.byteLength),s.set(n,2*e-n.byteLength),s.buffer}u(kW,"createECDSASignatureFromCMS");async function LW(r,e,t,n,s){switch(r.toUpperCase()){case"SHA-1":case"SHA-256":case"SHA-384":case"SHA-512":break;default:throw new sr(`Unknown hash function: ${r}`)}if(sr.assert(e,"zBuffer","ArrayBuffer"),e.byteLength===0)throw new sr("'zBuffer' has zero length, error");if(sr.assert(n,"SharedInfo","ArrayBuffer"),t>255)throw new sr("Please set 'Counter' argument to value less or equal to 255");let i=new ArrayBuffer(4),a=new Uint8Array(i);a[0]=0,a[1]=0,a[2]=0,a[3]=t;let o=Or;o=gl(o,e),o=gl(o,i),o=gl(o,n);let l=await s.digest({name:r},o);return{counter:t,result:l}}u(LW,"kdfWithCounter");async function d8(r,e,t,n,s=pt(!0)){let i=0,a=1;switch(r.toUpperCase()){case"SHA-1":i=160;break;case"SHA-256":i=256;break;case"SHA-384":i=384;break;case"SHA-512":i=512;break;default:throw new sr(`Unknown hash function: ${r}`)}if(sr.assert(e,"Zbuffer","ArrayBuffer"),e.byteLength===0)throw new sr("'Zbuffer' has zero length, error");sr.assert(n,"SharedInfo","ArrayBuffer");let o=t/i;Math.floor(o)>0&&(a=Math.floor(o),o-a>0&&a++);let l=[];for(let d=1;d<=a;d++)l.push(await LW(r,e,d,n,s));let c=Or,f=1,p=!0;for(;p;){p=!1;for(let d of l)if(d.counter===f){c=gl(c,d.result),p=!0;break}f++}if(t>>=3,c.byteLength>t){let d=new ArrayBuffer(t),g=new Uint8Array(d),m=new Uint8Array(c);for(let v=0;v<t;v++)g[v]=m[v];return d}return c}u(d8,"kdf");var kb="version",Lb="logID",Vb="extensions",Fb="timestamp",Ub="hashAlgorithm",Mb="signatureAlgorithm",jb="signature",m8="none",g8="md5",y8="sha1",v8="sha224",E8="sha256",w8="sha384",S8="sha512",A8="anonymous",C8="rsa",x8="dsa",b8="ecdsa",n5=class uu extends Ee{static{u(this,"SignedCertificateTimestamp")}constructor(e={}){super(),this.version=T(e,kb,uu.defaultValues(kb)),this.logID=T(e,Lb,uu.defaultValues(Lb)),this.timestamp=T(e,Fb,uu.defaultValues(Fb)),this.extensions=T(e,Vb,uu.defaultValues(Vb)),this.hashAlgorithm=T(e,Ub,uu.defaultValues(Ub)),this.signatureAlgorithm=T(e,Mb,uu.defaultValues(Mb)),this.signature=T(e,jb,uu.defaultValues(jb)),"stream"in e&&e.stream&&this.fromStream(e.stream),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case kb:return 0;case Lb:case Vb:return Or;case Fb:return new Date(0);case Ub:case Mb:return P;case jb:return Or;default:return super.defaultValues(e)}}fromSchema(e){if(!(e instanceof rm))throw new Error("Object's schema was not verified against input data for SignedCertificateTimestamp");let t=new Sa({stream:new yn({buffer:e.data})});this.fromStream(t)}fromStream(e){let t=e.getUint16();if(this.version=e.getBlock(1)[0],this.version===0){this.logID=new Uint8Array(e.getBlock(32)).buffer.slice(0),this.timestamp=new Date(va(new Uint8Array(e.getBlock(8)),8));let n=e.getUint16();switch(this.extensions=new Uint8Array(e.getBlock(n)).buffer.slice(0),e.getBlock(1)[0]){case 0:this.hashAlgorithm=m8;break;case 1:this.hashAlgorithm=g8;break;case 2:this.hashAlgorithm=y8;break;case 3:this.hashAlgorithm=v8;break;case 4:this.hashAlgorithm=E8;break;case 5:this.hashAlgorithm=w8;break;case 6:this.hashAlgorithm=S8;break;default:throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}switch(e.getBlock(1)[0]){case 0:this.signatureAlgorithm=A8;break;case 1:this.signatureAlgorithm=C8;break;case 2:this.signatureAlgorithm=x8;break;case 3:this.signatureAlgorithm=b8;break;default:throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}let s=e.getUint16();if(this.signature=new Uint8Array(e.getBlock(s)).buffer.slice(0),t!==47+n+s)throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}}toSchema(){let e=this.toStream();return new rm({data:e.stream.buffer})}toStream(){let e=new Sa;e.appendUint16(47+this.extensions.byteLength+this.signature.byteLength),e.appendChar(this.version),e.appendView(new Uint8Array(this.logID));let t=new ArrayBuffer(8),n=new Uint8Array(t),s=ei(this.timestamp.valueOf(),8);n.set(new Uint8Array(s),8-s.byteLength),e.appendView(n),e.appendUint16(this.extensions.byteLength),this.extensions.byteLength&&e.appendView(new Uint8Array(this.extensions));let i;switch(this.hashAlgorithm.toLowerCase()){case m8:i=0;break;case g8:i=1;break;case y8:i=2;break;case v8:i=3;break;case E8:i=4;break;case w8:i=5;break;case S8:i=6;break;default:throw new Error(`Incorrect data for hashAlgorithm: ${this.hashAlgorithm}`)}e.appendChar(i);let a;switch(this.signatureAlgorithm.toLowerCase()){case A8:a=0;break;case C8:a=1;break;case x8:a=2;break;case b8:a=3;break;default:throw new Error(`Incorrect data for signatureAlgorithm: ${this.signatureAlgorithm}`)}return e.appendChar(a),e.appendUint16(this.signature.byteLength),e.appendView(new Uint8Array(this.signature)),e}toJSON(){return{version:this.version,logID:Q2(this.logID),timestamp:this.timestamp,extensions:Q2(this.extensions),hashAlgorithm:this.hashAlgorithm,signatureAlgorithm:this.signatureAlgorithm,signature:Q2(this.signature)}}async verify(e,t,n=0,s=pt(!0)){let i=eE(zd(this.logID)),a=null,o=new Sa;for(let g of e)if(g.log_id===i){a=g.key;break}if(!a)throw new Error(`Public key not found for CT with logId: ${i}`);let l=yl(nh(a)),c=ci.fromBER(l);o.appendChar(0),o.appendChar(0);let f=new ArrayBuffer(8),p=new Uint8Array(f),d=ei(this.timestamp.valueOf(),8);return p.set(new Uint8Array(d),8-d.byteLength),o.appendView(p),o.appendUint16(n),n===0&&o.appendUint24(t.byteLength),o.appendView(new Uint8Array(t)),o.appendUint16(this.extensions.byteLength),this.extensions.byteLength!==0&&o.appendView(new Uint8Array(this.extensions)),s.verifyWithPublicKey(o.buffer.slice(0,o.length),new Ne({valueHex:this.signature}),c,{algorithmId:P},"SHA-256")}};n5.CLASS_NAME="SignedCertificateTimestamp";var wE="timestamps",s5=class i5 extends Ee{static{u(this,"SignedCertificateTimestampList")}constructor(e={}){super(),this.timestamps=T(e,wE,i5.defaultValues(wE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wE:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case wE:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){var t;let n=T(e,"names",{});return(t=n.optional)!==null&&t!==void 0||(n.optional=!1),new Ne({name:n.blockName||"SignedCertificateTimestampList",optional:n.optional})}fromSchema(e){if(!(e instanceof Ne))throw new Error("Object's schema was not verified against input data for SignedCertificateTimestampList");let t=new Sa({stream:new yn({buffer:e.valueBlock.valueHex})});if(t.getUint16()!==t.length)throw new Error("Object's schema was not verified against input data for SignedCertificateTimestampList");for(;t.length;)this.timestamps.push(new n5({stream:t}))}toSchema(){let e=new Sa,t=0,n=[];for(let s of this.timestamps){let i=s.toStream();n.push(i),t+=i.stream.buffer.byteLength}e.appendUint16(t);for(let s of n)e.appendView(s.stream.view);return new Ne({valueHex:e.stream.buffer.slice(0)})}toJSON(){return{timestamps:Array.from(this.timestamps,e=>e.toJSON())}}};s5.CLASS_NAME="SignedCertificateTimestampList";var hg="attributes",VW=[hg],a5=class _N extends Ee{static{u(this,"SubjectDirectoryAttributes")}constructor(e={}){super(),this.attributes=T(e,hg,_N.defaultValues(hg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case hg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.attributes||P,value:_r.schema()})]})}fromSchema(e){we(e,VW);let t=ve(e,e,_N.schema({names:{attributes:hg}}));me.assertSchema(t,this.className),this.attributes=Array.from(t.result.attributes,n=>new _r({schema:n}))}toSchema(){return new H({value:Array.from(this.attributes,e=>e.toSchema())})}toJSON(){return{attributes:Array.from(this.attributes,e=>e.toJSON())}}};a5.CLASS_NAME="SubjectDirectoryAttributes";var FW=class br{static{u(this,"ExtensionValueFactory")}static getItems(){return this.types||(this.types={},br.register(O8,"SubjectAltName",fN),br.register(_8,"IssuerAltName",fN),br.register(gT,"AuthorityKeyIdentifier",wT),br.register(dT,"BasicConstraints",ST),br.register(Z$,"MicrosoftCaVersion",K8),br.register(F8,"CertificatePolicies",yN),br.register($$,"CertificatePoliciesMicrosoft",yN),br.register(Q$,"MicrosoftCertTemplateV2",lW),br.register(V8,"CRLDistributionPoints",wN),br.register(mT,"FreshestCRL",wN),br.register(W$,"ExtKeyUsage",$8),br.register(k8,"CertificateIssuer",vn),br.register(yT,"AuthorityInfoAccess",CN),br.register(J$,"SubjectInfoAccess",CN),br.register(P8,"IssuingDistributionPoint",z8),br.register(L8,"NameConstraints",J8),br.register(M8,"PolicyConstraints",Y8),br.register(U8,"PolicyMappings",Q8),br.register(q$,"PrivateKeyUsagePeriod",Z8),br.register(eW,"QCStatements",e5),br.register(Y$,"SignedCertificateTimestampList",s5),br.register(U$,"SubjectDirectoryAttributes",a5)),this.types}static fromBER(e,t){let n=Ar(t);if(n.offset===-1)return null;let s=this.find(e);if(s)try{return new s.type({schema:n.result})}catch{let i=new s.type;return i.parsingError=`Incorrectly formatted value of extension ${s.name} (${e})`,i}return n.result}static find(e){return this.getItems()[e]||null}static register(e,t,n){this.getItems()[e]={name:t,type:n}}},pg="extnID",lu="critical",dg="extnValue",SE="parsedValue",UW=[pg,lu,dg],Us=class cu extends Ee{static{u(this,"Extension")}get parsedValue(){if(this._parsedValue===void 0){let e=FW.fromBER(this.extnID,this.extnValue.valueBlock.valueHexView);this._parsedValue=e}return this._parsedValue||void 0}set parsedValue(e){this._parsedValue=e}constructor(e={}){super(),this.extnID=T(e,pg,cu.defaultValues(pg)),this.critical=T(e,lu,cu.defaultValues(lu)),dg in e?this.extnValue=new Ne({valueHex:e.extnValue}):this.extnValue=cu.defaultValues(dg),SE in e&&(this.parsedValue=T(e,SE,cu.defaultValues(SE))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case pg:return P;case lu:return!1;case dg:return new Ne;case SE:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.extnID||P}),new ti({name:t.critical||P,optional:!0}),new Ne({name:t.extnValue||P})]})}fromSchema(e){we(e,UW);let t=ve(e,e,cu.schema({names:{extnID:pg,critical:lu,extnValue:dg}}));me.assertSchema(t,this.className),this.extnID=t.result.extnID.valueBlock.toString(),lu in t.result&&(this.critical=t.result.critical.valueBlock.value),this.extnValue=t.result.extnValue}toSchema(){let e=[];return e.push(new je({value:this.extnID})),this.critical!==cu.defaultValues(lu)&&e.push(new ti({value:this.critical})),e.push(this.extnValue),new H({value:e})}toJSON(){let e={extnID:this.extnID,extnValue:this.extnValue.toJSON()};return this.critical!==cu.defaultValues(lu)&&(e.critical=this.critical),this.parsedValue&&this.parsedValue.toJSON&&(e.parsedValue=this.parsedValue.toJSON()),e}};Us.CLASS_NAME="Extension";var mg="extensions",MW=[mg],Wr=class PN extends Ee{static{u(this,"Extensions")}constructor(e={}){super(),this.extensions=T(e,mg,PN.defaultValues(mg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case mg:return[];default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=T(e,"names",{});return new H({optional:t,name:n.blockName||P,value:[new ut({name:n.extensions||P,value:Us.schema(n.extension||{})})]})}fromSchema(e){we(e,MW);let t=ve(e,e,PN.schema({names:{extensions:mg}}));me.assertSchema(t,this.className),this.extensions=Array.from(t.result.extensions,n=>new Us({schema:n}))}toSchema(){return new H({value:Array.from(this.extensions,e=>e.toSchema())})}toJSON(){return{extensions:this.extensions.map(e=>e.toJSON())}}};Wr.CLASS_NAME="Extensions";var gg="issuer",yg="serialNumber",ql="issuerUID",jW=[gg,yg,ql],Ki=class vg extends Ee{static{u(this,"IssuerSerial")}constructor(e={}){super(),this.issuer=T(e,gg,vg.defaultValues(gg)),this.serialNumber=T(e,yg,vg.defaultValues(yg)),ql in e&&(this.issuerUID=T(e,ql,vg.defaultValues(ql))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case gg:return new vn;case yg:return new le;case ql:return new At;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[vn.schema(t.issuer||{}),new le({name:t.serialNumber||P}),new At({optional:!0,name:t.issuerUID||P})]})}fromSchema(e){we(e,jW);let t=ve(e,e,vg.schema({names:{issuer:{names:{blockName:gg}},serialNumber:yg,issuerUID:ql}}));me.assertSchema(t,this.className),this.issuer=new vn({schema:t.result.issuer}),this.serialNumber=t.result.serialNumber,ql in t.result&&(this.issuerUID=t.result.issuerUID)}toSchema(){let e=new H({value:[this.issuer.toSchema(),this.serialNumber]});return this.issuerUID&&e.valueBlock.value.push(this.issuerUID),e}toJSON(){let e={issuer:this.issuer.toJSON(),serialNumber:this.serialNumber.toJSON()};return this.issuerUID&&(e.issuerUID=this.issuerUID.toJSON()),e}};Ki.CLASS_NAME="IssuerSerial";var Eg="version",Hl="baseCertificateID",Kl="subjectName",wg="issuer",Sg="signature",Ag="serialNumber",Cg="attrCertValidityPeriod",xg="attributes",Xl="issuerUniqueID",Gl="extensions",qW=[Eg,Hl,Kl,wg,Sg,Ag,Cg,xg,Xl,Gl],sw=class Vs extends Ee{static{u(this,"AttributeCertificateInfoV1")}constructor(e={}){super(),this.version=T(e,Eg,Vs.defaultValues(Eg)),Hl in e&&(this.baseCertificateID=T(e,Hl,Vs.defaultValues(Hl))),Kl in e&&(this.subjectName=T(e,Kl,Vs.defaultValues(Kl))),this.issuer=T(e,wg,Vs.defaultValues(wg)),this.signature=T(e,Sg,Vs.defaultValues(Sg)),this.serialNumber=T(e,Ag,Vs.defaultValues(Ag)),this.attrCertValidityPeriod=T(e,Cg,Vs.defaultValues(Cg)),this.attributes=T(e,xg,Vs.defaultValues(xg)),Xl in e&&(this.issuerUniqueID=T(e,Xl,Vs.defaultValues(Xl))),Gl in e&&(this.extensions=T(e,Gl,Vs.defaultValues(Gl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Eg:return 0;case Hl:return new Ki;case Kl:return new vn;case wg:return new vn;case Sg:return new ce;case Ag:return new le;case Cg:return new jc;case xg:return[];case Xl:return new At;case Gl:return new Wr;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),new mr({value:[new re({name:t.baseCertificateID||P,idBlock:{tagClass:3,tagNumber:0},value:Ki.schema().valueBlock.value}),new re({name:t.subjectName||P,idBlock:{tagClass:3,tagNumber:1},value:vn.schema().valueBlock.value})]}),vn.schema({names:{blockName:t.issuer||P}}),ce.schema(t.signature||{}),new le({name:t.serialNumber||P}),jc.schema(t.attrCertValidityPeriod||{}),new H({name:t.attributes||P,value:[new ut({value:_r.schema()})]}),new At({optional:!0,name:t.issuerUniqueID||P}),Wr.schema(t.extensions||{},!0)]})}fromSchema(e){we(e,qW);let t=ve(e,e,Vs.schema({names:{version:Eg,baseCertificateID:Hl,subjectName:Kl,issuer:wg,signature:{names:{blockName:Sg}},serialNumber:Ag,attrCertValidityPeriod:{names:{blockName:Cg}},attributes:xg,issuerUniqueID:Xl,extensions:{names:{blockName:Gl}}}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,Hl in t.result&&(this.baseCertificateID=new Ki({schema:new H({value:t.result.baseCertificateID.valueBlock.value})})),Kl in t.result&&(this.subjectName=new vn({schema:new H({value:t.result.subjectName.valueBlock.value})})),this.issuer=t.result.issuer,this.signature=new ce({schema:t.result.signature}),this.serialNumber=t.result.serialNumber,this.attrCertValidityPeriod=new jc({schema:t.result.attrCertValidityPeriod}),this.attributes=Array.from(t.result.attributes.valueBlock.value,n=>new _r({schema:n})),Xl in t.result&&(this.issuerUniqueID=t.result.issuerUniqueID),Gl in t.result&&(this.extensions=new Wr({schema:t.result.extensions}))}toSchema(){let e=new H({value:[new le({value:this.version})]});return this.baseCertificateID&&e.valueBlock.value.push(new re({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.subjectName&&e.valueBlock.value.push(new re({idBlock:{tagClass:3,tagNumber:1},value:this.subjectName.toSchema().valueBlock.value})),e.valueBlock.value.push(this.issuer.toSchema()),e.valueBlock.value.push(this.signature.toSchema()),e.valueBlock.value.push(this.serialNumber),e.valueBlock.value.push(this.attrCertValidityPeriod.toSchema()),e.valueBlock.value.push(new H({value:Array.from(this.attributes,t=>t.toSchema())})),this.issuerUniqueID&&e.valueBlock.value.push(this.issuerUniqueID),this.extensions&&e.valueBlock.value.push(this.extensions.toSchema()),e}toJSON(){let e={version:this.version};return this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.subjectName&&(e.subjectName=this.subjectName.toJSON()),e.issuer=this.issuer.toJSON(),e.signature=this.signature.toJSON(),e.serialNumber=this.serialNumber.toJSON(),e.attrCertValidityPeriod=this.attrCertValidityPeriod.toJSON(),e.attributes=Array.from(this.attributes,t=>t.toJSON()),this.issuerUniqueID&&(e.issuerUniqueID=this.issuerUniqueID.toJSON()),this.extensions&&(e.extensions=this.extensions.toJSON()),e}};sw.CLASS_NAME="AttributeCertificateInfoV1";var bg="acinfo",Ng="signatureAlgorithm",Tg="signatureValue",HW=[bg,Tg,Ng],tS=class Ig extends Ee{static{u(this,"AttributeCertificateV1")}constructor(e={}){super(),this.acinfo=T(e,bg,Ig.defaultValues(bg)),this.signatureAlgorithm=T(e,Ng,Ig.defaultValues(Ng)),this.signatureValue=T(e,Tg,Ig.defaultValues(Tg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case bg:return new sw;case Ng:return new ce;case Tg:return new At;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[sw.schema(t.acinfo||{}),ce.schema(t.signatureAlgorithm||{}),new At({name:t.signatureValue||P})]})}fromSchema(e){we(e,HW);let t=ve(e,e,Ig.schema({names:{acinfo:{names:{blockName:bg}},signatureAlgorithm:{names:{blockName:Ng}},signatureValue:Tg}}));me.assertSchema(t,this.className),this.acinfo=new sw({schema:t.result.acinfo}),this.signatureAlgorithm=new ce({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}toSchema(){return new H({value:[this.acinfo.toSchema(),this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){return{acinfo:this.acinfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()}}};tS.CLASS_NAME="AttributeCertificateV1";var Dg="digestedObjectType",$l="otherObjectTypeID",Bg="digestAlgorithm",Rg="objectDigest",KW=[Dg,$l,Bg,Rg],qc=class Ih extends Ee{static{u(this,"ObjectDigestInfo")}constructor(e={}){super(),this.digestedObjectType=T(e,Dg,Ih.defaultValues(Dg)),$l in e&&(this.otherObjectTypeID=T(e,$l,Ih.defaultValues($l))),this.digestAlgorithm=T(e,Bg,Ih.defaultValues(Bg)),this.objectDigest=T(e,Rg,Ih.defaultValues(Rg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Dg:return new Fo;case $l:return new je;case Bg:return new ce;case Rg:return new At;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new Fo({name:t.digestedObjectType||P}),new je({optional:!0,name:t.otherObjectTypeID||P}),ce.schema(t.digestAlgorithm||{}),new At({name:t.objectDigest||P})]})}fromSchema(e){we(e,KW);let t=ve(e,e,Ih.schema({names:{digestedObjectType:Dg,otherObjectTypeID:$l,digestAlgorithm:{names:{blockName:Bg}},objectDigest:Rg}}));me.assertSchema(t,this.className),this.digestedObjectType=t.result.digestedObjectType,$l in t.result&&(this.otherObjectTypeID=t.result.otherObjectTypeID),this.digestAlgorithm=new ce({schema:t.result.digestAlgorithm}),this.objectDigest=t.result.objectDigest}toSchema(){let e=new H({value:[this.digestedObjectType]});return this.otherObjectTypeID&&e.valueBlock.value.push(this.otherObjectTypeID),e.valueBlock.value.push(this.digestAlgorithm.toSchema()),e.valueBlock.value.push(this.objectDigest),e}toJSON(){let e={digestedObjectType:this.digestedObjectType.toJSON(),digestAlgorithm:this.digestAlgorithm.toJSON(),objectDigest:this.objectDigest.toJSON()};return this.otherObjectTypeID&&(e.otherObjectTypeID=this.otherObjectTypeID.toJSON()),e}};qc.CLASS_NAME="ObjectDigestInfo";var Wl="issuerName",zl="baseCertificateID",Jl="objectDigestInfo",XW=[Wl,zl,Jl],kN=class Og extends Ee{static{u(this,"V2Form")}constructor(e={}){super(),Wl in e&&(this.issuerName=T(e,Wl,Og.defaultValues(Wl))),zl in e&&(this.baseCertificateID=T(e,zl,Og.defaultValues(zl))),Jl in e&&(this.objectDigestInfo=T(e,Jl,Og.defaultValues(Jl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Wl:return new vn;case zl:return new Ki;case Jl:return new qc;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[vn.schema({names:{blockName:t.issuerName}},!0),new re({optional:!0,name:t.baseCertificateID||P,idBlock:{tagClass:3,tagNumber:0},value:Ki.schema().valueBlock.value}),new re({optional:!0,name:t.objectDigestInfo||P,idBlock:{tagClass:3,tagNumber:1},value:qc.schema().valueBlock.value})]})}fromSchema(e){we(e,XW);let t=ve(e,e,Og.schema({names:{issuerName:Wl,baseCertificateID:zl,objectDigestInfo:Jl}}));me.assertSchema(t,this.className),Wl in t.result&&(this.issuerName=new vn({schema:t.result.issuerName})),zl in t.result&&(this.baseCertificateID=new Ki({schema:new H({value:t.result.baseCertificateID.valueBlock.value})})),Jl in t.result&&(this.objectDigestInfo=new qc({schema:new H({value:t.result.objectDigestInfo.valueBlock.value})}))}toSchema(){let e=new H;return this.issuerName&&e.valueBlock.value.push(this.issuerName.toSchema()),this.baseCertificateID&&e.valueBlock.value.push(new re({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.objectDigestInfo&&e.valueBlock.value.push(new re({idBlock:{tagClass:3,tagNumber:1},value:this.objectDigestInfo.toSchema().valueBlock.value})),e}toJSON(){let e={};return this.issuerName&&(e.issuerName=this.issuerName.toJSON()),this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.objectDigestInfo&&(e.objectDigestInfo=this.objectDigestInfo.toJSON()),e}};kN.CLASS_NAME="V2Form";var Yl="baseCertificateID",Ql="entityName",Zl="objectDigestInfo",GW=[Yl,Ql,Zl],iw=class _g extends Ee{static{u(this,"Holder")}constructor(e={}){super(),Yl in e&&(this.baseCertificateID=T(e,Yl,_g.defaultValues(Yl))),Ql in e&&(this.entityName=T(e,Ql,_g.defaultValues(Ql))),Zl in e&&(this.objectDigestInfo=T(e,Zl,_g.defaultValues(Zl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yl:return new Ki;case Ql:return new vn;case Zl:return new qc;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new re({optional:!0,name:t.baseCertificateID||P,idBlock:{tagClass:3,tagNumber:0},value:Ki.schema().valueBlock.value}),new re({optional:!0,name:t.entityName||P,idBlock:{tagClass:3,tagNumber:1},value:vn.schema().valueBlock.value}),new re({optional:!0,name:t.objectDigestInfo||P,idBlock:{tagClass:3,tagNumber:2},value:qc.schema().valueBlock.value})]})}fromSchema(e){we(e,GW);let t=ve(e,e,_g.schema({names:{baseCertificateID:Yl,entityName:Ql,objectDigestInfo:Zl}}));me.assertSchema(t,this.className),Yl in t.result&&(this.baseCertificateID=new Ki({schema:new H({value:t.result.baseCertificateID.valueBlock.value})})),Ql in t.result&&(this.entityName=new vn({schema:new H({value:t.result.entityName.valueBlock.value})})),Zl in t.result&&(this.objectDigestInfo=new qc({schema:new H({value:t.result.objectDigestInfo.valueBlock.value})}))}toSchema(){let e=new H;return this.baseCertificateID&&e.valueBlock.value.push(new re({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.entityName&&e.valueBlock.value.push(new re({idBlock:{tagClass:3,tagNumber:1},value:this.entityName.toSchema().valueBlock.value})),this.objectDigestInfo&&e.valueBlock.value.push(new re({idBlock:{tagClass:3,tagNumber:2},value:this.objectDigestInfo.toSchema().valueBlock.value})),e}toJSON(){let e={};return this.baseCertificateID&&(e.baseCertificateID=this.baseCertificateID.toJSON()),this.entityName&&(e.entityName=this.entityName.toJSON()),this.objectDigestInfo&&(e.objectDigestInfo=this.objectDigestInfo.toJSON()),e}};iw.CLASS_NAME="Holder";var Pg="version",kg="holder",Lg="issuer",Vg="signature",Fg="serialNumber",Ug="attrCertValidityPeriod",Mg="attributes",ec="issuerUniqueID",tc="extensions",$W=[Pg,kg,Lg,Vg,Fg,Ug,Mg,ec,tc],aw=class ii extends Ee{static{u(this,"AttributeCertificateInfoV2")}constructor(e={}){super(),this.version=T(e,Pg,ii.defaultValues(Pg)),this.holder=T(e,kg,ii.defaultValues(kg)),this.issuer=T(e,Lg,ii.defaultValues(Lg)),this.signature=T(e,Vg,ii.defaultValues(Vg)),this.serialNumber=T(e,Fg,ii.defaultValues(Fg)),this.attrCertValidityPeriod=T(e,Ug,ii.defaultValues(Ug)),this.attributes=T(e,Mg,ii.defaultValues(Mg)),ec in e&&(this.issuerUniqueID=T(e,ec,ii.defaultValues(ec))),tc in e&&(this.extensions=T(e,tc,ii.defaultValues(tc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pg:return 1;case kg:return new iw;case Lg:return{};case Vg:return new ce;case Fg:return new le;case Ug:return new jc;case Mg:return[];case ec:return new At;case tc:return new Wr;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),iw.schema(t.holder||{}),new mr({value:[vn.schema({names:{blockName:t.issuer||P}}),new re({name:t.issuer||P,idBlock:{tagClass:3,tagNumber:0},value:kN.schema().valueBlock.value})]}),ce.schema(t.signature||{}),new le({name:t.serialNumber||P}),jc.schema(t.attrCertValidityPeriod||{}),new H({name:t.attributes||P,value:[new ut({value:_r.schema()})]}),new At({optional:!0,name:t.issuerUniqueID||P}),Wr.schema(t.extensions||{},!0)]})}fromSchema(e){we(e,$W);let t=ve(e,e,ii.schema({names:{version:Pg,holder:{names:{blockName:kg}},issuer:Lg,signature:{names:{blockName:Vg}},serialNumber:Fg,attrCertValidityPeriod:{names:{blockName:Ug}},attributes:Mg,issuerUniqueID:ec,extensions:{names:{blockName:tc}}}}));switch(me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.holder=new iw({schema:t.result.holder}),t.result.issuer.idBlock.tagClass){case 3:this.issuer=new kN({schema:new H({value:t.result.issuer.valueBlock.value})});break;case 1:default:throw new Error("Incorrect value for 'issuer' in AttributeCertificateInfoV2")}this.signature=new ce({schema:t.result.signature}),this.serialNumber=t.result.serialNumber,this.attrCertValidityPeriod=new jc({schema:t.result.attrCertValidityPeriod}),this.attributes=Array.from(t.result.attributes.valueBlock.value,n=>new _r({schema:n})),ec in t.result&&(this.issuerUniqueID=t.result.issuerUniqueID),tc in t.result&&(this.extensions=new Wr({schema:t.result.extensions}))}toSchema(){let e=new H({value:[new le({value:this.version}),this.holder.toSchema(),new re({idBlock:{tagClass:3,tagNumber:0},value:this.issuer.toSchema().valueBlock.value}),this.signature.toSchema(),this.serialNumber,this.attrCertValidityPeriod.toSchema(),new H({value:Array.from(this.attributes,t=>t.toSchema())})]});return this.issuerUniqueID&&e.valueBlock.value.push(this.issuerUniqueID),this.extensions&&e.valueBlock.value.push(this.extensions.toSchema()),e}toJSON(){let e={version:this.version,holder:this.holder.toJSON(),issuer:this.issuer.toJSON(),signature:this.signature.toJSON(),serialNumber:this.serialNumber.toJSON(),attrCertValidityPeriod:this.attrCertValidityPeriod.toJSON(),attributes:Array.from(this.attributes,t=>t.toJSON())};return this.issuerUniqueID&&(e.issuerUniqueID=this.issuerUniqueID.toJSON()),this.extensions&&(e.extensions=this.extensions.toJSON()),e}};aw.CLASS_NAME="AttributeCertificateInfoV2";var jg="acinfo",qg="signatureAlgorithm",Hg="signatureValue",WW=[jg,qg,Hg],Fu=class Kg extends Ee{static{u(this,"AttributeCertificateV2")}constructor(e={}){super(),this.acinfo=T(e,jg,Kg.defaultValues(jg)),this.signatureAlgorithm=T(e,qg,Kg.defaultValues(qg)),this.signatureValue=T(e,Hg,Kg.defaultValues(Hg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case jg:return new aw;case qg:return new ce;case Hg:return new At;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[aw.schema(t.acinfo||{}),ce.schema(t.signatureAlgorithm||{}),new At({name:t.signatureValue||P})]})}fromSchema(e){we(e,WW);let t=ve(e,e,Kg.schema({names:{acinfo:{names:{blockName:jg}},signatureAlgorithm:{names:{blockName:qg}},signatureValue:Hg}}));me.assertSchema(t,this.className),this.acinfo=new aw({schema:t.result.acinfo}),this.signatureAlgorithm=new ce({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}toSchema(){return new H({value:[this.acinfo.toSchema(),this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){return{acinfo:this.acinfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()}}};Fu.CLASS_NAME="AttributeCertificateV2";var rc="contentType",Dh="content",zW=[rc,Dh],Nr=class ow extends Ee{static{u(this,"ContentInfo")}constructor(e={}){super(),this.contentType=T(e,rc,ow.defaultValues(rc)),this.content=T(e,Dh,ow.defaultValues(Dh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case rc:return P;case Dh:return new nt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case rc:return typeof t=="string"&&t===this.defaultValues(rc);case Dh:return t instanceof nt;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return"optional"in t||(t.optional=!1),new H({name:t.blockName||"ContentInfo",optional:t.optional,value:[new je({name:t.contentType||rc}),new re({idBlock:{tagClass:3,tagNumber:0},value:[new nt({name:t.content||Dh})]})]})}fromSchema(e){we(e,zW);let t=ve(e,e,ow.schema());me.assertSchema(t,this.className),this.contentType=t.result.contentType.valueBlock.toString(),this.content=t.result.content}toSchema(){return new H({value:[new je({value:this.contentType}),new re({idBlock:{tagClass:3,tagNumber:0},value:[this.content]})]})}toJSON(){let e={contentType:this.contentType};return this.content instanceof nt||(e.content=this.content.toJSON()),e}};Nr.CLASS_NAME="ContentInfo";Nr.DATA=vT;Nr.SIGNED_DATA=j8;Nr.ENVELOPED_DATA=q8;Nr.ENCRYPTED_DATA=H8;var qb="type",Hb="value",LN="utcTimeName",VN="generalTimeName",JW=[LN,VN],N8;(function(r){r[r.UTCTime=0]="UTCTime",r[r.GeneralizedTime=1]="GeneralizedTime",r[r.empty=2]="empty"})(N8||(N8={}));var En=class uw extends Ee{static{u(this,"Time")}constructor(e={}){super(),this.type=T(e,qb,uw.defaultValues(qb)),this.value=T(e,Hb,uw.defaultValues(Hb)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qb:return 0;case Hb:return new Date(0,0,0);default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=T(e,"names",{});return new mr({optional:t,value:[new wl({name:n.utcTimeName||P}),new dr({name:n.generalTimeName||P})]})}fromSchema(e){we(e,JW);let t=ve(e,e,uw.schema({names:{utcTimeName:LN,generalTimeName:VN}}));me.assertSchema(t,this.className),LN in t.result&&(this.type=0,this.value=t.result.utcTimeName.toDate()),VN in t.result&&(this.type=1,this.value=t.result.generalTimeName.toDate())}toSchema(){return this.type===0?new wl({valueDate:this.value}):this.type===1?new dr({valueDate:this.value}):{}}toJSON(){return{type:this.type,value:this.value}}};En.CLASS_NAME="Time";var Kb="tbs",fu="version",lw="serialNumber",cw="signature",fw="issuer",hw="notBefore",pw="notAfter",dw="subject",mw="subjectPublicKeyInfo",Xg="issuerUniqueID",Gg="subjectUniqueID",$g="extensions",Wg="signatureAlgorithm",zg="signatureValue",gs="tbsCertificate",rS=`${gs}.${fu}`,AT=`${gs}.${lw}`,CT=`${gs}.${cw}`,xT=`${gs}.${fw}`,nS=`${gs}.${hw}`,sS=`${gs}.${pw}`,bT=`${gs}.${dw}`,NT=`${gs}.${mw}`,iS=`${gs}.${Xg}`,aS=`${gs}.${Gg}`,j1=`${gs}.${$g}`,YW=[gs,rS,AT,CT,xT,nS,sS,bT,NT,iS,aS,j1,Wg,zg];function QW(r={}){let e=T(r,"names",{});return new H({name:e.blockName||gs,value:[new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new le({name:e.tbsCertificateVersion||rS})]}),new le({name:e.tbsCertificateSerialNumber||AT}),ce.schema(e.signature||{names:{blockName:CT}}),gr.schema(e.issuer||{names:{blockName:xT}}),new H({name:e.tbsCertificateValidity||"tbsCertificate.validity",value:[En.schema(e.notBefore||{names:{utcTimeName:nS,generalTimeName:nS}}),En.schema(e.notAfter||{names:{utcTimeName:sS,generalTimeName:sS}})]}),gr.schema(e.subject||{names:{blockName:bT}}),ci.schema(e.subjectPublicKeyInfo||{names:{blockName:NT}}),new Ze({name:e.tbsCertificateIssuerUniqueID||iS,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new Ze({name:e.tbsCertificateSubjectUniqueID||aS,optional:!0,idBlock:{tagClass:3,tagNumber:2}}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:3},value:[Wr.schema(e.extensions||{names:{blockName:j1}})]})]})}u(QW,"tbsCertificate");var Dn=class $r extends Ee{static{u(this,"Certificate")}get tbs(){return Ye.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(T(e,Kb,$r.defaultValues(Kb))),this.version=T(e,fu,$r.defaultValues(fu)),this.serialNumber=T(e,lw,$r.defaultValues(lw)),this.signature=T(e,cw,$r.defaultValues(cw)),this.issuer=T(e,fw,$r.defaultValues(fw)),this.notBefore=T(e,hw,$r.defaultValues(hw)),this.notAfter=T(e,pw,$r.defaultValues(pw)),this.subject=T(e,dw,$r.defaultValues(dw)),this.subjectPublicKeyInfo=T(e,mw,$r.defaultValues(mw)),Xg in e&&(this.issuerUniqueID=T(e,Xg,$r.defaultValues(Xg))),Gg in e&&(this.subjectUniqueID=T(e,Gg,$r.defaultValues(Gg))),$g in e&&(this.extensions=T(e,$g,$r.defaultValues($g))),this.signatureAlgorithm=T(e,Wg,$r.defaultValues(Wg)),this.signatureValue=T(e,zg,$r.defaultValues(zg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Kb:return Or;case fu:return 0;case lw:return new le;case cw:return new ce;case fw:return new gr;case hw:return new En;case pw:return new En;case dw:return new gr;case mw:return new ci;case Xg:return Or;case Gg:return Or;case $g:return[];case Wg:return new ce;case zg:return new At;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[QW(t.tbsCertificate),ce.schema(t.signatureAlgorithm||{names:{blockName:Wg}}),new At({name:t.signatureValue||zg})]})}fromSchema(e){we(e,YW);let t=ve(e,e,$r.schema({names:{tbsCertificate:{names:{extensions:{names:{extensions:j1}}}}}}));me.assertSchema(t,this.className),this.tbsView=t.result.tbsCertificate.valueBeforeDecodeView,rS in t.result&&(this.version=t.result[rS].valueBlock.valueDec),this.serialNumber=t.result[AT],this.signature=new ce({schema:t.result[CT]}),this.issuer=new gr({schema:t.result[xT]}),this.notBefore=new En({schema:t.result[nS]}),this.notAfter=new En({schema:t.result[sS]}),this.subject=new gr({schema:t.result[bT]}),this.subjectPublicKeyInfo=new ci({schema:t.result[NT]}),iS in t.result&&(this.issuerUniqueID=t.result[iS].valueBlock.valueHex),aS in t.result&&(this.subjectUniqueID=t.result[aS].valueBlock.valueHex),j1 in t.result&&(this.extensions=Array.from(t.result[j1],n=>new Us({schema:n}))),this.signatureAlgorithm=new ce({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[];return fu in this&&this.version!==$r.defaultValues(fu)&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new le({value:this.version})]})),e.push(this.serialNumber),e.push(this.signature.toSchema()),e.push(this.issuer.toSchema()),e.push(new H({value:[this.notBefore.toSchema(),this.notAfter.toSchema()]})),e.push(this.subject.toSchema()),e.push(this.subjectPublicKeyInfo.toSchema()),this.issuerUniqueID&&e.push(new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:1},valueHex:this.issuerUniqueID})),this.subjectUniqueID&&e.push(new Ze({optional:!0,idBlock:{tagClass:3,tagNumber:2},valueHex:this.subjectUniqueID})),this.extensions&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:3},value:[new H({value:Array.from(this.extensions,t=>t.toSchema())})]})),new H({value:e})}toSchema(e=!1){let t;if(e===!1){if(!this.tbsView.byteLength)return $r.schema().value[0];let n=Ar(this.tbsView);me.assert(n,"TBS Certificate"),t=n.result}else t=this.encodeTBS();return new H({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:at.ToHex(this.tbsView),version:this.version,serialNumber:this.serialNumber.toJSON(),signature:this.signature.toJSON(),issuer:this.issuer.toJSON(),notBefore:this.notBefore.toJSON(),notAfter:this.notAfter.toJSON(),subject:this.subject.toJSON(),subjectPublicKeyInfo:this.subjectPublicKeyInfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return fu in this&&this.version!==$r.defaultValues(fu)&&(e.version=this.version),this.issuerUniqueID&&(e.issuerUniqueID=at.ToHex(this.issuerUniqueID)),this.subjectUniqueID&&(e.subjectUniqueID=at.ToHex(this.subjectUniqueID)),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}async getPublicKey(e,t=pt(!0)){return t.getPublicKey(this.subjectPublicKeyInfo,this.signatureAlgorithm,e)}async getKeyHash(e="SHA-1",t=pt(!0)){return t.digest({name:e},this.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView)}async sign(e,t="SHA-1",n=pt(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters;this.signature=s.signatureAlgorithm,this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new At({valueHex:a})}async verify(e,t=pt(!0)){let n;if(e?n=e.subjectPublicKeyInfo:this.issuer.isEqual(this.subject)&&(n=this.subjectPublicKeyInfo),!(n instanceof ci))throw new Error("Please provide issuer certificate as a parameter");return t.verifyWithPublicKey(this.tbsView,this.signatureValue,n,this.signatureAlgorithm)}};Dn.CLASS_NAME="Certificate";function o5(r,e=null){if(e&&r.issuer.isEqual(e.issuer)&&r.serialNumber.isEqual(e.serialNumber))return null;let t=!1;if(r.extensions){for(let n of r.extensions)if(n.extnID===dT&&n.parsedValue instanceof ST&&n.parsedValue.cA){t=!0;break}}return t?r:null}u(o5,"checkCA");var Bh="certId",Rh="certValue",oh="parsedValue",ZW=[Bh,Rh],u5=class Jg extends Ee{static{u(this,"CertBag")}constructor(e={}){super(),this.certId=T(e,Bh,Jg.defaultValues(Bh)),this.certValue=T(e,Rh,Jg.defaultValues(Rh)),oh in e&&(this.parsedValue=T(e,oh,Jg.defaultValues(oh))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Bh:return P;case Rh:return new nt;case oh:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Bh:return t===P;case Rh:return t instanceof nt;case oh:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.id||"id"}),new re({idBlock:{tagClass:3,tagNumber:0},value:[new nt({name:t.value||"value"})]})]})}fromSchema(e){we(e,ZW);let t=ve(e,e,Jg.schema({names:{id:Bh,value:Rh}}));me.assertSchema(t,this.className),this.certId=t.result.certId.valueBlock.toString(),this.certValue=t.result.certValue;let n=this.certValue.valueBlock.valueHexView;switch(this.certId){case u8:try{this.parsedValue=Dn.fromBER(n)}catch{Fu.fromBER(n)}break;case l8:this.parsedValue=Fu.fromBER(n);break;case rW:default:throw new Error(`Incorrect CERT_ID value in CertBag: ${this.certId}`)}}toSchema(){return oh in this&&("acinfo"in this.parsedValue?this.certId=l8:this.certId=u8,this.certValue=new Ne({valueHex:this.parsedValue.toSchema().toBER(!1)})),new H({value:[new je({value:this.certId}),new re({idBlock:{tagClass:3,tagNumber:0},value:["toSchema"in this.certValue?this.certValue.toSchema():this.certValue]})]})}toJSON(){return{certId:this.certId,certValue:this.certValue.toJSON()}}};u5.CLASS_NAME="CertBag";var Yg="userCertificate",Oh="revocationDate",nc="crlEntryExtensions",ez=[Yg,Oh,nc],l5=class Qg extends Ee{static{u(this,"RevokedCertificate")}constructor(e={}){super(),this.userCertificate=T(e,Yg,Qg.defaultValues(Yg)),this.revocationDate=T(e,Oh,Qg.defaultValues(Oh)),nc in e&&(this.crlEntryExtensions=T(e,nc,Qg.defaultValues(nc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yg:return new le;case Oh:return new En;case nc:return new Wr;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.userCertificate||Yg}),En.schema({names:{utcTimeName:t.revocationDate||Oh,generalTimeName:t.revocationDate||Oh}}),Wr.schema({names:{blockName:t.crlEntryExtensions||nc}},!0)]})}fromSchema(e){we(e,ez);let t=ve(e,e,Qg.schema());me.assertSchema(t,this.className),this.userCertificate=t.result.userCertificate,this.revocationDate=new En({schema:t.result.revocationDate}),nc in t.result&&(this.crlEntryExtensions=new Wr({schema:t.result.crlEntryExtensions}))}toSchema(){let e=[this.userCertificate,this.revocationDate.toSchema()];return this.crlEntryExtensions&&e.push(this.crlEntryExtensions.toSchema()),new H({value:e})}toJSON(){let e={userCertificate:this.userCertificate.toJSON(),revocationDate:this.revocationDate.toJSON()};return this.crlEntryExtensions&&(e.crlEntryExtensions=this.crlEntryExtensions.toJSON()),e}};l5.CLASS_NAME="RevokedCertificate";var Xb="tbs",um="version",Gb="signature",$b="issuer",Wb="thisUpdate",AE="nextUpdate",CE="revokedCertificates",xE="crlExtensions",Zg="signatureAlgorithm",e1="signatureValue",qa="tbsCertList",oS=`${qa}.version`,TT=`${qa}.signature`,IT=`${qa}.issuer`,uS=`${qa}.thisUpdate`,z1=`${qa}.nextUpdate`,lS=`${qa}.revokedCertificates`,cS=`${qa}.extensions`,tz=[qa,oS,TT,IT,uS,z1,lS,cS,Zg,e1];function rz(r={}){let e=T(r,"names",{});return new H({name:e.blockName||qa,value:[new le({optional:!0,name:e.tbsCertListVersion||oS,value:2}),ce.schema(e.signature||{names:{blockName:TT}}),gr.schema(e.issuer||{names:{blockName:IT}}),En.schema(e.tbsCertListThisUpdate||{names:{utcTimeName:uS,generalTimeName:uS}}),En.schema(e.tbsCertListNextUpdate||{names:{utcTimeName:z1,generalTimeName:z1}},!0),new H({optional:!0,value:[new ut({name:e.tbsCertListRevokedCertificates||lS,value:new H({value:[new le,En.schema(),Wr.schema({},!0)]})})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Wr.schema(e.crlExtensions||{names:{blockName:cS}})]})]})}u(rz,"tbsCertList");var nz=[gT,_8,H$,K$,P8,mT,yT,X$,G$,k8],J1=class Fn extends Ee{static{u(this,"CertificateRevocationList")}get tbs(){return Ye.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(T(e,Xb,Fn.defaultValues(Xb))),this.version=T(e,um,Fn.defaultValues(um)),this.signature=T(e,Gb,Fn.defaultValues(Gb)),this.issuer=T(e,$b,Fn.defaultValues($b)),this.thisUpdate=T(e,Wb,Fn.defaultValues(Wb)),AE in e&&(this.nextUpdate=T(e,AE,Fn.defaultValues(AE))),CE in e&&(this.revokedCertificates=T(e,CE,Fn.defaultValues(CE))),xE in e&&(this.crlExtensions=T(e,xE,Fn.defaultValues(xE))),this.signatureAlgorithm=T(e,Zg,Fn.defaultValues(Zg)),this.signatureValue=T(e,e1,Fn.defaultValues(e1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xb:return Or;case um:return 0;case Gb:return new ce;case $b:return new gr;case Wb:return new En;case AE:return new En;case CE:return[];case xE:return new Wr;case Zg:return new ce;case e1:return new At;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||"CertificateList",value:[rz(e),ce.schema(t.signatureAlgorithm||{names:{blockName:Zg}}),new At({name:t.signatureValue||e1})]})}fromSchema(e){we(e,tz);let t=ve(e,e,Fn.schema());me.assertSchema(t,this.className),this.tbsView=t.result.tbsCertList.valueBeforeDecodeView,oS in t.result&&(this.version=t.result[oS].valueBlock.valueDec),this.signature=new ce({schema:t.result[TT]}),this.issuer=new gr({schema:t.result[IT]}),this.thisUpdate=new En({schema:t.result[uS]}),z1 in t.result&&(this.nextUpdate=new En({schema:t.result[z1]})),lS in t.result&&(this.revokedCertificates=Array.from(t.result[lS],n=>new l5({schema:n}))),cS in t.result&&(this.crlExtensions=new Wr({schema:t.result[cS]})),this.signatureAlgorithm=new ce({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[];return this.version!==Fn.defaultValues(um)&&e.push(new le({value:this.version})),e.push(this.signature.toSchema()),e.push(this.issuer.toSchema()),e.push(this.thisUpdate.toSchema()),this.nextUpdate&&e.push(this.nextUpdate.toSchema()),this.revokedCertificates&&e.push(new H({value:Array.from(this.revokedCertificates,t=>t.toSchema())})),this.crlExtensions&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.crlExtensions.toSchema()]})),new H({value:e})}toSchema(e=!1){let t;if(e)t=this.encodeTBS();else{if(!this.tbsView.byteLength)return Fn.schema();let n=Ar(this.tbsView);me.assert(n,"TBS Certificate Revocation List"),t=n.result}return new H({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:at.ToHex(this.tbsView),version:this.version,signature:this.signature.toJSON(),issuer:this.issuer.toJSON(),thisUpdate:this.thisUpdate.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return this.version!==Fn.defaultValues(um)&&(e.version=this.version),this.nextUpdate&&(e.nextUpdate=this.nextUpdate.toJSON()),this.revokedCertificates&&(e.revokedCertificates=Array.from(this.revokedCertificates,t=>t.toJSON())),this.crlExtensions&&(e.crlExtensions=this.crlExtensions.toJSON()),e}isCertificateRevoked(e){if(!this.issuer.isEqual(e.issuer)||!this.revokedCertificates)return!1;for(let t of this.revokedCertificates)if(t.userCertificate.isEqual(e.serialNumber))return!0;return!1}async sign(e,t="SHA-1",n=pt(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),{parameters:i}=s;this.signature=s.signatureAlgorithm,this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new At({valueHex:a})}async verify(e={},t=pt(!0)){let n;if(e.issuerCertificate&&(n=e.issuerCertificate.subjectPublicKeyInfo,!this.issuer.isEqual(e.issuerCertificate.subject)))return!1;if(e.publicKeyInfo&&(n=e.publicKeyInfo),!n)throw new Error("Issuer's certificate must be provided as an input parameter");if(this.crlExtensions){for(let s of this.crlExtensions.extensions)if(s.critical&&!nz.includes(s.extnID))return!1}return t.verifyWithPublicKey(this.tbsView,this.signatureValue,n,this.signatureAlgorithm)}};J1.CLASS_NAME="CertificateRevocationList";var _h="crlId",Ph="crlValue",lm="parsedValue",sz=[_h,Ph],c5=class t1 extends Ee{static{u(this,"CRLBag")}constructor(e={}){super(),this.crlId=T(e,_h,t1.defaultValues(_h)),this.crlValue=T(e,Ph,t1.defaultValues(Ph)),lm in e&&(this.parsedValue=T(e,lm,t1.defaultValues(lm))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case _h:return P;case Ph:return new nt;case lm:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case _h:return t===P;case Ph:return t instanceof nt;case lm:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.id||"id"}),new re({idBlock:{tagClass:3,tagNumber:0},value:[new nt({name:t.value||"value"})]})]})}fromSchema(e){we(e,sz);let t=ve(e,e,t1.schema({names:{id:_h,value:Ph}}));switch(me.assertSchema(t,this.className),this.crlId=t.result.crlId.valueBlock.toString(),this.crlValue=t.result.crlValue,this.crlId){case c8:this.parsedValue=J1.fromBER(this.certValue.valueBlock.valueHex);break;default:throw new Error(`Incorrect CRL_ID value in CRLBag: ${this.crlId}`)}}toSchema(){return this.parsedValue&&(this.crlId=c8,this.crlValue=new Ne({valueHex:this.parsedValue.toSchema().toBER(!1)})),new H({value:[new je({value:this.crlId}),new re({idBlock:{tagClass:3,tagNumber:0},value:[this.crlValue.toSchema()]})]})}toJSON(){return{crlId:this.crlId,crlValue:this.crlValue.toJSON()}}};c5.CLASS_NAME="CRLBag";var kh="version",Lh="encryptedContentInfo",hu="unprotectedAttrs",iz=[kh,Lh,hu],Y1=class r1 extends Ee{static{u(this,"EncryptedData")}constructor(e={}){super(),this.version=T(e,kh,r1.defaultValues(kh)),this.encryptedContentInfo=T(e,Lh,r1.defaultValues(Lh)),hu in e&&(this.unprotectedAttrs=T(e,hu,r1.defaultValues(hu))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case kh:return 0;case Lh:return new In;case hu:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case kh:return t===0;case Lh:return In.compareWithDefault("contentType",t.contentType)&&In.compareWithDefault("contentEncryptionAlgorithm",t.contentEncryptionAlgorithm)&&In.compareWithDefault("encryptedContent",t.encryptedContent);case hu:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),In.schema(t.encryptedContentInfo||{}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new ut({name:t.unprotectedAttrs||P,value:_r.schema()})]})]})}fromSchema(e){we(e,iz);let t=ve(e,e,r1.schema({names:{version:kh,encryptedContentInfo:{names:{blockName:Lh}},unprotectedAttrs:hu}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.encryptedContentInfo=new In({schema:t.result.encryptedContentInfo}),hu in t.result&&(this.unprotectedAttrs=Array.from(t.result.unprotectedAttrs,n=>new _r({schema:n})))}toSchema(){let e=[];return e.push(new le({value:this.version})),e.push(this.encryptedContentInfo.toSchema()),this.unprotectedAttrs&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.unprotectedAttrs,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={version:this.version,encryptedContentInfo:this.encryptedContentInfo.toJSON()};return this.unprotectedAttrs&&(e.unprotectedAttrs=Array.from(this.unprotectedAttrs,t=>t.toJSON())),e}async encrypt(e,t=pt(!0)){sr.assert(e,"parameters","object");let n={...e,contentType:"1.2.840.113549.1.7.1"};this.encryptedContentInfo=await t.encryptEncryptedContentInfo(n)}async decrypt(e,t=pt(!0)){sr.assert(e,"parameters","object");let n={...e,encryptedContentInfo:this.encryptedContentInfo};return t.decryptEncryptedContentInfo(n)}};Y1.CLASS_NAME="EncryptedData";var sc="encryptionAlgorithm",pu="encryptedData",cm="parsedValue",az=[sc,pu],f5=class Vh extends Ee{static{u(this,"PKCS8ShroudedKeyBag")}constructor(e={}){super(),this.encryptionAlgorithm=T(e,sc,Vh.defaultValues(sc)),this.encryptedData=T(e,pu,Vh.defaultValues(pu)),cm in e&&(this.parsedValue=T(e,cm,Vh.defaultValues(cm))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case sc:return new ce;case pu:return new Ne;case cm:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case sc:return ce.compareWithDefault("algorithmId",t.algorithmId)&&!("algorithmParams"in t);case pu:return t.isEqual(Vh.defaultValues(e));case cm:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.encryptionAlgorithm||{names:{blockName:sc}}),new mr({value:[new Ne({name:t.encryptedData||pu}),new Ne({idBlock:{isConstructed:!0},name:t.encryptedData||pu})]})]})}fromSchema(e){we(e,az);let t=ve(e,e,Vh.schema({names:{encryptionAlgorithm:{names:{blockName:sc}},encryptedData:pu}}));me.assertSchema(t,this.className),this.encryptionAlgorithm=new ce({schema:t.result.encryptionAlgorithm}),this.encryptedData=t.result.encryptedData}toSchema(){return new H({value:[this.encryptionAlgorithm.toSchema(),this.encryptedData]})}toJSON(){return{encryptionAlgorithm:this.encryptionAlgorithm.toJSON(),encryptedData:this.encryptedData.toJSON()}}async parseInternalValues(e,t=pt(!0)){let s=await new Y1({encryptedContentInfo:new In({contentEncryptionAlgorithm:this.encryptionAlgorithm,encryptedContent:this.encryptedData})}).decrypt(e,t);this.parsedValue=W1.fromBER(s)}async makeInternalValues(e,t=pt(!0)){if(!this.parsedValue)throw new Error('Please initialize "parsedValue" first');let n=new Y1,s={...e,contentToEncrypt:this.parsedValue.toSchema().toBER(!1)};if(await n.encrypt(s,t),!n.encryptedContentInfo.encryptedContent)throw new Error("The filed `encryptedContent` in EncryptedContentInfo is empty");this.encryptionAlgorithm=n.encryptedContentInfo.contentEncryptionAlgorithm,this.encryptedData=n.encryptedContentInfo.encryptedContent}};f5.CLASS_NAME="PKCS8ShroudedKeyBag";var Fh="secretTypeId",Uh="secretValue",oz=[Fh,Uh],h5=class gw extends Ee{static{u(this,"SecretBag")}constructor(e={}){super(),this.secretTypeId=T(e,Fh,gw.defaultValues(Fh)),this.secretValue=T(e,Uh,gw.defaultValues(Uh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Fh:return P;case Uh:return new nt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Fh:return t===P;case Uh:return t instanceof nt;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.id||"id"}),new re({idBlock:{tagClass:3,tagNumber:0},value:[new nt({name:t.value||"value"})]})]})}fromSchema(e){we(e,oz);let t=ve(e,e,gw.schema({names:{id:Fh,value:Uh}}));me.assertSchema(t,this.className),this.secretTypeId=t.result.secretTypeId.valueBlock.toString(),this.secretValue=t.result.secretValue}toSchema(){return new H({value:[new je({value:this.secretTypeId}),new re({idBlock:{tagClass:3,tagNumber:0},value:[this.secretValue.toSchema()]})]})}toJSON(){return{secretTypeId:this.secretTypeId,secretValue:this.secretValue.toJSON()}}};h5.CLASS_NAME="SecretBag";var uz=class ic{static{u(this,"SafeBagValueFactory")}static getItems(){return this.items||(this.items={},ic.register("1.2.840.113549.1.12.10.1.1",W1),ic.register("1.2.840.113549.1.12.10.1.2",f5),ic.register("1.2.840.113549.1.12.10.1.3",u5),ic.register("1.2.840.113549.1.12.10.1.4",c5),ic.register("1.2.840.113549.1.12.10.1.5",h5),ic.register("1.2.840.113549.1.12.10.1.6",Gp)),this.items}static register(e,t){this.getItems()[e]=t}static find(e){return this.getItems()[e]||null}},ac="bagId",oc="bagValue",Ba="bagAttributes",lz=[ac,oc,Ba],FN=class n1 extends Ee{static{u(this,"SafeBag")}constructor(e={}){super(),this.bagId=T(e,ac,n1.defaultValues(ac)),this.bagValue=T(e,oc,n1.defaultValues(oc)),Ba in e&&(this.bagAttributes=T(e,Ba,n1.defaultValues(Ba))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ac:return P;case oc:return new nt;case Ba:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ac:return t===P;case oc:return t instanceof nt;case Ba:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.bagId||ac}),new re({idBlock:{tagClass:3,tagNumber:0},value:[new nt({name:t.bagValue||oc})]}),new xr({optional:!0,value:[new ut({name:t.bagAttributes||Ba,value:_r.schema()})]})]})}fromSchema(e){we(e,lz);let t=ve(e,e,n1.schema({names:{bagId:ac,bagValue:oc,bagAttributes:Ba}}));me.assertSchema(t,this.className),this.bagId=t.result.bagId.valueBlock.toString();let n=uz.find(this.bagId);if(!n)throw new Error(`Invalid BAG_ID for SafeBag: ${this.bagId}`);this.bagValue=new n({schema:t.result.bagValue}),Ba in t.result&&(this.bagAttributes=Array.from(t.result.bagAttributes,s=>new _r({schema:s})))}toSchema(){let e=[new je({value:this.bagId}),new re({idBlock:{tagClass:3,tagNumber:0},value:[this.bagValue.toSchema()]})];return this.bagAttributes&&e.push(new xr({value:Array.from(this.bagAttributes,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={bagId:this.bagId,bagValue:this.bagValue.toJSON()};return this.bagAttributes&&(e.bagAttributes=Array.from(this.bagAttributes,t=>t.toJSON())),e}};FN.CLASS_NAME="SafeBag";var uh="safeBags",Gp=class UN extends Ee{static{u(this,"SafeContents")}constructor(e={}){super(),this.safeBags=T(e,uh,UN.defaultValues(uh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case uh:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case uh:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.safeBags||P,value:FN.schema()})]})}fromSchema(e){we(e,[uh]);let t=ve(e,e,UN.schema({names:{safeBags:uh}}));me.assertSchema(t,this.className),this.safeBags=Array.from(t.result.safeBags,n=>new FN({schema:n}))}toSchema(){return new H({value:Array.from(this.safeBags,e=>e.toSchema())})}toJSON(){return{safeBags:Array.from(this.safeBags,e=>e.toJSON())}}};Gp.CLASS_NAME="SafeContents";var s1="otherCertFormat",i1="otherCert",cz=[s1,i1],yw=class vw extends Ee{static{u(this,"OtherCertificateFormat")}constructor(e={}){super(),this.otherCertFormat=T(e,s1,vw.defaultValues(s1)),this.otherCert=T(e,i1,vw.defaultValues(i1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case s1:return P;case i1:return new nt;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.otherCertFormat||s1}),new nt({name:t.otherCert||i1})]})}fromSchema(e){we(e,cz);let t=ve(e,e,vw.schema());me.assertSchema(t,this.className),this.otherCertFormat=t.result.otherCertFormat.valueBlock.toString(),this.otherCert=t.result.otherCert}toSchema(){return new H({value:[new je({value:this.otherCertFormat}),this.otherCert]})}toJSON(){let e={otherCertFormat:this.otherCertFormat};return this.otherCert instanceof nt||(e.otherCert=this.otherCert.toJSON()),e}},a1="certificates",fz=[a1],Hc=class MN extends Ee{static{u(this,"CertificateSet")}constructor(e={}){super(),this.certificates=T(e,a1,MN.defaultValues(a1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case a1:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new xr({name:t.blockName||P,value:[new ut({name:t.certificates||a1,value:new mr({value:[Dn.schema(),new re({idBlock:{tagClass:3,tagNumber:0},value:[new nt]}),new re({idBlock:{tagClass:3,tagNumber:1},value:[new H]}),new re({idBlock:{tagClass:3,tagNumber:2},value:Fu.schema().valueBlock.value}),new re({idBlock:{tagClass:3,tagNumber:3},value:yw.schema().valueBlock.value})]})})]})}fromSchema(e){we(e,fz);let t=ve(e,e,MN.schema());me.assertSchema(t,this.className),this.certificates=Array.from(t.result.certificates||[],n=>{let s=n.idBlock.tagNumber;if(n.idBlock.tagClass===1)return new Dn({schema:n});let i=new H({value:n.valueBlock.value});switch(s){case 1:return i.valueBlock.value[0].valueBlock.value[0].valueBlock.valueDec===1?new Fu({schema:i}):new tS({schema:i});case 2:return new Fu({schema:i});case 3:return new yw({schema:i})}return n})}toSchema(){return new xr({value:Array.from(this.certificates,e=>{switch(!0){case e instanceof Dn:return e.toSchema();case e instanceof tS:return new re({idBlock:{tagClass:3,tagNumber:1},value:e.toSchema().valueBlock.value});case e instanceof Fu:return new re({idBlock:{tagClass:3,tagNumber:2},value:e.toSchema().valueBlock.value});case e instanceof yw:return new re({idBlock:{tagClass:3,tagNumber:3},value:e.toSchema().valueBlock.value})}return e.toSchema()})})}toJSON(){return{certificates:Array.from(this.certificates,e=>e.toJSON())}}};Hc.CLASS_NAME="CertificateSet";var o1="otherRevInfoFormat",u1="otherRevInfo",hz=[o1,u1],q1=class Ew extends Ee{static{u(this,"OtherRevocationInfoFormat")}constructor(e={}){super(),this.otherRevInfoFormat=T(e,o1,Ew.defaultValues(o1)),this.otherRevInfo=T(e,u1,Ew.defaultValues(u1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case o1:return P;case u1:return new nt;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.otherRevInfoFormat||o1}),new nt({name:t.otherRevInfo||u1})]})}fromSchema(e){we(e,hz);let t=ve(e,e,Ew.schema());me.assertSchema(t,this.className),this.otherRevInfoFormat=t.result.otherRevInfoFormat.valueBlock.toString(),this.otherRevInfo=t.result.otherRevInfo}toSchema(){return new H({value:[new je({value:this.otherRevInfoFormat}),this.otherRevInfo]})}toJSON(){let e={otherRevInfoFormat:this.otherRevInfoFormat};return this.otherRevInfo instanceof nt||(e.otherRevInfo=this.otherRevInfo.toJSON()),e}};q1.CLASS_NAME="OtherRevocationInfoFormat";var l1="crls",zb="otherRevocationInfos",pz=[l1],H1=class ww extends Ee{static{u(this,"RevocationInfoChoices")}constructor(e={}){super(),this.crls=T(e,l1,ww.defaultValues(l1)),this.otherRevocationInfos=T(e,zb,ww.defaultValues(zb)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case l1:return[];case zb:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new xr({name:t.blockName||P,value:[new ut({name:t.crls||P,value:new mr({value:[J1.schema(),new re({idBlock:{tagClass:3,tagNumber:1},value:[new je,new nt]})]})})]})}fromSchema(e){we(e,pz);let t=ve(e,e,ww.schema({names:{crls:l1}}));if(me.assertSchema(t,this.className),t.result.crls)for(let n of t.result.crls)n.idBlock.tagClass===1?this.crls.push(new J1({schema:n})):this.otherRevocationInfos.push(new q1({schema:n}))}toSchema(){let e=[];return e.push(...Array.from(this.crls,t=>t.toSchema())),e.push(...Array.from(this.otherRevocationInfos,t=>{let n=t.toSchema();return n.idBlock.tagClass=3,n.idBlock.tagNumber=1,n})),new xr({value:e})}toJSON(){return{crls:Array.from(this.crls,e=>e.toJSON()),otherRevocationInfos:Array.from(this.otherRevocationInfos,e=>e.toJSON())}}};H1.CLASS_NAME="RevocationInfoChoices";var c1="certs",uc="crls",dz=[c1,uc],Sw=class jN extends Ee{static{u(this,"OriginatorInfo")}constructor(e={}){super(),this.crls=T(e,uc,jN.defaultValues(uc)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case c1:return new Hc;case uc:return new H1;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case c1:return t.certificates.length===0;case uc:return t.crls.length===0&&t.otherRevocationInfos.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new re({name:t.certs||P,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:Hc.schema().valueBlock.value}),new re({name:t.crls||P,optional:!0,idBlock:{tagClass:3,tagNumber:1},value:H1.schema().valueBlock.value})]})}fromSchema(e){we(e,dz);let t=ve(e,e,jN.schema({names:{certs:c1,crls:uc}}));me.assertSchema(t,this.className),c1 in t.result&&(this.certs=new Hc({schema:new xr({value:t.result.certs.valueBlock.value})})),uc in t.result&&(this.crls=new H1({schema:new xr({value:t.result.crls.valueBlock.value})}))}toSchema(){let e=[];return this.certs&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:this.certs.toSchema().valueBlock.value})),this.crls&&e.push(new re({idBlock:{tagClass:3,tagNumber:1},value:this.crls.toSchema().valueBlock.value})),new H({value:e})}toJSON(){let e={};return this.certs&&(e.certs=this.certs.toJSON()),this.crls&&(e.crls=this.crls.toJSON()),e}};Sw.CLASS_NAME="OriginatorInfo";var f1="issuer",h1="serialNumber",mz=[f1,h1],wn=class Aw extends Ee{static{u(this,"IssuerAndSerialNumber")}constructor(e={}){super(),this.issuer=T(e,f1,Aw.defaultValues(f1)),this.serialNumber=T(e,h1,Aw.defaultValues(h1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case f1:return new gr;case h1:return new le;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[gr.schema(t.issuer||{}),new le({name:t.serialNumber||P})]})}fromSchema(e){we(e,mz);let t=ve(e,e,Aw.schema({names:{issuer:{names:{blockName:f1}},serialNumber:h1}}));me.assertSchema(t,this.className),this.issuer=new gr({schema:t.result.issuer}),this.serialNumber=t.result.serialNumber}toSchema(){return new H({value:[this.issuer.toSchema(),this.serialNumber]})}toJSON(){return{issuer:this.issuer.toJSON(),serialNumber:this.serialNumber.toJSON()}}};wn.CLASS_NAME="IssuerAndSerialNumber";var bE="variant",fm="value",gz=["blockName"],p5=class Cw extends Ee{static{u(this,"RecipientIdentifier")}constructor(e={}){super(),this.variant=T(e,bE,Cw.defaultValues(bE)),fm in e&&(this.value=T(e,fm,Cw.defaultValues(fm))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case bE:return-1;case fm:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case bE:return t===-1;case fm:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new mr({value:[wn.schema({names:{blockName:t.blockName||P}}),new Ze({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:0}})]})}fromSchema(e){we(e,gz);let t=ve(e,e,Cw.schema({names:{blockName:"blockName"}}));me.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new wn({schema:t.result.blockName})):(this.variant=2,this.value=new Ne({valueHex:t.result.blockName.valueBlock.valueHex}))}toSchema(){switch(this.variant){case 1:if(!(this.value instanceof wn))throw new Error("Incorrect type of RecipientIdentifier.value. It should be IssuerAndSerialNumber.");return this.value.toSchema();case 2:if(!(this.value instanceof Ne))throw new Error("Incorrect type of RecipientIdentifier.value. It should be ASN.1 OctetString.");return new Ze({idBlock:{tagClass:3,tagNumber:0},valueHex:this.value.valueBlock.valueHexView});default:return new nt}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2)&&this.value&&(e.value=this.value.toJSON()),e}};p5.CLASS_NAME="RecipientIdentifier";var lc="version",Mh="rid",jh="keyEncryptionAlgorithm",qh="encryptedKey",NE="recipientCertificate",yz=[lc,Mh,jh,qh],fS=class Ra extends Ee{static{u(this,"KeyTransRecipientInfo")}constructor(e={}){super(),this.version=T(e,lc,Ra.defaultValues(lc)),this.rid=T(e,Mh,Ra.defaultValues(Mh)),this.keyEncryptionAlgorithm=T(e,jh,Ra.defaultValues(jh)),this.encryptedKey=T(e,qh,Ra.defaultValues(qh)),this.recipientCertificate=T(e,NE,Ra.defaultValues(NE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case lc:return-1;case Mh:return{};case jh:return new ce;case qh:return new Ne;case NE:return new Dn;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case lc:return t===Ra.defaultValues(lc);case Mh:return Object.keys(t).length===0;case jh:case qh:return t.isEqual(Ra.defaultValues(e));case NE:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),p5.schema(t.rid||{}),ce.schema(t.keyEncryptionAlgorithm||{}),new Ne({name:t.encryptedKey||P})]})}fromSchema(e){we(e,yz);let t=ve(e,e,Ra.schema({names:{version:lc,rid:{names:{blockName:Mh}},keyEncryptionAlgorithm:{names:{blockName:jh}},encryptedKey:qh}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,t.result.rid.idBlock.tagClass===3?this.rid=new Ne({valueHex:t.result.rid.valueBlock.valueHex}):this.rid=new wn({schema:t.result.rid}),this.keyEncryptionAlgorithm=new ce({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){let e=[];return this.rid instanceof wn?(this.version=0,e.push(new le({value:this.version})),e.push(this.rid.toSchema())):(this.version=2,e.push(new le({value:this.version})),e.push(new Ze({idBlock:{tagClass:3,tagNumber:0},valueHex:this.rid.valueBlock.valueHexView}))),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.encryptedKey),new H({value:e})}toJSON(){return{version:this.version,rid:this.rid.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};fS.CLASS_NAME="KeyTransRecipientInfo";var Hh="algorithm",Kh="publicKey",vz=[Hh,Kh],hS=class p1 extends Ee{static{u(this,"OriginatorPublicKey")}constructor(e={}){super(),this.algorithm=T(e,Hh,p1.defaultValues(Hh)),this.publicKey=T(e,Kh,p1.defaultValues(Kh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Hh:return new ce;case Kh:return new At;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Hh:case Kh:return t.isEqual(p1.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.algorithm||{}),new At({name:t.publicKey||P})]})}fromSchema(e){we(e,vz);let t=ve(e,e,p1.schema({names:{algorithm:{names:{blockName:Hh}},publicKey:Kh}}));me.assertSchema(t,this.className),this.algorithm=new ce({schema:t.result.algorithm}),this.publicKey=t.result.publicKey}toSchema(){return new H({value:[this.algorithm.toSchema(),this.publicKey]})}toJSON(){return{algorithm:this.algorithm.toJSON(),publicKey:this.publicKey.toJSON()}}};hS.CLASS_NAME="OriginatorPublicKey";var TE="variant",hm="value",Ez=["blockName"],K1=class xw extends Ee{static{u(this,"OriginatorIdentifierOrKey")}constructor(e={}){super(),this.variant=T(e,TE,xw.defaultValues(TE)),hm in e&&(this.value=T(e,hm,xw.defaultValues(hm))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case TE:return-1;case hm:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case TE:return t===-1;case hm:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new mr({value:[wn.schema({names:{blockName:t.blockName||P}}),new Ze({idBlock:{tagClass:3,tagNumber:0},name:t.blockName||P}),new re({idBlock:{tagClass:3,tagNumber:1},name:t.blockName||P,value:hS.schema().valueBlock.value})]})}fromSchema(e){we(e,Ez);let t=ve(e,e,xw.schema({names:{blockName:"blockName"}}));me.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new wn({schema:t.result.blockName})):t.result.blockName.idBlock.tagNumber===0?(t.result.blockName.idBlock.tagClass=1,t.result.blockName.idBlock.tagNumber=4,this.variant=2,this.value=t.result.blockName):(this.variant=3,this.value=new hS({schema:new H({value:t.result.blockName.valueBlock.value})}))}toSchema(){switch(this.variant){case 1:return this.value.toSchema();case 2:return this.value.idBlock.tagClass=3,this.value.idBlock.tagNumber=0,this.value;case 3:{let e=this.value.toSchema();return e.idBlock.tagClass=3,e.idBlock.tagNumber=1,e}default:return new nt}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2||this.variant===3)&&(e.value=this.value.toJSON()),e}};K1.CLASS_NAME="OriginatorIdentifierOrKey";var Xh="keyAttrId",Ui="keyAttr",wz=[Xh,Ui],Kc=class bw extends Ee{static{u(this,"OtherKeyAttribute")}constructor(e={}){super(),this.keyAttrId=T(e,Xh,bw.defaultValues(Xh)),Ui in e&&(this.keyAttr=T(e,Ui,bw.defaultValues(Ui))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xh:return P;case Ui:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Xh:return typeof t=="string"&&t===P;case Ui:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({optional:t.optional||!0,name:t.blockName||P,value:[new je({name:t.keyAttrId||P}),new nt({optional:!0,name:t.keyAttr||P})]})}fromSchema(e){we(e,wz);let t=ve(e,e,bw.schema({names:{keyAttrId:Xh,keyAttr:Ui}}));me.assertSchema(t,this.className),this.keyAttrId=t.result.keyAttrId.valueBlock.toString(),Ui in t.result&&(this.keyAttr=t.result.keyAttr)}toSchema(){let e=[];return e.push(new je({value:this.keyAttrId})),Ui in this&&e.push(this.keyAttr),new H({value:e})}toJSON(){let e={keyAttrId:this.keyAttrId};return Ui in this&&(e.keyAttr=this.keyAttr.toJSON()),e}};Kc.CLASS_NAME="OtherKeyAttribute";var cc="subjectKeyIdentifier",du="date",mu="other",Sz=[cc,du,mu],pS=class Gh extends Ee{static{u(this,"RecipientKeyIdentifier")}constructor(e={}){super(),this.subjectKeyIdentifier=T(e,cc,Gh.defaultValues(cc)),du in e&&(this.date=T(e,du,Gh.defaultValues(du))),mu in e&&(this.other=T(e,mu,Gh.defaultValues(mu))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case cc:return new Ne;case du:return new dr;case mu:return new Kc;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case cc:return t.isEqual(Gh.defaultValues(cc));case du:return t.year===0&&t.month===0&&t.day===0&&t.hour===0&&t.minute===0&&t.second===0&&t.millisecond===0;case mu:return t.keyAttrId===P&&!("keyAttr"in t);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new Ne({name:t.subjectKeyIdentifier||P}),new dr({optional:!0,name:t.date||P}),Kc.schema(t.other||{})]})}fromSchema(e){we(e,Sz);let t=ve(e,e,Gh.schema({names:{subjectKeyIdentifier:cc,date:du,other:{names:{blockName:mu}}}}));me.assertSchema(t,this.className),this.subjectKeyIdentifier=t.result.subjectKeyIdentifier,du in t.result&&(this.date=t.result.date),mu in t.result&&(this.other=new Kc({schema:t.result.other}))}toSchema(){let e=[];return e.push(this.subjectKeyIdentifier),this.date&&e.push(this.date),this.other&&e.push(this.other.toSchema()),new H({value:e})}toJSON(){let e={subjectKeyIdentifier:this.subjectKeyIdentifier.toJSON()};return this.date&&(e.date=this.date.toJSON()),this.other&&(e.other=this.other.toJSON()),e}};pS.CLASS_NAME="RecipientKeyIdentifier";var IE="variant",DE="value",Az=["blockName"],Wp=class Nw extends Ee{static{u(this,"KeyAgreeRecipientIdentifier")}constructor(e={}){super(),this.variant=T(e,IE,Nw.defaultValues(IE)),this.value=T(e,DE,Nw.defaultValues(DE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case IE:return-1;case DE:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case IE:return t===-1;case DE:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new mr({value:[wn.schema(t.issuerAndSerialNumber||{names:{blockName:t.blockName||P}}),new re({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:0},value:pS.schema(t.rKeyId||{names:{blockName:t.blockName||P}}).valueBlock.value})]})}fromSchema(e){we(e,Az);let t=ve(e,e,Nw.schema({names:{blockName:"blockName"}}));me.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new wn({schema:t.result.blockName})):(this.variant=2,this.value=new pS({schema:new H({value:t.result.blockName.valueBlock.value})}))}toSchema(){switch(this.variant){case 1:return this.value.toSchema();case 2:return new re({idBlock:{tagClass:3,tagNumber:0},value:this.value.toSchema().valueBlock.value});default:return new nt}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2)&&(e.value=this.value.toJSON()),e}};Wp.CLASS_NAME="KeyAgreeRecipientIdentifier";var $h="rid",fc="encryptedKey",Cz=[$h,fc],dS=class d1 extends Ee{static{u(this,"RecipientEncryptedKey")}constructor(e={}){super(),this.rid=T(e,$h,d1.defaultValues($h)),this.encryptedKey=T(e,fc,d1.defaultValues(fc)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case $h:return new Wp;case fc:return new Ne;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case $h:return t.variant===-1&&!("value"in t);case fc:return t.isEqual(d1.defaultValues(fc));default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[Wp.schema(t.rid||{}),new Ne({name:t.encryptedKey||P})]})}fromSchema(e){we(e,Cz);let t=ve(e,e,d1.schema({names:{rid:{names:{blockName:$h}},encryptedKey:fc}}));me.assertSchema(t,this.className),this.rid=new Wp({schema:t.result.rid}),this.encryptedKey=t.result.encryptedKey}toSchema(){return new H({value:[this.rid.toSchema(),this.encryptedKey]})}toJSON(){return{rid:this.rid.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};dS.CLASS_NAME="RecipientEncryptedKey";var BE="encryptedKeys",d5="RecipientEncryptedKeys",xz=[d5],X1=class qN extends Ee{static{u(this,"RecipientEncryptedKeys")}constructor(e={}){super(),this.encryptedKeys=T(e,BE,qN.defaultValues(BE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case BE:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case BE:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.RecipientEncryptedKeys||P,value:dS.schema()})]})}fromSchema(e){we(e,xz);let t=ve(e,e,qN.schema({names:{RecipientEncryptedKeys:d5}}));me.assertSchema(t,this.className),this.encryptedKeys=Array.from(t.result.RecipientEncryptedKeys,n=>new dS({schema:n}))}toSchema(){return new H({value:Array.from(this.encryptedKeys,e=>e.toSchema())})}toJSON(){return{encryptedKeys:Array.from(this.encryptedKeys,e=>e.toJSON())}}};X1.CLASS_NAME="RecipientEncryptedKeys";var Wh="version",zh="originator",Oa="ukm",Jh="keyEncryptionAlgorithm",Yh="recipientEncryptedKeys",RE="recipientCertificate",OE="recipientPublicKey",bz=[Wh,zh,Oa,Jh,Yh],mS=class Mi extends Ee{static{u(this,"KeyAgreeRecipientInfo")}constructor(e={}){super(),this.version=T(e,Wh,Mi.defaultValues(Wh)),this.originator=T(e,zh,Mi.defaultValues(zh)),Oa in e&&(this.ukm=T(e,Oa,Mi.defaultValues(Oa))),this.keyEncryptionAlgorithm=T(e,Jh,Mi.defaultValues(Jh)),this.recipientEncryptedKeys=T(e,Yh,Mi.defaultValues(Yh)),this.recipientCertificate=T(e,RE,Mi.defaultValues(RE)),this.recipientPublicKey=T(e,OE,Mi.defaultValues(OE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Wh:return 0;case zh:return new K1;case Oa:return new Ne;case Jh:return new ce;case Yh:return new X1;case RE:return new Dn;case OE:return null;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Wh:return t===0;case zh:return t.variant===-1&&!("value"in t);case Oa:return t.isEqual(Mi.defaultValues(Oa));case Jh:return t.algorithmId===P&&!("algorithmParams"in t);case Yh:return t.encryptedKeys.length===0;case RE:return!1;case OE:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),new re({idBlock:{tagClass:3,tagNumber:0},value:[K1.schema(t.originator||{})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Ne({name:t.ukm||P})]}),ce.schema(t.keyEncryptionAlgorithm||{}),X1.schema(t.recipientEncryptedKeys||{})]})}fromSchema(e){we(e,bz);let t=ve(e,e,Mi.schema({names:{version:Wh,originator:{names:{blockName:zh}},ukm:Oa,keyEncryptionAlgorithm:{names:{blockName:Jh}},recipientEncryptedKeys:{names:{blockName:Yh}}}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.originator=new K1({schema:t.result.originator}),Oa in t.result&&(this.ukm=t.result.ukm),this.keyEncryptionAlgorithm=new ce({schema:t.result.keyEncryptionAlgorithm}),this.recipientEncryptedKeys=new X1({schema:t.result.recipientEncryptedKeys})}toSchema(){let e=[];return e.push(new le({value:this.version})),e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[this.originator.toSchema()]})),this.ukm&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[this.ukm]})),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.recipientEncryptedKeys.toSchema()),new H({value:e})}toJSON(){let e={version:this.version,originator:this.originator.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),recipientEncryptedKeys:this.recipientEncryptedKeys.toJSON()};return this.ukm&&(e.ukm=this.ukm.toJSON()),e}};mS.CLASS_NAME="KeyAgreeRecipientInfo";var hc="keyIdentifier",gu="date",yu="other",Nz=[hc,gu,yu],G1=class Qh extends Ee{static{u(this,"KEKIdentifier")}constructor(e={}){super(),this.keyIdentifier=T(e,hc,Qh.defaultValues(hc)),gu in e&&(this.date=T(e,gu,Qh.defaultValues(gu))),yu in e&&(this.other=T(e,yu,Qh.defaultValues(yu))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case hc:return new Ne;case gu:return new dr;case yu:return new Kc;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case hc:return t.isEqual(Qh.defaultValues(hc));case gu:return t.year===0&&t.month===0&&t.day===0&&t.hour===0&&t.minute===0&&t.second===0&&t.millisecond===0;case yu:return t.compareWithDefault("keyAttrId",t.keyAttrId)&&!("keyAttr"in t);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new Ne({name:t.keyIdentifier||P}),new dr({optional:!0,name:t.date||P}),Kc.schema(t.other||{})]})}fromSchema(e){we(e,Nz);let t=ve(e,e,Qh.schema({names:{keyIdentifier:hc,date:gu,other:{names:{blockName:yu}}}}));me.assertSchema(t,this.className),this.keyIdentifier=t.result.keyIdentifier,gu in t.result&&(this.date=t.result.date),yu in t.result&&(this.other=new Kc({schema:t.result.other}))}toSchema(){let e=[];return e.push(this.keyIdentifier),this.date&&e.push(this.date),this.other&&e.push(this.other.toSchema()),new H({value:e})}toJSON(){let e={keyIdentifier:this.keyIdentifier.toJSON()};return this.date&&(e.date=this.date),this.other&&(e.other=this.other.toJSON()),e}};G1.CLASS_NAME="KEKIdentifier";var Zh="version",ep="kekid",tp="keyEncryptionAlgorithm",pc="encryptedKey",_E="preDefinedKEK",Tz=[Zh,ep,tp,pc],gS=class _a extends Ee{static{u(this,"KEKRecipientInfo")}constructor(e={}){super(),this.version=T(e,Zh,_a.defaultValues(Zh)),this.kekid=T(e,ep,_a.defaultValues(ep)),this.keyEncryptionAlgorithm=T(e,tp,_a.defaultValues(tp)),this.encryptedKey=T(e,pc,_a.defaultValues(pc)),this.preDefinedKEK=T(e,_E,_a.defaultValues(_E)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Zh:return 0;case ep:return new G1;case tp:return new ce;case pc:return new Ne;case _E:return Or;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case"KEKRecipientInfo":return t===_a.defaultValues(Zh);case ep:return t.compareWithDefault("keyIdentifier",t.keyIdentifier)&&!("date"in t)&&!("other"in t);case tp:return t.algorithmId===P&&!("algorithmParams"in t);case pc:return t.isEqual(_a.defaultValues(pc));case _E:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),G1.schema(t.kekid||{}),ce.schema(t.keyEncryptionAlgorithm||{}),new Ne({name:t.encryptedKey||P})]})}fromSchema(e){we(e,Tz);let t=ve(e,e,_a.schema({names:{version:Zh,kekid:{names:{blockName:ep}},keyEncryptionAlgorithm:{names:{blockName:tp}},encryptedKey:pc}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.kekid=new G1({schema:t.result.kekid}),this.keyEncryptionAlgorithm=new ce({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){return new H({value:[new le({value:this.version}),this.kekid.toSchema(),this.keyEncryptionAlgorithm.toSchema(),this.encryptedKey]})}toJSON(){return{version:this.version,kekid:this.kekid.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};gS.CLASS_NAME="KEKRecipientInfo";var rp="version",vu="keyDerivationAlgorithm",np="keyEncryptionAlgorithm",dc="encryptedKey",PE="password",Iz=[rp,vu,np,dc],yS=class Eu extends Ee{static{u(this,"PasswordRecipientinfo")}constructor(e={}){super(),this.version=T(e,rp,Eu.defaultValues(rp)),vu in e&&(this.keyDerivationAlgorithm=T(e,vu,Eu.defaultValues(vu))),this.keyEncryptionAlgorithm=T(e,np,Eu.defaultValues(np)),this.encryptedKey=T(e,dc,Eu.defaultValues(dc)),this.password=T(e,PE,Eu.defaultValues(PE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case rp:return-1;case vu:return new ce;case np:return new ce;case dc:return new Ne;case PE:return Or;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case rp:return t===-1;case vu:case np:return t.algorithmId===P&&!("algorithmParams"in t);case dc:return t.isEqual(Eu.defaultValues(dc));case PE:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),new re({name:t.keyDerivationAlgorithm||P,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ce.schema().valueBlock.value}),ce.schema(t.keyEncryptionAlgorithm||{}),new Ne({name:t.encryptedKey||P})]})}fromSchema(e){we(e,Iz);let t=ve(e,e,Eu.schema({names:{version:rp,keyDerivationAlgorithm:vu,keyEncryptionAlgorithm:{names:{blockName:np}},encryptedKey:dc}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,vu in t.result&&(this.keyDerivationAlgorithm=new ce({schema:new H({value:t.result.keyDerivationAlgorithm.valueBlock.value})})),this.keyEncryptionAlgorithm=new ce({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){let e=[];return e.push(new le({value:this.version})),this.keyDerivationAlgorithm&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:this.keyDerivationAlgorithm.toSchema().valueBlock.value})),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.encryptedKey),new H({value:e})}toJSON(){let e={version:this.version,keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()};return this.keyDerivationAlgorithm&&(e.keyDerivationAlgorithm=this.keyDerivationAlgorithm.toJSON()),e}};yS.CLASS_NAME="PasswordRecipientInfo";var sp="oriType",mc="oriValue",Dz=[sp,mc],HN=class m1 extends Ee{static{u(this,"OtherRecipientInfo")}constructor(e={}){super(),this.oriType=T(e,sp,m1.defaultValues(sp)),this.oriValue=T(e,mc,m1.defaultValues(mc)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case sp:return P;case mc:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case sp:return t===P;case mc:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.oriType||P}),new nt({name:t.oriValue||P})]})}fromSchema(e){we(e,Dz);let t=ve(e,e,m1.schema({names:{oriType:sp,oriValue:mc}}));me.assertSchema(t,this.className),this.oriType=t.result.oriType.valueBlock.toString(),this.oriValue=t.result.oriValue}toSchema(){return new H({value:[new je({value:this.oriType}),this.oriValue]})}toJSON(){let e={oriType:this.oriType};return m1.compareWithDefault(mc,this.oriValue)||(e.oriValue=this.oriValue.toJSON()),e}};HN.CLASS_NAME="OtherRecipientInfo";var kE="variant",pm="value",Bz=["blockName"],gc=class g1 extends Ee{static{u(this,"RecipientInfo")}constructor(e={}){super(),this.variant=T(e,kE,g1.defaultValues(kE)),pm in e&&(this.value=T(e,pm,g1.defaultValues(pm))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case kE:return-1;case pm:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case kE:return t===g1.defaultValues(e);case pm:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new mr({value:[fS.schema({names:{blockName:t.blockName||P}}),new re({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:1},value:mS.schema().valueBlock.value}),new re({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:2},value:gS.schema().valueBlock.value}),new re({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:3},value:yS.schema().valueBlock.value}),new re({name:t.blockName||P,idBlock:{tagClass:3,tagNumber:4},value:HN.schema().valueBlock.value})]})}fromSchema(e){we(e,Bz);let t=ve(e,e,g1.schema({names:{blockName:"blockName"}}));if(me.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1)this.variant=1,this.value=new fS({schema:t.result.blockName});else{let n=new H({value:t.result.blockName.valueBlock.value});switch(t.result.blockName.idBlock.tagNumber){case 1:this.variant=2,this.value=new mS({schema:n});break;case 2:this.variant=3,this.value=new gS({schema:n});break;case 3:this.variant=4,this.value=new yS({schema:n});break;case 4:this.variant=5,this.value=new HN({schema:n});break;default:throw new Error("Incorrect structure of RecipientInfo block")}}}toSchema(){Ht.assertEmpty(this.value,"value","RecipientInfo");let e=this.value.toSchema();switch(this.variant){case 1:return e;case 2:case 3:case 4:return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.variant-1,e;default:return new nt}}toJSON(){let e={variant:this.variant};return this.value&&this.variant>=1&&this.variant<=4&&(e.value=this.value.toJSON()),e}};gc.CLASS_NAME="RecipientInfo";var wu="hashAlgorithm",Su="maskGenAlgorithm",Au="pSourceAlgorithm",Rz=[wu,Su,Au],Tw=class ai extends Ee{static{u(this,"RSAESOAEPParams")}constructor(e={}){super(),this.hashAlgorithm=T(e,wu,ai.defaultValues(wu)),this.maskGenAlgorithm=T(e,Su,ai.defaultValues(Su)),this.pSourceAlgorithm=T(e,Au,ai.defaultValues(Au)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wu:return new ce({algorithmId:"1.3.14.3.2.26",algorithmParams:new Cr});case Su:return new ce({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:new ce({algorithmId:"1.3.14.3.2.26",algorithmParams:new Cr}).toSchema()});case Au:return new ce({algorithmId:"1.2.840.113549.1.1.9",algorithmParams:new Ne({valueHex:new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer})});default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new re({idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[ce.schema(t.hashAlgorithm||{})]}),new re({idBlock:{tagClass:3,tagNumber:1},optional:!0,value:[ce.schema(t.maskGenAlgorithm||{})]}),new re({idBlock:{tagClass:3,tagNumber:2},optional:!0,value:[ce.schema(t.pSourceAlgorithm||{})]})]})}fromSchema(e){we(e,Rz);let t=ve(e,e,ai.schema({names:{hashAlgorithm:{names:{blockName:wu}},maskGenAlgorithm:{names:{blockName:Su}},pSourceAlgorithm:{names:{blockName:Au}}}}));me.assertSchema(t,this.className),wu in t.result&&(this.hashAlgorithm=new ce({schema:t.result.hashAlgorithm})),Su in t.result&&(this.maskGenAlgorithm=new ce({schema:t.result.maskGenAlgorithm})),Au in t.result&&(this.pSourceAlgorithm=new ce({schema:t.result.pSourceAlgorithm}))}toSchema(){let e=[];return this.hashAlgorithm.isEqual(ai.defaultValues(wu))||e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[this.hashAlgorithm.toSchema()]})),this.maskGenAlgorithm.isEqual(ai.defaultValues(Su))||e.push(new re({idBlock:{tagClass:3,tagNumber:1},value:[this.maskGenAlgorithm.toSchema()]})),this.pSourceAlgorithm.isEqual(ai.defaultValues(Au))||e.push(new re({idBlock:{tagClass:3,tagNumber:2},value:[this.pSourceAlgorithm.toSchema()]})),new H({value:e})}toJSON(){let e={};return this.hashAlgorithm.isEqual(ai.defaultValues(wu))||(e.hashAlgorithm=this.hashAlgorithm.toJSON()),this.maskGenAlgorithm.isEqual(ai.defaultValues(Su))||(e.maskGenAlgorithm=this.maskGenAlgorithm.toJSON()),this.pSourceAlgorithm.isEqual(ai.defaultValues(Au))||(e.pSourceAlgorithm=this.pSourceAlgorithm.toJSON()),e}};Tw.CLASS_NAME="RSAESOAEPParams";var ip="keyInfo",Cu="entityUInfo",ap="suppPubInfo",Oz=[ip,Cu,ap],KN=class op extends Ee{static{u(this,"ECCCMSSharedInfo")}constructor(e={}){super(),this.keyInfo=T(e,ip,op.defaultValues(ip)),Cu in e&&(this.entityUInfo=T(e,Cu,op.defaultValues(Cu))),this.suppPubInfo=T(e,ap,op.defaultValues(ap)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ip:return new ce;case Cu:return new Ne;case ap:return new Ne;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ip:case Cu:case ap:return t.isEqual(op.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.keyInfo||{}),new re({name:t.entityUInfo||P,idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[new Ne]}),new re({name:t.suppPubInfo||P,idBlock:{tagClass:3,tagNumber:2},value:[new Ne]})]})}fromSchema(e){we(e,Oz);let t=ve(e,e,op.schema({names:{keyInfo:{names:{blockName:ip}},entityUInfo:Cu,suppPubInfo:ap}}));me.assertSchema(t,this.className),this.keyInfo=new ce({schema:t.result.keyInfo}),Cu in t.result&&(this.entityUInfo=t.result.entityUInfo.valueBlock.value[0]),this.suppPubInfo=t.result.suppPubInfo.valueBlock.value[0]}toSchema(){let e=[];return e.push(this.keyInfo.toSchema()),this.entityUInfo&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[this.entityUInfo]})),e.push(new re({idBlock:{tagClass:3,tagNumber:2},value:[this.suppPubInfo]})),new H({value:e})}toJSON(){let e={keyInfo:this.keyInfo.toJSON(),suppPubInfo:this.suppPubInfo.toJSON()};return this.entityUInfo&&(e.entityUInfo=this.entityUInfo.toJSON()),e}};KN.CLASS_NAME="ECCCMSSharedInfo";var up="version",xu="originatorInfo",lp="recipientInfos",cp="encryptedContentInfo",bu="unprotectedAttrs",_z=[up,xu,lp,cp,bu],T8={kdfAlgorithm:"SHA-512",kekEncryptionLength:256},Pz={"P-256":256,"P-384":384,"P-521":528},XN=class Nu extends Ee{static{u(this,"EnvelopedData")}constructor(e={}){super(),this.version=T(e,up,Nu.defaultValues(up)),xu in e&&(this.originatorInfo=T(e,xu,Nu.defaultValues(xu))),this.recipientInfos=T(e,lp,Nu.defaultValues(lp)),this.encryptedContentInfo=T(e,cp,Nu.defaultValues(cp)),bu in e&&(this.unprotectedAttrs=T(e,bu,Nu.defaultValues(bu))),this.policy={disableSplit:!!e.disableSplit},e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case up:return 0;case xu:return new Sw;case lp:return[];case cp:return new In;case bu:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case up:return t===Nu.defaultValues(e);case xu:return t.certs.certificates.length===0&&t.crls.crls.length===0;case lp:case bu:return t.length===0;case cp:return In.compareWithDefault("contentType",t.contentType)&&In.compareWithDefault("contentEncryptionAlgorithm",t.contentEncryptionAlgorithm)&&In.compareWithDefault("encryptedContent",t.encryptedContent);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||P}),new re({name:t.originatorInfo||P,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:Sw.schema().valueBlock.value}),new xr({value:[new ut({name:t.recipientInfos||P,value:gc.schema()})]}),In.schema(t.encryptedContentInfo||{}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new ut({name:t.unprotectedAttrs||P,value:_r.schema()})]})]})}fromSchema(e){we(e,_z);let t=ve(e,e,Nu.schema({names:{version:up,originatorInfo:xu,recipientInfos:lp,encryptedContentInfo:{names:{blockName:cp}},unprotectedAttrs:bu}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,xu in t.result&&(this.originatorInfo=new Sw({schema:new H({value:t.result.originatorInfo.valueBlock.value})})),this.recipientInfos=Array.from(t.result.recipientInfos,n=>new gc({schema:n})),this.encryptedContentInfo=new In({schema:t.result.encryptedContentInfo}),bu in t.result&&(this.unprotectedAttrs=Array.from(t.result.unprotectedAttrs,n=>new _r({schema:n})))}toSchema(){let e=[];return e.push(new le({value:this.version})),this.originatorInfo&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:this.originatorInfo.toSchema().valueBlock.value})),e.push(new xr({value:Array.from(this.recipientInfos,t=>t.toSchema())})),e.push(this.encryptedContentInfo.toSchema()),this.unprotectedAttrs&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.unprotectedAttrs,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={version:this.version,recipientInfos:Array.from(this.recipientInfos,t=>t.toJSON()),encryptedContentInfo:this.encryptedContentInfo.toJSON()};return this.originatorInfo&&(e.originatorInfo=this.originatorInfo.toJSON()),this.unprotectedAttrs&&(e.unprotectedAttrs=Array.from(this.unprotectedAttrs,t=>t.toJSON())),e}addRecipientByCertificate(e,t,n,s=pt(!0)){let i=Object.assign({useOAEP:!0,oaepHashAlgorithm:"SHA-512"},T8,t||{});if(e.subjectPublicKeyInfo.algorithm.algorithmId.indexOf("1.2.840.113549")!==-1)n=1;else if(e.subjectPublicKeyInfo.algorithm.algorithmId.indexOf("1.2.840.10045")!==-1)n=2;else throw new Error(`Unknown type of certificate's public key: ${e.subjectPublicKeyInfo.algorithm.algorithmId}`);switch(n){case 1:{let a,o;if(i.useOAEP===!0){a=s.getOIDByAlgorithm({name:"RSA-OAEP"},!0,"keyEncryptionAlgorithm");let c=s.getOIDByAlgorithm({name:i.oaepHashAlgorithm},!0,"RSAES-OAEP-params"),f=new ce({algorithmId:c,algorithmParams:new Cr});o=new Tw({hashAlgorithm:f,maskGenAlgorithm:new ce({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:f.toSchema()})}).toSchema()}else{if(a=s.getOIDByAlgorithm({name:"RSAES-PKCS1-v1_5"}),a===P)throw new Error("Can not find OID for RSAES-PKCS1-v1_5");o=new Cr}let l=new fS({version:0,rid:new wn({issuer:e.issuer,serialNumber:e.serialNumber}),keyEncryptionAlgorithm:new ce({algorithmId:a,algorithmParams:o}),recipientCertificate:e});this.recipientInfos.push(new gc({variant:1,value:l}))}break;case 2:{let a=new Wp({variant:1,value:new wn({issuer:e.issuer,serialNumber:e.serialNumber})});this._addKeyAgreeRecipientInfo(a,i,{recipientCertificate:e},s)}break;default:throw new Error(`Unknown "variant" value: ${n}`)}return!0}addRecipientByPreDefinedData(e,t={},n,s=pt(!0)){if(sr.assert(e,"preDefinedData","ArrayBuffer"),!e.byteLength)throw new Error("Pre-defined data could have zero length");if(!t.keyIdentifier){let i=new ArrayBuffer(16),a=new Uint8Array(i);s.getRandomValues(a),t.keyIdentifier=i}switch(t.hmacHashAlgorithm||(t.hmacHashAlgorithm="SHA-512"),t.iterationCount===void 0&&(t.iterationCount=2048),t.keyEncryptionAlgorithm||(t.keyEncryptionAlgorithm={name:"AES-KW",length:256}),t.keyEncryptionAlgorithmParams||(t.keyEncryptionAlgorithmParams=new Cr),n){case 1:{let i=s.getOIDByAlgorithm(t.keyEncryptionAlgorithm,!0,"keyEncryptionAlgorithm"),a=new gS({version:4,kekid:new G1({keyIdentifier:new Ne({valueHex:t.keyIdentifier})}),keyEncryptionAlgorithm:new ce({algorithmId:i,algorithmParams:t.keyEncryptionAlgorithmParams}),preDefinedKEK:e});this.recipientInfos.push(new gc({variant:3,value:a}))}break;case 2:{let i=s.getOIDByAlgorithm({name:"PBKDF2"},!0,"keyDerivationAlgorithm"),a=new ArrayBuffer(64),o=new Uint8Array(a);s.getRandomValues(o);let l=s.getOIDByAlgorithm({name:"HMAC",hash:{name:t.hmacHashAlgorithm}},!0,"hmacHashAlgorithm"),c=new $p({salt:new Ne({valueHex:a}),iterationCount:t.iterationCount,prf:new ce({algorithmId:l,algorithmParams:new Cr})}),f=s.getOIDByAlgorithm(t.keyEncryptionAlgorithm,!0,"keyEncryptionAlgorithm"),p=new yS({version:0,keyDerivationAlgorithm:new ce({algorithmId:i,algorithmParams:c.toSchema()}),keyEncryptionAlgorithm:new ce({algorithmId:f,algorithmParams:t.keyEncryptionAlgorithmParams}),password:e});this.recipientInfos.push(new gc({variant:4,value:p}))}break;default:throw new Error(`Unknown value for "variant": ${n}`)}}addRecipientByKeyIdentifier(e,t,n,s=pt(!0)){let i=Object.assign({},T8,n||{}),a=new Wp({variant:2,value:new pS({subjectKeyIdentifier:new Ne({valueHex:t})})});this._addKeyAgreeRecipientInfo(a,i,{recipientPublicKey:e},s)}_addKeyAgreeRecipientInfo(e,t,n,s=pt(!0)){let i=new dS({rid:e}),a=s.getOIDByAlgorithm({name:"AES-KW",length:t.kekEncryptionLength},!0,"keyEncryptionAlgorithm"),o=new ce({algorithmId:a}),l=s.getOIDByAlgorithm({name:"ECDH",kdf:t.kdfAlgorithm},!0,"KeyAgreeRecipientInfo"),c=new ArrayBuffer(64),f=new Uint8Array(c);s.getRandomValues(f);let p={version:3,ukm:new Ne({valueHex:c}),keyEncryptionAlgorithm:new ce({algorithmId:l,algorithmParams:o.toSchema()}),recipientEncryptedKeys:new X1({encryptedKeys:[i]})},d=new mS(Object.assign(p,n));this.recipientInfos.push(new gc({variant:2,value:d}))}async encrypt(e,t,n=pt(!0)){let s=new ArrayBuffer(16),i=new Uint8Array(s);n.getRandomValues(i);let a=new Uint8Array(t),o=n.getOIDByAlgorithm(e,!0,"contentEncryptionAlgorithm"),l=await n.generateKey(e,!0,["encrypt"]),c=await n.encrypt({name:e.name,iv:i},l,a),f=await n.exportKey("raw",l);this.version=2,this.encryptedContentInfo=new In({disableSplit:this.policy.disableSplit,contentType:"1.2.840.113549.1.7.1",contentEncryptionAlgorithm:new ce({algorithmId:o,algorithmParams:new Ne({valueHex:s})}),encryptedContent:new Ne({valueHex:c})});let p=u(async y=>{let S=this.recipientInfos[y].value,C,w;if(S.recipientPublicKey)C=S.recipientPublicKey.algorithm.namedCurve,w=S.recipientPublicKey;else if(S.recipientCertificate){let pe=S.recipientCertificate.subjectPublicKeyInfo.algorithm.algorithmParams;if(pe.constructor.blockName()!==je.blockName())throw new Error(`Incorrect "recipientCertificate" for index ${y}`);switch(pe.valueBlock.toString()){case"1.2.840.10045.3.1.7":C="P-256";break;case"1.3.132.0.34":C="P-384";break;case"1.3.132.0.35":C="P-521";break;default:throw new Error(`Incorrect curve OID for index ${y}`)}w=await S.recipientCertificate.getPublicKey({algorithm:{algorithm:{name:"ECDH",namedCurve:C},usages:[]}},n)}else throw new Error("Unsupported RecipientInfo");let E=Pz[C],A=await n.generateKey({name:"ECDH",namedCurve:C},!0,["deriveBits"]),b=await n.exportKey("spki",A.publicKey),V=await n.deriveBits({name:"ECDH",public:w},A.privateKey,E),I=new ce({schema:S.keyEncryptionAlgorithm.algorithmParams}),D=n.getAlgorithmByOID(I.algorithmId,!0,"aesKWAlgorithm"),U=D.length,F=new ArrayBuffer(4),M=new Uint8Array(F);for(let pe=3;pe>=0;pe--)M[pe]=U,U>>=8;let ee=new KN({keyInfo:new ce({algorithmId:I.algorithmId}),entityUInfo:S.ukm,suppPubInfo:new Ne({valueHex:F})}).toSchema().toBER(!1),ie=n.getAlgorithmByOID(S.keyEncryptionAlgorithm.algorithmId,!0,"ecdhAlgorithm"),X=await d8(ie.kdf,V,D.length,ee,n),he=await n.importKey("raw",X,{name:"AES-KW"},!0,["wrapKey"]),Ce=await n.wrapKey("raw",l,he,{name:"AES-KW"}),xe=new K1;return xe.variant=3,xe.value=hS.fromBER(b),S.originator=xe,S.recipientEncryptedKeys.encryptedKeys[0].encryptedKey=new Ne({valueHex:Ce}),{ecdhPrivateKey:A.privateKey}},"SubKeyAgreeRecipientInfo"),d=u(async y=>{let S=this.recipientInfos[y].value,C=n.getAlgorithmByOID(S.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm");if(C.name==="RSA-OAEP"){let w=S.keyEncryptionAlgorithm.algorithmParams,E=new Tw({schema:w});if(C.hash=n.getAlgorithmByOID(E.hashAlgorithm.algorithmId),!("name"in C.hash))throw new Error(`Incorrect OID for hash algorithm: ${E.hashAlgorithm.algorithmId}`)}try{let w=await S.recipientCertificate.getPublicKey({algorithm:{algorithm:C,usages:["encrypt","wrapKey"]}},n),E=await n.encrypt(w.algorithm,w,f);S.encryptedKey=new Ne({valueHex:E})}catch{}},"SubKeyTransRecipientInfo"),g=u(async y=>{let S=this.recipientInfos[y].value,C=n.getAlgorithmByOID(S.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),w=await n.importKey("raw",new Uint8Array(S.preDefinedKEK),C,!0,["wrapKey"]),E=await n.wrapKey("raw",l,w,C);S.encryptedKey=new Ne({valueHex:E})},"SubKEKRecipientInfo"),m=u(async y=>{let S=this.recipientInfos[y].value,C;if(!S.keyDerivationAlgorithm)throw new Error('Please append encoded "keyDerivationAlgorithm"');if(!S.keyDerivationAlgorithm.algorithmParams)throw new Error('Incorrectly encoded "keyDerivationAlgorithm"');try{C=new $p({schema:S.keyDerivationAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "keyDerivationAlgorithm"')}let w=new Uint8Array(S.password),E=await n.importKey("raw",w,"PBKDF2",!1,["deriveKey"]),A=n.getAlgorithmByOID(S.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),b="SHA-1";C.prf&&(b=n.getAlgorithmByOID(C.prf.algorithmId,!0,"prfAlgorithm").hash.name);let V=new Uint8Array(C.salt.valueBlock.valueHex),I=C.iterationCount,D=await n.deriveKey({name:"PBKDF2",hash:{name:b},salt:V,iterations:I},E,A,!0,["wrapKey"]),U=await n.wrapKey("raw",l,D,A);S.encryptedKey=new Ne({valueHex:U})},"SubPasswordRecipientinfo"),v=[];for(let y=0;y<this.recipientInfos.length;y++)switch(this.recipientInfos[y].variant){case 1:v.push(await d(y));break;case 2:v.push(await p(y));break;case 3:v.push(await g(y));break;case 4:v.push(await m(y));break;default:throw new Error(`Unknown recipient type in array with index ${y}`)}return v}async decrypt(e,t,n=pt(!0)){let s=t||{};if(e+1>this.recipientInfos.length)throw new Error(`Maximum value for "index" is: ${this.recipientInfos.length-1}`);let i=u(async v=>{let y=this.recipientInfos[v].value,S,C,w,E=y.originator;if(s.recipientCertificate){let ie=s.recipientCertificate.subjectPublicKeyInfo.algorithm.algorithmParams;if(ie.constructor.blockName()!==je.blockName())throw new Error(`Incorrect "recipientCertificate" for index ${v}`);S=ie.valueBlock.toString()}else if(E.value.algorithm.algorithmParams){let ie=E.value.algorithm.algorithmParams;if(ie.constructor.blockName()!==je.blockName())throw new Error(`Incorrect originator for index ${v}`);S=ie.valueBlock.toString()}else throw new Error('Parameter "recipientCertificate" is mandatory for "KeyAgreeRecipientInfo" if algorithm params are missing from originator');if(!s.recipientPrivateKey)throw new Error('Parameter "recipientPrivateKey" is mandatory for "KeyAgreeRecipientInfo"');switch(S){case"1.2.840.10045.3.1.7":C="P-256",w=256;break;case"1.3.132.0.34":C="P-384",w=384;break;case"1.3.132.0.35":C="P-521",w=528;break;default:throw new Error(`Incorrect curve OID for index ${v}`)}let A,b=n;Ye.isBufferSource(s.recipientPrivateKey)?A=await n.importKey("pkcs8",s.recipientPrivateKey,{name:"ECDH",namedCurve:C},!0,["deriveBits"]):(A=s.recipientPrivateKey,"crypto"in s&&s.crypto&&(b=s.crypto.subtle)),"algorithmParams"in E.value.algorithm||(E.value.algorithm.algorithmParams=new je({value:S}));let V=E.value.toSchema().toBER(!1),I=await n.importKey("spki",V,{name:"ECDH",namedCurve:C},!0,[]),D=await b.deriveBits({name:"ECDH",public:I},A,w);async function U(ie){ie=ie||!1;let X=new ce({schema:y.keyEncryptionAlgorithm.algorithmParams}),he=n.getAlgorithmByOID(X.algorithmId,!0,"kwAlgorithm"),Ce=he.length,xe=new ArrayBuffer(4),pe=new Uint8Array(xe);for(let Le=3;Le>=0;Le--)pe[Le]=Ce,Ce>>=8;let W={algorithmId:X.algorithmId};ie&&(W.algorithmParams=new Cr);let Ie=new KN({keyInfo:new ce(W),entityUInfo:y.ukm,suppPubInfo:new Ne({valueHex:xe})}).toSchema().toBER(!1),Ve=n.getAlgorithmByOID(y.keyEncryptionAlgorithm.algorithmId,!0,"ecdhAlgorithm");if(!Ve.name)throw new Error(`Incorrect OID for key encryption algorithm: ${y.keyEncryptionAlgorithm.algorithmId}`);return d8(Ve.kdf,D,he.length,Ie,n)}u(U,"applyKDF");let F=await U(),M=u(async ie=>n.importKey("raw",ie,{name:"AES-KW"},!0,["unwrapKey"]),"importAesKwKey"),se=await M(F),ee=u(async ie=>{let X=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,he=n.getAlgorithmByOID(X,!0,"contentEncryptionAlgorithm");return n.unwrapKey("raw",y.recipientEncryptedKeys.encryptedKeys[0].encryptedKey.valueBlock.valueHexView,ie,{name:"AES-KW"},he,!0,["decrypt"])},"unwrapSessionKey");try{return await ee(se)}catch{let ie=await U(!0),X=await M(ie);return ee(X)}},"SubKeyAgreeRecipientInfo"),a=u(async v=>{let y=this.recipientInfos[v].value;if(!s.recipientPrivateKey)throw new Error('Parameter "recipientPrivateKey" is mandatory for "KeyTransRecipientInfo"');let S=n.getAlgorithmByOID(y.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm");if(S.name==="RSA-OAEP"){let V=y.keyEncryptionAlgorithm.algorithmParams,I=new Tw({schema:V});if(S.hash=n.getAlgorithmByOID(I.hashAlgorithm.algorithmId),!("name"in S.hash))throw new Error(`Incorrect OID for hash algorithm: ${I.hashAlgorithm.algorithmId}`)}let C,w=n;Ye.isBufferSource(s.recipientPrivateKey)?C=await n.importKey("pkcs8",s.recipientPrivateKey,S,!0,["decrypt"]):(C=s.recipientPrivateKey,"crypto"in s&&s.crypto&&(w=s.crypto.subtle));let E=await w.decrypt(C.algorithm,C,y.encryptedKey.valueBlock.valueHexView),A=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,b=n.getAlgorithmByOID(A,!0,"contentEncryptionAlgorithm");if(!("name"in b))throw new Error(`Incorrect "contentEncryptionAlgorithm": ${A}`);return n.importKey("raw",E,b,!0,["decrypt"])},"SubKeyTransRecipientInfo"),o=u(async v=>{let y=this.recipientInfos[v].value;if(!s.preDefinedData)throw new Error('Parameter "preDefinedData" is mandatory for "KEKRecipientInfo"');let S=n.getAlgorithmByOID(y.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),C=await n.importKey("raw",s.preDefinedData,S,!0,["unwrapKey"]),w=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,E=n.getAlgorithmByOID(w,!0,"contentEncryptionAlgorithm");if(!E.name)throw new Error(`Incorrect "contentEncryptionAlgorithm": ${w}`);return n.unwrapKey("raw",y.encryptedKey.valueBlock.valueHexView,C,S,E,!0,["decrypt"])},"SubKEKRecipientInfo"),l=u(async v=>{let y=this.recipientInfos[v].value,S;if(!s.preDefinedData)throw new Error('Parameter "preDefinedData" is mandatory for "KEKRecipientInfo"');if(!y.keyDerivationAlgorithm)throw new Error('Please append encoded "keyDerivationAlgorithm"');if(!y.keyDerivationAlgorithm.algorithmParams)throw new Error('Incorrectly encoded "keyDerivationAlgorithm"');try{S=new $p({schema:y.keyDerivationAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "keyDerivationAlgorithm"')}let C=await n.importKey("raw",s.preDefinedData,"PBKDF2",!1,["deriveKey"]),w=n.getAlgorithmByOID(y.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm"),E=S.prf?n.getAlgorithmByOID(S.prf.algorithmId,!0,"prfAlgorithm").hash.name:"SHA-1",A=new Uint8Array(S.salt.valueBlock.valueHex),b=S.iterationCount,V=await n.deriveKey({name:"PBKDF2",hash:{name:E},salt:A,iterations:b},C,w,!0,["unwrapKey"]),I=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,D=n.getAlgorithmByOID(I,!0,"contentEncryptionAlgorithm");return n.unwrapKey("raw",y.encryptedKey.valueBlock.valueHexView,V,w,D,!0,["decrypt"])},"SubPasswordRecipientinfo"),c;switch(this.recipientInfos[e].variant){case 1:c=await a(e);break;case 2:c=await i(e);break;case 3:c=await o(e);break;case 4:c=await l(e);break;default:throw new Error(`Unknown recipient type in array with index ${e}`)}let f=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,p=n.getAlgorithmByOID(f,!0,"contentEncryptionAlgorithm"),d=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmParams.valueBlock.valueHex,g=new Uint8Array(d);if(!this.encryptedContentInfo.encryptedContent)throw new Error("Required property `encryptedContent` is empty");let m=this.encryptedContentInfo.getEncryptedContent();return n.decrypt({name:p.name,iv:g},c,m)}};XN.CLASS_NAME="EnvelopedData";var lh="safeContents",dm="parsedValue",I8="contentInfos",GN=class Iw extends Ee{static{u(this,"AuthenticatedSafe")}constructor(e={}){super(),this.safeContents=T(e,lh,Iw.defaultValues(lh)),dm in e&&(this.parsedValue=T(e,dm,Iw.defaultValues(dm))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case lh:return[];case dm:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case lh:return t.length===0;case dm:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new ut({name:t.contentInfos||P,value:Nr.schema()})]})}fromSchema(e){we(e,[I8]);let t=ve(e,e,Iw.schema({names:{contentInfos:I8}}));me.assertSchema(t,this.className),this.safeContents=Array.from(t.result.contentInfos,n=>new Nr({schema:n}))}toSchema(){return new H({value:Array.from(this.safeContents,e=>e.toSchema())})}toJSON(){return{safeContents:Array.from(this.safeContents,e=>e.toJSON())}}async parseInternalValues(e,t=pt(!0)){if(Ht.assert(e,lh),sr.assert(e.safeContents,lh,"Array"),e.safeContents.length!==this.safeContents.length)throw new sr('Length of "parameters.safeContents" must be equal to "this.safeContents.length"');this.parsedValue={safeContents:[]};for(let[n,s]of this.safeContents.entries()){let i=e.safeContents[n],a=`parameters.safeContents[${n}]`;switch(s.contentType){case vT:{sr.assert(s.content,"this.safeContents[j].content",Ne);let o=s.content.getValue();this.parsedValue.safeContents.push({privacyMode:0,value:Gp.fromBER(o)})}break;case q8:{let o=new XN({schema:s.content});Ht.assert(a,i,"recipientCertificate","recipientKey");let l=i,c=l.recipientCertificate,f=l.recipientKey,p=await o.decrypt(0,{recipientCertificate:c,recipientPrivateKey:f},t);this.parsedValue.safeContents.push({privacyMode:2,value:Gp.fromBER(p)})}break;case H8:{let o=new Y1({schema:s.content});Ht.assert(a,i,"password");let l=i.password,c=await o.decrypt({password:l},t);this.parsedValue.safeContents.push({privacyMode:1,value:Gp.fromBER(c)})}break;default:throw new Error(`Unknown "contentType" for AuthenticatedSafe: " ${s.contentType}`)}}}async makeInternalValues(e,t=pt(!0)){if(!this.parsedValue)throw new Error('Please run "parseValues" first or add "parsedValue" manually');if(sr.assert(this.parsedValue,"this.parsedValue","object"),sr.assert(this.parsedValue.safeContents,"this.parsedValue.safeContents","Array"),sr.assert(e,"parameters","object"),Ht.assert(e,"safeContents"),sr.assert(e.safeContents,"parameters.safeContents","Array"),e.safeContents.length!==this.parsedValue.safeContents.length)throw new sr('Length of "parameters.safeContents" must be equal to "this.parsedValue.safeContents"');this.safeContents=[];for(let[n,s]of this.parsedValue.safeContents.entries())switch(Ht.assert("content",s,"privacyMode","value"),sr.assert(s.value,"content.value",Gp),s.privacyMode){case 0:{let i=s.value.toSchema().toBER(!1);this.safeContents.push(new Nr({contentType:"1.2.840.113549.1.7.1",content:new Ne({valueHex:i})}))}break;case 1:{let i=new Y1,a=e.safeContents[n];a.contentToEncrypt=s.value.toSchema().toBER(!1),await i.encrypt(a,t),this.safeContents.push(new Nr({contentType:"1.2.840.113549.1.7.6",content:i.toSchema()}))}break;case 2:{let i=new XN,a=s.value.toSchema().toBER(!1),o=e.safeContents[n];switch(Ht.assert(`parameters.safeContents[${n}]`,o,"encryptingCertificate","encryptionAlgorithm"),!0){case o.encryptionAlgorithm.name.toLowerCase()==="aes-cbc":case o.encryptionAlgorithm.name.toLowerCase()==="aes-gcm":break;default:throw new Error(`Incorrect parameter "encryptionAlgorithm" in "parameters.safeContents[i]": ${o.encryptionAlgorithm}`)}switch(!0){case o.encryptionAlgorithm.length===128:case o.encryptionAlgorithm.length===192:case o.encryptionAlgorithm.length===256:break;default:throw new Error(`Incorrect parameter "encryptionAlgorithm.length" in "parameters.safeContents[i]": ${o.encryptionAlgorithm.length}`)}let l=o.encryptionAlgorithm;i.addRecipientByCertificate(o.encryptingCertificate,{},void 0,t),await i.encrypt(l,a,t),this.safeContents.push(new Nr({contentType:"1.2.840.113549.1.7.3",content:i.toSchema()}))}break;default:throw new Error(`Incorrect value for "content.privacyMode": ${s.privacyMode}`)}return this}};GN.CLASS_NAME="AuthenticatedSafe";var yc="hashAlgorithm",fp="issuerNameHash",hp="issuerKeyHash",vc="serialNumber",kz=[yc,fp,hp,vc],ms=class Tu extends Ee{static{u(this,"CertID")}static async create(e,t,n=pt(!0)){let s=new Tu;return await s.createForCertificate(e,t,n),s}constructor(e={}){super(),this.hashAlgorithm=T(e,yc,Tu.defaultValues(yc)),this.issuerNameHash=T(e,fp,Tu.defaultValues(fp)),this.issuerKeyHash=T(e,hp,Tu.defaultValues(hp)),this.serialNumber=T(e,vc,Tu.defaultValues(vc)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case yc:return new ce;case fp:case hp:return new Ne;case vc:return new le;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case yc:return t.algorithmId===P&&!("algorithmParams"in t);case fp:case hp:case vc:return t.isEqual(Tu.defaultValues(vc));default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.hashAlgorithmObject||{names:{blockName:t.hashAlgorithm||P}}),new Ne({name:t.issuerNameHash||P}),new Ne({name:t.issuerKeyHash||P}),new le({name:t.serialNumber||P})]})}fromSchema(e){we(e,kz);let t=ve(e,e,Tu.schema({names:{hashAlgorithm:yc,issuerNameHash:fp,issuerKeyHash:hp,serialNumber:vc}}));me.assertSchema(t,this.className),this.hashAlgorithm=new ce({schema:t.result.hashAlgorithm}),this.issuerNameHash=t.result.issuerNameHash,this.issuerKeyHash=t.result.issuerKeyHash,this.serialNumber=t.result.serialNumber}toSchema(){return new H({value:[this.hashAlgorithm.toSchema(),this.issuerNameHash,this.issuerKeyHash,this.serialNumber]})}toJSON(){return{hashAlgorithm:this.hashAlgorithm.toJSON(),issuerNameHash:this.issuerNameHash.toJSON(),issuerKeyHash:this.issuerKeyHash.toJSON(),serialNumber:this.serialNumber.toJSON()}}isEqual(e){return!(this.hashAlgorithm.algorithmId!==e.hashAlgorithm.algorithmId||!Ye.isEqual(this.issuerNameHash.valueBlock.valueHexView,e.issuerNameHash.valueBlock.valueHexView)||!Ye.isEqual(this.issuerKeyHash.valueBlock.valueHexView,e.issuerKeyHash.valueBlock.valueHexView)||!this.serialNumber.isEqual(e.serialNumber))}async createForCertificate(e,t,n=pt(!0)){Ht.assert(t,yc,"issuerCertificate");let s=n.getOIDByAlgorithm({name:t.hashAlgorithm},!0,"hashAlgorithm");this.hashAlgorithm=new ce({algorithmId:s,algorithmParams:new Cr});let i=t.issuerCertificate;this.serialNumber=e.serialNumber;let a=await n.digest({name:t.hashAlgorithm},i.subject.toSchema().toBER(!1));this.issuerNameHash=new Ne({valueHex:a});let o=i.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView,l=await n.digest({name:t.hashAlgorithm},o);this.issuerKeyHash=new Ne({valueHex:l})}};ms.CLASS_NAME="CertID";var pp="certID",dp="certStatus",mp="thisUpdate",Iu="nextUpdate",Ec="singleExtensions",Lz=[pp,dp,mp,Iu,Ec],$N=class Du extends Ee{static{u(this,"SingleResponse")}constructor(e={}){super(),this.certID=T(e,pp,Du.defaultValues(pp)),this.certStatus=T(e,dp,Du.defaultValues(dp)),this.thisUpdate=T(e,mp,Du.defaultValues(mp)),Iu in e&&(this.nextUpdate=T(e,Iu,Du.defaultValues(Iu))),Ec in e&&(this.singleExtensions=T(e,Ec,Du.defaultValues(Ec))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case pp:return new ms;case dp:return{};case mp:case Iu:return new Date(0,0,0);case Ec:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case pp:return ms.compareWithDefault("hashAlgorithm",t.hashAlgorithm)&&ms.compareWithDefault("issuerNameHash",t.issuerNameHash)&&ms.compareWithDefault("issuerKeyHash",t.issuerKeyHash)&&ms.compareWithDefault("serialNumber",t.serialNumber);case dp:return Object.keys(t).length===0;case mp:case Iu:return t===Du.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ms.schema(t.certID||{}),new mr({value:[new Ze({name:t.certStatus||P,idBlock:{tagClass:3,tagNumber:0}}),new re({name:t.certStatus||P,idBlock:{tagClass:3,tagNumber:1},value:[new dr,new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Fo]})]}),new Ze({name:t.certStatus||P,idBlock:{tagClass:3,tagNumber:2},lenBlock:{length:1}})]}),new dr({name:t.thisUpdate||P}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new dr({name:t.nextUpdate||P})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[Wr.schema(t.singleExtensions||{})]})]})}fromSchema(e){we(e,Lz);let t=ve(e,e,Du.schema({names:{certID:{names:{blockName:pp}},certStatus:dp,thisUpdate:mp,nextUpdate:Iu,singleExtensions:{names:{blockName:Ec}}}}));me.assertSchema(t,this.className),this.certID=new ms({schema:t.result.certID}),this.certStatus=t.result.certStatus,this.thisUpdate=t.result.thisUpdate.toDate(),Iu in t.result&&(this.nextUpdate=t.result.nextUpdate.toDate()),Ec in t.result&&(this.singleExtensions=Array.from(t.result.singleExtensions.valueBlock.value,n=>new Us({schema:n})))}toSchema(){let e=[];return e.push(this.certID.toSchema()),e.push(this.certStatus),e.push(new dr({valueDate:this.thisUpdate})),this.nextUpdate&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[new dr({valueDate:this.nextUpdate})]})),this.singleExtensions&&e.push(new re({idBlock:{tagClass:3,tagNumber:1},value:[new H({value:Array.from(this.singleExtensions,t=>t.toSchema())})]})),new H({value:e})}toJSON(){let e={certID:this.certID.toJSON(),certStatus:this.certStatus.toJSON(),thisUpdate:this.thisUpdate};return this.nextUpdate&&(e.nextUpdate=this.nextUpdate),this.singleExtensions&&(e.singleExtensions=Array.from(this.singleExtensions,t=>t.toJSON())),e}};$N.CLASS_NAME="SingleResponse";var LE="tbs",wc="version",y1="responderID",v1="producedAt",E1="responses",gp="responseExtensions",Xc="ResponseData",Dw=`${Xc}.${wc}`,yp=`${Xc}.${y1}`,WN=`${Xc}.${v1}`,zN=`${Xc}.${E1}`,Bw=`${Xc}.${gp}`,Vz=[Xc,Dw,yp,WN,zN,Bw],Pa=class ji extends Ee{static{u(this,"ResponseData")}get tbs(){return Ye.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(T(e,LE,ji.defaultValues(LE))),wc in e&&(this.version=T(e,wc,ji.defaultValues(wc))),this.responderID=T(e,y1,ji.defaultValues(y1)),this.producedAt=T(e,v1,ji.defaultValues(v1)),this.responses=T(e,E1,ji.defaultValues(E1)),gp in e&&(this.responseExtensions=T(e,gp,ji.defaultValues(gp))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wc:return 0;case LE:return Or;case y1:return{};case v1:return new Date(0,0,0);case E1:case gp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case LE:return t.byteLength===0;case y1:return Object.keys(t).length===0;case v1:return t===ji.defaultValues(e);case E1:case gp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||Xc,value:[new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new le({name:t.version||Dw})]}),new mr({value:[new re({name:t.responderID||yp,idBlock:{tagClass:3,tagNumber:1},value:[gr.schema(t.ResponseDataByName||{names:{blockName:"ResponseData.byName"}})]}),new re({name:t.responderID||yp,idBlock:{tagClass:3,tagNumber:2},value:[new Ne({name:t.ResponseDataByKey||"ResponseData.byKey"})]})]}),new dr({name:t.producedAt||WN}),new H({value:[new ut({name:zN,value:$N.schema(t.response||{})})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[Wr.schema(t.extensions||{names:{blockName:Bw}})]})]})}fromSchema(e){we(e,Vz);let t=ve(e,e,ji.schema());me.assertSchema(t,this.className),this.tbsView=t.result.ResponseData.valueBeforeDecodeView,Dw in t.result&&(this.version=t.result[Dw].valueBlock.valueDec),t.result[yp].idBlock.tagNumber===1?this.responderID=new gr({schema:t.result[yp].valueBlock.value[0]}):this.responderID=t.result[yp].valueBlock.value[0],this.producedAt=t.result[WN].toDate(),this.responses=Array.from(t.result[zN],n=>new $N({schema:n})),Bw in t.result&&(this.responseExtensions=Array.from(t.result[Bw].valueBlock.value,n=>new Us({schema:n})))}toSchema(e=!1){let t;if(e===!1){if(!this.tbsView.byteLength)return ji.schema();let n=Ar(this.tbsView);me.assert(n,"TBS Response Data"),t=n.result}else{let n=[];wc in this&&n.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[new le({value:this.version})]})),this.responderID instanceof gr?n.push(new re({idBlock:{tagClass:3,tagNumber:1},value:[this.responderID.toSchema()]})):n.push(new re({idBlock:{tagClass:3,tagNumber:2},value:[this.responderID]})),n.push(new dr({valueDate:this.producedAt})),n.push(new H({value:Array.from(this.responses,s=>s.toSchema())})),this.responseExtensions&&n.push(new re({idBlock:{tagClass:3,tagNumber:1},value:[new H({value:Array.from(this.responseExtensions,s=>s.toSchema())})]})),t=new H({value:n})}return t}toJSON(){let e={};return wc in this&&(e.version=this.version),this.responderID&&(e.responderID=this.responderID),this.producedAt&&(e.producedAt=this.producedAt),this.responses&&(e.responses=Array.from(this.responses,t=>t.toJSON())),this.responseExtensions&&(e.responseExtensions=Array.from(this.responseExtensions,t=>t.toJSON())),e}};Pa.CLASS_NAME="ResponseData";var Jb="trustedCerts",Yb="certs",Qb="crls",Zb="ocsps",eN="checkDate",tN="findOrigin",rN="findIssuer",Lc;(function(r){r[r.unknown=-1]="unknown",r[r.success=0]="success",r[r.noRevocation=11]="noRevocation",r[r.noPath=60]="noPath",r[r.noValidPath=97]="noValidPath"})(Lc||(Lc={}));var vp=class m5 extends Error{static{u(this,"ChainValidationError")}constructor(e,t){super(t),this.name=m5.NAME,this.code=e,this.message=t}};vp.NAME="ChainValidationError";function Fz(r,e){for(let t=0;t<e.length;t++)if(Ye.isEqual(r.tbsView,e[t].tbsView))return!0;return!1}u(Fz,"isTrusted");var g5=class y5{static{u(this,"CertificateChainValidationEngine")}constructor(e={}){this.trustedCerts=T(e,Jb,this.defaultValues(Jb)),this.certs=T(e,Yb,this.defaultValues(Yb)),this.crls=T(e,Qb,this.defaultValues(Qb)),this.ocsps=T(e,Zb,this.defaultValues(Zb)),this.checkDate=T(e,eN,this.defaultValues(eN)),this.findOrigin=T(e,tN,this.defaultValues(tN)),this.findIssuer=T(e,rN,this.defaultValues(rN))}static defaultFindOrigin(e,t){e.tbsView.byteLength===0&&(e.tbsView=new Uint8Array(e.encodeTBS().toBER()));for(let n of t.certs)if(n.tbsView.byteLength===0&&(n.tbsView=new Uint8Array(n.encodeTBS().toBER())),Ye.isEqual(e.tbsView,n.tbsView))return"Intermediate Certificates";for(let n of t.trustedCerts)if(n.tbsView.byteLength===0&&(n.tbsView=new Uint8Array(n.encodeTBS().toBER())),Ye.isEqual(e.tbsView,n.tbsView))return"Trusted Certificates";return"Unknown"}async defaultFindIssuer(e,t,n=pt(!0)){let s=[],i=null,a=null,o=null;if(e.subject.isEqual(e.issuer))try{if(await e.verify(void 0,n))return[e]}catch{}if(e.extensions){for(let c of e.extensions)if(c.extnID===gT&&c.parsedValue instanceof wT){c.parsedValue.keyIdentifier?i=c.parsedValue.keyIdentifier:(c.parsedValue.authorityCertIssuer&&(a=c.parsedValue.authorityCertIssuer),c.parsedValue.authorityCertSerialNumber&&(o=c.parsedValue.authorityCertSerialNumber));break}}function l(c){if(i!==null&&c.extensions){let p=!1;for(let d of c.extensions)if(d.extnID===M$&&d.parsedValue){p=!0,Ye.isEqual(d.parsedValue.valueBlock.valueHex,i.valueBlock.valueHexView)&&s.push(c);break}if(p)return}let f=!1;o!==null&&(f=c.serialNumber.isEqual(o)),a!==null?c.subject.isEqual(a)&&f&&s.push(c):e.issuer.isEqual(c.subject)&&s.push(c)}u(l,"checkCertificate");for(let c of t.trustedCerts)l(c);for(let c of t.certs)l(c);for(let c=s.length-1;c>=0;c--)try{await e.verify(s[c],n)===!1&&s.splice(c,1)}catch{s.splice(c,1)}return s}defaultValues(e){switch(e){case Jb:return[];case Yb:return[];case Qb:return[];case Zb:return[];case eN:return new Date;case tN:return y5.defaultFindOrigin;case rN:return this.defaultFindIssuer;default:throw new Error(`Invalid member name for CertificateChainValidationEngine class: ${e}`)}}async sort(e=!1,t=pt(!0)){let n=[],s=u(async(m,v)=>{let y=[];function S(w){let E=!0;for(let A=0;A<w.length;A++){for(let b=0;b<w.length;b++)if(b!==A&&w[A]===w[b]){E=!1;break}if(!E)break}return E}if(u(S,"checkUnique"),Fz(m,this.trustedCerts))return[[m]];let C=await this.findIssuer(m,this,v);if(C.length===0)throw new Error("No valid certificate paths found");for(let w=0;w<C.length;w++){if(Ye.isEqual(C[w].tbsView,m.tbsView)){y.push([C[w]]);continue}let E=await s(C[w],v);for(let A=0;A<E.length;A++){let b=E[A].slice();b.splice(0,0,C[w]),S(b)?y.push(b):y.push(E[A])}}return y},"buildPath"),i=u(async m=>{let v=[],y=[],S=[];if(v.push(...n.filter(C=>m.issuer.isEqual(C.subject))),v.length===0)return{status:1,statusMessage:"No certificate's issuers"};if(y.push(...this.crls.filter(C=>C.issuer.isEqual(m.issuer))),y.length===0)return{status:2,statusMessage:"No CRLs for specific certificate issuer"};for(let C=0;C<y.length;C++){let w=y[C];if(!(w.nextUpdate&&w.nextUpdate.value<this.checkDate))for(let E=0;E<v.length;E++)try{if(await y[C].verify({issuerCertificate:v[E]},t)){S.push({crl:y[C],certificate:v[E]});break}}catch{}}return S.length?{status:0,statusMessage:P,result:S}:{status:3,statusMessage:"No valid CRLs found"}},"findCRL"),a=u(async(m,v)=>{let y=t.getAlgorithmByOID(m.signatureAlgorithm.algorithmId);if(!y.name||!y.hash)return 1;for(let S=0;S<this.ocsps.length;S++){let w=await this.ocsps[S].getCertificateStatus(m,v,t);if(w.isForCertificate)return w.status===0?0:1}return 2},"findOCSP");async function o(m,v=!1){let y=!1,S=!1,C=!1,w=!1;if(m.extensions){for(let E=0;E<m.extensions.length;E++){let A=m.extensions[E];if(A.critical&&!A.parsedValue)return{result:!1,resultCode:6,resultMessage:`Unable to parse critical certificate extension: ${A.extnID}`};if(A.extnID===j$){C=!0;let b=new Uint8Array(A.parsedValue.valueBlock.valueHex);(b[0]&4)===4&&(S=!0),(b[0]&2)===2&&(w=!0)}A.extnID===dT&&"cA"in A.parsedValue&&A.parsedValue.cA===!0&&(y=!0)}if(S===!0&&y===!1)return{result:!1,resultCode:3,resultMessage:'Unable to build certificate chain - using "keyCertSign" flag set without BasicConstraints'};if(C===!0&&y===!0&&S===!1)return{result:!1,resultCode:4,resultMessage:'Unable to build certificate chain - "keyCertSign" flag was not set'};if(y===!0&&C===!0&&v&&w===!1)return{result:!1,resultCode:5,resultMessage:'Unable to build certificate chain - intermediate certificate must have "cRLSign" key usage flag'}}return y===!1?{result:!1,resultCode:7,resultMessage:"Unable to build certificate chain - more than one possible end-user certificate"}:{result:!0,resultCode:0,resultMessage:P}}u(o,"checkForCA");let l=u(async(m,v)=>{for(let y=0;y<m.length;y++)if(m[y].notBefore.value>v||m[y].notAfter.value<v)return{result:!1,resultCode:8,resultMessage:"The certificate is either not yet valid or expired"};if(m.length<2)return{result:!1,resultCode:9,resultMessage:"Too short certificate path"};for(let y=m.length-2;y>=0;y--)if(m[y].issuer.isEqual(m[y].subject)===!1&&m[y].issuer.isEqual(m[y+1].subject)===!1)return{result:!1,resultCode:10,resultMessage:"Incorrect name chaining"};if(this.crls.length!==0||this.ocsps.length!==0)for(let y=0;y<m.length-1;y++){let S=2,C={status:0,statusMessage:P};if(this.ocsps.length!==0)switch(S=await a(m[y],m[y+1]),S){case 0:continue;case 1:return{result:!1,resultCode:12,resultMessage:"One of certificates was revoked via OCSP response"}}if(this.crls.length!==0){if(C=await i(m[y]),C.status===0&&C.result)for(let w=0;w<C.result.length;w++){if(C.result[w].crl.isCertificateRevoked(m[y]))return{result:!1,resultCode:12,resultMessage:"One of certificates had been revoked"};if((await o(C.result[w].certificate,!0)).result===!1)return{result:!1,resultCode:13,resultMessage:"CRL issuer certificate is not a CA certificate or does not have crlSign flag"}}else if(e===!1)throw new vp(Lc.noRevocation,`No revocation values found for one of certificates: ${C.statusMessage}`)}else if(S===2)return{result:!1,resultCode:11,resultMessage:"No revocation values found for one of certificates"};if(S===2&&C.status===2&&e){let w=m[y+1],E=!1;if(w.extensions)for(let A of w.extensions)switch(A.extnID){case V8:case mT:case yT:E=!0;break}if(E)throw new vp(Lc.noRevocation,`No revocation values found for one of certificates: ${C.statusMessage}`)}}for(let[y,S]of m.entries()){if(!y)continue;if(!(await o(S)).result)return{result:!1,resultCode:14,resultMessage:"One of intermediate certificates is not a CA certificate"}}return{result:!0}},"basicCheck");n.push(...this.trustedCerts),n.push(...this.certs);for(let m=0;m<n.length;m++)for(let v=0;v<n.length;v++)if(m!==v&&Ye.isEqual(n[m].tbsView,n[v].tbsView)){n.splice(v,1),m=0;break}let c=n[n.length-1],f,p=[c];if(f=await s(c,t),f.length===0)throw new vp(Lc.noPath,"Unable to find certificate path");for(let m=f.length-1;m>=0;m--){let v=!1;for(let y=0;y<f[m].length;y++){let S=f[m][y];for(let C=0;C<this.trustedCerts.length;C++)if(Ye.isEqual(S.tbsView,this.trustedCerts[C].tbsView)){v=!0;break}if(v)break}v||f.splice(m,1)}if(f.length===0)throw new vp(Lc.noValidPath,"No valid certificate paths found");let d=f[0].length,g=0;for(let m=0;m<f.length;m++)f[m].length<d&&(d=f[m].length,g=m);for(let m=0;m<f[g].length;m++)p.push(f[g][m]);if(f=await l(p,this.checkDate),f.result===!1)throw f;return p}async verify(e={},t=pt(!0)){function n(l,c){let f=Vu(l),p=Vu(c),d=f.split("."),g=p.split("."),m=d.length,v=g.length;if(m===0||v===0||m<v)return!1;for(let y=0;y<m;y++)if(d[y].length===0)return!1;for(let y=0;y<v;y++)if(g[y].length===0){if(y===0){if(v===1)return!1;continue}return!1}for(let y=0;y<v;y++)if(g[v-1-y].length!==0&&d[m-1-y].localeCompare(g[v-1-y])!==0)return!1;return!0}u(n,"compareDNSName");function s(l,c){let f=Vu(l),p=Vu(c),d=f.split("@"),g=p.split("@");if(d.length===0||g.length===0||d.length<g.length)return!1;if(g.length===1){if(n(d[1],g[0])){let v=d[1].split("."),y=g[0].split(".");return y[0].length===0?!0:v.length===y.length}return!1}return f.localeCompare(p)===0}u(s,"compareRFC822Name");function i(l,c){let f=Vu(l),p=Vu(c),d=f.split("/");if(p.split("/").length>1)return!1;if(d.length>1){for(let v=0;v<d.length;v++)if(d[v].length>0&&d[v].charAt(d[v].length-1)!==":"){f=d[v].split(":")[0];break}}if(n(f,p)){let v=f.split("."),y=p.split(".");return y[0].length===0?!0:v.length===y.length}return!1}u(i,"compareUniformResourceIdentifier");function a(l,c){let f=l.valueBlock.valueHexView,p=c.valueBlock.valueHexView;if(f.length===4&&p.length===8){for(let d=0;d<4;d++)if((f[d]^p[d])&p[d+4])return!1;return!0}if(f.length===16&&p.length===32){for(let d=0;d<16;d++)if((f[d]^p[d])&p[d+16])return!1;return!0}return!1}u(a,"compareIPAddress");function o(l,c){if(l.typesAndValues.length===0||c.typesAndValues.length===0)return!0;if(l.typesAndValues.length<c.typesAndValues.length)return!1;let f=!0,p=0;for(let d=0;d<c.typesAndValues.length;d++){let g=!1;for(let m=p;m<l.typesAndValues.length;m++)if(g=l.typesAndValues[m].isEqual(c.typesAndValues[d]),l.typesAndValues[m].type===c.typesAndValues[d].type&&(f=f&&g),g===!0)if(p===0||p===m){p=m+1;break}else return!1;if(g===!1)return!1}return p===0?!1:f}u(o,"compareDirectoryName");try{if(this.certs.length===0)throw new Error("Empty certificate array");let l=e.passedWhenNotRevValues||!1,c=e.initialPolicySet||[ks],f=e.initialExplicitPolicy||!1,p=e.initialPolicyMappingInhibit||!1,d=e.initialInhibitPolicy||!1,g=e.initialPermittedSubtreesSet||[],m=e.initialExcludedSubtreesSet||[],v=e.initialRequiredNameForms||[],y=f,S=p,C=d,w=[!1,!1,!1],E=0,A=0,b=0,V=g,I=m,D=v,U=1;this.certs=await this.sort(l,t);let F=[];F.push(ks);let M=[],se=new Array(this.certs.length-1);for(let pe=0;pe<this.certs.length-1;pe++)se[pe]=!0;M.push(se);let ee=new Array(this.certs.length-1),ie=new Array(this.certs.length-1),X=y?this.certs.length-1:-1;for(let pe=this.certs.length-2;pe>=0;pe--,U++){let W=this.certs[pe];if(W.extensions){for(let fe=0;fe<W.extensions.length;fe++){let Ie=W.extensions[fe];if(Ie.extnID===F8){ie[pe]=Ie.parsedValue;for(let Ve=0;Ve<F.length;Ve++)if(F[Ve]===ks){delete M[Ve][pe];break}for(let Ve=0;Ve<Ie.parsedValue.certificatePolicies.length;Ve++){let Le=-1,O=Ie.parsedValue.certificatePolicies[Ve].policyIdentifier;for(let B=0;B<F.length;B++)if(O===F[B]){Le=B;break}if(Le===-1){F.push(O);let B=new Array(this.certs.length-1);B[pe]=!0,M.push(B)}else M[Le][pe]=!0}}if(Ie.extnID===U8){if(S)return{result:!1,resultCode:98,resultMessage:"Policy mapping prohibited"};ee[pe]=Ie.parsedValue}Ie.extnID===M8&&y===!1&&(Ie.parsedValue.requireExplicitPolicy===0?(y=!0,X=pe):w[0]===!1?(w[0]=!0,E=Ie.parsedValue.requireExplicitPolicy):E=E>Ie.parsedValue.requireExplicitPolicy?Ie.parsedValue.requireExplicitPolicy:E,Ie.parsedValue.inhibitPolicyMapping===0?S=!0:w[1]===!1?(w[1]=!0,A=Ie.parsedValue.inhibitPolicyMapping+1):A=A>Ie.parsedValue.inhibitPolicyMapping+1?Ie.parsedValue.inhibitPolicyMapping+1:A),Ie.extnID===z$&&C===!1&&(Ie.parsedValue.valueBlock.valueDec===0?C=!0:w[2]===!1?(w[2]=!0,b=Ie.parsedValue.valueBlock.valueDec):b=b>Ie.parsedValue.valueBlock.valueDec?Ie.parsedValue.valueBlock.valueDec:b)}if(C===!0){let fe=-1;for(let Ie=0;Ie<F.length;Ie++)if(F[Ie]===ks){fe=Ie;break}fe!==-1&&delete M[0][pe]}y===!1&&w[0]===!0&&(E--,E===0&&(y=!0,X=pe,w[0]=!1)),S===!1&&w[1]===!0&&(A--,A===0&&(S=!0,w[1]=!1)),C===!1&&w[2]===!0&&(b--,b===0&&(C=!0,w[2]=!1))}}for(let pe=0;pe<this.certs.length-1;pe++)if(pe<this.certs.length-2&&typeof ee[pe+1]<"u")for(let W=0;W<ee[pe+1].mappings.length;W++){if(ee[pe+1].mappings[W].issuerDomainPolicy===ks||ee[pe+1].mappings[W].subjectDomainPolicy===ks)return{result:!1,resultCode:99,resultMessage:'The "anyPolicy" should not be a part of policy mapping scheme'};let fe=-1,Ie=-1;for(let Ve=0;Ve<F.length;Ve++)F[Ve]===ee[pe+1].mappings[W].issuerDomainPolicy&&(fe=Ve),F[Ve]===ee[pe+1].mappings[W].subjectDomainPolicy&&(Ie=Ve);typeof M[fe][pe]<"u"&&delete M[fe][pe];for(let Ve=0;Ve<ie[pe].certificatePolicies.length;Ve++)if(ee[pe+1].mappings[W].subjectDomainPolicy===ie[pe].certificatePolicies[Ve].policyIdentifier&&fe!==-1&&Ie!==-1)for(let Le=0;Le<=pe;Le++)typeof M[Ie][Le]<"u"&&(M[fe][Le]=!0,delete M[Ie][Le])}for(let pe=0;pe<F.length;pe++)if(F[pe]===ks)for(let W=0;W<X;W++)delete M[pe][W];let he=[];for(let pe=0;pe<M.length;pe++){let W=!0;for(let fe=0;fe<this.certs.length-1;fe++){let Ie=!1;if(fe<X&&F[pe]===ks&&F.length>1){W=!1;break}if(typeof M[pe][fe]>"u"){if(fe>=X){for(let Ve=0;Ve<F.length;Ve++)if(F[Ve]===ks){M[Ve][fe]===!0&&(Ie=!0);break}}if(!Ie){W=!1;break}}}W===!0&&he.push(F[pe])}let Ce=[];if(c.length===1&&c[0]===ks&&y===!1)Ce=c;else if(he.length===1&&he[0]===ks)Ce=c;else for(let pe=0;pe<he.length;pe++)for(let W=0;W<c.length;W++)if(c[W]===he[pe]||c[W]===ks){Ce.push(he[pe]);break}let xe={result:Ce.length>0,resultCode:0,resultMessage:Ce.length>0?P:'Zero "userConstrPolicies" array, no intersections with "authConstrPolicies"',authConstrPolicies:he,userConstrPolicies:Ce,explicitPolicyIndicator:y,policyMappings:ee,certificatePath:this.certs};if(Ce.length===0||xe.result===!1)return xe;U=1;for(let pe=this.certs.length-2;pe>=0;pe--,U++){let W=this.certs[pe],fe=[],Ie=[],Ve=[];if(W.extensions)for(let Q=0;Q<W.extensions.length;Q++){let K=W.extensions[Q];K.extnID===L8&&("permittedSubtrees"in K.parsedValue&&(Ie=Ie.concat(K.parsedValue.permittedSubtrees)),"excludedSubtrees"in K.parsedValue&&(Ve=Ve.concat(K.parsedValue.excludedSubtrees))),K.extnID===O8&&(fe=fe.concat(K.parsedValue.altNames))}let Le=D.length<=0;for(let Q=0;Q<D.length;Q++)switch(D[Q].base.type){case 4:{if(D[Q].base.value.typesAndValues.length!==W.subject.typesAndValues.length)continue;Le=!0;for(let K=0;K<W.subject.typesAndValues.length;K++)if(W.subject.typesAndValues[K].type!==D[Q].base.value.typesAndValues[K].type){Le=!1;break}if(Le===!0)break}break;default:}if(Le===!1)throw xe.result=!1,xe.resultCode=21,xe.resultMessage="No necessary name form found",xe;let O=[[],[],[],[],[]];for(let Q=0;Q<V.length;Q++)switch(V[Q].base.type){case 1:O[0].push(V[Q]);break;case 2:O[1].push(V[Q]);break;case 4:O[2].push(V[Q]);break;case 6:O[3].push(V[Q]);break;case 7:O[4].push(V[Q]);break;default:}for(let Q=0;Q<5;Q++){let K=!1,_e=!1,R=O[Q];for(let N=0;N<R.length;N++){switch(Q){case 0:if(fe.length>0)for(let J=0;J<fe.length;J++)fe[J].type===1&&(_e=!0,K=K||s(fe[J].value,R[N].base.value));else for(let J=0;J<W.subject.typesAndValues.length;J++)(W.subject.typesAndValues[J].type==="1.2.840.113549.1.9.1"||W.subject.typesAndValues[J].type==="0.9.2342.19200300.100.1.3")&&(_e=!0,K=K||s(W.subject.typesAndValues[J].value.valueBlock.value,R[N].base.value));break;case 1:if(fe.length>0)for(let J=0;J<fe.length;J++)fe[J].type===2&&(_e=!0,K=K||n(fe[J].value,R[N].base.value));break;case 2:_e=!0,K=o(W.subject,R[N].base.value);break;case 3:if(fe.length>0)for(let J=0;J<fe.length;J++)fe[J].type===6&&(_e=!0,K=K||i(fe[J].value,R[N].base.value));break;case 4:if(fe.length>0)for(let J=0;J<fe.length;J++)fe[J].type===7&&(_e=!0,K=K||a(fe[J].value,R[N].base.value));break;default:}if(K)break}if(K===!1&&R.length>0&&_e)throw xe.result=!1,xe.resultCode=41,xe.resultMessage='Failed to meet "permitted sub-trees" name constraint',xe}let B=!1;for(let Q=0;Q<I.length;Q++){switch(I[Q].base.type){case 1:if(fe.length>=0)for(let K=0;K<fe.length;K++)fe[K].type===1&&(B=B||s(fe[K].value,I[Q].base.value));else for(let K=0;K<W.subject.typesAndValues.length;K++)(W.subject.typesAndValues[K].type==="1.2.840.113549.1.9.1"||W.subject.typesAndValues[K].type==="0.9.2342.19200300.100.1.3")&&(B=B||s(W.subject.typesAndValues[K].value.valueBlock.value,I[Q].base.value));break;case 2:if(fe.length>0)for(let K=0;K<fe.length;K++)fe[K].type===2&&(B=B||n(fe[K].value,I[Q].base.value));break;case 4:B=B||o(W.subject,I[Q].base.value);break;case 6:if(fe.length>0)for(let K=0;K<fe.length;K++)fe[K].type===6&&(B=B||i(fe[K].value,I[Q].base.value));break;case 7:if(fe.length>0)for(let K=0;K<fe.length;K++)fe[K].type===7&&(B=B||a(fe[K].value,I[Q].base.value));break;default:}if(B)break}if(B===!0)throw xe.result=!1,xe.resultCode=42,xe.resultMessage='Failed to meet "excluded sub-trees" name constraint',xe;V=V.concat(Ie),I=I.concat(Ve)}return xe}catch(l){return l instanceof Error?l instanceof vp?{result:!1,resultCode:l.code,resultMessage:l.message,error:l}:{result:!1,resultCode:Lc.unknown,resultMessage:l.message,error:l}:l&&typeof l=="object"&&"resultMessage"in l?l:{result:!1,resultCode:-1,resultMessage:`${l}`}}}},Rw="tbsResponseData",w1="signatureAlgorithm",S1="signature",Ep="certs",Q1="BasicOCSPResponse",JN=`${Q1}.${Rw}`,YN=`${Q1}.${w1}`,QN=`${Q1}.${S1}`,Ow=`${Q1}.${Ep}`,Uz=[JN,YN,QN,Ow],$1=class Sc extends Ee{static{u(this,"BasicOCSPResponse")}constructor(e={}){super(),this.tbsResponseData=T(e,Rw,Sc.defaultValues(Rw)),this.signatureAlgorithm=T(e,w1,Sc.defaultValues(w1)),this.signature=T(e,S1,Sc.defaultValues(S1)),Ep in e&&(this.certs=T(e,Ep,Sc.defaultValues(Ep))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Rw:return new Pa;case w1:return new ce;case S1:return new At;case Ep:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case"type":{let n=Pa.compareWithDefault("tbs",t.tbs)&&Pa.compareWithDefault("responderID",t.responderID)&&Pa.compareWithDefault("producedAt",t.producedAt)&&Pa.compareWithDefault("responses",t.responses);return"responseExtensions"in t&&(n=n&&Pa.compareWithDefault("responseExtensions",t.responseExtensions)),n}case w1:return t.algorithmId===P&&!("algorithmParams"in t);case S1:return t.isEqual(Sc.defaultValues(e));case Ep:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||Q1,value:[Pa.schema(t.tbsResponseData||{names:{blockName:JN}}),ce.schema(t.signatureAlgorithm||{names:{blockName:YN}}),new At({name:t.signature||QN}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new H({value:[new ut({name:Ow,value:Dn.schema(t.certs||{})})]})]})]})}fromSchema(e){we(e,Uz);let t=ve(e,e,Sc.schema());me.assertSchema(t,this.className),this.tbsResponseData=new Pa({schema:t.result[JN]}),this.signatureAlgorithm=new ce({schema:t.result[YN]}),this.signature=t.result[QN],Ow in t.result&&(this.certs=Array.from(t.result[Ow],n=>new Dn({schema:n})))}toSchema(){let e=[];return e.push(this.tbsResponseData.toSchema()),e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.certs&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[new H({value:Array.from(this.certs,t=>t.toSchema())})]})),new H({value:e})}toJSON(){let e={tbsResponseData:this.tbsResponseData.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.certs&&(e.certs=Array.from(this.certs,t=>t.toJSON())),e}async getCertificateStatus(e,t,n=pt(!0)){let s={isForCertificate:!1,status:2},i={},a=[];for(let o of this.tbsResponseData.responses){let l=n.getAlgorithmByOID(o.certID.hashAlgorithm.algorithmId,!0,"CertID.hashAlgorithm");if(!i[l.name]){i[l.name]=1;let c=new ms;a.push(c),await c.createForCertificate(e,{hashAlgorithm:l.name,issuerCertificate:t},n)}}for(let o of this.tbsResponseData.responses)for(let l of a)if(o.certID.isEqual(l)){s.isForCertificate=!0;try{switch(o.certStatus.idBlock.isConstructed){case!0:o.certStatus.idBlock.tagNumber===1&&(s.status=1);break;case!1:switch(o.certStatus.idBlock.tagNumber){case 0:s.status=0;break;case 2:s.status=2;break;default:}break;default:}}catch{}return s}return s}async sign(e,t="SHA-1",n=pt(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters.algorithm;if(!("name"in i))throw new Error("Empty algorithm");this.signatureAlgorithm=s.signatureAlgorithm,this.tbsResponseData.tbsView=new Uint8Array(this.tbsResponseData.toSchema(!0).toBER());let a=await n.signWithPrivateKey(this.tbsResponseData.tbsView,e,{algorithm:i});this.signature=new At({valueHex:a})}async verify(e={},t=pt(!0)){let n=null,s=-1,i=e.trustedCerts||[];if(!this.certs)throw new Error("No certificates attached to the BasicOCSPResponse");switch(!0){case this.tbsResponseData.responderID instanceof gr:for(let[c,f]of this.certs.entries())if(f.subject.isEqual(this.tbsResponseData.responderID)){s=c;break}break;case this.tbsResponseData.responderID instanceof Ne:for(let[c,f]of this.certs.entries()){let p=await t.digest({name:"sha-1"},f.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);if(Lo(p,this.tbsResponseData.responderID.valueBlock.valueHex)){s=c;break}}break;default:throw new Error("Wrong value for responderID")}if(s===-1)throw new Error("Correct certificate was not found in OCSP response");n=this.certs[s];let a=[n];for(let c of this.certs){let f=await o5(c,n);f&&a.push(f)}if(!(await new g5({certs:a,trustedCerts:i}).verify({},t)).result)throw new Error("Validation of signer's certificate failed");return t.verifyWithPublicKey(this.tbsResponseData.tbsView,this.signature,this.certs[s].subjectPublicKeyInfo,this.signatureAlgorithm)}};$1.CLASS_NAME="BasicOCSPResponse";var nN="tbs",sN="version",iN="subject",aN="subjectPublicKeyInfo",ch="attributes",A1="signatureAlgorithm",C1="signatureValue",Yp="CertificationRequestInfo",DT=`${Yp}.version`,BT=`${Yp}.subject`,RT=`${Yp}.subjectPublicKeyInfo`,vS=`${Yp}.attributes`,Mz=[Yp,DT,BT,RT,vS,A1,C1];function jz(r={}){let e=T(r,"names",{});return new H({name:e.CertificationRequestInfo||Yp,value:[new le({name:e.CertificationRequestInfoVersion||DT}),gr.schema(e.subject||{names:{blockName:BT}}),ci.schema({names:{blockName:RT}}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new ut({optional:!0,name:e.CertificationRequestInfoAttributes||vS,value:_r.schema(e.attributes||{})})]})]})}u(jz,"CertificationRequestInfo");var qz=class qi extends Ee{static{u(this,"CertificationRequest")}get tbs(){return Ye.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(T(e,nN,qi.defaultValues(nN))),this.version=T(e,sN,qi.defaultValues(sN)),this.subject=T(e,iN,qi.defaultValues(iN)),this.subjectPublicKeyInfo=T(e,aN,qi.defaultValues(aN)),ch in e&&(this.attributes=T(e,ch,qi.defaultValues(ch))),this.signatureAlgorithm=T(e,A1,qi.defaultValues(A1)),this.signatureValue=T(e,C1,qi.defaultValues(C1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case nN:return Or;case sN:return 0;case iN:return new gr;case aN:return new ci;case ch:return[];case A1:return new ce;case C1:return new At;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({value:[jz(t.certificationRequestInfo||{}),new H({name:t.signatureAlgorithm||A1,value:[new je,new nt({optional:!0})]}),new At({name:t.signatureValue||C1})]})}fromSchema(e){we(e,Mz);let t=ve(e,e,qi.schema());me.assertSchema(t,this.className),this.tbsView=t.result.CertificationRequestInfo.valueBeforeDecodeView,this.version=t.result[DT].valueBlock.valueDec,this.subject=new gr({schema:t.result[BT]}),this.subjectPublicKeyInfo=new ci({schema:t.result[RT]}),vS in t.result&&(this.attributes=Array.from(t.result[vS],n=>new _r({schema:n}))),this.signatureAlgorithm=new ce({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[new le({value:this.version}),this.subject.toSchema(),this.subjectPublicKeyInfo.toSchema()];return ch in this&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.attributes||[],t=>t.toSchema())})),new H({value:e})}toSchema(e=!1){let t;if(e===!1){if(this.tbsView.byteLength===0)return qi.schema();let n=Ar(this.tbsView);me.assert(n,"PKCS#10 Certificate Request"),t=n.result}else t=this.encodeTBS();return new H({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:at.ToHex(this.tbsView),version:this.version,subject:this.subject.toJSON(),subjectPublicKeyInfo:this.subjectPublicKeyInfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return ch in this&&(e.attributes=Array.from(this.attributes||[],t=>t.toJSON())),e}async sign(e,t="SHA-1",n=pt(!0)){if(!e)throw new Error("Need to provide a private key for signing");let s=await n.getSignatureParameters(e,t),i=s.parameters;this.signatureAlgorithm=s.signatureAlgorithm,this.tbsView=new Uint8Array(this.encodeTBS().toBER());let a=await n.signWithPrivateKey(this.tbsView,e,i);this.signatureValue=new At({valueHex:a})}async verify(e=pt(!0)){return e.verifyWithPublicKey(this.tbsView,this.signatureValue,this.subjectPublicKeyInfo,this.signatureAlgorithm)}async getPublicKey(e,t=pt(!0)){return t.getPublicKey(this.subjectPublicKeyInfo,this.signatureAlgorithm,e)}};qz.CLASS_NAME="CertificationRequest";var Ac="digestAlgorithm",Cc="digest",Hz=[Ac,Cc],Vc=class x1 extends Ee{static{u(this,"DigestInfo")}constructor(e={}){super(),this.digestAlgorithm=T(e,Ac,x1.defaultValues(Ac)),this.digest=T(e,Cc,x1.defaultValues(Cc)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ac:return new ce;case Cc:return new Ne;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ac:return ce.compareWithDefault("algorithmId",t.algorithmId)&&!("algorithmParams"in t);case Cc:return t.isEqual(x1.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.digestAlgorithm||{names:{blockName:Ac}}),new Ne({name:t.digest||Cc})]})}fromSchema(e){we(e,Hz);let t=ve(e,e,x1.schema({names:{digestAlgorithm:{names:{blockName:Ac}},digest:Cc}}));me.assertSchema(t,this.className),this.digestAlgorithm=new ce({schema:t.result.digestAlgorithm}),this.digest=t.result.digest}toSchema(){return new H({value:[this.digestAlgorithm.toSchema(),this.digest]})}toJSON(){return{digestAlgorithm:this.digestAlgorithm.toJSON(),digest:this.digest.toJSON()}}};Vc.CLASS_NAME="DigestInfo";var wp="eContentType",oi="eContent",Kz=[wp,oi],Fc=class xc extends Ee{static{u(this,"EncapsulatedContentInfo")}constructor(e={}){if(super(),this.eContentType=T(e,wp,xc.defaultValues(wp)),oi in e&&(this.eContent=T(e,oi,xc.defaultValues(oi)),this.eContent.idBlock.tagClass===1&&this.eContent.idBlock.tagNumber===4&&this.eContent.idBlock.isConstructed===!1)){let t=new Ne({idBlock:{isConstructed:!0},isConstructed:!0}),n=0,s=this.eContent.valueBlock.valueHexView.slice().buffer,i=s.byteLength;for(;i>0;){let a=new Uint8Array(s,n,n+65536>s.byteLength?s.byteLength-n:65536),o=new ArrayBuffer(a.length),l=new Uint8Array(o);for(let c=0;c<l.length;c++)l[c]=a[c];t.valueBlock.value.push(new Ne({valueHex:o})),i-=a.length,n+=a.length}this.eContent=t}e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wp:return P;case oi:return new Ne;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case wp:return t===P;case oi:return t.idBlock.tagClass===1&&t.idBlock.tagNumber===4?t.isEqual(xc.defaultValues(oi)):!1;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.eContentType||P}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new nt({name:t.eContent||P})]})]})}fromSchema(e){we(e,Kz);let t=ve(e,e,xc.schema({names:{eContentType:wp,eContent:oi}}));me.assertSchema(t,this.className),this.eContentType=t.result.eContentType.valueBlock.toString(),oi in t.result&&(this.eContent=t.result.eContent)}toSchema(){let e=[];return e.push(new je({value:this.eContentType})),this.eContent&&xc.compareWithDefault(oi,this.eContent)===!1&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.eContent]})),new H({value:e})}toJSON(){let e={eContentType:this.eContentType};return this.eContent&&xc.compareWithDefault(oi,this.eContent)===!1&&(e.eContent=this.eContent.toJSON()),e}};Fc.CLASS_NAME="EncapsulatedContentInfo";var bc="mac",Nc="macSalt",ka="iterations",Xz=[bc,Nc,ka],Bu=class Tc extends Ee{static{u(this,"MacData")}constructor(e={}){super(),this.mac=T(e,bc,Tc.defaultValues(bc)),this.macSalt=T(e,Nc,Tc.defaultValues(Nc)),ka in e&&(this.iterations=T(e,ka,Tc.defaultValues(ka))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case bc:return new Vc;case Nc:return new Ne;case ka:return 1;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case bc:return Vc.compareWithDefault("digestAlgorithm",t.digestAlgorithm)&&Vc.compareWithDefault("digest",t.digest);case Nc:return t.isEqual(Tc.defaultValues(e));case ka:return t===Tc.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,optional:t.optional||!0,value:[Vc.schema(t.mac||{names:{blockName:bc}}),new Ne({name:t.macSalt||Nc}),new le({optional:!0,name:t.iterations||ka})]})}fromSchema(e){we(e,Xz);let t=ve(e,e,Tc.schema({names:{mac:{names:{blockName:bc}},macSalt:Nc,iterations:ka}}));me.assertSchema(t,this.className),this.mac=new Vc({schema:t.result.mac}),this.macSalt=t.result.macSalt,ka in t.result&&(this.iterations=t.result.iterations.valueBlock.valueDec)}toSchema(){let e=[this.mac.toSchema(),this.macSalt];return this.iterations!==void 0&&e.push(new le({value:this.iterations})),new H({value:e})}toJSON(){let e={mac:this.mac.toJSON(),macSalt:this.macSalt.toJSON()};return this.iterations!==void 0&&(e.iterations=this.iterations),e}};Bu.CLASS_NAME="MacData";var Uc="hashAlgorithm",Mc="hashedMessage",Gz=[Uc,Mc],li=class Sp extends Ee{static{u(this,"MessageImprint")}static async create(e,t,n=pt(!0)){let s=n.getOIDByAlgorithm({name:e},!0,"hashAlgorithm"),i=await n.digest(e,t);return new Sp({hashAlgorithm:new ce({algorithmId:s,algorithmParams:new Cr}),hashedMessage:new Ne({valueHex:i})})}constructor(e={}){super(),this.hashAlgorithm=T(e,Uc,Sp.defaultValues(Uc)),this.hashedMessage=T(e,Mc,Sp.defaultValues(Mc)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Uc:return new ce;case Mc:return new Ne;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Uc:return t.algorithmId===P&&!("algorithmParams"in t);case Mc:return t.isEqual(Sp.defaultValues(e))===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.hashAlgorithm||{}),new Ne({name:t.hashedMessage||P})]})}fromSchema(e){we(e,Gz);let t=ve(e,e,Sp.schema({names:{hashAlgorithm:{names:{blockName:Uc}},hashedMessage:Mc}}));me.assertSchema(t,this.className),this.hashAlgorithm=new ce({schema:t.result.hashAlgorithm}),this.hashedMessage=t.result.hashedMessage}toSchema(){return new H({value:[this.hashAlgorithm.toSchema(),this.hashedMessage]})}toJSON(){return{hashAlgorithm:this.hashAlgorithm.toJSON(),hashedMessage:this.hashedMessage.toJSON()}}};li.CLASS_NAME="MessageImprint";var Ap="reqCert",Ru="singleRequestExtensions",$z=[Ap,Ru],ES=class b1 extends Ee{static{u(this,"Request")}constructor(e={}){super(),this.reqCert=T(e,Ap,b1.defaultValues(Ap)),Ru in e&&(this.singleRequestExtensions=T(e,Ru,b1.defaultValues(Ru))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ap:return new ms;case Ru:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ap:return t.isEqual(b1.defaultValues(e));case Ru:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ms.schema(t.reqCert||{}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Wr.schema(t.extensions||{names:{blockName:t.singleRequestExtensions||P}})]})]})}fromSchema(e){we(e,$z);let t=ve(e,e,b1.schema({names:{reqCert:{names:{blockName:Ap}},extensions:{names:{blockName:Ru}}}}));me.assertSchema(t,this.className),this.reqCert=new ms({schema:t.result.reqCert}),Ru in t.result&&(this.singleRequestExtensions=Array.from(t.result.singleRequestExtensions.valueBlock.value,n=>new Us({schema:n})))}toSchema(){let e=[];return e.push(this.reqCert.toSchema()),this.singleRequestExtensions&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new H({value:Array.from(this.singleRequestExtensions,t=>t.toSchema())})]})),new H({value:e})}toJSON(){let e={reqCert:this.reqCert.toJSON()};return this.singleRequestExtensions&&(e.singleRequestExtensions=Array.from(this.singleRequestExtensions,t=>t.toJSON())),e}};ES.CLASS_NAME="Request";var VE="tbs",Cp="version",xp="requestorName",FE="requestList",bp="requestExtensions",Qp="TBSRequest",_w=`${Qp}.${Cp}`,Pw=`${Qp}.${xp}`,ZN=`${Qp}.requests`,kw=`${Qp}.${bp}`,Wz=[Qp,_w,Pw,ZN,kw],La=class Va extends Ee{static{u(this,"TBSRequest")}get tbs(){return Ye.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(T(e,VE,Va.defaultValues(VE))),Cp in e&&(this.version=T(e,Cp,Va.defaultValues(Cp))),xp in e&&(this.requestorName=T(e,xp,Va.defaultValues(xp))),this.requestList=T(e,FE,Va.defaultValues(FE)),bp in e&&(this.requestExtensions=T(e,bp,Va.defaultValues(bp))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case VE:return Or;case Cp:return 0;case xp:return new ir;case FE:case bp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case VE:return t.byteLength===0;case Cp:return t===Va.defaultValues(e);case xp:return t.type===ir.defaultValues("type")&&Object.keys(t.value).length===0;case FE:case bp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||Qp,value:[new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new le({name:t.TBSRequestVersion||_w})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[ir.schema(t.requestorName||{names:{blockName:Pw}})]}),new H({name:t.requestList||"TBSRequest.requestList",value:[new ut({name:t.requests||ZN,value:ES.schema(t.requestNames||{})})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:2},value:[Wr.schema(t.extensions||{names:{blockName:t.requestExtensions||kw}})]})]})}fromSchema(e){we(e,Wz);let t=ve(e,e,Va.schema());me.assertSchema(t,this.className),this.tbsView=t.result.TBSRequest.valueBeforeDecodeView,_w in t.result&&(this.version=t.result[_w].valueBlock.valueDec),Pw in t.result&&(this.requestorName=new ir({schema:t.result[Pw]})),this.requestList=Array.from(t.result[ZN],n=>new ES({schema:n})),kw in t.result&&(this.requestExtensions=Array.from(t.result[kw].valueBlock.value,n=>new Us({schema:n})))}toSchema(e=!1){let t;if(e===!1){if(this.tbsView.byteLength===0)return Va.schema();let n=Ar(this.tbsView);if(me.assert(n,"TBS Request"),!(n.result instanceof H))throw new Error("ASN.1 result should be SEQUENCE");t=n.result}else{let n=[];this.version!==void 0&&n.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[new le({value:this.version})]})),this.requestorName&&n.push(new re({idBlock:{tagClass:3,tagNumber:1},value:[this.requestorName.toSchema()]})),n.push(new H({value:Array.from(this.requestList,s=>s.toSchema())})),this.requestExtensions&&n.push(new re({idBlock:{tagClass:3,tagNumber:2},value:[new H({value:Array.from(this.requestExtensions,s=>s.toSchema())})]})),t=new H({value:n})}return t}toJSON(){let e={};return this.version!=null&&(e.version=this.version),this.requestorName&&(e.requestorName=this.requestorName.toJSON()),e.requestList=Array.from(this.requestList,t=>t.toJSON()),this.requestExtensions&&(e.requestExtensions=Array.from(this.requestExtensions,t=>t.toJSON())),e}};La.CLASS_NAME="TBSRequest";var fh="signatureAlgorithm",hh="signature",Xo="certs",Ic=class Np extends Ee{static{u(this,"Signature")}constructor(e={}){super(),this.signatureAlgorithm=T(e,fh,Np.defaultValues(fh)),this.signature=T(e,hh,Np.defaultValues(hh)),Xo in e&&(this.certs=T(e,Xo,Np.defaultValues(Xo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case fh:return new ce;case hh:return new At;case Xo:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case fh:return t.algorithmId===P&&!("algorithmParams"in t);case hh:return t.isEqual(Np.defaultValues(e));case Xo:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[ce.schema(t.signatureAlgorithm||{}),new At({name:t.signature||P}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new H({value:[new ut({name:t.certs||P,value:Dn.schema({})})]})]})]})}fromSchema(e){we(e,[fh,hh,Xo]);let t=ve(e,e,Np.schema({names:{signatureAlgorithm:{names:{blockName:fh}},signature:hh,certs:Xo}}));me.assertSchema(t,this.className),this.signatureAlgorithm=new ce({schema:t.result.signatureAlgorithm}),this.signature=t.result.signature,Xo in t.result&&(this.certs=Array.from(t.result.certs,n=>new Dn({schema:n})))}toSchema(){let e=[];return e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.certs&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new H({value:Array.from(this.certs,t=>t.toSchema())})]})),new H({value:e})}toJSON(){let e={signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.certs&&(e.certs=Array.from(this.certs,t=>t.toJSON())),e}};Ic.CLASS_NAME="Signature";var Tp="tbsRequest",Ou="optionalSignature",zz=[Tp,Ou],Jz=class Lw extends Ee{static{u(this,"OCSPRequest")}constructor(e={}){super(),this.tbsRequest=T(e,Tp,Lw.defaultValues(Tp)),Ou in e&&(this.optionalSignature=T(e,Ou,Lw.defaultValues(Ou))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Tp:return new La;case Ou:return new Ic;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Tp:return La.compareWithDefault("tbs",t.tbs)&&La.compareWithDefault("version",t.version)&&La.compareWithDefault("requestorName",t.requestorName)&&La.compareWithDefault("requestList",t.requestList)&&La.compareWithDefault("requestExtensions",t.requestExtensions);case Ou:return Ic.compareWithDefault("signatureAlgorithm",t.signatureAlgorithm)&&Ic.compareWithDefault("signature",t.signature)&&Ic.compareWithDefault("certs",t.certs);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||"OCSPRequest",value:[La.schema(t.tbsRequest||{names:{blockName:Tp}}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Ic.schema(t.optionalSignature||{names:{blockName:Ou}})]})]})}fromSchema(e){we(e,zz);let t=ve(e,e,Lw.schema());me.assertSchema(t,this.className),this.tbsRequest=new La({schema:t.result.tbsRequest}),Ou in t.result&&(this.optionalSignature=new Ic({schema:t.result.optionalSignature}))}toSchema(e=!1){let t=[];return t.push(this.tbsRequest.toSchema(e)),this.optionalSignature&&t.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.optionalSignature.toSchema()]})),new H({value:t})}toJSON(){let e={tbsRequest:this.tbsRequest.toJSON()};return this.optionalSignature&&(e.optionalSignature=this.optionalSignature.toJSON()),e}async createForCertificate(e,t,n=pt(!0)){let s=new ms;await s.createForCertificate(e,t,n),this.tbsRequest.requestList.push(new ES({reqCert:s}))}async sign(e,t="SHA-1",n=pt(!0)){if(Ht.assertEmpty(e,"privateKey","OCSPRequest.sign method"),!this.optionalSignature)throw new Error('Need to create "optionalSignature" field before signing');let s=await n.getSignatureParameters(e,t),i=s.parameters;this.optionalSignature.signatureAlgorithm=s.signatureAlgorithm;let a=this.tbsRequest.toSchema(!0).toBER(!1),o=await n.signWithPrivateKey(a,e,i);this.optionalSignature.signature=new At({valueHex:o})}verify(){}};Jz.CLASS_NAME="OCSPRequest";var Ip="responseType",Dp="response",Yz=[Ip,Dp],Bp=class N1 extends Ee{static{u(this,"ResponseBytes")}constructor(e={}){super(),this.responseType=T(e,Ip,N1.defaultValues(Ip)),this.response=T(e,Dp,N1.defaultValues(Dp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ip:return P;case Dp:return new Ne;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ip:return t===P;case Dp:return t.isEqual(N1.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new je({name:t.responseType||P}),new Ne({name:t.response||P})]})}fromSchema(e){we(e,Yz);let t=ve(e,e,N1.schema({names:{responseType:Ip,response:Dp}}));me.assertSchema(t,this.className),this.responseType=t.result.responseType.valueBlock.toString(),this.response=t.result.response}toSchema(){return new H({value:[new je({value:this.responseType}),this.response]})}toJSON(){return{responseType:this.responseType,response:this.response.toJSON()}}};Bp.CLASS_NAME="ResponseBytes";var ph="responseStatus",Aa="responseBytes",Qz=class T1 extends Ee{static{u(this,"OCSPResponse")}constructor(e={}){super(),this.responseStatus=T(e,ph,T1.defaultValues(ph)),Aa in e&&(this.responseBytes=T(e,Aa,T1.defaultValues(Aa))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ph:return new Fo;case Aa:return new Bp;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case ph:return t.isEqual(T1.defaultValues(e));case Aa:return Bp.compareWithDefault("responseType",t.responseType)&&Bp.compareWithDefault("response",t.response);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||"OCSPResponse",value:[new Fo({name:t.responseStatus||ph}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Bp.schema(t.responseBytes||{names:{blockName:Aa}})]})]})}fromSchema(e){we(e,[ph,Aa]);let t=ve(e,e,T1.schema());me.assertSchema(t,this.className),this.responseStatus=t.result.responseStatus,Aa in t.result&&(this.responseBytes=new Bp({schema:t.result.responseBytes}))}toSchema(){let e=[];return e.push(this.responseStatus),this.responseBytes&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:[this.responseBytes.toSchema()]})),new H({value:e})}toJSON(){let e={responseStatus:this.responseStatus.toJSON()};return this.responseBytes&&(e.responseBytes=this.responseBytes.toJSON()),e}async getCertificateStatus(e,t,n=pt(!0)){let s,i={isForCertificate:!1,status:2};if(!this.responseBytes||this.responseBytes.responseType!==KE)return i;try{let a=Ar(this.responseBytes.response.valueBlock.valueHexView);me.assert(a,"Basic OCSP response"),s=new $1({schema:a.result})}catch{return i}return s.getCertificateStatus(e,t,n)}async sign(e,t,n=pt(!0)){var s;if(this.responseBytes&&this.responseBytes.responseType===KE)return $1.fromBER(this.responseBytes.response.valueBlock.valueHexView).sign(e,t,n);throw new Error(`Unknown ResponseBytes type: ${((s=this.responseBytes)===null||s===void 0?void 0:s.responseType)||"Unknown"}`)}async verify(e=null,t=pt(!0)){var n;if(!(Aa in this))throw new Error("Empty ResponseBytes field");if(this.responseBytes&&this.responseBytes.responseType===KE){let s=$1.fromBER(this.responseBytes.response.valueBlock.valueHexView);return e!==null&&(s.certs||(s.certs=[]),s.certs.push(e)),s.verify({},t)}throw new Error(`Unknown ResponseBytes type: ${((n=this.responseBytes)===null||n===void 0?void 0:n.responseType)||"Unknown"}`)}};Qz.CLASS_NAME="OCSPResponse";var bl="type",Fa="attributes",UE="encodedValue",Zz=[Fa],ns=class Hi extends Ee{static{u(this,"SignedAndUnsignedAttributes")}constructor(e={}){super(),this.type=T(e,bl,Hi.defaultValues(bl)),this.attributes=T(e,Fa,Hi.defaultValues(Fa)),this.encodedValue=T(e,UE,Hi.defaultValues(UE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case bl:return-1;case Fa:return[];case UE:return Or;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case bl:return t===Hi.defaultValues(bl);case Fa:return t.length===0;case UE:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new re({name:t.blockName||P,optional:!0,idBlock:{tagClass:3,tagNumber:t.tagNumber||0},value:[new ut({name:t.attributes||P,value:_r.schema()})]})}fromSchema(e){we(e,Zz);let t=ve(e,e,Hi.schema({names:{tagNumber:this.type,attributes:Fa}}));me.assertSchema(t,this.className),this.type=t.result.idBlock.tagNumber,this.encodedValue=Ye.toArrayBuffer(t.result.valueBeforeDecodeView);let n=new Uint8Array(this.encodedValue);if(n[0]=49,!(Fa in t.result)){if(this.type===0)throw new Error("Wrong structure of SignedUnsignedAttributes");return}this.attributes=Array.from(t.result.attributes,s=>new _r({schema:s}))}toSchema(){if(Hi.compareWithDefault(bl,this.type)||Hi.compareWithDefault(Fa,this.attributes))throw new Error('Incorrectly initialized "SignedAndUnsignedAttributes" class');return new re({optional:!0,idBlock:{tagClass:3,tagNumber:this.type},value:Array.from(this.attributes,e=>e.toSchema())})}toJSON(){if(Hi.compareWithDefault(bl,this.type)||Hi.compareWithDefault(Fa,this.attributes))throw new Error('Incorrectly initialized "SignedAndUnsignedAttributes" class');return{type:this.type,attributes:Array.from(this.attributes,e=>e.toJSON())}}};ns.CLASS_NAME="SignedAndUnsignedAttributes";var Rp="version",Dc="sid",Op="digestAlgorithm",_u="signedAttrs",_p="signatureAlgorithm",I1="signature",Pu="unsignedAttrs",Mu="SignerInfo",eT=`${Mu}.${Rp}`,D1=`${Mu}.${Dc}`,tT=`${Mu}.${Op}`,Vw=`${Mu}.${_u}`,rT=`${Mu}.${_p}`,nT=`${Mu}.${I1}`,Fw=`${Mu}.${Pu}`,eJ=[eT,D1,tT,Vw,rT,nT,Fw],wS=class on extends Ee{static{u(this,"SignerInfo")}constructor(e={}){super(),this.version=T(e,Rp,on.defaultValues(Rp)),this.sid=T(e,Dc,on.defaultValues(Dc)),this.digestAlgorithm=T(e,Op,on.defaultValues(Op)),_u in e&&(this.signedAttrs=T(e,_u,on.defaultValues(_u))),this.signatureAlgorithm=T(e,_p,on.defaultValues(_p)),this.signature=T(e,I1,on.defaultValues(I1)),Pu in e&&(this.unsignedAttrs=T(e,Pu,on.defaultValues(Pu))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Rp:return 0;case Dc:return new nt;case Op:return new ce;case _u:return new ns({type:0});case _p:return new ce;case I1:return new Ne;case Pu:return new ns({type:1});default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Rp:return on.defaultValues(Rp)===t;case Dc:return t instanceof nt;case Op:return t instanceof ce?t.isEqual(on.defaultValues(Op)):!1;case _u:return ns.compareWithDefault("type",t.type)&&ns.compareWithDefault("attributes",t.attributes)&&ns.compareWithDefault("encodedValue",t.encodedValue);case _p:return t instanceof ce?t.isEqual(on.defaultValues(_p)):!1;case I1:case Pu:return ns.compareWithDefault("type",t.type)&&ns.compareWithDefault("attributes",t.attributes)&&ns.compareWithDefault("encodedValue",t.encodedValue);default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:Mu,value:[new le({name:t.version||eT}),new mr({value:[wn.schema(t.sidSchema||{names:{blockName:D1}}),new mr({value:[new re({optional:!0,name:t.sid||D1,idBlock:{tagClass:3,tagNumber:0},value:[new Ne]}),new Ze({optional:!0,name:t.sid||D1,idBlock:{tagClass:3,tagNumber:0}})]})]}),ce.schema(t.digestAlgorithm||{names:{blockName:tT}}),ns.schema(t.signedAttrs||{names:{blockName:Vw,tagNumber:0}}),ce.schema(t.signatureAlgorithm||{names:{blockName:rT}}),new Ne({name:t.signature||nT}),ns.schema(t.unsignedAttrs||{names:{blockName:Fw,tagNumber:1}})]})}fromSchema(e){we(e,eJ);let t=ve(e,e,on.schema());me.assertSchema(t,this.className),this.version=t.result[eT].valueBlock.valueDec;let n=t.result[D1];n.idBlock.tagClass===1?this.sid=new wn({schema:n}):this.sid=n,this.digestAlgorithm=new ce({schema:t.result[tT]}),Vw in t.result&&(this.signedAttrs=new ns({type:0,schema:t.result[Vw]})),this.signatureAlgorithm=new ce({schema:t.result[rT]}),this.signature=t.result[nT],Fw in t.result&&(this.unsignedAttrs=new ns({type:1,schema:t.result[Fw]}))}toSchema(){if(on.compareWithDefault(Dc,this.sid))throw new Error('Incorrectly initialized "SignerInfo" class');let e=[];return e.push(new le({value:this.version})),this.sid instanceof wn?e.push(this.sid.toSchema()):e.push(this.sid),e.push(this.digestAlgorithm.toSchema()),this.signedAttrs&&on.compareWithDefault(_u,this.signedAttrs)===!1&&e.push(this.signedAttrs.toSchema()),e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.unsignedAttrs&&on.compareWithDefault(Pu,this.unsignedAttrs)===!1&&e.push(this.unsignedAttrs.toSchema()),new H({value:e})}toJSON(){if(on.compareWithDefault(Dc,this.sid))throw new Error('Incorrectly initialized "SignerInfo" class');let e={version:this.version,digestAlgorithm:this.digestAlgorithm.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signature:this.signature.toJSON()};return this.sid instanceof nt||(e.sid=this.sid.toJSON()),this.signedAttrs&&on.compareWithDefault(_u,this.signedAttrs)===!1&&(e.signedAttrs=this.signedAttrs.toJSON()),this.unsignedAttrs&&on.compareWithDefault(Pu,this.unsignedAttrs)===!1&&(e.unsignedAttrs=this.unsignedAttrs.toJSON()),e}};wS.CLASS_NAME="SignerInfo";var B1="version",R1="policy",O1="messageImprint",_1="serialNumber",P1="genTime",Bc="ordering",Rc="nonce",Pp="accuracy",kp="tsa",Lp="extensions",fi="TSTInfo",sT=`${fi}.${B1}`,iT=`${fi}.${R1}`,aT=`${fi}.${O1}`,oT=`${fi}.${_1}`,uT=`${fi}.${P1}`,Uw=`${fi}.${Pp}`,Mw=`${fi}.${Bc}`,jw=`${fi}.${Rc}`,qw=`${fi}.${kp}`,Hw=`${fi}.${Lp}`,tJ=[sT,iT,aT,oT,uT,Uw,Mw,jw,qw,Hw],v5=class rs extends Ee{static{u(this,"TSTInfo")}constructor(e={}){super(),this.version=T(e,B1,rs.defaultValues(B1)),this.policy=T(e,R1,rs.defaultValues(R1)),this.messageImprint=T(e,O1,rs.defaultValues(O1)),this.serialNumber=T(e,_1,rs.defaultValues(_1)),this.genTime=T(e,P1,rs.defaultValues(P1)),Pp in e&&(this.accuracy=T(e,Pp,rs.defaultValues(Pp))),Bc in e&&(this.ordering=T(e,Bc,rs.defaultValues(Bc))),Rc in e&&(this.nonce=T(e,Rc,rs.defaultValues(Rc))),kp in e&&(this.tsa=T(e,kp,rs.defaultValues(kp))),Lp in e&&(this.extensions=T(e,Lp,rs.defaultValues(Lp))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case B1:return 0;case R1:return P;case O1:return new li;case _1:return new le;case P1:return new Date(0,0,0);case Pp:return new Nl;case Bc:return!1;case Rc:return new le;case kp:return new ir;case Lp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case B1:case R1:case P1:case Bc:return t===rs.defaultValues(Bc);case O1:return li.compareWithDefault(Uc,t.hashAlgorithm)&&li.compareWithDefault(Mc,t.hashedMessage);case _1:case Rc:return t.isEqual(rs.defaultValues(Rc));case Pp:return Nl.compareWithDefault(Go,t.seconds)&&Nl.compareWithDefault($o,t.millis)&&Nl.compareWithDefault(Wo,t.micros);case kp:return ir.compareWithDefault(Em,t.type)&&ir.compareWithDefault(wm,t.value);case Lp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||fi,value:[new le({name:t.version||sT}),new je({name:t.policy||iT}),li.schema(t.messageImprint||{names:{blockName:aT}}),new le({name:t.serialNumber||oT}),new dr({name:t.genTime||uT}),Nl.schema(t.accuracy||{names:{blockName:Uw}}),new ti({name:t.ordering||Mw,optional:!0}),new le({name:t.nonce||jw,optional:!0}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[ir.schema(t.tsa||{names:{blockName:qw}})]}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new ut({name:t.extensions||Hw,value:Us.schema(t.extension||{})})]})]})}fromSchema(e){we(e,tJ);let t=ve(e,e,rs.schema());me.assertSchema(t,this.className),this.version=t.result[sT].valueBlock.valueDec,this.policy=t.result[iT].valueBlock.toString(),this.messageImprint=new li({schema:t.result[aT]}),this.serialNumber=t.result[oT],this.genTime=t.result[uT].toDate(),Uw in t.result&&(this.accuracy=new Nl({schema:t.result[Uw]})),Mw in t.result&&(this.ordering=t.result[Mw].valueBlock.value),jw in t.result&&(this.nonce=t.result[jw]),qw in t.result&&(this.tsa=new ir({schema:t.result[qw]})),Hw in t.result&&(this.extensions=Array.from(t.result[Hw],n=>new Us({schema:n})))}toSchema(){let e=[];return e.push(new le({value:this.version})),e.push(new je({value:this.policy})),e.push(this.messageImprint.toSchema()),e.push(this.serialNumber),e.push(new dr({valueDate:this.genTime})),this.accuracy&&e.push(this.accuracy.toSchema()),this.ordering!==void 0&&e.push(new ti({value:this.ordering})),this.nonce&&e.push(this.nonce),this.tsa&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.tsa.toSchema()]})),this.extensions&&e.push(new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.extensions,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={version:this.version,policy:this.policy,messageImprint:this.messageImprint.toJSON(),serialNumber:this.serialNumber.toJSON(),genTime:this.genTime};return this.accuracy&&(e.accuracy=this.accuracy.toJSON()),this.ordering!==void 0&&(e.ordering=this.ordering),this.nonce&&(e.nonce=this.nonce.toJSON()),this.tsa&&(e.tsa=this.tsa.toJSON()),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}async verify(e,t=pt(!0)){if(!e.data)throw new Error('"data" is a mandatory attribute for TST_INFO verification');let n=e.data;if(e.notBefore&&this.genTime<e.notBefore)throw new Error("Generation time for TSTInfo object is less than notBefore value");if(e.notAfter&&this.genTime>e.notAfter)throw new Error("Generation time for TSTInfo object is more than notAfter value");let s=t.getAlgorithmByOID(this.messageImprint.hashAlgorithm.algorithmId,!0,"MessageImprint.hashAlgorithm"),i=await t.digest(s.name,new Uint8Array(n));return Ye.isEqual(i,this.messageImprint.hashedMessage.valueBlock.valueHexView)}};v5.CLASS_NAME="TSTInfo";var Vp="version",k1="digestAlgorithms",L1="encapContentInfo",Fp="certificates",Up="crls",V1="signerInfos",mm="ocsps",Gc="SignedData",lT=`${Gc}.${Vp}`,Kw=`${Gc}.${k1}`,cT=`${Gc}.${L1}`,Xw=`${Gc}.${Fp}`,Gw=`${Gc}.${Up}`,$w=`${Gc}.${V1}`,rJ=[lT,Kw,cT,Xw,Gw,$w],Nn=class extends Error{static{u(this,"SignedDataVerifyError")}constructor({message:e,code:t=0,date:n=new Date,signatureVerified:s=null,signerCertificate:i=null,signerCertificateVerified:a=null,timestampSerial:o=null,certificatePath:l=[]}){super(e),this.name="SignedDataVerifyError",this.date=n,this.code=t,this.timestampSerial=o,this.signatureVerified=s,this.signerCertificate=i,this.signerCertificateVerified=a,this.certificatePath=l}},Jp=class ui extends Ee{static{u(this,"SignedData")}constructor(e={}){super(),this.version=T(e,Vp,ui.defaultValues(Vp)),this.digestAlgorithms=T(e,k1,ui.defaultValues(k1)),this.encapContentInfo=T(e,L1,ui.defaultValues(L1)),Fp in e&&(this.certificates=T(e,Fp,ui.defaultValues(Fp))),Up in e&&(this.crls=T(e,Up,ui.defaultValues(Up))),mm in e&&(this.ocsps=T(e,mm,ui.defaultValues(mm))),this.signerInfos=T(e,V1,ui.defaultValues(V1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Vp:return 0;case k1:return[];case L1:return new Fc;case Fp:return[];case Up:return[];case mm:return[];case V1:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Vp:return t===ui.defaultValues(Vp);case L1:return Fc.compareWithDefault("eContentType",t.eContentType)&&Fc.compareWithDefault("eContent",t.eContent);case k1:case Fp:case Up:case mm:case V1:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return t.optional===void 0&&(t.optional=!1),new H({name:t.blockName||Gc,optional:t.optional,value:[new le({name:t.version||lT}),new xr({value:[new ut({name:t.digestAlgorithms||Kw,value:ce.schema()})]}),Fc.schema(t.encapContentInfo||{names:{blockName:cT}}),new re({name:t.certificates||Xw,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:Hc.schema().valueBlock.value}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:H1.schema(t.crls||{names:{crls:Gw}}).valueBlock.value}),new xr({value:[new ut({name:t.signerInfos||$w,value:wS.schema()})]})]})}fromSchema(e){we(e,rJ);let t=ve(e,e,ui.schema());if(me.assertSchema(t,this.className),this.version=t.result[lT].valueBlock.valueDec,Kw in t.result&&(this.digestAlgorithms=Array.from(t.result[Kw],n=>new ce({schema:n}))),this.encapContentInfo=new Fc({schema:t.result[cT]}),Xw in t.result){let n=new Hc({schema:new xr({value:t.result[Xw].valueBlock.value})});this.certificates=n.certificates.slice(0)}Gw in t.result&&(this.crls=Array.from(t.result[Gw],n=>n.idBlock.tagClass===1?new J1({schema:n}):(n.idBlock.tagClass=1,n.idBlock.tagNumber=16,new q1({schema:n})))),$w in t.result&&(this.signerInfos=Array.from(t.result[$w],n=>new wS({schema:n})))}toSchema(e=!1){let t=[];if(this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof yw)||this.crls&&this.crls.length&&this.crls.some(n=>n instanceof q1)?this.version=5:this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof Fu)?this.version=4:this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof tS)||this.signerInfos.some(n=>n.version===3)||this.encapContentInfo.eContentType!==ui.ID_DATA?this.version=3:this.version=1,t.push(new le({value:this.version})),t.push(new xr({value:Array.from(this.digestAlgorithms,n=>n.toSchema())})),t.push(this.encapContentInfo.toSchema()),this.certificates){let s=new Hc({certificates:this.certificates}).toSchema();t.push(new re({idBlock:{tagClass:3,tagNumber:0},value:s.valueBlock.value}))}return this.crls&&t.push(new re({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.crls,n=>{if(n instanceof q1){let s=n.toSchema();return s.idBlock.tagClass=3,s.idBlock.tagNumber=1,s}return n.toSchema(e)})})),t.push(new xr({value:Array.from(this.signerInfos,n=>n.toSchema())})),new H({value:t})}toJSON(){let e={version:this.version,digestAlgorithms:Array.from(this.digestAlgorithms,t=>t.toJSON()),encapContentInfo:this.encapContentInfo.toJSON(),signerInfos:Array.from(this.signerInfos,t=>t.toJSON())};return this.certificates&&(e.certificates=Array.from(this.certificates,t=>t.toJSON())),this.crls&&(e.crls=Array.from(this.crls,t=>t.toJSON())),e}async verify({signer:e=-1,data:t=Or,trustedCerts:n=[],checkDate:s=new Date,checkChain:i=!1,passedWhenNotRevValues:a=!1,extendedMode:o=!1,findOrigin:l=null,findIssuer:c=null}={},f=pt(!0)){let p=null,d=null;try{let g=Or,m=P,v=[],y=this.signerInfos[e];if(!y)throw new Nn({date:s,code:1,message:"Unable to get signer by supplied index"});if(!this.certificates)throw new Nn({date:s,code:2,message:"No certificates attached to this signed data"});if(y.sid instanceof wn){for(let E of this.certificates)if(E instanceof Dn&&E.issuer.isEqual(y.sid.issuer)&&E.serialNumber.isEqual(y.sid.serialNumber)){p=E;break}}else{let E=y.sid,A=E.idBlock.isConstructed?E.valueBlock.value[0].valueBlock.valueHex:E.valueBlock.valueHex;for(let b of this.certificates){if(!(b instanceof Dn))continue;let V=await f.digest({name:"sha-1"},b.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);if(Lo(V,A)){p=b;break}}}if(!p)throw new Nn({date:s,code:3,message:"Unable to find signer certificate"});if(this.encapContentInfo.eContentType===tW){if(!this.encapContentInfo.eContent)throw new Nn({date:s,code:15,message:"Error during verification: TSTInfo eContent is empty",signatureVerified:null,signerCertificate:p,timestampSerial:d,signerCertificateVerified:!0});let E;try{E=v5.fromBER(this.encapContentInfo.eContent.valueBlock.valueHexView)}catch{throw new Nn({date:s,code:15,message:"Error during verification: TSTInfo wrong ASN.1 schema ",signatureVerified:null,signerCertificate:p,timestampSerial:d,signerCertificateVerified:!0})}if(s=E.genTime,d=E.serialNumber.valueBlock.valueHexView.slice().buffer,t.byteLength===0)throw new Nn({date:s,code:4,message:"Missed detached data input array"});if(!await E.verify({data:t},f))throw new Nn({date:s,code:15,message:"Error during verification: TSTInfo verification is failed",signatureVerified:!1,signerCertificate:p,timestampSerial:d,signerCertificateVerified:!0})}if(i){let E=this.certificates.filter(I=>I instanceof Dn&&!!o5(I,p)),A={checkDate:s,certs:E,trustedCerts:n};c&&(A.findIssuer=c),l&&(A.findOrigin=l);let b=new g5(A);if(b.certs.push(p),this.crls)for(let I of this.crls)"thisUpdate"in I?b.crls.push(I):I.otherRevInfoFormat===KE&&b.ocsps.push(new $1({schema:I.otherRevInfo}));this.ocsps&&b.ocsps.push(...this.ocsps);let V=await b.verify({passedWhenNotRevValues:a},f).catch(I=>{throw new Nn({date:s,code:5,message:`Validation of signer's certificate failed with error: ${I instanceof Object?I.resultMessage:I}`,signerCertificate:p,signerCertificateVerified:!1})});if(V.certificatePath&&(v=V.certificatePath),!V.result)throw new Nn({date:s,code:5,message:`Validation of signer's certificate failed: ${V.resultMessage}`,signerCertificate:p,signerCertificateVerified:!1})}let S=f.getAlgorithmByOID(y.digestAlgorithm.algorithmId);if(!("name"in S))throw new Nn({date:s,code:7,message:`Unsupported signature algorithm: ${y.digestAlgorithm.algorithmId}`,signerCertificate:p,signerCertificateVerified:!0});m=S.name;let C=this.encapContentInfo.eContent;if(C)C.idBlock.tagClass===1&&C.idBlock.tagNumber===4?t=C.getValue():t=C.valueBlock.valueBeforeDecodeView.slice().buffer;else if(t.byteLength===0)throw new Nn({date:s,code:8,message:"Missed detached data input array",signerCertificate:p,signerCertificateVerified:!0});if(y.signedAttrs){let E=!1,A=!1;for(let b of y.signedAttrs.attributes)if(b.type==="1.2.840.113549.1.9.3"&&(E=!0),b.type==="1.2.840.113549.1.9.4"&&(A=!0,g=b.values[0].valueBlock.valueHex),E&&A)break;if(E===!1)throw new Nn({date:s,code:9,message:'Attribute "content-type" is a mandatory attribute for "signed attributes"',signerCertificate:p,signerCertificateVerified:!0});if(A===!1)throw new Nn({date:s,code:10,message:'Attribute "message-digest" is a mandatory attribute for "signed attributes"',signatureVerified:null,signerCertificate:p,signerCertificateVerified:!0})}if(y.signedAttrs){let E=await f.digest(m,new Uint8Array(t));if(!Lo(E,g))throw new Nn({date:s,code:15,message:"Error during verification: Message digest doesn't match",signatureVerified:null,signerCertificate:p,timestampSerial:d,signerCertificateVerified:!0});t=y.signedAttrs.encodedValue}let w=y.signatureAlgorithm.algorithmId==="1.2.840.113549.1.1.1"?await f.verifyWithPublicKey(t,y.signature,p.subjectPublicKeyInfo,y.signatureAlgorithm,m):await f.verifyWithPublicKey(t,y.signature,p.subjectPublicKeyInfo,y.signatureAlgorithm);return o?{date:s,code:14,message:P,signatureVerified:w,signerCertificate:p,timestampSerial:d,signerCertificateVerified:!0,certificatePath:v}:w}catch(g){throw g instanceof Nn?g:new Nn({date:s,code:15,message:`Error during verification: ${g instanceof Error?g.message:g}`,signatureVerified:null,signerCertificate:p,timestampSerial:d,signerCertificateVerified:!0})}}async sign(e,t,n="SHA-1",s=Or,i=pt(!0)){var a;if(!e)throw new Error("Need to provide a private key for signing");let o=this.signerInfos[t];if(!o)throw new RangeError("SignerInfo index is out of range");!(!((a=o.signedAttrs)===null||a===void 0)&&a.attributes.length)&&"hash"in e.algorithm&&"hash"in e.algorithm&&e.algorithm.hash&&(n=e.algorithm.hash.name);let l=i.getOIDByAlgorithm({name:n},!0,"hashAlgorithm");this.digestAlgorithms.filter(d=>d.algorithmId===l).length===0&&this.digestAlgorithms.push(new ce({algorithmId:l,algorithmParams:new Cr})),o.digestAlgorithm=new ce({algorithmId:l,algorithmParams:new Cr});let c=await i.getSignatureParameters(e,n),f=c.parameters;if(o.signatureAlgorithm=c.signatureAlgorithm,o.signedAttrs)if(o.signedAttrs.encodedValue.byteLength!==0)s=o.signedAttrs.encodedValue;else{s=o.signedAttrs.toSchema().toBER();let d=Ye.toUint8Array(s);d[0]=49}else{let d=this.encapContentInfo.eContent;if(d)d.idBlock.tagClass===1&&d.idBlock.tagNumber===4?s=d.getValue():s=d.valueBlock.valueBeforeDecodeView.slice().buffer;else if(s.byteLength===0)throw new Error("Missed detached data input array")}let p=await i.signWithPrivateKey(s,e,f);o.signature=new Ne({valueHex:p})}};Jp.CLASS_NAME="SignedData";Jp.ID_DATA=vT;var Oc="version",_c="authSafe",Ua="macData",gm="parsedValue",nJ=[Oc,_c,Ua],sJ=class Pc extends Ee{static{u(this,"PFX")}constructor(e={}){super(),this.version=T(e,Oc,Pc.defaultValues(Oc)),this.authSafe=T(e,_c,Pc.defaultValues(_c)),Ua in e&&(this.macData=T(e,Ua,Pc.defaultValues(Ua))),gm in e&&(this.parsedValue=T(e,gm,Pc.defaultValues(gm))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Oc:return 3;case _c:return new Nr;case Ua:return new Bu;case gm:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Oc:return t===Pc.defaultValues(e);case _c:return Nr.compareWithDefault("contentType",t.contentType)&&Nr.compareWithDefault("content",t.content);case Ua:return Bu.compareWithDefault("mac",t.mac)&&Bu.compareWithDefault("macSalt",t.macSalt)&&Bu.compareWithDefault("iterations",t.iterations);case gm:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.version||Oc}),Nr.schema(t.authSafe||{names:{blockName:_c}}),Bu.schema(t.macData||{names:{blockName:Ua,optional:!0}})]})}fromSchema(e){we(e,nJ);let t=ve(e,e,Pc.schema({names:{version:Oc,authSafe:{names:{blockName:_c}},macData:{names:{blockName:Ua}}}}));me.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.authSafe=new Nr({schema:t.result.authSafe}),Ua in t.result&&(this.macData=new Bu({schema:t.result.macData}))}toSchema(){let e=[new le({value:this.version}),this.authSafe.toSchema()];return this.macData&&e.push(this.macData.toSchema()),new H({value:e})}toJSON(){let e={version:this.version,authSafe:this.authSafe.toJSON()};return this.macData&&(e.macData=this.macData.toJSON()),e}async makeInternalValues(e={},t=pt(!0)){if(sr.assert(e,"parameters","object"),!this.parsedValue)throw new Error('Please call "parseValues" function first in order to make "parsedValue" data');switch(Ht.assertEmpty(this.parsedValue.integrityMode,"integrityMode","parsedValue"),Ht.assertEmpty(this.parsedValue.authenticatedSafe,"authenticatedSafe","parsedValue"),this.parsedValue.integrityMode){case 0:{if(!("iterations"in e))throw new Ht("iterations");Ht.assertEmpty(e.pbkdf2HashAlgorithm,"pbkdf2HashAlgorithm"),Ht.assertEmpty(e.hmacHashAlgorithm,"hmacHashAlgorithm"),Ht.assertEmpty(e.password,"password");let n=new ArrayBuffer(64),s=new Uint8Array(n);t.getRandomValues(s);let i=this.parsedValue.authenticatedSafe.toSchema().toBER(!1);this.authSafe=new Nr({contentType:Nr.DATA,content:new Ne({valueHex:i})});let a=await t.stampDataWithPassword({password:e.password,hashAlgorithm:e.hmacHashAlgorithm,salt:n,iterationCount:e.iterations,contentToStamp:i});this.macData=new Bu({mac:new Vc({digestAlgorithm:new ce({algorithmId:t.getOIDByAlgorithm({name:e.hmacHashAlgorithm},!0,"hmacHashAlgorithm")}),digest:new Ne({valueHex:a})}),macSalt:new Ne({valueHex:n}),iterations:e.iterations})}break;case 1:{if(!("signingCertificate"in e))throw new Ht("signingCertificate");Ht.assertEmpty(e.privateKey,"privateKey"),Ht.assertEmpty(e.hashAlgorithm,"hashAlgorithm");let n=this.parsedValue.authenticatedSafe.toSchema().toBER(!1),s=new Jp({version:1,encapContentInfo:new Fc({eContentType:"1.2.840.113549.1.7.1",eContent:new Ne({valueHex:n})}),certificates:[e.signingCertificate]}),i=await t.digest({name:e.hashAlgorithm},new Uint8Array(n)),a=[];a.push(new _r({type:"1.2.840.113549.1.9.3",values:[new je({value:"1.2.840.113549.1.7.1"})]})),a.push(new _r({type:"1.2.840.113549.1.9.5",values:[new wl({valueDate:new Date})]})),a.push(new _r({type:"1.2.840.113549.1.9.4",values:[new Ne({valueHex:i})]})),s.signerInfos.push(new wS({version:1,sid:new wn({issuer:e.signingCertificate.issuer,serialNumber:e.signingCertificate.serialNumber}),signedAttrs:new ns({type:0,attributes:a})})),await s.sign(e.privateKey,0,e.hashAlgorithm,void 0,t),this.authSafe=new Nr({contentType:"1.2.840.113549.1.7.2",content:s.toSchema(!0)})}break;default:throw new Error(`Parameter "integrityMode" has unknown value: ${this.parsedValue.integrityMode}`)}}async parseInternalValues(e,t=pt(!0)){switch(sr.assert(e,"parameters","object"),e.checkIntegrity===void 0&&(e.checkIntegrity=!0),this.parsedValue={},this.authSafe.contentType){case Nr.DATA:{Ht.assertEmpty(e.password,"password"),this.parsedValue.integrityMode=0,sr.assert(this.authSafe.content,"authSafe.content",Ne);let n=this.authSafe.content.getValue();if(this.parsedValue.authenticatedSafe=GN.fromBER(n),e.checkIntegrity){if(!this.macData)throw new Error('Absent "macData" value, can not check PKCS#12 data integrity');let s=t.getAlgorithmByOID(this.macData.mac.digestAlgorithm.algorithmId,!0,"digestAlgorithm");if(!await t.verifyDataStampedWithPassword({password:e.password,hashAlgorithm:s.name,salt:Ye.toArrayBuffer(this.macData.macSalt.valueBlock.valueHexView),iterationCount:this.macData.iterations||1,contentToVerify:n,signatureToVerify:Ye.toArrayBuffer(this.macData.mac.digest.valueBlock.valueHexView)}))throw new Error("Integrity for the PKCS#12 data is broken!")}}break;case Nr.SIGNED_DATA:{this.parsedValue.integrityMode=1;let n=new Jp({schema:this.authSafe.content}),s=n.encapContentInfo.eContent;Ht.assert(s,"eContent","cmsSigned.encapContentInfo"),sr.assert(s,"eContent",Ne);let i=s.getValue();if(this.parsedValue.authenticatedSafe=GN.fromBER(i),!await n.verify({signer:0,checkChain:!1},t))throw new Error("Integrity for the PKCS#12 data is broken!")}break;default:throw new Error(`Incorrect value for "this.authSafe.contentType": ${this.authSafe.contentType}`)}}};sJ.CLASS_NAME="PFX";var Mp="status",ku="statusStrings",Lu="failInfo",iJ=[Mp,ku,Lu],D8;(function(r){r[r.granted=0]="granted",r[r.grantedWithMods=1]="grantedWithMods",r[r.rejection=2]="rejection",r[r.waiting=3]="waiting",r[r.revocationWarning=4]="revocationWarning",r[r.revocationNotification=5]="revocationNotification"})(D8||(D8={}));var F1=class kc extends Ee{static{u(this,"PKIStatusInfo")}constructor(e={}){super(),this.status=T(e,Mp,kc.defaultValues(Mp)),ku in e&&(this.statusStrings=T(e,ku,kc.defaultValues(ku))),Lu in e&&(this.failInfo=T(e,Lu,kc.defaultValues(Lu))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Mp:return 2;case ku:return[];case Lu:return new At;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Mp:return t===kc.defaultValues(e);case ku:return t.length===0;case Lu:return t.isEqual(kc.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||P,value:[new le({name:t.status||P}),new H({optional:!0,value:[new ut({name:t.statusStrings||P,value:new _s})]}),new At({name:t.failInfo||P,optional:!0})]})}fromSchema(e){we(e,iJ);let t=ve(e,e,kc.schema({names:{status:Mp,statusStrings:ku,failInfo:Lu}}));me.assertSchema(t,this.className);let n=t.result.status;if(n.valueBlock.isHexOnly===!0||n.valueBlock.valueDec<0||n.valueBlock.valueDec>5)throw new Error('PKIStatusInfo "status" has invalid value');this.status=n.valueBlock.valueDec,ku in t.result&&(this.statusStrings=t.result.statusStrings),Lu in t.result&&(this.failInfo=t.result.failInfo)}toSchema(){let e=[];return e.push(new le({value:this.status})),this.statusStrings&&e.push(new H({optional:!0,value:this.statusStrings})),this.failInfo&&e.push(this.failInfo),new H({value:e})}toJSON(){let e={status:this.status};return this.statusStrings&&(e.statusStrings=Array.from(this.statusStrings,t=>t.toJSON())),this.failInfo&&(e.failInfo=this.failInfo.toJSON()),e}};F1.CLASS_NAME="PKIStatusInfo";var U1="version",M1="messageImprint",jp="reqPolicy",qp="nonce",Ma="certReq",Hp="extensions",$c="TimeStampReq",fT=`${$c}.${U1}`,hT=`${$c}.${M1}`,Ww=`${$c}.${jp}`,zw=`${$c}.${qp}`,Jw=`${$c}.${Ma}`,Yw=`${$c}.${Hp}`,aJ=[fT,hT,Ww,zw,Jw,Yw],oJ=class Fs extends Ee{static{u(this,"TimeStampReq")}constructor(e={}){super(),this.version=T(e,U1,Fs.defaultValues(U1)),this.messageImprint=T(e,M1,Fs.defaultValues(M1)),jp in e&&(this.reqPolicy=T(e,jp,Fs.defaultValues(jp))),qp in e&&(this.nonce=T(e,qp,Fs.defaultValues(qp))),Ma in e&&(this.certReq=T(e,Ma,Fs.defaultValues(Ma))),Hp in e&&(this.extensions=T(e,Hp,Fs.defaultValues(Hp))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case U1:return 0;case M1:return new li;case jp:return P;case qp:return new le;case Ma:return!1;case Hp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case U1:case jp:case Ma:return t===Fs.defaultValues(e);case M1:return li.compareWithDefault("hashAlgorithm",t.hashAlgorithm)&&li.compareWithDefault("hashedMessage",t.hashedMessage);case qp:return t.isEqual(Fs.defaultValues(e));case Hp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||$c,value:[new le({name:t.version||fT}),li.schema(t.messageImprint||{names:{blockName:hT}}),new je({name:t.reqPolicy||Ww,optional:!0}),new le({name:t.nonce||zw,optional:!0}),new ti({name:t.certReq||Jw,optional:!0}),new re({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new ut({name:t.extensions||Yw,value:Us.schema()})]})]})}fromSchema(e){we(e,aJ);let t=ve(e,e,Fs.schema());me.assertSchema(t,this.className),this.version=t.result[fT].valueBlock.valueDec,this.messageImprint=new li({schema:t.result[hT]}),Ww in t.result&&(this.reqPolicy=t.result[Ww].valueBlock.toString()),zw in t.result&&(this.nonce=t.result[zw]),Jw in t.result&&(this.certReq=t.result[Jw].valueBlock.value),Yw in t.result&&(this.extensions=Array.from(t.result[Yw],n=>new Us({schema:n})))}toSchema(){let e=[];return e.push(new le({value:this.version})),e.push(this.messageImprint.toSchema()),this.reqPolicy&&e.push(new je({value:this.reqPolicy})),this.nonce&&e.push(this.nonce),Ma in this&&Fs.compareWithDefault(Ma,this.certReq)===!1&&e.push(new ti({value:this.certReq})),this.extensions&&e.push(new re({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.extensions,t=>t.toSchema())})),new H({value:e})}toJSON(){let e={version:this.version,messageImprint:this.messageImprint.toJSON()};return this.reqPolicy!==void 0&&(e.reqPolicy=this.reqPolicy),this.nonce!==void 0&&(e.nonce=this.nonce.toJSON()),this.certReq!==void 0&&Fs.compareWithDefault(Ma,this.certReq)===!1&&(e.certReq=this.certReq),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}};oJ.CLASS_NAME="TimeStampReq";var Kp="status",Xp="timeStampToken",OT="TimeStampResp",pT=`${OT}.${Kp}`,Qw=`${OT}.${Xp}`,uJ=[pT,Qw],lJ=class Zw extends Ee{static{u(this,"TimeStampResp")}constructor(e={}){super(),this.status=T(e,Kp,Zw.defaultValues(Kp)),Xp in e&&(this.timeStampToken=T(e,Xp,Zw.defaultValues(Xp))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Kp:return new F1;case Xp:return new Nr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Kp:return F1.compareWithDefault(Kp,t.status)&&!("statusStrings"in t)&&!("failInfo"in t);case Xp:return t.contentType===P&&t.content instanceof nt;default:return super.defaultValues(e)}}static schema(e={}){let t=T(e,"names",{});return new H({name:t.blockName||OT,value:[F1.schema(t.status||{names:{blockName:pT}}),Nr.schema(t.timeStampToken||{names:{blockName:Qw,optional:!0}})]})}fromSchema(e){we(e,uJ);let t=ve(e,e,Zw.schema());me.assertSchema(t,this.className),this.status=new F1({schema:t.result[pT]}),Qw in t.result&&(this.timeStampToken=new Nr({schema:t.result[Qw]}))}toSchema(){let e=[];return e.push(this.status.toSchema()),this.timeStampToken&&e.push(this.timeStampToken.toSchema()),new H({value:e})}toJSON(){let e={status:this.status.toJSON()};return this.timeStampToken&&(e.timeStampToken=this.timeStampToken.toJSON()),e}async sign(e,t,n=pt(!0)){return this.assertContentType(),new Jp({schema:this.timeStampToken.content}).sign(e,0,t,void 0,n)}async verify(e={signer:0,trustedCerts:[],data:Or},t=pt(!0)){return this.assertContentType(),new Jp({schema:this.timeStampToken.content}).verify(e,t)}assertContentType(){if(!this.timeStampToken)throw new Error("timeStampToken is absent in TSP response");if(this.timeStampToken.contentType!==j8)throw new Error(`Wrong format of timeStampToken: ${this.timeStampToken.contentType}`)}};lJ.CLASS_NAME="TimeStampResp";function cJ(){if(typeof globalThis<"u"&&"crypto"in globalThis){let r="webcrypto";"webkitSubtle"in globalThis.crypto&&(r="safari"),eS(r,new zp({name:r,crypto:globalThis.crypto}))}else if(typeof crypto<"u"&&"webcrypto"in crypto){let r="NodeJS ^15",e=crypto.webcrypto;eS(r,new zp({name:r,crypto:e}))}}u(cJ,"initCryptoEngine");cJ();var _T=null,qr=class{static{u(this,"Application")}static setEngine(e,t){_T=Object.assign(t,{name:e}),eS(e,new zp({name:e,crypto:t}))}static get crypto(){if(!_T)throw new De(ye.CRYPTOGRAPHIC_NO_MODULE);return _T}static isNodePlugin(){return typeof self>"u"&&typeof window>"u"}};function fJ(){qr.isNodePlugin()||qr.setEngine("W3 WebCrypto module",self.crypto)}u(fJ,"init");fJ();var SS=class{static{u(this,"XmlAlgorithm")}getAlgorithmName(){return this.namespaceURI}},Wc=class extends SS{static{u(this,"HashAlgorithm")}async Digest(e){let t;if(typeof e=="string")t=zt.FromString(e,"utf8");else if(ArrayBuffer.isView(e))t=new Uint8Array(e.buffer);else if(e instanceof ArrayBuffer)t=new Uint8Array(e);else{let s=Qf(e);t=zt.FromString(s,"utf8")}let n=await qr.crypto.subtle.digest(this.algorithm,t);return new Uint8Array(n)}},Ur=class extends SS{static{u(this,"SignatureAlgorithm")}async Sign(e,t,n){let s=zt.FromString(e,"utf8");return qr.crypto.subtle.sign(n,t,s)}async Verify(e,t,n){let s=this.algorithm,i=zt.FromString(e,"utf8");return qr.crypto.subtle.verify(s,t,n,i)}};var zr="SHA-1",un="SHA-256",ln="SHA-384",cn="SHA-512",Zp="http://www.w3.org/2000/09/xmldsig#sha1",e0="http://www.w3.org/2001/04/xmlenc#sha256",t0="http://www.w3.org/2001/04/xmldsig-more#sha384",r0="http://www.w3.org/2001/04/xmlenc#sha512",AS=class extends Wc{static{u(this,"Sha1")}constructor(){super(...arguments),this.algorithm={name:zr},this.namespaceURI=Zp}},Z1=class extends Wc{static{u(this,"Sha256")}constructor(){super(...arguments),this.algorithm={name:un},this.namespaceURI=e0}},CS=class extends Wc{static{u(this,"Sha384")}constructor(){super(...arguments),this.algorithm={name:ln},this.namespaceURI=t0}},xS=class extends Wc{static{u(this,"Sha512")}constructor(){super(...arguments),this.algorithm={name:cn},this.namespaceURI=r0}};var Ha="ECDSA",bS="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1",NS="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256",TS="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384",IS="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512";function DS(r){if(r.name.toUpperCase()===Ha.toUpperCase())switch(r.hash.name.toUpperCase()){case zr:return new n0;case un:return new s0;case ln:return new i0;case cn:return new a0}return null}u(DS,"fromAlgorithm");var n0=class extends Ur{static{u(this,"EcdsaSha1")}constructor(){super(...arguments),this.algorithm={name:Ha,hash:{name:zr}},this.namespaceURI=bS}static fromAlgorithm(e){return DS(e)}},s0=class extends Ur{static{u(this,"EcdsaSha256")}constructor(){super(...arguments),this.algorithm={name:Ha,hash:{name:un}},this.namespaceURI=NS}static fromAlgorithm(e){return DS(e)}},i0=class extends Ur{static{u(this,"EcdsaSha384")}constructor(){super(...arguments),this.algorithm={name:Ha,hash:{name:ln}},this.namespaceURI=TS}static fromAlgorithm(e){return DS(e)}},a0=class extends Ur{static{u(this,"EcdsaSha512")}constructor(){super(...arguments),this.algorithm={name:Ha,hash:{name:cn}},this.namespaceURI=IS}static fromAlgorithm(e){return DS(e)}};var o0="HMAC",PT="http://www.w3.org/2000/09/xmldsig#hmac-sha1",kT="http://www.w3.org/2001/04/xmldsig-more#hmac-sha256",LT="http://www.w3.org/2001/04/xmldsig-more#hmac-sha384",VT="http://www.w3.org/2001/04/xmldsig-more#hmac-sha512";function BS(r){if(r.name.toUpperCase()===o0.toUpperCase())switch(r.hash.name.toUpperCase()){case zr:return new ey;case un:return new ty;case ln:return new ry;case cn:return new ny}return null}u(BS,"fromAlgorithm");var ey=class extends Ur{static{u(this,"HmacSha1")}constructor(){super(...arguments),this.algorithm={name:o0,hash:{name:zr}},this.namespaceURI=PT}static fromAlgorithm(e){return BS(e)}},ty=class extends Ur{static{u(this,"HmacSha256")}constructor(){super(...arguments),this.algorithm={name:o0,hash:{name:un}},this.namespaceURI=kT}static fromAlgorithm(e){return BS(e)}},ry=class extends Ur{static{u(this,"HmacSha384")}constructor(){super(...arguments),this.algorithm={name:o0,hash:{name:ln}},this.namespaceURI=LT}static fromAlgorithm(e){return BS(e)}},ny=class extends Ur{static{u(this,"HmacSha512")}constructor(){super(...arguments),this.algorithm={name:o0,hash:{name:cn}},this.namespaceURI=VT}static fromAlgorithm(e){return BS(e)}};var Ka="RSASSA-PKCS1-v1_5",RS="http://www.w3.org/2000/09/xmldsig#rsa-sha1",OS="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",_S="http://www.w3.org/2001/04/xmldsig-more#rsa-sha384",PS="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";function kS(r){if(r.name.toUpperCase()===Ka.toUpperCase())switch(r.hash.name.toUpperCase()){case zr:return new u0;case un:return new l0;case ln:return new c0;case cn:return new f0}return null}u(kS,"fromAlgorithm");var u0=class extends Ur{static{u(this,"RsaPkcs1Sha1")}constructor(){super(...arguments),this.algorithm={name:Ka,hash:{name:zr}},this.namespaceURI=RS}static fromAlgorithm(e){return kS(e)}},l0=class extends Ur{static{u(this,"RsaPkcs1Sha256")}constructor(){super(...arguments),this.algorithm={name:Ka,hash:{name:un}},this.namespaceURI=OS}static fromAlgorithm(e){return kS(e)}},c0=class extends Ur{static{u(this,"RsaPkcs1Sha384")}constructor(){super(...arguments),this.algorithm={name:Ka,hash:{name:ln}},this.namespaceURI=_S}static fromAlgorithm(e){return kS(e)}},f0=class extends Ur{static{u(this,"RsaPkcs1Sha512")}constructor(){super(...arguments),this.algorithm={name:Ka,hash:{name:cn}},this.namespaceURI=PS}static fromAlgorithm(e){return kS(e)}};function Oe(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var o=r.length-1;o>=0;o--)(a=r[o])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i}u(Oe,"__decorate");function ze(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}u(ze,"__metadata");var oe={DefaultCanonMethod:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315",DefaultDigestMethod:"http://www.w3.org/2001/04/xmlenc#sha256",DefaultPrefix:"ds",ElementNames:{CanonicalizationMethod:"CanonicalizationMethod",DigestMethod:"DigestMethod",DigestValue:"DigestValue",DSAKeyValue:"DSAKeyValue",DomainParameters:"DomainParameters",EncryptedKey:"EncryptedKey",HMACOutputLength:"HMACOutputLength",RSAPSSParams:"RSAPSSParams",MaskGenerationFunction:"MaskGenerationFunction",SaltLength:"SaltLength",KeyInfo:"KeyInfo",KeyName:"KeyName",KeyValue:"KeyValue",Modulus:"Modulus",Exponent:"Exponent",Manifest:"Manifest",Object:"Object",Reference:"Reference",RetrievalMethod:"RetrievalMethod",RSAKeyValue:"RSAKeyValue",ECDSAKeyValue:"ECDSAKeyValue",NamedCurve:"NamedCurve",PublicKey:"PublicKey",Signature:"Signature",SignatureMethod:"SignatureMethod",SignatureValue:"SignatureValue",SignedInfo:"SignedInfo",Transform:"Transform",Transforms:"Transforms",X509Data:"X509Data",PGPData:"PGPData",SPKIData:"SPKIData",SPKIexp:"SPKIexp",MgmtData:"MgmtData",X509IssuerSerial:"X509IssuerSerial",X509IssuerName:"X509IssuerName",X509SerialNumber:"X509SerialNumber",X509SKI:"X509SKI",X509SubjectName:"X509SubjectName",X509Certificate:"X509Certificate",X509CRL:"X509CRL",XPath:"XPath",X:"X",Y:"Y"},AttributeNames:{Algorithm:"Algorithm",Encoding:"Encoding",Id:"Id",MimeType:"MimeType",Type:"Type",URI:"URI"},AlgorithmNamespaces:{XmlDsigBase64Transform:"http://www.w3.org/2000/09/xmldsig#base64",XmlDsigC14NTransform:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315",XmlDsigC14NWithCommentsTransform:"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",XmlDsigEnvelopedSignatureTransform:"http://www.w3.org/2000/09/xmldsig#enveloped-signature",XmlDsigXPathTransform:"http://www.w3.org/TR/1999/REC-xpath-19991116",XmlDsigXsltTransform:"http://www.w3.org/TR/1999/REC-xslt-19991116",XmlDsigExcC14NTransform:"http://www.w3.org/2001/10/xml-exc-c14n#",XmlDsigExcC14NWithCommentsTransform:"http://www.w3.org/2001/10/xml-exc-c14n#WithComments",XmlDecryptionTransform:"http://www.w3.org/2002/07/decrypt#XML",XmlLicenseTransform:"urn:mpeg:mpeg21:2003:01-REL-R-NS:licenseTransform"},Uri:{Manifest:"http://www.w3.org/2000/09/xmldsig#Manifest"},NamespaceURI:"http://www.w3.org/2000/09/xmldsig#",NamespaceURIMore:"http://www.w3.org/2007/05/xmldsig-more#",NamespaceURIPss:"http://www.example.org/xmldsig-pss/#"};var Sr=class extends Yn{static{u(this,"XmlSignatureObject")}};Sr=Oe([yt({localName:"xmldsig",namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix})],Sr);var Ms=class extends eh{static{u(this,"XmlSignatureCollection")}};Ms=Oe([yt({localName:"xmldsig_collection",namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix})],Ms);var js=class extends Sr{static{u(this,"DigestMethod")}constructor(e){super(),e&&(this.Algorithm=e)}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:oe.DefaultDigestMethod}),ze("design:type",String)],js.prototype,"Algorithm",void 0);js=Oe([yt({localName:oe.ElementNames.DigestMethod}),ze("design:paramtypes",[String])],js);var ys=class extends Sr{static{u(this,"KeyInfoClause")}static canImportCryptoKey(e){return!1}};var hJ={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},h0=class extends ys{static{u(this,"RsaKeyValue")}constructor(){super(...arguments),this.key=null,this.jwk=null,this.keyUsage=[]}static canImportCryptoKey(e){let t=e.algorithm.name.toUpperCase();return t===Ka.toUpperCase()||t===hi.toUpperCase()}async importKey(e){let t=e.algorithm.name?e.algorithm.name.toUpperCase():"";if(t!==Ka.toUpperCase()&&t!==hi.toUpperCase())throw new De(ye.ALGORITHM_WRONG_NAME,e.algorithm.name);this.key=e;let n=await qr.crypto.subtle.exportKey("jwk",e);return this.jwk=n,this.Modulus=zt.FromBase64Url(n.n||""),this.Exponent=zt.FromBase64Url(n.e||""),this.keyUsage=e.usages,this}async exportKey(e=hJ){if(this.key)return this.key;if(!this.Modulus)throw new De(ye.CRYPTOGRAPHIC,"RsaKeyValue has no Modulus");let t=zt.ToBase64Url(this.Modulus);if(!this.Exponent)throw new De(ye.CRYPTOGRAPHIC,"RsaKeyValue has no Exponent");let n=zt.ToBase64Url(this.Exponent),s;switch(e.name.toUpperCase()){case Ka.toUpperCase():s="R";break;case hi.toUpperCase():s="P";break;default:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}switch(e.hash.name.toUpperCase()){case zr:s+="S1";break;case un:s+="S256";break;case ln:s+="S384";break;case cn:s+="S512";break}let i={kty:"RSA",alg:s,n:t,e:n,ext:!0};return qr.crypto.subtle.importKey("jwk",i,e,!0,this.keyUsage)}LoadXml(e){super.LoadXml(e),this.keyUsage=["verify"]}};Oe([Nt({localName:oe.ElementNames.Modulus,prefix:oe.DefaultPrefix,namespaceURI:oe.NamespaceURI,required:!0,converter:Os}),ze("design:type",Object)],h0.prototype,"Modulus",void 0);Oe([Nt({localName:oe.ElementNames.Exponent,prefix:oe.DefaultPrefix,namespaceURI:oe.NamespaceURI,required:!0,converter:Os}),ze("design:type",Object)],h0.prototype,"Exponent",void 0);h0=Oe([yt({localName:oe.ElementNames.RSAKeyValue})],h0);var FT="http://www.w3.org/2007/05/xmldsig-more#",UT="pss",p0=class extends Yn{static{u(this,"MaskGenerationFunction")}};Oe([Nt({parser:js}),ze("design:type",js)],p0.prototype,"DigestMethod",void 0);Oe([pr({localName:oe.AttributeNames.Algorithm,defaultValue:"http://www.w3.org/2007/05/xmldsig-more#MGF1"}),ze("design:type",String)],p0.prototype,"Algorithm",void 0);p0=Oe([yt({localName:oe.ElementNames.MaskGenerationFunction,prefix:UT,namespaceURI:FT})],p0);var pi=class extends Yn{static{u(this,"PssAlgorithmParams")}};Oe([Nt({parser:js}),ze("design:type",js)],pi.prototype,"DigestMethod",void 0);Oe([Nt({parser:p0}),ze("design:type",p0)],pi.prototype,"MGF",void 0);Oe([Nt({converter:Wd,prefix:UT,namespaceURI:FT}),ze("design:type",Number)],pi.prototype,"SaltLength",void 0);Oe([Nt({converter:Wd}),ze("design:type",Number)],pi.prototype,"TrailerField",void 0);pi=Oe([yt({localName:oe.ElementNames.RSAPSSParams,prefix:UT,namespaceURI:FT})],pi);var hi="RSA-PSS",MT="http://www.w3.org/2007/05/xmldsig-more#rsa-pss",LS=class r extends Ur{static{u(this,"RsaPssWithParams")}constructor(){super(...arguments),this.algorithm={name:hi,hash:{name:zr}},this.namespaceURI=MT}static fromAlgorithm(e){let t=null;if(e.name.toUpperCase()===hi.toUpperCase()){switch(e.hash.name.toUpperCase()){case zr:t=new r;break;case un:t=new r;break;case ln:t=new r;break;case cn:t=new r;break}if(t)return t.algorithm.hash.name=e.hash.name,e.saltLength&&(t.algorithm.saltLength=e.saltLength),t}return null}fromMethod(e){if(!e.Any.Some(t=>{if(t instanceof pi){switch(t.DigestMethod.Algorithm.toLowerCase()){case Zp:this.algorithm.hash.name=zr;break;case e0:this.algorithm.hash.name=un;break;case t0:this.algorithm.hash.name=ln;break;case r0:this.algorithm.hash.name=cn;break;default:throw new De(ye.CRYPTOGRAPHIC,`Unsupported hash algorithm: ${t.DigestMethod.Algorithm}`)}return t.SaltLength&&(this.algorithm.saltLength=t.SaltLength),!0}return!1}))throw new De(ye.CRYPTOGRAPHIC,"RSA-PSS parameters not found in SignatureMethod")}toMethod(e){let t=new pi;switch(this.algorithm.hash.name.toUpperCase()){case zr:t.DigestMethod.Algorithm=Zp;break;case un:t.DigestMethod.Algorithm=e0;break;case ln:t.DigestMethod.Algorithm=t0;break;case cn:t.DigestMethod.Algorithm=r0;break;default:throw new De(ye.CRYPTOGRAPHIC,`Unsupported hash algorithm: ${this.algorithm.hash.name}`)}this.algorithm.saltLength&&(t.SaltLength=this.algorithm.saltLength),e.Any.Add(t)}};var jT="http://www.w3.org/2007/05/xmldsig-more#sha1-rsa-MGF1",qT="http://www.w3.org/2007/05/xmldsig-more#sha256-rsa-MGF1",HT="http://www.w3.org/2007/05/xmldsig-more#sha384-rsa-MGF1",KT="http://www.w3.org/2007/05/xmldsig-more#sha512-rsa-MGF1",d0=class extends Ur{static{u(this,"RsaPssWithoutParamsBase")}static fromAlgorithm(e){return null}},VS=class extends d0{static{u(this,"RsaPssWithoutParamsSha1")}constructor(){super(...arguments),this.algorithm={name:hi,hash:{name:zr},saltLength:20},this.namespaceURI=jT}},FS=class extends d0{static{u(this,"RsaPssWithoutParamsSha256")}constructor(){super(...arguments),this.algorithm={name:hi,hash:{name:un},saltLength:32},this.namespaceURI=qT}},US=class extends d0{static{u(this,"RsaPssWithoutParamsSha384")}constructor(){super(...arguments),this.algorithm={name:hi,hash:{name:ln},saltLength:48},this.namespaceURI=HT}},MS=class extends d0{static{u(this,"RsaPssWithoutParamsSha512")}constructor(){super(...arguments),this.algorithm={name:hi,hash:{name:cn},saltLength:64},this.namespaceURI=KT}};var vs;(function(r){r[r.BeforeDocElement=0]="BeforeDocElement",r[r.InsideDocElement=1]="InsideDocElement",r[r.AfterDocElement=2]="AfterDocElement"})(vs||(vs={}));var Xi=class{static{u(this,"XmlCanonicalizer")}constructor(e,t,n=new th){this.propagatedNamespaces=new th,this.result=[],this.visibleNamespaces=new th,this.inclusiveNamespacesPrefixList=[],this.state=vs.BeforeDocElement,this.withComments=e,this.exclusive=t,this.propagatedNamespaces=n}get InclusiveNamespacesPrefixList(){return this.inclusiveNamespacesPrefixList.join(" ")}set InclusiveNamespacesPrefixList(e){this.inclusiveNamespacesPrefixList=e.split(" ")}Canonicalize(e){if(!e)throw new De(ye.CRYPTOGRAPHIC,"Parameter 1 is not Node");return this.WriteNode(e),this.result.join("")}WriteNode(e){switch(e.nodeType){case gt.Document:case gt.DocumentFragment:this.WriteDocumentNode(e);break;case gt.Element:this.WriteElementNode(e);break;case gt.CDATA:case gt.SignificantWhitespace:case gt.Text:ml(e.parentNode)||this.WriteTextNode(e);break;case gt.Whitespace:this.state===vs.InsideDocElement&&this.WriteTextNode(e);break;case gt.Comment:this.WriteCommentNode(e);break;case gt.ProcessingInstruction:this.WriteProcessingInstructionNode(e);break;case gt.EntityReference:for(let t=0;t<e.childNodes.length;t++)this.WriteNode(e.childNodes[t]);break;case gt.Attribute:throw new De(ye.CRYPTOGRAPHIC,"Attribute node is impossible here");case gt.EndElement:throw new De(ye.CRYPTOGRAPHIC,"Attribute node is impossible here");case gt.EndEntity:throw new De(ye.CRYPTOGRAPHIC,"Attribute node is impossible here");case gt.DocumentType:case gt.Entity:case gt.Notation:case gt.XmlDeclaration:break}}WriteDocumentNode(e){this.state=vs.BeforeDocElement;for(let t=e.firstChild;t!=null;t=t.nextSibling)this.WriteNode(t)}WriteCommentNode(e){this.withComments&&(this.state===vs.AfterDocElement?this.result.push(`
91
+ <!--`):this.result.push("<!--"),this.result.push(this.NormalizeString(e.nodeValue,gt.Comment)),this.state===vs.BeforeDocElement?this.result.push(`-->
92
+ `):this.result.push("-->"))}WriteTextNode(e){this.result.push(this.NormalizeString(e.nodeValue,e.nodeType))}WriteProcessingInstructionNode(e){let t=e.nodeName||e.tagName;t!=="xml"&&(this.state===vs.AfterDocElement?this.result.push(`
93
+ <?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,gt.ProcessingInstruction))),this.state===vs.BeforeDocElement?this.result.push(`?>
94
+ `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===vs.BeforeDocElement&&(this.state=vs.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===vs.BeforeDocElement&&(this.state=vs.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(!XT(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let f={prefix:a.prefix,namespace:a.namespaceURI};t.push(f),this.visibleNamespaces.Add(f),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let f={prefix:a.prefix,namespace:a.nodeValue};t.push(f),this.visibleNamespaces.Add(f),n++}let o=null,l;(l=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(o=l[1]);let c=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,o)){let f=E5(e,o);if(f>1)c=!1;else if(f===0)continue}if(!this.IsNamespaceRendered(o,a.nodeValue)&&c){let f={prefix:o,namespace:a.nodeValue};t.push(f),this.visibleNamespaces.Add(f),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(dJ);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];XT(s)||t.push(s)}t.sort(mJ),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,gt.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===gt.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===gt.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===gt.Attribute?n.push("&quot;"):i===" "&&t===gt.Attribute?n.push("&#x9;"):i===`
95
+ `&&t===gt.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case gt.Text:case gt.CDATA:case gt.SignificantWhitespace:case gt.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 dJ(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}u(dJ,"XmlDsigC14NTransformNamespacesComparer");function mJ(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}u(mJ,"XmlDsigC14NTransformAttributesComparer");function E5(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(!XT(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===gt.Element){let a=E5(s,e,t);if(s.nodeType===gt.Element&&a)return++t+a}return t}u(E5,"IsNamespaceUsed");function XT(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===gt.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}u(XT,"IsNamespaceNode");var jS=class extends Ms{static{u(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element||n.nodeName===oe.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case oe.ElementNames.RSAPSSParams:s=pi;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};jS=Oe([yt({localName:"Other"})],jS);var Gi=class extends Sr{static{u(this,"SignatureMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:""}),ze("design:type",String)],Gi.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.HMACOutputLength,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Wd}),ze("design:type",Number)],Gi.prototype,"HMACOutputLength",void 0);Oe([Nt({parser:jS,noRoot:!0,minOccurs:0}),ze("design:type",jS)],Gi.prototype,"Any",void 0);Gi=Oe([yt({localName:oe.ElementNames.SignatureMethod})],Gi);var m0=class extends Sr{static{u(this,"CanonicalizationMethod")}};Oe([pr({localName:oe.AttributeNames.Algorithm,required:!0,defaultValue:oe.DefaultCanonMethod}),ze("design:type",String)],m0.prototype,"Algorithm",void 0);m0=Oe([yt({localName:oe.ElementNames.CanonicalizationMethod})],m0);var g0=class extends Sr{static{u(this,"DataObject")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],g0.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.MimeType,defaultValue:""}),ze("design:type",String)],g0.prototype,"MimeType",void 0);Oe([pr({localName:oe.AttributeNames.Encoding,defaultValue:""}),ze("design:type",String)],g0.prototype,"Encoding",void 0);g0=Oe([yt({localName:oe.ElementNames.Object})],g0);var sy=class extends Ms{static{u(this,"DataObjects")}};sy=Oe([yt({localName:"xmldsig_objects",parser:g0})],sy);var Bn=class extends Sr{static{u(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new De(ye.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new De(ye.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};Oe([pr({localName:oe.AttributeNames.Algorithm,defaultValue:""}),ze("design:type",String)],Bn.prototype,"Algorithm",void 0);Oe([Nt({localName:oe.ElementNames.XPath,defaultValue:""}),ze("design:type",String)],Bn.prototype,"XPath",void 0);Bn=Oe([yt({localName:oe.ElementNames.Transform})],Bn);var Xa=class extends Bn{static{u(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return zt.FromString(this.innerXml.textContent||"","base64")}};var $i=class extends Bn{static{u(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Xi(!1,!1)}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Wi=class extends $i{static{u(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Xi(!0,!1)}};var Ga=class extends Bn{static{u(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)ps(e)&&e.localName===oe.ElementNames.Signature&&e.namespaceURI===oe.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var zi=class extends Bn{static{u(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Xi(!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 De(ye.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},Ji=class extends zi{static{u(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Xi(!0,!0)}};function w5(r){return r.parentNode?w5(r.parentNode):r}u(w5,"lookupParentNode");var y0=class extends Bn{static{u(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=oe.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new De(ye.PARAM_REQUIRED,"innerXml");this.Filter(w5(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:Zf("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})`,o=typeof self>"u"?Zf("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:u(c=>i.lookupNamespaceURI(c),"lookupNamespaceURI")},o.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};Oe([Nt({localName:oe.ElementNames.XPath,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],y0.prototype,"XPath",void 0);var v0=class extends Ms{static{u(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return zc(t,Ga);case oe.AlgorithmNamespaces.XmlDsigC14NTransform:return zc(t,$i);case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return zc(t,Wi);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:return zc(t,zi);case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return zc(t,Ji);case oe.AlgorithmNamespaces.XmlDsigBase64Transform:return zc(t,Xa);case oe.AlgorithmNamespaces.XmlDsigXPathTransform:return zc(t,y0);default:try{let n=iy.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new De(ye.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};v0=Oe([yt({localName:oe.ElementNames.Transforms,parser:Bn})],v0);function zc(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}u(zc,"ChangeTransform");var Yi=class extends Sr{static{u(this,"Reference")}constructor(e){super(),this.DigestMethod=new js,e&&(this.Uri=e)}};Oe([pr({defaultValue:""}),ze("design:type",String)],Yi.prototype,"Id",void 0);Oe([pr({localName:oe.AttributeNames.URI}),ze("design:type",String)],Yi.prototype,"Uri",void 0);Oe([pr({localName:oe.AttributeNames.Type,defaultValue:""}),ze("design:type",String)],Yi.prototype,"Type",void 0);Oe([Nt({parser:v0}),ze("design:type",v0)],Yi.prototype,"Transforms",void 0);Oe([Nt({required:!0,parser:js}),ze("design:type",js)],Yi.prototype,"DigestMethod",void 0);Oe([Nt({required:!0,localName:oe.ElementNames.DigestValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,converter:Os}),ze("design:type",Uint8Array)],Yi.prototype,"DigestValue",void 0);Yi=Oe([yt({localName:oe.ElementNames.Reference}),ze("design:paramtypes",[String])],Yi);var E0=class extends Ms{static{u(this,"References")}};E0=Oe([yt({localName:"References",parser:Yi})],E0);var $a=class extends Sr{static{u(this,"SignedInfo")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],$a.prototype,"Id",void 0);Oe([Nt({parser:m0,required:!0}),ze("design:type",m0)],$a.prototype,"CanonicalizationMethod",void 0);Oe([Nt({parser:Gi,required:!0}),ze("design:type",Gi)],$a.prototype,"SignatureMethod",void 0);Oe([Nt({parser:E0,minOccurs:1,noRoot:!0}),ze("design:type",E0)],$a.prototype,"References",void 0);$a=Oe([yt({localName:oe.ElementNames.SignedInfo})],$a);var C0="http://www.w3.org/2001/04/xmldsig-more#",x0="ecdsa",Jc=class extends Yn{static{u(this,"EcdsaPublicKey")}};Oe([Nt({localName:oe.ElementNames.X,namespaceURI:C0,prefix:x0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"X",void 0);Oe([Nt({localName:oe.ElementNames.Y,namespaceURI:C0,prefix:x0,required:!0,converter:Os}),ze("design:type",Uint8Array)],Jc.prototype,"Y",void 0);Jc=Oe([yt({localName:oe.ElementNames.PublicKey,namespaceURI:C0,prefix:x0})],Jc);var w0=class extends Yn{static{u(this,"NamedCurve")}};Oe([pr({localName:oe.AttributeNames.URI,required:!0}),ze("design:type",String)],w0.prototype,"Uri",void 0);w0=Oe([yt({localName:oe.ElementNames.NamedCurve,namespaceURI:C0,prefix:x0})],w0);var S0=class extends Yn{static{u(this,"DomainParameters")}};Oe([Nt({parser:w0}),ze("design:type",w0)],S0.prototype,"NamedCurve",void 0);S0=Oe([yt({localName:oe.ElementNames.DomainParameters,namespaceURI:C0,prefix:x0})],S0);var A0=class extends ys{static{u(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=oe.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Ha.toUpperCase()}get NamedCurve(){return A5(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new De(ye.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await qr.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new Jc,this.PublicKey.X=zt.FromString(t.x||"","base64url"),this.PublicKey.Y=zt.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new S0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new w0),this.DomainParameters.NamedCurve.Uri=A5(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=zt.ToBase64Url(this.PublicKey.X),n=zt.ToBase64Url(this.PublicKey.Y),s=gJ(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await qr.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};Oe([Nt({parser:S0}),ze("design:type",S0)],A0.prototype,"DomainParameters",void 0);Oe([Nt({parser:Jc,required:!0}),ze("design:type",Jc)],A0.prototype,"PublicKey",void 0);A0=Oe([yt({localName:oe.ElementNames.ECDSAKeyValue,namespaceURI:C0,prefix:x0})],A0);function A5(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 De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve")}u(A5,"GetNamedCurveOid");function gJ(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 De(ye.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}u(gJ,"GetNamedCurveFromOid");var yJ=class extends Map{static{u(this,"KeyInfoClauseRegistry")}},ju=new yJ;ju.set(oe.ElementNames.RSAKeyValue,h0);ju.set(oe.ElementNames.ECDSAKeyValue,A0);var qS=class{static{u(this,"KeyInfoClauseFactory")}static create(e){let t=ju.get(e);if(!t)throw new De(ye.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var ay=class extends ys{static{u(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 ju)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new De(ye.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new De(ye.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(ps(n))try{let s=n.localName,i=qS.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new De(ye.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};ay=Oe([yt({localName:oe.ElementNames.KeyValue}),ze("design:paramtypes",[ys])],ay);var vJ={"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{u(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 qr.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()===Ha){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=vJ[i.toString()],o=a?a.short:null;n.push(`${o||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Ar(this.raw.buffer);this.simpl=new Dn({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var HS=class extends Sr{static{u(this,"X509IssuerSerial")}};Oe([Nt({localName:oe.ElementNames.X509IssuerName,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509IssuerName",void 0);Oe([Nt({localName:oe.ElementNames.X509SerialNumber,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0}),ze("design:type",String)],HS.prototype,"X509SerialNumber",void 0);HS=Oe([yt({localName:oe.ElementNames.X509IssuerSerial})],HS);var Yc;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(Yc||(Yc={}));var N0=class extends ys{static{u(this,"KeyInfoX509Data")}constructor(e,t=Yc.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 Yc.None:case Yc.EndCertOnly:this.AddCertificate(e);break;case Yc.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case Yc.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new De(ye.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new De(ye.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 De(ye.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new De(ye.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=zt.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(oe.NamespaceURI,n+oe.ElementNames.X509IssuerSerial),a=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let o=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SerialNumber);o.textContent=s.serialNumber,i.appendChild(o),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SKI);i.textContent=zt.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509Certificate);i.textContent=zt.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(oe.NamespaceURI,n+oe.ElementNames.X509CRL);s.textContent=zt.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(oe.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Sr.GetChild(s,oe.ElementNames.X509IssuerName,oe.NamespaceURI,!0),a=Sr.GetChild(s,oe.ElementNames.X509SerialNumber,oe.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(oe.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(oe.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(oe.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=zt.FromBase64(s.textContent);this.AddCertificate(new b0(i))}});let n=this.GetChild(oe.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=zt.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};N0=Oe([yt({localName:oe.ElementNames.X509Data}),ze("design:paramtypes",[Object,Object])],N0);var oy=class extends ys{static{u(this,"SPKIData")}async importKey(e){let t=await qr.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 qr.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};Oe([Nt({localName:oe.ElementNames.SPKIexp,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os}),ze("design:type",Object)],oy.prototype,"SPKIexp",void 0);oy=Oe([yt({localName:oe.ElementNames.SPKIData})],oy);var Qc=class extends Ms{static{u(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==gt.Element)continue;let s=null;switch(n.localName){case oe.ElementNames.KeyValue:s=ay;break;case oe.ElementNames.X509Data:s=N0;break;case oe.ElementNames.SPKIData:s=oy;break;case oe.ElementNames.KeyName:case oe.ElementNames.RetrievalMethod:case oe.ElementNames.PGPData:case oe.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],Qc.prototype,"Id",void 0);Qc=Oe([yt({localName:oe.ElementNames.KeyInfo})],Qc);var qu=class extends Sr{static{u(this,"Signature")}};Oe([pr({localName:oe.AttributeNames.Id,defaultValue:""}),ze("design:type",String)],qu.prototype,"Id",void 0);Oe([Nt({parser:$a,required:!0}),ze("design:type",$a)],qu.prototype,"SignedInfo",void 0);Oe([Nt({localName:oe.ElementNames.SignatureValue,namespaceURI:oe.NamespaceURI,prefix:oe.DefaultPrefix,required:!0,converter:Os,defaultValue:null}),ze("design:type",Object)],qu.prototype,"SignatureValue",void 0);Oe([Nt({parser:Qc}),ze("design:type",Qc)],qu.prototype,"KeyInfo",void 0);Oe([Nt({parser:sy,noRoot:!0}),ze("design:type",sy)],qu.prototype,"ObjectList",void 0);qu=Oe([yt({localName:oe.ElementNames.Signature})],qu);var wJ=class extends Map{static{u(this,"AlgorithmRegistry")}},Rt=new wJ;Rt.set(RS,{type:"signature",algorithm:u0});Rt.set(OS,{type:"signature",algorithm:l0});Rt.set(_S,{type:"signature",algorithm:c0});Rt.set(PS,{type:"signature",algorithm:f0});Rt.set(RS,{type:"signature",algorithm:u0});Rt.set(OS,{type:"signature",algorithm:l0});Rt.set(_S,{type:"signature",algorithm:c0});Rt.set(PS,{type:"signature",algorithm:f0});Rt.set(MT,{type:"signature",algorithm:LS});Rt.set(jT,{type:"signature",algorithm:VS});Rt.set(qT,{type:"signature",algorithm:FS});Rt.set(HT,{type:"signature",algorithm:US});Rt.set(KT,{type:"signature",algorithm:MS});Rt.set(bS,{type:"signature",algorithm:n0});Rt.set(NS,{type:"signature",algorithm:s0});Rt.set(TS,{type:"signature",algorithm:i0});Rt.set(IS,{type:"signature",algorithm:a0});Rt.set(bS.toUpperCase(),{type:"signature",algorithm:n0});Rt.set(NS.toUpperCase(),{type:"signature",algorithm:s0});Rt.set(TS.toUpperCase(),{type:"signature",algorithm:i0});Rt.set(IS.toUpperCase(),{type:"signature",algorithm:a0});Rt.set(PT,{type:"signature",algorithm:ey});Rt.set(kT,{type:"signature",algorithm:ty});Rt.set(LT,{type:"signature",algorithm:ry});Rt.set(VT,{type:"signature",algorithm:ny});Rt.set(Zp,{type:"hash",algorithm:AS});Rt.set(e0,{type:"hash",algorithm:Z1});Rt.set(t0,{type:"hash",algorithm:CS});Rt.set(r0,{type:"hash",algorithm:xS});var Zc=class{static{u(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="hash"&&t===e)return new s;throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of Rt)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of Rt)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new De(ye.ALGORITHM_NOT_SUPPORTED,e.name)}};var SJ=class extends Map{static{u(this,"TransformRegistry")}},Wa=new SJ;Wa.set(oe.AlgorithmNamespaces.XmlDsigBase64Transform,Xa);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NTransform,$i);Wa.set(oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Wi);Wa.set(oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,Ga);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NTransform,zi);Wa.set(oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,Ji);var iy=class{static{u(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new De(ye.PARAM_REQUIRED,"name");let t=Wa.get(e);if(t)return new t;let n;switch(e){case oe.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Xa;break;case oe.AlgorithmNamespaces.XmlDsigC14NTransform:n=new $i;break;case oe.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Wi;break;case oe.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new Ga;break;case oe.AlgorithmNamespaces.XmlDsigXPathTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigXsltTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);case oe.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new zi;break;case oe.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new Ji;break;case oe.AlgorithmNamespaces.XmlDecryptionTransform:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e);default:throw new De(ye.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return Zc.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return Zc.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return Zc.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}),Zc.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Gi;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){Rt.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){Rt.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){ju.set(e,t)}static RegisterTransform(e,t){Wa.set(e,t)}};var sf=Ty(RL(),1);var OL={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var _L={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var PL=class{static{u(this,"Xml2JsToolkit")}xml2js;constructor(e=mQ){this.xml2js=e,j4({XMLSerializer:sf.default.XMLSerializer,DOMParser:sf.default.DOMParser,DOMImplementation:sf.default.DOMImplementation})}async validate(e,t){if(!e||e.trim().length===0)return rr(new Mt("Please provide a valid xml content"));if(!t||t.trim().length===0)return rr(new Mt("Please provide a valid existing xsd path"));try{return await pP.validate(e,t),Hr()}catch(n){return cs(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({..._L,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...OL,...t}).buildObject(e))}digest(e,t,n=W0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=W0){let n=new sf.default.DOMParser().parseFromString(this.clear(e),"application/xml");return new Xi(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let n=this.parseXml(e),i=this.getDocumentElement(n).getElementsByTagName(t).item(0);return i?this.clear(this.serializeXml(i)):null}getFirstNode(e){let t=this.parseXml(e),s=this.getDocumentElement(t).firstChild;return s?this.clear(this.serializeXml(s)):null}getAttribute(e,t){let n=this.parseXml(e);return this.getDocumentElement(n).getAttribute(t)}appendNode(e,t){let n=this.parseXml(e),s=this.getDocumentElement(n),i=this.getDocumentElement(this.parseXml(t));return s.appendChild(i),this.clear(this.serializeXml(n))}insertBefore(e,t,n){let s=this.parseXml(e),a=this.getDocumentElement(s).getElementsByTagName(t).item(0);if(!a?.parentNode)throw new Mt(`No element found with tag "${t}" to insert before`);let o=this.getDocumentElement(this.parseXml(n));return a.parentNode.insertBefore(o,a),this.clear(this.serializeXml(s))}hash(e,t){return dQ.createHash(t).update(e,"utf8").digest().toString("base64")}parseXml(e){return new sf.default.DOMParser().parseFromString(e,"application/xml")}getDocumentElement(e){if(!e.documentElement)throw new Mt("Invalid xml provided. Missing root element.");return e.documentElement}serializeXml(e){return new sf.default.XMLSerializer().serializeToString(e)}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
96
+ `,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};import{registerDecorator as gQ}from"class-validator";var kL=u(r=>(e,t)=>{gQ({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof pf?!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 LL}from"class-validator";var X0=Symbol("choice"),G0=u(r=>r==null||r==="","isEmpty"),gme=u(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(X0,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(X0,i,e);for(let o of t)LL({name:"choice",target:e,propertyName:o,options:s,validator:{validate(l,c){let f=c.object,p=c.property,d=Reflect.getMetadata(X0,e);if(!d)return!0;let g=d.find(m=>m.properties.includes(p));if(!g||G0(l))return!0;for(let m of g.properties){if(m===p)continue;let v=f[m];if(!G0(v))return!1}for(let m of d)if(m!==g)for(let v of m.properties){let y=f[v];if(!G0(y))return!1}return!0},defaultMessage(l){let c=Reflect.getMetadata(X0,e);if(!c)return`${l.property} validation error`;let f=c.find(d=>d.properties.includes(l.property));if(!f)return`${l.property} validation error`;let p=l.object;for(let d of f.properties){let g=p[d];if(!G0(g)&&d!==l.property)return`${l.property} cannot be set because ${d} is already set. Only one property from this choice group is allowed.`}for(let d of c)if(d!==f)for(let g of d.properties){let m=p[g];if(!G0(m))return`${l.property} cannot be set because ${g} from a different choice group is already set.`}return`${l.property} validation error`}}});if(n)for(let o of t)LL({name:"choiceGroupRequired",target:e,propertyName:o,options:{...s,always:!0},validator:{validate(l,c){let f=c.object,p=Reflect.getMetadata(X0,e);if(!p)return!0;let d=p.find(g=>g.properties.includes(c.property));if(!d?.required)return!0;for(let g of d.properties){let m=f[g];if(!G0(m))return!0}return c.property!==d.properties[0]},defaultMessage(l){let c=Reflect.getMetadata(X0,e);if(!c)return"At least one property from a choice group must be provided";let f=c.find(p=>p.properties.includes(l.property));return f?`You must provide a value for one of the following properties: ${f.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as yQ}from"class-transformer";var Cme=u(({fixed:r,...e}={fixed:2})=>(t,n)=>{kL(e)(t,n),yQ(({value:s})=>pf.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as vQ}from"class-transformer";import{IsDateString as EQ}from"class-validator";var Dme=u((r={})=>(e,t)=>{vQ(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?dd(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),EQ()(e,t)},"TransformDateString");var VL=class{static{u(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],l=n.reduce((m,v,y)=>m+v*a[y],0)%11,c=l===0||l===1?0:11-l,f=[5,4,3,2,9,8,7,6,5,4,3,2],d=[...n,c].reduce((m,v,y)=>m+v*f[y],0)%11,g=d===0||d===1?0:11-d;return s===c&&i===g}};var FL=class{static{u(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 l=0;l<8;l++)s+=parseInt(t[l],10)*n[l];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var UL=class{static{u(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 ML=class{static{u(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 o=[9,8,7,6,5,4,3,2],l=i;for(let p=0;p<8;p++)l+=parseInt(t[p],10)*o[p];let f=11-l%11;return f===10?f=0:f===11&&(f=a),f===parseInt(t[8],10)}};var jL=class{static{u(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(v=>parseInt(v,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 v=0;v<i.length;v++)a+=n[v]*i[v];let o=a%s,l=s-o;(s===11&&o<=1||s===10&&o===0)&&(l=0);let f=(t.slice(0,t.length-2)+l.toString()).split("").map(v=>parseInt(v,10)),p=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],d=0;for(let v=0;v<p.length;v++)d+=f[v]*p[v];let g=d%s,m=s-g;return(s===11&&g<=1||s===10&&g===0)&&(m=0),m===n[t.length-2]&&l===n[t.length-1]}};var qL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var HL=class{static{u(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 p=10,d=0;p>=0;p--,d=(d+1)%i.length)a+=n[p]*i[d];let o=11-a%11;(o===10||o===11)&&(o=0);let l=n.concat([o]),c=0;for(let p=11,d=0;p>=0;p--,d=(d+1)%i.length)c+=l[p]*i[d];let f=11-c%11;return(f===10||f===11)&&(f=0),o===s[0]&&f===s[1]}};var KL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var XL=class{static{u(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 l=0;l<8;l++)i+=parseInt(t[l],10)*s[l];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var GL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var $L=class{static{u(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 g=0;g<12;g++){let m=g%2===0?1:2,v=(parseInt(s[g])*m).toString();i+=v.split("").reduce((y,S)=>y+parseInt(S),0)}let o=Math.ceil(i/10)*10-i,l=n+o.toString(),c=[3,2,11,10,9,8,7,6,5,4,3,2],f=0;for(let g=0;g<12;g++)f+=parseInt(l[g])*c[g];let p=f%11,d=p<2?0:11-p;return parseInt(t[11])===o&&parseInt(t[12])===d}};var WL=class{static{u(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 l=0;l<8;l++)s+=parseInt(t[l],10)*n[l];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var zL=class{static{u(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 o=0;o<10;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var JL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var YL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var QL=class{static{u(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 g=0;g<7;g++)i+=n[g]*s[g];let a=i%11,o=a===0||a===1?0:11-a,l=[...n,o],c=[9,8,7,6,5,4,3,2],f=0;for(let g=0;g<8;g++)f+=l[g]*c[g];let p=f%11,d=p===0||p===1?0:11-p;return o===parseInt(t[7])&&d===parseInt(t[8])}};var ZL=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var eV=class{static{u(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 p=0;p<8;p++)a+=n[p]*s[p];let o=11-a%11;o>=10&&(o=0);let l=[...n,o],c=0;for(let p=0;p<9;p++)c+=l[p]*i[p];let f=11-c%11;return f>=10&&(f=0),o===parseInt(t[8])&&f===parseInt(t[9])}};var tV=class{static{u(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 o=0;o<7;o++)s+=parseInt(t[o],10)*n[o];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var rV=class{static{u(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 c=0;c<n.length;c++)i+=s[c]*n[c];let o=i*10%11;return(o===10?0:o)===parseInt(t[t.length-1])}};var nV=class{static{u(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 l=0;l<s.length;l++)i+=n[l]*s[l];let o=11-i%11;return(o===10||o===11)&&(o-=10),o===parseInt(t[t.length-1])}};var sV=class{static{u(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 iV=class{static{u(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 aV=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o],10)*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var oV=class{static{u(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 o=0;o<8;o++)s+=parseInt(t[o])*n[o];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var uV=class{static{u(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 f=0;f<8;f++)i+=n[f]*s[f];let a=i%11%10,o=[3,2,10,9,8,7,6,5,4,3,2],l=0;for(let f=0;f<11;f++)l+=n[f]*o[f];let c=l%11%10;return a===n[8]&&c===n[11]}};var lV=class{static{u(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 c=0;c<i.length;c++)a+=s[c]*i[c];let o=a%11;return(o<2?0:11-o)===parseInt(t[10])}};export{yo as ASN1,mI as CanonicalizationMethod,gme as Choice,pf as Decimal,fA as DigestAlgorithm,yI as EntitySigner,CQ as Environment,kL as IsDecimal,VI as MemoryCacheAdapter,Mt as NFeTsError,lR as NativeCertificateRepository,vv as NullCacheAdapter,LI as PdfkitPdfBuilder,eo as SignatureAlgorithm,cA as SignatureMethod,lA as SignatureNamespace,lf as Signer,SZ as SkipAllValidations,wZ as SkipValidation,z0 as SkipValidationMetadata,fP as SoapRemoteTransmissionRepository,SQ as StateAcronyms,VL as StateCodeAcValidator,FL as StateCodeAlValidator,UL as StateCodeAmValidator,ML as StateCodeApValidator,jL as StateCodeBaValidator,qL as StateCodeCeValidator,HL as StateCodeDfValidator,KL as StateCodeEsValidator,XL as StateCodeGoValidator,GL as StateCodeMaValidator,$L as StateCodeMgValidator,WL as StateCodeMsValidator,zL as StateCodeMtValidator,JL as StateCodePaValidator,YL as StateCodePbValidator,QL as StateCodePeValidator,ZL as StateCodePiValidator,eV as StateCodePrValidator,tV as StateCodeRjValidator,rV as StateCodeRnValidator,nV as StateCodeRoValidator,sV as StateCodeRrValidator,iV as StateCodeRsValidator,aV as StateCodeScValidator,oV as StateCodeSeValidator,uV as StateCodeSpValidator,lV as StateCodeToValidator,Qt as StateCodes,Dme as TransformDateString,Cme as TransformDecimal,Dy as TransmissionError,$0 as TransmissionHostNotFoundError,uf as TransmissionTimeoutError,wI as ValidateErrorsMetadata,RZ as Validates,gI as ValidationError,PL as Xml2JsToolkit,vI as XmlSigner,Ry as clearEmptyValues,SI as mapConstraintsToErrors,EI as plainToInstance};
97
+ /*! Bundled license information:
98
+
99
+ axios/dist/node/axios.cjs:
100
+ (*! Axios v1.15.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
101
+
102
+ js-md4/src/md4.js:
103
+ (**
104
+ * [js-md4]{@link https://github.com/emn178/js-md4}
105
+ *
106
+ * @namespace md4
107
+ * @version 0.3.2
108
+ * @author Yi-Cyuan Chen [emn178@gmail.com]
109
+ * @copyright Yi-Cyuan Chen 2015-2027
110
+ * @license MIT
111
+ *)
112
+
113
+ sax/lib/sax.js:
114
+ sax/lib/sax.js:
115
+ (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
116
+
117
+ decimal.js/decimal.mjs:
118
+ (*!
119
+ * decimal.js v10.6.0
120
+ * An arbitrary-precision Decimal type for JavaScript.
121
+ * https://github.com/MikeMcl/decimal.js
122
+ * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
123
+ * MIT Licence
124
+ *)
125
+
126
+ pvtsutils/build/index.es.js:
127
+ (*!
128
+ * MIT License
129
+ *
130
+ * Copyright (c) 2017-2024 Peculiar Ventures, LLC
131
+ *
132
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
133
+ * of this software and associated documentation files (the "Software"), to deal
134
+ * in the Software without restriction, including without limitation the rights
135
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
136
+ * copies of the Software, and to permit persons to whom the Software is
137
+ * furnished to do so, subject to the following conditions:
138
+ *
139
+ * The above copyright notice and this permission notice shall be included in all
140
+ * copies or substantial portions of the Software.
141
+ *
142
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
143
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
144
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
145
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
146
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
147
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
148
+ * SOFTWARE.
149
+ *
150
+ *)
151
+
152
+ pvutils/build/utils.es.js:
153
+ (*!
154
+ Copyright (c) Peculiar Ventures, LLC
155
+ *)
156
+
157
+ asn1js/build/index.es.js:
158
+ (*!
159
+ * Copyright (c) 2014, GMO GlobalSign
160
+ * Copyright (c) 2015-2022, Peculiar Ventures
161
+ * All rights reserved.
162
+ *
163
+ * Author 2014-2019, Yury Strozhevsky
164
+ *
165
+ * Redistribution and use in source and binary forms, with or without modification,
166
+ * are permitted provided that the following conditions are met:
167
+ *
168
+ * * Redistributions of source code must retain the above copyright notice, this
169
+ * list of conditions and the following disclaimer.
170
+ *
171
+ * * Redistributions in binary form must reproduce the above copyright notice, this
172
+ * list of conditions and the following disclaimer in the documentation and/or
173
+ * other materials provided with the distribution.
174
+ *
175
+ * * Neither the name of the copyright holder nor the names of its
176
+ * contributors may be used to endorse or promote products derived from
177
+ * this software without specific prior written permission.
178
+ *
179
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
180
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
181
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
182
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
183
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
184
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
185
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
186
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
187
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
188
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
189
+ *
190
+ *)
191
+
192
+ @noble/hashes/esm/utils.js:
193
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
194
+
195
+ pkijs/build/index.es.js:
196
+ (*!
197
+ * Copyright (c) 2014, GlobalSign
198
+ * Copyright (c) 2015-2019, Peculiar Ventures
199
+ * All rights reserved.
200
+ *
201
+ * Author 2014-2019, Yury Strozhevsky
202
+ *
203
+ * Redistribution and use in source and binary forms, with or without modification,
204
+ * are permitted provided that the following conditions are met:
205
+ *
206
+ * * Redistributions of source code must retain the above copyright notice, this
207
+ * list of conditions and the following disclaimer.
208
+ *
209
+ * * Redistributions in binary form must reproduce the above copyright notice, this
210
+ * list of conditions and the following disclaimer in the documentation and/or
211
+ * other materials provided with the distribution.
212
+ *
213
+ * * Neither the name of the {organization} nor the names of its
214
+ * contributors may be used to endorse or promote products derived from
215
+ * this software without specific prior written permission.
216
+ *
217
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
218
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
219
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
220
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
221
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
222
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
223
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
224
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
225
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
226
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
227
+ *
228
+ *)
229
+ */