nfets 0.0.16 → 0.0.18

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,238 +0,0 @@
1
- import{a as mw,b as bK,c as xK,d as NK}from"./chunk-3WPW27WV.mjs";import{a as o,b as wt,d as ye,f as dw}from"./chunk-W6MRGYXP.mjs";var $t=ye((Kle,kP)=>{"use strict";kP.exports={options:{usePureJavaScript:!1}}});var UP=ye(($le,VP)=>{"use strict";var jb={};VP.exports=jb;var LP={};jb.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=_$(r,e);else{var s=0,i=e.length,a=e.charAt(0),u=[0];for(s=0;s<r.length;++s){for(var l=0,f=r[s];l<u.length;++l)f+=u[l]<<8,u[l]=f%i,f=f/i|0;for(;f>0;)u.push(f%i),f=f/i|0}for(s=0;r[s]===0&&s<r.length-1;++s)n+=a;for(s=u.length-1;s>=0;--s)n+=e[u[s]]}if(t){var h=new RegExp(".{1,"+t+"}","g");n=n.match(h).join(`\r
2
- `)}return n};jb.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=LP[e];if(!t){t=LP[e]=[];for(var n=0;n<e.length;++n)t[e.charCodeAt(n)]=n}r=r.replace(/\s/g,"");for(var s=e.length,i=e.charAt(0),a=[0],n=0;n<r.length;n++){var u=t[r.charCodeAt(n)];if(u===void 0)return;for(var l=0,f=u;l<a.length;++l)f+=a[l]*s,a[l]=f&255,f>>=8;for(;f>0;)a.push(f&255),f>>=8}for(var h=0;r[h]===i&&h<r.length-1;++h)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function _$(r,e){var t=0,n=e.length,s=e.charAt(0),i=[0];for(t=0;t<r.length();++t){for(var a=0,u=r.at(t);a<i.length;++a)u+=i[a]<<8,i[a]=u%n,u=u/n|0;for(;u>0;)i.push(u%n),u=u/n|0}var 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}o(_$,"_encodeWithByteBuffer")});var ur=ye((Gle,qP)=>{"use strict";var MP=$t(),jP=UP(),re=qP.exports=MP.util=MP.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){re.nextTick=process.nextTick,typeof setImmediate=="function"?re.setImmediate=setImmediate:re.setImmediate=re.nextTick;return}if(typeof setImmediate=="function"){re.setImmediate=function(){return setImmediate.apply(void 0,arguments)},re.nextTick=function(u){return setImmediate(u)};return}if(re.setImmediate=function(u){setTimeout(u,0)},typeof window<"u"&&typeof window.postMessage=="function"){let u=function(l){if(l.source===window&&l.data===r){l.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(h){h()})}};var a=u;o(u,"handler");var r="forge.setImmediate",e=[];re.setImmediate=function(l){e.push(l),e.length===1&&window.postMessage(r,"*")},window.addEventListener("message",u,!0)}if(typeof MutationObserver<"u"){var t=Date.now(),n=!0,s=document.createElement("div"),e=[];new MutationObserver(function(){var l=e.slice();e.length=0,l.forEach(function(f){f()})}).observe(s,{attributes:!0});var i=re.setImmediate;re.setImmediate=function(l){Date.now()-t>15?(t=Date.now(),i(l)):(e.push(l),e.length===1&&s.setAttribute("a",n=!n))}}re.nextTick=re.setImmediate})();re.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;re.globalScope=(function(){return re.isNodejs?global:typeof self>"u"?window:self})();re.isArray=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};re.isArrayBuffer=function(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer};re.isArrayBufferView=function(r){return r&&re.isArrayBuffer(r.buffer)&&r.byteLength!==void 0};function vm(r){if(!(r===8||r===16||r===24||r===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+r)}o(vm,"_checkBitsParam");re.ByteBuffer=Fb;function Fb(r){if(this.data="",this.read=0,typeof r=="string")this.data=r;else if(re.isArrayBuffer(r)||re.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 Fb||typeof r=="object"&&typeof r.data=="string"&&typeof r.read=="number")&&(this.data=r.data,this.read=r.read);this._constructedStringLength=0}o(Fb,"ByteStringBuffer");re.ByteStringBuffer=Fb;var R$=4096;re.ByteStringBuffer.prototype._optimizeConstructedString=function(r){this._constructedStringLength+=r,this._constructedStringLength>R$&&(this.data.substr(0,1),this._constructedStringLength=0)};re.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};re.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};re.ByteStringBuffer.prototype.putByte=function(r){return this.putBytes(String.fromCharCode(r))};re.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};re.ByteStringBuffer.prototype.putBytes=function(r){return this.data+=r,this._optimizeConstructedString(r.length),this};re.ByteStringBuffer.prototype.putString=function(r){return this.putBytes(re.encodeUtf8(r))};re.ByteStringBuffer.prototype.putInt16=function(r){return this.putBytes(String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};re.ByteStringBuffer.prototype.putInt24=function(r){return this.putBytes(String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};re.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))};re.ByteStringBuffer.prototype.putInt16Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255))};re.ByteStringBuffer.prototype.putInt24Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255))};re.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))};re.ByteStringBuffer.prototype.putInt=function(r,e){vm(e);var t="";do e-=8,t+=String.fromCharCode(r>>e&255);while(e>0);return this.putBytes(t)};re.ByteStringBuffer.prototype.putSignedInt=function(r,e){return r<0&&(r+=2<<e-1),this.putInt(r,e)};re.ByteStringBuffer.prototype.putBuffer=function(r){return this.putBytes(r.getBytes())};re.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};re.ByteStringBuffer.prototype.getInt16=function(){var r=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,r};re.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};re.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};re.ByteStringBuffer.prototype.getInt16Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,r};re.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};re.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};re.ByteStringBuffer.prototype.getInt=function(r){vm(r);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),r-=8;while(r>0);return e};re.ByteStringBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};re.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};re.ByteStringBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};re.ByteStringBuffer.prototype.at=function(r){return this.data.charCodeAt(this.read+r)};re.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};re.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};re.ByteStringBuffer.prototype.copy=function(){var r=re.createBuffer(this.data);return r.read=this.read,r};re.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};re.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};re.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};re.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};re.ByteStringBuffer.prototype.toString=function(){return re.decodeUtf8(this.bytes())};function P$(r,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var t=re.isArrayBuffer(r),n=re.isArrayBufferView(r);if(t||n){t?this.data=new DataView(r):this.data=new DataView(r.buffer,r.byteOffset,r.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,r!=null&&this.putBytes(r),"writeOffset"in e&&(this.write=e.writeOffset)}o(P$,"DataBuffer");re.DataBuffer=P$;re.DataBuffer.prototype.length=function(){return this.write-this.read};re.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};re.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};re.DataBuffer.prototype.putByte=function(r){return this.accommodate(1),this.data.setUint8(this.write++,r),this};re.DataBuffer.prototype.fillWithByte=function(r,e){this.accommodate(e);for(var t=0;t<e;++t)this.data.setUint8(r);return this};re.DataBuffer.prototype.putBytes=function(r,e){if(re.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(re.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 re.DataBuffer||typeof r=="object"&&typeof r.read=="number"&&typeof r.write=="number"&&re.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 re.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+=re.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+=re.binary.base64.decode(r,i,this.write),this;if(e==="utf8"&&(r=re.encodeUtf8(r),e="binary"),e==="binary"||e==="raw")return this.accommodate(r.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=re.binary.raw.decode(i),this;if(e==="utf16")return this.accommodate(r.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=re.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+r)};re.DataBuffer.prototype.putBuffer=function(r){return this.putBytes(r),r.clear(),this};re.DataBuffer.prototype.putString=function(r){return this.putBytes(r,"utf16")};re.DataBuffer.prototype.putInt16=function(r){return this.accommodate(2),this.data.setInt16(this.write,r),this.write+=2,this};re.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};re.DataBuffer.prototype.putInt32=function(r){return this.accommodate(4),this.data.setInt32(this.write,r),this.write+=4,this};re.DataBuffer.prototype.putInt16Le=function(r){return this.accommodate(2),this.data.setInt16(this.write,r,!0),this.write+=2,this};re.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};re.DataBuffer.prototype.putInt32Le=function(r){return this.accommodate(4),this.data.setInt32(this.write,r,!0),this.write+=4,this};re.DataBuffer.prototype.putInt=function(r,e){vm(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,r>>e&255);while(e>0);return this};re.DataBuffer.prototype.putSignedInt=function(r,e){return vm(e),this.accommodate(e/8),r<0&&(r+=2<<e-1),this.putInt(r,e)};re.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};re.DataBuffer.prototype.getInt16=function(){var r=this.data.getInt16(this.read);return this.read+=2,r};re.DataBuffer.prototype.getInt24=function(){var r=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,r};re.DataBuffer.prototype.getInt32=function(){var r=this.data.getInt32(this.read);return this.read+=4,r};re.DataBuffer.prototype.getInt16Le=function(){var r=this.data.getInt16(this.read,!0);return this.read+=2,r};re.DataBuffer.prototype.getInt24Le=function(){var r=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,r};re.DataBuffer.prototype.getInt32Le=function(){var r=this.data.getInt32(this.read,!0);return this.read+=4,r};re.DataBuffer.prototype.getInt=function(r){vm(r);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),r-=8;while(r>0);return e};re.DataBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};re.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};re.DataBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};re.DataBuffer.prototype.at=function(r){return this.data.getUint8(this.read+r)};re.DataBuffer.prototype.setAt=function(r,e){return this.data.setUint8(r,e),this};re.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};re.DataBuffer.prototype.copy=function(){return new re.DataBuffer(this)};re.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};re.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};re.DataBuffer.prototype.truncate=function(r){return this.write=Math.max(0,this.length()-r),this.read=Math.min(this.read,this.write),this};re.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};re.DataBuffer.prototype.toString=function(r){var e=new Uint8Array(this.data,this.read,this.length());if(r=r||"utf8",r==="binary"||r==="raw")return re.binary.raw.encode(e);if(r==="hex")return re.binary.hex.encode(e);if(r==="base64")return re.binary.base64.encode(e);if(r==="utf8")return re.text.utf8.decode(e);if(r==="utf16")return re.text.utf16.decode(e);throw new Error("Invalid encoding: "+r)};re.createBuffer=function(r,e){return e=e||"raw",r!==void 0&&e==="utf8"&&(r=re.encodeUtf8(r)),new re.ByteBuffer(r)};re.fillString=function(r,e){for(var t="";e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return t};re.xorBytes=function(r,e,t){for(var n="",s="",i="",a=0,u=0;t>0;--t,++a)s=r.charCodeAt(a)^e.charCodeAt(a),u>=10&&(n+=i,i="",u=0),i+=String.fromCharCode(s),++u;return n+=i,n};re.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};re.bytesToHex=function(r){return re.createBuffer(r).toHex()};re.int32ToBytes=function(r){return String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255)};var yu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",vu=[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],FP="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";re.encode64=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.length;)s=r.charCodeAt(u++),i=r.charCodeAt(u++),a=r.charCodeAt(u++),t+=yu.charAt(s>>2),t+=yu.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=yu.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":yu.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
3
- `,t=t.substr(e));return n+=t,n};re.decode64=function(r){r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",t,n,s,i,a=0;a<r.length;)t=vu[r.charCodeAt(a++)-43],n=vu[r.charCodeAt(a++)-43],s=vu[r.charCodeAt(a++)-43],i=vu[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};re.encodeUtf8=function(r){return unescape(encodeURIComponent(r))};re.decodeUtf8=function(r){return decodeURIComponent(escape(r))};re.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:jP.encode,decode:jP.decode}};re.binary.raw.encode=function(r){return String.fromCharCode.apply(null,r)};re.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};re.binary.hex.encode=re.bytesToHex;re.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};re.binary.base64.encode=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.byteLength;)s=r[u++],i=r[u++],a=r[u++],t+=yu.charAt(s>>2),t+=yu.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=yu.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":yu.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
4
- `,t=t.substr(e));return n+=t,n};re.binary.base64.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/4)*3)),r=r.replace(/[^A-Za-z0-9\+\/\=]/g,""),t=t||0;for(var s,i,a,u,l=0,f=t;l<r.length;)s=vu[r.charCodeAt(l++)-43],i=vu[r.charCodeAt(l++)-43],a=vu[r.charCodeAt(l++)-43],u=vu[r.charCodeAt(l++)-43],n[f++]=s<<2|i>>4,a!==64&&(n[f++]=(i&15)<<4|a>>2,u!==64&&(n[f++]=(a&3)<<6|u));return e?f-t:n.subarray(0,f)};re.binary.base58.encode=function(r,e){return re.binary.baseN.encode(r,FP,e)};re.binary.base58.decode=function(r,e){return re.binary.baseN.decode(r,FP,e)};re.text={utf8:{},utf16:{}};re.text.utf8.encode=function(r,e,t){r=re.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};re.text.utf8.decode=function(r){return re.decodeUtf8(String.fromCharCode.apply(null,r))};re.text.utf16.encode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length*2));var s=new Uint16Array(n.buffer);t=t||0;for(var i=t,a=t,u=0;u<r.length;++u)s[a++]=r.charCodeAt(u),i+=2;return e?i-t:n};re.text.utf16.decode=function(r){return String.fromCharCode.apply(null,new Uint16Array(r.buffer))};re.deflate=function(r,e,t){if(e=re.decode64(r.deflate(re.encode64(e)).rval),t){var n=2,s=e.charCodeAt(1);s&32&&(n=6),e=e.substring(n,e.length-4)}return e};re.inflate=function(r,e,t){var n=r.inflate(re.encode64(e)).rval;return n===null?null:re.decode64(n)};var qb=o(function(r,e,t){if(!r)throw new Error("WebStorage not available.");var n;if(t===null?n=r.removeItem(e):(t=re.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"),Hb=o(function(r,e){if(!r)throw new Error("WebStorage not available.");var t=r.getItem(e);if(r.init)if(t.rval===null){if(t.error){var n=new Error(t.error.message);throw n.id=t.error.id,n.name=t.error.name,n}t=null}else t=t.rval;return t!==null&&(t=JSON.parse(re.decode64(t))),t},"_getStorageObject"),O$=o(function(r,e,t,n){var s=Hb(r,e);s===null&&(s={}),s[t]=n,qb(r,e,s)},"_setItem"),k$=o(function(r,e,t){var n=Hb(r,e);return n!==null&&(n=t in n?n[t]:null),n},"_getItem"),L$=o(function(r,e,t){var n=Hb(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),qb(r,e,n)}},"_removeItem"),V$=o(function(r,e){qb(r,e,null)},"_clearItems"),Nw=o(function(r,e,t){var n=null;typeof t>"u"&&(t=["web","flash"]);var s,i=!1,a=null;for(var u in t){s=t[u];try{if(s==="flash"||s==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=r.apply(this,e),i=s==="flash"}(s==="web"||s==="both")&&(e[0]=localStorage,n=r.apply(this,e),i=!0)}catch(l){a=l}if(i)break}if(!i)throw a;return n},"_callStorageFunction");re.setItem=function(r,e,t,n,s){Nw(O$,arguments,s)};re.getItem=function(r,e,t,n){return Nw(k$,arguments,n)};re.removeItem=function(r,e,t,n){Nw(L$,arguments,n)};re.clearItems=function(r,e,t){Nw(V$,arguments,t)};re.isEmpty=function(r){for(var e in r)if(r.hasOwnProperty(e))return!1;return!0};re.format=function(r){for(var e=/%./g,t,n,s=0,i=[],a=0;t=e.exec(r);){n=r.substring(a,e.lastIndex-2),n.length>0&&i.push(n),a=e.lastIndex;var u=t[0][1];switch(u){case"s":case"o":s<arguments.length?i.push(arguments[s+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+u+"?>")}}return i.push(r.substring(a)),i.join("")};re.formatNumber=function(r,e,t,n){var s=r,i=isNaN(e=Math.abs(e))?2:e,a=t===void 0?",":t,u=n===void 0?".":n,l=s<0?"-":"",f=parseInt(s=Math.abs(+s||0).toFixed(i),10)+"",h=f.length>3?f.length%3:0;return l+(h?f.substr(0,h)+u:"")+f.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+u)+(i?a+Math.abs(s-f).toFixed(i).slice(2):"")};re.formatSize=function(r){return r>=1073741824?r=re.formatNumber(r/1073741824,2,".","")+" GiB":r>=1048576?r=re.formatNumber(r/1048576,2,".","")+" MiB":r>=1024?r=re.formatNumber(r/1024,0)+" KiB":r=re.formatNumber(r,0)+" bytes",r};re.bytesFromIP=function(r){return r.indexOf(".")!==-1?re.bytesFromIPv4(r):r.indexOf(":")!==-1?re.bytesFromIPv6(r):null};re.bytesFromIPv4=function(r){if(r=r.split("."),r.length!==4)return null;for(var e=re.createBuffer(),t=0;t<r.length;++t){var n=parseInt(r[t],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};re.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=re.createBuffer(),s=0;s<8;++s){if(!r[s]||r[s].length===0){n.fillWithByte(0,t),t=0;continue}var i=re.hexToBytes(r[s]);i.length<2&&n.putByte(0),n.putBytes(i)}return n.getBytes()};re.bytesToIP=function(r){return r.length===4?re.bytesToIPv4(r):r.length===16?re.bytesToIPv6(r):null};re.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(".")};re.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=re.bytesToHex(r[s]+r[s+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var a=t[t.length-1],u=e.length;!a||u!==a.end+1?t.push({start:u,end:u}):(a.end=u,a.end-a.start>t[n].end-t[n].start&&(n=t.length-1))}e.push(i)}if(t.length>0){var 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(":")};re.estimateCores=function(r,e){if(typeof r=="function"&&(e=r,r={}),r=r||{},"cores"in re&&!r.update)return e(null,re.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return re.cores=navigator.hardwareConcurrency,e(null,re.cores);if(typeof Worker>"u")return re.cores=1,e(null,re.cores);if(typeof Blob>"u")return re.cores=2,e(null,re.cores);var t=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(a){for(var u=Date.now(),l=u+4;Date.now()<l;);self.postMessage({st:u,et:l})})}).toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(a,u,l){if(u===0){var f=Math.floor(a.reduce(function(h,m){return h+m},0)/a.length);return re.cores=Math.max(1,f),URL.revokeObjectURL(t),e(null,re.cores)}s(l,function(h,m){a.push(i(l,m)),n(a,u-1,l)})}o(n,"sample");function s(a,u){for(var l=[],f=[],h=0;h<a;++h){var m=new Worker(t);m.addEventListener("message",function(g){if(f.push(g.data),f.length===a){for(var w=0;w<a;++w)l[w].terminate();u(null,f)}}),l.push(m)}for(var h=0;h<a;++h)l[h].postMessage(h)}o(s,"map");function i(a,u){for(var l=[],f=0;f<a;++f)for(var h=u[f],m=l[f]=[],g=0;g<a;++g)if(f!==g){var w=u[g];(h.st>w.st&&h.st<w.et||w.st>h.st&&w.st<h.et)&&m.push(g)}return l.reduce(function(y,S){return Math.max(y,S.length)},0)}o(i,"reduce")}});var Tw=ye((Jle,HP)=>{"use strict";var Cn=$t();ur();HP.exports=Cn.cipher=Cn.cipher||{};Cn.cipher.algorithms=Cn.cipher.algorithms||{};Cn.cipher.createCipher=function(r,e){var t=r;if(typeof t=="string"&&(t=Cn.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new Cn.cipher.BlockCipher({algorithm:t,key:e,decrypt:!1})};Cn.cipher.createDecipher=function(r,e){var t=r;if(typeof t=="string"&&(t=Cn.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new Cn.cipher.BlockCipher({algorithm:t,key:e,decrypt:!0})};Cn.cipher.registerAlgorithm=function(r,e){r=r.toUpperCase(),Cn.cipher.algorithms[r]=e};Cn.cipher.getAlgorithm=function(r){return r=r.toUpperCase(),r in Cn.cipher.algorithms?Cn.cipher.algorithms[r]:null};var Kb=Cn.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)};Kb.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=Cn.util.createBuffer(),this.output=r.output||Cn.util.createBuffer(),this.mode.start(e)};Kb.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()};Kb.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 Xb=ye((zle,KP)=>{"use strict";var bn=$t();ur();bn.cipher=bn.cipher||{};var zt=KP.exports=bn.cipher.modes=bn.cipher.modes||{};zt.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)};zt.ecb.prototype.start=function(r){};zt.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])};zt.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])};zt.ecb.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};zt.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)};zt.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)};zt.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=Iw(r.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};zt.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};zt.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)};zt.cbc.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};zt.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)};zt.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=bn.util.createBuffer(),this._partialBytes=0};zt.cfb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=Iw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.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};zt.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};zt.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=bn.util.createBuffer(),this._partialBytes=0};zt.ofb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=Iw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.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};zt.ofb.prototype.decrypt=zt.ofb.prototype.encrypt;zt.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=bn.util.createBuffer(),this._partialBytes=0};zt.ctr.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=Iw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};zt.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}Bw(this._inBlock)};zt.ctr.prototype.decrypt=zt.ctr.prototype.encrypt;zt.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=bn.util.createBuffer(),this._partialBytes=0,this._R=3774873600};zt.gcm.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");var e=bn.util.createBuffer(r.iv);this._cipherLength=0;var t;if("additionalData"in r?t=bn.util.createBuffer(r.additionalData):t=bn.util.createBuffer(),"tagLength"in r?this._tagLength=r.tagLength:this._tagLength=128,this._tag=null,r.decrypt&&(this._tag=bn.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($b(n*8)))}this._inBlock=this._j0.slice(0),Bw(this._inBlock),this._partialBytes=0,t=bn.util.createBuffer(t),this._aDataLength=$b(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()])};zt.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),Bw(this._inBlock)};zt.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),Bw(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};zt.gcm.prototype.afterFinish=function(r,e){var t=!0;e.decrypt&&e.overflow&&r.truncate(this.blockSize-e.overflow),this.tag=bn.util.createBuffer();var n=this._aDataLength.concat($b(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};zt.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};zt.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)};zt.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};zt.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)};zt.gcm.prototype.generateHashTable=function(r,e){for(var t=8/e,n=4*t,s=16*t,i=new Array(s),a=0;a<s;++a){var u=[0,0,0,0],l=a/n|0,f=(n-1-a%n)*e;u[l]=1<<e-1<<f,i[a]=this.generateSubHashTable(this.multiply(u,r),e)}return i};zt.gcm.prototype.generateSubHashTable=function(r,e){var t=1<<e,n=t>>>1,s=new Array(t);s[n]=r.slice(0);for(var i=n>>>1;i>0;)this.pow(s[2*i],s[i]=[]),i>>=1;for(i=2;i<n;){for(var a=1;a<i;++a){var u=s[i],l=s[a];s[i+a]=[u[0]^l[0],u[1]^l[1],u[2]^l[2],u[3]^l[3]]}i*=2}for(s[0]=[0,0,0,0],i=n+1;i<t;++i){var f=s[i^n];s[i]=[r[0]^f[0],r[1]^f[1],r[2]^f[2],r[3]^f[3]]}return s};function Iw(r,e){if(typeof r=="string"&&(r=bn.util.createBuffer(r)),bn.util.isArray(r)&&r.length>4){var t=r;r=bn.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(!bn.util.isArray(r)){for(var s=[],i=e/4,n=0;n<i;++n)s.push(r.getInt32());r=s}return r}o(Iw,"transformIV");function Bw(r){r[r.length-1]=r[r.length-1]+1&4294967295}o(Bw,"inc32");function $b(r){return[r/4294967296|0,r&4294967295]}o($b,"from64To32")});var wu=ye((Qle,WP)=>{"use strict";var Br=$t();Tw();Xb();ur();WP.exports=Br.aes=Br.aes||{};Br.aes.startEncrypting=function(r,e,t,n){var s=Dw({key:r,output:t,decrypt:!1,mode:n});return s.start(e),s};Br.aes.createEncryptionCipher=function(r,e){return Dw({key:r,output:null,decrypt:!1,mode:e})};Br.aes.startDecrypting=function(r,e,t,n){var s=Dw({key:r,output:t,decrypt:!0,mode:n});return s.start(e),s};Br.aes.createDecryptionCipher=function(r,e){return Dw({key:r,output:null,decrypt:!0,mode:e})};Br.aes.Algorithm=function(r,e){Jb||XP();var t=this;t.name=r,t.mode=new e({blockSize:16,cipher:{encrypt:o(function(n,s){return Wb(t._w,n,s,!1)},"encrypt"),decrypt:o(function(n,s){return Wb(t._w,n,s,!0)},"decrypt")}}),t._init=!1};Br.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=Br.util.createBuffer(e);else if(Br.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){t=e,e=Br.util.createBuffer();for(var n=0;n<t.length;++n)e.putByte(t[n])}if(!Br.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(!Br.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=GP(e,r.decrypt&&!a),this._init=!0}};Br.aes._expandKey=function(r,e){return Jb||XP(),GP(r,e)};Br.aes._updateBlock=Wb;qh("AES-ECB",Br.cipher.modes.ecb);qh("AES-CBC",Br.cipher.modes.cbc);qh("AES-CFB",Br.cipher.modes.cfb);qh("AES-OFB",Br.cipher.modes.ofb);qh("AES-CTR",Br.cipher.modes.ctr);qh("AES-GCM",Br.cipher.modes.gcm);function qh(r,e){var t=o(function(){return new Br.aes.Algorithm(r,e)},"factory");Br.cipher.registerAlgorithm(r,t)}o(qh,"registerAlgorithm");var Jb=!1,Fh=4,ls,Gb,$P,hc,Fi;function XP(){Jb=!0,$P=[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;ls=new Array(256),Gb=new Array(256),hc=new Array(4),Fi=new Array(4);for(var e=0;e<4;++e)hc[e]=new Array(256),Fi[e]=new Array(256);for(var t=0,n=0,s,i,a,u,l,f,h,e=0;e<256;++e){u=n^n<<1^n<<2^n<<3^n<<4,u=u>>8^u&255^99,ls[t]=u,Gb[u]=t,l=r[u],s=r[t],i=r[s],a=r[i],f=l<<24^u<<16^u<<8^(u^l),h=(s^i^a)<<24^(t^a)<<16^(t^i^a)<<8^(t^s^a);for(var m=0;m<4;++m)hc[m][t]=f,Fi[m][u]=h,f=f<<24|f>>>8,h=h<<24|h>>>8;t===0?t=n=1:(t=s^r[r[r[s^a]]],n^=r[r[n]])}}o(XP,"initialize");function GP(r,e){for(var t=r.slice(0),n,s=1,i=t.length,a=i+6+1,u=Fh*a,l=i;l<u;++l)n=t[l-1],l%i===0?(n=ls[n>>>16&255]<<24^ls[n>>>8&255]<<16^ls[n&255]<<8^ls[n>>>24]^$P[s]<<24,s++):i>6&&l%i===4&&(n=ls[n>>>24]<<24^ls[n>>>16&255]<<16^ls[n>>>8&255]<<8^ls[n&255]),t[l]=t[l-i]^n;if(e){var f,h=Fi[0],m=Fi[1],g=Fi[2],w=Fi[3],y=t.slice(0);u=t.length;for(var l=0,S=u-Fh;l<u;l+=Fh,S-=Fh)if(l===0||l===u-Fh)y[l]=t[S],y[l+1]=t[S+3],y[l+2]=t[S+2],y[l+3]=t[S+1];else for(var E=0;E<Fh;++E)f=t[S+E],y[l+(3&-E)]=h[ls[f>>>24]]^m[ls[f>>>16&255]]^g[ls[f>>>8&255]]^w[ls[f&255]];t=y}return t}o(GP,"_expandKey");function Wb(r,e,t,n){var s=r.length/4-1,i,a,u,l,f;n?(i=Fi[0],a=Fi[1],u=Fi[2],l=Fi[3],f=Gb):(i=hc[0],a=hc[1],u=hc[2],l=hc[3],f=ls);var h,m,g,w,y,S,E;h=e[0]^r[0],m=e[n?3:1]^r[1],g=e[2]^r[2],w=e[n?1:3]^r[3];for(var b=3,T=1;T<s;++T)y=i[h>>>24]^a[m>>>16&255]^u[g>>>8&255]^l[w&255]^r[++b],S=i[m>>>24]^a[g>>>16&255]^u[w>>>8&255]^l[h&255]^r[++b],E=i[g>>>24]^a[w>>>16&255]^u[h>>>8&255]^l[m&255]^r[++b],w=i[w>>>24]^a[h>>>16&255]^u[m>>>8&255]^l[g&255]^r[++b],h=y,m=S,g=E;t[0]=f[h>>>24]<<24^f[m>>>16&255]<<16^f[g>>>8&255]<<8^f[w&255]^r[++b],t[n?3:1]=f[m>>>24]<<24^f[g>>>16&255]<<16^f[w>>>8&255]<<8^f[h&255]^r[++b],t[2]=f[g>>>24]<<24^f[w>>>16&255]<<16^f[h>>>8&255]<<8^f[m&255]^r[++b],t[n?1:3]=f[w>>>24]<<24^f[h>>>16&255]<<16^f[m>>>8&255]<<8^f[g&255]^r[++b]}o(Wb,"_updateBlock");function Dw(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="AES-"+e,n;r.decrypt?n=Br.cipher.createDecipher(t,r.key):n=Br.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var u=null;a instanceof Br.util.ByteBuffer&&(u=a,a={}),a=a||{},a.output=u,a.iv=i,s.call(n,a)},n}o(Dw,"_createCipher")});var Su=ye((ece,JP)=>{"use strict";var wm=$t();wm.pki=wm.pki||{};var zb=JP.exports=wm.pki.oids=wm.oids=wm.oids||{};function Ue(r,e){zb[r]=e,zb[e]=r}o(Ue,"_IN");function yr(r,e){zb[r]=e}o(yr,"_I_");Ue("1.2.840.113549.1.1.1","rsaEncryption");Ue("1.2.840.113549.1.1.4","md5WithRSAEncryption");Ue("1.2.840.113549.1.1.5","sha1WithRSAEncryption");Ue("1.2.840.113549.1.1.7","RSAES-OAEP");Ue("1.2.840.113549.1.1.8","mgf1");Ue("1.2.840.113549.1.1.9","pSpecified");Ue("1.2.840.113549.1.1.10","RSASSA-PSS");Ue("1.2.840.113549.1.1.11","sha256WithRSAEncryption");Ue("1.2.840.113549.1.1.12","sha384WithRSAEncryption");Ue("1.2.840.113549.1.1.13","sha512WithRSAEncryption");Ue("1.3.101.112","EdDSA25519");Ue("1.2.840.10040.4.3","dsa-with-sha1");Ue("1.3.14.3.2.7","desCBC");Ue("1.3.14.3.2.26","sha1");Ue("1.3.14.3.2.29","sha1WithRSASignature");Ue("2.16.840.1.101.3.4.2.1","sha256");Ue("2.16.840.1.101.3.4.2.2","sha384");Ue("2.16.840.1.101.3.4.2.3","sha512");Ue("2.16.840.1.101.3.4.2.4","sha224");Ue("2.16.840.1.101.3.4.2.5","sha512-224");Ue("2.16.840.1.101.3.4.2.6","sha512-256");Ue("1.2.840.113549.2.2","md2");Ue("1.2.840.113549.2.5","md5");Ue("1.2.840.113549.1.7.1","data");Ue("1.2.840.113549.1.7.2","signedData");Ue("1.2.840.113549.1.7.3","envelopedData");Ue("1.2.840.113549.1.7.4","signedAndEnvelopedData");Ue("1.2.840.113549.1.7.5","digestedData");Ue("1.2.840.113549.1.7.6","encryptedData");Ue("1.2.840.113549.1.9.1","emailAddress");Ue("1.2.840.113549.1.9.2","unstructuredName");Ue("1.2.840.113549.1.9.3","contentType");Ue("1.2.840.113549.1.9.4","messageDigest");Ue("1.2.840.113549.1.9.5","signingTime");Ue("1.2.840.113549.1.9.6","counterSignature");Ue("1.2.840.113549.1.9.7","challengePassword");Ue("1.2.840.113549.1.9.8","unstructuredAddress");Ue("1.2.840.113549.1.9.14","extensionRequest");Ue("1.2.840.113549.1.9.20","friendlyName");Ue("1.2.840.113549.1.9.21","localKeyId");Ue("1.2.840.113549.1.9.22.1","x509Certificate");Ue("1.2.840.113549.1.12.10.1.1","keyBag");Ue("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");Ue("1.2.840.113549.1.12.10.1.3","certBag");Ue("1.2.840.113549.1.12.10.1.4","crlBag");Ue("1.2.840.113549.1.12.10.1.5","secretBag");Ue("1.2.840.113549.1.12.10.1.6","safeContentsBag");Ue("1.2.840.113549.1.5.13","pkcs5PBES2");Ue("1.2.840.113549.1.5.12","pkcs5PBKDF2");Ue("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");Ue("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");Ue("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");Ue("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");Ue("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");Ue("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");Ue("1.2.840.113549.2.7","hmacWithSHA1");Ue("1.2.840.113549.2.8","hmacWithSHA224");Ue("1.2.840.113549.2.9","hmacWithSHA256");Ue("1.2.840.113549.2.10","hmacWithSHA384");Ue("1.2.840.113549.2.11","hmacWithSHA512");Ue("1.2.840.113549.3.7","des-EDE3-CBC");Ue("2.16.840.1.101.3.4.1.2","aes128-CBC");Ue("2.16.840.1.101.3.4.1.22","aes192-CBC");Ue("2.16.840.1.101.3.4.1.42","aes256-CBC");Ue("2.5.4.3","commonName");Ue("2.5.4.4","surname");Ue("2.5.4.5","serialNumber");Ue("2.5.4.6","countryName");Ue("2.5.4.7","localityName");Ue("2.5.4.8","stateOrProvinceName");Ue("2.5.4.9","streetAddress");Ue("2.5.4.10","organizationName");Ue("2.5.4.11","organizationalUnitName");Ue("2.5.4.12","title");Ue("2.5.4.13","description");Ue("2.5.4.15","businessCategory");Ue("2.5.4.17","postalCode");Ue("2.5.4.42","givenName");Ue("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");Ue("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");Ue("2.16.840.1.113730.1.1","nsCertType");Ue("2.16.840.1.113730.1.13","nsComment");yr("2.5.29.1","authorityKeyIdentifier");yr("2.5.29.2","keyAttributes");yr("2.5.29.3","certificatePolicies");yr("2.5.29.4","keyUsageRestriction");yr("2.5.29.5","policyMapping");yr("2.5.29.6","subtreesConstraint");yr("2.5.29.7","subjectAltName");yr("2.5.29.8","issuerAltName");yr("2.5.29.9","subjectDirectoryAttributes");yr("2.5.29.10","basicConstraints");yr("2.5.29.11","nameConstraints");yr("2.5.29.12","policyConstraints");yr("2.5.29.13","basicConstraints");Ue("2.5.29.14","subjectKeyIdentifier");Ue("2.5.29.15","keyUsage");yr("2.5.29.16","privateKeyUsagePeriod");Ue("2.5.29.17","subjectAltName");Ue("2.5.29.18","issuerAltName");Ue("2.5.29.19","basicConstraints");yr("2.5.29.20","cRLNumber");yr("2.5.29.21","cRLReason");yr("2.5.29.22","expirationDate");yr("2.5.29.23","instructionCode");yr("2.5.29.24","invalidityDate");yr("2.5.29.25","cRLDistributionPoints");yr("2.5.29.26","issuingDistributionPoint");yr("2.5.29.27","deltaCRLIndicator");yr("2.5.29.28","issuingDistributionPoint");yr("2.5.29.29","certificateIssuer");yr("2.5.29.30","nameConstraints");Ue("2.5.29.31","cRLDistributionPoints");Ue("2.5.29.32","certificatePolicies");yr("2.5.29.33","policyMappings");yr("2.5.29.34","policyConstraints");Ue("2.5.29.35","authorityKeyIdentifier");yr("2.5.29.36","policyConstraints");Ue("2.5.29.37","extKeyUsage");yr("2.5.29.46","freshestCRL");yr("2.5.29.54","inhibitAnyPolicy");Ue("1.3.6.1.4.1.11129.2.4.2","timestampList");Ue("1.3.6.1.5.5.7.1.1","authorityInfoAccess");Ue("1.3.6.1.5.5.7.3.1","serverAuth");Ue("1.3.6.1.5.5.7.3.2","clientAuth");Ue("1.3.6.1.5.5.7.3.3","codeSigning");Ue("1.3.6.1.5.5.7.3.4","emailProtection");Ue("1.3.6.1.5.5.7.3.8","timeStamping")});var qi=ye((rce,YP)=>{"use strict";var Vr=$t();ur();Su();var Qe=YP.exports=Vr.asn1=Vr.asn1||{};Qe.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};Qe.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};Qe.create=function(r,e,t,n,s){if(Vr.util.isArray(n)){for(var i=[],a=0;a<n.length;++a)n[a]!==void 0&&i.push(n[a]);n=i}var u={tagClass:r,type:e,constructed:t,composed:t||Vr.util.isArray(n),value:n};return s&&"bitStringContents"in s&&(u.bitStringContents=s.bitStringContents,u.original=Qe.copy(u)),u};Qe.copy=function(r,e){var t;if(Vr.util.isArray(r)){t=[];for(var n=0;n<r.length;++n)t.push(Qe.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:Qe.copy(r.value,e)},e&&!e.excludeBitStringContents&&(t.bitStringContents=r.bitStringContents),t)};Qe.equals=function(r,e,t){if(Vr.util.isArray(r)){if(!Vr.util.isArray(e)||r.length!==e.length)return!1;for(var n=0;n<r.length;++n)if(!Qe.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&&Qe.equals(r.value,e.value);return t&&t.includeBitStringContents&&(s=s&&r.bitStringContents===e.bitStringContents),s};Qe.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 Sm(r,e,t){if(t>e){var n=new Error("Too few bytes to parse DER.");throw n.available=r.length(),n.remaining=e,n.requested=t,n}}o(Sm,"_checkBufferLength");var U$=o(function(r,e){var t=r.getByte();if(e--,t!==128){var n,s=t&128;if(!s)n=t;else{var i=t&127;Sm(r,e,i),n=r.getInt(i<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");Qe.fromDer=function(r,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof r=="string"&&(r=Vr.util.createBuffer(r));var t=r.length(),n=_w(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 _w(r,e,t,n){var s;Sm(r,e,2);var i=r.getByte();e--;var a=i&192,u=i&31;s=r.length();var l=U$(r,e);if(e-=s-r.length(),l!==void 0&&l>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=r.length(),f.remaining=e,f.requested=l,f}l=e}var h,m,g=(i&32)===32;if(g)if(h=[],l===void 0)for(;;){if(Sm(r,e,2),r.bytes(2)==="\0\0"){r.getBytes(2),e-=2;break}s=r.length(),h.push(_w(r,e,t+1,n)),e-=s-r.length()}else for(;l>0;)s=r.length(),h.push(_w(r,l,t+1,n)),e-=s-r.length(),l-=s-r.length();if(h===void 0&&a===Qe.Class.UNIVERSAL&&u===Qe.Type.BITSTRING&&(m=r.bytes(l)),h===void 0&&n.decodeBitStrings&&a===Qe.Class.UNIVERSAL&&u===Qe.Type.BITSTRING&&l>1){var w=r.read,y=e,S=0;if(u===Qe.Type.BITSTRING&&(Sm(r,e,1),S=r.getByte(),e--),S===0)try{s=r.length();var E={strict:!0,decodeBitStrings:!0},b=_w(r,e,t+1,E),T=s-r.length();e-=T,u==Qe.Type.BITSTRING&&T++;var A=b.tagClass;T===l&&(A===Qe.Class.UNIVERSAL||A===Qe.Class.CONTEXT_SPECIFIC)&&(h=[b])}catch{}h===void 0&&(r.read=w,e=y)}if(h===void 0){if(l===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=e}if(u===Qe.Type.BMPSTRING)for(h="";l>0;l-=2)Sm(r,e,2),h+=String.fromCharCode(r.getInt16()),e-=2;else h=r.getBytes(l),e-=l}var C=m===void 0?null:{bitStringContents:m};return Qe.create(a,u,g,h,C)}o(_w,"_fromDer");Qe.toDer=function(r){var e=Vr.util.createBuffer(),t=r.tagClass|r.type,n=Vr.util.createBuffer(),s=!1;if("bitStringContents"in r&&(s=!0,r.original&&(s=Qe.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(Qe.toDer(r.value[i]))}else if(r.type===Qe.Type.BMPSTRING)for(var i=0;i<r.value.length;++i)n.putInt16(r.value.charCodeAt(i));else r.type===Qe.Type.INTEGER&&r.value.length>1&&(r.value.charCodeAt(0)===0&&(r.value.charCodeAt(1)&128)===0||r.value.charCodeAt(0)===255&&(r.value.charCodeAt(1)&128)===128)?n.putBytes(r.value.substr(1)):n.putBytes(r.value);if(e.putByte(t),n.length()<=127)e.putByte(n.length()&127);else{var a=n.length(),u="";do u+=String.fromCharCode(a&255),a=a>>>8;while(a>0);e.putByte(u.length|128);for(var i=u.length-1;i>=0;--i)e.putByte(u.charCodeAt(i))}return e.putBuffer(n),e};Qe.oidToDer=function(r){var e=r.split("."),t=Vr.util.createBuffer();t.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,s,i,a,u=2;u<e.length;++u){n=!0,s=[],i=parseInt(e[u],10);do a=i&127,i=i>>>7,n||(a|=128),s.push(a),n=!1;while(i>0);for(var l=s.length-1;l>=0;--l)t.putByte(s[l])}return t};Qe.derToOid=function(r){var e;typeof r=="string"&&(r=Vr.util.createBuffer(r));var t=r.getByte();e=Math.floor(t/40)+"."+t%40;for(var n=0;r.length()>0;)t=r.getByte(),n=n<<7,t&128?n+=t&127:(e+="."+(n+t),n=0);return e};Qe.utcTimeToDate=function(r){var e=new Date,t=parseInt(r.substr(0,2),10);t=t>=50?1900+t:2e3+t;var n=parseInt(r.substr(2,2),10)-1,s=parseInt(r.substr(4,2),10),i=parseInt(r.substr(6,2),10),a=parseInt(r.substr(8,2),10),u=0;if(r.length>11){var l=r.charAt(10),f=10;l!=="+"&&l!=="-"&&(u=parseInt(r.substr(10,2),10),f+=2)}if(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,u,0),f&&(l=r.charAt(f),l==="+"||l==="-")){var h=parseInt(r.substr(f+1,2),10),m=parseInt(r.substr(f+4,2),10),g=h*60+m;g*=6e4,l==="+"?e.setTime(+e-g):e.setTime(+e+g)}return e};Qe.generalizedTimeToDate=function(r){var e=new Date,t=parseInt(r.substr(0,4),10),n=parseInt(r.substr(4,2),10)-1,s=parseInt(r.substr(6,2),10),i=parseInt(r.substr(8,2),10),a=parseInt(r.substr(10,2),10),u=parseInt(r.substr(12,2),10),l=0,f=0,h=!1;r.charAt(r.length-1)==="Z"&&(h=!0);var m=r.length-5,g=r.charAt(m);if(g==="+"||g==="-"){var w=parseInt(r.substr(m+1,2),10),y=parseInt(r.substr(m+4,2),10);f=w*60+y,f*=6e4,g==="+"&&(f*=-1),h=!0}return r.charAt(14)==="."&&(l=parseFloat(r.substr(14),10)*1e3),h?(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,u,l),e.setTime(+e+f)):(e.setFullYear(t,n,s),e.setHours(i,a,u,l)),e};Qe.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};Qe.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};Qe.integerToDer=function(r){var e=Vr.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};Qe.derToInteger=function(r){typeof r=="string"&&(r=Vr.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)};Qe.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&&Vr.util.isArray(e.value))for(var i=0,a=0;s&&a<e.value.length;++a)s=e.value[a].optional||!1,r.value[i]&&(s=Qe.validate(r.value[i],e.value[a],t,n),s?++i:e.value[a].optional&&(s=!0)),!s&&n&&n.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+r.value.length+'"');if(s&&t&&(e.capture&&(t[e.capture]=r.value),e.captureAsn1&&(t[e.captureAsn1]=r),e.captureBitStringContents&&"bitStringContents"in r&&(t[e.captureBitStringContents]=r.bitStringContents),e.captureBitStringValue&&"bitStringContents"in r)){var u;if(r.bitStringContents.length<2)t[e.captureBitStringValue]="";else{var l=r.bitStringContents.charCodeAt(0);if(l!==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 zP=/[^\\u0000-\\u00ff]/;Qe.prettyPrint=function(r,e,t){var n="";e=e||0,t=t||2,e>0&&(n+=`
5
- `);for(var s="",i=0;i<e*t;++i)s+=" ";switch(n+=s+"Tag: ",r.tagClass){case Qe.Class.UNIVERSAL:n+="Universal:";break;case Qe.Class.APPLICATION:n+="Application:";break;case Qe.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case Qe.Class.PRIVATE:n+="Private:";break}if(r.tagClass===Qe.Class.UNIVERSAL)switch(n+=r.type,r.type){case Qe.Type.NONE:n+=" (None)";break;case Qe.Type.BOOLEAN:n+=" (Boolean)";break;case Qe.Type.INTEGER:n+=" (Integer)";break;case Qe.Type.BITSTRING:n+=" (Bit string)";break;case Qe.Type.OCTETSTRING:n+=" (Octet string)";break;case Qe.Type.NULL:n+=" (Null)";break;case Qe.Type.OID:n+=" (Object Identifier)";break;case Qe.Type.ODESC:n+=" (Object Descriptor)";break;case Qe.Type.EXTERNAL:n+=" (External or Instance of)";break;case Qe.Type.REAL:n+=" (Real)";break;case Qe.Type.ENUMERATED:n+=" (Enumerated)";break;case Qe.Type.EMBEDDED:n+=" (Embedded PDV)";break;case Qe.Type.UTF8:n+=" (UTF8)";break;case Qe.Type.ROID:n+=" (Relative Object Identifier)";break;case Qe.Type.SEQUENCE:n+=" (Sequence)";break;case Qe.Type.SET:n+=" (Set)";break;case Qe.Type.PRINTABLESTRING:n+=" (Printable String)";break;case Qe.Type.IA5String:n+=" (IA5String (ASCII))";break;case Qe.Type.UTCTIME:n+=" (UTC time)";break;case Qe.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case Qe.Type.BMPSTRING:n+=" (BMP String)";break}else n+=r.type;if(n+=`
6
- `,n+=s+"Constructed: "+r.constructed+`
7
- `,r.composed){for(var a=0,u="",i=0;i<r.value.length;++i)r.value[i]!==void 0&&(a+=1,u+=Qe.prettyPrint(r.value[i],e+1,t),i+1<r.value.length&&(u+=","));n+=s+"Sub values: "+a+u}else{if(n+=s+"Value: ",r.type===Qe.Type.OID){var l=Qe.derToOid(r.value);n+=l,Vr.pki&&Vr.pki.oids&&l in Vr.pki.oids&&(n+=" ("+Vr.pki.oids[l]+") ")}if(r.type===Qe.Type.INTEGER)try{n+=Qe.derToInteger(r.value)}catch{n+="0x"+Vr.util.bytesToHex(r.value)}else if(r.type===Qe.Type.BITSTRING){if(r.value.length>1?n+="0x"+Vr.util.bytesToHex(r.value.slice(1)):n+="(none)",r.value.length>0){var f=r.value.charCodeAt(0);f==1?n+=" (1 unused bit shown)":f>1&&(n+=" ("+f+" unused bits shown)")}}else if(r.type===Qe.Type.OCTETSTRING)zP.test(r.value)||(n+="("+r.value+") "),n+="0x"+Vr.util.bytesToHex(r.value);else if(r.type===Qe.Type.UTF8)try{n+=Vr.util.decodeUtf8(r.value)}catch(h){if(h.message==="URI malformed")n+="0x"+Vr.util.bytesToHex(r.value)+" (malformed UTF8)";else throw h}else r.type===Qe.Type.PRINTABLESTRING||r.type===Qe.Type.IA5String?n+=r.value:zP.test(r.value)?n+="0x"+Vr.util.bytesToHex(r.value):r.value.length===0?n+="[null]":n+=r.value}return n}});var ma=ye((sce,QP)=>{"use strict";var Rw=$t();QP.exports=Rw.md=Rw.md||{};Rw.md.algorithms=Rw.md.algorithms||{}});var Hh=ye((ice,ZP)=>{"use strict";var ho=$t();ma();ur();var M$=ZP.exports=ho.hmac=ho.hmac||{};M$.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 ho.md.algorithms)e=ho.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=ho.util.createBuffer(a);else if(ho.util.isArray(a)){var u=a;a=ho.util.createBuffer();for(var l=0;l<u.length;++l)a.putByte(u[l])}var f=a.length();f>e.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),t=ho.util.createBuffer(),n=ho.util.createBuffer(),f=a.length();for(var l=0;l<f;++l){var u=a.at(l);t.putByte(54^u),n.putByte(92^u)}if(f<e.blockLength)for(var u=e.blockLength-f,l=0;l<u;++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 Ow=ye((ace,nO)=>{"use strict";var ga=$t();ma();ur();var tO=nO.exports=ga.md5=ga.md5||{};ga.md.md5=ga.md.algorithms.md5=tO;tO.create=function(){rO||j$();var r=null,e=ga.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=ga.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=ga.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),eO(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=ga.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(Yb.substr(0,n.blockLength-a));for(var u,l=0,f=n.fullMessageLength.length-1;f>=0;--f)u=n.fullMessageLength[f]*8+l,l=u/4294967296>>>0,s.putInt32Le(u>>>0);var h={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3};eO(h,t,s);var m=ga.util.createBuffer();return m.putInt32Le(h.h0),m.putInt32Le(h.h1),m.putInt32Le(h.h2),m.putInt32Le(h.h3),m},n};var Yb=null,Pw=null,Em=null,Kh=null,rO=!1;function j$(){Yb="\x80",Yb+=ga.util.fillString("\0",64),Pw=[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],Em=[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],Kh=new Array(64);for(var r=0;r<64;++r)Kh[r]=Math.floor(Math.abs(Math.sin(r+1))*4294967296);rO=!0}o(j$,"_init");function eO(r,e,t){for(var n,s,i,a,u,l,f,h,m=t.length();m>=64;){for(s=r.h0,i=r.h1,a=r.h2,u=r.h3,h=0;h<16;++h)e[h]=t.getInt32Le(),l=u^i&(a^u),n=s+l+Kh[h]+e[h],f=Em[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<32;++h)l=a^u&(i^a),n=s+l+Kh[h]+e[Pw[h]],f=Em[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<48;++h)l=i^a^u,n=s+l+Kh[h]+e[Pw[h]],f=Em[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;for(;h<64;++h)l=a^(i|~u),n=s+l+Kh[h]+e[Pw[h]],f=Em[h],s=u,u=a,a=i,i+=n<<f|n>>>32-f;r.h0=r.h0+s|0,r.h1=r.h1+i|0,r.h2=r.h2+a|0,r.h3=r.h3+u|0,m-=64}}o(eO,"_update")});var pc=ye((uce,iO)=>{"use strict";var Lw=$t();ur();var sO=iO.exports=Lw.pem=Lw.pem||{};sO.encode=function(r,e){e=e||{};var t="-----BEGIN "+r.type+`-----\r
8
- `,n;if(r.procType&&(n={name:"Proc-Type",values:[String(r.procType.version),r.procType.type]},t+=kw(n)),r.contentDomain&&(n={name:"Content-Domain",values:[r.contentDomain]},t+=kw(n)),r.dekInfo&&(n={name:"DEK-Info",values:[r.dekInfo.algorithm]},r.dekInfo.parameters&&n.values.push(r.dekInfo.parameters),t+=kw(n)),r.headers)for(var s=0;s<r.headers.length;++s)t+=kw(r.headers[s]);return r.procType&&(t+=`\r
9
- `),t+=Lw.util.encode64(r.body,e.maxline||64)+`\r
10
- `,t+="-----END "+r.type+`-----\r
11
- `,t};sO.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 u={type:a,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Lw.util.decode64(i[3])};if(e.push(u),!!i[2]){for(var l=i[2].split(s),f=0;i&&f<l.length;){for(var h=l[f].replace(/\s+$/,""),m=f+1;m<l.length;++m){var g=l[m];if(!/\s/.test(g[0]))break;h+=g,f=m}if(i=h.match(n),i){for(var w={name:i[1],values:[]},y=i[2].split(","),S=0;S<y.length;++S)w.values.push(F$(y[S]));if(u.procType)if(!u.contentDomain&&w.name==="Content-Domain")u.contentDomain=y[0]||"";else if(!u.dekInfo&&w.name==="DEK-Info"){if(w.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.headers.push(w);else{if(w.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(w.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++f}if(u.procType==="ENCRYPTED"&&!u.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 kw(r){for(var e=r.name+": ",t=[],n=o(function(l,f){return" "+f},"insertSpace"),s=0;s<r.values.length;++s)t.push(r.values[s].replace(/^(\S+\r\n)/,n));e+=t.join(",")+`\r
12
- `;for(var i=0,a=-1,s=0;s<e.length;++s,++i)if(i>65&&a!==-1){var u=e[a];u===","?(++a,e=e.substr(0,a)+`\r
13
- `+e.substr(a)):e=e.substr(0,a)+`\r
14
- `+u+e.substr(a+1),i=s-a-1,a=-1,++s}else(e[s]===" "||e[s]===" "||e[s]===",")&&(a=s);return e}o(kw,"foldHeader");function F$(r){return r.replace(/^\s+/,"")}o(F$,"ltrim")});var Am=ye((cce,oO)=>{"use strict";var Fr=$t();Tw();Xb();ur();oO.exports=Fr.des=Fr.des||{};Fr.des.startEncrypting=function(r,e,t,n){var s=Vw({key:r,output:t,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};Fr.des.createEncryptionCipher=function(r,e){return Vw({key:r,output:null,decrypt:!1,mode:e})};Fr.des.startDecrypting=function(r,e,t,n){var s=Vw({key:r,output:t,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return s.start(e),s};Fr.des.createDecryptionCipher=function(r,e){return Vw({key:r,output:null,decrypt:!0,mode:e})};Fr.des.Algorithm=function(r,e){var t=this;t.name=r,t.mode=new e({blockSize:8,cipher:{encrypt:o(function(n,s){return aO(t._keys,n,s,!1)},"encrypt"),decrypt:o(function(n,s){return aO(t._keys,n,s,!0)},"decrypt")}}),t._init=!1};Fr.des.Algorithm.prototype.initialize=function(r){if(!this._init){var e=Fr.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=z$(e),this._init=!0}};ya("DES-ECB",Fr.cipher.modes.ecb);ya("DES-CBC",Fr.cipher.modes.cbc);ya("DES-CFB",Fr.cipher.modes.cfb);ya("DES-OFB",Fr.cipher.modes.ofb);ya("DES-CTR",Fr.cipher.modes.ctr);ya("3DES-ECB",Fr.cipher.modes.ecb);ya("3DES-CBC",Fr.cipher.modes.cbc);ya("3DES-CFB",Fr.cipher.modes.cfb);ya("3DES-OFB",Fr.cipher.modes.ofb);ya("3DES-CTR",Fr.cipher.modes.ctr);function ya(r,e){var t=o(function(){return new Fr.des.Algorithm(r,e)},"factory");Fr.cipher.registerAlgorithm(r,t)}o(ya,"registerAlgorithm");var q$=[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],H$=[-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],K$=[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],$$=[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],X$=[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],G$=[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],W$=[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],J$=[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 z$(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],u=[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],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],m=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],g=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],w=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],S=r.length()>8?3:1,E=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],T=0,A,C=0;C<S;C++){var x=r.getInt32(),B=r.getInt32();A=(x>>>4^B)&252645135,B^=A,x^=A<<4,A=(B>>>-16^x)&65535,x^=A,B^=A<<-16,A=(x>>>2^B)&858993459,B^=A,x^=A<<2,A=(B>>>-16^x)&65535,x^=A,B^=A<<-16,A=(x>>>1^B)&1431655765,B^=A,x^=A<<1,A=(B>>>8^x)&16711935,x^=A,B^=A<<8,A=(x>>>1^B)&1431655765,B^=A,x^=A<<1,A=x<<8|B>>>20&240,x=B<<24|B<<8&16711680|B>>>8&65280|B>>>24&240,B=A;for(var F=0;F<b.length;++F){b[F]?(x=x<<2|x>>>26,B=B<<2|B>>>26):(x=x<<1|x>>>27,B=B<<1|B>>>27),x&=-15,B&=-15;var R=e[x>>>28]|t[x>>>24&15]|n[x>>>20&15]|s[x>>>16&15]|i[x>>>12&15]|a[x>>>8&15]|u[x>>>4&15],H=l[B>>>28]|f[B>>>24&15]|h[B>>>20&15]|m[B>>>16&15]|g[B>>>12&15]|w[B>>>8&15]|y[B>>>4&15];A=(H>>>16^R)&65535,E[T++]=R^A,E[T++]=H^A<<16}}return E}o(z$,"_createKeys");function aO(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,u=e[0],l=e[1];a=(u>>>4^l)&252645135,l^=a,u^=a<<4,a=(u>>>16^l)&65535,l^=a,u^=a<<16,a=(l>>>2^u)&858993459,u^=a,l^=a<<2,a=(l>>>8^u)&16711935,u^=a,l^=a<<8,a=(u>>>1^l)&1431655765,l^=a,u^=a<<1,u=u<<1|u>>>31,l=l<<1|l>>>31;for(var f=0;f<s;f+=3){for(var h=i[f+1],m=i[f+2],g=i[f];g!=h;g+=m){var w=l^r[g],y=(l>>>4|l<<28)^r[g+1];a=u,u=l,l=a^(H$[w>>>24&63]|$$[w>>>16&63]|G$[w>>>8&63]|J$[w&63]|q$[y>>>24&63]|K$[y>>>16&63]|X$[y>>>8&63]|W$[y&63])}a=u,u=l,l=a}u=u>>>1|u<<31,l=l>>>1|l<<31,a=(u>>>1^l)&1431655765,l^=a,u^=a<<1,a=(l>>>8^u)&16711935,u^=a,l^=a<<8,a=(l>>>2^u)&858993459,u^=a,l^=a<<2,a=(u>>>16^l)&65535,l^=a,u^=a<<16,a=(u>>>4^l)&252645135,l^=a,u^=a<<4,t[0]=u,t[1]=l}o(aO,"_updateBlock");function Vw(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="DES-"+e,n;r.decrypt?n=Fr.cipher.createDecipher(t,r.key):n=Fr.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var u=null;a instanceof Fr.util.ByteBuffer&&(u=a,a={}),a=a||{},a.output=u,a.iv=i,s.call(n,a)},n}o(Vw,"_createCipher")});var Uw=ye((hce,uO)=>{"use strict";var cs=$t();Hh();ma();ur();var Y$=cs.pkcs5=cs.pkcs5||{},po;cs.util.isNodejs&&!cs.options.usePureJavaScript&&(po=wt("crypto"));uO.exports=cs.pbkdf2=Y$.pbkdf2=function(r,e,t,n,s,i){if(typeof s=="function"&&(i=s,s=null),cs.util.isNodejs&&!cs.options.usePureJavaScript&&po.pbkdf2&&(s===null||typeof s!="object")&&(po.pbkdf2Sync.length>4||!s||s==="sha1"))return typeof s!="string"&&(s="sha1"),r=Buffer.from(r,"binary"),e=Buffer.from(e,"binary"),i?po.pbkdf2Sync.length===4?po.pbkdf2(r,e,t,n,function(A,C){if(A)return i(A);i(null,C.toString("binary"))}):po.pbkdf2(r,e,t,n,s,function(A,C){if(A)return i(A);i(null,C.toString("binary"))}):po.pbkdf2Sync.length===4?po.pbkdf2Sync(r,e,t,n).toString("binary"):po.pbkdf2Sync(r,e,t,n,s).toString("binary");if((typeof s>"u"||s===null)&&(s="sha1"),typeof s=="string"){if(!(s in cs.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=cs.md[s].create()}var a=s.digestLength;if(n>4294967295*a){var u=new Error("Derived key is too long.");if(i)return i(u);throw u}var l=Math.ceil(n/a),f=n-(l-1)*a,h=cs.hmac.create();h.start(s,r);var m="",g,w,y;if(!i){for(var S=1;S<=l;++S){h.start(null,null),h.update(e),h.update(cs.util.int32ToBytes(S)),g=y=h.digest().getBytes();for(var E=2;E<=t;++E)h.start(null,null),h.update(y),w=h.digest().getBytes(),g=cs.util.xorBytes(g,w,a),y=w;m+=S<l?g:g.substr(0,f)}return m}var S=1,E;function b(){if(S>l)return i(null,m);h.start(null,null),h.update(e),h.update(cs.util.int32ToBytes(S)),g=y=h.digest().getBytes(),E=2,T()}o(b,"outer");function T(){if(E<=t)return h.start(null,null),h.update(y),w=h.digest().getBytes(),g=cs.util.xorBytes(g,w,a),y=w,++E,cs.util.setImmediate(T);m+=S<l?g:g.substr(0,f),++S,b()}o(T,"inner"),b()}});var Zb=ye((dce,pO)=>{"use strict";var va=$t();ma();ur();var cO=pO.exports=va.sha256=va.sha256||{};va.md.sha256=va.md.algorithms.sha256=cO;cO.create=function(){fO||Q$();var r=null,e=va.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=va.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=va.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),lO(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=va.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(Qb.substr(0,n.blockLength-a));for(var u,l,f=n.fullMessageLength[0]*8,h=0;h<n.fullMessageLength.length-1;++h)u=n.fullMessageLength[h+1]*8,l=u/4294967296>>>0,f+=l,s.putInt32(f>>>0),f=u>>>0;s.putInt32(f);var m={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4,h5:r.h5,h6:r.h6,h7:r.h7};lO(m,t,s);var g=va.util.createBuffer();return g.putInt32(m.h0),g.putInt32(m.h1),g.putInt32(m.h2),g.putInt32(m.h3),g.putInt32(m.h4),g.putInt32(m.h5),g.putInt32(m.h6),g.putInt32(m.h7),g},n};var Qb=null,fO=!1,hO=null;function Q$(){Qb="\x80",Qb+=va.util.fillString("\0",64),hO=[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],fO=!0}o(Q$,"_init");function lO(r,e,t){for(var n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T=t.length();T>=64;){for(f=0;f<16;++f)e[f]=t.getInt32();for(;f<64;++f)n=e[f-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,s=e[f-15],s=(s>>>7|s<<25)^(s>>>18|s<<14)^s>>>3,e[f]=n+e[f-7]+s+e[f-16]|0;for(h=r.h0,m=r.h1,g=r.h2,w=r.h3,y=r.h4,S=r.h5,E=r.h6,b=r.h7,f=0;f<64;++f)a=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),u=E^y&(S^E),i=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),l=h&m|g&(h^m),n=b+a+u+hO[f]+e[f],s=i+l,b=E,E=S,S=y,y=w+n>>>0,w=g,g=m,m=h,h=n+s>>>0;r.h0=r.h0+h|0,r.h1=r.h1+m|0,r.h2=r.h2+g|0,r.h3=r.h3+w|0,r.h4=r.h4+y|0,r.h5=r.h5+S|0,r.h6=r.h6+E|0,r.h7=r.h7+b|0,T-=64}}o(lO,"_update")});var ex=ye((gce,dO)=>{"use strict";var wa=$t();ur();var Mw=null;wa.util.isNodejs&&!wa.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Mw=wt("crypto"));var Z$=dO.exports=wa.prng=wa.prng||{};Z$.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(f,h){if(!h)return e.generateSync(f);var m=e.plugin.cipher,g=e.plugin.increment,w=e.plugin.formatKey,y=e.plugin.formatSeed,S=wa.util.createBuffer();e.key=null,E();function E(b){if(b)return h(b);if(S.length()>=f)return h(null,S.getBytes(f));if(e.generated>1048575&&(e.key=null),e.key===null)return wa.util.nextTick(function(){i(E)});var T=m(e.key,e.seed);e.generated+=T.length,S.putBytes(T),e.key=w(m(e.key,g(e.seed))),e.seed=y(m(e.key,e.seed)),wa.util.setImmediate(E)}o(E,"generate")},e.generateSync=function(f){var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,w=e.plugin.formatSeed;e.key=null;for(var y=wa.util.createBuffer();y.length()<f;){e.generated>1048575&&(e.key=null),e.key===null&&a();var S=h(e.key,e.seed);e.generated+=S.length,y.putBytes(S),e.key=g(h(e.key,m(e.seed))),e.seed=w(h(e.key,e.seed))}return y.getBytes(f)};function i(f){if(e.pools[0].messageLength>=32)return u(),f();var h=32-e.pools[0].messageLength<<5;e.seedFile(h,function(m,g){if(m)return f(m);e.collect(g),u(),f()})}o(i,"_reseed");function a(){if(e.pools[0].messageLength>=32)return u();var f=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(f)),u()}o(a,"_reseedSync");function u(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var f=e.plugin.md.create();f.update(e.keyBytes);for(var h=1,m=0;m<32;++m)e.reseeds%h===0&&(f.update(e.pools[m].digest().getBytes()),e.pools[m].start()),h=h<<1;e.keyBytes=f.digest().getBytes(),f.start(),f.update(e.keyBytes);var g=f.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(g),e.generated=0}o(u,"_seed");function l(f){var h=null,m=wa.util.globalScope,g=m.crypto||m.msCrypto;g&&g.getRandomValues&&(h=o(function(x){return g.getRandomValues(x)},"getRandomValues"));var w=wa.util.createBuffer();if(h)for(;w.length()<f;){var y=Math.max(1,Math.min(f-w.length(),65536)/4),S=new Uint32Array(Math.floor(y));try{h(S);for(var E=0;E<S.length;++E)w.putInt32(S[E])}catch(x){if(!(typeof QuotaExceededError<"u"&&x instanceof QuotaExceededError))throw x}}if(w.length()<f)for(var b,T,A,C=Math.floor(Math.random()*65536);w.length()<f;){T=16807*(C&65535),b=16807*(C>>16),T+=(b&32767)<<16,T+=b>>15,T=(T&2147483647)+(T>>31),C=T&4294967295;for(var E=0;E<3;++E)A=C>>>(E<<3),A^=Math.floor(Math.random()*256),w.putByte(A&255)}return w.getBytes(f)}return o(l,"defaultSeedFile"),Mw?(e.seedFile=function(f,h){Mw.randomBytes(f,function(m,g){if(m)return h(m);h(null,g.toString())})},e.seedFileSync=function(f){return Mw.randomBytes(f).toString()}):(e.seedFile=function(f,h){try{h(null,l(f))}catch(m){h(m)}},e.seedFileSync=l),e.collect=function(f){for(var h=f.length,m=0;m<h;++m)e.pools[e.pool].update(f.substr(m,1)),e.pool=e.pool===31?0:e.pool+1},e.collectInt=function(f,h){for(var m="",g=0;g<h;g+=8)m+=String.fromCharCode(f>>g&255);e.collect(m)},e.registerWorker=function(f){if(f===self)e.seedFile=function(m,g){function w(y){var S=y.data;S.forge&&S.forge.prng&&(self.removeEventListener("message",w),g(S.forge.prng.err,S.forge.prng.bytes))}o(w,"listener"),self.addEventListener("message",w),self.postMessage({forge:{prng:{needed:m}}})};else{var h=o(function(m){var g=m.data;g.forge&&g.forge.prng&&e.seedFile(g.forge.prng.needed,function(w,y){f.postMessage({forge:{prng:{err:w,bytes:y}}})})},"listener");f.addEventListener("message",h)}},e}});var fi=ye((vce,tx)=>{"use strict";var xn=$t();wu();Zb();ex();ur();(function(){if(xn.random&&xn.random.getBytes){tx.exports=xn.random;return}(function(r){var e={},t=new Array(4),n=xn.util.createBuffer();e.formatKey=function(m){var g=xn.util.createBuffer(m);return m=new Array(4),m[0]=g.getInt32(),m[1]=g.getInt32(),m[2]=g.getInt32(),m[3]=g.getInt32(),xn.aes._expandKey(m,!1)},e.formatSeed=function(m){var g=xn.util.createBuffer(m);return m=new Array(4),m[0]=g.getInt32(),m[1]=g.getInt32(),m[2]=g.getInt32(),m[3]=g.getInt32(),m},e.cipher=function(m,g){return xn.aes._updateBlock(m,g,t,!1),n.putInt32(t[0]),n.putInt32(t[1]),n.putInt32(t[2]),n.putInt32(t[3]),n.getBytes()},e.increment=function(m){return++m[3],m},e.md=xn.md.sha256;function s(){var m=xn.prng.create(e);return m.getBytes=function(g,w){return m.generate(g,w)},m.getBytesSync=function(g){return m.generate(g)},m}o(s,"spawnPrng");var i=s(),a=null,u=xn.util.globalScope,l=u.crypto||u.msCrypto;if(l&&l.getRandomValues&&(a=o(function(m){return l.getRandomValues(m)},"getRandomValues")),xn.options.usePureJavaScript||!xn.util.isNodejs&&!a){if(typeof window>"u"||window.document,i.collectInt(+new Date,32),typeof navigator<"u"){var f="";for(var h in navigator)try{typeof navigator[h]=="string"&&(f+=navigator[h])}catch{}i.collect(f),f=null}r&&(r().mousemove(function(m){i.collectInt(m.clientX,16),i.collectInt(m.clientY,16)}),r().keypress(function(m){i.collectInt(m.charCode,8)}))}if(!xn.random)xn.random=i;else for(var h in i)xn.random[h]=i[h];xn.random.createInstance=s,tx.exports=xn.random})(typeof jQuery<"u"?jQuery:null)})()});var nx=ye((Sce,yO)=>{"use strict";var As=$t();ur();var rx=[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],mO=[1,2,3,5],eX=o(function(r,e){return r<<e&65535|(r&65535)>>16-e},"rol"),tX=o(function(r,e){return(r&65535)>>e|r<<16-e&65535},"ror");yO.exports=As.rc2=As.rc2||{};As.rc2.expandKey=function(r,e){typeof r=="string"&&(r=As.util.createBuffer(r)),e=e||128;var t=r,n=r.length(),s=e,i=Math.ceil(s/8),a=255>>(s&7),u;for(u=n;u<128;u++)t.putByte(rx[t.at(u-1)+t.at(u-n)&255]);for(t.setAt(128-i,rx[t.at(128-i)&a]),u=127-i;u>=0;u--)t.setAt(u,rx[t.at(u+1)^t.at(u+i)]);return t};var gO=o(function(r,e,t){var n=!1,s=null,i=null,a=null,u,l,f,h,m=[];for(r=As.rc2.expandKey(r,e),f=0;f<64;f++)m.push(r.getInt16Le());t?(u=o(function(y){for(f=0;f<4;f++)y[f]+=m[h]+(y[(f+3)%4]&y[(f+2)%4])+(~y[(f+3)%4]&y[(f+1)%4]),y[f]=eX(y[f],mO[f]),h++},"mixRound"),l=o(function(y){for(f=0;f<4;f++)y[f]+=m[y[(f+3)%4]&63]},"mashRound")):(u=o(function(y){for(f=3;f>=0;f--)y[f]=tX(y[f],mO[f]),y[f]-=m[h]+(y[(f+3)%4]&y[(f+2)%4])+(~y[(f+3)%4]&y[(f+1)%4]),h--},"mixRound"),l=o(function(y){for(f=3;f>=0;f--)y[f]-=m[y[(f+3)%4]&63]},"mashRound"));var g=o(function(y){var S=[];for(f=0;f<4;f++){var E=s.getInt16Le();a!==null&&(t?E^=a.getInt16Le():a.putInt16Le(E)),S.push(E&65535)}h=t?0:63;for(var b=0;b<y.length;b++)for(var T=0;T<y[b][0];T++)y[b][1](S);for(f=0;f<4;f++)a!==null&&(t?a.putInt16Le(S[f]):S[f]^=a.getInt16Le()),i.putInt16Le(S[f])},"runPlan"),w=null;return w={start:o(function(y,S){y&&typeof y=="string"&&(y=As.util.createBuffer(y)),n=!1,s=As.util.createBuffer(),i=S||new As.util.createBuffer,a=y,w.output=i},"start"),update:o(function(y){for(n||s.putBuffer(y);s.length()>=8;)g([[5,u],[1,l],[6,u],[1,l],[5,u]])},"update"),finish:o(function(y){var S=!0;if(t)if(y)S=y(8,s,!t);else{var E=s.length()===8?8:8-s.length();s.fillWithByte(E,E)}if(S&&(n=!0,w.update()),!t&&(S=s.length()===0,S))if(y)S=y(8,i,!t);else{var b=i.length(),T=i.at(b-1);T>b?S=!1:i.truncate(T)}return S},"finish")},w},"createCipher");As.rc2.startEncrypting=function(r,e,t){var n=As.rc2.createEncryptionCipher(r,128);return n.start(e,t),n};As.rc2.createEncryptionCipher=function(r,e){return gO(r,e,!0)};As.rc2.startDecrypting=function(r,e,t){var n=As.rc2.createDecryptionCipher(r,128);return n.start(e,t),n};As.rc2.createDecryptionCipher=function(r,e){return gO(r,e,!1)}});var bm=ye((Ace,xO)=>{"use strict";var sx=$t();xO.exports=sx.jsbn=sx.jsbn||{};var mo,rX=0xdeadbeefcafe,vO=(rX&16777215)==15715070;function Oe(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))}o(Oe,"BigInteger");sx.jsbn.BigInteger=Oe;function lr(){return new Oe(null)}o(lr,"nbi");function nX(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}o(nX,"am1");function sX(r,e,t,n,s,i){for(var a=e&32767,u=e>>15;--i>=0;){var l=this.data[r]&32767,f=this.data[r++]>>15,h=u*l+f*a;l=a*l+((h&32767)<<15)+t.data[n]+(s&1073741823),s=(l>>>30)+(h>>>15)+u*f+(s>>>30),t.data[n++]=l&1073741823}return s}o(sX,"am2");function wO(r,e,t,n,s,i){for(var a=e&16383,u=e>>14;--i>=0;){var l=this.data[r]&16383,f=this.data[r++]>>14,h=u*l+f*a;l=a*l+((h&16383)<<14)+t.data[n]+s,s=(l>>28)+(h>>14)+u*f,t.data[n++]=l&268435455}return s}o(wO,"am3");typeof navigator>"u"?(Oe.prototype.am=wO,mo=28):vO&&navigator.appName=="Microsoft Internet Explorer"?(Oe.prototype.am=sX,mo=30):vO&&navigator.appName!="Netscape"?(Oe.prototype.am=nX,mo=26):(Oe.prototype.am=wO,mo=28);Oe.prototype.DB=mo;Oe.prototype.DM=(1<<mo)-1;Oe.prototype.DV=1<<mo;var ix=52;Oe.prototype.FV=Math.pow(2,ix);Oe.prototype.F1=ix-mo;Oe.prototype.F2=2*mo-ix;var iX="0123456789abcdefghijklmnopqrstuvwxyz",jw=new Array,$h,hi;$h=48;for(hi=0;hi<=9;++hi)jw[$h++]=hi;$h=97;for(hi=10;hi<36;++hi)jw[$h++]=hi;$h=65;for(hi=10;hi<36;++hi)jw[$h++]=hi;function SO(r){return iX.charAt(r)}o(SO,"int2char");function EO(r,e){var t=jw[r.charCodeAt(e)];return t??-1}o(EO,"intAt");function aX(r){for(var e=this.t-1;e>=0;--e)r.data[e]=this.data[e];r.t=this.t,r.s=this.s}o(aX,"bnpCopyTo");function oX(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}o(oX,"bnpFromInt");function Eu(r){var e=lr();return e.fromInt(r),e}o(Eu,"nbv");function uX(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:EO(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&&Oe.ZERO.subTo(this,this)}o(uX,"bnpFromString");function lX(){for(var r=this.s&this.DM;this.t>0&&this.data[this.t-1]==r;)--this.t}o(lX,"bnpClamp");function cX(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,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(n=this.data[a]>>u)>0&&(s=!0,i=SO(n));a>=0;)u<e?(n=(this.data[a]&(1<<u)-1)<<e-u,n|=this.data[--a]>>(u+=this.DB-e)):(n=this.data[a]>>(u-=e)&t,u<=0&&(u+=this.DB,--a)),n>0&&(s=!0),s&&(i+=SO(n));return s?i:"0"}o(cX,"bnToString");function fX(){var r=lr();return Oe.ZERO.subTo(this,r),r}o(fX,"bnNegate");function hX(){return this.s<0?this.negate():this}o(hX,"bnAbs");function pX(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}o(pX,"bnCompareTo");function Fw(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}o(Fw,"nbits");function dX(){return this.t<=0?0:this.DB*(this.t-1)+Fw(this.data[this.t-1]^this.s&this.DM)}o(dX,"bnBitLength");function mX(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}o(mX,"bnpDLShiftTo");function gX(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}o(gX,"bnpDRShiftTo");function yX(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,u;for(u=this.t-1;u>=0;--u)e.data[u+i+1]=this.data[u]>>n|a,a=(this.data[u]&s)<<t;for(u=i-1;u>=0;--u)e.data[u]=0;e.data[i]=a,e.t=this.t+i+1,e.s=this.s,e.clamp()}o(yX,"bnpLShiftTo");function vX(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()}o(vX,"bnpRShiftTo");function wX(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()}o(wX,"bnpSubTo");function SX(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&&Oe.ZERO.subTo(e,e)}o(SX,"bnpMultiplyTo");function EX(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()}o(EX,"bnpSquareTo");function AX(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=lr());var i=lr(),a=this.s,u=r.s,l=this.DB-Fw(n.data[n.t-1]);l>0?(n.lShiftTo(l,i),s.lShiftTo(l,t)):(n.copyTo(i),s.copyTo(t));var f=i.t,h=i.data[f-1];if(h!=0){var m=h*(1<<this.F1)+(f>1?i.data[f-2]>>this.F2:0),g=this.FV/m,w=(1<<this.F1)/m,y=1<<this.F2,S=t.t,E=S-f,b=e??lr();for(i.dlShiftTo(E,b),t.compareTo(b)>=0&&(t.data[t.t++]=1,t.subTo(b,t)),Oe.ONE.dlShiftTo(f,b),b.subTo(i,i);i.t<f;)i.data[i.t++]=0;for(;--E>=0;){var T=t.data[--S]==h?this.DM:Math.floor(t.data[S]*g+(t.data[S-1]+y)*w);if((t.data[S]+=i.am(0,T,t,E,0,f))<T)for(i.dlShiftTo(E,b),t.subTo(b,t);t.data[S]<--T;)t.subTo(b,t)}e!=null&&(t.drShiftTo(f,e),a!=u&&Oe.ZERO.subTo(e,e)),t.t=f,t.clamp(),l>0&&t.rShiftTo(l,t),a<0&&Oe.ZERO.subTo(t,t)}}}o(AX,"bnpDivRemTo");function CX(r){var e=lr();return this.abs().divRemTo(r,null,e),this.s<0&&e.compareTo(Oe.ZERO)>0&&r.subTo(e,e),e}o(CX,"bnMod");function dc(r){this.m=r}o(dc,"Classic");function bX(r){return r.s<0||r.compareTo(this.m)>=0?r.mod(this.m):r}o(bX,"cConvert");function xX(r){return r}o(xX,"cRevert");function NX(r){r.divRemTo(this.m,null,r)}o(NX,"cReduce");function TX(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(TX,"cMulTo");function IX(r,e){r.squareTo(e),this.reduce(e)}o(IX,"cSqrTo");dc.prototype.convert=bX;dc.prototype.revert=xX;dc.prototype.reduce=NX;dc.prototype.mulTo=TX;dc.prototype.sqrTo=IX;function BX(){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}o(BX,"bnpInvDigit");function mc(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}o(mc,"Montgomery");function DX(r){var e=lr();return r.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),r.s<0&&e.compareTo(Oe.ZERO)>0&&this.m.subTo(e,e),e}o(DX,"montConvert");function _X(r){var e=lr();return r.copyTo(e),this.reduce(e),e}o(_X,"montRevert");function RX(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)}o(RX,"montReduce");function PX(r,e){r.squareTo(e),this.reduce(e)}o(PX,"montSqrTo");function OX(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(OX,"montMulTo");mc.prototype.convert=DX;mc.prototype.revert=_X;mc.prototype.reduce=RX;mc.prototype.mulTo=OX;mc.prototype.sqrTo=PX;function kX(){return(this.t>0?this.data[0]&1:this.s)==0}o(kX,"bnpIsEven");function LX(r,e){if(r>4294967295||r<1)return Oe.ONE;var t=lr(),n=lr(),s=e.convert(this),i=Fw(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)}o(LX,"bnpExp");function VX(r,e){var t;return r<256||e.isEven()?t=new dc(e):t=new mc(e),this.exp(r,t)}o(VX,"bnModPowInt");Oe.prototype.copyTo=aX;Oe.prototype.fromInt=oX;Oe.prototype.fromString=uX;Oe.prototype.clamp=lX;Oe.prototype.dlShiftTo=mX;Oe.prototype.drShiftTo=gX;Oe.prototype.lShiftTo=yX;Oe.prototype.rShiftTo=vX;Oe.prototype.subTo=wX;Oe.prototype.multiplyTo=SX;Oe.prototype.squareTo=EX;Oe.prototype.divRemTo=AX;Oe.prototype.invDigit=BX;Oe.prototype.isEven=kX;Oe.prototype.exp=LX;Oe.prototype.toString=cX;Oe.prototype.negate=fX;Oe.prototype.abs=hX;Oe.prototype.compareTo=pX;Oe.prototype.bitLength=dX;Oe.prototype.mod=CX;Oe.prototype.modPowInt=VX;Oe.ZERO=Eu(0);Oe.ONE=Eu(1);function UX(){var r=lr();return this.copyTo(r),r}o(UX,"bnClone");function MX(){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]}o(MX,"bnIntValue");function jX(){return this.t==0?this.s:this.data[0]<<24>>24}o(jX,"bnByteValue");function FX(){return this.t==0?this.s:this.data[0]<<16>>16}o(FX,"bnShortValue");function qX(r){return Math.floor(Math.LN2*this.DB/Math.log(r))}o(qX,"bnpChunkSize");function HX(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}o(HX,"bnSigNum");function KX(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=Eu(t),s=lr(),i=lr(),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}o(KX,"bnpToRadix");function $X(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,u=0;u<r.length;++u){var l=EO(r,u);if(l<0){r.charAt(u)=="-"&&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&&Oe.ZERO.subTo(this,this)}o($X,"bnpFromRadix");function XX(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(Oe.ONE.shiftLeft(r-1),ax,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(Oe.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)}}o(XX,"bnpFromNumber");function GX(){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}o(GX,"bnToByteArray");function WX(r){return this.compareTo(r)==0}o(WX,"bnEquals");function JX(r){return this.compareTo(r)<0?this:r}o(JX,"bnMin");function zX(r){return this.compareTo(r)>0?this:r}o(zX,"bnMax");function YX(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()}o(YX,"bnpBitwiseTo");function QX(r,e){return r&e}o(QX,"op_and");function ZX(r){var e=lr();return this.bitwiseTo(r,QX,e),e}o(ZX,"bnAnd");function ax(r,e){return r|e}o(ax,"op_or");function eG(r){var e=lr();return this.bitwiseTo(r,ax,e),e}o(eG,"bnOr");function AO(r,e){return r^e}o(AO,"op_xor");function tG(r){var e=lr();return this.bitwiseTo(r,AO,e),e}o(tG,"bnXor");function CO(r,e){return r&~e}o(CO,"op_andnot");function rG(r){var e=lr();return this.bitwiseTo(r,CO,e),e}o(rG,"bnAndNot");function nG(){for(var r=lr(),e=0;e<this.t;++e)r.data[e]=this.DM&~this.data[e];return r.t=this.t,r.s=~this.s,r}o(nG,"bnNot");function sG(r){var e=lr();return r<0?this.rShiftTo(-r,e):this.lShiftTo(r,e),e}o(sG,"bnShiftLeft");function iG(r){var e=lr();return r<0?this.lShiftTo(-r,e):this.rShiftTo(r,e),e}o(iG,"bnShiftRight");function aG(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}o(aG,"lbit");function oG(){for(var r=0;r<this.t;++r)if(this.data[r]!=0)return r*this.DB+aG(this.data[r]);return this.s<0?this.t*this.DB:-1}o(oG,"bnGetLowestSetBit");function uG(r){for(var e=0;r!=0;)r&=r-1,++e;return e}o(uG,"cbit");function lG(){for(var r=0,e=this.s&this.DM,t=0;t<this.t;++t)r+=uG(this.data[t]^e);return r}o(lG,"bnBitCount");function cG(r){var e=Math.floor(r/this.DB);return e>=this.t?this.s!=0:(this.data[e]&1<<r%this.DB)!=0}o(cG,"bnTestBit");function fG(r,e){var t=Oe.ONE.shiftLeft(r);return this.bitwiseTo(t,e,t),t}o(fG,"bnpChangeBit");function hG(r){return this.changeBit(r,ax)}o(hG,"bnSetBit");function pG(r){return this.changeBit(r,CO)}o(pG,"bnClearBit");function dG(r){return this.changeBit(r,AO)}o(dG,"bnFlipBit");function mG(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()}o(mG,"bnpAddTo");function gG(r){var e=lr();return this.addTo(r,e),e}o(gG,"bnAdd");function yG(r){var e=lr();return this.subTo(r,e),e}o(yG,"bnSubtract");function vG(r){var e=lr();return this.multiplyTo(r,e),e}o(vG,"bnMultiply");function wG(r){var e=lr();return this.divRemTo(r,e,null),e}o(wG,"bnDivide");function SG(r){var e=lr();return this.divRemTo(r,null,e),e}o(SG,"bnRemainder");function EG(r){var e=lr(),t=lr();return this.divRemTo(r,e,t),new Array(e,t)}o(EG,"bnDivideAndRemainder");function AG(r){this.data[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()}o(AG,"bnpDMultiply");function CG(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]}}o(CG,"bnpDAddOffset");function Cm(){}o(Cm,"NullExp");function bO(r){return r}o(bO,"nNop");function bG(r,e,t){r.multiplyTo(e,t)}o(bG,"nMulTo");function xG(r,e){r.squareTo(e)}o(xG,"nSqrTo");Cm.prototype.convert=bO;Cm.prototype.revert=bO;Cm.prototype.mulTo=bG;Cm.prototype.sqrTo=xG;function NG(r){return this.exp(r,new Cm)}o(NG,"bnPow");function TG(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()}o(TG,"bnpMultiplyLowerTo");function IG(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)}o(IG,"bnpMultiplyUpperTo");function Xh(r){this.r2=lr(),this.q3=lr(),Oe.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}o(Xh,"Barrett");function BG(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=lr();return r.copyTo(e),this.reduce(e),e}o(BG,"barrettConvert");function DG(r){return r}o(DG,"barrettRevert");function _G(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)}o(_G,"barrettReduce");function RG(r,e){r.squareTo(e),this.reduce(e)}o(RG,"barrettSqrTo");function PG(r,e,t){r.multiplyTo(e,t),this.reduce(t)}o(PG,"barrettMulTo");Xh.prototype.convert=BG;Xh.prototype.revert=DG;Xh.prototype.reduce=_G;Xh.prototype.mulTo=PG;Xh.prototype.sqrTo=RG;function OG(r,e){var t=r.bitLength(),n,s=Eu(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 dc(e):e.isEven()?i=new Xh(e):i=new mc(e);var a=new Array,u=3,l=n-1,f=(1<<n)-1;if(a[1]=i.convert(this),n>1){var h=lr();for(i.sqrTo(a[1],h);u<=f;)a[u]=lr(),i.mulTo(h,a[u-2],a[u]),u+=2}var m=r.t-1,g,w=!0,y=lr(),S;for(t=Fw(r.data[m])-1;m>=0;){for(t>=l?g=r.data[m]>>t-l&f:(g=(r.data[m]&(1<<t+1)-1)<<l-t,m>0&&(g|=r.data[m-1]>>this.DB+t-l)),u=n;(g&1)==0;)g>>=1,--u;if((t-=u)<0&&(t+=this.DB,--m),w)a[g].copyTo(s),w=!1;else{for(;u>1;)i.sqrTo(s,y),i.sqrTo(y,s),u-=2;u>0?i.sqrTo(s,y):(S=s,s=y,y=S),i.mulTo(y,a[g],s)}for(;m>=0&&(r.data[m]&1<<t)==0;)i.sqrTo(s,y),S=s,s=y,y=S,--t<0&&(t=this.DB-1,--m)}return i.revert(s)}o(OG,"bnModPow");function kG(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}o(kG,"bnGCD");function LG(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}o(LG,"bnpModInt");function VG(r){var e=r.isEven();if(this.isEven()&&e||r.signum()==0)return Oe.ZERO;for(var t=r.clone(),n=this.clone(),s=Eu(1),i=Eu(0),a=Eu(0),u=Eu(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()||!u.isEven())&&(a.addTo(this,a),u.subTo(r,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(r,u),u.rShiftTo(1,u);t.compareTo(n)>=0?(t.subTo(n,t),e&&s.subTo(a,s),i.subTo(u,i)):(n.subTo(t,n),e&&a.subTo(s,a),u.subTo(i,u))}if(n.compareTo(Oe.ONE)!=0)return Oe.ZERO;if(u.compareTo(r)>=0)return u.subtract(r);if(u.signum()<0)u.addTo(r,u);else return u;return u.signum()<0?u.add(r):u}o(VG,"bnModInverse");var Hi=[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],UG=(1<<26)/Hi[Hi.length-1];function MG(r){var e,t=this.abs();if(t.t==1&&t.data[0]<=Hi[Hi.length-1]){for(e=0;e<Hi.length;++e)if(t.data[0]==Hi[e])return!0;return!1}if(t.isEven())return!1;for(e=1;e<Hi.length;){for(var n=Hi[e],s=e+1;s<Hi.length&&n<UG;)n*=Hi[s++];for(n=t.modInt(n);e<s;)if(n%Hi[e++]==0)return!1}return t.millerRabin(r)}o(MG,"bnIsProbablePrime");function jG(r){var e=this.subtract(Oe.ONE),t=e.getLowestSetBit();if(t<=0)return!1;for(var n=e.shiftRight(t),s=FG(),i,a=0;a<r;++a){do i=new Oe(this.bitLength(),s);while(i.compareTo(Oe.ONE)<=0||i.compareTo(e)>=0);var u=i.modPow(n,this);if(u.compareTo(Oe.ONE)!=0&&u.compareTo(e)!=0){for(var l=1;l++<t&&u.compareTo(e)!=0;)if(u=u.modPowInt(2,this),u.compareTo(Oe.ONE)==0)return!1;if(u.compareTo(e)!=0)return!1}}return!0}o(jG,"bnpMillerRabin");function FG(){return{nextBytes:o(function(r){for(var e=0;e<r.length;++e)r[e]=Math.floor(Math.random()*256)},"nextBytes")}}o(FG,"bnGetPrng");Oe.prototype.chunkSize=qX;Oe.prototype.toRadix=KX;Oe.prototype.fromRadix=$X;Oe.prototype.fromNumber=XX;Oe.prototype.bitwiseTo=YX;Oe.prototype.changeBit=fG;Oe.prototype.addTo=mG;Oe.prototype.dMultiply=AG;Oe.prototype.dAddOffset=CG;Oe.prototype.multiplyLowerTo=TG;Oe.prototype.multiplyUpperTo=IG;Oe.prototype.modInt=LG;Oe.prototype.millerRabin=jG;Oe.prototype.clone=UX;Oe.prototype.intValue=MX;Oe.prototype.byteValue=jX;Oe.prototype.shortValue=FX;Oe.prototype.signum=HX;Oe.prototype.toByteArray=GX;Oe.prototype.equals=WX;Oe.prototype.min=JX;Oe.prototype.max=zX;Oe.prototype.and=ZX;Oe.prototype.or=eG;Oe.prototype.xor=tG;Oe.prototype.andNot=rG;Oe.prototype.not=nG;Oe.prototype.shiftLeft=sG;Oe.prototype.shiftRight=iG;Oe.prototype.getLowestSetBit=oG;Oe.prototype.bitCount=lG;Oe.prototype.testBit=cG;Oe.prototype.setBit=hG;Oe.prototype.clearBit=pG;Oe.prototype.flipBit=dG;Oe.prototype.add=gG;Oe.prototype.subtract=yG;Oe.prototype.multiply=vG;Oe.prototype.divide=wG;Oe.prototype.remainder=SG;Oe.prototype.divideAndRemainder=EG;Oe.prototype.modPow=OG;Oe.prototype.modInverse=VG;Oe.prototype.pow=NG;Oe.prototype.gcd=kG;Oe.prototype.isProbablePrime=MG});var Gh=ye((bce,BO)=>{"use strict";var Sa=$t();ma();ur();var TO=BO.exports=Sa.sha1=Sa.sha1||{};Sa.md.sha1=Sa.md.algorithms.sha1=TO;TO.create=function(){IO||qG();var r=null,e=Sa.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=Sa.util.createBuffer(),r={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},n},n.start(),n.update=function(s,i){i==="utf8"&&(s=Sa.util.encodeUtf8(s));var a=s.length;n.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var u=n.fullMessageLength.length-1;u>=0;--u)n.fullMessageLength[u]+=a[1],a[1]=a[0]+(n.fullMessageLength[u]/4294967296>>>0),n.fullMessageLength[u]=n.fullMessageLength[u]>>>0,a[0]=a[1]/4294967296>>>0;return e.putBytes(s),NO(r,t,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var s=Sa.util.createBuffer();s.putBytes(e.bytes());var i=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,a=i&n.blockLength-1;s.putBytes(ox.substr(0,n.blockLength-a));for(var u,l,f=n.fullMessageLength[0]*8,h=0;h<n.fullMessageLength.length-1;++h)u=n.fullMessageLength[h+1]*8,l=u/4294967296>>>0,f+=l,s.putInt32(f>>>0),f=u>>>0;s.putInt32(f);var m={h0:r.h0,h1:r.h1,h2:r.h2,h3:r.h3,h4:r.h4};NO(m,t,s);var g=Sa.util.createBuffer();return g.putInt32(m.h0),g.putInt32(m.h1),g.putInt32(m.h2),g.putInt32(m.h3),g.putInt32(m.h4),g},n};var ox=null,IO=!1;function qG(){ox="\x80",ox+=Sa.util.fillString("\0",64),IO=!0}o(qG,"_init");function NO(r,e,t){for(var n,s,i,a,u,l,f,h,m=t.length();m>=64;){for(s=r.h0,i=r.h1,a=r.h2,u=r.h3,l=r.h4,h=0;h<16;++h)n=t.getInt32(),e[h]=n,f=u^i&(a^u),n=(s<<5|s>>>27)+f+l+1518500249+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<20;++h)n=e[h-3]^e[h-8]^e[h-14]^e[h-16],n=n<<1|n>>>31,e[h]=n,f=u^i&(a^u),n=(s<<5|s>>>27)+f+l+1518500249+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<32;++h)n=e[h-3]^e[h-8]^e[h-14]^e[h-16],n=n<<1|n>>>31,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+1859775393+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<40;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+1859775393+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<60;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i&a|u&(i^a),n=(s<<5|s>>>27)+f+l+2400959708+n,l=u,u=a,a=(i<<30|i>>>2)>>>0,i=s,s=n;for(;h<80;++h)n=e[h-6]^e[h-16]^e[h-28]^e[h-32],n=n<<2|n>>>30,e[h]=n,f=i^a^u,n=(s<<5|s>>>27)+f+l+3395469782+n,l=u,u=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+u|0,r.h4=r.h4+l|0,m-=64}}o(NO,"_update")});var ux=ye((Nce,_O)=>{"use strict";var Ea=$t();ur();fi();Gh();var DO=_O.exports=Ea.pkcs1=Ea.pkcs1||{};DO.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=Ea.md.sha1.create(),a||(a=i);var u=Math.ceil(r.n.bitLength()/8),l=u-2*i.digestLength-2;if(e.length>l){var f=new Error("RSAES-OAEP input message length is too long.");throw f.length=e.length,f.maxLength=l,f}n||(n=""),i.update(n,"raw");for(var h=i.digest(),m="",g=l-e.length,w=0;w<g;w++)m+="\0";var y=h.getBytes()+m+""+e;if(!s)s=Ea.random.getBytes(i.digestLength);else if(s.length!==i.digestLength){var f=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw f.seedLength=s.length,f.digestLength=i.digestLength,f}var S=qw(s,u-i.digestLength-1,a),E=Ea.util.xorBytes(y,S,y.length),b=qw(E,i.digestLength,a),T=Ea.util.xorBytes(s,b,s.length);return"\0"+T+E};DO.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 E=new Error("RSAES-OAEP encoded message length is invalid.");throw E.length=e.length,E.expectedLength=a,E}if(s===void 0?s=Ea.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 u=s.digest().getBytes(),l=e.charAt(0),f=e.substring(1,s.digestLength+1),h=e.substring(1+s.digestLength),m=qw(h,s.digestLength,i),g=Ea.util.xorBytes(f,m,f.length),w=qw(g,a-s.digestLength-1,i),y=Ea.util.xorBytes(h,w,h.length),S=y.substring(0,s.digestLength),E=l!=="\0",b=0;b<s.digestLength;++b)E|=u.charAt(b)!==S.charAt(b);for(var T=1,A=s.digestLength,C=s.digestLength;C<y.length;C++){var x=y.charCodeAt(C),B=x&1^1,F=T?65534:0;E|=x&F,T=T&B,A+=T}if(E||y.charCodeAt(A)!==1)throw new Error("Invalid RSAES-OAEP padding.");return y.substring(A+1)};function qw(r,e,t){t||(t=Ea.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)}o(qw,"rsa_mgf1")});var cx=ye((Ice,lx)=>{"use strict";var Au=$t();ur();bm();fi();(function(){if(Au.prime){lx.exports=Au.prime;return}var r=lx.exports=Au.prime=Au.prime||{},e=Au.jsbn.BigInteger,t=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var s=o(function(m,g){return m|g},"op_or");r.generateProbablePrime=function(m,g,w){typeof g=="function"&&(w=g,g={}),g=g||{};var y=g.algorithm||"PRIMEINC";typeof y=="string"&&(y={name:y}),y.options=y.options||{};var S=g.prng||Au.random,E={nextBytes:o(function(b){for(var T=S.getBytesSync(b.length),A=0;A<b.length;++A)b[A]=T.charCodeAt(A)},"nextBytes")};if(y.name==="PRIMEINC")return i(m,E,y.options,w);throw new Error("Invalid prime generation algorithm: "+y.name)};function i(m,g,w,y){return"workers"in w?l(m,g,w,y):a(m,g,w,y)}o(i,"primeincFindPrime");function a(m,g,w,y){var S=f(m,g),E=0,b=h(S.bitLength());"millerRabinTests"in w&&(b=w.millerRabinTests);var T=10;"maxBlockTime"in w&&(T=w.maxBlockTime),u(S,m,g,E,b,T,y)}o(a,"primeincFindPrimeWithoutWorkers");function u(m,g,w,y,S,E,b){var T=+new Date;do{if(m.bitLength()>g&&(m=f(g,w)),m.isProbablePrime(S))return b(null,m);m.dAddOffset(t[y++%8],0)}while(E<0||+new Date-T<E);Au.util.setImmediate(function(){u(m,g,w,y,S,E,b)})}o(u,"_primeinc");function l(m,g,w,y){if(typeof Worker>"u")return a(m,g,w,y);var S=f(m,g),E=w.workers,b=w.workLoad||100,T=b*30/8,A=w.workerScript||"forge/prime.worker.js";if(E===-1)return Au.util.estimateCores(function(x,B){x&&(B=2),E=B-1,C()});C();function C(){E=Math.max(1,E);for(var x=[],B=0;B<E;++B)x[B]=new Worker(A);for(var F=E,B=0;B<E;++B)x[B].addEventListener("message",H);var R=!1;function H(q){if(!R){--F;var K=q.data;if(K.found){for(var G=0;G<x.length;++G)x[G].terminate();return R=!0,y(null,new e(K.prime,16))}S.bitLength()>m&&(S=f(m,g));var he=S.toString(16);q.target.postMessage({hex:he,workLoad:b}),S.dAddOffset(T,0)}}o(H,"workerMessage")}o(C,"generate")}o(l,"primeincFindPrimeWithWorkers");function f(m,g){var w=new e(m,g),y=m-1;return w.testBit(y)||w.bitwiseTo(e.ONE.shiftLeft(y),s,w),w.dAddOffset(31-w.mod(n).byteValue(),0),w}o(f,"generateRandom");function h(m){return m<=100?27:m<=150?18:m<=200?15:m<=250?12:m<=300?9:m<=350?8:m<=400?7:m<=500?6:m<=600?5:m<=800?4:m<=1250?3:2}o(h,"getMillerRabinTests")})()});var xm=ye((Dce,UO)=>{"use strict";var yt=$t();qi();bm();Su();ux();cx();fi();ur();typeof ir>"u"&&(ir=yt.jsbn.BigInteger);var ir,fx=yt.util.isNodejs?wt("crypto"):null,pe=yt.asn1,pi=yt.util;yt.pki=yt.pki||{};UO.exports=yt.pki.rsa=yt.rsa=yt.rsa||{};var Vt=yt.pki,HG=[6,4,2,4,2,4,6,2],KG={name:"PrivateKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},$G={name:"RSAPrivateKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},XG={name:"RSAPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:pe.Class.UNIVERSAL,type:pe.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},GG=yt.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},WG={name:"DigestInfo",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:pe.Class.UNIVERSAL,type:pe.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:pe.Class.UNIVERSAL,type:pe.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:pe.Class.UNIVERSAL,type:pe.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},JG=o(function(r){var e;if(r.algorithm in Vt.oids)e=Vt.oids[r.algorithm];else{var t=new Error("Unknown message digest algorithm.");throw t.algorithm=r.algorithm,t}var n=pe.oidToDer(e).getBytes(),s=pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[]),i=pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[]);i.value.push(pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,n)),i.value.push(pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,""));var a=pe.create(pe.Class.UNIVERSAL,pe.Type.OCTETSTRING,!1,r.digest().getBytes());return s.value.push(i),s.value.push(a),pe.toDer(s).getBytes()},"emsaPkcs1v15encode"),LO=o(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(ir.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(ir.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new ir(yt.util.bytesToHex(yt.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(ir.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");Vt.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=VO(r,e,t)):(s=yt.util.createBuffer(),s.putBytes(r));for(var a=new ir(s.toHex(),16),u=LO(a,e,n),l=u.toString(16),f=yt.util.createBuffer(),h=i-Math.ceil(l.length/2);h>0;)f.putByte(0),--h;return f.putBytes(yt.util.hexToBytes(l)),f.getBytes()};Vt.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 ir(yt.util.createBuffer(r).toHex(),16);if(a.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=LO(a,e,t),l=u.toString(16),f=yt.util.createBuffer(),h=s-Math.ceil(l.length/2);h>0;)f.putByte(0),--h;return f.putBytes(yt.util.hexToBytes(l)),n!==!1?Hw(f.getBytes(),e,t):f.getBytes()};Vt.rsa.createKeyPairGenerationState=function(r,e,t){typeof r=="string"&&(r=parseInt(r,10)),r=r||2048,t=t||{};var n=t.prng||yt.random,s={nextBytes:o(function(u){for(var l=n.getBytesSync(u.length),f=0;f<u.length;++f)u[f]=l.charCodeAt(f)},"nextBytes")},i=t.algorithm||"PRIMEINC",a;if(i==="PRIMEINC")a={algorithm:i,state:0,bits:r,rng:s,eInt:e||65537,e:new ir(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};Vt.rsa.stepKeyPairGenerationState=function(r,e){"algorithm"in r||(r.algorithm="PRIMEINC");var t=new ir(null);t.fromInt(30);for(var n=0,s=o(function(m,g){return m|g},"op_or"),i=+new Date,a,u=0;r.keys===null&&(e<=0||u<e);){if(r.state===0){var l=r.p===null?r.pBits:r.qBits,f=l-1;r.pqState===0?(r.num=new ir(l,r.rng),r.num.testBit(f)||r.num.bitwiseTo(ir.ONE.shiftLeft(f),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(YG(r.num.bitLength()))?++r.pqState:r.num.dAddOffset(HG[n++%8],0):r.pqState===2?r.pqState=r.num.subtract(ir.ONE).gcd(r.e).compareTo(ir.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(ir.ONE),r.q1=r.q.subtract(ir.ONE),r.phi=r.p1.multiply(r.q1),++r.state;else if(r.state===3)r.phi.gcd(r.e).compareTo(ir.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 h=r.e.modInverse(r.phi);r.keys={privateKey:Vt.rsa.setPrivateKey(r.n,r.e,h,r.p,r.q,h.mod(r.p1),h.mod(r.q1),r.q.modInverse(r.p)),publicKey:Vt.rsa.setPublicKey(r.n,r.e)}}a=+new Date,u+=a-i,i=a}return r.keys!==null};Vt.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),!yt.options.usePureJavaScript&&!t.prng&&r>=256&&r<=16384&&(e===65537||e===3)){if(n){if(RO("generateKeyPair"))return fx.generateKeyPair("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(u,l,f){if(u)return n(u);n(null,{privateKey:Vt.privateKeyFromPem(f),publicKey:Vt.publicKeyFromPem(l)})});if(PO("generateKey")&&PO("exportKey"))return pi.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:kO(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(u){return pi.globalScope.crypto.subtle.exportKey("pkcs8",u.privateKey)}).then(void 0,function(u){n(u)}).then(function(u){if(u){var l=Vt.privateKeyFromAsn1(pe.fromDer(yt.util.createBuffer(u)));n(null,{privateKey:l,publicKey:Vt.setRsaPublicKey(l.n,l.e)})}});if(OO("generateKey")&&OO("exportKey")){var s=pi.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:r,publicExponent:kO(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);s.oncomplete=function(u){var l=u.target.result,f=pi.globalScope.msCrypto.subtle.exportKey("pkcs8",l.privateKey);f.oncomplete=function(h){var m=h.target.result,g=Vt.privateKeyFromAsn1(pe.fromDer(yt.util.createBuffer(m)));n(null,{privateKey:g,publicKey:Vt.setRsaPublicKey(g.n,g.e)})},f.onerror=function(h){n(h)}},s.onerror=function(u){n(u)};return}}else if(RO("generateKeyPairSync")){var i=fx.generateKeyPairSync("rsa",{modulusLength:r,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Vt.privateKeyFromPem(i.privateKey),publicKey:Vt.publicKeyFromPem(i.publicKey)}}}var a=Vt.rsa.createKeyPairGenerationState(r,e,t);if(!n)return Vt.rsa.stepKeyPairGenerationState(a,0),a.keys;zG(a,t,n)};Vt.setRsaPublicKey=Vt.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:o(function(u,l,f){return VO(u,l,2).getBytes()},"encode")};else if(s==="RSA-OAEP"||s==="RSAES-OAEP")s={encode:o(function(u,l){return yt.pkcs1.encode_rsa_oaep(l,u,i)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(s)!==-1)s={encode:o(function(u){return u},"encode")};else if(typeof s=="string")throw new Error('Unsupported encryption scheme: "'+s+'".');var a=s.encode(n,t,!0);return Vt.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}),"_parseAllDigestBytes"in a||(a._parseAllDigestBytes=!0),i==="RSASSA-PKCS1-V1_5"?i={verify:o(function(l,f){f=Hw(f,t,!0);var h=pe.fromDer(f,{parseAllBytes:a._parseAllDigestBytes}),m={},g=[];if(!pe.validate(h,WG,m,g)){var w=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw w.errors=g,w}var y=pe.derToOid(m.algorithmIdentifier);if(!(y===yt.oids.md2||y===yt.oids.md5||y===yt.oids.sha1||y===yt.oids.sha224||y===yt.oids.sha256||y===yt.oids.sha384||y===yt.oids.sha512||y===yt.oids["sha512-224"]||y===yt.oids["sha512-256"])){var w=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw w.oid=y,w}if((y===yt.oids.md2||y===yt.oids.md5)&&!("parameters"in m))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return l===m.digest},"verify")}:(i==="NONE"||i==="NULL"||i===null)&&(i={verify:o(function(l,f){return f=Hw(f,t,!0),l===f},"verify")});var u=Vt.rsa.decrypt(s,t,!0,!1);return i.verify(n,u,t.n.bitLength())},t};Vt.setRsaPrivateKey=Vt.rsa.setPrivateKey=function(r,e,t,n,s,i,a,u){var l={n:r,e,d:t,p:n,q:s,dP:i,dQ:a,qInv:u};return l.decrypt=function(f,h,m){typeof h=="string"?h=h.toUpperCase():h===void 0&&(h="RSAES-PKCS1-V1_5");var g=Vt.rsa.decrypt(f,l,!1,!1);if(h==="RSAES-PKCS1-V1_5")h={decode:Hw};else if(h==="RSA-OAEP"||h==="RSAES-OAEP")h={decode:o(function(w,y){return yt.pkcs1.decode_rsa_oaep(y,w,m)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(h)!==-1)h={decode:o(function(w){return w},"decode")};else throw new Error('Unsupported encryption scheme: "'+h+'".');return h.decode(g,l,!1)},l.sign=function(f,h){var m=!1;typeof h=="string"&&(h=h.toUpperCase()),h===void 0||h==="RSASSA-PKCS1-V1_5"?(h={encode:JG},m=1):(h==="NONE"||h==="NULL"||h===null)&&(h={encode:o(function(){return f},"encode")},m=1);var g=h.encode(f,l.n.bitLength());return Vt.rsa.encrypt(g,l,m)},l};Vt.wrapRsaPrivateKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,pe.integerToDer(0).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,pe.oidToDer(Vt.oids.rsaEncryption).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,"")]),pe.create(pe.Class.UNIVERSAL,pe.Type.OCTETSTRING,!1,pe.toDer(r).getBytes())])};Vt.privateKeyFromAsn1=function(r){var e={},t=[];if(pe.validate(r,KG,e,t)&&(r=pe.fromDer(yt.util.createBuffer(e.privateKey))),e={},t=[],!pe.validate(r,$G,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,u,l,f,h,m;return s=yt.util.createBuffer(e.privateKeyModulus).toHex(),i=yt.util.createBuffer(e.privateKeyPublicExponent).toHex(),a=yt.util.createBuffer(e.privateKeyPrivateExponent).toHex(),u=yt.util.createBuffer(e.privateKeyPrime1).toHex(),l=yt.util.createBuffer(e.privateKeyPrime2).toHex(),f=yt.util.createBuffer(e.privateKeyExponent1).toHex(),h=yt.util.createBuffer(e.privateKeyExponent2).toHex(),m=yt.util.createBuffer(e.privateKeyCoefficient).toHex(),Vt.setRsaPrivateKey(new ir(s,16),new ir(i,16),new ir(a,16),new ir(u,16),new ir(l,16),new ir(f,16),new ir(h,16),new ir(m,16))};Vt.privateKeyToAsn1=Vt.privateKeyToRSAPrivateKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,pe.integerToDer(0).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.n)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.e)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.d)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.p)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.q)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.dP)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.dQ)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.qInv))])};Vt.publicKeyFromAsn1=function(r){var e={},t=[];if(pe.validate(r,GG,e,t)){var n=pe.derToOid(e.publicKeyOid);if(n!==Vt.oids.rsaEncryption){var s=new Error("Cannot read public key. Unknown OID.");throw s.oid=n,s}r=e.rsaPublicKey}if(t=[],!pe.validate(r,XG,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=yt.util.createBuffer(e.publicKeyModulus).toHex(),a=yt.util.createBuffer(e.publicKeyExponent).toHex();return Vt.setRsaPublicKey(new ir(i,16),new ir(a,16))};Vt.publicKeyToAsn1=Vt.publicKeyToSubjectPublicKeyInfo=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.OID,!1,pe.oidToDer(Vt.oids.rsaEncryption).getBytes()),pe.create(pe.Class.UNIVERSAL,pe.Type.NULL,!1,"")]),pe.create(pe.Class.UNIVERSAL,pe.Type.BITSTRING,!1,[Vt.publicKeyToRSAPublicKey(r)])])};Vt.publicKeyToRSAPublicKey=function(r){return pe.create(pe.Class.UNIVERSAL,pe.Type.SEQUENCE,!0,[pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.n)),pe.create(pe.Class.UNIVERSAL,pe.Type.INTEGER,!1,Aa(r.e))])};function VO(r,e,t){var n=yt.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,u;if(t===0||t===1){u=t===0?0:255;for(var l=0;l<a;++l)n.putByte(u)}else for(;a>0;){for(var f=0,h=yt.random.getBytes(a),l=0;l<a;++l)u=h.charCodeAt(l),u===0?++f:n.putByte(u);a=f}return n.putByte(0),n.putBytes(r),n}o(VO,"_encodePkcs1_v1_5");function Hw(r,e,t,n){var s=Math.ceil(e.n.bitLength()/8),i=yt.util.createBuffer(r),a=i.getByte(),u=i.getByte();if(a!==0||t&&u!==0&&u!==1||!t&&u!=2||t&&u===0&&typeof n>"u")throw new Error("Encryption block is invalid.");var l=0;if(u===0){l=s-3-n;for(var f=0;f<l;++f)if(i.getByte()!==0)throw new Error("Encryption block is invalid.")}else if(u===1)for(l=0;i.length()>1;){if(i.getByte()!==255){--i.read;break}++l}else if(u===2)for(l=0;i.length()>1;){if(i.getByte()===0){--i.read;break}++l}var h=i.getByte();if(h!==0||l!==s-3-i.length())throw new Error("Encryption block is invalid.");return i.getBytes()}o(Hw,"_decodePkcs1_v1_5");function zG(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(u,l){if(u)return t(u);if(r.p=l,r.q!==null)return a(u,r.q);i(r.qBits,a)})}o(s,"generate");function i(u,l){yt.prime.generateProbablePrime(u,n,l)}o(i,"getPrime");function a(u,l){if(u)return t(u);if(r.q=l,r.p.compareTo(r.q)<0){var f=r.p;r.p=r.q,r.q=f}if(r.p.subtract(ir.ONE).gcd(r.e).compareTo(ir.ONE)!==0){r.p=null,s();return}if(r.q.subtract(ir.ONE).gcd(r.e).compareTo(ir.ONE)!==0){r.q=null,i(r.qBits,a);return}if(r.p1=r.p.subtract(ir.ONE),r.q1=r.q.subtract(ir.ONE),r.phi=r.p1.multiply(r.q1),r.phi.gcd(r.e).compareTo(ir.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 h=r.e.modInverse(r.phi);r.keys={privateKey:Vt.rsa.setPrivateKey(r.n,r.e,h,r.p,r.q,h.mod(r.p1),h.mod(r.q1),r.q.modInverse(r.p)),publicKey:Vt.rsa.setPublicKey(r.n,r.e)},t(null,r.keys)}o(a,"finish")}o(zG,"_generateKeyPair");function Aa(r){var e=r.toString(16);e[0]>="8"&&(e="00"+e);var t=yt.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}o(Aa,"_bnToBytes");function YG(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}o(YG,"_getMillerRabinTests");function RO(r){return yt.util.isNodejs&&typeof fx[r]=="function"}o(RO,"_detectNodeCrypto");function PO(r){return typeof pi.globalScope<"u"&&typeof pi.globalScope.crypto=="object"&&typeof pi.globalScope.crypto.subtle=="object"&&typeof pi.globalScope.crypto.subtle[r]=="function"}o(PO,"_detectSubtleCrypto");function OO(r){return typeof pi.globalScope<"u"&&typeof pi.globalScope.msCrypto=="object"&&typeof pi.globalScope.msCrypto.subtle=="object"&&typeof pi.globalScope.msCrypto.subtle[r]=="function"}o(OO,"_detectSubtleMsCrypto");function kO(r){for(var e=yt.util.hexToBytes(r.toString(16)),t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}o(kO,"_intToUint8Array")});var hx=ye((Rce,HO)=>{"use strict";var st=$t();wu();qi();Am();ma();Su();Uw();pc();fi();nx();xm();ur();typeof MO>"u"&&(MO=st.jsbn.BigInteger);var MO,Ee=st.asn1,Ft=st.pki=st.pki||{};HO.exports=Ft.pbe=st.pbe=st.pbe||{};var gc=Ft.oids,QG={name:"EncryptedPrivateKeyInfo",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},ZG={name:"PBES2Algorithms",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},eW={name:"pkcs-12PbeParams",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Ee.Class.UNIVERSAL,type:Ee.Type.INTEGER,constructed:!1,capture:"iterations"}]};Ft.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=st.random.getBytesSync(t.saltSize),s=t.count,i=Ee.integerToDer(s),a,u,l;if(t.algorithm.indexOf("aes")===0||t.algorithm==="des"){var f,h,m;switch(t.algorithm){case"aes128":a=16,f=16,h=gc["aes128-CBC"],m=st.aes.createEncryptionCipher;break;case"aes192":a=24,f=16,h=gc["aes192-CBC"],m=st.aes.createEncryptionCipher;break;case"aes256":a=32,f=16,h=gc["aes256-CBC"],m=st.aes.createEncryptionCipher;break;case"des":a=8,f=8,h=gc.desCBC,m=st.des.createEncryptionCipher;break;default:var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=t.algorithm,g}var w="hmacWith"+t.prfAlgorithm.toUpperCase(),y=qO(w),S=st.pkcs5.pbkdf2(e,n,s,a,y),E=st.random.getBytesSync(f),b=m(S);b.start(E),b.update(Ee.toDer(r)),b.finish(),l=b.output.getBytes();var T=tW(n,i,a,w);u=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(gc.pkcs5PBES2).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(gc.pkcs5PBKDF2).getBytes()),T]),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(h).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,E)])])])}else if(t.algorithm==="3des"){a=24;var A=new st.util.ByteBuffer(n),S=Ft.pbe.generatePkcs12Key(e,A,1,s,a),E=Ft.pbe.generatePkcs12Key(e,A,2,s,a),b=st.des.createEncryptionCipher(S);b.start(E),b.update(Ee.toDer(r)),b.finish(),l=b.output.getBytes(),u=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(gc["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,n),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,i.getBytes())])])}else{var g=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw g.algorithm=t.algorithm,g}var C=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[u,Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,l)]);return C};Ft.decryptPrivateKeyInfo=function(r,e){var t=null,n={},s=[];if(!Ee.validate(r,QG,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=Ee.derToOid(n.encryptionOid),u=Ft.pbe.getCipher(a,n.encryptionParams,e),l=st.util.createBuffer(n.encryptedData);return u.update(l),u.finish()&&(t=Ee.fromDer(u.output)),t};Ft.encryptedPrivateKeyToPem=function(r,e){var t={type:"ENCRYPTED PRIVATE KEY",body:Ee.toDer(r).getBytes()};return st.pem.encode(t,{maxline:e})};Ft.encryptedPrivateKeyFromPem=function(r){var e=st.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 Ee.fromDer(e.body)};Ft.encryptRsaPrivateKey=function(r,e,t){if(t=t||{},!t.legacy){var n=Ft.wrapRsaPrivateKey(Ft.privateKeyToAsn1(r));return n=Ft.encryptPrivateKeyInfo(n,e,t),Ft.encryptedPrivateKeyToPem(n)}var s,i,a,u;switch(t.algorithm){case"aes128":s="AES-128-CBC",a=16,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",a=24,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",a=32,i=st.random.getBytesSync(16),u=st.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",a=24,i=st.random.getBytesSync(8),u=st.des.createEncryptionCipher;break;case"des":s="DES-CBC",a=8,i=st.random.getBytesSync(8),u=st.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 f=st.pbe.opensslDeriveBytes(e,i.substr(0,8),a),h=u(f);h.start(i),h.update(Ee.toDer(Ft.privateKeyToAsn1(r))),h.finish();var m={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:st.util.bytesToHex(i).toUpperCase()},body:h.output.getBytes()};return st.pem.encode(m)};Ft.decryptRsaPrivateKey=function(r,e){var t=null,n=st.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=st.des.createDecryptionCipher;break;case"DES-EDE3-CBC":i=24,a=st.des.createDecryptionCipher;break;case"AES-128-CBC":i=16,a=st.aes.createDecryptionCipher;break;case"AES-192-CBC":i=24,a=st.aes.createDecryptionCipher;break;case"AES-256-CBC":i=32,a=st.aes.createDecryptionCipher;break;case"RC2-40-CBC":i=5,a=o(function(m){return st.rc2.createDecryptionCipher(m,40)},"cipherFn");break;case"RC2-64-CBC":i=8,a=o(function(m){return st.rc2.createDecryptionCipher(m,64)},"cipherFn");break;case"RC2-128-CBC":i=16,a=o(function(m){return st.rc2.createDecryptionCipher(m,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 u=st.util.hexToBytes(n.dekInfo.parameters),l=st.pbe.opensslDeriveBytes(e,u.substr(0,8),i),f=a(l);if(f.start(u),f.update(st.util.createBuffer(n.body)),f.finish())t=f.output.getBytes();else return t}else t=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?t=Ft.decryptPrivateKeyInfo(Ee.fromDer(t),e):t=Ee.fromDer(t),t!==null&&(t=Ft.privateKeyFromAsn1(t)),t};Ft.pbe.generatePkcs12Key=function(r,e,t,n,s,i){var a,u;if(typeof i>"u"||i===null){if(!("sha1"in st.md))throw new Error('"sha1" hash algorithm unavailable.');i=st.md.sha1.create()}var l=i.digestLength,f=i.blockLength,h=new st.util.ByteBuffer,m=new st.util.ByteBuffer;if(r!=null){for(u=0;u<r.length;u++)m.putInt16(r.charCodeAt(u));m.putInt16(0)}var g=m.length(),w=e.length(),y=new st.util.ByteBuffer;y.fillWithByte(t,f);var S=f*Math.ceil(w/f),E=new st.util.ByteBuffer;for(u=0;u<S;u++)E.putByte(e.at(u%w));var b=f*Math.ceil(g/f),T=new st.util.ByteBuffer;for(u=0;u<b;u++)T.putByte(m.at(u%g));var A=E;A.putBuffer(T);for(var C=Math.ceil(s/l),x=1;x<=C;x++){var B=new st.util.ByteBuffer;B.putBytes(y.bytes()),B.putBytes(A.bytes());for(var F=0;F<n;F++)i.start(),i.update(B.getBytes()),B=i.digest();var R=new st.util.ByteBuffer;for(u=0;u<f;u++)R.putByte(B.at(u%l));var H=Math.ceil(w/f)+Math.ceil(g/f),q=new st.util.ByteBuffer;for(a=0;a<H;a++){var K=new st.util.ByteBuffer(A.getBytes(f)),G=511;for(u=R.length()-1;u>=0;u--)G=G>>8,G+=R.at(u)+K.at(u),K.setAt(u,G&255);q.putBuffer(K)}A=q,h.putBuffer(B)}return h.truncate(h.length()-s),h};Ft.pbe.getCipher=function(r,e,t){switch(r){case Ft.oids.pkcs5PBES2:return Ft.pbe.getCipherForPBES2(r,e,t);case Ft.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case Ft.oids["pbewithSHAAnd40BitRC2-CBC"]:return Ft.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}};Ft.pbe.getCipherForPBES2=function(r,e,t){var n={},s=[];if(!Ee.validate(e,ZG,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=Ee.derToOid(n.kdfOid),r!==Ft.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=Ee.derToOid(n.encOid),r!==Ft.oids["aes128-CBC"]&&r!==Ft.oids["aes192-CBC"]&&r!==Ft.oids["aes256-CBC"]&&r!==Ft.oids["des-EDE3-CBC"]&&r!==Ft.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,u=st.util.createBuffer(n.kdfIterationCount);u=u.getInt(u.length()<<3);var l,f;switch(Ft.oids[r]){case"aes128-CBC":l=16,f=st.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=st.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=st.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=st.des.createDecryptionCipher;break;case"desCBC":l=8,f=st.des.createDecryptionCipher;break}var h=FO(n.prfOid),m=st.pkcs5.pbkdf2(t,a,u,l,h),g=n.encIv,w=f(m);return w.start(g),w};Ft.pbe.getCipherForPKCS12PBE=function(r,e,t){var n={},s=[];if(!Ee.validate(e,eW,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=st.util.createBuffer(n.salt),u=st.util.createBuffer(n.iterations);u=u.getInt(u.length()<<3);var l,f,h;switch(r){case Ft.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24,f=8,h=st.des.startDecrypting;break;case Ft.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5,f=8,h=o(function(S,E){var b=st.rc2.createDecryptionCipher(S,40);return b.start(E,null),b},"cipherFn");break;default:var i=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw i.oid=r,i}var m=FO(n.prfOid),g=Ft.pbe.generatePkcs12Key(t,a,1,u,l,m);m.start();var w=Ft.pbe.generatePkcs12Key(t,a,2,u,f,m);return h(g,w)};Ft.pbe.opensslDeriveBytes=function(r,e,t,n){if(typeof n>"u"||n===null){if(!("md5"in st.md))throw new Error('"md5" hash algorithm unavailable.');n=st.md.md5.create()}e===null&&(e="");for(var s=[jO(n,r+e)],i=16,a=1;i<t;++a,i+=16)s.push(jO(n,s[a-1]+r+e));return s.join("").substr(0,t)};function jO(r,e){return r.start().update(e).digest().getBytes()}o(jO,"hash");function FO(r){var e;if(!r)e="hmacWithSHA1";else if(e=Ft.oids[Ee.derToOid(r)],!e){var t=new Error("Unsupported PRF OID.");throw t.oid=r,t.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],t}return qO(e)}o(FO,"prfOidToMessageDigest");function qO(r){var e=st.md;switch(r){case"hmacWithSHA224":e=st.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()}o(qO,"prfAlgorithmToMessageDigest");function tW(r,e,t,n){var s=Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OCTETSTRING,!1,r),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,e.getBytes())]);return n!=="hmacWithSHA1"&&s.value.push(Ee.create(Ee.Class.UNIVERSAL,Ee.Type.INTEGER,!1,st.util.hexToBytes(t.toString(16))),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.SEQUENCE,!0,[Ee.create(Ee.Class.UNIVERSAL,Ee.Type.OID,!1,Ee.oidToDer(Ft.oids[n]).getBytes()),Ee.create(Ee.Class.UNIVERSAL,Ee.Type.NULL,!1,"")])),s}o(tW,"createPbkdf2Params")});var px=ye((Oce,XO)=>{"use strict";var Wh=$t();qi();ur();var tt=Wh.asn1,Jh=XO.exports=Wh.pkcs7asn1=Wh.pkcs7asn1||{};Wh.pkcs7=Wh.pkcs7||{};Wh.pkcs7.asn1=Jh;var KO={name:"ContentInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Jh.contentInfoValidator=KO;var $O={name:"EncryptedContentInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Jh.envelopedDataValidator={name:"EnvelopedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat($O)};Jh.encryptedDataValidator={name:"EncryptedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"}].concat($O)};var rW={name:"SignerInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:tt.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Jh.signedDataValidator={name:"SignedData",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},KO,{name:"SignedData.Certificates",tagClass:tt.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:tt.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SET,capture:"signerInfos",optional:!0,value:[rW]}]};Jh.recipientInfoValidator={name:"RecipientInfo",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:tt.Class.UNIVERSAL,type:tt.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:tt.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:tt.Class.UNIVERSAL,type:tt.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var dx=ye((kce,GO)=>{"use strict";var yc=$t();ur();yc.mgf=yc.mgf||{};var nW=GO.exports=yc.mgf.mgf1=yc.mgf1=yc.mgf1||{};nW.create=function(r){var e={generate:o(function(t,n){for(var s=new yc.util.ByteBuffer,i=Math.ceil(n/r.digestLength),a=0;a<i;a++){var u=new yc.util.ByteBuffer;u.putInt32(a),r.start(),r.update(t+u.getBytes()),s.putBuffer(r.digest())}return s.truncate(s.length()-n),s.getBytes()},"generate")};return e}});var JO=ye((Vce,WO)=>{"use strict";var Kw=$t();dx();WO.exports=Kw.mgf=Kw.mgf||{};Kw.mgf.mgf1=Kw.mgf1});var $w=ye((Uce,zO)=>{"use strict";var vc=$t();fi();ur();var sW=zO.exports=vc.pss=vc.pss||{};sW.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=vc.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||vc.random,u={};return u.encode=function(l,f){var h,m=f-1,g=Math.ceil(m/8),w=l.digest().getBytes();if(g<n+i+2)throw new Error("Message is too long to encrypt.");var y;s===null?y=a.getBytesSync(i):y=s.bytes();var S=new vc.util.ByteBuffer;S.fillWithByte(0,8),S.putBytes(w),S.putBytes(y),e.start(),e.update(S.getBytes());var E=e.digest().getBytes(),b=new vc.util.ByteBuffer;b.fillWithByte(0,g-i-n-2),b.putByte(1),b.putBytes(y);var T=b.getBytes(),A=g-n-1,C=t.generate(E,A),x="";for(h=0;h<A;h++)x+=String.fromCharCode(T.charCodeAt(h)^C.charCodeAt(h));var B=65280>>8*g-m&255;return x=String.fromCharCode(x.charCodeAt(0)&~B)+x.substr(1),x+E+"\xBC"},u.verify=function(l,f,h){var m,g=h-1,w=Math.ceil(g/8);if(f=f.substr(-w),w<n+i+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(f.charCodeAt(w-1)!==188)throw new Error("Encoded message does not end in 0xBC.");var y=w-n-1,S=f.substr(0,y),E=f.substr(y,n),b=65280>>8*w-g&255;if((S.charCodeAt(0)&b)!==0)throw new Error("Bits beyond keysize not zero as expected.");var T=t.generate(E,y),A="";for(m=0;m<y;m++)A+=String.fromCharCode(S.charCodeAt(m)^T.charCodeAt(m));A=String.fromCharCode(A.charCodeAt(0)&~b)+A.substr(1);var C=w-n-i-2;for(m=0;m<C;m++)if(A.charCodeAt(m)!==0)throw new Error("Leftmost octets not zero as expected");if(A.charCodeAt(C)!==1)throw new Error("Inconsistent PSS signature, 0x01 marker not found");var x=A.substr(-i),B=new vc.util.ByteBuffer;B.fillWithByte(0,8),B.putBytes(l),B.putBytes(x),e.start(),e.update(B.getBytes());var F=e.digest().getBytes();return E===F},u}});var Ww=ye((Mce,t3)=>{"use strict";var vt=$t();wu();qi();Am();ma();JO();Su();pc();$w();xm();ur();var k=vt.asn1,$e=t3.exports=vt.pki=vt.pki||{},ar=$e.oids,zr={};zr.CN=ar.commonName;zr.commonName="CN";zr.C=ar.countryName;zr.countryName="C";zr.L=ar.localityName;zr.localityName="L";zr.ST=ar.stateOrProvinceName;zr.stateOrProvinceName="ST";zr.O=ar.organizationName;zr.organizationName="O";zr.OU=ar.organizationalUnitName;zr.organizationalUnitName="OU";zr.E=ar.emailAddress;zr.emailAddress="E";var QO=vt.pki.rsa.publicKeyValidator,iW={name:"Certificate",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:k.Class.UNIVERSAL,type:k.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:k.Class.UNIVERSAL,type:k.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:k.Class.UNIVERSAL,type:k.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:k.Class.UNIVERSAL,type:k.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},QO,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:k.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:k.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:k.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},aW={name:"rsapss",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:k.Class.UNIVERSAL,type:k.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:k.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:k.Class.UNIVERSAL,type:k.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:k.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:k.Class.UNIVERSAL,type:k.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:k.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:k.Class.UNIVERSAL,type:k.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},oW={name:"CertificationRequestInfo",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},QO,{name:"CertificationRequestInfo.attributes",tagClass:k.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:k.Class.UNIVERSAL,type:k.Type.SET,constructed:!0}]}]}]},uW={name:"CertificationRequest",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[oW,{name:"CertificationRequest.signatureAlgorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:k.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:k.Class.UNIVERSAL,type:k.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};$e.RDNAttributesAsArray=function(r,e){for(var t=[],n,s,i,a=0;a<r.value.length;++a){n=r.value[a];for(var u=0;u<n.value.length;++u)i={},s=n.value[u],i.type=k.derToOid(s.value[0].value),i.value=s.value[1].value,i.valueTagClass=s.value[1].type,i.type in ar&&(i.name=ar[i.type],i.name in zr&&(i.shortName=zr[i.name])),e&&(e.update(i.type),e.update(i.value)),t.push(i)}return t};$e.CRIAttributesAsArray=function(r){for(var e=[],t=0;t<r.length;++t)for(var n=r[t],s=k.derToOid(n.value[0].value),i=n.value[1].value,a=0;a<i.length;++a){var u={};if(u.type=s,u.value=i[a].value,u.valueTagClass=i[a].type,u.type in ar&&(u.name=ar[u.type],u.name in zr&&(u.shortName=zr[u.name])),u.type===ar.extensionRequest){u.extensions=[];for(var l=0;l<u.value.length;++l)u.extensions.push($e.certificateExtensionFromAsn1(u.value[l]))}e.push(u)}return e};function Cu(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}o(Cu,"_getAttribute");var Xw=o(function(r,e,t){var n={};if(r!==ar["RSASSA-PSS"])return n;t&&(n={hash:{algorithmOid:ar.sha1},mgf:{algorithmOid:ar.mgf1,hash:{algorithmOid:ar.sha1}},saltLength:20});var s={},i=[];if(!k.validate(e,aW,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=k.derToOid(s.hashOid)),s.maskGenOid!==void 0&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=k.derToOid(s.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=k.derToOid(s.maskGenHashOid)),s.saltLength!==void 0&&(n.saltLength=s.saltLength.charCodeAt(0)),n},"_readSignatureParameters"),Gw=o(function(r){switch(ar[r.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return vt.md.sha1.create();case"md5WithRSAEncryption":return vt.md.md5.create();case"sha256WithRSAEncryption":return vt.md.sha256.create();case"sha384WithRSAEncryption":return vt.md.sha384.create();case"sha512WithRSAEncryption":return vt.md.sha512.create();case"RSASSA-PSS":return vt.md.sha256.create();default:var e=new Error("Could not compute "+r.type+" digest. Unknown signature OID.");throw e.signatureOid=r.signatureOid,e}},"_createSignatureDigest"),ZO=o(function(r){var e=r.certificate,t;switch(e.signatureOid){case ar.sha1WithRSAEncryption:case ar.sha1WithRSASignature:break;case ar["RSASSA-PSS"]:var n,s;if(n=ar[e.signatureParameters.mgf.hash.algorithmOid],n===void 0||vt.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=ar[e.signatureParameters.mgf.algorithmOid],s===void 0||vt.mgf[s]===void 0){var i=new Error("Unsupported MGF function.");throw i.oid=e.signatureParameters.mgf.algorithmOid,i.name=s,i}if(s=vt.mgf[s].create(vt.md[n].create()),n=ar[e.signatureParameters.hash.algorithmOid],n===void 0||vt.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=vt.pss.create(vt.md[n].create(),s,e.signatureParameters.saltLength);break}return e.publicKey.verify(r.md.digest().getBytes(),r.signature,t)},"_verifySignature");$e.certificateFromPem=function(r,e,t){var n=vt.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=k.fromDer(n.body,t);return $e.certificateFromAsn1(i,e)};$e.certificateToPem=function(r,e){var t={type:"CERTIFICATE",body:k.toDer($e.certificateToAsn1(r)).getBytes()};return vt.pem.encode(t,{maxline:e})};$e.publicKeyFromPem=function(r){var e=vt.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=k.fromDer(e.body);return $e.publicKeyFromAsn1(n)};$e.publicKeyToPem=function(r,e){var t={type:"PUBLIC KEY",body:k.toDer($e.publicKeyToAsn1(r)).getBytes()};return vt.pem.encode(t,{maxline:e})};$e.publicKeyToRSAPublicKeyPem=function(r,e){var t={type:"RSA PUBLIC KEY",body:k.toDer($e.publicKeyToRSAPublicKey(r)).getBytes()};return vt.pem.encode(t,{maxline:e})};$e.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||vt.md.sha1.create(),n=e.type||"RSAPublicKey",s;switch(n){case"RSAPublicKey":s=k.toDer($e.publicKeyToRSAPublicKey(r)).getBytes();break;case"SubjectPublicKeyInfo":s=k.toDer($e.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};$e.certificationRequestFromPem=function(r,e,t){var n=vt.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=k.fromDer(n.body,t);return $e.certificationRequestFromAsn1(i,e)};$e.certificationRequestToPem=function(r,e){var t={type:"CERTIFICATE REQUEST",body:k.toDer($e.certificationRequestToAsn1(r)).getBytes()};return vt.pem.encode(t,{maxline:e})};$e.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 Cu(r.issuer,e)},r.issuer.addField=function(e){di([e]),r.issuer.attributes.push(e)},r.issuer.attributes=[],r.issuer.hash=null,r.subject={},r.subject.getField=function(e){return Cu(r.subject,e)},r.subject.addField=function(e){di([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){di(e),r.subject.attributes=e,delete r.subject.uniqueId,t&&(r.subject.uniqueId=t),r.subject.hash=null},r.setIssuer=function(e,t){di(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)e3(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||vt.md.sha1.create();var n=ar[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=$e.getTBSCertificate(r);var i=k.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=Gw({signatureOid:e.signatureOid,type:"certificate"});var u=e.tbsCertificate||$e.getTBSCertificate(e),l=k.toDer(u);a.update(l.getBytes())}return a!==null&&(t=ZO({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,u=0;t&&u<n.attributes.length;++u)i=n.attributes[u],a=s.attributes[u],(i.type!==a.type||i.value!==a.value)&&(t=!1)}return t},r.issued=function(e){return e.isIssuer(r)},r.generateSubjectKeyIdentifier=function(){return $e.getPublicKeyFingerprint(r.publicKey,{type:"RSAPublicKey"})},r.verifySubjectKeyIdentifier=function(){for(var e=ar.subjectKeyIdentifier,t=0;t<r.extensions.length;++t){var n=r.extensions[t];if(n.id===e){var s=r.generateSubjectKeyIdentifier().getBytes();return vt.util.hexToBytes(n.subjectKeyIdentifier)===s}}return!1},r};$e.certificateFromAsn1=function(r,e){var t={},n=[];if(!k.validate(r,iW,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=k.derToOid(t.publicKeyOid);if(i!==$e.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=$e.createCertificate();a.version=t.certVersion?t.certVersion.charCodeAt(0):0;var u=vt.util.createBuffer(t.certSerialNumber);a.serialNumber=u.toHex(),a.signatureOid=vt.asn1.derToOid(t.certSignatureOid),a.signatureParameters=Xw(a.signatureOid,t.certSignatureParams,!0),a.siginfo.algorithmOid=vt.asn1.derToOid(t.certinfoSignatureOid),a.siginfo.parameters=Xw(a.siginfo.algorithmOid,t.certinfoSignatureParams,!1),a.signature=t.certSignature;var l=[];if(t.certValidity1UTCTime!==void 0&&l.push(k.utcTimeToDate(t.certValidity1UTCTime)),t.certValidity2GeneralizedTime!==void 0&&l.push(k.generalizedTimeToDate(t.certValidity2GeneralizedTime)),t.certValidity3UTCTime!==void 0&&l.push(k.utcTimeToDate(t.certValidity3UTCTime)),t.certValidity4GeneralizedTime!==void 0&&l.push(k.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=Gw({signatureOid:a.signatureOid,type:"certificate"});var f=k.toDer(a.tbsCertificate);a.md.update(f.getBytes())}var h=vt.md.sha1.create(),m=k.toDer(t.certIssuer);h.update(m.getBytes()),a.issuer.getField=function(y){return Cu(a.issuer,y)},a.issuer.addField=function(y){di([y]),a.issuer.attributes.push(y)},a.issuer.attributes=$e.RDNAttributesAsArray(t.certIssuer),t.certIssuerUniqueId&&(a.issuer.uniqueId=t.certIssuerUniqueId),a.issuer.hash=h.digest().toHex();var g=vt.md.sha1.create(),w=k.toDer(t.certSubject);return g.update(w.getBytes()),a.subject.getField=function(y){return Cu(a.subject,y)},a.subject.addField=function(y){di([y]),a.subject.attributes.push(y)},a.subject.attributes=$e.RDNAttributesAsArray(t.certSubject),t.certSubjectUniqueId&&(a.subject.uniqueId=t.certSubjectUniqueId),a.subject.hash=g.digest().toHex(),t.certExtensions?a.extensions=$e.certificateExtensionsFromAsn1(t.certExtensions):a.extensions=[],a.publicKey=$e.publicKeyFromAsn1(t.subjectPublicKeyInfo),a};$e.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($e.certificateExtensionFromAsn1(n.value[s]));return e};$e.certificateExtensionFromAsn1=function(r){var e={};if(e.id=k.derToOid(r.value[0].value),e.critical=!1,r.value[1].type===k.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 ar){if(e.name=ar[e.id],e.name==="keyUsage"){var t=k.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=k.fromDer(e.value);t.value.length>0&&t.value[0].type===k.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===k.Type.INTEGER?i=t.value[0].value:t.value.length>1&&(i=t.value[1].value),i!==null&&(e.pathLenConstraint=k.derToInteger(i))}else if(e.name==="extKeyUsage")for(var t=k.fromDer(e.value),a=0;a<t.value.length;++a){var u=k.derToOid(t.value[a].value);u in ar?e[ar[u]]=!0:e[u]=!0}else if(e.name==="nsCertType"){var t=k.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=k.fromDer(e.value),f=0;f<t.value.length;++f){l=t.value[f];var h={type:l.type,value:l.value};switch(e.altNames.push(h),l.type){case 1:case 2:case 6:break;case 7:h.ip=vt.util.bytesToIP(l.value);break;case 8:h.oid=k.derToOid(l.value);break;default:}}}else if(e.name==="subjectKeyIdentifier"){var t=k.fromDer(e.value);e.subjectKeyIdentifier=vt.util.bytesToHex(t.value)}}return e};$e.certificationRequestFromAsn1=function(r,e){var t={},n=[];if(!k.validate(r,uW,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=k.derToOid(t.publicKeyOid);if(i!==$e.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var a=$e.createCertificationRequest();if(a.version=t.csrVersion?t.csrVersion.charCodeAt(0):0,a.signatureOid=vt.asn1.derToOid(t.csrSignatureOid),a.signatureParameters=Xw(a.signatureOid,t.csrSignatureParams,!0),a.siginfo.algorithmOid=vt.asn1.derToOid(t.csrSignatureOid),a.siginfo.parameters=Xw(a.siginfo.algorithmOid,t.csrSignatureParams,!1),a.signature=t.csrSignature,a.certificationRequestInfo=t.certificationRequestInfo,e){a.md=Gw({signatureOid:a.signatureOid,type:"certification request"});var u=k.toDer(a.certificationRequestInfo);a.md.update(u.getBytes())}var l=vt.md.sha1.create();return a.subject.getField=function(f){return Cu(a.subject,f)},a.subject.addField=function(f){di([f]),a.subject.attributes.push(f)},a.subject.attributes=$e.RDNAttributesAsArray(t.certificationRequestInfoSubject,l),a.subject.hash=l.digest().toHex(),a.publicKey=$e.publicKeyFromAsn1(t.subjectPublicKeyInfo),a.getAttribute=function(f){return Cu(a,f)},a.addAttribute=function(f){di([f]),a.attributes.push(f)},a.attributes=$e.CRIAttributesAsArray(t.certificationRequestInfoAttributes||[]),a};$e.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 Cu(r.subject,e)},r.subject.addField=function(e){di([e]),r.subject.attributes.push(e)},r.subject.attributes=[],r.subject.hash=null,r.publicKey=null,r.attributes=[],r.getAttribute=function(e){return Cu(r,e)},r.addAttribute=function(e){di([e]),r.attributes.push(e)},r.md=null,r.setSubject=function(e){di(e),r.subject.attributes=e,r.subject.hash=null},r.setAttributes=function(e){di(e),r.attributes=e},r.sign=function(e,t){r.md=t||vt.md.sha1.create();var n=ar[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=$e.getCertificationRequestInfo(r);var i=k.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=Gw({signatureOid:r.signatureOid,type:"certification request"});var n=r.certificationRequestInfo||$e.getCertificationRequestInfo(r),s=k.toDer(n);t.update(s.getBytes())}return t!==null&&(e=ZO({certificate:r,md:t,signature:r.signature})),e},r};function zh(r){for(var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),t,n,s=r.attributes,i=0;i<s.length;++i){t=s[i];var a=t.value,u=k.Type.PRINTABLESTRING;"valueTagClass"in t&&(u=t.valueTagClass,u===k.Type.UTF8&&(a=vt.util.encodeUtf8(a))),n=k.create(k.Class.UNIVERSAL,k.Type.SET,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(t.type).getBytes()),k.create(k.Class.UNIVERSAL,u,!1,a)])]),e.value.push(n)}return e}o(zh,"_dnToAsn1");function di(r){for(var e,t=0;t<r.length;++t){if(e=r[t],typeof e.name>"u"&&(e.type&&e.type in $e.oids?e.name=$e.oids[e.type]:e.shortName&&e.shortName in zr&&(e.name=$e.oids[zr[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in $e.oids)e.type=$e.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 zr&&(e.shortName=zr[e.name]),e.type===ar.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=k.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var s=0;s<e.extensions.length;++s)e.value.push($e.certificateExtensionToAsn1(e3(e.extensions[s])))}if(typeof e.value>"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}o(di,"_fillMissingFields");function e3(r,e){if(e=e||{},typeof r.name>"u"&&r.id&&r.id in $e.oids&&(r.name=$e.oids[r.id]),typeof r.id>"u")if(r.name&&r.name in $e.oids)r.id=$e.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=k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,a)}else if(r.name==="basicConstraints")r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),r.cA&&r.value.value.push(k.create(k.Class.UNIVERSAL,k.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in r&&r.value.value.push(k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.pathLenConstraint).getBytes()));else if(r.name==="extKeyUsage"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);var u=r.value.value;for(var l in r)r[l]===!0&&(l in ar?u.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(ar[l]).getBytes())):l.indexOf(".")!==-1&&u.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.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=k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,a)}else if(r.name==="subjectAltName"||r.name==="issuerAltName"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);for(var f,h=0;h<r.altNames.length;++h){f=r.altNames[h];var a=f.value;if(f.type===7&&f.ip){if(a=vt.util.bytesFromIP(f.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else f.type===8&&(f.oid?a=k.oidToDer(k.oidToDer(f.oid)):a=k.oidToDer(a));r.value.value.push(k.create(k.Class.CONTEXT_SPECIFIC,f.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=k.create(k.Class.UNIVERSAL,k.Type.IA5STRING,!1,r.comment)}else if(r.name==="subjectKeyIdentifier"&&e.cert){var m=e.cert.generateSubjectKeyIdentifier();r.subjectKeyIdentifier=m.toHex(),r.value=k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,m.getBytes())}else if(r.name==="authorityKeyIdentifier"&&e.cert){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);var u=r.value.value;if(r.keyIdentifier){var g=r.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():r.keyIdentifier;u.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!1,g))}if(r.authorityCertIssuer){var w=[k.create(k.Class.CONTEXT_SPECIFIC,4,!0,[zh(r.authorityCertIssuer===!0?e.cert.issuer:r.authorityCertIssuer)])];u.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,w))}if(r.serialNumber){var y=vt.util.hexToBytes(r.serialNumber===!0?e.cert.serialNumber:r.serialNumber);u.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if(r.name==="cRLDistributionPoints"){r.value=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);for(var u=r.value.value,S=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]),E=k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[]),f,h=0;h<r.altNames.length;++h){f=r.altNames[h];var a=f.value;if(f.type===7&&f.ip){if(a=vt.util.bytesFromIP(f.ip),a===null){var t=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw t.extension=r,t}}else f.type===8&&(f.oid?a=k.oidToDer(k.oidToDer(f.oid)):a=k.oidToDer(a));E.value.push(k.create(k.Class.CONTEXT_SPECIFIC,f.type,!1,a))}S.value.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[E])),u.push(S)}if(typeof r.value>"u"){var t=new Error("Extension value not specified.");throw t.extension=r,t}return r}o(e3,"_fillMissingExtensionFields");function mx(r,e){switch(r){case ar["RSASSA-PSS"]:var t=[];return e.hash.algorithmOid!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.hash.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.mgf.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(e.mgf.hash.algorithmOid).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&t.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(e.saltLength).getBytes())])),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,t);default:return k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")}}o(mx,"_signatureParametersToAsn1");function lW(r){var e=k.create(k.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=k.Type.UTF8;"valueTagClass"in s&&(a=s.valueTagClass),a===k.Type.UTF8&&(i=vt.util.encodeUtf8(i));var u=!1;"valueConstructed"in s&&(u=s.valueConstructed);var l=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(s.type).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SET,!0,[k.create(k.Class.UNIVERSAL,a,u,i)])]);e.value.push(l)}return e}o(lW,"_CRIAttributesToAsn1");var cW=new Date("1950-01-01T00:00:00Z"),fW=new Date("2050-01-01T00:00:00Z");function YO(r){return r>=cW&&r<fW?k.create(k.Class.UNIVERSAL,k.Type.UTCTIME,!1,k.dateToUtcTime(r)):k.create(k.Class.UNIVERSAL,k.Type.GENERALIZEDTIME,!1,k.dateToGeneralizedTime(r))}o(YO,"_dateToAsn1");$e.getTBSCertificate=function(r){var e=YO(r.validity.notBefore),t=YO(r.validity.notAfter),n=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.version).getBytes())]),k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,vt.util.hexToBytes(r.serialNumber)),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.siginfo.algorithmOid).getBytes()),mx(r.siginfo.algorithmOid,r.siginfo.parameters)]),zh(r.issuer),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,t]),zh(r.subject),$e.publicKeyToAsn1(r.publicKey)]);return r.issuer.uniqueId&&n.value.push(k.create(k.Class.CONTEXT_SPECIFIC,1,!0,[k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.issuer.uniqueId)])),r.subject.uniqueId&&n.value.push(k.create(k.Class.CONTEXT_SPECIFIC,2,!0,[k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.subject.uniqueId)])),r.extensions.length>0&&n.value.push($e.certificateExtensionsToAsn1(r.extensions)),n};$e.getCertificationRequestInfo=function(r){var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(r.version).getBytes()),zh(r.subject),$e.publicKeyToAsn1(r.publicKey),lW(r)]);return e};$e.distinguishedNameToAsn1=function(r){return zh(r)};$e.certificateToAsn1=function(r){var e=r.tbsCertificate||$e.getTBSCertificate(r);return k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.signatureOid).getBytes()),mx(r.signatureOid,r.signatureParameters)]),k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.signature)])};$e.certificateExtensionsToAsn1=function(r){var e=k.create(k.Class.CONTEXT_SPECIFIC,3,!0,[]),t=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);e.value.push(t);for(var n=0;n<r.length;++n)t.value.push($e.certificateExtensionToAsn1(r[n]));return e};$e.certificateExtensionToAsn1=function(r){var e=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[]);e.value.push(k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.id).getBytes())),r.critical&&e.value.push(k.create(k.Class.UNIVERSAL,k.Type.BOOLEAN,!1,"\xFF"));var t=r.value;return typeof r.value!="string"&&(t=k.toDer(t).getBytes()),e.value.push(k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,t)),e};$e.certificationRequestToAsn1=function(r){var e=r.certificationRequestInfo||$e.getCertificationRequestInfo(r);return k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[e,k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(r.signatureOid).getBytes()),mx(r.signatureOid,r.signatureParameters)]),k.create(k.Class.UNIVERSAL,k.Type.BITSTRING,!1,"\0"+r.signature)])};$e.createCaStore=function(r){var e={certs:{}};e.getIssuer=function(a){var u=t(a.issuer);return u},e.addCertificate=function(a){if(typeof a=="string"&&(a=vt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))if(a.subject.hash in e.certs){var u=e.certs[a.subject.hash];vt.util.isArray(u)||(u=[u]),u.push(a),e.certs[a.subject.hash]=u}else e.certs[a.subject.hash]=a},e.hasCertificate=function(a){typeof a=="string"&&(a=vt.pki.certificateFromPem(a));var u=t(a.subject);if(!u)return!1;vt.util.isArray(u)||(u=[u]);for(var l=k.toDer($e.certificateToAsn1(a)).getBytes(),f=0;f<u.length;++f){var h=k.toDer($e.certificateToAsn1(u[f])).getBytes();if(l===h)return!0}return!1},e.listAllCertificates=function(){var a=[];for(var u in e.certs)if(e.certs.hasOwnProperty(u)){var l=e.certs[u];if(!vt.util.isArray(l))a.push(l);else for(var f=0;f<l.length;++f)a.push(l[f])}return a},e.removeCertificate=function(a){var u;if(typeof a=="string"&&(a=vt.pki.certificateFromPem(a)),n(a.subject),!e.hasCertificate(a))return null;var l=t(a.subject);if(!vt.util.isArray(l))return u=e.certs[a.subject.hash],delete e.certs[a.subject.hash],u;for(var f=k.toDer($e.certificateToAsn1(a)).getBytes(),h=0;h<l.length;++h){var m=k.toDer($e.certificateToAsn1(l[h])).getBytes();f===m&&(u=l[h],l.splice(h,1))}return l.length===0&&delete e.certs[a.subject.hash],u};function t(a){return n(a),e.certs[a.hash]||null}o(t,"getBySubject");function n(a){if(!a.hash){var u=vt.md.sha1.create();a.attributes=$e.RDNAttributesAsArray(zh(a),u),a.hash=u.digest().toHex()}}if(o(n,"ensureSubjectHasHash"),r)for(var s=0;s<r.length;++s){var i=r[s];e.addCertificate(i)}return e};$e.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"};$e.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,u=0;do{var l=e.shift(),f=null,h=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(a={message:"Certificate is not valid yet or has expired.",error:$e.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),a===null){if(f=e[0]||r.getIssuer(l),f===null&&l.isIssuer(l)&&(h=!0,f=l),f){var m=f;vt.util.isArray(m)||(m=[m]);for(var g=!1;!g&&m.length>0;){f=m.shift();try{g=f.verify(l)}catch{}}g||(a={message:"Certificate signature is invalid.",error:$e.certificateError.bad_certificate})}a===null&&(!f||h)&&!r.hasCertificate(l)&&(a={message:"Certificate is not trusted.",error:$e.certificateError.unknown_ca})}if(a===null&&f&&!l.isIssuer(f)&&(a={message:"Certificate issuer is invalid.",error:$e.certificateError.bad_certificate}),a===null)for(var w={keyUsage:!0,basicConstraints:!0},y=0;a===null&&y<l.extensions.length;++y){var S=l.extensions[y];S.critical&&!(S.name in w)&&(a={message:"Certificate has an unsupported critical extension.",error:$e.certificateError.unsupported_certificate})}if(a===null&&(!i||e.length===0&&(!f||h))){var E=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(b!==null&&(!b.keyCertSign||E===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:$e.certificateError.bad_certificate}),a===null&&E!==null&&!E.cA&&(a={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:$e.certificateError.bad_certificate}),a===null&&b!==null&&"pathLenConstraint"in E){var T=u-1;T>E.pathLenConstraint&&(a={message:"Certificate basicConstraints pathLenConstraint violated.",error:$e.certificateError.bad_certificate})}}var A=a===null?!0:a.error,C=t.verify?t.verify(A,u,n):A;if(C===!0)a=null;else throw A===!0&&(a={message:"The application rejected the certificate.",error:$e.certificateError.bad_certificate}),(C||C===0)&&(typeof C=="object"&&!vt.util.isArray(C)?(C.message&&(a.message=C.message),C.error&&(a.error=C.error)):typeof C=="string"&&(a.error=C)),a;i=!1,++u}while(e.length>0);return!0}});var yx=ye((Fce,n3)=>{"use strict";var Dr=$t();qi();Hh();Su();px();hx();fi();xm();Gh();ur();Ww();var Y=Dr.asn1,Yt=Dr.pki,Tm=n3.exports=Dr.pkcs12=Dr.pkcs12||{},r3={name:"ContentInfo",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},hW={name:"PFX",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Y.Class.UNIVERSAL,type:Y.Type.INTEGER,constructed:!1,capture:"version"},r3,{name:"PFX.macData",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:Y.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Y.Class.UNIVERSAL,type:Y.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},pW={name:"SafeBag",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},dW={name:"Attribute",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SET,constructed:!0,capture:"values"}]},mW={name:"CertBag",tagClass:Y.Class.UNIVERSAL,type:Y.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Y.Class.UNIVERSAL,type:Y.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Y.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Y.Class.UNIVERSAL,type:Y.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function Nm(r,e,t,n){for(var s=[],i=0;i<r.length;i++)for(var a=0;a<r[i].safeBags.length;a++){var u=r[i].safeBags[a];if(!(n!==void 0&&u.type!==n)){if(e===null){s.push(u);continue}u.attributes[e]!==void 0&&u.attributes[e].indexOf(t)>=0&&s.push(u)}}return s}o(Nm,"_getBagsByAttribute");Tm.pkcs12FromAsn1=function(r,e,t){typeof e=="string"?(t=e,e=!0):e===void 0&&(e=!0);var n={},s=[];if(!Y.validate(r,hW,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:o(function(E){var b={},T;return"localKeyId"in E?T=E.localKeyId:"localKeyIdHex"in E&&(T=Dr.util.hexToBytes(E.localKeyIdHex)),T===void 0&&!("friendlyName"in E)&&"bagType"in E&&(b[E.bagType]=Nm(a.safeContents,null,null,E.bagType)),T!==void 0&&(b.localKeyId=Nm(a.safeContents,"localKeyId",T,E.bagType)),"friendlyName"in E&&(b.friendlyName=Nm(a.safeContents,"friendlyName",E.friendlyName,E.bagType)),b},"getBags"),getBagsByFriendlyName:o(function(E,b){return Nm(a.safeContents,"friendlyName",E,b)},"getBagsByFriendlyName"),getBagsByLocalKeyId:o(function(E,b){return Nm(a.safeContents,"localKeyId",E,b)},"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(Y.derToOid(n.contentType)!==Yt.oids.data){var i=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw i.oid=Y.derToOid(n.contentType),i}var u=n.content.value[0];if(u.tagClass!==Y.Class.UNIVERSAL||u.type!==Y.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(u=gx(u),n.mac){var l=null,f=0,h=Y.derToOid(n.macAlgorithm);switch(h){case Yt.oids.sha1:l=Dr.md.sha1.create(),f=20;break;case Yt.oids.sha256:l=Dr.md.sha256.create(),f=32;break;case Yt.oids.sha384:l=Dr.md.sha384.create(),f=48;break;case Yt.oids.sha512:l=Dr.md.sha512.create(),f=64;break;case Yt.oids.md5:l=Dr.md.md5.create(),f=16;break}if(l===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+h);var m=new Dr.util.ByteBuffer(n.macSalt),g="macIterations"in n?parseInt(Dr.util.bytesToHex(n.macIterations),16):1,w=Tm.generateKey(t,m,3,g,f,l),y=Dr.hmac.create();y.start(l,w),y.update(u.value);var S=y.getMac();if(S.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return gW(a,u.value,e,t),a};function gx(r){if(r.composed||r.constructed){for(var e=Dr.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}o(gx,"_decodePkcs7Data");function gW(r,e,t,n){if(e=Y.fromDer(e,t),e.tagClass!==Y.Class.UNIVERSAL||e.type!==Y.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={},u=[];if(!Y.validate(i,r3,a,u)){var l=new Error("Cannot read ContentInfo.");throw l.errors=u,l}var f={encrypted:!1},h=null,m=a.content.value[0];switch(Y.derToOid(a.contentType)){case Yt.oids.data:if(m.tagClass!==Y.Class.UNIVERSAL||m.type!==Y.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");h=gx(m).value;break;case Yt.oids.encryptedData:h=yW(m,n),f.encrypted=!0;break;default:var l=new Error("Unsupported PKCS#12 contentType.");throw l.contentType=Y.derToOid(a.contentType),l}f.safeBags=vW(h,t,n),r.safeContents.push(f)}}o(gW,"_decodeAuthenticatedSafe");function yW(r,e){var t={},n=[];if(!Y.validate(r,Dr.pkcs7.asn1.encryptedDataValidator,t,n)){var s=new Error("Cannot read EncryptedContentInfo.");throw s.errors=n,s}var i=Y.derToOid(t.contentType);if(i!==Yt.oids.data){var s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw s.oid=i,s}i=Y.derToOid(t.encAlgorithm);var a=Yt.pbe.getCipher(i,t.encParameter,e),u=gx(t.encryptedContentAsn1),l=Dr.util.createBuffer(u.value);if(a.update(l),!a.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return a.output.getBytes()}o(yW,"_decryptSafeContents");function vW(r,e,t){if(!e&&r.length===0)return[];if(r=Y.fromDer(r,e),r.tagClass!==Y.Class.UNIVERSAL||r.type!==Y.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={},u=[];if(!Y.validate(i,pW,a,u)){var l=new Error("Cannot read SafeBag.");throw l.errors=u,l}var f={type:Y.derToOid(a.bagId),attributes:wW(a.bagAttributes)};n.push(f);var h,m,g=a.bagValue.value[0];switch(f.type){case Yt.oids.pkcs8ShroudedKeyBag:if(g=Yt.decryptPrivateKeyInfo(g,t),g===null)throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case Yt.oids.keyBag:try{f.key=Yt.privateKeyFromAsn1(g)}catch{f.key=null,f.asn1=g}continue;case Yt.oids.certBag:h=mW,m=o(function(){if(Y.derToOid(a.certId)!==Yt.oids.x509Certificate){var y=new Error("Unsupported certificate type, only X.509 supported.");throw y.oid=Y.derToOid(a.certId),y}var S=Y.fromDer(a.cert,e);try{f.cert=Yt.certificateFromAsn1(S,!0)}catch{f.cert=null,f.asn1=S}},"decoder");break;default:var l=new Error("Unsupported PKCS#12 SafeBag type.");throw l.oid=f.type,l}if(h!==void 0&&!Y.validate(g,h,a,u)){var l=new Error("Cannot read PKCS#12 "+h.name);throw l.errors=u,l}m()}return n}o(vW,"_decodeSafeContents");function wW(r){var e={};if(r!==void 0)for(var t=0;t<r.length;++t){var n={},s=[];if(!Y.validate(r[t],dW,n,s)){var i=new Error("Cannot read PKCS#12 BagAttribute.");throw i.errors=s,i}var a=Y.derToOid(n.oid);if(Yt.oids[a]!==void 0){e[Yt.oids[a]]=[];for(var u=0;u<n.values.length;++u)e[Yt.oids[a]].push(n.values[u].value)}}return e}o(wW,"_decodeBagAttributes");Tm.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=Dr.util.hexToBytes(s);else if(n.generateLocalKeyId)if(e){var a=Dr.util.isArray(e)?e[0]:e;typeof a=="string"&&(a=Yt.certificateFromPem(a));var u=Dr.md.sha1.create();u.update(Y.toDer(Yt.certificateToAsn1(a)).getBytes()),s=u.digest().getBytes()}else s=Dr.random.getBytes(20);var l=[];s!==null&&l.push(Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.localKeyId).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,s)])])),"friendlyName"in n&&l.push(Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.friendlyName).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.BMPSTRING,!1,n.friendlyName)])])),l.length>0&&(i=Y.create(Y.Class.UNIVERSAL,Y.Type.SET,!0,l));var f=[],h=[];e!==null&&(Dr.util.isArray(e)?h=e:h=[e]);for(var m=[],g=0;g<h.length;++g){e=h[g],typeof e=="string"&&(e=Yt.certificateFromPem(e));var w=g===0?i:void 0,y=Yt.certificateToAsn1(e),S=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.certBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.x509Certificate).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(y).getBytes())])])]),w]);m.push(S)}if(m.length>0){var E=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,m),b=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(E).getBytes())])]);f.push(b)}var T=null;if(r!==null){var A=Yt.wrapRsaPrivateKey(Yt.privateKeyToAsn1(r));t===null?T=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.keyBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[A]),i]):T=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.pkcs8ShroudedKeyBag).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Yt.encryptPrivateKeyInfo(A,t,n)]),i]);var C=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[T]),x=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(C).getBytes())])]);f.push(x)}var B=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,f),F;if(n.useMac){var u=Dr.md.sha1.create(),R=new Dr.util.ByteBuffer(Dr.random.getBytes(n.saltSize)),H=n.count,r=Tm.generateKey(t,R,3,H,20),q=Dr.hmac.create();q.start(u,r),q.update(Y.toDer(B).getBytes());var K=q.getMac();F=Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.sha1).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.NULL,!1,"")]),Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,K.getBytes())]),Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,R.getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.INTEGER,!1,Y.integerToDer(H).getBytes())])}return Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.INTEGER,!1,Y.integerToDer(3).getBytes()),Y.create(Y.Class.UNIVERSAL,Y.Type.SEQUENCE,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OID,!1,Y.oidToDer(Yt.oids.data).getBytes()),Y.create(Y.Class.CONTEXT_SPECIFIC,0,!0,[Y.create(Y.Class.UNIVERSAL,Y.Type.OCTETSTRING,!1,Y.toDer(B).getBytes())])]),F])};Tm.generateKey=Dr.pbe.generatePkcs12Key});var wx=ye((Hce,s3)=>{"use strict";var bu=$t();qi();Su();hx();pc();Uw();yx();$w();xm();ur();Ww();var vx=bu.asn1,Yh=s3.exports=bu.pki=bu.pki||{};Yh.pemToDer=function(r){var e=bu.pem.decode(r)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return bu.util.createBuffer(e.body)};Yh.privateKeyFromPem=function(r){var e=bu.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=vx.fromDer(e.body);return Yh.privateKeyFromAsn1(n)};Yh.privateKeyToPem=function(r,e){var t={type:"RSA PRIVATE KEY",body:vx.toDer(Yh.privateKeyToAsn1(r)).getBytes()};return bu.pem.encode(t,{maxline:e})};Yh.privateKeyInfoToPem=function(r,e){var t={type:"PRIVATE KEY",body:vx.toDer(r).getBytes()};return bu.pem.encode(t,{maxline:e})}});var xx=ye((Kce,h3)=>{"use strict";var ke=$t();qi();Hh();Ow();pc();wx();fi();Gh();ur();var Qw=o(function(r,e,t,n){var s=ke.util.createBuffer(),i=r.length>>1,a=i+(r.length&1),u=r.substr(0,a),l=r.substr(i,a),f=ke.util.createBuffer(),h=ke.hmac.create();t=e+t;var m=Math.ceil(n/16),g=Math.ceil(n/20);h.start("MD5",u);var w=ke.util.createBuffer();f.putBytes(t);for(var y=0;y<m;++y)h.start(null,null),h.update(f.getBytes()),f.putBuffer(h.digest()),h.start(null,null),h.update(f.bytes()+t),w.putBuffer(h.digest());h.start("SHA1",l);var S=ke.util.createBuffer();f.clear(),f.putBytes(t);for(var y=0;y<g;++y)h.start(null,null),h.update(f.getBytes()),f.putBuffer(h.digest()),h.start(null,null),h.update(f.bytes()+t),S.putBuffer(h.digest());return s.putBytes(ke.util.xorBytes(w.getBytes(),S.getBytes(),n)),s},"prf_TLS1"),SW=o(function(r,e,t){var n=ke.hmac.create();n.start("SHA1",r);var s=ke.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"),EW=o(function(r,e,t){var n=!1;try{var s=r.deflate(e.fragment.getBytes());e.fragment=ke.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"deflate"),AW=o(function(r,e,t){var n=!1;try{var s=r.inflate(e.fragment.getBytes());e.fragment=ke.util.createBuffer(s),e.length=s.length,n=!0}catch{}return n},"inflate"),Xs=o(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 ke.util.createBuffer(r.getBytes(t))},"readVector"),mi=o(function(r,e,t){r.putInt(t.length(),e<<3),r.putBuffer(t)},"writeVector"),U={};U.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}};U.SupportedVersions=[U.Versions.TLS_1_1,U.Versions.TLS_1_0];U.Version=U.SupportedVersions[0];U.MaxFragment=15360;U.ConnectionEnd={server:0,client:1};U.PRFAlgorithm={tls_prf_sha256:0};U.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};U.CipherType={stream:0,block:1,aead:2};U.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};U.CompressionMethod={none:0,deflate:1};U.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24};U.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};U.Alert={};U.Alert.Level={warning:1,fatal:2};U.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};U.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};U.CipherSuites={};U.getCipherSuite=function(r){var e=null;for(var t in U.CipherSuites){var n=U.CipherSuites[t];if(n.id[0]===r.charCodeAt(0)&&n.id[1]===r.charCodeAt(1)){e=n;break}}return e};U.handleUnexpected=function(r,e){var t=!r.open&&r.entity===U.ConnectionEnd.client;t||r.error(r,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unexpected_message}})};U.handleHelloRequest=function(r,e,t){!r.handshaking&&r.handshakes>0&&(U.queue(r,U.createAlert(r,{level:U.Alert.Level.warning,description:U.Alert.Description.no_renegotiation})),U.flush(r)),r.process()};U.parseHelloMessage=function(r,e,t){var n=null,s=r.entity===U.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:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});else{var i=e.fragment,a=i.length();if(n={version:{major:i.getByte(),minor:i.getByte()},random:ke.util.createBuffer(i.getBytes(32)),session_id:Xs(i,1),extensions:[]},s?(n.cipher_suite=i.getBytes(2),n.compression_method=i.getByte()):(n.cipher_suites=Xs(i,2),n.compression_methods=Xs(i,1)),a=t-(a-i.length()),a>0){for(var u=Xs(i,2);u.length()>0;)n.extensions.push({type:[u.getByte(),u.getByte()],data:Xs(u,2)});if(!s)for(var l=0;l<n.extensions.length;++l){var f=n.extensions[l];if(f.type[0]===0&&f.type[1]===0)for(var h=Xs(f.data,2);h.length()>0;){var m=h.getByte();if(m!==0)break;r.session.extensions.server_name.serverNameList.push(Xs(h,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:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}});if(s)r.session.cipherSuite=U.getCipherSuite(n.cipher_suite);else for(var g=ke.util.createBuffer(n.cipher_suites.bytes());g.length()>0&&(r.session.cipherSuite=U.getCipherSuite(g.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:U.Alert.Level.fatal,description:U.Alert.Description.handshake_failure},cipherSuite:ke.util.bytesToHex(n.cipher_suite)});s?r.session.compressionMethod=n.compression_method:r.session.compressionMethod=U.CompressionMethod.none}return n};U.createSecurityParameters=function(r,e){var t=r.entity===U.ConnectionEnd.client,n=e.random.bytes(),s=t?r.session.sp.client_random:n,i=t?n:U.createRandom().getBytes();r.session.sp={entity:r.entity,prf_algorithm:U.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}};U.handleServerHello=function(r,e,t){var n=U.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:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}});r.session.version=r.version;var s=n.session_id.bytes();s.length>0&&s===r.session.id?(r.expect=o3,r.session.resuming=!0,r.session.sp.server_random=n.random.bytes()):(r.expect=bW,r.session.resuming=!1,U.createSecurityParameters(r,n)),r.session.id=s,r.process()}};U.handleClientHello=function(r,e,t){var n=U.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=ke.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,u=1;u<U.SupportedVersions.length&&(a=U.SupportedVersions[u],!(a.minor<=n.version.minor));++u);r.version={major:a.major,minor:a.minor},r.session.version=r.version}i!==null?(r.expect=Cx,r.session.resuming=!0,r.session.sp.client_random=n.random.bytes()):(r.expect=r.verifyClient!==!1?_W:Ax,r.session.resuming=!1,U.createSecurityParameters(r,n)),r.open=!0,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerHello(r)})),r.session.resuming?(U.queue(r,U.createRecord(r,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),r.state.pending=U.createConnectionState(r),r.state.current.write=r.state.pending.write,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createFinished(r)}))):(U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificate(r)})),r.fail||(U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerKeyExchange(r)})),r.verifyClient!==!1&&U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificateRequest(r)})),U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createServerHelloDone(r)})))),U.flush(r),r.process()}};U.handleCertificate=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_list:Xs(n,3)},i,a,u=[];try{for(;s.certificate_list.length()>0;)i=Xs(s.certificate_list,3),a=ke.asn1.fromDer(i),i=ke.pki.certificateFromAsn1(a,!0),u.push(i)}catch(f){return r.error(r,{message:"Could not parse certificate list.",cause:f,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate}})}var l=r.entity===U.ConnectionEnd.client;(l||r.verifyClient===!0)&&u.length===0?r.error(r,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}}):u.length===0?r.expect=l?i3:Ax:(l?r.session.serverCertificate=u[0]:r.session.clientCertificate=u[0],U.verifyCertificateChain(r,u)&&(r.expect=l?i3:Ax)),r.process()};U.handleServerKeyExchange=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unsupported_certificate}});r.expect=xW,r.process()};U.handleClientKeyExchange=function(r,e,t){if(t<48)return r.error(r,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unsupported_certificate}});var n=e.fragment,s={enc_pre_master_secret:Xs(n,2).getBytes()},i=null;if(r.getPrivateKey)try{i=r.getPrivateKey(r,r.session.serverCertificate),i=ke.pki.privateKeyFromPem(i)}catch(l){r.error(r,{message:"Could not get private key.",cause:l,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}})}if(i===null)return r.error(r,{message:"No private key set.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}});try{var a=r.session.sp;a.pre_master_secret=i.decrypt(s.enc_pre_master_secret);var u=r.session.clientHelloVersion;if(u.major!==a.pre_master_secret.charCodeAt(0)||u.minor!==a.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{a.pre_master_secret=ke.random.getBytes(48)}r.expect=Cx,r.session.clientCertificate!==null&&(r.expect=RW),r.process()};U.handleCertificateRequest=function(r,e,t){if(t<3)return r.error(r,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment,s={certificate_types:Xs(n,1),certificate_authorities:Xs(n,2)};r.session.certificateRequest=s,r.expect=NW,r.process()};U.handleCertificateVerify=function(r,e,t){if(t<2)return r.error(r,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var s=n.bytes();n.read+=4;var i={signature:Xs(n,2).getBytes()},a=ke.util.createBuffer();a.putBuffer(r.session.md5.digest()),a.putBuffer(r.session.sha1.digest()),a=a.getBytes();try{var u=r.session.clientCertificate;if(!u.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:U.Alert.Level.fatal,description:U.Alert.Description.handshake_failure}})}r.expect=Cx,r.process()};U.handleServerHelloDone=function(r,e,t){if(t>0)return r.error(r,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.record_overflow}});if(r.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.insufficient_security}},s=0,i=r.verify(r,n.alert.description,s,[]);if(i!==!0)return(i||i===0)&&(typeof i=="object"&&!ke.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=U.createRecord(r,{type:U.ContentType.handshake,data:U.createCertificate(r)}),U.queue(r,e)),e=U.createRecord(r,{type:U.ContentType.handshake,data:U.createClientKeyExchange(r)}),U.queue(r,e),r.expect=BW;var a=o(function(u,l){u.session.certificateRequest!==null&&u.session.clientCertificate!==null&&U.queue(u,U.createRecord(u,{type:U.ContentType.handshake,data:U.createCertificateVerify(u,l)})),U.queue(u,U.createRecord(u,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),u.state.pending=U.createConnectionState(u),u.state.current.write=u.state.pending.write,U.queue(u,U.createRecord(u,{type:U.ContentType.handshake,data:U.createFinished(u)})),u.expect=o3,U.flush(u),u.process()},"callback");if(r.session.certificateRequest===null||r.session.clientCertificate===null)return a(r,null);U.getClientSignature(r,a)};U.handleChangeCipherSpec=function(r,e){if(e.fragment.getByte()!==1)return r.error(r,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.illegal_parameter}});var t=r.entity===U.ConnectionEnd.client;(r.session.resuming&&t||!r.session.resuming&&!t)&&(r.state.pending=U.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?TW:PW,r.process()};U.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=ke.util.createBuffer(),n.putBuffer(r.session.md5.digest()),n.putBuffer(r.session.sha1.digest());var a=r.entity===U.ConnectionEnd.client,u=a?"server finished":"client finished",l=r.session.sp,f=12,h=Qw;if(n=h(l.master_secret,u,n.getBytes(),f),n.getBytes()!==i)return r.error(r,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.decrypt_error}});r.session.md5.update(s),r.session.sha1.update(s),(r.session.resuming&&a||!r.session.resuming&&!a)&&(U.queue(r,U.createRecord(r,{type:U.ContentType.change_cipher_spec,data:U.createChangeCipherSpec()})),r.state.current.write=r.state.pending.write,r.state.pending=null,U.queue(r,U.createRecord(r,{type:U.ContentType.handshake,data:U.createFinished(r)}))),r.expect=a?IW:OW,r.handshaking=!1,++r.handshakes,r.peerCertificate=a?r.session.serverCertificate:r.session.clientCertificate,U.flush(r),r.isConnected=!0,r.connected(r),r.process()};U.handleAlert=function(r,e){var t=e.fragment,n={level:t.getByte(),description:t.getByte()},s;switch(n.description){case U.Alert.Description.close_notify:s="Connection closed.";break;case U.Alert.Description.unexpected_message:s="Unexpected message.";break;case U.Alert.Description.bad_record_mac:s="Bad record MAC.";break;case U.Alert.Description.decryption_failed:s="Decryption failed.";break;case U.Alert.Description.record_overflow:s="Record overflow.";break;case U.Alert.Description.decompression_failure:s="Decompression failed.";break;case U.Alert.Description.handshake_failure:s="Handshake failure.";break;case U.Alert.Description.bad_certificate:s="Bad certificate.";break;case U.Alert.Description.unsupported_certificate:s="Unsupported certificate.";break;case U.Alert.Description.certificate_revoked:s="Certificate revoked.";break;case U.Alert.Description.certificate_expired:s="Certificate expired.";break;case U.Alert.Description.certificate_unknown:s="Certificate unknown.";break;case U.Alert.Description.illegal_parameter:s="Illegal parameter.";break;case U.Alert.Description.unknown_ca:s="Unknown certificate authority.";break;case U.Alert.Description.access_denied:s="Access denied.";break;case U.Alert.Description.decode_error:s="Decode error.";break;case U.Alert.Description.decrypt_error:s="Decrypt error.";break;case U.Alert.Description.export_restriction:s="Export restriction.";break;case U.Alert.Description.protocol_version:s="Unsupported protocol version.";break;case U.Alert.Description.insufficient_security:s="Insufficient security.";break;case U.Alert.Description.internal_error:s="Internal error.";break;case U.Alert.Description.user_canceled:s="User canceled.";break;case U.Alert.Description.no_renegotiation:s="Renegotiation not supported.";break;default:s="Unknown error.";break}if(n.description===U.Alert.Description.close_notify)return r.close();r.error(r,{message:s,send:!1,origin:r.entity===U.ConnectionEnd.client?"server":"client",alert:n}),r.process()};U.handleHandshake=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt24();if(s>t.length())return r.fragmented=e,e.fragment=ke.util.createBuffer(),t.read-=4,r.process();r.fragmented=null,t.read-=4;var i=t.bytes(s+4);t.read+=4,n in Yw[r.entity][r.expect]?(r.entity===U.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:ke.md.md5.create(),sha1:ke.md.sha1.create()}),n!==U.HandshakeType.hello_request&&n!==U.HandshakeType.certificate_verify&&n!==U.HandshakeType.finished&&(r.session.md5.update(i),r.session.sha1.update(i)),Yw[r.entity][r.expect][n](r,e,s)):U.handleUnexpected(r,e)};U.handleApplicationData=function(r,e){r.data.putBuffer(e.fragment),r.dataReady(r),r.process()};U.handleHeartbeat=function(r,e){var t=e.fragment,n=t.getByte(),s=t.getInt16(),i=t.getBytes(s);if(n===U.HeartbeatMessageType.heartbeat_request){if(r.handshaking||s>i.length)return r.process();U.queue(r,U.createRecord(r,{type:U.ContentType.heartbeat,data:U.createHeartbeat(U.HeartbeatMessageType.heartbeat_response,i)})),U.flush(r)}else if(n===U.HeartbeatMessageType.heartbeat_response){if(i!==r.expectedHeartbeatPayload)return r.process();r.heartbeatReceived&&r.heartbeatReceived(r,ke.util.createBuffer(i))}r.process()};var CW=0,bW=1,i3=2,xW=3,NW=4,o3=5,TW=6,IW=7,BW=8,DW=0,_W=1,Ax=2,RW=3,Cx=4,PW=5,OW=6,V=U.handleUnexpected,u3=U.handleChangeCipherSpec,kn=U.handleAlert,fs=U.handleHandshake,l3=U.handleApplicationData,Ln=U.handleHeartbeat,bx=[];bx[U.ConnectionEnd.client]=[[V,kn,fs,V,Ln],[V,kn,fs,V,Ln],[V,kn,fs,V,Ln],[V,kn,fs,V,Ln],[V,kn,fs,V,Ln],[u3,kn,V,V,Ln],[V,kn,fs,V,Ln],[V,kn,fs,l3,Ln],[V,kn,fs,V,Ln]];bx[U.ConnectionEnd.server]=[[V,kn,fs,V,Ln],[V,kn,fs,V,Ln],[V,kn,fs,V,Ln],[V,kn,fs,V,Ln],[u3,kn,V,V,Ln],[V,kn,fs,V,Ln],[V,kn,fs,l3,Ln],[V,kn,fs,V,Ln]];var xu=U.handleHelloRequest,kW=U.handleServerHello,c3=U.handleCertificate,a3=U.handleServerKeyExchange,Sx=U.handleCertificateRequest,Jw=U.handleServerHelloDone,f3=U.handleFinished,Yw=[];Yw[U.ConnectionEnd.client]=[[V,V,kW,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[xu,V,V,V,V,V,V,V,V,V,V,c3,a3,Sx,Jw,V,V,V,V,V,V],[xu,V,V,V,V,V,V,V,V,V,V,V,a3,Sx,Jw,V,V,V,V,V,V],[xu,V,V,V,V,V,V,V,V,V,V,V,V,Sx,Jw,V,V,V,V,V,V],[xu,V,V,V,V,V,V,V,V,V,V,V,V,V,Jw,V,V,V,V,V,V],[xu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[xu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,f3],[xu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[xu,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V]];var LW=U.handleClientHello,VW=U.handleClientKeyExchange,UW=U.handleCertificateVerify;Yw[U.ConnectionEnd.server]=[[V,LW,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,c3,V,V,V,V,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,VW,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,UW,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,f3],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V],[V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V]];U.generateKeys=function(r,e){var t=Qw,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===U.Versions.TLS_1_0.major&&r.version.minor===U.Versions.TLS_1_0.minor;i&&(s+=2*e.fixed_iv_length);var a=t(e.master_secret,"key expansion",n,s),u={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&&(u.client_write_IV=a.getBytes(e.fixed_iv_length),u.server_write_IV=a.getBytes(e.fixed_iv_length)),u};U.createConnectionState=function(r){var e=r.entity===U.ConnectionEnd.client,t=o(function(){var i={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:o(function(a){return!0},"cipherFunction"),compressionState:null,compressFunction:o(function(a){return!0},"compressFunction"),updateSequenceNumber:o(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:U.Alert.Level.fatal,description:U.Alert.Description.decompression_failure}}):i.error(i,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.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:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}):i.error(i,{message:"Could not compress record.",send:!1,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}),!i.fail},r.session){var s=r.session.sp;switch(r.session.cipherSuite.initSecurityParameters(s),s.keys=U.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 U.CompressionMethod.none:break;case U.CompressionMethod.deflate:n.read.compressFunction=AW,n.write.compressFunction=EW;break;default:throw new Error("Unsupported compression algorithm.")}}return n};U.createRandom=function(){var r=new Date,e=+r+r.getTimezoneOffset()*6e4,t=ke.util.createBuffer();return t.putInt32(e),t.putBytes(ke.random.getBytes(28)),t};U.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};U.createAlert=function(r,e){var t=ke.util.createBuffer();return t.putByte(e.level),t.putByte(e.description),U.createRecord(r,{type:U.ContentType.alert,data:t})};U.createClientHello=function(r){r.session.clientHelloVersion={major:r.version.major,minor:r.version.minor};for(var e=ke.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=ke.util.createBuffer();i.putByte(U.CompressionMethod.none);var a=i.length(),u=ke.util.createBuffer();if(r.virtualHost){var l=ke.util.createBuffer();l.putByte(0),l.putByte(0);var f=ke.util.createBuffer();f.putByte(0),mi(f,2,ke.util.createBuffer(r.virtualHost));var h=ke.util.createBuffer();mi(h,2,f),mi(l,2,h),u.putBuffer(l)}var m=u.length();m>0&&(m+=2);var g=r.session.id,w=g.length+1+2+4+28+2+s+1+a+m,y=ke.util.createBuffer();return y.putByte(U.HandshakeType.client_hello),y.putInt24(w),y.putByte(r.version.major),y.putByte(r.version.minor),y.putBytes(r.session.sp.client_random),mi(y,1,ke.util.createBuffer(g)),mi(y,2,e),mi(y,1,i),m>0&&mi(y,2,u),y};U.createServerHello=function(r){var e=r.session.id,t=e.length+1+2+4+28+2+1,n=ke.util.createBuffer();return n.putByte(U.HandshakeType.server_hello),n.putInt24(t),n.putByte(r.version.major),n.putByte(r.version.minor),n.putBytes(r.session.sp.server_random),mi(n,1,ke.util.createBuffer(e)),n.putByte(r.session.cipherSuite.id[0]),n.putByte(r.session.cipherSuite.id[1]),n.putByte(r.session.compressionMethod),n};U.createCertificate=function(r){var e=r.entity===U.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=ke.util.createBuffer();if(t!==null)try{ke.util.isArray(t)||(t=[t]);for(var i=null,a=0;a<t.length;++a){var u=ke.pem.decode(t[a])[0];if(u.type!=="CERTIFICATE"&&u.type!=="X509 CERTIFICATE"&&u.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=u.type,l}if(u.procType&&u.procType.type==="ENCRYPTED")throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var f=ke.util.createBuffer(u.body);i===null&&(i=ke.asn1.fromDer(f.bytes(),!1));var h=ke.util.createBuffer();mi(h,3,f),s.putBuffer(h)}t=ke.pki.certificateFromAsn1(i),e?r.session.clientCertificate=t:r.session.serverCertificate=t}catch(w){return r.error(r,{message:"Could not send certificate list.",cause:w,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate}})}var m=3+s.length(),g=ke.util.createBuffer();return g.putByte(U.HandshakeType.certificate),g.putInt24(m),mi(g,3,s),g};U.createClientKeyExchange=function(r){var e=ke.util.createBuffer();e.putByte(r.session.clientHelloVersion.major),e.putByte(r.session.clientHelloVersion.minor),e.putBytes(ke.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=ke.util.createBuffer();return i.putByte(U.HandshakeType.client_key_exchange),i.putInt24(s),i.putInt16(e.length),i.putBytes(e),i};U.createServerKeyExchange=function(r){var e=0,t=ke.util.createBuffer();return e>0&&(t.putByte(U.HandshakeType.server_key_exchange),t.putInt24(e)),t};U.getClientSignature=function(r,e){var t=ke.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=ke.pki.privateKeyFromPem(a)}catch(u){n.error(n,{message:"Could not get private key.",cause:u,send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}})}a===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.internal_error}}):s=a.sign(s,null),i(n,s)},r.getSignature(r,t,e)};U.createCertificateVerify=function(r,e){var t=e.length+2,n=ke.util.createBuffer();return n.putByte(U.HandshakeType.certificate_verify),n.putInt24(t),n.putInt16(e.length),n.putBytes(e),n};U.createCertificateRequest=function(r){var e=ke.util.createBuffer();e.putByte(1);var t=ke.util.createBuffer();for(var n in r.caStore.certs){var s=r.caStore.certs[n],i=ke.pki.distinguishedNameToAsn1(s.subject),a=ke.asn1.toDer(i);t.putInt16(a.length()),t.putBuffer(a)}var u=1+e.length()+2+t.length(),l=ke.util.createBuffer();return l.putByte(U.HandshakeType.certificate_request),l.putInt24(u),mi(l,1,e),mi(l,2,t),l};U.createServerHelloDone=function(r){var e=ke.util.createBuffer();return e.putByte(U.HandshakeType.server_hello_done),e.putInt24(0),e};U.createChangeCipherSpec=function(){var r=ke.util.createBuffer();return r.putByte(1),r};U.createFinished=function(r){var e=ke.util.createBuffer();e.putBuffer(r.session.md5.digest()),e.putBuffer(r.session.sha1.digest());var t=r.entity===U.ConnectionEnd.client,n=r.session.sp,s=12,i=Qw,a=t?"client finished":"server finished";e=i(n.master_secret,a,e.getBytes(),s);var u=ke.util.createBuffer();return u.putByte(U.HandshakeType.finished),u.putInt24(e.length()),u.putBuffer(e),u};U.createHeartbeat=function(r,e,t){typeof t>"u"&&(t=e.length);var n=ke.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(ke.random.getBytes(i)),n};U.queue=function(r,e){if(e&&!(e.fragment.length()===0&&(e.type===U.ContentType.handshake||e.type===U.ContentType.alert||e.type===U.ContentType.change_cipher_spec))){if(e.type===U.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()<=U.MaxFragment)n=[e];else{n=[];for(var s=e.fragment.bytes();s.length>U.MaxFragment;)n.push(U.createRecord(r,{type:e.type,data:ke.util.createBuffer(s.slice(0,U.MaxFragment))})),s=s.slice(U.MaxFragment);s.length>0&&n.push(U.createRecord(r,{type:e.type,data:ke.util.createBuffer(s)}))}for(var i=0;i<n.length&&!r.fail;++i){var a=n[i],u=r.state.current.write;u.update(r,a)&&r.records.push(a)}}};U.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 Ex=o(function(r){switch(r){case!0:return!0;case ke.pki.certificateError.bad_certificate:return U.Alert.Description.bad_certificate;case ke.pki.certificateError.unsupported_certificate:return U.Alert.Description.unsupported_certificate;case ke.pki.certificateError.certificate_revoked:return U.Alert.Description.certificate_revoked;case ke.pki.certificateError.certificate_expired:return U.Alert.Description.certificate_expired;case ke.pki.certificateError.certificate_unknown:return U.Alert.Description.certificate_unknown;case ke.pki.certificateError.unknown_ca:return U.Alert.Description.unknown_ca;default:return U.Alert.Description.bad_certificate}},"_certErrorToAlertDesc"),MW=o(function(r){switch(r){case!0:return!0;case U.Alert.Description.bad_certificate:return ke.pki.certificateError.bad_certificate;case U.Alert.Description.unsupported_certificate:return ke.pki.certificateError.unsupported_certificate;case U.Alert.Description.certificate_revoked:return ke.pki.certificateError.certificate_revoked;case U.Alert.Description.certificate_expired:return ke.pki.certificateError.certificate_expired;case U.Alert.Description.certificate_unknown:return ke.pki.certificateError.certificate_unknown;case U.Alert.Description.unknown_ca:return ke.pki.certificateError.unknown_ca;default:return ke.pki.certificateError.bad_certificate}},"_alertDescToCertError");U.verifyCertificateChain=function(r,e){try{var t={};for(var n in r.verifyOptions)t[n]=r.verifyOptions[n];t.verify=function(i,a,u){var l=Ex(i),f=r.verify(r,i,a,u);if(f!==!0){if(typeof f=="object"&&!ke.util.isArray(f)){var h=new Error("The application rejected the certificate.");throw h.send=!0,h.alert={level:U.Alert.Level.fatal,description:U.Alert.Description.bad_certificate},f.message&&(h.message=f.message),f.alert&&(h.alert.description=f.alert),h}f!==i&&(f=MW(f))}return f},ke.pki.verifyCertificateChain(r.caStore,e,t)}catch(i){var s=i;(typeof s!="object"||ke.util.isArray(s))&&(s={send:!0,alert:{level:U.Alert.Level.fatal,description:Ex(i)}}),"send"in s||(s.send=!0),"alert"in s||(s.alert={level:U.Alert.Level.fatal,description:Ex(s.error)}),r.error(r,s)}return!r.fail};U.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=ke.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 u in t.order)if(t.order[u]===a){t.order.splice(u,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=ke.util.bytesToHex(s);t.order.push(a),t.cache[a]=i}}return t};U.createConnection=function(r){var e=null;r.caStore?ke.util.isArray(r.caStore)?e=ke.pki.createCaStore(r.caStore):e=r.caStore:e=ke.pki.createCaStore();var t=r.cipherSuites||null;if(t===null){t=[];for(var n in U.CipherSuites)t.push(U.CipherSuites[n])}var s=r.server?U.ConnectionEnd.server:U.ConnectionEnd.client,i=r.sessionCache?U.createSessionCache(r.sessionCache):null,a={version:{major:U.Version.major,minor:U.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(h,m,g,w){return m},verifyOptions:r.verifyOptions||{},getCertificate:r.getCertificate||null,getPrivateKey:r.getPrivateKey||null,getSignature:r.getSignature||null,input:ke.util.createBuffer(),tlsData:ke.util.createBuffer(),data:ke.util.createBuffer(),tlsDataReady:r.tlsDataReady,dataReady:r.dataReady,heartbeatReceived:r.heartbeatReceived,closed:r.closed,error:o(function(h,m){m.origin=m.origin||(h.entity===U.ConnectionEnd.client?"client":"server"),m.send&&(U.queue(h,U.createAlert(h,m.alert)),U.flush(h));var g=m.fatal!==!1;g&&(h.fail=!0),r.error(h,m),g&&h.close(!1)},"error"),deflate:r.deflate||null,inflate:r.inflate||null};a.reset=function(h){a.version={major:U.Version.major,minor:U.Version.minor},a.record=null,a.session=null,a.peerCertificate=null,a.state={pending:null,current:null},a.expect=a.entity===U.ConnectionEnd.client?CW:DW,a.fragmented=null,a.records=[],a.open=!1,a.handshakes=0,a.handshaking=!1,a.isConnected=!1,a.fail=!(h||typeof h>"u"),a.input.clear(),a.tlsData.clear(),a.data.clear(),a.state.current=U.createConnectionState(a)},a.reset();var u=o(function(h,m){var g=m.type-U.ContentType.change_cipher_spec,w=bx[h.entity][h.expect];g in w?w[g](h,m):U.handleUnexpected(h,m)},"_update"),l=o(function(h){var m=0,g=h.input,w=g.length();if(w<5)m=5-w;else{h.record={type:g.getByte(),version:{major:g.getByte(),minor:g.getByte()},length:g.getInt16(),fragment:ke.util.createBuffer(),ready:!1};var y=h.record.version.major===h.version.major;y&&h.session&&h.session.version&&(y=h.record.version.minor===h.version.minor),y||h.error(h,{message:"Incompatible TLS version.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.protocol_version}})}return m},"_readRecordHeader"),f=o(function(h){var m=0,g=h.input,w=g.length();if(w<h.record.length)m=h.record.length-w;else{h.record.fragment.putBytes(g.getBytes(h.record.length)),g.compact();var y=h.state.current.read;y.update(h,h.record)&&(h.fragmented!==null&&(h.fragmented.type===h.record.type?(h.fragmented.fragment.putBuffer(h.record.fragment),h.record=h.fragmented):h.error(h,{message:"Invalid fragmented record.",send:!0,alert:{level:U.Alert.Level.fatal,description:U.Alert.Description.unexpected_message}})),h.record.ready=!0)}return m},"_readRecord");return a.handshake=function(h){if(a.entity!==U.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,h=h||"";var m=null;h.length>0&&(a.sessionCache&&(m=a.sessionCache.getSession(h)),m===null&&(h="")),h.length===0&&a.sessionCache&&(m=a.sessionCache.getSession(),m!==null&&(h=m.id)),a.session={id:h,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:ke.md.md5.create(),sha1:ke.md.sha1.create()},m&&(a.version=m.version,a.session.sp=m.sp),a.session.sp.client_random=U.createRandom().getBytes(),a.open=!0,U.queue(a,U.createRecord(a,{type:U.ContentType.handshake,data:U.createClientHello(a)})),U.flush(a)}},a.process=function(h){var m=0;return h&&a.input.putBytes(h),a.fail||(a.record!==null&&a.record.ready&&a.record.fragment.isEmpty()&&(a.record=null),a.record===null&&(m=l(a)),!a.fail&&a.record!==null&&!a.record.ready&&(m=f(a)),!a.fail&&a.record!==null&&a.record.ready&&u(a,a.record)),m},a.prepare=function(h){return U.queue(a,U.createRecord(a,{type:U.ContentType.application_data,data:ke.util.createBuffer(h)})),U.flush(a)},a.prepareHeartbeatRequest=function(h,m){return h instanceof ke.util.ByteBuffer&&(h=h.bytes()),typeof m>"u"&&(m=h.length),a.expectedHeartbeatPayload=h,U.queue(a,U.createRecord(a,{type:U.ContentType.heartbeat,data:U.createHeartbeat(U.HeartbeatMessageType.heartbeat_request,h,m)})),U.flush(a)},a.close=function(h){if(!a.fail&&a.sessionCache&&a.session){var m={id:a.session.id,version:a.session.version,sp:a.session.sp};m.sp.keys=null,a.sessionCache.setSession(m.id,m)}a.open&&(a.open=!1,a.input.clear(),(a.isConnected||a.handshaking)&&(a.isConnected=a.handshaking=!1,U.queue(a,U.createAlert(a,{level:U.Alert.Level.warning,description:U.Alert.Description.close_notify})),U.flush(a)),a.closed(a)),a.reset(h)},a};h3.exports=ke.tls=ke.tls||{};for(zw in U)typeof U[zw]!="function"&&(ke.tls[zw]=U[zw]);var zw;ke.tls.prf_tls1=Qw;ke.tls.hmac_sha1=SW;ke.tls.createSessionCache=U.createSessionCache;ke.tls.createConnection=U.createConnection});var m3=ye((Xce,d3)=>{"use strict";var Nu=$t();wu();xx();var gi=d3.exports=Nu.tls;gi.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:o(function(r){r.bulk_cipher_algorithm=gi.BulkCipherAlgorithm.aes,r.cipher_type=gi.CipherType.block,r.enc_key_length=16,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=gi.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:p3};gi.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:o(function(r){r.bulk_cipher_algorithm=gi.BulkCipherAlgorithm.aes,r.cipher_type=gi.CipherType.block,r.enc_key_length=32,r.block_length=16,r.fixed_iv_length=16,r.record_iv_length=16,r.mac_algorithm=gi.MACAlgorithm.hmac_sha1,r.mac_length=20,r.mac_key_length=20},"initSecurityParameters"),initConnectionState:p3};function p3(r,e,t){var n=e.entity===Nu.tls.ConnectionEnd.client;r.read.cipherState={init:!1,cipher:Nu.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:Nu.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=HW,r.write.cipherFunction=jW,r.read.macLength=r.write.macLength=t.mac_length,r.read.macFunction=r.write.macFunction=gi.hmac_sha1}o(p3,"initConnectionState");function jW(r,e){var t=!1,n=e.macFunction(e.macKey,e.sequenceNumber,r);r.fragment.putBytes(n),e.updateSequenceNumber();var s;r.version.minor===gi.Versions.TLS_1_0.minor?s=e.cipherState.init?null:e.cipherState.iv:s=Nu.random.getBytesSync(16),e.cipherState.init=!0;var i=e.cipherState.cipher;return i.start({iv:s}),r.version.minor>=gi.Versions.TLS_1_1.minor&&i.output.putBytes(s),i.update(r.fragment),i.finish(FW)&&(r.fragment=i.output,r.length=r.fragment.length(),t=!0),t}o(jW,"encrypt_aes_cbc_sha1");function FW(r,e,t){if(!t){var n=r-e.length()%r;e.fillWithByte(n-1,n)}return!0}o(FW,"encrypt_aes_cbc_sha1_padding");function qW(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}o(qW,"decrypt_aes_cbc_sha1_padding");function HW(r,e){var t=!1,n;r.version.minor===gi.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(qW);var i=e.macLength,a=Nu.random.getBytesSync(i),u=s.output.length();u>=i?(r.fragment=s.output.getBytes(u-i),a=s.output.getBytes(i)):r.fragment=s.output.getBytes(),r.fragment=Nu.util.createBuffer(r.fragment),r.length=r.fragment.length();var l=e.macFunction(e.macKey,e.sequenceNumber,r);return e.updateSequenceNumber(),t=KW(e.macKey,a,l)&&t,t}o(HW,"decrypt_aes_cbc_sha1");function KW(r,e,t){var n=Nu.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}o(KW,"compareMacs")});var Ix=ye((Wce,w3)=>{"use strict";var Ur=$t();ma();ur();var Im=w3.exports=Ur.sha512=Ur.sha512||{};Ur.md.sha512=Ur.md.algorithms.sha512=Im;var y3=Ur.sha384=Ur.sha512.sha384=Ur.sha512.sha384||{};y3.create=function(){return Im.create("SHA-384")};Ur.md.sha384=Ur.md.algorithms.sha384=y3;Ur.sha512.sha256=Ur.sha512.sha256||{create:o(function(){return Im.create("SHA-512/256")},"create")};Ur.md["sha512/256"]=Ur.md.algorithms["sha512/256"]=Ur.sha512.sha256;Ur.sha512.sha224=Ur.sha512.sha224||{create:o(function(){return Im.create("SHA-512/224")},"create")};Ur.md["sha512/224"]=Ur.md.algorithms["sha512/224"]=Ur.sha512.sha224;Im.create=function(r){if(v3||$W(),typeof r>"u"&&(r="SHA-512"),!(r in wc))throw new Error("Invalid SHA-512 algorithm: "+r);for(var e=wc[r],t=null,n=Ur.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 u={algorithm:r.replace("-","").toLowerCase(),blockLength:128,digestLength:a,messageLength:0,fullMessageLength:null,messageLengthSize:16};return u.start=function(){u.messageLength=0,u.fullMessageLength=u.messageLength128=[];for(var l=u.messageLengthSize/4,f=0;f<l;++f)u.fullMessageLength.push(0);n=Ur.util.createBuffer(),t=new Array(e.length);for(var f=0;f<e.length;++f)t[f]=e[f].slice(0);return u},u.start(),u.update=function(l,f){f==="utf8"&&(l=Ur.util.encodeUtf8(l));var h=l.length;u.messageLength+=h,h=[h/4294967296>>>0,h>>>0];for(var m=u.fullMessageLength.length-1;m>=0;--m)u.fullMessageLength[m]+=h[1],h[1]=h[0]+(u.fullMessageLength[m]/4294967296>>>0),u.fullMessageLength[m]=u.fullMessageLength[m]>>>0,h[0]=h[1]/4294967296>>>0;return n.putBytes(l),g3(t,s,n),(n.read>2048||n.length()===0)&&n.compact(),u},u.digest=function(){var l=Ur.util.createBuffer();l.putBytes(n.bytes());var f=u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize,h=f&u.blockLength-1;l.putBytes(Nx.substr(0,u.blockLength-h));for(var m,g,w=u.fullMessageLength[0]*8,y=0;y<u.fullMessageLength.length-1;++y)m=u.fullMessageLength[y+1]*8,g=m/4294967296>>>0,w+=g,l.putInt32(w>>>0),w=m>>>0;l.putInt32(w);for(var S=new Array(t.length),y=0;y<t.length;++y)S[y]=t[y].slice(0);g3(S,s,l);var E=Ur.util.createBuffer(),b;r==="SHA-512"?b=S.length:r==="SHA-384"?b=S.length-2:b=S.length-4;for(var y=0;y<b;++y)E.putInt32(S[y][0]),(y!==b-1||r!=="SHA-512/224")&&E.putInt32(S[y][1]);return E},u};var Nx=null,v3=!1,Tx=null,wc=null;function $W(){Nx="\x80",Nx+=Ur.util.fillString("\0",128),Tx=[[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]],wc={},wc["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],wc["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],wc["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],wc["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],v3=!0}o($W,"_init");function g3(r,e,t){for(var n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R,H,q,K,G,he,le,oe,Z,fe,Se,Ke,be,we,Me=t.length();Me>=128;){for(oe=0;oe<16;++oe)e[oe][0]=t.getInt32()>>>0,e[oe][1]=t.getInt32()>>>0;for(;oe<80;++oe)Se=e[oe-2],Z=Se[0],fe=Se[1],n=((Z>>>19|fe<<13)^(fe>>>29|Z<<3)^Z>>>6)>>>0,s=((Z<<13|fe>>>19)^(fe<<3|Z>>>29)^(Z<<26|fe>>>6))>>>0,be=e[oe-15],Z=be[0],fe=be[1],i=((Z>>>1|fe<<31)^(Z>>>8|fe<<24)^Z>>>7)>>>0,a=((Z<<31|fe>>>1)^(Z<<24|fe>>>8)^(Z<<25|fe>>>7))>>>0,Ke=e[oe-7],we=e[oe-16],fe=s+Ke[1]+a+we[1],e[oe][0]=n+Ke[0]+i+we[0]+(fe/4294967296>>>0)>>>0,e[oe][1]=fe>>>0;for(S=r[0][0],E=r[0][1],b=r[1][0],T=r[1][1],A=r[2][0],C=r[2][1],x=r[3][0],B=r[3][1],F=r[4][0],R=r[4][1],H=r[5][0],q=r[5][1],K=r[6][0],G=r[6][1],he=r[7][0],le=r[7][1],oe=0;oe<80;++oe)f=((F>>>14|R<<18)^(F>>>18|R<<14)^(R>>>9|F<<23))>>>0,h=((F<<18|R>>>14)^(F<<14|R>>>18)^(R<<23|F>>>9))>>>0,m=(K^F&(H^K))>>>0,g=(G^R&(q^G))>>>0,u=((S>>>28|E<<4)^(E>>>2|S<<30)^(E>>>7|S<<25))>>>0,l=((S<<4|E>>>28)^(E<<30|S>>>2)^(E<<25|S>>>7))>>>0,w=(S&b|A&(S^b))>>>0,y=(E&T|C&(E^T))>>>0,fe=le+h+g+Tx[oe][1]+e[oe][1],n=he+f+m+Tx[oe][0]+e[oe][0]+(fe/4294967296>>>0)>>>0,s=fe>>>0,fe=l+y,i=u+w+(fe/4294967296>>>0)>>>0,a=fe>>>0,he=K,le=G,K=H,G=q,H=F,q=R,fe=B+s,F=x+n+(fe/4294967296>>>0)>>>0,R=fe>>>0,x=A,B=C,A=b,C=T,b=S,T=E,fe=s+a,S=n+i+(fe/4294967296>>>0)>>>0,E=fe>>>0;fe=r[0][1]+E,r[0][0]=r[0][0]+S+(fe/4294967296>>>0)>>>0,r[0][1]=fe>>>0,fe=r[1][1]+T,r[1][0]=r[1][0]+b+(fe/4294967296>>>0)>>>0,r[1][1]=fe>>>0,fe=r[2][1]+C,r[2][0]=r[2][0]+A+(fe/4294967296>>>0)>>>0,r[2][1]=fe>>>0,fe=r[3][1]+B,r[3][0]=r[3][0]+x+(fe/4294967296>>>0)>>>0,r[3][1]=fe>>>0,fe=r[4][1]+R,r[4][0]=r[4][0]+F+(fe/4294967296>>>0)>>>0,r[4][1]=fe>>>0,fe=r[5][1]+q,r[5][0]=r[5][0]+H+(fe/4294967296>>>0)>>>0,r[5][1]=fe>>>0,fe=r[6][1]+G,r[6][0]=r[6][0]+K+(fe/4294967296>>>0)>>>0,r[6][1]=fe>>>0,fe=r[7][1]+le,r[7][0]=r[7][0]+he+(fe/4294967296>>>0)>>>0,r[7][1]=fe>>>0,Me-=128}}o(g3,"_update")});var S3=ye(Bx=>{"use strict";var XW=$t();qi();var Nn=XW.asn1;Bx.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};Bx.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Nn.Class.UNIVERSAL,type:Nn.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var P3=ye((Yce,R3)=>{"use strict";var Vn=$t();bm();fi();Ix();ur();var N3=S3(),GW=N3.publicKeyValidator,WW=N3.privateKeyValidator;typeof E3>"u"&&(E3=Vn.jsbn.BigInteger);var E3,Rx=Vn.util.ByteBuffer,Cs=typeof Buffer>"u"?Uint8Array:Buffer;Vn.pki=Vn.pki||{};R3.exports=Vn.pki.ed25519=Vn.ed25519=Vn.ed25519||{};var Qt=Vn.ed25519;Qt.constants={};Qt.constants.PUBLIC_KEY_BYTE_LENGTH=32;Qt.constants.PRIVATE_KEY_BYTE_LENGTH=64;Qt.constants.SEED_BYTE_LENGTH=32;Qt.constants.SIGN_BYTE_LENGTH=64;Qt.constants.HASH_BYTE_LENGTH=64;Qt.generateKeyPair=function(r){r=r||{};var e=r.seed;if(e===void 0)e=Vn.random.getBytesSync(Qt.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Qt.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Qt.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=go({message:e,encoding:"binary"});for(var t=new Cs(Qt.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Cs(Qt.constants.PRIVATE_KEY_BYTE_LENGTH),s=0;s<32;++s)n[s]=e[s];return QW(t,n),{publicKey:t,privateKey:n}};Qt.privateKeyFromAsn1=function(r){var e={},t=[],n=Vn.asn1.validate(r,WW,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=Vn.asn1.derToOid(e.privateKeyOid),a=Vn.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var u=e.privateKey,l=go({message:Vn.asn1.fromDer(u).value,encoding:"binary"});return{privateKeyBytes:l}};Qt.publicKeyFromAsn1=function(r){var e={},t=[],n=Vn.asn1.validate(r,GW,e,t);if(!n){var s=new Error("Invalid Key.");throw s.errors=t,s}var i=Vn.asn1.derToOid(e.publicKeyOid),a=Vn.oids.EdDSA25519;if(i!==a)throw new Error('Invalid OID "'+i+'"; OID must be "'+a+'".');var u=e.ed25519PublicKey;if(u.length!==Qt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return go({message:u,encoding:"binary"})};Qt.publicKeyFromPrivateKey=function(r){r=r||{};var e=go({message:r.privateKey,encoding:"binary"});if(e.length!==Qt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Qt.constants.PRIVATE_KEY_BYTE_LENGTH);for(var t=new Cs(Qt.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<t.length;++n)t[n]=e[32+n];return t};Qt.sign=function(r){r=r||{};var e=go(r),t=go({message:r.privateKey,encoding:"binary"});if(t.length===Qt.constants.SEED_BYTE_LENGTH){var n=Qt.generateKeyPair({seed:t});t=n.privateKey}else if(t.length!==Qt.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Qt.constants.SEED_BYTE_LENGTH+" or "+Qt.constants.PRIVATE_KEY_BYTE_LENGTH);var s=new Cs(Qt.constants.SIGN_BYTE_LENGTH+e.length);ZW(s,e,e.length,t);for(var i=new Cs(Qt.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=s[a];return i};Qt.verify=function(r){r=r||{};var e=go(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=go({message:r.signature,encoding:"binary"});if(t.length!==Qt.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+Qt.constants.SIGN_BYTE_LENGTH);var n=go({message:r.publicKey,encoding:"binary"});if(n.length!==Qt.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+Qt.constants.PUBLIC_KEY_BYTE_LENGTH);var s=new Cs(Qt.constants.SIGN_BYTE_LENGTH+e.length),i=new Cs(Qt.constants.SIGN_BYTE_LENGTH+e.length),a;for(a=0;a<Qt.constants.SIGN_BYTE_LENGTH;++a)s[a]=t[a];for(a=0;a<e.length;++a)s[a+Qt.constants.SIGN_BYTE_LENGTH]=e[a];return eJ(i,s,s.length,n)>=0};function go(r){var e=r.message;if(e instanceof Uint8Array||e instanceof Cs)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 Rx(e,t)}else if(!(e instanceof Rx))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 Cs(e.length()),s=0;s<n.length;++s)n[s]=e.at(s);return n}o(go,"messageToNativeBuffer");var Px=Nt(),Zw=Nt([1]),JW=Nt([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),zW=Nt([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),A3=Nt([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),C3=Nt([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),Dx=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]),YW=Nt([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Bm(r,e){var t=Vn.md.sha512.create(),n=new Rx(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 Cs(Qt.constants.HASH_BYTE_LENGTH),a=0;a<64;++a)i[a]=s.charCodeAt(a);return i}o(Bm,"sha512");function QW(r,e){var t=[Nt(),Nt(),Nt(),Nt()],n,s=Bm(e,32);for(s[0]&=248,s[31]&=127,s[31]|=64,Vx(t,s),Lx(r,t),n=0;n<32;++n)e[n+32]=r[n];return 0}o(QW,"crypto_sign_keypair");function ZW(r,e,t,n){var s,i,a=new Float64Array(64),u=[Nt(),Nt(),Nt(),Nt()],l=Bm(n,32);l[0]&=248,l[31]&=127,l[31]|=64;var f=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 h=Bm(r.subarray(32),t+32);for(Ox(h),Vx(u,h),Lx(r,u),s=32;s<64;++s)r[s]=n[s];var m=Bm(r,t+64);for(Ox(m),s=32;s<64;++s)a[s]=0;for(s=0;s<32;++s)a[s]=h[s];for(s=0;s<32;++s)for(i=0;i<32;i++)a[s+i]+=m[s]*l[i];return T3(r.subarray(32),a),f}o(ZW,"crypto_sign");function eJ(r,e,t,n){var s,i,a=new Cs(32),u=[Nt(),Nt(),Nt(),Nt()],l=[Nt(),Nt(),Nt(),Nt()];if(i=-1,t<64||tJ(l,n))return-1;for(s=0;s<t;++s)r[s]=e[s];for(s=0;s<32;++s)r[s+32]=n[s];var f=Bm(r,t);if(Ox(f),D3(u,l,f),Vx(l,e.subarray(32)),kx(u,l),Lx(a,u),t-=64,I3(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}o(eJ,"crypto_sign_open");function T3(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]*Dx[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)*Dx[s],t=e[s]>>8,e[s]&=255;for(s=0;s<32;++s)e[s]-=t*Dx[s];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,r[n]=e[n]&255}o(T3,"modL");function Ox(r){for(var e=new Float64Array(64),t=0;t<64;++t)e[t]=r[t],r[t]=0;T3(r,e)}o(Ox,"reduce");function kx(r,e){var t=Nt(),n=Nt(),s=Nt(),i=Nt(),a=Nt(),u=Nt(),l=Nt(),f=Nt(),h=Nt();Zh(t,r[1],r[0]),Zh(h,e[1],e[0]),Nr(t,t,h),Qh(n,r[0],r[1]),Qh(h,e[0],e[1]),Nr(n,n,h),Nr(s,r[3],e[3]),Nr(s,s,zW),Nr(i,r[2],e[2]),Qh(i,i,i),Zh(a,n,t),Zh(u,i,s),Qh(l,i,s),Qh(f,n,t),Nr(r[0],a,u),Nr(r[1],f,l),Nr(r[2],l,u),Nr(r[3],a,f)}o(kx,"add");function b3(r,e,t){for(var n=0;n<4;++n)_3(r[n],e[n],t)}o(b3,"cswap");function Lx(r,e){var t=Nt(),n=Nt(),s=Nt();iJ(s,e[2]),Nr(t,e[0],s),Nr(n,e[1],s),eS(r,n),r[31]^=B3(t)<<7}o(Lx,"pack");function eS(r,e){var t,n,s,i=Nt(),a=Nt();for(t=0;t<16;++t)a[t]=e[t];for(_x(a),_x(a),_x(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,_3(a,i,1-s)}for(t=0;t<16;t++)r[2*t]=a[t]&255,r[2*t+1]=a[t]>>8}o(eS,"pack25519");function tJ(r,e){var t=Nt(),n=Nt(),s=Nt(),i=Nt(),a=Nt(),u=Nt(),l=Nt();return Tu(r[2],Zw),rJ(r[1],e),Sc(s,r[1]),Nr(i,s,JW),Zh(s,s,r[2]),Qh(i,r[2],i),Sc(a,i),Sc(u,a),Nr(l,u,a),Nr(t,l,s),Nr(t,t,i),nJ(t,t),Nr(t,t,s),Nr(t,t,i),Nr(t,t,i),Nr(r[0],t,i),Sc(n,r[0]),Nr(n,n,i),x3(n,s)&&Nr(r[0],r[0],YW),Sc(n,r[0]),Nr(n,n,i),x3(n,s)?-1:(B3(r[0])===e[31]>>7&&Zh(r[0],Px,r[0]),Nr(r[3],r[0],r[1]),0)}o(tJ,"unpackneg");function rJ(r,e){var t;for(t=0;t<16;++t)r[t]=e[2*t]+(e[2*t+1]<<8);r[15]&=32767}o(rJ,"unpack25519");function nJ(r,e){var t=Nt(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=250;n>=0;--n)Sc(t,t),n!==1&&Nr(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}o(nJ,"pow2523");function x3(r,e){var t=new Cs(32),n=new Cs(32);return eS(t,r),eS(n,e),I3(t,0,n,0)}o(x3,"neq25519");function I3(r,e,t,n){return sJ(r,e,t,n,32)}o(I3,"crypto_verify_32");function sJ(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}o(sJ,"vn");function B3(r){var e=new Cs(32);return eS(e,r),e[0]&1}o(B3,"par25519");function D3(r,e,t){var n,s;for(Tu(r[0],Px),Tu(r[1],Zw),Tu(r[2],Zw),Tu(r[3],Px),s=255;s>=0;--s)n=t[s/8|0]>>(s&7)&1,b3(r,e,n),kx(e,r),kx(r,r),b3(r,e,n)}o(D3,"scalarmult");function Vx(r,e){var t=[Nt(),Nt(),Nt(),Nt()];Tu(t[0],A3),Tu(t[1],C3),Tu(t[2],Zw),Nr(t[3],A3,C3),D3(r,t,e)}o(Vx,"scalarbase");function Tu(r,e){var t;for(t=0;t<16;t++)r[t]=e[t]|0}o(Tu,"set25519");function iJ(r,e){var t=Nt(),n;for(n=0;n<16;++n)t[n]=e[n];for(n=253;n>=0;--n)Sc(t,t),n!==2&&n!==4&&Nr(t,t,e);for(n=0;n<16;++n)r[n]=t[n]}o(iJ,"inv25519");function _x(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)}o(_x,"car25519");function _3(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}o(_3,"sel25519");function Nt(r){var e,t=new Float64Array(16);if(r)for(e=0;e<r.length;++e)t[e]=r[e];return t}o(Nt,"gf");function Qh(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]+t[n]}o(Qh,"A");function Zh(r,e,t){for(var n=0;n<16;++n)r[n]=e[n]-t[n]}o(Zh,"Z");function Sc(r,e){Nr(r,e,e)}o(Sc,"S");function Nr(r,e,t){var n,s,i=0,a=0,u=0,l=0,f=0,h=0,m=0,g=0,w=0,y=0,S=0,E=0,b=0,T=0,A=0,C=0,x=0,B=0,F=0,R=0,H=0,q=0,K=0,G=0,he=0,le=0,oe=0,Z=0,fe=0,Se=0,Ke=0,be=t[0],we=t[1],Me=t[2],Je=t[3],Ye=t[4],lt=t[5],O=t[6],_=t[7],ne=t[8],J=t[9],Xe=t[10],Re=t[11],xe=t[12],ct=t[13],rr=t[14],je=t[15];n=e[0],i+=n*be,a+=n*we,u+=n*Me,l+=n*Je,f+=n*Ye,h+=n*lt,m+=n*O,g+=n*_,w+=n*ne,y+=n*J,S+=n*Xe,E+=n*Re,b+=n*xe,T+=n*ct,A+=n*rr,C+=n*je,n=e[1],a+=n*be,u+=n*we,l+=n*Me,f+=n*Je,h+=n*Ye,m+=n*lt,g+=n*O,w+=n*_,y+=n*ne,S+=n*J,E+=n*Xe,b+=n*Re,T+=n*xe,A+=n*ct,C+=n*rr,x+=n*je,n=e[2],u+=n*be,l+=n*we,f+=n*Me,h+=n*Je,m+=n*Ye,g+=n*lt,w+=n*O,y+=n*_,S+=n*ne,E+=n*J,b+=n*Xe,T+=n*Re,A+=n*xe,C+=n*ct,x+=n*rr,B+=n*je,n=e[3],l+=n*be,f+=n*we,h+=n*Me,m+=n*Je,g+=n*Ye,w+=n*lt,y+=n*O,S+=n*_,E+=n*ne,b+=n*J,T+=n*Xe,A+=n*Re,C+=n*xe,x+=n*ct,B+=n*rr,F+=n*je,n=e[4],f+=n*be,h+=n*we,m+=n*Me,g+=n*Je,w+=n*Ye,y+=n*lt,S+=n*O,E+=n*_,b+=n*ne,T+=n*J,A+=n*Xe,C+=n*Re,x+=n*xe,B+=n*ct,F+=n*rr,R+=n*je,n=e[5],h+=n*be,m+=n*we,g+=n*Me,w+=n*Je,y+=n*Ye,S+=n*lt,E+=n*O,b+=n*_,T+=n*ne,A+=n*J,C+=n*Xe,x+=n*Re,B+=n*xe,F+=n*ct,R+=n*rr,H+=n*je,n=e[6],m+=n*be,g+=n*we,w+=n*Me,y+=n*Je,S+=n*Ye,E+=n*lt,b+=n*O,T+=n*_,A+=n*ne,C+=n*J,x+=n*Xe,B+=n*Re,F+=n*xe,R+=n*ct,H+=n*rr,q+=n*je,n=e[7],g+=n*be,w+=n*we,y+=n*Me,S+=n*Je,E+=n*Ye,b+=n*lt,T+=n*O,A+=n*_,C+=n*ne,x+=n*J,B+=n*Xe,F+=n*Re,R+=n*xe,H+=n*ct,q+=n*rr,K+=n*je,n=e[8],w+=n*be,y+=n*we,S+=n*Me,E+=n*Je,b+=n*Ye,T+=n*lt,A+=n*O,C+=n*_,x+=n*ne,B+=n*J,F+=n*Xe,R+=n*Re,H+=n*xe,q+=n*ct,K+=n*rr,G+=n*je,n=e[9],y+=n*be,S+=n*we,E+=n*Me,b+=n*Je,T+=n*Ye,A+=n*lt,C+=n*O,x+=n*_,B+=n*ne,F+=n*J,R+=n*Xe,H+=n*Re,q+=n*xe,K+=n*ct,G+=n*rr,he+=n*je,n=e[10],S+=n*be,E+=n*we,b+=n*Me,T+=n*Je,A+=n*Ye,C+=n*lt,x+=n*O,B+=n*_,F+=n*ne,R+=n*J,H+=n*Xe,q+=n*Re,K+=n*xe,G+=n*ct,he+=n*rr,le+=n*je,n=e[11],E+=n*be,b+=n*we,T+=n*Me,A+=n*Je,C+=n*Ye,x+=n*lt,B+=n*O,F+=n*_,R+=n*ne,H+=n*J,q+=n*Xe,K+=n*Re,G+=n*xe,he+=n*ct,le+=n*rr,oe+=n*je,n=e[12],b+=n*be,T+=n*we,A+=n*Me,C+=n*Je,x+=n*Ye,B+=n*lt,F+=n*O,R+=n*_,H+=n*ne,q+=n*J,K+=n*Xe,G+=n*Re,he+=n*xe,le+=n*ct,oe+=n*rr,Z+=n*je,n=e[13],T+=n*be,A+=n*we,C+=n*Me,x+=n*Je,B+=n*Ye,F+=n*lt,R+=n*O,H+=n*_,q+=n*ne,K+=n*J,G+=n*Xe,he+=n*Re,le+=n*xe,oe+=n*ct,Z+=n*rr,fe+=n*je,n=e[14],A+=n*be,C+=n*we,x+=n*Me,B+=n*Je,F+=n*Ye,R+=n*lt,H+=n*O,q+=n*_,K+=n*ne,G+=n*J,he+=n*Xe,le+=n*Re,oe+=n*xe,Z+=n*ct,fe+=n*rr,Se+=n*je,n=e[15],C+=n*be,x+=n*we,B+=n*Me,F+=n*Je,R+=n*Ye,H+=n*lt,q+=n*O,K+=n*_,G+=n*ne,he+=n*J,le+=n*Xe,oe+=n*Re,Z+=n*xe,fe+=n*ct,Se+=n*rr,Ke+=n*je,i+=38*x,a+=38*B,u+=38*F,l+=38*R,f+=38*H,h+=38*q,m+=38*K,g+=38*G,w+=38*he,y+=38*le,S+=38*oe,E+=38*Z,b+=38*fe,T+=38*Se,A+=38*Ke,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=u+s+65535,s=Math.floor(n/65536),u=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=h+s+65535,s=Math.floor(n/65536),h=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=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=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,n=b+s+65535,s=Math.floor(n/65536),b=n-s*65536,n=T+s+65535,s=Math.floor(n/65536),T=n-s*65536,n=A+s+65535,s=Math.floor(n/65536),A=n-s*65536,n=C+s+65535,s=Math.floor(n/65536),C=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=u+s+65535,s=Math.floor(n/65536),u=n-s*65536,n=l+s+65535,s=Math.floor(n/65536),l=n-s*65536,n=f+s+65535,s=Math.floor(n/65536),f=n-s*65536,n=h+s+65535,s=Math.floor(n/65536),h=n-s*65536,n=m+s+65535,s=Math.floor(n/65536),m=n-s*65536,n=g+s+65535,s=Math.floor(n/65536),g=n-s*65536,n=w+s+65535,s=Math.floor(n/65536),w=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=E+s+65535,s=Math.floor(n/65536),E=n-s*65536,n=b+s+65535,s=Math.floor(n/65536),b=n-s*65536,n=T+s+65535,s=Math.floor(n/65536),T=n-s*65536,n=A+s+65535,s=Math.floor(n/65536),A=n-s*65536,n=C+s+65535,s=Math.floor(n/65536),C=n-s*65536,i+=s-1+37*(s-1),r[0]=i,r[1]=a,r[2]=u,r[3]=l,r[4]=f,r[5]=h,r[6]=m,r[7]=g,r[8]=w,r[9]=y,r[10]=S,r[11]=E,r[12]=b,r[13]=T,r[14]=A,r[15]=C}o(Nr,"M")});var V3=ye((Zce,L3)=>{"use strict";var Gs=$t();ur();fi();bm();L3.exports=Gs.kem=Gs.kem||{};var O3=Gs.jsbn.BigInteger;Gs.kem.rsa={};Gs.kem.rsa.create=function(r,e){e=e||{};var t=e.prng||Gs.random,n={};return n.encrypt=function(s,i){var a=Math.ceil(s.n.bitLength()/8),u;do u=new O3(Gs.util.bytesToHex(t.getBytesSync(a)),16).mod(s.n);while(u.compareTo(O3.ONE)<=0);u=Gs.util.hexToBytes(u.toString(16));var l=a-u.length;l>0&&(u=Gs.util.fillString("\0",l)+u);var f=s.encrypt(u,"NONE"),h=r.generate(u,i);return{encapsulation:f,key:h}},n.decrypt=function(s,i,a){var u=s.decrypt(i,"NONE");return r.generate(u,a)},n};Gs.kem.kdf1=function(r,e){k3(this,r,0,e||r.digestLength)};Gs.kem.kdf2=function(r,e){k3(this,r,1,e||r.digestLength)};function k3(r,e,t,n){r.generate=function(s,i){for(var a=new Gs.util.ByteBuffer,u=Math.ceil(i/n)+t,l=new Gs.util.ByteBuffer,f=t;f<u;++f){l.putInt32(f),e.start(),e.update(s+l.getBytes());var h=e.digest();a.putBytes(h.getBytes(n))}return a.truncate(a.length()-i),a.getBytes()}}o(k3,"_createKDF")});var F3=ye((tfe,j3)=>{"use strict";var tr=$t();ur();j3.exports=tr.log=tr.log||{};tr.log.levels=["none","error","warning","info","debug","verbose","max"];var tS={},jx=[],_m=null;tr.log.LEVEL_LOCKED=2;tr.log.NO_LEVEL_CHECK=4;tr.log.INTERPOLATE=8;for(Ca=0;Ca<tr.log.levels.length;++Ca)Ux=tr.log.levels[Ca],tS[Ux]={index:Ca,name:Ux.toUpperCase()};var Ux,Ca;tr.log.logMessage=function(r){for(var e=tS[r.level].index,t=0;t<jx.length;++t){var n=jx[t];if(n.flags&tr.log.NO_LEVEL_CHECK)n.f(r);else{var s=tS[n.level].index;e<=s&&n.f(n,r)}}};tr.log.prepareStandard=function(r){"standard"in r||(r.standard=tS[r.level].name+" ["+r.category+"] "+r.message)};tr.log.prepareFull=function(r){if(!("full"in r)){var e=[r.message];e=e.concat([]),r.full=tr.util.format.apply(this,e)}};tr.log.prepareStandardFull=function(r){"standardFull"in r||(tr.log.prepareStandard(r),r.standardFull=r.standard)};for(Mx=["error","warning","info","debug","verbose"],Ca=0;Ca<Mx.length;++Ca)(function(e){tr.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};tr.log.logMessage(i)}})(Mx[Ca]);var Mx,Ca;tr.log.makeLogger=function(r){var e={flags:0,f:r};return tr.log.setLevel(e,"none"),e};tr.log.setLevel=function(r,e){var t=!1;if(r&&!(r.flags&tr.log.LEVEL_LOCKED))for(var n=0;n<tr.log.levels.length;++n){var s=tr.log.levels[n];if(e==s){r.level=e,t=!0;break}}return t};tr.log.lock=function(r,e){typeof e>"u"||e?r.flags|=tr.log.LEVEL_LOCKED:r.flags&=~tr.log.LEVEL_LOCKED};tr.log.addLogger=function(r){jx.push(r)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(U3={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},Rm=o(function(r,e){tr.log.prepareStandard(e);var t=U3[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),t.apply(console,n)},"f"),ep=tr.log.makeLogger(Rm)):(Rm=o(function(e,t){tr.log.prepareStandardFull(t),console.log(t.standardFull)},"f"),ep=tr.log.makeLogger(Rm)),tr.log.setLevel(ep,"debug"),tr.log.addLogger(ep),_m=ep):console={log:o(function(){},"log")};var ep,U3,Rm;_m!==null&&typeof window<"u"&&window.location&&(Dm=new URL(window.location.href).searchParams,Dm.has("console.level")&&tr.log.setLevel(_m,Dm.get("console.level").slice(-1)[0]),Dm.has("console.lock")&&(M3=Dm.get("console.lock").slice(-1)[0],M3=="true"&&tr.log.lock(_m)));var Dm,M3;tr.log.consoleLogger=_m});var H3=ye((nfe,q3)=>{"use strict";q3.exports=ma();Ow();Gh();Zb();Ix()});var X3=ye((sfe,$3)=>{"use strict";var We=$t();wu();qi();Am();Su();pc();px();fi();ur();Ww();var ee=We.asn1,hs=$3.exports=We.pkcs7=We.pkcs7||{};hs.messageFromPem=function(r){var e=We.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=ee.fromDer(e.body);return hs.messageFromAsn1(n)};hs.messageToPem=function(r,e){var t={type:"PKCS7",body:ee.toDer(r.toAsn1()).getBytes()};return We.pem.encode(t,{maxline:e})};hs.messageFromAsn1=function(r){var e={},t=[];if(!ee.validate(r,hs.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=ee.derToOid(e.contentType),i;switch(s){case We.pki.oids.envelopedData:i=hs.createEnvelopedData();break;case We.pki.oids.encryptedData:i=hs.createEncryptedData();break;case We.pki.oids.signedData:i=hs.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};hs.createSignedData=function(){var r=null;return r={type:We.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:o(function(n){if(qx(r,n,hs.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(We.pki.certificateFromAsn1(s[i]))},"fromAsn1"),toAsn1:o(function(){r.contentInfo||r.sign();for(var n=[],s=0;s<r.certificates.length;++s)n.push(We.pki.certificateToAsn1(r.certificates[s]));var i=[],a=ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,r.digestAlgorithmIdentifiers),r.contentInfo])]);return n.length>0&&a.value[0].value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,n)),i.length>0&&a.value[0].value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,r.signerInfos)),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),a])},"toAsn1"),addSigner:o(function(n){var s=n.issuer,i=n.serialNumber;if(n.certificate){var a=n.certificate;typeof a=="string"&&(a=We.pki.certificateFromPem(a)),s=a.issuer.attributes,i=a.serialNumber}var u=n.key;if(!u)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof u=="string"&&(u=We.pki.privateKeyFromPem(u));var l=n.digestAlgorithm||We.pki.oids.sha1;switch(l){case We.pki.oids.sha1:case We.pki.oids.sha256:case We.pki.oids.sha384:case We.pki.oids.sha512:case We.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+l)}var f=n.authenticatedAttributes||[];if(f.length>0){for(var h=!1,m=!1,g=0;g<f.length;++g){var w=f[g];if(!h&&w.type===We.pki.oids.contentType){if(h=!0,m)break;continue}if(!m&&w.type===We.pki.oids.messageDigest){if(m=!0,h)break;continue}}if(!h||!m)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:u,version:1,issuer:s,serialNumber:i,digestAlgorithm:l,signatureAlgorithm:We.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:f,unauthenticatedAttributes:[]})},"addSigner"),sign:o(function(n){if(n=n||{},(typeof r.content!="object"||r.contentInfo===null)&&(r.contentInfo=ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(We.pki.oids.data).getBytes())]),"content"in r)){var s;r.content instanceof We.util.ByteBuffer?s=r.content.bytes():typeof r.content=="string"&&(s=We.util.encodeUtf8(r.content)),n.detached?r.detachedContent=ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,s):r.contentInfo.value.push(ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,s)]))}if(r.signers.length!==0){var i=e();t(i)}},"sign"),verify:o(function(){throw new Error("PKCS#7 signature verification not yet implemented.")},"verify"),addCertificate:o(function(n){typeof n=="string"&&(n=We.pki.certificateFromPem(n)),r.certificates.push(n)},"addCertificate"),addCertificateRevokationList:o(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]=We.md[We.pki.oids[a]].create()),i.authenticatedAttributes.length===0?i.md=n[a]:i.md=We.md[We.pki.oids[a]].create()}r.digestAlgorithmIdentifiers=[];for(var a in n)r.digestAlgorithmIdentifiers.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(a).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")]));return n}o(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=ee.derToOid(r.contentInfo.value[0].value),a=ee.toDer(s);a.getByte(),ee.getBerValueLength(a),a=a.getBytes();for(var u in n)n[u].start().update(a);for(var l=new Date,f=0;f<r.signers.length;++f){var h=r.signers[f];if(h.authenticatedAttributes.length===0){if(i!==We.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{h.authenticatedAttributesAsn1=ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var m=ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,[]),g=0;g<h.authenticatedAttributes.length;++g){var w=h.authenticatedAttributes[g];w.type===We.pki.oids.messageDigest?w.value=n[h.digestAlgorithm].digest():w.type===We.pki.oids.signingTime&&(w.value||(w.value=l)),m.value.push(Fx(w)),h.authenticatedAttributesAsn1.value.push(Fx(w))}a=ee.toDer(m).getBytes(),h.md.start().update(a)}h.signature=h.key.sign(h.md,"RSASSA-PKCS1-V1_5")}r.signerInfos=fJ(r.signers)}o(t,"addSignerInfos")};hs.createEncryptedData=function(){var r=null;return r={type:We.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:We.pki.oids["aes256-CBC"]},fromAsn1:o(function(e){qx(r,e,hs.asn1.encryptedDataValidator)},"fromAsn1"),decrypt:o(function(e){e!==void 0&&(r.encryptedContent.key=e),K3(r)},"decrypt")},r};hs.createEnvelopedData=function(){var r=null;return r={type:We.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:We.pki.oids["aes256-CBC"]},fromAsn1:o(function(e){var t=qx(r,e,hs.asn1.envelopedDataValidator);r.recipients=uJ(t.recipientInfos.value)},"fromAsn1"),toAsn1:o(function(){return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,lJ(r.recipients)),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,hJ(r.encryptedContent))])])])},"toAsn1"),findRecipient:o(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,u=0;u<t.length;++u)if(i[u].type!==t[u].type||i[u].value!==t[u].value){a=!1;break}if(a)return s}}return null},"findRecipient"),decrypt:o(function(e,t){if(r.encryptedContent.key===void 0&&e!==void 0&&t!==void 0)switch(e.encryptedContent.algorithm){case We.pki.oids.rsaEncryption:case We.pki.oids.desCBC:var n=t.decrypt(e.encryptedContent.content);r.encryptedContent.key=We.util.createBuffer(n);break;default:throw new Error("Unsupported asymmetric cipher, OID "+e.encryptedContent.algorithm)}K3(r)},"decrypt"),addRecipient:o(function(e){r.recipients.push({version:0,issuer:e.issuer.attributes,serialNumber:e.serialNumber,encryptedContent:{algorithm:We.pki.oids.rsaEncryption,key:e.publicKey}})},"addRecipient"),encrypt:o(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 We.pki.oids["aes128-CBC"]:n=16,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["aes192-CBC"]:n=24,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["aes256-CBC"]:n=32,s=16,i=We.aes.createEncryptionCipher;break;case We.pki.oids["des-EDE3-CBC"]:n=24,s=8,i=We.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+t)}if(e===void 0)e=We.util.createBuffer(We.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=We.util.createBuffer(We.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 u=0;u<r.recipients.length;++u){var l=r.recipients[u];if(l.encryptedContent.content===void 0)switch(l.encryptedContent.algorithm){case We.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 aJ(r){var e={},t=[];if(!ee.validate(r,hs.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:We.pki.RDNAttributesAsArray(e.issuer),serialNumber:We.util.createBuffer(e.serial).toHex(),encryptedContent:{algorithm:ee.derToOid(e.encAlgorithm),parameter:e.encParameter?e.encParameter.value:void 0,content:e.encKey}}}o(aJ,"_recipientFromAsn1");function oJ(r){return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[We.pki.distinguishedNameToAsn1({attributes:r.issuer}),ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,We.util.hexToBytes(r.serialNumber))]),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.encryptedContent.algorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")]),ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.encryptedContent.content)])}o(oJ,"_recipientToAsn1");function uJ(r){for(var e=[],t=0;t<r.length;++t)e.push(aJ(r[t]));return e}o(uJ,"_recipientsFromAsn1");function lJ(r){for(var e=[],t=0;t<r.length;++t)e.push(oJ(r[t]));return e}o(lJ,"_recipientsToAsn1");function cJ(r){var e=ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,ee.integerToDer(r.version).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[We.pki.distinguishedNameToAsn1({attributes:r.issuer}),ee.create(ee.Class.UNIVERSAL,ee.Type.INTEGER,!1,We.util.hexToBytes(r.serialNumber))]),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.digestAlgorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")])]);if(r.authenticatedAttributesAsn1&&e.value.push(r.authenticatedAttributesAsn1),e.value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.signatureAlgorithm).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.NULL,!1,"")])),e.value.push(ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.signature)),r.unauthenticatedAttributes.length>0){for(var t=ee.create(ee.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<r.unauthenticatedAttributes.length;++n){var s=r.unauthenticatedAttributes[n];t.values.push(Fx(s))}e.value.push(t)}return e}o(cJ,"_signerToAsn1");function fJ(r){for(var e=[],t=0;t<r.length;++t)e.push(cJ(r[t]));return e}o(fJ,"_signersToAsn1");function Fx(r){var e;if(r.type===We.pki.oids.contentType)e=ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.value).getBytes());else if(r.type===We.pki.oids.messageDigest)e=ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.value.bytes());else if(r.type===We.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=ee.utcTimeToDate(s):s=ee.generalizedTimeToDate(s):s=new Date(i)}s>=t&&s<n?e=ee.create(ee.Class.UNIVERSAL,ee.Type.UTCTIME,!1,ee.dateToUtcTime(s)):e=ee.create(ee.Class.UNIVERSAL,ee.Type.GENERALIZEDTIME,!1,ee.dateToGeneralizedTime(s))}return ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.type).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SET,!0,[e])])}o(Fx,"_attributeToAsn1");function hJ(r){return[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(We.pki.oids.data).getBytes()),ee.create(ee.Class.UNIVERSAL,ee.Type.SEQUENCE,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OID,!1,ee.oidToDer(r.algorithm).getBytes()),r.parameter?ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.parameter.getBytes()):void 0]),ee.create(ee.Class.CONTEXT_SPECIFIC,0,!0,[ee.create(ee.Class.UNIVERSAL,ee.Type.OCTETSTRING,!1,r.content.getBytes())])]}o(hJ,"_encryptedContentToAsn1");function qx(r,e,t){var n={},s=[];if(!ee.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=ee.derToOid(n.contentType);if(a!==We.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var u="";if(We.util.isArray(n.encryptedContent))for(var l=0;l<n.encryptedContent.length;++l){if(n.encryptedContent[l].type!==ee.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");u+=n.encryptedContent[l].value}else u=n.encryptedContent;r.encryptedContent={algorithm:ee.derToOid(n.encAlgorithm),parameter:We.util.createBuffer(n.encParameter.value),content:We.util.createBuffer(u)}}if(n.content){var u="";if(We.util.isArray(n.content))for(var l=0;l<n.content.length;++l){if(n.content[l].type!==ee.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");u+=n.content[l].value}else u=n.content;r.content=We.util.createBuffer(u)}return r.version=n.version.charCodeAt(0),r.rawCapture=n,n}o(qx,"_fromAsn1");function K3(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 We.pki.oids["aes128-CBC"]:case We.pki.oids["aes192-CBC"]:case We.pki.oids["aes256-CBC"]:e=We.aes.createDecryptionCipher(r.encryptedContent.key);break;case We.pki.oids.desCBC:case We.pki.oids["des-EDE3-CBC"]:e=We.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}}o(K3,"_decryptContent")});var W3=ye((afe,G3)=>{"use strict";var ln=$t();wu();Hh();Ow();Gh();ur();var nS=G3.exports=ln.ssh=ln.ssh||{};nS.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
15
- `;i+="Encryption: "+s+`\r
16
- `,i+="Comment: "+t+`\r
17
- `;var a=ln.util.createBuffer();tp(a,n),ba(a,r.e),ba(a,r.n);var u=ln.util.encode64(a.bytes(),64),l=Math.floor(u.length/66)+1;i+="Public-Lines: "+l+`\r
18
- `,i+=u;var f=ln.util.createBuffer();ba(f,r.d),ba(f,r.p),ba(f,r.q),ba(f,r.qInv);var h;if(!e)h=ln.util.encode64(f.bytes(),64);else{var m=f.length()+16-1;m-=m%16;var g=rS(f.bytes());g.truncate(g.length()-m+f.length()),f.putBuffer(g);var w=ln.util.createBuffer();w.putBuffer(rS("\0\0\0\0",e)),w.putBuffer(rS("\0\0\0",e));var y=ln.aes.createEncryptionCipher(w.truncate(8),"CBC");y.start(ln.util.createBuffer().fillWithByte(0,16)),y.update(f.copy()),y.finish();var S=y.output;S.truncate(16),h=ln.util.encode64(S.bytes(),64)}l=Math.floor(h.length/66)+1,i+=`\r
19
- Private-Lines: `+l+`\r
20
- `,i+=h;var E=rS("putty-private-key-file-mac-key",e),b=ln.util.createBuffer();tp(b,n),tp(b,s),tp(b,t),b.putInt32(a.length()),b.putBuffer(a),b.putInt32(f.length()),b.putBuffer(f);var T=ln.hmac.create();return T.start("sha1",E),T.update(b.bytes()),i+=`\r
21
- Private-MAC: `+T.digest().toHex()+`\r
22
- `,i};nS.publicKeyToOpenSSH=function(r,e){var t="ssh-rsa";e=e||"";var n=ln.util.createBuffer();return tp(n,t),ba(n,r.e),ba(n,r.n),t+" "+ln.util.encode64(n.bytes())+" "+e};nS.privateKeyToOpenSSH=function(r,e){return e?ln.pki.encryptRsaPrivateKey(r,e,{legacy:!0,algorithm:"aes128"}):ln.pki.privateKeyToPem(r)};nS.getPublicKeyFingerprint=function(r,e){e=e||{};var t=e.md||ln.md.md5.create(),n="ssh-rsa",s=ln.util.createBuffer();tp(s,n),ba(s,r.e),ba(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 ba(r,e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var n=ln.util.hexToBytes(t);r.putInt32(n.length),r.putBytes(n)}o(ba,"_addBigIntegerToBuffer");function tp(r,e){r.putInt32(e.length),r.putString(e)}o(tp,"_addStringToBuffer");function rS(){for(var r=ln.md.sha1.create(),e=arguments.length,t=0;t<e;++t)r.update(arguments[t]);return r.digest()}o(rS,"_sha1")});var z3=ye((ufe,J3)=>{"use strict";J3.exports=$t();wu();m3();qi();Tw();Am();P3();Hh();V3();F3();H3();dx();Uw();pc();ux();yx();X3();wx();cx();ex();$w();fi();nx();W3();xx();ur()});var t4=ye((Afe,e4)=>{"use strict";var{PassThrough:yJ}=wt("stream");e4.exports=r=>{r={...r};let{array:e}=r,{encoding:t}=r,n=t==="buffer",s=!1;e?s=!(t||n):t=t||"utf8",n&&(t=null);let i=new yJ({objectMode:s});t&&i.setEncoding(t);let a=0,u=[];return i.on("data",l=>{u.push(l),s?a=u.length:a+=l.length}),i.getBufferedValue=()=>e?u:n?Buffer.concat(u,a):u.join(""),i.getBufferedLength=()=>a,i}});var n4=ye((bfe,Pm)=>{"use strict";var{constants:vJ}=wt("buffer"),wJ=wt("stream"),{promisify:SJ}=wt("util"),EJ=t4(),AJ=SJ(wJ.pipeline),r4=class extends Error{static{o(this,"MaxBufferError")}constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function $x(r,e){if(!r)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};let{maxBuffer:t}=e,n=EJ(e);return await new Promise((s,i)=>{let a=o(u=>{u&&n.getBufferedLength()<=vJ.MAX_LENGTH&&(u.bufferedData=n.getBufferedValue()),i(u)},"rejectPromise");(async()=>{try{await AJ(r,n),s()}catch(u){a(u)}})(),n.on("data",()=>{n.getBufferedLength()>t&&a(new r4)})}),n.getBufferedValue()}o($x,"getStream");Pm.exports=$x;Pm.exports.buffer=(r,e)=>$x(r,{...e,encoding:"buffer"});Pm.exports.array=(r,e)=>$x(r,{...e,array:!0});Pm.exports.MaxBufferError=r4});var yo=ye((np,Om)=>{"use strict";(function(){var r,e="4.17.21",t=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",i="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",f=1,h=2,m=4,g=1,w=2,y=1,S=2,E=4,b=8,T=16,A=32,C=64,x=128,B=256,F=512,R=30,H="...",q=800,K=16,G=1,he=2,le=3,oe=1/0,Z=9007199254740991,fe=17976931348623157e292,Se=NaN,Ke=4294967295,be=Ke-1,we=Ke>>>1,Me=[["ary",x],["bind",y],["bindKey",S],["curry",b],["curryRight",T],["flip",F],["partial",A],["partialRight",C],["rearg",B]],Je="[object Arguments]",Ye="[object Array]",lt="[object AsyncFunction]",O="[object Boolean]",_="[object Date]",ne="[object DOMException]",J="[object Error]",Xe="[object Function]",Re="[object GeneratorFunction]",xe="[object Map]",ct="[object Number]",rr="[object Null]",je="[object Object]",nr="[object Promise]",Vs="[object Proxy]",Ge="[object RegExp]",Mr="[object Set]",un="[object String]",Xn="[object Symbol]",gs="[object Undefined]",ss="[object WeakMap]",pt="[object WeakSet]",Ze="[object ArrayBuffer]",_n="[object DataView]",is="[object Float32Array]",oa="[object Float64Array]",ua="[object Int8Array]",Rt="[object Int16Array]",vh="[object Int32Array]",wh="[object Uint8Array]",rc="[object Uint8ClampedArray]",Q0="[object Uint16Array]",Us="[object Uint32Array]",d=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,$=/(__e\(.*?\)|\b__t\)) \+\n'';/g,te=/&(?:amp|lt|gt|quot|#39);/g,ie=/[&<>"']/g,X=RegExp(te.source),nt=RegExp(ie.source),kt=/<%-([\s\S]+?)%>/g,Wt=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Dt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rn=/^\w*$/,ri=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,or=/[\\^$.*+?()[\]{}|]/g,la=RegExp(or.source),Z0=/^\s+/,xv=/\s/,d2=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,m2=/\{\n\/\* \[wrapped with (.+)\] \*/,g2=/,? & /,y2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qe=/[()=,{}\[\]\/\s]/,Zt=/\\(\\)?/g,Gn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ki=/\w*$/,v2=/^[-+]0x[0-9a-f]+$/i,fM=/^0b[01]+$/i,hM=/^\[object .+?Constructor\]$/,pM=/^0o[0-7]+$/i,dM=/^(?:0|[1-9]\d*)$/,mM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nv=/($^)/,gM=/['\n\r\u2028\u2029\\]/g,Tv="\\ud800-\\udfff",yM="\\u0300-\\u036f",vM="\\ufe20-\\ufe2f",wM="\\u20d0-\\u20ff",cD=yM+vM+wM,fD="\\u2700-\\u27bf",hD="a-z\\xdf-\\xf6\\xf8-\\xff",SM="\\xac\\xb1\\xd7\\xf7",EM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",AM="\\u2000-\\u206f",CM=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pD="A-Z\\xc0-\\xd6\\xd8-\\xde",dD="\\ufe0e\\ufe0f",mD=SM+EM+AM+CM,w2="['\u2019]",bM="["+Tv+"]",gD="["+mD+"]",Iv="["+cD+"]",yD="\\d+",xM="["+fD+"]",vD="["+hD+"]",wD="[^"+Tv+mD+yD+fD+hD+pD+"]",S2="\\ud83c[\\udffb-\\udfff]",NM="(?:"+Iv+"|"+S2+")",SD="[^"+Tv+"]",E2="(?:\\ud83c[\\udde6-\\uddff]){2}",A2="[\\ud800-\\udbff][\\udc00-\\udfff]",Sh="["+pD+"]",ED="\\u200d",AD="(?:"+vD+"|"+wD+")",TM="(?:"+Sh+"|"+wD+")",CD="(?:"+w2+"(?:d|ll|m|re|s|t|ve))?",bD="(?:"+w2+"(?:D|LL|M|RE|S|T|VE))?",xD=NM+"?",ND="["+dD+"]?",IM="(?:"+ED+"(?:"+[SD,E2,A2].join("|")+")"+ND+xD+")*",BM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",DM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",TD=ND+xD+IM,_M="(?:"+[xM,E2,A2].join("|")+")"+TD,RM="(?:"+[SD+Iv+"?",Iv,E2,A2,bM].join("|")+")",PM=RegExp(w2,"g"),OM=RegExp(Iv,"g"),C2=RegExp(S2+"(?="+S2+")|"+RM+TD,"g"),kM=RegExp([Sh+"?"+vD+"+"+CD+"(?="+[gD,Sh,"$"].join("|")+")",TM+"+"+bD+"(?="+[gD,Sh+AD,"$"].join("|")+")",Sh+"?"+AD+"+"+CD,Sh+"+"+bD,DM,BM,yD,_M].join("|"),"g"),LM=RegExp("["+ED+Tv+cD+dD+"]"),VM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,UM=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],MM=-1,Lr={};Lr[is]=Lr[oa]=Lr[ua]=Lr[Rt]=Lr[vh]=Lr[wh]=Lr[rc]=Lr[Q0]=Lr[Us]=!0,Lr[Je]=Lr[Ye]=Lr[Ze]=Lr[O]=Lr[_n]=Lr[_]=Lr[J]=Lr[Xe]=Lr[xe]=Lr[ct]=Lr[je]=Lr[Ge]=Lr[Mr]=Lr[un]=Lr[ss]=!1;var Ir={};Ir[Je]=Ir[Ye]=Ir[Ze]=Ir[_n]=Ir[O]=Ir[_]=Ir[is]=Ir[oa]=Ir[ua]=Ir[Rt]=Ir[vh]=Ir[xe]=Ir[ct]=Ir[je]=Ir[Ge]=Ir[Mr]=Ir[un]=Ir[Xn]=Ir[wh]=Ir[rc]=Ir[Q0]=Ir[Us]=!0,Ir[J]=Ir[Xe]=Ir[ss]=!1;var jM={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},FM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qM={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},HM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},KM=parseFloat,$M=parseInt,ID=typeof global=="object"&&global&&global.Object===Object&&global,XM=typeof self=="object"&&self&&self.Object===Object&&self,En=ID||XM||Function("return this")(),b2=typeof np=="object"&&np&&!np.nodeType&&np,nc=b2&&typeof Om=="object"&&Om&&!Om.nodeType&&Om,BD=nc&&nc.exports===b2,x2=BD&&ID.process,ni=(function(){try{var se=nc&&nc.require&&nc.require("util").types;return se||x2&&x2.binding&&x2.binding("util")}catch{}})(),DD=ni&&ni.isArrayBuffer,_D=ni&&ni.isDate,RD=ni&&ni.isMap,PD=ni&&ni.isRegExp,OD=ni&&ni.isSet,kD=ni&&ni.isTypedArray;function Ms(se,Ce,ve){switch(ve.length){case 0:return se.call(Ce);case 1:return se.call(Ce,ve[0]);case 2:return se.call(Ce,ve[0],ve[1]);case 3:return se.call(Ce,ve[0],ve[1],ve[2])}return se.apply(Ce,ve)}o(Ms,"apply");function GM(se,Ce,ve,ut){for(var Pt=-1,mr=se==null?0:se.length;++Pt<mr;){var mn=se[Pt];Ce(ut,mn,ve(mn),se)}return ut}o(GM,"arrayAggregator");function si(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut&&Ce(se[ve],ve,se)!==!1;);return se}o(si,"arrayEach");function WM(se,Ce){for(var ve=se==null?0:se.length;ve--&&Ce(se[ve],ve,se)!==!1;);return se}o(WM,"arrayEachRight");function LD(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut;)if(!Ce(se[ve],ve,se))return!1;return!0}o(LD,"arrayEvery");function nu(se,Ce){for(var ve=-1,ut=se==null?0:se.length,Pt=0,mr=[];++ve<ut;){var mn=se[ve];Ce(mn,ve,se)&&(mr[Pt++]=mn)}return mr}o(nu,"arrayFilter");function Bv(se,Ce){var ve=se==null?0:se.length;return!!ve&&Eh(se,Ce,0)>-1}o(Bv,"arrayIncludes");function N2(se,Ce,ve){for(var ut=-1,Pt=se==null?0:se.length;++ut<Pt;)if(ve(Ce,se[ut]))return!0;return!1}o(N2,"arrayIncludesWith");function jr(se,Ce){for(var ve=-1,ut=se==null?0:se.length,Pt=Array(ut);++ve<ut;)Pt[ve]=Ce(se[ve],ve,se);return Pt}o(jr,"arrayMap");function su(se,Ce){for(var ve=-1,ut=Ce.length,Pt=se.length;++ve<ut;)se[Pt+ve]=Ce[ve];return se}o(su,"arrayPush");function T2(se,Ce,ve,ut){var Pt=-1,mr=se==null?0:se.length;for(ut&&mr&&(ve=se[++Pt]);++Pt<mr;)ve=Ce(ve,se[Pt],Pt,se);return ve}o(T2,"arrayReduce");function JM(se,Ce,ve,ut){var Pt=se==null?0:se.length;for(ut&&Pt&&(ve=se[--Pt]);Pt--;)ve=Ce(ve,se[Pt],Pt,se);return ve}o(JM,"arrayReduceRight");function I2(se,Ce){for(var ve=-1,ut=se==null?0:se.length;++ve<ut;)if(Ce(se[ve],ve,se))return!0;return!1}o(I2,"arraySome");var zM=B2("length");function YM(se){return se.split("")}o(YM,"asciiToArray");function QM(se){return se.match(y2)||[]}o(QM,"asciiWords");function VD(se,Ce,ve){var ut;return ve(se,function(Pt,mr,mn){if(Ce(Pt,mr,mn))return ut=mr,!1}),ut}o(VD,"baseFindKey");function Dv(se,Ce,ve,ut){for(var Pt=se.length,mr=ve+(ut?1:-1);ut?mr--:++mr<Pt;)if(Ce(se[mr],mr,se))return mr;return-1}o(Dv,"baseFindIndex");function Eh(se,Ce,ve){return Ce===Ce?cj(se,Ce,ve):Dv(se,UD,ve)}o(Eh,"baseIndexOf");function ZM(se,Ce,ve,ut){for(var Pt=ve-1,mr=se.length;++Pt<mr;)if(ut(se[Pt],Ce))return Pt;return-1}o(ZM,"baseIndexOfWith");function UD(se){return se!==se}o(UD,"baseIsNaN");function MD(se,Ce){var ve=se==null?0:se.length;return ve?_2(se,Ce)/ve:Se}o(MD,"baseMean");function B2(se){return function(Ce){return Ce==null?r:Ce[se]}}o(B2,"baseProperty");function D2(se){return function(Ce){return se==null?r:se[Ce]}}o(D2,"basePropertyOf");function jD(se,Ce,ve,ut,Pt){return Pt(se,function(mr,mn,br){ve=ut?(ut=!1,mr):Ce(ve,mr,mn,br)}),ve}o(jD,"baseReduce");function ej(se,Ce){var ve=se.length;for(se.sort(Ce);ve--;)se[ve]=se[ve].value;return se}o(ej,"baseSortBy");function _2(se,Ce){for(var ve,ut=-1,Pt=se.length;++ut<Pt;){var mr=Ce(se[ut]);mr!==r&&(ve=ve===r?mr:ve+mr)}return ve}o(_2,"baseSum");function R2(se,Ce){for(var ve=-1,ut=Array(se);++ve<se;)ut[ve]=Ce(ve);return ut}o(R2,"baseTimes");function tj(se,Ce){return jr(Ce,function(ve){return[ve,se[ve]]})}o(tj,"baseToPairs");function FD(se){return se&&se.slice(0,$D(se)+1).replace(Z0,"")}o(FD,"baseTrim");function js(se){return function(Ce){return se(Ce)}}o(js,"baseUnary");function P2(se,Ce){return jr(Ce,function(ve){return se[ve]})}o(P2,"baseValues");function em(se,Ce){return se.has(Ce)}o(em,"cacheHas");function qD(se,Ce){for(var ve=-1,ut=se.length;++ve<ut&&Eh(Ce,se[ve],0)>-1;);return ve}o(qD,"charsStartIndex");function HD(se,Ce){for(var ve=se.length;ve--&&Eh(Ce,se[ve],0)>-1;);return ve}o(HD,"charsEndIndex");function rj(se,Ce){for(var ve=se.length,ut=0;ve--;)se[ve]===Ce&&++ut;return ut}o(rj,"countHolders");var nj=D2(jM),sj=D2(FM);function ij(se){return"\\"+HM[se]}o(ij,"escapeStringChar");function aj(se,Ce){return se==null?r:se[Ce]}o(aj,"getValue");function Ah(se){return LM.test(se)}o(Ah,"hasUnicode");function oj(se){return VM.test(se)}o(oj,"hasUnicodeWord");function uj(se){for(var Ce,ve=[];!(Ce=se.next()).done;)ve.push(Ce.value);return ve}o(uj,"iteratorToArray");function O2(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut,Pt){ve[++Ce]=[Pt,ut]}),ve}o(O2,"mapToArray");function KD(se,Ce){return function(ve){return se(Ce(ve))}}o(KD,"overArg");function iu(se,Ce){for(var ve=-1,ut=se.length,Pt=0,mr=[];++ve<ut;){var mn=se[ve];(mn===Ce||mn===l)&&(se[ve]=l,mr[Pt++]=ve)}return mr}o(iu,"replaceHolders");function _v(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut){ve[++Ce]=ut}),ve}o(_v,"setToArray");function lj(se){var Ce=-1,ve=Array(se.size);return se.forEach(function(ut){ve[++Ce]=[ut,ut]}),ve}o(lj,"setToPairs");function cj(se,Ce,ve){for(var ut=ve-1,Pt=se.length;++ut<Pt;)if(se[ut]===Ce)return ut;return-1}o(cj,"strictIndexOf");function fj(se,Ce,ve){for(var ut=ve+1;ut--;)if(se[ut]===Ce)return ut;return ut}o(fj,"strictLastIndexOf");function Ch(se){return Ah(se)?pj(se):zM(se)}o(Ch,"stringSize");function Li(se){return Ah(se)?dj(se):YM(se)}o(Li,"stringToArray");function $D(se){for(var Ce=se.length;Ce--&&xv.test(se.charAt(Ce)););return Ce}o($D,"trimmedEndIndex");var hj=D2(qM);function pj(se){for(var Ce=C2.lastIndex=0;C2.test(se);)++Ce;return Ce}o(pj,"unicodeSize");function dj(se){return se.match(C2)||[]}o(dj,"unicodeToArray");function mj(se){return se.match(kM)||[]}o(mj,"unicodeWords");var gj=o(function se(Ce){Ce=Ce==null?En:au.defaults(En.Object(),Ce,au.pick(En,UM));var ve=Ce.Array,ut=Ce.Date,Pt=Ce.Error,mr=Ce.Function,mn=Ce.Math,br=Ce.Object,k2=Ce.RegExp,yj=Ce.String,ii=Ce.TypeError,Rv=ve.prototype,vj=mr.prototype,bh=br.prototype,Pv=Ce["__core-js_shared__"],Ov=vj.toString,wr=bh.hasOwnProperty,wj=0,XD=(function(){var c=/[^.]+$/.exec(Pv&&Pv.keys&&Pv.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""})(),kv=bh.toString,Sj=Ov.call(br),Ej=En._,Aj=k2("^"+Ov.call(wr).replace(or,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Lv=BD?Ce.Buffer:r,ou=Ce.Symbol,Vv=Ce.Uint8Array,GD=Lv?Lv.allocUnsafe:r,Uv=KD(br.getPrototypeOf,br),WD=br.create,JD=bh.propertyIsEnumerable,Mv=Rv.splice,zD=ou?ou.isConcatSpreadable:r,tm=ou?ou.iterator:r,sc=ou?ou.toStringTag:r,jv=(function(){try{var c=lc(br,"defineProperty");return c({},"",{}),c}catch{}})(),Cj=Ce.clearTimeout!==En.clearTimeout&&Ce.clearTimeout,bj=ut&&ut.now!==En.Date.now&&ut.now,xj=Ce.setTimeout!==En.setTimeout&&Ce.setTimeout,Fv=mn.ceil,qv=mn.floor,L2=br.getOwnPropertySymbols,Nj=Lv?Lv.isBuffer:r,YD=Ce.isFinite,Tj=Rv.join,Ij=KD(br.keys,br),gn=mn.max,Wn=mn.min,Bj=ut.now,Dj=Ce.parseInt,QD=mn.random,_j=Rv.reverse,V2=lc(Ce,"DataView"),rm=lc(Ce,"Map"),U2=lc(Ce,"Promise"),xh=lc(Ce,"Set"),nm=lc(Ce,"WeakMap"),sm=lc(br,"create"),Hv=nm&&new nm,Nh={},Rj=cc(V2),Pj=cc(rm),Oj=cc(U2),kj=cc(xh),Lj=cc(nm),Kv=ou?ou.prototype:r,im=Kv?Kv.valueOf:r,ZD=Kv?Kv.toString:r;function M(c){if(Jr(c)&&!Lt(c)&&!(c instanceof er)){if(c instanceof ai)return c;if(wr.call(c,"__wrapped__"))return eR(c)}return new ai(c)}o(M,"lodash");var Th=(function(){function c(){}return o(c,"object"),function(p){if(!Hr(p))return{};if(WD)return WD(p);c.prototype=p;var v=new c;return c.prototype=r,v}})();function $v(){}o($v,"baseLodash");function ai(c,p){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=r}o(ai,"LodashWrapper"),M.templateSettings={escape:kt,evaluate:Wt,interpolate:et,variable:"",imports:{_:M}},M.prototype=$v.prototype,M.prototype.constructor=M,ai.prototype=Th($v.prototype),ai.prototype.constructor=ai;function er(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ke,this.__views__=[]}o(er,"LazyWrapper");function Vj(){var c=new er(this.__wrapped__);return c.__actions__=ys(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=ys(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=ys(this.__views__),c}o(Vj,"lazyClone");function Uj(){if(this.__filtered__){var c=new er(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}o(Uj,"lazyReverse");function Mj(){var c=this.__wrapped__.value(),p=this.__dir__,v=Lt(c),N=p<0,P=v?c.length:0,j=YF(0,P,this.__views__),z=j.start,Q=j.end,ue=Q-z,Ne=N?Q:z-1,De=this.__iteratees__,Le=De.length,ze=0,ht=Wn(ue,this.__takeCount__);if(!v||!N&&P==ue&&ht==ue)return C_(c,this.__actions__);var bt=[];e:for(;ue--&&ze<ht;){Ne+=p;for(var Kt=-1,xt=c[Ne];++Kt<Le;){var Jt=De[Kt],sr=Jt.iteratee,Hs=Jt.type,us=sr(xt);if(Hs==he)xt=us;else if(!us){if(Hs==G)continue e;break e}}bt[ze++]=xt}return bt}o(Mj,"lazyValue"),er.prototype=Th($v.prototype),er.prototype.constructor=er;function ic(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(ic,"Hash");function jj(){this.__data__=sm?sm(null):{},this.size=0}o(jj,"hashClear");function Fj(c){var p=this.has(c)&&delete this.__data__[c];return this.size-=p?1:0,p}o(Fj,"hashDelete");function qj(c){var p=this.__data__;if(sm){var v=p[c];return v===a?r:v}return wr.call(p,c)?p[c]:r}o(qj,"hashGet");function Hj(c){var p=this.__data__;return sm?p[c]!==r:wr.call(p,c)}o(Hj,"hashHas");function Kj(c,p){var v=this.__data__;return this.size+=this.has(c)?0:1,v[c]=sm&&p===r?a:p,this}o(Kj,"hashSet"),ic.prototype.clear=jj,ic.prototype.delete=Fj,ic.prototype.get=qj,ic.prototype.has=Hj,ic.prototype.set=Kj;function to(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(to,"ListCache");function $j(){this.__data__=[],this.size=0}o($j,"listCacheClear");function Xj(c){var p=this.__data__,v=Xv(p,c);if(v<0)return!1;var N=p.length-1;return v==N?p.pop():Mv.call(p,v,1),--this.size,!0}o(Xj,"listCacheDelete");function Gj(c){var p=this.__data__,v=Xv(p,c);return v<0?r:p[v][1]}o(Gj,"listCacheGet");function Wj(c){return Xv(this.__data__,c)>-1}o(Wj,"listCacheHas");function Jj(c,p){var v=this.__data__,N=Xv(v,c);return N<0?(++this.size,v.push([c,p])):v[N][1]=p,this}o(Jj,"listCacheSet"),to.prototype.clear=$j,to.prototype.delete=Xj,to.prototype.get=Gj,to.prototype.has=Wj,to.prototype.set=Jj;function ro(c){var p=-1,v=c==null?0:c.length;for(this.clear();++p<v;){var N=c[p];this.set(N[0],N[1])}}o(ro,"MapCache");function zj(){this.size=0,this.__data__={hash:new ic,map:new(rm||to),string:new ic}}o(zj,"mapCacheClear");function Yj(c){var p=sw(this,c).delete(c);return this.size-=p?1:0,p}o(Yj,"mapCacheDelete");function Qj(c){return sw(this,c).get(c)}o(Qj,"mapCacheGet");function Zj(c){return sw(this,c).has(c)}o(Zj,"mapCacheHas");function eF(c,p){var v=sw(this,c),N=v.size;return v.set(c,p),this.size+=v.size==N?0:1,this}o(eF,"mapCacheSet"),ro.prototype.clear=zj,ro.prototype.delete=Yj,ro.prototype.get=Qj,ro.prototype.has=Zj,ro.prototype.set=eF;function ac(c){var p=-1,v=c==null?0:c.length;for(this.__data__=new ro;++p<v;)this.add(c[p])}o(ac,"SetCache");function tF(c){return this.__data__.set(c,a),this}o(tF,"setCacheAdd");function rF(c){return this.__data__.has(c)}o(rF,"setCacheHas"),ac.prototype.add=ac.prototype.push=tF,ac.prototype.has=rF;function Vi(c){var p=this.__data__=new to(c);this.size=p.size}o(Vi,"Stack");function nF(){this.__data__=new to,this.size=0}o(nF,"stackClear");function sF(c){var p=this.__data__,v=p.delete(c);return this.size=p.size,v}o(sF,"stackDelete");function iF(c){return this.__data__.get(c)}o(iF,"stackGet");function aF(c){return this.__data__.has(c)}o(aF,"stackHas");function oF(c,p){var v=this.__data__;if(v instanceof to){var N=v.__data__;if(!rm||N.length<t-1)return N.push([c,p]),this.size=++v.size,this;v=this.__data__=new ro(N)}return v.set(c,p),this.size=v.size,this}o(oF,"stackSet"),Vi.prototype.clear=nF,Vi.prototype.delete=sF,Vi.prototype.get=iF,Vi.prototype.has=aF,Vi.prototype.set=oF;function e_(c,p){var v=Lt(c),N=!v&&fc(c),P=!v&&!N&&hu(c),j=!v&&!N&&!P&&_h(c),z=v||N||P||j,Q=z?R2(c.length,yj):[],ue=Q.length;for(var Ne in c)(p||wr.call(c,Ne))&&!(z&&(Ne=="length"||P&&(Ne=="offset"||Ne=="parent")||j&&(Ne=="buffer"||Ne=="byteLength"||Ne=="byteOffset")||ao(Ne,ue)))&&Q.push(Ne);return Q}o(e_,"arrayLikeKeys");function t_(c){var p=c.length;return p?c[J2(0,p-1)]:r}o(t_,"arraySample");function uF(c,p){return iw(ys(c),oc(p,0,c.length))}o(uF,"arraySampleSize");function lF(c){return iw(ys(c))}o(lF,"arrayShuffle");function M2(c,p,v){(v!==r&&!Ui(c[p],v)||v===r&&!(p in c))&&no(c,p,v)}o(M2,"assignMergeValue");function am(c,p,v){var N=c[p];(!(wr.call(c,p)&&Ui(N,v))||v===r&&!(p in c))&&no(c,p,v)}o(am,"assignValue");function Xv(c,p){for(var v=c.length;v--;)if(Ui(c[v][0],p))return v;return-1}o(Xv,"assocIndexOf");function cF(c,p,v,N){return uu(c,function(P,j,z){p(N,P,v(P),z)}),N}o(cF,"baseAggregator");function r_(c,p){return c&&fa(p,An(p),c)}o(r_,"baseAssign");function fF(c,p){return c&&fa(p,ws(p),c)}o(fF,"baseAssignIn");function no(c,p,v){p=="__proto__"&&jv?jv(c,p,{configurable:!0,enumerable:!0,value:v,writable:!0}):c[p]=v}o(no,"baseAssignValue");function j2(c,p){for(var v=-1,N=p.length,P=ve(N),j=c==null;++v<N;)P[v]=j?r:Sb(c,p[v]);return P}o(j2,"baseAt");function oc(c,p,v){return c===c&&(v!==r&&(c=c<=v?c:v),p!==r&&(c=c>=p?c:p)),c}o(oc,"baseClamp");function oi(c,p,v,N,P,j){var z,Q=p&f,ue=p&h,Ne=p&m;if(v&&(z=P?v(c,N,P,j):v(c)),z!==r)return z;if(!Hr(c))return c;var De=Lt(c);if(De){if(z=ZF(c),!Q)return ys(c,z)}else{var Le=Jn(c),ze=Le==Xe||Le==Re;if(hu(c))return N_(c,Q);if(Le==je||Le==Je||ze&&!P){if(z=ue||ze?{}:$_(c),!Q)return ue?qF(c,fF(z,c)):FF(c,r_(z,c))}else{if(!Ir[Le])return P?c:{};z=e9(c,Le,Q)}}j||(j=new Vi);var ht=j.get(c);if(ht)return ht;j.set(c,z),SR(c)?c.forEach(function(xt){z.add(oi(xt,p,v,xt,c,j))}):vR(c)&&c.forEach(function(xt,Jt){z.set(Jt,oi(xt,p,v,Jt,c,j))});var bt=Ne?ue?ab:ib:ue?ws:An,Kt=De?r:bt(c);return si(Kt||c,function(xt,Jt){Kt&&(Jt=xt,xt=c[Jt]),am(z,Jt,oi(xt,p,v,Jt,c,j))}),z}o(oi,"baseClone");function hF(c){var p=An(c);return function(v){return n_(v,c,p)}}o(hF,"baseConforms");function n_(c,p,v){var N=v.length;if(c==null)return!N;for(c=br(c);N--;){var P=v[N],j=p[P],z=c[P];if(z===r&&!(P in c)||!j(z))return!1}return!0}o(n_,"baseConformsTo");function s_(c,p,v){if(typeof c!="function")throw new ii(s);return pm(function(){c.apply(r,v)},p)}o(s_,"baseDelay");function om(c,p,v,N){var P=-1,j=Bv,z=!0,Q=c.length,ue=[],Ne=p.length;if(!Q)return ue;v&&(p=jr(p,js(v))),N?(j=N2,z=!1):p.length>=t&&(j=em,z=!1,p=new ac(p));e:for(;++P<Q;){var De=c[P],Le=v==null?De:v(De);if(De=N||De!==0?De:0,z&&Le===Le){for(var ze=Ne;ze--;)if(p[ze]===Le)continue e;ue.push(De)}else j(p,Le,N)||ue.push(De)}return ue}o(om,"baseDifference");var uu=__(ca),i_=__(q2,!0);function pF(c,p){var v=!0;return uu(c,function(N,P,j){return v=!!p(N,P,j),v}),v}o(pF,"baseEvery");function Gv(c,p,v){for(var N=-1,P=c.length;++N<P;){var j=c[N],z=p(j);if(z!=null&&(Q===r?z===z&&!qs(z):v(z,Q)))var Q=z,ue=j}return ue}o(Gv,"baseExtremum");function dF(c,p,v,N){var P=c.length;for(v=jt(v),v<0&&(v=-v>P?0:P+v),N=N===r||N>P?P:jt(N),N<0&&(N+=P),N=v>N?0:AR(N);v<N;)c[v++]=p;return c}o(dF,"baseFill");function a_(c,p){var v=[];return uu(c,function(N,P,j){p(N,P,j)&&v.push(N)}),v}o(a_,"baseFilter");function Pn(c,p,v,N,P){var j=-1,z=c.length;for(v||(v=r9),P||(P=[]);++j<z;){var Q=c[j];p>0&&v(Q)?p>1?Pn(Q,p-1,v,N,P):su(P,Q):N||(P[P.length]=Q)}return P}o(Pn,"baseFlatten");var F2=R_(),o_=R_(!0);function ca(c,p){return c&&F2(c,p,An)}o(ca,"baseForOwn");function q2(c,p){return c&&o_(c,p,An)}o(q2,"baseForOwnRight");function Wv(c,p){return nu(p,function(v){return oo(c[v])})}o(Wv,"baseFunctions");function uc(c,p){p=cu(p,c);for(var v=0,N=p.length;c!=null&&v<N;)c=c[ha(p[v++])];return v&&v==N?c:r}o(uc,"baseGet");function u_(c,p,v){var N=p(c);return Lt(c)?N:su(N,v(c))}o(u_,"baseGetAllKeys");function as(c){return c==null?c===r?gs:rr:sc&&sc in br(c)?zF(c):l9(c)}o(as,"baseGetTag");function H2(c,p){return c>p}o(H2,"baseGt");function mF(c,p){return c!=null&&wr.call(c,p)}o(mF,"baseHas");function gF(c,p){return c!=null&&p in br(c)}o(gF,"baseHasIn");function yF(c,p,v){return c>=Wn(p,v)&&c<gn(p,v)}o(yF,"baseInRange");function K2(c,p,v){for(var N=v?N2:Bv,P=c[0].length,j=c.length,z=j,Q=ve(j),ue=1/0,Ne=[];z--;){var De=c[z];z&&p&&(De=jr(De,js(p))),ue=Wn(De.length,ue),Q[z]=!v&&(p||P>=120&&De.length>=120)?new ac(z&&De):r}De=c[0];var Le=-1,ze=Q[0];e:for(;++Le<P&&Ne.length<ue;){var ht=De[Le],bt=p?p(ht):ht;if(ht=v||ht!==0?ht:0,!(ze?em(ze,bt):N(Ne,bt,v))){for(z=j;--z;){var Kt=Q[z];if(!(Kt?em(Kt,bt):N(c[z],bt,v)))continue e}ze&&ze.push(bt),Ne.push(ht)}}return Ne}o(K2,"baseIntersection");function vF(c,p,v,N){return ca(c,function(P,j,z){p(N,v(P),j,z)}),N}o(vF,"baseInverter");function um(c,p,v){p=cu(p,c),c=J_(c,p);var N=c==null?c:c[ha(li(p))];return N==null?r:Ms(N,c,v)}o(um,"baseInvoke");function l_(c){return Jr(c)&&as(c)==Je}o(l_,"baseIsArguments");function wF(c){return Jr(c)&&as(c)==Ze}o(wF,"baseIsArrayBuffer");function SF(c){return Jr(c)&&as(c)==_}o(SF,"baseIsDate");function lm(c,p,v,N,P){return c===p?!0:c==null||p==null||!Jr(c)&&!Jr(p)?c!==c&&p!==p:EF(c,p,v,N,lm,P)}o(lm,"baseIsEqual");function EF(c,p,v,N,P,j){var z=Lt(c),Q=Lt(p),ue=z?Ye:Jn(c),Ne=Q?Ye:Jn(p);ue=ue==Je?je:ue,Ne=Ne==Je?je:Ne;var De=ue==je,Le=Ne==je,ze=ue==Ne;if(ze&&hu(c)){if(!hu(p))return!1;z=!0,De=!1}if(ze&&!De)return j||(j=new Vi),z||_h(c)?q_(c,p,v,N,P,j):WF(c,p,ue,v,N,P,j);if(!(v&g)){var ht=De&&wr.call(c,"__wrapped__"),bt=Le&&wr.call(p,"__wrapped__");if(ht||bt){var Kt=ht?c.value():c,xt=bt?p.value():p;return j||(j=new Vi),P(Kt,xt,v,N,j)}}return ze?(j||(j=new Vi),JF(c,p,v,N,P,j)):!1}o(EF,"baseIsEqualDeep");function AF(c){return Jr(c)&&Jn(c)==xe}o(AF,"baseIsMap");function $2(c,p,v,N){var P=v.length,j=P,z=!N;if(c==null)return!j;for(c=br(c);P--;){var Q=v[P];if(z&&Q[2]?Q[1]!==c[Q[0]]:!(Q[0]in c))return!1}for(;++P<j;){Q=v[P];var ue=Q[0],Ne=c[ue],De=Q[1];if(z&&Q[2]){if(Ne===r&&!(ue in c))return!1}else{var Le=new Vi;if(N)var ze=N(Ne,De,ue,c,p,Le);if(!(ze===r?lm(De,Ne,g|w,N,Le):ze))return!1}}return!0}o($2,"baseIsMatch");function c_(c){if(!Hr(c)||s9(c))return!1;var p=oo(c)?Aj:hM;return p.test(cc(c))}o(c_,"baseIsNative");function CF(c){return Jr(c)&&as(c)==Ge}o(CF,"baseIsRegExp");function bF(c){return Jr(c)&&Jn(c)==Mr}o(bF,"baseIsSet");function xF(c){return Jr(c)&&fw(c.length)&&!!Lr[as(c)]}o(xF,"baseIsTypedArray");function f_(c){return typeof c=="function"?c:c==null?Ss:typeof c=="object"?Lt(c)?d_(c[0],c[1]):p_(c):PR(c)}o(f_,"baseIteratee");function X2(c){if(!hm(c))return Ij(c);var p=[];for(var v in br(c))wr.call(c,v)&&v!="constructor"&&p.push(v);return p}o(X2,"baseKeys");function NF(c){if(!Hr(c))return u9(c);var p=hm(c),v=[];for(var N in c)N=="constructor"&&(p||!wr.call(c,N))||v.push(N);return v}o(NF,"baseKeysIn");function G2(c,p){return c<p}o(G2,"baseLt");function h_(c,p){var v=-1,N=vs(c)?ve(c.length):[];return uu(c,function(P,j,z){N[++v]=p(P,j,z)}),N}o(h_,"baseMap");function p_(c){var p=ub(c);return p.length==1&&p[0][2]?G_(p[0][0],p[0][1]):function(v){return v===c||$2(v,c,p)}}o(p_,"baseMatches");function d_(c,p){return cb(c)&&X_(p)?G_(ha(c),p):function(v){var N=Sb(v,c);return N===r&&N===p?Eb(v,c):lm(p,N,g|w)}}o(d_,"baseMatchesProperty");function Jv(c,p,v,N,P){c!==p&&F2(p,function(j,z){if(P||(P=new Vi),Hr(j))TF(c,p,z,v,Jv,N,P);else{var Q=N?N(hb(c,z),j,z+"",c,p,P):r;Q===r&&(Q=j),M2(c,z,Q)}},ws)}o(Jv,"baseMerge");function TF(c,p,v,N,P,j,z){var Q=hb(c,v),ue=hb(p,v),Ne=z.get(ue);if(Ne){M2(c,v,Ne);return}var De=j?j(Q,ue,v+"",c,p,z):r,Le=De===r;if(Le){var ze=Lt(ue),ht=!ze&&hu(ue),bt=!ze&&!ht&&_h(ue);De=ue,ze||ht||bt?Lt(Q)?De=Q:tn(Q)?De=ys(Q):ht?(Le=!1,De=N_(ue,!0)):bt?(Le=!1,De=T_(ue,!0)):De=[]:dm(ue)||fc(ue)?(De=Q,fc(Q)?De=CR(Q):(!Hr(Q)||oo(Q))&&(De=$_(ue))):Le=!1}Le&&(z.set(ue,De),P(De,ue,N,j,z),z.delete(ue)),M2(c,v,De)}o(TF,"baseMergeDeep");function m_(c,p){var v=c.length;if(v)return p+=p<0?v:0,ao(p,v)?c[p]:r}o(m_,"baseNth");function g_(c,p,v){p.length?p=jr(p,function(j){return Lt(j)?function(z){return uc(z,j.length===1?j[0]:j)}:j}):p=[Ss];var N=-1;p=jr(p,js(Et()));var P=h_(c,function(j,z,Q){var ue=jr(p,function(Ne){return Ne(j)});return{criteria:ue,index:++N,value:j}});return ej(P,function(j,z){return jF(j,z,v)})}o(g_,"baseOrderBy");function IF(c,p){return y_(c,p,function(v,N){return Eb(c,N)})}o(IF,"basePick");function y_(c,p,v){for(var N=-1,P=p.length,j={};++N<P;){var z=p[N],Q=uc(c,z);v(Q,z)&&cm(j,cu(z,c),Q)}return j}o(y_,"basePickBy");function BF(c){return function(p){return uc(p,c)}}o(BF,"basePropertyDeep");function W2(c,p,v,N){var P=N?ZM:Eh,j=-1,z=p.length,Q=c;for(c===p&&(p=ys(p)),v&&(Q=jr(c,js(v)));++j<z;)for(var ue=0,Ne=p[j],De=v?v(Ne):Ne;(ue=P(Q,De,ue,N))>-1;)Q!==c&&Mv.call(Q,ue,1),Mv.call(c,ue,1);return c}o(W2,"basePullAll");function v_(c,p){for(var v=c?p.length:0,N=v-1;v--;){var P=p[v];if(v==N||P!==j){var j=P;ao(P)?Mv.call(c,P,1):Q2(c,P)}}return c}o(v_,"basePullAt");function J2(c,p){return c+qv(QD()*(p-c+1))}o(J2,"baseRandom");function DF(c,p,v,N){for(var P=-1,j=gn(Fv((p-c)/(v||1)),0),z=ve(j);j--;)z[N?j:++P]=c,c+=v;return z}o(DF,"baseRange");function z2(c,p){var v="";if(!c||p<1||p>Z)return v;do p%2&&(v+=c),p=qv(p/2),p&&(c+=c);while(p);return v}o(z2,"baseRepeat");function Gt(c,p){return pb(W_(c,p,Ss),c+"")}o(Gt,"baseRest");function _F(c){return t_(Rh(c))}o(_F,"baseSample");function RF(c,p){var v=Rh(c);return iw(v,oc(p,0,v.length))}o(RF,"baseSampleSize");function cm(c,p,v,N){if(!Hr(c))return c;p=cu(p,c);for(var P=-1,j=p.length,z=j-1,Q=c;Q!=null&&++P<j;){var ue=ha(p[P]),Ne=v;if(ue==="__proto__"||ue==="constructor"||ue==="prototype")return c;if(P!=z){var De=Q[ue];Ne=N?N(De,ue,Q):r,Ne===r&&(Ne=Hr(De)?De:ao(p[P+1])?[]:{})}am(Q,ue,Ne),Q=Q[ue]}return c}o(cm,"baseSet");var w_=Hv?function(c,p){return Hv.set(c,p),c}:Ss,PF=jv?function(c,p){return jv(c,"toString",{configurable:!0,enumerable:!1,value:Cb(p),writable:!0})}:Ss;function OF(c){return iw(Rh(c))}o(OF,"baseShuffle");function ui(c,p,v){var N=-1,P=c.length;p<0&&(p=-p>P?0:P+p),v=v>P?P:v,v<0&&(v+=P),P=p>v?0:v-p>>>0,p>>>=0;for(var j=ve(P);++N<P;)j[N]=c[N+p];return j}o(ui,"baseSlice");function kF(c,p){var v;return uu(c,function(N,P,j){return v=p(N,P,j),!v}),!!v}o(kF,"baseSome");function zv(c,p,v){var N=0,P=c==null?N:c.length;if(typeof p=="number"&&p===p&&P<=we){for(;N<P;){var j=N+P>>>1,z=c[j];z!==null&&!qs(z)&&(v?z<=p:z<p)?N=j+1:P=j}return P}return Y2(c,p,Ss,v)}o(zv,"baseSortedIndex");function Y2(c,p,v,N){var P=0,j=c==null?0:c.length;if(j===0)return 0;p=v(p);for(var z=p!==p,Q=p===null,ue=qs(p),Ne=p===r;P<j;){var De=qv((P+j)/2),Le=v(c[De]),ze=Le!==r,ht=Le===null,bt=Le===Le,Kt=qs(Le);if(z)var xt=N||bt;else Ne?xt=bt&&(N||ze):Q?xt=bt&&ze&&(N||!ht):ue?xt=bt&&ze&&!ht&&(N||!Kt):ht||Kt?xt=!1:xt=N?Le<=p:Le<p;xt?P=De+1:j=De}return Wn(j,be)}o(Y2,"baseSortedIndexBy");function S_(c,p){for(var v=-1,N=c.length,P=0,j=[];++v<N;){var z=c[v],Q=p?p(z):z;if(!v||!Ui(Q,ue)){var ue=Q;j[P++]=z===0?0:z}}return j}o(S_,"baseSortedUniq");function E_(c){return typeof c=="number"?c:qs(c)?Se:+c}o(E_,"baseToNumber");function Fs(c){if(typeof c=="string")return c;if(Lt(c))return jr(c,Fs)+"";if(qs(c))return ZD?ZD.call(c):"";var p=c+"";return p=="0"&&1/c==-oe?"-0":p}o(Fs,"baseToString");function lu(c,p,v){var N=-1,P=Bv,j=c.length,z=!0,Q=[],ue=Q;if(v)z=!1,P=N2;else if(j>=t){var Ne=p?null:XF(c);if(Ne)return _v(Ne);z=!1,P=em,ue=new ac}else ue=p?[]:Q;e:for(;++N<j;){var De=c[N],Le=p?p(De):De;if(De=v||De!==0?De:0,z&&Le===Le){for(var ze=ue.length;ze--;)if(ue[ze]===Le)continue e;p&&ue.push(Le),Q.push(De)}else P(ue,Le,v)||(ue!==Q&&ue.push(Le),Q.push(De))}return Q}o(lu,"baseUniq");function Q2(c,p){return p=cu(p,c),c=J_(c,p),c==null||delete c[ha(li(p))]}o(Q2,"baseUnset");function A_(c,p,v,N){return cm(c,p,v(uc(c,p)),N)}o(A_,"baseUpdate");function Yv(c,p,v,N){for(var P=c.length,j=N?P:-1;(N?j--:++j<P)&&p(c[j],j,c););return v?ui(c,N?0:j,N?j+1:P):ui(c,N?j+1:0,N?P:j)}o(Yv,"baseWhile");function C_(c,p){var v=c;return v instanceof er&&(v=v.value()),T2(p,function(N,P){return P.func.apply(P.thisArg,su([N],P.args))},v)}o(C_,"baseWrapperValue");function Z2(c,p,v){var N=c.length;if(N<2)return N?lu(c[0]):[];for(var P=-1,j=ve(N);++P<N;)for(var z=c[P],Q=-1;++Q<N;)Q!=P&&(j[P]=om(j[P]||z,c[Q],p,v));return lu(Pn(j,1),p,v)}o(Z2,"baseXor");function b_(c,p,v){for(var N=-1,P=c.length,j=p.length,z={};++N<P;){var Q=N<j?p[N]:r;v(z,c[N],Q)}return z}o(b_,"baseZipObject");function eb(c){return tn(c)?c:[]}o(eb,"castArrayLikeObject");function tb(c){return typeof c=="function"?c:Ss}o(tb,"castFunction");function cu(c,p){return Lt(c)?c:cb(c,p)?[c]:Z_(gr(c))}o(cu,"castPath");var LF=Gt;function fu(c,p,v){var N=c.length;return v=v===r?N:v,!p&&v>=N?c:ui(c,p,v)}o(fu,"castSlice");var x_=Cj||function(c){return En.clearTimeout(c)};function N_(c,p){if(p)return c.slice();var v=c.length,N=GD?GD(v):new c.constructor(v);return c.copy(N),N}o(N_,"cloneBuffer");function rb(c){var p=new c.constructor(c.byteLength);return new Vv(p).set(new Vv(c)),p}o(rb,"cloneArrayBuffer");function VF(c,p){var v=p?rb(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.byteLength)}o(VF,"cloneDataView");function UF(c){var p=new c.constructor(c.source,ki.exec(c));return p.lastIndex=c.lastIndex,p}o(UF,"cloneRegExp");function MF(c){return im?br(im.call(c)):{}}o(MF,"cloneSymbol");function T_(c,p){var v=p?rb(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.length)}o(T_,"cloneTypedArray");function I_(c,p){if(c!==p){var v=c!==r,N=c===null,P=c===c,j=qs(c),z=p!==r,Q=p===null,ue=p===p,Ne=qs(p);if(!Q&&!Ne&&!j&&c>p||j&&z&&ue&&!Q&&!Ne||N&&z&&ue||!v&&ue||!P)return 1;if(!N&&!j&&!Ne&&c<p||Ne&&v&&P&&!N&&!j||Q&&v&&P||!z&&P||!ue)return-1}return 0}o(I_,"compareAscending");function jF(c,p,v){for(var N=-1,P=c.criteria,j=p.criteria,z=P.length,Q=v.length;++N<z;){var ue=I_(P[N],j[N]);if(ue){if(N>=Q)return ue;var Ne=v[N];return ue*(Ne=="desc"?-1:1)}}return c.index-p.index}o(jF,"compareMultiple");function B_(c,p,v,N){for(var P=-1,j=c.length,z=v.length,Q=-1,ue=p.length,Ne=gn(j-z,0),De=ve(ue+Ne),Le=!N;++Q<ue;)De[Q]=p[Q];for(;++P<z;)(Le||P<j)&&(De[v[P]]=c[P]);for(;Ne--;)De[Q++]=c[P++];return De}o(B_,"composeArgs");function D_(c,p,v,N){for(var P=-1,j=c.length,z=-1,Q=v.length,ue=-1,Ne=p.length,De=gn(j-Q,0),Le=ve(De+Ne),ze=!N;++P<De;)Le[P]=c[P];for(var ht=P;++ue<Ne;)Le[ht+ue]=p[ue];for(;++z<Q;)(ze||P<j)&&(Le[ht+v[z]]=c[P++]);return Le}o(D_,"composeArgsRight");function ys(c,p){var v=-1,N=c.length;for(p||(p=ve(N));++v<N;)p[v]=c[v];return p}o(ys,"copyArray");function fa(c,p,v,N){var P=!v;v||(v={});for(var j=-1,z=p.length;++j<z;){var Q=p[j],ue=N?N(v[Q],c[Q],Q,v,c):r;ue===r&&(ue=c[Q]),P?no(v,Q,ue):am(v,Q,ue)}return v}o(fa,"copyObject");function FF(c,p){return fa(c,lb(c),p)}o(FF,"copySymbols");function qF(c,p){return fa(c,H_(c),p)}o(qF,"copySymbolsIn");function Qv(c,p){return function(v,N){var P=Lt(v)?GM:cF,j=p?p():{};return P(v,c,Et(N,2),j)}}o(Qv,"createAggregator");function Ih(c){return Gt(function(p,v){var N=-1,P=v.length,j=P>1?v[P-1]:r,z=P>2?v[2]:r;for(j=c.length>3&&typeof j=="function"?(P--,j):r,z&&os(v[0],v[1],z)&&(j=P<3?r:j,P=1),p=br(p);++N<P;){var Q=v[N];Q&&c(p,Q,N,j)}return p})}o(Ih,"createAssigner");function __(c,p){return function(v,N){if(v==null)return v;if(!vs(v))return c(v,N);for(var P=v.length,j=p?P:-1,z=br(v);(p?j--:++j<P)&&N(z[j],j,z)!==!1;);return v}}o(__,"createBaseEach");function R_(c){return function(p,v,N){for(var P=-1,j=br(p),z=N(p),Q=z.length;Q--;){var ue=z[c?Q:++P];if(v(j[ue],ue,j)===!1)break}return p}}o(R_,"createBaseFor");function HF(c,p,v){var N=p&y,P=fm(c);function j(){var z=this&&this!==En&&this instanceof j?P:c;return z.apply(N?v:this,arguments)}return o(j,"wrapper"),j}o(HF,"createBind");function P_(c){return function(p){p=gr(p);var v=Ah(p)?Li(p):r,N=v?v[0]:p.charAt(0),P=v?fu(v,1).join(""):p.slice(1);return N[c]()+P}}o(P_,"createCaseFirst");function Bh(c){return function(p){return T2(_R(DR(p).replace(PM,"")),c,"")}}o(Bh,"createCompounder");function fm(c){return function(){var p=arguments;switch(p.length){case 0:return new c;case 1:return new c(p[0]);case 2:return new c(p[0],p[1]);case 3:return new c(p[0],p[1],p[2]);case 4:return new c(p[0],p[1],p[2],p[3]);case 5:return new c(p[0],p[1],p[2],p[3],p[4]);case 6:return new c(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new c(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var v=Th(c.prototype),N=c.apply(v,p);return Hr(N)?N:v}}o(fm,"createCtor");function KF(c,p,v){var N=fm(c);function P(){for(var j=arguments.length,z=ve(j),Q=j,ue=Dh(P);Q--;)z[Q]=arguments[Q];var Ne=j<3&&z[0]!==ue&&z[j-1]!==ue?[]:iu(z,ue);if(j-=Ne.length,j<v)return U_(c,p,Zv,P.placeholder,r,z,Ne,r,r,v-j);var De=this&&this!==En&&this instanceof P?N:c;return Ms(De,this,z)}return o(P,"wrapper"),P}o(KF,"createCurry");function O_(c){return function(p,v,N){var P=br(p);if(!vs(p)){var j=Et(v,3);p=An(p),v=o(function(Q){return j(P[Q],Q,P)},"predicate")}var z=c(p,v,N);return z>-1?P[j?p[z]:z]:r}}o(O_,"createFind");function k_(c){return io(function(p){var v=p.length,N=v,P=ai.prototype.thru;for(c&&p.reverse();N--;){var j=p[N];if(typeof j!="function")throw new ii(s);if(P&&!z&&nw(j)=="wrapper")var z=new ai([],!0)}for(N=z?N:v;++N<v;){j=p[N];var Q=nw(j),ue=Q=="wrapper"?ob(j):r;ue&&fb(ue[0])&&ue[1]==(x|b|A|B)&&!ue[4].length&&ue[9]==1?z=z[nw(ue[0])].apply(z,ue[3]):z=j.length==1&&fb(j)?z[Q]():z.thru(j)}return function(){var Ne=arguments,De=Ne[0];if(z&&Ne.length==1&&Lt(De))return z.plant(De).value();for(var Le=0,ze=v?p[Le].apply(this,Ne):De;++Le<v;)ze=p[Le].call(this,ze);return ze}})}o(k_,"createFlow");function Zv(c,p,v,N,P,j,z,Q,ue,Ne){var De=p&x,Le=p&y,ze=p&S,ht=p&(b|T),bt=p&F,Kt=ze?r:fm(c);function xt(){for(var Jt=arguments.length,sr=ve(Jt),Hs=Jt;Hs--;)sr[Hs]=arguments[Hs];if(ht)var us=Dh(xt),Ks=rj(sr,us);if(N&&(sr=B_(sr,N,P,ht)),j&&(sr=D_(sr,j,z,ht)),Jt-=Ks,ht&&Jt<Ne){var rn=iu(sr,us);return U_(c,p,Zv,xt.placeholder,v,sr,rn,Q,ue,Ne-Jt)}var Mi=Le?v:this,lo=ze?Mi[c]:c;return Jt=sr.length,Q?sr=c9(sr,Q):bt&&Jt>1&&sr.reverse(),De&&ue<Jt&&(sr.length=ue),this&&this!==En&&this instanceof xt&&(lo=Kt||fm(lo)),lo.apply(Mi,sr)}return o(xt,"wrapper"),xt}o(Zv,"createHybrid");function L_(c,p){return function(v,N){return vF(v,c,p(N),{})}}o(L_,"createInverter");function ew(c,p){return function(v,N){var P;if(v===r&&N===r)return p;if(v!==r&&(P=v),N!==r){if(P===r)return N;typeof v=="string"||typeof N=="string"?(v=Fs(v),N=Fs(N)):(v=E_(v),N=E_(N)),P=c(v,N)}return P}}o(ew,"createMathOperation");function nb(c){return io(function(p){return p=jr(p,js(Et())),Gt(function(v){var N=this;return c(p,function(P){return Ms(P,N,v)})})})}o(nb,"createOver");function tw(c,p){p=p===r?" ":Fs(p);var v=p.length;if(v<2)return v?z2(p,c):p;var N=z2(p,Fv(c/Ch(p)));return Ah(p)?fu(Li(N),0,c).join(""):N.slice(0,c)}o(tw,"createPadding");function $F(c,p,v,N){var P=p&y,j=fm(c);function z(){for(var Q=-1,ue=arguments.length,Ne=-1,De=N.length,Le=ve(De+ue),ze=this&&this!==En&&this instanceof z?j:c;++Ne<De;)Le[Ne]=N[Ne];for(;ue--;)Le[Ne++]=arguments[++Q];return Ms(ze,P?v:this,Le)}return o(z,"wrapper"),z}o($F,"createPartial");function V_(c){return function(p,v,N){return N&&typeof N!="number"&&os(p,v,N)&&(v=N=r),p=uo(p),v===r?(v=p,p=0):v=uo(v),N=N===r?p<v?1:-1:uo(N),DF(p,v,N,c)}}o(V_,"createRange");function rw(c){return function(p,v){return typeof p=="string"&&typeof v=="string"||(p=ci(p),v=ci(v)),c(p,v)}}o(rw,"createRelationalOperation");function U_(c,p,v,N,P,j,z,Q,ue,Ne){var De=p&b,Le=De?z:r,ze=De?r:z,ht=De?j:r,bt=De?r:j;p|=De?A:C,p&=~(De?C:A),p&E||(p&=~(y|S));var Kt=[c,p,P,ht,Le,bt,ze,Q,ue,Ne],xt=v.apply(r,Kt);return fb(c)&&z_(xt,Kt),xt.placeholder=N,Y_(xt,c,p)}o(U_,"createRecurry");function sb(c){var p=mn[c];return function(v,N){if(v=ci(v),N=N==null?0:Wn(jt(N),292),N&&YD(v)){var P=(gr(v)+"e").split("e"),j=p(P[0]+"e"+(+P[1]+N));return P=(gr(j)+"e").split("e"),+(P[0]+"e"+(+P[1]-N))}return p(v)}}o(sb,"createRound");var XF=xh&&1/_v(new xh([,-0]))[1]==oe?function(c){return new xh(c)}:Nb;function M_(c){return function(p){var v=Jn(p);return v==xe?O2(p):v==Mr?lj(p):tj(p,c(p))}}o(M_,"createToPairs");function so(c,p,v,N,P,j,z,Q){var ue=p&S;if(!ue&&typeof c!="function")throw new ii(s);var Ne=N?N.length:0;if(Ne||(p&=~(A|C),N=P=r),z=z===r?z:gn(jt(z),0),Q=Q===r?Q:jt(Q),Ne-=P?P.length:0,p&C){var De=N,Le=P;N=P=r}var ze=ue?r:ob(c),ht=[c,p,v,N,P,De,Le,j,z,Q];if(ze&&o9(ht,ze),c=ht[0],p=ht[1],v=ht[2],N=ht[3],P=ht[4],Q=ht[9]=ht[9]===r?ue?0:c.length:gn(ht[9]-Ne,0),!Q&&p&(b|T)&&(p&=~(b|T)),!p||p==y)var bt=HF(c,p,v);else p==b||p==T?bt=KF(c,p,Q):(p==A||p==(y|A))&&!P.length?bt=$F(c,p,v,N):bt=Zv.apply(r,ht);var Kt=ze?w_:z_;return Y_(Kt(bt,ht),c,p)}o(so,"createWrap");function j_(c,p,v,N){return c===r||Ui(c,bh[v])&&!wr.call(N,v)?p:c}o(j_,"customDefaultsAssignIn");function F_(c,p,v,N,P,j){return Hr(c)&&Hr(p)&&(j.set(p,c),Jv(c,p,r,F_,j),j.delete(p)),c}o(F_,"customDefaultsMerge");function GF(c){return dm(c)?r:c}o(GF,"customOmitClone");function q_(c,p,v,N,P,j){var z=v&g,Q=c.length,ue=p.length;if(Q!=ue&&!(z&&ue>Q))return!1;var Ne=j.get(c),De=j.get(p);if(Ne&&De)return Ne==p&&De==c;var Le=-1,ze=!0,ht=v&w?new ac:r;for(j.set(c,p),j.set(p,c);++Le<Q;){var bt=c[Le],Kt=p[Le];if(N)var xt=z?N(Kt,bt,Le,p,c,j):N(bt,Kt,Le,c,p,j);if(xt!==r){if(xt)continue;ze=!1;break}if(ht){if(!I2(p,function(Jt,sr){if(!em(ht,sr)&&(bt===Jt||P(bt,Jt,v,N,j)))return ht.push(sr)})){ze=!1;break}}else if(!(bt===Kt||P(bt,Kt,v,N,j))){ze=!1;break}}return j.delete(c),j.delete(p),ze}o(q_,"equalArrays");function WF(c,p,v,N,P,j,z){switch(v){case _n:if(c.byteLength!=p.byteLength||c.byteOffset!=p.byteOffset)return!1;c=c.buffer,p=p.buffer;case Ze:return!(c.byteLength!=p.byteLength||!j(new Vv(c),new Vv(p)));case O:case _:case ct:return Ui(+c,+p);case J:return c.name==p.name&&c.message==p.message;case Ge:case un:return c==p+"";case xe:var Q=O2;case Mr:var ue=N&g;if(Q||(Q=_v),c.size!=p.size&&!ue)return!1;var Ne=z.get(c);if(Ne)return Ne==p;N|=w,z.set(c,p);var De=q_(Q(c),Q(p),N,P,j,z);return z.delete(c),De;case Xn:if(im)return im.call(c)==im.call(p)}return!1}o(WF,"equalByTag");function JF(c,p,v,N,P,j){var z=v&g,Q=ib(c),ue=Q.length,Ne=ib(p),De=Ne.length;if(ue!=De&&!z)return!1;for(var Le=ue;Le--;){var ze=Q[Le];if(!(z?ze in p:wr.call(p,ze)))return!1}var ht=j.get(c),bt=j.get(p);if(ht&&bt)return ht==p&&bt==c;var Kt=!0;j.set(c,p),j.set(p,c);for(var xt=z;++Le<ue;){ze=Q[Le];var Jt=c[ze],sr=p[ze];if(N)var Hs=z?N(sr,Jt,ze,p,c,j):N(Jt,sr,ze,c,p,j);if(!(Hs===r?Jt===sr||P(Jt,sr,v,N,j):Hs)){Kt=!1;break}xt||(xt=ze=="constructor")}if(Kt&&!xt){var us=c.constructor,Ks=p.constructor;us!=Ks&&"constructor"in c&&"constructor"in p&&!(typeof us=="function"&&us instanceof us&&typeof Ks=="function"&&Ks instanceof Ks)&&(Kt=!1)}return j.delete(c),j.delete(p),Kt}o(JF,"equalObjects");function io(c){return pb(W_(c,r,nR),c+"")}o(io,"flatRest");function ib(c){return u_(c,An,lb)}o(ib,"getAllKeys");function ab(c){return u_(c,ws,H_)}o(ab,"getAllKeysIn");var ob=Hv?function(c){return Hv.get(c)}:Nb;function nw(c){for(var p=c.name+"",v=Nh[p],N=wr.call(Nh,p)?v.length:0;N--;){var P=v[N],j=P.func;if(j==null||j==c)return P.name}return p}o(nw,"getFuncName");function Dh(c){var p=wr.call(M,"placeholder")?M:c;return p.placeholder}o(Dh,"getHolder");function Et(){var c=M.iteratee||bb;return c=c===bb?f_:c,arguments.length?c(arguments[0],arguments[1]):c}o(Et,"getIteratee");function sw(c,p){var v=c.__data__;return n9(p)?v[typeof p=="string"?"string":"hash"]:v.map}o(sw,"getMapData");function ub(c){for(var p=An(c),v=p.length;v--;){var N=p[v],P=c[N];p[v]=[N,P,X_(P)]}return p}o(ub,"getMatchData");function lc(c,p){var v=aj(c,p);return c_(v)?v:r}o(lc,"getNative");function zF(c){var p=wr.call(c,sc),v=c[sc];try{c[sc]=r;var N=!0}catch{}var P=kv.call(c);return N&&(p?c[sc]=v:delete c[sc]),P}o(zF,"getRawTag");var lb=L2?function(c){return c==null?[]:(c=br(c),nu(L2(c),function(p){return JD.call(c,p)}))}:Tb,H_=L2?function(c){for(var p=[];c;)su(p,lb(c)),c=Uv(c);return p}:Tb,Jn=as;(V2&&Jn(new V2(new ArrayBuffer(1)))!=_n||rm&&Jn(new rm)!=xe||U2&&Jn(U2.resolve())!=nr||xh&&Jn(new xh)!=Mr||nm&&Jn(new nm)!=ss)&&(Jn=o(function(c){var p=as(c),v=p==je?c.constructor:r,N=v?cc(v):"";if(N)switch(N){case Rj:return _n;case Pj:return xe;case Oj:return nr;case kj:return Mr;case Lj:return ss}return p},"getTag"));function YF(c,p,v){for(var N=-1,P=v.length;++N<P;){var j=v[N],z=j.size;switch(j.type){case"drop":c+=z;break;case"dropRight":p-=z;break;case"take":p=Wn(p,c+z);break;case"takeRight":c=gn(c,p-z);break}}return{start:c,end:p}}o(YF,"getView");function QF(c){var p=c.match(m2);return p?p[1].split(g2):[]}o(QF,"getWrapDetails");function K_(c,p,v){p=cu(p,c);for(var N=-1,P=p.length,j=!1;++N<P;){var z=ha(p[N]);if(!(j=c!=null&&v(c,z)))break;c=c[z]}return j||++N!=P?j:(P=c==null?0:c.length,!!P&&fw(P)&&ao(z,P)&&(Lt(c)||fc(c)))}o(K_,"hasPath");function ZF(c){var p=c.length,v=new c.constructor(p);return p&&typeof c[0]=="string"&&wr.call(c,"index")&&(v.index=c.index,v.input=c.input),v}o(ZF,"initCloneArray");function $_(c){return typeof c.constructor=="function"&&!hm(c)?Th(Uv(c)):{}}o($_,"initCloneObject");function e9(c,p,v){var N=c.constructor;switch(p){case Ze:return rb(c);case O:case _:return new N(+c);case _n:return VF(c,v);case is:case oa:case ua:case Rt:case vh:case wh:case rc:case Q0:case Us:return T_(c,v);case xe:return new N;case ct:case un:return new N(c);case Ge:return UF(c);case Mr:return new N;case Xn:return MF(c)}}o(e9,"initCloneByTag");function t9(c,p){var v=p.length;if(!v)return c;var N=v-1;return p[N]=(v>1?"& ":"")+p[N],p=p.join(v>2?", ":" "),c.replace(d2,`{
23
- /* [wrapped with `+p+`] */
24
- `)}o(t9,"insertWrapDetails");function r9(c){return Lt(c)||fc(c)||!!(zD&&c&&c[zD])}o(r9,"isFlattenable");function ao(c,p){var v=typeof c;return p=p??Z,!!p&&(v=="number"||v!="symbol"&&dM.test(c))&&c>-1&&c%1==0&&c<p}o(ao,"isIndex");function os(c,p,v){if(!Hr(v))return!1;var N=typeof p;return(N=="number"?vs(v)&&ao(p,v.length):N=="string"&&p in v)?Ui(v[p],c):!1}o(os,"isIterateeCall");function cb(c,p){if(Lt(c))return!1;var v=typeof c;return v=="number"||v=="symbol"||v=="boolean"||c==null||qs(c)?!0:Rn.test(c)||!Dt.test(c)||p!=null&&c in br(p)}o(cb,"isKey");function n9(c){var p=typeof c;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?c!=="__proto__":c===null}o(n9,"isKeyable");function fb(c){var p=nw(c),v=M[p];if(typeof v!="function"||!(p in er.prototype))return!1;if(c===v)return!0;var N=ob(v);return!!N&&c===N[0]}o(fb,"isLaziable");function s9(c){return!!XD&&XD in c}o(s9,"isMasked");var i9=Pv?oo:Ib;function hm(c){var p=c&&c.constructor,v=typeof p=="function"&&p.prototype||bh;return c===v}o(hm,"isPrototype");function X_(c){return c===c&&!Hr(c)}o(X_,"isStrictComparable");function G_(c,p){return function(v){return v==null?!1:v[c]===p&&(p!==r||c in br(v))}}o(G_,"matchesStrictComparable");function a9(c){var p=lw(c,function(N){return v.size===u&&v.clear(),N}),v=p.cache;return p}o(a9,"memoizeCapped");function o9(c,p){var v=c[1],N=p[1],P=v|N,j=P<(y|S|x),z=N==x&&v==b||N==x&&v==B&&c[7].length<=p[8]||N==(x|B)&&p[7].length<=p[8]&&v==b;if(!(j||z))return c;N&y&&(c[2]=p[2],P|=v&y?0:E);var Q=p[3];if(Q){var ue=c[3];c[3]=ue?B_(ue,Q,p[4]):Q,c[4]=ue?iu(c[3],l):p[4]}return Q=p[5],Q&&(ue=c[5],c[5]=ue?D_(ue,Q,p[6]):Q,c[6]=ue?iu(c[5],l):p[6]),Q=p[7],Q&&(c[7]=Q),N&x&&(c[8]=c[8]==null?p[8]:Wn(c[8],p[8])),c[9]==null&&(c[9]=p[9]),c[0]=p[0],c[1]=P,c}o(o9,"mergeData");function u9(c){var p=[];if(c!=null)for(var v in br(c))p.push(v);return p}o(u9,"nativeKeysIn");function l9(c){return kv.call(c)}o(l9,"objectToString");function W_(c,p,v){return p=gn(p===r?c.length-1:p,0),function(){for(var N=arguments,P=-1,j=gn(N.length-p,0),z=ve(j);++P<j;)z[P]=N[p+P];P=-1;for(var Q=ve(p+1);++P<p;)Q[P]=N[P];return Q[p]=v(z),Ms(c,this,Q)}}o(W_,"overRest");function J_(c,p){return p.length<2?c:uc(c,ui(p,0,-1))}o(J_,"parent");function c9(c,p){for(var v=c.length,N=Wn(p.length,v),P=ys(c);N--;){var j=p[N];c[N]=ao(j,v)?P[j]:r}return c}o(c9,"reorder");function hb(c,p){if(!(p==="constructor"&&typeof c[p]=="function")&&p!="__proto__")return c[p]}o(hb,"safeGet");var z_=Q_(w_),pm=xj||function(c,p){return En.setTimeout(c,p)},pb=Q_(PF);function Y_(c,p,v){var N=p+"";return pb(c,t9(N,f9(QF(N),v)))}o(Y_,"setWrapToString");function Q_(c){var p=0,v=0;return function(){var N=Bj(),P=K-(N-v);if(v=N,P>0){if(++p>=q)return arguments[0]}else p=0;return c.apply(r,arguments)}}o(Q_,"shortOut");function iw(c,p){var v=-1,N=c.length,P=N-1;for(p=p===r?N:p;++v<p;){var j=J2(v,P),z=c[j];c[j]=c[v],c[v]=z}return c.length=p,c}o(iw,"shuffleSelf");var Z_=a9(function(c){var p=[];return c.charCodeAt(0)===46&&p.push(""),c.replace(ri,function(v,N,P,j){p.push(P?j.replace(Zt,"$1"):N||v)}),p});function ha(c){if(typeof c=="string"||qs(c))return c;var p=c+"";return p=="0"&&1/c==-oe?"-0":p}o(ha,"toKey");function cc(c){if(c!=null){try{return Ov.call(c)}catch{}try{return c+""}catch{}}return""}o(cc,"toSource");function f9(c,p){return si(Me,function(v){var N="_."+v[0];p&v[1]&&!Bv(c,N)&&c.push(N)}),c.sort()}o(f9,"updateWrapDetails");function eR(c){if(c instanceof er)return c.clone();var p=new ai(c.__wrapped__,c.__chain__);return p.__actions__=ys(c.__actions__),p.__index__=c.__index__,p.__values__=c.__values__,p}o(eR,"wrapperClone");function h9(c,p,v){(v?os(c,p,v):p===r)?p=1:p=gn(jt(p),0);var N=c==null?0:c.length;if(!N||p<1)return[];for(var P=0,j=0,z=ve(Fv(N/p));P<N;)z[j++]=ui(c,P,P+=p);return z}o(h9,"chunk");function p9(c){for(var p=-1,v=c==null?0:c.length,N=0,P=[];++p<v;){var j=c[p];j&&(P[N++]=j)}return P}o(p9,"compact");function d9(){var c=arguments.length;if(!c)return[];for(var p=ve(c-1),v=arguments[0],N=c;N--;)p[N-1]=arguments[N];return su(Lt(v)?ys(v):[v],Pn(p,1))}o(d9,"concat");var m9=Gt(function(c,p){return tn(c)?om(c,Pn(p,1,tn,!0)):[]}),g9=Gt(function(c,p){var v=li(p);return tn(v)&&(v=r),tn(c)?om(c,Pn(p,1,tn,!0),Et(v,2)):[]}),y9=Gt(function(c,p){var v=li(p);return tn(v)&&(v=r),tn(c)?om(c,Pn(p,1,tn,!0),r,v):[]});function v9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),ui(c,p<0?0:p,N)):[]}o(v9,"drop");function w9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),p=N-p,ui(c,0,p<0?0:p)):[]}o(w9,"dropRight");function S9(c,p){return c&&c.length?Yv(c,Et(p,3),!0,!0):[]}o(S9,"dropRightWhile");function E9(c,p){return c&&c.length?Yv(c,Et(p,3),!0):[]}o(E9,"dropWhile");function A9(c,p,v,N){var P=c==null?0:c.length;return P?(v&&typeof v!="number"&&os(c,p,v)&&(v=0,N=P),dF(c,p,v,N)):[]}o(A9,"fill");function tR(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=v==null?0:jt(v);return P<0&&(P=gn(N+P,0)),Dv(c,Et(p,3),P)}o(tR,"findIndex");function rR(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=N-1;return v!==r&&(P=jt(v),P=v<0?gn(N+P,0):Wn(P,N-1)),Dv(c,Et(p,3),P,!0)}o(rR,"findLastIndex");function nR(c){var p=c==null?0:c.length;return p?Pn(c,1):[]}o(nR,"flatten");function C9(c){var p=c==null?0:c.length;return p?Pn(c,oe):[]}o(C9,"flattenDeep");function b9(c,p){var v=c==null?0:c.length;return v?(p=p===r?1:jt(p),Pn(c,p)):[]}o(b9,"flattenDepth");function x9(c){for(var p=-1,v=c==null?0:c.length,N={};++p<v;){var P=c[p];N[P[0]]=P[1]}return N}o(x9,"fromPairs");function sR(c){return c&&c.length?c[0]:r}o(sR,"head");function N9(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=v==null?0:jt(v);return P<0&&(P=gn(N+P,0)),Eh(c,p,P)}o(N9,"indexOf");function T9(c){var p=c==null?0:c.length;return p?ui(c,0,-1):[]}o(T9,"initial");var I9=Gt(function(c){var p=jr(c,eb);return p.length&&p[0]===c[0]?K2(p):[]}),B9=Gt(function(c){var p=li(c),v=jr(c,eb);return p===li(v)?p=r:v.pop(),v.length&&v[0]===c[0]?K2(v,Et(p,2)):[]}),D9=Gt(function(c){var p=li(c),v=jr(c,eb);return p=typeof p=="function"?p:r,p&&v.pop(),v.length&&v[0]===c[0]?K2(v,r,p):[]});function _9(c,p){return c==null?"":Tj.call(c,p)}o(_9,"join");function li(c){var p=c==null?0:c.length;return p?c[p-1]:r}o(li,"last");function R9(c,p,v){var N=c==null?0:c.length;if(!N)return-1;var P=N;return v!==r&&(P=jt(v),P=P<0?gn(N+P,0):Wn(P,N-1)),p===p?fj(c,p,P):Dv(c,UD,P,!0)}o(R9,"lastIndexOf");function P9(c,p){return c&&c.length?m_(c,jt(p)):r}o(P9,"nth");var O9=Gt(iR);function iR(c,p){return c&&c.length&&p&&p.length?W2(c,p):c}o(iR,"pullAll");function k9(c,p,v){return c&&c.length&&p&&p.length?W2(c,p,Et(v,2)):c}o(k9,"pullAllBy");function L9(c,p,v){return c&&c.length&&p&&p.length?W2(c,p,r,v):c}o(L9,"pullAllWith");var V9=io(function(c,p){var v=c==null?0:c.length,N=j2(c,p);return v_(c,jr(p,function(P){return ao(P,v)?+P:P}).sort(I_)),N});function U9(c,p){var v=[];if(!(c&&c.length))return v;var N=-1,P=[],j=c.length;for(p=Et(p,3);++N<j;){var z=c[N];p(z,N,c)&&(v.push(z),P.push(N))}return v_(c,P),v}o(U9,"remove");function db(c){return c==null?c:_j.call(c)}o(db,"reverse");function M9(c,p,v){var N=c==null?0:c.length;return N?(v&&typeof v!="number"&&os(c,p,v)?(p=0,v=N):(p=p==null?0:jt(p),v=v===r?N:jt(v)),ui(c,p,v)):[]}o(M9,"slice");function j9(c,p){return zv(c,p)}o(j9,"sortedIndex");function F9(c,p,v){return Y2(c,p,Et(v,2))}o(F9,"sortedIndexBy");function q9(c,p){var v=c==null?0:c.length;if(v){var N=zv(c,p);if(N<v&&Ui(c[N],p))return N}return-1}o(q9,"sortedIndexOf");function H9(c,p){return zv(c,p,!0)}o(H9,"sortedLastIndex");function K9(c,p,v){return Y2(c,p,Et(v,2),!0)}o(K9,"sortedLastIndexBy");function $9(c,p){var v=c==null?0:c.length;if(v){var N=zv(c,p,!0)-1;if(Ui(c[N],p))return N}return-1}o($9,"sortedLastIndexOf");function X9(c){return c&&c.length?S_(c):[]}o(X9,"sortedUniq");function G9(c,p){return c&&c.length?S_(c,Et(p,2)):[]}o(G9,"sortedUniqBy");function W9(c){var p=c==null?0:c.length;return p?ui(c,1,p):[]}o(W9,"tail");function J9(c,p,v){return c&&c.length?(p=v||p===r?1:jt(p),ui(c,0,p<0?0:p)):[]}o(J9,"take");function z9(c,p,v){var N=c==null?0:c.length;return N?(p=v||p===r?1:jt(p),p=N-p,ui(c,p<0?0:p,N)):[]}o(z9,"takeRight");function Y9(c,p){return c&&c.length?Yv(c,Et(p,3),!1,!0):[]}o(Y9,"takeRightWhile");function Q9(c,p){return c&&c.length?Yv(c,Et(p,3)):[]}o(Q9,"takeWhile");var Z9=Gt(function(c){return lu(Pn(c,1,tn,!0))}),eq=Gt(function(c){var p=li(c);return tn(p)&&(p=r),lu(Pn(c,1,tn,!0),Et(p,2))}),tq=Gt(function(c){var p=li(c);return p=typeof p=="function"?p:r,lu(Pn(c,1,tn,!0),r,p)});function rq(c){return c&&c.length?lu(c):[]}o(rq,"uniq");function nq(c,p){return c&&c.length?lu(c,Et(p,2)):[]}o(nq,"uniqBy");function sq(c,p){return p=typeof p=="function"?p:r,c&&c.length?lu(c,r,p):[]}o(sq,"uniqWith");function mb(c){if(!(c&&c.length))return[];var p=0;return c=nu(c,function(v){if(tn(v))return p=gn(v.length,p),!0}),R2(p,function(v){return jr(c,B2(v))})}o(mb,"unzip");function aR(c,p){if(!(c&&c.length))return[];var v=mb(c);return p==null?v:jr(v,function(N){return Ms(p,r,N)})}o(aR,"unzipWith");var iq=Gt(function(c,p){return tn(c)?om(c,p):[]}),aq=Gt(function(c){return Z2(nu(c,tn))}),oq=Gt(function(c){var p=li(c);return tn(p)&&(p=r),Z2(nu(c,tn),Et(p,2))}),uq=Gt(function(c){var p=li(c);return p=typeof p=="function"?p:r,Z2(nu(c,tn),r,p)}),lq=Gt(mb);function cq(c,p){return b_(c||[],p||[],am)}o(cq,"zipObject");function fq(c,p){return b_(c||[],p||[],cm)}o(fq,"zipObjectDeep");var hq=Gt(function(c){var p=c.length,v=p>1?c[p-1]:r;return v=typeof v=="function"?(c.pop(),v):r,aR(c,v)});function oR(c){var p=M(c);return p.__chain__=!0,p}o(oR,"chain");function pq(c,p){return p(c),c}o(pq,"tap");function aw(c,p){return p(c)}o(aw,"thru");var dq=io(function(c){var p=c.length,v=p?c[0]:0,N=this.__wrapped__,P=o(function(j){return j2(j,c)},"interceptor");return p>1||this.__actions__.length||!(N instanceof er)||!ao(v)?this.thru(P):(N=N.slice(v,+v+(p?1:0)),N.__actions__.push({func:aw,args:[P],thisArg:r}),new ai(N,this.__chain__).thru(function(j){return p&&!j.length&&j.push(r),j}))});function mq(){return oR(this)}o(mq,"wrapperChain");function gq(){return new ai(this.value(),this.__chain__)}o(gq,"wrapperCommit");function yq(){this.__values__===r&&(this.__values__=ER(this.value()));var c=this.__index__>=this.__values__.length,p=c?r:this.__values__[this.__index__++];return{done:c,value:p}}o(yq,"wrapperNext");function vq(){return this}o(vq,"wrapperToIterator");function wq(c){for(var p,v=this;v instanceof $v;){var N=eR(v);N.__index__=0,N.__values__=r,p?P.__wrapped__=N:p=N;var P=N;v=v.__wrapped__}return P.__wrapped__=c,p}o(wq,"wrapperPlant");function Sq(){var c=this.__wrapped__;if(c instanceof er){var p=c;return this.__actions__.length&&(p=new er(this)),p=p.reverse(),p.__actions__.push({func:aw,args:[db],thisArg:r}),new ai(p,this.__chain__)}return this.thru(db)}o(Sq,"wrapperReverse");function Eq(){return C_(this.__wrapped__,this.__actions__)}o(Eq,"wrapperValue");var Aq=Qv(function(c,p,v){wr.call(c,v)?++c[v]:no(c,v,1)});function Cq(c,p,v){var N=Lt(c)?LD:pF;return v&&os(c,p,v)&&(p=r),N(c,Et(p,3))}o(Cq,"every");function bq(c,p){var v=Lt(c)?nu:a_;return v(c,Et(p,3))}o(bq,"filter");var xq=O_(tR),Nq=O_(rR);function Tq(c,p){return Pn(ow(c,p),1)}o(Tq,"flatMap");function Iq(c,p){return Pn(ow(c,p),oe)}o(Iq,"flatMapDeep");function Bq(c,p,v){return v=v===r?1:jt(v),Pn(ow(c,p),v)}o(Bq,"flatMapDepth");function uR(c,p){var v=Lt(c)?si:uu;return v(c,Et(p,3))}o(uR,"forEach");function lR(c,p){var v=Lt(c)?WM:i_;return v(c,Et(p,3))}o(lR,"forEachRight");var Dq=Qv(function(c,p,v){wr.call(c,v)?c[v].push(p):no(c,v,[p])});function _q(c,p,v,N){c=vs(c)?c:Rh(c),v=v&&!N?jt(v):0;var P=c.length;return v<0&&(v=gn(P+v,0)),hw(c)?v<=P&&c.indexOf(p,v)>-1:!!P&&Eh(c,p,v)>-1}o(_q,"includes");var Rq=Gt(function(c,p,v){var N=-1,P=typeof p=="function",j=vs(c)?ve(c.length):[];return uu(c,function(z){j[++N]=P?Ms(p,z,v):um(z,p,v)}),j}),Pq=Qv(function(c,p,v){no(c,v,p)});function ow(c,p){var v=Lt(c)?jr:h_;return v(c,Et(p,3))}o(ow,"map");function Oq(c,p,v,N){return c==null?[]:(Lt(p)||(p=p==null?[]:[p]),v=N?r:v,Lt(v)||(v=v==null?[]:[v]),g_(c,p,v))}o(Oq,"orderBy");var kq=Qv(function(c,p,v){c[v?0:1].push(p)},function(){return[[],[]]});function Lq(c,p,v){var N=Lt(c)?T2:jD,P=arguments.length<3;return N(c,Et(p,4),v,P,uu)}o(Lq,"reduce");function Vq(c,p,v){var N=Lt(c)?JM:jD,P=arguments.length<3;return N(c,Et(p,4),v,P,i_)}o(Vq,"reduceRight");function Uq(c,p){var v=Lt(c)?nu:a_;return v(c,cw(Et(p,3)))}o(Uq,"reject");function Mq(c){var p=Lt(c)?t_:_F;return p(c)}o(Mq,"sample");function jq(c,p,v){(v?os(c,p,v):p===r)?p=1:p=jt(p);var N=Lt(c)?uF:RF;return N(c,p)}o(jq,"sampleSize");function Fq(c){var p=Lt(c)?lF:OF;return p(c)}o(Fq,"shuffle");function qq(c){if(c==null)return 0;if(vs(c))return hw(c)?Ch(c):c.length;var p=Jn(c);return p==xe||p==Mr?c.size:X2(c).length}o(qq,"size");function Hq(c,p,v){var N=Lt(c)?I2:kF;return v&&os(c,p,v)&&(p=r),N(c,Et(p,3))}o(Hq,"some");var Kq=Gt(function(c,p){if(c==null)return[];var v=p.length;return v>1&&os(c,p[0],p[1])?p=[]:v>2&&os(p[0],p[1],p[2])&&(p=[p[0]]),g_(c,Pn(p,1),[])}),uw=bj||function(){return En.Date.now()};function $q(c,p){if(typeof p!="function")throw new ii(s);return c=jt(c),function(){if(--c<1)return p.apply(this,arguments)}}o($q,"after");function cR(c,p,v){return p=v?r:p,p=c&&p==null?c.length:p,so(c,x,r,r,r,r,p)}o(cR,"ary");function fR(c,p){var v;if(typeof p!="function")throw new ii(s);return c=jt(c),function(){return--c>0&&(v=p.apply(this,arguments)),c<=1&&(p=r),v}}o(fR,"before");var gb=Gt(function(c,p,v){var N=y;if(v.length){var P=iu(v,Dh(gb));N|=A}return so(c,N,p,v,P)}),hR=Gt(function(c,p,v){var N=y|S;if(v.length){var P=iu(v,Dh(hR));N|=A}return so(p,N,c,v,P)});function pR(c,p,v){p=v?r:p;var N=so(c,b,r,r,r,r,r,p);return N.placeholder=pR.placeholder,N}o(pR,"curry");function dR(c,p,v){p=v?r:p;var N=so(c,T,r,r,r,r,r,p);return N.placeholder=dR.placeholder,N}o(dR,"curryRight");function mR(c,p,v){var N,P,j,z,Q,ue,Ne=0,De=!1,Le=!1,ze=!0;if(typeof c!="function")throw new ii(s);p=ci(p)||0,Hr(v)&&(De=!!v.leading,Le="maxWait"in v,j=Le?gn(ci(v.maxWait)||0,p):j,ze="trailing"in v?!!v.trailing:ze);function ht(rn){var Mi=N,lo=P;return N=P=r,Ne=rn,z=c.apply(lo,Mi),z}o(ht,"invokeFunc");function bt(rn){return Ne=rn,Q=pm(Jt,p),De?ht(rn):z}o(bt,"leadingEdge");function Kt(rn){var Mi=rn-ue,lo=rn-Ne,OR=p-Mi;return Le?Wn(OR,j-lo):OR}o(Kt,"remainingWait");function xt(rn){var Mi=rn-ue,lo=rn-Ne;return ue===r||Mi>=p||Mi<0||Le&&lo>=j}o(xt,"shouldInvoke");function Jt(){var rn=uw();if(xt(rn))return sr(rn);Q=pm(Jt,Kt(rn))}o(Jt,"timerExpired");function sr(rn){return Q=r,ze&&N?ht(rn):(N=P=r,z)}o(sr,"trailingEdge");function Hs(){Q!==r&&x_(Q),Ne=0,N=ue=P=Q=r}o(Hs,"cancel");function us(){return Q===r?z:sr(uw())}o(us,"flush");function Ks(){var rn=uw(),Mi=xt(rn);if(N=arguments,P=this,ue=rn,Mi){if(Q===r)return bt(ue);if(Le)return x_(Q),Q=pm(Jt,p),ht(ue)}return Q===r&&(Q=pm(Jt,p)),z}return o(Ks,"debounced"),Ks.cancel=Hs,Ks.flush=us,Ks}o(mR,"debounce");var Xq=Gt(function(c,p){return s_(c,1,p)}),Gq=Gt(function(c,p,v){return s_(c,ci(p)||0,v)});function Wq(c){return so(c,F)}o(Wq,"flip");function lw(c,p){if(typeof c!="function"||p!=null&&typeof p!="function")throw new ii(s);var v=o(function(){var N=arguments,P=p?p.apply(this,N):N[0],j=v.cache;if(j.has(P))return j.get(P);var z=c.apply(this,N);return v.cache=j.set(P,z)||j,z},"memoized");return v.cache=new(lw.Cache||ro),v}o(lw,"memoize"),lw.Cache=ro;function cw(c){if(typeof c!="function")throw new ii(s);return function(){var p=arguments;switch(p.length){case 0:return!c.call(this);case 1:return!c.call(this,p[0]);case 2:return!c.call(this,p[0],p[1]);case 3:return!c.call(this,p[0],p[1],p[2])}return!c.apply(this,p)}}o(cw,"negate");function Jq(c){return fR(2,c)}o(Jq,"once");var zq=LF(function(c,p){p=p.length==1&&Lt(p[0])?jr(p[0],js(Et())):jr(Pn(p,1),js(Et()));var v=p.length;return Gt(function(N){for(var P=-1,j=Wn(N.length,v);++P<j;)N[P]=p[P].call(this,N[P]);return Ms(c,this,N)})}),yb=Gt(function(c,p){var v=iu(p,Dh(yb));return so(c,A,r,p,v)}),gR=Gt(function(c,p){var v=iu(p,Dh(gR));return so(c,C,r,p,v)}),Yq=io(function(c,p){return so(c,B,r,r,r,p)});function Qq(c,p){if(typeof c!="function")throw new ii(s);return p=p===r?p:jt(p),Gt(c,p)}o(Qq,"rest");function Zq(c,p){if(typeof c!="function")throw new ii(s);return p=p==null?0:gn(jt(p),0),Gt(function(v){var N=v[p],P=fu(v,0,p);return N&&su(P,N),Ms(c,this,P)})}o(Zq,"spread");function e7(c,p,v){var N=!0,P=!0;if(typeof c!="function")throw new ii(s);return Hr(v)&&(N="leading"in v?!!v.leading:N,P="trailing"in v?!!v.trailing:P),mR(c,p,{leading:N,maxWait:p,trailing:P})}o(e7,"throttle");function t7(c){return cR(c,1)}o(t7,"unary");function r7(c,p){return yb(tb(p),c)}o(r7,"wrap");function n7(){if(!arguments.length)return[];var c=arguments[0];return Lt(c)?c:[c]}o(n7,"castArray");function s7(c){return oi(c,m)}o(s7,"clone");function i7(c,p){return p=typeof p=="function"?p:r,oi(c,m,p)}o(i7,"cloneWith");function a7(c){return oi(c,f|m)}o(a7,"cloneDeep");function o7(c,p){return p=typeof p=="function"?p:r,oi(c,f|m,p)}o(o7,"cloneDeepWith");function u7(c,p){return p==null||n_(c,p,An(p))}o(u7,"conformsTo");function Ui(c,p){return c===p||c!==c&&p!==p}o(Ui,"eq");var l7=rw(H2),c7=rw(function(c,p){return c>=p}),fc=l_((function(){return arguments})())?l_:function(c){return Jr(c)&&wr.call(c,"callee")&&!JD.call(c,"callee")},Lt=ve.isArray,f7=DD?js(DD):wF;function vs(c){return c!=null&&fw(c.length)&&!oo(c)}o(vs,"isArrayLike");function tn(c){return Jr(c)&&vs(c)}o(tn,"isArrayLikeObject");function h7(c){return c===!0||c===!1||Jr(c)&&as(c)==O}o(h7,"isBoolean");var hu=Nj||Ib,p7=_D?js(_D):SF;function d7(c){return Jr(c)&&c.nodeType===1&&!dm(c)}o(d7,"isElement");function m7(c){if(c==null)return!0;if(vs(c)&&(Lt(c)||typeof c=="string"||typeof c.splice=="function"||hu(c)||_h(c)||fc(c)))return!c.length;var p=Jn(c);if(p==xe||p==Mr)return!c.size;if(hm(c))return!X2(c).length;for(var v in c)if(wr.call(c,v))return!1;return!0}o(m7,"isEmpty");function g7(c,p){return lm(c,p)}o(g7,"isEqual");function y7(c,p,v){v=typeof v=="function"?v:r;var N=v?v(c,p):r;return N===r?lm(c,p,r,v):!!N}o(y7,"isEqualWith");function vb(c){if(!Jr(c))return!1;var p=as(c);return p==J||p==ne||typeof c.message=="string"&&typeof c.name=="string"&&!dm(c)}o(vb,"isError");function v7(c){return typeof c=="number"&&YD(c)}o(v7,"isFinite");function oo(c){if(!Hr(c))return!1;var p=as(c);return p==Xe||p==Re||p==lt||p==Vs}o(oo,"isFunction");function yR(c){return typeof c=="number"&&c==jt(c)}o(yR,"isInteger");function fw(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Z}o(fw,"isLength");function Hr(c){var p=typeof c;return c!=null&&(p=="object"||p=="function")}o(Hr,"isObject");function Jr(c){return c!=null&&typeof c=="object"}o(Jr,"isObjectLike");var vR=RD?js(RD):AF;function w7(c,p){return c===p||$2(c,p,ub(p))}o(w7,"isMatch");function S7(c,p,v){return v=typeof v=="function"?v:r,$2(c,p,ub(p),v)}o(S7,"isMatchWith");function E7(c){return wR(c)&&c!=+c}o(E7,"isNaN");function A7(c){if(i9(c))throw new Pt(n);return c_(c)}o(A7,"isNative");function C7(c){return c===null}o(C7,"isNull");function b7(c){return c==null}o(b7,"isNil");function wR(c){return typeof c=="number"||Jr(c)&&as(c)==ct}o(wR,"isNumber");function dm(c){if(!Jr(c)||as(c)!=je)return!1;var p=Uv(c);if(p===null)return!0;var v=wr.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&Ov.call(v)==Sj}o(dm,"isPlainObject");var wb=PD?js(PD):CF;function x7(c){return yR(c)&&c>=-Z&&c<=Z}o(x7,"isSafeInteger");var SR=OD?js(OD):bF;function hw(c){return typeof c=="string"||!Lt(c)&&Jr(c)&&as(c)==un}o(hw,"isString");function qs(c){return typeof c=="symbol"||Jr(c)&&as(c)==Xn}o(qs,"isSymbol");var _h=kD?js(kD):xF;function N7(c){return c===r}o(N7,"isUndefined");function T7(c){return Jr(c)&&Jn(c)==ss}o(T7,"isWeakMap");function I7(c){return Jr(c)&&as(c)==pt}o(I7,"isWeakSet");var B7=rw(G2),D7=rw(function(c,p){return c<=p});function ER(c){if(!c)return[];if(vs(c))return hw(c)?Li(c):ys(c);if(tm&&c[tm])return uj(c[tm]());var p=Jn(c),v=p==xe?O2:p==Mr?_v:Rh;return v(c)}o(ER,"toArray");function uo(c){if(!c)return c===0?c:0;if(c=ci(c),c===oe||c===-oe){var p=c<0?-1:1;return p*fe}return c===c?c:0}o(uo,"toFinite");function jt(c){var p=uo(c),v=p%1;return p===p?v?p-v:p:0}o(jt,"toInteger");function AR(c){return c?oc(jt(c),0,Ke):0}o(AR,"toLength");function ci(c){if(typeof c=="number")return c;if(qs(c))return Se;if(Hr(c)){var p=typeof c.valueOf=="function"?c.valueOf():c;c=Hr(p)?p+"":p}if(typeof c!="string")return c===0?c:+c;c=FD(c);var v=fM.test(c);return v||pM.test(c)?$M(c.slice(2),v?2:8):v2.test(c)?Se:+c}o(ci,"toNumber");function CR(c){return fa(c,ws(c))}o(CR,"toPlainObject");function _7(c){return c?oc(jt(c),-Z,Z):c===0?c:0}o(_7,"toSafeInteger");function gr(c){return c==null?"":Fs(c)}o(gr,"toString");var R7=Ih(function(c,p){if(hm(p)||vs(p)){fa(p,An(p),c);return}for(var v in p)wr.call(p,v)&&am(c,v,p[v])}),bR=Ih(function(c,p){fa(p,ws(p),c)}),pw=Ih(function(c,p,v,N){fa(p,ws(p),c,N)}),P7=Ih(function(c,p,v,N){fa(p,An(p),c,N)}),O7=io(j2);function k7(c,p){var v=Th(c);return p==null?v:r_(v,p)}o(k7,"create");var L7=Gt(function(c,p){c=br(c);var v=-1,N=p.length,P=N>2?p[2]:r;for(P&&os(p[0],p[1],P)&&(N=1);++v<N;)for(var j=p[v],z=ws(j),Q=-1,ue=z.length;++Q<ue;){var Ne=z[Q],De=c[Ne];(De===r||Ui(De,bh[Ne])&&!wr.call(c,Ne))&&(c[Ne]=j[Ne])}return c}),V7=Gt(function(c){return c.push(r,F_),Ms(xR,r,c)});function U7(c,p){return VD(c,Et(p,3),ca)}o(U7,"findKey");function M7(c,p){return VD(c,Et(p,3),q2)}o(M7,"findLastKey");function j7(c,p){return c==null?c:F2(c,Et(p,3),ws)}o(j7,"forIn");function F7(c,p){return c==null?c:o_(c,Et(p,3),ws)}o(F7,"forInRight");function q7(c,p){return c&&ca(c,Et(p,3))}o(q7,"forOwn");function H7(c,p){return c&&q2(c,Et(p,3))}o(H7,"forOwnRight");function K7(c){return c==null?[]:Wv(c,An(c))}o(K7,"functions");function $7(c){return c==null?[]:Wv(c,ws(c))}o($7,"functionsIn");function Sb(c,p,v){var N=c==null?r:uc(c,p);return N===r?v:N}o(Sb,"get");function X7(c,p){return c!=null&&K_(c,p,mF)}o(X7,"has");function Eb(c,p){return c!=null&&K_(c,p,gF)}o(Eb,"hasIn");var G7=L_(function(c,p,v){p!=null&&typeof p.toString!="function"&&(p=kv.call(p)),c[p]=v},Cb(Ss)),W7=L_(function(c,p,v){p!=null&&typeof p.toString!="function"&&(p=kv.call(p)),wr.call(c,p)?c[p].push(v):c[p]=[v]},Et),J7=Gt(um);function An(c){return vs(c)?e_(c):X2(c)}o(An,"keys");function ws(c){return vs(c)?e_(c,!0):NF(c)}o(ws,"keysIn");function z7(c,p){var v={};return p=Et(p,3),ca(c,function(N,P,j){no(v,p(N,P,j),N)}),v}o(z7,"mapKeys");function Y7(c,p){var v={};return p=Et(p,3),ca(c,function(N,P,j){no(v,P,p(N,P,j))}),v}o(Y7,"mapValues");var Q7=Ih(function(c,p,v){Jv(c,p,v)}),xR=Ih(function(c,p,v,N){Jv(c,p,v,N)}),Z7=io(function(c,p){var v={};if(c==null)return v;var N=!1;p=jr(p,function(j){return j=cu(j,c),N||(N=j.length>1),j}),fa(c,ab(c),v),N&&(v=oi(v,f|h|m,GF));for(var P=p.length;P--;)Q2(v,p[P]);return v});function eH(c,p){return NR(c,cw(Et(p)))}o(eH,"omitBy");var tH=io(function(c,p){return c==null?{}:IF(c,p)});function NR(c,p){if(c==null)return{};var v=jr(ab(c),function(N){return[N]});return p=Et(p),y_(c,v,function(N,P){return p(N,P[0])})}o(NR,"pickBy");function rH(c,p,v){p=cu(p,c);var N=-1,P=p.length;for(P||(P=1,c=r);++N<P;){var j=c==null?r:c[ha(p[N])];j===r&&(N=P,j=v),c=oo(j)?j.call(c):j}return c}o(rH,"result");function nH(c,p,v){return c==null?c:cm(c,p,v)}o(nH,"set");function sH(c,p,v,N){return N=typeof N=="function"?N:r,c==null?c:cm(c,p,v,N)}o(sH,"setWith");var TR=M_(An),IR=M_(ws);function iH(c,p,v){var N=Lt(c),P=N||hu(c)||_h(c);if(p=Et(p,4),v==null){var j=c&&c.constructor;P?v=N?new j:[]:Hr(c)?v=oo(j)?Th(Uv(c)):{}:v={}}return(P?si:ca)(c,function(z,Q,ue){return p(v,z,Q,ue)}),v}o(iH,"transform");function aH(c,p){return c==null?!0:Q2(c,p)}o(aH,"unset");function oH(c,p,v){return c==null?c:A_(c,p,tb(v))}o(oH,"update");function uH(c,p,v,N){return N=typeof N=="function"?N:r,c==null?c:A_(c,p,tb(v),N)}o(uH,"updateWith");function Rh(c){return c==null?[]:P2(c,An(c))}o(Rh,"values");function lH(c){return c==null?[]:P2(c,ws(c))}o(lH,"valuesIn");function cH(c,p,v){return v===r&&(v=p,p=r),v!==r&&(v=ci(v),v=v===v?v:0),p!==r&&(p=ci(p),p=p===p?p:0),oc(ci(c),p,v)}o(cH,"clamp");function fH(c,p,v){return p=uo(p),v===r?(v=p,p=0):v=uo(v),c=ci(c),yF(c,p,v)}o(fH,"inRange");function hH(c,p,v){if(v&&typeof v!="boolean"&&os(c,p,v)&&(p=v=r),v===r&&(typeof p=="boolean"?(v=p,p=r):typeof c=="boolean"&&(v=c,c=r)),c===r&&p===r?(c=0,p=1):(c=uo(c),p===r?(p=c,c=0):p=uo(p)),c>p){var N=c;c=p,p=N}if(v||c%1||p%1){var P=QD();return Wn(c+P*(p-c+KM("1e-"+((P+"").length-1))),p)}return J2(c,p)}o(hH,"random");var pH=Bh(function(c,p,v){return p=p.toLowerCase(),c+(v?BR(p):p)});function BR(c){return Ab(gr(c).toLowerCase())}o(BR,"capitalize");function DR(c){return c=gr(c),c&&c.replace(mM,nj).replace(OM,"")}o(DR,"deburr");function dH(c,p,v){c=gr(c),p=Fs(p);var N=c.length;v=v===r?N:oc(jt(v),0,N);var P=v;return v-=p.length,v>=0&&c.slice(v,P)==p}o(dH,"endsWith");function mH(c){return c=gr(c),c&&nt.test(c)?c.replace(ie,sj):c}o(mH,"escape");function gH(c){return c=gr(c),c&&la.test(c)?c.replace(or,"\\$&"):c}o(gH,"escapeRegExp");var yH=Bh(function(c,p,v){return c+(v?"-":"")+p.toLowerCase()}),vH=Bh(function(c,p,v){return c+(v?" ":"")+p.toLowerCase()}),wH=P_("toLowerCase");function SH(c,p,v){c=gr(c),p=jt(p);var N=p?Ch(c):0;if(!p||N>=p)return c;var P=(p-N)/2;return tw(qv(P),v)+c+tw(Fv(P),v)}o(SH,"pad");function EH(c,p,v){c=gr(c),p=jt(p);var N=p?Ch(c):0;return p&&N<p?c+tw(p-N,v):c}o(EH,"padEnd");function AH(c,p,v){c=gr(c),p=jt(p);var N=p?Ch(c):0;return p&&N<p?tw(p-N,v)+c:c}o(AH,"padStart");function CH(c,p,v){return v||p==null?p=0:p&&(p=+p),Dj(gr(c).replace(Z0,""),p||0)}o(CH,"parseInt1");function bH(c,p,v){return(v?os(c,p,v):p===r)?p=1:p=jt(p),z2(gr(c),p)}o(bH,"repeat");function xH(){var c=arguments,p=gr(c[0]);return c.length<3?p:p.replace(c[1],c[2])}o(xH,"replace");var NH=Bh(function(c,p,v){return c+(v?"_":"")+p.toLowerCase()});function TH(c,p,v){return v&&typeof v!="number"&&os(c,p,v)&&(p=v=r),v=v===r?Ke:v>>>0,v?(c=gr(c),c&&(typeof p=="string"||p!=null&&!wb(p))&&(p=Fs(p),!p&&Ah(c))?fu(Li(c),0,v):c.split(p,v)):[]}o(TH,"split");var IH=Bh(function(c,p,v){return c+(v?" ":"")+Ab(p)});function BH(c,p,v){return c=gr(c),v=v==null?0:oc(jt(v),0,c.length),p=Fs(p),c.slice(v,v+p.length)==p}o(BH,"startsWith");function DH(c,p,v){var N=M.templateSettings;v&&os(c,p,v)&&(p=r),c=gr(c),p=pw({},p,N,j_);var P=pw({},p.imports,N.imports,j_),j=An(P),z=P2(P,j),Q,ue,Ne=0,De=p.interpolate||Nv,Le="__p += '",ze=k2((p.escape||Nv).source+"|"+De.source+"|"+(De===et?Gn:Nv).source+"|"+(p.evaluate||Nv).source+"|$","g"),ht="//# sourceURL="+(wr.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++MM+"]")+`
25
- `;c.replace(ze,function(xt,Jt,sr,Hs,us,Ks){return sr||(sr=Hs),Le+=c.slice(Ne,Ks).replace(gM,ij),Jt&&(Q=!0,Le+=`' +
26
- __e(`+Jt+`) +
27
- '`),us&&(ue=!0,Le+=`';
28
- `+us+`;
29
- __p += '`),sr&&(Le+=`' +
30
- ((__t = (`+sr+`)) == null ? '' : __t) +
31
- '`),Ne=Ks+xt.length,xt}),Le+=`';
32
- `;var bt=wr.call(p,"variable")&&p.variable;if(!bt)Le=`with (obj) {
33
- `+Le+`
34
- }
35
- `;else if(qe.test(bt))throw new Pt(i);Le=(ue?Le.replace(d,""):Le).replace(I,"$1").replace($,"$1;"),Le="function("+(bt||"obj")+`) {
36
- `+(bt?"":`obj || (obj = {});
37
- `)+"var __t, __p = ''"+(Q?", __e = _.escape":"")+(ue?`, __j = Array.prototype.join;
38
- function print() { __p += __j.call(arguments, '') }
39
- `:`;
40
- `)+Le+`return __p
41
- }`;var Kt=RR(function(){return mr(j,ht+"return "+Le).apply(r,z)});if(Kt.source=Le,vb(Kt))throw Kt;return Kt}o(DH,"template");function _H(c){return gr(c).toLowerCase()}o(_H,"toLower");function RH(c){return gr(c).toUpperCase()}o(RH,"toUpper");function PH(c,p,v){if(c=gr(c),c&&(v||p===r))return FD(c);if(!c||!(p=Fs(p)))return c;var N=Li(c),P=Li(p),j=qD(N,P),z=HD(N,P)+1;return fu(N,j,z).join("")}o(PH,"trim");function OH(c,p,v){if(c=gr(c),c&&(v||p===r))return c.slice(0,$D(c)+1);if(!c||!(p=Fs(p)))return c;var N=Li(c),P=HD(N,Li(p))+1;return fu(N,0,P).join("")}o(OH,"trimEnd");function kH(c,p,v){if(c=gr(c),c&&(v||p===r))return c.replace(Z0,"");if(!c||!(p=Fs(p)))return c;var N=Li(c),P=qD(N,Li(p));return fu(N,P).join("")}o(kH,"trimStart");function LH(c,p){var v=R,N=H;if(Hr(p)){var P="separator"in p?p.separator:P;v="length"in p?jt(p.length):v,N="omission"in p?Fs(p.omission):N}c=gr(c);var j=c.length;if(Ah(c)){var z=Li(c);j=z.length}if(v>=j)return c;var Q=v-Ch(N);if(Q<1)return N;var ue=z?fu(z,0,Q).join(""):c.slice(0,Q);if(P===r)return ue+N;if(z&&(Q+=ue.length-Q),wb(P)){if(c.slice(Q).search(P)){var Ne,De=ue;for(P.global||(P=k2(P.source,gr(ki.exec(P))+"g")),P.lastIndex=0;Ne=P.exec(De);)var Le=Ne.index;ue=ue.slice(0,Le===r?Q:Le)}}else if(c.indexOf(Fs(P),Q)!=Q){var ze=ue.lastIndexOf(P);ze>-1&&(ue=ue.slice(0,ze))}return ue+N}o(LH,"truncate");function VH(c){return c=gr(c),c&&X.test(c)?c.replace(te,hj):c}o(VH,"unescape");var UH=Bh(function(c,p,v){return c+(v?" ":"")+p.toUpperCase()}),Ab=P_("toUpperCase");function _R(c,p,v){return c=gr(c),p=v?r:p,p===r?oj(c)?mj(c):QM(c):c.match(p)||[]}o(_R,"words");var RR=Gt(function(c,p){try{return Ms(c,r,p)}catch(v){return vb(v)?v:new Pt(v)}}),MH=io(function(c,p){return si(p,function(v){v=ha(v),no(c,v,gb(c[v],c))}),c});function jH(c){var p=c==null?0:c.length,v=Et();return c=p?jr(c,function(N){if(typeof N[1]!="function")throw new ii(s);return[v(N[0]),N[1]]}):[],Gt(function(N){for(var P=-1;++P<p;){var j=c[P];if(Ms(j[0],this,N))return Ms(j[1],this,N)}})}o(jH,"cond");function FH(c){return hF(oi(c,f))}o(FH,"conforms");function Cb(c){return function(){return c}}o(Cb,"constant");function qH(c,p){return c==null||c!==c?p:c}o(qH,"defaultTo");var HH=k_(),KH=k_(!0);function Ss(c){return c}o(Ss,"identity");function bb(c){return f_(typeof c=="function"?c:oi(c,f))}o(bb,"iteratee");function $H(c){return p_(oi(c,f))}o($H,"matches");function XH(c,p){return d_(c,oi(p,f))}o(XH,"matchesProperty");var GH=Gt(function(c,p){return function(v){return um(v,c,p)}}),WH=Gt(function(c,p){return function(v){return um(c,v,p)}});function xb(c,p,v){var N=An(p),P=Wv(p,N);v==null&&!(Hr(p)&&(P.length||!N.length))&&(v=p,p=c,c=this,P=Wv(p,An(p)));var j=!(Hr(v)&&"chain"in v)||!!v.chain,z=oo(c);return si(P,function(Q){var ue=p[Q];c[Q]=ue,z&&(c.prototype[Q]=function(){var Ne=this.__chain__;if(j||Ne){var De=c(this.__wrapped__),Le=De.__actions__=ys(this.__actions__);return Le.push({func:ue,args:arguments,thisArg:c}),De.__chain__=Ne,De}return ue.apply(c,su([this.value()],arguments))})}),c}o(xb,"mixin");function JH(){return En._===this&&(En._=Ej),this}o(JH,"noConflict");function Nb(){}o(Nb,"noop");function zH(c){return c=jt(c),Gt(function(p){return m_(p,c)})}o(zH,"nthArg");var YH=nb(jr),QH=nb(LD),ZH=nb(I2);function PR(c){return cb(c)?B2(ha(c)):BF(c)}o(PR,"property");function eK(c){return function(p){return c==null?r:uc(c,p)}}o(eK,"propertyOf");var tK=V_(),rK=V_(!0);function Tb(){return[]}o(Tb,"stubArray");function Ib(){return!1}o(Ib,"stubFalse");function nK(){return{}}o(nK,"stubObject");function sK(){return""}o(sK,"stubString");function iK(){return!0}o(iK,"stubTrue");function aK(c,p){if(c=jt(c),c<1||c>Z)return[];var v=Ke,N=Wn(c,Ke);p=Et(p),c-=Ke;for(var P=R2(N,p);++v<c;)p(v);return P}o(aK,"times");function oK(c){return Lt(c)?jr(c,ha):qs(c)?[c]:ys(Z_(gr(c)))}o(oK,"toPath");function uK(c){var p=++wj;return gr(c)+p}o(uK,"uniqueId");var lK=ew(function(c,p){return c+p},0),cK=sb("ceil"),fK=ew(function(c,p){return c/p},1),hK=sb("floor");function pK(c){return c&&c.length?Gv(c,Ss,H2):r}o(pK,"max");function dK(c,p){return c&&c.length?Gv(c,Et(p,2),H2):r}o(dK,"maxBy");function mK(c){return MD(c,Ss)}o(mK,"mean");function gK(c,p){return MD(c,Et(p,2))}o(gK,"meanBy");function yK(c){return c&&c.length?Gv(c,Ss,G2):r}o(yK,"min");function vK(c,p){return c&&c.length?Gv(c,Et(p,2),G2):r}o(vK,"minBy");var wK=ew(function(c,p){return c*p},1),SK=sb("round"),EK=ew(function(c,p){return c-p},0);function AK(c){return c&&c.length?_2(c,Ss):0}o(AK,"sum");function CK(c,p){return c&&c.length?_2(c,Et(p,2)):0}return o(CK,"sumBy"),M.after=$q,M.ary=cR,M.assign=R7,M.assignIn=bR,M.assignInWith=pw,M.assignWith=P7,M.at=O7,M.before=fR,M.bind=gb,M.bindAll=MH,M.bindKey=hR,M.castArray=n7,M.chain=oR,M.chunk=h9,M.compact=p9,M.concat=d9,M.cond=jH,M.conforms=FH,M.constant=Cb,M.countBy=Aq,M.create=k7,M.curry=pR,M.curryRight=dR,M.debounce=mR,M.defaults=L7,M.defaultsDeep=V7,M.defer=Xq,M.delay=Gq,M.difference=m9,M.differenceBy=g9,M.differenceWith=y9,M.drop=v9,M.dropRight=w9,M.dropRightWhile=S9,M.dropWhile=E9,M.fill=A9,M.filter=bq,M.flatMap=Tq,M.flatMapDeep=Iq,M.flatMapDepth=Bq,M.flatten=nR,M.flattenDeep=C9,M.flattenDepth=b9,M.flip=Wq,M.flow=HH,M.flowRight=KH,M.fromPairs=x9,M.functions=K7,M.functionsIn=$7,M.groupBy=Dq,M.initial=T9,M.intersection=I9,M.intersectionBy=B9,M.intersectionWith=D9,M.invert=G7,M.invertBy=W7,M.invokeMap=Rq,M.iteratee=bb,M.keyBy=Pq,M.keys=An,M.keysIn=ws,M.map=ow,M.mapKeys=z7,M.mapValues=Y7,M.matches=$H,M.matchesProperty=XH,M.memoize=lw,M.merge=Q7,M.mergeWith=xR,M.method=GH,M.methodOf=WH,M.mixin=xb,M.negate=cw,M.nthArg=zH,M.omit=Z7,M.omitBy=eH,M.once=Jq,M.orderBy=Oq,M.over=YH,M.overArgs=zq,M.overEvery=QH,M.overSome=ZH,M.partial=yb,M.partialRight=gR,M.partition=kq,M.pick=tH,M.pickBy=NR,M.property=PR,M.propertyOf=eK,M.pull=O9,M.pullAll=iR,M.pullAllBy=k9,M.pullAllWith=L9,M.pullAt=V9,M.range=tK,M.rangeRight=rK,M.rearg=Yq,M.reject=Uq,M.remove=U9,M.rest=Qq,M.reverse=db,M.sampleSize=jq,M.set=nH,M.setWith=sH,M.shuffle=Fq,M.slice=M9,M.sortBy=Kq,M.sortedUniq=X9,M.sortedUniqBy=G9,M.split=TH,M.spread=Zq,M.tail=W9,M.take=J9,M.takeRight=z9,M.takeRightWhile=Y9,M.takeWhile=Q9,M.tap=pq,M.throttle=e7,M.thru=aw,M.toArray=ER,M.toPairs=TR,M.toPairsIn=IR,M.toPath=oK,M.toPlainObject=CR,M.transform=iH,M.unary=t7,M.union=Z9,M.unionBy=eq,M.unionWith=tq,M.uniq=rq,M.uniqBy=nq,M.uniqWith=sq,M.unset=aH,M.unzip=mb,M.unzipWith=aR,M.update=oH,M.updateWith=uH,M.values=Rh,M.valuesIn=lH,M.without=iq,M.words=_R,M.wrap=r7,M.xor=aq,M.xorBy=oq,M.xorWith=uq,M.zip=lq,M.zipObject=cq,M.zipObjectDeep=fq,M.zipWith=hq,M.entries=TR,M.entriesIn=IR,M.extend=bR,M.extendWith=pw,xb(M,M),M.add=lK,M.attempt=RR,M.camelCase=pH,M.capitalize=BR,M.ceil=cK,M.clamp=cH,M.clone=s7,M.cloneDeep=a7,M.cloneDeepWith=o7,M.cloneWith=i7,M.conformsTo=u7,M.deburr=DR,M.defaultTo=qH,M.divide=fK,M.endsWith=dH,M.eq=Ui,M.escape=mH,M.escapeRegExp=gH,M.every=Cq,M.find=xq,M.findIndex=tR,M.findKey=U7,M.findLast=Nq,M.findLastIndex=rR,M.findLastKey=M7,M.floor=hK,M.forEach=uR,M.forEachRight=lR,M.forIn=j7,M.forInRight=F7,M.forOwn=q7,M.forOwnRight=H7,M.get=Sb,M.gt=l7,M.gte=c7,M.has=X7,M.hasIn=Eb,M.head=sR,M.identity=Ss,M.includes=_q,M.indexOf=N9,M.inRange=fH,M.invoke=J7,M.isArguments=fc,M.isArray=Lt,M.isArrayBuffer=f7,M.isArrayLike=vs,M.isArrayLikeObject=tn,M.isBoolean=h7,M.isBuffer=hu,M.isDate=p7,M.isElement=d7,M.isEmpty=m7,M.isEqual=g7,M.isEqualWith=y7,M.isError=vb,M.isFinite=v7,M.isFunction=oo,M.isInteger=yR,M.isLength=fw,M.isMap=vR,M.isMatch=w7,M.isMatchWith=S7,M.isNaN=E7,M.isNative=A7,M.isNil=b7,M.isNull=C7,M.isNumber=wR,M.isObject=Hr,M.isObjectLike=Jr,M.isPlainObject=dm,M.isRegExp=wb,M.isSafeInteger=x7,M.isSet=SR,M.isString=hw,M.isSymbol=qs,M.isTypedArray=_h,M.isUndefined=N7,M.isWeakMap=T7,M.isWeakSet=I7,M.join=_9,M.kebabCase=yH,M.last=li,M.lastIndexOf=R9,M.lowerCase=vH,M.lowerFirst=wH,M.lt=B7,M.lte=D7,M.max=pK,M.maxBy=dK,M.mean=mK,M.meanBy=gK,M.min=yK,M.minBy=vK,M.stubArray=Tb,M.stubFalse=Ib,M.stubObject=nK,M.stubString=sK,M.stubTrue=iK,M.multiply=wK,M.nth=P9,M.noConflict=JH,M.noop=Nb,M.now=uw,M.pad=SH,M.padEnd=EH,M.padStart=AH,M.parseInt=CH,M.random=hH,M.reduce=Lq,M.reduceRight=Vq,M.repeat=bH,M.replace=xH,M.result=rH,M.round=SK,M.runInContext=se,M.sample=Mq,M.size=qq,M.snakeCase=NH,M.some=Hq,M.sortedIndex=j9,M.sortedIndexBy=F9,M.sortedIndexOf=q9,M.sortedLastIndex=H9,M.sortedLastIndexBy=K9,M.sortedLastIndexOf=$9,M.startCase=IH,M.startsWith=BH,M.subtract=EK,M.sum=AK,M.sumBy=CK,M.template=DH,M.times=aK,M.toFinite=uo,M.toInteger=jt,M.toLength=AR,M.toLower=_H,M.toNumber=ci,M.toSafeInteger=_7,M.toString=gr,M.toUpper=RH,M.trim=PH,M.trimEnd=OH,M.trimStart=kH,M.truncate=LH,M.unescape=VH,M.uniqueId=uK,M.upperCase=UH,M.upperFirst=Ab,M.each=uR,M.eachRight=lR,M.first=sR,xb(M,(function(){var c={};return ca(M,function(p,v){wr.call(M.prototype,v)||(c[v]=p)}),c})(),{chain:!1}),M.VERSION=e,si(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){M[c].placeholder=M}),si(["drop","take"],function(c,p){er.prototype[c]=function(v){v=v===r?1:gn(jt(v),0);var N=this.__filtered__&&!p?new er(this):this.clone();return N.__filtered__?N.__takeCount__=Wn(v,N.__takeCount__):N.__views__.push({size:Wn(v,Ke),type:c+(N.__dir__<0?"Right":"")}),N},er.prototype[c+"Right"]=function(v){return this.reverse()[c](v).reverse()}}),si(["filter","map","takeWhile"],function(c,p){var v=p+1,N=v==G||v==le;er.prototype[c]=function(P){var j=this.clone();return j.__iteratees__.push({iteratee:Et(P,3),type:v}),j.__filtered__=j.__filtered__||N,j}}),si(["head","last"],function(c,p){var v="take"+(p?"Right":"");er.prototype[c]=function(){return this[v](1).value()[0]}}),si(["initial","tail"],function(c,p){var v="drop"+(p?"":"Right");er.prototype[c]=function(){return this.__filtered__?new er(this):this[v](1)}}),er.prototype.compact=function(){return this.filter(Ss)},er.prototype.find=function(c){return this.filter(c).head()},er.prototype.findLast=function(c){return this.reverse().find(c)},er.prototype.invokeMap=Gt(function(c,p){return typeof c=="function"?new er(this):this.map(function(v){return um(v,c,p)})}),er.prototype.reject=function(c){return this.filter(cw(Et(c)))},er.prototype.slice=function(c,p){c=jt(c);var v=this;return v.__filtered__&&(c>0||p<0)?new er(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),p!==r&&(p=jt(p),v=p<0?v.dropRight(-p):v.take(p-c)),v)},er.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},er.prototype.toArray=function(){return this.take(Ke)},ca(er.prototype,function(c,p){var v=/^(?:filter|find|map|reject)|While$/.test(p),N=/^(?:head|last)$/.test(p),P=M[N?"take"+(p=="last"?"Right":""):p],j=N||/^find/.test(p);P&&(M.prototype[p]=function(){var z=this.__wrapped__,Q=N?[1]:arguments,ue=z instanceof er,Ne=Q[0],De=ue||Lt(z),Le=o(function(Jt){var sr=P.apply(M,su([Jt],Q));return N&&ze?sr[0]:sr},"interceptor");De&&v&&typeof Ne=="function"&&Ne.length!=1&&(ue=De=!1);var ze=this.__chain__,ht=!!this.__actions__.length,bt=j&&!ze,Kt=ue&&!ht;if(!j&&De){z=Kt?z:new er(this);var xt=c.apply(z,Q);return xt.__actions__.push({func:aw,args:[Le],thisArg:r}),new ai(xt,ze)}return bt&&Kt?c.apply(this,Q):(xt=this.thru(Le),bt?N?xt.value()[0]:xt.value():xt)})}),si(["pop","push","shift","sort","splice","unshift"],function(c){var p=Rv[c],v=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",N=/^(?:pop|shift)$/.test(c);M.prototype[c]=function(){var P=arguments;if(N&&!this.__chain__){var j=this.value();return p.apply(Lt(j)?j:[],P)}return this[v](function(z){return p.apply(Lt(z)?z:[],P)})}}),ca(er.prototype,function(c,p){var v=M[p];if(v){var N=v.name+"";wr.call(Nh,N)||(Nh[N]=[]),Nh[N].push({name:p,func:v})}}),Nh[Zv(r,S).name]=[{name:"wrapper",func:r}],er.prototype.clone=Vj,er.prototype.reverse=Uj,er.prototype.value=Mj,M.prototype.at=dq,M.prototype.chain=mq,M.prototype.commit=gq,M.prototype.next=yq,M.prototype.plant=wq,M.prototype.reverse=Sq,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Eq,M.prototype.first=M.prototype.head,tm&&(M.prototype[tm]=vq),M},"runInContext"),au=gj();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(En._=au,define(function(){return au})):nc?((nc.exports=au)._=au,b2._=au):En._=au}).call(np)});var dN=ye((Tfe,Q4)=>{"use strict";var CJ=bK(),bJ=wt("crypto"),xJ=wt("url"),NJ=xK(),TJ=wt("http"),IJ=wt("https"),BJ=wt("util"),DJ=NK(),_J=wt("zlib"),N4=wt("stream"),RJ=wt("events");function Na(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}o(Na,"_interopDefaultLegacy");var T4=Na(CJ),PJ=Na(bJ),OJ=Na(xJ),kJ=Na(NJ),LJ=Na(TJ),VJ=Na(IJ),I4=Na(BJ),UJ=Na(DJ),Bu=Na(_J),Iu=Na(N4);function B4(r,e){return o(function(){return r.apply(e,arguments)},"wrap")}o(B4,"bind");var{toString:MJ}=Object.prototype,{getPrototypeOf:oN}=Object,{iterator:dS,toStringTag:D4}=Symbol,mS=(r=>e=>{let t=MJ.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ki=o(r=>(r=r.toLowerCase(),e=>mS(e)===r),"kindOfTest"),gS=o(r=>e=>typeof e===r,"typeOfTest"),{isArray:lp}=Array,ip=gS("undefined");function Vm(r){return r!==null&&!ip(r)&&r.constructor!==null&&!ip(r.constructor)&&bs(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}o(Vm,"isBuffer");var _4=Ki("ArrayBuffer");function jJ(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&_4(r.buffer),e}o(jJ,"isArrayBufferView");var FJ=gS("string"),bs=gS("function"),R4=gS("number"),Um=o(r=>r!==null&&typeof r=="object","isObject"),qJ=o(r=>r===!0||r===!1,"isBoolean"),oS=o(r=>{if(mS(r)!=="object")return!1;let e=oN(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(D4 in r)&&!(dS in r)},"isPlainObject"),HJ=o(r=>{if(!Um(r)||Vm(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},"isEmptyObject"),KJ=Ki("Date"),$J=Ki("File"),XJ=Ki("Blob"),GJ=Ki("FileList"),WJ=o(r=>Um(r)&&bs(r.pipe),"isStream"),JJ=o(r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||bs(r.append)&&((e=mS(r))==="formdata"||e==="object"&&bs(r.toString)&&r.toString()==="[object FormData]"))},"isFormData"),zJ=Ki("URLSearchParams"),[YJ,QJ,ZJ,ez]=["ReadableStream","Request","Response","Headers"].map(Ki),tz=o(r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function Mm(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,s;if(typeof r!="object"&&(r=[r]),lp(r))for(n=0,s=r.length;n<s;n++)e.call(null,r[n],n,r);else{if(Vm(r))return;let i=t?Object.getOwnPropertyNames(r):Object.keys(r),a=i.length,u;for(n=0;n<a;n++)u=i[n],e.call(null,r[u],u,r)}}o(Mm,"forEach");function P4(r,e){if(Vm(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}o(P4,"findKey");var Ac=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,O4=o(r=>!ip(r)&&r!==Ac,"isContextDefined");function Yx(){let{caseless:r,skipUndefined:e}=O4(this)&&this||{},t={},n=o((s,i)=>{let a=r&&P4(t,i)||i;oS(t[a])&&oS(s)?t[a]=Yx(t[a],s):oS(s)?t[a]=Yx({},s):lp(s)?t[a]=s.slice():(!e||!ip(s))&&(t[a]=s)},"assignValue");for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Mm(arguments[s],n);return t}o(Yx,"merge");var rz=o((r,e,t,{allOwnKeys:n}={})=>(Mm(e,(s,i)=>{t&&bs(s)?r[i]=B4(s,t):r[i]=s},{allOwnKeys:n}),r),"extend"),nz=o(r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),"stripBOM"),sz=o((r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},"inherits"),iz=o((r,e,t,n)=>{let s,i,a,u={};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))&&!u[a]&&(e[a]=r[a],u[a]=!0);r=t!==!1&&oN(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},"toFlatObject"),az=o((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"),oz=o(r=>{if(!r)return null;if(lp(r))return r;let e=r.length;if(!R4(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},"toArray"),uz=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&oN(Uint8Array)),lz=o((r,e)=>{let n=(r&&r[dS]).call(r),s;for(;(s=n.next())&&!s.done;){let i=s.value;e.call(r,i[0],i[1])}},"forEachEntry"),cz=o((r,e)=>{let t,n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},"matchAll"),fz=Ki("HTMLFormElement"),hz=o(r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,o(function(t,n,s){return n.toUpperCase()+s},"replacer")),"toCamelCase"),s4=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),pz=Ki("RegExp"),k4=o((r,e)=>{let t=Object.getOwnPropertyDescriptors(r),n={};Mm(t,(s,i)=>{let a;(a=e(s,i,r))!==!1&&(n[i]=a||s)}),Object.defineProperties(r,n)},"reduceDescriptors"),dz=o(r=>{k4(r,(e,t)=>{if(bs(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let n=r[t];if(bs(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"),mz=o((r,e)=>{let t={},n=o(s=>{s.forEach(i=>{t[i]=!0})},"define");return lp(r)?n(r):n(String(r).split(e)),t},"toObjectSet"),gz=o(()=>{},"noop"),yz=o((r,e)=>r!=null&&Number.isFinite(r=+r)?r:e,"toFiniteNumber");function vz(r){return!!(r&&bs(r.append)&&r[D4]==="FormData"&&r[dS])}o(vz,"isSpecCompliantForm");var wz=o(r=>{let e=new Array(10),t=o((n,s)=>{if(Um(n)){if(e.indexOf(n)>=0)return;if(Vm(n))return n;if(!("toJSON"in n)){e[s]=n;let i=lp(n)?[]:{};return Mm(n,(a,u)=>{let l=t(a,s+1);!ip(l)&&(i[u]=l)}),e[s]=void 0,i}}return n},"visit");return t(r,0)},"toJSONObject"),Sz=Ki("AsyncFunction"),Ez=o(r=>r&&(Um(r)||bs(r))&&bs(r.then)&&bs(r.catch),"isThenable"),L4=((r,e)=>r?setImmediate:e?((t,n)=>(Ac.addEventListener("message",({source:s,data:i})=>{s===Ac&&i===t&&n.length&&n.shift()()},!1),s=>{n.push(s),Ac.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",bs(Ac.postMessage)),Az=typeof queueMicrotask<"u"?queueMicrotask.bind(Ac):typeof process<"u"&&process.nextTick||L4,Cz=o(r=>r!=null&&bs(r[dS]),"isIterable"),ce={isArray:lp,isArrayBuffer:_4,isBuffer:Vm,isFormData:JJ,isArrayBufferView:jJ,isString:FJ,isNumber:R4,isBoolean:qJ,isObject:Um,isPlainObject:oS,isEmptyObject:HJ,isReadableStream:YJ,isRequest:QJ,isResponse:ZJ,isHeaders:ez,isUndefined:ip,isDate:KJ,isFile:$J,isBlob:XJ,isRegExp:pz,isFunction:bs,isStream:WJ,isURLSearchParams:zJ,isTypedArray:uz,isFileList:GJ,forEach:Mm,merge:Yx,extend:rz,trim:tz,stripBOM:nz,inherits:sz,toFlatObject:iz,kindOf:mS,kindOfTest:Ki,endsWith:az,toArray:oz,forEachEntry:lz,matchAll:cz,isHTMLForm:fz,hasOwnProperty:s4,hasOwnProp:s4,reduceDescriptors:k4,freezeMethods:dz,toObjectSet:mz,toCamelCase:hz,noop:gz,toFiniteNumber:yz,findKey:P4,global:Ac,isContextDefined:O4,isSpecCompliantForm:vz,toJSONObject:wz,isAsyncFn:Sz,isThenable:Ez,setImmediate:L4,asap:Az,isIterable:Cz};function it(r,e,t,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}o(it,"AxiosError");ce.inherits(it,Error,{toJSON:o(function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}},"toJSON")});var V4=it.prototype,U4={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{U4[r]={value:r}});Object.defineProperties(it,U4);Object.defineProperty(V4,"isAxiosError",{value:!0});it.from=(r,e,t,n,s,i)=>{let a=Object.create(V4);ce.toFlatObject(r,a,o(function(h){return h!==Error.prototype},"filter"),f=>f!=="isAxiosError");let u=r&&r.message?r.message:"Error",l=e==null&&r?r.code:e;return it.call(a,u,l,t,n,s),r&&a.cause==null&&Object.defineProperty(a,"cause",{value:r,configurable:!0}),a.name=r&&r.name||"Error",i&&Object.assign(a,i),a};function Qx(r){return ce.isPlainObject(r)||ce.isArray(r)}o(Qx,"isVisitable");function M4(r){return ce.endsWith(r,"[]")?r.slice(0,-2):r}o(M4,"removeBrackets");function i4(r,e,t){return r?r.concat(e).map(o(function(s,i){return s=M4(s),!t&&i?"["+s+"]":s},"each")).join(t?".":""):e}o(i4,"renderKey");function bz(r){return ce.isArray(r)&&!r.some(Qx)}o(bz,"isFlatArray");var xz=ce.toFlatObject(ce,{},null,o(function(e){return/^is[A-Z]/.test(e)},"filter"));function yS(r,e,t){if(!ce.isObject(r))throw new TypeError("target must be an object");e=e||new(T4.default||FormData),t=ce.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,o(function(S,E){return!ce.isUndefined(E[S])},"defined"));let n=t.metaTokens,s=t.visitor||h,i=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(e);if(!ce.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(ce.isDate(y))return y.toISOString();if(ce.isBoolean(y))return y.toString();if(!l&&ce.isBlob(y))throw new it("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(y)||ce.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}o(f,"convertValue");function h(y,S,E){let b=y;if(y&&!E&&typeof y=="object"){if(ce.endsWith(S,"{}"))S=n?S:S.slice(0,-2),y=JSON.stringify(y);else if(ce.isArray(y)&&bz(y)||(ce.isFileList(y)||ce.endsWith(S,"[]"))&&(b=ce.toArray(y)))return S=M4(S),b.forEach(o(function(A,C){!(ce.isUndefined(A)||A===null)&&e.append(a===!0?i4([S],C,i):a===null?S:S+"[]",f(A))},"each")),!1}return Qx(y)?!0:(e.append(i4(E,S,i),f(y)),!1)}o(h,"defaultVisitor");let m=[],g=Object.assign(xz,{defaultVisitor:h,convertValue:f,isVisitable:Qx});function w(y,S){if(!ce.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+S.join("."));m.push(y),ce.forEach(y,o(function(b,T){(!(ce.isUndefined(b)||b===null)&&s.call(e,b,ce.isString(T)?T.trim():T,S,g))===!0&&w(b,S?S.concat(T):[T])},"each")),m.pop()}}if(o(w,"build"),!ce.isObject(r))throw new TypeError("data must be an object");return w(r),e}o(yS,"toFormData");function a4(r){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,o(function(n){return e[n]},"replacer"))}o(a4,"encode$1");function j4(r,e){this._pairs=[],r&&yS(r,this,e)}o(j4,"AxiosURLSearchParams");var F4=j4.prototype;F4.append=o(function(e,t){this._pairs.push([e,t])},"append");F4.toString=o(function(e){let t=e?function(n){return e.call(this,n,a4)}:a4;return this._pairs.map(o(function(s){return t(s[0])+"="+t(s[1])},"each"),"").join("&")},"toString");function Nz(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}o(Nz,"encode");function uN(r,e,t){if(!e)return r;let n=t&&t.encode||Nz;ce.isFunction(t)&&(t={serialize:t});let s=t&&t.serialize,i;if(s?i=s(e,t):i=ce.isURLSearchParams(e)?e.toString():new j4(e,t).toString(n),i){let a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+i}return r}o(uN,"buildURL");var Zx=class{static{o(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){ce.forEach(this.handlers,o(function(n){n!==null&&e(n)},"forEachHandler"))}},o4=Zx,lN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Tz=OJ.default.URLSearchParams,Xx="abcdefghijklmnopqrstuvwxyz",u4="0123456789",q4={DIGIT:u4,ALPHA:Xx,ALPHA_DIGIT:Xx+Xx.toUpperCase()+u4},Iz=o((r=16,e=q4.ALPHA_DIGIT)=>{let t="",{length:n}=e,s=new Uint32Array(r);PJ.default.randomFillSync(s);for(let i=0;i<r;i++)t+=e[s[i]%n];return t},"generateString"),Bz={isNode:!0,classes:{URLSearchParams:Tz,FormData:T4.default,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:q4,generateString:Iz,protocols:["http","https","file","data"]},cN=typeof window<"u"&&typeof document<"u",eN=typeof navigator=="object"&&navigator||void 0,Dz=cN&&(!eN||["ReactNative","NativeScript","NS"].indexOf(eN.product)<0),_z=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Rz=cN&&window.location.href||"http://localhost",Pz=Object.freeze({__proto__:null,hasBrowserEnv:cN,hasStandardBrowserWebWorkerEnv:_z,hasStandardBrowserEnv:Dz,navigator:eN,origin:Rz}),Yr={...Pz,...Bz};function Oz(r,e){return yS(r,new Yr.classes.URLSearchParams,{visitor:o(function(t,n,s,i){return Yr.isNode&&ce.isBuffer(t)?(this.append(n,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},"visitor"),...e})}o(Oz,"toURLEncodedForm");function kz(r){return ce.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}o(kz,"parsePropPath");function Lz(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}o(Lz,"arrayToObject");function H4(r){function e(t,n,s,i){let a=t[i++];if(a==="__proto__")return!0;let u=Number.isFinite(+a),l=i>=t.length;return a=!a&&ce.isArray(s)?s.length:a,l?(ce.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!u):((!s[a]||!ce.isObject(s[a]))&&(s[a]=[]),e(t,n,s[a],i)&&ce.isArray(s[a])&&(s[a]=Lz(s[a])),!u)}if(o(e,"buildPath"),ce.isFormData(r)&&ce.isFunction(r.entries)){let t={};return ce.forEachEntry(r,(n,s)=>{e(kz(n),s,t,0)}),t}return null}o(H4,"formDataToJSON");function Vz(r,e,t){if(ce.isString(r))try{return(e||JSON.parse)(r),ce.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}o(Vz,"stringifySafely");var fN={transitional:lN,adapter:["xhr","http","fetch"],transformRequest:[o(function(e,t){let n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=ce.isObject(e);if(i&&ce.isHTMLForm(e)&&(e=new FormData(e)),ce.isFormData(e))return s?JSON.stringify(H4(e)):e;if(ce.isArrayBuffer(e)||ce.isBuffer(e)||ce.isStream(e)||ce.isFile(e)||ce.isBlob(e)||ce.isReadableStream(e))return e;if(ce.isArrayBufferView(e))return e.buffer;if(ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Oz(e,this.formSerializer).toString();if((u=ce.isFileList(e))||n.indexOf("multipart/form-data")>-1){let l=this.env&&this.env.FormData;return yS(u?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),Vz(e)):e},"transformRequest")],transformResponse:[o(function(e){let t=this.transitional||fN.transitional,n=t&&t.forcedJSONParsing,s=this.responseType==="json";if(ce.isResponse(e)||ce.isReadableStream(e))return e;if(e&&ce.isString(e)&&(n&&!this.responseType||s)){let a=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(u){if(a)throw u.name==="SyntaxError"?it.from(u,it.ERR_BAD_RESPONSE,this,null,this.response):u}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yr.classes.FormData,Blob:Yr.classes.Blob},validateStatus:o(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],r=>{fN.headers[r]={}});var hN=fN,Uz=ce.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"]),Mz=o(r=>{let e={},t,n,s;return r&&r.split(`
42
- `).forEach(o(function(a){s=a.indexOf(":"),t=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!t||e[t]&&Uz[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)},"parser")),e},"parseHeaders"),l4=Symbol("internals");function km(r){return r&&String(r).trim().toLowerCase()}o(km,"normalizeHeader");function uS(r){return r===!1||r==null?r:ce.isArray(r)?r.map(uS):String(r)}o(uS,"normalizeValue");function jz(r){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}o(jz,"parseTokens");var Fz=o(r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()),"isValidHeaderName");function Gx(r,e,t,n,s){if(ce.isFunction(n))return n.call(this,e,t);if(s&&(e=t),!!ce.isString(e)){if(ce.isString(n))return e.indexOf(n)!==-1;if(ce.isRegExp(n))return n.test(e)}}o(Gx,"matchHeaderValue");function qz(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}o(qz,"formatHeader");function Hz(r,e){let t=ce.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:o(function(s,i,a){return this[n].call(this,e,s,i,a)},"value"),configurable:!0})})}o(Hz,"buildAccessors");var ap=class{static{o(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,t,n){let s=this;function i(u,l,f){let h=km(l);if(!h)throw new Error("header name must be a non-empty string");let m=ce.findKey(s,h);(!m||s[m]===void 0||f===!0||f===void 0&&s[m]!==!1)&&(s[m||l]=uS(u))}o(i,"setHeader");let a=o((u,l)=>ce.forEach(u,(f,h)=>i(f,h,l)),"setHeaders");if(ce.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(ce.isString(e)&&(e=e.trim())&&!Fz(e))a(Mz(e),t);else if(ce.isObject(e)&&ce.isIterable(e)){let u={},l,f;for(let h of e){if(!ce.isArray(h))throw TypeError("Object iterator must return a key-value pair");u[f=h[0]]=(l=u[f])?ce.isArray(l)?[...l,h[1]]:[l,h[1]]:h[1]}a(u,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=km(e),e){let n=ce.findKey(this,e);if(n){let s=this[n];if(!t)return s;if(t===!0)return jz(s);if(ce.isFunction(t))return t.call(this,s,n);if(ce.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=km(e),e){let n=ce.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Gx(this,this[n],n,t)))}return!1}delete(e,t){let n=this,s=!1;function i(a){if(a=km(a),a){let u=ce.findKey(n,a);u&&(!t||Gx(n,n[u],u,t))&&(delete n[u],s=!0)}}return o(i,"deleteHeader"),ce.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||Gx(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){let t=this,n={};return ce.forEach(this,(s,i)=>{let a=ce.findKey(n,i);if(a){t[a]=uS(s),delete t[i];return}let u=e?qz(i):String(i).trim();u!==i&&delete t[i],t[u]=uS(s),n[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return ce.forEach(this,(n,s)=>{n!=null&&n!==!1&&(t[s]=e&&ce.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(`
43
- `)}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[l4]=this[l4]={accessors:{}}).accessors,s=this.prototype;function i(a){let u=km(a);n[u]||(Hz(s,a),n[u]=!0)}return o(i,"defineAccessor"),ce.isArray(e)?e.forEach(i):i(e),this}};ap.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(ap.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:o(()=>r,"get"),set(n){this[t]=n}}});ce.freezeMethods(ap);var xs=ap;function Wx(r,e){let t=this||hN,n=e||t,s=xs.from(n.headers),i=n.data;return ce.forEach(r,o(function(u){i=u.call(t,i,s.normalize(),e?e.status:void 0)},"transform")),s.normalize(),i}o(Wx,"transformData");function K4(r){return!!(r&&r.__CANCEL__)}o(K4,"isCancel");function Du(r,e,t){it.call(this,r??"canceled",it.ERR_CANCELED,e,t),this.name="CanceledError"}o(Du,"CanceledError");ce.inherits(Du,it,{__CANCEL__:!0});function sp(r,e,t){let n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new it("Request failed with status code "+t.status,[it.ERR_BAD_REQUEST,it.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}o(sp,"settle");function Kz(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}o(Kz,"isAbsoluteURL");function $z(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}o($z,"combineURLs");function pN(r,e,t){let n=!Kz(e);return r&&(n||t==!1)?$z(r,e):e}o(pN,"buildFullPath");var fS="1.12.2";function $4(r){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}o($4,"parseProtocol");var Xz=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Gz(r,e,t){let n=t&&t.Blob||Yr.classes.Blob,s=$4(r);if(e===void 0&&n&&(e=!0),s==="data"){r=s.length?r.slice(s.length+1):r;let i=Xz.exec(r);if(!i)throw new it("Invalid URL",it.ERR_INVALID_URL);let a=i[1],u=i[2],l=i[3],f=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(e){if(!n)throw new it("Blob is not supported",it.ERR_NOT_SUPPORT);return new n([f],{type:a})}return f}throw new it("Unsupported protocol "+s,it.ERR_NOT_SUPPORT)}o(Gz,"fromDataURI");var Jx=Symbol("internals"),tN=class extends Iu.default.Transform{static{o(this,"AxiosTransformStream")}constructor(e){e=ce.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,s)=>!ce.isUndefined(s[n])),super({readableHighWaterMark:e.chunkSize});let t=this[Jx]={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[Jx];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){let s=this[Jx],i=s.maxRate,a=this.readableHighWaterMark,u=s.timeWindow,l=1e3/u,f=i/l,h=s.minChunkSize!==!1?Math.max(s.minChunkSize,f*.01):0,m=o((w,y)=>{let S=Buffer.byteLength(w);s.bytesSeen+=S,s.bytes+=S,s.isCaptured&&this.emit("progress",s.bytesSeen),this.push(w)?process.nextTick(y):s.onReadCallback=()=>{s.onReadCallback=null,process.nextTick(y)}},"pushChunk"),g=o((w,y)=>{let S=Buffer.byteLength(w),E=null,b=a,T,A=0;if(i){let C=Date.now();(!s.ts||(A=C-s.ts)>=u)&&(s.ts=C,T=f-s.bytes,s.bytes=T<0?-T:0,A=0),T=f-s.bytes}if(i){if(T<=0)return setTimeout(()=>{y(null,w)},u-A);T<b&&(b=T)}b&&S>b&&S-b>h&&(E=w.subarray(b),w=w.subarray(0,b)),m(w,E?()=>{process.nextTick(y,null,E)}:y)},"transformChunk");g(e,o(function w(y,S){if(y)return n(y);S?g(S,w):n(null)},"transformNextChunk"))}},c4=tN,{asyncIterator:f4}=Symbol,Wz=o(async function*(r){r.stream?yield*r.stream():r.arrayBuffer?yield await r.arrayBuffer():r[f4]?yield*r[f4]():yield r},"readBlob"),X4=Wz,Jz=Yr.ALPHABET.ALPHA_DIGIT+"-_",Lm=typeof TextEncoder=="function"?new TextEncoder:new I4.default.TextEncoder,Cc=`\r
44
- `,zz=Lm.encode(Cc),Yz=2,rN=class{static{o(this,"FormDataPart")}constructor(e,t){let{escapeName:n}=this.constructor,s=ce.isString(t),i=`Content-Disposition: form-data; name="${n(e)}"${!s&&t.name?`; filename="${n(t.name)}"`:""}${Cc}`;s?t=Lm.encode(String(t).replace(/\r?\n|\r\n?/g,Cc)):i+=`Content-Type: ${t.type||"application/octet-stream"}${Cc}`,this.headers=Lm.encode(i+Cc),this.contentLength=s?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+Yz,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;ce.isTypedArray(e)?yield e:yield*X4(e),yield zz}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},Qz=o((r,e,t)=>{let{tag:n="form-data-boundary",size:s=25,boundary:i=n+"-"+Yr.generateString(s,Jz)}=t||{};if(!ce.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=Lm.encode("--"+i+Cc),u=Lm.encode("--"+i+"--"+Cc),l=u.byteLength,f=Array.from(r.entries()).map(([m,g])=>{let w=new rN(m,g);return l+=w.size,w});l+=a.byteLength*f.length,l=ce.toFiniteNumber(l);let h={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(l)&&(h["Content-Length"]=l),e&&e(h),N4.Readable.from((async function*(){for(let m of f)yield a,yield*m.encode();yield u})())},"formDataToStream"),Zz=Qz,nN=class extends Iu.default.Transform{static{o(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)}},eY=nN,tY=o((r,e)=>ce.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"),rY=tY;function nY(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,o(function(l){let f=Date.now(),h=n[i];a||(a=f),t[s]=l,n[s]=f;let m=i,g=0;for(;m!==s;)g+=t[m++],m=m%r;if(s=(s+1)%r,s===i&&(i=(i+1)%r),f-a<e)return;let w=h&&f-h;return w?Math.round(g*1e3/w):void 0},"push")}o(nY,"speedometer");function sY(r,e){let t=0,n=1e3/e,s,i,a=o((f,h=Date.now())=>{t=h,s=null,i&&(clearTimeout(i),i=null),r(...f)},"invoke");return[o((...f)=>{let h=Date.now(),m=h-t;m>=n?a(f,h):(s=f,i||(i=setTimeout(()=>{i=null,a(s)},n-m)))},"throttled"),o(()=>s&&a(s),"flush")]}o(sY,"throttle");var op=o((r,e,t=3)=>{let n=0,s=nY(50,250);return sY(i=>{let a=i.loaded,u=i.lengthComputable?i.total:void 0,l=a-n,f=s(l),h=a<=u;n=a;let m={loaded:a,total:u,progress:u?a/u:void 0,bytes:l,rate:f||void 0,estimated:f&&u&&h?(u-a)/f:void 0,event:i,lengthComputable:u!=null,[e?"download":"upload"]:!0};r(m)},t)},"progressEventReducer"),hS=o((r,e)=>{let t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},"progressEventDecorator"),pS=o(r=>(...e)=>ce.asap(()=>r(...e)),"asyncDecorator");function iY(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 g=0;g<a;g++)if(n.charCodeAt(g)===37&&g+2<a){let w=n.charCodeAt(g+1),y=n.charCodeAt(g+2);(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102)&&(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102)&&(i-=2,g+=2)}let u=0,l=a-1,f=o(g=>g>=2&&n.charCodeAt(g-2)===37&&n.charCodeAt(g-1)===51&&(n.charCodeAt(g)===68||n.charCodeAt(g)===100),"tailIsPct3D");l>=0&&(n.charCodeAt(l)===61?(u++,l--):f(l)&&(u++,l-=3)),u===1&&l>=0&&(n.charCodeAt(l)===61||f(l))&&u++;let m=Math.floor(i/4)*3-(u||0);return m>0?m:0}return Buffer.byteLength(n,"utf8")}o(iY,"estimateDataURLDecodedBytes");var h4={flush:Bu.default.constants.Z_SYNC_FLUSH,finishFlush:Bu.default.constants.Z_SYNC_FLUSH},aY={flush:Bu.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:Bu.default.constants.BROTLI_OPERATION_FLUSH},p4=ce.isFunction(Bu.default.createBrotliDecompress),{http:oY,https:uY}=UJ.default,lY=/https:?/,d4=Yr.protocols.map(r=>r+":"),m4=o((r,[e,t])=>(r.on("end",t).on("error",t),e),"flushOnFinish");function cY(r,e){r.beforeRedirects.proxy&&r.beforeRedirects.proxy(r),r.beforeRedirects.config&&r.beforeRedirects.config(r,e)}o(cY,"dispatchBeforeRedirect");function G4(r,e,t){let n=e;if(!n&&n!==!1){let s=kJ.default.getProxyForUrl(t);s&&(n=new URL(s))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let i=Buffer.from(n.auth,"utf8").toString("base64");r.headers["Proxy-Authorization"]="Basic "+i}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=o(function(i){G4(i,e,i.href)},"beforeRedirect")}o(G4,"setProxy");var fY=typeof process<"u"&&ce.kindOf(process)==="process",hY=o(r=>new Promise((e,t)=>{let n,s,i=o((l,f)=>{s||(s=!0,n&&n(l,f))},"done"),a=o(l=>{i(l),e(l)},"_resolve"),u=o(l=>{i(l,!0),t(l)},"_reject");r(a,u,l=>n=l).catch(u)}),"wrapAsync"),pY=o(({address:r,family:e})=>{if(!ce.isString(r))throw TypeError("address must be a string");return{address:r,family:e||(r.indexOf(".")<0?6:4)}},"resolveFamily"),g4=o((r,e)=>pY(ce.isObject(r)?r:{address:r,family:e}),"buildAddressEntry"),dY=fY&&o(function(e){return hY(o(async function(n,s,i){let{data:a,lookup:u,family:l}=e,{responseType:f,responseEncoding:h}=e,m=e.method.toUpperCase(),g,w=!1,y;if(u){let fe=rY(u,Se=>ce.isArray(Se)?Se:[Se]);u=o((Se,Ke,be)=>{fe(Se,Ke,(we,Me,Je)=>{if(we)return be(we);let Ye=ce.isArray(Me)?Me.map(lt=>g4(lt)):[g4(Me,Je)];Ke.all?be(we,Ye):be(we,Ye[0].address,Ye[0].family)})},"lookup")}let S=new RJ.EventEmitter,E=o(()=>{e.cancelToken&&e.cancelToken.unsubscribe(b),e.signal&&e.signal.removeEventListener("abort",b),S.removeAllListeners()},"onFinished");i((fe,Se)=>{g=!0,Se&&(w=!0,E())});function b(fe){S.emit("abort",!fe||fe.type?new Du(null,e,y):fe)}o(b,"abort"),S.once("abort",s),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(b),e.signal&&(e.signal.aborted?b():e.signal.addEventListener("abort",b)));let T=pN(e.baseURL,e.url,e.allowAbsoluteUrls),A=new URL(T,Yr.hasBrowserEnv?Yr.origin:void 0),C=A.protocol||d4[0];if(C==="data:"){if(e.maxContentLength>-1){let Se=String(e.url||T||"");if(iY(Se)>e.maxContentLength)return s(new it("maxContentLength size of "+e.maxContentLength+" exceeded",it.ERR_BAD_RESPONSE,e))}let fe;if(m!=="GET")return sp(n,s,{status:405,statusText:"method not allowed",headers:{},config:e});try{fe=Gz(e.url,f==="blob",{Blob:e.env&&e.env.Blob})}catch(Se){throw it.from(Se,it.ERR_BAD_REQUEST,e)}return f==="text"?(fe=fe.toString(h),(!h||h==="utf8")&&(fe=ce.stripBOM(fe))):f==="stream"&&(fe=Iu.default.Readable.from(fe)),sp(n,s,{data:fe,status:200,statusText:"OK",headers:new xs,config:e})}if(d4.indexOf(C)===-1)return s(new it("Unsupported protocol "+C,it.ERR_BAD_REQUEST,e));let x=xs.from(e.headers).normalize();x.set("User-Agent","axios/"+fS,!1);let{onUploadProgress:B,onDownloadProgress:F}=e,R=e.maxRate,H,q;if(ce.isSpecCompliantForm(a)){let fe=x.getContentType(/boundary=([-_\w\d]{10,70})/i);a=Zz(a,Se=>{x.set(Se)},{tag:`axios-${fS}-boundary`,boundary:fe&&fe[1]||void 0})}else if(ce.isFormData(a)&&ce.isFunction(a.getHeaders)){if(x.set(a.getHeaders()),!x.hasContentLength())try{let fe=await I4.default.promisify(a.getLength).call(a);Number.isFinite(fe)&&fe>=0&&x.setContentLength(fe)}catch{}}else if(ce.isBlob(a)||ce.isFile(a))a.size&&x.setContentType(a.type||"application/octet-stream"),x.setContentLength(a.size||0),a=Iu.default.Readable.from(X4(a));else if(a&&!ce.isStream(a)){if(!Buffer.isBuffer(a))if(ce.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else if(ce.isString(a))a=Buffer.from(a,"utf-8");else return s(new it("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",it.ERR_BAD_REQUEST,e));if(x.setContentLength(a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return s(new it("Request body larger than maxBodyLength limit",it.ERR_BAD_REQUEST,e))}let K=ce.toFiniteNumber(x.getContentLength());ce.isArray(R)?(H=R[0],q=R[1]):H=q=R,a&&(B||H)&&(ce.isStream(a)||(a=Iu.default.Readable.from(a,{objectMode:!1})),a=Iu.default.pipeline([a,new c4({maxRate:ce.toFiniteNumber(H)})],ce.noop),B&&a.on("progress",m4(a,hS(K,op(pS(B),!1,3)))));let G;if(e.auth){let fe=e.auth.username||"",Se=e.auth.password||"";G=fe+":"+Se}if(!G&&A.username){let fe=A.username,Se=A.password;G=fe+":"+Se}G&&x.delete("authorization");let he;try{he=uN(A.pathname+A.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(fe){let Se=new Error(fe.message);return Se.config=e,Se.url=e.url,Se.exists=!0,s(Se)}x.set("Accept-Encoding","gzip, compress, deflate"+(p4?", br":""),!1);let le={path:he,method:m,headers:x.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:G,protocol:C,family:l,beforeRedirect:cY,beforeRedirects:{}};!ce.isUndefined(u)&&(le.lookup=u),e.socketPath?le.socketPath=e.socketPath:(le.hostname=A.hostname.startsWith("[")?A.hostname.slice(1,-1):A.hostname,le.port=A.port,G4(le,e.proxy,C+"//"+A.hostname+(A.port?":"+A.port:"")+le.path));let oe,Z=lY.test(le.protocol);if(le.agent=Z?e.httpsAgent:e.httpAgent,e.transport?oe=e.transport:e.maxRedirects===0?oe=Z?VJ.default:LJ.default:(e.maxRedirects&&(le.maxRedirects=e.maxRedirects),e.beforeRedirect&&(le.beforeRedirects.config=e.beforeRedirect),oe=Z?uY:oY),e.maxBodyLength>-1?le.maxBodyLength=e.maxBodyLength:le.maxBodyLength=1/0,e.insecureHTTPParser&&(le.insecureHTTPParser=e.insecureHTTPParser),y=oe.request(le,o(function(Se){if(y.destroyed)return;let Ke=[Se],be=+Se.headers["content-length"];if(F||q){let lt=new c4({maxRate:ce.toFiniteNumber(q)});F&&lt.on("progress",m4(lt,hS(be,op(pS(F),!0,3)))),Ke.push(lt)}let we=Se,Me=Se.req||y;if(e.decompress!==!1&&Se.headers["content-encoding"])switch((m==="HEAD"||Se.statusCode===204)&&delete Se.headers["content-encoding"],(Se.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Ke.push(Bu.default.createUnzip(h4)),delete Se.headers["content-encoding"];break;case"deflate":Ke.push(new eY),Ke.push(Bu.default.createUnzip(h4)),delete Se.headers["content-encoding"];break;case"br":p4&&(Ke.push(Bu.default.createBrotliDecompress(aY)),delete Se.headers["content-encoding"])}we=Ke.length>1?Iu.default.pipeline(Ke,ce.noop):Ke[0];let Je=Iu.default.finished(we,()=>{Je(),E()}),Ye={status:Se.statusCode,statusText:Se.statusMessage,headers:new xs(Se.headers),config:e,request:Me};if(f==="stream")Ye.data=we,sp(n,s,Ye);else{let lt=[],O=0;we.on("data",o(function(ne){lt.push(ne),O+=ne.length,e.maxContentLength>-1&&O>e.maxContentLength&&(w=!0,we.destroy(),s(new it("maxContentLength size of "+e.maxContentLength+" exceeded",it.ERR_BAD_RESPONSE,e,Me)))},"handleStreamData")),we.on("aborted",o(function(){if(w)return;let ne=new it("stream has been aborted",it.ERR_BAD_RESPONSE,e,Me);we.destroy(ne),s(ne)},"handlerStreamAborted")),we.on("error",o(function(ne){y.destroyed||s(it.from(ne,null,e,Me))},"handleStreamError")),we.on("end",o(function(){try{let ne=lt.length===1?lt[0]:Buffer.concat(lt);f!=="arraybuffer"&&(ne=ne.toString(h),(!h||h==="utf8")&&(ne=ce.stripBOM(ne))),Ye.data=ne}catch(ne){return s(it.from(ne,null,e,Ye.request,Ye))}sp(n,s,Ye)},"handleStreamEnd"))}S.once("abort",lt=>{we.destroyed||(we.emit("error",lt),we.destroy())})},"handleResponse")),S.once("abort",fe=>{s(fe),y.destroy(fe)}),y.on("error",o(function(Se){s(it.from(Se,null,e,y))},"handleRequestError")),y.on("socket",o(function(Se){Se.setKeepAlive(!0,1e3*60)},"handleRequestSocket")),e.timeout){let fe=parseInt(e.timeout,10);if(Number.isNaN(fe)){s(new it("error trying to parse `config.timeout` to int",it.ERR_BAD_OPTION_VALUE,e,y));return}y.setTimeout(fe,o(function(){if(g)return;let Ke=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",be=e.transitional||lN;e.timeoutErrorMessage&&(Ke=e.timeoutErrorMessage),s(new it(Ke,be.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,e,y)),b()},"handleRequestTimeout"))}if(ce.isStream(a)){let fe=!1,Se=!1;a.on("end",()=>{fe=!0}),a.once("error",Ke=>{Se=!0,y.destroy(Ke)}),a.on("close",()=>{!fe&&!Se&&b(new Du("Request stream has been aborted",e,y))}),a.pipe(y)}else y.end(a)},"dispatchHttpRequest"))},"httpAdapter"),mY=Yr.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,Yr.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(Yr.origin),Yr.navigator&&/(msie|trident)/i.test(Yr.navigator.userAgent)):()=>!0,gY=Yr.hasStandardBrowserEnv?{write(r,e,t,n,s,i){let a=[r+"="+encodeURIComponent(e)];ce.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),ce.isString(n)&&a.push("path="+n),ce.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(r){let e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}},y4=o(r=>r instanceof xs?{...r}:r,"headersToObject");function bc(r,e){e=e||{};let t={};function n(f,h,m,g){return ce.isPlainObject(f)&&ce.isPlainObject(h)?ce.merge.call({caseless:g},f,h):ce.isPlainObject(h)?ce.merge({},h):ce.isArray(h)?h.slice():h}o(n,"getMergedValue");function s(f,h,m,g){if(ce.isUndefined(h)){if(!ce.isUndefined(f))return n(void 0,f,m,g)}else return n(f,h,m,g)}o(s,"mergeDeepProperties");function i(f,h){if(!ce.isUndefined(h))return n(void 0,h)}o(i,"valueFromConfig2");function a(f,h){if(ce.isUndefined(h)){if(!ce.isUndefined(f))return n(void 0,f)}else return n(void 0,h)}o(a,"defaultToConfig2");function u(f,h,m){if(m in e)return n(f,h);if(m in r)return n(void 0,f)}o(u,"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:u,headers:o((f,h,m)=>s(y4(f),y4(h),m,!0),"headers")};return ce.forEach(Object.keys({...r,...e}),o(function(h){let m=l[h]||s,g=m(r[h],e[h],h);ce.isUndefined(g)&&m!==u||(t[h]=g)},"computeConfigValue")),t}o(bc,"mergeConfig");var W4=o(r=>{let e=bc({},r),{data:t,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:u}=e;if(e.headers=a=xs.from(a),e.url=uN(pN(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),u&&a.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ce.isFormData(t)){if(Yr.hasStandardBrowserEnv||Yr.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(ce.isFunction(t.getHeaders)){let l=t.getHeaders(),f=["content-type","content-length"];Object.entries(l).forEach(([h,m])=>{f.includes(h.toLowerCase())&&a.set(h,m)})}}if(Yr.hasStandardBrowserEnv&&(n&&ce.isFunction(n)&&(n=n(e)),n||n!==!1&&mY(e.url))){let l=s&&i&&gY.read(i);l&&a.set(s,l)}return e},"resolveConfig"),yY=typeof XMLHttpRequest<"u",vY=yY&&function(r){return new Promise(o(function(t,n){let s=W4(r),i=s.data,a=xs.from(s.headers).normalize(),{responseType:u,onUploadProgress:l,onDownloadProgress:f}=s,h,m,g,w,y;function S(){w&&w(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}o(S,"done");let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function b(){if(!E)return;let A=xs.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),x={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:A,config:r,request:E};sp(o(function(F){t(F),S()},"_resolve"),o(function(F){n(F),S()},"_reject"),x),E=null}o(b,"onloadend"),"onloadend"in E?E.onloadend=b:E.onreadystatechange=o(function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(b)},"handleLoad"),E.onabort=o(function(){E&&(n(new it("Request aborted",it.ECONNABORTED,r,E)),E=null)},"handleAbort"),E.onerror=o(function(C){let x=C&&C.message?C.message:"Network Error",B=new it(x,it.ERR_NETWORK,r,E);B.event=C||null,n(B),E=null},"handleError"),E.ontimeout=o(function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",x=s.transitional||lN;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),n(new it(C,x.clarifyTimeoutError?it.ETIMEDOUT:it.ECONNABORTED,r,E)),E=null},"handleTimeout"),i===void 0&&a.setContentType(null),"setRequestHeader"in E&&ce.forEach(a.toJSON(),o(function(C,x){E.setRequestHeader(x,C)},"setRequestHeader")),ce.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),u&&u!=="json"&&(E.responseType=s.responseType),f&&([g,y]=op(f,!0),E.addEventListener("progress",g)),l&&E.upload&&([m,w]=op(l),E.upload.addEventListener("progress",m),E.upload.addEventListener("loadend",w)),(s.cancelToken||s.signal)&&(h=o(A=>{E&&(n(!A||A.type?new Du(null,r,E):A),E.abort(),E=null)},"onCanceled"),s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));let T=$4(s.url);if(T&&Yr.protocols.indexOf(T)===-1){n(new it("Unsupported protocol "+T+":",it.ERR_BAD_REQUEST,r));return}E.send(i||null)},"dispatchXhrRequest"))},wY=o((r,e)=>{let{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,s,i=o(function(f){if(!s){s=!0,u();let h=f instanceof Error?f:this.reason;n.abort(h instanceof it?h:new Du(h instanceof Error?h.message:h))}},"onabort"),a=e&&setTimeout(()=>{a=null,i(new it(`timeout ${e} of ms exceeded`,it.ETIMEDOUT))},e),u=o(()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),r=null)},"unsubscribe");r.forEach(f=>f.addEventListener("abort",i));let{signal:l}=n;return l.unsubscribe=()=>ce.asap(u),l}},"composeSignals"),SY=wY,EY=o(function*(r,e){let t=r.byteLength;if(!e||t<e){yield r;return}let n=0,s;for(;n<t;)s=n+e,yield r.slice(n,s),n=s},"streamChunk"),AY=o(async function*(r,e){for await(let t of CY(r))yield*EY(t,e)},"readBytes"),CY=o(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"),v4=o((r,e,t,n)=>{let s=AY(r,e),i=0,a,u=o(l=>{a||(a=!0,n&&n(l))},"_onFinish");return new ReadableStream({async pull(l){try{let{done:f,value:h}=await s.next();if(f){u(),l.close();return}let m=h.byteLength;if(t){let g=i+=m;t(g)}l.enqueue(new Uint8Array(h))}catch(f){throw u(f),f}},cancel(l){return u(l),s.return()}},{highWaterMark:2})},"trackStream"),w4=64*1024,{isFunction:aS}=ce,bY=(({Request:r,Response:e})=>({Request:r,Response:e}))(ce.global),{ReadableStream:S4,TextEncoder:E4}=ce.global,A4=o((r,...e)=>{try{return!!r(...e)}catch{return!1}},"test"),xY=o(r=>{r=ce.merge.call({skipUndefined:!0},bY,r);let{fetch:e,Request:t,Response:n}=r,s=e?aS(e):typeof fetch=="function",i=aS(t),a=aS(n);if(!s)return!1;let u=s&&aS(S4),l=s&&(typeof E4=="function"?(y=>S=>y.encode(S))(new E4):async y=>new Uint8Array(await new t(y).arrayBuffer())),f=i&&u&&A4(()=>{let y=!1,S=new t(Yr.origin,{body:new S4,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!S}),h=a&&u&&A4(()=>ce.isReadableStream(new n("").body)),m={stream:h&&(y=>y.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!m[y]&&(m[y]=(S,E)=>{let b=S&&S[y];if(b)return b.call(S);throw new it(`Response type '${y}' is not supported`,it.ERR_NOT_SUPPORT,E)})});let g=o(async y=>{if(y==null)return 0;if(ce.isBlob(y))return y.size;if(ce.isSpecCompliantForm(y))return(await new t(Yr.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(y)||ce.isArrayBuffer(y))return y.byteLength;if(ce.isURLSearchParams(y)&&(y=y+""),ce.isString(y))return(await l(y)).byteLength},"getBodyLength"),w=o(async(y,S)=>{let E=ce.toFiniteNumber(y.getContentLength());return E??g(S)},"resolveBodyLength");return async y=>{let{url:S,method:E,data:b,signal:T,cancelToken:A,timeout:C,onDownloadProgress:x,onUploadProgress:B,responseType:F,headers:R,withCredentials:H="same-origin",fetchOptions:q}=W4(y),K=e||fetch;F=F?(F+"").toLowerCase():"text";let G=SY([T,A&&A.toAbortSignal()],C),he=null,le=G&&G.unsubscribe&&(()=>{G.unsubscribe()}),oe;try{if(B&&f&&E!=="get"&&E!=="head"&&(oe=await w(R,b))!==0){let we=new t(S,{method:"POST",body:b,duplex:"half"}),Me;if(ce.isFormData(b)&&(Me=we.headers.get("content-type"))&&R.setContentType(Me),we.body){let[Je,Ye]=hS(oe,op(pS(B)));b=v4(we.body,w4,Je,Ye)}}ce.isString(H)||(H=H?"include":"omit");let Z=i&&"credentials"in t.prototype,fe={...q,signal:G,method:E.toUpperCase(),headers:R.normalize().toJSON(),body:b,duplex:"half",credentials:Z?H:void 0};he=i&&new t(S,fe);let Se=await(i?K(he,q):K(S,fe)),Ke=h&&(F==="stream"||F==="response");if(h&&(x||Ke&&le)){let we={};["status","statusText","headers"].forEach(lt=>{we[lt]=Se[lt]});let Me=ce.toFiniteNumber(Se.headers.get("content-length")),[Je,Ye]=x&&hS(Me,op(pS(x),!0))||[];Se=new n(v4(Se.body,w4,Je,()=>{Ye&&Ye(),le&&le()}),we)}F=F||"text";let be=await m[ce.findKey(m,F)||"text"](Se,y);return!Ke&&le&&le(),await new Promise((we,Me)=>{sp(we,Me,{data:be,headers:xs.from(Se.headers),status:Se.status,statusText:Se.statusText,config:y,request:he})})}catch(Z){throw le&&le(),Z&&Z.name==="TypeError"&&/Load failed|fetch/i.test(Z.message)?Object.assign(new it("Network Error",it.ERR_NETWORK,y,he),{cause:Z.cause||Z}):it.from(Z,Z&&Z.code,y,he)}}},"factory"),NY=new Map,J4=o(r=>{let e=r?r.env:{},{fetch:t,Request:n,Response:s}=e,i=[n,s,t],a=i.length,u=a,l,f,h=NY;for(;u--;)l=i[u],f=h.get(l),f===void 0&&h.set(l,f=u?new Map:xY(e)),h=f;return f},"getFetch");J4();var sN={http:dY,xhr:vY,fetch:{get:J4}};ce.forEach(sN,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});var C4=o(r=>`- ${r}`,"renderReason"),TY=o(r=>ce.isFunction(r)||r===null||r===!1,"isResolvedHandle"),z4={getAdapter:o((r,e)=>{r=ce.isArray(r)?r:[r];let{length:t}=r,n,s,i={};for(let a=0;a<t;a++){n=r[a];let u;if(s=n,!TY(n)&&(s=sN[(u=String(n)).toLowerCase()],s===void 0))throw new it(`Unknown adapter '${u}'`);if(s&&(ce.isFunction(s)||(s=s.get(e))))break;i[u||"#"+a]=s}if(!s){let a=Object.entries(i).map(([l,f])=>`adapter ${l} `+(f===!1?"is not supported by the environment":"is not available in the build")),u=t?a.length>1?`since :
45
- `+a.map(C4).join(`
46
- `):" "+C4(a[0]):"as no adapter specified";throw new it("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s},"getAdapter"),adapters:sN};function zx(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Du(null,r)}o(zx,"throwIfCancellationRequested");function b4(r){return zx(r),r.headers=xs.from(r.headers),r.data=Wx.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),z4.getAdapter(r.adapter||hN.adapter,r)(r).then(o(function(n){return zx(r),n.data=Wx.call(r,r.transformResponse,n),n.headers=xs.from(n.headers),n},"onAdapterResolution"),o(function(n){return K4(n)||(zx(r),n&&n.response&&(n.response.data=Wx.call(r,r.transformResponse,n.response),n.response.headers=xs.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(b4,"dispatchRequest");var vS={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{vS[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var x4={};vS.transitional=o(function(e,t,n){function s(i,a){return"[Axios v"+fS+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return o(s,"formatMessage"),(i,a,u)=>{if(e===!1)throw new it(s(a," has been removed"+(t?" in "+t:"")),it.ERR_DEPRECATED);return t&&!x4[a]&&(x4[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,u):!0}},"transitional");vS.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function IY(r,e,t){if(typeof r!="object")throw new it("options must be an object",it.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),s=n.length;for(;s-- >0;){let i=n[s],a=e[i];if(a){let u=r[i],l=u===void 0||a(u,i,r);if(l!==!0)throw new it("option "+i+" must be "+l,it.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new it("Unknown option "+i,it.ERR_BAD_OPTION)}}o(IY,"assertOptions");var lS={assertOptions:IY,validators:vS},xa=lS.validators,up=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new o4,response:new o4}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
47
- `+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=bc(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&lS.assertOptions(n,{silentJSONParsing:xa.transitional(xa.boolean),forcedJSONParsing:xa.transitional(xa.boolean),clarifyTimeoutError:xa.transitional(xa.boolean)},!1),s!=null&&(ce.isFunction(s)?t.paramsSerializer={serialize:s}:lS.assertOptions(s,{encode:xa.function,serialize:xa.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),lS.assertOptions(t,{baseUrl:xa.spelling("baseURL"),withXsrfToken:xa.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&ce.merge(i.common,i[t.method]);i&&ce.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),t.headers=xs.concat(a,i);let u=[],l=!0;this.interceptors.request.forEach(o(function(S){typeof S.runWhen=="function"&&S.runWhen(t)===!1||(l=l&&S.synchronous,u.unshift(S.fulfilled,S.rejected))},"unshiftRequestInterceptors"));let f=[];this.interceptors.response.forEach(o(function(S){f.push(S.fulfilled,S.rejected)},"pushResponseInterceptors"));let h,m=0,g;if(!l){let y=[b4.bind(this),void 0];for(y.unshift(...u),y.push(...f),g=y.length,h=Promise.resolve(t);m<g;)h=h.then(y[m++],y[m++]);return h}g=u.length;let w=t;for(;m<g;){let y=u[m++],S=u[m++];try{w=y(w)}catch(E){S.call(this,E);break}}try{h=b4.call(this,w)}catch(y){return Promise.reject(y)}for(m=0,g=f.length;m<g;)h=h.then(f[m++],f[m++]);return h}getUri(e){e=bc(this.defaults,e);let t=pN(e.baseURL,e.url,e.allowAbsoluteUrls);return uN(t,e.params,e.paramsSerializer)}};ce.forEach(["delete","get","head","options"],o(function(e){up.prototype[e]=function(t,n){return this.request(bc(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ce.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(i,a,u){return this.request(bc(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),up.prototype[e]=t(),up.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var cS=up,iN=class r{static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(i){t=i},"promiseExecutor"));let n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i,a=new Promise(u=>{n.subscribe(u),i=u}).then(s);return a.cancel=o(function(){n.unsubscribe(i)},"reject"),a},e(o(function(i,a,u){n.reason||(n.reason=new Du(i,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new r(o(function(s){e=s},"executor")),cancel:e}}},BY=iN;function DY(r){return o(function(t){return r.apply(null,t)},"wrap")}o(DY,"spread");function _Y(r){return ce.isObject(r)&&r.isAxiosError===!0}o(_Y,"isAxiosError");var aN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(aN).forEach(([r,e])=>{aN[e]=r});var RY=aN;function Y4(r){let e=new cS(r),t=B4(cS.prototype.request,e);return ce.extend(t,cS.prototype,e,{allOwnKeys:!0}),ce.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(s){return Y4(bc(r,s))},"create"),t}o(Y4,"createInstance");var cn=Y4(hN);cn.Axios=cS;cn.CanceledError=Du;cn.CancelToken=BY;cn.isCancel=K4;cn.VERSION=fS;cn.toFormData=yS;cn.AxiosError=it;cn.Cancel=cn.CanceledError;cn.all=o(function(e){return Promise.all(e)},"all");cn.spread=DY;cn.isAxiosError=_Y;cn.mergeConfig=bc;cn.AxiosHeaders=xs;cn.formToJSON=r=>H4(ce.isHTMLForm(r)?new FormData(r):r);cn.getAdapter=z4.getAdapter;cn.HttpStatusCode=RY;cn.default=cn;Q4.exports=cn});var Z4=ye((Bfe,_r)=>{"use strict";_r.exports.NTLMFLAG_NEGOTIATE_UNICODE=1;_r.exports.NTLMFLAG_NEGOTIATE_OEM=2;_r.exports.NTLMFLAG_REQUEST_TARGET=4;_r.exports.NTLMFLAG_NEGOTIATE_SIGN=16;_r.exports.NTLMFLAG_NEGOTIATE_SEAL=32;_r.exports.NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE=64;_r.exports.NTLMFLAG_NEGOTIATE_LM_KEY=128;_r.exports.NTLMFLAG_NEGOTIATE_NETWARE=256;_r.exports.NTLMFLAG_NEGOTIATE_NTLM_KEY=512;_r.exports.NTLMFLAG_NEGOTIATE_ANONYMOUS=2048;_r.exports.NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED=4096;_r.exports.NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED=8192;_r.exports.NTLMFLAG_NEGOTIATE_LOCAL_CALL=16384;_r.exports.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN=32768;_r.exports.NTLMFLAG_TARGET_TYPE_DOMAIN=65536;_r.exports.NTLMFLAG_TARGET_TYPE_SERVER=1<<17;_r.exports.NTLMFLAG_TARGET_TYPE_SHARE=1<<18;_r.exports.NTLMFLAG_NEGOTIATE_NTLM2_KEY=1<<19;_r.exports.NTLMFLAG_REQUEST_INIT_RESPONSE=1<<20;_r.exports.NTLMFLAG_REQUEST_ACCEPT_RESPONSE=1<<21;_r.exports.NTLMFLAG_REQUEST_NONNT_SESSION_KEY=1<<22;_r.exports.NTLMFLAG_NEGOTIATE_TARGET_INFO=1<<23;_r.exports.NTLMFLAG_NEGOTIATE_128=1<<29;_r.exports.NTLMFLAG_NEGOTIATE_KEY_EXCHANGE=1<<30;_r.exports.NTLMFLAG_NEGOTIATE_56=1<<31});var mN=ye(yi=>{"use strict";yi.readUInt32BE=o(function(e,t){var n=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return n>>>0},"readUInt32BE");yi.writeUInt32BE=o(function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=t&255},"writeUInt32BE");yi.ip=o(function(e,t,n,s){for(var i=0,a=0,u=6;u>=0;u-=2){for(var l=0;l<=24;l+=8)i<<=1,i|=t>>>l+u&1;for(var l=0;l<=24;l+=8)i<<=1,i|=e>>>l+u&1}for(var u=6;u>=0;u-=2){for(var l=1;l<=25;l+=8)a<<=1,a|=t>>>l+u&1;for(var l=1;l<=25;l+=8)a<<=1,a|=e>>>l+u&1}n[s+0]=i>>>0,n[s+1]=a>>>0},"ip");yi.rip=o(function(e,t,n,s){for(var i=0,a=0,u=0;u<4;u++)for(var l=24;l>=0;l-=8)i<<=1,i|=t>>>l+u&1,i<<=1,i|=e>>>l+u&1;for(var u=4;u<8;u++)for(var l=24;l>=0;l-=8)a<<=1,a|=t>>>l+u&1,a<<=1,a|=e>>>l+u&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"rip");yi.pc1=o(function(e,t,n,s){for(var i=0,a=0,u=7;u>=5;u--){for(var l=0;l<=24;l+=8)i<<=1,i|=t>>l+u&1;for(var l=0;l<=24;l+=8)i<<=1,i|=e>>l+u&1}for(var l=0;l<=24;l+=8)i<<=1,i|=t>>l+u&1;for(var u=1;u<=3;u++){for(var l=0;l<=24;l+=8)a<<=1,a|=t>>l+u&1;for(var l=0;l<=24;l+=8)a<<=1,a|=e>>l+u&1}for(var l=0;l<=24;l+=8)a<<=1,a|=e>>l+u&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc1");yi.r28shl=o(function(e,t){return e<<t&268435455|e>>>28-t},"r28shl");var wS=[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];yi.pc2=o(function(e,t,n,s){for(var i=0,a=0,u=wS.length>>>1,l=0;l<u;l++)i<<=1,i|=e>>>wS[l]&1;for(var l=u;l<wS.length;l++)a<<=1,a|=t>>>wS[l]&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc2");yi.expand=o(function(e,t,n){var s=0,i=0;s=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4)s<<=6,s|=e>>>a&63;for(var a=11;a>=3;a-=4)i|=e>>>a&63,i<<=6;i|=(e&31)<<1|e>>>31,t[n+0]=s>>>0,t[n+1]=i>>>0},"expand");var ek=[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];yi.substitute=o(function(e,t){for(var n=0,s=0;s<4;s++){var i=e>>>18-s*6&63,a=ek[s*64+i];n<<=4,n|=a}for(var s=0;s<4;s++){var i=t>>>18-s*6&63,a=ek[256+s*64+i];n<<=4,n|=a}return n>>>0},"substitute");var tk=[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];yi.permute=o(function(e){for(var t=0,n=0;n<tk.length;n++)t<<=1,t|=e>>>tk[n]&1;return t>>>0},"permute");yi.padSplit=o(function(e,t,n){for(var s=e.toString(2);s.length<t;)s="0"+s;for(var i=[],a=0;a<t;a+=n)i.push(s.slice(a,a+n));return i.join(" ")},"padSplit")});var jm=ye((Rfe,nk)=>{"use strict";nk.exports=rk;function rk(r,e){if(!r)throw new Error(e||"Assertion failed")}o(rk,"assert");rk.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var SS=ye((Ofe,sk)=>{"use strict";var PY=jm();function vi(r){this.options=r,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=r.padding!==!1}o(vi,"Cipher");sk.exports=vi;vi.prototype._init=o(function(){},"_init");vi.prototype.update=o(function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)},"update");vi.prototype._buffer=o(function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),s=0;s<n;s++)this.buffer[this.bufferOff+s]=e[t+s];return this.bufferOff+=n,n},"_buffer");vi.prototype._flushBuffer=o(function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},"_flushBuffer");vi.prototype._updateEncrypt=o(function(e){var t=0,n=0,s=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(s*this.blockSize);this.bufferOff!==0&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(i,n)));for(var a=e.length-(e.length-t)%this.blockSize;t<a;t+=this.blockSize)this._update(e,t,i,n),n+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},"_updateEncrypt");vi.prototype._updateDecrypt=o(function(e){for(var t=0,n=0,s=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(s*this.blockSize);s>0;s--)t+=this._buffer(e,t),n+=this._flushBuffer(i,n);return t+=this._buffer(e,t),i},"_updateDecrypt");vi.prototype.final=o(function(e){var t;e&&(t=this.update(e));var n;return this.type==="encrypt"?n=this._finalEncrypt():n=this._finalDecrypt(),t?t.concat(n):n},"final");vi.prototype._pad=o(function(e,t){if(t===0)return!1;for(;t<e.length;)e[t++]=0;return!0},"_pad");vi.prototype._finalEncrypt=o(function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},"_finalEncrypt");vi.prototype._unpad=o(function(e){return e},"_unpad");vi.prototype._finalDecrypt=o(function(){PY.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 ik=ye((Lfe,gN)=>{"use strict";typeof Object.create=="function"?gN.exports=o(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):gN.exports=o(function(e,t){if(t){e.super_=t;var n=o(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var ES=ye((Ufe,vN)=>{"use strict";try{if(yN=wt("util"),typeof yN.inherits!="function")throw"";vN.exports=yN.inherits}catch{vN.exports=ik()}var yN});var wN=ye((Mfe,uk)=>{"use strict";var ak=jm(),OY=ES(),vn=mN(),ok=SS();function kY(){this.tmp=new Array(2),this.keys=null}o(kY,"DESState");function Ta(r){ok.call(this,r);var e=new kY;this._desState=e,this.deriveKeys(e,r.key)}o(Ta,"DES");OY(Ta,ok);uk.exports=Ta;Ta.create=o(function(e){return new Ta(e)},"create");var LY=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Ta.prototype.deriveKeys=o(function(e,t){e.keys=new Array(32),ak.equal(t.length,this.blockSize,"Invalid key length");var n=vn.readUInt32BE(t,0),s=vn.readUInt32BE(t,4);vn.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=LY[i>>>1];n=vn.r28shl(n,a),s=vn.r28shl(s,a),vn.pc2(n,s,e.keys,i)}},"deriveKeys");Ta.prototype._update=o(function(e,t,n,s){var i=this._desState,a=vn.readUInt32BE(e,t),u=vn.readUInt32BE(e,t+4);vn.ip(a,u,i.tmp,0),a=i.tmp[0],u=i.tmp[1],this.type==="encrypt"?this._encrypt(i,a,u,i.tmp,0):this._decrypt(i,a,u,i.tmp,0),a=i.tmp[0],u=i.tmp[1],vn.writeUInt32BE(n,a,s),vn.writeUInt32BE(n,u,s+4)},"_update");Ta.prototype._pad=o(function(e,t){if(this.padding===!1)return!1;for(var n=e.length-t,s=t;s<e.length;s++)e[s]=n;return!0},"_pad");Ta.prototype._unpad=o(function(e){if(this.padding===!1)return e;for(var t=e[e.length-1],n=e.length-t;n<e.length;n++)ak.equal(e[n],t);return e.slice(0,e.length-t)},"_unpad");Ta.prototype._encrypt=o(function(e,t,n,s,i){for(var a=t,u=n,l=0;l<e.keys.length;l+=2){var f=e.keys[l],h=e.keys[l+1];vn.expand(u,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1];var m=vn.substitute(f,h),g=vn.permute(m),w=u;u=(a^g)>>>0,a=w}vn.rip(u,a,s,i)},"_encrypt");Ta.prototype._decrypt=o(function(e,t,n,s,i){for(var a=n,u=t,l=e.keys.length-2;l>=0;l-=2){var f=e.keys[l],h=e.keys[l+1];vn.expand(a,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1];var m=vn.substitute(f,h),g=vn.permute(m),w=a;a=(u^g)>>>0,u=w}vn.rip(a,u,s,i)},"_decrypt")});var ck=ye(lk=>{"use strict";var VY=jm(),UY=ES(),AS={};function MY(r){VY.equal(r.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=r[e]}o(MY,"CBCState");function jY(r){function e(i){r.call(this,i),this._cbcInit()}o(e,"CBC"),UY(e,r);for(var t=Object.keys(AS),n=0;n<t.length;n++){var s=t[n];e.prototype[s]=AS[s]}return e.create=o(function(a){return new e(a)},"create"),e}o(jY,"instantiate");lk.instantiate=jY;AS._cbcInit=o(function(){var e=new MY(this.options.iv);this._cbcState=e},"_cbcInit");AS._update=o(function(e,t,n,s){var i=this._cbcState,a=this.constructor.super_.prototype,u=i.iv;if(this.type==="encrypt"){for(var l=0;l<this.blockSize;l++)u[l]^=e[t+l];a._update.call(this,u,0,n,s);for(var l=0;l<this.blockSize;l++)u[l]=n[s+l]}else{a._update.call(this,e,t,n,s);for(var l=0;l<this.blockSize;l++)n[s+l]^=u[l];for(var l=0;l<this.blockSize;l++)u[l]=e[t+l]}},"_update")});var pk=ye((Hfe,hk)=>{"use strict";var FY=jm(),qY=ES(),fk=SS(),_u=wN();function HY(r,e){FY.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=[_u.create({type:"encrypt",key:t}),_u.create({type:"decrypt",key:n}),_u.create({type:"encrypt",key:s})]:this.ciphers=[_u.create({type:"decrypt",key:s}),_u.create({type:"encrypt",key:n}),_u.create({type:"decrypt",key:t})]}o(HY,"EDEState");function xc(r){fk.call(this,r);var e=new HY(this.type,this.options.key);this._edeState=e}o(xc,"EDE");qY(xc,fk);hk.exports=xc;xc.create=o(function(e){return new xc(e)},"create");xc.prototype._update=o(function(e,t,n,s){var i=this._edeState;i.ciphers[0]._update(e,t,n,s),i.ciphers[1]._update(n,s,n,s),i.ciphers[2]._update(n,s,n,s)},"_update");xc.prototype._pad=_u.prototype._pad;xc.prototype._unpad=_u.prototype._unpad});var dk=ye(cp=>{"use strict";cp.utils=mN();cp.Cipher=SS();cp.DES=wN();cp.CBC=ck();cp.EDE=pk()});var mk=ye((Xfe,CS)=>{"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 CS=="object"&&CS.exports,n=typeof define=="function"&&define.amd,s=!r.JS_MD4_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",i="0123456789abcdef".split(""),a=[128,32768,8388608,-2147483648],u=[0,8,16,24],l=["hex","array","digest","buffer","arrayBuffer"],f=[],h;if(s){var m=new ArrayBuffer(68);h=new Uint8Array(m),f=new Uint32Array(m)}var g=o(function(b){return function(T){return new S(!0).update(T)[b]()}},"createOutputMethod"),w=o(function(){var b=g("hex");e&&(b=y(b)),b.create=function(){return new S},b.update=function(C){return b.create().update(C)};for(var T=0;T<l.length;++T){var A=l[T];b[A]=g(A)}return b},"createMethod"),y=o(function(b){var T=wt("crypto"),A=wt("buffer").Buffer,C=o(function(x){if(typeof x=="string")return T.createHash("md4").update(x,"utf8").digest("hex");if(s&&x instanceof ArrayBuffer)x=new Uint8Array(x);else if(x.length===void 0)return b(x);return T.createHash("md4").update(new A(x)).digest("hex")},"nodeMethod");return C},"nodeWrap");function S(b){if(b)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=h;else if(s){var T=new ArrayBuffer(68);this.buffer8=new Uint8Array(T),this.blocks=new Uint32Array(T)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0}o(S,"Md4"),S.prototype.update=function(b){if(!this.finalized){var T=typeof b!="string";T&&s&&b instanceof ArrayBuffer&&(b=new Uint8Array(b));for(var A,C=0,x,B=b.length||0,F=this.blocks,R=this.buffer8;C<B;){if(this.hashed&&(this.hashed=!1,F[0]=F[16],F[16]=F[1]=F[2]=F[3]=F[4]=F[5]=F[6]=F[7]=F[8]=F[9]=F[10]=F[11]=F[12]=F[13]=F[14]=F[15]=0),T)if(s)for(x=this.start;C<B&&x<64;++C)R[x++]=b[C];else for(x=this.start;C<B&&x<64;++C)F[x>>2]|=b[C]<<u[x++&3];else if(s)for(x=this.start;C<B&&x<64;++C)A=b.charCodeAt(C),A<128?R[x++]=A:A<2048?(R[x++]=192|A>>6,R[x++]=128|A&63):A<55296||A>=57344?(R[x++]=224|A>>12,R[x++]=128|A>>6&63,R[x++]=128|A&63):(A=65536+((A&1023)<<10|b.charCodeAt(++C)&1023),R[x++]=240|A>>18,R[x++]=128|A>>12&63,R[x++]=128|A>>6&63,R[x++]=128|A&63);else for(x=this.start;C<B&&x<64;++C)A=b.charCodeAt(C),A<128?F[x>>2]|=A<<u[x++&3]:A<2048?(F[x>>2]|=(192|A>>6)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]):A<55296||A>=57344?(F[x>>2]|=(224|A>>12)<<u[x++&3],F[x>>2]|=(128|A>>6&63)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]):(A=65536+((A&1023)<<10|b.charCodeAt(++C)&1023),F[x>>2]|=(240|A>>18)<<u[x++&3],F[x>>2]|=(128|A>>12&63)<<u[x++&3],F[x>>2]|=(128|A>>6&63)<<u[x++&3],F[x>>2]|=(128|A&63)<<u[x++&3]);this.lastByteIndex=x,this.bytes+=x-this.start,x>=64?(this.start=x-64,this.hash(),this.hashed=!0):this.start=x}return this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var b=this.blocks,T=this.lastByteIndex;b[T>>2]|=a[T&3],T>=56&&(this.hashed||this.hash(),b[0]=b[16],b[16]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=b[9]=b[10]=b[11]=b[12]=b[13]=b[14]=b[15]=0),b[14]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var b,T,A,C,x,B,F,R,H=this.blocks;this.first?(b=H[0]-1,b=b<<3|b>>>29,C=(b&4023233417|~b&2562383102)+H[1]+271733878,C=C<<7|C>>>25,A=(C&b|~C&4023233417)+H[2]-1732584194,A=A<<11|A>>>21,T=(A&C|~A&b)+H[3]-271733879,T=T<<19|T>>>13):(b=this.h0,T=this.h1,A=this.h2,C=this.h3,b+=(T&A|~T&C)+H[0],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[1],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[2],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[3],T=T<<19|T>>>13),b+=(T&A|~T&C)+H[4],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[5],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[6],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[7],T=T<<19|T>>>13,b+=(T&A|~T&C)+H[8],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[9],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[10],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[11],T=T<<19|T>>>13,b+=(T&A|~T&C)+H[12],b=b<<3|b>>>29,C+=(b&T|~b&A)+H[13],C=C<<7|C>>>25,A+=(C&b|~C&T)+H[14],A=A<<11|A>>>21,T+=(A&C|~A&b)+H[15],T=T<<19|T>>>13,B=T&A,b+=(B|T&C|A&C)+H[0]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[4]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[8]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[12]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[1]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[5]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[9]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[13]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[2]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[6]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[10]+1518500249,A=A<<9|A>>>23,F=A&C,T+=(F|A&b|R)+H[14]+1518500249,T=T<<13|T>>>19,B=T&A,b+=(B|T&C|F)+H[3]+1518500249,b=b<<3|b>>>29,x=b&T,C+=(x|b&A|B)+H[7]+1518500249,C=C<<5|C>>>27,R=C&b,A+=(R|C&T|x)+H[11]+1518500249,A=A<<9|A>>>23,T+=(A&C|A&b|R)+H[15]+1518500249,T=T<<13|T>>>19,B=T^A,b+=(B^C)+H[0]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[8]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[4]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[12]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[2]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[10]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[6]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[14]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[1]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[9]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[5]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[13]+1859775393,T=T<<15|T>>>17,B=T^A,b+=(B^C)+H[3]+1859775393,b=b<<3|b>>>29,C+=(B^b)+H[11]+1859775393,C=C<<9|C>>>23,R=C^b,A+=(R^T)+H[7]+1859775393,A=A<<11|A>>>21,T+=(R^A)+H[15]+1859775393,T=T<<15|T>>>17,this.first?(this.h0=b+1732584193<<0,this.h1=T-271733879<<0,this.h2=A-1732584194<<0,this.h3=C+271733878<<0,this.first=!1):(this.h0=this.h0+b<<0,this.h1=this.h1+T<<0,this.h2=this.h2+A<<0,this.h3=this.h3+C<<0)},S.prototype.hex=function(){this.finalize();var b=this.h0,T=this.h1,A=this.h2,C=this.h3;return i[b>>4&15]+i[b&15]+i[b>>12&15]+i[b>>8&15]+i[b>>20&15]+i[b>>16&15]+i[b>>28&15]+i[b>>24&15]+i[T>>4&15]+i[T&15]+i[T>>12&15]+i[T>>8&15]+i[T>>20&15]+i[T>>16&15]+i[T>>28&15]+i[T>>24&15]+i[A>>4&15]+i[A&15]+i[A>>12&15]+i[A>>8&15]+i[A>>20&15]+i[A>>16&15]+i[A>>28&15]+i[A>>24&15]+i[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]},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var b=this.h0,T=this.h1,A=this.h2,C=this.h3;return[b&255,b>>8&255,b>>16&255,b>>24&255,T&255,T>>8&255,T>>16&255,T>>24&255,A&255,A>>8&255,A>>16&255,A>>24&255,C&255,C>>8&255,C>>16&255,C>>24&255]},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var b=new ArrayBuffer(16),T=new Uint32Array(b);return T[0]=this.h0,T[1]=this.h1,T[2]=this.h2,T[3]=this.h3,b},S.prototype.buffer=S.prototype.arrayBuffer;var E=w();t?CS.exports=E:(r.md4=E,n&&define(function(){return E}))})()});var vk=ye((Jfe,yk)=>{"use strict";var SN=wt("crypto"),Wfe=dk(),KY=mk();function $Y(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),Ru(n.slice(0,7),r).copy(t),Ru(n.slice(7,14),r).copy(t,8),Ru(n.slice(14),r).copy(t,16),t}o($Y,"createLMResponse");function XY(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([Ru(t.slice(0,7),n),Ru(t.slice(7),n)]))}o(XY,"createLMHash");function Ru(r,e){var t=new Buffer.alloc(8);t[0]=r[0]&254,t[1]=r[0]<<7&255|r[1]>>1,t[2]=r[1]<<6&255|r[2]>>2,t[3]=r[2]<<5&255|r[3]>>3,t[4]=r[3]<<4&255|r[4]>>4,t[5]=r[4]<<3&255|r[5]>>5,t[6]=r[5]<<2&255|r[6]>>6,t[7]=r[6]<<1&255;for(var n=0;n<8;n++){for(var s=0,i=1;i<8;i++)s+=(t[n]>>i)%2;t[n]|=s%2===0?1:0}var a=a.DES.create({type:"encrypt",ley:t});return a.update(e)}o(Ru,"calculateDES");function GY(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),Ru(n.slice(0,7),r).copy(t),Ru(n.slice(7,14),r).copy(t,8),Ru(n.slice(14),r).copy(t,16),t}o(GY,"createNTLMResponse");function WY(r){var e=KY.create();return e.update(new Buffer.from(r,"ucs2")),e.buffer()}o(WY,"createNTLMHash");function gk(r,e,t){var n=SN.createHmac("md5",r);return n.update(new Buffer.from(e.toUpperCase()+t,"ucs2")),n.digest()}o(gk,"createNTLMv2Hash");function JY(r,e,t,n,s){var i=new Buffer.alloc(24),a=gk(t,e,s),u=SN.createHmac("md5",a);r.challenge.copy(i,8),i.write(n||EN(16),16,"hex"),u.update(i.slice(8));var l=u.digest();return l.copy(i),i}o(JY,"createLMv2Response");function zY(r,e,t,n,s){var i=new Buffer.alloc(48+r.targetInfo.buffer.length),a=gk(t,e,s),u=SN.createHmac("md5",a);r.challenge.copy(i,8),i.writeUInt32BE(16842752,16),i.writeUInt32LE(0,20);var l=((Date.now()+116444736e5)*1e4).toString(16),f=+("0x"+l.substring(Math.max(0,l.length-8))),h=+("0x"+l.substring(0,Math.max(0,l.length-8)));i.writeUInt32LE(f,24,!1),i.writeUInt32LE(h,28,!1),i.write(n||EN(16),32,"hex"),i.writeUInt32LE(0,40),r.targetInfo.buffer.copy(i,44),i.writeUInt32LE(0,44+r.targetInfo.buffer.length),u.update(i.slice(8));var m=u.digest();return m.copy(i),i}o(zY,"createNTLMv2Response");function EN(r){for(var e="";e.length<r;)e+=Math.floor(Math.random()*16).toString(16);return e}o(EN,"createPseudoRandomValue");yk.exports={createLMHash:XY,createNTLMHash:WY,createLMResponse:$Y,createNTLMResponse:GY,createLMv2Response:JY,createNTLMv2Response:zY,createPseudoRandomValue:EN}});var Ek=ye((Yfe,Sk)=>{"use strict";var wk=wt("os"),Ou=Z4(),Pu=vk(),ku="NTLMSSP\0";function YY(r,e){var t=32,n=0,s=new Buffer.alloc(1024);return r=r===void 0?wk.hostname():r,e=e===void 0?"":e,s.write(ku,n,ku.length,"ascii"),n+=ku.length,s.writeUInt32LE(1,n),n+=4,s.writeUInt32LE(Ou.NTLMFLAG_NEGOTIATE_OEM|Ou.NTLMFLAG_REQUEST_TARGET|Ou.NTLMFLAG_NEGOTIATE_NTLM_KEY|Ou.NTLMFLAG_NEGOTIATE_NTLM2_KEY|Ou.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN,n),n+=4,s.writeUInt16LE(e.length,n),n+=2,s.writeUInt16LE(e.length,n),n+=2,s.writeUInt32LE(e.length===0?0:t,n),n+=4,e.length>0&&(t+=s.write(e,t,"ascii")),s.writeUInt16LE(r.length,n),n+=2,s.writeUInt16LE(r.length,n),n+=2,s.writeUInt32LE(r.length===0?0:t,n),n+=4,r.length>0&&(t+=s.write(r,t,"ascii")),"NTLM "+s.toString("base64",0,t)}o(YY,"createType1Message");function QY(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,ku.length)!==ku)throw new Error("Invalid message signature: "+r);if(t.readUInt32LE(ku.length)!==2)throw new Error("Invalid message type (no type 2)");return n.flags=t.readUInt32LE(20),n.encoding=n.flags&Ou.NTLMFLAG_NEGOTIATE_OEM?"ascii":"ucs2",n.version=n.flags&Ou.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&Ou.NTLMFLAG_NEGOTIATE_TARGET_INFO&&(n.targetInfo=(function(){var s={},i=t.readUInt16LE(40),a=t.readUInt32LE(44),u=new Buffer.alloc(i);if(t.copy(u,0,a,a+i),i===0)return s;if(a+i>t.length||a<32)throw new Error("Bad type 2 message");for(var l=a;l<a+i;){var f=t.readUInt16LE(l);l+=2;var h=t.readUInt16LE(l);if(l+=2,f===0)break;var m=void 0;switch(f){case 1:m="SERVER";break;case 2:m="DOMAIN";break;case 3:m="FQDN";break;case 4:m="DNS";break;case 5:m="PARENT_DNS";break;default:m="";break}m&&(s[m]=t.toString("ucs2",l,l+h)),l+=h}return{parsed:s,buffer:u}})()),n}o(QY,"decodeType2Message");function ZY(r,e,t,n,s){var i=52,a=new Buffer.alloc(1024);if(n===void 0&&(n=wk.hostname()),s===void 0&&(s=r.targetName),a.write(ku,0,ku.length,"ascii"),a.writeUInt32LE(3,8),r.version===2){i=64;var u=Pu.createNTLMHash(t),l=Pu.createPseudoRandomValue(16),f=Pu.createLMv2Response(r,e,u,l,s),h=Pu.createNTLMv2Response(r,e,u,l,s);a.writeUInt16LE(f.length,12),a.writeUInt16LE(f.length,14),a.writeUInt32LE(i,16),f.copy(a,i),i+=f.length,a.writeUInt16LE(h.length,20),a.writeUInt16LE(h.length,22),a.writeUInt32LE(i,24),h.copy(a,i),i+=h.length}else{var m=Pu.createLMHash(t),u=Pu.createNTLMHash(t),g=Pu.createLMResponse(r.challenge,m),w=Pu.createNTLMResponse(r.challenge,u);a.writeUInt16LE(g.length,12),a.writeUInt16LE(g.length,14),a.writeUInt32LE(i,16),g.copy(a,i),i+=g.length,a.writeUInt16LE(w.length,20),a.writeUInt16LE(w.length,22),a.writeUInt32LE(i,24),w.copy(a,i),i+=w.length}return a.writeUInt16LE(r.encoding==="ascii"?s.length:s.length*2,28),a.writeUInt16LE(r.encoding==="ascii"?s.length:s.length*2,30),a.writeUInt32LE(i,32),i+=a.write(s,i,r.encoding),a.writeUInt16LE(r.encoding==="ascii"?e.length:e.length*2,36),a.writeUInt16LE(r.encoding==="ascii"?e.length:e.length*2,38),a.writeUInt32LE(i,40),i+=a.write(e,i,r.encoding),a.writeUInt16LE(r.encoding==="ascii"?n.length:n.length*2,44),a.writeUInt16LE(r.encoding==="ascii"?n.length:n.length*2,46),a.writeUInt32LE(i,48),i+=a.write(n,i,r.encoding),r.version===2&&(a.writeUInt16LE(0,52),a.writeUInt16LE(0,54),a.writeUInt32LE(0,56),a.writeUInt32LE(r.flags,60)),"NTLM "+a.toString("base64",0,i)}o(ZY,"createType3Message");Sk.exports={createType1Message:YY,decodeType2Message:QY,createType3Message:ZY}});var xk=ye((Zfe,bk)=>{"use strict";var eQ=wt("util"),tQ=wt("stream"),Ak=tQ.Writable,Ck=Ck||function(r){setTimeout(r,0)};bk.exports=Fm;eQ.inherits(Fm,Ak);function Fm(r){if(!(this instanceof Fm))return new Fm(r);r=r||{},Ak.call(this,r)}o(Fm,"DevNull");Fm.prototype._write=function(r,e,t){Ck(t)}});var Tk=ye(Un=>{"use strict";var rQ=Un&&Un.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nQ=Un&&Un.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bS=Un&&Un.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&rQ(t,e,n[s]);return nQ(t,e),t}})(),sQ=Un&&Un.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return o(s,"adopt"),new(t||(t=Promise))(function(i,a){function u(h){try{f(n.next(h))}catch(m){a(m)}}o(u,"fulfilled");function l(h){try{f(n.throw(h))}catch(m){a(m)}}o(l,"rejected");function f(h){h.done?i(h.value):s(h.value).then(u,l)}o(f,"step"),f((n=n.apply(r,e||[])).next())})},iQ=Un&&Un.__generator||function(r,e){var t={label:0,sent:o(function(){if(i[0]&1)throw i[1];return i[1]},"sent"),trys:[],ops:[]},n,s,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(h){return l([f,h])}}function l(f){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(t=0)),t;)try{if(n=1,s&&(i=f[0]&2?s.return:f[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,f[1])).done)return i;switch(s=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,s=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(h){f=[6,h],s=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},aQ=Un&&Un.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Un,"__esModule",{value:!0});Un.AxiosError=void 0;Un.NtlmClient=cQ;var Nk=bS(dN());Object.defineProperty(Un,"AxiosError",{enumerable:!0,get:o(function(){return Nk.AxiosError},"get")});var AN=bS(Ek()),oQ=bS(wt("https")),uQ=bS(wt("http")),lQ=aQ(xk());function cQ(r,e){var t=this,n=e??{};n.httpAgent||(n.httpAgent=new uQ.Agent({keepAlive:!0})),n.httpsAgent||(n.httpsAgent=new oQ.Agent({keepAlive:!0}));var s=Nk.default.create(n);return s.interceptors.response.use(function(i){return i},function(i){return sQ(t,void 0,void 0,function(){var a,u,l,f,h,m,g,w;return iQ(this,function(y){switch(y.label){case 0:return a=i.response,a&&a.status===401&&a.headers["www-authenticate"]&&a.headers["www-authenticate"].includes("NTLM")&&(!a.config.headers["X-retry"]||a.config.headers["X-retry"]!=="false")?(u=((g=a.headers["www-authenticate"].split(",").find(function(S){return S.match(/ *NTLM/)}))===null||g===void 0?void 0:g.trim())||"",a.config.headers||(a.config.headers={}),u.length<50?(l=AN.createType1Message(r.workstation,r.domain),a.config.headers.Authorization=l):(f=AN.decodeType2Message((u.match(/^NTLM\s+(.+?)(,|\s+|$)/)||[])[1]),h=AN.createType3Message(f,r.username,r.password,r.workstation,r.domain),a.config.headers["X-retry"]="false",a.config.headers.Authorization=h),a.config.responseType!=="stream"?[3,2]:(m=(w=i.response)===null||w===void 0?void 0:w.data,m&&!m.readableEnded?[4,new Promise(function(S){m.pipe((0,lQ.default)()),m.once("close",S)})]:[3,2])):[3,3];case 1:y.sent(),y.label=2;case 2:return[2,s(a.config)];case 3:throw i}})})}),s}o(cQ,"NtlmClient")});var qm=ye(Lu=>{"use strict";Lu.removeLeadingAndTrailingHTTPWhitespace=r=>r.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,"");Lu.removeTrailingHTTPWhitespace=r=>r.replace(/[ \t\n\r]+$/u,"");Lu.isHTTPWhitespaceChar=r=>r===" "||r===" "||r===`
48
- `||r==="\r";Lu.solelyContainsHTTPTokenCodePoints=r=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(r);Lu.soleyContainsHTTPQuotedStringTokenCodePoints=r=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(r);Lu.asciiLowercase=r=>r.replace(/[A-Z]/ug,e=>e.toLowerCase());Lu.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 Bk=ye((ihe,Ik)=>{"use strict";var{asciiLowercase:xS,solelyContainsHTTPTokenCodePoints:fQ,soleyContainsHTTPQuotedStringTokenCodePoints:hQ}=qm();Ik.exports=class{static{o(this,"MIMETypeParameters")}constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=xS(String(e)),this._map.get(e)}has(e){return e=xS(String(e)),this._map.has(e)}set(e,t){if(e=xS(String(e)),t=String(t),!fQ(e))throw new Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!hQ(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=xS(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 Rk=ye((ohe,_k)=>{"use strict";var{removeLeadingAndTrailingHTTPWhitespace:pQ,removeTrailingHTTPWhitespace:Dk,isHTTPWhitespaceChar:dQ,solelyContainsHTTPTokenCodePoints:CN,soleyContainsHTTPQuotedStringTokenCodePoints:mQ,asciiLowercase:bN,collectAnHTTPQuotedString:gQ}=qm();_k.exports=r=>{r=pQ(r);let e=0,t="";for(;e<r.length&&r[e]!=="/";)t+=r[e],++e;if(t.length===0||!CN(t)||e>=r.length)return null;++e;let n="";for(;e<r.length&&r[e]!==";";)n+=r[e],++e;if(n=Dk(n),n.length===0||!CN(n))return null;let s={type:bN(t),subtype:bN(n),parameters:new Map};for(;e<r.length;){for(++e;dQ(r[e]);)++e;let i="";for(;e<r.length&&r[e]!==";"&&r[e]!=="=";)i+=r[e],++e;if(i=bN(i),e<r.length){if(r[e]===";")continue;++e}let a=null;if(r[e]==='"')for([a,e]=gQ(r,e);e<r.length&&r[e]!==";";)++e;else{for(a="";e<r.length&&r[e]!==";";)a+=r[e],++e;if(a=Dk(a),a==="")continue}i.length>0&&CN(i)&&mQ(a)&&!s.parameters.has(i)&&s.parameters.set(i,a)}return s}});var Ok=ye((uhe,Pk)=>{"use strict";var{solelyContainsHTTPTokenCodePoints:yQ}=qm();Pk.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+="=",(!yQ(n)||n.length===0)&&(n=n.replace(/(["\\])/ug,"\\$1"),n=`"${n}"`),e+=n;return e}});var Uk=ye((che,Vk)=>{"use strict";var vQ=Bk(),wQ=Rk(),SQ=Ok(),{asciiLowercase:kk,solelyContainsHTTPTokenCodePoints:Lk}=qm();Vk.exports=class{static{o(this,"MIMEType")}constructor(e){e=String(e);let t=wQ(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 vQ(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=kk(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!Lk(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=kk(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!Lk(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return SQ(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 Vu=ye(hn=>{"use strict";var EQ=hn&&hn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),AQ=hn&&hn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),CQ=hn&&hn.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&EQ(t,e,n[s]);return AQ(t,e),t}})();Object.defineProperty(hn,"__esModule",{value:!0});hn.wsdlCacheSingleton=hn.TNS_PREFIX=void 0;hn.passwordDigest=xQ;hn.findPrefix=NQ;hn.splitQName=TQ;hn.xmlEscape=IQ;hn.parseMTOMResp=BQ;var bQ=CQ(wt("crypto"));function xQ(r,e,t){let n=bQ.createHash("sha1"),s=Buffer.from(r||"","base64"),i=Buffer.from(e||"","utf8"),a=Buffer.from(t||"","utf8"),u=Buffer.concat([s,i,a]);return n.update(u),n.digest("base64")}o(xQ,"passwordDigest");hn.TNS_PREFIX="__tns__";function NQ(r,e){for(let t in r)if(t!==hn.TNS_PREFIX&&r[t]===e)return t}o(NQ,"findPrefix");function TQ(r){if(typeof r!="string")return{prefix:hn.TNS_PREFIX,name:r};let[e]=r.split("|",1),t=e.indexOf(":");return{prefix:e.substring(0,t)||hn.TNS_PREFIX,name:e.substring(t+1)}}o(TQ,"splitQName");function IQ(r){return typeof r=="string"?r.substr(0,9)==="<![CDATA["&&r.substr(-3)==="]]>"?r:r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):r}o(IQ,"xmlEscape");function BQ(r,e,t){return import("./src-NRIPS2N7.mjs").then(({MultipartParser:n})=>{let s={parts:[]},i="",a="",u,l=0,f=new n;return f.initWithBoundary(e),f.on("data",({name:h,buffer:m,start:g,end:w})=>{switch(h){case"partBegin":s.parts[l]={body:null,headers:{}},u=Buffer.from("");break;case"headerField":i=m.slice(g,w).toString();break;case"headerValue":a=m.slice(g,w).toString();break;case"headerEnd":s.parts[l].headers[i.toLowerCase()]=a;break;case"partData":u=Buffer.concat([u,m.slice(g,w)]);break;case"partEnd":s.parts[l].body=u,l++;break}}),f.write(r),t(null,s)}).catch(t)}o(BQ,"parseMTOMResp");var DQ=class{static{o(this,"DefaultWSDLCache")}constructor(){this.cache={}}has(e){return!!this.cache[e]}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}clear(){this.cache={}}};hn.wsdlCacheSingleton=new DQ});var Mk=ye((mhe,_Q)=>{_Q.exports={name:"soap",version:"1.6.0",description:"A minimal node SOAP client",engines:{node:">=14.17.0"},author:"Vinay Pulim <v@pulim.com>",dependencies:{axios:"^1.12.2","axios-ntlm":"^1.4.6",debug:"^4.4.3",formidable:"^3.5.4","get-stream":"^6.0.1",lodash:"^4.17.21",sax:"^1.4.1","strip-bom":"^3.0.0","whatwg-mimetype":"4.0.0","xml-crypto":"^6.1.2"},repository:{type:"git",url:"https://github.com/vpulim/node-soap.git"},main:"./lib/soap.js",types:"./lib/soap.d.ts",directories:{lib:"./lib",test:"./test"},scripts:{build:"tsc -p .",watch:"tsc -w -p .",lint:"eslint .",format:"prettier --write .","format:check":"prettier --check .",toc:"./node_modules/.bin/doctoc Readme.md --github --maxlevel 3",cover:"OPENSSL_ENABLE_SHA1_SIGNATURES=1 nyc --extension=.ts --reporter=lcov --reporter=html --reporter=text mocha --no-parallel --timeout 30000 --exit test/*-test.js test/security/*.js",coveralls:"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js -v",docs:"typedoc --out docs",test:"mocha --timeout 15000 --bail --exit test/*-test.js test/security/*.js"},keywords:["soap"],license:"MIT",devDependencies:{"@eslint/js":"^9.38.0","@types/debug":"^4.1.12","@types/formidable":"^3.4.6","@types/lodash":"^4.17.20","@types/node":"^14.0.0","@types/sax":"^1.2.7","@types/whatwg-mimetype":"^3.0.2","body-parser":"^2.2.0",colors:"^1.4.0",diff:"^8.0.2",doctoc:"^2.2.1",duplexer:"~0.1.2",eslint:"^9.38.0",express:"^5.1.0",finalhandler:"^2.1.0",glob:"^11.0.3",mocha:"^11.7.4",nyc:"^17.1.0",prettier:"^3.6.2","readable-stream":"^4.7.0",semver:"^7.7.3","serve-static":"^2.2.0",should:"^13.2.3",sinon:"^21.0.0","source-map-support":"^0.5.21",timekeeper:"^2.3.1",typedoc:"^0.28.14",typescript:"^5.9.3","typescript-eslint":"^8.46.1"}}});var NS=ye(wi=>{"use strict";var RQ=wi&&wi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PQ=wi&&wi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),qk=wi&&wi.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&RQ(t,e,n[s]);return PQ(t,e),t}})(),Hk=wi&&wi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wi,"__esModule",{value:!0});wi.HttpClient=void 0;var OQ=qk(dN()),kQ=Tk(),jk=wt("crypto"),LQ=Hk(mw()),VQ=qk(wt("url")),UQ=Hk(Uk()),MQ=wt("zlib"),jQ=Vu(),Fk=(0,LQ.default)("node-soap"),FQ=Mk(),qQ=class{static{o(this,"HttpClient")}constructor(e){e=e||{},this.options=e,this._request=e.request||OQ.create()}buildRequest(e,t,n,s={}){let i=VQ.parse(e),a=t?"POST":"GET",u=i.hostname,l=parseInt(i.port,10),f={"User-Agent":"node-soap/"+FQ.version,Accept:"text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8","Accept-Encoding":"none","Accept-Charset":"utf-8",...s.forever&&{Connection:"keep-alive"},Host:u+(isNaN(l)?"":":"+l)},h=["headers"],{attachments:m,...g}=s,w=m||[];typeof t=="string"&&w.length===0&&!s.forceMTOM&&(f["Content-Length"]=Buffer.byteLength(t,"utf8"),f["Content-Type"]="application/x-www-form-urlencoded"),n=n||{};for(let S in n)f[S]=n[S];let y={url:i.href,method:a,headers:f,transformResponse:o(S=>S,"transformResponse")};if(s.ntlm||(y.validateStatus=null),s.forceMTOM||w.length>0){let S=(0,jk.randomUUID)(),E=null;if(f["Content-Type"].indexOf("action")>-1)for(let C of f["Content-Type"].split("; "))C.indexOf("action")>-1&&(E=C);let b=(0,jk.randomUUID)();f["Content-Type"]='multipart/related; type="application/xop+xml"; start="<'+S+'>"; start-info="text/xml"; boundary='+b,E&&(f["Content-Type"]=f["Content-Type"]+"; "+E);let T=[{"Content-Type":'application/xop+xml; charset=UTF-8; type="text/xml"',"Content-ID":"<"+S+">",body:t}];w.forEach(C=>{T.push({"Content-Type":C.mimetype,"Content-Transfer-Encoding":"binary","Content-ID":"<"+C.contentId+">","Content-Disposition":'attachment; filename="'+C.name+'"',body:C.body})}),y.data=[Buffer.from(`--${b}\r
49
- `)];let A=0;T.forEach(C=>{Object.keys(C).forEach(x=>{x!=="body"&&y.data.push(Buffer.from(`${x}: ${C[x]}\r
50
- `))}),y.data.push(Buffer.from(`\r
51
- `),Buffer.from(C.body),Buffer.from(`\r
52
- --${b}${A===T.length-1?"--":""}\r
53
- `)),A++}),y.data=Buffer.concat(y.data)}else y.data=t;s.forceGzip&&(y.decompress=!0,y.data=(0,MQ.gzipSync)(y.data),y.headers["Accept-Encoding"]="gzip,deflate",y.headers["Content-Encoding"]="gzip");for(let S in g)if(h.indexOf(S)!==-1)for(let E in s[S])y[S][E]=s[S][E];else y[S]=s[S];return Fk("Http request: %j",y),y}handleResponse(e,t,n){if(Fk("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),u;i!==void 0&&i.ntlm?u=(0,kQ.NtlmClient)({username:i.username,password:i.password,workstation:i.workstation||"",domain:i.domain||""})(a):(this.options.parseReponseAttachments&&(a.responseType="arraybuffer",a.responseEncoding="binary"),u=this._request(a));let l=this;return u.then(f=>{let h=o(m=>(f.data=this.handleResponse(u,f,m||f.data),n(null,f,f.data),f),"handleBody");if(l.options.parseReponseAttachments)if(f.headers["content-type"]&&f.headers["content-type"].toLowerCase().indexOf("multipart/related")>-1){let g,w=UQ.default.parse(f.headers["content-type"]);return w&&(g=w.parameters.get("boundary")),g?(0,jQ.parseMTOMResp)(f.data,g,(y,S)=>{if(y)return n(y);let E=S.parts.shift();return!E||!E.body?n(new Error("Cannot parse multipart response")):(f.mtomResponseAttachments=S,h(E.body.toString(l.options.encoding||"utf8")))}):n(new Error("Missing boundary from content-type"))}else return h(f.data.toString(l.options.encoding||"utf8"));else return h()},f=>n(f)),u}requestStream(e,t,n,s){let i=this.buildRequest(e,t,n,s);i.responseType="stream";let a=this._request(i).then(u=>(u.data=this.handleResponse(a,u,u.data),u));return a}};wi.HttpClient=qQ});var xN=ye(Si=>{"use strict";var HQ=Si&&Si.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),KQ=Si&&Si.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Gk=Si&&Si.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&HQ(t,e,n[s]);return KQ(t,e),t}})(),Wk=Si&&Si.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Si,"__esModule",{value:!0});Si.Client=void 0;var Kk=Gk(wt("assert")),$Q=wt("crypto"),XQ=Wk(mw()),GQ=wt("events"),WQ=Wk(n4()),$k=Gk(yo()),JQ=NS(),zQ=Vu(),YQ=(0,XQ.default)("node-soap"),Xk=/[^a-z$_0-9]/i,QQ=class extends GQ.EventEmitter{static{o(this,"Client")}constructor(e,t,n){super(),n=n||{},this.wsdl=e,this._initializeOptions(n),this._initializeServices(t),this.httpClient=n.httpClient||new JQ.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 u in i){a[u]=this._defineMethod(i[u],n);let l=this.normalizeNames?u.replace(Xk,"_"):u;if(this[l]=a[u],!Xk.test(l)){let f=this.overridePromiseSuffix;this[l+f]=this._promisifyMethod(a[u])}}return a}_promisifyMethod(e){return(t,n,s)=>new Promise((i,a)=>{e(t,o((l,f,h,m,g,w)=>{l?a(l):i([f,h,m,g,w])},"callback"),n,s)})}_defineMethod(e,t){let n;return(s,i,a,u)=>{typeof s=="function"?(i=s,s={}):typeof a=="function"?(n=i,i=a,a=n):typeof u=="function"&&(n=i,i=u,u=a,a=n),this._invoke(e,s,t,(l,f,h,m,g,w)=>{i(l,f,h,m,g,w)},a,u)}}_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 u=e.apply(null,[...a]);return typeof u=="object"?i.wsdl.objectToXML(u,t,n,s,!0):u}}default:return e}}_invoke(e,t,n,s,i,a){let u=e.$name,l=e.input,f=e.output,h=e.style,m=this.wsdl.definitions,g=this.wsdl.options.envelopeKey,w=this.wsdl.options.envelopeSoapUrl,y=m.$targetNamespace,S="",E="",b=null,T,A=(0,zQ.findPrefix)(m.xmlns,y),C={"Content-Type":"text/xml; charset=utf-8"},x="xmlns:"+g+'="'+w+'"',B=o((G,he,le)=>{let oe;if(!f)return s(null,null,he,G.Header,b,le.mtomResponseAttachments);if(!G.html&&!G.Body){if(le.status>=400){let Z=new Error("Error http status codes");return Z.response=le,Z.body=he,this.emit("soapError",Z,H),s(Z,G,he,G.Header)}return s(null,G,he,G.Header)}if(typeof G.Body!="object"){let Z=new Error("Cannot parse response");return Z.response=le,Z.body=he,s(Z,G,he,void 0,b)}oe=G.Body[f.$name],oe||(oe=G.Body[f.$name.replace(/(?:Out(?:put)?|Response)$/,"")]),oe||["Response","Out","Output"].forEach(Z=>{if(Object.hasOwnProperty.call(G.Body,u+Z))return oe=G.Body[u+Z]}),s(null,oe,he,G.Header,b,le.mtomResponseAttachments)},"finish"),F=o((G,he)=>{let le;try{le=this.wsdl.xmlToObject(G)}catch(oe){if(!f||!f.$lookupTypes){YQ("Response element is not present. Unable to convert response xml to json.");let Z=$k.isObject(G)?G:q(G);if(Z)return s(null,he,Z,void 0,b)}return oe.response=he,oe.body=G,this.emit("soapError",oe,H),s(oe,he,G,void 0,b,he.mtomResponseAttachments)}return B(le,G,he)},"parseSync");this.SOAPAction?T=this.SOAPAction:e.soapAction!==void 0&&e.soapAction!==null?T=e.soapAction:T=(y.lastIndexOf("/")!==y.length-1?y+"/":y)+u,this.wsdl.options.forceSoap12Headers?(C["Content-Type"]=`application/soap+xml; charset=utf-8; action="${T}"`,x="xmlns:"+g+'="http://www.w3.org/2003/05/soap-envelope"'):C.SOAPAction='"'+T+'"',i=i||{},this.security&&this.security.addHeaders&&this.security.addHeaders(C),this.security&&this.security.addOptions&&this.security.addOptions(i),h==="rpc"&&(l.parts||l.name==="element"||t===null)?(Kk.ok(!h||h==="rpc","invalid message definition for document style binding"),E=this.wsdl.objectToRpcXML(u,t,A,y,l.name!=="element"),e.inputSoap==="encoded"&&(S='soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ')):(Kk.ok(!h||h==="document","invalid message definition for rpc style binding"),E=this.wsdl.objectToDocumentXML(l.$name,t,l.targetNSAlias,l.targetNamespace,l.$type||l.$lookupType));let R;this.soapHeaders&&(R=this.soapHeaders.map(G=>typeof G=="function"?G(e,n,T,t):G).join(" ")),b='<?xml version="1.0" encoding="utf-8"?><'+g+":Envelope "+x+' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '+S+this.wsdl.xmlnsInEnvelope+">"+(R||this.security?"<"+g+":Header"+(this.wsdl.xmlnsInHeader?" "+this.wsdl.xmlnsInHeader:"")+">"+(R||"")+(this.security&&!this.security.postProcess?this.security.toXML():"")+"</"+g+":Header>":"")+"<"+g+":Body"+(this.bodyAttributes?this.bodyAttributes.join(" "):"")+">"+E+"</"+g+":Body></"+g+":Envelope>",this.security&&this.security.postProcess&&(b=this.security.postProcess(b,g)),i&&i.postProcess&&(b=i.postProcess(b)),this.lastMessage=E,this.lastRequest=b,this.lastEndpoint=n;let H=i.exchangeId||(0,$Q.randomUUID)();if(this.emit("message",E,H),this.emit("request",b,H),this.httpHeaders===null)C={};else{for(let G in this.httpHeaders)C[G]=this.httpHeaders[G];for(let G in a)C[G]=a[G]}let q=o(G=>{try{return JSON.parse(G)}catch{return}},"tryJSONparse");if(this.streamAllowed&&typeof this.httpClient.requestStream=="function"){s=$k.once(s);let G=Date.now(),he=o(le=>{this.lastResponse=null,this.lastResponseHeaders=null,this.lastElapsedTime=null,this.lastRequestHeaders=le.config&&le.config.headers,this.emit("response",null,null,H),this.returnSaxStream||!le.response||!le.response.data?s(le,void 0,void 0,void 0,b):(le.response.data.on("close",()=>{s(le,void 0,void 0,void 0,b)}),le.response.data.on("data",oe=>{le.response.data=oe.toString()}))},"onError");this.httpClient.requestStream(n,b,C,i,this).then(le=>{if(this.lastRequestHeaders=le.headers,le.data.on&&le.data.on("error",oe=>he(oe)),le.status!==200||!f||!f.$lookupTypes){(0,WQ.default)(le.data).then(oe=>(this.lastResponse=oe,this.lastElapsedTime=Date.now()-G,this.lastResponseHeaders=le&&le.headers,this.lastRequestHeaders=le.config&&le.config.headers||le.headers,this.emit("response",oe,le,H),F(oe,le)));return}if(this.returnSaxStream){let oe=this.wsdl.getSaxStream(le.data);return B({saxStream:oe},"<stream>",le.data)}else this.wsdl.xmlToObject(le.data,(oe,Z)=>(this.lastResponse=le,this.lastElapsedTime=Date.now()-G,this.lastResponseHeaders=le&&le.headers,this.lastRequestHeaders=le.config.headers,this.emit("response","<stream>",le.data,H),oe?(oe.response=le,oe.body="<stream>",this.emit("soapError",oe,H),s(oe,le,void 0,void 0,b)):B(Z,"<stream>",le)))},he);return}let K=Date.now();return this.httpClient.request(n,b,(G,he,le)=>{if(this.lastResponse=le,he&&(this.lastResponseHeaders=he.headers,this.lastElapsedTime=Date.now()-K,this.lastResponseAttachments=he.mtomResponseAttachments,this.lastRequestHeaders=he.config&&he.config.headers),this.emit("response",le,he,H),G){this.lastRequestHeaders=G.config&&G.config.headers;try{G.response&&G.response.data&&this.wsdl.xmlToObject(G.response.data)}catch(oe){G.root=oe.root||oe}s(G,void 0,void 0,void 0,b)}else return F(le,he)},C,i,this)}};Si.Client=QQ});var zk=ye(Ia=>{"use strict";var ZQ=Ia&&Ia.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),eZ=Ia&&Ia.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),tZ=Ia&&Ia.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&ZQ(t,e,n[s]);return eZ(t,e),t}})();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.BasicAuthSecurity=void 0;var Jk=tZ(yo()),rZ=class{static{o(this,"BasicAuthSecurity")}constructor(e,t,n){this._username=e,this._password=t,this.defaults={},Jk.merge(this.defaults,n)}addHeaders(e){e.Authorization="Basic "+Buffer.from(this._username+":"+this._password||"").toString("base64")}toXML(){return""}addOptions(e){Jk.merge(e,this.defaults)}};Ia.BasicAuthSecurity=rZ});var Qk=ye(Ba=>{"use strict";var nZ=Ba&&Ba.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),sZ=Ba&&Ba.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),iZ=Ba&&Ba.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&nZ(t,e,n[s]);return sZ(t,e),t}})();Object.defineProperty(Ba,"__esModule",{value:!0});Ba.BearerSecurity=void 0;var Yk=iZ(yo()),aZ=class{static{o(this,"BearerSecurity")}constructor(e,t){this._token=e,this.defaults={},Yk.merge(this.defaults,t)}addHeaders(e){e.Authorization="Bearer "+this._token}toXML(){return""}addOptions(e){Yk.merge(e,this.defaults)}};Ba.BearerSecurity=aZ});var tL=ye(Da=>{"use strict";var oZ=Da&&Da.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),uZ=Da&&Da.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),TN=Da&&Da.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&oZ(t,e,n[s]);return uZ(t,e),t}})();Object.defineProperty(Da,"__esModule",{value:!0});Da.ClientSSLSecurity=void 0;var NN=TN(wt("fs")),Zk=TN(wt("https")),eL=TN(yo()),lZ=class{static{o(this,"ClientSSLSecurity")}constructor(e,t,n,s){if(e)if(Buffer.isBuffer(e))this.key=e;else if(typeof e=="string")this.key=NN.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=NN.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=NN.readFileSync(n):(s=n,this.ca=null)),this.defaults={},eL.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,eL.merge(e,this.defaults),e.forever?(this.agent||(e.keepAlive=!0,this.agent=new Zk.Agent(e)),t=this.agent):t=new Zk.Agent(e),e.httpsAgent=t}};Da.ClientSSLSecurity=lZ});var nL=ye(_a=>{"use strict";var cZ=_a&&_a.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),fZ=_a&&_a.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),IN=_a&&_a.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&cZ(t,e,n[s]);return fZ(t,e),t}})();Object.defineProperty(_a,"__esModule",{value:!0});_a.ClientSSLSecurityPFX=void 0;var hZ=IN(wt("fs")),pZ=IN(wt("https")),rL=IN(yo()),dZ=class{static{o(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=hZ.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={},rL.merge(this.defaults,n)}toXML(){return""}addOptions(e){e.pfx=this.pfx,this.passphrase&&(e.passphrase=this.passphrase),rL.merge(e,this.defaults),e.httpsAgent=new pZ.Agent(e)}};_a.ClientSSLSecurityPFX=dZ});var sL=ye(Ra=>{"use strict";var mZ=Ra&&Ra.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),gZ=Ra&&Ra.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),yZ=Ra&&Ra.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&mZ(t,e,n[s]);return gZ(t,e),t}})();Object.defineProperty(Ra,"__esModule",{value:!0});Ra.NTLMSecurity=void 0;var vZ=yZ(yo()),wZ=class{static{o(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){vZ.merge(e,this.defaults)}};Ra.NTLMSecurity=wZ});var iL=ye(Pa=>{"use strict";var SZ=Pa&&Pa.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),EZ=Pa&&Pa.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),AZ=Pa&&Pa.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&SZ(t,e,n[s]);return EZ(t,e),t}})();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.WSSecurity=void 0;var CZ=AZ(wt("crypto")),BN=Vu(),bZ=["PasswordDigest","PasswordText"],xZ=class{static{o(this,"WSSecurity")}constructor(e,t,n){n=n||{},this._username=e,this._password=t,this._envelopeKey="soap",typeof n=="string"?(this._passwordType=n||"PasswordText",n={}):this._passwordType=n.passwordType?n.passwordType:"PasswordText",bZ.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)}toXML(){function e(u){function l(f){return f<10?"0"+f:f}return o(l,"pad"),u.getUTCFullYear()+"-"+l(u.getUTCMonth()+1)+"-"+l(u.getUTCDate())+"T"+l(u.getUTCHours())+":"+l(u.getUTCMinutes())+":"+l(u.getUTCSeconds())+"Z"}o(e,"getDate");let t=new Date,n=e(t),s="";if(this._hasTimeStamp){let u=e(new Date(t.getTime()+6e5));s='<wsu:Timestamp wsu:Id="Timestamp-'+n+'"><wsu:Created>'+n+"</wsu:Created><wsu:Expires>"+u+"</wsu:Expires></wsu:Timestamp>"}let i,a;if(this._hasNonce||this._passwordType!=="PasswordText"){let u=CZ.createHash("sha1");u.update(n+Math.random()),a=u.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,BN.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,BN.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,BN.xmlEscape)(this._username)+"</wsse:Username>"+i+(this._hasTokenCreated?"<wsu:Created>"+n+"</wsu:Created>":"")+"</wsse:UsernameToken></wsse:Security>"}};Pa.WSSecurity=xZ});var TS=ye(DN=>{"use strict";var NZ=typeof DN>"u"?{}:DN;(function(r){"use strict";function e(d){var I=Array.prototype.slice,$=d.length,te=o(function(X,nt){return function(){return nt.apply(this,X.concat(I.call(arguments)))}},"partial"),ie=o(function(){var X=I.call(arguments);return X.length<$?te(X,ie):d.apply(this,I.apply(arguments,[0,$]))},"fn1");return ie}o(e,"curry");var t=o(function(d,I){for(var $=0;$<I.length;$+=1)d(I[$],$,I)},"forEach"),n=o(function(d,I,$){var te=I;return t(function(ie,X){te=d(te,ie,X)},$),te},"reduce"),s=o(function(d,I){var $=new Array(I.length);return t(function(te,ie){$[ie]=d(te)},I),$},"map"),i=o(function(d,I){var $=[];return t(function(te,ie){d(te,ie)&&$.push(te)},I),$},"filter"),a=o(function(d,I){for(var $=0;$<d.length;$+=1)if(d[$]===I)return!0;return!1},"includes");function u(d){return function(){return d}}o(u,"always");function l(d){return d.toString()}o(l,"toString");var f=o(function(d,I){return I.join(d)},"join"),h=o(function(d,I,$){return d+$+I},"wrap"),m=Array.prototype.concat,g=32767;function w(d){for(var I=[],$=0;$<d.length;$+=g){var te=d.slice($,$+g);I=m.apply(I,te)}return I}o(w,"flatten");function y(d,I){for(var $=Object(d),te=1;te<arguments.length;te++){var ie=arguments[te];if(ie!=null)for(var X in ie)Object.prototype.hasOwnProperty.call(ie,X)&&($[X]=ie[X])}return $}o(y,"assign");var S={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};E.prototype=new Object,E.prototype.constructor=E,E.superclass=Object.prototype;function E(){this.init()}o(E,"XPathParser"),E.prototype.init=function(){this.reduceActions=[],this.reduceActions[3]=function(d){return new F(d[0],d[2])},this.reduceActions[5]=function(d){return new R(d[0],d[2])},this.reduceActions[7]=function(d){return new H(d[0],d[2])},this.reduceActions[8]=function(d){return new q(d[0],d[2])},this.reduceActions[10]=function(d){return new K(d[0],d[2])},this.reduceActions[11]=function(d){return new G(d[0],d[2])},this.reduceActions[12]=function(d){return new he(d[0],d[2])},this.reduceActions[13]=function(d){return new le(d[0],d[2])},this.reduceActions[15]=function(d){return new oe(d[0],d[2])},this.reduceActions[16]=function(d){return new Z(d[0],d[2])},this.reduceActions[18]=function(d){return new fe(d[0],d[2])},this.reduceActions[19]=function(d){return new Se(d[0],d[2])},this.reduceActions[20]=function(d){return new Ke(d[0],d[2])},this.reduceActions[22]=function(d){return new x(d[1])},this.reduceActions[24]=function(d){return new be(d[0],d[2])},this.reduceActions[25]=function(d){return new we(void 0,void 0,d[0])},this.reduceActions[27]=function(d){return d[0].locationPath=d[2],d[0]},this.reduceActions[28]=function(d){return d[0].locationPath=d[2],d[0].locationPath.steps.unshift(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[0]},this.reduceActions[29]=function(d){return new we(d[0],[],void 0)},this.reduceActions[30]=function(d){return Ze.instance_of(d[0],we)?(d[0].filterPredicates==null&&(d[0].filterPredicates=[]),d[0].filterPredicates.push(d[1]),d[0]):new we(d[0],[d[1]],void 0)},this.reduceActions[32]=function(d){return d[1]},this.reduceActions[33]=function(d){return new Re(d[0])},this.reduceActions[34]=function(d){return new xe(d[0])},this.reduceActions[36]=function(d){return new J(d[0],[])},this.reduceActions[37]=function(d){return new J(d[0],d[2])},this.reduceActions[38]=function(d){return[d[0]]},this.reduceActions[39]=function(d){return d[2].unshift(d[0]),d[2]},this.reduceActions[43]=function(d){return new lt(!0,[])},this.reduceActions[44]=function(d){return d[1].absolute=!0,d[1]},this.reduceActions[46]=function(d){return new lt(!1,[d[0]])},this.reduceActions[47]=function(d){return d[0].steps.push(d[2]),d[0]},this.reduceActions[49]=function(d){return new O(d[0],d[1],[])},this.reduceActions[50]=function(d){return new O(O.CHILD,d[0],[])},this.reduceActions[51]=function(d){return new O(d[0],d[1],d[2])},this.reduceActions[52]=function(d){return new O(O.CHILD,d[0],d[1])},this.reduceActions[54]=function(d){return[d[0]]},this.reduceActions[55]=function(d){return d[1].unshift(d[0]),d[1]},this.reduceActions[56]=function(d){return d[0]=="ancestor"?O.ANCESTOR:d[0]=="ancestor-or-self"?O.ANCESTORORSELF:d[0]=="attribute"?O.ATTRIBUTE:d[0]=="child"?O.CHILD:d[0]=="descendant"?O.DESCENDANT:d[0]=="descendant-or-self"?O.DESCENDANTORSELF:d[0]=="following"?O.FOLLOWING:d[0]=="following-sibling"?O.FOLLOWINGSIBLING:d[0]=="namespace"?O.NAMESPACE:d[0]=="parent"?O.PARENT:d[0]=="preceding"?O.PRECEDING:d[0]=="preceding-sibling"?O.PRECEDINGSIBLING:d[0]=="self"?O.SELF:-1},this.reduceActions[57]=function(d){return O.ATTRIBUTE},this.reduceActions[59]=function(d){return d[0]=="comment"?_.commentTest:d[0]=="text"?_.textTest:d[0]=="processing-instruction"?_.anyPiTest:d[0]=="node"?_.nodeTest:new _(-1,void 0)},this.reduceActions[60]=function(d){return new _.PITest(d[2])},this.reduceActions[61]=function(d){return d[1]},this.reduceActions[63]=function(d){return d[1].absolute=!0,d[1].steps.unshift(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[1]},this.reduceActions[64]=function(d){return d[0].steps.push(new O(O.DESCENDANTORSELF,_.nodeTest,[])),d[0].steps.push(d[2]),d[0]},this.reduceActions[65]=function(d){return new O(O.SELF,_.nodeTest,[])},this.reduceActions[66]=function(d){return new O(O.PARENT,_.nodeTest,[])},this.reduceActions[67]=function(d){return new ne(d[1])},this.reduceActions[68]=function(d){return _.nameTestAny},this.reduceActions[69]=function(d){return new _.NameTestPrefixAny(d[0].split(":")[0])},this.reduceActions[70]=function(d){return new _.NameTestQName(d[0])}},E.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 "],E.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 "],E.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 "," "," "],E.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]],E.DOUBLEDOT=2,E.DOUBLECOLON=3,E.DOUBLESLASH=4,E.NOTEQUAL=5,E.LESSTHANOREQUAL=6,E.GREATERTHANOREQUAL=7,E.AND=8,E.OR=9,E.MOD=10,E.DIV=11,E.MULTIPLYOPERATOR=12,E.FUNCTIONNAME=13,E.AXISNAME=14,E.LITERAL=15,E.NUMBER=16,E.ASTERISKNAMETEST=17,E.QNAME=18,E.NCNAMECOLONASTERISK=19,E.NODETYPE=20,E.PROCESSINGINSTRUCTIONWITHLITERAL=21,E.EQUALS=22,E.LESSTHAN=23,E.GREATERTHAN=24,E.PLUS=25,E.MINUS=26,E.BAR=27,E.SLASH=28,E.LEFTPARENTHESIS=29,E.RIGHTPARENTHESIS=30,E.COMMA=31,E.AT=32,E.LEFTBRACKET=33,E.RIGHTBRACKET=34,E.DOT=35,E.DOLLAR=36,E.prototype.tokenize=function(d){for(var I=[],$=[],te=d+"\0",ie=0,X=te.charAt(ie++);;){for(;X==" "||X==" "||X=="\r"||X==`
54
- `;)X=te.charAt(ie++);if(X=="\0"||ie>=te.length)break;if(X=="("){I.push(E.LEFTPARENTHESIS),$.push(X),X=te.charAt(ie++);continue}if(X==")"){I.push(E.RIGHTPARENTHESIS),$.push(X),X=te.charAt(ie++);continue}if(X=="["){I.push(E.LEFTBRACKET),$.push(X),X=te.charAt(ie++);continue}if(X=="]"){I.push(E.RIGHTBRACKET),$.push(X),X=te.charAt(ie++);continue}if(X=="@"){I.push(E.AT),$.push(X),X=te.charAt(ie++);continue}if(X==","){I.push(E.COMMA),$.push(X),X=te.charAt(ie++);continue}if(X=="|"){I.push(E.BAR),$.push(X),X=te.charAt(ie++);continue}if(X=="+"){I.push(E.PLUS),$.push(X),X=te.charAt(ie++);continue}if(X=="-"){I.push(E.MINUS),$.push(X),X=te.charAt(ie++);continue}if(X=="="){I.push(E.EQUALS),$.push(X),X=te.charAt(ie++);continue}if(X=="$"){I.push(E.DOLLAR),$.push(X),X=te.charAt(ie++);continue}if(X=="."){if(X=te.charAt(ie++),X=="."){I.push(E.DOUBLEDOT),$.push(".."),X=te.charAt(ie++);continue}if(X>="0"&&X<="9"){var nt="."+X;for(X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);I.push(E.NUMBER),$.push(nt);continue}I.push(E.DOT),$.push(".");continue}if(X=="'"||X=='"'){for(var kt=X,Wt="";ie<te.length&&(X=te.charAt(ie))!==kt;)Wt+=X,ie+=1;if(X!==kt)throw _n.fromMessage("Unterminated string literal: "+kt+Wt);ie+=1,I.push(E.LITERAL),$.push(Wt),X=te.charAt(ie++);continue}if(X>="0"&&X<="9"){var nt=X;for(X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);if(X=="."&&te.charAt(ie)>="0"&&te.charAt(ie)<="9")for(nt+=X,nt+=te.charAt(ie++),X=te.charAt(ie++);X>="0"&&X<="9";)nt+=X,X=te.charAt(ie++);I.push(E.NUMBER),$.push(nt);continue}if(X=="*"){if(I.length>0){var et=I[I.length-1];if(et!=E.AT&&et!=E.DOUBLECOLON&&et!=E.LEFTPARENTHESIS&&et!=E.LEFTBRACKET&&et!=E.AND&&et!=E.OR&&et!=E.MOD&&et!=E.DIV&&et!=E.MULTIPLYOPERATOR&&et!=E.SLASH&&et!=E.DOUBLESLASH&&et!=E.BAR&&et!=E.PLUS&&et!=E.MINUS&&et!=E.EQUALS&&et!=E.NOTEQUAL&&et!=E.LESSTHAN&&et!=E.LESSTHANOREQUAL&&et!=E.GREATERTHAN&&et!=E.GREATERTHANOREQUAL){I.push(E.MULTIPLYOPERATOR),$.push(X),X=te.charAt(ie++);continue}}I.push(E.ASTERISKNAMETEST),$.push(X),X=te.charAt(ie++);continue}if(X==":"&&te.charAt(ie)==":"){I.push(E.DOUBLECOLON),$.push("::"),ie++,X=te.charAt(ie++);continue}if(X=="/"){if(X=te.charAt(ie++),X=="/"){I.push(E.DOUBLESLASH),$.push("//"),X=te.charAt(ie++);continue}I.push(E.SLASH),$.push("/");continue}if(X=="!"&&te.charAt(ie)=="="){I.push(E.NOTEQUAL),$.push("!="),ie++,X=te.charAt(ie++);continue}if(X=="<"){if(te.charAt(ie)=="="){I.push(E.LESSTHANOREQUAL),$.push("<="),ie++,X=te.charAt(ie++);continue}I.push(E.LESSTHAN),$.push("<"),X=te.charAt(ie++);continue}if(X==">"){if(te.charAt(ie)=="="){I.push(E.GREATERTHANOREQUAL),$.push(">="),ie++,X=te.charAt(ie++);continue}I.push(E.GREATERTHAN),$.push(">"),X=te.charAt(ie++);continue}if(X=="_"||Ze.isLetter(X.charCodeAt(0))){var Dt=X;for(X=te.charAt(ie++);Ze.isNCNameChar(X.charCodeAt(0));)Dt+=X,X=te.charAt(ie++);if(I.length>0){var et=I[I.length-1];if(et!=E.AT&&et!=E.DOUBLECOLON&&et!=E.LEFTPARENTHESIS&&et!=E.LEFTBRACKET&&et!=E.AND&&et!=E.OR&&et!=E.MOD&&et!=E.DIV&&et!=E.MULTIPLYOPERATOR&&et!=E.SLASH&&et!=E.DOUBLESLASH&&et!=E.BAR&&et!=E.PLUS&&et!=E.MINUS&&et!=E.EQUALS&&et!=E.NOTEQUAL&&et!=E.LESSTHAN&&et!=E.LESSTHANOREQUAL&&et!=E.GREATERTHAN&&et!=E.GREATERTHANOREQUAL){if(Dt=="and"){I.push(E.AND),$.push(Dt);continue}if(Dt=="or"){I.push(E.OR),$.push(Dt);continue}if(Dt=="mod"){I.push(E.MOD),$.push(Dt);continue}if(Dt=="div"){I.push(E.DIV),$.push(Dt);continue}}}if(X==":"){if(te.charAt(ie)=="*"){I.push(E.NCNAMECOLONASTERISK),$.push(Dt+":*"),ie++,X=te.charAt(ie++);continue}if(te.charAt(ie)=="_"||Ze.isLetter(te.charCodeAt(ie))){for(Dt+=":",X=te.charAt(ie++);Ze.isNCNameChar(X.charCodeAt(0));)Dt+=X,X=te.charAt(ie++);if(X=="("){I.push(E.FUNCTIONNAME),$.push(Dt);continue}I.push(E.QNAME),$.push(Dt);continue}if(te.charAt(ie)==":"){I.push(E.AXISNAME),$.push(Dt);continue}}if(X=="("){if(Dt=="comment"||Dt=="text"||Dt=="node"){I.push(E.NODETYPE),$.push(Dt);continue}if(Dt=="processing-instruction"){te.charAt(ie)==")"?I.push(E.NODETYPE):I.push(E.PROCESSINGINSTRUCTIONWITHLITERAL),$.push(Dt);continue}I.push(E.FUNCTIONNAME),$.push(Dt);continue}I.push(E.QNAME),$.push(Dt);continue}throw new Error("Unexpected character "+X)}return I.push(1),$.push("[EOF]"),[I,$]},E.SHIFT="s",E.REDUCE="r",E.ACCEPT="a",E.prototype.parse=function(Wt){var I,$,te=this.tokenize(Wt);if(te!=null){I=te[0],$=te[1];var ie=0,X=[],nt=[],kt=[],Wt,et,Dt;for(X.push(0),nt.push(1),kt.push("_S"),et=I[ie],Dt=$[ie++];;)switch(Wt=X[X.length-1],E.actionTable[Wt].charAt(et-1)){case E.SHIFT:nt.push(-et),kt.push(Dt),X.push(E.actionTableNumber[Wt].charCodeAt(et-1)-32),et=I[ie],Dt=$[ie++];break;case E.REDUCE:for(var Rn=E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][1],ri=[],or=0;or<Rn;or++)nt.pop(),ri.unshift(kt.pop()),X.pop();var la=X[X.length-1];nt.push(E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][0]),this.reduceActions[E.actionTableNumber[Wt].charCodeAt(et-1)-32]==null?kt.push(ri[0]):kt.push(this.reduceActions[E.actionTableNumber[Wt].charCodeAt(et-1)-32](ri)),X.push(E.gotoTable[la].charCodeAt(E.productions[E.actionTableNumber[Wt].charCodeAt(et-1)-32][0]-2)-33);break;case E.ACCEPT:return new b(kt.pop());default:throw new Error("XPath parse error")}}},b.prototype=new Object,b.prototype.constructor=b,b.superclass=Object.prototype;function b(d){this.expression=d}o(b,"XPath"),b.prototype.toString=function(){return this.expression.toString()};function T(d,I,$){I in d||(d[I]=$)}o(T,"setIfUnset"),b.prototype.evaluate=function(d){return d.contextNode=d.expressionContextNode,d.contextSize=1,d.contextPosition=1,d.isHtml&&(T(d,"caseInsensitive",!0),T(d,"allowAnyNamespaceForNoPrefix",!0)),T(d,"caseInsensitive",!1),this.expression.evaluate(d)},b.XML_NAMESPACE_URI="http://www.w3.org/XML/1998/namespace",b.XMLNS_NAMESPACE_URI="http://www.w3.org/2000/xmlns/",A.prototype=new Object,A.prototype.constructor=A,A.superclass=Object.prototype;function A(){}o(A,"Expression"),A.prototype.init=function(){},A.prototype.toString=function(){return"<Expression>"},A.prototype.evaluate=function(d){throw new Error("Could not evaluate expression.")},C.prototype=new A,C.prototype.constructor=C,C.superclass=A.prototype;function C(d){arguments.length>0&&this.init(d)}o(C,"UnaryOperation"),C.prototype.init=function(d){this.rhs=d},x.prototype=new C,x.prototype.constructor=x,x.superclass=C.prototype;function x(d){arguments.length>0&&this.init(d)}o(x,"UnaryMinusOperation"),x.prototype.init=function(d){x.superclass.init.call(this,d)},x.prototype.evaluate=function(d){return this.rhs.evaluate(d).number().negate()},x.prototype.toString=function(){return"-"+this.rhs.toString()},B.prototype=new A,B.prototype.constructor=B,B.superclass=A.prototype;function B(d,I){arguments.length>0&&this.init(d,I)}o(B,"BinaryOperation"),B.prototype.init=function(d,I){this.lhs=d,this.rhs=I},F.prototype=new B,F.prototype.constructor=F,F.superclass=B.prototype;function F(d,I){arguments.length>0&&this.init(d,I)}o(F,"OrOperation"),F.prototype.init=function(d,I){F.superclass.init.call(this,d,I)},F.prototype.toString=function(){return"("+this.lhs.toString()+" or "+this.rhs.toString()+")"},F.prototype.evaluate=function(d){var I=this.lhs.evaluate(d).bool();return I.booleanValue()?I:this.rhs.evaluate(d).bool()},R.prototype=new B,R.prototype.constructor=R,R.superclass=B.prototype;function R(d,I){arguments.length>0&&this.init(d,I)}o(R,"AndOperation"),R.prototype.init=function(d,I){R.superclass.init.call(this,d,I)},R.prototype.toString=function(){return"("+this.lhs.toString()+" and "+this.rhs.toString()+")"},R.prototype.evaluate=function(d){var I=this.lhs.evaluate(d).bool();return I.booleanValue()?this.rhs.evaluate(d).bool():I},H.prototype=new B,H.prototype.constructor=H,H.superclass=B.prototype;function H(d,I){arguments.length>0&&this.init(d,I)}o(H,"EqualsOperation"),H.prototype.init=function(d,I){H.superclass.init.call(this,d,I)},H.prototype.toString=function(){return"("+this.lhs.toString()+" = "+this.rhs.toString()+")"},H.prototype.evaluate=function(d){return this.lhs.evaluate(d).equals(this.rhs.evaluate(d))},q.prototype=new B,q.prototype.constructor=q,q.superclass=B.prototype;function q(d,I){arguments.length>0&&this.init(d,I)}o(q,"NotEqualOperation"),q.prototype.init=function(d,I){q.superclass.init.call(this,d,I)},q.prototype.toString=function(){return"("+this.lhs.toString()+" != "+this.rhs.toString()+")"},q.prototype.evaluate=function(d){return this.lhs.evaluate(d).notequal(this.rhs.evaluate(d))},K.prototype=new B,K.prototype.constructor=K,K.superclass=B.prototype;function K(d,I){arguments.length>0&&this.init(d,I)}o(K,"LessThanOperation"),K.prototype.init=function(d,I){K.superclass.init.call(this,d,I)},K.prototype.evaluate=function(d){return this.lhs.evaluate(d).lessthan(this.rhs.evaluate(d))},K.prototype.toString=function(){return"("+this.lhs.toString()+" < "+this.rhs.toString()+")"},G.prototype=new B,G.prototype.constructor=G,G.superclass=B.prototype;function G(d,I){arguments.length>0&&this.init(d,I)}o(G,"GreaterThanOperation"),G.prototype.init=function(d,I){G.superclass.init.call(this,d,I)},G.prototype.evaluate=function(d){return this.lhs.evaluate(d).greaterthan(this.rhs.evaluate(d))},G.prototype.toString=function(){return"("+this.lhs.toString()+" > "+this.rhs.toString()+")"},he.prototype=new B,he.prototype.constructor=he,he.superclass=B.prototype;function he(d,I){arguments.length>0&&this.init(d,I)}o(he,"LessThanOrEqualOperation"),he.prototype.init=function(d,I){he.superclass.init.call(this,d,I)},he.prototype.evaluate=function(d){return this.lhs.evaluate(d).lessthanorequal(this.rhs.evaluate(d))},he.prototype.toString=function(){return"("+this.lhs.toString()+" <= "+this.rhs.toString()+")"},le.prototype=new B,le.prototype.constructor=le,le.superclass=B.prototype;function le(d,I){arguments.length>0&&this.init(d,I)}o(le,"GreaterThanOrEqualOperation"),le.prototype.init=function(d,I){le.superclass.init.call(this,d,I)},le.prototype.evaluate=function(d){return this.lhs.evaluate(d).greaterthanorequal(this.rhs.evaluate(d))},le.prototype.toString=function(){return"("+this.lhs.toString()+" >= "+this.rhs.toString()+")"},oe.prototype=new B,oe.prototype.constructor=oe,oe.superclass=B.prototype;function oe(d,I){arguments.length>0&&this.init(d,I)}o(oe,"PlusOperation"),oe.prototype.init=function(d,I){oe.superclass.init.call(this,d,I)},oe.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().plus(this.rhs.evaluate(d).number())},oe.prototype.toString=function(){return"("+this.lhs.toString()+" + "+this.rhs.toString()+")"},Z.prototype=new B,Z.prototype.constructor=Z,Z.superclass=B.prototype;function Z(d,I){arguments.length>0&&this.init(d,I)}o(Z,"MinusOperation"),Z.prototype.init=function(d,I){Z.superclass.init.call(this,d,I)},Z.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().minus(this.rhs.evaluate(d).number())},Z.prototype.toString=function(){return"("+this.lhs.toString()+" - "+this.rhs.toString()+")"},fe.prototype=new B,fe.prototype.constructor=fe,fe.superclass=B.prototype;function fe(d,I){arguments.length>0&&this.init(d,I)}o(fe,"MultiplyOperation"),fe.prototype.init=function(d,I){fe.superclass.init.call(this,d,I)},fe.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().multiply(this.rhs.evaluate(d).number())},fe.prototype.toString=function(){return"("+this.lhs.toString()+" * "+this.rhs.toString()+")"},Se.prototype=new B,Se.prototype.constructor=Se,Se.superclass=B.prototype;function Se(d,I){arguments.length>0&&this.init(d,I)}o(Se,"DivOperation"),Se.prototype.init=function(d,I){Se.superclass.init.call(this,d,I)},Se.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().div(this.rhs.evaluate(d).number())},Se.prototype.toString=function(){return"("+this.lhs.toString()+" div "+this.rhs.toString()+")"},Ke.prototype=new B,Ke.prototype.constructor=Ke,Ke.superclass=B.prototype;function Ke(d,I){arguments.length>0&&this.init(d,I)}o(Ke,"ModOperation"),Ke.prototype.init=function(d,I){Ke.superclass.init.call(this,d,I)},Ke.prototype.evaluate=function(d){return this.lhs.evaluate(d).number().mod(this.rhs.evaluate(d).number())},Ke.prototype.toString=function(){return"("+this.lhs.toString()+" mod "+this.rhs.toString()+")"},be.prototype=new B,be.prototype.constructor=be,be.superclass=B.prototype;function be(d,I){arguments.length>0&&this.init(d,I)}o(be,"BarOperation"),be.prototype.init=function(d,I){be.superclass.init.call(this,d,I)},be.prototype.evaluate=function(d){return this.lhs.evaluate(d).nodeset().union(this.rhs.evaluate(d).nodeset())},be.prototype.toString=function(){return s(l,[this.lhs,this.rhs]).join(" | ")},we.prototype=new A,we.prototype.constructor=we,we.superclass=A.prototype;function we(d,I,$){arguments.length>0&&this.init(d,I,$)}o(we,"PathExpr"),we.prototype.init=function(d,I,$){we.superclass.init.call(this),this.filter=d,this.filterPredicates=I,this.locationPath=$};function Me(d){for(;d&&d.parentNode;)d=d.parentNode;return d}o(Me,"findRoot"),we.applyPredicates=function(d,I,$){if(d.length===0)return $;var te=I.extend({});return n(function(ie,X){return te.contextSize=ie.length,i(function(nt,kt){return te.contextNode=nt,te.contextPosition=kt+1,we.predicateMatches(X,te)},ie)},$,d)},we.getRoot=function(d,I){var $=I[0];if($.nodeType===S.DOCUMENT_NODE)return $;if(d.virtualRoot)return d.virtualRoot;var te=$.ownerDocument;if(te)return te;for(var ie=$;ie.parentNode!=null;)ie=ie.parentNode;return ie},we.applyStep=function(d,I,$){var te=this,ie=[];switch(I.contextNode=$,d.axis){case O.ANCESTOR:if(I.contextNode===I.virtualRoot)break;var X;for(I.contextNode.nodeType==S.ATTRIBUTE_NODE?X=we.getOwnerElement(I.contextNode):X=I.contextNode.parentNode;X!=null&&(d.nodeTest.matches(X,I)&&ie.push(X),X!==I.virtualRoot);)X=X.parentNode;break;case O.ANCESTORORSELF:for(var X=I.contextNode;X!=null&&(d.nodeTest.matches(X,I)&&ie.push(X),X!==I.virtualRoot);X=X.nodeType==S.ATTRIBUTE_NODE?we.getOwnerElement(X):X.parentNode);break;case O.ATTRIBUTE:var nt=I.contextNode.attributes;if(nt!=null)for(var kt=0;kt<nt.length;kt++){var X=nt.item(kt);d.nodeTest.matches(X,I)&&ie.push(X)}break;case O.CHILD:for(var X=I.contextNode.firstChild;X!=null;X=X.nextSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.DESCENDANT:for(var or=[I.contextNode.firstChild];or.length>0;)for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;break;case O.DESCENDANTORSELF:d.nodeTest.matches(I.contextNode,I)&&ie.push(I.contextNode);for(var or=[I.contextNode.firstChild];or.length>0;)for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;break;case O.FOLLOWING:if(I.contextNode===I.virtualRoot)break;var or=[];I.contextNode.firstChild!=null?or.unshift(I.contextNode.firstChild):or.unshift(I.contextNode.nextSibling);for(var X=I.contextNode.parentNode;X!=null&&X.nodeType!=S.DOCUMENT_NODE&&X!==I.virtualRoot;X=X.parentNode)or.unshift(X.nextSibling);do for(var X=or.pop();X!=null;)d.nodeTest.matches(X,I)&&ie.push(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling;while(or.length>0);break;case O.FOLLOWINGSIBLING:if(I.contextNode===I.virtualRoot)break;for(var X=I.contextNode.nextSibling;X!=null;X=X.nextSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.NAMESPACE:var Wt={};if(I.contextNode.nodeType==S.ELEMENT_NODE){Wt.xml=b.XML_NAMESPACE_URI,Wt.xmlns=b.XMLNS_NAMESPACE_URI;for(var X=I.contextNode;X!=null&&X.nodeType==S.ELEMENT_NODE;X=X.parentNode)for(var kt=0;kt<X.attributes.length;kt++){var et=X.attributes.item(kt),Dt=String(et.name);if(Dt=="xmlns")Wt[""]==null&&(Wt[""]=et.value);else if(Dt.length>6&&Dt.substring(0,6)=="xmlns:"){var Rn=Dt.substring(6,Dt.length);Wt[Rn]==null&&(Wt[Rn]=et.value)}}for(var Rn in Wt){var ri=new Mr(Rn,Wt[Rn],I.contextNode);d.nodeTest.matches(ri,I)&&ie.push(ri)}}break;case O.PARENT:X=null,I.contextNode!==I.virtualRoot&&(I.contextNode.nodeType==S.ATTRIBUTE_NODE?X=we.getOwnerElement(I.contextNode):X=I.contextNode.parentNode),X!=null&&d.nodeTest.matches(X,I)&&ie.push(X);break;case O.PRECEDING:var or;I.virtualRoot!=null?or=[I.virtualRoot]:or=[Me(I.contextNode)];e:for(;or.length>0;)for(var X=or.pop();X!=null;){if(X==I.contextNode)break e;d.nodeTest.matches(X,I)&&ie.unshift(X),X.firstChild!=null?(or.push(X.nextSibling),X=X.firstChild):X=X.nextSibling}break;case O.PRECEDINGSIBLING:if(I.contextNode===I.virtualRoot)break;for(var X=I.contextNode.previousSibling;X!=null;X=X.previousSibling)d.nodeTest.matches(X,I)&&ie.push(X);break;case O.SELF:d.nodeTest.matches(I.contextNode,I)&&ie.push(I.contextNode);break;default:}return ie};function Je(d,I,$){return we.applyPredicates(d.predicates,I,we.applyStep(d,I,$))}o(Je,"applyStepWithPredicates");function Ye(d,I,$){return w(s(Je.bind(null,$,d),I))}o(Ye,"applyStepToNodes"),we.applySteps=function(d,I,$){return n(Ye.bind(null,I),$,d)},we.prototype.applyFilter=function(d,I){if(!this.filter)return{nodes:[d.contextNode]};var $=this.filter.evaluate(d);if(!Ze.instance_of($,Ge)){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:$}}return{nodes:we.applyPredicates(this.filterPredicates||[],I,$.toUnsortedArray())}},we.applyLocationPath=function(d,I,$){if(!d)return $;var te=d.absolute?[we.getRoot(I,$)]:$;return we.applySteps(d.steps,I,te)},we.prototype.evaluate=function(d){var I=y(new un,d),$=this.applyFilter(d,I);if("nonNodes"in $)return $.nonNodes;var te=new Ge;return te.addArray(we.applyLocationPath(this.locationPath,I,$.nodes)),te},we.predicateMatches=function(d,I){var $=d.evaluate(I);return Ze.instance_of($,xe)?I.contextPosition===$.numberValue():$.booleanValue()},we.predicateString=function(d){return h("[","]",d.toString())},we.predicatesString=function(d){return f("",s(we.predicateString,d))},we.prototype.toString=function(){if(this.filter!=null){var d=l(this.filter);return Ze.instance_of(this.filter,Re)?h("'","'",d):this.filterPredicates!=null&&this.filterPredicates.length?h("(",")",d)+we.predicatesString(this.filterPredicates):this.locationPath!=null?d+(this.locationPath.absolute?"":"/")+l(this.locationPath):d}return l(this.locationPath)},we.getOwnerElement=function(d){if(d.ownerElement)return d.ownerElement;try{if(d.selectSingleNode)return d.selectSingleNode("..")}catch{}for(var I=d.nodeType==S.DOCUMENT_NODE?d:d.ownerDocument,$=I.getElementsByTagName("*"),te=0;te<$.length;te++)for(var ie=$.item(te),X=ie.attributes,nt=0;nt<X.length;nt++){var kt=X.item(nt);if(kt===d)return ie}return null},lt.prototype=new Object,lt.prototype.constructor=lt,lt.superclass=Object.prototype;function lt(d,I){arguments.length>0&&this.init(d,I)}o(lt,"LocationPath"),lt.prototype.init=function(d,I){this.absolute=d,this.steps=I},lt.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(d,I,$){arguments.length>0&&this.init(d,I,$)}o(O,"Step"),O.prototype.init=function(d,I,$){this.axis=d,this.nodeTest=I,this.predicates=$},O.prototype.toString=function(){return O.STEPNAMES[this.axis]+"::"+this.nodeTest.toString()+we.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(d,I){return d[I[0]]=I[1],d},{},[[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"]]),_.prototype=new Object,_.prototype.constructor=_,_.superclass=Object.prototype;function _(d,I){arguments.length>0&&this.init(d,I)}o(_,"NodeTest"),_.prototype.init=function(d,I){this.type=d,this.value=I},_.prototype.toString=function(){return"<unknown nodetest type>"},_.prototype.matches=function(d,I){console.warn("unknown node test type")},_.NAMETESTANY=0,_.NAMETESTPREFIXANY=1,_.NAMETESTQNAME=2,_.COMMENT=3,_.TEXT=4,_.PI=5,_.NODE=6,_.isNodeType=function(d){return function(I){return a(d,I.nodeType)}},_.makeNodeTestType=function(d,I,$){var te=$||function(){};return te.prototype=new _(d),te.prototype.constructor=te,y(te.prototype,I),te},_.makeNodeTypeTest=function(d,I,$){return new(_.makeNodeTestType(d,{matches:_.isNodeType(I),toString:u($)}))},_.hasPrefix=function(d){return d.prefix||(d.nodeName||d.tagName).indexOf(":")!==-1},_.isElementOrAttribute=_.isNodeType([1,2]),_.nameSpaceMatches=function(d,I,$){var te=$.namespaceURI||"";if(!d)return!te||I.allowAnyNamespaceForNoPrefix&&!_.hasPrefix($);var ie=I.namespaceResolver.getNamespace(d,I.expressionContextNode);if(ie==null)throw new Error("Cannot resolve QName "+d);return ie===te},_.localNameMatches=function(d,I,$){var te=$.localName||$.nodeName;return I.caseInsensitive?d.toLowerCase()===te.toLowerCase():d===te},_.NameTestPrefixAny=_.makeNodeTestType(_.NAMETESTPREFIXANY,{matches:o(function(d,I){return _.isElementOrAttribute(d)&&_.nameSpaceMatches(this.prefix,I,d)},"matches"),toString:o(function(){return this.prefix+":*"},"toString")},o(function(I){this.prefix=I},"NameTestPrefixAny")),_.NameTestQName=_.makeNodeTestType(_.NAMETESTQNAME,{matches:o(function(d,I){return _.isNodeType([S.ELEMENT_NODE,S.ATTRIBUTE_NODE,Mr.XPATH_NAMESPACE_NODE])(d)&&_.nameSpaceMatches(this.prefix,I,d)&&_.localNameMatches(this.localName,I,d)},"matches"),toString:o(function(){return this.name},"toString")},o(function(I){var $=I.split(":");this.name=I,this.prefix=$.length>1?$[0]:null,this.localName=$[$.length>1?1:0]},"NameTestQName")),_.PITest=_.makeNodeTestType(_.PI,{matches:o(function(d,I){return _.isNodeType([S.PROCESSING_INSTRUCTION_NODE])(d)&&(d.target||d.nodeName)===this.name},"matches"),toString:o(function(){return h('processing-instruction("','")',this.name)},"toString")},function(d){this.name=d}),_.nameTestAny=_.makeNodeTypeTest(_.NAMETESTANY,[S.ELEMENT_NODE,S.ATTRIBUTE_NODE,Mr.XPATH_NAMESPACE_NODE],"*"),_.textTest=_.makeNodeTypeTest(_.TEXT,[S.TEXT_NODE,S.CDATA_SECTION_NODE],"text()"),_.commentTest=_.makeNodeTypeTest(_.COMMENT,[S.COMMENT_NODE],"comment()"),_.nodeTest=_.makeNodeTypeTest(_.NODE,[S.ELEMENT_NODE,S.ATTRIBUTE_NODE,S.TEXT_NODE,S.CDATA_SECTION_NODE,S.PROCESSING_INSTRUCTION_NODE,S.COMMENT_NODE,S.DOCUMENT_NODE],"node()"),_.anyPiTest=_.makeNodeTypeTest(_.PI,[S.PROCESSING_INSTRUCTION_NODE],"processing-instruction()"),ne.prototype=new A,ne.prototype.constructor=ne,ne.superclass=A.prototype;function ne(d){arguments.length>0&&this.init(d)}o(ne,"VariableReference"),ne.prototype.init=function(d){this.variable=d},ne.prototype.toString=function(){return"$"+this.variable},ne.prototype.evaluate=function(d){var I=Ze.resolveQName(this.variable,d.namespaceResolver,d.contextNode,!1);if(I[0]==null)throw new Error("Cannot resolve QName "+fn);var $=d.variableResolver.getVariable(I[1],I[0]);if(!$)throw _n.fromMessage("Undeclared variable: "+this.toString());return $},J.prototype=new A,J.prototype.constructor=J,J.superclass=A.prototype;function J(d,I){arguments.length>0&&this.init(d,I)}o(J,"FunctionCall"),J.prototype.init=function(d,I){this.functionName=d,this.arguments=I},J.prototype.toString=function(){for(var d=this.functionName+"(",I=0;I<this.arguments.length;I++)I>0&&(d+=", "),d+=this.arguments[I].toString();return d+")"},J.prototype.evaluate=function(d){var I=gs.getFunctionFromContext(this.functionName,d);if(!I)throw new Error("Unknown function "+this.functionName);var $=[d].concat(this.arguments);return I.apply(d.functionResolver.thisArg,$)};var Xe=new Object;Xe.equals=function(d,I){return d.equals(I)},Xe.notequal=function(d,I){return d.notequal(I)},Xe.lessthan=function(d,I){return d.lessthan(I)},Xe.greaterthan=function(d,I){return d.greaterthan(I)},Xe.lessthanorequal=function(d,I){return d.lessthanorequal(I)},Xe.greaterthanorequal=function(d,I){return d.greaterthanorequal(I)},Re.prototype=new A,Re.prototype.constructor=Re,Re.superclass=A.prototype;function Re(d){arguments.length>0&&this.init(d)}o(Re,"XString"),Re.prototype.init=function(d){this.str=String(d)},Re.prototype.toString=function(){return this.str},Re.prototype.evaluate=function(d){return this},Re.prototype.string=function(){return this},Re.prototype.number=function(){return new xe(this.str)},Re.prototype.bool=function(){return new je(this.str)},Re.prototype.nodeset=function(){throw new Error("Cannot convert string to nodeset")},Re.prototype.stringValue=function(){return this.str},Re.prototype.numberValue=function(){return this.number().numberValue()},Re.prototype.booleanValue=function(){return this.bool().booleanValue()},Re.prototype.equals=function(d){return Ze.instance_of(d,je)?this.bool().equals(d):Ze.instance_of(d,xe)?this.number().equals(d):Ze.instance_of(d,Ge)?d.compareWithString(this,Xe.equals):new je(this.str==d.str)},Re.prototype.notequal=function(d){return Ze.instance_of(d,je)?this.bool().notequal(d):Ze.instance_of(d,xe)?this.number().notequal(d):Ze.instance_of(d,Ge)?d.compareWithString(this,Xe.notequal):new je(this.str!=d.str)},Re.prototype.lessthan=function(d){return this.number().lessthan(d)},Re.prototype.greaterthan=function(d){return this.number().greaterthan(d)},Re.prototype.lessthanorequal=function(d){return this.number().lessthanorequal(d)},Re.prototype.greaterthanorequal=function(d){return this.number().greaterthanorequal(d)},xe.prototype=new A,xe.prototype.constructor=xe,xe.superclass=A.prototype;function xe(d){arguments.length>0&&this.init(d)}o(xe,"XNumber"),xe.prototype.init=function(d){this.num=typeof d=="string"?this.parse(d):Number(d)},xe.prototype.numberFormat=/^\s*-?[0-9]*\.?[0-9]+\s*$/,xe.prototype.parse=function(d){return this.numberFormat.test(d)?parseFloat(d):Number.NaN};function ct(d){for(var I=d.split("e-"),$=I[0].replace(".",""),te=Number(I[1]),ie=0;ie<te-1;ie+=1)$="0"+$;return"0."+$}o(ct,"padSmallNumber");function rr(d){for(var I=d.split("e"),$=I[0].replace(".",""),te=Number(I[1]),ie=te+1-$.length,X=0;X<ie;X+=1)$+="0";return $}o(rr,"padLargeNumber"),xe.prototype.toString=function(){var d=this.num.toString();return d.indexOf("e-")!==-1?ct(d):d.indexOf("e")!==-1?rr(d):d},xe.prototype.evaluate=function(d){return this},xe.prototype.string=function(){return new Re(this.toString())},xe.prototype.number=function(){return this},xe.prototype.bool=function(){return new je(this.num)},xe.prototype.nodeset=function(){throw new Error("Cannot convert number to nodeset")},xe.prototype.stringValue=function(){return this.string().stringValue()},xe.prototype.numberValue=function(){return this.num},xe.prototype.booleanValue=function(){return this.bool().booleanValue()},xe.prototype.negate=function(){return new xe(-this.num)},xe.prototype.equals=function(d){return Ze.instance_of(d,je)?this.bool().equals(d):Ze.instance_of(d,Re)?this.equals(d.number()):Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.equals):new je(this.num==d.num)},xe.prototype.notequal=function(d){return Ze.instance_of(d,je)?this.bool().notequal(d):Ze.instance_of(d,Re)?this.notequal(d.number()):Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.notequal):new je(this.num!=d.num)},xe.prototype.lessthan=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.greaterthan):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.lessthan(d.number()):new je(this.num<d.num)},xe.prototype.greaterthan=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.lessthan):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.greaterthan(d.number()):new je(this.num>d.num)},xe.prototype.lessthanorequal=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.greaterthanorequal):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.lessthanorequal(d.number()):new je(this.num<=d.num)},xe.prototype.greaterthanorequal=function(d){return Ze.instance_of(d,Ge)?d.compareWithNumber(this,Xe.lessthanorequal):Ze.instance_of(d,je)||Ze.instance_of(d,Re)?this.greaterthanorequal(d.number()):new je(this.num>=d.num)},xe.prototype.plus=function(d){return new xe(this.num+d.num)},xe.prototype.minus=function(d){return new xe(this.num-d.num)},xe.prototype.multiply=function(d){return new xe(this.num*d.num)},xe.prototype.div=function(d){return new xe(this.num/d.num)},xe.prototype.mod=function(d){return new xe(this.num%d.num)},je.prototype=new A,je.prototype.constructor=je,je.superclass=A.prototype;function je(d){arguments.length>0&&this.init(d)}o(je,"XBoolean"),je.prototype.init=function(d){this.b=!!d},je.prototype.toString=function(){return this.b.toString()},je.prototype.evaluate=function(d){return this},je.prototype.string=function(){return new Re(this.b)},je.prototype.number=function(){return new xe(this.b)},je.prototype.bool=function(){return this},je.prototype.nodeset=function(){throw new Error("Cannot convert boolean to nodeset")},je.prototype.stringValue=function(){return this.string().stringValue()},je.prototype.numberValue=function(){return this.number().numberValue()},je.prototype.booleanValue=function(){return this.b},je.prototype.not=function(){return new je(!this.b)},je.prototype.equals=function(d){return Ze.instance_of(d,Re)||Ze.instance_of(d,xe)?this.equals(d.bool()):Ze.instance_of(d,Ge)?d.compareWithBoolean(this,Xe.equals):new je(this.b==d.b)},je.prototype.notequal=function(d){return Ze.instance_of(d,Re)||Ze.instance_of(d,xe)?this.notequal(d.bool()):Ze.instance_of(d,Ge)?d.compareWithBoolean(this,Xe.notequal):new je(this.b!=d.b)},je.prototype.lessthan=function(d){return this.number().lessthan(d)},je.prototype.greaterthan=function(d){return this.number().greaterthan(d)},je.prototype.lessthanorequal=function(d){return this.number().lessthanorequal(d)},je.prototype.greaterthanorequal=function(d){return this.number().greaterthanorequal(d)},je.true_=new je(!0),je.false_=new je(!1),nr.prototype=new Object,nr.prototype.constructor=nr,nr.superclass=Object.prototype;function nr(d){this.init(d)}o(nr,"AVLTree"),nr.prototype.init=function(d){this.left=null,this.right=null,this.node=d,this.depth=1},nr.prototype.balance=function(){var d=this.left==null?0:this.left.depth,I=this.right==null?0:this.right.depth;if(d>I+1){var $=this.left.left==null?0:this.left.left.depth,te=this.left.right==null?0:this.left.right.depth;$<te&&this.left.rotateRR(),this.rotateLL()}else if(d+1<I){var ie=this.right.right==null?0:this.right.right.depth,X=this.right.left==null?0:this.right.left.depth;X>ie&&this.right.rotateLL(),this.rotateRR()}},nr.prototype.rotateLL=function(){var d=this.node,I=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=I,this.right.node=d,this.right.updateInNewLocation(),this.updateInNewLocation()},nr.prototype.rotateRR=function(){var d=this.node,I=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=I,this.left.node=d,this.left.updateInNewLocation(),this.updateInNewLocation()},nr.prototype.updateInNewLocation=function(){this.getDepthFromChildren()},nr.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 Vs(d,I){if(d===I)return 0;if(d.compareDocumentPosition){var $=d.compareDocumentPosition(I);return $&1||$&10?1:$&20?-1:0}for(var te=0,ie=0,X=d;X!=null;X=X.parentNode||X.ownerElement)te++;for(var nt=I;nt!=null;nt=nt.parentNode||nt.ownerElement)ie++;if(te>ie){for(;te>ie;)d=d.parentNode||d.ownerElement,te--;if(d===I)return 1}else if(ie>te){for(;ie>te;)I=I.parentNode||I.ownerElement,ie--;if(d===I)return-1}for(var kt=d.parentNode||d.ownerElement,Wt=I.parentNode||I.ownerElement;kt!==Wt;)d=kt,I=Wt,kt=d.parentNode||d.ownerElement,Wt=I.parentNode||I.ownerElement;var et=Ze.isAttribute(d),Dt=Ze.isAttribute(I);if(et&&!Dt)return-1;if(!et&&Dt)return 1;if(kt)for(var Rn=et?kt.attributes:kt.childNodes,ri=Rn.length,or=0;or<ri;or+=1){var la=Rn[or];if(la===d)return-1;if(la===I)return 1}throw new Error("Unexpected: could not determine node order")}o(Vs,"nodeOrder"),nr.prototype.add=function(d){if(d===this.node)return!1;var I=Vs(d,this.node),$=!1;return I==-1?this.left==null?(this.left=new nr(d),$=!0):($=this.left.add(d),$&&this.balance()):I==1&&(this.right==null?(this.right=new nr(d),$=!0):($=this.right.add(d),$&&this.balance())),$&&this.getDepthFromChildren(),$},Ge.prototype=new A,Ge.prototype.constructor=Ge,Ge.superclass=A.prototype;function Ge(){this.init()}o(Ge,"XNodeSet"),Ge.prototype.init=function(){this.tree=null,this.nodes=[],this.size=0},Ge.prototype.toString=function(){var d=this.first();return d==null?"":this.stringForNode(d)},Ge.prototype.evaluate=function(d){return this},Ge.prototype.string=function(){return new Re(this.toString())},Ge.prototype.stringValue=function(){return this.toString()},Ge.prototype.number=function(){return new xe(this.string())},Ge.prototype.numberValue=function(){return Number(this.string())},Ge.prototype.bool=function(){return new je(this.booleanValue())},Ge.prototype.booleanValue=function(){return!!this.size},Ge.prototype.nodeset=function(){return this},Ge.prototype.stringForNode=function(d){return d.nodeType==S.DOCUMENT_NODE||d.nodeType==S.ELEMENT_NODE||d.nodeType===S.DOCUMENT_FRAGMENT_NODE?this.stringForContainerNode(d):d.nodeType===S.ATTRIBUTE_NODE?d.value||d.nodeValue:d.isNamespaceNode?d.namespace:d.nodeValue},Ge.prototype.stringForContainerNode=function(d){for(var I="",$=d.firstChild;$!=null;$=$.nextSibling){var te=$.nodeType;(te===1||te===3||te===4||te===9||te===11)&&(I+=this.stringForNode($))}return I},Ge.prototype.buildTree=function(){if(!this.tree&&this.nodes.length){this.tree=new nr(this.nodes[0]);for(var d=1;d<this.nodes.length;d+=1)this.tree.add(this.nodes[d])}return this.tree},Ge.prototype.first=function(){var d=this.buildTree();if(d==null)return null;for(;d.left!=null;)d=d.left;return d.node},Ge.prototype.add=function(d){for(var I=0;I<this.nodes.length;I+=1)if(d===this.nodes[I])return;this.tree=null,this.nodes.push(d),this.size+=1},Ge.prototype.addArray=function(d){var I=this;t(function($){I.add($)},d)},Ge.prototype.toArray=function(){var d=[];return this.toArrayRec(this.buildTree(),d),d},Ge.prototype.toArrayRec=function(d,I){d!=null&&(this.toArrayRec(d.left,I),I.push(d.node),this.toArrayRec(d.right,I))},Ge.prototype.toUnsortedArray=function(){return this.nodes.slice()},Ge.prototype.compareWithString=function(d,I){for(var $=this.toUnsortedArray(),te=0;te<$.length;te++){var ie=$[te],X=new Re(this.stringForNode(ie)),nt=I(X,d);if(nt.booleanValue())return nt}return new je(!1)},Ge.prototype.compareWithNumber=function(d,I){for(var $=this.toUnsortedArray(),te=0;te<$.length;te++){var ie=$[te],X=new xe(this.stringForNode(ie)),nt=I(X,d);if(nt.booleanValue())return nt}return new je(!1)},Ge.prototype.compareWithBoolean=function(d,I){return I(this.bool(),d)},Ge.prototype.compareWithNodeSet=function(d,I){for(var $=this.toUnsortedArray(),te=o(function(kt,Wt){return I(Wt,kt)},"oInvert"),ie=0;ie<$.length;ie++){var X=new Re(this.stringForNode($[ie])),nt=d.compareWithString(X,te);if(nt.booleanValue())return nt}return new je(!1)},Ge.compareWith=e(function(d,I){return Ze.instance_of(I,Re)?this.compareWithString(I,d):Ze.instance_of(I,xe)?this.compareWithNumber(I,d):Ze.instance_of(I,je)?this.compareWithBoolean(I,d):this.compareWithNodeSet(I,d)}),Ge.prototype.equals=Ge.compareWith(Xe.equals),Ge.prototype.notequal=Ge.compareWith(Xe.notequal),Ge.prototype.lessthan=Ge.compareWith(Xe.lessthan),Ge.prototype.greaterthan=Ge.compareWith(Xe.greaterthan),Ge.prototype.lessthanorequal=Ge.compareWith(Xe.lessthanorequal),Ge.prototype.greaterthanorequal=Ge.compareWith(Xe.greaterthanorequal),Ge.prototype.union=function(d){var I=new Ge;return I.addArray(this.toUnsortedArray()),I.addArray(d.toUnsortedArray()),I},Mr.prototype=new Object,Mr.prototype.constructor=Mr,Mr.superclass=Object.prototype;function Mr(d,I,$){this.isXPathNamespace=!0,this.ownerDocument=$.ownerDocument,this.nodeName="#namespace",this.prefix=d,this.localName=d,this.namespaceURI=I,this.nodeValue=I,this.ownerElement=$,this.nodeType=Mr.XPATH_NAMESPACE_NODE}o(Mr,"XPathNamespace"),Mr.prototype.toString=function(){return'{ "'+this.prefix+'", "'+this.namespaceURI+'" }'},un.prototype=new Object,un.prototype.constructor=un,un.superclass=Object.prototype;function un(d,I,$){this.variableResolver=d??new Xn,this.namespaceResolver=I??new ss,this.functionResolver=$??new gs}o(un,"XPathContext"),un.prototype.extend=function(d){return y(new un,this,d)},Xn.prototype=new Object,Xn.prototype.constructor=Xn,Xn.superclass=Object.prototype;function Xn(){}o(Xn,"VariableResolver"),Xn.prototype.getVariable=function(d,I){return null},gs.prototype=new Object,gs.prototype.constructor=gs,gs.superclass=Object.prototype;function gs(d){this.thisArg=d??pt,this.functions=new Object,this.addStandardFunctions()}o(gs,"FunctionResolver"),gs.prototype.addStandardFunctions=function(){this.functions["{}last"]=pt.last,this.functions["{}position"]=pt.position,this.functions["{}count"]=pt.count,this.functions["{}id"]=pt.id,this.functions["{}local-name"]=pt.localName,this.functions["{}namespace-uri"]=pt.namespaceURI,this.functions["{}name"]=pt.name,this.functions["{}string"]=pt.string,this.functions["{}concat"]=pt.concat,this.functions["{}starts-with"]=pt.startsWith,this.functions["{}contains"]=pt.contains,this.functions["{}substring-before"]=pt.substringBefore,this.functions["{}substring-after"]=pt.substringAfter,this.functions["{}substring"]=pt.substring,this.functions["{}string-length"]=pt.stringLength,this.functions["{}normalize-space"]=pt.normalizeSpace,this.functions["{}translate"]=pt.translate,this.functions["{}boolean"]=pt.boolean_,this.functions["{}not"]=pt.not,this.functions["{}true"]=pt.true_,this.functions["{}false"]=pt.false_,this.functions["{}lang"]=pt.lang,this.functions["{}number"]=pt.number,this.functions["{}sum"]=pt.sum,this.functions["{}floor"]=pt.floor,this.functions["{}ceiling"]=pt.ceiling,this.functions["{}round"]=pt.round},gs.prototype.addFunction=function(d,I,$){this.functions["{"+d+"}"+I]=$},gs.getFunctionFromContext=function(d,I){var $=Ze.resolveQName(d,I.namespaceResolver,I.contextNode,!1);if($[0]===null)throw new Error("Cannot resolve QName "+name);return I.functionResolver.getFunction($[1],$[0])},gs.prototype.getFunction=function(d,I){return this.functions["{"+I+"}"+d]},ss.prototype=new Object,ss.prototype.constructor=ss,ss.superclass=Object.prototype;function ss(){}o(ss,"NamespaceResolver"),ss.prototype.getNamespace=function(d,I){if(d=="xml")return b.XML_NAMESPACE_URI;if(d=="xmlns")return b.XMLNS_NAMESPACE_URI;for(I.nodeType==S.DOCUMENT_NODE?I=I.documentElement:I.nodeType==S.ATTRIBUTE_NODE?I=we.getOwnerElement(I):I.nodeType!=S.ELEMENT_NODE&&(I=I.parentNode);I!=null&&I.nodeType==S.ELEMENT_NODE;){for(var $=I.attributes,te=0;te<$.length;te++){var ie=$.item(te),X=ie.name||ie.nodeName;if(X==="xmlns"&&d===""||X==="xmlns:"+d)return String(ie.value||ie.nodeValue)}I=I.parentNode}return null};var pt=new Object;pt.last=function(d){if(arguments.length!=1)throw new Error("Function last expects ()");return new xe(d.contextSize)},pt.position=function(d){if(arguments.length!=1)throw new Error("Function position expects ()");return new xe(d.contextPosition)},pt.count=function(){var d=arguments[0],I;if(arguments.length!=2||!Ze.instance_of(I=arguments[1].evaluate(d),Ge))throw new Error("Function count expects (node-set)");return new xe(I.size)},pt.id=function(){var d=arguments[0],I;if(arguments.length!=2)throw new Error("Function id expects (object)");I=arguments[1].evaluate(d),Ze.instance_of(I,Ge)?I=I.toArray().join(" "):I=I.stringValue();for(var $=I.split(/[\x0d\x0a\x09\x20]+/),te=0,ie=new Ge,X=d.contextNode.nodeType==S.DOCUMENT_NODE?d.contextNode:d.contextNode.ownerDocument,nt=0;nt<$.length;nt++){var kt;X.getElementById?kt=X.getElementById($[nt]):kt=Ze.getElementById(X,$[nt]),kt!=null&&(ie.add(kt),te++)}return ie},pt.localName=function(d,I){var $;if(arguments.length==1)$=d.contextNode;else if(arguments.length==2)$=I.evaluate(d).first();else throw new Error("Function local-name expects (node-set?)");return $==null?new Re(""):new Re($.localName||$.baseName||$.target||$.nodeName||"")},pt.namespaceURI=function(){var d=arguments[0],I;if(arguments.length==1)I=d.contextNode;else if(arguments.length==2)I=arguments[1].evaluate(d).first();else throw new Error("Function namespace-uri expects (node-set?)");return I==null?new Re(""):new Re(I.namespaceURI)},pt.name=function(){var d=arguments[0],I;if(arguments.length==1)I=d.contextNode;else if(arguments.length==2)I=arguments[1].evaluate(d).first();else throw new Error("Function name expects (node-set?)");return I==null?new Re(""):I.nodeType==S.ELEMENT_NODE?new Re(I.nodeName):I.nodeType==S.ATTRIBUTE_NODE?new Re(I.name||I.nodeName):I.nodeType===S.PROCESSING_INSTRUCTION_NODE?new Re(I.target||I.nodeName):I.localName==null?new Re(""):new Re(I.localName)},pt.string=function(){var d=arguments[0];if(arguments.length==1)return new Re(Ge.prototype.stringForNode(d.contextNode));if(arguments.length==2)return arguments[1].evaluate(d).string();throw new Error("Function string expects (object?)")},pt.concat=function(d){if(arguments.length<3)throw new Error("Function concat expects (string, string[, string]*)");for(var I="",$=1;$<arguments.length;$++)I+=arguments[$].evaluate(d).stringValue();return new Re(I)},pt.startsWith=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function startsWith expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new je(I.substring(0,$.length)==$)},pt.contains=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function contains expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new je(I.indexOf($)!==-1)},pt.substringBefore=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function substring-before expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();return new Re(I.substring(0,I.indexOf($)))},pt.substringAfter=function(){var d=arguments[0];if(arguments.length!=3)throw new Error("Function substring-after expects (string, string)");var I=arguments[1].evaluate(d).stringValue(),$=arguments[2].evaluate(d).stringValue();if($.length==0)return new Re(I);var te=I.indexOf($);return te==-1?new Re(""):new Re(I.substring(te+$.length))},pt.substring=function(){var d=arguments[0];if(!(arguments.length==3||arguments.length==4))throw new Error("Function substring expects (string, number, number?)");var I=arguments[1].evaluate(d).stringValue(),$=Math.round(arguments[2].evaluate(d).numberValue())-1,te=arguments.length==4?$+Math.round(arguments[3].evaluate(d).numberValue()):void 0;return new Re(I.substring($,te))},pt.stringLength=function(){var d=arguments[0],I;if(arguments.length==1)I=Ge.prototype.stringForNode(d.contextNode);else if(arguments.length==2)I=arguments[1].evaluate(d).stringValue();else throw new Error("Function string-length expects (string?)");return new xe(I.length)},pt.normalizeSpace=function(){var d=arguments[0],I;if(arguments.length==1)I=Ge.prototype.stringForNode(d.contextNode);else if(arguments.length==2)I=arguments[1].evaluate(d).stringValue();else throw new Error("Function normalize-space expects (string?)");for(var $=0,te=I.length-1;Ze.isSpace(I.charCodeAt(te));)te--;for(var ie="";$<=te&&Ze.isSpace(I.charCodeAt($));)$++;for(;$<=te;)if(Ze.isSpace(I.charCodeAt($)))for(ie+=" ";$<=te&&Ze.isSpace(I.charCodeAt($));)$++;else ie+=I.charAt($),$++;return new Re(ie)},pt.translate=function(d,I,$,te){if(arguments.length!=4)throw new Error("Function translate expects (string, string, string)");var ie=I.evaluate(d).stringValue(),X=$.evaluate(d).stringValue(),nt=te.evaluate(d).stringValue(),kt=n(function(et,Dt,Rn){return Dt in et||(et[Dt]=Rn>nt.length?"":nt[Rn]),et},{},X),Wt=f("",s(function(et){return et in kt?kt[et]:et},ie));return new Re(Wt)},pt.boolean_=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function boolean expects (object)");return arguments[1].evaluate(d).bool()},pt.not=function(d,I){if(arguments.length!=2)throw new Error("Function not expects (object)");return I.evaluate(d).bool().not()},pt.true_=function(){if(arguments.length!=1)throw new Error("Function true expects ()");return je.true_},pt.false_=function(){if(arguments.length!=1)throw new Error("Function false expects ()");return je.false_},pt.lang=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function lang expects (string)");for(var I,$=d.contextNode;$!=null&&$.nodeType!=S.DOCUMENT_NODE;$=$.parentNode){var te=$.getAttributeNS(b.XML_NAMESPACE_URI,"lang");if(te!=null){I=String(te);break}}if(I==null)return je.false_;var ie=arguments[1].evaluate(d).stringValue();return new je(I.substring(0,ie.length)==ie&&(I.length==ie.length||I.charAt(ie.length)=="-"))},pt.number=function(){var d=arguments[0];if(!(arguments.length==1||arguments.length==2))throw new Error("Function number expects (object?)");return arguments.length==1?new xe(Ge.prototype.stringForNode(d.contextNode)):arguments[1].evaluate(d).number()},pt.sum=function(){var d=arguments[0],I;if(arguments.length!=2||!Ze.instance_of(I=arguments[1].evaluate(d),Ge))throw new Error("Function sum expects (node-set)");I=I.toUnsortedArray();for(var $=0,te=0;te<I.length;te++)$+=new xe(Ge.prototype.stringForNode(I[te])).numberValue();return new xe($)},pt.floor=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function floor expects (number)");return new xe(Math.floor(arguments[1].evaluate(d).numberValue()))},pt.ceiling=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function ceiling expects (number)");return new xe(Math.ceil(arguments[1].evaluate(d).numberValue()))},pt.round=function(){var d=arguments[0];if(arguments.length!=2)throw new Error("Function round expects (number)");return new xe(Math.round(arguments[1].evaluate(d).numberValue()))};var Ze=new Object;Ze.isAttribute=function(d){return d&&(d.nodeType===S.ATTRIBUTE_NODE||d.ownerElement)},Ze.splitQName=function(d){var I=d.indexOf(":");return I==-1?[null,d]:[d.substring(0,I),d.substring(I+1)]},Ze.resolveQName=function(d,I,$,te){var ie=Ze.splitQName(d);return ie[0]!=null?ie[0]=I.getNamespace(ie[0],$):te?(ie[0]=I.getNamespace("",$),ie[0]==null&&(ie[0]="")):ie[0]="",ie},Ze.isSpace=function(d){return d==9||d==13||d==10||d==32},Ze.isLetter=function(d){return d>=65&&d<=90||d>=97&&d<=122||d>=192&&d<=214||d>=216&&d<=246||d>=248&&d<=255||d>=256&&d<=305||d>=308&&d<=318||d>=321&&d<=328||d>=330&&d<=382||d>=384&&d<=451||d>=461&&d<=496||d>=500&&d<=501||d>=506&&d<=535||d>=592&&d<=680||d>=699&&d<=705||d==902||d>=904&&d<=906||d==908||d>=910&&d<=929||d>=931&&d<=974||d>=976&&d<=982||d==986||d==988||d==990||d==992||d>=994&&d<=1011||d>=1025&&d<=1036||d>=1038&&d<=1103||d>=1105&&d<=1116||d>=1118&&d<=1153||d>=1168&&d<=1220||d>=1223&&d<=1224||d>=1227&&d<=1228||d>=1232&&d<=1259||d>=1262&&d<=1269||d>=1272&&d<=1273||d>=1329&&d<=1366||d==1369||d>=1377&&d<=1414||d>=1488&&d<=1514||d>=1520&&d<=1522||d>=1569&&d<=1594||d>=1601&&d<=1610||d>=1649&&d<=1719||d>=1722&&d<=1726||d>=1728&&d<=1742||d>=1744&&d<=1747||d==1749||d>=1765&&d<=1766||d>=2309&&d<=2361||d==2365||d>=2392&&d<=2401||d>=2437&&d<=2444||d>=2447&&d<=2448||d>=2451&&d<=2472||d>=2474&&d<=2480||d==2482||d>=2486&&d<=2489||d>=2524&&d<=2525||d>=2527&&d<=2529||d>=2544&&d<=2545||d>=2565&&d<=2570||d>=2575&&d<=2576||d>=2579&&d<=2600||d>=2602&&d<=2608||d>=2610&&d<=2611||d>=2613&&d<=2614||d>=2616&&d<=2617||d>=2649&&d<=2652||d==2654||d>=2674&&d<=2676||d>=2693&&d<=2699||d==2701||d>=2703&&d<=2705||d>=2707&&d<=2728||d>=2730&&d<=2736||d>=2738&&d<=2739||d>=2741&&d<=2745||d==2749||d==2784||d>=2821&&d<=2828||d>=2831&&d<=2832||d>=2835&&d<=2856||d>=2858&&d<=2864||d>=2866&&d<=2867||d>=2870&&d<=2873||d==2877||d>=2908&&d<=2909||d>=2911&&d<=2913||d>=2949&&d<=2954||d>=2958&&d<=2960||d>=2962&&d<=2965||d>=2969&&d<=2970||d==2972||d>=2974&&d<=2975||d>=2979&&d<=2980||d>=2984&&d<=2986||d>=2990&&d<=2997||d>=2999&&d<=3001||d>=3077&&d<=3084||d>=3086&&d<=3088||d>=3090&&d<=3112||d>=3114&&d<=3123||d>=3125&&d<=3129||d>=3168&&d<=3169||d>=3205&&d<=3212||d>=3214&&d<=3216||d>=3218&&d<=3240||d>=3242&&d<=3251||d>=3253&&d<=3257||d==3294||d>=3296&&d<=3297||d>=3333&&d<=3340||d>=3342&&d<=3344||d>=3346&&d<=3368||d>=3370&&d<=3385||d>=3424&&d<=3425||d>=3585&&d<=3630||d==3632||d>=3634&&d<=3635||d>=3648&&d<=3653||d>=3713&&d<=3714||d==3716||d>=3719&&d<=3720||d==3722||d==3725||d>=3732&&d<=3735||d>=3737&&d<=3743||d>=3745&&d<=3747||d==3749||d==3751||d>=3754&&d<=3755||d>=3757&&d<=3758||d==3760||d>=3762&&d<=3763||d==3773||d>=3776&&d<=3780||d>=3904&&d<=3911||d>=3913&&d<=3945||d>=4256&&d<=4293||d>=4304&&d<=4342||d==4352||d>=4354&&d<=4355||d>=4357&&d<=4359||d==4361||d>=4363&&d<=4364||d>=4366&&d<=4370||d==4412||d==4414||d==4416||d==4428||d==4430||d==4432||d>=4436&&d<=4437||d==4441||d>=4447&&d<=4449||d==4451||d==4453||d==4455||d==4457||d>=4461&&d<=4462||d>=4466&&d<=4467||d==4469||d==4510||d==4520||d==4523||d>=4526&&d<=4527||d>=4535&&d<=4536||d==4538||d>=4540&&d<=4546||d==4587||d==4592||d==4601||d>=7680&&d<=7835||d>=7840&&d<=7929||d>=7936&&d<=7957||d>=7960&&d<=7965||d>=7968&&d<=8005||d>=8008&&d<=8013||d>=8016&&d<=8023||d==8025||d==8027||d==8029||d>=8031&&d<=8061||d>=8064&&d<=8116||d>=8118&&d<=8124||d==8126||d>=8130&&d<=8132||d>=8134&&d<=8140||d>=8144&&d<=8147||d>=8150&&d<=8155||d>=8160&&d<=8172||d>=8178&&d<=8180||d>=8182&&d<=8188||d==8486||d>=8490&&d<=8491||d==8494||d>=8576&&d<=8578||d>=12353&&d<=12436||d>=12449&&d<=12538||d>=12549&&d<=12588||d>=44032&&d<=55203||d>=19968&&d<=40869||d==12295||d>=12321&&d<=12329},Ze.isNCNameChar=function(d){return d>=48&&d<=57||d>=1632&&d<=1641||d>=1776&&d<=1785||d>=2406&&d<=2415||d>=2534&&d<=2543||d>=2662&&d<=2671||d>=2790&&d<=2799||d>=2918&&d<=2927||d>=3047&&d<=3055||d>=3174&&d<=3183||d>=3302&&d<=3311||d>=3430&&d<=3439||d>=3664&&d<=3673||d>=3792&&d<=3801||d>=3872&&d<=3881||d==46||d==45||d==95||Ze.isLetter(d)||d>=768&&d<=837||d>=864&&d<=865||d>=1155&&d<=1158||d>=1425&&d<=1441||d>=1443&&d<=1465||d>=1467&&d<=1469||d==1471||d>=1473&&d<=1474||d==1476||d>=1611&&d<=1618||d==1648||d>=1750&&d<=1756||d>=1757&&d<=1759||d>=1760&&d<=1764||d>=1767&&d<=1768||d>=1770&&d<=1773||d>=2305&&d<=2307||d==2364||d>=2366&&d<=2380||d==2381||d>=2385&&d<=2388||d>=2402&&d<=2403||d>=2433&&d<=2435||d==2492||d==2494||d==2495||d>=2496&&d<=2500||d>=2503&&d<=2504||d>=2507&&d<=2509||d==2519||d>=2530&&d<=2531||d==2562||d==2620||d==2622||d==2623||d>=2624&&d<=2626||d>=2631&&d<=2632||d>=2635&&d<=2637||d>=2672&&d<=2673||d>=2689&&d<=2691||d==2748||d>=2750&&d<=2757||d>=2759&&d<=2761||d>=2763&&d<=2765||d>=2817&&d<=2819||d==2876||d>=2878&&d<=2883||d>=2887&&d<=2888||d>=2891&&d<=2893||d>=2902&&d<=2903||d>=2946&&d<=2947||d>=3006&&d<=3010||d>=3014&&d<=3016||d>=3018&&d<=3021||d==3031||d>=3073&&d<=3075||d>=3134&&d<=3140||d>=3142&&d<=3144||d>=3146&&d<=3149||d>=3157&&d<=3158||d>=3202&&d<=3203||d>=3262&&d<=3268||d>=3270&&d<=3272||d>=3274&&d<=3277||d>=3285&&d<=3286||d>=3330&&d<=3331||d>=3390&&d<=3395||d>=3398&&d<=3400||d>=3402&&d<=3405||d==3415||d==3633||d>=3636&&d<=3642||d>=3655&&d<=3662||d==3761||d>=3764&&d<=3769||d>=3771&&d<=3772||d>=3784&&d<=3789||d>=3864&&d<=3865||d==3893||d==3895||d==3897||d==3902||d==3903||d>=3953&&d<=3972||d>=3974&&d<=3979||d>=3984&&d<=3989||d==3991||d>=3993&&d<=4013||d>=4017&&d<=4023||d==4025||d>=8400&&d<=8412||d==8417||d>=12330&&d<=12335||d==12441||d==12442||d==183||d==720||d==721||d==903||d==1600||d==3654||d==3782||d==12293||d>=12337&&d<=12341||d>=12445&&d<=12446||d>=12540&&d<=12542},Ze.coalesceText=function(d){for(var I=d.firstChild;I!=null;I=I.nextSibling)if(I.nodeType==S.TEXT_NODE||I.nodeType==S.CDATA_SECTION_NODE){var $=I.nodeValue,te=I;for(I=I.nextSibling;I!=null&&(I.nodeType==S.TEXT_NODE||I.nodeType==S.CDATA_SECTION_NODE);){$+=I.nodeValue;var ie=I;I=I.nextSibling,ie.parentNode.removeChild(ie)}if(te.nodeType==S.CDATA_SECTION_NODE){var X=te.parentNode;if(te.nextSibling==null)X.removeChild(te),X.appendChild(X.ownerDocument.createTextNode($));else{var nt=te.nextSibling;X.removeChild(te),X.insertBefore(X.ownerDocument.createTextNode($),nt)}}else te.nodeValue=$;if(I==null)break}else I.nodeType==S.ELEMENT_NODE&&Ze.coalesceText(I)},Ze.instance_of=function(d,I){for(;d!=null;){if(d.constructor===I)return!0;if(d===Object)return!1;d=d.constructor.superclass}return!1},Ze.getElementById=function(d,I){if(d.nodeType==S.ELEMENT_NODE&&(d.getAttribute("id")==I||d.getAttributeNS(null,"id")==I))return d;for(var $=d.firstChild;$!=null;$=$.nextSibling){var te=Ze.getElementById($,I);if(te!=null)return te}return null};var _n=(function(){function d($,te){var ie=te?": "+te.toString():"";switch($){case I.INVALID_EXPRESSION_ERR:return"Invalid expression"+ie;case I.TYPE_ERR:return"Type error"+ie}return null}o(d,"getMessage");function I($,te,ie){var X=Error.call(this,d($,te)||ie);return X.code=$,X.exception=te,X}return o(I,"XPathException"),I.prototype=Object.create(Error.prototype),I.prototype.constructor=I,I.superclass=Error,I.prototype.toString=function(){return this.message},I.fromMessage=function($,te){return new I(null,te,$)},I.INVALID_EXPRESSION_ERR=51,I.TYPE_ERR=52,I})();is.prototype={},is.prototype.constructor=is,is.superclass=Object.prototype;function is(d,I,$){this.xpath=$.parse(d),this.context=new un,this.context.namespaceResolver=new oa(I)}o(is,"XPathExpression"),is.getOwnerDocument=function(d){return d.nodeType===S.DOCUMENT_NODE?d:d.ownerDocument},is.detectHtmlDom=function(d){if(!d)return!1;var I=is.getOwnerDocument(d);try{return I.implementation.hasFeature("HTML","2.0")}catch{return!0}},is.prototype.evaluate=function(d,I,$){this.context.expressionContextNode=d,this.context.caseInsensitive=is.detectHtmlDom(d);var te=this.xpath.evaluate(this.context);return new Rt(te,I)},oa.prototype={},oa.prototype.constructor=oa,oa.superclass=Object.prototype;function oa(d){this.xpathNSResolver=d}o(oa,"XPathNSResolverWrapper"),oa.prototype.getNamespace=function(d,I){return this.xpathNSResolver==null?null:this.xpathNSResolver.lookupNamespaceURI(d)},ua.prototype={},ua.prototype.constructor=ua,ua.superclass=Object.prototype;function ua(d){this.node=d,this.namespaceResolver=new ss}o(ua,"NodeXPathNSResolver"),ua.prototype.lookupNamespaceURI=function(d){return this.namespaceResolver.getNamespace(d,this.node)},Rt.prototype={},Rt.prototype.constructor=Rt,Rt.superclass=Object.prototype;function Rt(d,I){switch(I==Rt.ANY_TYPE&&(d.constructor===Re?I=Rt.STRING_TYPE:d.constructor===xe?I=Rt.NUMBER_TYPE:d.constructor===je?I=Rt.BOOLEAN_TYPE:d.constructor===Ge&&(I=Rt.UNORDERED_NODE_ITERATOR_TYPE)),this.resultType=I,I){case Rt.NUMBER_TYPE:this.numberValue=d.numberValue();return;case Rt.STRING_TYPE:this.stringValue=d.stringValue();return;case Rt.BOOLEAN_TYPE:this.booleanValue=d.booleanValue();return;case Rt.ANY_UNORDERED_NODE_TYPE:case Rt.FIRST_ORDERED_NODE_TYPE:if(d.constructor===Ge){this.singleNodeValue=d.first();return}break;case Rt.UNORDERED_NODE_ITERATOR_TYPE:case Rt.ORDERED_NODE_ITERATOR_TYPE:if(d.constructor===Ge){this.invalidIteratorState=!1,this.nodes=d.toArray(),this.iteratorIndex=0;return}break;case Rt.UNORDERED_NODE_SNAPSHOT_TYPE:case Rt.ORDERED_NODE_SNAPSHOT_TYPE:if(d.constructor===Ge){this.nodes=d.toArray(),this.snapshotLength=this.nodes.length;return}break}throw new _n(_n.TYPE_ERR)}o(Rt,"XPathResult"),Rt.prototype.iterateNext=function(){if(this.resultType!=Rt.UNORDERED_NODE_ITERATOR_TYPE&&this.resultType!=Rt.ORDERED_NODE_ITERATOR_TYPE)throw new _n(_n.TYPE_ERR);return this.nodes[this.iteratorIndex++]},Rt.prototype.snapshotItem=function(d){if(this.resultType!=Rt.UNORDERED_NODE_SNAPSHOT_TYPE&&this.resultType!=Rt.ORDERED_NODE_SNAPSHOT_TYPE)throw new _n(_n.TYPE_ERR);return this.nodes[d]},Rt.ANY_TYPE=0,Rt.NUMBER_TYPE=1,Rt.STRING_TYPE=2,Rt.BOOLEAN_TYPE=3,Rt.UNORDERED_NODE_ITERATOR_TYPE=4,Rt.ORDERED_NODE_ITERATOR_TYPE=5,Rt.UNORDERED_NODE_SNAPSHOT_TYPE=6,Rt.ORDERED_NODE_SNAPSHOT_TYPE=7,Rt.ANY_UNORDERED_NODE_TYPE=8,Rt.FIRST_ORDERED_NODE_TYPE=9;function vh(d,I){d.createExpression=function($,te){try{return new is($,te,I)}catch(ie){throw new _n(_n.INVALID_EXPRESSION_ERR,ie)}},d.createNSResolver=function($){return new ua($)},d.evaluate=function($,te,ie,X,nt){if(X<0||X>9)throw{code:0,toString:o(function(){return"Request type not supported"},"toString")};return d.createExpression($,ie,I).evaluate(te,X,nt)}}o(vh,"installDOM3XPathSupport");try{var wh=!0;try{document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("XPath",null)&&(wh=!1)}catch{}wh&&vh(document,new E)}catch{}vh(r,new E),(function(){var d=new E,I=new ss,$=new gs,te=new Xn;function ie(qe){return{getNamespace:o(function(Zt,Gn){var ki=qe(Zt,Gn);return ki||I.getNamespace(Zt,Gn)},"getNamespace")}}o(ie,"makeNSResolverFromFunction");function X(qe){return ie(qe.getNamespace.bind(qe))}o(X,"makeNSResolverFromObject");function nt(qe){return ie(function(Zt){return qe[Zt]})}o(nt,"makeNSResolverFromMap");function kt(qe){return qe&&typeof qe.getNamespace=="function"?X(qe):typeof qe=="function"?ie(qe):typeof qe=="object"?nt(qe):I}o(kt,"makeNSResolver");function Wt(qe){if(qe===null||typeof qe>"u"||qe instanceof Re||qe instanceof je||qe instanceof xe||qe instanceof Ge)return qe;switch(typeof qe){case"string":return new Re(qe);case"boolean":return new je(qe);case"number":return new xe(qe)}var Zt=new Ge;return Zt.addArray([].concat(qe)),Zt}o(Wt,"convertValue");function et(qe){return function(Zt){var Gn=Array.prototype.slice.call(arguments,1).map(function(v2){return v2.evaluate(Zt)}),ki=qe.apply(this,[].concat(Zt,Gn));return Wt(ki)}}o(et,"makeEvaluator");function Dt(qe){return{getFunction:o(function(Zt,Gn){var ki=qe(Zt,Gn);return ki?et(ki):$.getFunction(Zt,Gn)},"getFunction")}}o(Dt,"makeFunctionResolverFromFunction");function Rn(qe){return Dt(qe.getFunction.bind(qe))}o(Rn,"makeFunctionResolverFromObject");function ri(qe){return Dt(function(Zt){return qe[Zt]})}o(ri,"makeFunctionResolverFromMap");function or(qe){return qe&&typeof qe.getFunction=="function"?Rn(qe):typeof qe=="function"?Dt(qe):typeof qe=="object"?ri(qe):$}o(or,"makeFunctionResolver");function la(qe){return{getVariable:o(function(Zt,Gn){var ki=qe(Zt,Gn);return Wt(ki)},"getVariable")}}o(la,"makeVariableResolverFromFunction");function Z0(qe){if(qe){if(typeof qe.getVariable=="function")return la(qe.getVariable.bind(qe));if(typeof qe=="function")return la(qe);if(typeof qe=="object")return la(function(Zt){return qe[Zt]})}return te}o(Z0,"makeVariableResolver");function xv(qe,Zt,Gn){qe in Gn&&(Zt[qe]=Gn[qe])}o(xv,"copyIfPresent");function d2(qe){var Zt=new un;return qe?(Zt.namespaceResolver=kt(qe.namespaces),Zt.functionResolver=or(qe.functions),Zt.variableResolver=Z0(qe.variables),Zt.expressionContextNode=qe.node,xv("allowAnyNamespaceForNoPrefix",Zt,qe),xv("isHtml",Zt,qe)):Zt.namespaceResolver=I,Zt}o(d2,"makeContext");function m2(qe,Zt){var Gn=d2(Zt);return qe.evaluate(Gn)}o(m2,"evaluate");var g2={evaluate:o(function(qe){return m2(this.expression,qe)},"evaluate"),evaluateNumber:o(function(qe){return this.evaluate(qe).numberValue()},"evaluateNumber"),evaluateString:o(function(qe){return this.evaluate(qe).stringValue()},"evaluateString"),evaluateBoolean:o(function(qe){return this.evaluate(qe).booleanValue()},"evaluateBoolean"),evaluateNodeSet:o(function(qe){return this.evaluate(qe).nodeset()},"evaluateNodeSet"),select:o(function(qe){return this.evaluateNodeSet(qe).toArray()},"select"),select1:o(function(qe){return this.select(qe)[0]},"select1")};function y2(qe){var Zt=d.parse(qe);return Object.create(g2,{expression:{value:Zt}})}o(y2,"parse"),r.parse=y2})(),y(r,{XPath:b,XPathParser:E,XPathResult:Rt,Step:O,PathExpr:we,NodeTest:_,LocationPath:lt,OrOperation:F,AndOperation:R,BarOperation:be,EqualsOperation:H,NotEqualOperation:q,LessThanOperation:K,GreaterThanOperation:G,LessThanOrEqualOperation:he,GreaterThanOrEqualOperation:le,PlusOperation:oe,MinusOperation:Z,MultiplyOperation:fe,DivOperation:Se,ModOperation:Ke,UnaryMinusOperation:x,FunctionCall:J,VariableReference:ne,XPathContext:un,XNodeSet:Ge,XBoolean:je,XString:Re,XNumber:xe,NamespaceResolver:ss,FunctionResolver:gs,VariableResolver:Xn,Utilities:Ze}),r.select=function(d,I,$){return r.selectWithResolver(d,I,null,$)},r.useNamespaces=function(d){var I={mappings:d||{},lookupNamespaceURI:o(function($){return this.mappings[$]},"lookupNamespaceURI")};return function($,te,ie){return r.selectWithResolver($,te,I,ie)}},r.selectWithResolver=function(d,I,$,te){var ie=new is(d,$,new E),X=Rt.ANY_TYPE,nt=ie.evaluate(I,X,null);return nt.resultType==Rt.STRING_TYPE?nt=nt.stringValue:nt.resultType==Rt.NUMBER_TYPE?nt=nt.numberValue:nt.resultType==Rt.BOOLEAN_TYPE?nt=nt.booleanValue:(nt=nt.nodes,te&&(nt=nt[0])),nt},r.select1=function(d,I){return r.select(d,I,!0)};var rc=o(function(d){return d&&typeof d.nodeType=="number"&&Number.isInteger(d.nodeType)&&d.nodeType>=1&&d.nodeType<=11&&typeof d.nodeName=="string"},"isNodeLike"),Q0=o(function(d){return Array.isArray(d)&&d.every(rc)},"isArrayOfNodes"),Us=o(function(d){return function(I){return rc(I)&&I.nodeType===d}},"isNodeOfType");y(r,{isNodeLike:rc,isArrayOfNodes:Q0,isElement:Us(S.ELEMENT_NODE),isAttribute:Us(S.ATTRIBUTE_NODE),isTextNode:Us(S.TEXT_NODE),isCDATASection:Us(S.CDATA_SECTION_NODE),isProcessingInstruction:Us(S.PROCESSING_INSTRUCTION_NODE),isComment:Us(S.COMMENT_NODE),isDocumentNode:Us(S.DOCUMENT_NODE),isDocumentTypeNode:Us(S.DOCUMENT_TYPE_NODE),isDocumentFragment:Us(S.DOCUMENT_FRAGMENT_NODE)})})(NZ)});var fp=ye(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.assertIsDocumentFragmentNode=It.assertIsDocumentTypeNode=It.assertIsDocumentNode=It.assertIsCommentNode=It.assertIsProcessingInstructionNode=It.assertIsCDATASectionNode=It.assertIsTextNode=It.assertIsAttributeNode=It.assertIsElementNode=It.isDocumentFragmentNode=It.isDocumentTypeNode=It.isDocumentNode=It.isCommentNode=It.isProcessingInstructionNode=It.isCDATASectionNode=It.isTextNode=It.isAttributeNode=It.isElementNode=It.assertIsArrayOfNodes=It.isArrayOfNodes=It.assertIsNodeLike=It.isNodeLike=It.NodeTypes=void 0;var Qr;(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"})(Qr||(It.NodeTypes=Qr={}));function IS(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"}o(IS,"isNodeLike");It.isNodeLike=IS;function TZ(r){if(!IS(r))throw new Error(`Value is not a Node-like object. Received: ${r}`)}o(TZ,"assertIsNodeLike");It.assertIsNodeLike=TZ;function aL(r){return Array.isArray(r)&&r.every(IS)}o(aL,"isArrayOfNodes");It.isArrayOfNodes=aL;function IZ(r){if(!aL(r))throw new Error("Value is not an array of Nodes")}o(IZ,"assertIsArrayOfNodes");It.assertIsArrayOfNodes=IZ;function Oa(r,e){return IS(e)&&e.nodeType===r}o(Oa,"isNodeOfType");function vo(r,e){let t=Object.keys(Qr).find(n=>Qr[n]===r);if(!Oa(r,e))throw new Error(`Value is not of type ${t}`)}o(vo,"assertIsNodeOfType");var BZ=o(r=>Oa(Qr.ELEMENT_NODE,r),"isElementNode");It.isElementNode=BZ;var DZ=o(r=>Oa(Qr.ATTRIBUTE_NODE,r),"isAttributeNode");It.isAttributeNode=DZ;var _Z=o(r=>Oa(Qr.TEXT_NODE,r),"isTextNode");It.isTextNode=_Z;var RZ=o(r=>Oa(Qr.CDATA_SECTION_NODE,r),"isCDATASectionNode");It.isCDATASectionNode=RZ;var PZ=o(r=>Oa(Qr.PROCESSING_INSTRUCTION_NODE,r),"isProcessingInstructionNode");It.isProcessingInstructionNode=PZ;var OZ=o(r=>Oa(Qr.COMMENT_NODE,r),"isCommentNode");It.isCommentNode=OZ;var kZ=o(r=>Oa(Qr.DOCUMENT_NODE,r),"isDocumentNode");It.isDocumentNode=kZ;var LZ=o(r=>Oa(Qr.DOCUMENT_TYPE_NODE,r),"isDocumentTypeNode");It.isDocumentTypeNode=LZ;var VZ=o(r=>Oa(Qr.DOCUMENT_FRAGMENT_NODE,r),"isDocumentFragmentNode");It.isDocumentFragmentNode=VZ;var UZ=o(r=>{vo(Qr.ELEMENT_NODE,r)},"assertIsElementNode");It.assertIsElementNode=UZ;var MZ=o(r=>vo(Qr.ATTRIBUTE_NODE,r),"assertIsAttributeNode");It.assertIsAttributeNode=MZ;var jZ=o(r=>vo(Qr.TEXT_NODE,r),"assertIsTextNode");It.assertIsTextNode=jZ;var FZ=o(r=>vo(Qr.CDATA_SECTION_NODE,r),"assertIsCDATASectionNode");It.assertIsCDATASectionNode=FZ;var qZ=o(r=>vo(Qr.PROCESSING_INSTRUCTION_NODE,r),"assertIsProcessingInstructionNode");It.assertIsProcessingInstructionNode=qZ;var HZ=o(r=>vo(Qr.COMMENT_NODE,r),"assertIsCommentNode");It.assertIsCommentNode=HZ;var KZ=o(r=>vo(Qr.DOCUMENT_NODE,r),"assertIsDocumentNode");It.assertIsDocumentNode=KZ;var $Z=o(r=>vo(Qr.DOCUMENT_TYPE_NODE,r),"assertIsDocumentTypeNode");It.assertIsDocumentTypeNode=$Z;var XZ=o(r=>vo(Qr.DOCUMENT_FRAGMENT_NODE,r),"assertIsDocumentFragmentNode");It.assertIsDocumentFragmentNode=XZ});var Hm=ye(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.validateDigestValue=cr.findAncestorNs=cr.derToPem=cr.pemToDer=cr.normalizePem=cr.BASE64_REGEX=cr.EXTRACT_X509_CERTS=cr.PEM_FORMAT_REGEX=cr.encodeSpecialCharactersInText=cr.encodeSpecialCharactersInAttribute=cr.findChilds=cr.findChildren=cr.findAttr=cr.isArrayHasLength=void 0;var GZ=TS(),RN=fp();function oL(r){return Array.isArray(r)&&r.length>0}o(oL,"isArrayHasLength");cr.isArrayHasLength=oL;function WZ(r,e,t){return r.localName===e&&(r.namespaceURI===t||t==null)}o(WZ,"attrEqualsExplicitly");function JZ(r,e,t,n){return r.localName===e&&(!r.namespaceURI&&n?.namespaceURI===t||t==null)}o(JZ,"attrEqualsImplicitly");function zZ(r,e,t){for(let n=0;n<r.attributes.length;n++){let s=r.attributes[n];if(WZ(s,e,t)||JZ(s,e,t,r))return s}return null}o(zZ,"findAttr");cr.findAttr=zZ;function uL(r,e,t){let n=r.documentElement??r,s=[];for(let i=0;i<n.childNodes.length;i++){let a=n.childNodes[i];RN.isElementNode(a)&&a.localName===e&&(a.namespaceURI===t||t==null)&&s.push(a)}return s}o(uL,"findChildren");cr.findChildren=uL;function YZ(r,e,t){return uL(r,e,t)}o(YZ,"findChilds");cr.findChilds=YZ;var QZ={"&":"&amp;","<":"&lt;",'"':"&quot;","\r":"&#xD;","\n":"&#xA;"," ":"&#x9;"},ZZ={"&":"&amp;","<":"&lt;",">":"&gt;","\r":"&#xD;"};function eee(r){return r.replace(/([&<"\r\n\t])/g,function(e,t){return QZ[t]})}o(eee,"encodeSpecialCharactersInAttribute");cr.encodeSpecialCharactersInAttribute=eee;function tee(r){return r.replace(/([&<>\r])/g,function(e,t){return ZZ[t]})}o(tee,"encodeSpecialCharactersInText");cr.encodeSpecialCharactersInText=tee;cr.PEM_FORMAT_REGEX=new RegExp("^-----BEGIN [A-Z ]{1,48}-----([^-]*)-----END [A-Z ]{1,48}-----$","s");cr.EXTRACT_X509_CERTS=new RegExp("-----BEGIN CERTIFICATE-----[^-]*-----END CERTIFICATE-----","g");cr.BASE64_REGEX=new RegExp("^(?:[A-Za-z0-9\\+\\/]{4}\\n{0,1})*(?:[A-Za-z0-9\\+\\/]{2}==|[A-Za-z0-9\\+\\/]{3}=)?$","s");function _N(r){return`${(r.trim().replace(/(\r\n|\r)/g,`
55
- `).match(/.{1,64}/g)??[]).join(`
56
- `)}
57
- `}o(_N,"normalizePem");cr.normalizePem=_N;function ree(r){if(!cr.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")}o(ree,"pemToDer");cr.pemToDer=ree;function nee(r,e){let t=Buffer.isBuffer(r)?r.toString("base64").trim():r.replace(/(\r\n|\r)/g,"").trim();if(cr.PEM_FORMAT_REGEX.test(t))return _N(t);if(cr.BASE64_REGEX.test(t.replace(/ /g,""))){if(e==null)throw new Error("PEM label is required when DER is given.");let n=`-----BEGIN ${e}-----
58
- ${t.replace(/ /g,"")}
59
- -----END ${e}-----`;return _N(n)}throw new Error("Unknown DER format.")}o(nee,"derToPem");cr.derToPem=nee;function lL(r,e=[]){if(!RN.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 lL(t,e)}o(lL,"collectAncestorNamespaces");function see(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||""}o(see,"findNSPrefix");function iee(r){return r.every(e=>RN.isElementNode(e))}o(iee,"isElementSubset");function aee(r,e,t){if(e==null)return[];let n=GZ.selectWithResolver(e,r,t);if(!oL(n))return[];if(!iee(n))throw new Error("Document subset must be list of elements");let s=lL(n[0]),i=[];for(let l=0;l<s.length;l++){let f=!0;for(let h in i)if(i[h].prefix===s[l].prefix){f=!1;break}f&&i.push(s[l])}let a=[],u=see(n[0]);for(let l of i)l.prefix!==u&&a.push(l);return a}o(aee,"findAncestorNs");cr.findAncestorNs=aee;function oee(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}o(oee,"validateDigestValue");cr.validateDigestValue=oee});var ON=ye(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.C14nCanonicalizationWithComments=hp.C14nCanonicalization=void 0;var BS=Hm(),PN=fp(),cL=class{static{o(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(PN.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}="${BS.encodeSpecialCharactersInAttribute(a.value)}"`).join("")}renderNs(e,t,n,s,i){let a,u,l=[],f=n,h=[],m=e.namespaceURI||"";if(e.prefix?t.indexOf(e.prefix)===-1&&(h.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push(e.prefix)):n!==m&&(f=e.namespaceURI||"",l.push(' xmlns="',f,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)u=e.attributes[a],u.prefix==="xmlns"&&t.indexOf(u.localName)===-1&&(h.push({prefix:u.localName,namespaceURI:u.value}),t.push(u.localName)),u.prefix&&t.indexOf(u.prefix)===-1&&u.prefix!=="xmlns"&&u.prefix!=="xml"&&(h.push({prefix:u.prefix,namespaceURI:u.namespaceURI}),t.push(u.prefix));if(BS.isArrayHasLength(i))for(let g of i){let w=!1;for(let y of h)y.prefix===g.prefix&&y.namespaceURI===g.namespaceURI&&(w=!0);w||h.push(g)}return h.sort(this.nsCompare),l.push(...h.map(g=>g.prefix?` xmlns:${g.prefix}="${g.namespaceURI}"`:` xmlns="${g.namespaceURI}"`)),{rendered:l.join(""),newDefaultNs:f}}processInner(e,t,n,s,i){if(PN.isCommentNode(e))return this.renderComment(e);if(e.data)return BS.encodeSpecialCharactersInText(e.data);if(PN.isElementNode(e)){let a,u,l=this.renderNs(e,t,n,s,i),f=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)u=t.slice(0),f.push(this.processInner(e.childNodes[a],u,l.newDefaultNs,s,[]));return f.push("</",e.tagName,">"),f.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,f=e;for(;l!==null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;f!==null;){if(f===e.ownerDocument.documentElement){s=!0;break}f=f.previousSibling}}let i=s?`
60
- `:"",a=n?`
61
- `:"",u=BS.encodeSpecialCharactersInText(e.data);return`${i}<!--${u}-->${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"}};hp.C14nCanonicalization=cL;var uee=class extends cL{static{o(this,"C14nCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"}};hp.C14nCanonicalizationWithComments=uee});var VN=ye(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.ExclusiveCanonicalizationWithComments=pp.ExclusiveCanonicalization=void 0;var Nc=Hm(),kN=fp();function LN(r,e,t){let n=!1;return r.forEach(function(s){s.prefix===e&&s.namespaceURI===t&&(n=!0)}),n}o(LN,"isPrefixInScope");var fL=class{static{o(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(kN.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,'="',Nc.encodeSpecialCharactersInAttribute(n.value),'"');return s.join("")}renderNs(e,t,n,s,i){let a,u,l=[],f=n,h=[],m=e.namespaceURI||"";if(e.prefix?LN(t,e.prefix,e.namespaceURI||s[e.prefix])||(h.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]}),t.push({prefix:e.prefix,namespaceURI:e.namespaceURI||s[e.prefix]})):n!==m&&(f=e.namespaceURI,l.push(' xmlns="',f,'"')),e.attributes)for(a=0;a<e.attributes.length;++a)u=e.attributes[a],u.prefix&&!LN(t,u.localName,u.value)&&i.indexOf(u.localName)>=0&&(h.push({prefix:u.localName,namespaceURI:u.value}),t.push({prefix:u.localName,namespaceURI:u.value})),u.prefix&&!LN(t,u.prefix,u.namespaceURI)&&u.prefix!=="xmlns"&&u.prefix!=="xml"&&(h.push({prefix:u.prefix,namespaceURI:u.namespaceURI}),t.push({prefix:u.prefix,namespaceURI:u.namespaceURI}));h.sort(this.nsCompare);for(let g of h)l.push(" xmlns:",g.prefix,'="',g.namespaceURI,'"');return{rendered:l.join(""),newDefaultNs:f}}processInner(e,t,n,s,i){if(kN.isCommentNode(e))return this.renderComment(e);if(e.data)return Nc.encodeSpecialCharactersInText(e.data);if(kN.isElementNode(e)){let a,u,l=this.renderNs(e,t,n,s,i),f=["<",e.tagName,l.rendered,this.renderAttrs(e),">"];for(a=0;a<e.childNodes.length;++a)u=t.slice(0),f.push(this.processInner(e.childNodes[a],u,l.newDefaultNs,s,i));return f.push("</",e.tagName,">"),f.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,f=e;for(;l!=null;){if(l===e.ownerDocument.documentElement){n=!0;break}l=l.nextSibling}for(;f!=null;){if(f===e.ownerDocument.documentElement){s=!0;break}f=f.previousSibling}}let i=s?`
62
- `:"",a=n?`
63
- `:"",u=Nc.encodeSpecialCharactersInText(e.data);return`${i}<!--${u}-->${a}`}process(e,t){t=t||{};let n=t.inclusiveNamespacesPrefixList||[],s=t.defaultNs||"",i=t.defaultNsForPrefix||{},a=t.ancestorNamespaces||[];if(!Nc.isArrayHasLength(n)){let l=Nc.findChildren(e,"CanonicalizationMethod");if(l.length!==0){let f=Nc.findChildren(l[0],"InclusiveNamespaces");f.length!==0&&(n=(f[0].getAttribute("PrefixList")||"").split(" "))}}return Nc.isArrayHasLength(n)&&n.forEach(function(l){a&&a.forEach(function(f){l===f.prefix&&e.setAttributeNS("http://www.w3.org/2000/xmlns/",`xmlns:${l}`,f.namespaceURI)})}),this.processInner(e,[],s,i,n)}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#"}};pp.ExclusiveCanonicalization=fL;var lee=class extends fL{static{o(this,"ExclusiveCanonicalizationWithComments")}constructor(){super(),this.includeComments=!0}getAlgorithmName(){return"http://www.w3.org/2001/10/xml-exc-c14n#WithComments"}};pp.ExclusiveCanonicalizationWithComments=lee});var Km=ye(dp=>{"use strict";function cee(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}}o(cee,"find");function UN(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}o(UN,"freeze");function fee(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}o(fee,"assign");var hL=UN({HTML:"text/html",isHTML:o(function(r){return r===hL.HTML},"isHTML"),XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),pL=UN({HTML:"http://www.w3.org/1999/xhtml",isHTML:o(function(r){return r===pL.HTML},"isHTML"),SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});dp.assign=fee;dp.find=cee;dp.freeze=UN;dp.MIME_TYPE=hL;dp.NAMESPACE=pL});var JN=ye(Uu=>{"use strict";var EL=Km(),ka=EL.find,$m=EL.NAMESPACE;function hee(r){return r!==""}o(hee,"notEmptyString");function pee(r){return r?r.split(/[\t\n\f\r ]+/).filter(hee):[]}o(pee,"splitOnASCIIWhitespace");function dee(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}o(dee,"orderedSetReducer");function dL(r){if(!r)return[];var e=pee(r);return Object.keys(e.reduce(dee,{}))}o(dL,"toOrderedSet");function mee(r){return function(e){return r&&r.indexOf(e)!==-1}}o(mee,"arrayIncludes");function Wm(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}o(Wm,"copy");function Ts(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};var n=s;o(s,"t"),s.prototype=e.prototype,s=new s,Wm(t,s),r.prototype=t=s}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}o(Ts,"_extends");var Is={},Ei=Is.ELEMENT_NODE=1,gp=Is.ATTRIBUTE_NODE=2,DS=Is.TEXT_NODE=3,AL=Is.CDATA_SECTION_NODE=4,CL=Is.ENTITY_REFERENCE_NODE=5,gee=Is.ENTITY_NODE=6,bL=Is.PROCESSING_INSTRUCTION_NODE=7,xL=Is.COMMENT_NODE=8,NL=Is.DOCUMENT_NODE=9,TL=Is.DOCUMENT_TYPE_NODE=10,So=Is.DOCUMENT_FRAGMENT_NODE=11,yee=Is.NOTATION_NODE=12,Yn={},Tn={},rpe=Yn.INDEX_SIZE_ERR=(Tn[1]="Index size error",1),npe=Yn.DOMSTRING_SIZE_ERR=(Tn[2]="DOMString size error",2),Ns=Yn.HIERARCHY_REQUEST_ERR=(Tn[3]="Hierarchy request error",3),spe=Yn.WRONG_DOCUMENT_ERR=(Tn[4]="Wrong document",4),ipe=Yn.INVALID_CHARACTER_ERR=(Tn[5]="Invalid character",5),ape=Yn.NO_DATA_ALLOWED_ERR=(Tn[6]="No data allowed",6),ope=Yn.NO_MODIFICATION_ALLOWED_ERR=(Tn[7]="No modification allowed",7),IL=Yn.NOT_FOUND_ERR=(Tn[8]="Not found",8),upe=Yn.NOT_SUPPORTED_ERR=(Tn[9]="Not supported",9),mL=Yn.INUSE_ATTRIBUTE_ERR=(Tn[10]="Attribute in use",10),lpe=Yn.INVALID_STATE_ERR=(Tn[11]="Invalid state",11),cpe=Yn.SYNTAX_ERR=(Tn[12]="Syntax error",12),fpe=Yn.INVALID_MODIFICATION_ERR=(Tn[13]="Invalid modification",13),hpe=Yn.NAMESPACE_ERR=(Tn[14]="Invalid namespace",14),ppe=Yn.INVALID_ACCESS_ERR=(Tn[15]="Invalid access",15);function nn(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Tn[r]),this.message=Tn[r],Error.captureStackTrace&&Error.captureStackTrace(this,nn);return t.code=r,e&&(this.message=this.message+": "+e),t}o(nn,"DOMException");nn.prototype=Error.prototype;Wm(Yn,nn);function wo(){}o(wo,"NodeList");wo.prototype={length:0,item:o(function(r){return r>=0&&r<this.length?this[r]:null},"item"),toString:o(function(r,e){for(var t=[],n=0;n<this.length;n++)mp(this[n],t,r,e);return t.join("")},"toString"),filter:o(function(r){return Array.prototype.filter.call(this,r)},"filter"),indexOf:o(function(r){return Array.prototype.indexOf.call(this,r)},"indexOf")};function yp(r,e){this._node=r,this._refresh=e,FN(this)}o(yp,"LiveNodeList");function FN(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(jL(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];Wm(t,r),r._inc=e}}o(FN,"_updateLiveList");yp.prototype.item=function(r){return FN(this),this[r]||null};Ts(yp,wo);function _S(){}o(_S,"NamedNodeMap");function BL(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}o(BL,"_findNodeIndex");function gL(r,e,t,n){if(n?e[BL(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(n&&RL(s,r,n),vee(s,r,t))}}o(gL,"_addNamedNode");function yL(r,e,t){var n=BL(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)}}else throw new nn(IL,new Error(r.tagName+"@"+t))}o(yL,"_removeNamedNode");_S.prototype={length:0,item:wo.prototype.item,getNamedItem:o(function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},"getNamedItem"),setNamedItem:o(function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new nn(mL);var t=this.getNamedItem(r.nodeName);return gL(this._ownerElement,this,r,t),t},"setNamedItem"),setNamedItemNS:o(function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new nn(mL);return t=this.getNamedItemNS(r.namespaceURI,r.localName),gL(this._ownerElement,this,r,t),t},"setNamedItemNS"),removeNamedItem:o(function(r){var e=this.getNamedItem(r);return yL(this._ownerElement,this,e),e},"removeNamedItem"),removeNamedItemNS:o(function(r,e){var t=this.getNamedItemNS(r,e);return yL(this._ownerElement,this,t),t},"removeNamedItemNS"),getNamedItemNS:o(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 DL(){}o(DL,"DOMImplementation");DL.prototype={hasFeature:o(function(r,e){return!0},"hasFeature"),createDocument:o(function(r,e,t){var n=new Jm;if(n.implementation=this,n.childNodes=new wo,n.doctype=t||null,t&&n.appendChild(t),e){var s=n.createElementNS(r,e);n.appendChild(s)}return n},"createDocument"),createDocumentType:o(function(r,e,t){var n=new OS;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n},"createDocumentType")};function Er(){}o(Er,"Node");Er.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:o(function(r,e){return RS(this,r,e)},"insertBefore"),replaceChild:o(function(r,e){RS(this,r,e,OL),e&&this.removeChild(e)},"replaceChild"),removeChild:o(function(r){return PL(this,r)},"removeChild"),appendChild:o(function(r){return this.insertBefore(r,null)},"appendChild"),hasChildNodes:o(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:o(function(r){return jN(this.ownerDocument||this,this,r)},"cloneNode"),normalize:o(function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==DS&&r.nodeType==DS?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e)}},"normalize"),isSupported:o(function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},"isSupported"),hasAttributes:o(function(){return this.attributes.length>0},"hasAttributes"),lookupPrefix:o(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==gp?e.ownerDocument:e.parentNode}return null},"lookupPrefix"),lookupNamespaceURI:o(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==gp?e.ownerDocument:e.parentNode}return null},"lookupNamespaceURI"),isDefaultNamespace:o(function(r){var e=this.lookupPrefix(r);return e==null},"isDefaultNamespace")};function _L(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}o(_L,"_xmlEncoder");Wm(Is,Er);Wm(Is,Er.prototype);function Xm(r,e){if(e(r))return!0;if(r=r.firstChild)do if(Xm(r,e))return!0;while(r=r.nextSibling)}o(Xm,"_visitNode");function Jm(){this.ownerDocument=this}o(Jm,"Document");function vee(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===$m.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}o(vee,"_onAddAttribute");function RL(r,e,t,n){r&&r._inc++;var s=t.namespaceURI;s===$m.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}o(RL,"_onRemoveAttribute");function qN(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]}}}o(qN,"_onUpdateChild");function PL(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,qN(r.ownerDocument,r),e}o(PL,"_removeChild");function wee(r){return r&&(r.nodeType===Er.DOCUMENT_NODE||r.nodeType===Er.DOCUMENT_FRAGMENT_NODE||r.nodeType===Er.ELEMENT_NODE)}o(wee,"hasValidParentNodeType");function See(r){return r&&(La(r)||HN(r)||Eo(r)||r.nodeType===Er.DOCUMENT_FRAGMENT_NODE||r.nodeType===Er.COMMENT_NODE||r.nodeType===Er.PROCESSING_INSTRUCTION_NODE)}o(See,"hasInsertableNodeType");function Eo(r){return r&&r.nodeType===Er.DOCUMENT_TYPE_NODE}o(Eo,"isDocTypeNode");function La(r){return r&&r.nodeType===Er.ELEMENT_NODE}o(La,"isElementNode");function HN(r){return r&&r.nodeType===Er.TEXT_NODE}o(HN,"isTextNode");function vL(r,e){var t=r.childNodes||[];if(ka(t,La)||Eo(e))return!1;var n=ka(t,Eo);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}o(vL,"isElementInsertionPossible");function wL(r,e){var t=r.childNodes||[];function n(i){return La(i)&&i!==e}if(o(n,"hasElementChildThatIsNotChild"),ka(t,n))return!1;var s=ka(t,Eo);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}o(wL,"isElementReplacementPossible");function Eee(r,e,t){if(!wee(r))throw new nn(Ns,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new nn(IL,"child not in parent");if(!See(e)||Eo(e)&&r.nodeType!==Er.DOCUMENT_NODE)throw new nn(Ns,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}o(Eee,"assertPreInsertionValidity1to5");function Aee(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Er.DOCUMENT_FRAGMENT_NODE){var i=s.filter(La);if(i.length>1||ka(s,HN))throw new nn(Ns,"More than one element or text in fragment");if(i.length===1&&!vL(r,t))throw new nn(Ns,"Element in fragment can not be inserted before doctype")}if(La(e)&&!vL(r,t))throw new nn(Ns,"Only one element can be added and only after doctype");if(Eo(e)){if(ka(n,Eo))throw new nn(Ns,"Only one doctype is allowed");var a=ka(n,La);if(t&&n.indexOf(a)<n.indexOf(t))throw new nn(Ns,"Doctype can only be inserted before an element");if(!t&&a)throw new nn(Ns,"Doctype can not be appended since element is present")}}o(Aee,"assertPreInsertionValidityInDocument");function OL(r,e,t){var n=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Er.DOCUMENT_FRAGMENT_NODE){var i=s.filter(La);if(i.length>1||ka(s,HN))throw new nn(Ns,"More than one element or text in fragment");if(i.length===1&&!wL(r,t))throw new nn(Ns,"Element in fragment can not be inserted before doctype")}if(La(e)&&!wL(r,t))throw new nn(Ns,"Only one element can be added and only after doctype");if(Eo(e)){let l=function(f){return Eo(f)&&f!==t};var u=l;if(o(l,"hasDoctypeChildThatIsNotChild"),ka(n,l))throw new nn(Ns,"Only one doctype is allowed");var a=ka(n,La);if(t&&n.indexOf(a)<n.indexOf(t))throw new nn(Ns,"Doctype can only be inserted before an element")}}o(OL,"assertPreReplacementValidityInDocument");function RS(r,e,t,n){Eee(r,e,t),r.nodeType===Er.DOCUMENT_NODE&&(n||Aee)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===So){var i=e.firstChild;if(i==null)return e;var a=e.lastChild}else i=a=e;var u=t?t.previousSibling:r.lastChild;i.previousSibling=u,a.nextSibling=t,u?u.nextSibling=i:r.firstChild=i,t==null?r.lastChild=a:t.previousSibling=a;do{i.parentNode=r;var l=r.ownerDocument||r;Gm(i,l)}while(i!==a&&(i=i.nextSibling));return qN(r.ownerDocument||r,r),e.nodeType==So&&(e.firstChild=e.lastChild=null),e}o(RS,"_insertBefore");function Gm(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===Ei&&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;)Gm(s,e),s=s.nextSibling}}o(Gm,"_updateOwnerDocument");function Cee(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,qN(r.ownerDocument,r,e);var t=r.ownerDocument||r;return Gm(e,t),e}o(Cee,"_appendSingleChild");Jm.prototype={nodeName:"#document",nodeType:NL,doctype:null,documentElement:null,_inc:1,insertBefore:o(function(r,e){if(r.nodeType==So){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return RS(this,r,e),Gm(r,this),this.documentElement===null&&r.nodeType===Ei&&(this.documentElement=r),r},"insertBefore"),removeChild:o(function(r){return this.documentElement==r&&(this.documentElement=null),PL(this,r)},"removeChild"),replaceChild:o(function(r,e){RS(this,r,e,OL),Gm(r,this),e&&this.removeChild(e),La(r)&&(this.documentElement=r)},"replaceChild"),importNode:o(function(r,e){return ML(this,r,e)},"importNode"),getElementById:o(function(r){var e=null;return Xm(this.documentElement,function(t){if(t.nodeType==Ei&&t.getAttribute("id")==r)return e=t,!0}),e},"getElementById"),getElementsByClassName:o(function(r){var e=dL(r);return new yp(this,function(t){var n=[];return e.length>0&&Xm(t.documentElement,function(s){if(s!==t&&s.nodeType===Ei){var i=s.getAttribute("class");if(i){var a=r===i;if(!a){var u=dL(i);a=e.every(mee(u))}a&&n.push(s)}}}),n})},"getElementsByClassName"),createElement:o(function(r){var e=new Tc;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new wo;var t=e.attributes=new _S;return t._ownerElement=e,e},"createElement"),createDocumentFragment:o(function(){var r=new kS;return r.ownerDocument=this,r.childNodes=new wo,r},"createDocumentFragment"),createTextNode:o(function(r){var e=new KN;return e.ownerDocument=this,e.appendData(r),e},"createTextNode"),createComment:o(function(r){var e=new $N;return e.ownerDocument=this,e.appendData(r),e},"createComment"),createCDATASection:o(function(r){var e=new XN;return e.ownerDocument=this,e.appendData(r),e},"createCDATASection"),createProcessingInstruction:o(function(r,e){var t=new WN;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},"createProcessingInstruction"),createAttribute:o(function(r){var e=new PS;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},"createAttribute"),createEntityReference:o(function(r){var e=new GN;return e.ownerDocument=this,e.nodeName=r,e},"createEntityReference"),createElementNS:o(function(r,e){var t=new Tc,n=e.split(":"),s=t.attributes=new _S;return t.childNodes=new wo,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:o(function(r,e){var t=new PS,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")};Ts(Jm,Er);function Tc(){this._nsMap={}}o(Tc,"Element");Tc.prototype={nodeType:Ei,hasAttribute:o(function(r){return this.getAttributeNode(r)!=null},"hasAttribute"),getAttribute:o(function(r){var e=this.getAttributeNode(r);return e&&e.value||""},"getAttribute"),getAttributeNode:o(function(r){return this.attributes.getNamedItem(r)},"getAttributeNode"),setAttribute:o(function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},"setAttribute"),removeAttribute:o(function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},"removeAttribute"),appendChild:o(function(r){return r.nodeType===So?this.insertBefore(r,null):Cee(this,r)},"appendChild"),setAttributeNode:o(function(r){return this.attributes.setNamedItem(r)},"setAttributeNode"),setAttributeNodeNS:o(function(r){return this.attributes.setNamedItemNS(r)},"setAttributeNodeNS"),removeAttributeNode:o(function(r){return this.attributes.removeNamedItem(r.nodeName)},"removeAttributeNode"),removeAttributeNS:o(function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},"removeAttributeNS"),hasAttributeNS:o(function(r,e){return this.getAttributeNodeNS(r,e)!=null},"hasAttributeNS"),getAttributeNS:o(function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},"getAttributeNS"),setAttributeNS:o(function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},"setAttributeNS"),getAttributeNodeNS:o(function(r,e){return this.attributes.getNamedItemNS(r,e)},"getAttributeNodeNS"),getElementsByTagName:o(function(r){return new yp(this,function(e){var t=[];return Xm(e,function(n){n!==e&&n.nodeType==Ei&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},"getElementsByTagName"),getElementsByTagNameNS:o(function(r,e){return new yp(this,function(t){var n=[];return Xm(t,function(s){s!==t&&s.nodeType===Ei&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&n.push(s)}),n})},"getElementsByTagNameNS")};Jm.prototype.getElementsByTagName=Tc.prototype.getElementsByTagName;Jm.prototype.getElementsByTagNameNS=Tc.prototype.getElementsByTagNameNS;Ts(Tc,Er);function PS(){}o(PS,"Attr");PS.prototype.nodeType=gp;Ts(PS,Er);function zm(){}o(zm,"CharacterData");zm.prototype={data:"",substringData:o(function(r,e){return this.data.substring(r,r+e)},"substringData"),appendData:o(function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},"appendData"),insertData:o(function(r,e){this.replaceData(r,0,e)},"insertData"),appendChild:o(function(r){throw new Error(Tn[Ns])},"appendChild"),deleteData:o(function(r,e){this.replaceData(r,e,"")},"deleteData"),replaceData:o(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")};Ts(zm,Er);function KN(){}o(KN,"Text");KN.prototype={nodeName:"#text",nodeType:DS,splitText:o(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")};Ts(KN,zm);function $N(){}o($N,"Comment");$N.prototype={nodeName:"#comment",nodeType:xL};Ts($N,zm);function XN(){}o(XN,"CDATASection");XN.prototype={nodeName:"#cdata-section",nodeType:AL};Ts(XN,zm);function OS(){}o(OS,"DocumentType");OS.prototype.nodeType=TL;Ts(OS,Er);function kL(){}o(kL,"Notation");kL.prototype.nodeType=yee;Ts(kL,Er);function LL(){}o(LL,"Entity");LL.prototype.nodeType=gee;Ts(LL,Er);function GN(){}o(GN,"EntityReference");GN.prototype.nodeType=CL;Ts(GN,Er);function kS(){}o(kS,"DocumentFragment");kS.prototype.nodeName="#document-fragment";kS.prototype.nodeType=So;Ts(kS,Er);function WN(){}o(WN,"ProcessingInstruction");WN.prototype.nodeType=bL;Ts(WN,Er);function VL(){}o(VL,"XMLSerializer");VL.prototype.serializeToString=function(r,e,t){return UL.call(r,e,t)};Er.prototype.toString=UL;function UL(r,e){var t=[],n=this.nodeType==9&&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 mp(this,t,r,e,a),t.join("")}o(UL,"nodeSerializeToString");function SL(r,e,t){var n=r.prefix||"",s=r.namespaceURI;if(!s||n==="xml"&&s===$m.XML||s===$m.XMLNS)return!1;for(var i=t.length;i--;){var a=t[i];if(a.prefix===n)return a.namespace!==s}return!0}o(SL,"needNamespaceDefine");function MN(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,_L),'"')}o(MN,"addSerializedAttribute");function mp(r,e,t,n,s){if(s||(s=[]),n)if(r=n(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case Ei:var i=r.attributes,a=i.length,b=r.firstChild,u=r.tagName;t=$m.isHTML(r.namespaceURI)||t;var l=u;if(!t&&!r.prefix&&r.namespaceURI){for(var f,h=0;h<i.length;h++)if(i.item(h).name==="xmlns"){f=i.item(h).value;break}if(!f)for(var m=s.length-1;m>=0;m--){var g=s[m];if(g.prefix===""&&g.namespace===r.namespaceURI){f=g.namespace;break}}if(f!==r.namespaceURI)for(var m=s.length-1;m>=0;m--){var g=s[m];if(g.namespace===r.namespaceURI){g.prefix&&(l=g.prefix+":"+u);break}}}e.push("<",l);for(var w=0;w<a;w++){var y=i.item(w);y.prefix=="xmlns"?s.push({prefix:y.localName,namespace:y.value}):y.nodeName=="xmlns"&&s.push({prefix:"",namespace:y.value})}for(var w=0;w<a;w++){var y=i.item(w);if(SL(y,t,s)){var S=y.prefix||"",E=y.namespaceURI;MN(e,S?"xmlns:"+S:"xmlns",E),s.push({prefix:S,namespace:E})}mp(y,e,t,n,s)}if(u===l&&SL(r,t,s)){var S=r.prefix||"",E=r.namespaceURI;MN(e,S?"xmlns:"+S:"xmlns",E),s.push({prefix:S,namespace:E})}if(b||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),t&&/^script$/i.test(u))for(;b;)b.data?e.push(b.data):mp(b,e,t,n,s.slice()),b=b.nextSibling;else for(;b;)mp(b,e,t,n,s.slice()),b=b.nextSibling;e.push("</",l,">")}else e.push("/>");return;case NL:case So:for(var b=r.firstChild;b;)mp(b,e,t,n,s.slice()),b=b.nextSibling;return;case gp:return MN(e,r.name,r.value);case DS:return e.push(r.data.replace(/[<&>]/g,_L));case AL:return e.push("<![CDATA[",r.data,"]]>");case xL:return e.push("<!--",r.data,"-->");case TL:var T=r.publicId,A=r.systemId;if(e.push("<!DOCTYPE ",r.name),T)e.push(" PUBLIC ",T),A&&A!="."&&e.push(" ",A),e.push(">");else if(A&&A!=".")e.push(" SYSTEM ",A,">");else{var C=r.internalSubset;C&&e.push(" [",C,"]"),e.push(">")}return;case bL:return e.push("<?",r.target," ",r.data,"?>");case CL:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName)}}o(mp,"serializeToString");function ML(r,e,t){var n;switch(e.nodeType){case Ei:n=e.cloneNode(!1),n.ownerDocument=r;case So:break;case gp:t=!0;break}if(n||(n=e.cloneNode(!1)),n.ownerDocument=r,n.parentNode=null,t)for(var s=e.firstChild;s;)n.appendChild(ML(r,s,t)),s=s.nextSibling;return n}o(ML,"importNode");function jN(r,e,t){var n=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var i=e[s];typeof i!="object"&&i!=n[s]&&(n[s]=i)}switch(e.childNodes&&(n.childNodes=new wo),n.ownerDocument=r,n.nodeType){case Ei:var a=e.attributes,u=n.attributes=new _S,l=a.length;u._ownerElement=n;for(var f=0;f<l;f++)n.setAttributeNode(jN(r,a.item(f),!0));break;case gp:t=!0}if(t)for(var h=e.firstChild;h;)n.appendChild(jN(r,h,t)),h=h.nextSibling;return n}o(jN,"cloneNode");function jL(r,e,t){r[e]=t}o(jL,"__set__");try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case Ei:case So:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};bee=r,o(r,"getTextContent"),Object.defineProperty(yp.prototype,"length",{get:o(function(){return FN(this),this.$$length},"get")}),Object.defineProperty(Er.prototype,"textContent",{get:o(function(){return r(this)},"get"),set:o(function(e){switch(this.nodeType){case Ei:case So:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}},"set")}),jL=o(function(e,t,n){e["$$"+t]=n},"__set__")}}catch{}var bee;Uu.DocumentType=OS;Uu.DOMException=nn;Uu.DOMImplementation=DL;Uu.Element=Tc;Uu.Node=Er;Uu.NodeList=wo;Uu.XMLSerializer=VL});var qL=ye(Ym=>{"use strict";var FL=Km().freeze;Ym.XML_ENTITIES=FL({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Ym.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:`
64
- `,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"});Ym.entityMap=Ym.HTML_ENTITIES});var zL=ye(YN=>{"use strict";var tg=Km().NAMESPACE,zN=/[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]/,HL=new RegExp("[\\-\\.0-9"+zN.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),KL=new RegExp("^"+zN.source+HL.source+"*(?::"+zN.source+HL.source+"*)?$"),Qm=0,Mu=1,vp=2,Zm=3,wp=4,Sp=5,eg=6,LS=7;function Ep(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Ep)}o(Ep,"ParseError");Ep.prototype=new Error;Ep.prototype.name=Ep.name;function GL(){}o(GL,"XMLReader");GL.prototype={parse:o(function(r,e,t){var n=this.domBuilder;n.startDocument(),WL(e,e={}),xee(r,e,t,n,this.errorHandler),n.endDocument()},"parse")};function xee(r,e,t,n,s){function i(Z){if(Z>65535){Z-=65536;var fe=55296+(Z>>10),Se=56320+(Z&1023);return String.fromCharCode(fe,Se)}else return String.fromCharCode(Z)}o(i,"fixedFromCharCode");function a(Z){var fe=Z.slice(1,-1);return Object.hasOwnProperty.call(t,fe)?t[fe]:fe.charAt(0)==="#"?i(parseInt(fe.substr(1).replace("x","0x"))):(s.error("entity not found:"+Z),Z)}o(a,"entityReplacer");function u(Z){if(Z>S){var fe=r.substring(S,Z).replace(/&#?\w+;/g,a);g&&l(S),n.characters(fe,0,Z-S),S=Z}}o(u,"appendText");function l(Z,fe){for(;Z>=h&&(fe=m.exec(r));)f=fe.index,h=f+fe[0].length,g.lineNumber++;g.columnNumber=Z-f+1}o(l,"position");for(var f=0,h=0,m=/.*(?:\r\n?|\n)|.*$/g,g=n.locator,w=[{currentNSMap:e}],y={},S=0;;){try{var E=r.indexOf("<",S);if(E<0){if(!r.substr(S).match(/^\s*$/)){var b=n.doc,T=b.createTextNode(r.substr(S));b.appendChild(T),n.currentElement=T}return}switch(E>S&&u(E),r.charAt(E+1)){case"/":var K=r.indexOf(">",E+3),A=r.substring(E+2,K).replace(/[ \t\n\r]+$/g,""),C=w.pop();K<0?(A=r.substring(E+2).replace(/[\s<].*/,""),s.error("end tag name: "+A+" is not complete:"+C.tagName),K=E+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,""),s.error("end tag name: "+A+" maybe not complete"),K=E+1+A.length);var x=C.localNSMap,B=C.tagName==A,F=B||C.tagName&&C.tagName.toLowerCase()==A.toLowerCase();if(F){if(n.endElement(C.uri,C.localName,A),x)for(var R in x)Object.prototype.hasOwnProperty.call(x,R)&&n.endPrefixMapping(R);B||s.fatalError("end tag name: "+A+" is not match the current start tagName:"+C.tagName)}else w.push(C);K++;break;case"?":g&&l(E),K=Dee(r,E,n);break;case"!":g&&l(E),K=Bee(r,E,n,s);break;default:g&&l(E);var H=new JL,q=w[w.length-1].currentNSMap,K=Nee(r,E,H,q,a,s),G=H.length;if(!H.closed&&Iee(r,K,H.tagName,y)&&(H.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),g&&G){for(var he=$L(g,{}),le=0;le<G;le++){var oe=H[le];l(oe.offset),oe.locator=$L(g,{})}n.locator=he,XL(H,n,q)&&w.push(H),n.locator=g}else XL(H,n,q)&&w.push(H);tg.isHTML(H.uri)&&!H.closed?K=Tee(r,K,H.tagName,a,n):K++}}catch(Z){if(Z instanceof Ep)throw Z;s.error("element parse error: "+Z),K=-1}K>S?S=K:u(Math.max(E,S)+1)}}o(xee,"parse");function $L(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}o($L,"copyLocator");function Nee(r,e,t,n,s,i){function a(w,y,S){t.attributeNames.hasOwnProperty(w)&&i.fatalError("Attribute "+w+" redefined"),t.addValue(w,y.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),S)}o(a,"addAttribute");for(var u,l,f=++e,h=Qm;;){var m=r.charAt(f);switch(m){case"=":if(h===Mu)u=r.slice(e,f),h=Zm;else if(h===vp)h=Zm;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(h===Zm||h===Mu)if(h===Mu&&(i.warning('attribute value must after "="'),u=r.slice(e,f)),e=f+1,f=r.indexOf(m,e),f>0)l=r.slice(e,f),a(u,l,e-1),h=Sp;else throw new Error("attribute value no end '"+m+"' match");else if(h==wp)l=r.slice(e,f),a(u,l,e),i.warning('attribute "'+u+'" missed start quot('+m+")!!"),e=f+1,h=Sp;else throw new Error('attribute value must after "="');break;case"/":switch(h){case Qm:t.setTagName(r.slice(e,f));case Sp:case eg:case LS:h=LS,t.closed=!0;case wp:case Mu:break;case vp:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),h==Qm&&t.setTagName(r.slice(e,f)),f;case">":switch(h){case Qm:t.setTagName(r.slice(e,f));case Sp:case eg:case LS:break;case wp:case Mu:l=r.slice(e,f),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case vp:h===vp&&(l=u),h==wp?(i.warning('attribute "'+l+'" missed quot(")!'),a(u,l,e)):((!tg.isHTML(n[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Zm:throw new Error("attribute value missed!!")}return f;case"\x80":m=" ";default:if(m<=" ")switch(h){case Qm:t.setTagName(r.slice(e,f)),h=eg;break;case Mu:u=r.slice(e,f),h=vp;break;case wp:var l=r.slice(e,f);i.warning('attribute "'+l+'" missed quot(")!!'),a(u,l,e);case Sp:h=eg;break}else switch(h){case vp:var g=t.tagName;(!tg.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&i.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),a(u,u,e),e=f,h=Mu;break;case Sp:i.warning('attribute space is required"'+u+'"!!');case eg:h=Mu,e=f;break;case Zm:h=wp,e=f;break;case LS:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}o(Nee,"parseElementStartPart");function XL(r,e,t){for(var n=r.tagName,s=null,m=r.length;m--;){var i=r[m],a=i.qName,u=i.value,g=a.indexOf(":");if(g>0)var l=i.prefix=a.slice(0,g),f=a.slice(g+1),h=l==="xmlns"&&f;else f=a,l=null,h=a==="xmlns"&&"";i.localName=f,h!==!1&&(s==null&&(s={},WL(t,t={})),t[h]=s[h]=u,i.uri=tg.XMLNS,e.startPrefixMapping(h,u))}for(var m=r.length;m--;){i=r[m];var l=i.prefix;l&&(l==="xml"&&(i.uri=tg.XML),l!=="xmlns"&&(i.uri=t[l||""]))}var g=n.indexOf(":");g>0?(l=r.prefix=n.slice(0,g),f=r.localName=n.slice(g+1)):(l=null,f=r.localName=n);var w=r.uri=t[l||""];if(e.startElement(w,f,n,r),r.closed){if(e.endElement(w,f,n),s)for(l in s)Object.prototype.hasOwnProperty.call(s,l)&&e.endPrefixMapping(l)}else return r.currentNSMap=t,r.localNSMap=s,!0}o(XL,"appendElement");function Tee(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}o(Tee,"parseHtmlSpecialContent");function Iee(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}o(Iee,"fixSelfClosed");function WL(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}o(WL,"_copy");function Bee(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=_ee(r,e),u=a.length;if(u>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],f=!1,h=!1;u>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],h=u>4&&a[4][0]):/^system$/i.test(a[2][0])&&(h=a[3][0]));var m=a[u-1];return t.startDTD(l,f,h),t.endDTD(),m.index+m[0].length}}return-1}o(Bee,"parseDCC");function Dee(r,e,t){var n=r.indexOf("?>",e);if(n){var s=r.substring(e,n).match(/^<\?(\S*)\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}o(Dee,"parseInstruction");function JL(){this.attributeNames={}}o(JL,"ElementAttributes");JL.prototype={setTagName:o(function(r){if(!KL.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},"setTagName"),addValue:o(function(r,e,t){if(!KL.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:o(function(r){return this[r].localName},"getLocalName"),getLocator:o(function(r){return this[r].locator},"getLocator"),getQName:o(function(r){return this[r].qName},"getQName"),getURI:o(function(r){return this[r].uri},"getURI"),getValue:o(function(r){return this[r].value},"getValue")};function _ee(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}o(_ee,"split");YN.XMLReader=GL;YN.ParseError=Ep});var n8=ye(US=>{"use strict";var Ree=Km(),Pee=JN(),YL=qL(),e8=zL(),Oee=Pee.DOMImplementation,QL=Ree.NAMESPACE,kee=e8.ParseError,Lee=e8.XMLReader;function t8(r){return r.replace(/\r[\n\u0085]/g,`
65
- `).replace(/[\r\u0085\u2028]/g,`
66
- `)}o(t8,"normalizeLineEndings");function r8(r){this.options=r||{locator:{}}}o(r8,"DOMParser");r8.prototype.parseFromString=function(r,e){var t=this.options,n=new Lee,s=t.domBuilder||new rg,i=t.errorHandler,a=t.locator,u=t.xmlns||{},l=/\/x?html?$/.test(e),f=l?YL.HTML_ENTITIES:YL.XML_ENTITIES;a&&s.setDocumentLocator(a),n.errorHandler=Vee(i,s,a),n.domBuilder=t.domBuilder||s,l&&(u[""]=QL.HTML),u.xml=u.xml||QL.XML;var h=t.normalizeLineEndings||t8;return r&&typeof r=="string"?n.parse(h(r),u,f):n.errorHandler.error("invalid doc source"),s.doc};function Vee(r,e,t){if(!r){if(e instanceof rg)return e;r=e}var n={},s=r instanceof Function;t=t||{};function i(a){var u=r[a];!u&&s&&(u=r.length==2?function(l){r(a,l)}:r),n[a]=u&&function(l){u("[xmldom "+a+"] "+l+QN(t))}||function(){}}return o(i,"build"),i("warning"),i("error"),i("fatalError"),n}o(Vee,"buildErrorHandler");function rg(){this.cdata=!1}o(rg,"DOMHandler");function Ap(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}o(Ap,"position");rg.prototype={startDocument:o(function(){this.doc=new Oee().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},"startDocument"),startElement:o(function(r,e,t,n){var s=this.doc,i=s.createElementNS(r,t||e),a=n.length;VS(this,i),this.currentElement=i,this.locator&&Ap(this.locator,i);for(var u=0;u<a;u++){var r=n.getURI(u),l=n.getValue(u),t=n.getQName(u),f=s.createAttributeNS(r,t);this.locator&&Ap(n.getLocator(u),f),f.value=f.nodeValue=l,i.setAttributeNode(f)}},"startElement"),endElement:o(function(r,e,t){var n=this.currentElement,s=n.tagName;this.currentElement=n.parentNode},"endElement"),startPrefixMapping:o(function(r,e){},"startPrefixMapping"),endPrefixMapping:o(function(r){},"endPrefixMapping"),processingInstruction:o(function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&Ap(this.locator,t),VS(this,t)},"processingInstruction"),ignorableWhitespace:o(function(r,e,t){},"ignorableWhitespace"),characters:o(function(r,e,t){if(r=ZL.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&&Ap(this.locator,n)}},"characters"),skippedEntity:o(function(r){},"skippedEntity"),endDocument:o(function(){this.doc.normalize()},"endDocument"),setDocumentLocator:o(function(r){(this.locator=r)&&(r.lineNumber=0)},"setDocumentLocator"),comment:o(function(r,e,t){r=ZL.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&Ap(this.locator,n),VS(this,n)},"comment"),startCDATA:o(function(){this.cdata=!0},"startCDATA"),endCDATA:o(function(){this.cdata=!1},"endCDATA"),startDTD:o(function(r,e,t){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(r,e,t);this.locator&&Ap(this.locator,s),VS(this,s),this.doc.doctype=s}},"startDTD"),warning:o(function(r){console.warn("[xmldom warning] "+r,QN(this.locator))},"warning"),error:o(function(r){console.error("[xmldom error] "+r,QN(this.locator))},"error"),fatalError:o(function(r){throw new kee(r,this.locator)},"fatalError")};function QN(r){if(r)return`
67
- @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}o(QN,"_locator");function ZL(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}o(ZL,"_toString");"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){rg.prototype[r]=function(){return null}});function VS(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}o(VS,"appendElement");US.__DOMHandler=rg;US.normalizeLineEndings=t8;US.DOMParser=r8});var ZN=ye(MS=>{"use strict";var s8=JN();MS.DOMImplementation=s8.DOMImplementation;MS.XMLSerializer=s8.XMLSerializer;MS.DOMParser=n8().DOMParser});var i8=ye(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});FS.EnvelopedSignature=void 0;var jS=TS(),eT=fp(),Uee=class{static{o(this,"EnvelopedSignature")}constructor(){this.includeComments=!1,this.includeComments=!1}process(e,t){if(t.signatureNode==null){let i=jS.select1("./*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);return eT.isNodeLike(i)&&i.parentNode&&i.parentNode.removeChild(i),e}let n=t.signatureNode,s=jS.select1(".//*[local-name(.)='SignatureValue']/text()",n);if(eT.isTextNode(s)){let i=s.data,a=jS.select(".//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);for(let u of Array.isArray(a)?a:[]){let l=jS.select1(".//*[local-name(.)='SignatureValue']/text()",u);if(eT.isTextNode(l)){let f=l.data;i===f&&u.parentNode&&u.parentNode.removeChild(u)}}}return e}getAlgorithmName(){return"http://www.w3.org/2000/09/xmldsig#enveloped-signature"}};FS.EnvelopedSignature=Uee});var a8=ye(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.Sha512=ju.Sha256=ju.Sha1=void 0;var tT=wt("crypto"),Mee=class{static{o(this,"Sha1")}constructor(){this.getHash=function(e){let t=tT.createHash("sha1");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2000/09/xmldsig#sha1"}}};ju.Sha1=Mee;var jee=class{static{o(this,"Sha256")}constructor(){this.getHash=function(e){let t=tT.createHash("sha256");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha256"}}};ju.Sha256=jee;var Fee=class{static{o(this,"Sha512")}constructor(){this.getHash=function(e){let t=tT.createHash("sha512");return t.update(e,"utf8"),t.digest("base64")},this.getAlgorithmName=function(){return"http://www.w3.org/2001/04/xmlenc#sha512"}}};ju.Sha512=Fee});var rT=ye(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});qS.createOptionalCallbackFunction=void 0;function qee(r){return typeof r=="function"}o(qee,"isErrorFirstCallback");function Hee(r){return(...e)=>{let t=e[e.length-1];if(qee(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)}}o(Hee,"createOptionalCallbackFunction");qS.createOptionalCallbackFunction=Hee});var o8=ye(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.HmacSha1=Va.RsaSha512=Va.RsaSha256=Va.RsaSha1=void 0;var Fu=wt("crypto"),qu=rT(),Kee=class{static{o(this,"RsaSha1")}constructor(){this.getSignature=(0,qu.createOptionalCallbackFunction)((e,t)=>{let n=Fu.createSign("RSA-SHA1");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,qu.createOptionalCallbackFunction)((e,t,n)=>{let s=Fu.createVerify("RSA-SHA1");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2000/09/xmldsig#rsa-sha1"}};Va.RsaSha1=Kee;var $ee=class{static{o(this,"RsaSha256")}constructor(){this.getSignature=(0,qu.createOptionalCallbackFunction)((e,t)=>{let n=Fu.createSign("RSA-SHA256");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,qu.createOptionalCallbackFunction)((e,t,n)=>{let s=Fu.createVerify("RSA-SHA256");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"}};Va.RsaSha256=$ee;var Xee=class{static{o(this,"RsaSha512")}constructor(){this.getSignature=(0,qu.createOptionalCallbackFunction)((e,t)=>{let n=Fu.createSign("RSA-SHA512");return n.update(e),n.sign(t,"base64")}),this.verifySignature=(0,qu.createOptionalCallbackFunction)((e,t,n)=>{let s=Fu.createVerify("RSA-SHA512");return s.update(e),s.verify(t,n,"base64")}),this.getAlgorithmName=()=>"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"}};Va.RsaSha512=Xee;var Gee=class{static{o(this,"HmacSha1")}constructor(){this.getSignature=(0,qu.createOptionalCallbackFunction)((e,t)=>{let n=Fu.createHmac("SHA1",t);return n.update(e),n.digest("base64")}),this.verifySignature=(0,qu.createOptionalCallbackFunction)((e,t,n)=>{let s=Fu.createHmac("SHA1",t);return s.update(e),s.digest("base64")===n}),this.getAlgorithmName=()=>"http://www.w3.org/2000/09/xmldsig#hmac-sha1"}};Va.HmacSha1=Gee});var c8=ye(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});KS.SignedXml=void 0;var Ws=fp(),Ic=ZN(),Wee=wt("util"),Ai=TS(),u8=ON(),Jee=i8(),l8=VN(),nT=a8(),HS=o8(),pr=Hm(),sT=class Cp{static{o(this,"SignedXml")}constructor(e={}){this.signatureAlgorithm=void 0,this.canonicalizationAlgorithm=void 0,this.inclusiveNamespacesPrefixList=[],this.namespaceResolver={lookupNamespaceURI:o(function(){throw new Error("Not implemented")},"lookupNamespaceURI")},this.implicitTransforms=[],this.keyInfoAttributes={},this.getKeyInfoContent=Cp.getKeyInfoContent,this.getCertFromKeyInfo=Cp.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":u8.C14nCanonicalization,"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments":u8.C14nCanonicalizationWithComments,"http://www.w3.org/2001/10/xml-exc-c14n#":l8.ExclusiveCanonicalization,"http://www.w3.org/2001/10/xml-exc-c14n#WithComments":l8.ExclusiveCanonicalizationWithComments,"http://www.w3.org/2000/09/xmldsig#enveloped-signature":Jee.EnvelopedSignature},this.HashAlgorithms={"http://www.w3.org/2000/09/xmldsig#sha1":nT.Sha1,"http://www.w3.org/2001/04/xmlenc#sha256":nT.Sha256,"http://www.w3.org/2001/04/xmlenc#sha512":nT.Sha512},this.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#rsa-sha1":HS.RsaSha1,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256":HS.RsaSha256,"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512":HS.RsaSha512};let{idMode:t,idAttribute:n,privateKey:s,publicCert:i,signatureAlgorithm:a,canonicalizationAlgorithm:u,inclusiveNamespacesPrefixList:l,implicitTransforms:f,keyInfoAttributes:h,getKeyInfoContent:m,getCertFromKeyInfo:g}=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=u,typeof l=="string"?this.inclusiveNamespacesPrefixList=l.split(" "):pr.isArrayHasLength(l)&&(this.inclusiveNamespacesPrefixList=l),this.implicitTransforms=f??this.implicitTransforms,this.keyInfoAttributes=h??this.keyInfoAttributes,this.getKeyInfoContent=m??this.getKeyInfoContent,this.getCertFromKeyInfo=g??Cp.noop,this.CanonicalizationAlgorithms,this.HashAlgorithms,this.SignatureAlgorithms}enableHMAC(){this.SignatureAlgorithms={"http://www.w3.org/2000/09/xmldsig#hmac-sha1":HS.HmacSha1},this.getKeyInfoContent=Cp.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(pr.EXTRACT_X509_CERTS)||[]),s.length>0&&(n=s.map(i=>`<${t}X509Certificate>${pr.pemToDer(i).toString("base64")}</${t}X509Certificate>`).join("")),`<${t}X509Data>${n}</${t}X509Data>`}static getCertFromKeyInfo(e){if(e!=null){let t=Ai.select1(".//*[local-name(.)='X509Certificate']",e);if(Ws.isNodeLike(t))return pr.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 Ic.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 Ic.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 u=pr.findChildren(a,"Reference");if(!pr.isArrayHasLength(u)){if(t){t(new Error("could not find any Reference elements"),!1);return}throw new Error("could not find any Reference elements")}for(let m of u)this.loadReference(m);if(!this.getReferences().every(m=>this.validateReference(m,n))){if(this.signedReferences=[],this.references.forEach(m=>{m.signedReference=void 0}),t){t(new Error("Could not validate all references"),!1);return}return!1}let l=this.findSignatureAlgorithm(this.signatureAlgorithm),f=this.getCertFromKeyInfo(this.keyInfo)||this.publicCert||this.privateKey;if(f==null)throw new Error("KeyInfo or publicCert or privateKey is required to validate signature");if(l.verifySignature(s,f,this.signatureValue)===!0)if(t)t(null,!0);else return!0;else if(this.signedReferences=[],this.references.forEach(m=>{m.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=pr.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:pr.findAncestorNs(e,"//*[local-name()='SignedInfo']")};return this.getCanonXml([this.canonicalizationAlgorithm],t[0],s)}getCanonReferenceXml(e,t,n){Array.isArray(t.transforms)&&(t.ancestorNamespaces=pr.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=Ai.select1(e,t);Ws.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 f of this.idAttributes){let h=n.getAttribute(f);if(i===h){s.xpath=`//*[@*[local-name(.)='${f}']='${i}']`;break}}let a=this.getCanonReferenceXml(t,s,n),l=this.findHashAlgorithm(s.digestAlgorithm).getHash(a);if(pr.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=Ai.select1("//*",t);else{if(n?.indexOf("'")!==-1)throw new Error("Cannot validate a uri with quotes inside it");{let l=0;for(let f of this.idAttributes){let h=`//*[@*[local-name(.)='${f}']='${n}']`,m=Ai.select(h,t);if(pr.isArrayHasLength(m)){if(l+=m.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=m[0],e.xpath=h}}}}if(e.getValidatedNode=(0,Wee.deprecate)(l=>{if(l=l||e.xpath,typeof l!="string"||e.validationError!=null)return null;let f=Ai.select1(l,t);return Ws.isNodeLike(f)?f:null},"`ref.getValidatedNode()` is deprecated and insecure. Use `ref.signedReference` or `this.getSignedReferences()` instead."),!Ws.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),u=this.findHashAlgorithm(e.digestAlgorithm).getHash(i);if(!pr.validateDigestValue(u,e.digestValue)){let l=new Error(`invalid signature: for uri ${e.uri} calculated digest is ${u} 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=Ai.select("//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",e);return Ws.isArrayOfNodes(t)?t:[]}loadSignature(e){typeof e=="string"?this.signatureNode=e=new Ic.DOMParser().parseFromString(e):this.signatureNode=e,this.signatureXml=e.toString();let t=Ai.select1(".//*[local-name(.)='CanonicalizationMethod']/@Algorithm",e);if(!Ws.isNodeLike(t))throw new Error("could not find CanonicalizationMethod/@Algorithm element");Ws.isAttributeNode(t)&&(this.canonicalizationAlgorithm=t.value);let n=Ai.select1(".//*[local-name(.)='SignatureMethod']/@Algorithm",e);Ws.isAttributeNode(n)&&(this.signatureAlgorithm=n.value);let s=pr.findChildren(this.signatureNode,"SignedInfo");if(!pr.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 Ic.DOMParser().parseFromString(a,"text/xml").documentElement;this.references=[];let f=pr.findChildren(l,"Reference");if(!pr.isArrayHasLength(f))throw new Error("could not find any Reference elements");for(let g of f)this.loadReference(g);let h=Ai.select1(".//*[local-name(.)='SignatureValue']/text()",e);Ws.isTextNode(h)&&(this.signatureValue=h.data.replace(/\r?\n/g,""));let m=Ai.select1(".//*[local-name(.)='KeyInfo']",e);Ws.isNodeLike(m)&&(this.keyInfo=m)}loadReference(e){let t=pr.findChildren(e,"DigestMethod");if(t.length===0)throw new Error(`could not find DigestMethod in reference ${e.toString()}`);let n=t[0],s=pr.findAttr(n,"Algorithm");if(!s)throw new Error(`could not find Algorithm attribute in node ${n.toString()}`);let i=s.value;if(t=pr.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 u=[],l=[];if(t=pr.findChildren(e,"Transforms"),t.length!==0){let h=t[0],m=pr.findChildren(h,"Transform");for(let w of m){let y=pr.findAttr(w,"Algorithm");y&&u.push(y.value)}let g=pr.findChildren(m[m.length-1],"InclusiveNamespaces");pr.isArrayHasLength(g)&&(l=g.flatMap(w=>(w.getAttribute("PrefixList")??"").split(" ")).filter(w=>w.length>0))}pr.isArrayHasLength(this.implicitTransforms)&&this.implicitTransforms.forEach(function(h){u.push(h)}),(u.length===0||u[u.length-1]==="http://www.w3.org/2000/09/xmldsig#enveloped-signature")&&u.push("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");let f=Ws.isElementNode(e)&&e.getAttribute("URI")||void 0;this.addReference({transforms:u,digestAlgorithm:i,uri:f,digestValue:a,inclusiveNamespacesPrefixList:l,isEmptyUri:!1})}addReference({xpath:e,transforms:t,digestAlgorithm:n,uri:s="",digestValue:i,inclusiveNamespacesPrefixList:a=[],isEmptyUri:u=!1}){if(n==null)throw new Error("digestAlgorithm is required");if(!pr.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:u,getValidatedNode:o(()=>{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 Ic.DOMParser().parseFromString(e),a="xmlns",u=[],l,f=["append","prepend","before","after"],h=t.prefix,m=t.attrs||{},g=t.location||{},w=t.existingPrefixes||{};if(this.namespaceResolver={lookupNamespaceURI:o(function(B){return B?w[B]:null},"lookupNamespaceURI")},g.reference=g.reference||"/*",g.action=g.action||"append",f.indexOf(g.action)===-1){let B=new Error(`location.action option has an invalid action: ${g.action}, must be any of the following values: ${f.join(", ")}`);if(s){s(B);return}else throw B}h?(a+=`:${h}`,l=`${h}:`):l="",Object.keys(m).forEach(function(B){B!=="xmlns"&&B!==a&&u.push(`${B}="${m[B]}"`)}),u.push(`${a}="http://www.w3.org/2000/09/xmldsig#"`);let y=`<${l}Signature ${u.join(" ")}>`;y+=this.createSignedInfo(i,h),y+=this.getKeyInfo(h),y+=`</${l}Signature>`,this.originalXmlWithIds=i.toString();let S="";Object.keys(w).forEach(function(B){S+=`xmlns:${B}="${w[B]}" `});let E=`<Dummy ${S}>${y}</Dummy>`,T=new Ic.DOMParser().parseFromString(E).documentElement.firstChild,A=Ai.select1(g.reference,i);if(!Ws.isNodeLike(A)){let B=new Error(`the following xpath cannot be used because it was not found: ${g.reference}`);if(s){s(B);return}else throw B}if(g.action==="append")A.appendChild(T);else if(g.action==="prepend")A.insertBefore(T,A.firstChild);else if(g.action==="before"){if(A.parentNode==null)throw new Error("`location.reference` refers to the root node (by default), so we can't insert `before`");A.parentNode.insertBefore(T,A)}else if(g.action==="after"){if(A.parentNode==null)throw new Error("`location.reference` refers to the root node (by default), so we can't insert `after`");A.parentNode.insertBefore(T,A.nextSibling)}this.signatureNode=T;let C=pr.findChildren(this.signatureNode,"SignedInfo");if(C.length===0){let B=new Error("could not find SignedInfo element in the message");if(s){s(B);return}else throw B}let x=C[0];typeof s=="function"?this.calculateSignatureValue(i,(B,F)=>{B?s(B):(this.signatureValue=F||"",T.insertBefore(this.createSignature(h),x.nextSibling),this.signatureXml=T.toString(),this.signedXml=i.toString(),s(null,this))}):(this.calculateSignatureValue(i),T.insertBefore(this.createSignature(h),x.nextSibling),this.signatureXml=T.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=Ai.selectWithResolver(s.xpath??"",e,this.namespaceResolver);if(!pr.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 f=this.ensureHasId(a);s.uri=f,n+=`<${t}Reference URI="#${f}">`}n+=`<${t}Transforms>`;for(let f of s.transforms||[]){let h=this.findCanonicalizationAlgorithm(f);n+=`<${t}Transform Algorithm="${h.getAlgorithmName()}"`,pr.isArrayHasLength(s.inclusiveNamespacesPrefixList)?(n+=">",n+=`<InclusiveNamespaces PrefixList="${s.inclusiveNamespacesPrefixList.join(" ")}" xmlns="${h.getAlgorithmName()}"/>`,n+=`</${t}Transform>`):n+=" />"}let u=this.getCanonReferenceXml(e,s,a),l=this.findHashAlgorithm(s.digestAlgorithm);n+=`</${t}Transforms><${t}DigestMethod Algorithm="${l.getAlgorithmName()}" /><${t}DigestValue>${l.getHash(u)}</${t}DigestValue></${t}Reference>`}}return n}getCanonXml(e,t,n={}){n.defaultNsForPrefix=n.defaultNsForPrefix??Cp.defaultNsForPrefix,n.signatureNode=this.signatureNode;let i=t.cloneNode(!0);return e.forEach(a=>{Ws.isNodeLike(i)&&(i=this.findCanonicalizationAlgorithm(a).process(i,n))}),i.toString()}ensureHasId(e){let t;if(this.idMode==="wssecurity"?t=pr.findAttr(e,"Id","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"):this.idAttributes.some(s=>(t=pr.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()}"`,pr.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 Ic.DOMParser().parseFromString(s).documentElement.firstChild}getSignatureXml(){return this.signatureXml}getOriginalXmlWithIds(){return this.originalXmlWithIds}getSignedXml(){return this.signedXml}};KS.SignedXml=sT;sT.defaultNsForPrefix={ds:"http://www.w3.org/2000/09/xmldsig#"};sT.noop=()=>null});var iT=ye(In=>{"use strict";var zee=In&&In.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),f8=In&&In.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&zee(e,r,t)};Object.defineProperty(In,"__esModule",{value:!0});In.SignedXml=In.ExclusiveCanonicalizationWithComments=In.ExclusiveCanonicalization=In.C14nCanonicalizationWithComments=In.C14nCanonicalization=void 0;var h8=ON();Object.defineProperty(In,"C14nCanonicalization",{enumerable:!0,get:o(function(){return h8.C14nCanonicalization},"get")});Object.defineProperty(In,"C14nCanonicalizationWithComments",{enumerable:!0,get:o(function(){return h8.C14nCanonicalizationWithComments},"get")});var p8=VN();Object.defineProperty(In,"ExclusiveCanonicalization",{enumerable:!0,get:o(function(){return p8.ExclusiveCanonicalization},"get")});Object.defineProperty(In,"ExclusiveCanonicalizationWithComments",{enumerable:!0,get:o(function(){return p8.ExclusiveCanonicalizationWithComments},"get")});var Yee=c8();Object.defineProperty(In,"SignedXml",{enumerable:!0,get:o(function(){return Yee.SignedXml},"get")});f8(rT(),In);f8(Hm(),In)});var g8=ye(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});XS.WSSecurityCert=void 0;var Qee=wt("crypto"),Zee=iT();function ete(r,e){return new Date(r.getTime()+e*6e4)}o(ete,"addMinutes");function d8(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"}o(d8,"dateStringForSOAP");function tte(){return d8(new Date)}o(tte,"generateCreated");function rte(){return d8(ete(new Date,10))}o(rte,"generateExpires");function $S(r,e,t){return[e.slice(0,t),r,e.slice(t)].join("")}o($S,"insertStr");function nte(){return(0,Qee.randomUUID)().replace(/-/gm,"")}o(nte,"generateId");function ste(r,e){for(let t of r)t.xpath===m8&&(t.xpath=e)}o(ste,"resolvePlaceholderInReferences");var Hu="http://docs.oasis-open.org/wss/2004/01",m8="[[bodyXpath]]",ite=class{static{o(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 Zee.SignedXml({idMode:s?.signerOptions?.idMode,signatureAlgorithm:s?.signatureAlgorithm}),this.signer.digestAlgorithm=s.digestAlgorithm??"http://www.w3.org/2001/04/xmlenc#sha256",s.signatureAlgorithm==="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"&&(this.signer.signatureAlgorithm=s.signatureAlgorithm,this.signer.addReference({xpath:m8,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=`${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`)}else this.signerOptions={existingPrefixes:{wsse:`${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd`}};this.signer.privateKey={key:e,passphrase:n},this.x509Id=`x509-${nte()}`,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="${Hu}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>`}postProcess(e,t){this.created=tte(),this.expires=rte();let n="";this.hasTimeStamp&&(n=`<Timestamp xmlns="${Hu}/oasis-200401-wss-wssecurity-utility-1.0.xsd"><Created>${this.created}</Created><Expires>${this.expires}</Expires></Timestamp>`);let s=`<wsse:BinarySecurityToken EncodingType="${Hu}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="${Hu}/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>`+n,i,a=`xmlns:wsse="${Hu}/oasis-200401-wss-wssecurity-secext-1.0.xsd"`,u=`xmlns:wsu="${Hu}/oasis-200401-wss-wssecurity-utility-1.0.xsd"`,l=e.indexOf("</wsse:Security>");if(l>-1){let y=/<wsse:Security( [^>]*)?>/,S=e.match(y),E="";S[0].includes(` ${t}:mustUnderstand="`)||(E+=`${t}:mustUnderstand="1" `),S[0].includes(a.substring(0,a.indexOf("=")))||(E+=`${a} `),S[0].includes(u.substring(0,a.indexOf("=")))||(E+=`${u} `);let b="<wsse:Security ",T=e.indexOf(b);e=$S(s,e,l),i=$S(E,e,T+b.length)}else{let y=`<wsse:Security ${a} ${u} ${t}:mustUnderstand="1">`+s+"</wsse:Security>";i=$S(y,e,e.indexOf(`</${t}:Header>`))}let f=this.signatureTransformations,h=`//*[name(.)='${t}:Body']`;ste(this.signer.references,h),!this.excludeReferencesFromSigning.some(y=>y==="Body")&&!(this.signer.references.filter(y=>y.xpath===h).length>0)&&this.signer.addReference({xpath:h,transforms:f,digestAlgorithm:this.signer.digestAlgorithm});for(let y of this.additionalReferences){let S=`//*[name(.)='${y}']`;!this.excludeReferencesFromSigning.some(E=>E===y)&&!(this.signer.references.filter(E=>E.xpath===S).length>0)&&this.signer.addReference({xpath:S,transforms:f,digestAlgorithm:this.signer.digestAlgorithm})}let m="//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']";!this.excludeReferencesFromSigning.some(y=>y==="Timestamp")&&this.hasTimeStamp&&!(this.signer.references.filter(y=>y.xpath===m).length>0)&&this.signer.addReference({xpath:m,transforms:f,digestAlgorithm:this.signer.digestAlgorithm}),this.signer.computeSignature(i,this.signerOptions);let g=this.signer.getOriginalXmlWithIds(),w=this.signer.getSignatureXml();return $S(w,g,g.indexOf("</wsse:Security>"))}};XS.WSSecurityCert=ite});var S8=ye(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});GS.WSSecurityCertWithToken=void 0;var ate=wt("crypto"),ote=iT();function ute(r,e){return new Date(r.getTime()+e*6e4)}o(ute,"addMinutes");function v8(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"}o(v8,"dateStringForSOAP");function lte(){return v8(new Date)}o(lte,"generateCreated");function cte(){return v8(ute(new Date,10))}o(cte,"generateExpires");function y8(r,e,t){return[e.slice(0,t),r,e.slice(t)].join("")}o(y8,"insertStr");function fte(){return(0,ate.randomUUID)().replace(/-/gm,"")}o(fte,"generateId");function hte(r,e){for(let t of r)t.xpath===w8&&(t.xpath=e)}o(hte,"resolvePlaceholderInReferences");var Ku="http://docs.oasis-open.org/wss/2004/01",w8="[[bodyXpath]]",pte=class{static{o(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 ote.SignedXml;let t=e.options||{};if(t.signatureAlgorithm==="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"&&(this.signer.signatureAlgorithm=t.signatureAlgorithm,this.signer.addReference({xpath:w8,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=`${Ku}/oasis-200401-wss-wssecurity-secext-1.0.xsd`)}else this.signerOptions={existingPrefixes:{wsse:`${Ku}/oasis-200401-wss-wssecurity-secext-1.0.xsd`}};this.signer.privateKey={key:e.privateKey,passphrase:e.keyPassword},this.x509Id=`x509-${fte()}`,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="${Ku}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/></wsse:SecurityTokenReference>`}postProcess(e,t){this.created=lte(),this.expires=cte();let n="";this.hasTimeStamp&&(n=`<Timestamp xmlns="${Ku}/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="${Ku}/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="${Ku}/oasis-200401-wss-wssecurity-utility-1.0.xsd" ${t}:mustUnderstand="1"><wsse:BinarySecurityToken EncodingType="${Ku}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="${Ku}/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>`+s+n+"</wsse:Security>",a=y8(i,e,e.indexOf(`</${t}:Header>`)),u=this.signatureTransformations,l=`//*[name(.)='${t}:Body']`;hte(this.signer.references,l),this.signer.references.filter(h=>h.xpath===l).length>0||this.signer.addReference({xpath:l,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"});for(let h of this.additionalReferences){let m=`//*[name(.)='${h}']`;this.signer.references.filter(g=>g.xpath===m).length>0||this.signer.addReference({xpath:m,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"})}let f="//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']";return this.hasTimeStamp&&!(this.signer.references.filter(h=>h.xpath===f).length>0)&&this.signer.addReference({xpath:f,transforms:u,digestAlgorithm:"http://www.w3.org/2001/04/xmlenc#sha256"}),this.signer.computeSignature(a,this.signerOptions),y8(this.signer.getSignatureXml(),a,a.indexOf("</wsse:Security>"))}};GS.WSSecurityCertWithToken=pte});var E8=ye(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});WS.WSSecurityPlusCert=void 0;var dte=class{static{o(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)}};WS.WSSecurityPlusCert=dte});var aT=ye(ps=>{"use strict";var mte=ps&&ps.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ao=ps&&ps.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&mte(e,r,t)};Object.defineProperty(ps,"__esModule",{value:!0});Ao(zk(),ps);Ao(Qk(),ps);Ao(tL(),ps);Ao(nL(),ps);Ao(sL(),ps);Ao(iL(),ps);Ao(g8(),ps);Ao(S8(),ps);Ao(E8(),ps)});var oT=ye(Ci=>{"use strict";var gte=Ci&&Ci.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yte=Ci&&Ci.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),vte=Ci&&Ci.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&gte(t,e,n[s]);return yte(t,e),t}})(),wte=Ci&&Ci.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.Server=void 0;var Ste=wt("events"),JS=vte(wt("url")),Ete=wte(wt("zlib"));function Ate(r){return typeof r.route=="function"&&typeof r.use=="function"}o(Ate,"isExpress");function A8(r){return!!r&&typeof r.then=="function"}o(A8,"isPromiseLike");function C8(r){function e(t){return t<10?"0"+t:t}return o(e,"pad"),r.getUTCFullYear()+"-"+e(r.getUTCMonth()+1)+"-"+e(r.getUTCDate())+"T"+e(r.getUTCHours())+":"+e(r.getUTCMinutes())+":"+e(r.getUTCSeconds())+"Z"}o(C8,"getDateString");var Cte=class extends Ste.EventEmitter{static{o(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:()=>{},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(Ate(e))e.route(t).all((u,l)=>{if(typeof this.authorizeConnection=="function"&&!this.authorizeConnection(u,l)){l.end();return}this._requestListener(u,l)}),this.callback(a,this);else{let u=e.listeners("request").slice();e.removeAllListeners("request"),e.addListener("request",(l,f)=>{if(typeof this.authorizeConnection=="function"&&!this.authorizeConnection(l,f)){f.end();return}let h=JS.parse(l.url).pathname;if(h[h.length-1]!=="/"&&(h+="/"),t===h||t instanceof RegExp&&h.match(t))this._requestListener(l,f);else for(let m=0,g=u.length;m<g;m++)u[m].call(this,l,f)}),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}_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 u=e.apply(null,[...a]);return typeof u=="object"?i.wsdl.objectToXML(u,t,n,s,!0):u}}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}_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,u)=>{this._sendHttpResponse(t,u||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=JS.parse(e.url).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,u=e;e.headers["content-encoding"]==="gzip"&&(a=Ete.default.createGunzip(),e.pipe(a),u=a),u.on("data",l=>{i.push(l)}),u.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=JS.parse(t.url).pathname.replace(/\/$/,""),a=this.wsdl.xmlToObject(e),u=a.Body,l=a.Header,f,h,m,g,w=a.Header&&a.Header.Security&&a.Header.Security.Timestamp,y=this.authenticate||o(function(){return!0},"defaultAuthenticate"),S=o((b,T)=>{let A={result:b};this.emit("response",A,h),s(A.result,T)},"callback"),E=o(()=>{if(typeof this.log=="function"&&this.log("info","Attempting to bind to "+i,t),!u)throw new Error("Failed to parse the SOAP Message body");if(f=(()=>{let b=this.wsdl.definitions.services,T,A;for(A in b){m=A;let x=b[m].ports;for(A in x){g=A;let B=x[g],F=JS.parse(B.location).pathname.replace(/\/$/,"");if(typeof this.log=="function"&&this.log("info","Trying "+g+" from path "+F,t),F===i)return B.binding;T||(T=B)}}return T?T.binding:void 0})(),!f)throw new Error("Failed to bind to WSDL");try{let b=this._getSoapAction(t),T=Object.keys(u)[0]==="attributes"?Object.keys(u)[1]:Object.keys(u)[0],A=f.topElements[T];b?h=this._getMethodNameBySoapAction(f,b):h=A?A.methodName:T;let C=f.methods[h].style||f.style;this.emit("request",a,h),l&&this.emit("headers",l,h),C==="rpc"?this._executeMethod({serviceName:m,portName:g,methodName:h,outputName:T+"Response",args:u[T],headers:l,style:"rpc"},t,n,S):this._executeMethod({serviceName:m,portName:g,methodName:h,outputName:A.outputName,args:u[T],headers:l,style:"document"},t,n,S,w)}catch(b){if(b.Fault!==void 0)return this._sendError(b.Fault,S,w);throw b}},"process");if(typeof y=="function"){let b=!1,T=o(C=>{if(!b){if(b=!0,C instanceof Error)return this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:C.toString()},statusCode:500},S,w);if(typeof C=="boolean")if(C===!0)try{E()}catch(x){return x.Fault!==void 0?this._sendError(x.Fault,S,w):this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:x.toString()},statusCode:500},S,w)}else return this._sendError({Code:{Value:"SOAP-ENV:Client",Subcode:{Value:"AuthenticationFailure"}},Reason:{Text:"Invalid username or password"},statusCode:401},S,w)}},"processAuthResult"),A=y(a.Header&&a.Header.Security,T,t,a);A8(A)&&A.then(C=>{T(C)},C=>{T(C)}),typeof A=="boolean"&&T(A)}else throw new Error("Invalid authenticate function (not a function)")}_getMethodNameBySoapAction(e,t){for(let n in e.methods)if(e.methods[n].soapAction===t)return n}_executeMethod(e,t,n,s,i){e=e||{};let a,u,l,f=e.serviceName,h=e.portName,m=this.wsdl.definitions.services[f].ports[h].binding,g=e.methodName,w=e.outputName,y=e.args,S=e.style;this.soapHeaders&&(l=this.soapHeaders.map(C=>typeof C=="function"?C(g,y,e.headers,t,n,this):C).join(`
68
- `));try{a=this.services[f][h][g]}catch{return s(this._envelope("",l,i))}let E=!1,b=o((C,x)=>{if(!E){if(E=!0,C)return C.Fault!==void 0?this._sendError(C.Fault,s,i):this._sendError({Code:{Value:"SOAP-ENV:Server",Subcode:{Value:"InternalServerError"}},Reason:{Text:C.toString()},statusCode:500},s,i);if(S==="rpc")u=this.wsdl.objectToRpcXML(w,x,"",this.wsdl.definitions.$targetNamespace);else if(S==="document"){let B=m.methods[g].output;u=this.wsdl.objectToDocumentXML(w,x,B.targetNSAlias,B.targetNamespace)}else{let B=m.methods[g].output,F=B.$targetNamespace,R=w;F&&(R=`${F}:${R}`),u=this.wsdl.objectToDocumentXML(R,x,B.targetNSAlias,B.targetNamespace)}s(this._envelope(u,l,i))}},"handleResult");m.methods[g].output||(E=!0,u="",this.onewayOptions.emptyBody&&(u=this._envelope("",l,i)),s(u,this.onewayOptions.responseCode));let T=o((C,x)=>{C&&C.Fault!==void 0||x===void 0&&(x=C,C=null),b(C,x)},"methodCallback"),A=a.apply(this,[y,T,e.headers,t,n]);typeof A<"u"&&(A8(A)?A.then(C=>{b(null,C)},C=>{b(C)}):b(null,A))}_envelope(e,t,n){let a='<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="'+(this.wsdl.options.forceSoap12Headers?"http://www.w3.org/2003/05/soap-envelope":"http://schemas.xmlsoap.org/soap/envelope/")+'" '+this.wsdl.xmlnsInEnvelope+">";if(t=t||"",n){let u=new Date,l=C8(u),f=C8(new Date(u.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>'+l+"</u:Created> <u:Expires>"+f+`</u:Expires> </u:Timestamp> </o:Security>
69
- `}return t!==""&&(a+="<soap:Header>"+t+"</soap:Header>"),a+=e?"<soap:Body>"+e+"</soap:Body>":"<soap:Body/>",a+="</soap:Envelope>",a}_sendError(e,t,n){let s,i;return e.statusCode&&(i=e.statusCode,e.statusCode=void 0),"faultcode"in e?s=this.wsdl.objectToDocumentXML("soap:Fault",e,void 0):s=this.wsdl.objectToDocumentXML("Fault",e,"soap"),t(this._envelope(s,"",n),i)}_sendHttpResponse(e,t,n){t&&(e.statusCode=t),this.enableChunkedEncoding?(e.write(n),e.end()):e.end(n)}};Ci.Server=Cte});var uT=ye(zS=>{"use strict";(function(r){r.parser=function(O,_){return new t(O,_)},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(O,_){if(!(this instanceof t))return new t(O,_);var ne=this;s(ne),ne.q=ne.c="",ne.bufferCheckPosition=r.MAX_BUFFER_LENGTH,ne.opt=_||{},ne.opt.lowercase=ne.opt.lowercase||ne.opt.lowercasetags,ne.looseCase=ne.opt.lowercase?"toLowerCase":"toUpperCase",ne.tags=[],ne.closed=ne.closedRoot=ne.sawRoot=!1,ne.tag=ne.error=null,ne.strict=!!O,ne.noscript=!!(O||ne.opt.noscript),ne.state=R.BEGIN,ne.strictEntities=ne.opt.strictEntities,ne.ENTITIES=ne.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES),ne.attribList=[],ne.opt.xmlns&&(ne.ns=Object.create(y)),ne.opt.unquotedAttributeValues===void 0&&(ne.opt.unquotedAttributeValues=!O),ne.trackPosition=ne.opt.position!==!1,ne.trackPosition&&(ne.position=ne.line=ne.column=0),q(ne,"onready")}o(t,"SAXParser"),Object.create||(Object.create=function(O){function _(){}o(_,"F"),_.prototype=O;var ne=new _;return ne}),Object.keys||(Object.keys=function(O){var _=[];for(var ne in O)O.hasOwnProperty(ne)&&_.push(ne);return _});function n(O){for(var _=Math.max(r.MAX_BUFFER_LENGTH,10),ne=0,J=0,Xe=e.length;J<Xe;J++){var Re=O[e[J]].length;if(Re>_)switch(e[J]){case"textNode":G(O);break;case"cdata":K(O,"oncdata",O.cdata),O.cdata="";break;case"script":K(O,"onscript",O.script),O.script="";break;default:le(O,"Max buffer length exceeded: "+e[J])}ne=Math.max(ne,Re)}var xe=r.MAX_BUFFER_LENGTH-ne;O.bufferCheckPosition=xe+O.position}o(n,"checkBufferLength");function s(O){for(var _=0,ne=e.length;_<ne;_++)O[e[_]]=""}o(s,"clearBuffers");function i(O){G(O),O.cdata!==""&&(K(O,"oncdata",O.cdata),O.cdata=""),O.script!==""&&(K(O,"onscript",O.script),O.script="")}o(i,"flushBuffers"),t.prototype={end:o(function(){oe(this)},"end"),write:lt,resume:o(function(){return this.error=null,this},"resume"),close:o(function(){return this.write(null)},"close"),flush:o(function(){i(this)},"flush")};var a;try{a=wt("stream").Stream}catch{a=o(function(){},"Stream")}a||(a=o(function(){},"Stream"));var u=r.EVENTS.filter(function(O){return O!=="error"&&O!=="end"});function l(O,_){return new f(O,_)}o(l,"createStream");function f(O,_){if(!(this instanceof f))return new f(O,_);a.apply(this),this._parser=new t(O,_),this.writable=!0,this.readable=!0;var ne=this;this._parser.onend=function(){ne.emit("end")},this._parser.onerror=function(J){ne.emit("error",J),ne._parser.error=null},this._decoder=null,u.forEach(function(J){Object.defineProperty(ne,"on"+J,{get:o(function(){return ne._parser["on"+J]},"get"),set:o(function(Xe){if(!Xe)return ne.removeAllListeners(J),ne._parser["on"+J]=Xe,Xe;ne.on(J,Xe)},"set"),enumerable:!0,configurable:!1})})}o(f,"SAXStream"),f.prototype=Object.create(a.prototype,{constructor:{value:f}}),f.prototype.write=function(O){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(O)){if(!this._decoder){var _=wt("string_decoder").StringDecoder;this._decoder=new _("utf8")}O=this._decoder.write(O)}return this._parser.write(O.toString()),this.emit("data",O),!0},f.prototype.end=function(O){return O&&O.length&&this.write(O),this._parser.end(),!0},f.prototype.on=function(O,_){var ne=this;return!ne._parser["on"+O]&&u.indexOf(O)!==-1&&(ne._parser["on"+O]=function(){var J=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);J.splice(0,0,O),ne.emit.apply(ne,J)}),a.prototype.on.call(ne,O,_)};var h="[CDATA[",m="DOCTYPE",g="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",y={xml:g,xmlns:w},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]/,E=/[:_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-]/,b=/[#:_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]/,T=/[#:_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 A(O){return O===" "||O===`
70
- `||O==="\r"||O===" "}o(A,"isWhitespace");function C(O){return O==='"'||O==="'"}o(C,"isQuote");function x(O){return O===">"||A(O)}o(x,"isAttribEnd");function B(O,_){return O.test(_)}o(B,"isMatch");function F(O,_){return!B(O,_)}o(F,"notMatch");var R=0;r.STATE={BEGIN:R++,BEGIN_WHITESPACE:R++,TEXT:R++,TEXT_ENTITY:R++,OPEN_WAKA:R++,SGML_DECL:R++,SGML_DECL_QUOTED:R++,DOCTYPE:R++,DOCTYPE_QUOTED:R++,DOCTYPE_DTD:R++,DOCTYPE_DTD_QUOTED:R++,COMMENT_STARTING:R++,COMMENT:R++,COMMENT_ENDING:R++,COMMENT_ENDED:R++,CDATA:R++,CDATA_ENDING:R++,CDATA_ENDING_2:R++,PROC_INST:R++,PROC_INST_BODY:R++,PROC_INST_ENDING:R++,OPEN_TAG:R++,OPEN_TAG_SLASH:R++,ATTRIB:R++,ATTRIB_NAME:R++,ATTRIB_NAME_SAW_WHITE:R++,ATTRIB_VALUE:R++,ATTRIB_VALUE_QUOTED:R++,ATTRIB_VALUE_CLOSED:R++,ATTRIB_VALUE_UNQUOTED:R++,ATTRIB_VALUE_ENTITY_Q:R++,ATTRIB_VALUE_ENTITY_U:R++,CLOSE_TAG:R++,CLOSE_TAG_SAW_WHITE:R++,SCRIPT:R++,SCRIPT_ENDING:R++},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 _=r.ENTITIES[O],ne=typeof _=="number"?String.fromCharCode(_):_;r.ENTITIES[O]=ne});for(var H in r.STATE)r.STATE[r.STATE[H]]=H;R=r.STATE;function q(O,_,ne){O[_]&&O[_](ne)}o(q,"emit");function K(O,_,ne){O.textNode&&G(O),q(O,_,ne)}o(K,"emitNode");function G(O){O.textNode=he(O.opt,O.textNode),O.textNode&&q(O,"ontext",O.textNode),O.textNode=""}o(G,"closeText");function he(O,_){return O.trim&&(_=_.trim()),O.normalize&&(_=_.replace(/\s+/g," ")),_}o(he,"textopts");function le(O,_){return G(O),O.trackPosition&&(_+=`
71
- Line: `+O.line+`
72
- Column: `+O.column+`
73
- Char: `+O.c),_=new Error(_),O.error=_,q(O,"onerror",_),O}o(le,"error");function oe(O){return O.sawRoot&&!O.closedRoot&&Z(O,"Unclosed root tag"),O.state!==R.BEGIN&&O.state!==R.BEGIN_WHITESPACE&&O.state!==R.TEXT&&le(O,"Unexpected end"),G(O),O.c="",O.closed=!0,q(O,"onend"),t.call(O,O.strict,O.opt),O}o(oe,"end");function Z(O,_){if(typeof O!="object"||!(O instanceof t))throw new Error("bad call to strictFail");O.strict&&le(O,_)}o(Z,"strictFail");function fe(O){O.strict||(O.tagName=O.tagName[O.looseCase]());var _=O.tags[O.tags.length-1]||O,ne=O.tag={name:O.tagName,attributes:{}};O.opt.xmlns&&(ne.ns=_.ns),O.attribList.length=0,K(O,"onopentagstart",ne)}o(fe,"newTag");function Se(O,_){var ne=O.indexOf(":"),J=ne<0?["",O]:O.split(":"),Xe=J[0],Re=J[1];return _&&O==="xmlns"&&(Xe="xmlns",Re=""),{prefix:Xe,local:Re}}o(Se,"qname");function Ke(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 _=Se(O.attribName,!0),ne=_.prefix,J=_.local;if(ne==="xmlns")if(J==="xml"&&O.attribValue!==g)Z(O,"xml: prefix must be bound to "+g+`
74
- Actual: `+O.attribValue);else if(J==="xmlns"&&O.attribValue!==w)Z(O,"xmlns: prefix must be bound to "+w+`
75
- Actual: `+O.attribValue);else{var Xe=O.tag,Re=O.tags[O.tags.length-1]||O;Xe.ns===Re.ns&&(Xe.ns=Object.create(Re.ns)),Xe.ns[J]=O.attribValue}O.attribList.push([O.attribName,O.attribValue])}else O.tag.attributes[O.attribName]=O.attribValue,K(O,"onattribute",{name:O.attribName,value:O.attribValue});O.attribName=O.attribValue=""}o(Ke,"attrib");function be(O,_){if(O.opt.xmlns){var ne=O.tag,J=Se(O.tagName);ne.prefix=J.prefix,ne.local=J.local,ne.uri=ne.ns[J.prefix]||"",ne.prefix&&!ne.uri&&(Z(O,"Unbound namespace prefix: "+JSON.stringify(O.tagName)),ne.uri=J.prefix);var Xe=O.tags[O.tags.length-1]||O;ne.ns&&Xe.ns!==ne.ns&&Object.keys(ne.ns).forEach(function(Xn){K(O,"onopennamespace",{prefix:Xn,uri:ne.ns[Xn]})});for(var Re=0,xe=O.attribList.length;Re<xe;Re++){var ct=O.attribList[Re],rr=ct[0],je=ct[1],nr=Se(rr,!0),Vs=nr.prefix,Ge=nr.local,Mr=Vs===""?"":ne.ns[Vs]||"",un={name:rr,value:je,prefix:Vs,local:Ge,uri:Mr};Vs&&Vs!=="xmlns"&&!Mr&&(Z(O,"Unbound namespace prefix: "+JSON.stringify(Vs)),un.uri=Vs),O.tag.attributes[rr]=un,K(O,"onattribute",un)}O.attribList.length=0}O.tag.isSelfClosing=!!_,O.sawRoot=!0,O.tags.push(O.tag),K(O,"onopentag",O.tag),_||(!O.noscript&&O.tagName.toLowerCase()==="script"?O.state=R.SCRIPT:O.state=R.TEXT,O.tag=null,O.tagName=""),O.attribName=O.attribValue="",O.attribList.length=0}o(be,"openTag");function we(O){if(!O.tagName){Z(O,"Weird empty close tag."),O.textNode+="</>",O.state=R.TEXT;return}if(O.script){if(O.tagName!=="script"){O.script+="</"+O.tagName+">",O.tagName="",O.state=R.SCRIPT;return}K(O,"onscript",O.script),O.script=""}var _=O.tags.length,ne=O.tagName;O.strict||(ne=ne[O.looseCase]());for(var J=ne;_--;){var Xe=O.tags[_];if(Xe.name!==J)Z(O,"Unexpected close tag");else break}if(_<0){Z(O,"Unmatched closing tag: "+O.tagName),O.textNode+="</"+O.tagName+">",O.state=R.TEXT;return}O.tagName=ne;for(var Re=O.tags.length;Re-- >_;){var xe=O.tag=O.tags.pop();O.tagName=O.tag.name,K(O,"onclosetag",O.tagName);var ct={};for(var rr in xe.ns)ct[rr]=xe.ns[rr];var je=O.tags[O.tags.length-1]||O;O.opt.xmlns&&xe.ns!==je.ns&&Object.keys(xe.ns).forEach(function(nr){var Vs=xe.ns[nr];K(O,"onclosenamespace",{prefix:nr,uri:Vs})})}_===0&&(O.closedRoot=!0),O.tagName=O.attribValue=O.attribName="",O.attribList.length=0,O.state=R.TEXT}o(we,"closeTag");function Me(O){var _=O.entity,ne=_.toLowerCase(),J,Xe="";return O.ENTITIES[_]?O.ENTITIES[_]:O.ENTITIES[ne]?O.ENTITIES[ne]:(_=ne,_.charAt(0)==="#"&&(_.charAt(1)==="x"?(_=_.slice(2),J=parseInt(_,16),Xe=J.toString(16)):(_=_.slice(1),J=parseInt(_,10),Xe=J.toString(10))),_=_.replace(/^0+/,""),isNaN(J)||Xe.toLowerCase()!==_?(Z(O,"Invalid character entity"),"&"+O.entity+";"):String.fromCodePoint(J))}o(Me,"parseEntity");function Je(O,_){_==="<"?(O.state=R.OPEN_WAKA,O.startTagPosition=O.position):A(_)||(Z(O,"Non-whitespace before first tag."),O.textNode=_,O.state=R.TEXT)}o(Je,"beginWhiteSpace");function Ye(O,_){var ne="";return _<O.length&&(ne=O.charAt(_)),ne}o(Ye,"charAt");function lt(O){var _=this;if(this.error)throw this.error;if(_.closed)return le(_,"Cannot write after close. Assign an onready handler.");if(O===null)return oe(_);typeof O=="object"&&(O=O.toString());for(var ne=0,J="";J=Ye(O,ne++),_.c=J,!!J;)switch(_.trackPosition&&(_.position++,J===`
76
- `?(_.line++,_.column=0):_.column++),_.state){case R.BEGIN:if(_.state=R.BEGIN_WHITESPACE,J==="\uFEFF")continue;Je(_,J);continue;case R.BEGIN_WHITESPACE:Je(_,J);continue;case R.TEXT:if(_.sawRoot&&!_.closedRoot){for(var Xe=ne-1;J&&J!=="<"&&J!=="&";)J=Ye(O,ne++),J&&_.trackPosition&&(_.position++,J===`
77
- `?(_.line++,_.column=0):_.column++);_.textNode+=O.substring(Xe,ne-1)}J==="<"&&!(_.sawRoot&&_.closedRoot&&!_.strict)?(_.state=R.OPEN_WAKA,_.startTagPosition=_.position):(!A(J)&&(!_.sawRoot||_.closedRoot)&&Z(_,"Text data outside of root node."),J==="&"?_.state=R.TEXT_ENTITY:_.textNode+=J);continue;case R.SCRIPT:J==="<"?_.state=R.SCRIPT_ENDING:_.script+=J;continue;case R.SCRIPT_ENDING:J==="/"?_.state=R.CLOSE_TAG:(_.script+="<"+J,_.state=R.SCRIPT);continue;case R.OPEN_WAKA:if(J==="!")_.state=R.SGML_DECL,_.sgmlDecl="";else if(!A(J))if(B(S,J))_.state=R.OPEN_TAG,_.tagName=J;else if(J==="/")_.state=R.CLOSE_TAG,_.tagName="";else if(J==="?")_.state=R.PROC_INST,_.procInstName=_.procInstBody="";else{if(Z(_,"Unencoded <"),_.startTagPosition+1<_.position){var Re=_.position-_.startTagPosition;J=new Array(Re).join(" ")+J}_.textNode+="<"+J,_.state=R.TEXT}continue;case R.SGML_DECL:if(_.sgmlDecl+J==="--"){_.state=R.COMMENT,_.comment="",_.sgmlDecl="";continue}_.doctype&&_.doctype!==!0&&_.sgmlDecl?(_.state=R.DOCTYPE_DTD,_.doctype+="<!"+_.sgmlDecl+J,_.sgmlDecl=""):(_.sgmlDecl+J).toUpperCase()===h?(K(_,"onopencdata"),_.state=R.CDATA,_.sgmlDecl="",_.cdata=""):(_.sgmlDecl+J).toUpperCase()===m?(_.state=R.DOCTYPE,(_.doctype||_.sawRoot)&&Z(_,"Inappropriately located doctype declaration"),_.doctype="",_.sgmlDecl=""):J===">"?(K(_,"onsgmldeclaration",_.sgmlDecl),_.sgmlDecl="",_.state=R.TEXT):(C(J)&&(_.state=R.SGML_DECL_QUOTED),_.sgmlDecl+=J);continue;case R.SGML_DECL_QUOTED:J===_.q&&(_.state=R.SGML_DECL,_.q=""),_.sgmlDecl+=J;continue;case R.DOCTYPE:J===">"?(_.state=R.TEXT,K(_,"ondoctype",_.doctype),_.doctype=!0):(_.doctype+=J,J==="["?_.state=R.DOCTYPE_DTD:C(J)&&(_.state=R.DOCTYPE_QUOTED,_.q=J));continue;case R.DOCTYPE_QUOTED:_.doctype+=J,J===_.q&&(_.q="",_.state=R.DOCTYPE);continue;case R.DOCTYPE_DTD:J==="]"?(_.doctype+=J,_.state=R.DOCTYPE):J==="<"?(_.state=R.OPEN_WAKA,_.startTagPosition=_.position):C(J)?(_.doctype+=J,_.state=R.DOCTYPE_DTD_QUOTED,_.q=J):_.doctype+=J;continue;case R.DOCTYPE_DTD_QUOTED:_.doctype+=J,J===_.q&&(_.state=R.DOCTYPE_DTD,_.q="");continue;case R.COMMENT:J==="-"?_.state=R.COMMENT_ENDING:_.comment+=J;continue;case R.COMMENT_ENDING:J==="-"?(_.state=R.COMMENT_ENDED,_.comment=he(_.opt,_.comment),_.comment&&K(_,"oncomment",_.comment),_.comment=""):(_.comment+="-"+J,_.state=R.COMMENT);continue;case R.COMMENT_ENDED:J!==">"?(Z(_,"Malformed comment"),_.comment+="--"+J,_.state=R.COMMENT):_.doctype&&_.doctype!==!0?_.state=R.DOCTYPE_DTD:_.state=R.TEXT;continue;case R.CDATA:J==="]"?_.state=R.CDATA_ENDING:_.cdata+=J;continue;case R.CDATA_ENDING:J==="]"?_.state=R.CDATA_ENDING_2:(_.cdata+="]"+J,_.state=R.CDATA);continue;case R.CDATA_ENDING_2:J===">"?(_.cdata&&K(_,"oncdata",_.cdata),K(_,"onclosecdata"),_.cdata="",_.state=R.TEXT):J==="]"?_.cdata+="]":(_.cdata+="]]"+J,_.state=R.CDATA);continue;case R.PROC_INST:J==="?"?_.state=R.PROC_INST_ENDING:A(J)?_.state=R.PROC_INST_BODY:_.procInstName+=J;continue;case R.PROC_INST_BODY:if(!_.procInstBody&&A(J))continue;J==="?"?_.state=R.PROC_INST_ENDING:_.procInstBody+=J;continue;case R.PROC_INST_ENDING:J===">"?(K(_,"onprocessinginstruction",{name:_.procInstName,body:_.procInstBody}),_.procInstName=_.procInstBody="",_.state=R.TEXT):(_.procInstBody+="?"+J,_.state=R.PROC_INST_BODY);continue;case R.OPEN_TAG:B(E,J)?_.tagName+=J:(fe(_),J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:(A(J)||Z(_,"Invalid character in tag name"),_.state=R.ATTRIB));continue;case R.OPEN_TAG_SLASH:J===">"?(be(_,!0),we(_)):(Z(_,"Forward-slash in opening tag not followed by >"),_.state=R.ATTRIB);continue;case R.ATTRIB:if(A(J))continue;J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:B(S,J)?(_.attribName=J,_.attribValue="",_.state=R.ATTRIB_NAME):Z(_,"Invalid attribute name");continue;case R.ATTRIB_NAME:J==="="?_.state=R.ATTRIB_VALUE:J===">"?(Z(_,"Attribute without value"),_.attribValue=_.attribName,Ke(_),be(_)):A(J)?_.state=R.ATTRIB_NAME_SAW_WHITE:B(E,J)?_.attribName+=J:Z(_,"Invalid attribute name");continue;case R.ATTRIB_NAME_SAW_WHITE:if(J==="=")_.state=R.ATTRIB_VALUE;else{if(A(J))continue;Z(_,"Attribute without value"),_.tag.attributes[_.attribName]="",_.attribValue="",K(_,"onattribute",{name:_.attribName,value:""}),_.attribName="",J===">"?be(_):B(S,J)?(_.attribName=J,_.state=R.ATTRIB_NAME):(Z(_,"Invalid attribute name"),_.state=R.ATTRIB)}continue;case R.ATTRIB_VALUE:if(A(J))continue;C(J)?(_.q=J,_.state=R.ATTRIB_VALUE_QUOTED):(_.opt.unquotedAttributeValues||le(_,"Unquoted attribute value"),_.state=R.ATTRIB_VALUE_UNQUOTED,_.attribValue=J);continue;case R.ATTRIB_VALUE_QUOTED:if(J!==_.q){J==="&"?_.state=R.ATTRIB_VALUE_ENTITY_Q:_.attribValue+=J;continue}Ke(_),_.q="",_.state=R.ATTRIB_VALUE_CLOSED;continue;case R.ATTRIB_VALUE_CLOSED:A(J)?_.state=R.ATTRIB:J===">"?be(_):J==="/"?_.state=R.OPEN_TAG_SLASH:B(S,J)?(Z(_,"No whitespace between attributes"),_.attribName=J,_.attribValue="",_.state=R.ATTRIB_NAME):Z(_,"Invalid attribute name");continue;case R.ATTRIB_VALUE_UNQUOTED:if(!x(J)){J==="&"?_.state=R.ATTRIB_VALUE_ENTITY_U:_.attribValue+=J;continue}Ke(_),J===">"?be(_):_.state=R.ATTRIB;continue;case R.CLOSE_TAG:if(_.tagName)J===">"?we(_):B(E,J)?_.tagName+=J:_.script?(_.script+="</"+_.tagName,_.tagName="",_.state=R.SCRIPT):(A(J)||Z(_,"Invalid tagname in closing tag"),_.state=R.CLOSE_TAG_SAW_WHITE);else{if(A(J))continue;F(S,J)?_.script?(_.script+="</"+J,_.state=R.SCRIPT):Z(_,"Invalid tagname in closing tag."):_.tagName=J}continue;case R.CLOSE_TAG_SAW_WHITE:if(A(J))continue;J===">"?we(_):Z(_,"Invalid characters in closing tag");continue;case R.TEXT_ENTITY:case R.ATTRIB_VALUE_ENTITY_Q:case R.ATTRIB_VALUE_ENTITY_U:var xe,ct;switch(_.state){case R.TEXT_ENTITY:xe=R.TEXT,ct="textNode";break;case R.ATTRIB_VALUE_ENTITY_Q:xe=R.ATTRIB_VALUE_QUOTED,ct="attribValue";break;case R.ATTRIB_VALUE_ENTITY_U:xe=R.ATTRIB_VALUE_UNQUOTED,ct="attribValue";break}if(J===";"){var rr=Me(_);_.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes(rr)?(_.entity="",_.state=xe,_.write(rr)):(_[ct]+=rr,_.entity="",_.state=xe)}else B(_.entity.length?T:b,J)?_.entity+=J:(Z(_,"Invalid character in entity name"),_[ct]+="&"+_.entity+J,_.entity="",_.state=xe);continue;default:throw new Error(_,"Unknown state: "+_.state)}return _.position>=_.bufferCheckPosition&&n(_),_}o(lt,"write");String.fromCodePoint||(function(){var O=String.fromCharCode,_=Math.floor,ne=o(function(){var J=16384,Xe=[],Re,xe,ct=-1,rr=arguments.length;if(!rr)return"";for(var je="";++ct<rr;){var nr=Number(arguments[ct]);if(!isFinite(nr)||nr<0||nr>1114111||_(nr)!==nr)throw RangeError("Invalid code point: "+nr);nr<=65535?Xe.push(nr):(nr-=65536,Re=(nr>>10)+55296,xe=nr%1024+56320,Xe.push(Re,xe)),(ct+1===rr||Xe.length>J)&&(je+=O.apply(null,Xe),Xe.length=0)}return je},"fromCodePoint");Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:ne,configurable:!0,writable:!0}):String.fromCodePoint=ne})()})(typeof zS>"u"?zS.sax={}:zS)});var x8=ye((sde,b8)=>{"use strict";b8.exports=r=>{if(typeof r!="string")throw new TypeError("Expected a string, got "+typeof r);return r.charCodeAt(0)===65279?r.slice(1):r}});var N8=ye(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});YS.NamespaceContext=void 0;var bte=class{static{o(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}}},xte=class{static{o(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 bte(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}};YS.NamespaceContext=xte});var V8=ye(at=>{"use strict";var Nte=at&&at.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Tte=at&&at.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Ite=at&&at.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Nte(t,e,n[s]);return Tte(t,e),t}})(),Bte=at&&at.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(at,"__esModule",{value:!0});at.ImportElement=at.IncludeElement=at.BodyElement=at.DefinitionsElement=at.ServiceElement=at.PortElement=at.BindingElement=at.PortTypeElement=at.OperationElement=at.TypesElement=at.SchemaElement=at.DocumentationElement=at.MessageElement=at.AllElement=at.AttributeElement=at.SequenceElement=at.SimpleContentElement=at.ComplexContentElement=at.ComplexTypeElement=at.EnumerationElement=at.ChoiceElement=at.ExtensionElement=at.RestrictionElement=at.SimpleTypeElement=at.OutputElement=at.InputElement=at.AnyElement=at.ElementElement=at.UnexpectedElement=at.Element=void 0;var lT=wt("assert"),Dte=Bte(mw()),$i=Ite(yo()),Qn=Vu(),_te=(0,Dte.default)("node-soap"),QS={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},dr=class{static{o(this,"Element")}constructor(e,t,n,s){this.allowedChildren={},this.children=[];let i=(0,Qn.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 u=/^xmlns:?(.*)$/.exec(a);u?this.xmlns[u[1]?u[1]:Qn.TNS_PREFIX]=t[a]:a==="value"?this[this.valueKey]=t[a]:this["$"+a]=t[a]}for(let a in s){let u=/^xmlns:?(.*)$/.exec(a);u&&u[1]&&(this.schemaXmlns[u[1]]=s[a])}this.$targetNamespace!==void 0&&(this.xmlns[Qn.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,Qn.splitQName)(t).name];if(a==null&&!this.strict&&(a=T8),a){let u=new a(t,n,s,i);u.init();let l=e[0];l instanceof wT&&(u.definitionsXmlns=l.xmlns),e.push(u)}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]&&($i.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)}};at.Element=dr;var T8=class I8 extends dr{static{o(this,"UnexpectedElement")}startElement(e,t,n,s,i){let a=new I8(t,n,s,i);a.init(),e.push(a)}};at.UnexpectedElement=T8;var cT=class extends dr{static{o(this,"ElementElement")}constructor(){super(...arguments),this.allowedChildren=sn(["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 u=a>1;u&&s&&(s+="[]"),t&&t[Qn.TNS_PREFIX]&&(this.$targetNamespace=t[Qn.TNS_PREFIX]);let l=this.$type||this.$ref;if(l){l=(0,Qn.splitQName)(l);let f=l.name,h=!!$u(l.prefix,this.definitionsXmlns,e.xmlns)||!!$u(this.targetNSAlias,this.definitionsXmlns,e.xmlns)||this.forceUseSchemaXmlns,m=$u(l.prefix,t,this.xmlns,h?this.schemaXmlns:void 0,this.definitionsXmlns,e.xmlns),g=e.schemas[m],w=g&&(this.$type?g.complexTypes[f]||g.types[f]:g.elements[f]),y=this.$type?e.descriptions.types:e.descriptions.elements;if(m&&e.schemas[m]&&(t=e.schemas[m].xmlns),w&&!(f in QS))if(f in y)if(this.$ref)if(u){let S=f+"[]";y[S]=y[f],n[S]=y[S]}else n=y[f];else n[s]=y[f];else{let S={};y[f]=S,u&&"maxOccurs"in w&&(w.maxOccurs=this.$maxOccurs),this.$minOccurs&&"minOccurs"in w&&(w.minOccurs=this.$minOccurs);let E=w.description(e,t);if(typeof E=="string")S=E;else{Object.keys(E).forEach(T=>{S[T]=E[T]});let b=E[Xi.Symbol];b&&(S[Xi.Symbol]=b)}this.$ref?n=S:n[s]=S,typeof S=="object"&&(S.targetNSAlias=l.prefix,S.targetNamespace=m),y[f]=S}else n[s]=this.$type}else{let f=this.children;n[s]={};for(let h of f)(h instanceof nE||h instanceof eE)&&(n[s]=h.description(e,t))}return n}};at.ElementElement=cT;var ZS=class extends dr{static{o(this,"AnyElement")}};at.AnyElement=ZS;var B8=class extends dr{static{o(this,"InputElement")}constructor(){super(...arguments),this.allowedChildren=sn(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof sE&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};at.InputElement=B8;var D8=class extends dr{static{o(this,"OutputElement")}constructor(){super(...arguments),this.allowedChildren=sn(["body","documentation","header","SecuritySpecRef"])}addChild(e){e instanceof sE&&(this.use=e.$use,this.use==="encoded"&&(this.encodingStyle=e.$encodingStyle),this.children.pop())}};at.OutputElement=D8;var eE=class extends dr{static{o(this,"SimpleTypeElement")}constructor(){super(...arguments),this.allowedChildren=sn(["restriction"])}description(e){for(let t of this.children)if(t instanceof tE)return[this.$name,t.description()].filter(Boolean).join("|");return{}}};at.SimpleTypeElement=eE;var tE=class extends dr{static{o(this,"RestrictionElement")}constructor(){super(...arguments),this.allowedChildren=sn(["all","choice","enumeration","sequence","attribute"])}description(e,t){let n=this.children,s,i=!1,a={};for(let l of n){if(l instanceof Xi){a[l.$name]=l.description(e);continue}!i&&(l instanceof ig||l instanceof sg)&&(i=!0,s=l.description(e,t))}if(Object.keys(a).length>0&&(s=s??{},s[Xi.Symbol]=a),s&&this.$base){let l=(0,Qn.splitQName)(this.$base),f=l.name,h=$u(l.prefix,t,this.definitionsXmlns,e.xmlns),m=e.schemas[h],g=m&&(m.complexTypes[f]||m.types[f]||m.elements[f]);if(s.getBase=()=>g.description(e,m.xmlns),g){let w=g.description(e,m.xmlns);w[Xi.Symbol]&&$i.defaults(a,w[Xi.Symbol]),s=$i.defaults(s,w)}return s}let u=this.children.map(l=>l.description()).join(",");return[this.$base,u].filter(Boolean).join("|")}};at.RestrictionElement=tE;var rE=class extends dr{static{o(this,"ExtensionElement")}constructor(){super(...arguments),this.allowedChildren=sn(["all","choice","sequence"])}description(e,t){let n={};for(let s of this.children)(s instanceof ig||s instanceof sg)&&(n=s.description(e,t));if(this.$base){let s=(0,Qn.splitQName)(this.$base),i=s.name,a=$u(s.prefix,t,this.definitionsXmlns,e.xmlns),u=e.schemas[a];if(i in QS)return this.$base;{let l=u&&(u.complexTypes[i]||u.types[i]||u.elements[i]);if(l){let f=l.description(e,u.xmlns);n=typeof f=="string"?f:$i.defaults(f,n)}}}return n}};at.ExtensionElement=rE;var sg=class extends dr{static{o(this,"ChoiceElement")}constructor(){super(...arguments),this.allowedChildren=sn(["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}};at.ChoiceElement=sg;var _8=class extends dr{static{o(this,"EnumerationElement")}description(){return this[this.valueKey]}};at.EnumerationElement=_8;var nE=class extends dr{static{o(this,"ComplexTypeElement")}constructor(){super(...arguments),this.allowedChildren=sn(["all","annotation","choice","complexContent","sequence","simpleContent","attribute"])}description(e,t){let n={},s=!1,i={},a=this.children||[];for(let u of a){if(u instanceof Xi){i[u.$name]=u.description(e);continue}!s&&(u instanceof sg||u instanceof ig||u instanceof pT||u instanceof hT||u instanceof fT)&&(s=!0,n=u.description(e,t))}return Object.keys(i).length>0&&(n[Xi.Symbol]=i),n}};at.ComplexTypeElement=nE;var fT=class extends dr{static{o(this,"ComplexContentElement")}constructor(){super(...arguments),this.allowedChildren=sn(["extension","restriction"])}description(e,t){for(let n of this.children)if(n instanceof rE||n instanceof tE)return n.description(e,t);return{}}};at.ComplexContentElement=fT;var hT=class extends dr{static{o(this,"SimpleContentElement")}constructor(){super(...arguments),this.allowedChildren=sn(["extension"])}description(e,t){for(let n of this.children)if(n instanceof rE)return n.description(e,t);return{}}};at.SimpleContentElement=hT;var ig=class extends dr{static{o(this,"SequenceElement")}constructor(){super(...arguments),this.allowedChildren=sn(["any","choice","element","sequence"])}description(e,t){let n={};for(let s of this.children){if(s instanceof ZS)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};at.SequenceElement=ig;var Xi=class extends dr{static{o(this,"AttributeElement")}description(e){return{type:this.$type,required:this.$use==="required"}}};at.AttributeElement=Xi;Xi.Symbol=Symbol("$attributes");var pT=class extends dr{static{o(this,"AllElement")}constructor(){super(...arguments),this.allowedChildren=sn(["choice","element"])}description(e,t){let n={};for(let s of this.children){if(s instanceof ZS)continue;let i=s.description(e,t);for(let a in i)n[a]=i[a]}return n}};at.AllElement=pT;var dT=class extends dr{static{o(this,"MessageElement")}constructor(){super(...arguments),this.allowedChildren=sn(["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,Qn.splitQName)(t.$element),a=$u(i.prefix,this.definitionsXmlns,e.xmlns),u=e.schemas[a];if(this.element=u.elements[i.name],!this.element){_te(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 f of l)s.push(this._getNestedLookupTypeString(f));if(s.length>0){s=s.join("_").split("_").filter(o(function(m){return m!=="^"},"removeEmptyLookupTypes"));let f=e.schemas[this.element.targetNamespace].xmlns;for(let h=0;h<s.length;h++)s[h]=this._createLookupTypeObject(s[h],f)}if(this.element.$lookupTypes=s,this.element.$type){let f=(0,Qn.splitQName)(this.element.$type),h=$u(f.prefix,u.xmlns,this.definitionsXmlns,e.xmlns);if(h&&!(f.name in QS)){u=e.schemas[h];let m=u.complexTypes[f.name]||u.types[f.name]||u.elements[f.name];m&&(this.parts=m.description(e,u.xmlns))}}else{let f=this.element.description(e,u.xmlns);this.parts=f[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,lT.ok)(i.name==="part","Expected part element");let a=(0,Qn.splitQName)(i.$type),u=$u(a.prefix,this.definitionsXmlns,e.xmlns),l=a.name;typeof e.schemas[u]<"u"?this.parts[i.$name]=e.schemas[u].types[l]||e.schemas[u].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=u),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,Qn.splitQName)(e),s=n.prefix,i=n.name.split("#"),a=i[0],u=i[1];return{$namespace:t[s],$type:s+":"+a,$name:u}}_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}};at.MessageElement=dT;var R8=class extends dr{static{o(this,"DocumentationElement")}};at.DocumentationElement=R8;var ng=class P8 extends dr{static{o(this,"SchemaElement")}constructor(){super(...arguments),this.allowedChildren=sn(["complexType","element","import","include","simpleType"]),this.complexTypes={},this.types={},this.elements={},this.includes=[]}merge(e){return(0,lT.ok)(e instanceof P8),$i.merge(this.complexTypes,e.complexTypes),$i.merge(this.types,e.types),$i.merge(this.elements,e.elements),$i.merge(this.xmlns,e.xmlns),$i.merge(this,$i.pickBy(e,(t,n)=>n.startsWith("$")&&!Object.hasOwnProperty.call(this,n))),this}addChild(e){if(!(e.$name in QS)){if(e instanceof ST||e instanceof ET){let t=e.$schemaLocation||e.$location;t&&this.includes.push({namespace:e.$namespace||e.$targetNamespace||this.$targetNamespace,location:t})}else e instanceof nE?this.complexTypes[e.$name]=e:e instanceof cT?this.elements[e.$name]=e:e instanceof eE&&(this.types[e.$name]=e);this.children.pop()}}};at.SchemaElement=ng;var mT=class extends dr{static{o(this,"TypesElement")}constructor(){super(...arguments),this.allowedChildren=sn(["documentation","schema"]),this.schemas={}}addChild(e){(0,lT.ok)(e instanceof ng);let t=e.includes.find(i=>Object.hasOwnProperty.call(i,"namespace")),n=typeof t<"u"&&Object.hasOwnProperty.call(t,"namespace")&&e instanceof ng?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}};at.TypesElement=mT;var O8=class k8 extends dr{static{o(this,"OperationElement")}constructor(){super(...arguments),this.allowedChildren=sn(["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 k8&&(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,Qn.splitQName)(i.$message).name,u=e.messages[a];u&&(u.postProcess(e),u.element?(e.messages[u.element.$name]=u,this[i.name]=u.element):this[i.name]=u,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]]}}};at.OperationElement=O8;var gT=class extends dr{static{o(this,"PortTypeElement")}constructor(){super(...arguments),this.allowedChildren=sn(["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}};at.PortTypeElement=gT;var yT=class extends dr{static{o(this,"BindingElement")}constructor(){super(...arguments),this.allowedChildren=sn(["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,Qn.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 u=i[a];if(u.name!=="operation")continue;u.postProcess(e,"binding"),i.splice(a--,1),u.style||(u.style=s);let l=this.methods[u.$name];l&&(l.style=u.style,l.soapAction=u.soapAction,l.inputSoap=u.input||null,l.outputSoap=u.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}};at.BindingElement=yT;var L8=class extends dr{static{o(this,"PortElement")}constructor(){super(...arguments),this.allowedChildren=sn(["address","documentation"]),this.location=null}addChild(e){e.name==="address"&&typeof e.$location<"u"&&(this.location=e.$location)}};at.PortElement=L8;var vT=class extends dr{static{o(this,"ServiceElement")}constructor(){super(...arguments),this.allowedChildren=sn(["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,Qn.splitQName)(i.$binding).name,u=n[a];u&&(u.postProcess(e),this.ports[i.$name]={location:i.location,binding:u},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}};at.ServiceElement=vT;var wT=class extends dr{static{o(this,"DefinitionsElement")}constructor(){super(...arguments),this.allowedChildren=sn(["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 mT)$i.merge(this.schemas,e.schemas);else if(e instanceof dT)this.messages[e.$name]=e;else if(e.name==="import"){let t=new ng(e.$namespace,{});t.init(),this.schemas[e.$namespace]=t,this.schemas[e.$namespace].addChild(e)}else e instanceof gT?this.portTypes[e.$name]=e:e instanceof yT?(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 vT&&(this.services[e.$name]=e);this.children.pop()}};at.DefinitionsElement=wT;var sE=class extends dr{static{o(this,"BodyElement")}};at.BodyElement=sE;var ST=class extends dr{static{o(this,"IncludeElement")}};at.IncludeElement=ST;var ET=class extends dr{static{o(this,"ImportElement")}};at.ImportElement=ET;var Rte={all:pT,any:ZS,binding:yT,body:sE,choice:sg,complexContent:fT,complexType:nE,definitions:wT,documentation:R8,element:cT,enumeration:_8,extension:rE,fault:dr,import:ET,include:ST,input:B8,message:dT,operation:O8,output:D8,port:L8,portType:gT,restriction:tE,schema:ng,sequence:ig,service:vT,simpleContent:hT,simpleType:eE,types:mT,attribute:Xi};function sn(r){let e={};for(let t of r)e[t.replace(/^_/,"")]=Rte[t]||dr;return e}o(sn,"buildAllowedChildren");function $u(r,...e){for(let t of e)if(t?.[r])return t[r]}o($u,"findNs")});var bT=ye(Bs=>{"use strict";var Pte=Bs&&Bs.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ote=Bs&&Bs.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),bp=Bs&&Bs.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Pte(t,e,n[s]);return Ote(t,e),t}})(),F8=Bs&&Bs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.WSDL=void 0;Bs.trim=CT;Bs.open_wsdl=q8;var kte=wt("assert"),Lte=F8(mw()),Vte=bp(wt("fs")),U8=bp(yo()),ag=bp(wt("path")),iE=bp(uT()),Ute=F8(x8()),Mte=bp(wt("url")),jte=NS(),Fte=N8(),Tr=Vu(),Bc=bp(V8()),M8=(0,Lte.default)("node-soap"),j8="http://www.w3.org/2001/XMLSchema-instance",qte="http://schemas.xmlsoap.org/soap/envelope/";function CT(r){return r.trim()}o(CT,"trim");function aE(r){return r&&r.charAt(r.length-1)!==":"?r+":":r}o(aE,"appendColon");function AT(r){return r&&r.charAt(r.length-1)===":"?r.substring(0,r.length-1):r}o(AT,"noColonNameSpace");var oE=class{static{o(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,Ute.default)(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 u=this.services=this.definitions.services;if(u)for(a in u)u[a].postProcess(this.definitions);let l=this.definitions.complexTypes;if(l)for(a in l)l[a].deleteFixedAttrs();let f=this.definitions.bindings;for(let h in f){let m=f[h];typeof m.style>"u"&&(m.style="document");let g=m.methods,w=m.topElements={};for(let y in g)if((g[y].style||m.style)==="document"&&g[y].input){let S=g[y].input.$name,E="";g[y].output&&(E=g[y].output.$name),w[S]={methodName:y,outputName:E}}}this.xmlnsInEnvelope=this._xmlnsMap(),this.callback(i,this)}catch(u){this.callback(u)}})})}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=iE.createStream(!0,null);return e.pipe(t),t}xmlToObject(e,t){let n=typeof t=="function"?{}:iE.parser(!0,null),s=null,i={},u=[{name:null,object:i,schema:{Envelope:{Header:{Security:{UsernameToken:{Username:"string",Password:"string"}}},Body:{Fault:{faultcode:"string",faultstring:"string",detail:"string"}}}}}],l=new Map,f="soap",h={},m={};if(n.onopentag=w=>{let y=w.name,S=w.attributes,E=(0,Tr.splitQName)(y).name,b,T=u[u.length-1],A=T.schema,C={},x=!1,B=!1,F={},R=E;if(S.href){let K=S.href.substr(1);m[K]||(m[K]={hrefs:[],obj:null}),m[K].hrefs.push({par:T.object,key:E,obj:F})}S.id&&(m[S.id]||(m[S.id]={hrefs:[],obj:null}));for(b in S){let K=S[b];if(/^xmlns:|^xmlns$/.test(b)){let G=(0,Tr.splitQName)(b).name;h[G]=K,K===j8&&l.set(G,K),K===qte&&(f=G);continue}x=!0,C[b]=K}for(b in C){let K=(0,Tr.splitQName)(b);if(K.name==="nil"&&h[K.prefix]===j8&&C[b]&&(C[b].toLowerCase()==="true"||C[b]==="1")){B=!0;break}}if(x&&(F[this.options.attributesKey]=C),!s&&h[f]&&T.name==="Body"&&E!=="Fault"){let K=this.definitions.messages[E];if(!K)try{let G=!1;/Response$/.test(E)?E=E.replace(/Response$/,""):/Request$/.test(E)?(G=!0,E=E.replace(/Request$/,"")):/Solicit$/.test(E)&&(G=!0,E=E.replace(/Solicit$/,""));let he=this.definitions.portTypes,le=Object.keys(he),oe=he[le[0]];G?E=oe.methods[E].input.$name:E=oe.methods[E].output.$name,K=this.definitions.messages[E],this.definitions.messages[R]=this.definitions.messages[E]}catch(G){this.options.returnFault&&n.onerror(G)}A=K.description(this.definitions),s=R}let H,q;for(let K of l.keys())if(`${K}:type`in C){q=C[`${K}:type`];break}if(q){let K=(0,Tr.splitQName)(q),G;K.prefix===Tr.TNS_PREFIX?G=h[K.prefix]||h.xmlns:G=h[K.prefix];let he=this.findSchemaObject(G,K.name);he&&(H=he.description(this.definitions))}A&&A[E+"[]"]&&(E=E+"[]"),u.push({name:R,object:F,schema:H||A&&A[E],id:S.id,nil:B})},n.onclosetag=w=>{let y=u.pop(),S=y.object,E=u[u.length-1],b=E.object,T=E.schema,A=(0,Tr.splitQName)(w).name;if(typeof y.schema=="string"&&(y.schema==="string"||y.schema.split(":")[1]==="string")&&typeof S=="object"&&Object.keys(S).length===0&&(S=y.object=this.options.preserveWhitespace&&y.text||""),y.nil===!0)if(this.options.handleNilAsNull)S=null;else return;U8.isPlainObject(S)&&!Object.keys(S).length&&(S=null),T&&T[A+"[]"]?(b[A]||(b[A]=[]),b[A].push(S)):A in b?(Array.isArray(b[A])||(b[A]=[b[A]]),b[A].push(S)):b[A]=S,y.id&&(m[y.id].obj=S)},n.oncdata=w=>{let y=w;if(w=CT(w),!!w.length)if(/<\?xml[\s\S]+\?>/.test(w)){let S=u[u.length-1],E=this.xmlToObject(w);S.object[this.options.attributesKey]?S.object[this.options.valueKey]=E:S.object=E}else n.ontext(y)},n.onerror=w=>{throw n.resume(),{Fault:{faultcode:500,faultstring:"Invalid XML",detail:new Error(w).message,statusCode:500}}},n.ontext=w=>{let y=u[u.length-1],S=w;if(w=CT(w),!w.length){this.options.preserveWhitespace&&(y.text=(y.text||"")+S);return}let E=(0,Tr.splitQName)(y.schema).name,b;this.options&&this.options.customDeserializer&&this.options.customDeserializer[E]?b=this.options.customDeserializer[E](w,y):E==="int"||E==="integer"||E==="short"||E==="long"?b=parseInt(w,10):E==="double"||E==="float"||E==="decimal"?b=Number(w):E==="bool"||E==="boolean"?b=w.toLowerCase()==="true"||w==="1":E==="dateTime"||E==="date"?b=new Date(w):(this.options.preserveWhitespace&&(w=S),typeof y.object!="string"?b=w:b=y.object+w),y.object[this.options.attributesKey]?y.object[this.options.valueKey]=b:y.object=b},typeof t=="function"){let w=iE.createStream(!0,null);w.on("opentag",n.onopentag),w.on("closetag",n.onclosetag),w.on("cdata",n.oncdata),w.on("text",n.ontext),e.pipe(w).on("error",y=>{t(y)}).on("end",()=>{let y;try{y=g()}catch(S){return t(S)}t(null,y)});return}return n.write(e).close(),g();function g(){for(let w in m){let y=m[w];for(let S of y.hrefs)Object.assign(S.obj,y.obj)}if(i.Envelope){let w=i.Envelope.Body;if(w&&w.Fault){let y=w.Fault,S=y.faultcode&&y.faultcode.$value,E=y.faultstring&&y.faultstring.$value,b=y.detail&&y.detail.$value;S=S||y.faultcode,E=E||y.faultstring,b=b||y.detail,S=S||y.Code&&`${y.Code.Value}: ${y.Code.Subcode&&y.Code.Subcode.Value}`,E=E||y.Reason&&y.Reason.Text.$value,E=E||y.Reason&&y.Reason.Text,b=b||y.Detail;let T=new Error(S+": "+E+(b?": "+JSON.stringify(b):""));throw T.root=i,T}return i.Envelope}return i}o(g,"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 u=i?this.findSchemaObject(s,i):null;return this.objectToXML(a,null,n,s,!0,null,u)}objectToRpcXML(e,t,n,s,i){let a=[],u=this.definitions,l="_xmlns";n=n||(0,Tr.findPrefix)(u.xmlns,s),s=s||u.xmlns[n],n=n===Tr.TNS_PREFIX?"":n+":",a.push(["<",n,e,">"].join(""));for(let f in t)if(Object.prototype.hasOwnProperty.call(t,f)&&f!==l){let h=t[f];if(f===this.options.xmlKey)a.push(this.objectToXML({[f]:h},null,n,s));else{let m=(i?"":n)+f,g=[];if(typeof h=="object"&&Object.prototype.hasOwnProperty.call(h,this.options.attributesKey)){let w=h[this.options.attributesKey];for(let y in w)g.push(" "+y+'="'+w[y]+'"')}a.push(["<",m].concat(g).concat(">").join("")),a.push(typeof h=="object"?this.objectToXML(h,f,n,s):(0,Tr.xmlEscape)(h)),a.push(["</",m,">"].join(""))}}return a.push(["</",n,e,">"].join("")),a.join("")}isIgnoredNameSpace(e){return this.options.ignoredNamespaces.indexOf(e)>-1}filterOutIgnoredNameSpace(e){let t=AT(e);return this.isIgnoredNameSpace(t)?"":t}objectToXML(e,t,n,s,i,a,u,l){let f=this.definitions.schemas[s];if(this.options.overrideElementKey&&Object.keys(this.options.overrideElementKey).length>0)for(let A in this.options.overrideElementKey){let C=this.options.overrideElementKey[A];e&&e[A]&&(Object.defineProperty(e,C,Object.getOwnPropertyDescriptor(e,A)),delete e[A])}let h=n?n.parent:void 0;typeof h<"u"&&(n=n.current),h=AT(h),this.isIgnoredNameSpace(h)&&(h="");let m=!f,g=f&&f.$elementFormDefault==="qualified",w=[],y=(n||g)&&n!==Tr.TNS_PREFIX,S="";s&&i&&(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes?this.options.overrideRootElement.xmlnsAttributes.forEach(A=>{S+=" "+A.name+'="'+A.value+'"'}):(y&&!this.isIgnoredNameSpace(n)&&(S+=" xmlns:"+n+'="'+s+'"'),(g||m)&&(S+=' xmlns="'+s+'"'))),l?l.pushContext():(l=new Fte.NamespaceContext,l.declareNamespace(n,s)),a&&!(this.options.overrideRootElement&&this.options.overrideRootElement.xmlnsAttributes)&&(S=a);let E="";this.options.overrideRootElement&&i?E=this.options.overrideRootElement.namespace:y&&(g||i||m)&&!this.isIgnoredNameSpace(n)&&(E=n);let b,T;if(Array.isArray(e)){let A="",C=!1,x=/^([^:]+):([^:]+)$/.exec(t);for(x?(A=x[1],t=x[2]):t[0]===":"&&(C=!0,t=t.substr(1)),b=0,T=e.length;b<T;b++){let B=e[b],F=this.processAttributes(B,l),R=A||h||E,H=this.objectToXML(B,t,n,s,!1,null,u,l),q=["<",t,F,S];C||(q=["<",aE(R),t,F,S]),H===""&&this.options.useEmptyTag?(q.push(" />"),w.push(q.join(""))):(q.push(">"),(this.options.namespaceArrayElements||b===0)&&w.push(q.join("")),w.push(H),(this.options.namespaceArrayElements||b===T-1)&&(C?w.push(["</",t,">"].join("")):w.push(["</",aE(R),t,">"].join(""))))}}else if(typeof e=="object"){let A="";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,Tr.xmlEscape)(e[t]);let C=e[t];if(typeof C>"u")continue;let x=this.processAttributes(C,l),B="",F="",R=!1,H=/^([^:]+):([^:]+)$/.exec(t);if(H?(F=H[1]+":",t=H[2]):t[0]===":"&&(R=!0,t=t.substr(1)),i)B=this.objectToXML(C,t,n,s,!1,null,u,l);else if(this.definitions.schemas)if(f){let K=this.findChildSchemaObject(u,t);if(K&&(K.$type&&K.$type.indexOf("xsd:")===-1||K.$ref||K.$name)){let G="",he="",le,oe="",Z=K.$ref||K.$name;if(Z){Z=(0,Tr.splitQName)(Z),he=Z.name,Z.prefix===Tr.TNS_PREFIX?(le=K.$targetNamespace,G=l.registerNamespace(le),this.isIgnoredNameSpace(G)&&(G=n)):(G=Z.prefix,this.isIgnoredNameSpace(G)&&(G=n),le=f.xmlns[G]||this.definitions.xmlns[G]);let Se=!1;K.$name&&K.targetNamespace===void 0&&(K.$form==="unqualified"?Se=!0:K.$form==="qualified"?Se=!1:Se=f.$elementFormDefault!=="qualified"),Se&&(G=""),le&&G&&l.declareNamespace(G,le)&&(oe=" xmlns:"+G+'="'+le+'"',S.includes(G)||(A=oe,S+=oe))}let fe;if(K.$type){let Se=(0,Tr.splitQName)(K.$type),Ke=K.$baseNameSpace||Se.prefix,be=f.xmlns[Ke]||this.definitions.xmlns[Ke];le=be,be!=="http://www.w3.org/2001/XMLSchema"&&Ke!==Tr.TNS_PREFIX&&l.addNamespace(Ke,be),fe=this.findSchemaType(Se.name,be)||K}else fe=this.findSchemaObject(le,he)||K;K.$baseNameSpace&&this.options.ignoreBaseNameSpaces&&(G=n,le=s),this.options.ignoreBaseNameSpaces&&(G="",le=""),E=G,Array.isArray(C)?(G={current:G,parent:E},oe=oe&&oe.length?oe:A):oe=null,B=this.objectToXML(C,t,G,le,!1,oe,fe,l)}else e[this.options.attributesKey]&&e[this.options.attributesKey].xsi_type?(F=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(C,t,e[this.options.attributesKey].xsi_type.prefix,e[this.options.attributesKey].xsi_type.xmlns,!1,null,null,l)):(Array.isArray(C)&&(R?t=":"+t:t=F+t),B=this.objectToXML(C,t,n,s,!1,null,null,l))}else B=this.objectToXML(C,t,n,s,!1,null,null,l);E=AT(E),y&&!g&&i&&!this.options.overrideRootElement?E=n:this.isIgnoredNameSpace(E)&&(E="");let q=!B&&this.options.useEmptyTag;Array.isArray(C)||w.push(["<",R?"":aE(F||E),t,x,S,C===null?' xsi:nil="true"':"",q?" />":">"].join("")),q||(w.push(B),Array.isArray(C)||w.push(["</",R?"":aE(F||E),t,">"].join("")))}}else e!==void 0&&w.push(this.options.escapeXML?(0,Tr.xmlEscape)(e):e);return l.popContext(),w.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 u=a.type;a.prefix&&(u=`${a.prefix}:${u}`),n+=` xsi:type="${u}"`,a.xmlns&&(n+=` xmlns:${a.prefix}="${a.xmlns}"`)}else n+=` ${i}="${(0,Tr.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 f=e.$lookupTypes;for(i=0;i<f.length;i++){let h=f[i];if(h.$name===t){s=h;break}}}let u=e;if(u.$name===t&&u.name==="element"||u.$ref&&(a=(0,Tr.splitQName)(u.$ref),a.name===t))return u;let l;if(u.$type&&n.length===1){let f=(0,Tr.splitQName)(u.$type);f.prefix===Tr.TNS_PREFIX?l=e.$targetNamespace:l=this.definitions.xmlns[f.prefix];let h=this.findSchemaType(f.name,l);if(h)return this.findChildSchemaObject(h,t,n)}if(u.$base&&(!Array.isArray(u.children)||!u.children.length)){let f=(0,Tr.splitQName)(u.$base);l=e.$targetNamespace,f.prefix!==Tr.TNS_PREFIX&&(l=this.definitions.xmlns[f.prefix]);let h=this.findSchemaType(f.name,l);if(h)return this.findChildSchemaObject(h,t,n)}if(Array.isArray(u.children)&&u.children.length>0)for(let f of u.children){if(s=this.findChildSchemaObject(f,t,n),s)break;if(f.$base){let h=(0,Tr.splitQName)(f.$base),m=h.prefix===Tr.TNS_PREFIX?"":h.prefix;l=f.xmlns[h.prefix]||f.schemaXmlns[h.prefix];let g=this.findSchemaType(h.name,l);if(g&&(s=this.findChildSchemaObject(g,t,n),s)){s.$baseNameSpace=m;break}}}return!s&&u.$name===t?u: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;!/^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=ag.resolve(ag.dirname(this.uri),ag.parse(n.location).base):s=ag.resolve(ag.dirname(this.uri),n.location):s=Mte.resolve(this.uri||"",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)}Hte(s,i,(a,u)=>{if(a)return t(a);if(this._includesWsdl.push(u),u.definitions instanceof Bc.DefinitionsElement)U8.mergeWith(this.definitions,u.definitions,(l,f)=>l instanceof Bc.SchemaElement?l.merge(f):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=iE.parser(!0,null),n=[],s=null,i=null,a=null,u=null,l=this.options;return t.onopentag=f=>{let h=f.name,m=f.attributes,g=n[n.length-1],w=(0,Tr.splitQName)(h).name;if(w==="schema"&&(u=m),g)try{g.startElement(n,h,m,l,u)}catch(y){if(this.options.strict)throw y;n.push(new Bc.Element(h,m,l,u))}else if(w==="definitions")s=new Bc.DefinitionsElement(h,m,l),n.push(s);else if(w==="schema")s=new Bc.DefinitionsElement("definitions",{},{}),i=new Bc.TypesElement("types",{},{}),a=new Bc.SchemaElement(h,m,l),i.addChild(a),s.addChild(i),n.push(a);else throw w==="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=f=>{let h=n[n.length-1];(0,kte.ok)(h,"Unmatched close tag: "+f),h.endElement(n,f)},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===Tr.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}};Bs.WSDL=oE;function Hte(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):q8(r,n,s)}o(Hte,"open_wsdl_recursive");function q8(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,u=n.wsdl_options,l;return/^<\?xml[^>]*?>/i.test(r)?(l=new oE(r,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):/^https?:/i.test(r)?(M8("Reading url: %s",r),(n.httpClient||new jte.HttpClient(n)).request(r,null,(h,m,g)=>{h?s(h):m&&m.status===200?(l=new oE(g,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s)):s(new Error("Invalid WSDL URL: "+r+`
78
-
79
- \r Code: `+m.status+`
80
-
81
- \r Response Body: `+m.data))},a,u)):(M8("Reading file: %s",r),Vte.readFile(r,"utf8",(f,h)=>{f?s(f):(l=new oE(h,r,n),i[r]=l,l.WSDL_CACHE=i,l.onReady(s))})),l}o(q8,"open_wsdl")});var K8=ye(H8=>{"use strict";Object.defineProperty(H8,"__esModule",{value:!0})});var W8=ye(Ot=>{"use strict";var $8=Ot&&Ot.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Kte=Ot&&Ot.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),$te=Ot&&Ot.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&$8(t,e,n[s]);return Kte(t,e),t}})(),Xte=Ot&&Ot.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&$8(e,r,t)};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.WSDL=Ot.passwordDigest=Ot.Server=Ot.WSSecurityCertWithToken=Ot.WSSecurityPlusCert=Ot.WSSecurityCert=Ot.WSSecurity=Ot.NTLMSecurity=Ot.ClientSSLSecurityPFX=Ot.ClientSSLSecurity=Ot.BearerSecurity=Ot.BasicAuthSecurity=Ot.HttpClient=Ot.Client=Ot.security=void 0;Ot.createClient=G8;Ot.createClientAsync=sre;Ot.listen=ire;var Gte=xN(),Wte=$te(aT()),Jte=oT(),zte=Vu(),X8=bT();Ot.security=Wte;var Yte=xN();Object.defineProperty(Ot,"Client",{enumerable:!0,get:o(function(){return Yte.Client},"get")});var Qte=NS();Object.defineProperty(Ot,"HttpClient",{enumerable:!0,get:o(function(){return Qte.HttpClient},"get")});var Co=aT();Object.defineProperty(Ot,"BasicAuthSecurity",{enumerable:!0,get:o(function(){return Co.BasicAuthSecurity},"get")});Object.defineProperty(Ot,"BearerSecurity",{enumerable:!0,get:o(function(){return Co.BearerSecurity},"get")});Object.defineProperty(Ot,"ClientSSLSecurity",{enumerable:!0,get:o(function(){return Co.ClientSSLSecurity},"get")});Object.defineProperty(Ot,"ClientSSLSecurityPFX",{enumerable:!0,get:o(function(){return Co.ClientSSLSecurityPFX},"get")});Object.defineProperty(Ot,"NTLMSecurity",{enumerable:!0,get:o(function(){return Co.NTLMSecurity},"get")});Object.defineProperty(Ot,"WSSecurity",{enumerable:!0,get:o(function(){return Co.WSSecurity},"get")});Object.defineProperty(Ot,"WSSecurityCert",{enumerable:!0,get:o(function(){return Co.WSSecurityCert},"get")});Object.defineProperty(Ot,"WSSecurityPlusCert",{enumerable:!0,get:o(function(){return Co.WSSecurityPlusCert},"get")});Object.defineProperty(Ot,"WSSecurityCertWithToken",{enumerable:!0,get:o(function(){return Co.WSSecurityCertWithToken},"get")});var Zte=oT();Object.defineProperty(Ot,"Server",{enumerable:!0,get:o(function(){return Zte.Server},"get")});var ere=Vu();Object.defineProperty(Ot,"passwordDigest",{enumerable:!0,get:o(function(){return ere.passwordDigest},"get")});Xte(K8(),Ot);var tre=bT();Object.defineProperty(Ot,"WSDL",{enumerable:!0,get:o(function(){return tre.WSDL},"get")});function rre(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)})}o(rre,"getFromCache");function nre(r,e,t){typeof e=="function"&&(t=e,e={});let n=o(s=>{(0,X8.open_wsdl)(r,e,s)},"openWsdl");if(e.disableCache===!0)n(t);else{let s;e.wsdlCache?s=e.wsdlCache:s=zte.wsdlCacheSingleton,rre(r,s,n,t)}}o(nre,"_requestWSDL");function G8(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,nre(r,a,(u,l)=>{i(u,l&&new Gte.Client(l,s,a))})}o(G8,"createClient");function sre(r,e,t){return typeof e>"u"&&(e={}),new Promise((n,s)=>{G8(r,e,(i,a)=>{i&&s(i),n(a)},t)})}o(sre,"createClientAsync");function ire(r,e,t,n,s){let i,a,u="";typeof e=="object"&&!(e instanceof RegExp)?(i=e,a=i.path,t=i.services,n=i.xml,u=i.uri):(a=e,i={path:e,services:t,callback:s});let l=new X8.WSDL(n||t,u,i);return new Jte.Server(r,a,t,l,i)}o(ire,"listen")});var uE=ye(xT=>{"use strict";(function(){xT.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:`
82
- `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(xT)});var Ua=ye((Z8,Xu)=>{"use strict";(function(){var r,e,t,n,s,i,a,u=[].slice,l={}.hasOwnProperty;r=o(function(){var f,h,m,g,w,y;if(y=arguments[0],w=2<=arguments.length?u.call(arguments,1):[],s(Object.assign))Object.assign.apply(null,arguments);else for(f=0,m=w.length;f<m;f++)if(g=w[f],g!=null)for(h in g)l.call(g,h)&&(y[h]=g[h]);return y},"assign"),s=o(function(f){return!!f&&Object.prototype.toString.call(f)==="[object Function]"},"isFunction"),i=o(function(f){var h;return!!f&&((h=typeof f)=="function"||h==="object")},"isObject"),t=o(function(f){return s(Array.isArray)?Array.isArray(f):Object.prototype.toString.call(f)==="[object Array]"},"isArray"),n=o(function(f){var h;if(t(f))return!f.length;for(h in f)if(l.call(f,h))return!1;return!0},"isEmpty"),a=o(function(f){var h,m;return i(f)&&(m=Object.getPrototypeOf(f))&&(h=m.constructor)&&typeof h=="function"&&h instanceof h&&Function.prototype.toString.call(h)===Function.prototype.toString.call(Object)},"isPlainObject"),e=o(function(f){return s(f.valueOf)?f.valueOf():f},"getValue"),Xu.exports.assign=r,Xu.exports.isFunction=s,Xu.exports.isObject=i,Xu.exports.isArray=t,Xu.exports.isEmpty=n,Xu.exports.isPlainObject=a,Xu.exports.getValue=e}).call(Z8)});var NT=ye((e5,t5)=>{"use strict";(function(){var r;t5.exports=r=(function(){function e(){}return o(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(e5)});var s5=ye((r5,n5)=>{"use strict";(function(){var r;n5.exports=r=(function(){function e(){}return o(e,"XMLDOMErrorHandler"),e.prototype.handleError=function(t){throw new Error(t)},e})()}).call(r5)});var o5=ye((i5,a5)=>{"use strict";(function(){var r;a5.exports=r=(function(){function e(t){this.arr=t||[]}return o(e,"XMLDOMStringList"),Object.defineProperty(e.prototype,"length",{get:o(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(i5)});var c5=ye((u5,l5)=>{"use strict";(function(){var r,e,t;e=s5(),t=o5(),l5.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 o(n,"XMLDOMConfiguration"),Object.defineProperty(n.prototype,"parameterNames",{get:o(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(u5)});var an=ye((f5,h5)=>{"use strict";(function(){h5.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(f5)});var TT=ye((p5,d5)=>{"use strict";(function(){var r,e,t;r=an(),t=Js(),d5.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 o(n,"XMLAttribute"),Object.defineProperty(n.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(n.prototype,"ownerElement",{get:o(function(){return this.parent},"get")}),Object.defineProperty(n.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(s){return this.value=s||""},"set")}),Object.defineProperty(n.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(n.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(n.prototype,"specified",{get:o(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(p5)});var lE=ye((m5,g5)=>{"use strict";(function(){var r;g5.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNamedNodeMap"),Object.defineProperty(e.prototype,"length",{get:o(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(m5)});var cE=ye((y5,v5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f=o(function(m,g){for(var w in g)h.call(g,w)&&(m[w]=g[w]);function y(){this.constructor=m}return o(y,"ctor"),y.prototype=g.prototype,m.prototype=new y,m.__super__=g.prototype,m},"extend"),h={}.hasOwnProperty;l=Ua(),u=l.isObject,a=l.isFunction,i=l.getValue,s=Js(),r=an(),e=TT(),n=lE(),v5.exports=t=(function(m){f(g,m);function g(w,y,S){var E,b,T,A;if(g.__super__.constructor.call(this,w),y==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(y),this.type=r.Element,this.attribs={},this.schemaTypeInfo=null,S!=null&&this.attribute(S),w.type===r.Document&&(this.isRoot=!0,this.documentObject=w,w.rootObject=this,w.children)){for(A=w.children,b=0,T=A.length;b<T;b++)if(E=A[b],E.type===r.DocType){E.name=this.name;break}}}return o(g,"XMLElement"),Object.defineProperty(g.prototype,"tagName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"namespaceURI",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"prefix",{get:o(function(){return""},"get")}),Object.defineProperty(g.prototype,"localName",{get:o(function(){return this.name},"get")}),Object.defineProperty(g.prototype,"id",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"className",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"classList",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(g.prototype,"attributes",{get:o(function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new n(this.attribs)),this.attributeMap},"get")}),g.prototype.clone=function(){var w,y,S,E;S=Object.create(this),S.isRoot&&(S.documentObject=null),S.attribs={},E=this.attribs;for(y in E)h.call(E,y)&&(w=E[y],S.attribs[y]=w.clone());return S.children=[],this.children.forEach(function(b){var T;return T=b.clone(),T.parent=S,S.children.push(T)}),S},g.prototype.attribute=function(w,y){var S,E;if(w!=null&&(w=i(w)),u(w))for(S in w)h.call(w,S)&&(E=w[S],this.attribute(S,E));else a(y)&&(y=y.apply()),this.options.keepNullAttributes&&y==null?this.attribs[w]=new e(this,w,""):y!=null&&(this.attribs[w]=new e(this,w,y));return this},g.prototype.removeAttribute=function(w){var y,S,E;if(w==null)throw new Error("Missing attribute name. "+this.debugInfo());if(w=i(w),Array.isArray(w))for(S=0,E=w.length;S<E;S++)y=w[S],delete this.attribs[y];else delete this.attribs[w];return this},g.prototype.toString=function(w){return this.options.writer.element(this,this.options.writer.filterOptions(w))},g.prototype.att=function(w,y){return this.attribute(w,y)},g.prototype.a=function(w,y){return this.attribute(w,y)},g.prototype.getAttribute=function(w){return this.attribs.hasOwnProperty(w)?this.attribs[w].value:null},g.prototype.setAttribute=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNode=function(w){return this.attribs.hasOwnProperty(w)?this.attribs[w]:null},g.prototype.setAttributeNode=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNode=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNS=function(w,y,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.removeAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getAttributeNodeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setAttributeNodeNS=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.hasAttribute=function(w){return this.attribs.hasOwnProperty(w)},g.prototype.hasAttributeNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttribute=function(w,y){return this.attribs.hasOwnProperty(w)?this.attribs[w].isId:y},g.prototype.setIdAttributeNS=function(w,y,S){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.setIdAttributeNode=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByTagNameNS=function(w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.getElementsByClassName=function(w){throw new Error("This DOM method is not implemented."+this.debugInfo())},g.prototype.isEqualNode=function(w){var y,S,E;if(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(w)||w.namespaceURI!==this.namespaceURI||w.prefix!==this.prefix||w.localName!==this.localName||w.attribs.length!==this.attribs.length)return!1;for(y=S=0,E=this.attribs.length-1;0<=E?S<=E:S>=E;y=0<=E?++S:--S)if(!this.attribs[y].isEqualNode(w.attribs[y]))return!1;return!0},g})(s)}).call(y5)});var og=ye((w5,S5)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=Js(),S5.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a),this.value=""}return o(i,"XMLCharacterData"),Object.defineProperty(i.prototype,"data",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),Object.defineProperty(i.prototype,"length",{get:o(function(){return this.value.length},"get")}),Object.defineProperty(i.prototype,"textContent",{get:o(function(){return this.value},"get"),set:o(function(a){return this.value=a||""},"set")}),i.prototype.clone=function(){return Object.create(this)},i.prototype.substringData=function(a,u){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,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.deleteData=function(a,u){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceData=function(a,u,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(w5)});var fE=ye((E5,A5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=an(),t=og(),A5.exports=e=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),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 o(a,"XMLCData"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.cdata(this,this.options.writer.filterOptions(u))},a})(t)}).call(E5)});var hE=ye((C5,b5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=an(),e=og(),b5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=r.Comment,this.value=this.stringify.comment(l)}return o(a,"XMLComment"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.comment(this,this.options.writer.filterOptions(u))},a})(e)}).call(C5)});var pE=ye((x5,N5)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;n=Ua().isObject,t=Js(),r=an(),N5.exports=e=(function(a){s(u,a);function u(l,f,h,m){var g;u.__super__.constructor.call(this,l),n(f)&&(g=f,f=g.version,h=g.encoding,m=g.standalone),f||(f="1.0"),this.type=r.Declaration,this.version=this.stringify.xmlVersion(f),h!=null&&(this.encoding=this.stringify.xmlEncoding(h)),m!=null&&(this.standalone=this.stringify.xmlStandalone(m))}return o(u,"XMLDeclaration"),u.prototype.toString=function(l){return this.options.writer.declaration(this,this.options.writer.filterOptions(l))},u})(t)}).call(x5)});var dE=ye((T5,I5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Js(),r=an(),I5.exports=e=(function(i){n(a,i);function a(u,l,f,h,m,g){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(f==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(l));if(!h)throw new Error("Missing DTD attribute type. "+this.debugInfo(l));if(!m)throw new Error("Missing DTD attribute default. "+this.debugInfo(l));if(m.indexOf("#")!==0&&(m="#"+m),!m.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(l));if(g&&!m.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(f),this.attributeType=this.stringify.dtdAttType(h),g&&(this.defaultValue=this.stringify.dtdAttDefault(g)),this.defaultValueType=m}return o(a,"XMLDTDAttList"),a.prototype.toString=function(u){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(u))},a})(t)}).call(T5)});var mE=ye((B5,D5)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;n=Ua().isObject,t=Js(),r=an(),D5.exports=e=(function(a){s(u,a);function u(l,f,h,m){if(u.__super__.constructor.call(this,l),h==null)throw new Error("Missing DTD entity name. "+this.debugInfo(h));if(m==null)throw new Error("Missing DTD entity value. "+this.debugInfo(h));if(this.pe=!!f,this.name=this.stringify.name(h),this.type=r.EntityDeclaration,!n(m))this.value=this.stringify.dtdEntityValue(m),this.internal=!0;else{if(!m.pubID&&!m.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(h));if(m.pubID&&!m.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(h));if(this.internal=!1,m.pubID!=null&&(this.pubID=this.stringify.dtdPubID(m.pubID)),m.sysID!=null&&(this.sysID=this.stringify.dtdSysID(m.sysID)),m.nData!=null&&(this.nData=this.stringify.dtdNData(m.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(h))}}return o(u,"XMLDTDEntity"),Object.defineProperty(u.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(u.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(u.prototype,"notationName",{get:o(function(){return this.nData||null},"get")}),Object.defineProperty(u.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(u.prototype,"xmlVersion",{get:o(function(){return null},"get")}),u.prototype.toString=function(l){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(l))},u})(t)}).call(B5)});var gE=ye((_5,R5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Js(),r=an(),R5.exports=e=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD element name. "+this.debugInfo());f||(f="(#PCDATA)"),Array.isArray(f)&&(f="("+f.join(",")+")"),this.name=this.stringify.name(l),this.type=r.ElementDeclaration,this.value=this.stringify.dtdElementValue(f)}return o(a,"XMLDTDElement"),a.prototype.toString=function(u){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(u))},a})(t)}).call(_5)});var yE=ye((P5,O5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Js(),r=an(),O5.exports=e=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing DTD notation name. "+this.debugInfo(l));if(!f.pubID&&!f.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,f.pubID!=null&&(this.pubID=this.stringify.dtdPubID(f.pubID)),f.sysID!=null&&(this.sysID=this.stringify.dtdSysID(f.sysID))}return o(a,"XMLDTDNotation"),Object.defineProperty(a.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(a.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),a.prototype.toString=function(u){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(u))},a})(t)}).call(P5)});var vE=ye((k5,L5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f=o(function(m,g){for(var w in g)h.call(g,w)&&(m[w]=g[w]);function y(){this.constructor=m}return o(y,"ctor"),y.prototype=g.prototype,m.prototype=new y,m.__super__=g.prototype,m},"extend"),h={}.hasOwnProperty;l=Ua().isObject,u=Js(),r=an(),e=dE(),n=mE(),t=gE(),s=yE(),a=lE(),L5.exports=i=(function(m){f(g,m);function g(w,y,S){var E,b,T,A,C,x;if(g.__super__.constructor.call(this,w),this.type=r.DocType,w.children){for(A=w.children,b=0,T=A.length;b<T;b++)if(E=A[b],E.type===r.Element){this.name=E.name;break}}this.documentObject=w,l(y)&&(C=y,y=C.pubID,S=C.sysID),S==null&&(x=[y,S],S=x[0],y=x[1]),y!=null&&(this.pubID=this.stringify.dtdPubID(y)),S!=null&&(this.sysID=this.stringify.dtdSysID(S))}return o(g,"XMLDocType"),Object.defineProperty(g.prototype,"entities",{get:o(function(){var w,y,S,E,b;for(E={},b=this.children,y=0,S=b.length;y<S;y++)w=b[y],w.type===r.EntityDeclaration&&!w.pe&&(E[w.name]=w);return new a(E)},"get")}),Object.defineProperty(g.prototype,"notations",{get:o(function(){var w,y,S,E,b;for(E={},b=this.children,y=0,S=b.length;y<S;y++)w=b[y],w.type===r.NotationDeclaration&&(E[w.name]=w);return new a(E)},"get")}),Object.defineProperty(g.prototype,"publicId",{get:o(function(){return this.pubID},"get")}),Object.defineProperty(g.prototype,"systemId",{get:o(function(){return this.sysID},"get")}),Object.defineProperty(g.prototype,"internalSubset",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),g.prototype.element=function(w,y){var S;return S=new t(this,w,y),this.children.push(S),this},g.prototype.attList=function(w,y,S,E,b){var T;return T=new e(this,w,y,S,E,b),this.children.push(T),this},g.prototype.entity=function(w,y){var S;return S=new n(this,!1,w,y),this.children.push(S),this},g.prototype.pEntity=function(w,y){var S;return S=new n(this,!0,w,y),this.children.push(S),this},g.prototype.notation=function(w,y){var S;return S=new s(this,w,y),this.children.push(S),this},g.prototype.toString=function(w){return this.options.writer.docType(this,this.options.writer.filterOptions(w))},g.prototype.ele=function(w,y){return this.element(w,y)},g.prototype.att=function(w,y,S,E,b){return this.attList(w,y,S,E,b)},g.prototype.ent=function(w,y){return this.entity(w,y)},g.prototype.pent=function(w,y){return this.pEntity(w,y)},g.prototype.not=function(w,y){return this.notation(w,y)},g.prototype.up=function(){return this.root()||this.documentObject},g.prototype.isEqualNode=function(w){return!(!g.__super__.isEqualNode.apply(this,arguments).isEqualNode(w)||w.name!==this.name||w.publicId!==this.publicId||w.systemId!==this.systemId)},g})(u)}).call(k5)});var wE=ye((V5,U5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=an(),e=Js(),U5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=r.Raw,this.value=this.stringify.raw(l)}return o(a,"XMLRaw"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.raw(this,this.options.writer.filterOptions(u))},a})(e)}).call(V5)});var SE=ye((M5,j5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=an(),e=og(),j5.exports=t=(function(i){n(a,i);function a(u,l){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=r.Text,this.value=this.stringify.text(l)}return o(a,"XMLText"),Object.defineProperty(a.prototype,"isElementContentWhitespace",{get:o(function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},"get")}),Object.defineProperty(a.prototype,"wholeText",{get:o(function(){var u,l,f;for(f="",l=this.previousSibling;l;)f=l.data+f,l=l.previousSibling;for(f+=this.data,u=this.nextSibling;u;)f=f+u.data,u=u.nextSibling;return f},"get")}),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.text(this,this.options.writer.filterOptions(u))},a.prototype.splitText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a.prototype.replaceWholeText=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},a})(e)}).call(M5)});var EE=ye((F5,q5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;r=an(),e=og(),q5.exports=t=(function(i){n(a,i);function a(u,l,f){if(a.__super__.constructor.call(this,u),l==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=r.ProcessingInstruction,this.target=this.stringify.insTarget(l),this.name=this.target,f&&(this.value=this.stringify.insValue(f))}return o(a,"XMLProcessingInstruction"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(u))},a.prototype.isEqualNode=function(u){return!(!a.__super__.isEqualNode.apply(this,arguments).isEqualNode(u)||u.target!==this.target)},a})(e)}).call(F5)});var IT=ye((H5,K5)=>{"use strict";(function(){var r,e,t,n=o(function(i,a){for(var u in a)s.call(a,u)&&(i[u]=a[u]);function l(){this.constructor=i}return o(l,"ctor"),l.prototype=a.prototype,i.prototype=new l,i.__super__=a.prototype,i},"extend"),s={}.hasOwnProperty;t=Js(),r=an(),K5.exports=e=(function(i){n(a,i);function a(u){a.__super__.constructor.call(this,u),this.type=r.Dummy}return o(a,"XMLDummy"),a.prototype.clone=function(){return Object.create(this)},a.prototype.toString=function(u){return""},a})(t)}).call(H5)});var G5=ye(($5,X5)=>{"use strict";(function(){var r;X5.exports=r=(function(){function e(t){this.nodes=t}return o(e,"XMLNodeList"),Object.defineProperty(e.prototype,"length",{get:o(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($5)});var z5=ye((W5,J5)=>{"use strict";(function(){J5.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(W5)});var Js=ye((Y5,Q5)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A={}.hasOwnProperty;T=Ua(),b=T.isObject,E=T.isFunction,S=T.isEmpty,y=T.getValue,u=null,t=null,n=null,s=null,i=null,g=null,w=null,m=null,a=null,e=null,h=null,l=null,r=null,Q5.exports=f=(function(){function C(x){this.parent=x,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=cE(),t=fE(),n=hE(),s=pE(),i=vE(),g=wE(),w=SE(),m=EE(),a=IT(),e=an(),h=G5(),l=lE(),r=z5())}return o(C,"XMLNode"),Object.defineProperty(C.prototype,"nodeName",{get:o(function(){return this.name},"get")}),Object.defineProperty(C.prototype,"nodeType",{get:o(function(){return this.type},"get")}),Object.defineProperty(C.prototype,"nodeValue",{get:o(function(){return this.value},"get")}),Object.defineProperty(C.prototype,"parentNode",{get:o(function(){return this.parent},"get")}),Object.defineProperty(C.prototype,"childNodes",{get:o(function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new h(this.children)),this.childNodeList},"get")}),Object.defineProperty(C.prototype,"firstChild",{get:o(function(){return this.children[0]||null},"get")}),Object.defineProperty(C.prototype,"lastChild",{get:o(function(){return this.children[this.children.length-1]||null},"get")}),Object.defineProperty(C.prototype,"previousSibling",{get:o(function(){var x;return x=this.parent.children.indexOf(this),this.parent.children[x-1]||null},"get")}),Object.defineProperty(C.prototype,"nextSibling",{get:o(function(){var x;return x=this.parent.children.indexOf(this),this.parent.children[x+1]||null},"get")}),Object.defineProperty(C.prototype,"ownerDocument",{get:o(function(){return this.document()||null},"get")}),Object.defineProperty(C.prototype,"textContent",{get:o(function(){var x,B,F,R,H;if(this.nodeType===e.Element||this.nodeType===e.DocumentFragment){for(H="",R=this.children,B=0,F=R.length;B<F;B++)x=R[B],x.textContent&&(H+=x.textContent);return H}else return null},"get"),set:o(function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},"set")}),C.prototype.setParent=function(x){var B,F,R,H,q;for(this.parent=x,x&&(this.options=x.options,this.stringify=x.stringify),H=this.children,q=[],F=0,R=H.length;F<R;F++)B=H[F],q.push(B.setParent(this));return q},C.prototype.element=function(x,B,F){var R,H,q,K,G,he,le,oe,Z,fe,Se;if(he=null,B===null&&F==null&&(Z=[{},null],B=Z[0],F=Z[1]),B==null&&(B={}),B=y(B),b(B)||(fe=[B,F],F=fe[0],B=fe[1]),x!=null&&(x=y(x)),Array.isArray(x))for(q=0,le=x.length;q<le;q++)H=x[q],he=this.element(H);else if(E(x))he=this.element(x.apply());else if(b(x)){for(G in x)if(A.call(x,G))if(Se=x[G],E(Se)&&(Se=Se.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&G.indexOf(this.stringify.convertAttKey)===0)he=this.attribute(G.substr(this.stringify.convertAttKey.length),Se);else if(!this.options.separateArrayItems&&Array.isArray(Se)&&S(Se))he=this.dummy();else if(b(Se)&&S(Se))he=this.element(G);else if(!this.options.keepNullNodes&&Se==null)he=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(Se))for(K=0,oe=Se.length;K<oe;K++)H=Se[K],R={},R[G]=H,he=this.element(R);else b(Se)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&G.indexOf(this.stringify.convertTextKey)===0?he=this.element(Se):(he=this.element(G),he.element(Se)):he=this.element(G,Se)}else!this.options.keepNullNodes&&F===null?he=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&x.indexOf(this.stringify.convertTextKey)===0?he=this.text(F):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&x.indexOf(this.stringify.convertCDataKey)===0?he=this.cdata(F):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&x.indexOf(this.stringify.convertCommentKey)===0?he=this.comment(F):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&x.indexOf(this.stringify.convertRawKey)===0?he=this.raw(F):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&x.indexOf(this.stringify.convertPIKey)===0?he=this.instruction(x.substr(this.stringify.convertPIKey.length),F):he=this.node(x,B,F);if(he==null)throw new Error("Could not create any elements with: "+x+". "+this.debugInfo());return he},C.prototype.insertBefore=function(x,B,F){var R,H,q,K,G;if(x?.type)return q=x,K=B,q.setParent(this),K?(H=children.indexOf(K),G=children.splice(H),children.push(q),Array.prototype.push.apply(children,G)):children.push(q),q;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(x));return H=this.parent.children.indexOf(this),G=this.parent.children.splice(H),R=this.parent.element(x,B,F),Array.prototype.push.apply(this.parent.children,G),R},C.prototype.insertAfter=function(x,B,F){var R,H,q;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(x));return H=this.parent.children.indexOf(this),q=this.parent.children.splice(H+1),R=this.parent.element(x,B,F),Array.prototype.push.apply(this.parent.children,q),R},C.prototype.remove=function(){var x,B;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return x=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[x,x-x+1].concat(B=[])),this.parent},C.prototype.node=function(x,B,F){var R,H;return x!=null&&(x=y(x)),B||(B={}),B=y(B),b(B)||(H=[B,F],F=H[0],B=H[1]),R=new u(this,x,B),F!=null&&R.text(F),this.children.push(R),R},C.prototype.text=function(x){var B;return b(x)&&this.element(x),B=new w(this,x),this.children.push(B),this},C.prototype.cdata=function(x){var B;return B=new t(this,x),this.children.push(B),this},C.prototype.comment=function(x){var B;return B=new n(this,x),this.children.push(B),this},C.prototype.commentBefore=function(x){var B,F,R;return F=this.parent.children.indexOf(this),R=this.parent.children.splice(F),B=this.parent.comment(x),Array.prototype.push.apply(this.parent.children,R),this},C.prototype.commentAfter=function(x){var B,F,R;return F=this.parent.children.indexOf(this),R=this.parent.children.splice(F+1),B=this.parent.comment(x),Array.prototype.push.apply(this.parent.children,R),this},C.prototype.raw=function(x){var B;return B=new g(this,x),this.children.push(B),this},C.prototype.dummy=function(){var x;return x=new a(this),x},C.prototype.instruction=function(x,B){var F,R,H,q,K;if(x!=null&&(x=y(x)),B!=null&&(B=y(B)),Array.isArray(x))for(q=0,K=x.length;q<K;q++)F=x[q],this.instruction(F);else if(b(x))for(F in x)A.call(x,F)&&(R=x[F],this.instruction(F,R));else E(B)&&(B=B.apply()),H=new m(this,x,B),this.children.push(H);return this},C.prototype.instructionBefore=function(x,B){var F,R,H;return R=this.parent.children.indexOf(this),H=this.parent.children.splice(R),F=this.parent.instruction(x,B),Array.prototype.push.apply(this.parent.children,H),this},C.prototype.instructionAfter=function(x,B){var F,R,H;return R=this.parent.children.indexOf(this),H=this.parent.children.splice(R+1),F=this.parent.instruction(x,B),Array.prototype.push.apply(this.parent.children,H),this},C.prototype.declaration=function(x,B,F){var R,H;return R=this.document(),H=new s(R,x,B,F),R.children.length===0?R.children.unshift(H):R.children[0].type===e.Declaration?R.children[0]=H:R.children.unshift(H),R.root()||R},C.prototype.dtd=function(x,B){var F,R,H,q,K,G,he,le,oe,Z;for(R=this.document(),H=new i(R,x,B),oe=R.children,q=K=0,he=oe.length;K<he;q=++K)if(F=oe[q],F.type===e.DocType)return R.children[q]=H,H;for(Z=R.children,q=G=0,le=Z.length;G<le;q=++G)if(F=Z[q],F.isRoot)return R.children.splice(q,0,H),H;return R.children.push(H),H},C.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},C.prototype.root=function(){var x;for(x=this;x;){if(x.type===e.Document)return x.rootObject;if(x.isRoot)return x;x=x.parent}},C.prototype.document=function(){var x;for(x=this;x;){if(x.type===e.Document)return x;x=x.parent}},C.prototype.end=function(x){return this.document().end(x)},C.prototype.prev=function(){var x;if(x=this.parent.children.indexOf(this),x<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[x-1]},C.prototype.next=function(){var x;if(x=this.parent.children.indexOf(this),x===-1||x===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[x+1]},C.prototype.importDocument=function(x){var B;return B=x.root().clone(),B.parent=this,B.isRoot=!1,this.children.push(B),this},C.prototype.debugInfo=function(x){var B,F;return x=x||this.name,x==null&&!((B=this.parent)!=null&&B.name)?"":x==null?"parent: <"+this.parent.name+">":(F=this.parent)!=null&&F.name?"node: <"+x+">, parent: <"+this.parent.name+">":"node: <"+x+">"},C.prototype.ele=function(x,B,F){return this.element(x,B,F)},C.prototype.nod=function(x,B,F){return this.node(x,B,F)},C.prototype.txt=function(x){return this.text(x)},C.prototype.dat=function(x){return this.cdata(x)},C.prototype.com=function(x){return this.comment(x)},C.prototype.ins=function(x,B){return this.instruction(x,B)},C.prototype.doc=function(){return this.document()},C.prototype.dec=function(x,B,F){return this.declaration(x,B,F)},C.prototype.e=function(x,B,F){return this.element(x,B,F)},C.prototype.n=function(x,B,F){return this.node(x,B,F)},C.prototype.t=function(x){return this.text(x)},C.prototype.d=function(x){return this.cdata(x)},C.prototype.c=function(x){return this.comment(x)},C.prototype.r=function(x){return this.raw(x)},C.prototype.i=function(x,B){return this.instruction(x,B)},C.prototype.u=function(){return this.up()},C.prototype.importXMLBuilder=function(x){return this.importDocument(x)},C.prototype.replaceChild=function(x,B){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.removeChild=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.appendChild=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.hasChildNodes=function(){return this.children.length!==0},C.prototype.cloneNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isSupported=function(x,B){return!0},C.prototype.hasAttributes=function(){return this.attribs.length!==0},C.prototype.compareDocumentPosition=function(x){var B,F;return B=this,B===x?0:this.document()!==x.document()?(F=r.Disconnected|r.ImplementationSpecific,Math.random()<.5?F|=r.Preceding:F|=r.Following,F):B.isAncestor(x)?r.Contains|r.Preceding:B.isDescendant(x)?r.Contains|r.Following:B.isPreceding(x)?r.Preceding:r.Following},C.prototype.isSameNode=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupPrefix=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isDefaultNamespace=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.lookupNamespaceURI=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.isEqualNode=function(x){var B,F,R;if(x.nodeType!==this.nodeType||x.children.length!==this.children.length)return!1;for(B=F=0,R=this.children.length-1;0<=R?F<=R:F>=R;B=0<=R?++F:--F)if(!this.children[B].isEqualNode(x.children[B]))return!1;return!0},C.prototype.getFeature=function(x,B){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.setUserData=function(x,B,F){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.getUserData=function(x){throw new Error("This DOM method is not implemented."+this.debugInfo())},C.prototype.contains=function(x){return x?x===this||this.isDescendant(x):!1},C.prototype.isDescendant=function(x){var B,F,R,H,q;for(q=this.children,R=0,H=q.length;R<H;R++)if(B=q[R],x===B||(F=B.isDescendant(x),F))return!0;return!1},C.prototype.isAncestor=function(x){return x.isDescendant(this)},C.prototype.isPreceding=function(x){var B,F;return B=this.treePosition(x),F=this.treePosition(this),B===-1||F===-1?!1:B<F},C.prototype.isFollowing=function(x){var B,F;return B=this.treePosition(x),F=this.treePosition(this),B===-1||F===-1?!1:B>F},C.prototype.treePosition=function(x){var B,F;return F=0,B=!1,this.foreachTreeNode(this.document(),function(R){if(F++,!B&&R===x)return B=!0}),B?F:-1},C.prototype.foreachTreeNode=function(x,B){var F,R,H,q,K;for(x||(x=this.document()),q=x.children,R=0,H=q.length;R<H;R++){if(F=q[R],K=B(F))return K;if(K=this.foreachTreeNode(F,B),K)return K}},C})()}).call(Y5)});var BT=ye((Z5,eV)=>{"use strict";(function(){var r,e=o(function(n,s){return function(){return n.apply(s,arguments)}},"bind"),t={}.hasOwnProperty;eV.exports=r=(function(){function n(s){this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this);var i,a,u;s||(s={}),this.options=s,this.options.version||(this.options.version="1.0"),a=s.stringify||{};for(i in a)t.call(a,i)&&(u=a[i],this[i]=u)}return o(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(Z5)});var ug=ye((tV,rV)=>{"use strict";(function(){rV.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(tV)});var DT=ye((nV,sV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b={}.hasOwnProperty;E=Ua().assign,r=an(),l=pE(),f=vE(),t=fE(),n=hE(),m=cE(),w=wE(),y=SE(),g=EE(),h=IT(),s=dE(),i=gE(),a=mE(),u=yE(),e=ug(),sV.exports=S=(function(){function T(A){var C,x,B;A||(A={}),this.options=A,x=A.writer||{};for(C in x)b.call(x,C)&&(B=x[C],this["_"+C]=this[C],this[C]=B)}return o(T,"XMLWriterBase"),T.prototype.filterOptions=function(A){var C,x,B,F,R,H,q,K;return A||(A={}),A=E({},this.options,A),C={writer:this},C.pretty=A.pretty||!1,C.allowEmpty=A.allowEmpty||!1,C.indent=(x=A.indent)!=null?x:" ",C.newline=(B=A.newline)!=null?B:`
83
- `,C.offset=(F=A.offset)!=null?F:0,C.dontPrettyTextNodes=(R=(H=A.dontPrettyTextNodes)!=null?H:A.dontprettytextnodes)!=null?R:0,C.spaceBeforeSlash=(q=(K=A.spaceBeforeSlash)!=null?K:A.spacebeforeslash)!=null?q:"",C.spaceBeforeSlash===!0&&(C.spaceBeforeSlash=" "),C.suppressPrettyCount=0,C.user={},C.state=e.None,C},T.prototype.indent=function(A,C,x){var B;return!C.pretty||C.suppressPrettyCount?"":C.pretty&&(B=(x||0)+C.offset+1,B>0)?new Array(B).join(C.indent):""},T.prototype.endline=function(A,C,x){return!C.pretty||C.suppressPrettyCount?"":C.newline},T.prototype.attribute=function(A,C,x){var B;return this.openAttribute(A,C,x),B=" "+A.name+'="'+A.value+'"',this.closeAttribute(A,C,x),B},T.prototype.cdata=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<![CDATA[",C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+="]]>"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.comment=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!-- ",C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=" -->"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.declaration=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<?xml",C.state=e.InsideTag,B+=' version="'+A.version+'"',A.encoding!=null&&(B+=' encoding="'+A.encoding+'"'),A.standalone!=null&&(B+=' standalone="'+A.standalone+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+"?>",B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.docType=function(A,C,x){var B,F,R,H,q;if(x||(x=0),this.openNode(A,C,x),C.state=e.OpenTag,H=this.indent(A,C,x),H+="<!DOCTYPE "+A.root().name,A.pubID&&A.sysID?H+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.sysID&&(H+=' SYSTEM "'+A.sysID+'"'),A.children.length>0){for(H+=" [",H+=this.endline(A,C,x),C.state=e.InsideTag,q=A.children,F=0,R=q.length;F<R;F++)B=q[F],H+=this.writeChildNode(B,C,x+1);C.state=e.CloseTag,H+="]"}return C.state=e.CloseTag,H+=C.spaceBeforeSlash+">",H+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),H},T.prototype.element=function(A,C,x){var B,F,R,H,q,K,G,he,le,oe,Z,fe,Se,Ke;x||(x=0),oe=!1,Z="",this.openNode(A,C,x),C.state=e.OpenTag,Z+=this.indent(A,C,x)+"<"+A.name,fe=A.attribs;for(le in fe)b.call(fe,le)&&(B=fe[le],Z+=this.attribute(B,C,x));if(R=A.children.length,H=R===0?null:A.children[0],R===0||A.children.every(function(be){return(be.type===r.Text||be.type===r.Raw)&&be.value===""}))C.allowEmpty?(Z+=">",C.state=e.CloseTag,Z+="</"+A.name+">"+this.endline(A,C,x)):(C.state=e.CloseTag,Z+=C.spaceBeforeSlash+"/>"+this.endline(A,C,x));else if(C.pretty&&R===1&&(H.type===r.Text||H.type===r.Raw)&&H.value!=null)Z+=">",C.state=e.InsideTag,C.suppressPrettyCount++,oe=!0,Z+=this.writeChildNode(H,C,x+1),C.suppressPrettyCount--,oe=!1,C.state=e.CloseTag,Z+="</"+A.name+">"+this.endline(A,C,x);else{if(C.dontPrettyTextNodes){for(Se=A.children,q=0,G=Se.length;q<G;q++)if(F=Se[q],(F.type===r.Text||F.type===r.Raw)&&F.value!=null){C.suppressPrettyCount++,oe=!0;break}}for(Z+=">"+this.endline(A,C,x),C.state=e.InsideTag,Ke=A.children,K=0,he=Ke.length;K<he;K++)F=Ke[K],Z+=this.writeChildNode(F,C,x+1);C.state=e.CloseTag,Z+=this.indent(A,C,x)+"</"+A.name+">",oe&&C.suppressPrettyCount--,Z+=this.endline(A,C,x),C.state=e.None}return this.closeNode(A,C,x),Z},T.prototype.writeChildNode=function(A,C,x){switch(A.type){case r.CData:return this.cdata(A,C,x);case r.Comment:return this.comment(A,C,x);case r.Element:return this.element(A,C,x);case r.Raw:return this.raw(A,C,x);case r.Text:return this.text(A,C,x);case r.ProcessingInstruction:return this.processingInstruction(A,C,x);case r.Dummy:return"";case r.Declaration:return this.declaration(A,C,x);case r.DocType:return this.docType(A,C,x);case r.AttributeDeclaration:return this.dtdAttList(A,C,x);case r.ElementDeclaration:return this.dtdElement(A,C,x);case r.EntityDeclaration:return this.dtdEntity(A,C,x);case r.NotationDeclaration:return this.dtdNotation(A,C,x);default:throw new Error("Unknown XML node type: "+A.constructor.name)}},T.prototype.processingInstruction=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<?",C.state=e.InsideTag,B+=A.target,A.value&&(B+=" "+A.value),C.state=e.CloseTag,B+=C.spaceBeforeSlash+"?>",B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.raw=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x),C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.text=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x),C.state=e.InsideTag,B+=A.value,C.state=e.CloseTag,B+=this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdAttList=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ATTLIST",C.state=e.InsideTag,B+=" "+A.elementName+" "+A.attributeName+" "+A.attributeType,A.defaultValueType!=="#DEFAULT"&&(B+=" "+A.defaultValueType),A.defaultValue&&(B+=' "'+A.defaultValue+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdElement=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ELEMENT",C.state=e.InsideTag,B+=" "+A.name+" "+A.value,C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdEntity=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!ENTITY",C.state=e.InsideTag,A.pe&&(B+=" %"),B+=" "+A.name,A.value?B+=' "'+A.value+'"':(A.pubID&&A.sysID?B+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.sysID&&(B+=' SYSTEM "'+A.sysID+'"'),A.nData&&(B+=" NDATA "+A.nData)),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.dtdNotation=function(A,C,x){var B;return this.openNode(A,C,x),C.state=e.OpenTag,B=this.indent(A,C,x)+"<!NOTATION",C.state=e.InsideTag,B+=" "+A.name,A.pubID&&A.sysID?B+=' PUBLIC "'+A.pubID+'" "'+A.sysID+'"':A.pubID?B+=' PUBLIC "'+A.pubID+'"':A.sysID&&(B+=' SYSTEM "'+A.sysID+'"'),C.state=e.CloseTag,B+=C.spaceBeforeSlash+">"+this.endline(A,C,x),C.state=e.None,this.closeNode(A,C,x),B},T.prototype.openNode=function(A,C,x){},T.prototype.closeNode=function(A,C,x){},T.prototype.openAttribute=function(A,C,x){},T.prototype.closeAttribute=function(A,C,x){},T})()}).call(nV)});var AE=ye((iV,aV)=>{"use strict";(function(){var r,e,t=o(function(s,i){for(var a in i)n.call(i,a)&&(s[a]=i[a]);function u(){this.constructor=s}return o(u,"ctor"),u.prototype=i.prototype,s.prototype=new u,s.__super__=i.prototype,s},"extend"),n={}.hasOwnProperty;e=DT(),aV.exports=r=(function(s){t(i,s);function i(a){i.__super__.constructor.call(this,a)}return o(i,"XMLStringWriter"),i.prototype.document=function(a,u){var l,f,h,m,g;for(u=this.filterOptions(u),m="",g=a.children,f=0,h=g.length;f<h;f++)l=g[f],m+=this.writeChildNode(l,u,0);return u.pretty&&m.slice(-u.newline.length)===u.newline&&(m=m.slice(0,-u.newline.length)),m},i})(e)}).call(iV)});var _T=ye((oV,uV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l=o(function(h,m){for(var g in m)f.call(m,g)&&(h[g]=m[g]);function w(){this.constructor=h}return o(w,"ctor"),w.prototype=m.prototype,h.prototype=new w,h.__super__=m.prototype,h},"extend"),f={}.hasOwnProperty;u=Ua().isPlainObject,t=NT(),e=c5(),s=Js(),r=an(),a=BT(),i=AE(),uV.exports=n=(function(h){l(m,h);function m(g){m.__super__.constructor.call(this,null),this.name="#document",this.type=r.Document,this.documentURI=null,this.domConfig=new e,g||(g={}),g.writer||(g.writer=new i),this.options=g,this.stringify=new a(g)}return o(m,"XMLDocument"),Object.defineProperty(m.prototype,"implementation",{value:new t}),Object.defineProperty(m.prototype,"doctype",{get:o(function(){var g,w,y,S;for(S=this.children,w=0,y=S.length;w<y;w++)if(g=S[w],g.type===r.DocType)return g;return null},"get")}),Object.defineProperty(m.prototype,"documentElement",{get:o(function(){return this.rootObject||null},"get")}),Object.defineProperty(m.prototype,"inputEncoding",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"strictErrorChecking",{get:o(function(){return!1},"get")}),Object.defineProperty(m.prototype,"xmlEncoding",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].encoding:null},"get")}),Object.defineProperty(m.prototype,"xmlStandalone",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].standalone==="yes":!1},"get")}),Object.defineProperty(m.prototype,"xmlVersion",{get:o(function(){return this.children.length!==0&&this.children[0].type===r.Declaration?this.children[0].version:"1.0"},"get")}),Object.defineProperty(m.prototype,"URL",{get:o(function(){return this.documentURI},"get")}),Object.defineProperty(m.prototype,"origin",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"compatMode",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"characterSet",{get:o(function(){return null},"get")}),Object.defineProperty(m.prototype,"contentType",{get:o(function(){return null},"get")}),m.prototype.end=function(g){var w;return w={},g?u(g)&&(w=g,g=this.options.writer):g=this.options.writer,g.document(this,g.filterOptions(w))},m.prototype.toString=function(g){return this.options.writer.document(this,this.options.writer.filterOptions(g))},m.prototype.createElement=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTextNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createComment=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createCDATASection=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createProcessingInstruction=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttribute=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEntityReference=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.importNode=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createElementNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createAttributeNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByTagNameNS=function(g,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementById=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.adoptNode=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.renameNode=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.getElementsByClassName=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createEvent=function(g){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createNodeIterator=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m.prototype.createTreeWalker=function(g,w,y){throw new Error("This DOM method is not implemented."+this.debugInfo())},m})(s)}).call(oV)});var fV=ye((lV,cV)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R={}.hasOwnProperty;F=Ua(),x=F.isObject,C=F.isFunction,B=F.isPlainObject,A=F.getValue,r=an(),m=_T(),w=cE(),n=fE(),s=hE(),S=wE(),T=SE(),y=EE(),f=pE(),h=vE(),i=dE(),u=mE(),a=gE(),l=yE(),t=TT(),b=BT(),E=AE(),e=ug(),cV.exports=g=(function(){function H(q,K,G){var he;this.name="?xml",this.type=r.Document,q||(q={}),he={},q.writer?B(q.writer)&&(he=q.writer,q.writer=new E):q.writer=new E,this.options=q,this.writer=q.writer,this.writerOptions=this.writer.filterOptions(he),this.stringify=new b(q),this.onDataCallback=K||function(){},this.onEndCallback=G||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return o(H,"XMLDocumentCB"),H.prototype.createChildNode=function(q){var K,G,he,le,oe,Z,fe,Se;switch(q.type){case r.CData:this.cdata(q.value);break;case r.Comment:this.comment(q.value);break;case r.Element:he={},fe=q.attribs;for(G in fe)R.call(fe,G)&&(K=fe[G],he[G]=K.value);this.node(q.name,he);break;case r.Dummy:this.dummy();break;case r.Raw:this.raw(q.value);break;case r.Text:this.text(q.value);break;case r.ProcessingInstruction:this.instruction(q.target,q.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+q.constructor.name)}for(Se=q.children,oe=0,Z=Se.length;oe<Z;oe++)le=Se[oe],this.createChildNode(le),le.type===r.Element&&this.up();return this},H.prototype.dummy=function(){return this},H.prototype.node=function(q,K,G){var he;if(q==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(q));return this.openCurrent(),q=A(q),K==null&&(K={}),K=A(K),x(K)||(he=[K,G],G=he[0],K=he[1]),this.currentNode=new w(this,q,K),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,G!=null&&this.text(G),this},H.prototype.element=function(q,K,G){var he,le,oe,Z,fe,Se;if(this.currentNode&&this.currentNode.type===r.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(q)||x(q)||C(q))for(Z=this.options.noValidation,this.options.noValidation=!0,Se=new m(this.options).element("TEMP_ROOT"),Se.element(q),this.options.noValidation=Z,fe=Se.children,le=0,oe=fe.length;le<oe;le++)he=fe[le],this.createChildNode(he),he.type===r.Element&&this.up();else this.node(q,K,G);return this},H.prototype.attribute=function(q,K){var G,he;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(q));if(q!=null&&(q=A(q)),x(q))for(G in q)R.call(q,G)&&(he=q[G],this.attribute(G,he));else C(K)&&(K=K.apply()),this.options.keepNullAttributes&&K==null?this.currentNode.attribs[q]=new t(this,q,""):K!=null&&(this.currentNode.attribs[q]=new t(this,q,K));return this},H.prototype.text=function(q){var K;return this.openCurrent(),K=new T(this,q),this.onData(this.writer.text(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.cdata=function(q){var K;return this.openCurrent(),K=new n(this,q),this.onData(this.writer.cdata(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.comment=function(q){var K;return this.openCurrent(),K=new s(this,q),this.onData(this.writer.comment(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.raw=function(q){var K;return this.openCurrent(),K=new S(this,q),this.onData(this.writer.raw(K,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.instruction=function(q,K){var G,he,le,oe,Z;if(this.openCurrent(),q!=null&&(q=A(q)),K!=null&&(K=A(K)),Array.isArray(q))for(G=0,oe=q.length;G<oe;G++)he=q[G],this.instruction(he);else if(x(q))for(he in q)R.call(q,he)&&(le=q[he],this.instruction(he,le));else C(K)&&(K=K.apply()),Z=new y(this,q,K),this.onData(this.writer.processingInstruction(Z,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},H.prototype.declaration=function(q,K,G){var he;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return he=new f(this,q,K,G),this.onData(this.writer.declaration(he,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.doctype=function(q,K,G){if(this.openCurrent(),q==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 h(this,K,G),this.currentNode.rootNodeName=q,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},H.prototype.dtdElement=function(q,K){var G;return this.openCurrent(),G=new a(this,q,K),this.onData(this.writer.dtdElement(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.attList=function(q,K,G,he,le){var oe;return this.openCurrent(),oe=new i(this,q,K,G,he,le),this.onData(this.writer.dtdAttList(oe,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.entity=function(q,K){var G;return this.openCurrent(),G=new u(this,!1,q,K),this.onData(this.writer.dtdEntity(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.pEntity=function(q,K){var G;return this.openCurrent(),G=new u(this,!0,q,K),this.onData(this.writer.dtdEntity(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.prototype.notation=function(q,K){var G;return this.openCurrent(),G=new l(this,q,K),this.onData(this.writer.dtdNotation(G,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},H.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},H.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},H.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},H.prototype.openNode=function(q){var K,G,he,le;if(!q.isOpen){if(!this.root&&this.currentLevel===0&&q.type===r.Element&&(this.root=q),G="",q.type===r.Element){this.writerOptions.state=e.OpenTag,G=this.writer.indent(q,this.writerOptions,this.currentLevel)+"<"+q.name,le=q.attribs;for(he in le)R.call(le,he)&&(K=le[he],G+=this.writer.attribute(K,this.writerOptions,this.currentLevel));G+=(q.children?">":"/>")+this.writer.endline(q,this.writerOptions,this.currentLevel),this.writerOptions.state=e.InsideTag}else this.writerOptions.state=e.OpenTag,G=this.writer.indent(q,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+q.rootNodeName,q.pubID&&q.sysID?G+=' PUBLIC "'+q.pubID+'" "'+q.sysID+'"':q.sysID&&(G+=' SYSTEM "'+q.sysID+'"'),q.children?(G+=" [",this.writerOptions.state=e.InsideTag):(this.writerOptions.state=e.CloseTag,G+=">"),G+=this.writer.endline(q,this.writerOptions,this.currentLevel);return this.onData(G,this.currentLevel),q.isOpen=!0}},H.prototype.closeNode=function(q){var K;if(!q.isClosed)return K="",this.writerOptions.state=e.CloseTag,q.type===r.Element?K=this.writer.indent(q,this.writerOptions,this.currentLevel)+"</"+q.name+">"+this.writer.endline(q,this.writerOptions,this.currentLevel):K=this.writer.indent(q,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(q,this.writerOptions,this.currentLevel),this.writerOptions.state=e.None,this.onData(K,this.currentLevel),q.isClosed=!0},H.prototype.onData=function(q,K){return this.documentStarted=!0,this.onDataCallback(q,K+1)},H.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},H.prototype.debugInfo=function(q){return q==null?"":"node: <"+q+">"},H.prototype.ele=function(){return this.element.apply(this,arguments)},H.prototype.nod=function(q,K,G){return this.node(q,K,G)},H.prototype.txt=function(q){return this.text(q)},H.prototype.dat=function(q){return this.cdata(q)},H.prototype.com=function(q){return this.comment(q)},H.prototype.ins=function(q,K){return this.instruction(q,K)},H.prototype.dec=function(q,K,G){return this.declaration(q,K,G)},H.prototype.dtd=function(q,K,G){return this.doctype(q,K,G)},H.prototype.e=function(q,K,G){return this.element(q,K,G)},H.prototype.n=function(q,K,G){return this.node(q,K,G)},H.prototype.t=function(q){return this.text(q)},H.prototype.d=function(q){return this.cdata(q)},H.prototype.c=function(q){return this.comment(q)},H.prototype.r=function(q){return this.raw(q)},H.prototype.i=function(q,K){return this.instruction(q,K)},H.prototype.att=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.a=function(){return this.currentNode&&this.currentNode.type===r.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},H.prototype.ent=function(q,K){return this.entity(q,K)},H.prototype.pent=function(q,K){return this.pEntity(q,K)},H.prototype.not=function(q,K){return this.notation(q,K)},H})()}).call(lV)});var dV=ye((hV,pV)=>{"use strict";(function(){var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;r=an(),n=DT(),e=ug(),pV.exports=t=(function(a){s(u,a);function u(l,f){this.stream=l,u.__super__.constructor.call(this,f)}return o(u,"XMLStreamWriter"),u.prototype.endline=function(l,f,h){return l.isLastRootNode&&f.state===e.CloseTag?"":u.__super__.endline.call(this,l,f,h)},u.prototype.document=function(l,f){var h,m,g,w,y,S,E,b,T;for(E=l.children,m=g=0,y=E.length;g<y;m=++g)h=E[m],h.isLastRootNode=m===l.children.length-1;for(f=this.filterOptions(f),b=l.children,T=[],w=0,S=b.length;w<S;w++)h=b[w],T.push(this.writeChildNode(h,f,0));return T},u.prototype.attribute=function(l,f,h){return this.stream.write(u.__super__.attribute.call(this,l,f,h))},u.prototype.cdata=function(l,f,h){return this.stream.write(u.__super__.cdata.call(this,l,f,h))},u.prototype.comment=function(l,f,h){return this.stream.write(u.__super__.comment.call(this,l,f,h))},u.prototype.declaration=function(l,f,h){return this.stream.write(u.__super__.declaration.call(this,l,f,h))},u.prototype.docType=function(l,f,h){var m,g,w,y;if(h||(h=0),this.openNode(l,f,h),f.state=e.OpenTag,this.stream.write(this.indent(l,f,h)),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,f,h)),f.state=e.InsideTag,y=l.children,g=0,w=y.length;g<w;g++)m=y[g],this.writeChildNode(m,f,h+1);f.state=e.CloseTag,this.stream.write("]")}return f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+">"),this.stream.write(this.endline(l,f,h)),f.state=e.None,this.closeNode(l,f,h)},u.prototype.element=function(l,f,h){var m,g,w,y,S,E,b,T,A,C;h||(h=0),this.openNode(l,f,h),f.state=e.OpenTag,this.stream.write(this.indent(l,f,h)+"<"+l.name),A=l.attribs;for(b in A)i.call(A,b)&&(m=A[b],this.attribute(m,f,h));if(w=l.children.length,y=w===0?null:l.children[0],w===0||l.children.every(function(x){return(x.type===r.Text||x.type===r.Raw)&&x.value===""}))f.allowEmpty?(this.stream.write(">"),f.state=e.CloseTag,this.stream.write("</"+l.name+">")):(f.state=e.CloseTag,this.stream.write(f.spaceBeforeSlash+"/>"));else if(f.pretty&&w===1&&(y.type===r.Text||y.type===r.Raw)&&y.value!=null)this.stream.write(">"),f.state=e.InsideTag,f.suppressPrettyCount++,T=!0,this.writeChildNode(y,f,h+1),f.suppressPrettyCount--,T=!1,f.state=e.CloseTag,this.stream.write("</"+l.name+">");else{for(this.stream.write(">"+this.endline(l,f,h)),f.state=e.InsideTag,C=l.children,S=0,E=C.length;S<E;S++)g=C[S],this.writeChildNode(g,f,h+1);f.state=e.CloseTag,this.stream.write(this.indent(l,f,h)+"</"+l.name+">")}return this.stream.write(this.endline(l,f,h)),f.state=e.None,this.closeNode(l,f,h)},u.prototype.processingInstruction=function(l,f,h){return this.stream.write(u.__super__.processingInstruction.call(this,l,f,h))},u.prototype.raw=function(l,f,h){return this.stream.write(u.__super__.raw.call(this,l,f,h))},u.prototype.text=function(l,f,h){return this.stream.write(u.__super__.text.call(this,l,f,h))},u.prototype.dtdAttList=function(l,f,h){return this.stream.write(u.__super__.dtdAttList.call(this,l,f,h))},u.prototype.dtdElement=function(l,f,h){return this.stream.write(u.__super__.dtdElement.call(this,l,f,h))},u.prototype.dtdEntity=function(l,f,h){return this.stream.write(u.__super__.dtdEntity.call(this,l,f,h))},u.prototype.dtdNotation=function(l,f,h){return this.stream.write(u.__super__.dtdNotation.call(this,l,f,h))},u})(n)}).call(hV)});var gV=ye((mV,Gu)=>{"use strict";(function(){var r,e,t,n,s,i,a,u,l,f;f=Ua(),u=f.assign,l=f.isFunction,t=NT(),n=_T(),s=fV(),a=AE(),i=dV(),r=an(),e=ug(),Gu.exports.create=function(h,m,g,w){var y,S;if(h==null)throw new Error("Root element needs a name.");return w=u({},m,g,w),y=new n(w),S=y.element(h),w.headless||(y.declaration(w),(w.pubID!=null||w.sysID!=null)&&y.dtd(w)),S},Gu.exports.begin=function(h,m,g){var w;return l(h)&&(w=[h,m],m=w[0],g=w[1],h={}),m?new s(h,m,g):new n(h)},Gu.exports.stringWriter=function(h){return new a(h)},Gu.exports.streamWriter=function(h,m){return new i(h,m)},Gu.exports.implementation=new t,Gu.exports.nodeType=r,Gu.exports.writerState=e}).call(mV)});var yV=ye(RT=>{"use strict";(function(){"use strict";var r,e,t,n,s,i={}.hasOwnProperty;r=gV(),e=uE().defaults,n=o(function(a){return typeof a=="string"&&(a.indexOf("&")>=0||a.indexOf(">")>=0||a.indexOf("<")>=0)},"requiresCDATA"),s=o(function(a){return"<![CDATA["+t(a)+"]]>"},"wrapCDATA"),t=o(function(a){return a.replace("]]>","]]]]><![CDATA[>")},"escapeCDATA"),RT.Builder=(function(){function a(u){var l,f,h;this.options={},f=e["0.2"];for(l in f)i.call(f,l)&&(h=f[l],this.options[l]=h);for(l in u)i.call(u,l)&&(h=u[l],this.options[l]=h)}return o(a,"Builder"),a.prototype.buildObject=function(u){var l,f,h,m,g;return l=this.options.attrkey,f=this.options.charkey,Object.keys(u).length===1&&this.options.rootName===e["0.2"].rootName?(g=Object.keys(u)[0],u=u[g]):g=this.options.rootName,h=(function(w){return function(y,S){var E,b,T,A,C,x;if(typeof S!="object")w.options.cdata&&n(S)?y.raw(s(S)):y.txt(S);else if(Array.isArray(S)){for(A in S)if(i.call(S,A)){b=S[A];for(C in b)T=b[C],y=h(y.ele(C),T).up()}}else for(C in S)if(i.call(S,C))if(b=S[C],C===l){if(typeof b=="object")for(E in b)x=b[E],y=y.att(E,x)}else if(C===f)w.options.cdata&&n(b)?y=y.raw(s(b)):y=y.txt(b);else if(Array.isArray(b))for(A in b)i.call(b,A)&&(T=b[A],typeof T=="string"?w.options.cdata&&n(T)?y=y.ele(C).raw(s(T)).up():y=y.ele(C,T).up():y=h(y.ele(C),T).up());else typeof b=="object"?y=h(y.ele(C),b).up():typeof b=="string"&&w.options.cdata&&n(b)?y=y.ele(C).raw(s(b)).up():(b==null&&(b=""),y=y.ele(C,b.toString()).up());return y}})(this),m=r.create(g,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),h(m,u).end(this.options.renderOpts)},a})()}).call(RT)});var vV=ye(PT=>{"use strict";(function(){"use strict";PT.stripBOM=function(r){return r[0]==="\uFEFF"?r.substring(1):r}}).call(PT)});var OT=ye(Dc=>{"use strict";(function(){"use strict";var r;r=new RegExp(/(?!xmlns)^.*:/),Dc.normalize=function(e){return e.toLowerCase()},Dc.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Dc.stripPrefix=function(e){return e.replace(r,"")},Dc.parseNumbers=function(e){return isNaN(e)||(e=e%1===0?parseInt(e,10):parseFloat(e)),e},Dc.parseBooleans=function(e){return/^(?:true|false)$/i.test(e)&&(e=e.toLowerCase()==="true"),e}}).call(Dc)});var wV=ye(bo=>{"use strict";(function(){"use strict";var r,e,t,n,s,i,a,u,l,f=o(function(g,w){return function(){return g.apply(w,arguments)}},"bind"),h=o(function(g,w){for(var y in w)m.call(w,y)&&(g[y]=w[y]);function S(){this.constructor=g}return o(S,"ctor"),S.prototype=w.prototype,g.prototype=new S,g.__super__=w.prototype,g},"extend"),m={}.hasOwnProperty;u=uT(),n=wt("events"),r=vV(),a=OT(),l=wt("timers").setImmediate,e=uE().defaults,s=o(function(g){return typeof g=="object"&&g!=null&&Object.keys(g).length===0},"isEmpty"),i=o(function(g,w,y){var S,E,b;for(S=0,E=g.length;S<E;S++)b=g[S],w=b(w,y);return w},"processItem"),t=o(function(g,w,y){var S;return S=Object.create(null),S.value=y,S.writable=!0,S.enumerable=!0,S.configurable=!0,Object.defineProperty(g,w,S)},"defineProperty"),bo.Parser=(function(g){h(w,g);function w(y){this.parseStringPromise=f(this.parseStringPromise,this),this.parseString=f(this.parseString,this),this.reset=f(this.reset,this),this.assignOrPush=f(this.assignOrPush,this),this.processAsync=f(this.processAsync,this);var S,E,b;if(!(this instanceof bo.Parser))return new bo.Parser(y);this.options={},E=e["0.2"];for(S in E)m.call(E,S)&&(b=E[S],this.options[S]=b);for(S in y)m.call(y,S)&&(b=y[S],this.options[S]=b);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 o(w,"Parser"),w.prototype.processAsync=function(){var y,S;try{return this.remaining.length<=this.options.chunkSize?(y=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(y),this.saxParser.close()):(y=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(y),l(this.processAsync))}catch(E){if(S=E,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(S)}},w.prototype.assignOrPush=function(y,S,E){return S in y?(y[S]instanceof Array||t(y,S,[y[S]]),y[S].push(E)):this.options.explicitArray?t(y,S,[E]):t(y,S,E)},w.prototype.reset=function(){var y,S,E,b;return this.removeAllListeners(),this.saxParser=u.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(T){return function(A){if(T.saxParser.resume(),!T.saxParser.errThrown)return T.saxParser.errThrown=!0,T.emit("error",A)}})(this),this.saxParser.onend=(function(T){return function(){if(!T.saxParser.ended)return T.saxParser.ended=!0,T.emit("end",T.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,b=[],y=this.options.attrkey,S=this.options.charkey,this.saxParser.onopentag=(function(T){return function(A){var C,x,B,F,R;if(B={},B[S]="",!T.options.ignoreAttrs){R=A.attributes;for(C in R)m.call(R,C)&&(!(y in B)&&!T.options.mergeAttrs&&(B[y]={}),x=T.options.attrValueProcessors?i(T.options.attrValueProcessors,A.attributes[C],C):A.attributes[C],F=T.options.attrNameProcessors?i(T.options.attrNameProcessors,C):C,T.options.mergeAttrs?T.assignOrPush(B,F,x):t(B[y],F,x))}return B["#name"]=T.options.tagNameProcessors?i(T.options.tagNameProcessors,A.name):A.name,T.options.xmlns&&(B[T.options.xmlnskey]={uri:A.uri,local:A.local}),b.push(B)}})(this),this.saxParser.onclosetag=(function(T){return function(){var A,C,x,B,F,R,H,q,K,G;if(R=b.pop(),F=R["#name"],(!T.options.explicitChildren||!T.options.preserveChildrenOrder)&&delete R["#name"],R.cdata===!0&&(A=R.cdata,delete R.cdata),K=b[b.length-1],R[S].match(/^\s*$/)&&!A?(C=R[S],delete R[S]):(T.options.trim&&(R[S]=R[S].trim()),T.options.normalize&&(R[S]=R[S].replace(/\s{2,}/g," ").trim()),R[S]=T.options.valueProcessors?i(T.options.valueProcessors,R[S],F):R[S],Object.keys(R).length===1&&S in R&&!T.EXPLICIT_CHARKEY&&(R=R[S])),s(R)&&(typeof T.options.emptyTag=="function"?R=T.options.emptyTag():R=T.options.emptyTag!==""?T.options.emptyTag:C),T.options.validator!=null&&(G="/"+(function(){var he,le,oe;for(oe=[],he=0,le=b.length;he<le;he++)B=b[he],oe.push(B["#name"]);return oe})().concat(F).join("/"),(function(){var he;try{return R=T.options.validator(G,K&&K[F],R)}catch(le){return he=le,T.emit("error",he)}})()),T.options.explicitChildren&&!T.options.mergeAttrs&&typeof R=="object"){if(!T.options.preserveChildrenOrder)B={},T.options.attrkey in R&&(B[T.options.attrkey]=R[T.options.attrkey],delete R[T.options.attrkey]),!T.options.charsAsChildren&&T.options.charkey in R&&(B[T.options.charkey]=R[T.options.charkey],delete R[T.options.charkey]),Object.getOwnPropertyNames(R).length>0&&(B[T.options.childkey]=R),R=B;else if(K){K[T.options.childkey]=K[T.options.childkey]||[],H={};for(x in R)m.call(R,x)&&t(H,x,R[x]);K[T.options.childkey].push(H),delete R["#name"],Object.keys(R).length===1&&S in R&&!T.EXPLICIT_CHARKEY&&(R=R[S])}}return b.length>0?T.assignOrPush(K,F,R):(T.options.explicitRoot&&(q=R,R={},t(R,F,q)),T.resultObject=R,T.saxParser.ended=!0,T.emit("end",T.resultObject))}})(this),E=(function(T){return function(A){var C,x;if(x=b[b.length-1],x)return x[S]+=A,T.options.explicitChildren&&T.options.preserveChildrenOrder&&T.options.charsAsChildren&&(T.options.includeWhiteChars||A.replace(/\\n/g,"").trim()!=="")&&(x[T.options.childkey]=x[T.options.childkey]||[],C={"#name":"__text__"},C[S]=A,T.options.normalize&&(C[S]=C[S].replace(/\s{2,}/g," ").trim()),x[T.options.childkey].push(C)),x}})(this),this.saxParser.ontext=E,this.saxParser.oncdata=(function(T){return function(A){var C;if(C=E(A),C)return C.cdata=!0}})(this)},w.prototype.parseString=function(y,S){var E;S!=null&&typeof S=="function"&&(this.on("end",function(b){return this.reset(),S(null,b)}),this.on("error",function(b){return this.reset(),S(b)}));try{return y=y.toString(),y.trim()===""?(this.emit("end",null),!0):(y=r.stripBOM(y),this.options.async?(this.remaining=y,l(this.processAsync),this.saxParser):this.saxParser.write(y).close())}catch(b){if(E=b,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw E}else return this.emit("error",E),this.saxParser.errThrown=!0}},w.prototype.parseStringPromise=function(y){return new Promise((function(S){return function(E,b){return S.parseString(y,function(T,A){return T?b(T):E(A)})}})(this))},w})(n),bo.parseString=function(g,w,y){var S,E,b;return y!=null?(typeof y=="function"&&(S=y),typeof w=="object"&&(E=w)):(typeof w=="function"&&(S=w),E={}),b=new bo.Parser(E),b.parseString(g,S)},bo.parseStringPromise=function(g,w){var y,S;return typeof w=="object"&&(y=w),S=new bo.Parser(y),S.parseStringPromise(g)}}).call(bo)});var SV=ye(xo=>{"use strict";(function(){"use strict";var r,e,t,n,s=o(function(a,u){for(var l in u)i.call(u,l)&&(a[l]=u[l]);function f(){this.constructor=a}return o(f,"ctor"),f.prototype=u.prototype,a.prototype=new f,a.__super__=u.prototype,a},"extend"),i={}.hasOwnProperty;e=uE(),r=yV(),t=wV(),n=OT(),xo.defaults=e.defaults,xo.processors=n,xo.ValidationError=(function(a){s(u,a);function u(l){this.message=l}return o(u,"ValidationError"),u})(Error),xo.Builder=r.Builder,xo.Parser=t.Parser,xo.parseString=t.parseString,xo.parseStringPromise=t.parseStringPromise}).call(xo)});var Bb="http://www.w3.org/2000/09/xmldsig#",kR="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",Db=(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})({}),Ph=(function(r){return r.SHA1="sha1",r.SHA256="sha256",r})({}),_b=(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 Sr={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"},lae=Object.keys(Sr);var fae={Production:"1",Homolog:"2"};var dae={[Sr.AC]:"America/Rio_Branco",[Sr.AL]:"America/Maceio",[Sr.AM]:"America/Manaus",[Sr.AP]:"America/Belem",[Sr.BA]:"America/Bahia",[Sr.CE]:"America/Fortaleza",[Sr.DF]:"America/Sao_Paulo",[Sr.ES]:"America/Sao_Paulo",[Sr.GO]:"America/Sao_Paulo",[Sr.MA]:"America/Fortaleza",[Sr.MG]:"America/Sao_Paulo",[Sr.MS]:"America/Campo_Grande",[Sr.MT]:"America/Cuiaba",[Sr.PA]:"America/Belem",[Sr.PB]:"America/Fortaleza",[Sr.PE]:"America/Recife",[Sr.PI]:"America/Fortaleza",[Sr.PR]:"America/Sao_Paulo",[Sr.RJ]:"America/Sao_Paulo",[Sr.RN]:"America/Fortaleza",[Sr.RO]:"America/Porto_Velho",[Sr.RR]:"America/Boa_Vista",[Sr.RS]:"America/Sao_Paulo",[Sr.SC]:"America/Sao_Paulo",[Sr.SE]:"America/Maceio",[Sr.SP]:"America/Sao_Paulo",[Sr.TO]:"America/Araguaina"};var $s=class extends Error{static{o(this,"NFeTsError")}};var LR=class extends $s{static{o(this,"ValidationError")}};var mm={includeComments:!1,exclusive:!0};import{NFeTsError as TK}from"@nfets/core/domain/errors/nfets-error";var Rb=o(r=>{throw new TK("Didn't expect to get here")},"unreachable");var Oh=class{static{o(this,"Signer")}toolkit;certificateRepository;algorithm;canonical;constructor(e,t,n=Ph.SHA1,s=mm){this.toolkit=e,this.certificateRepository=t,this.algorithm=n,this.canonical=s}assemble(e,t,n){let s=this.certificateRepository.getStringCertificate(n);return{$:{xmlns:Bb},SignedInfo:e,SignatureValue:t,KeyInfo:{X509Data:{X509Certificate:s}}}}signedInfo(e,t){return{CanonicalizationMethod:{$:{Algorithm:kR}},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:Bb},...e},{rootName:"SignedInfo"}),this.canonical);return await 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 Ph.SHA256:return _b.SHA256;case Ph.SHA1:return _b.SHA1;default:return Rb(this.algorithm)}}get signatureMethod(){switch(this.algorithm){case Ph.SHA256:return Db.RSA_SHA256;case Ph.SHA1:return Db.RSA_SHA1;default:return Rb(this.algorithm)}}};var Pb=class{static{o(this,"Left")}value;constructor(e){this.value=e}isLeft(){return!0}isRight(){return!1}},gw=class{static{o(this,"Right")}value;constructor(e){this.value=e}isLeft(){return!1}isRight(){return!0}},co=o(r=>new Pb(r),"left"),kh=o(r=>r===void 0?new gw(void 0):new gw(r),"right");var VR=class extends Oh{static{o(this,"EntitySigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n;if(!e[s])return co(new $s(`Node ${String(s)} not found`));let l=await this.toolkit.build(this.ns(e,s),{headless:!0,rootName:String(s),renderOpts:{pretty:!1}}),f=this.signedInfo(l,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=e;return m.Signature=this.assemble(f,h.value,u),kh(m)}ns(e,t){let n=e.$?.xmlns,{$:s,...i}=e[t],{xmlns:a,...u}=s??{};return{$:{xmlns:n,...u},...i}}};var UR=class extends Oh{static{o(this,"XmlSigner")}async sign(e,t,n){let{tag:s,mark:i}=t,{privateKey:a,certificate:u}=n,l=this.toolkit.getNode(e,s);if(!l)return co(new $s(`Node ${s} not found`));let f=this.signedInfo(l,i),h=await this.signOrLeft(f,a);if(h.isLeft())return h;let m=await this.toolkit.build(this.assemble(f,h.value,u),{rootName:"Signature"});return kh(this.toolkit.appendNode(e,m))}};import"reflect-metadata";import{validateSync as BK}from"class-validator";import"reflect-metadata";var gm="__SkipValidation__",noe=o(()=>(r,e)=>{Reflect.defineMetadata(gm,!0,r,e.toString())},"SkipValidation"),soe=o(()=>r=>{Reflect.defineMetadata(gm,!0,r)},"SkipAllValidations");import{plainToInstance as IK}from"class-transformer";var yw=o(r=>{for(let[e,t]of Object.entries(r))typeof t>"u"&&delete r[e],t===""&&delete r[e],t&&typeof t=="object"&&yw(t)},"clearEmptyValues"),MR=o((r,e,t={})=>{let n=IK(e,r);return t.clearEmptyValues&&yw(n),n},"plainToInstance");var jR="__ValidateErrors__",FR=o((r,e)=>r.reduce((t,n)=>{if(n.children?.length)return t.concat(FR(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"),doe=o(r=>(e,t,n)=>{let s=n.value;n.value=function(...i){let a=Reflect.getMetadata(gm,this.constructor);if(Reflect.getMetadata(gm,this.constructor.prototype,t.toString())===!0||a===!0)return s?.apply(this,i);let[l,...f]=i,h=MR(l,r),m=BK(h,{whitelist:!0});if(yw(h),m.length){let g=Reflect.getMetadata(jR,this)??[];Reflect.defineMetadata(jR,g.concat(FR(m,s?.name)),this)}return s?.apply(this,[h,...f])}},"Validates");import"reflect-metadata";import{Decimal as DK}from"@nfets/core/infrastructure";import{registerDecorator as _K}from"class-validator";var qR=o(r=>(e,t)=>{_K({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof DK?!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 HR}from"class-validator";var Lh=Symbol("choice"),Vh=o(r=>r==null||r==="","isEmpty"),boe=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(Lh,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(Lh,i,e);for(let u of t)HR({name:"choice",target:e,propertyName:u,options:s,validator:{validate(l,f){let h=f.object,m=f.property,g=Reflect.getMetadata(Lh,e);if(!g)return!0;let w=g.find(y=>y.properties.includes(m));if(!w||Vh(l))return!0;for(let y of w.properties){if(y===m)continue;let S=h[y];if(!Vh(S))return!1}for(let y of g)if(y!==w)for(let S of y.properties){let E=h[S];if(!Vh(E))return!1}return!0},defaultMessage(l){let f=Reflect.getMetadata(Lh,e);if(!f)return`${l.property} validation error`;let h=f.find(g=>g.properties.includes(l.property));if(!h)return`${l.property} validation error`;let m=l.object;for(let g of h.properties){let w=m[g];if(!Vh(w)&&g!==l.property)return`${l.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`}for(let g of f)if(g!==h)for(let w of g.properties){let y=m[w];if(!Vh(y))return`${l.property} cannot be set because ${w} from a different choice group is already set.`}return`${l.property} validation error`}}});if(n)for(let u of t)HR({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(l,f){let h=f.object,m=Reflect.getMetadata(Lh,e);if(!m)return!0;let g=m.find(w=>w.properties.includes(f.property));if(!g?.required)return!0;for(let w of g.properties){let y=h[w];if(!Vh(y))return!0}return f.property!==g.properties[0]},defaultMessage(l){let f=Reflect.getMetadata(Lh,e);if(!f)return"At least one property from a choice group must be provided";let h=f.find(m=>m.properties.includes(l.property));return h?`You must provide a value for one of the following properties: ${h.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Decimal as RK}from"@nfets/core/infrastructure";import{Transform as PK}from"class-transformer";var _oe=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{qR(e)(t,n),PK(({value:s})=>RK.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as LK}from"class-transformer";import{IsDateString as VK}from"class-validator";import Ob from"dayjs";import OK from"dayjs/plugin/utc";import kK from"dayjs/plugin/timezone";Ob.extend(OK);Ob.extend(kK);var KR=Ob;var Foe=o((r={})=>(e,t)=>{LK(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?KR(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),VK()(e,t)},"TransformDateString");var $R=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],l=n.reduce((y,S,E)=>y+S*a[E],0)%11,f=l===0||l===1?0:11-l,h=[5,4,3,2,9,8,7,6,5,4,3,2],g=[...n,f].reduce((y,S,E)=>y+S*h[E],0)%11,w=g===0||g===1?0:11-g;return s===f&&i===w}};var XR=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let 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 GR=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var WR=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],l=i;for(let m=0;m<8;m++)l+=parseInt(t[m],10)*u[m];let h=11-l%11;return h===10?h=0:h===11&&(h=a),h===parseInt(t[8],10)}};var JR=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(S=>parseInt(S,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 S=0;S<i.length;S++)a+=n[S]*i[S];let u=a%s,l=s-u;(s===11&&u<=1||s===10&&u===0)&&(l=0);let h=(t.slice(0,t.length-2)+l.toString()).split("").map(S=>parseInt(S,10)),m=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],g=0;for(let S=0;S<m.length;S++)g+=h[S]*m[S];let w=g%s,y=s-w;return(s===11&&w<=1||s===10&&w===0)&&(y=0),y===n[t.length-2]&&l===n[t.length-1]}};var zR=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var YR=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let m=10,g=0;m>=0;m--,g=(g+1)%i.length)a+=n[m]*i[g];let u=11-a%11;(u===10||u===11)&&(u=0);let l=n.concat([u]),f=0;for(let m=11,g=0;m>=0;m--,g=(g+1)%i.length)f+=l[m]*i[g];let h=11-f%11;return(h===10||h===11)&&(h=0),u===s[0]&&h===s[1]}};var QR=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var ZR=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let 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 eP=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var tP=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let w=0;w<12;w++){let y=w%2===0?1:2,S=(parseInt(s[w])*y).toString();i+=S.split("").reduce((E,b)=>E+parseInt(b),0)}let u=Math.ceil(i/10)*10-i,l=n+u.toString(),f=[3,2,11,10,9,8,7,6,5,4,3,2],h=0;for(let w=0;w<12;w++)h+=parseInt(l[w])*f[w];let m=h%11,g=m<2?0:11-m;return parseInt(t[11])===u&&parseInt(t[12])===g}};var rP=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let 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 nP=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var sP=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var iP=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var aP=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let w=0;w<7;w++)i+=n[w]*s[w];let a=i%11,u=a===0||a===1?0:11-a,l=[...n,u],f=[9,8,7,6,5,4,3,2],h=0;for(let w=0;w<8;w++)h+=l[w]*f[w];let m=h%11,g=m===0||m===1?0:11-m;return u===parseInt(t[7])&&g===parseInt(t[8])}};var oP=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var uP=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let m=0;m<8;m++)a+=n[m]*s[m];let u=11-a%11;u>=10&&(u=0);let l=[...n,u],f=0;for(let m=0;m<9;m++)f+=l[m]*i[m];let h=11-f%11;return h>=10&&(h=0),u===parseInt(t[8])&&h===parseInt(t[9])}};var lP=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var cP=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let f=0;f<n.length;f++)i+=s[f]*n[f];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var fP=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let l=0;l<s.length;l++)i+=n[l]*s[l];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var hP=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var pP=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var dP=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var mP=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var gP=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let h=0;h<8;h++)i+=n[h]*s[h];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],l=0;for(let h=0;h<11;h++)l+=n[h]*u[h];let f=l%11%10;return a===n[8]&&f===n[11]}};var yP=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let f=0;f<i.length;f++)a+=s[f]*i[f];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};var vP=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
84
- `).reduce((i,a)=>{let[u,l]=a.split("=").map(f=>f.trim());return!u||!l?i:i.set(u,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")?.replace(/:.*$/g,""),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),s=t.indexOf(n);if(s===-1)return;let i=[t.subarray(0,s),t.subarray(s)];if(i.length<=1)return;let u=i[0].subarray(-4),l=u.subarray(-2);u[0]===48?l=u:u[1]===48&&(l=u.subarray(-3));let f=Buffer.concat([l,n,i[1]]),h=this.length(f),m=n.length,g=f.subarray(2+m,2+m+h),w=g.length-l.length-2;if(w<=0||w>g.length)return;let S=g.subarray(-w).toString("utf8");return S.substring(Buffer.from(S).findIndex((E,b)=>S.charCodeAt(b)>=32&&S.charCodeAt(b)<=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 Uh=9e15,gu=1e9,kb="0123456789abcdef",Sw="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Ew="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Lb={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Uh,maxE:Uh,crypto:!1},AP,fo,Bt=!0,Cw="[DecimalError] ",mu=Cw+"Invalid argument: ",CP=Cw+"Precision limit exceeded",bP=Cw+"crypto unavailable",xP="[object Decimal]",zn=Math.floor,yn=Math.pow,UK=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,MK=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,jK=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,NP=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ji=1e7,At=7,FK=9007199254740991,qK=Sw.length-1,Vb=Ew.length-1,Pe={toStringTag:xP};Pe.absoluteValue=Pe.abs=function(){var r=new this.constructor(this);return r.s<0&&(r.s=1),mt(r)};Pe.ceil=function(){return mt(new this.constructor(this),this.e+1,2)};Pe.clampedTo=Pe.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(mu+e);return t=n.cmp(r),t<0?r:n.cmp(e)>0?e:new s(n)};Pe.comparedTo=Pe.cmp=function(r){var e,t,n,s,i=this,a=i.d,u=(r=new i.constructor(r)).d,l=i.s,f=r.s;if(!a||!u)return!l||!f?NaN:l!==f?l:a===u?0:!a^l<0?1:-1;if(!a[0]||!u[0])return a[0]?l:u[0]?-f:0;if(l!==f)return l;if(i.e!==r.e)return i.e>r.e^l<0?1:-1;for(n=a.length,s=u.length,e=0,t=n<s?n:s;e<t;++e)if(a[e]!==u[e])return a[e]>u[e]^l<0?1:-1;return n===s?0:n>s^l<0?1:-1};Pe.cosine=Pe.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())+At,n.rounding=1,t=HK(n,_P(n,t)),n.precision=r,n.rounding=e,mt(fo==2||fo==3?t.neg():t,r,e,!0)):new n(1):new n(NaN)};Pe.cubeRoot=Pe.cbrt=function(){var r,e,t,n,s,i,a,u,l,f,h=this,m=h.constructor;if(!h.isFinite()||h.isZero())return new m(h);for(Bt=!1,i=h.s*yn(h.s*h,1/3),!i||Math.abs(i)==1/0?(t=On(h.d),r=h.e,(i=(r-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=yn(t,1/3),r=zn((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 m(t),n.s=h.s):n=new m(i.toString()),a=(r=m.precision)+3;;)if(u=n,l=u.times(u).times(u),f=l.plus(h),n=xr(f.plus(h).times(u),f.plus(l),a+2,1),On(u.d).slice(0,a)===(t=On(n.d)).slice(0,a))if(t=t.slice(a-3,a+1),t=="9999"||!s&&t=="4999"){if(!s&&(mt(u,r+1,0),u.times(u).times(u).eq(h))){n=u;break}a+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(mt(n,r+1,1),e=!n.times(n).times(n).eq(h));break}return Bt=!0,mt(n,r,m.rounding,e)};Pe.decimalPlaces=Pe.dp=function(){var r,e=this.d,t=NaN;if(e){if(r=e.length-1,t=(r-zn(this.e/At))*At,r=e[r],r)for(;r%10==0;r/=10)t--;t<0&&(t=0)}return t};Pe.dividedBy=Pe.div=function(r){return xr(this,new this.constructor(r))};Pe.dividedToIntegerBy=Pe.divToInt=function(r){var e=this,t=e.constructor;return mt(xr(e,new t(r),0,1,1),t.precision,t.rounding)};Pe.equals=Pe.eq=function(r){return this.cmp(r)===0};Pe.floor=function(){return mt(new this.constructor(this),this.e+1,3)};Pe.greaterThan=Pe.gt=function(r){return this.cmp(r)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(r){var e=this.cmp(r);return e==1||e===0};Pe.hyperbolicCosine=Pe.cosh=function(){var r,e,t,n,s,i=this,a=i.constructor,u=new a(1);if(!i.isFinite())return new a(i.s?1/0:NaN);if(i.isZero())return u;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/xw(4,r)).toString()):(r=16,e="2.3283064365386962890625e-10"),i=Mh(a,1,i.times(e),new a(1),!0);for(var l,f=r,h=new a(8);f--;)l=i.times(i),i=u.minus(l.times(h.minus(l.times(h))));return mt(i,a.precision=t,a.rounding=n,!0)};Pe.hyperbolicSine=Pe.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=Mh(i,2,s,s,!0);else{r=1.4*Math.sqrt(n),r=r>16?16:r|0,s=s.times(1/xw(5,r)),s=Mh(i,2,s,s,!0);for(var a,u=new i(5),l=new i(16),f=new i(20);r--;)a=s.times(s),s=s.times(u.plus(a.times(l.times(a).plus(f))))}return i.precision=e,i.rounding=t,mt(s,e,t,!0)};Pe.hyperbolicTangent=Pe.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,xr(t.sinh(),t.cosh(),n.precision=r,n.rounding=e)):new n(t.s)};Pe.inverseCosine=Pe.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()?pa(e,n,s):new e(0):new e(NaN):r.isZero()?pa(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))};Pe.inverseHyperbolicCosine=Pe.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,Bt=!1,t=t.times(t).minus(1).sqrt().plus(t),Bt=!0,n.precision=r,n.rounding=e,t.ln()):new n(t)};Pe.inverseHyperbolicSine=Pe.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,Bt=!1,t=t.times(t).plus(1).sqrt().plus(t),Bt=!0,n.precision=r,n.rounding=e,t.ln())};Pe.inverseHyperbolicTangent=Pe.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?mt(new i(s),r,e,!0):(i.precision=t=n-s.e,s=xr(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)};Pe.inverseSine=Pe.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=pa(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)))};Pe.inverseTangent=Pe.atan=function(){var r,e,t,n,s,i,a,u,l,f=this,h=f.constructor,m=h.precision,g=h.rounding;if(f.isFinite()){if(f.isZero())return new h(f);if(f.abs().eq(1)&&m+4<=Vb)return a=pa(h,m+4,g).times(.25),a.s=f.s,a}else{if(!f.s)return new h(NaN);if(m+4<=Vb)return a=pa(h,m+4,g).times(.5),a.s=f.s,a}for(h.precision=u=m+10,h.rounding=1,t=Math.min(28,u/At+2|0),r=t;r;--r)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(Bt=!1,e=Math.ceil(u/At),n=1,l=f.times(f),a=new h(f),s=f;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)),Bt=!0,mt(a,h.precision=m,h.rounding=g,!0)};Pe.isFinite=function(){return!!this.d};Pe.isInteger=Pe.isInt=function(){return!!this.d&&zn(this.e/At)>this.d.length-2};Pe.isNaN=function(){return!this.s};Pe.isNegative=Pe.isNeg=function(){return this.s<0};Pe.isPositive=Pe.isPos=function(){return this.s>0};Pe.isZero=function(){return!!this.d&&this.d[0]===0};Pe.lessThan=Pe.lt=function(r){return this.cmp(r)<0};Pe.lessThanOrEqualTo=Pe.lte=function(r){return this.cmp(r)<1};Pe.logarithm=Pe.log=function(r){var e,t,n,s,i,a,u,l,f=this,h=f.constructor,m=h.precision,g=h.rounding,w=5;if(r==null)r=new h(10),e=!0;else{if(r=new h(r),t=r.d,r.s<0||!t||!t[0]||r.eq(1))return new h(NaN);e=r.eq(10)}if(t=f.d,f.s<0||!t||!t[0]||f.eq(1))return new h(t&&!t[0]?-1/0:f.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(Bt=!1,u=m+w,a=du(f,u),n=e?Aw(h,u+10):du(r,u),l=xr(a,n,u,1),ym(l.d,s=m,g))do if(u+=10,a=du(f,u),n=e?Aw(h,u+10):du(r,u),l=xr(a,n,u,1),!i){+On(l.d).slice(s+1,s+15)+1==1e14&&(l=mt(l,m+1,0));break}while(ym(l.d,s+=10,g));return Bt=!0,mt(l,m,g)};Pe.minus=Pe.sub=function(r){var e,t,n,s,i,a,u,l,f,h,m,g,w=this,y=w.constructor;if(r=new y(r),!w.d||!r.d)return!w.s||!r.s?r=new y(NaN):w.d?r.s=-r.s:r=new y(r.d||w.s!==r.s?w:NaN),r;if(w.s!=r.s)return r.s=-r.s,w.plus(r);if(f=w.d,g=r.d,u=y.precision,l=y.rounding,!f[0]||!g[0]){if(g[0])r.s=-r.s;else if(f[0])r=new y(w);else return new y(l===3?-0:0);return Bt?mt(r,u,l):r}if(t=zn(r.e/At),h=zn(w.e/At),f=f.slice(),i=h-t,i){for(m=i<0,m?(e=f,i=-i,a=g.length):(e=g,t=h,a=f.length),n=Math.max(Math.ceil(u/At),a)+2,i>n&&(i=n,e.length=1),e.reverse(),n=i;n--;)e.push(0);e.reverse()}else{for(n=f.length,a=g.length,m=n<a,m&&(a=n),n=0;n<a;n++)if(f[n]!=g[n]){m=f[n]<g[n];break}i=0}for(m&&(e=f,f=g,g=e,r.s=-r.s),a=f.length,n=g.length-a;n>0;--n)f[a++]=0;for(n=g.length;n>i;){if(f[--n]<g[n]){for(s=n;s&&f[--s]===0;)f[s]=ji-1;--f[s],f[n]+=ji}f[n]-=g[n]}for(;f[--a]===0;)f.pop();for(;f[0]===0;f.shift())--t;return f[0]?(r.d=f,r.e=bw(f,t),Bt?mt(r,u,l):r):new y(l===3?-0:0)};Pe.modulo=Pe.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]?mt(new n(t),n.precision,n.rounding):(Bt=!1,n.modulo==9?(e=xr(t,r.abs(),0,3,1),e.s*=r.s):e=xr(t,r,0,n.modulo,1),e=e.times(r),Bt=!0,t.minus(e))};Pe.naturalExponential=Pe.exp=function(){return Ub(this)};Pe.naturalLogarithm=Pe.ln=function(){return du(this)};Pe.negated=Pe.neg=function(){var r=new this.constructor(this);return r.s=-r.s,mt(r)};Pe.plus=Pe.add=function(r){var e,t,n,s,i,a,u,l,f,h,m=this,g=m.constructor;if(r=new g(r),!m.d||!r.d)return!m.s||!r.s?r=new g(NaN):m.d||(r=new g(r.d||m.s===r.s?m:NaN)),r;if(m.s!=r.s)return r.s=-r.s,m.minus(r);if(f=m.d,h=r.d,u=g.precision,l=g.rounding,!f[0]||!h[0])return h[0]||(r=new g(m)),Bt?mt(r,u,l):r;if(i=zn(m.e/At),n=zn(r.e/At),f=f.slice(),s=i-n,s){for(s<0?(t=f,s=-s,a=h.length):(t=h,n=i,a=f.length),i=Math.ceil(u/At),a=i>a?i+1:a+1,s>a&&(s=a,t.length=1),t.reverse();s--;)t.push(0);t.reverse()}for(a=f.length,s=h.length,a-s<0&&(s=a,t=h,h=f,f=t),e=0;s;)e=(f[--s]=f[s]+h[s]+e)/ji|0,f[s]%=ji;for(e&&(f.unshift(e),++n),a=f.length;f[--a]==0;)f.pop();return r.d=f,r.e=bw(f,n),Bt?mt(r,u,l):r};Pe.precision=Pe.sd=function(r){var e,t=this;if(r!==void 0&&r!==!!r&&r!==1&&r!==0)throw Error(mu+r);return t.d?(e=TP(t.d),r&&t.e+1>e&&(e=t.e+1)):e=NaN,e};Pe.round=function(){var r=this,e=r.constructor;return mt(new e(r),r.e+1,e.rounding)};Pe.sine=Pe.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())+At,n.rounding=1,t=$K(n,_P(n,t)),n.precision=r,n.rounding=e,mt(fo>2?t.neg():t,r,e,!0)):new n(NaN)};Pe.squareRoot=Pe.sqrt=function(){var r,e,t,n,s,i,a=this,u=a.d,l=a.e,f=a.s,h=a.constructor;if(f!==1||!u||!u[0])return new h(!f||f<0&&(!u||u[0])?NaN:u?a:1/0);for(Bt=!1,f=Math.sqrt(+a),f==0||f==1/0?(e=On(u),(e.length+l)%2==0&&(e+="0"),f=Math.sqrt(e),l=zn((l+1)/2)-(l<0||l%2),f==1/0?e="5e"+l:(e=f.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),n=new h(e)):n=new h(f.toString()),t=(l=h.precision)+3;;)if(i=n,n=i.plus(xr(a,i,t+2,1)).times(.5),On(i.d).slice(0,t)===(e=On(n.d)).slice(0,t))if(e=e.slice(t-3,t+1),e=="9999"||!s&&e=="4999"){if(!s&&(mt(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")&&(mt(n,l+1,1),r=!n.times(n).eq(a));break}return Bt=!0,mt(n,l,h.rounding,r)};Pe.tangent=Pe.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=xr(t,new n(1).minus(t.times(t)).sqrt(),r+10,0),n.precision=r,n.rounding=e,mt(fo==2||fo==4?t.neg():t,r,e,!0)):new n(NaN)};Pe.times=Pe.mul=function(r){var e,t,n,s,i,a,u,l,f,h=this,m=h.constructor,g=h.d,w=(r=new m(r)).d;if(r.s*=h.s,!g||!g[0]||!w||!w[0])return new m(!r.s||g&&!g[0]&&!w||w&&!w[0]&&!g?NaN:!g||!w?r.s/0:r.s*0);for(t=zn(h.e/At)+zn(r.e/At),l=g.length,f=w.length,l<f&&(i=g,g=w,w=i,a=l,l=f,f=a),i=[],a=l+f,n=a;n--;)i.push(0);for(n=f;--n>=0;){for(e=0,s=l+n;s>n;)u=i[s]+w[n]*g[s-n-1]+e,i[s--]=u%ji|0,e=u/ji|0;i[s]=(i[s]+e)%ji|0}for(;!i[--a];)i.pop();return e?++t:i.shift(),r.d=i,r.e=bw(i,t),Bt?mt(r,m.precision,m.rounding):r};Pe.toBinary=function(r,e){return Mb(this,2,r,e)};Pe.toDecimalPlaces=Pe.toDP=function(r,e){var t=this,n=t.constructor;return t=new n(t),r===void 0?t:(Es(r,0,gu),e===void 0?e=n.rounding:Es(e,0,8),mt(t,r+t.e+1,e))};Pe.toExponential=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=da(n,!0):(Es(r,0,gu),e===void 0?e=s.rounding:Es(e,0,8),n=mt(new s(n),r+1,e),t=da(n,!0,r+1)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toFixed=function(r,e){var t,n,s=this,i=s.constructor;return r===void 0?t=da(s):(Es(r,0,gu),e===void 0?e=i.rounding:Es(e,0,8),n=mt(new i(s),r+s.e+1,e),t=da(n,!1,r+n.e+1)),s.isNeg()&&!s.isZero()?"-"+t:t};Pe.toFraction=function(r){var e,t,n,s,i,a,u,l,f,h,m,g,w=this,y=w.d,S=w.constructor;if(!y)return new S(w);if(f=t=new S(1),n=l=new S(0),e=new S(n),i=e.e=TP(y)-w.e-1,a=i%At,e.d[0]=yn(10,a<0?At+a:a),r==null)r=i>0?e:f;else{if(u=new S(r),!u.isInt()||u.lt(f))throw Error(mu+u);r=u.gt(e)?i>0?e:f:u}for(Bt=!1,u=new S(On(y)),h=S.precision,S.precision=i=y.length*At*2;m=xr(u,e,0,1,1),s=t.plus(m.times(n)),s.cmp(r)!=1;)t=n,n=s,s=f,f=l.plus(m.times(s)),l=s,s=e,e=u.minus(m.times(s)),u=s;return s=xr(r.minus(t),n,0,1,1),l=l.plus(s.times(f)),t=t.plus(s.times(n)),l.s=f.s=w.s,g=xr(f,n,i,1).minus(w).abs().cmp(xr(l,t,i,1).minus(w).abs())<1?[f,n]:[l,t],S.precision=h,Bt=!0,g};Pe.toHexadecimal=Pe.toHex=function(r,e){return Mb(this,16,r,e)};Pe.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:Es(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]?(Bt=!1,t=xr(t,r,0,e,1).times(r),Bt=!0,mt(t)):(r.s=t.s,t=r),t};Pe.toNumber=function(){return+this};Pe.toOctal=function(r,e){return Mb(this,8,r,e)};Pe.toPower=Pe.pow=function(r){var e,t,n,s,i,a,u=this,l=u.constructor,f=+(r=new l(r));if(!u.d||!r.d||!u.d[0]||!r.d[0])return new l(yn(+u,f));if(u=new l(u),u.eq(1))return u;if(n=l.precision,i=l.rounding,r.eq(1))return mt(u,n,i);if(e=zn(r.e/At),e>=r.d.length-1&&(t=f<0?-f:f)<=FK)return s=IP(l,u,t,n),r.s<0?new l(1).div(s):mt(s,n,i);if(a=u.s,a<0){if(e<r.d.length-1)return new l(NaN);if((r.d[e]&1)==0&&(a=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=a,u}return t=yn(+u,f),e=t==0||!isFinite(t)?zn(f*(Math.log("0."+On(u.d))/Math.LN10+u.e+1)):new l(t+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(Bt=!1,l.rounding=u.s=1,t=Math.min(12,(e+"").length),s=Ub(r.times(du(u,n+t)),n),s.d&&(s=mt(s,n+5,1),ym(s.d,n,i)&&(e=n+10,s=mt(Ub(r.times(du(u,e+t)),e),e+5,1),+On(s.d).slice(n+1,n+15)+1==1e14&&(s=mt(s,n+1,0)))),s.s=a,Bt=!0,l.rounding=i,mt(s,n,i))};Pe.toPrecision=function(r,e){var t,n=this,s=n.constructor;return r===void 0?t=da(n,n.e<=s.toExpNeg||n.e>=s.toExpPos):(Es(r,1,gu),e===void 0?e=s.rounding:Es(e,0,8),n=mt(new s(n),r,e),t=da(n,r<=n.e||n.e<=s.toExpNeg,r)),n.isNeg()&&!n.isZero()?"-"+t:t};Pe.toSignificantDigits=Pe.toSD=function(r,e){var t=this,n=t.constructor;return r===void 0?(r=n.precision,e=n.rounding):(Es(r,1,gu),e===void 0?e=n.rounding:Es(e,0,8)),mt(new n(t),r,e)};Pe.toString=function(){var r=this,e=r.constructor,t=da(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()&&!r.isZero()?"-"+t:t};Pe.truncated=Pe.trunc=function(){return mt(new this.constructor(this),this.e+1,1)};Pe.valueOf=Pe.toJSON=function(){var r=this,e=r.constructor,t=da(r,r.e<=e.toExpNeg||r.e>=e.toExpPos);return r.isNeg()?"-"+t:t};function On(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=At-n.length,t&&(i+=pu(t)),i+=n;a=r[e],n=a+"",t=At-n.length,t&&(i+=pu(t))}else if(a===0)return"0";for(;a%10===0;)a/=10;return i+a}o(On,"digitsToString");function Es(r,e,t){if(r!==~~r||r<e||r>t)throw Error(mu+r)}o(Es,"checkInt32");function ym(r,e,t,n){var s,i,a,u;for(i=r[0];i>=10;i/=10)--e;return--e<0?(e+=At,s=0):(s=Math.ceil((e+1)/At),e%=At),i=yn(10,At-e),u=r[s]%i|0,n==null?e<3?(e==0?u=u/100|0:e==1&&(u=u/10|0),a=t<4&&u==99999||t>3&&u==49999||u==5e4||u==0):a=(t<4&&u+1==i||t>3&&u+1==i/2)&&(r[s+1]/i/100|0)==yn(10,e-2)-1||(u==i/2||u==0)&&(r[s+1]/i/100|0)==0:e<4?(e==0?u=u/1e3|0:e==1?u=u/100|0:e==2&&(u=u/10|0),a=(n||t<4)&&u==9999||!n&&t>3&&u==4999):a=((n||t<4)&&u+1==i||!n&&t>3&&u+1==i/2)&&(r[s+1]/i/1e3|0)==yn(10,e-3)-1,a}o(ym,"checkRoundingDigits");function vw(r,e,t){for(var n,s=[0],i,a=0,u=r.length;a<u;){for(i=s.length;i--;)s[i]*=e;for(s[0]+=kb.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()}o(vw,"convertBase");function HK(r,e){var t,n,s;if(e.isZero())return e;n=e.d.length,n<32?(t=Math.ceil(n/3),s=(1/xw(4,t)).toString()):(t=16,s="2.3283064365386962890625e-10"),r.precision+=t,e=Mh(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}o(HK,"cosine");var xr=(function(){function r(n,s,i){var a,u=0,l=n.length;for(n=n.slice();l--;)a=n[l]*s+u,n[l]=a%i|0,u=a/i|0;return u&&n.unshift(u),n}o(r,"multiplyInteger");function e(n,s,i,a){var u,l;if(i!=a)l=i>a?1:-1;else for(u=l=0;u<i;u++)if(n[u]!=s[u]){l=n[u]>s[u]?1:-1;break}return l}o(e,"compare");function t(n,s,i,a){for(var u=0;i--;)n[i]-=u,u=n[i]<s[i]?1:0,n[i]=u*a+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return o(t,"subtract"),function(n,s,i,a,u,l){var f,h,m,g,w,y,S,E,b,T,A,C,x,B,F,R,H,q,K,G,he=n.constructor,le=n.s==s.s?1:-1,oe=n.d,Z=s.d;if(!oe||!oe[0]||!Z||!Z[0])return new he(!n.s||!s.s||(oe?Z&&oe[0]==Z[0]:!Z)?NaN:oe&&oe[0]==0||!Z?le*0:le/0);for(l?(w=1,h=n.e-s.e):(l=ji,w=At,h=zn(n.e/w)-zn(s.e/w)),K=Z.length,H=oe.length,b=new he(le),T=b.d=[],m=0;Z[m]==(oe[m]||0);m++);if(Z[m]>(oe[m]||0)&&h--,i==null?(B=i=he.precision,a=he.rounding):u?B=i+(n.e-s.e)+1:B=i,B<0)T.push(1),y=!0;else{if(B=B/w+2|0,m=0,K==1){for(g=0,Z=Z[0],B++;(m<H||g)&&B--;m++)F=g*l+(oe[m]||0),T[m]=F/Z|0,g=F%Z|0;y=g||m<H}else{for(g=l/(Z[0]+1)|0,g>1&&(Z=r(Z,g,l),oe=r(oe,g,l),K=Z.length,H=oe.length),R=K,A=oe.slice(0,K),C=A.length;C<K;)A[C++]=0;G=Z.slice(),G.unshift(0),q=Z[0],Z[1]>=l/2&&++q;do g=0,f=e(Z,A,K,C),f<0?(x=A[0],K!=C&&(x=x*l+(A[1]||0)),g=x/q|0,g>1?(g>=l&&(g=l-1),S=r(Z,g,l),E=S.length,C=A.length,f=e(S,A,E,C),f==1&&(g--,t(S,K<E?G:Z,E,l))):(g==0&&(f=g=1),S=Z.slice()),E=S.length,E<C&&S.unshift(0),t(A,S,C,l),f==-1&&(C=A.length,f=e(Z,A,K,C),f<1&&(g++,t(A,K<C?G:Z,C,l))),C=A.length):f===0&&(g++,A=[0]),T[m++]=g,f&&A[0]?A[C++]=oe[R]||0:(A=[oe[R]],C=1);while((R++<H||A[0]!==void 0)&&B--);y=A[0]!==void 0}T[0]||T.shift()}if(w==1)b.e=h,AP=y;else{for(m=1,g=T[0];g>=10;g/=10)m++;b.e=m+h*w-1,mt(b,u?i+b.e+1:i,a,y)}return b}})();function mt(r,e,t,n){var s,i,a,u,l,f,h,m,g,w=r.constructor;e:if(e!=null){if(m=r.d,!m)return r;for(s=1,u=m[0];u>=10;u/=10)s++;if(i=e-s,i<0)i+=At,a=e,h=m[g=0],l=h/yn(10,s-a-1)%10|0;else if(g=Math.ceil((i+1)/At),u=m.length,g>=u)if(n){for(;u++<=g;)m.push(0);h=l=0,s=1,i%=At,a=i-At+1}else break e;else{for(h=u=m[g],s=1;u>=10;u/=10)s++;i%=At,a=i-At+s,l=a<0?0:h/yn(10,s-a-1)%10|0}if(n=n||e<0||m[g+1]!==void 0||(a<0?h:h%yn(10,s-a-1)),f=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?h/yn(10,s-a):0:m[g-1])%10&1||t==(r.s<0?8:7)),e<1||!m[0])return m.length=0,f?(e-=r.e+1,m[0]=yn(10,(At-e%At)%At),r.e=-e||0):m[0]=r.e=0,r;if(i==0?(m.length=g,u=1,g--):(m.length=g+1,u=yn(10,At-i),m[g]=a>0?(h/yn(10,s-a)%yn(10,a)|0)*u:0),f)for(;;)if(g==0){for(i=1,a=m[0];a>=10;a/=10)i++;for(a=m[0]+=u,u=1;a>=10;a/=10)u++;i!=u&&(r.e++,m[0]==ji&&(m[0]=1));break}else{if(m[g]+=u,m[g]!=ji)break;m[g--]=0,u=1}for(i=m.length;m[--i]===0;)m.pop()}return Bt&&(r.e>w.maxE?(r.d=null,r.e=NaN):r.e<w.minE&&(r.e=0,r.d=[0])),r}o(mt,"finalise");function da(r,e,t){if(!r.isFinite())return DP(r);var n,s=r.e,i=On(r.d),a=i.length;return e?(t&&(n=t-a)>0?i=i.charAt(0)+"."+i.slice(1)+pu(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(r.e<0?"e":"e+")+r.e):s<0?(i="0."+pu(-s-1)+i,t&&(n=t-a)>0&&(i+=pu(n))):s>=a?(i+=pu(s+1-a),t&&(n=t-s-1)>0&&(i=i+"."+pu(n))):((n=s+1)<a&&(i=i.slice(0,n)+"."+i.slice(n)),t&&(n=t-a)>0&&(s+1===a&&(i+="."),i+=pu(n))),i}o(da,"finiteToString");function bw(r,e){var t=r[0];for(e*=At;t>=10;t/=10)e++;return e}o(bw,"getBase10Exponent");function Aw(r,e,t){if(e>qK)throw Bt=!0,t&&(r.precision=t),Error(CP);return mt(new r(Sw),e,1,!0)}o(Aw,"getLn10");function pa(r,e,t){if(e>Vb)throw Error(CP);return mt(new r(Ew),e,t,!0)}o(pa,"getPi");function TP(r){var e=r.length-1,t=e*At+1;if(e=r[e],e){for(;e%10==0;e/=10)t--;for(e=r[0];e>=10;e/=10)t++}return t}o(TP,"getPrecision");function pu(r){for(var e="";r--;)e+="0";return e}o(pu,"getZeroString");function IP(r,e,t,n){var s,i=new r(1),a=Math.ceil(n/At+4);for(Bt=!1;;){if(t%2&&(i=i.times(e),SP(i.d,a)&&(s=!0)),t=zn(t/2),t===0){t=i.d.length-1,s&&i.d[t]===0&&++i.d[t];break}e=e.times(e),SP(e.d,a)}return Bt=!0,i}o(IP,"intPow");function wP(r){return r.d[r.d.length-1]&1}o(wP,"isOdd");function BP(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}o(BP,"maxOrMin");function Ub(r,e){var t,n,s,i,a,u,l,f=0,h=0,m=0,g=r.constructor,w=g.rounding,y=g.precision;if(!r.d||!r.d[0]||r.e>17)return new g(r.d?r.d[0]?r.s<0?0:1/0:1:r.s?r.s<0?0:r:NaN);for(e==null?(Bt=!1,l=y):l=e,u=new g(.03125);r.e>-2;)r=r.times(u),m+=5;for(n=Math.log(yn(2,m))/Math.LN10*2+5|0,l+=n,t=i=a=new g(1),g.precision=l;;){if(i=mt(i.times(r),l,1),t=t.times(++h),u=a.plus(xr(i,t,l,1)),On(u.d).slice(0,l)===On(a.d).slice(0,l)){for(s=m;s--;)a=mt(a.times(a),l,1);if(e==null)if(f<3&&ym(a.d,l-n,w,f))g.precision=l+=10,t=i=u=new g(1),h=0,f++;else return mt(a,g.precision=y,w,Bt=!0);else return g.precision=y,a}a=u}}o(Ub,"naturalExponential");function du(r,e){var t,n,s,i,a,u,l,f,h,m,g,w=1,y=10,S=r,E=S.d,b=S.constructor,T=b.rounding,A=b.precision;if(S.s<0||!E||!E[0]||!S.e&&E[0]==1&&E.length==1)return new b(E&&!E[0]?-1/0:S.s!=1?NaN:E?0:S);if(e==null?(Bt=!1,h=A):h=e,b.precision=h+=y,t=On(E),n=t.charAt(0),Math.abs(i=S.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)S=S.times(r),t=On(S.d),n=t.charAt(0),w++;i=S.e,n>1?(S=new b("0."+t),i++):S=new b(n+"."+t.slice(1))}else return f=Aw(b,h+2,A).times(i+""),S=du(new b(n+"."+t.slice(1)),h-y).plus(f),b.precision=A,e==null?mt(S,A,T,Bt=!0):S;for(m=S,l=a=S=xr(S.minus(1),S.plus(1),h,1),g=mt(S.times(S),h,1),s=3;;){if(a=mt(a.times(g),h,1),f=l.plus(xr(a,new b(s),h,1)),On(f.d).slice(0,h)===On(l.d).slice(0,h))if(l=l.times(2),i!==0&&(l=l.plus(Aw(b,h+2,A).times(i+""))),l=xr(l,new b(w),h,1),e==null)if(ym(l.d,h-y,T,u))b.precision=h+=y,f=a=S=xr(m.minus(1),m.plus(1),h,1),g=mt(S.times(S),h,1),s=u=1;else return mt(l,b.precision=A,T,Bt=!0);else return b.precision=A,l;l=f,s+=2}}o(du,"naturalLogarithm");function DP(r){return String(r.s*r.s/0)}o(DP,"nonFiniteToString");function ww(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)%At,t<0&&(n+=At),n<s){for(n&&r.d.push(+e.slice(0,n)),s-=At;n<s;)r.d.push(+e.slice(n,n+=At));e=e.slice(n),n=At-e.length}else n-=s;for(;n--;)e+="0";r.d.push(+e),Bt&&(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}o(ww,"parseDecimal");function KK(r,e){var t,n,s,i,a,u,l,f,h;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),NP.test(e))return ww(r,e)}else if(e==="Infinity"||e==="NaN")return+e||(r.s=NaN),r.e=NaN,r.d=null,r;if(MK.test(e))t=16,e=e.toLowerCase();else if(UK.test(e))t=2;else if(jK.test(e))t=8;else throw Error(mu+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(".",""),u=e.length,i=u-i,s=IP(n,new n(t),i,i*2)),f=vw(e,t,ji),h=f.length-1,i=h;f[i]===0;--i)f.pop();return i<0?new n(r.s*0):(r.e=bw(f,h),r.d=f,Bt=!1,a&&(r=xr(r,s,u*4)),l&&(r=r.times(Math.abs(l)<54?yn(2,l):jh.pow(2,l))),Bt=!0,r)}o(KK,"parseOther");function $K(r,e){var t,n=e.d.length;if(n<3)return e.isZero()?e:Mh(r,2,e,e);t=1.4*Math.sqrt(n),t=t>16?16:t|0,e=e.times(1/xw(5,t)),e=Mh(r,2,e,e);for(var s,i=new r(5),a=new r(16),u=new r(20);t--;)s=e.times(e),e=e.times(i.plus(s.times(a.times(s).minus(u))));return e}o($K,"sine");function Mh(r,e,t,n,s){var i,a,u,l,f=1,h=r.precision,m=Math.ceil(h/At);for(Bt=!1,l=t.times(t),u=new r(n);;){if(a=xr(u.times(l),new r(e++*e++),h,1),u=s?n.plus(a):n.minus(a),n=xr(a.times(l),new r(e++*e++),h,1),a=u.plus(n),a.d[m]!==void 0){for(i=m;a.d[i]===u.d[i]&&i--;);if(i==-1)break}i=u,u=n,n=a,a=i,f++}return Bt=!0,a.d.length=m+1,a}o(Mh,"taylorSeries");function xw(r,e){for(var t=r;--e;)t*=r;return t}o(xw,"tinyPow");function _P(r,e){var t,n=e.s<0,s=pa(r,r.precision,1),i=s.times(.5);if(e=e.abs(),e.lte(i))return fo=n?4:1,e;if(t=e.divToInt(s),t.isZero())fo=n?3:2;else{if(e=e.minus(t.times(s)),e.lte(i))return fo=wP(t)?n?2:3:n?4:1,e;fo=wP(t)?n?1:4:n?3:2}return e.minus(s).abs()}o(_P,"toLessThanHalfPi");function Mb(r,e,t,n){var s,i,a,u,l,f,h,m,g,w=r.constructor,y=t!==void 0;if(y?(Es(t,1,gu),n===void 0?n=w.rounding:Es(n,0,8)):(t=w.precision,n=w.rounding),!r.isFinite())h=DP(r);else{for(h=da(r),a=h.indexOf("."),y?(s=2,e==16?t=t*4-3:e==8&&(t=t*3-2)):s=e,a>=0&&(h=h.replace(".",""),g=new w(1),g.e=h.length-a,g.d=vw(da(g),10,s),g.e=g.d.length),m=vw(h,10,s),i=l=m.length;m[--l]==0;)m.pop();if(!m[0])h=y?"0p+0":"0";else{if(a<0?i--:(r=new w(r),r.d=m,r.e=i,r=xr(r,g,t,n,0,s),m=r.d,i=r.e,f=AP),a=m[t],u=s/2,f=f||m[t+1]!==void 0,f=n<4?(a!==void 0||f)&&(n===0||n===(r.s<0?3:2)):a>u||a===u&&(n===4||f||n===6&&m[t-1]&1||n===(r.s<0?8:7)),m.length=t,f)for(;++m[--t]>s-1;)m[t]=0,t||(++i,m.unshift(1));for(l=m.length;!m[l-1];--l);for(a=0,h="";a<l;a++)h+=kb.charAt(m[a]);if(y){if(l>1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)h+="0";for(m=vw(h,s,e),l=m.length;!m[l-1];--l);for(a=1,h="1.";a<l;a++)h+=kb.charAt(m[a])}else h=h.charAt(0)+"."+h.slice(1);h=h+(i<0?"p":"p+")+i}else if(i<0){for(;++i;)h="0"+h;h="0."+h}else if(++i>l)for(i-=l;i--;)h+="0";else i<l&&(h=h.slice(0,i)+"."+h.slice(i))}h=(e==16?"0x":e==2?"0b":e==8?"0o":"")+h}return r.s<0?"-"+h:h}o(Mb,"toStringBinary");function SP(r,e){if(r.length>e)return r.length=e,!0}o(SP,"truncate");function XK(r){return new this(r).abs()}o(XK,"abs");function GK(r){return new this(r).acos()}o(GK,"acos");function WK(r){return new this(r).acosh()}o(WK,"acosh");function JK(r,e){return new this(r).plus(e)}o(JK,"add");function zK(r){return new this(r).asin()}o(zK,"asin");function YK(r){return new this(r).asinh()}o(YK,"asinh");function QK(r){return new this(r).atan()}o(QK,"atan");function ZK(r){return new this(r).atanh()}o(ZK,"atanh");function e$(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=pa(this,i,1).times(e.s>0?.25:.75),t.s=r.s):!e.d||r.isZero()?(t=e.s<0?pa(this,n,s):new this(0),t.s=r.s):!r.d||e.isZero()?(t=pa(this,i,1).times(.5),t.s=r.s):e.s<0?(this.precision=i,this.rounding=1,t=this.atan(xr(r,e,i,1)),e=pa(this,i,1),this.precision=n,this.rounding=s,t=r.s<0?t.minus(e):t.plus(e)):t=this.atan(xr(r,e,i,1)),t}o(e$,"atan2");function t$(r){return new this(r).cbrt()}o(t$,"cbrt");function r$(r){return mt(r=new this(r),r.e+1,2)}o(r$,"ceil");function n$(r,e,t){return new this(r).clamp(e,t)}o(n$,"clamp");function s$(r){if(!r||typeof r!="object")throw Error(Cw+"Object expected");var e,t,n,s=r.defaults===!0,i=["precision",1,gu,"rounding",0,8,"toExpNeg",-Uh,0,"toExpPos",0,Uh,"maxE",0,Uh,"minE",-Uh,0,"modulo",0,9];for(e=0;e<i.length;e+=3)if(t=i[e],s&&(this[t]=Lb[t]),(n=r[t])!==void 0)if(zn(n)===n&&n>=i[e+1]&&n<=i[e+2])this[t]=n;else throw Error(mu+t+": "+n);if(t="crypto",s&&(this[t]=Lb[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(bP);else this[t]=!1;else throw Error(mu+t+": "+n);return this}o(s$,"config");function i$(r){return new this(r).cos()}o(i$,"cos");function a$(r){return new this(r).cosh()}o(a$,"cosh");function RP(r){var e,t,n;function s(i){var a,u,l,f=this;if(!(f instanceof s))return new s(i);if(f.constructor=s,EP(i)){f.s=i.s,Bt?!i.d||i.e>s.maxE?(f.e=NaN,f.d=null):i.e<s.minE?(f.e=0,f.d=[0]):(f.e=i.e,f.d=i.d.slice()):(f.e=i.e,f.d=i.d?i.d.slice():i.d);return}if(l=typeof i,l==="number"){if(i===0){f.s=1/i<0?-1:1,f.e=0,f.d=[0];return}if(i<0?(i=-i,f.s=-1):f.s=1,i===~~i&&i<1e7){for(a=0,u=i;u>=10;u/=10)a++;Bt?a>s.maxE?(f.e=NaN,f.d=null):a<s.minE?(f.e=0,f.d=[0]):(f.e=a,f.d=[i]):(f.e=a,f.d=[i]);return}if(i*0!==0){i||(f.s=NaN),f.e=NaN,f.d=null;return}return ww(f,i.toString())}if(l==="string")return(u=i.charCodeAt(0))===45?(i=i.slice(1),f.s=-1):(u===43&&(i=i.slice(1)),f.s=1),NP.test(i)?ww(f,i):KK(f,i);if(l==="bigint")return i<0?(i=-i,f.s=-1):f.s=1,ww(f,i.toString());throw Error(mu+i)}if(o(s,"Decimal"),s.prototype=Pe,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=s$,s.clone=RP,s.isDecimal=EP,s.abs=XK,s.acos=GK,s.acosh=WK,s.add=JK,s.asin=zK,s.asinh=YK,s.atan=QK,s.atanh=ZK,s.atan2=e$,s.cbrt=t$,s.ceil=r$,s.clamp=n$,s.cos=i$,s.cosh=a$,s.div=o$,s.exp=u$,s.floor=l$,s.hypot=c$,s.ln=f$,s.log=h$,s.log10=d$,s.log2=p$,s.max=m$,s.min=g$,s.mod=y$,s.mul=v$,s.pow=w$,s.random=S$,s.round=E$,s.sign=A$,s.sin=C$,s.sinh=b$,s.sqrt=x$,s.sub=N$,s.sum=T$,s.tan=I$,s.tanh=B$,s.trunc=D$,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}o(RP,"clone");function o$(r,e){return new this(r).div(e)}o(o$,"div");function u$(r){return new this(r).exp()}o(u$,"exp");function l$(r){return mt(r=new this(r),r.e+1,3)}o(l$,"floor");function c$(){var r,e,t=new this(0);for(Bt=!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 Bt=!0,new this(1/0);t=e}return Bt=!0,t.sqrt()}o(c$,"hypot");function EP(r){return r instanceof jh||r&&r.toStringTag===xP||!1}o(EP,"isDecimalInstance");function f$(r){return new this(r).ln()}o(f$,"ln");function h$(r,e){return new this(r).log(e)}o(h$,"log");function p$(r){return new this(r).log(2)}o(p$,"log2");function d$(r){return new this(r).log(10)}o(d$,"log10");function m$(){return BP(this,arguments,-1)}o(m$,"max");function g$(){return BP(this,arguments,1)}o(g$,"min");function y$(r,e){return new this(r).mod(e)}o(y$,"mod");function v$(r,e){return new this(r).mul(e)}o(v$,"mul");function w$(r,e){return new this(r).pow(e)}o(w$,"pow");function S$(r){var e,t,n,s,i=0,a=new this(1),u=[];if(r===void 0?r=this.precision:Es(r,1,gu),n=Math.ceil(r/At),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]:u[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):(u.push(s%1e7),i+=4);i=n/4}else throw Error(bP);else for(;i<n;)u[i++]=Math.random()*1e7|0;for(n=u[--i],r%=At,n&&r&&(s=yn(10,At-r),u[i]=(n/s|0)*s);u[i]===0;i--)u.pop();if(i<0)t=0,u=[0];else{for(t=-1;u[0]===0;t-=At)u.shift();for(n=1,s=u[0];s>=10;s/=10)n++;n<At&&(t-=At-n)}return a.e=t,a.d=u,a}o(S$,"random");function E$(r){return mt(r=new this(r),r.e+1,this.rounding)}o(E$,"round");function A$(r){return r=new this(r),r.d?r.d[0]?r.s:0*r.s:r.s||NaN}o(A$,"sign");function C$(r){return new this(r).sin()}o(C$,"sin");function b$(r){return new this(r).sinh()}o(b$,"sinh");function x$(r){return new this(r).sqrt()}o(x$,"sqrt");function N$(r,e){return new this(r).sub(e)}o(N$,"sub");function T$(){var r=0,e=arguments,t=new this(e[r]);for(Bt=!1;t.s&&++r<e.length;)t=t.plus(e[r]);return Bt=!0,mt(t,this.precision,this.rounding)}o(T$,"sum");function I$(r){return new this(r).tan()}o(I$,"tan");function B$(r){return new this(r).tanh()}o(B$,"tanh");function D$(r){return mt(r=new this(r),r.e+1,1)}o(D$,"trunc");Pe[Symbol.for("nodejs.util.inspect.custom")]=Pe.toString;Pe[Symbol.toStringTag]="Decimal";var jh=Pe.constructor=RP(Lb);Sw=new jh(Sw);Ew=new jh(Ew);var PP=class r extends jh{static{o(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)}};var OP=class{static{o(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 Ec=dw(z3(),1);import Y3 from"fs";import pJ from"path";import rp from"crypto";import{NFeTsError as sS}from"@nfets/core/domain/errors/nfets-error";import{left as Hx,right as iS}from"@nfets/core/shared/either";import{leftFromError as Kx}from"@nfets/core/shared/left-from-error";import{NullCacheAdapter as dJ}from"@nfets/core/infrastructure/repositories/null-cache-adapter";import{SignatureAlgorithm as mJ}from"@nfets/core/domain/entities/signer/algo";import{ASN1 as gJ}from"@nfets/core/application";var Q3=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new dJ){this.httpClient=e,this.cache=t}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let s=Ec.default.asn1.fromDer(n.value.toString("binary")),i=Ec.default.pkcs12.pkcs12FromAsn1(s,t),{certBag:a,pkcs8ShroudedKeyBag:u}=Ec.default.pki.oids,l=i.getBags({bagType:a}),f=i.getBags({bagType:u}),h=l[a];if(!h?.length)return Hx(new sS("Cannot read certificate"));let[{cert:m},...g]=h;if(!m)return Hx(new sS("Issuer Certificate not found"));let w=f[u]?.[0].key;if(!w)return Hx(new sS("Certificate Private Key not found"));let y=g.reduce((A,{cert:C})=>(C&&A.push(new rp.X509Certificate(Ec.default.pki.certificateToPem(C))),A),[]),S=Ec.default.pki.privateKeyToPem(w),E=Ec.default.pki.certificateToPem(m),b=rp.createPrivateKey(S),T=new rp.X509Certificate(E);return iS({ca:y,password:t,privateKey:b,certificate:T})}catch(t){return Kx(t)}}async sign(e,t,n=mJ.SHA1){try{let i=rp.sign(n,Buffer.from(e),{key:t,padding:rp.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(iS(i))}catch(s){return Promise.resolve(Kx(s))}}getCertificateInfo(e){return new gJ().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new sS("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 iS(i);if(pJ.isAbsolute(t)||Y3.existsSync(t))return this.hitBufferOnCache(s,Y3.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 Kx(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return rp.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),iS(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var Z3=class{static{o(this,"NullCacheAdapter")}async get(e){return Promise.resolve(null)}has(e){return Promise.resolve(!1)}set(e,t){return Promise.resolve(!0)}};var Y8=dw(W8(),1);import{constants as are}from"crypto";import{Agent as J8}from"https";import{right as ore}from"@nfets/core/shared/either";import{leftFromError as ure}from"@nfets/core/shared/left-from-error";var z8=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:are.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new J8({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return new J8({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}async send(e){try{let t=this.httpsAgent,n=await(0,Y8.createClientAsync)(`${e.url}?wsdl`,{attributesKey:"$",wsdl_options:{httpsAgent:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[l]=await n[`${e.method}Async`]({_xml:s},{httpsAgent:t});return ore(l)}catch(t){return ure(t)}}};import{addon as lre}from"@nfets/core/shared/addon";var cre=lre("xml_validator.node"),Q8=cre;var oae=dw(SV(),1);import aae from"crypto";var EV="application/xml";var Ut;(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"})(Ut||(Ut={}));function fre(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(fre,"SelectNodesEx");function hre(r,e){let t=xp("xpath").select;return t(e,r)}o(hre,"SelectNodesNode");var AV=typeof self<"u"?fre:hre;function bi(r){r=r.replace(/\r\n/g,`
85
- `).replace(/\r/g,`
86
- `);let e;return typeof DOMParser<"u"?e=DOMParser:e=xp("DOMParser"),new e().parseFromString(r,EV)}o(bi,"Parse");function Ma(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=xp("XMLSerializer"),new e().serializeToString(r)}o(Ma,"Stringify");function CE(r,e){let t=AV(r,e);return t&&t.length>0?t[0]:null}o(CE,"SelectSingleNode");function CV(r,e){return r&&r.nodeType===e}o(CV,"isNodeType");function zs(r){return CV(r,Ut.Element)}o(zs,"isElement");function _c(r){return CV(r,Ut.Document)}o(_c,"isDocument");var bV=new Map;function xV(r){for(let e in r)bV.set(e,r[e])}o(xV,"setNodeDependencies");function xp(r){let e=bV.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(xp,"getNodeDependency");var lg="element",cg="attribute",bE="content";var pre=1e9;function kT(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}o(kT,"assign");function Mt(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=kT({},t.items)),t.target=e}}o(Mt,"XmlElement");function Xt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=kT({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||pre,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:lg},TV(e,s,r)}}o(Xt,"XmlChildElement");function Rr(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=kT({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=cg,TV(e,s,r)}}o(Rr,"XmlAttribute");function TV(r,e,t){let n=`_${e}`,s={set:o(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:o(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}o(TV,"defineProperty");var Wu=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function dre(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}o(dre,"printf");function mre(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(mre,"padNum");var Fe=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=dre(on[e],...t);this.message=`${this.prefix}${mre(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},Te;(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"})(Te||(Te={}));var on={};on[Te.NONE]="No description";on[Te.NULL_REFERENCE]="Null reference";on[Te.NULL_PARAM]="'%1' has empty '%2' object";on[Te.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";on[Te.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";on[Te.METHOD_NOT_IMPLEMENTED]="Method is not implemented";on[Te.METHOD_NOT_SUPPORTED]="Method is not supported";on[Te.PARAM_REQUIRED]="Required parameter is missing '%1'";on[Te.CONVERTER_UNSUPPORTED]="Converter is not supported";on[Te.ELEMENT_MALFORMED]="Malformed element '%1'";on[Te.ELEMENT_MISSING]="Element '%1' is missing in '%2'";on[Te.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";on[Te.CONTENT_MISSING]="Content is missing in '%1'";on[Te.CRYPTOGRAPHIC]="Cryptographic error: %1";on[Te.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";on[Te.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";on[Te.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";on[Te.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";on[Te.XML_EXCEPTION]="XML exception: %1";on[Te.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var vr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new Fe(Te.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 Fe(Te.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 Fe(Te.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 Fe(Te.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 xi={get:o(r=>{if(r)return vr.ToBase64(r)},"get"),set:o(r=>vr.FromBase64(r),"set")},fg={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var gre="xml_root",Ds=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new Fe(Te.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 Fe(Te.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return _c(e)&&(n=e.getElementById(t)),n==null&&(n=CE(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=CE(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=CE(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=gre,t=null,n=null){if(n&&!t)throw new Fe(Te.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let u=`${s}${e}`;return bi(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=_c(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];zs(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=_c(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(zs(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(zs(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new Fe(Te.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let u in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,u))continue;let l=t[u],f=i.items[u];switch(f.type){case bE:{let h=f,m=h.converter?h.converter.get(l):l;if(h.required&&m==null)throw new Fe(Te.CONTENT_MISSING,a);(h.defaultValue!==l||h.required)&&(s.textContent=m);break}case cg:{let h=f,m=h.converter?h.converter.get(l):l;if(h.required&&m==null)throw new Fe(Te.ATTRIBUTE_MISSING,h.localName,a);(h.defaultValue!==l||h.required)&&(h.namespaceURI?s.setAttributeNS(h.namespaceURI,h.localName||"",m):s.setAttribute(h.localName||"",m));break}case lg:{let h=f,m=null;if(h.parser){if(h.required&&!l||h.minOccurs&&!l.Count){let g=l?.localName||h.localName;throw new Fe(Te.ELEMENT_MISSING,g,a)}l&&(m=l.GetXml(l.element===void 0&&(h.required||l.Count)))}else{let g=h.converter?h.converter.get(l):l;if(h.required&&g===void 0)throw new Fe(Te.ELEMENT_MISSING,h.localName,a);if(l!==h.defaultValue||h.required)if(h.namespaceURI?m=n.createElementNS(h.namespaceURI,`${h.prefix?h.prefix+":":""}${h.localName}`):m=n.createElement(`${h.prefix?h.prefix+":":""}${h.localName}`),Array.isArray(g))for(let w of g){let y=w instanceof r?w.GetXml(!0):w;y!==null&&m&&m.appendChild(y)}else if(g instanceof r){let w=g.GetXml(!0);w&&m&&m.appendChild(w)}else m&&(m.textContent=g)}if(m)if(h.noRoot){let g=[];for(let S=0;S<m.childNodes.length;S++){let E=m.childNodes.item(S);zs(E)&&g.push(E)}let w=h.minOccurs||0,y=h.maxOccurs||1/0;if(g.length<w||g.length>y)throw new Fe(Te.COLLECTION_LIMIT,l.localName,i.localName);g.forEach(S=>s.appendChild(S.cloneNode(!0)))}else{if(m.childNodes.length<(h.minOccurs||0)||m.childNodes.length>(h.maxOccurs||1/0))throw new Fe(Te.COLLECTION_LIMIT,l.localName,i.localName);s.appendChild(m)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=bi(e).documentElement:t=e,!t)throw new Fe(Te.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new Fe(Te.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let u=s.items[a];switch(u.type){case bE:{let l=u;if(l.required&&!t.textContent)throw new Fe(Te.CONTENT_MISSING,i);if(!t.textContent)n[a]=l.defaultValue;else{let f=l.converter?l.converter.set(t.textContent):t.textContent;n[a]=f}break}case cg:{let l=u,f,h;if(!l.localName)throw new Fe(Te.PARAM_REQUIRED,"localName");if(l.namespaceURI?(f=t.hasAttributeNS.bind(t,l.namespaceURI,l.localName),h=t.getAttributeNS.bind(t,l.namespaceURI,l.localName)):(f=t.hasAttribute.bind(t,l.localName),h=t.getAttribute.bind(t,l.localName)),l.required&&!f())throw new Fe(Te.ATTRIBUTE_MISSING,l.localName,i);if(!f())n[a]=l.defaultValue;else{let m=h(),g=l.converter&&m?l.converter.set(m):m;n[a]=g}break}case lg:{let l=u;if(l.noRoot){if(!l.parser)throw new Fe(Te.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser'`);let h=new l.parser;if(!(h instanceof Np))throw new Fe(Te.XML_EXCEPTION,`Schema for '${l.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);h.OnLoadXml(t),delete h.element;let m=l.minOccurs||0,g=l.maxOccurs||1/0;if(h.Count<m||h.Count>g)throw new Fe(Te.COLLECTION_LIMIT,l.parser.localName,i);n[a]=h;continue}let f=null;for(let h=0;h<t.childNodes.length;h++){let m=t.childNodes.item(h);if(!zs(m))continue;let g=m;if(g.localName===l.localName&&g.namespaceURI==l.namespaceURI){f=g;break}}if(l.required&&!f)throw new Fe(Te.ELEMENT_MISSING,l.parser?l.parser.localName:l.localName,i);if(l.parser){if(f){let h=new l.parser;h.localName=l.localName,h.namespaceURI=l.namespaceURI,n[a]=h,h.LoadXml(f)}}else if(!f)n[a]=l.defaultValue;else{let h=f.textContent||"",m=l.converter?l.converter.set(h):h;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Ma(e):""}GetElement(e,t=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new Fe(Te.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new Fe(Te.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 Np=class extends Ds{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new Wu(this.GetIterator().map(e))}Filter(e){return new Wu(this.GetIterator().filter(e))}Sort(e){return new Wu(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 Fe(Te.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(!(zs(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 Tp=class extends Wu{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var yre="[object ArrayBuffer]",dt=class UT{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===yre}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=UT.toUint8Array(e),s=UT.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let u=this.toUint8Array(a);s.set(u,i),i+=u.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},VT="string",vre=/^[0-9a-f\s]+$/i,wre=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Sre=/^[a-zA-Z0-9-_]+$/,IV=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=dt.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},ja=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=dt.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let u=s.getUint16(a,t);i+=String.fromCharCode(u)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},Ct=class Ip{static{o(this,"Convert")}static isHex(e){return typeof e===VT&&vre.test(e)}static isBase64(e){return typeof e===VT&&wre.test(e)}static isBase64Url(e){return typeof e===VT&&Sre.test(e)}static ToString(e,t="utf8"){let n=dt.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 ja.toString(n,!0);case"utf16":case"utf16be":return ja.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 ja.fromString(e,!0);case"utf16":case"utf16be":return ja.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=dt.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(!Ip.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(!Ip.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=Ip.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return IV.fromString(e);case"utf16":case"utf16be":return ja.fromString(e);case"utf16le":case"usc2":return ja.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=Ip.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return IV.toString(e);case"utf16":case"utf16be":return ja.toString(e);case"utf16le":case"usc2":return ja.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=dt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=dt.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(!Ip.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 ja.toString(e,t)}static FromUtf16String(e,t=!1){return ja.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,"")||""}};Ct.DEFAULT_UTF8_ENCODING="utf8";function D(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(D,"getParametersValue");function xE(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}o(xE,"bufferToHexCodes");function No(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(No,"utilFromBase");function Gi(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let l;if(n<0)l=new ArrayBuffer(u),i=u;else{if(n<u)return new ArrayBuffer(0);l=new ArrayBuffer(n),i=n}let f=new Uint8Array(l);for(let h=u-1;h>=0;h--){let m=Math.pow(2,h*e);f[i-h-1]=Math.floor(s/m),s-=f[i-h-1]*m}return l}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(Gi,"utilToBase");function Rc(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}o(Rc,"utilConcatBuf");function NE(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}o(NE,"utilConcatView");function MT(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,l=r[0]===0&&(r[1]&128)===0;(u||l)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=No(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let u=0;u<this.valueHex.byteLength;u++)i[u]=r[u];return i[0]&=127,No(i,8)-n}o(MT,"utilDecodeTC");function DV(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=Gi(a,8,n),l=new Uint8Array(u);return l[0]|=128,u}let s=Gi(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),u=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let l=0;l<a.byteLength;l++)i[l+1]=u[l];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(DV,"utilEncodeTC");function Ju(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(Ju,"isEqualBuffer");function _s(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}o(_s,"padNumber");var _V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",RV="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function TE(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,u="",l=e?RV:_V;if(n){let f=0;for(let h=0;h<r.length;h++)if(r.charCodeAt(h)!==0){f=h;break}r=r.slice(f)}for(;s<r.length;){let f=r.charCodeAt(s++);s>=r.length&&(i=1);let h=r.charCodeAt(s++);s>=r.length&&(a=1);let m=r.charCodeAt(s++),g=f>>2,w=(f&3)<<4|h>>4,y=(h&15)<<2|m>>6,S=m&63;i===1?y=S=64:a===1&&(S=64),t?y===64?u+=`${l.charAt(g)}${l.charAt(w)}`:S===64?u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}`:u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}${l.charAt(S)}`:u+=`${l.charAt(g)}${l.charAt(w)}${l.charAt(y)}${l.charAt(S)}`}return u}o(TE,"toBase64");function Bp(r,e=!1,t=!1){let n=e?RV:_V;function s(l){for(let f=0;f<64;f++)if(n.charAt(f)===l)return f;return 64}o(s,"indexOf");function i(l){return l===64?0:l}o(i,"test");let a=0,u="";for(;a<r.length;){let l=s(r.charAt(a++)),f=a>=r.length?0:s(r.charAt(a++)),h=a>=r.length?0:s(r.charAt(a++)),m=a>=r.length?0:s(r.charAt(a++)),g=i(l)<<2|i(f)>>4,w=(i(f)&15)<<4|i(h)>>2,y=(i(h)&3)<<6|i(m);u+=String.fromCharCode(g),h!==64&&(u+=String.fromCharCode(w)),m!==64&&(u+=String.fromCharCode(y))}if(t){let l=u.length,f=-1;for(let h=l-1;h>=0;h--)if(u.charCodeAt(h)!==0){f=h;break}f!==-1?u=u.slice(0,f+1):u=""}return u}o(Bp,"fromBase64");function hg(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(hg,"arrayBufferToString");function Pc(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}o(Pc,"stringToArrayBuffer");var Ere=Math.log(2);function PV(r){let e=Math.log(r)/Ere,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(PV,"nearestPowerOf2");function _e(r,e){for(let t of e)delete r[t]}o(_e,"clearProps");function IE(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(IE,"assertBigInt");function HT(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}o(HT,"concat");function To(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(To,"checkBufferParams");var KT=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return HT(this.items)}},pg=[new Uint8Array([1])],kV="0123456789",jT="name",LV="valueHexView",Are="isHexOnly",Cre="idBlock",bre="tagClass",xre="tagNumber",Nre="isConstructed",Tre="fromBER",Ire="toBER",Bre="local",Rs="",Wi=new ArrayBuffer(0),BE=new Uint8Array(0),mg="EndOfContent",UV="OCTET STRING",MV="BIT STRING";function Io(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?dt.toUint8Array(i.valueHex):BE}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!To(this,a,s,i))return-1;let u=s+i;return this.valueHexView=a.subarray(s,u),this.valueHexView.length?(this.blockLength=i,u):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Wi)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Ct.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(Io,"HexBlock");var Oc=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Rs,warnings:n=[],valueBeforeDecode:s=BE}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=dt.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Ct.ToHex(this.valueBeforeDecodeView)}}};Oc.NAME="baseBlock";var Ps=class extends Oc{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Ps.NAME="valueBlock";var jV=class extends Io(Oc){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?dt.toUint8Array(e.valueHex):BE,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",Wi}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=Gi(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let l=0;l<a-1;l++)u[l+1]=i[l]|128;u[a]=i[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!To(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let u=i[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let l=1,f=this.valueHexView=new Uint8Array(255),h=255;for(;i[l]&128;){if(f[l-1]=i[l]&127,l++,l>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(l===h){h+=255;let g=new Uint8Array(h);for(let w=0;w<f.length;w++)g[w]=f[w];f=this.valueHexView=new Uint8Array(h)}}this.blockLength=l+1,f[l-1]=i[l]&127;let m=new Uint8Array(l);for(let g=0;g<l;g++)m[g]=f[g];f=this.valueHexView=new Uint8Array(l),f.set(m),this.blockLength<=9?this.tagNumber=No(f,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}}};jV.NAME="identificationBlock";var FV=class extends Oc{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!To(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,l=s.subarray(u,u+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=No(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=Gi(this.length,8);if(s.byteLength>127)return this.error="Too big length",Wi;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}}};FV.NAME="lengthBlock";var ot={},ds=class extends Oc{static{o(this,"BaseBlock")}constructor({name:e=Rs,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new jV(s),this.lenBlock=new FV(s),this.valueBlock=i?new i(s):new Ps(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 KT;t||qV(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?Wi: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():Ct.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Ct.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 Ju(t,n)}};ds.NAME="BaseBlock";function qV(r){var e;if(r instanceof ot.Constructed)for(let t of r.valueBlock.value)qV(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(qV,"prepareIndefiniteForm");var HV=class extends ds{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Rs,...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}'`}};HV.NAME="BaseStringBlock";var KV=class extends Io(Ps){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};KV.NAME="PrimitiveValueBlock";var $V,gt=class extends ds{static{o(this,"Primitive")}constructor(e={}){super(e,KV),this.idBlock.isConstructed=!1}};$V=gt;ot.Primitive=$V;gt.NAME="PRIMITIVE";function Dre(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(Dre,"localChangeType");function gg(r,e=0,t=r.length){let n=e,s=new ds({},Ps),i=new Oc;if(!To(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=u,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let l=ds;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=ot.EndOfContent;break;case 1:l=ot.Boolean;break;case 2:l=ot.Integer;break;case 3:l=ot.BitString;break;case 4:l=ot.OctetString;break;case 5:l=ot.Null;break;case 6:l=ot.ObjectIdentifier;break;case 10:l=ot.Enumerated;break;case 12:l=ot.Utf8String;break;case 13:l=ot.RelativeObjectIdentifier;break;case 14:l=ot.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:l=ot.Sequence;break;case 17:l=ot.Set;break;case 18:l=ot.NumericString;break;case 19:l=ot.PrintableString;break;case 20:l=ot.TeletexString;break;case 21:l=ot.VideotexString;break;case 22:l=ot.IA5String;break;case 23:l=ot.UTCTime;break;case 24:l=ot.GeneralizedTime;break;case 25:l=ot.GraphicString;break;case 26:l=ot.VisibleString;break;case 27:l=ot.GeneralString;break;case 28:l=ot.UniversalString;break;case 29:l=ot.CharacterString;break;case 30:l=ot.BmpString;break;case 31:l=ot.DATE;break;case 32:l=ot.TimeOfDay;break;case 33:l=ot.DateTime;break;case 34:l=ot.Duration;break;default:{let f=s.idBlock.isConstructed?new ot.Constructed:new ot.Primitive;f.idBlock=s.idBlock,f.lenBlock=s.lenBlock,f.warnings=s.warnings,s=f}}break;case 2:case 3:case 4:default:l=s.idBlock.isConstructed?ot.Constructed:ot.Primitive}return s=Dre(s,l),u=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:u,result:s}}o(gg,"localFromBER");function Kr(r){if(!r.byteLength){let e=new ds({},Ps);return e.error="Input buffer has zero length",{offset:-1,result:e}}return gg(dt.toUint8Array(r).slice(),0,r.byteLength)}o(Kr,"fromBER");function _re(r,e){return r?1:e}o(_re,"checkLen");var zu=class extends Ps{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=dt.toUint8Array(e);if(!To(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(;_re(this.isIndefiniteForm,n)>0;){let a=gg(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===mg)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===mg?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new KT;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?Wi:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};zu.NAME="ConstructedValueBlock";var XV,ae=class extends ds{static{o(this,"Constructed")}constructor(e={}){super(e,zu),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} :`}};XV=ae;ot.Constructed=XV;ae.NAME="CONSTRUCTED";var GV=class extends Ps{static{o(this,"LocalEndOfContentValueBlock")}fromBER(e,t,n){return t}toBER(e){return Wi}};GV.override="EndOfContentValueBlock";var WV,JV=class extends ds{static{o(this,"EndOfContent")}constructor(e={}){super(e,GV),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};WV=JV;ot.EndOfContent=WV;JV.NAME=mg;var zV,$r=class extends ds{static{o(this,"Null")}constructor(e={}){super(e,Ps),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}`}};zV=$r;ot.Null=zV;$r.NAME="NULL";var YV=class extends Io(Ps){static{o(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=dt.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,n){let s=dt.toUint8Array(e);return To(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,MT.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};YV.NAME="BooleanValueBlock";var QV,Ji=class extends ds{static{o(this,"Boolean")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,YV),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};QV=Ji;ot.Boolean=QV;Ji.NAME="BOOLEAN";var ZV=class extends Io(zu){static{o(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=zu.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===mg){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==UV)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?zu.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};ZV.NAME="OctetStringValueBlock";var $T,Ve=class extends ds{static{o(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},ZV),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=gg(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 ae.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,t=Ct.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 $T&&e.push(t.valueBlock.valueHexView);return dt.concat(e)}};$T=Ve;ot.OctetString=$T;Ve.NAME=UV;var e6=class extends Io(zu){static{o(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=zu.prototype.fromBER.call(this,e,t,n),s===-1)return s;for(let u of this.value){let l=u.constructor.NAME;if(l===mg){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==MV)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let f=u.valueBlock;if(this.unusedBits>0&&f.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=f.unusedBits}return s}let i=dt.toUint8Array(e);if(!To(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 u=a.subarray(1);try{if(u.byteLength){let l=gg(u,0,u.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 zu.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Wi;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}}};e6.NAME="BitStringValueBlock";var t6,qt=class extends ds{static{o(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},e6),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 ae.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}`}}};t6=qt;ot.BitString=t6;qt.NAME=MV;var r6;function Rre(r,e){let t=new Uint8Array([0]),n=new Uint8Array(r),s=new Uint8Array(e),i=n.slice(0),a=i.length-1,u=s.slice(0),l=u.length-1,f=0,h=l<a?a:l,m=0;for(let g=h;g>=0;g--,m++){switch(!0){case m<u.length:f=i[a-m]+u[l-m]+t[0];break;default:f=i[a-m]+t[0]}switch(t[0]=f/10,!0){case m>=i.length:i=NE(new Uint8Array([f%10]),i);break;default:i[a-m]=f%10}}return t[0]>0&&(i=NE(t,i)),i}o(Rre,"viewAdd");function VV(r){if(r>=pg.length)for(let e=pg.length;e<=r;e++){let t=new Uint8Array([0]),n=pg[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=NE(t,n)),pg.push(n)}return pg[r]}o(VV,"power2");function Pre(r,e){let t=0,n=new Uint8Array(r),s=new Uint8Array(e),i=n.slice(0),a=i.length-1,u=s.slice(0),l=u.length-1,f,h=0;for(let m=l;m>=0;m--,h++)switch(f=i[a-h]-u[l-h]-t,!0){case f<0:t=1,i[a-h]=f+10;break;default:t=0,i[a-h]=f}if(t>0)for(let m=a-l+1;m>=0;m--,h++)if(f=i[a-h]-t,f<0)t=1,i[a-h]=f+10;else{t=0,i[a-h]=f;break}return i.slice()}o(Pre,"viewSub");var XT=class extends Io(Ps){static{o(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=MT.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(DV(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="",u=!1;for(let l=i.byteLength-1;l>=0;l--){s=i[l];for(let f=0;f<8;f++){if((s&1)===1)switch(n){case e:t=Pre(VV(n),t),a="-";break;default:t=Rre(t,VV(n))}n++,s>>=1}}for(let l=0;l<t.length;l++)t[l]&&(u=!0),u&&(a+=kV.charAt(t[l]));return u===!1&&(a+=kV.charAt(0)),a}};r6=XT;XT.NAME="IntegerValueBlock";Object.defineProperty(r6.prototype,"valueHex",{set:o(function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},"set"),get:o(function(){return this.valueHexView.slice().buffer},"get")});var dg,me=class extends ds{static{o(this,"Integer")}constructor(e={}){super(e,XT),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return IE(),BigInt(this.valueBlock.toString())}static fromBigInt(e){IE();let t=BigInt(e),n=new KT,s=t.toString(16).replace(/^-/,""),i=new Uint8Array(Ct.FromHex(s));if(t<0){let u=new Uint8Array(i.length+(i[0]&128?1:0));u[0]|=128;let f=BigInt(`0x${Ct.ToHex(u)}`)+t,h=dt.toUint8Array(Ct.FromHex(f.toString(16)));h[0]|=128,n.write(h)}else i[0]&128&&n.write(new Uint8Array([0])),n.write(i);return new dg({valueHex:n.final()})}convertToDER(){let e=new dg({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new dg({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};dg=me;ot.Integer=dg;me.NAME="INTEGER";var n6,Yu=class extends me{static{o(this,"Enumerated")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};n6=Yu;ot.Enumerated=n6;Yu.NAME="ENUMERATED";var FT=class extends Io(Ps){static{o(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=dt.toUint8Array(e);if(!To(this,s,t,n))return-1;let i=s.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let u=0;u<n&&(this.valueHexView[u]=i[u]&127,this.blockLength++,(i[u]&128)!==0);u++);let a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];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=No(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){IE();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=Gi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Wi;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=Ct.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}}};FT.NAME="sidBlock";var s6=class extends Ps{static{o(this,"LocalObjectIdentifierValueBlock")}constructor({value:e=Rs,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let s=t;for(;n>0;){let i=new FT;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,Wi;t.push(s)}return HT(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],u=0;switch(a.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}let l=parseInt(s,10);if(isNaN(l))return;a.valueDec=l+u,i=!1}else{let a=new FT;if(s>Number.MAX_SAFE_INTEGER){IE();let u=BigInt(s);a.valueBigInt=u}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}};s6.NAME="ObjectIdentifierValueBlock";var i6,rt=class extends ds{static{o(this,"ObjectIdentifier")}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,s6),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};i6=rt;ot.ObjectIdentifier=i6;rt.NAME="OBJECT IDENTIFIER";var qT=class extends Io(Oc){static{o(this,"LocalRelativeSidValueBlock")}constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;let s=dt.toUint8Array(e);if(!To(this,s,t,n))return-1;let i=s.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let u=0;u<n&&(this.valueHexView[u]=i[u]&127,this.blockLength++,(i[u]&128)!==0);u++);let a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];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=No(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=Gi(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Wi;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=Ct.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};qT.NAME="relativeSidBlock";var a6=class extends Ps{static{o(this,"LocalRelativeObjectIdentifierValueBlock")}constructor({value:e=Rs,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let s=t;for(;n>0;){let i=new qT;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,Wi;n.push(i)}return HT(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 qT;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}};a6.NAME="RelativeObjectIdentifierValueBlock";var o6,u6=class extends ds{static{o(this,"RelativeObjectIdentifier")}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,a6),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};o6=u6;ot.RelativeObjectIdentifier=o6;u6.NAME="RelativeObjectIdentifier";var l6,W=class extends ae{static{o(this,"Sequence")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};l6=W;ot.Sequence=l6;W.NAME="SEQUENCE";var c6,Xr=class extends ae{static{o(this,"Set")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};c6=Xr;ot.Set=c6;Xr.NAME="SET";var f6=class extends Io(Ps){static{o(this,"LocalStringValueBlock")}constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Rs}toJSON(){return{...super.toJSON(),value:this.value}}};f6.NAME="StringValueBlock";var h6=class extends f6{static{o(this,"LocalSimpleStringValueBlock")}};h6.NAME="SimpleStringValueBlock";var Ys=class extends HV{static{o(this,"LocalSimpleStringBlock")}constructor({...e}={}){super(e,h6)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,dt.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}};Ys.NAME="SIMPLE STRING";var p6=class extends Ys{static{o(this,"LocalUtf8StringValueBlock")}fromBuffer(e){this.valueBlock.valueHexView=dt.toUint8Array(e);try{this.valueBlock.value=Ct.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=Ct.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(Ct.FromUtf8String(e)),this.valueBlock.value=e}};p6.NAME="Utf8StringValueBlock";var d6,Ni=class extends p6{static{o(this,"Utf8String")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};d6=Ni;ot.Utf8String=d6;Ni.NAME="UTF8String";var m6=class extends Ys{static{o(this,"LocalBmpStringValueBlock")}fromBuffer(e){this.valueBlock.value=Ct.ToUtf16String(e),this.valueBlock.valueHexView=dt.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(Ct.FromUtf16String(e))}};m6.NAME="BmpStringValueBlock";var g6,Dp=class extends m6{static{o(this,"BmpString")}constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};g6=Dp;ot.BmpString=g6;Dp.NAME="BMPString";var y6=class extends Ys{static{o(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=Gi(e.charCodeAt(s),8),a=new Uint8Array(i);if(a.length>4)continue;let u=4-a.length;for(let l=a.length-1;l>=0;l--)n[s*4+l+u]=a[l]}this.valueBlock.value=e}};y6.NAME="UniversalStringValueBlock";var v6,_p=class extends y6{static{o(this,"UniversalString")}constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};v6=_p;ot.UniversalString=v6;_p.NAME="UniversalString";var w6,kc=class extends Ys{static{o(this,"NumericString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};w6=kc;ot.NumericString=w6;kc.NAME="NumericString";var S6,Ti=class extends Ys{static{o(this,"PrintableString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};S6=Ti;ot.PrintableString=S6;Ti.NAME="PrintableString";var E6,Rp=class extends Ys{static{o(this,"TeletexString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};E6=Rp;ot.TeletexString=E6;Rp.NAME="TeletexString";var A6,DE=class extends Ys{static{o(this,"VideotexString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};A6=DE;ot.VideotexString=A6;DE.NAME="VideotexString";var C6,yg=class extends Ys{static{o(this,"IA5String")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};C6=yg;ot.IA5String=C6;yg.NAME="IA5String";var b6,_E=class extends Ys{static{o(this,"GraphicString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};b6=_E;ot.GraphicString=b6;_E.NAME="GraphicString";var x6,vg=class extends Ys{static{o(this,"VisibleString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};x6=vg;ot.VisibleString=x6;vg.NAME="VisibleString";var N6,RE=class extends Ys{static{o(this,"GeneralString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};N6=RE;ot.GeneralString=N6;RE.NAME="GeneralString";var T6,PE=class extends Ys{static{o(this,"CharacterString")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};T6=PE;ot.CharacterString=T6;PE.NAME="CharacterString";var I6,Lc=class extends vg{static{o(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,dt.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]=_s(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=_s(this.month,2),t[2]=_s(this.day,2),t[3]=_s(this.hour,2),t[4]=_s(this.minute,2),t[5]=_s(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}}};I6=Lc;ot.UTCTime=I6;Lc.NAME="UTCTime";var B6,Pr=class extends Lc{static{o(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,u=0,l=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{let m=new Number(e[e.length-1]);if(isNaN(m.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 m=1,g=n.indexOf("+"),w="";if(g===-1&&(g=n.indexOf("-"),m=-1),g!==-1){if(w=n.substring(g+1),n=n.substring(0,g),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let y=parseInt(w.substring(0,2),10);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");if(u=m*y,w.length===4){if(y=parseInt(w.substring(2,4),10),isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");l=m*y}}}let f=n.indexOf(".");if(f===-1&&(f=n.indexOf(",")),f!==-1){let m=new Number(`0${n.substring(f)}`);if(isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");i=m.valueOf(),s=n.substring(0,f)}else s=n;switch(!0){case s.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,f!==-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,f!==-1){let m=60*i;this.minute=Math.floor(m),m=60*(m-this.minute),this.second=Math.floor(m),m=1e3*(m-this.second),this.millisecond=Math.floor(m)}break;case s.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let m=60*i;this.second=Math.floor(m),m=1e3*(m-this.second),this.millisecond=Math.floor(m)}break;case s.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let m=1e3*i;this.millisecond=Math.floor(m)}break;default:throw new Error("Wrong input string for conversion")}let h=a.exec(s);if(h===null)throw new Error("Wrong input string for conversion");for(let m=1;m<h.length;m++)switch(m){case 1:this.year=parseInt(h[m],10);break;case 2:this.month=parseInt(h[m],10);break;case 3:this.day=parseInt(h[m],10);break;case 4:this.hour=parseInt(h[m],10)+u;break;case 5:this.minute=parseInt(h[m],10)+l;break;case 6:this.second=parseInt(h[m],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let m=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=m.getUTCFullYear(),this.month=m.getUTCMonth(),this.day=m.getUTCDay(),this.hour=m.getUTCHours(),this.minute=m.getUTCMinutes(),this.second=m.getUTCSeconds(),this.millisecond=m.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(_s(this.year,4)),t.push(_s(this.month,2)),t.push(_s(this.day,2)),t.push(_s(this.hour,2)),t.push(_s(this.minute,2)),t.push(_s(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(_s(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};B6=Pr;ot.GeneralizedTime=B6;Pr.NAME="GeneralizedTime";var D6,_6=class extends Ni{static{o(this,"DATE")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};D6=_6;ot.DATE=D6;_6.NAME="DATE";var R6,P6=class extends Ni{static{o(this,"TimeOfDay")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};R6=P6;ot.TimeOfDay=R6;P6.NAME="TimeOfDay";var O6,k6=class extends Ni{static{o(this,"DateTime")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};O6=k6;ot.DateTime=O6;k6.NAME="DateTime";var L6,V6=class extends Ni{static{o(this,"Duration")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};L6=V6;ot.Duration=L6;V6.NAME="Duration";var U6,M6=class extends Ni{static{o(this,"TIME")}constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};U6=M6;ot.TIME=U6;M6.NAME="TIME";var St=class{static{o(this,"Any")}constructor({name:e=Rs,optional:t=!1}={}){this.name=e,this.optional=t}},Or=class extends St{static{o(this,"Choice")}constructor({value:e=[],...t}={}){super(t),this.value=e}},Tt=class extends St{static{o(this,"Repeated")}constructor({value:e=new St,local:t=!1,...n}={}){super(n),this.value=e,this.local=t}},wg=class{static{o(this,"RawData")}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=dt.toUint8Array(e)}constructor({data:e=BE}={}){this.dataView=dt.toUint8Array(e)}fromBER(e,t,n){let s=t+n;return this.dataView=dt.toUint8Array(e).subarray(t,s),s}toBER(e){return this.dataView.slice().buffer}};function Ie(r,e,t){if(t instanceof Or){for(let i of t.value)if(Ie(r,e,i).verified)return{verified:!0,result:r};{let i={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(jT)&&(i.name=t.name),i}}if(t instanceof St)return t.hasOwnProperty(jT)&&(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(!(Cre in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Tre in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Ire 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(bre)===!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(xre)===!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(Nre)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(Are 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(!(LV 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 u=0;u<i.length;u++)if(i[u]!==a[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Rs),t.name&&(r[t.name]=e)),t instanceof ot.Constructed){let i=0,a={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof Tt&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let l=!0;for(let f=0;f<t.valueBlock.value.length;f++)l=l&&(t.valueBlock.value[f].optional||!1);return l?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Rs),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let l=0;l<u;l++)if(l-i>=e.valueBlock.value.length){if(t.valueBlock.value[l].optional===!1){let f={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,Rs),t.name&&(delete r[t.name],f.name=t.name)),f}}else if(t.valueBlock.value[0]instanceof Tt){if(a=Ie(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,Rs),t.name&&delete r[t.name]),a;if(jT in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let f={};Bre in t.valueBlock.value[0]&&t.valueBlock.value[0].local?f=e:f=r,typeof f[t.valueBlock.value[0].name]>"u"&&(f[t.valueBlock.value[0].name]=[]),f[t.valueBlock.value[0].name].push(e.valueBlock.value[l])}}else if(a=Ie(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,Rs),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,Rs),t.name&&(delete r[t.name],l.name=t.name)),l}return{verified:!0,result:r}}if(t.primitiveSchema&&LV in e.valueBlock){let i=gg(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,Rs),t.name&&(delete r[t.name],a.name=t.name)),a}return Ie(r,i.result,t.primitiveSchema)}return{verified:!0,result:r}}o(Ie,"compareSchema");var Mn=class r{static{o(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:u}=this.prepareFindParameters(t,n,s),l=e.length;if(l>a)return-1;let f=[];for(let h=0;h<l;h++)f.push(e.view[h]);for(let h=0;h<=a-l;h++){let m=!0,g=u?i-l-h:i+h;for(let w=0;w<l;w++)if(this.view[w+g]!=f[w]){m=!1;break}if(m)return u?i-l-h:i+l+h}return-1}findFirstIn(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l={id:-1,position:u?0:i+a,length:0};for(let f=0;f<e.length;f++){let h=this.findPattern(e[f],i,a,u);if(h!=-1){let m=!1,g=e[f].length;u?h-g>=l.position-l.length&&(m=!0):h-g<=l.position-l.length&&(m=!0),m&&(l.position=h,l.id=f,l.length=g)}}return l}findAllIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={id:-1,position:s};do{let l=u.position;if(u=this.findFirstIn(e,u.position,i),u.id==-1)break;i-=u.position-l,a.push({id:u.id,position:u.position})}while(!0);return a}findAllPatternIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u=e.length;if(u>i)return-1;let l=Array.from(e.view);for(let f=0;f<=i-u;f++){let h=!0,m=s+f;for(let g=0;g<u;g++)if(this.view[g+m]!=l[g]){h=!1;break}h&&(a.push(s+u+f),f+=u-1)}return a}findFirstNotIn(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l={left:{id:-1,position:i},right:{id:-1,position:0},value:new r},f=a;for(;f>0;){if(l.right=this.findFirstIn(e,u?i-a+f:i+a-f,f,u),l.right.id==-1){a=f,u?i-=a:i=l.left.position,l.value=new r({buffer:this._buffer.slice(i,i+a)});break}if(l.right.position!=(u?l.left.position-e[l.right.id].length:l.left.position+e[l.right.id].length)){u?(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,f-=e[l.right.id].length}if(u){let h=l.right;l.right=l.left,l.left=h}return l}findAllNotIn(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={left:{id:-1,position:s},right:{id:-1,position:s},value:new r};do{let l=u.right.position;u=this.findFirstNotIn(e,u.right.position,i),i-=u.right.position-l,a.push({left:{id:u.left.id,position:u.left.position},right:{id:u.right.id,position:u.right.position},value:u.value})}while(u.right.id!=-1);return a}findFirstSequence(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=this.skipNotPatterns(e,i,a,u);if(l==-1)return{position:-1,value:new r};let f=this.skipPatterns(e,l,a-(u?i-l:l-i),u);u?(i=f,a=l-f):(i=l,a=f-l);let h=new r({buffer:this._buffer.slice(i,i+a)});return{position:f,value:h}}findAllSequences(e,t,n){let{start:s,length:i}=this.prepareFindParameters(t,n),a=[],u={position:s,value:new r};do{let l=u.position;u=this.findFirstSequence(e,u.position,i),u.position!=-1&&(i-=u.position-l,a.push({position:u.position,value:u.value}))}while(u.position!=-1);return a}findPairedPatterns(e,t,n,s){let i=[];if(e.isEqual(t))return i;let{start:a,length:u}=this.prepareFindParameters(n,s),l=0,f=this.findAllPatternIn(e,a,u);if(!Array.isArray(f)||f.length==0)return i;let h=this.findAllPatternIn(t,a,u);if(!Array.isArray(h)||h.length==0)return i;for(;l<f.length&&h.length!=0;){if(f[0]==h[0]){i.push({left:f[0],right:h[0]}),f.splice(0,1),h.splice(0,1);continue}if(f[l]>h[0])break;for(;f[l]<h[0]&&(l++,!(l>=f.length)););i.push({left:f[l-1],right:h[0]}),f.splice(l-1,1),h.splice(0,1),l=0}return i.sort((m,g)=>m.left-g.left),i}findPairedArrays(e,t,n,s){let{start:i,length:a}=this.prepareFindParameters(n,s),u=[],l=0,f=this.findAllIn(e,i,a);if(f.length==0)return u;let h=this.findAllIn(t,i,a);if(h.length==0)return u;for(;l<f.length&&h.length!=0;){if(f[0].position==h[0].position){u.push({left:f[0],right:h[0]}),f.splice(0,1),h.splice(0,1);continue}if(f[l].position>h[0].position)break;for(;f[l].position<h[0].position&&(l++,!(l>=f.length)););u.push({left:f[l-1],right:h[0]}),f.splice(l-1,1),h.splice(0,1),l=0}return u.sort((m,g)=>m.left.position-g.left.position),u}replacePattern(e,t,n,s,i=null){let a=[],u,l={status:-1,searchPatternPositions:[],replacePatternPositions:[]},{start:f,length:h}=this.prepareFindParameters(n,s);if(i==null){if(a=this.findAllIn([e],f,h),a.length==0)return l}else a=i;l.searchPatternPositions.push(...Array.from(a,y=>y.position));let m=e.length-t.length,g=new ArrayBuffer(this.view.length-a.length*m),w=new Uint8Array(g);for(w.set(new Uint8Array(this.buffer,0,f)),u=0;u<a.length;u++){let y=u==0?f:a[u-1].position;w.set(new Uint8Array(this.buffer,y,a[u].position-e.length-y),y-u*m),w.set(t.view,a[u].position-e.length-u*m),l.replacePatternPositions.push(a[u].position-e.length-u*m)}return u--,w.set(new Uint8Array(this.buffer,a[u].position,this.length-a[u].position),a[u].position-e.length+t.length-u*m),this.buffer=g,this.view=new Uint8Array(this.buffer),l.status=1,l}skipPatterns(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=i;for(let f=0;f<e.length;f++){let h=e[f].length,m=u?l-h:l,g=!0;for(let w=0;w<h;w++)if(this.view[w+m]!=e[f].view[w]){g=!1;break}if(g){if(f=-1,u){if(l-=h,l<=0)return l}else if(l+=h,l>=i+a)return l}}return l}skipNotPatterns(e,t,n,s){let{start:i,length:a,backward:u}=this.prepareFindParameters(t,n,s),l=-1;for(let f=0;f<a;f++){for(let h=0;h<e.length;h++){let m=e[h].length,g=u?i-f-m:i+f,w=!0;for(let y=0;y<m;y++)if(this.view[y+g]!=e[h].view[y]){w=!1;break}if(w){l=u?i-f:i+f;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 Ore=16777216,Bo=class r{static{o(this,"SeqStream")}constructor(e={}){this._stream=new Mn,this._length=0,this._start=0,this.backward=!1,this.appendBlock=0,this.prevLength=0,this.prevStart=0,"view"in e?this.stream=new Mn({view:e.view}):"buffer"in e?this.stream=new Mn({buffer:e.buffer}):"string"in e?this.stream=new Mn({string:e.string}):"hexstring"in e?this.stream=new Mn({hexstring:e.hexstring}):"stream"in e?this.stream=e.stream.slice():this.stream=new Mn,"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 Mn}}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 Mn};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 Mn}}else if(s.position>this._start+s.value.length+n)return{position:-1,value:new Mn};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]*Ore+(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))}};Bo.APPEND_BLOCK=1e3;function Lre(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}o(Lre,"isBytes");function GT(r,...e){if(!Lre(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}`)}o(GT,"bytes");function WT(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")}o(WT,"exists");function F6(r,e){GT(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}o(F6,"output");var kE=o(r=>new DataView(r.buffer,r.byteOffset,r.byteLength),"createView"),zi=o((r,e)=>r<<32-e|r>>>e,"rotr"),LE=o((r,e)=>r<<e|r>>>32-e>>>0,"rotl"),a1e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Vre(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}o(Vre,"utf8ToBytes");function JT(r){return typeof r=="string"&&(r=Vre(r)),GT(r),r}o(JT,"toBytes");var OE=class{static{o(this,"Hash")}clone(){return this._cloneInto()}},o1e={}.toString;function Vc(r){let e=o(n=>r().update(JT(n)).digest(),"hashC"),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}o(Vc,"wrapConstructor");function Ure(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),u=Number(t&i),l=n?4:0,f=n?0:4;r.setUint32(e+l,a,n),r.setUint32(e+f,u,n)}o(Ure,"setBigUint64");var VE=o((r,e,t)=>r&e^~r&t,"Chi"),UE=o((r,e,t)=>r&e^r&t^e&t,"Maj"),Qu=class extends OE{static{o(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=kE(this.buffer)}update(e){WT(this);let{view:t,buffer:n,blockLen:s}=this;e=JT(e);let i=e.length;for(let a=0;a<i;){let u=Math.min(s-this.pos,i-a);if(u===s){let l=kE(e);for(;s<=i-a;a+=s)this.process(l,a);continue}n.set(e.subarray(a,a+u),this.pos),this.pos+=u,a+=u,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){WT(this),F6(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 m=a;m<s;m++)t[m]=0;Ure(n,s-8,BigInt(this.length*8),i),this.process(n,0);let u=kE(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let f=l/4,h=this.get();if(f>h.length)throw new Error("_sha2: outputLen bigger than state");for(let m=0;m<f;m++)u.setUint32(4*m,h[m],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:u}=this;return e.length=s,e.pos=u,e.finished=i,e.destroyed=a,s%t&&e.buffer.set(n),e}};var Sg=new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),Zu=new Uint32Array(80),Mre=class extends Qu{static{o(this,"SHA1")}constructor(){super(64,20,8,!1),this.A=Sg[0]|0,this.B=Sg[1]|0,this.C=Sg[2]|0,this.D=Sg[3]|0,this.E=Sg[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)Zu[l]=e.getUint32(t,!1);for(let l=16;l<80;l++)Zu[l]=LE(Zu[l-3]^Zu[l-8]^Zu[l-14]^Zu[l-16],1);let{A:n,B:s,C:i,D:a,E:u}=this;for(let l=0;l<80;l++){let f,h;l<20?(f=VE(s,i,a),h=1518500249):l<40?(f=s^i^a,h=1859775393):l<60?(f=UE(s,i,a),h=2400959708):(f=s^i^a,h=3395469782);let m=LE(n,5)+f+u+h+Zu[l]|0;u=a,a=i,i=LE(s,30),s=n,n=m}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,this.set(n,s,i,a,u)}roundClean(){Zu.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}},q6=Vc(()=>new Mre);var jre=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]),el=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),tl=new Uint32Array(64),Fre=class extends Qu{static{o(this,"SHA256")}constructor(){super(64,32,8,!1),this.A=el[0]|0,this.B=el[1]|0,this.C=el[2]|0,this.D=el[3]|0,this.E=el[4]|0,this.F=el[5]|0,this.G=el[6]|0,this.H=el[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:a,G:u,H:l}=this;return[e,t,n,s,i,a,u,l]}set(e,t,n,s,i,a,u,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=u|0,this.H=l|0}process(e,t){for(let m=0;m<16;m++,t+=4)tl[m]=e.getUint32(t,!1);for(let m=16;m<64;m++){let g=tl[m-15],w=tl[m-2],y=zi(g,7)^zi(g,18)^g>>>3,S=zi(w,17)^zi(w,19)^w>>>10;tl[m]=S+tl[m-7]+y+tl[m-16]|0}let{A:n,B:s,C:i,D:a,E:u,F:l,G:f,H:h}=this;for(let m=0;m<64;m++){let g=zi(u,6)^zi(u,11)^zi(u,25),w=h+g+VE(u,l,f)+jre[m]+tl[m]|0,S=(zi(n,2)^zi(n,13)^zi(n,22))+UE(n,s,i)|0;h=f,f=l,l=u,u=a+w|0,a=i,i=s,s=n,n=w+S|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,u=u+this.E|0,l=l+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(n,s,i,a,u,l,f,h)}roundClean(){tl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var zT=Vc(()=>new Fre);var ME=BigInt(4294967295),YT=BigInt(32);function H6(r,e=!1){return e?{h:Number(r&ME),l:Number(r>>YT&ME)}:{h:Number(r>>YT&ME)|0,l:Number(r&ME)|0}}o(H6,"fromBig");function qre(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}=H6(r[s],e);[t[s],n[s]]=[i,a]}return[t,n]}o(qre,"split");var Hre=o((r,e)=>BigInt(r>>>0)<<YT|BigInt(e>>>0),"toBig"),Kre=o((r,e,t)=>r>>>t,"shrSH"),$re=o((r,e,t)=>r<<32-t|e>>>t,"shrSL"),Xre=o((r,e,t)=>r>>>t|e<<32-t,"rotrSH"),Gre=o((r,e,t)=>r<<32-t|e>>>t,"rotrSL"),Wre=o((r,e,t)=>r<<64-t|e>>>t-32,"rotrBH"),Jre=o((r,e,t)=>r>>>t-32|e<<64-t,"rotrBL"),zre=o((r,e)=>e,"rotr32H"),Yre=o((r,e)=>r,"rotr32L"),Qre=o((r,e,t)=>r<<t|e>>>32-t,"rotlSH"),Zre=o((r,e,t)=>e<<t|r>>>32-t,"rotlSL"),ene=o((r,e,t)=>e<<t-32|r>>>64-t,"rotlBH"),tne=o((r,e,t)=>r<<t-32|e>>>64-t,"rotlBL");function rne(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}o(rne,"add");var nne=o((r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0),"add3L"),sne=o((r,e,t,n)=>e+t+n+(r/2**32|0)|0,"add3H"),ine=o((r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0),"add4L"),ane=o((r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0,"add4H"),one=o((r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0),"add5L"),une=o((r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0,"add5H");var lne={fromBig:H6,split:qre,toBig:Hre,shrSH:Kre,shrSL:$re,rotrSH:Xre,rotrSL:Gre,rotrBH:Wre,rotrBL:Jre,rotr32H:zre,rotr32L:Yre,rotlSH:Qre,rotlSL:Zre,rotlBH:ene,rotlBL:tne,add:rne,add3L:nne,add3H:sne,add4L:ine,add4H:ane,add5H:une,add5L:one},Ht=lne;var[cne,fne]=Ht.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))),rl=new Uint32Array(80),nl=new Uint32Array(80),jE=class extends Qu{static{o(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:u,Dl:l,Eh:f,El:h,Fh:m,Fl:g,Gh:w,Gl:y,Hh:S,Hl:E}=this;return[e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E]}set(e,t,n,s,i,a,u,l,f,h,m,g,w,y,S,E){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=u|0,this.Dl=l|0,this.Eh=f|0,this.El=h|0,this.Fh=m|0,this.Fl=g|0,this.Gh=w|0,this.Gl=y|0,this.Hh=S|0,this.Hl=E|0}process(e,t){for(let A=0;A<16;A++,t+=4)rl[A]=e.getUint32(t),nl[A]=e.getUint32(t+=4);for(let A=16;A<80;A++){let C=rl[A-15]|0,x=nl[A-15]|0,B=Ht.rotrSH(C,x,1)^Ht.rotrSH(C,x,8)^Ht.shrSH(C,x,7),F=Ht.rotrSL(C,x,1)^Ht.rotrSL(C,x,8)^Ht.shrSL(C,x,7),R=rl[A-2]|0,H=nl[A-2]|0,q=Ht.rotrSH(R,H,19)^Ht.rotrBH(R,H,61)^Ht.shrSH(R,H,6),K=Ht.rotrSL(R,H,19)^Ht.rotrBL(R,H,61)^Ht.shrSL(R,H,6),G=Ht.add4L(F,K,nl[A-7],nl[A-16]),he=Ht.add4H(G,B,q,rl[A-7],rl[A-16]);rl[A]=he|0,nl[A]=G|0}let{Ah:n,Al:s,Bh:i,Bl:a,Ch:u,Cl:l,Dh:f,Dl:h,Eh:m,El:g,Fh:w,Fl:y,Gh:S,Gl:E,Hh:b,Hl:T}=this;for(let A=0;A<80;A++){let C=Ht.rotrSH(m,g,14)^Ht.rotrSH(m,g,18)^Ht.rotrBH(m,g,41),x=Ht.rotrSL(m,g,14)^Ht.rotrSL(m,g,18)^Ht.rotrBL(m,g,41),B=m&w^~m&S,F=g&y^~g&E,R=Ht.add5L(T,x,F,fne[A],nl[A]),H=Ht.add5H(R,b,C,B,cne[A],rl[A]),q=R|0,K=Ht.rotrSH(n,s,28)^Ht.rotrBH(n,s,34)^Ht.rotrBH(n,s,39),G=Ht.rotrSL(n,s,28)^Ht.rotrBL(n,s,34)^Ht.rotrBL(n,s,39),he=n&i^n&u^i&u,le=s&a^s&l^a&l;b=S|0,T=E|0,S=w|0,E=y|0,w=m|0,y=g|0,{h:m,l:g}=Ht.add(f|0,h|0,H|0,q|0),f=u|0,h=l|0,u=i|0,l=a|0,i=n|0,a=s|0;let oe=Ht.add3L(q,G,le);n=Ht.add3H(oe,H,K,he),s=oe|0}({h:n,l:s}=Ht.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:a}=Ht.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:u,l}=Ht.add(this.Ch|0,this.Cl|0,u|0,l|0),{h:f,l:h}=Ht.add(this.Dh|0,this.Dl|0,f|0,h|0),{h:m,l:g}=Ht.add(this.Eh|0,this.El|0,m|0,g|0),{h:w,l:y}=Ht.add(this.Fh|0,this.Fl|0,w|0,y|0),{h:S,l:E}=Ht.add(this.Gh|0,this.Gl|0,S|0,E|0),{h:b,l:T}=Ht.add(this.Hh|0,this.Hl|0,b|0,T|0),this.set(n,s,i,a,u,l,f,h,m,g,w,y,S,E,b,T)}roundClean(){rl.fill(0),nl.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 hne=class extends jE{static{o(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}},QT=Vc(()=>new jE);var ZT=Vc(()=>new hne);var Zr=new ArrayBuffer(0),L="",Ar=class BI extends TypeError{static{o(this,"ArgumentError")}constructor(){super(...arguments),this.name=BI.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 BI(`Parameter '${t}' is not of type ${s.length>1?`(${s.join(" or ")})`:s[0]}`)}};Ar.NAME="ArgumentError";var fr=class pA extends TypeError{static{o(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)),Ar.assert(n,"parameters","object");for(let i of s){let a=n[i];if(a==null)throw new pA(i,t)}}static assertEmpty(e,t,n){if(e==null)throw new pA(t,n)}constructor(e,t=null,n){super(),this.name=pA.NAME,this.field=e,t&&(this.target=t),n?this.message=n:this.message=`Absent mandatory parameter '${e}' ${t?` in '${t}'`:L}`}};fr.NAME="ParameterError";var Ae=class dU extends Error{static{o(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 dU(`Error during parsing of ASN.1 data. Data is not correct for '${t}'.`)}constructor(e){super(e),this.name="AsnError"}},Be=class{static{o(this,"PkiObject")}static blockName(){return this.CLASS_NAME}static fromBER(e){let t=Kr(e);Ae.assert(t,this.name);try{return new this({schema:t.result})}catch{throw new Ae(`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 Ct.ToString(t.toBER(),e)}};Be.CLASS_NAME="PkiObject";function zl(r){let e=!1,t=L,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()}o(zl,"stringPrep");var Eg="type",eI="value",DI=class Og extends Be{static{o(this,"AttributeTypeAndValue")}constructor(e={}){super(),this.type=D(e,Eg,Og.defaultValues(Eg)),this.value=D(e,eI,Og.defaultValues(eI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Eg:return L;case eI:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.type||L}),new St({name:t.value||L})]})}fromSchema(e){_e(e,[Eg,"typeValue"]);let t=Ie(e,e,Og.schema({names:{type:Eg,value:"typeValue"}}));Ae.assertSchema(t,this.className),this.type=t.result.type.valueBlock.toString(),this.value=t.result.typeValue}toSchema(){return new W({value:[new rt({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=[Ni.blockName(),Dp.blockName(),_p.blockName(),kc.blockName(),Ti.blockName(),Rp.blockName(),DE.blockName(),yg.blockName(),_E.blockName(),vg.blockName(),RE.blockName(),PE.blockName()];if(e instanceof ArrayBuffer)return dt.isEqual(this.value.valueBeforeDecodeView,e);if(e.constructor.blockName()===Og.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=zl(this.value.valueBlock.value),u=zl(e.value.valueBlock.value);if(a.localeCompare(u)!==0)return!1}else if(!dt.isEqual(this.value.valueBeforeDecodeView,e.value.valueBeforeDecodeView))return!1;return!0}return!1}};DI.CLASS_NAME="AttributeTypeAndValue";var Uc="typesAndValues",FE="valueBeforeDecode",K6="RDN",kr=class kg extends Be{static{o(this,"RelativeDistinguishedNames")}constructor(e={}){super(),this.typesAndValues=D(e,Uc,kg.defaultValues(Uc)),this.valueBeforeDecode=D(e,FE,kg.defaultValues(FE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Uc:return[];case FE:return Zr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Uc:return t.length===0;case FE:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.repeatedSequence||L,value:new Xr({value:[new Tt({name:t.repeatedSet||L,value:DI.schema(t.typeAndValue||{})})]})})]})}fromSchema(e){_e(e,[K6,Uc]);let t=Ie(e,e,kg.schema({names:{blockName:K6,repeatedSet:Uc}}));Ae.assertSchema(t,this.className),Uc in t.result&&(this.typesAndValues=Array.from(t.result.typesAndValues,n=>new DI({schema:n}))),this.valueBeforeDecode=t.result.RDN.valueBeforeDecodeView.slice().buffer}toSchema(){if(this.valueBeforeDecode.byteLength===0)return new W({value:[new Xr({value:Array.from(this.typesAndValues,t=>t.toSchema())})]});let e=Kr(this.valueBeforeDecode);if(Ae.assert(e,"RelativeDistinguishedNames"),!(e.result instanceof W))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 kg){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?Ju(this.valueBeforeDecode,e):!1}};kr.CLASS_NAME="RelativeDistinguishedNames";var Lg="type",Vg="value";function pne(r={},e=!1){let t=D(r,"names",{});return new W({optional:e,value:[new ae({optional:!0,idBlock:{tagClass:2,tagNumber:1},name:t.country_name||L,value:[new Or({value:[new kc,new Ti]})]}),new ae({optional:!0,idBlock:{tagClass:2,tagNumber:2},name:t.administration_domain_name||L,value:[new Or({value:[new kc,new Ti]})]}),new gt({optional:!0,idBlock:{tagClass:3,tagNumber:0},name:t.network_address||L,isHexOnly:!0}),new gt({optional:!0,idBlock:{tagClass:3,tagNumber:1},name:t.terminal_identifier||L,isHexOnly:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:2},name:t.private_domain_name||L,value:[new Or({value:[new kc,new Ti]})]}),new gt({optional:!0,idBlock:{tagClass:3,tagNumber:3},name:t.organization_name||L,isHexOnly:!0}),new gt({optional:!0,name:t.numeric_user_identifier||L,idBlock:{tagClass:3,tagNumber:4},isHexOnly:!0}),new ae({optional:!0,name:t.personal_name||L,idBlock:{tagClass:3,tagNumber:5},value:[new gt({idBlock:{tagClass:3,tagNumber:0},isHexOnly:!0}),new gt({optional:!0,idBlock:{tagClass:3,tagNumber:1},isHexOnly:!0}),new gt({optional:!0,idBlock:{tagClass:3,tagNumber:2},isHexOnly:!0}),new gt({optional:!0,idBlock:{tagClass:3,tagNumber:3},isHexOnly:!0})]}),new ae({optional:!0,name:t.organizational_unit_names||L,idBlock:{tagClass:3,tagNumber:6},value:[new Tt({value:new Ti})]})]})}o(pne,"builtInStandardAttributes");function dne(r=!1){return new W({optional:r,value:[new Ti,new Ti]})}o(dne,"builtInDomainDefinedAttributes");function mne(r=!1){return new Xr({optional:r,value:[new gt({optional:!0,idBlock:{tagClass:3,tagNumber:0},isHexOnly:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new St]})]})}o(mne,"extensionAttributes");var Cr=class jp extends Be{static{o(this,"GeneralName")}constructor(e={}){super(),this.type=D(e,Lg,jp.defaultValues(Lg)),this.value=D(e,Vg,jp.defaultValues(Vg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Lg:return 9;case Vg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Lg:return t===jp.defaultValues(e);case Vg:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Or({value:[new ae({idBlock:{tagClass:3,tagNumber:0},name:t.blockName||L,value:[new rt,new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St]})]}),new gt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:1}}),new gt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:2}}),new ae({idBlock:{tagClass:3,tagNumber:3},name:t.blockName||L,value:[pne(t.builtInStandardAttributes||{},!1),dne(!0),mne(!0)]}),new ae({idBlock:{tagClass:3,tagNumber:4},name:t.blockName||L,value:[kr.schema(t.directoryName||{})]}),new ae({idBlock:{tagClass:3,tagNumber:5},name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Or({value:[new Rp,new Ti,new _p,new Ni,new Dp]})]}),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new Or({value:[new Rp,new Ti,new _p,new Ni,new Dp]})]})]}),new gt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:6}}),new gt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:7}}),new gt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:8}})]})}fromSchema(e){_e(e,["blockName","otherName","rfc822Name","dNSName","x400Address","directoryName","ediPartyName","uniformResourceIdentifier","iPAddress","registeredID"]);let t=Ie(e,e,jp.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(Ae.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=Kr(s);Ae.assert(i,"GeneralName value"),this.value=i.result.valueBlock.value}break;case 3:this.value=t.result.blockName;break;case 4:this.value=new kr({schema:t.result.directoryName});break;case 5:this.value=t.result.ediPartyName;break;case 7:this.value=new Ve({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=Kr(s);Ae.assert(i,"GeneralName registeredID"),this.value=i.result.valueBlock.toString()}break}}toSchema(){switch(this.type){case 0:case 3:case 5:return new ae({idBlock:{tagClass:3,tagNumber:this.type},value:[this.value]});case 1:case 2:case 6:{let e=new yg({value:this.value});return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}case 4:return new ae({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 rt({value:this.value});return e.idBlock.tagClass=3,e.idBlock.tagNumber=this.type,e}default:return jp.schema()}}toJSON(){let e={type:this.type,value:L};if(typeof this.value=="string")e.value=this.value;else try{e.value=this.value.toJSON()}catch{}return e}};Cr.CLASS_NAME="GeneralName";var Ug="accessMethod",Mg="accessLocation",gne=[Ug,Mg],_I=class dA extends Be{static{o(this,"AccessDescription")}constructor(e={}){super(),this.accessMethod=D(e,Ug,dA.defaultValues(Ug)),this.accessLocation=D(e,Mg,dA.defaultValues(Mg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ug:return L;case Mg:return new Cr;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.accessMethod||L}),Cr.schema(t.accessLocation||{})]})}fromSchema(e){_e(e,gne);let t=Ie(e,e,dA.schema({names:{accessMethod:Ug,accessLocation:{names:{blockName:Mg}}}}));Ae.assertSchema(t,this.className),this.accessMethod=t.result.accessMethod.valueBlock.toString(),this.accessLocation=new Cr({schema:t.result.accessLocation})}toSchema(){return new W({value:[new rt({value:this.accessMethod}),this.accessLocation.toSchema()]})}toJSON(){return{accessMethod:this.accessMethod,accessLocation:this.accessLocation.toJSON()}}};_I.CLASS_NAME="AccessDescription";var il="seconds",al="millis",ol="micros",qc=class Fp extends Be{static{o(this,"Accuracy")}constructor(e={}){super(),il in e&&(this.seconds=D(e,il,Fp.defaultValues(il))),al in e&&(this.millis=D(e,al,Fp.defaultValues(al))),ol in e&&(this.micros=D(e,ol,Fp.defaultValues(ol))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case il:case al:case ol:return 0;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case il:case al:case ol:return t===Fp.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:!0,value:[new me({optional:!0,name:t.seconds||L}),new gt({name:t.millis||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new gt({name:t.micros||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,[il,al,ol]);let t=Ie(e,e,Fp.schema({names:{seconds:il,millis:al,micros:ol}}));if(Ae.assertSchema(t,this.className),"seconds"in t.result&&(this.seconds=t.result.seconds.valueBlock.valueDec),"millis"in t.result){let n=new me({valueHex:t.result.millis.valueBlock.valueHex});this.millis=n.valueBlock.valueDec}if("micros"in t.result){let n=new me({valueHex:t.result.micros.valueBlock.valueHex});this.micros=n.valueBlock.valueDec}}toSchema(){let e=[];if(this.seconds!==void 0&&e.push(new me({value:this.seconds})),this.millis!==void 0){let t=new me({value:this.millis});e.push(new gt({idBlock:{tagClass:3,tagNumber:0},valueHex:t.valueBlock.valueHexView}))}if(this.micros!==void 0){let t=new me({value:this.micros});e.push(new gt({idBlock:{tagClass:3,tagNumber:1},valueHex:t.valueBlock.valueHexView}))}return new W({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}};qc.CLASS_NAME="Accuracy";var qE="algorithmId",Ag="algorithmParams",mU="algorithm",RI="params",yne=[mU,RI],ge=class jg extends Be{static{o(this,"AlgorithmIdentifier")}constructor(e={}){super(),this.algorithmId=D(e,qE,jg.defaultValues(qE)),Ag in e&&(this.algorithmParams=D(e,Ag,jg.defaultValues(Ag))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qE:return L;case Ag:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case qE:return t===L;case Ag:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:t.optional||!1,value:[new rt({name:t.algorithmIdentifier||L}),new St({name:t.algorithmParams||L,optional:!0})]})}fromSchema(e){_e(e,yne);let t=Ie(e,e,jg.schema({names:{algorithmIdentifier:mU,algorithmParams:RI}}));Ae.assertSchema(t,this.className),this.algorithmId=t.result.algorithm.valueBlock.toString(),RI in t.result&&(this.algorithmParams=t.result.params)}toSchema(){let e=[];return e.push(new rt({value:this.algorithmId})),this.algorithmParams&&!(this.algorithmParams instanceof St)&&e.push(this.algorithmParams),new W({value:e})}toJSON(){let e={algorithmId:this.algorithmId};return this.algorithmParams&&!(this.algorithmParams instanceof St)&&(e.algorithmParams=this.algorithmParams.toJSON()),e}isEqual(e){return!(e instanceof jg)||this.algorithmId!==e.algorithmId?!1:this.algorithmParams?e.algorithmParams?JSON.stringify(this.algorithmParams)===JSON.stringify(e.algorithmParams):!1:!e.algorithmParams}};ge.CLASS_NAME="AlgorithmIdentifier";var qp="altNames",vne=[qp],PI=class OI extends Be{static{o(this,"AltName")}constructor(e={}){super(),this.altNames=D(e,qp,OI.defaultValues(qp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qp:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.altNames||L,value:Cr.schema()})]})}fromSchema(e){_e(e,vne);let t=Ie(e,e,OI.schema({names:{altNames:qp}}));Ae.assertSchema(t,this.className),qp in t.result&&(this.altNames=Array.from(t.result.altNames,n=>new Cr({schema:n})))}toSchema(){return new W({value:Array.from(this.altNames,e=>e.toSchema())})}toJSON(){return{altNames:Array.from(this.altNames,e=>e.toJSON())}}};PI.CLASS_NAME="AltName";var Hp="type",Kp="values",wne=[Hp,Kp],en=class mA extends Be{static{o(this,"Attribute")}constructor(e={}){super(),this.type=D(e,Hp,mA.defaultValues(Hp)),this.values=D(e,Kp,mA.defaultValues(Kp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Hp:return L;case Kp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Hp:return t===L;case Kp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.type||L}),new Xr({name:t.setName||L,value:[new Tt({name:t.values||L,value:new St})]})]})}fromSchema(e){_e(e,wne);let t=Ie(e,e,mA.schema({names:{type:Hp,values:Kp}}));Ae.assertSchema(t,this.className),this.type=t.result.type.valueBlock.toString(),this.values=t.result.values}toSchema(){return new W({value:[new rt({value:this.type}),new Xr({value:this.values})]})}toJSON(){return{type:this.type,values:Array.from(this.values,e=>e.toJSON())}}};en.CLASS_NAME="Attribute";var Fg="notBeforeTime",qg="notAfterTime",Sne=[Fg,qg],sh=class gA extends Be{static{o(this,"AttCertValidityPeriod")}constructor(e={}){super(),this.notBeforeTime=D(e,Fg,gA.defaultValues(Fg)),this.notAfterTime=D(e,qg,gA.defaultValues(qg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Fg:case qg:return new Date(0,0,0);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Pr({name:t.notBeforeTime||L}),new Pr({name:t.notAfterTime||L})]})}fromSchema(e){_e(e,Sne);let t=Ie(e,e,gA.schema({names:{notBeforeTime:Fg,notAfterTime:qg}}));Ae.assertSchema(t,this.className),this.notBeforeTime=t.result.notBeforeTime.toDate(),this.notAfterTime=t.result.notAfterTime.toDate()}toSchema(){return new W({value:[new Pr({valueDate:this.notBeforeTime}),new Pr({valueDate:this.notAfterTime})]})}toJSON(){return{notBeforeTime:this.notBeforeTime,notAfterTime:this.notAfterTime}}};sh.CLASS_NAME="AttCertValidityPeriod";var Cg="names",$6="generalNames",jn=class kI extends Be{static{o(this,"GeneralNames")}constructor(e={}){super(),this.names=D(e,Cg,kI.defaultValues(Cg)),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=D(e,Cg,{});return new W({optional:t,name:n.blockName||L,value:[new Tt({name:n.generalNames||L,value:Cr.schema()})]})}fromSchema(e){_e(e,[Cg,$6]);let t=Ie(e,e,kI.schema({names:{blockName:Cg,generalNames:$6}}));Ae.assertSchema(t,this.className),this.names=Array.from(t.result.generalNames,n=>new Cr({schema:n}))}toSchema(){return new W({value:Array.from(this.names,e=>e.toSchema())})}toJSON(){return{names:Array.from(this.names,e=>e.toJSON())}}};jn.CLASS_NAME="GeneralNames";var Ene="2.5.29.9",Ane="2.5.29.14",Cne="2.5.29.15",bne="2.5.29.16",gU="2.5.29.17",yU="2.5.29.18",LB="2.5.29.19",xne="2.5.29.20",Nne="2.5.29.27",Tne="2.5.29.21",Ine="2.5.29.24",vU="2.5.29.28",wU="2.5.29.29",SU="2.5.29.30",EU="2.5.29.31",VB="2.5.29.46",AU="2.5.29.32",Ii="2.5.29.32.0",Bne="1.3.6.1.4.1.311.21.10",CU="2.5.29.33",UB="2.5.29.35",bU="2.5.29.36",Dne="2.5.29.37",_ne="2.5.29.54",MB="1.3.6.1.5.5.7.1.1",Rne="1.3.6.1.5.5.7.1.11",Pne="1.3.6.1.4.1.11129.2.4.2";var One="1.3.6.1.4.1.311.21.7",kne="1.3.6.1.4.1.311.21.1",Lne="1.3.6.1.5.5.7.1.3",jB="1.2.840.113549.1.7.1",xU="1.2.840.113549.1.7.2",NU="1.2.840.113549.1.7.3",TU="1.2.840.113549.1.7.6",Vne="1.2.840.113549.1.9.16.1.4",X6="1.2.840.113549.1.9.22.1",Une="1.2.840.113549.1.9.22.2",G6="1.2.840.113549.1.9.22.3",W6="1.2.840.113549.1.9.23.1",Mne="1.3.6.1.5.5.7",FB=`${Mne}.48`,yA=`${FB}.1.1`,q1e=`${FB}.2`,H1e=`${FB}.1`;var Hc="keyIdentifier",Kc="authorityCertIssuer",$c="authorityCertSerialNumber",jne=[Hc,Kc,$c],qB=class Hg extends Be{static{o(this,"AuthorityKeyIdentifier")}constructor(e={}){super(),Hc in e&&(this.keyIdentifier=D(e,Hc,Hg.defaultValues(Hc))),Kc in e&&(this.authorityCertIssuer=D(e,Kc,Hg.defaultValues(Kc))),$c in e&&(this.authorityCertSerialNumber=D(e,$c,Hg.defaultValues($c))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Hc:return new Ve;case Kc:return[];case $c:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new gt({name:t.keyIdentifier||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.authorityCertIssuer||L,value:Cr.schema()})]}),new gt({name:t.authorityCertSerialNumber||L,optional:!0,idBlock:{tagClass:3,tagNumber:2}})]})}fromSchema(e){_e(e,jne);let t=Ie(e,e,Hg.schema({names:{keyIdentifier:Hc,authorityCertIssuer:Kc,authorityCertSerialNumber:$c}}));Ae.assertSchema(t,this.className),Hc in t.result&&(this.keyIdentifier=new Ve({valueHex:t.result.keyIdentifier.valueBlock.valueHex})),Kc in t.result&&(this.authorityCertIssuer=Array.from(t.result.authorityCertIssuer,n=>new Cr({schema:n}))),$c in t.result&&(this.authorityCertSerialNumber=new me({valueHex:t.result.authorityCertSerialNumber.valueBlock.valueHex}))}toSchema(){let e=[];return this.keyIdentifier&&e.push(new gt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.keyIdentifier.valueBlock.valueHexView})),this.authorityCertIssuer&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.authorityCertIssuer,t=>t.toSchema())})),this.authorityCertSerialNumber&&e.push(new gt({idBlock:{tagClass:3,tagNumber:2},valueHex:this.authorityCertSerialNumber.valueBlock.valueHexView})),new W({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}};qB.CLASS_NAME="AuthorityKeyIdentifier";var Mc="pathLenConstraint",jc="cA",HB=class vA extends Be{static{o(this,"BasicConstraints")}constructor(e={}){super(),this.cA=D(e,jc,!1),Mc in e&&(this.pathLenConstraint=D(e,Mc,0)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case jc:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Ji({optional:!0,name:t.cA||L}),new me({optional:!0,name:t.pathLenConstraint||L})]})}fromSchema(e){_e(e,[jc,Mc]);let t=Ie(e,e,vA.schema({names:{cA:jc,pathLenConstraint:Mc}}));Ae.assertSchema(t,this.className),jc in t.result&&(this.cA=t.result.cA.valueBlock.value),Mc 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!==vA.defaultValues(jc)&&e.push(new Ji({value:this.cA})),Mc in this&&(this.pathLenConstraint instanceof me?e.push(this.pathLenConstraint):e.push(new me({value:this.pathLenConstraint}))),new W({value:e})}toJSON(){let e={};return this.cA!==vA.defaultValues(jc)&&(e.cA=this.cA),Mc in this&&(this.pathLenConstraint instanceof me?e.pathLenConstraint=this.pathLenConstraint.toJSON():e.pathLenConstraint=this.pathLenConstraint),e}};HB.CLASS_NAME="BasicConstraints";var tI="certificateIndex",rI="keyIndex",IU=class LI extends Be{static{o(this,"CAVersion")}constructor(e={}){super(),this.certificateIndex=D(e,tI,LI.defaultValues(tI)),this.keyIndex=D(e,rI,LI.defaultValues(rI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case tI:case rI:return 0;default:return super.defaultValues(e)}}static schema(){return new me}fromSchema(e){if(e.constructor.blockName()!==me.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 m=new ArrayBuffer(4);new Uint8Array(m).set(n,4-t.byteLength),t=m.slice(0)}break;case t.byteLength>4:{let m=new ArrayBuffer(4);new Uint8Array(m).set(n.slice(0,4)),t=m.slice(0)}break}let s=t.slice(0,2),i=new Uint8Array(s),a=i[0];i[0]=i[1],i[1]=a;let u=new Uint16Array(s);this.keyIndex=u[0];let l=t.slice(2),f=new Uint8Array(l);a=f[0],f[0]=f[1],f[1]=a;let h=new Uint16Array(l);this.certificateIndex=h[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 u=new Uint8Array(i);return s=u[0],u[0]=u[1],u[1]=s,new me({valueHex:Rc(i,e)})}toJSON(){return{certificateIndex:this.certificateIndex,keyIndex:this.keyIndex}}};IU.CLASS_NAME="CAVersion";var Kg="policyQualifierId",$g="qualifier",Fne=[Kg,$g],VI=class wA extends Be{static{o(this,"PolicyQualifierInfo")}constructor(e={}){super(),this.policyQualifierId=D(e,Kg,wA.defaultValues(Kg)),this.qualifier=D(e,$g,wA.defaultValues($g)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Kg:return L;case $g:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.policyQualifierId||L}),new St({name:t.qualifier||L})]})}fromSchema(e){_e(e,Fne);let t=Ie(e,e,wA.schema({names:{policyQualifierId:Kg,qualifier:$g}}));Ae.assertSchema(t,this.className),this.policyQualifierId=t.result.policyQualifierId.valueBlock.toString(),this.qualifier=t.result.qualifier}toSchema(){return new W({value:[new rt({value:this.policyQualifierId}),this.qualifier]})}toJSON(){return{policyQualifierId:this.policyQualifierId,qualifier:this.qualifier.toJSON()}}};VI.CLASS_NAME="PolicyQualifierInfo";var Xg="policyIdentifier",Xc="policyQualifiers",qne=[Xg,Xc],UI=class SA extends Be{static{o(this,"PolicyInformation")}constructor(e={}){super(),this.policyIdentifier=D(e,Xg,SA.defaultValues(Xg)),Xc in e&&(this.policyQualifiers=D(e,Xc,SA.defaultValues(Xc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xg:return L;case Xc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.policyIdentifier||L}),new W({optional:!0,value:[new Tt({name:t.policyQualifiers||L,value:VI.schema()})]})]})}fromSchema(e){_e(e,qne);let t=Ie(e,e,SA.schema({names:{policyIdentifier:Xg,policyQualifiers:Xc}}));Ae.assertSchema(t,this.className),this.policyIdentifier=t.result.policyIdentifier.valueBlock.toString(),Xc in t.result&&(this.policyQualifiers=Array.from(t.result.policyQualifiers,n=>new VI({schema:n})))}toSchema(){let e=[];return e.push(new rt({value:this.policyIdentifier})),this.policyQualifiers&&e.push(new W({value:Array.from(this.policyQualifiers,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={policyIdentifier:this.policyIdentifier};return this.policyQualifiers&&(e.policyQualifiers=Array.from(this.policyQualifiers,t=>t.toJSON())),e}};UI.CLASS_NAME="PolicyInformation";var Gg="certificatePolicies",Hne=[Gg],MI=class jI extends Be{static{o(this,"CertificatePolicies")}constructor(e={}){super(),this.certificatePolicies=D(e,Gg,jI.defaultValues(Gg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Gg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.certificatePolicies||L,value:UI.schema()})]})}fromSchema(e){_e(e,Hne);let t=Ie(e,e,jI.schema({names:{certificatePolicies:Gg}}));Ae.assertSchema(t,this.className),this.certificatePolicies=Array.from(t.result.certificatePolicies,n=>new UI({schema:n}))}toSchema(){return new W({value:Array.from(this.certificatePolicies,e=>e.toSchema())})}toJSON(){return{certificatePolicies:Array.from(this.certificatePolicies,e=>e.toJSON())}}};MI.CLASS_NAME="CertificatePolicies";var Wg="templateID",_o="templateMajorVersion",Ro="templateMinorVersion",Kne=[Wg,_o,Ro],$ne=class Jg extends Be{static{o(this,"CertificateTemplate")}constructor(e={}){super(),this.templateID=D(e,Wg,Jg.defaultValues(Wg)),_o in e&&(this.templateMajorVersion=D(e,_o,Jg.defaultValues(_o))),Ro in e&&(this.templateMinorVersion=D(e,Ro,Jg.defaultValues(Ro))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Wg:return L;case _o:case Ro:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.templateID||L}),new me({name:t.templateMajorVersion||L,optional:!0}),new me({name:t.templateMinorVersion||L,optional:!0})]})}fromSchema(e){_e(e,Kne);let t=Ie(e,e,Jg.schema({names:{templateID:Wg,templateMajorVersion:_o,templateMinorVersion:Ro}}));Ae.assertSchema(t,this.className),this.templateID=t.result.templateID.valueBlock.toString(),_o in t.result&&(this.templateMajorVersion=t.result.templateMajorVersion.valueBlock.valueDec),Ro in t.result&&(this.templateMinorVersion=t.result.templateMinorVersion.valueBlock.valueDec)}toSchema(){let e=[];return e.push(new rt({value:this.templateID})),_o in this&&e.push(new me({value:this.templateMajorVersion})),Ro in this&&e.push(new me({value:this.templateMinorVersion})),new W({value:e})}toJSON(){let e={templateID:this.templateID};return _o in this&&(e.templateMajorVersion=this.templateMajorVersion),Ro in this&&(e.templateMinorVersion=this.templateMinorVersion),e}},Gc="distributionPoint",BU="distributionPointNames",Wc="reasons",Jc="cRLIssuer",DU="cRLIssuerNames",Xne=[Gc,BU,Wc,Jc,DU],FI=class zg extends Be{static{o(this,"DistributionPoint")}constructor(e={}){super(),Gc in e&&(this.distributionPoint=D(e,Gc,zg.defaultValues(Gc))),Wc in e&&(this.reasons=D(e,Wc,zg.defaultValues(Wc))),Jc in e&&(this.cRLIssuer=D(e,Jc,zg.defaultValues(Jc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Gc:return[];case Wc:return new qt;case Jc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Or({value:[new ae({name:t.distributionPoint||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.distributionPointNames||L,value:Cr.schema()})]}),new ae({name:t.distributionPoint||L,optional:!0,idBlock:{tagClass:3,tagNumber:1},value:kr.schema().valueBlock.value})]})]}),new gt({name:t.reasons||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new ae({name:t.cRLIssuer||L,optional:!0,idBlock:{tagClass:3,tagNumber:2},value:[new Tt({name:t.cRLIssuerNames||L,value:Cr.schema()})]})]})}fromSchema(e){_e(e,Xne);let t=Ie(e,e,zg.schema({names:{distributionPoint:Gc,distributionPointNames:BU,reasons:Wc,cRLIssuer:Jc,cRLIssuerNames:DU}}));Ae.assertSchema(t,this.className),Gc in t.result&&(t.result.distributionPoint.idBlock.tagNumber===0&&(this.distributionPoint=Array.from(t.result.distributionPointNames,n=>new Cr({schema:n}))),t.result.distributionPoint.idBlock.tagNumber===1&&(this.distributionPoint=new kr({schema:new W({value:t.result.distributionPoint.valueBlock.value})}))),Wc in t.result&&(this.reasons=new qt({valueHex:t.result.reasons.valueBlock.valueHex})),Jc in t.result&&(this.cRLIssuer=Array.from(t.result.cRLIssuerNames,n=>new Cr({schema:n})))}toSchema(){let e=[];if(this.distributionPoint){let t;this.distributionPoint instanceof Array?t=new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.distributionPoint,n=>n.toSchema())}):t=new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.distributionPoint.toSchema()]}),e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[t]}))}return this.reasons&&e.push(new gt({idBlock:{tagClass:3,tagNumber:1},valueHex:this.reasons.valueBlock.valueHexView})),this.cRLIssuer&&e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:Array.from(this.cRLIssuer,t=>t.toSchema())})),new W({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}};FI.CLASS_NAME="DistributionPoint";var Yg="distributionPoints",Gne=[Yg],qI=class HI extends Be{static{o(this,"CRLDistributionPoints")}constructor(e={}){super(),this.distributionPoints=D(e,Yg,HI.defaultValues(Yg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.distributionPoints||L,value:FI.schema()})]})}fromSchema(e){_e(e,Gne);let t=Ie(e,e,HI.schema({names:{distributionPoints:Yg}}));Ae.assertSchema(t,this.className),this.distributionPoints=Array.from(t.result.distributionPoints,n=>new FI({schema:n}))}toSchema(){return new W({value:Array.from(this.distributionPoints,e=>e.toSchema())})}toJSON(){return{distributionPoints:Array.from(this.distributionPoints,e=>e.toJSON())}}};qI.CLASS_NAME="CRLDistributionPoints";var Qg="keyPurposes",Wne=[Qg],_U=class KI extends Be{static{o(this,"ExtKeyUsage")}constructor(e={}){super(),this.keyPurposes=D(e,Qg,KI.defaultValues(Qg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Qg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.keyPurposes||L,value:new rt})]})}fromSchema(e){_e(e,Wne);let t=Ie(e,e,KI.schema({names:{keyPurposes:Qg}}));Ae.assertSchema(t,this.className),this.keyPurposes=Array.from(t.result.keyPurposes,n=>n.valueBlock.toString())}toSchema(){return new W({value:Array.from(this.keyPurposes,e=>new rt({value:e}))})}toJSON(){return{keyPurposes:Array.from(this.keyPurposes)}}};_U.CLASS_NAME="ExtKeyUsage";var bg="accessDescriptions",$I=class XI extends Be{static{o(this,"InfoAccess")}constructor(e={}){super(),this.accessDescriptions=D(e,bg,XI.defaultValues(bg)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case bg:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.accessDescriptions||L,value:_I.schema()})]})}fromSchema(e){_e(e,[bg]);let t=Ie(e,e,XI.schema({names:{accessDescriptions:bg}}));Ae.assertSchema(t,this.className),this.accessDescriptions=Array.from(t.result.accessDescriptions,n=>new _I({schema:n}))}toSchema(){return new W({value:Array.from(this.accessDescriptions,e=>e.toSchema())})}toJSON(){return{accessDescriptions:Array.from(this.accessDescriptions,e=>e.toJSON())}}};$I.CLASS_NAME="InfoAccess";var zc="distributionPoint",RU="distributionPointNames",ul="onlyContainsUserCerts",ll="onlyContainsCACerts",cl="onlySomeReasons",fl="indirectCRL",hl="onlyContainsAttributeCerts",Jne=[zc,RU,ul,ll,cl,fl,hl],PU=class es extends Be{static{o(this,"IssuingDistributionPoint")}constructor(e={}){super(),zc in e&&(this.distributionPoint=D(e,zc,es.defaultValues(zc))),this.onlyContainsUserCerts=D(e,ul,es.defaultValues(ul)),this.onlyContainsCACerts=D(e,ll,es.defaultValues(ll)),cl in e&&(this.onlySomeReasons=D(e,cl,es.defaultValues(cl))),this.indirectCRL=D(e,fl,es.defaultValues(fl)),this.onlyContainsAttributeCerts=D(e,hl,es.defaultValues(hl)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case zc:return[];case ul:return!1;case ll:return!1;case cl:return 0;case fl:return!1;case hl:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Or({value:[new ae({name:t.distributionPoint||L,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.distributionPointNames||L,value:Cr.schema()})]}),new ae({name:t.distributionPoint||L,idBlock:{tagClass:3,tagNumber:1},value:kr.schema().valueBlock.value})]})]}),new gt({name:t.onlyContainsUserCerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new gt({name:t.onlyContainsCACerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:2}}),new gt({name:t.onlySomeReasons||L,optional:!0,idBlock:{tagClass:3,tagNumber:3}}),new gt({name:t.indirectCRL||L,optional:!0,idBlock:{tagClass:3,tagNumber:4}}),new gt({name:t.onlyContainsAttributeCerts||L,optional:!0,idBlock:{tagClass:3,tagNumber:5}})]})}fromSchema(e){_e(e,Jne);let t=Ie(e,e,es.schema({names:{distributionPoint:zc,distributionPointNames:RU,onlyContainsUserCerts:ul,onlyContainsCACerts:ll,onlySomeReasons:cl,indirectCRL:fl,onlyContainsAttributeCerts:hl}}));if(Ae.assertSchema(t,this.className),zc in t.result)switch(!0){case t.result.distributionPoint.idBlock.tagNumber===0:this.distributionPoint=Array.from(t.result.distributionPointNames,n=>new Cr({schema:n}));break;case t.result.distributionPoint.idBlock.tagNumber===1:this.distributionPoint=new kr({schema:new W({value:t.result.distributionPoint.valueBlock.value})});break;default:throw new Error("Unknown tagNumber for distributionPoint: {$asn1.result.distributionPoint.idBlock.tagNumber}")}if(ul in t.result){let n=new Uint8Array(t.result.onlyContainsUserCerts.valueBlock.valueHex);this.onlyContainsUserCerts=n[0]!==0}if(ll in t.result){let n=new Uint8Array(t.result.onlyContainsCACerts.valueBlock.valueHex);this.onlyContainsCACerts=n[0]!==0}if(cl in t.result){let n=new Uint8Array(t.result.onlySomeReasons.valueBlock.valueHex);this.onlySomeReasons=n[0]}if(fl in t.result){let n=new Uint8Array(t.result.indirectCRL.valueBlock.valueHex);this.indirectCRL=n[0]!==0}if(hl 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 ae({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 ae({idBlock:{tagClass:3,tagNumber:0},value:[t]}))}if(this.onlyContainsUserCerts!==es.defaultValues(ul)&&e.push(new gt({idBlock:{tagClass:3,tagNumber:1},valueHex:new Uint8Array([255]).buffer})),this.onlyContainsCACerts!==es.defaultValues(ll)&&e.push(new gt({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 gt({idBlock:{tagClass:3,tagNumber:3},valueHex:t}))}return this.indirectCRL!==es.defaultValues(fl)&&e.push(new gt({idBlock:{tagClass:3,tagNumber:4},valueHex:new Uint8Array([255]).buffer})),this.onlyContainsAttributeCerts!==es.defaultValues(hl)&&e.push(new gt({idBlock:{tagClass:3,tagNumber:5},valueHex:new Uint8Array([255]).buffer})),new W({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!==es.defaultValues(ul)&&(e.onlyContainsUserCerts=this.onlyContainsUserCerts),this.onlyContainsCACerts!==es.defaultValues(ll)&&(e.onlyContainsCACerts=this.onlyContainsCACerts),cl in this&&(e.onlySomeReasons=this.onlySomeReasons),this.indirectCRL!==es.defaultValues(fl)&&(e.indirectCRL=this.indirectCRL),this.onlyContainsAttributeCerts!==es.defaultValues(hl)&&(e.onlyContainsAttributeCerts=this.onlyContainsAttributeCerts),e}};PU.CLASS_NAME="IssuingDistributionPoint";var Zg="base",$p="minimum",pl="maximum",zne=[Zg,$p,pl],e1=class t1 extends Be{static{o(this,"GeneralSubtree")}constructor(e={}){super(),this.base=D(e,Zg,t1.defaultValues(Zg)),this.minimum=D(e,$p,t1.defaultValues($p)),pl in e&&(this.maximum=D(e,pl,t1.defaultValues(pl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Zg:return new Cr;case $p:return 0;case pl:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Cr.schema(t.base||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.minimum||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new me({name:t.maximum||L})]})]})}fromSchema(e){_e(e,zne);let t=Ie(e,e,t1.schema({names:{base:{names:{blockName:Zg}},minimum:$p,maximum:pl}}));Ae.assertSchema(t,this.className),this.base=new Cr({schema:t.result.base}),$p in t.result&&(t.result.minimum.valueBlock.isHexOnly?this.minimum=t.result.minimum:this.minimum=t.result.minimum.valueBlock.valueDec),pl 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 me?t=this.minimum:t=new me({value:this.minimum}),e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[t]}))}if(pl in this){let t=0;this.maximum instanceof me?t=this.maximum:t=new me({value:this.maximum}),e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[t]}))}return new W({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}};e1.CLASS_NAME="GeneralSubtree";var Yc="permittedSubtrees",Qc="excludedSubtrees",Yne=[Yc,Qc],OU=class EA extends Be{static{o(this,"NameConstraints")}constructor(e={}){super(),Yc in e&&(this.permittedSubtrees=D(e,Yc,EA.defaultValues(Yc))),Qc in e&&(this.excludedSubtrees=D(e,Qc,EA.defaultValues(Qc))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yc:case Qc:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.permittedSubtrees||L,value:e1.schema()})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.excludedSubtrees||L,value:e1.schema()})]})]})}fromSchema(e){_e(e,Yne);let t=Ie(e,e,EA.schema({names:{permittedSubtrees:Yc,excludedSubtrees:Qc}}));Ae.assertSchema(t,this.className),Yc in t.result&&(this.permittedSubtrees=Array.from(t.result.permittedSubtrees,n=>new e1({schema:n}))),Qc in t.result&&(this.excludedSubtrees=Array.from(t.result.excludedSubtrees,n=>new e1({schema:n})))}toSchema(){let e=[];return this.permittedSubtrees&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.permittedSubtrees,t=>t.toSchema())})),this.excludedSubtrees&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.excludedSubtrees,t=>t.toSchema())})),new W({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}};OU.CLASS_NAME="NameConstraints";var Po="requireExplicitPolicy",Oo="inhibitPolicyMapping",Qne=[Po,Oo],kU=class AA extends Be{static{o(this,"PolicyConstraints")}constructor(e={}){super(),Po in e&&(this.requireExplicitPolicy=D(e,Po,AA.defaultValues(Po))),Oo in e&&(this.inhibitPolicyMapping=D(e,Oo,AA.defaultValues(Oo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Po:return 0;case Oo:return 0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new gt({name:t.requireExplicitPolicy||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new gt({name:t.inhibitPolicyMapping||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,Qne);let t=Ie(e,e,AA.schema({names:{requireExplicitPolicy:Po,inhibitPolicyMapping:Oo}}));if(Ae.assertSchema(t,this.className),Po in t.result){let n=t.result.requireExplicitPolicy;n.idBlock.tagClass=1,n.idBlock.tagNumber=2;let s=n.toBER(!1),i=Kr(s);Ae.assert(i,"Integer"),this.requireExplicitPolicy=i.result.valueBlock.valueDec}if(Oo in t.result){let n=t.result.inhibitPolicyMapping;n.idBlock.tagClass=1,n.idBlock.tagNumber=2;let s=n.toBER(!1),i=Kr(s);Ae.assert(i,"Integer"),this.inhibitPolicyMapping=i.result.valueBlock.valueDec}}toSchema(){let e=[];if(Po in this){let t=new me({value:this.requireExplicitPolicy});t.idBlock.tagClass=3,t.idBlock.tagNumber=0,e.push(t)}if(Oo in this){let t=new me({value:this.inhibitPolicyMapping});t.idBlock.tagClass=3,t.idBlock.tagNumber=1,e.push(t)}return new W({value:e})}toJSON(){let e={};return Po in this&&(e.requireExplicitPolicy=this.requireExplicitPolicy),Oo in this&&(e.inhibitPolicyMapping=this.inhibitPolicyMapping),e}};kU.CLASS_NAME="PolicyConstraints";var r1="issuerDomainPolicy",n1="subjectDomainPolicy",Zne=[r1,n1],GI=class CA extends Be{static{o(this,"PolicyMapping")}constructor(e={}){super(),this.issuerDomainPolicy=D(e,r1,CA.defaultValues(r1)),this.subjectDomainPolicy=D(e,n1,CA.defaultValues(n1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case r1:return L;case n1:return L;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.issuerDomainPolicy||L}),new rt({name:t.subjectDomainPolicy||L})]})}fromSchema(e){_e(e,Zne);let t=Ie(e,e,CA.schema({names:{issuerDomainPolicy:r1,subjectDomainPolicy:n1}}));Ae.assertSchema(t,this.className),this.issuerDomainPolicy=t.result.issuerDomainPolicy.valueBlock.toString(),this.subjectDomainPolicy=t.result.subjectDomainPolicy.valueBlock.toString()}toSchema(){return new W({value:[new rt({value:this.issuerDomainPolicy}),new rt({value:this.subjectDomainPolicy})]})}toJSON(){return{issuerDomainPolicy:this.issuerDomainPolicy,subjectDomainPolicy:this.subjectDomainPolicy}}};GI.CLASS_NAME="PolicyMapping";var s1="mappings",ese=[s1],LU=class WI extends Be{static{o(this,"PolicyMappings")}constructor(e={}){super(),this.mappings=D(e,s1,WI.defaultValues(s1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case s1:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.mappings||L,value:GI.schema()})]})}fromSchema(e){_e(e,ese);let t=Ie(e,e,WI.schema({names:{mappings:s1}}));Ae.assertSchema(t,this.className),this.mappings=Array.from(t.result.mappings,n=>new GI({schema:n}))}toSchema(){return new W({value:Array.from(this.mappings,e=>e.toSchema())})}toJSON(){return{mappings:Array.from(this.mappings,e=>e.toJSON())}}};LU.CLASS_NAME="PolicyMappings";var dl="notBefore",ml="notAfter",tse=[dl,ml],VU=class bA extends Be{static{o(this,"PrivateKeyUsagePeriod")}constructor(e={}){super(),dl in e&&(this.notBefore=D(e,dl,bA.defaultValues(dl))),ml in e&&(this.notAfter=D(e,ml,bA.defaultValues(ml))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case dl:return new Date;case ml:return new Date;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new gt({name:t.notBefore||L,optional:!0,idBlock:{tagClass:3,tagNumber:0}}),new gt({name:t.notAfter||L,optional:!0,idBlock:{tagClass:3,tagNumber:1}})]})}fromSchema(e){_e(e,tse);let t=Ie(e,e,bA.schema({names:{notBefore:dl,notAfter:ml}}));if(Ae.assertSchema(t,this.className),dl in t.result){let n=new Pr;n.fromBuffer(t.result.notBefore.valueBlock.valueHex),this.notBefore=n.toDate()}if(ml in t.result){let n=new Pr({valueHex:t.result.notAfter.valueBlock.valueHex});n.fromBuffer(t.result.notAfter.valueBlock.valueHex),this.notAfter=n.toDate()}}toSchema(){let e=[];return dl in this&&e.push(new gt({idBlock:{tagClass:3,tagNumber:0},valueHex:new Pr({valueDate:this.notBefore}).valueBlock.valueHexView})),ml in this&&e.push(new gt({idBlock:{tagClass:3,tagNumber:1},valueHex:new Pr({valueDate:this.notAfter}).valueBlock.valueHexView})),new W({value:e})}toJSON(){let e={};return this.notBefore&&(e.notBefore=this.notBefore),this.notAfter&&(e.notAfter=this.notAfter),e}};VU.CLASS_NAME="PrivateKeyUsagePeriod";var Xp="id",ko="type",Gp="values",rse=[Xp,ko],nse=[Gp],JI=class xA extends Be{static{o(this,"QCStatement")}constructor(e={}){super(),this.id=D(e,Xp,xA.defaultValues(Xp)),ko in e&&(this.type=D(e,ko,xA.defaultValues(ko))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xp:return L;case ko:return new $r;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Xp:return t===L;case ko:return t instanceof $r;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||L}),new St({name:t.type||L,optional:!0})]})}fromSchema(e){_e(e,rse);let t=Ie(e,e,xA.schema({names:{id:Xp,type:ko}}));Ae.assertSchema(t,this.className),this.id=t.result.id.valueBlock.toString(),ko in t.result&&(this.type=t.result.type)}toSchema(){let e=[new rt({value:this.id})];return ko in this&&e.push(this.type),new W({value:e})}toJSON(){let e={id:this.id};return this.type&&(e.type=this.type.toJSON()),e}};JI.CLASS_NAME="QCStatement";var UU=class zI extends Be{static{o(this,"QCStatements")}constructor(e={}){super(),this.values=D(e,Gp,zI.defaultValues(Gp)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Gp:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Gp:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.values||L,value:JI.schema(t.value||{})})]})}fromSchema(e){_e(e,nse);let t=Ie(e,e,zI.schema({names:{values:Gp}}));Ae.assertSchema(t,this.className),this.values=Array.from(t.result.values,n=>new JI({schema:n}))}toSchema(){return new W({value:Array.from(this.values,e=>e.toSchema())})}toJSON(){return{values:Array.from(this.values,e=>e.toJSON())}}};UU.CLASS_NAME="QCStatements";var Zc,Ql=class{static{o(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}};Zc=Ql;Ql.namedCurves={};Zc.register("P-256","1.2.840.10045.3.1.7",32),Zc.register("P-384","1.3.132.0.34",48),Zc.register("P-521","1.3.132.0.35",66),Zc.register("brainpoolP256r1","1.3.36.3.3.2.8.1.1.7",32),Zc.register("brainpoolP384r1","1.3.36.3.3.2.8.1.1.11",48),Zc.register("brainpoolP512r1","1.3.36.3.3.2.8.1.1.13",64);var HE="x",KE="y",$E="namedCurve",Jo=class Wp extends Be{static{o(this,"ECPublicKey")}constructor(e={}){super(),this.x=D(e,HE,Wp.defaultValues(HE)),this.y=D(e,KE,Wp.defaultValues(KE)),this.namedCurve=D(e,$E,Wp.defaultValues($E)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case HE:case KE:return Zr;case $E:return L;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case HE:case KE:return t instanceof ArrayBuffer&&Ju(t,Wp.defaultValues(e));case $E:return typeof t=="string"&&t===Wp.defaultValues(e);default:return super.defaultValues(e)}}static schema(){return new wg}fromSchema(e){let t=dt.toUint8Array(e);if(t[0]!==4)throw new Error("Object's schema was not verified against input data for ECPublicKey");let n=Ql.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 wg({data:Rc(new Uint8Array([4]).buffer,this.x,this.y)})}toJSON(){let e=Ql.find(this.namedCurve);return{crv:e?e.name:this.namedCurve,x:TE(hg(this.x),!0,!0,!1),y:TE(hg(this.y),!0,!0,!1)}}fromJSON(e){fr.assert("json",e,"crv","x","y");let t=0,n=Ql.find(e.crv);n&&(this.namedCurve=n.id,t=n.size);let s=Pc(Bp(e.x,!0));if(s.byteLength<t){this.x=new ArrayBuffer(t);let a=new Uint8Array(this.x),u=new Uint8Array(s);a.set(u,1)}else this.x=s.slice(0,t);let i=Pc(Bp(e.y,!0));if(i.byteLength<t){this.y=new ArrayBuffer(t);let a=new Uint8Array(this.y),u=new Uint8Array(i);a.set(u,1)}else this.y=i.slice(0,t)}};Jo.CLASS_NAME="ECPublicKey";var i1="modulus",a1="publicExponent",sse=[i1,a1],YI=class NA extends Be{static{o(this,"RSAPublicKey")}constructor(e={}){super(),this.modulus=D(e,i1,NA.defaultValues(i1)),this.publicExponent=D(e,a1,NA.defaultValues(a1)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case i1:return new me;case a1:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.modulus||L}),new me({name:t.publicExponent||L})]})}fromSchema(e){_e(e,sse);let t=Ie(e,e,NA.schema({names:{modulus:i1,publicExponent:a1}}));Ae.assertSchema(t,this.className),this.modulus=t.result.modulus.convertFromDER(256),this.publicExponent=t.result.publicExponent}toSchema(){return new W({value:[this.modulus.convertToDER(),this.publicExponent]})}toJSON(){return{n:Ct.ToBase64Url(this.modulus.valueBlock.valueHexView),e:Ct.ToBase64Url(this.publicExponent.valueBlock.valueHexView)}}fromJSON(e){fr.assert("json",e,"n","e");let t=Pc(Bp(e.n,!0));this.modulus=new me({valueHex:t.slice(0,Math.pow(2,PV(t.byteLength)))}),this.publicExponent=new me({valueHex:Pc(Bp(e.e,!0)).slice(0,3)})}};YI.CLASS_NAME="RSAPublicKey";var o1="algorithm",u1="subjectPublicKey",ise=[o1,u1],sa=class TA extends Be{static{o(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()===rt.blockName())try{this._parsedKey=new Jo({namedCurve:this.algorithm.algorithmParams.valueBlock.toString(),schema:this.subjectPublicKey.valueBlock.valueHexView})}catch{}break;case"1.2.840.113549.1.1.1":{let e=Kr(this.subjectPublicKey.valueBlock.valueHexView);if(e.offset!==-1)try{this._parsedKey=new YI({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=D(e,o1,TA.defaultValues(o1)),this.subjectPublicKey=D(e,u1,TA.defaultValues(u1));let t=D(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 o1:return new ge;case u1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.algorithm||{}),new qt({name:t.subjectPublicKey||L})]})}fromSchema(e){_e(e,ise);let t=Ie(e,e,TA.schema({names:{algorithm:{names:{blockName:o1}},subjectPublicKey:u1}}));Ae.assertSchema(t,this.className),this.algorithm=new ge({schema:t.result.algorithm}),this.subjectPublicKey=t.result.subjectPublicKey}toSchema(){return new W({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":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 Jo({json:e}),this.algorithm=new ge({algorithmId:"1.2.840.10045.2.1",algorithmParams:new rt({value:this.parsedKey.namedCurve})});break;case"RSA":this.parsedKey=new YI({json:e}),this.algorithm=new ge({algorithmId:"1.2.840.113549.1.1.1",algorithmParams:new $r});break;default:throw new Error(`Invalid value for "kty" parameter: ${e.kty}`)}this.subjectPublicKey=new qt({valueHex:this.parsedKey.toSchema().toBER(!1)})}}async importKey(e,t=_t(!0)){try{if(!e)throw new Error("Need to provide publicKey input parameter");let n=await t.exportKey("spki",e),s=Kr(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}`)}}};sa.CLASS_NAME="PublicKeyInfo";var Jp="version",zp="privateKey",Yi="namedCurve",gl="publicKey",ase=[Jp,zp,Yi,gl],QI=class Lo extends Be{static{o(this,"ECPrivateKey")}constructor(e={}){super(),this.version=D(e,Jp,Lo.defaultValues(Jp)),this.privateKey=D(e,zp,Lo.defaultValues(zp)),Yi in e&&(this.namedCurve=D(e,Yi,Lo.defaultValues(Yi))),gl in e&&(this.publicKey=D(e,gl,Lo.defaultValues(gl))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Jp:return 1;case zp:return new Ve;case Yi:return L;case gl:return new Jo;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Jp:return t===Lo.defaultValues(e);case zp:return t.isEqual(Lo.defaultValues(e));case Yi:return t===L;case gl:return Jo.compareWithDefault(Yi,t.namedCurve)&&Jo.compareWithDefault("x",t.x)&&Jo.compareWithDefault("y",t.y);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new Ve({name:t.privateKey||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new rt({name:t.namedCurve||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new qt({name:t.publicKey||L})]})]})}fromSchema(e){_e(e,ase);let t=Ie(e,e,Lo.schema({names:{version:Jp,privateKey:zp,namedCurve:Yi,publicKey:gl}}));if(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.privateKey=t.result.privateKey,Yi in t.result&&(this.namedCurve=t.result.namedCurve.valueBlock.toString()),gl in t.result){let n={schema:t.result.publicKey.valueBlock.valueHex};Yi in this&&(n.namedCurve=this.namedCurve),this.publicKey=new Jo(n)}}toSchema(){let e=[new me({value:this.version}),this.privateKey];return this.namedCurve&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new rt({value:this.namedCurve})]})),this.publicKey&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new qt({valueHex:this.publicKey.toSchema().toBER(!1)})]})),new W({value:e})}toJSON(){if(!this.namedCurve||Lo.compareWithDefault(Yi,this.namedCurve))throw new Error('Not enough information for making JSON: absent "namedCurve" value');let e=Ql.find(this.namedCurve),t={crv:e?e.name:this.namedCurve,d:Ct.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){fr.assert("json",e,"crv","d");let t=0,n=Ql.find(e.crv);n&&(this.namedCurve=n.id,t=n.size);let s=Ct.FromBase64Url(e.d);if(s.byteLength<t){let i=new ArrayBuffer(t),a=new Uint8Array(i),u=new Uint8Array(s);a.set(u,1),this.privateKey=new Ve({valueHex:i})}else this.privateKey=new Ve({valueHex:s.slice(0,t)});e.x&&e.y&&(this.publicKey=new Jo({json:e}))}};QI.CLASS_NAME="ECPrivateKey";var l1="prime",c1="exponent",f1="coefficient",ose=[l1,c1,f1],IA=class h1 extends Be{static{o(this,"OtherPrimeInfo")}constructor(e={}){super(),this.prime=D(e,l1,h1.defaultValues(l1)),this.exponent=D(e,c1,h1.defaultValues(c1)),this.coefficient=D(e,f1,h1.defaultValues(f1)),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case l1:return new me;case c1:return new me;case f1:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.prime||L}),new me({name:t.exponent||L}),new me({name:t.coefficient||L})]})}fromSchema(e){_e(e,ose);let t=Ie(e,e,h1.schema({names:{prime:l1,exponent:c1,coefficient:f1}}));Ae.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 W({value:[this.prime.convertToDER(),this.exponent.convertToDER(),this.coefficient.convertToDER()]})}toJSON(){return{r:Ct.ToBase64Url(this.prime.valueBlock.valueHexView),d:Ct.ToBase64Url(this.exponent.valueBlock.valueHexView),t:Ct.ToBase64Url(this.coefficient.valueBlock.valueHexView)}}fromJSON(e){fr.assert("json",e,"r","d","r"),this.prime=new me({valueHex:Ct.FromBase64Url(e.r)}),this.exponent=new me({valueHex:Ct.FromBase64Url(e.d)}),this.coefficient=new me({valueHex:Ct.FromBase64Url(e.t)})}};IA.CLASS_NAME="OtherPrimeInfo";var p1="version",d1="modulus",m1="publicExponent",g1="privateExponent",y1="prime1",v1="prime2",w1="exponent1",S1="exponent2",E1="coefficient",ef="otherPrimeInfos",use=[p1,d1,m1,g1,y1,v1,w1,S1,E1,ef],ZI=class Bi extends Be{static{o(this,"RSAPrivateKey")}constructor(e={}){super(),this.version=D(e,p1,Bi.defaultValues(p1)),this.modulus=D(e,d1,Bi.defaultValues(d1)),this.publicExponent=D(e,m1,Bi.defaultValues(m1)),this.privateExponent=D(e,g1,Bi.defaultValues(g1)),this.prime1=D(e,y1,Bi.defaultValues(y1)),this.prime2=D(e,v1,Bi.defaultValues(v1)),this.exponent1=D(e,w1,Bi.defaultValues(w1)),this.exponent2=D(e,S1,Bi.defaultValues(S1)),this.coefficient=D(e,E1,Bi.defaultValues(E1)),ef in e&&(this.otherPrimeInfos=D(e,ef,Bi.defaultValues(ef))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case p1:return 0;case d1:return new me;case m1:return new me;case g1:return new me;case y1:return new me;case v1:return new me;case w1:return new me;case S1:return new me;case E1:return new me;case ef:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new me({name:t.modulus||L}),new me({name:t.publicExponent||L}),new me({name:t.privateExponent||L}),new me({name:t.prime1||L}),new me({name:t.prime2||L}),new me({name:t.exponent1||L}),new me({name:t.exponent2||L}),new me({name:t.coefficient||L}),new W({optional:!0,value:[new Tt({name:t.otherPrimeInfosName||L,value:IA.schema(t.otherPrimeInfo||{})})]})]})}fromSchema(e){_e(e,use);let t=Ie(e,e,Bi.schema({names:{version:p1,modulus:d1,publicExponent:m1,privateExponent:g1,prime1:y1,prime2:v1,exponent1:w1,exponent2:S1,coefficient:E1,otherPrimeInfo:{names:{blockName:ef}}}}));Ae.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),ef in t.result&&(this.otherPrimeInfos=Array.from(t.result.otherPrimeInfos,n=>new IA({schema:n})))}toSchema(){let e=[];return e.push(new me({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 W({value:Array.from(this.otherPrimeInfos,t=>t.toSchema())})),new W({value:e})}toJSON(){let e={n:Ct.ToBase64Url(this.modulus.valueBlock.valueHexView),e:Ct.ToBase64Url(this.publicExponent.valueBlock.valueHexView),d:Ct.ToBase64Url(this.privateExponent.valueBlock.valueHexView),p:Ct.ToBase64Url(this.prime1.valueBlock.valueHexView),q:Ct.ToBase64Url(this.prime2.valueBlock.valueHexView),dp:Ct.ToBase64Url(this.exponent1.valueBlock.valueHexView),dq:Ct.ToBase64Url(this.exponent2.valueBlock.valueHexView),qi:Ct.ToBase64Url(this.coefficient.valueBlock.valueHexView)};return this.otherPrimeInfos&&(e.oth=Array.from(this.otherPrimeInfos,t=>t.toJSON())),e}fromJSON(e){fr.assert("json",e,"n","e","d","p","q","dp","dq","qi"),this.modulus=new me({valueHex:Ct.FromBase64Url(e.n)}),this.publicExponent=new me({valueHex:Ct.FromBase64Url(e.e)}),this.privateExponent=new me({valueHex:Ct.FromBase64Url(e.d)}),this.prime1=new me({valueHex:Ct.FromBase64Url(e.p)}),this.prime2=new me({valueHex:Ct.FromBase64Url(e.q)}),this.exponent1=new me({valueHex:Ct.FromBase64Url(e.dp)}),this.exponent2=new me({valueHex:Ct.FromBase64Url(e.dq)}),this.coefficient=new me({valueHex:Ct.FromBase64Url(e.qi)}),e.oth&&(this.otherPrimeInfos=Array.from(e.oth,t=>new IA({json:t})))}};ZI.CLASS_NAME="RSAPrivateKey";var A1="version",C1="privateKeyAlgorithm",b1="privateKey",tf="attributes",XE="parsedKey",lse=[A1,C1,b1,tf],fv=class rf extends Be{static{o(this,"PrivateKeyInfo")}constructor(e={}){super(),this.version=D(e,A1,rf.defaultValues(A1)),this.privateKeyAlgorithm=D(e,C1,rf.defaultValues(C1)),this.privateKey=D(e,b1,rf.defaultValues(b1)),tf in e&&(this.attributes=D(e,tf,rf.defaultValues(tf))),XE in e&&(this.parsedKey=D(e,XE,rf.defaultValues(XE))),e.json&&this.fromJSON(e.json),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case A1:return 0;case C1:return new ge;case b1:return new Ve;case tf:return[];case XE:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),ge.schema(t.privateKeyAlgorithm||{}),new Ve({name:t.privateKey||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.attributes||L,value:en.schema()})]})]})}fromSchema(e){_e(e,lse);let t=Ie(e,e,rf.schema({names:{version:A1,privateKeyAlgorithm:{names:{blockName:C1}},privateKey:b1,attributes:tf}}));switch(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.privateKeyAlgorithm=new ge({schema:t.result.privateKeyAlgorithm}),this.privateKey=t.result.privateKey,tf in t.result&&(this.attributes=Array.from(t.result.attributes,n=>new en({schema:n}))),this.privateKeyAlgorithm.algorithmId){case"1.2.840.113549.1.1.1":{let n=Kr(this.privateKey.valueBlock.valueHexView);n.offset!==-1&&(this.parsedKey=new ZI({schema:n.result}))}break;case"1.2.840.10045.2.1":if("algorithmParams"in this.privateKeyAlgorithm&&this.privateKeyAlgorithm.algorithmParams instanceof rt){let n=Kr(this.privateKey.valueBlock.valueHexView);n.offset!==-1&&(this.parsedKey=new QI({namedCurve:this.privateKeyAlgorithm.algorithmParams.valueBlock.toString(),schema:n.result}))}break}}toSchema(){let e=[new me({value:this.version}),this.privateKeyAlgorithm.toSchema(),this.privateKey];return this.attributes&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.attributes,t=>t.toSchema())})),new W({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 QI({json:e}),this.privateKeyAlgorithm=new ge({algorithmId:"1.2.840.10045.2.1",algorithmParams:new rt({value:this.parsedKey.namedCurve})});break;case"RSA":this.parsedKey=new ZI({json:e}),this.privateKeyAlgorithm=new ge({algorithmId:"1.2.840.113549.1.1.1",algorithmParams:new $r});break;default:throw new Error(`Invalid value for "kty" parameter: ${e.kty}`)}this.privateKey=new Ve({valueHex:this.parsedKey.toSchema().toBER(!1)})}}};fv.CLASS_NAME="PrivateKeyInfo";var Yp="contentType",Qp="contentEncryptionAlgorithm",nf="encryptedContent",cse=[Yp,Qp,nf],J6=1024,ts=class x1 extends Be{static{o(this,"EncryptedContentInfo")}constructor(e={}){if(super(),this.contentType=D(e,Yp,x1.defaultValues(Yp)),this.contentEncryptionAlgorithm=D(e,Qp,x1.defaultValues(Qp)),nf 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 Ve({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+J6>s.byteLength?s.byteLength-n:J6),u=new ArrayBuffer(a.length),l=new Uint8Array(u);for(let f=0;f<l.length;f++)l[f]=a[f];t.valueBlock.value.push(new Ve({valueHex:u})),i-=a.length,n+=a.length}this.encryptedContent=t}e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Yp:return L;case Qp:return new ge;case nf:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Yp:return t===L;case Qp:return t.algorithmId===L&&!("algorithmParams"in t);case nf:return t.isEqual(x1.defaultValues(nf));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.contentType||L}),ge.schema(t.contentEncryptionAlgorithm||{}),new Or({value:[new ae({name:t.encryptedContent||L,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({value:new Ve})]}),new gt({name:t.encryptedContent||L,idBlock:{tagClass:3,tagNumber:0}})]})]})}fromSchema(e){_e(e,cse);let t=Ie(e,e,x1.schema({names:{contentType:Yp,contentEncryptionAlgorithm:{names:{blockName:Qp}},encryptedContent:nf}}));Ae.assertSchema(t,this.className),this.contentType=t.result.contentType.valueBlock.toString(),this.contentEncryptionAlgorithm=new ge({schema:t.result.contentEncryptionAlgorithm}),nf 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 rt({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 W({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 Ve.prototype.getValue.call(this.encryptedContent)}};ts.CLASS_NAME="EncryptedContentInfo";var yl="hashAlgorithm",vl="maskGenAlgorithm",wl="saltLength",Sl="trailerField",fse=[yl,vl,wl,Sl],BA=class Os extends Be{static{o(this,"RSASSAPSSParams")}constructor(e={}){super(),this.hashAlgorithm=D(e,yl,Os.defaultValues(yl)),this.maskGenAlgorithm=D(e,vl,Os.defaultValues(vl)),this.saltLength=D(e,wl,Os.defaultValues(wl)),this.trailerField=D(e,Sl,Os.defaultValues(Sl)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case yl:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new $r});case vl:return new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new $r}).toSchema()});case wl:return 20;case Sl:return 1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[ge.schema(t.hashAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:1},optional:!0,value:[ge.schema(t.maskGenAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:2},optional:!0,value:[new me({name:t.saltLength||L})]}),new ae({idBlock:{tagClass:3,tagNumber:3},optional:!0,value:[new me({name:t.trailerField||L})]})]})}fromSchema(e){_e(e,fse);let t=Ie(e,e,Os.schema({names:{hashAlgorithm:{names:{blockName:yl}},maskGenAlgorithm:{names:{blockName:vl}},saltLength:wl,trailerField:Sl}}));Ae.assertSchema(t,this.className),yl in t.result&&(this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm})),vl in t.result&&(this.maskGenAlgorithm=new ge({schema:t.result.maskGenAlgorithm})),wl in t.result&&(this.saltLength=t.result.saltLength.valueBlock.valueDec),Sl in t.result&&(this.trailerField=t.result.trailerField.valueBlock.valueDec)}toSchema(){let e=[];return this.hashAlgorithm.isEqual(Os.defaultValues(yl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.hashAlgorithm.toSchema()]})),this.maskGenAlgorithm.isEqual(Os.defaultValues(vl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.maskGenAlgorithm.toSchema()]})),this.saltLength!==Os.defaultValues(wl)&&e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[new me({value:this.saltLength})]})),this.trailerField!==Os.defaultValues(Sl)&&e.push(new ae({idBlock:{tagClass:3,tagNumber:3},value:[new me({value:this.trailerField})]})),new W({value:e})}toJSON(){let e={};return this.hashAlgorithm.isEqual(Os.defaultValues(yl))||(e.hashAlgorithm=this.hashAlgorithm.toJSON()),this.maskGenAlgorithm.isEqual(Os.defaultValues(vl))||(e.maskGenAlgorithm=this.maskGenAlgorithm.toJSON()),this.saltLength!==Os.defaultValues(wl)&&(e.saltLength=this.saltLength),this.trailerField!==Os.defaultValues(Sl)&&(e.trailerField=this.trailerField),e}};BA.CLASS_NAME="RSASSAPSSParams";var Zp="salt",N1="iterationCount",Qi="keyLength",Vo="prf",hse=[Zp,N1,Qi,Vo],w0=class Fa extends Be{static{o(this,"PBKDF2Params")}constructor(e={}){super(),this.salt=D(e,Zp,Fa.defaultValues(Zp)),this.iterationCount=D(e,N1,Fa.defaultValues(N1)),Qi in e&&(this.keyLength=D(e,Qi,Fa.defaultValues(Qi))),Vo in e&&(this.prf=D(e,Vo,Fa.defaultValues(Vo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Zp:return{};case N1:return-1;case Qi:return 0;case Vo:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new $r});default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Or({value:[new Ve({name:t.saltPrimitive||L}),ge.schema(t.saltConstructed||{})]}),new me({name:t.iterationCount||L}),new me({name:t.keyLength||L,optional:!0}),ge.schema(t.prf||{names:{optional:!0}})]})}fromSchema(e){_e(e,hse);let t=Ie(e,e,Fa.schema({names:{saltPrimitive:Zp,saltConstructed:{names:{blockName:Zp}},iterationCount:N1,keyLength:Qi,prf:{names:{blockName:Vo,optional:!0}}}}));Ae.assertSchema(t,this.className),this.salt=t.result.salt,this.iterationCount=t.result.iterationCount.valueBlock.valueDec,Qi in t.result&&(this.keyLength=t.result.keyLength.valueBlock.valueDec),Vo in t.result&&(this.prf=new ge({schema:t.result.prf}))}toSchema(){let e=[];return e.push(this.salt),e.push(new me({value:this.iterationCount})),Qi in this&&Fa.defaultValues(Qi)!==this.keyLength&&e.push(new me({value:this.keyLength})),this.prf&&Fa.defaultValues(Vo).isEqual(this.prf)===!1&&e.push(this.prf.toSchema()),new W({value:e})}toJSON(){let e={salt:this.salt.toJSON(),iterationCount:this.iterationCount};return Qi in this&&Fa.defaultValues(Qi)!==this.keyLength&&(e.keyLength=this.keyLength),this.prf&&Fa.defaultValues(Vo).isEqual(this.prf)===!1&&(e.prf=this.prf.toJSON()),e}};w0.CLASS_NAME="PBKDF2Params";var T1="keyDerivationFunc",I1="encryptionScheme",pse=[T1,I1],eB=class DA extends Be{static{o(this,"PBES2Params")}constructor(e={}){super(),this.keyDerivationFunc=D(e,T1,DA.defaultValues(T1)),this.encryptionScheme=D(e,I1,DA.defaultValues(I1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case T1:return new ge;case I1:return new ge;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.keyDerivationFunc||{}),ge.schema(t.encryptionScheme||{})]})}fromSchema(e){_e(e,pse);let t=Ie(e,e,DA.schema({names:{keyDerivationFunc:{names:{blockName:T1}},encryptionScheme:{names:{blockName:I1}}}}));Ae.assertSchema(t,this.className),this.keyDerivationFunc=new ge({schema:t.result.keyDerivationFunc}),this.encryptionScheme=new ge({schema:t.result.encryptionScheme})}toSchema(){return new W({value:[this.keyDerivationFunc.toSchema(),this.encryptionScheme.toSchema()]})}toJSON(){return{keyDerivationFunc:this.keyDerivationFunc.toJSON(),encryptionScheme:this.encryptionScheme.toJSON()}}};eB.CLASS_NAME="PBES2Params";var dse=class{static{o(this,"AbstractCryptoEngine")}constructor(e){this.crypto=e.crypto,this.subtle="webkitSubtle"in e.crypto?e.crypto.webkitSubtle:e.crypto.subtle,this.name=D(e,"name",L)}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 z6(r,e,t,n,s){let i,a,u;switch(r.toUpperCase()){case"SHA-1":i=20,a=64,u=q6;break;case"SHA-256":i=32,a=64,u=zT;break;case"SHA-384":i=48,a=128,u=ZT;break;case"SHA-512":i=64,a=128,u=QT;break;default:throw new Error("Unsupported hashing algorithm")}let l=new Uint8Array(t),f=new TextDecoder().decode(t);new TextEncoder().encode(f).some((C,x)=>C!==l[x])&&(f=String.fromCharCode(...l));let m=new Uint8Array(f.length*2+2),g=new DataView(m.buffer);for(let C=0;C<f.length;C++)g.setUint16(C*2,f.charCodeAt(C),!1);g.setUint16(f.length*2,0,!1);let w=new Uint8Array(a).fill(3),y=new Uint8Array(n),S=new Uint8Array(a*Math.ceil(y.length/a)).map((C,x)=>y[x%y.length]),E=new Uint8Array(a*Math.ceil(m.length/a)).map((C,x)=>m[x%m.length]),b=new Uint8Array(S.length+E.length);b.set(S),b.set(E,S.length);let T=Math.ceil((e>>3)/i),A=[];for(let C=0;C<T;C++){let x=new Uint8Array(w.length+b.length);x.set(w),x.set(b,w.length);for(let H=0;H<s;H++)x=u(x);let B=new Uint8Array(a).map((H,q)=>x[q%x.length]),F=Math.ceil(y.length/a)+Math.ceil(m.length/a),R=[];for(let H=0;H<F;H++){let q=Array.from(b.slice(H*a,(H+1)*a)),K=511;for(let G=B.length-1;G>=0;G--)K>>=8,K+=B[G]+(q[G]||0),q[G]=K&255;R.push(...q)}b=new Uint8Array(R),A.push(...x)}return new Uint8Array(A.slice(0,e>>3)).buffer}o(z6,"makePKCS12B2Key");function MU(r){let e=typeof r=="string"?{name:r}:r;return"hash"in e?{...e,hash:MU(e.hash)}:e}o(MU,"prepareAlgorithm");var E0=class extends dse{static{o(this,"CryptoEngine")}async importKey(e,t,n,s,i){var a,u,l,f,h,m;let g={},w=MU(n);switch(e.toLowerCase()){case"raw":return this.subtle.importKey("raw",t,n,s,i);case"spki":{let y=Kr(dt.toArrayBuffer(t));Ae.assert(y,"keyData");let S=new sa;try{S.fromSchema(y.result)}catch{throw new Ar("Incorrect keyData")}switch(w.name.toUpperCase()){case"RSA-PSS":{if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="PS1";break;case"SHA-256":g.alg="PS256";break;case"SHA-384":g.alg="PS384";break;case"SHA-512":g.alg="PS512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}case"RSASSA-PKCS1-V1_5":{if(i=["verify"],g.kty="RSA",g.ext=s,g.key_ops=i,S.algorithm.algorithmId!=="1.2.840.113549.1.1.1")throw new Error(`Incorrect public key algorithm: ${S.algorithm.algorithmId}`);if(!g.alg){if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="RS1";break;case"SHA-256":g.alg="RS256";break;case"SHA-384":g.alg="RS384";break;case"SHA-512":g.alg="RS512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}let E=S.toJSON();Object.assign(g,E)}break;case"ECDSA":i=["verify"];case"ECDH":{if(g={kty:"EC",ext:s,key_ops:i},S.algorithm.algorithmId!=="1.2.840.10045.2.1")throw new Error(`Incorrect public key algorithm: ${S.algorithm.algorithmId}`);let E=S.toJSON();Object.assign(g,E)}break;case"RSA-OAEP":{if(g.kty="RSA",g.ext=s,g.key_ops=i,this.name.toLowerCase()==="safari")g.alg="RSA-OAEP";else{if(!w.hash)throw new fr("hash","algorithm.hash","Incorrect hash algorithm: Hash algorithm is missed");switch(w.hash.name.toUpperCase()){case"SHA-1":g.alg="RSA-OAEP";break;case"SHA-256":g.alg="RSA-OAEP-256";break;case"SHA-384":g.alg="RSA-OAEP-384";break;case"SHA-512":g.alg="RSA-OAEP-512";break;default:throw new Error(`Incorrect hash algorithm: ${w.hash.name.toUpperCase()}`)}}let E=S.toJSON();Object.assign(g,E)}break;case"RSAES-PKCS1-V1_5":{g.kty="RSA",g.ext=s,g.key_ops=i,g.alg="PS1";let E=S.toJSON();Object.assign(g,E)}break;default:throw new Error(`Incorrect algorithm name: ${w.name.toUpperCase()}`)}}break;case"pkcs8":{let y=new fv,S=Kr(dt.toArrayBuffer(t));Ae.assert(S,"keyData");try{y.fromSchema(S.result)}catch{throw new Error("Incorrect keyData")}if(!y.parsedKey)throw new Error("Incorrect keyData");switch(w.name.toUpperCase()){case"RSA-PSS":switch((a=w.hash)===null||a===void 0?void 0:a.name.toUpperCase()){case"SHA-1":g.alg="PS1";break;case"SHA-256":g.alg="PS256";break;case"SHA-384":g.alg="PS384";break;case"SHA-512":g.alg="PS512";break;default:throw new Error(`Incorrect hash algorithm: ${(u=w.hash)===null||u===void 0?void 0:u.name.toUpperCase()}`)}case"RSASSA-PKCS1-V1_5":{if(i=["sign"],g.kty="RSA",g.ext=s,g.key_ops=i,y.privateKeyAlgorithm.algorithmId!=="1.2.840.113549.1.1.1")throw new Error(`Incorrect private key algorithm: ${y.privateKeyAlgorithm.algorithmId}`);if(!("alg"in g))switch((l=w.hash)===null||l===void 0?void 0:l.name.toUpperCase()){case"SHA-1":g.alg="RS1";break;case"SHA-256":g.alg="RS256";break;case"SHA-384":g.alg="RS384";break;case"SHA-512":g.alg="RS512";break;default:throw new Error(`Incorrect hash algorithm: ${(f=w.hash)===null||f===void 0?void 0:f.name.toUpperCase()}`)}let E=y.toJSON();Object.assign(g,E)}break;case"ECDSA":i=["sign"];case"ECDH":{if(g={kty:"EC",ext:s,key_ops:i},y.privateKeyAlgorithm.algorithmId!=="1.2.840.10045.2.1")throw new Error(`Incorrect algorithm: ${y.privateKeyAlgorithm.algorithmId}`);let E=y.toJSON();Object.assign(g,E)}break;case"RSA-OAEP":{if(g.kty="RSA",g.ext=s,g.key_ops=i,this.name.toLowerCase()==="safari")g.alg="RSA-OAEP";else switch((h=w.hash)===null||h===void 0?void 0:h.name.toUpperCase()){case"SHA-1":g.alg="RSA-OAEP";break;case"SHA-256":g.alg="RSA-OAEP-256";break;case"SHA-384":g.alg="RSA-OAEP-384";break;case"SHA-512":g.alg="RSA-OAEP-512";break;default:throw new Error(`Incorrect hash algorithm: ${(m=w.hash)===null||m===void 0?void 0:m.name.toUpperCase()}`)}let E=y.toJSON();Object.assign(g,E)}break;case"RSAES-PKCS1-V1_5":{i=["decrypt"],g.kty="RSA",g.ext=s,g.key_ops=i,g.alg="PS1";let E=y.toJSON();Object.assign(g,E)}break;default:throw new Error(`Incorrect algorithm name: ${w.name.toUpperCase()}`)}}break;case"jwk":g=t;break;default:throw new Error(`Incorrect format: ${e}`)}if(this.name.toLowerCase()==="safari")try{return this.subtle.importKey("jwk",Pc(JSON.stringify(g)),n,s,i)}catch{return this.subtle.importKey("jwk",g,n,s,i)}return this.subtle.importKey("jwk",g,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(hg(n))),e.toLowerCase()){case"raw":return this.subtle.exportKey("raw",t);case"spki":{let s=new sa;try{s.fromJSON(n)}catch{throw new Error("Incorrect key data")}return s.toSchema().toBER(!1)}case"pkcs8":{let s=new fv;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 u=await this.importKey(e,n,s,i,a);return this.exportKey(t,u)}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} `:L}: ${e}`);return{}}getOIDByAlgorithm(e,t=!1,n){let s=L;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} `:L}: ${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=L;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 BA({schema:e.algorithmParams});if(n.hashAlgorithm){let s=this.getAlgorithmByOID(n.hashAlgorithm.algorithmId);if("name"in s)t=s.name;else return L}else t="SHA-1"}catch{}break}return t}async encryptEncryptedContentInfo(e){fr.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 u=new ArrayBuffer(64),l=new Uint8Array(u);this.getRandomValues(l);let f=new Uint8Array(e.contentToEncrypt),h=new w0({salt:new Ve({valueHex:u}),iterationCount:e.iterationCount,prf:new ge({algorithmId:s,algorithmParams:new $r})}),m=new Uint8Array(e.password),g=await this.importKey("raw",m,"PBKDF2",!1,["deriveKey"]),w=await this.deriveKey({name:"PBKDF2",hash:{name:e.hmacHashAlgorithm},salt:l,iterations:e.iterationCount},g,e.contentEncryptionAlgorithm,!1,["encrypt"]),y=await this.encrypt({name:e.contentEncryptionAlgorithm.name,iv:a},w,f),S=new eB({keyDerivationFunc:new ge({algorithmId:n,algorithmParams:h.toSchema()}),encryptionScheme:new ge({algorithmId:t,algorithmParams:new Ve({valueHex:i})})});return new ts({contentType:e.contentType,contentEncryptionAlgorithm:new ge({algorithmId:"1.2.840.113549.1.5.13",algorithmParams:S.toSchema()}),encryptedContent:new Ve({valueHex:y})})}async decryptEncryptedContentInfo(e){if(fr.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 eB({schema:e.encryptedContentInfo.contentEncryptionAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "pbes2Parameters"')}let n;try{n=new w0({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),u=n.salt.valueBlock.valueHex,l=new Uint8Array(u),f=n.iterationCount,h="SHA-1";n.prf&&(h=this.getAlgorithmByOID(n.prf.algorithmId,!0).hash.name);let m=await this.importKey("raw",e.password,"PBKDF2",!1,["deriveKey"]),g=await this.deriveKey({name:"PBKDF2",hash:{name:h},salt:l,iterations:f},m,s,!1,["decrypt"]),w=e.encryptedContentInfo.getEncryptedContent();return this.decrypt({name:s.name,iv:a},g,w)}async stampDataWithPassword(e){if(!(e instanceof Object))throw new Error('Parameters must have type "Object"');fr.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 z6(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){fr.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 z6(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 ge,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 ge({algorithmId:l,algorithmParams:new $r}),a.maskGenAlgorithm=new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:a.hashAlgorithm.toSchema()})}i.saltLength!==20&&(a.saltLength=i.saltLength);let u=new BA(a);n.algorithmId="1.2.840.113549.1.1.10",n.algorithmParams=u.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"?gse(s):s}fillPublicKeyParameters(e,t){let n={},s=this.getHashAlgorithm(t);if(s===L)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 u=e.algorithm;if(!u.algorithmParams)throw new Error("Algorithm parameters for ECDSA public key are missed");let l=u.algorithmParams;if("idBlock"in u.algorithmParams&&!(l.idBlock.tagClass===1&&l.idBlock.tagNumber===6))throw new Error("Incorrect type for ECDSA public key parameters");let f=this.getAlgorithmByOID(l.valueBlock.toString(),!0);n.algorithm.algorithm.namedCurve=f.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 f={},h;s.algorithmId==="1.2.840.113549.1.1.10"?h=s.algorithmId:h=n.algorithm.algorithmId;let m=this.getAlgorithmByOID(h,!0);if(f.algorithm=this.getAlgorithmParameters(m.name,"importKey"),"hash"in f.algorithm.algorithm&&(f.algorithm.algorithm.hash.name=i),m.name==="ECDSA"){let g=!1;if("algorithmParams"in n.algorithm&&"idBlock"in n.algorithm.algorithmParams&&n.algorithm.algorithmParams.idBlock.tagClass===1&&n.algorithm.algorithmParams.idBlock.tagNumber===6&&(g=!0),g===!1)throw new Error("Incorrect type for ECDSA public key parameters");let w=this.getAlgorithmByOID(n.algorithm.algorithmParams.valueBlock.toString(),!0);f.algorithm.algorithm.namedCurve=w.name}a=await this.getPublicKey(n,null,f)}else{if(i=this.getHashAlgorithm(s),!i)throw new Error(`Unsupported signature algorithm: ${s.algorithmId}`);a=await this.getPublicKey(n,s)}let u=this.getAlgorithmParameters(a.algorithm.name,"verify");"hash"in u.algorithm&&(u.algorithm.hash.name=i);let l=t.valueBlock.valueHexView;if(a.algorithm.name==="ECDSA"){let f=Ql.find(a.algorithm.namedCurve);if(!f)throw new Error("Unsupported named curve in use");let h=Kr(l);Ae.assert(h,"Signature value"),l=yse(h.result,f.size)}if(a.algorithm.name==="RSA-PSS"){let f=new BA({schema:s.algorithmParams});"saltLength"in f?u.algorithm.saltLength=f.saltLength:u.algorithm.saltLength=20;let h="SHA-1";"hashAlgorithm"in f&&(h=this.getAlgorithmByOID(f.hashAlgorithm.algorithmId,!0).name),u.algorithm.hash.name=h}return this.verify(u.algorithm,a,l,e)}},jU={name:"none",crypto:null};function Y6(r){return!!(r&&typeof r=="object"&&"crypto"in r)}o(Y6,"isCryptoEngine");function TC(r,...e){let t=null;if(e.length<2)e.length?t=e[0]:t=typeof self<"u"&&self.crypto?new E0({name:"browser",crypto:self.crypto}):null;else{let n=e[0],s=e[1];Y6(s)?t=s:Y6(n)?t=n:"subtle"in n&&"getRandomValues"in n&&(t=new E0({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 jU={name:r,crypto:t}}o(TC,"setEngine");function mse(){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 jU}o(mse,"getEngine");function _t(r=!1){let e=mse();if(!e.crypto&&r)throw new Error("Unable to create WebCrypto object");return e.crypto}o(_t,"getCrypto");function gse(r){if(r.byteLength%2!==0)return Zr;let e=r.byteLength/2,t=new ArrayBuffer(e);new Uint8Array(t).set(new Uint8Array(r,0,e));let s=new me({valueHex:t}),i=new ArrayBuffer(e);new Uint8Array(i).set(new Uint8Array(r,e,e));let u=new me({valueHex:i});return new W({value:[s.convertToDER(),u.convertToDER()]}).toBER(!1)}o(gse,"createCMSECDSASignature");function yse(r,e){if(!(r instanceof W&&r.valueBlock.value.length===2&&r.valueBlock.value[0]instanceof me&&r.valueBlock.value[1]instanceof me))return Zr;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}o(yse,"createECDSASignatureFromCMS");async function vse(r,e,t,n,s){switch(r.toUpperCase()){case"SHA-1":case"SHA-256":case"SHA-384":case"SHA-512":break;default:throw new Ar(`Unknown hash function: ${r}`)}if(Ar.assert(e,"zBuffer","ArrayBuffer"),e.byteLength===0)throw new Ar("'zBuffer' has zero length, error");if(Ar.assert(n,"SharedInfo","ArrayBuffer"),t>255)throw new Ar("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 u=Zr;u=Rc(u,e),u=Rc(u,i),u=Rc(u,n);let l=await s.digest({name:r},u);return{counter:t,result:l}}o(vse,"kdfWithCounter");async function Q6(r,e,t,n,s=_t(!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 Ar(`Unknown hash function: ${r}`)}if(Ar.assert(e,"Zbuffer","ArrayBuffer"),e.byteLength===0)throw new Ar("'Zbuffer' has zero length, error");Ar.assert(n,"SharedInfo","ArrayBuffer");let u=t/i;Math.floor(u)>0&&(a=Math.floor(u),u-a>0&&a++);let l=[];for(let g=1;g<=a;g++)l.push(await vse(r,e,g,n,s));let f=Zr,h=1,m=!0;for(;m;){m=!1;for(let g of l)if(g.counter===h){f=Rc(f,g.result),m=!0;break}h++}if(t>>=3,f.byteLength>t){let g=new ArrayBuffer(t),w=new Uint8Array(g),y=new Uint8Array(f);for(let S=0;S<t;S++)w[S]=y[S];return g}return f}o(Q6,"kdf");var nI="version",sI="logID",iI="extensions",aI="timestamp",oI="hashAlgorithm",uI="signatureAlgorithm",lI="signature",Z6="none",eU="md5",tU="sha1",rU="sha224",nU="sha256",sU="sha384",iU="sha512",aU="anonymous",oU="rsa",uU="dsa",lU="ecdsa",FU=class El extends Be{static{o(this,"SignedCertificateTimestamp")}constructor(e={}){super(),this.version=D(e,nI,El.defaultValues(nI)),this.logID=D(e,sI,El.defaultValues(sI)),this.timestamp=D(e,aI,El.defaultValues(aI)),this.extensions=D(e,iI,El.defaultValues(iI)),this.hashAlgorithm=D(e,oI,El.defaultValues(oI)),this.signatureAlgorithm=D(e,uI,El.defaultValues(uI)),this.signature=D(e,lI,El.defaultValues(lI)),"stream"in e&&e.stream&&this.fromStream(e.stream),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case nI:return 0;case sI:case iI:return Zr;case aI:return new Date(0);case oI:case uI:return L;case lI:return Zr;default:return super.defaultValues(e)}}fromSchema(e){if(!(e instanceof wg))throw new Error("Object's schema was not verified against input data for SignedCertificateTimestamp");let t=new Bo({stream:new Mn({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(No(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=Z6;break;case 1:this.hashAlgorithm=eU;break;case 2:this.hashAlgorithm=tU;break;case 3:this.hashAlgorithm=rU;break;case 4:this.hashAlgorithm=nU;break;case 5:this.hashAlgorithm=sU;break;case 6:this.hashAlgorithm=iU;break;default:throw new Error("Object's stream was not correct for SignedCertificateTimestamp")}switch(e.getBlock(1)[0]){case 0:this.signatureAlgorithm=aU;break;case 1:this.signatureAlgorithm=oU;break;case 2:this.signatureAlgorithm=uU;break;case 3:this.signatureAlgorithm=lU;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 wg({data:e.stream.buffer})}toStream(){let e=new Bo;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=Gi(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 Z6:i=0;break;case eU:i=1;break;case tU:i=2;break;case rU:i=3;break;case nU:i=4;break;case sU:i=5;break;case iU:i=6;break;default:throw new Error(`Incorrect data for hashAlgorithm: ${this.hashAlgorithm}`)}e.appendChar(i);let a;switch(this.signatureAlgorithm.toLowerCase()){case aU:a=0;break;case oU:a=1;break;case uU:a=2;break;case lU: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:xE(this.logID),timestamp:this.timestamp,extensions:xE(this.extensions),hashAlgorithm:this.hashAlgorithm,signatureAlgorithm:this.signatureAlgorithm,signature:xE(this.signature)}}async verify(e,t,n=0,s=_t(!0)){let i=TE(hg(this.logID)),a=null,u=new Bo;for(let w of e)if(w.log_id===i){a=w.key;break}if(!a)throw new Error(`Public key not found for CT with logId: ${i}`);let l=Pc(Bp(a)),f=sa.fromBER(l);u.appendChar(0),u.appendChar(0);let h=new ArrayBuffer(8),m=new Uint8Array(h),g=Gi(this.timestamp.valueOf(),8);return m.set(new Uint8Array(g),8-g.byteLength),u.appendView(m),u.appendUint16(n),n===0&&u.appendUint24(t.byteLength),u.appendView(new Uint8Array(t)),u.appendUint16(this.extensions.byteLength),this.extensions.byteLength!==0&&u.appendView(new Uint8Array(this.extensions)),s.verifyWithPublicKey(u.buffer.slice(0,u.length),new Ve({valueHex:this.signature}),f,{algorithmId:L},"SHA-256")}};FU.CLASS_NAME="SignedCertificateTimestamp";var GE="timestamps",qU=class HU extends Be{static{o(this,"SignedCertificateTimestampList")}constructor(e={}){super(),this.timestamps=D(e,GE,HU.defaultValues(GE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case GE:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case GE:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){var t;let n=D(e,"names",{});return(t=n.optional)!==null&&t!==void 0||(n.optional=!1),new Ve({name:n.blockName||"SignedCertificateTimestampList",optional:n.optional})}fromSchema(e){if(!(e instanceof Ve))throw new Error("Object's schema was not verified against input data for SignedCertificateTimestampList");let t=new Bo({stream:new Mn({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 FU({stream:t}))}toSchema(){let e=new Bo,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 Ve({valueHex:e.stream.buffer.slice(0)})}toJSON(){return{timestamps:Array.from(this.timestamps,e=>e.toJSON())}}};qU.CLASS_NAME="SignedCertificateTimestampList";var B1="attributes",wse=[B1],KU=class tB extends Be{static{o(this,"SubjectDirectoryAttributes")}constructor(e={}){super(),this.attributes=D(e,B1,tB.defaultValues(B1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case B1:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.attributes||L,value:en.schema()})]})}fromSchema(e){_e(e,wse);let t=Ie(e,e,tB.schema({names:{attributes:B1}}));Ae.assertSchema(t,this.className),this.attributes=Array.from(t.result.attributes,n=>new en({schema:n}))}toSchema(){return new W({value:Array.from(this.attributes,e=>e.toSchema())})}toJSON(){return{attributes:Array.from(this.attributes,e=>e.toJSON())}}};KU.CLASS_NAME="SubjectDirectoryAttributes";var Sse=class Gr{static{o(this,"ExtensionValueFactory")}static getItems(){return this.types||(this.types={},Gr.register(gU,"SubjectAltName",PI),Gr.register(yU,"IssuerAltName",PI),Gr.register(UB,"AuthorityKeyIdentifier",qB),Gr.register(LB,"BasicConstraints",HB),Gr.register(kne,"MicrosoftCaVersion",IU),Gr.register(AU,"CertificatePolicies",MI),Gr.register(Bne,"CertificatePoliciesMicrosoft",MI),Gr.register(One,"MicrosoftCertTemplateV2",$ne),Gr.register(EU,"CRLDistributionPoints",qI),Gr.register(VB,"FreshestCRL",qI),Gr.register(Dne,"ExtKeyUsage",_U),Gr.register(wU,"CertificateIssuer",jn),Gr.register(MB,"AuthorityInfoAccess",$I),Gr.register(Rne,"SubjectInfoAccess",$I),Gr.register(vU,"IssuingDistributionPoint",PU),Gr.register(SU,"NameConstraints",OU),Gr.register(bU,"PolicyConstraints",kU),Gr.register(CU,"PolicyMappings",LU),Gr.register(bne,"PrivateKeyUsagePeriod",VU),Gr.register(Lne,"QCStatements",UU),Gr.register(Pne,"SignedCertificateTimestampList",qU),Gr.register(Ene,"SubjectDirectoryAttributes",KU)),this.types}static fromBER(e,t){let n=Kr(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}}},D1="extnID",Al="critical",_1="extnValue",WE="parsedValue",Ese=[D1,Al,_1],Ri=class Cl extends Be{static{o(this,"Extension")}get parsedValue(){if(this._parsedValue===void 0){let e=Sse.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=D(e,D1,Cl.defaultValues(D1)),this.critical=D(e,Al,Cl.defaultValues(Al)),_1 in e?this.extnValue=new Ve({valueHex:e.extnValue}):this.extnValue=Cl.defaultValues(_1),WE in e&&(this.parsedValue=D(e,WE,Cl.defaultValues(WE))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case D1:return L;case Al:return!1;case _1:return new Ve;case WE:return{};default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.extnID||L}),new Ji({name:t.critical||L,optional:!0}),new Ve({name:t.extnValue||L})]})}fromSchema(e){_e(e,Ese);let t=Ie(e,e,Cl.schema({names:{extnID:D1,critical:Al,extnValue:_1}}));Ae.assertSchema(t,this.className),this.extnID=t.result.extnID.valueBlock.toString(),Al in t.result&&(this.critical=t.result.critical.valueBlock.value),this.extnValue=t.result.extnValue}toSchema(){let e=[];return e.push(new rt({value:this.extnID})),this.critical!==Cl.defaultValues(Al)&&e.push(new Ji({value:this.critical})),e.push(this.extnValue),new W({value:e})}toJSON(){let e={extnID:this.extnID,extnValue:this.extnValue.toJSON()};return this.critical!==Cl.defaultValues(Al)&&(e.critical=this.critical),this.parsedValue&&this.parsedValue.toJSON&&(e.parsedValue=this.parsedValue.toJSON()),e}};Ri.CLASS_NAME="Extension";var R1="extensions",Ase=[R1],Sn=class rB extends Be{static{o(this,"Extensions")}constructor(e={}){super(),this.extensions=D(e,R1,rB.defaultValues(R1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case R1:return[];default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=D(e,"names",{});return new W({optional:t,name:n.blockName||L,value:[new Tt({name:n.extensions||L,value:Ri.schema(n.extension||{})})]})}fromSchema(e){_e(e,Ase);let t=Ie(e,e,rB.schema({names:{extensions:R1}}));Ae.assertSchema(t,this.className),this.extensions=Array.from(t.result.extensions,n=>new Ri({schema:n}))}toSchema(){return new W({value:Array.from(this.extensions,e=>e.toSchema())})}toJSON(){return{extensions:this.extensions.map(e=>e.toJSON())}}};Sn.CLASS_NAME="Extensions";var P1="issuer",O1="serialNumber",sf="issuerUID",Cse=[P1,O1,sf],Ga=class k1 extends Be{static{o(this,"IssuerSerial")}constructor(e={}){super(),this.issuer=D(e,P1,k1.defaultValues(P1)),this.serialNumber=D(e,O1,k1.defaultValues(O1)),sf in e&&(this.issuerUID=D(e,sf,k1.defaultValues(sf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case P1:return new jn;case O1:return new me;case sf:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[jn.schema(t.issuer||{}),new me({name:t.serialNumber||L}),new qt({optional:!0,name:t.issuerUID||L})]})}fromSchema(e){_e(e,Cse);let t=Ie(e,e,k1.schema({names:{issuer:{names:{blockName:P1}},serialNumber:O1,issuerUID:sf}}));Ae.assertSchema(t,this.className),this.issuer=new jn({schema:t.result.issuer}),this.serialNumber=t.result.serialNumber,sf in t.result&&(this.issuerUID=t.result.issuerUID)}toSchema(){let e=new W({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}};Ga.CLASS_NAME="IssuerSerial";var L1="version",af="baseCertificateID",of="subjectName",V1="issuer",U1="signature",M1="serialNumber",j1="attrCertValidityPeriod",F1="attributes",uf="issuerUniqueID",lf="extensions",bse=[L1,af,of,V1,U1,M1,j1,F1,uf,lf],_A=class Di extends Be{static{o(this,"AttributeCertificateInfoV1")}constructor(e={}){super(),this.version=D(e,L1,Di.defaultValues(L1)),af in e&&(this.baseCertificateID=D(e,af,Di.defaultValues(af))),of in e&&(this.subjectName=D(e,of,Di.defaultValues(of))),this.issuer=D(e,V1,Di.defaultValues(V1)),this.signature=D(e,U1,Di.defaultValues(U1)),this.serialNumber=D(e,M1,Di.defaultValues(M1)),this.attrCertValidityPeriod=D(e,j1,Di.defaultValues(j1)),this.attributes=D(e,F1,Di.defaultValues(F1)),uf in e&&(this.issuerUniqueID=D(e,uf,Di.defaultValues(uf))),lf in e&&(this.extensions=D(e,lf,Di.defaultValues(lf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case L1:return 0;case af:return new Ga;case of:return new jn;case V1:return new jn;case U1:return new ge;case M1:return new me;case j1:return new sh;case F1:return[];case uf:return new qt;case lf:return new Sn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new Or({value:[new ae({name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Ga.schema().valueBlock.value}),new ae({name:t.subjectName||L,idBlock:{tagClass:3,tagNumber:1},value:jn.schema().valueBlock.value})]}),jn.schema({names:{blockName:t.issuer||L}}),ge.schema(t.signature||{}),new me({name:t.serialNumber||L}),sh.schema(t.attrCertValidityPeriod||{}),new W({name:t.attributes||L,value:[new Tt({value:en.schema()})]}),new qt({optional:!0,name:t.issuerUniqueID||L}),Sn.schema(t.extensions||{},!0)]})}fromSchema(e){_e(e,bse);let t=Ie(e,e,Di.schema({names:{version:L1,baseCertificateID:af,subjectName:of,issuer:V1,signature:{names:{blockName:U1}},serialNumber:M1,attrCertValidityPeriod:{names:{blockName:j1}},attributes:F1,issuerUniqueID:uf,extensions:{names:{blockName:lf}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,af in t.result&&(this.baseCertificateID=new Ga({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),of in t.result&&(this.subjectName=new jn({schema:new W({value:t.result.subjectName.valueBlock.value})})),this.issuer=t.result.issuer,this.signature=new ge({schema:t.result.signature}),this.serialNumber=t.result.serialNumber,this.attrCertValidityPeriod=new sh({schema:t.result.attrCertValidityPeriod}),this.attributes=Array.from(t.result.attributes.valueBlock.value,n=>new en({schema:n})),uf in t.result&&(this.issuerUniqueID=t.result.issuerUniqueID),lf in t.result&&(this.extensions=new Sn({schema:t.result.extensions}))}toSchema(){let e=new W({value:[new me({value:this.version})]});return this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.subjectName&&e.valueBlock.value.push(new ae({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 W({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}};_A.CLASS_NAME="AttributeCertificateInfoV1";var q1="acinfo",H1="signatureAlgorithm",K1="signatureValue",xse=[q1,K1,H1],IC=class $1 extends Be{static{o(this,"AttributeCertificateV1")}constructor(e={}){super(),this.acinfo=D(e,q1,$1.defaultValues(q1)),this.signatureAlgorithm=D(e,H1,$1.defaultValues(H1)),this.signatureValue=D(e,K1,$1.defaultValues(K1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case q1:return new _A;case H1:return new ge;case K1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[_A.schema(t.acinfo||{}),ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signatureValue||L})]})}fromSchema(e){_e(e,xse);let t=Ie(e,e,$1.schema({names:{acinfo:{names:{blockName:q1}},signatureAlgorithm:{names:{blockName:H1}},signatureValue:K1}}));Ae.assertSchema(t,this.className),this.acinfo=new _A({schema:t.result.acinfo}),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}toSchema(){return new W({value:[this.acinfo.toSchema(),this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){return{acinfo:this.acinfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()}}};IC.CLASS_NAME="AttributeCertificateV1";var X1="digestedObjectType",cf="otherObjectTypeID",G1="digestAlgorithm",W1="objectDigest",Nse=[X1,cf,G1,W1],ih=class ed extends Be{static{o(this,"ObjectDigestInfo")}constructor(e={}){super(),this.digestedObjectType=D(e,X1,ed.defaultValues(X1)),cf in e&&(this.otherObjectTypeID=D(e,cf,ed.defaultValues(cf))),this.digestAlgorithm=D(e,G1,ed.defaultValues(G1)),this.objectDigest=D(e,W1,ed.defaultValues(W1)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case X1:return new Yu;case cf:return new rt;case G1:return new ge;case W1:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Yu({name:t.digestedObjectType||L}),new rt({optional:!0,name:t.otherObjectTypeID||L}),ge.schema(t.digestAlgorithm||{}),new qt({name:t.objectDigest||L})]})}fromSchema(e){_e(e,Nse);let t=Ie(e,e,ed.schema({names:{digestedObjectType:X1,otherObjectTypeID:cf,digestAlgorithm:{names:{blockName:G1}},objectDigest:W1}}));Ae.assertSchema(t,this.className),this.digestedObjectType=t.result.digestedObjectType,cf in t.result&&(this.otherObjectTypeID=t.result.otherObjectTypeID),this.digestAlgorithm=new ge({schema:t.result.digestAlgorithm}),this.objectDigest=t.result.objectDigest}toSchema(){let e=new W({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}};ih.CLASS_NAME="ObjectDigestInfo";var ff="issuerName",hf="baseCertificateID",pf="objectDigestInfo",Tse=[ff,hf,pf],nB=class J1 extends Be{static{o(this,"V2Form")}constructor(e={}){super(),ff in e&&(this.issuerName=D(e,ff,J1.defaultValues(ff))),hf in e&&(this.baseCertificateID=D(e,hf,J1.defaultValues(hf))),pf in e&&(this.objectDigestInfo=D(e,pf,J1.defaultValues(pf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case ff:return new jn;case hf:return new Ga;case pf:return new ih;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[jn.schema({names:{blockName:t.issuerName}},!0),new ae({optional:!0,name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Ga.schema().valueBlock.value}),new ae({optional:!0,name:t.objectDigestInfo||L,idBlock:{tagClass:3,tagNumber:1},value:ih.schema().valueBlock.value})]})}fromSchema(e){_e(e,Tse);let t=Ie(e,e,J1.schema({names:{issuerName:ff,baseCertificateID:hf,objectDigestInfo:pf}}));Ae.assertSchema(t,this.className),ff in t.result&&(this.issuerName=new jn({schema:t.result.issuerName})),hf in t.result&&(this.baseCertificateID=new Ga({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),pf in t.result&&(this.objectDigestInfo=new ih({schema:new W({value:t.result.objectDigestInfo.valueBlock.value})}))}toSchema(){let e=new W;return this.issuerName&&e.valueBlock.value.push(this.issuerName.toSchema()),this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.objectDigestInfo&&e.valueBlock.value.push(new ae({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}};nB.CLASS_NAME="V2Form";var df="baseCertificateID",mf="entityName",gf="objectDigestInfo",Ise=[df,mf,gf],RA=class z1 extends Be{static{o(this,"Holder")}constructor(e={}){super(),df in e&&(this.baseCertificateID=D(e,df,z1.defaultValues(df))),mf in e&&(this.entityName=D(e,mf,z1.defaultValues(mf))),gf in e&&(this.objectDigestInfo=D(e,gf,z1.defaultValues(gf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case df:return new Ga;case mf:return new jn;case gf:return new ih;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({optional:!0,name:t.baseCertificateID||L,idBlock:{tagClass:3,tagNumber:0},value:Ga.schema().valueBlock.value}),new ae({optional:!0,name:t.entityName||L,idBlock:{tagClass:3,tagNumber:1},value:jn.schema().valueBlock.value}),new ae({optional:!0,name:t.objectDigestInfo||L,idBlock:{tagClass:3,tagNumber:2},value:ih.schema().valueBlock.value})]})}fromSchema(e){_e(e,Ise);let t=Ie(e,e,z1.schema({names:{baseCertificateID:df,entityName:mf,objectDigestInfo:gf}}));Ae.assertSchema(t,this.className),df in t.result&&(this.baseCertificateID=new Ga({schema:new W({value:t.result.baseCertificateID.valueBlock.value})})),mf in t.result&&(this.entityName=new jn({schema:new W({value:t.result.entityName.valueBlock.value})})),gf in t.result&&(this.objectDigestInfo=new ih({schema:new W({value:t.result.objectDigestInfo.valueBlock.value})}))}toSchema(){let e=new W;return this.baseCertificateID&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.baseCertificateID.toSchema().valueBlock.value})),this.entityName&&e.valueBlock.value.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.entityName.toSchema().valueBlock.value})),this.objectDigestInfo&&e.valueBlock.value.push(new ae({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}};RA.CLASS_NAME="Holder";var Y1="version",Q1="holder",Z1="issuer",ey="signature",ty="serialNumber",ry="attrCertValidityPeriod",ny="attributes",yf="issuerUniqueID",vf="extensions",Bse=[Y1,Q1,Z1,ey,ty,ry,ny,yf,vf],PA=class Zi extends Be{static{o(this,"AttributeCertificateInfoV2")}constructor(e={}){super(),this.version=D(e,Y1,Zi.defaultValues(Y1)),this.holder=D(e,Q1,Zi.defaultValues(Q1)),this.issuer=D(e,Z1,Zi.defaultValues(Z1)),this.signature=D(e,ey,Zi.defaultValues(ey)),this.serialNumber=D(e,ty,Zi.defaultValues(ty)),this.attrCertValidityPeriod=D(e,ry,Zi.defaultValues(ry)),this.attributes=D(e,ny,Zi.defaultValues(ny)),yf in e&&(this.issuerUniqueID=D(e,yf,Zi.defaultValues(yf))),vf in e&&(this.extensions=D(e,vf,Zi.defaultValues(vf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Y1:return 1;case Q1:return new RA;case Z1:return{};case ey:return new ge;case ty:return new me;case ry:return new sh;case ny:return[];case yf:return new qt;case vf:return new Sn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),RA.schema(t.holder||{}),new Or({value:[jn.schema({names:{blockName:t.issuer||L}}),new ae({name:t.issuer||L,idBlock:{tagClass:3,tagNumber:0},value:nB.schema().valueBlock.value})]}),ge.schema(t.signature||{}),new me({name:t.serialNumber||L}),sh.schema(t.attrCertValidityPeriod||{}),new W({name:t.attributes||L,value:[new Tt({value:en.schema()})]}),new qt({optional:!0,name:t.issuerUniqueID||L}),Sn.schema(t.extensions||{},!0)]})}fromSchema(e){_e(e,Bse);let t=Ie(e,e,Zi.schema({names:{version:Y1,holder:{names:{blockName:Q1}},issuer:Z1,signature:{names:{blockName:ey}},serialNumber:ty,attrCertValidityPeriod:{names:{blockName:ry}},attributes:ny,issuerUniqueID:yf,extensions:{names:{blockName:vf}}}}));switch(Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.holder=new RA({schema:t.result.holder}),t.result.issuer.idBlock.tagClass){case 3:this.issuer=new nB({schema:new W({value:t.result.issuer.valueBlock.value})});break;case 1:default:throw new Error("Incorrect value for 'issuer' in AttributeCertificateInfoV2")}this.signature=new ge({schema:t.result.signature}),this.serialNumber=t.result.serialNumber,this.attrCertValidityPeriod=new sh({schema:t.result.attrCertValidityPeriod}),this.attributes=Array.from(t.result.attributes.valueBlock.value,n=>new en({schema:n})),yf in t.result&&(this.issuerUniqueID=t.result.issuerUniqueID),vf in t.result&&(this.extensions=new Sn({schema:t.result.extensions}))}toSchema(){let e=new W({value:[new me({value:this.version}),this.holder.toSchema(),new ae({idBlock:{tagClass:3,tagNumber:0},value:this.issuer.toSchema().valueBlock.value}),this.signature.toSchema(),this.serialNumber,this.attrCertValidityPeriod.toSchema(),new W({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}};PA.CLASS_NAME="AttributeCertificateInfoV2";var sy="acinfo",iy="signatureAlgorithm",ay="signatureValue",Dse=[sy,iy,ay],Yl=class oy extends Be{static{o(this,"AttributeCertificateV2")}constructor(e={}){super(),this.acinfo=D(e,sy,oy.defaultValues(sy)),this.signatureAlgorithm=D(e,iy,oy.defaultValues(iy)),this.signatureValue=D(e,ay,oy.defaultValues(ay)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case sy:return new PA;case iy:return new ge;case ay:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[PA.schema(t.acinfo||{}),ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signatureValue||L})]})}fromSchema(e){_e(e,Dse);let t=Ie(e,e,oy.schema({names:{acinfo:{names:{blockName:sy}},signatureAlgorithm:{names:{blockName:iy}},signatureValue:ay}}));Ae.assertSchema(t,this.className),this.acinfo=new PA({schema:t.result.acinfo}),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}toSchema(){return new W({value:[this.acinfo.toSchema(),this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){return{acinfo:this.acinfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()}}};Yl.CLASS_NAME="AttributeCertificateV2";var wf="contentType",td="content",_se=[wf,td],Wr=class OA extends Be{static{o(this,"ContentInfo")}constructor(e={}){super(),this.contentType=D(e,wf,OA.defaultValues(wf)),this.content=D(e,td,OA.defaultValues(td)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wf:return L;case td:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case wf:return typeof t=="string"&&t===this.defaultValues(wf);case td:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return"optional"in t||(t.optional=!1),new W({name:t.blockName||"ContentInfo",optional:t.optional,value:[new rt({name:t.contentType||wf}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.content||td})]})]})}fromSchema(e){_e(e,_se);let t=Ie(e,e,OA.schema());Ae.assertSchema(t,this.className),this.contentType=t.result.contentType.valueBlock.toString(),this.content=t.result.content}toSchema(){return new W({value:[new rt({value:this.contentType}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.content]})]})}toJSON(){let e={contentType:this.contentType};return this.content instanceof St||(e.content=this.content.toJSON()),e}};Wr.CLASS_NAME="ContentInfo";Wr.DATA=jB;Wr.SIGNED_DATA=xU;Wr.ENVELOPED_DATA=NU;Wr.ENCRYPTED_DATA=TU;var cI="type",fI="value",sB="utcTimeName",iB="generalTimeName",Rse=[sB,iB],cU;(function(r){r[r.UTCTime=0]="UTCTime",r[r.GeneralizedTime=1]="GeneralizedTime",r[r.empty=2]="empty"})(cU||(cU={}));var Fn=class kA extends Be{static{o(this,"Time")}constructor(e={}){super(),this.type=D(e,cI,kA.defaultValues(cI)),this.value=D(e,fI,kA.defaultValues(fI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case cI:return 0;case fI:return new Date(0,0,0);default:return super.defaultValues(e)}}static schema(e={},t=!1){let n=D(e,"names",{});return new Or({optional:t,value:[new Lc({name:n.utcTimeName||L}),new Pr({name:n.generalTimeName||L})]})}fromSchema(e){_e(e,Rse);let t=Ie(e,e,kA.schema({names:{utcTimeName:sB,generalTimeName:iB}}));Ae.assertSchema(t,this.className),sB in t.result&&(this.type=0,this.value=t.result.utcTimeName.toDate()),iB in t.result&&(this.type=1,this.value=t.result.generalTimeName.toDate())}toSchema(){return this.type===0?new Lc({valueDate:this.value}):this.type===1?new Pr({valueDate:this.value}):{}}toJSON(){return{type:this.type,value:this.value}}};Fn.CLASS_NAME="Time";var hI="tbs",bl="version",LA="serialNumber",VA="signature",UA="issuer",MA="notBefore",jA="notAfter",FA="subject",qA="subjectPublicKeyInfo",uy="issuerUniqueID",ly="subjectUniqueID",cy="extensions",fy="signatureAlgorithm",hy="signatureValue",Zs="tbsCertificate",BC=`${Zs}.${bl}`,KB=`${Zs}.${LA}`,$B=`${Zs}.${VA}`,XB=`${Zs}.${UA}`,DC=`${Zs}.${MA}`,_C=`${Zs}.${jA}`,GB=`${Zs}.${FA}`,WB=`${Zs}.${qA}`,RC=`${Zs}.${uy}`,PC=`${Zs}.${ly}`,sv=`${Zs}.${cy}`,Pse=[Zs,BC,KB,$B,XB,DC,_C,GB,WB,RC,PC,sv,fy,hy];function Ose(r={}){let e=D(r,"names",{});return new W({name:e.blockName||Zs,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:e.tbsCertificateVersion||BC})]}),new me({name:e.tbsCertificateSerialNumber||KB}),ge.schema(e.signature||{names:{blockName:$B}}),kr.schema(e.issuer||{names:{blockName:XB}}),new W({name:e.tbsCertificateValidity||"tbsCertificate.validity",value:[Fn.schema(e.notBefore||{names:{utcTimeName:DC,generalTimeName:DC}}),Fn.schema(e.notAfter||{names:{utcTimeName:_C,generalTimeName:_C}})]}),kr.schema(e.subject||{names:{blockName:GB}}),sa.schema(e.subjectPublicKeyInfo||{names:{blockName:WB}}),new gt({name:e.tbsCertificateIssuerUniqueID||RC,optional:!0,idBlock:{tagClass:3,tagNumber:1}}),new gt({name:e.tbsCertificateSubjectUniqueID||PC,optional:!0,idBlock:{tagClass:3,tagNumber:2}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:3},value:[Sn.schema(e.extensions||{names:{blockName:sv}})]})]})}o(Ose,"tbsCertificate");var rs=class wn extends Be{static{o(this,"Certificate")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,hI,wn.defaultValues(hI))),this.version=D(e,bl,wn.defaultValues(bl)),this.serialNumber=D(e,LA,wn.defaultValues(LA)),this.signature=D(e,VA,wn.defaultValues(VA)),this.issuer=D(e,UA,wn.defaultValues(UA)),this.notBefore=D(e,MA,wn.defaultValues(MA)),this.notAfter=D(e,jA,wn.defaultValues(jA)),this.subject=D(e,FA,wn.defaultValues(FA)),this.subjectPublicKeyInfo=D(e,qA,wn.defaultValues(qA)),uy in e&&(this.issuerUniqueID=D(e,uy,wn.defaultValues(uy))),ly in e&&(this.subjectUniqueID=D(e,ly,wn.defaultValues(ly))),cy in e&&(this.extensions=D(e,cy,wn.defaultValues(cy))),this.signatureAlgorithm=D(e,fy,wn.defaultValues(fy)),this.signatureValue=D(e,hy,wn.defaultValues(hy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case hI:return Zr;case bl:return 0;case LA:return new me;case VA:return new ge;case UA:return new kr;case MA:return new Fn;case jA:return new Fn;case FA:return new kr;case qA:return new sa;case uy:return Zr;case ly:return Zr;case cy:return[];case fy:return new ge;case hy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Ose(t.tbsCertificate),ge.schema(t.signatureAlgorithm||{names:{blockName:fy}}),new qt({name:t.signatureValue||hy})]})}fromSchema(e){_e(e,Pse);let t=Ie(e,e,wn.schema({names:{tbsCertificate:{names:{extensions:{names:{extensions:sv}}}}}}));Ae.assertSchema(t,this.className),this.tbsView=t.result.tbsCertificate.valueBeforeDecodeView,BC in t.result&&(this.version=t.result[BC].valueBlock.valueDec),this.serialNumber=t.result[KB],this.signature=new ge({schema:t.result[$B]}),this.issuer=new kr({schema:t.result[XB]}),this.notBefore=new Fn({schema:t.result[DC]}),this.notAfter=new Fn({schema:t.result[_C]}),this.subject=new kr({schema:t.result[GB]}),this.subjectPublicKeyInfo=new sa({schema:t.result[WB]}),RC in t.result&&(this.issuerUniqueID=t.result[RC].valueBlock.valueHex),PC in t.result&&(this.subjectUniqueID=t.result[PC].valueBlock.valueHex),sv in t.result&&(this.extensions=Array.from(t.result[sv],n=>new Ri({schema:n}))),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[];return bl in this&&this.version!==wn.defaultValues(bl)&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),e.push(this.serialNumber),e.push(this.signature.toSchema()),e.push(this.issuer.toSchema()),e.push(new W({value:[this.notBefore.toSchema(),this.notAfter.toSchema()]})),e.push(this.subject.toSchema()),e.push(this.subjectPublicKeyInfo.toSchema()),this.issuerUniqueID&&e.push(new gt({optional:!0,idBlock:{tagClass:3,tagNumber:1},valueHex:this.issuerUniqueID})),this.subjectUniqueID&&e.push(new gt({optional:!0,idBlock:{tagClass:3,tagNumber:2},valueHex:this.subjectUniqueID})),this.extensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:3},value:[new W({value:Array.from(this.extensions,t=>t.toSchema())})]})),new W({value:e})}toSchema(e=!1){let t;if(e===!1){if(!this.tbsView.byteLength)return wn.schema().value[0];let n=Kr(this.tbsView);Ae.assert(n,"TBS Certificate"),t=n.result}else t=this.encodeTBS();return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.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 bl in this&&this.version!==wn.defaultValues(bl)&&(e.version=this.version),this.issuerUniqueID&&(e.issuerUniqueID=Ct.ToHex(this.issuerUniqueID)),this.subjectUniqueID&&(e.subjectUniqueID=Ct.ToHex(this.subjectUniqueID)),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}async getPublicKey(e,t=_t(!0)){return t.getPublicKey(this.subjectPublicKeyInfo,this.signatureAlgorithm,e)}async getKeyHash(e="SHA-1",t=_t(!0)){return t.digest({name:e},this.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView)}async sign(e,t="SHA-1",n=_t(!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 qt({valueHex:a})}async verify(e,t=_t(!0)){let n;if(e?n=e.subjectPublicKeyInfo:this.issuer.isEqual(this.subject)&&(n=this.subjectPublicKeyInfo),!(n instanceof sa))throw new Error("Please provide issuer certificate as a parameter");return t.verifyWithPublicKey(this.tbsView,this.signatureValue,n,this.signatureAlgorithm)}};rs.CLASS_NAME="Certificate";function $U(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===LB&&n.parsedValue instanceof HB&&n.parsedValue.cA){t=!0;break}}return t?r:null}o($U,"checkCA");var rd="certId",nd="certValue",Pp="parsedValue",kse=[rd,nd],XU=class py extends Be{static{o(this,"CertBag")}constructor(e={}){super(),this.certId=D(e,rd,py.defaultValues(rd)),this.certValue=D(e,nd,py.defaultValues(nd)),Pp in e&&(this.parsedValue=D(e,Pp,py.defaultValues(Pp))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case rd:return L;case nd:return new St;case Pp:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case rd:return t===L;case nd:return t instanceof St;case Pp:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,kse);let t=Ie(e,e,py.schema({names:{id:rd,value:nd}}));Ae.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 X6:try{this.parsedValue=rs.fromBER(n)}catch{Yl.fromBER(n)}break;case G6:this.parsedValue=Yl.fromBER(n);break;case Une:default:throw new Error(`Incorrect CERT_ID value in CertBag: ${this.certId}`)}}toSchema(){return Pp in this&&("acinfo"in this.parsedValue?this.certId=G6:this.certId=X6,this.certValue=new Ve({valueHex:this.parsedValue.toSchema().toBER(!1)})),new W({value:[new rt({value:this.certId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:["toSchema"in this.certValue?this.certValue.toSchema():this.certValue]})]})}toJSON(){return{certId:this.certId,certValue:this.certValue.toJSON()}}};XU.CLASS_NAME="CertBag";var dy="userCertificate",sd="revocationDate",Sf="crlEntryExtensions",Lse=[dy,sd,Sf],GU=class my extends Be{static{o(this,"RevokedCertificate")}constructor(e={}){super(),this.userCertificate=D(e,dy,my.defaultValues(dy)),this.revocationDate=D(e,sd,my.defaultValues(sd)),Sf in e&&(this.crlEntryExtensions=D(e,Sf,my.defaultValues(Sf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case dy:return new me;case sd:return new Fn;case Sf:return new Sn;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.userCertificate||dy}),Fn.schema({names:{utcTimeName:t.revocationDate||sd,generalTimeName:t.revocationDate||sd}}),Sn.schema({names:{blockName:t.crlEntryExtensions||Sf}},!0)]})}fromSchema(e){_e(e,Lse);let t=Ie(e,e,my.schema());Ae.assertSchema(t,this.className),this.userCertificate=t.result.userCertificate,this.revocationDate=new Fn({schema:t.result.revocationDate}),Sf in t.result&&(this.crlEntryExtensions=new Sn({schema:t.result.crlEntryExtensions}))}toSchema(){let e=[this.userCertificate,this.revocationDate.toSchema()];return this.crlEntryExtensions&&e.push(this.crlEntryExtensions.toSchema()),new W({value:e})}toJSON(){let e={userCertificate:this.userCertificate.toJSON(),revocationDate:this.revocationDate.toJSON()};return this.crlEntryExtensions&&(e.crlEntryExtensions=this.crlEntryExtensions.toJSON()),e}};GU.CLASS_NAME="RevokedCertificate";var pI="tbs",xg="version",dI="signature",mI="issuer",gI="thisUpdate",JE="nextUpdate",zE="revokedCertificates",YE="crlExtensions",gy="signatureAlgorithm",yy="signatureValue",zo="tbsCertList",OC=`${zo}.version`,JB=`${zo}.signature`,zB=`${zo}.issuer`,kC=`${zo}.thisUpdate`,hv=`${zo}.nextUpdate`,LC=`${zo}.revokedCertificates`,VC=`${zo}.extensions`,Vse=[zo,OC,JB,zB,kC,hv,LC,VC,gy,yy];function Use(r={}){let e=D(r,"names",{});return new W({name:e.blockName||zo,value:[new me({optional:!0,name:e.tbsCertListVersion||OC,value:2}),ge.schema(e.signature||{names:{blockName:JB}}),kr.schema(e.issuer||{names:{blockName:zB}}),Fn.schema(e.tbsCertListThisUpdate||{names:{utcTimeName:kC,generalTimeName:kC}}),Fn.schema(e.tbsCertListNextUpdate||{names:{utcTimeName:hv,generalTimeName:hv}},!0),new W({optional:!0,value:[new Tt({name:e.tbsCertListRevokedCertificates||LC,value:new W({value:[new me,Fn.schema(),Sn.schema({},!0)]})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Sn.schema(e.crlExtensions||{names:{blockName:VC}})]})]})}o(Use,"tbsCertList");var Mse=[UB,yU,xne,Nne,vU,VB,MB,Tne,Ine,wU],pv=class ms extends Be{static{o(this,"CertificateRevocationList")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,pI,ms.defaultValues(pI))),this.version=D(e,xg,ms.defaultValues(xg)),this.signature=D(e,dI,ms.defaultValues(dI)),this.issuer=D(e,mI,ms.defaultValues(mI)),this.thisUpdate=D(e,gI,ms.defaultValues(gI)),JE in e&&(this.nextUpdate=D(e,JE,ms.defaultValues(JE))),zE in e&&(this.revokedCertificates=D(e,zE,ms.defaultValues(zE))),YE in e&&(this.crlExtensions=D(e,YE,ms.defaultValues(YE))),this.signatureAlgorithm=D(e,gy,ms.defaultValues(gy)),this.signatureValue=D(e,yy,ms.defaultValues(yy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case pI:return Zr;case xg:return 0;case dI:return new ge;case mI:return new kr;case gI:return new Fn;case JE:return new Fn;case zE:return[];case YE:return new Sn;case gy:return new ge;case yy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"CertificateList",value:[Use(e),ge.schema(t.signatureAlgorithm||{names:{blockName:gy}}),new qt({name:t.signatureValue||yy})]})}fromSchema(e){_e(e,Vse);let t=Ie(e,e,ms.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.tbsCertList.valueBeforeDecodeView,OC in t.result&&(this.version=t.result[OC].valueBlock.valueDec),this.signature=new ge({schema:t.result[JB]}),this.issuer=new kr({schema:t.result[zB]}),this.thisUpdate=new Fn({schema:t.result[kC]}),hv in t.result&&(this.nextUpdate=new Fn({schema:t.result[hv]})),LC in t.result&&(this.revokedCertificates=Array.from(t.result[LC],n=>new GU({schema:n}))),VC in t.result&&(this.crlExtensions=new Sn({schema:t.result[VC]})),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[];return this.version!==ms.defaultValues(xg)&&e.push(new me({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 W({value:Array.from(this.revokedCertificates,t=>t.toSchema())})),this.crlExtensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.crlExtensions.toSchema()]})),new W({value:e})}toSchema(e=!1){let t;if(e)t=this.encodeTBS();else{if(!this.tbsView.byteLength)return ms.schema();let n=Kr(this.tbsView);Ae.assert(n,"TBS Certificate Revocation List"),t=n.result}return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.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!==ms.defaultValues(xg)&&(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=_t(!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 qt({valueHex:a})}async verify(e={},t=_t(!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&&!Mse.includes(s.extnID))return!1}return t.verifyWithPublicKey(this.tbsView,this.signatureValue,n,this.signatureAlgorithm)}};pv.CLASS_NAME="CertificateRevocationList";var id="crlId",ad="crlValue",Ng="parsedValue",jse=[id,ad],WU=class vy extends Be{static{o(this,"CRLBag")}constructor(e={}){super(),this.crlId=D(e,id,vy.defaultValues(id)),this.crlValue=D(e,ad,vy.defaultValues(ad)),Ng in e&&(this.parsedValue=D(e,Ng,vy.defaultValues(Ng))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case id:return L;case ad:return new St;case Ng:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case id:return t===L;case ad:return t instanceof St;case Ng:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,jse);let t=Ie(e,e,vy.schema({names:{id,value:ad}}));switch(Ae.assertSchema(t,this.className),this.crlId=t.result.crlId.valueBlock.toString(),this.crlValue=t.result.crlValue,this.crlId){case W6:this.parsedValue=pv.fromBER(this.certValue.valueBlock.valueHex);break;default:throw new Error(`Incorrect CRL_ID value in CRLBag: ${this.crlId}`)}}toSchema(){return this.parsedValue&&(this.crlId=W6,this.crlValue=new Ve({valueHex:this.parsedValue.toSchema().toBER(!1)})),new W({value:[new rt({value:this.crlId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.crlValue.toSchema()]})]})}toJSON(){return{crlId:this.crlId,crlValue:this.crlValue.toJSON()}}};WU.CLASS_NAME="CRLBag";var od="version",ud="encryptedContentInfo",xl="unprotectedAttrs",Fse=[od,ud,xl],dv=class wy extends Be{static{o(this,"EncryptedData")}constructor(e={}){super(),this.version=D(e,od,wy.defaultValues(od)),this.encryptedContentInfo=D(e,ud,wy.defaultValues(ud)),xl in e&&(this.unprotectedAttrs=D(e,xl,wy.defaultValues(xl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case od:return 0;case ud:return new ts;case xl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case od:return t===0;case ud:return ts.compareWithDefault("contentType",t.contentType)&&ts.compareWithDefault("contentEncryptionAlgorithm",t.contentEncryptionAlgorithm)&&ts.compareWithDefault("encryptedContent",t.encryptedContent);case xl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),ts.schema(t.encryptedContentInfo||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.unprotectedAttrs||L,value:en.schema()})]})]})}fromSchema(e){_e(e,Fse);let t=Ie(e,e,wy.schema({names:{version:od,encryptedContentInfo:{names:{blockName:ud}},unprotectedAttrs:xl}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.encryptedContentInfo=new ts({schema:t.result.encryptedContentInfo}),xl in t.result&&(this.unprotectedAttrs=Array.from(t.result.unprotectedAttrs,n=>new en({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(this.encryptedContentInfo.toSchema()),this.unprotectedAttrs&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.unprotectedAttrs,t=>t.toSchema())})),new W({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=_t(!0)){Ar.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=_t(!0)){Ar.assert(e,"parameters","object");let n={...e,encryptedContentInfo:this.encryptedContentInfo};return t.decryptEncryptedContentInfo(n)}};dv.CLASS_NAME="EncryptedData";var Ef="encryptionAlgorithm",Nl="encryptedData",Tg="parsedValue",qse=[Ef,Nl],JU=class ld extends Be{static{o(this,"PKCS8ShroudedKeyBag")}constructor(e={}){super(),this.encryptionAlgorithm=D(e,Ef,ld.defaultValues(Ef)),this.encryptedData=D(e,Nl,ld.defaultValues(Nl)),Tg in e&&(this.parsedValue=D(e,Tg,ld.defaultValues(Tg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ef:return new ge;case Nl:return new Ve;case Tg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ef:return ge.compareWithDefault("algorithmId",t.algorithmId)&&!("algorithmParams"in t);case Nl:return t.isEqual(ld.defaultValues(e));case Tg:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.encryptionAlgorithm||{names:{blockName:Ef}}),new Or({value:[new Ve({name:t.encryptedData||Nl}),new Ve({idBlock:{isConstructed:!0},name:t.encryptedData||Nl})]})]})}fromSchema(e){_e(e,qse);let t=Ie(e,e,ld.schema({names:{encryptionAlgorithm:{names:{blockName:Ef}},encryptedData:Nl}}));Ae.assertSchema(t,this.className),this.encryptionAlgorithm=new ge({schema:t.result.encryptionAlgorithm}),this.encryptedData=t.result.encryptedData}toSchema(){return new W({value:[this.encryptionAlgorithm.toSchema(),this.encryptedData]})}toJSON(){return{encryptionAlgorithm:this.encryptionAlgorithm.toJSON(),encryptedData:this.encryptedData.toJSON()}}async parseInternalValues(e,t=_t(!0)){let s=await new dv({encryptedContentInfo:new ts({contentEncryptionAlgorithm:this.encryptionAlgorithm,encryptedContent:this.encryptedData})}).decrypt(e,t);this.parsedValue=fv.fromBER(s)}async makeInternalValues(e,t=_t(!0)){if(!this.parsedValue)throw new Error('Please initialize "parsedValue" first');let n=new dv,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}};JU.CLASS_NAME="PKCS8ShroudedKeyBag";var cd="secretTypeId",fd="secretValue",Hse=[cd,fd],zU=class HA extends Be{static{o(this,"SecretBag")}constructor(e={}){super(),this.secretTypeId=D(e,cd,HA.defaultValues(cd)),this.secretValue=D(e,fd,HA.defaultValues(fd)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case cd:return L;case fd:return new St;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case cd:return t===L;case fd:return t instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.id||"id"}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.value||"value"})]})]})}fromSchema(e){_e(e,Hse);let t=Ie(e,e,HA.schema({names:{id:cd,value:fd}}));Ae.assertSchema(t,this.className),this.secretTypeId=t.result.secretTypeId.valueBlock.toString(),this.secretValue=t.result.secretValue}toSchema(){return new W({value:[new rt({value:this.secretTypeId}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.secretValue.toSchema()]})]})}toJSON(){return{secretTypeId:this.secretTypeId,secretValue:this.secretValue.toJSON()}}};zU.CLASS_NAME="SecretBag";var Kse=class Af{static{o(this,"SafeBagValueFactory")}static getItems(){return this.items||(this.items={},Af.register("1.2.840.113549.1.12.10.1.1",fv),Af.register("1.2.840.113549.1.12.10.1.2",JU),Af.register("1.2.840.113549.1.12.10.1.3",XU),Af.register("1.2.840.113549.1.12.10.1.4",WU),Af.register("1.2.840.113549.1.12.10.1.5",zU),Af.register("1.2.840.113549.1.12.10.1.6",v0)),this.items}static register(e,t){this.getItems()[e]=t}static find(e){return this.getItems()[e]||null}},Cf="bagId",bf="bagValue",Uo="bagAttributes",$se=[Cf,bf,Uo],aB=class Sy extends Be{static{o(this,"SafeBag")}constructor(e={}){super(),this.bagId=D(e,Cf,Sy.defaultValues(Cf)),this.bagValue=D(e,bf,Sy.defaultValues(bf)),Uo in e&&(this.bagAttributes=D(e,Uo,Sy.defaultValues(Uo))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Cf:return L;case bf:return new St;case Uo:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Cf:return t===L;case bf:return t instanceof St;case Uo:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.bagId||Cf}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.bagValue||bf})]}),new Xr({optional:!0,value:[new Tt({name:t.bagAttributes||Uo,value:en.schema()})]})]})}fromSchema(e){_e(e,$se);let t=Ie(e,e,Sy.schema({names:{bagId:Cf,bagValue:bf,bagAttributes:Uo}}));Ae.assertSchema(t,this.className),this.bagId=t.result.bagId.valueBlock.toString();let n=Kse.find(this.bagId);if(!n)throw new Error(`Invalid BAG_ID for SafeBag: ${this.bagId}`);this.bagValue=new n({schema:t.result.bagValue}),Uo in t.result&&(this.bagAttributes=Array.from(t.result.bagAttributes,s=>new en({schema:s})))}toSchema(){let e=[new rt({value:this.bagId}),new ae({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 W({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}};aB.CLASS_NAME="SafeBag";var Op="safeBags",v0=class oB extends Be{static{o(this,"SafeContents")}constructor(e={}){super(),this.safeBags=D(e,Op,oB.defaultValues(Op)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Op:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Op:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.safeBags||L,value:aB.schema()})]})}fromSchema(e){_e(e,[Op]);let t=Ie(e,e,oB.schema({names:{safeBags:Op}}));Ae.assertSchema(t,this.className),this.safeBags=Array.from(t.result.safeBags,n=>new aB({schema:n}))}toSchema(){return new W({value:Array.from(this.safeBags,e=>e.toSchema())})}toJSON(){return{safeBags:Array.from(this.safeBags,e=>e.toJSON())}}};v0.CLASS_NAME="SafeContents";var Ey="otherCertFormat",Ay="otherCert",Xse=[Ey,Ay],KA=class $A extends Be{static{o(this,"OtherCertificateFormat")}constructor(e={}){super(),this.otherCertFormat=D(e,Ey,$A.defaultValues(Ey)),this.otherCert=D(e,Ay,$A.defaultValues(Ay)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ey:return L;case Ay:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.otherCertFormat||Ey}),new St({name:t.otherCert||Ay})]})}fromSchema(e){_e(e,Xse);let t=Ie(e,e,$A.schema());Ae.assertSchema(t,this.className),this.otherCertFormat=t.result.otherCertFormat.valueBlock.toString(),this.otherCert=t.result.otherCert}toSchema(){return new W({value:[new rt({value:this.otherCertFormat}),this.otherCert]})}toJSON(){let e={otherCertFormat:this.otherCertFormat};return this.otherCert instanceof St||(e.otherCert=this.otherCert.toJSON()),e}},Cy="certificates",Gse=[Cy],ah=class uB extends Be{static{o(this,"CertificateSet")}constructor(e={}){super(),this.certificates=D(e,Cy,uB.defaultValues(Cy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Cy:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Xr({name:t.blockName||L,value:[new Tt({name:t.certificates||Cy,value:new Or({value:[rs.schema(),new ae({idBlock:{tagClass:3,tagNumber:0},value:[new St]}),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W]}),new ae({idBlock:{tagClass:3,tagNumber:2},value:Yl.schema().valueBlock.value}),new ae({idBlock:{tagClass:3,tagNumber:3},value:KA.schema().valueBlock.value})]})})]})}fromSchema(e){_e(e,Gse);let t=Ie(e,e,uB.schema());Ae.assertSchema(t,this.className),this.certificates=Array.from(t.result.certificates||[],n=>{let s=n.idBlock.tagNumber;if(n.idBlock.tagClass===1)return new rs({schema:n});let i=new W({value:n.valueBlock.value});switch(s){case 1:return i.valueBlock.value[0].valueBlock.value[0].valueBlock.valueDec===1?new Yl({schema:i}):new IC({schema:i});case 2:return new Yl({schema:i});case 3:return new KA({schema:i})}return n})}toSchema(){return new Xr({value:Array.from(this.certificates,e=>{switch(!0){case e instanceof rs:return e.toSchema();case e instanceof IC:return new ae({idBlock:{tagClass:3,tagNumber:1},value:e.toSchema().valueBlock.value});case e instanceof Yl:return new ae({idBlock:{tagClass:3,tagNumber:2},value:e.toSchema().valueBlock.value});case e instanceof KA:return new ae({idBlock:{tagClass:3,tagNumber:3},value:e.toSchema().valueBlock.value})}return e.toSchema()})})}toJSON(){return{certificates:Array.from(this.certificates,e=>e.toJSON())}}};ah.CLASS_NAME="CertificateSet";var by="otherRevInfoFormat",xy="otherRevInfo",Wse=[by,xy],iv=class XA extends Be{static{o(this,"OtherRevocationInfoFormat")}constructor(e={}){super(),this.otherRevInfoFormat=D(e,by,XA.defaultValues(by)),this.otherRevInfo=D(e,xy,XA.defaultValues(xy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case by:return L;case xy:return new St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.otherRevInfoFormat||by}),new St({name:t.otherRevInfo||xy})]})}fromSchema(e){_e(e,Wse);let t=Ie(e,e,XA.schema());Ae.assertSchema(t,this.className),this.otherRevInfoFormat=t.result.otherRevInfoFormat.valueBlock.toString(),this.otherRevInfo=t.result.otherRevInfo}toSchema(){return new W({value:[new rt({value:this.otherRevInfoFormat}),this.otherRevInfo]})}toJSON(){let e={otherRevInfoFormat:this.otherRevInfoFormat};return this.otherRevInfo instanceof St||(e.otherRevInfo=this.otherRevInfo.toJSON()),e}};iv.CLASS_NAME="OtherRevocationInfoFormat";var Ny="crls",yI="otherRevocationInfos",Jse=[Ny],av=class GA extends Be{static{o(this,"RevocationInfoChoices")}constructor(e={}){super(),this.crls=D(e,Ny,GA.defaultValues(Ny)),this.otherRevocationInfos=D(e,yI,GA.defaultValues(yI)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ny:return[];case yI:return[];default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Xr({name:t.blockName||L,value:[new Tt({name:t.crls||L,value:new Or({value:[pv.schema(),new ae({idBlock:{tagClass:3,tagNumber:1},value:[new rt,new St]})]})})]})}fromSchema(e){_e(e,Jse);let t=Ie(e,e,GA.schema({names:{crls:Ny}}));if(Ae.assertSchema(t,this.className),t.result.crls)for(let n of t.result.crls)n.idBlock.tagClass===1?this.crls.push(new pv({schema:n})):this.otherRevocationInfos.push(new iv({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())}}};av.CLASS_NAME="RevocationInfoChoices";var Ty="certs",xf="crls",zse=[Ty,xf],WA=class lB extends Be{static{o(this,"OriginatorInfo")}constructor(e={}){super(),this.crls=D(e,xf,lB.defaultValues(xf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Ty:return new ah;case xf:return new av;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Ty:return t.certificates.length===0;case xf:return t.crls.length===0&&t.otherRevocationInfos.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({name:t.certs||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ah.schema().valueBlock.value}),new ae({name:t.crls||L,optional:!0,idBlock:{tagClass:3,tagNumber:1},value:av.schema().valueBlock.value})]})}fromSchema(e){_e(e,zse);let t=Ie(e,e,lB.schema({names:{certs:Ty,crls:xf}}));Ae.assertSchema(t,this.className),Ty in t.result&&(this.certs=new ah({schema:new Xr({value:t.result.certs.valueBlock.value})})),xf in t.result&&(this.crls=new av({schema:new Xr({value:t.result.crls.valueBlock.value})}))}toSchema(){let e=[];return this.certs&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.certs.toSchema().valueBlock.value})),this.crls&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:this.crls.toSchema().valueBlock.value})),new W({value:e})}toJSON(){let e={};return this.certs&&(e.certs=this.certs.toJSON()),this.crls&&(e.crls=this.crls.toJSON()),e}};WA.CLASS_NAME="OriginatorInfo";var Iy="issuer",By="serialNumber",Yse=[Iy,By],qn=class JA extends Be{static{o(this,"IssuerAndSerialNumber")}constructor(e={}){super(),this.issuer=D(e,Iy,JA.defaultValues(Iy)),this.serialNumber=D(e,By,JA.defaultValues(By)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Iy:return new kr;case By:return new me;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[kr.schema(t.issuer||{}),new me({name:t.serialNumber||L})]})}fromSchema(e){_e(e,Yse);let t=Ie(e,e,JA.schema({names:{issuer:{names:{blockName:Iy}},serialNumber:By}}));Ae.assertSchema(t,this.className),this.issuer=new kr({schema:t.result.issuer}),this.serialNumber=t.result.serialNumber}toSchema(){return new W({value:[this.issuer.toSchema(),this.serialNumber]})}toJSON(){return{issuer:this.issuer.toJSON(),serialNumber:this.serialNumber.toJSON()}}};qn.CLASS_NAME="IssuerAndSerialNumber";var QE="variant",Ig="value",Qse=["blockName"],YU=class zA extends Be{static{o(this,"RecipientIdentifier")}constructor(e={}){super(),this.variant=D(e,QE,zA.defaultValues(QE)),Ig in e&&(this.value=D(e,Ig,zA.defaultValues(Ig))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case QE:return-1;case Ig:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case QE:return t===-1;case Ig:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Or({value:[qn.schema({names:{blockName:t.blockName||L}}),new gt({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:0}})]})}fromSchema(e){_e(e,Qse);let t=Ie(e,e,zA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new qn({schema:t.result.blockName})):(this.variant=2,this.value=new Ve({valueHex:t.result.blockName.valueBlock.valueHex}))}toSchema(){switch(this.variant){case 1:if(!(this.value instanceof qn))throw new Error("Incorrect type of RecipientIdentifier.value. It should be IssuerAndSerialNumber.");return this.value.toSchema();case 2:if(!(this.value instanceof Ve))throw new Error("Incorrect type of RecipientIdentifier.value. It should be ASN.1 OctetString.");return new gt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.value.valueBlock.valueHexView});default:return new St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2)&&this.value&&(e.value=this.value.toJSON()),e}};YU.CLASS_NAME="RecipientIdentifier";var Nf="version",hd="rid",pd="keyEncryptionAlgorithm",dd="encryptedKey",ZE="recipientCertificate",Zse=[Nf,hd,pd,dd],UC=class Mo extends Be{static{o(this,"KeyTransRecipientInfo")}constructor(e={}){super(),this.version=D(e,Nf,Mo.defaultValues(Nf)),this.rid=D(e,hd,Mo.defaultValues(hd)),this.keyEncryptionAlgorithm=D(e,pd,Mo.defaultValues(pd)),this.encryptedKey=D(e,dd,Mo.defaultValues(dd)),this.recipientCertificate=D(e,ZE,Mo.defaultValues(ZE)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Nf:return-1;case hd:return{};case pd:return new ge;case dd:return new Ve;case ZE:return new rs;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Nf:return t===Mo.defaultValues(Nf);case hd:return Object.keys(t).length===0;case pd:case dd:return t.isEqual(Mo.defaultValues(e));case ZE:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),YU.schema(t.rid||{}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,Zse);let t=Ie(e,e,Mo.schema({names:{version:Nf,rid:{names:{blockName:hd}},keyEncryptionAlgorithm:{names:{blockName:pd}},encryptedKey:dd}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,t.result.rid.idBlock.tagClass===3?this.rid=new Ve({valueHex:t.result.rid.valueBlock.valueHex}):this.rid=new qn({schema:t.result.rid}),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){let e=[];return this.rid instanceof qn?(this.version=0,e.push(new me({value:this.version})),e.push(this.rid.toSchema())):(this.version=2,e.push(new me({value:this.version})),e.push(new gt({idBlock:{tagClass:3,tagNumber:0},valueHex:this.rid.valueBlock.valueHexView}))),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.encryptedKey),new W({value:e})}toJSON(){return{version:this.version,rid:this.rid.toJSON(),keyEncryptionAlgorithm:this.keyEncryptionAlgorithm.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};UC.CLASS_NAME="KeyTransRecipientInfo";var md="algorithm",gd="publicKey",eie=[md,gd],MC=class Dy extends Be{static{o(this,"OriginatorPublicKey")}constructor(e={}){super(),this.algorithm=D(e,md,Dy.defaultValues(md)),this.publicKey=D(e,gd,Dy.defaultValues(gd)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case md:return new ge;case gd:return new qt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case md:case gd:return t.isEqual(Dy.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.algorithm||{}),new qt({name:t.publicKey||L})]})}fromSchema(e){_e(e,eie);let t=Ie(e,e,Dy.schema({names:{algorithm:{names:{blockName:md}},publicKey:gd}}));Ae.assertSchema(t,this.className),this.algorithm=new ge({schema:t.result.algorithm}),this.publicKey=t.result.publicKey}toSchema(){return new W({value:[this.algorithm.toSchema(),this.publicKey]})}toJSON(){return{algorithm:this.algorithm.toJSON(),publicKey:this.publicKey.toJSON()}}};MC.CLASS_NAME="OriginatorPublicKey";var eA="variant",Bg="value",tie=["blockName"],ov=class YA extends Be{static{o(this,"OriginatorIdentifierOrKey")}constructor(e={}){super(),this.variant=D(e,eA,YA.defaultValues(eA)),Bg in e&&(this.value=D(e,Bg,YA.defaultValues(Bg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case eA:return-1;case Bg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case eA:return t===-1;case Bg:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Or({value:[qn.schema({names:{blockName:t.blockName||L}}),new gt({idBlock:{tagClass:3,tagNumber:0},name:t.blockName||L}),new ae({idBlock:{tagClass:3,tagNumber:1},name:t.blockName||L,value:MC.schema().valueBlock.value})]})}fromSchema(e){_e(e,tie);let t=Ie(e,e,YA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new qn({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 MC({schema:new W({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 St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2||this.variant===3)&&(e.value=this.value.toJSON()),e}};ov.CLASS_NAME="OriginatorIdentifierOrKey";var yd="keyAttrId",qa="keyAttr",rie=[yd,qa],oh=class QA extends Be{static{o(this,"OtherKeyAttribute")}constructor(e={}){super(),this.keyAttrId=D(e,yd,QA.defaultValues(yd)),qa in e&&(this.keyAttr=D(e,qa,QA.defaultValues(qa))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case yd:return L;case qa:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case yd:return typeof t=="string"&&t===L;case qa:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({optional:t.optional||!0,name:t.blockName||L,value:[new rt({name:t.keyAttrId||L}),new St({optional:!0,name:t.keyAttr||L})]})}fromSchema(e){_e(e,rie);let t=Ie(e,e,QA.schema({names:{keyAttrId:yd,keyAttr:qa}}));Ae.assertSchema(t,this.className),this.keyAttrId=t.result.keyAttrId.valueBlock.toString(),qa in t.result&&(this.keyAttr=t.result.keyAttr)}toSchema(){let e=[];return e.push(new rt({value:this.keyAttrId})),qa in this&&e.push(this.keyAttr),new W({value:e})}toJSON(){let e={keyAttrId:this.keyAttrId};return qa in this&&(e.keyAttr=this.keyAttr.toJSON()),e}};oh.CLASS_NAME="OtherKeyAttribute";var Tf="subjectKeyIdentifier",Tl="date",Il="other",nie=[Tf,Tl,Il],jC=class vd extends Be{static{o(this,"RecipientKeyIdentifier")}constructor(e={}){super(),this.subjectKeyIdentifier=D(e,Tf,vd.defaultValues(Tf)),Tl in e&&(this.date=D(e,Tl,vd.defaultValues(Tl))),Il in e&&(this.other=D(e,Il,vd.defaultValues(Il))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Tf:return new Ve;case Tl:return new Pr;case Il:return new oh;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Tf:return t.isEqual(vd.defaultValues(Tf));case Tl:return t.year===0&&t.month===0&&t.day===0&&t.hour===0&&t.minute===0&&t.second===0&&t.millisecond===0;case Il:return t.keyAttrId===L&&!("keyAttr"in t);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Ve({name:t.subjectKeyIdentifier||L}),new Pr({optional:!0,name:t.date||L}),oh.schema(t.other||{})]})}fromSchema(e){_e(e,nie);let t=Ie(e,e,vd.schema({names:{subjectKeyIdentifier:Tf,date:Tl,other:{names:{blockName:Il}}}}));Ae.assertSchema(t,this.className),this.subjectKeyIdentifier=t.result.subjectKeyIdentifier,Tl in t.result&&(this.date=t.result.date),Il in t.result&&(this.other=new oh({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 W({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}};jC.CLASS_NAME="RecipientKeyIdentifier";var tA="variant",rA="value",sie=["blockName"],S0=class ZA extends Be{static{o(this,"KeyAgreeRecipientIdentifier")}constructor(e={}){super(),this.variant=D(e,tA,ZA.defaultValues(tA)),this.value=D(e,rA,ZA.defaultValues(rA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case tA:return-1;case rA:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case tA:return t===-1;case rA:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Or({value:[qn.schema(t.issuerAndSerialNumber||{names:{blockName:t.blockName||L}}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:0},value:jC.schema(t.rKeyId||{names:{blockName:t.blockName||L}}).valueBlock.value})]})}fromSchema(e){_e(e,sie);let t=Ie(e,e,ZA.schema({names:{blockName:"blockName"}}));Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1?(this.variant=1,this.value=new qn({schema:t.result.blockName})):(this.variant=2,this.value=new jC({schema:new W({value:t.result.blockName.valueBlock.value})}))}toSchema(){switch(this.variant){case 1:return this.value.toSchema();case 2:return new ae({idBlock:{tagClass:3,tagNumber:0},value:this.value.toSchema().valueBlock.value});default:return new St}}toJSON(){let e={variant:this.variant};return(this.variant===1||this.variant===2)&&(e.value=this.value.toJSON()),e}};S0.CLASS_NAME="KeyAgreeRecipientIdentifier";var wd="rid",If="encryptedKey",iie=[wd,If],FC=class _y extends Be{static{o(this,"RecipientEncryptedKey")}constructor(e={}){super(),this.rid=D(e,wd,_y.defaultValues(wd)),this.encryptedKey=D(e,If,_y.defaultValues(If)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case wd:return new S0;case If:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case wd:return t.variant===-1&&!("value"in t);case If:return t.isEqual(_y.defaultValues(If));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[S0.schema(t.rid||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,iie);let t=Ie(e,e,_y.schema({names:{rid:{names:{blockName:wd}},encryptedKey:If}}));Ae.assertSchema(t,this.className),this.rid=new S0({schema:t.result.rid}),this.encryptedKey=t.result.encryptedKey}toSchema(){return new W({value:[this.rid.toSchema(),this.encryptedKey]})}toJSON(){return{rid:this.rid.toJSON(),encryptedKey:this.encryptedKey.toJSON()}}};FC.CLASS_NAME="RecipientEncryptedKey";var nA="encryptedKeys",QU="RecipientEncryptedKeys",aie=[QU],uv=class cB extends Be{static{o(this,"RecipientEncryptedKeys")}constructor(e={}){super(),this.encryptedKeys=D(e,nA,cB.defaultValues(nA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case nA:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case nA:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.RecipientEncryptedKeys||L,value:FC.schema()})]})}fromSchema(e){_e(e,aie);let t=Ie(e,e,cB.schema({names:{RecipientEncryptedKeys:QU}}));Ae.assertSchema(t,this.className),this.encryptedKeys=Array.from(t.result.RecipientEncryptedKeys,n=>new FC({schema:n}))}toSchema(){return new W({value:Array.from(this.encryptedKeys,e=>e.toSchema())})}toJSON(){return{encryptedKeys:Array.from(this.encryptedKeys,e=>e.toJSON())}}};uv.CLASS_NAME="RecipientEncryptedKeys";var Sd="version",Ed="originator",jo="ukm",Ad="keyEncryptionAlgorithm",Cd="recipientEncryptedKeys",sA="recipientCertificate",iA="recipientPublicKey",oie=[Sd,Ed,jo,Ad,Cd],qC=class Ha extends Be{static{o(this,"KeyAgreeRecipientInfo")}constructor(e={}){super(),this.version=D(e,Sd,Ha.defaultValues(Sd)),this.originator=D(e,Ed,Ha.defaultValues(Ed)),jo in e&&(this.ukm=D(e,jo,Ha.defaultValues(jo))),this.keyEncryptionAlgorithm=D(e,Ad,Ha.defaultValues(Ad)),this.recipientEncryptedKeys=D(e,Cd,Ha.defaultValues(Cd)),this.recipientCertificate=D(e,sA,Ha.defaultValues(sA)),this.recipientPublicKey=D(e,iA,Ha.defaultValues(iA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Sd:return 0;case Ed:return new ov;case jo:return new Ve;case Ad:return new ge;case Cd:return new uv;case sA:return new rs;case iA:return null;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Sd:return t===0;case Ed:return t.variant===-1&&!("value"in t);case jo:return t.isEqual(Ha.defaultValues(jo));case Ad:return t.algorithmId===L&&!("algorithmParams"in t);case Cd:return t.encryptedKeys.length===0;case sA:return!1;case iA:return!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({idBlock:{tagClass:3,tagNumber:0},value:[ov.schema(t.originator||{})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Ve({name:t.ukm||L})]}),ge.schema(t.keyEncryptionAlgorithm||{}),uv.schema(t.recipientEncryptedKeys||{})]})}fromSchema(e){_e(e,oie);let t=Ie(e,e,Ha.schema({names:{version:Sd,originator:{names:{blockName:Ed}},ukm:jo,keyEncryptionAlgorithm:{names:{blockName:Ad}},recipientEncryptedKeys:{names:{blockName:Cd}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.originator=new ov({schema:t.result.originator}),jo in t.result&&(this.ukm=t.result.ukm),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.recipientEncryptedKeys=new uv({schema:t.result.recipientEncryptedKeys})}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.originator.toSchema()]})),this.ukm&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[this.ukm]})),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.recipientEncryptedKeys.toSchema()),new W({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}};qC.CLASS_NAME="KeyAgreeRecipientInfo";var Bf="keyIdentifier",Bl="date",Dl="other",uie=[Bf,Bl,Dl],lv=class bd extends Be{static{o(this,"KEKIdentifier")}constructor(e={}){super(),this.keyIdentifier=D(e,Bf,bd.defaultValues(Bf)),Bl in e&&(this.date=D(e,Bl,bd.defaultValues(Bl))),Dl in e&&(this.other=D(e,Dl,bd.defaultValues(Dl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Bf:return new Ve;case Bl:return new Pr;case Dl:return new oh;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Bf:return t.isEqual(bd.defaultValues(Bf));case Bl:return t.year===0&&t.month===0&&t.day===0&&t.hour===0&&t.minute===0&&t.second===0&&t.millisecond===0;case Dl:return t.compareWithDefault("keyAttrId",t.keyAttrId)&&!("keyAttr"in t);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Ve({name:t.keyIdentifier||L}),new Pr({optional:!0,name:t.date||L}),oh.schema(t.other||{})]})}fromSchema(e){_e(e,uie);let t=Ie(e,e,bd.schema({names:{keyIdentifier:Bf,date:Bl,other:{names:{blockName:Dl}}}}));Ae.assertSchema(t,this.className),this.keyIdentifier=t.result.keyIdentifier,Bl in t.result&&(this.date=t.result.date),Dl in t.result&&(this.other=new oh({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 W({value:e})}toJSON(){let e={keyIdentifier:this.keyIdentifier.toJSON()};return this.date&&(e.date=this.date),this.other&&(e.other=this.other.toJSON()),e}};lv.CLASS_NAME="KEKIdentifier";var xd="version",Nd="kekid",Td="keyEncryptionAlgorithm",Df="encryptedKey",aA="preDefinedKEK",lie=[xd,Nd,Td,Df],HC=class Fo extends Be{static{o(this,"KEKRecipientInfo")}constructor(e={}){super(),this.version=D(e,xd,Fo.defaultValues(xd)),this.kekid=D(e,Nd,Fo.defaultValues(Nd)),this.keyEncryptionAlgorithm=D(e,Td,Fo.defaultValues(Td)),this.encryptedKey=D(e,Df,Fo.defaultValues(Df)),this.preDefinedKEK=D(e,aA,Fo.defaultValues(aA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case xd:return 0;case Nd:return new lv;case Td:return new ge;case Df:return new Ve;case aA:return Zr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case"KEKRecipientInfo":return t===Fo.defaultValues(xd);case Nd:return t.compareWithDefault("keyIdentifier",t.keyIdentifier)&&!("date"in t)&&!("other"in t);case Td:return t.algorithmId===L&&!("algorithmParams"in t);case Df:return t.isEqual(Fo.defaultValues(Df));case aA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),lv.schema(t.kekid||{}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,lie);let t=Ie(e,e,Fo.schema({names:{version:xd,kekid:{names:{blockName:Nd}},keyEncryptionAlgorithm:{names:{blockName:Td}},encryptedKey:Df}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.kekid=new lv({schema:t.result.kekid}),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){return new W({value:[new me({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()}}};HC.CLASS_NAME="KEKRecipientInfo";var Id="version",_l="keyDerivationAlgorithm",Bd="keyEncryptionAlgorithm",_f="encryptedKey",oA="password",cie=[Id,_l,Bd,_f],KC=class Rl extends Be{static{o(this,"PasswordRecipientinfo")}constructor(e={}){super(),this.version=D(e,Id,Rl.defaultValues(Id)),_l in e&&(this.keyDerivationAlgorithm=D(e,_l,Rl.defaultValues(_l))),this.keyEncryptionAlgorithm=D(e,Bd,Rl.defaultValues(Bd)),this.encryptedKey=D(e,_f,Rl.defaultValues(_f)),this.password=D(e,oA,Rl.defaultValues(oA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Id:return-1;case _l:return new ge;case Bd:return new ge;case _f:return new Ve;case oA:return Zr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Id:return t===-1;case _l:case Bd:return t.algorithmId===L&&!("algorithmParams"in t);case _f:return t.isEqual(Rl.defaultValues(_f));case oA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({name:t.keyDerivationAlgorithm||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ge.schema().valueBlock.value}),ge.schema(t.keyEncryptionAlgorithm||{}),new Ve({name:t.encryptedKey||L})]})}fromSchema(e){_e(e,cie);let t=Ie(e,e,Rl.schema({names:{version:Id,keyDerivationAlgorithm:_l,keyEncryptionAlgorithm:{names:{blockName:Bd}},encryptedKey:_f}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,_l in t.result&&(this.keyDerivationAlgorithm=new ge({schema:new W({value:t.result.keyDerivationAlgorithm.valueBlock.value})})),this.keyEncryptionAlgorithm=new ge({schema:t.result.keyEncryptionAlgorithm}),this.encryptedKey=t.result.encryptedKey}toSchema(){let e=[];return e.push(new me({value:this.version})),this.keyDerivationAlgorithm&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:this.keyDerivationAlgorithm.toSchema().valueBlock.value})),e.push(this.keyEncryptionAlgorithm.toSchema()),e.push(this.encryptedKey),new W({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}};KC.CLASS_NAME="PasswordRecipientInfo";var Dd="oriType",Rf="oriValue",fie=[Dd,Rf],fB=class Ry extends Be{static{o(this,"OtherRecipientInfo")}constructor(e={}){super(),this.oriType=D(e,Dd,Ry.defaultValues(Dd)),this.oriValue=D(e,Rf,Ry.defaultValues(Rf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Dd:return L;case Rf:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Dd:return t===L;case Rf:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.oriType||L}),new St({name:t.oriValue||L})]})}fromSchema(e){_e(e,fie);let t=Ie(e,e,Ry.schema({names:{oriType:Dd,oriValue:Rf}}));Ae.assertSchema(t,this.className),this.oriType=t.result.oriType.valueBlock.toString(),this.oriValue=t.result.oriValue}toSchema(){return new W({value:[new rt({value:this.oriType}),this.oriValue]})}toJSON(){let e={oriType:this.oriType};return Ry.compareWithDefault(Rf,this.oriValue)||(e.oriValue=this.oriValue.toJSON()),e}};fB.CLASS_NAME="OtherRecipientInfo";var uA="variant",Dg="value",hie=["blockName"],Pf=class Py extends Be{static{o(this,"RecipientInfo")}constructor(e={}){super(),this.variant=D(e,uA,Py.defaultValues(uA)),Dg in e&&(this.value=D(e,Dg,Py.defaultValues(Dg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case uA:return-1;case Dg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case uA:return t===Py.defaultValues(e);case Dg:return Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new Or({value:[UC.schema({names:{blockName:t.blockName||L}}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:1},value:qC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:2},value:HC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:3},value:KC.schema().valueBlock.value}),new ae({name:t.blockName||L,idBlock:{tagClass:3,tagNumber:4},value:fB.schema().valueBlock.value})]})}fromSchema(e){_e(e,hie);let t=Ie(e,e,Py.schema({names:{blockName:"blockName"}}));if(Ae.assertSchema(t,this.className),t.result.blockName.idBlock.tagClass===1)this.variant=1,this.value=new UC({schema:t.result.blockName});else{let n=new W({value:t.result.blockName.valueBlock.value});switch(t.result.blockName.idBlock.tagNumber){case 1:this.variant=2,this.value=new qC({schema:n});break;case 2:this.variant=3,this.value=new HC({schema:n});break;case 3:this.variant=4,this.value=new KC({schema:n});break;case 4:this.variant=5,this.value=new fB({schema:n});break;default:throw new Error("Incorrect structure of RecipientInfo block")}}}toSchema(){fr.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 St}}toJSON(){let e={variant:this.variant};return this.value&&this.variant>=1&&this.variant<=4&&(e.value=this.value.toJSON()),e}};Pf.CLASS_NAME="RecipientInfo";var Pl="hashAlgorithm",Ol="maskGenAlgorithm",kl="pSourceAlgorithm",pie=[Pl,Ol,kl],eC=class ea extends Be{static{o(this,"RSAESOAEPParams")}constructor(e={}){super(),this.hashAlgorithm=D(e,Pl,ea.defaultValues(Pl)),this.maskGenAlgorithm=D(e,Ol,ea.defaultValues(Ol)),this.pSourceAlgorithm=D(e,kl,ea.defaultValues(kl)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Pl:return new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new $r});case Ol:return new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:new ge({algorithmId:"1.3.14.3.2.26",algorithmParams:new $r}).toSchema()});case kl:return new ge({algorithmId:"1.2.840.113549.1.1.9",algorithmParams:new Ve({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=D(e,"names",{});return new W({name:t.blockName||L,value:[new ae({idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[ge.schema(t.hashAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:1},optional:!0,value:[ge.schema(t.maskGenAlgorithm||{})]}),new ae({idBlock:{tagClass:3,tagNumber:2},optional:!0,value:[ge.schema(t.pSourceAlgorithm||{})]})]})}fromSchema(e){_e(e,pie);let t=Ie(e,e,ea.schema({names:{hashAlgorithm:{names:{blockName:Pl}},maskGenAlgorithm:{names:{blockName:Ol}},pSourceAlgorithm:{names:{blockName:kl}}}}));Ae.assertSchema(t,this.className),Pl in t.result&&(this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm})),Ol in t.result&&(this.maskGenAlgorithm=new ge({schema:t.result.maskGenAlgorithm})),kl in t.result&&(this.pSourceAlgorithm=new ge({schema:t.result.pSourceAlgorithm}))}toSchema(){let e=[];return this.hashAlgorithm.isEqual(ea.defaultValues(Pl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.hashAlgorithm.toSchema()]})),this.maskGenAlgorithm.isEqual(ea.defaultValues(Ol))||e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.maskGenAlgorithm.toSchema()]})),this.pSourceAlgorithm.isEqual(ea.defaultValues(kl))||e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.pSourceAlgorithm.toSchema()]})),new W({value:e})}toJSON(){let e={};return this.hashAlgorithm.isEqual(ea.defaultValues(Pl))||(e.hashAlgorithm=this.hashAlgorithm.toJSON()),this.maskGenAlgorithm.isEqual(ea.defaultValues(Ol))||(e.maskGenAlgorithm=this.maskGenAlgorithm.toJSON()),this.pSourceAlgorithm.isEqual(ea.defaultValues(kl))||(e.pSourceAlgorithm=this.pSourceAlgorithm.toJSON()),e}};eC.CLASS_NAME="RSAESOAEPParams";var _d="keyInfo",Ll="entityUInfo",Rd="suppPubInfo",die=[_d,Ll,Rd],hB=class Pd extends Be{static{o(this,"ECCCMSSharedInfo")}constructor(e={}){super(),this.keyInfo=D(e,_d,Pd.defaultValues(_d)),Ll in e&&(this.entityUInfo=D(e,Ll,Pd.defaultValues(Ll))),this.suppPubInfo=D(e,Rd,Pd.defaultValues(Rd)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case _d:return new ge;case Ll:return new Ve;case Rd:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case _d:case Ll:case Rd:return t.isEqual(Pd.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.keyInfo||{}),new ae({name:t.entityUInfo||L,idBlock:{tagClass:3,tagNumber:0},optional:!0,value:[new Ve]}),new ae({name:t.suppPubInfo||L,idBlock:{tagClass:3,tagNumber:2},value:[new Ve]})]})}fromSchema(e){_e(e,die);let t=Ie(e,e,Pd.schema({names:{keyInfo:{names:{blockName:_d}},entityUInfo:Ll,suppPubInfo:Rd}}));Ae.assertSchema(t,this.className),this.keyInfo=new ge({schema:t.result.keyInfo}),Ll 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 ae({idBlock:{tagClass:3,tagNumber:0},value:[this.entityUInfo]})),e.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.suppPubInfo]})),new W({value:e})}toJSON(){let e={keyInfo:this.keyInfo.toJSON(),suppPubInfo:this.suppPubInfo.toJSON()};return this.entityUInfo&&(e.entityUInfo=this.entityUInfo.toJSON()),e}};hB.CLASS_NAME="ECCCMSSharedInfo";var Od="version",Vl="originatorInfo",kd="recipientInfos",Ld="encryptedContentInfo",Ul="unprotectedAttrs",mie=[Od,Vl,kd,Ld,Ul],fU={kdfAlgorithm:"SHA-512",kekEncryptionLength:256},gie={"P-256":256,"P-384":384,"P-521":528},pB=class Ml extends Be{static{o(this,"EnvelopedData")}constructor(e={}){super(),this.version=D(e,Od,Ml.defaultValues(Od)),Vl in e&&(this.originatorInfo=D(e,Vl,Ml.defaultValues(Vl))),this.recipientInfos=D(e,kd,Ml.defaultValues(kd)),this.encryptedContentInfo=D(e,Ld,Ml.defaultValues(Ld)),Ul in e&&(this.unprotectedAttrs=D(e,Ul,Ml.defaultValues(Ul))),this.policy={disableSplit:!!e.disableSplit},e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Od:return 0;case Vl:return new WA;case kd:return[];case Ld:return new ts;case Ul:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Od:return t===Ml.defaultValues(e);case Vl:return t.certs.certificates.length===0&&t.crls.crls.length===0;case kd:case Ul:return t.length===0;case Ld:return ts.compareWithDefault("contentType",t.contentType)&&ts.compareWithDefault("contentEncryptionAlgorithm",t.contentEncryptionAlgorithm)&&ts.compareWithDefault("encryptedContent",t.encryptedContent);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||L}),new ae({name:t.originatorInfo||L,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:WA.schema().valueBlock.value}),new Xr({value:[new Tt({name:t.recipientInfos||L,value:Pf.schema()})]}),ts.schema(t.encryptedContentInfo||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.unprotectedAttrs||L,value:en.schema()})]})]})}fromSchema(e){_e(e,mie);let t=Ie(e,e,Ml.schema({names:{version:Od,originatorInfo:Vl,recipientInfos:kd,encryptedContentInfo:{names:{blockName:Ld}},unprotectedAttrs:Ul}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,Vl in t.result&&(this.originatorInfo=new WA({schema:new W({value:t.result.originatorInfo.valueBlock.value})})),this.recipientInfos=Array.from(t.result.recipientInfos,n=>new Pf({schema:n})),this.encryptedContentInfo=new ts({schema:t.result.encryptedContentInfo}),Ul in t.result&&(this.unprotectedAttrs=Array.from(t.result.unprotectedAttrs,n=>new en({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),this.originatorInfo&&e.push(new ae({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 ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.unprotectedAttrs,t=>t.toSchema())})),new W({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=_t(!0)){let i=Object.assign({useOAEP:!0,oaepHashAlgorithm:"SHA-512"},fU,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,u;if(i.useOAEP===!0){a=s.getOIDByAlgorithm({name:"RSA-OAEP"},!0,"keyEncryptionAlgorithm");let f=s.getOIDByAlgorithm({name:i.oaepHashAlgorithm},!0,"RSAES-OAEP-params"),h=new ge({algorithmId:f,algorithmParams:new $r});u=new eC({hashAlgorithm:h,maskGenAlgorithm:new ge({algorithmId:"1.2.840.113549.1.1.8",algorithmParams:h.toSchema()})}).toSchema()}else{if(a=s.getOIDByAlgorithm({name:"RSAES-PKCS1-v1_5"}),a===L)throw new Error("Can not find OID for RSAES-PKCS1-v1_5");u=new $r}let l=new UC({version:0,rid:new qn({issuer:e.issuer,serialNumber:e.serialNumber}),keyEncryptionAlgorithm:new ge({algorithmId:a,algorithmParams:u}),recipientCertificate:e});this.recipientInfos.push(new Pf({variant:1,value:l}))}break;case 2:{let a=new S0({variant:1,value:new qn({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=_t(!0)){if(Ar.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 $r),n){case 1:{let i=s.getOIDByAlgorithm(t.keyEncryptionAlgorithm,!0,"keyEncryptionAlgorithm"),a=new HC({version:4,kekid:new lv({keyIdentifier:new Ve({valueHex:t.keyIdentifier})}),keyEncryptionAlgorithm:new ge({algorithmId:i,algorithmParams:t.keyEncryptionAlgorithmParams}),preDefinedKEK:e});this.recipientInfos.push(new Pf({variant:3,value:a}))}break;case 2:{let i=s.getOIDByAlgorithm({name:"PBKDF2"},!0,"keyDerivationAlgorithm"),a=new ArrayBuffer(64),u=new Uint8Array(a);s.getRandomValues(u);let l=s.getOIDByAlgorithm({name:"HMAC",hash:{name:t.hmacHashAlgorithm}},!0,"hmacHashAlgorithm"),f=new w0({salt:new Ve({valueHex:a}),iterationCount:t.iterationCount,prf:new ge({algorithmId:l,algorithmParams:new $r})}),h=s.getOIDByAlgorithm(t.keyEncryptionAlgorithm,!0,"keyEncryptionAlgorithm"),m=new KC({version:0,keyDerivationAlgorithm:new ge({algorithmId:i,algorithmParams:f.toSchema()}),keyEncryptionAlgorithm:new ge({algorithmId:h,algorithmParams:t.keyEncryptionAlgorithmParams}),password:e});this.recipientInfos.push(new Pf({variant:4,value:m}))}break;default:throw new Error(`Unknown value for "variant": ${n}`)}}addRecipientByKeyIdentifier(e,t,n,s=_t(!0)){let i=Object.assign({},fU,n||{}),a=new S0({variant:2,value:new jC({subjectKeyIdentifier:new Ve({valueHex:t})})});this._addKeyAgreeRecipientInfo(a,i,{recipientPublicKey:e},s)}_addKeyAgreeRecipientInfo(e,t,n,s=_t(!0)){let i=new FC({rid:e}),a=s.getOIDByAlgorithm({name:"AES-KW",length:t.kekEncryptionLength},!0,"keyEncryptionAlgorithm"),u=new ge({algorithmId:a}),l=s.getOIDByAlgorithm({name:"ECDH",kdf:t.kdfAlgorithm},!0,"KeyAgreeRecipientInfo"),f=new ArrayBuffer(64),h=new Uint8Array(f);s.getRandomValues(h);let m={version:3,ukm:new Ve({valueHex:f}),keyEncryptionAlgorithm:new ge({algorithmId:l,algorithmParams:u.toSchema()}),recipientEncryptedKeys:new uv({encryptedKeys:[i]})},g=new qC(Object.assign(m,n));this.recipientInfos.push(new Pf({variant:2,value:g}))}async encrypt(e,t,n=_t(!0)){let s=new ArrayBuffer(16),i=new Uint8Array(s);n.getRandomValues(i);let a=new Uint8Array(t),u=n.getOIDByAlgorithm(e,!0,"contentEncryptionAlgorithm"),l=await n.generateKey(e,!0,["encrypt"]),f=await n.encrypt({name:e.name,iv:i},l,a),h=await n.exportKey("raw",l);this.version=2,this.encryptedContentInfo=new ts({disableSplit:this.policy.disableSplit,contentType:"1.2.840.113549.1.7.1",contentEncryptionAlgorithm:new ge({algorithmId:u,algorithmParams:new Ve({valueHex:s})}),encryptedContent:new Ve({valueHex:f})});let m=o(async E=>{let b=this.recipientInfos[E].value,T,A;if(b.recipientPublicKey)T=b.recipientPublicKey.algorithm.namedCurve,A=b.recipientPublicKey;else if(b.recipientCertificate){let be=b.recipientCertificate.subjectPublicKeyInfo.algorithm.algorithmParams;if(be.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect "recipientCertificate" for index ${E}`);switch(be.valueBlock.toString()){case"1.2.840.10045.3.1.7":T="P-256";break;case"1.3.132.0.34":T="P-384";break;case"1.3.132.0.35":T="P-521";break;default:throw new Error(`Incorrect curve OID for index ${E}`)}A=await b.recipientCertificate.getPublicKey({algorithm:{algorithm:{name:"ECDH",namedCurve:T},usages:[]}},n)}else throw new Error("Unsupported RecipientInfo");let C=gie[T],x=await n.generateKey({name:"ECDH",namedCurve:T},!0,["deriveBits"]),B=await n.exportKey("spki",x.publicKey),F=await n.deriveBits({name:"ECDH",public:A},x.privateKey,C),R=new ge({schema:b.keyEncryptionAlgorithm.algorithmParams}),H=n.getAlgorithmByOID(R.algorithmId,!0,"aesKWAlgorithm"),q=H.length,K=new ArrayBuffer(4),G=new Uint8Array(K);for(let be=3;be>=0;be--)G[be]=q,q>>=8;let le=new hB({keyInfo:new ge({algorithmId:R.algorithmId}),entityUInfo:b.ukm,suppPubInfo:new Ve({valueHex:K})}).toSchema().toBER(!1),oe=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"ecdhAlgorithm"),Z=await Q6(oe.kdf,F,H.length,le,n),fe=await n.importKey("raw",Z,{name:"AES-KW"},!0,["wrapKey"]),Se=await n.wrapKey("raw",l,fe,{name:"AES-KW"}),Ke=new ov;return Ke.variant=3,Ke.value=MC.fromBER(B),b.originator=Ke,b.recipientEncryptedKeys.encryptedKeys[0].encryptedKey=new Ve({valueHex:Se}),{ecdhPrivateKey:x.privateKey}},"SubKeyAgreeRecipientInfo"),g=o(async E=>{let b=this.recipientInfos[E].value,T=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm");if(T.name==="RSA-OAEP"){let A=b.keyEncryptionAlgorithm.algorithmParams,C=new eC({schema:A});if(T.hash=n.getAlgorithmByOID(C.hashAlgorithm.algorithmId),!("name"in T.hash))throw new Error(`Incorrect OID for hash algorithm: ${C.hashAlgorithm.algorithmId}`)}try{let A=await b.recipientCertificate.getPublicKey({algorithm:{algorithm:T,usages:["encrypt","wrapKey"]}},n),C=await n.encrypt(A.algorithm,A,h);b.encryptedKey=new Ve({valueHex:C})}catch{}},"SubKeyTransRecipientInfo"),w=o(async E=>{let b=this.recipientInfos[E].value,T=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),A=await n.importKey("raw",new Uint8Array(b.preDefinedKEK),T,!0,["wrapKey"]),C=await n.wrapKey("raw",l,A,T);b.encryptedKey=new Ve({valueHex:C})},"SubKEKRecipientInfo"),y=o(async E=>{let b=this.recipientInfos[E].value,T;if(!b.keyDerivationAlgorithm)throw new Error('Please append encoded "keyDerivationAlgorithm"');if(!b.keyDerivationAlgorithm.algorithmParams)throw new Error('Incorrectly encoded "keyDerivationAlgorithm"');try{T=new w0({schema:b.keyDerivationAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "keyDerivationAlgorithm"')}let A=new Uint8Array(b.password),C=await n.importKey("raw",A,"PBKDF2",!1,["deriveKey"]),x=n.getAlgorithmByOID(b.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),B="SHA-1";T.prf&&(B=n.getAlgorithmByOID(T.prf.algorithmId,!0,"prfAlgorithm").hash.name);let F=new Uint8Array(T.salt.valueBlock.valueHex),R=T.iterationCount,H=await n.deriveKey({name:"PBKDF2",hash:{name:B},salt:F,iterations:R},C,x,!0,["wrapKey"]),q=await n.wrapKey("raw",l,H,x);b.encryptedKey=new Ve({valueHex:q})},"SubPasswordRecipientinfo"),S=[];for(let E=0;E<this.recipientInfos.length;E++)switch(this.recipientInfos[E].variant){case 1:S.push(await g(E));break;case 2:S.push(await m(E));break;case 3:S.push(await w(E));break;case 4:S.push(await y(E));break;default:throw new Error(`Unknown recipient type in array with index ${E}`)}return S}async decrypt(e,t,n=_t(!0)){let s=t||{};if(e+1>this.recipientInfos.length)throw new Error(`Maximum value for "index" is: ${this.recipientInfos.length-1}`);let i=o(async S=>{let E=this.recipientInfos[S].value,b,T,A,C=E.originator;if(s.recipientCertificate){let oe=s.recipientCertificate.subjectPublicKeyInfo.algorithm.algorithmParams;if(oe.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect "recipientCertificate" for index ${S}`);b=oe.valueBlock.toString()}else if(C.value.algorithm.algorithmParams){let oe=C.value.algorithm.algorithmParams;if(oe.constructor.blockName()!==rt.blockName())throw new Error(`Incorrect originator for index ${S}`);b=oe.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(b){case"1.2.840.10045.3.1.7":T="P-256",A=256;break;case"1.3.132.0.34":T="P-384",A=384;break;case"1.3.132.0.35":T="P-521",A=528;break;default:throw new Error(`Incorrect curve OID for index ${S}`)}let x,B=n;dt.isBufferSource(s.recipientPrivateKey)?x=await n.importKey("pkcs8",s.recipientPrivateKey,{name:"ECDH",namedCurve:T},!0,["deriveBits"]):(x=s.recipientPrivateKey,"crypto"in s&&s.crypto&&(B=s.crypto.subtle)),"algorithmParams"in C.value.algorithm||(C.value.algorithm.algorithmParams=new rt({value:b}));let F=C.value.toSchema().toBER(!1),R=await n.importKey("spki",F,{name:"ECDH",namedCurve:T},!0,[]),H=await B.deriveBits({name:"ECDH",public:R},x,A);async function q(oe){oe=oe||!1;let Z=new ge({schema:E.keyEncryptionAlgorithm.algorithmParams}),fe=n.getAlgorithmByOID(Z.algorithmId,!0,"kwAlgorithm"),Se=fe.length,Ke=new ArrayBuffer(4),be=new Uint8Array(Ke);for(let lt=3;lt>=0;lt--)be[lt]=Se,Se>>=8;let we={algorithmId:Z.algorithmId};oe&&(we.algorithmParams=new $r);let Je=new hB({keyInfo:new ge(we),entityUInfo:E.ukm,suppPubInfo:new Ve({valueHex:Ke})}).toSchema().toBER(!1),Ye=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"ecdhAlgorithm");if(!Ye.name)throw new Error(`Incorrect OID for key encryption algorithm: ${E.keyEncryptionAlgorithm.algorithmId}`);return Q6(Ye.kdf,H,fe.length,Je,n)}o(q,"applyKDF");let K=await q(),G=o(async oe=>n.importKey("raw",oe,{name:"AES-KW"},!0,["unwrapKey"]),"importAesKwKey"),he=await G(K),le=o(async oe=>{let Z=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,fe=n.getAlgorithmByOID(Z,!0,"contentEncryptionAlgorithm");return n.unwrapKey("raw",E.recipientEncryptedKeys.encryptedKeys[0].encryptedKey.valueBlock.valueHexView,oe,{name:"AES-KW"},fe,!0,["decrypt"])},"unwrapSessionKey");try{return await le(he)}catch{let oe=await q(!0),Z=await G(oe);return le(Z)}},"SubKeyAgreeRecipientInfo"),a=o(async S=>{let E=this.recipientInfos[S].value;if(!s.recipientPrivateKey)throw new Error('Parameter "recipientPrivateKey" is mandatory for "KeyTransRecipientInfo"');let b=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm");if(b.name==="RSA-OAEP"){let F=E.keyEncryptionAlgorithm.algorithmParams,R=new eC({schema:F});if(b.hash=n.getAlgorithmByOID(R.hashAlgorithm.algorithmId),!("name"in b.hash))throw new Error(`Incorrect OID for hash algorithm: ${R.hashAlgorithm.algorithmId}`)}let T,A=n;dt.isBufferSource(s.recipientPrivateKey)?T=await n.importKey("pkcs8",s.recipientPrivateKey,b,!0,["decrypt"]):(T=s.recipientPrivateKey,"crypto"in s&&s.crypto&&(A=s.crypto.subtle));let C=await A.decrypt(T.algorithm,T,E.encryptedKey.valueBlock.valueHexView),x=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,B=n.getAlgorithmByOID(x,!0,"contentEncryptionAlgorithm");if(!("name"in B))throw new Error(`Incorrect "contentEncryptionAlgorithm": ${x}`);return n.importKey("raw",C,B,!0,["decrypt"])},"SubKeyTransRecipientInfo"),u=o(async S=>{let E=this.recipientInfos[S].value;if(!s.preDefinedData)throw new Error('Parameter "preDefinedData" is mandatory for "KEKRecipientInfo"');let b=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"kekAlgorithm"),T=await n.importKey("raw",s.preDefinedData,b,!0,["unwrapKey"]),A=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,C=n.getAlgorithmByOID(A,!0,"contentEncryptionAlgorithm");if(!C.name)throw new Error(`Incorrect "contentEncryptionAlgorithm": ${A}`);return n.unwrapKey("raw",E.encryptedKey.valueBlock.valueHexView,T,b,C,!0,["decrypt"])},"SubKEKRecipientInfo"),l=o(async S=>{let E=this.recipientInfos[S].value,b;if(!s.preDefinedData)throw new Error('Parameter "preDefinedData" is mandatory for "KEKRecipientInfo"');if(!E.keyDerivationAlgorithm)throw new Error('Please append encoded "keyDerivationAlgorithm"');if(!E.keyDerivationAlgorithm.algorithmParams)throw new Error('Incorrectly encoded "keyDerivationAlgorithm"');try{b=new w0({schema:E.keyDerivationAlgorithm.algorithmParams})}catch{throw new Error('Incorrectly encoded "keyDerivationAlgorithm"')}let T=await n.importKey("raw",s.preDefinedData,"PBKDF2",!1,["deriveKey"]),A=n.getAlgorithmByOID(E.keyEncryptionAlgorithm.algorithmId,!0,"keyEncryptionAlgorithm"),C=b.prf?n.getAlgorithmByOID(b.prf.algorithmId,!0,"prfAlgorithm").hash.name:"SHA-1",x=new Uint8Array(b.salt.valueBlock.valueHex),B=b.iterationCount,F=await n.deriveKey({name:"PBKDF2",hash:{name:C},salt:x,iterations:B},T,A,!0,["unwrapKey"]),R=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,H=n.getAlgorithmByOID(R,!0,"contentEncryptionAlgorithm");return n.unwrapKey("raw",E.encryptedKey.valueBlock.valueHexView,F,A,H,!0,["decrypt"])},"SubPasswordRecipientinfo"),f;switch(this.recipientInfos[e].variant){case 1:f=await a(e);break;case 2:f=await i(e);break;case 3:f=await u(e);break;case 4:f=await l(e);break;default:throw new Error(`Unknown recipient type in array with index ${e}`)}let h=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmId,m=n.getAlgorithmByOID(h,!0,"contentEncryptionAlgorithm"),g=this.encryptedContentInfo.contentEncryptionAlgorithm.algorithmParams.valueBlock.valueHex,w=new Uint8Array(g);if(!this.encryptedContentInfo.encryptedContent)throw new Error("Required property `encryptedContent` is empty");let y=this.encryptedContentInfo.getEncryptedContent();return n.decrypt({name:m.name,iv:w},f,y)}};pB.CLASS_NAME="EnvelopedData";var kp="safeContents",_g="parsedValue",hU="contentInfos",dB=class tC extends Be{static{o(this,"AuthenticatedSafe")}constructor(e={}){super(),this.safeContents=D(e,kp,tC.defaultValues(kp)),_g in e&&(this.parsedValue=D(e,_g,tC.defaultValues(_g))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case kp:return[];case _g:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case kp:return t.length===0;case _g:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new Tt({name:t.contentInfos||L,value:Wr.schema()})]})}fromSchema(e){_e(e,[hU]);let t=Ie(e,e,tC.schema({names:{contentInfos:hU}}));Ae.assertSchema(t,this.className),this.safeContents=Array.from(t.result.contentInfos,n=>new Wr({schema:n}))}toSchema(){return new W({value:Array.from(this.safeContents,e=>e.toSchema())})}toJSON(){return{safeContents:Array.from(this.safeContents,e=>e.toJSON())}}async parseInternalValues(e,t=_t(!0)){if(fr.assert(e,kp),Ar.assert(e.safeContents,kp,"Array"),e.safeContents.length!==this.safeContents.length)throw new Ar('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 jB:{Ar.assert(s.content,"this.safeContents[j].content",Ve);let u=s.content.getValue();this.parsedValue.safeContents.push({privacyMode:0,value:v0.fromBER(u)})}break;case NU:{let u=new pB({schema:s.content});fr.assert(a,i,"recipientCertificate","recipientKey");let l=i,f=l.recipientCertificate,h=l.recipientKey,m=await u.decrypt(0,{recipientCertificate:f,recipientPrivateKey:h},t);this.parsedValue.safeContents.push({privacyMode:2,value:v0.fromBER(m)})}break;case TU:{let u=new dv({schema:s.content});fr.assert(a,i,"password");let l=i.password,f=await u.decrypt({password:l},t);this.parsedValue.safeContents.push({privacyMode:1,value:v0.fromBER(f)})}break;default:throw new Error(`Unknown "contentType" for AuthenticatedSafe: " ${s.contentType}`)}}}async makeInternalValues(e,t=_t(!0)){if(!this.parsedValue)throw new Error('Please run "parseValues" first or add "parsedValue" manually');if(Ar.assert(this.parsedValue,"this.parsedValue","object"),Ar.assert(this.parsedValue.safeContents,"this.parsedValue.safeContents","Array"),Ar.assert(e,"parameters","object"),fr.assert(e,"safeContents"),Ar.assert(e.safeContents,"parameters.safeContents","Array"),e.safeContents.length!==this.parsedValue.safeContents.length)throw new Ar('Length of "parameters.safeContents" must be equal to "this.parsedValue.safeContents"');this.safeContents=[];for(let[n,s]of this.parsedValue.safeContents.entries())switch(fr.assert("content",s,"privacyMode","value"),Ar.assert(s.value,"content.value",v0),s.privacyMode){case 0:{let i=s.value.toSchema().toBER(!1);this.safeContents.push(new Wr({contentType:"1.2.840.113549.1.7.1",content:new Ve({valueHex:i})}))}break;case 1:{let i=new dv,a=e.safeContents[n];a.contentToEncrypt=s.value.toSchema().toBER(!1),await i.encrypt(a,t),this.safeContents.push(new Wr({contentType:"1.2.840.113549.1.7.6",content:i.toSchema()}))}break;case 2:{let i=new pB,a=s.value.toSchema().toBER(!1),u=e.safeContents[n];switch(fr.assert(`parameters.safeContents[${n}]`,u,"encryptingCertificate","encryptionAlgorithm"),!0){case u.encryptionAlgorithm.name.toLowerCase()==="aes-cbc":case u.encryptionAlgorithm.name.toLowerCase()==="aes-gcm":break;default:throw new Error(`Incorrect parameter "encryptionAlgorithm" in "parameters.safeContents[i]": ${u.encryptionAlgorithm}`)}switch(!0){case u.encryptionAlgorithm.length===128:case u.encryptionAlgorithm.length===192:case u.encryptionAlgorithm.length===256:break;default:throw new Error(`Incorrect parameter "encryptionAlgorithm.length" in "parameters.safeContents[i]": ${u.encryptionAlgorithm.length}`)}let l=u.encryptionAlgorithm;i.addRecipientByCertificate(u.encryptingCertificate,{},void 0,t),await i.encrypt(l,a,t),this.safeContents.push(new Wr({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}};dB.CLASS_NAME="AuthenticatedSafe";var Of="hashAlgorithm",Vd="issuerNameHash",Ud="issuerKeyHash",kf="serialNumber",yie=[Of,Vd,Ud,kf],Qs=class jl extends Be{static{o(this,"CertID")}static async create(e,t,n=_t(!0)){let s=new jl;return await s.createForCertificate(e,t,n),s}constructor(e={}){super(),this.hashAlgorithm=D(e,Of,jl.defaultValues(Of)),this.issuerNameHash=D(e,Vd,jl.defaultValues(Vd)),this.issuerKeyHash=D(e,Ud,jl.defaultValues(Ud)),this.serialNumber=D(e,kf,jl.defaultValues(kf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Of:return new ge;case Vd:case Ud:return new Ve;case kf:return new me;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Of:return t.algorithmId===L&&!("algorithmParams"in t);case Vd:case Ud:case kf:return t.isEqual(jl.defaultValues(kf));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.hashAlgorithmObject||{names:{blockName:t.hashAlgorithm||L}}),new Ve({name:t.issuerNameHash||L}),new Ve({name:t.issuerKeyHash||L}),new me({name:t.serialNumber||L})]})}fromSchema(e){_e(e,yie);let t=Ie(e,e,jl.schema({names:{hashAlgorithm:Of,issuerNameHash:Vd,issuerKeyHash:Ud,serialNumber:kf}}));Ae.assertSchema(t,this.className),this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm}),this.issuerNameHash=t.result.issuerNameHash,this.issuerKeyHash=t.result.issuerKeyHash,this.serialNumber=t.result.serialNumber}toSchema(){return new W({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||!dt.isEqual(this.issuerNameHash.valueBlock.valueHexView,e.issuerNameHash.valueBlock.valueHexView)||!dt.isEqual(this.issuerKeyHash.valueBlock.valueHexView,e.issuerKeyHash.valueBlock.valueHexView)||!this.serialNumber.isEqual(e.serialNumber))}async createForCertificate(e,t,n=_t(!0)){fr.assert(t,Of,"issuerCertificate");let s=n.getOIDByAlgorithm({name:t.hashAlgorithm},!0,"hashAlgorithm");this.hashAlgorithm=new ge({algorithmId:s,algorithmParams:new $r});let i=t.issuerCertificate;this.serialNumber=e.serialNumber;let a=await n.digest({name:t.hashAlgorithm},i.subject.toSchema().toBER(!1));this.issuerNameHash=new Ve({valueHex:a});let u=i.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView,l=await n.digest({name:t.hashAlgorithm},u);this.issuerKeyHash=new Ve({valueHex:l})}};Qs.CLASS_NAME="CertID";var Md="certID",jd="certStatus",Fd="thisUpdate",Fl="nextUpdate",Lf="singleExtensions",vie=[Md,jd,Fd,Fl,Lf],mB=class ql extends Be{static{o(this,"SingleResponse")}constructor(e={}){super(),this.certID=D(e,Md,ql.defaultValues(Md)),this.certStatus=D(e,jd,ql.defaultValues(jd)),this.thisUpdate=D(e,Fd,ql.defaultValues(Fd)),Fl in e&&(this.nextUpdate=D(e,Fl,ql.defaultValues(Fl))),Lf in e&&(this.singleExtensions=D(e,Lf,ql.defaultValues(Lf))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Md:return new Qs;case jd:return{};case Fd:case Fl:return new Date(0,0,0);case Lf:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Md:return Qs.compareWithDefault("hashAlgorithm",t.hashAlgorithm)&&Qs.compareWithDefault("issuerNameHash",t.issuerNameHash)&&Qs.compareWithDefault("issuerKeyHash",t.issuerKeyHash)&&Qs.compareWithDefault("serialNumber",t.serialNumber);case jd:return Object.keys(t).length===0;case Fd:case Fl:return t===ql.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Qs.schema(t.certID||{}),new Or({value:[new gt({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:0}}),new ae({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:1},value:[new Pr,new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Yu]})]}),new gt({name:t.certStatus||L,idBlock:{tagClass:3,tagNumber:2},lenBlock:{length:1}})]}),new Pr({name:t.thisUpdate||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Pr({name:t.nextUpdate||L})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[Sn.schema(t.singleExtensions||{})]})]})}fromSchema(e){_e(e,vie);let t=Ie(e,e,ql.schema({names:{certID:{names:{blockName:Md}},certStatus:jd,thisUpdate:Fd,nextUpdate:Fl,singleExtensions:{names:{blockName:Lf}}}}));Ae.assertSchema(t,this.className),this.certID=new Qs({schema:t.result.certID}),this.certStatus=t.result.certStatus,this.thisUpdate=t.result.thisUpdate.toDate(),Fl in t.result&&(this.nextUpdate=t.result.nextUpdate.toDate()),Lf in t.result&&(this.singleExtensions=Array.from(t.result.singleExtensions.valueBlock.value,n=>new Ri({schema:n})))}toSchema(){let e=[];return e.push(this.certID.toSchema()),e.push(this.certStatus),e.push(new Pr({valueDate:this.thisUpdate})),this.nextUpdate&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new Pr({valueDate:this.nextUpdate})]})),this.singleExtensions&&e.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W({value:Array.from(this.singleExtensions,t=>t.toSchema())})]})),new W({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}};mB.CLASS_NAME="SingleResponse";var lA="tbs",Vf="version",Oy="responderID",ky="producedAt",Ly="responses",qd="responseExtensions",uh="ResponseData",rC=`${uh}.${Vf}`,Hd=`${uh}.${Oy}`,gB=`${uh}.${ky}`,yB=`${uh}.${Ly}`,nC=`${uh}.${qd}`,wie=[uh,rC,Hd,gB,yB,nC],qo=class Ka extends Be{static{o(this,"ResponseData")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,lA,Ka.defaultValues(lA))),Vf in e&&(this.version=D(e,Vf,Ka.defaultValues(Vf))),this.responderID=D(e,Oy,Ka.defaultValues(Oy)),this.producedAt=D(e,ky,Ka.defaultValues(ky)),this.responses=D(e,Ly,Ka.defaultValues(Ly)),qd in e&&(this.responseExtensions=D(e,qd,Ka.defaultValues(qd))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Vf:return 0;case lA:return Zr;case Oy:return{};case ky:return new Date(0,0,0);case Ly:case qd:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case lA:return t.byteLength===0;case Oy:return Object.keys(t).length===0;case ky:return t===Ka.defaultValues(e);case Ly:case qd:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||uh,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.version||rC})]}),new Or({value:[new ae({name:t.responderID||Hd,idBlock:{tagClass:3,tagNumber:1},value:[kr.schema(t.ResponseDataByName||{names:{blockName:"ResponseData.byName"}})]}),new ae({name:t.responderID||Hd,idBlock:{tagClass:3,tagNumber:2},value:[new Ve({name:t.ResponseDataByKey||"ResponseData.byKey"})]})]}),new Pr({name:t.producedAt||gB}),new W({value:[new Tt({name:yB,value:mB.schema(t.response||{})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[Sn.schema(t.extensions||{names:{blockName:nC}})]})]})}fromSchema(e){_e(e,wie);let t=Ie(e,e,Ka.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.ResponseData.valueBeforeDecodeView,rC in t.result&&(this.version=t.result[rC].valueBlock.valueDec),t.result[Hd].idBlock.tagNumber===1?this.responderID=new kr({schema:t.result[Hd].valueBlock.value[0]}):this.responderID=t.result[Hd].valueBlock.value[0],this.producedAt=t.result[gB].toDate(),this.responses=Array.from(t.result[yB],n=>new mB({schema:n})),nC in t.result&&(this.responseExtensions=Array.from(t.result[nC].valueBlock.value,n=>new Ri({schema:n})))}toSchema(e=!1){let t;if(e===!1){if(!this.tbsView.byteLength)return Ka.schema();let n=Kr(this.tbsView);Ae.assert(n,"TBS Response Data"),t=n.result}else{let n=[];Vf in this&&n.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),this.responderID instanceof kr?n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.responderID.toSchema()]})):n.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[this.responderID]})),n.push(new Pr({valueDate:this.producedAt})),n.push(new W({value:Array.from(this.responses,s=>s.toSchema())})),this.responseExtensions&&n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[new W({value:Array.from(this.responseExtensions,s=>s.toSchema())})]})),t=new W({value:n})}return t}toJSON(){let e={};return Vf 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}};qo.CLASS_NAME="ResponseData";var vI="trustedCerts",wI="certs",SI="crls",EI="ocsps",AI="checkDate",CI="findOrigin",bI="findIssuer",Zf;(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"})(Zf||(Zf={}));var Kd=class ZU extends Error{static{o(this,"ChainValidationError")}constructor(e,t){super(t),this.name=ZU.NAME,this.code=e,this.message=t}};Kd.NAME="ChainValidationError";function Sie(r,e){for(let t=0;t<e.length;t++)if(dt.isEqual(r.tbsView,e[t].tbsView))return!0;return!1}o(Sie,"isTrusted");var eM=class tM{static{o(this,"CertificateChainValidationEngine")}constructor(e={}){this.trustedCerts=D(e,vI,this.defaultValues(vI)),this.certs=D(e,wI,this.defaultValues(wI)),this.crls=D(e,SI,this.defaultValues(SI)),this.ocsps=D(e,EI,this.defaultValues(EI)),this.checkDate=D(e,AI,this.defaultValues(AI)),this.findOrigin=D(e,CI,this.defaultValues(CI)),this.findIssuer=D(e,bI,this.defaultValues(bI))}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())),dt.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())),dt.isEqual(e.tbsView,n.tbsView))return"Trusted Certificates";return"Unknown"}async defaultFindIssuer(e,t,n=_t(!0)){let s=[],i=null,a=null,u=null;if(e.subject.isEqual(e.issuer))try{if(await e.verify(void 0,n))return[e]}catch{}if(e.extensions){for(let f of e.extensions)if(f.extnID===UB&&f.parsedValue instanceof qB){f.parsedValue.keyIdentifier?i=f.parsedValue.keyIdentifier:(f.parsedValue.authorityCertIssuer&&(a=f.parsedValue.authorityCertIssuer),f.parsedValue.authorityCertSerialNumber&&(u=f.parsedValue.authorityCertSerialNumber));break}}function l(f){if(i!==null&&f.extensions){let m=!1;for(let g of f.extensions)if(g.extnID===Ane&&g.parsedValue){m=!0,dt.isEqual(g.parsedValue.valueBlock.valueHex,i.valueBlock.valueHexView)&&s.push(f);break}if(m)return}let h=!1;u!==null&&(h=f.serialNumber.isEqual(u)),a!==null?f.subject.isEqual(a)&&h&&s.push(f):e.issuer.isEqual(f.subject)&&s.push(f)}o(l,"checkCertificate");for(let f of t.trustedCerts)l(f);for(let f of t.certs)l(f);for(let f=s.length-1;f>=0;f--)try{await e.verify(s[f],n)===!1&&s.splice(f,1)}catch{s.splice(f,1)}return s}defaultValues(e){switch(e){case vI:return[];case wI:return[];case SI:return[];case EI:return[];case AI:return new Date;case CI:return tM.defaultFindOrigin;case bI:return this.defaultFindIssuer;default:throw new Error(`Invalid member name for CertificateChainValidationEngine class: ${e}`)}}async sort(e=!1,t=_t(!0)){let n=[],s=o(async(y,S)=>{let E=[];function b(A){let C=!0;for(let x=0;x<A.length;x++){for(let B=0;B<A.length;B++)if(B!==x&&A[x]===A[B]){C=!1;break}if(!C)break}return C}if(o(b,"checkUnique"),Sie(y,this.trustedCerts))return[[y]];let T=await this.findIssuer(y,this,S);if(T.length===0)throw new Error("No valid certificate paths found");for(let A=0;A<T.length;A++){if(dt.isEqual(T[A].tbsView,y.tbsView)){E.push([T[A]]);continue}let C=await s(T[A],S);for(let x=0;x<C.length;x++){let B=C[x].slice();B.splice(0,0,T[A]),b(B)?E.push(B):E.push(C[x])}}return E},"buildPath"),i=o(async y=>{let S=[],E=[],b=[];if(S.push(...n.filter(T=>y.issuer.isEqual(T.subject))),S.length===0)return{status:1,statusMessage:"No certificate's issuers"};if(E.push(...this.crls.filter(T=>T.issuer.isEqual(y.issuer))),E.length===0)return{status:2,statusMessage:"No CRLs for specific certificate issuer"};for(let T=0;T<E.length;T++){let A=E[T];if(!(A.nextUpdate&&A.nextUpdate.value<this.checkDate))for(let C=0;C<S.length;C++)try{if(await E[T].verify({issuerCertificate:S[C]},t)){b.push({crl:E[T],certificate:S[C]});break}}catch{}}return b.length?{status:0,statusMessage:L,result:b}:{status:3,statusMessage:"No valid CRLs found"}},"findCRL"),a=o(async(y,S)=>{let E=t.getAlgorithmByOID(y.signatureAlgorithm.algorithmId);if(!E.name||!E.hash)return 1;for(let b=0;b<this.ocsps.length;b++){let A=await this.ocsps[b].getCertificateStatus(y,S,t);if(A.isForCertificate)return A.status===0?0:1}return 2},"findOCSP");async function u(y,S=!1){let E=!1,b=!1,T=!1,A=!1;if(y.extensions){for(let C=0;C<y.extensions.length;C++){let x=y.extensions[C];if(x.critical&&!x.parsedValue)return{result:!1,resultCode:6,resultMessage:`Unable to parse critical certificate extension: ${x.extnID}`};if(x.extnID===Cne){T=!0;let B=new Uint8Array(x.parsedValue.valueBlock.valueHex);(B[0]&4)===4&&(b=!0),(B[0]&2)===2&&(A=!0)}x.extnID===LB&&"cA"in x.parsedValue&&x.parsedValue.cA===!0&&(E=!0)}if(b===!0&&E===!1)return{result:!1,resultCode:3,resultMessage:'Unable to build certificate chain - using "keyCertSign" flag set without BasicConstraints'};if(T===!0&&E===!0&&b===!1)return{result:!1,resultCode:4,resultMessage:'Unable to build certificate chain - "keyCertSign" flag was not set'};if(E===!0&&T===!0&&S&&A===!1)return{result:!1,resultCode:5,resultMessage:'Unable to build certificate chain - intermediate certificate must have "cRLSign" key usage flag'}}return E===!1?{result:!1,resultCode:7,resultMessage:"Unable to build certificate chain - more than one possible end-user certificate"}:{result:!0,resultCode:0,resultMessage:L}}o(u,"checkForCA");let l=o(async(y,S)=>{for(let E=0;E<y.length;E++)if(y[E].notBefore.value>S||y[E].notAfter.value<S)return{result:!1,resultCode:8,resultMessage:"The certificate is either not yet valid or expired"};if(y.length<2)return{result:!1,resultCode:9,resultMessage:"Too short certificate path"};for(let E=y.length-2;E>=0;E--)if(y[E].issuer.isEqual(y[E].subject)===!1&&y[E].issuer.isEqual(y[E+1].subject)===!1)return{result:!1,resultCode:10,resultMessage:"Incorrect name chaining"};if(this.crls.length!==0||this.ocsps.length!==0)for(let E=0;E<y.length-1;E++){let b=2,T={status:0,statusMessage:L};if(this.ocsps.length!==0)switch(b=await a(y[E],y[E+1]),b){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(T=await i(y[E]),T.status===0&&T.result)for(let A=0;A<T.result.length;A++){if(T.result[A].crl.isCertificateRevoked(y[E]))return{result:!1,resultCode:12,resultMessage:"One of certificates had been revoked"};if((await u(T.result[A].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 Kd(Zf.noRevocation,`No revocation values found for one of certificates: ${T.statusMessage}`)}else if(b===2)return{result:!1,resultCode:11,resultMessage:"No revocation values found for one of certificates"};if(b===2&&T.status===2&&e){let A=y[E+1],C=!1;if(A.extensions)for(let x of A.extensions)switch(x.extnID){case EU:case VB:case MB:C=!0;break}if(C)throw new Kd(Zf.noRevocation,`No revocation values found for one of certificates: ${T.statusMessage}`)}}for(let[E,b]of y.entries()){if(!E)continue;if(!(await u(b)).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 y=0;y<n.length;y++)for(let S=0;S<n.length;S++)if(y!==S&&dt.isEqual(n[y].tbsView,n[S].tbsView)){n.splice(S,1),y=0;break}let f=n[n.length-1],h,m=[f];if(h=await s(f,t),h.length===0)throw new Kd(Zf.noPath,"Unable to find certificate path");for(let y=h.length-1;y>=0;y--){let S=!1;for(let E=0;E<h[y].length;E++){let b=h[y][E];for(let T=0;T<this.trustedCerts.length;T++)if(dt.isEqual(b.tbsView,this.trustedCerts[T].tbsView)){S=!0;break}if(S)break}S||h.splice(y,1)}if(h.length===0)throw new Kd(Zf.noValidPath,"No valid certificate paths found");let g=h[0].length,w=0;for(let y=0;y<h.length;y++)h[y].length<g&&(g=h[y].length,w=y);for(let y=0;y<h[w].length;y++)m.push(h[w][y]);if(h=await l(m,this.checkDate),h.result===!1)throw h;return m}async verify(e={},t=_t(!0)){function n(l,f){let h=zl(l),m=zl(f),g=h.split("."),w=m.split("."),y=g.length,S=w.length;if(y===0||S===0||y<S)return!1;for(let E=0;E<y;E++)if(g[E].length===0)return!1;for(let E=0;E<S;E++)if(w[E].length===0){if(E===0){if(S===1)return!1;continue}return!1}for(let E=0;E<S;E++)if(w[S-1-E].length!==0&&g[y-1-E].localeCompare(w[S-1-E])!==0)return!1;return!0}o(n,"compareDNSName");function s(l,f){let h=zl(l),m=zl(f),g=h.split("@"),w=m.split("@");if(g.length===0||w.length===0||g.length<w.length)return!1;if(w.length===1){if(n(g[1],w[0])){let S=g[1].split("."),E=w[0].split(".");return E[0].length===0?!0:S.length===E.length}return!1}return h.localeCompare(m)===0}o(s,"compareRFC822Name");function i(l,f){let h=zl(l),m=zl(f),g=h.split("/");if(m.split("/").length>1)return!1;if(g.length>1){for(let S=0;S<g.length;S++)if(g[S].length>0&&g[S].charAt(g[S].length-1)!==":"){h=g[S].split(":")[0];break}}if(n(h,m)){let S=h.split("."),E=m.split(".");return E[0].length===0?!0:S.length===E.length}return!1}o(i,"compareUniformResourceIdentifier");function a(l,f){let h=l.valueBlock.valueHexView,m=f.valueBlock.valueHexView;if(h.length===4&&m.length===8){for(let g=0;g<4;g++)if((h[g]^m[g])&m[g+4])return!1;return!0}if(h.length===16&&m.length===32){for(let g=0;g<16;g++)if((h[g]^m[g])&m[g+16])return!1;return!0}return!1}o(a,"compareIPAddress");function u(l,f){if(l.typesAndValues.length===0||f.typesAndValues.length===0)return!0;if(l.typesAndValues.length<f.typesAndValues.length)return!1;let h=!0,m=0;for(let g=0;g<f.typesAndValues.length;g++){let w=!1;for(let y=m;y<l.typesAndValues.length;y++)if(w=l.typesAndValues[y].isEqual(f.typesAndValues[g]),l.typesAndValues[y].type===f.typesAndValues[g].type&&(h=h&&w),w===!0)if(m===0||m===y){m=y+1;break}else return!1;if(w===!1)return!1}return m===0?!1:h}o(u,"compareDirectoryName");try{if(this.certs.length===0)throw new Error("Empty certificate array");let l=e.passedWhenNotRevValues||!1,f=e.initialPolicySet||[Ii],h=e.initialExplicitPolicy||!1,m=e.initialPolicyMappingInhibit||!1,g=e.initialInhibitPolicy||!1,w=e.initialPermittedSubtreesSet||[],y=e.initialExcludedSubtreesSet||[],S=e.initialRequiredNameForms||[],E=h,b=m,T=g,A=[!1,!1,!1],C=0,x=0,B=0,F=w,R=y,H=S,q=1;this.certs=await this.sort(l,t);let K=[];K.push(Ii);let G=[],he=new Array(this.certs.length-1);for(let be=0;be<this.certs.length-1;be++)he[be]=!0;G.push(he);let le=new Array(this.certs.length-1),oe=new Array(this.certs.length-1),Z=E?this.certs.length-1:-1;for(let be=this.certs.length-2;be>=0;be--,q++){let we=this.certs[be];if(we.extensions){for(let Me=0;Me<we.extensions.length;Me++){let Je=we.extensions[Me];if(Je.extnID===AU){oe[be]=Je.parsedValue;for(let Ye=0;Ye<K.length;Ye++)if(K[Ye]===Ii){delete G[Ye][be];break}for(let Ye=0;Ye<Je.parsedValue.certificatePolicies.length;Ye++){let lt=-1,O=Je.parsedValue.certificatePolicies[Ye].policyIdentifier;for(let _=0;_<K.length;_++)if(O===K[_]){lt=_;break}if(lt===-1){K.push(O);let _=new Array(this.certs.length-1);_[be]=!0,G.push(_)}else G[lt][be]=!0}}if(Je.extnID===CU){if(b)return{result:!1,resultCode:98,resultMessage:"Policy mapping prohibited"};le[be]=Je.parsedValue}Je.extnID===bU&&E===!1&&(Je.parsedValue.requireExplicitPolicy===0?(E=!0,Z=be):A[0]===!1?(A[0]=!0,C=Je.parsedValue.requireExplicitPolicy):C=C>Je.parsedValue.requireExplicitPolicy?Je.parsedValue.requireExplicitPolicy:C,Je.parsedValue.inhibitPolicyMapping===0?b=!0:A[1]===!1?(A[1]=!0,x=Je.parsedValue.inhibitPolicyMapping+1):x=x>Je.parsedValue.inhibitPolicyMapping+1?Je.parsedValue.inhibitPolicyMapping+1:x),Je.extnID===_ne&&T===!1&&(Je.parsedValue.valueBlock.valueDec===0?T=!0:A[2]===!1?(A[2]=!0,B=Je.parsedValue.valueBlock.valueDec):B=B>Je.parsedValue.valueBlock.valueDec?Je.parsedValue.valueBlock.valueDec:B)}if(T===!0){let Me=-1;for(let Je=0;Je<K.length;Je++)if(K[Je]===Ii){Me=Je;break}Me!==-1&&delete G[0][be]}E===!1&&A[0]===!0&&(C--,C===0&&(E=!0,Z=be,A[0]=!1)),b===!1&&A[1]===!0&&(x--,x===0&&(b=!0,A[1]=!1)),T===!1&&A[2]===!0&&(B--,B===0&&(T=!0,A[2]=!1))}}for(let be=0;be<this.certs.length-1;be++)if(be<this.certs.length-2&&typeof le[be+1]<"u")for(let we=0;we<le[be+1].mappings.length;we++){if(le[be+1].mappings[we].issuerDomainPolicy===Ii||le[be+1].mappings[we].subjectDomainPolicy===Ii)return{result:!1,resultCode:99,resultMessage:'The "anyPolicy" should not be a part of policy mapping scheme'};let Me=-1,Je=-1;for(let Ye=0;Ye<K.length;Ye++)K[Ye]===le[be+1].mappings[we].issuerDomainPolicy&&(Me=Ye),K[Ye]===le[be+1].mappings[we].subjectDomainPolicy&&(Je=Ye);typeof G[Me][be]<"u"&&delete G[Me][be];for(let Ye=0;Ye<oe[be].certificatePolicies.length;Ye++)if(le[be+1].mappings[we].subjectDomainPolicy===oe[be].certificatePolicies[Ye].policyIdentifier&&Me!==-1&&Je!==-1)for(let lt=0;lt<=be;lt++)typeof G[Je][lt]<"u"&&(G[Me][lt]=!0,delete G[Je][lt])}for(let be=0;be<K.length;be++)if(K[be]===Ii)for(let we=0;we<Z;we++)delete G[be][we];let fe=[];for(let be=0;be<G.length;be++){let we=!0;for(let Me=0;Me<this.certs.length-1;Me++){let Je=!1;if(Me<Z&&K[be]===Ii&&K.length>1){we=!1;break}if(typeof G[be][Me]>"u"){if(Me>=Z){for(let Ye=0;Ye<K.length;Ye++)if(K[Ye]===Ii){G[Ye][Me]===!0&&(Je=!0);break}}if(!Je){we=!1;break}}}we===!0&&fe.push(K[be])}let Se=[];if(f.length===1&&f[0]===Ii&&E===!1)Se=f;else if(fe.length===1&&fe[0]===Ii)Se=f;else for(let be=0;be<fe.length;be++)for(let we=0;we<f.length;we++)if(f[we]===fe[be]||f[we]===Ii){Se.push(fe[be]);break}let Ke={result:Se.length>0,resultCode:0,resultMessage:Se.length>0?L:'Zero "userConstrPolicies" array, no intersections with "authConstrPolicies"',authConstrPolicies:fe,userConstrPolicies:Se,explicitPolicyIndicator:E,policyMappings:le,certificatePath:this.certs};if(Se.length===0||Ke.result===!1)return Ke;q=1;for(let be=this.certs.length-2;be>=0;be--,q++){let we=this.certs[be],Me=[],Je=[],Ye=[];if(we.extensions)for(let ne=0;ne<we.extensions.length;ne++){let J=we.extensions[ne];J.extnID===SU&&("permittedSubtrees"in J.parsedValue&&(Je=Je.concat(J.parsedValue.permittedSubtrees)),"excludedSubtrees"in J.parsedValue&&(Ye=Ye.concat(J.parsedValue.excludedSubtrees))),J.extnID===gU&&(Me=Me.concat(J.parsedValue.altNames))}let lt=H.length<=0;for(let ne=0;ne<H.length;ne++)switch(H[ne].base.type){case 4:{if(H[ne].base.value.typesAndValues.length!==we.subject.typesAndValues.length)continue;lt=!0;for(let J=0;J<we.subject.typesAndValues.length;J++)if(we.subject.typesAndValues[J].type!==H[ne].base.value.typesAndValues[J].type){lt=!1;break}if(lt===!0)break}break;default:}if(lt===!1)throw Ke.result=!1,Ke.resultCode=21,Ke.resultMessage="No necessary name form found",Ke;let O=[[],[],[],[],[]];for(let ne=0;ne<F.length;ne++)switch(F[ne].base.type){case 1:O[0].push(F[ne]);break;case 2:O[1].push(F[ne]);break;case 4:O[2].push(F[ne]);break;case 6:O[3].push(F[ne]);break;case 7:O[4].push(F[ne]);break;default:}for(let ne=0;ne<5;ne++){let J=!1,Xe=!1,Re=O[ne];for(let xe=0;xe<Re.length;xe++){switch(ne){case 0:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===1&&(Xe=!0,J=J||s(Me[ct].value,Re[xe].base.value));else for(let ct=0;ct<we.subject.typesAndValues.length;ct++)(we.subject.typesAndValues[ct].type==="1.2.840.113549.1.9.1"||we.subject.typesAndValues[ct].type==="0.9.2342.19200300.100.1.3")&&(Xe=!0,J=J||s(we.subject.typesAndValues[ct].value.valueBlock.value,Re[xe].base.value));break;case 1:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===2&&(Xe=!0,J=J||n(Me[ct].value,Re[xe].base.value));break;case 2:Xe=!0,J=u(we.subject,Re[xe].base.value);break;case 3:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===6&&(Xe=!0,J=J||i(Me[ct].value,Re[xe].base.value));break;case 4:if(Me.length>0)for(let ct=0;ct<Me.length;ct++)Me[ct].type===7&&(Xe=!0,J=J||a(Me[ct].value,Re[xe].base.value));break;default:}if(J)break}if(J===!1&&Re.length>0&&Xe)throw Ke.result=!1,Ke.resultCode=41,Ke.resultMessage='Failed to meet "permitted sub-trees" name constraint',Ke}let _=!1;for(let ne=0;ne<R.length;ne++){switch(R[ne].base.type){case 1:if(Me.length>=0)for(let J=0;J<Me.length;J++)Me[J].type===1&&(_=_||s(Me[J].value,R[ne].base.value));else for(let J=0;J<we.subject.typesAndValues.length;J++)(we.subject.typesAndValues[J].type==="1.2.840.113549.1.9.1"||we.subject.typesAndValues[J].type==="0.9.2342.19200300.100.1.3")&&(_=_||s(we.subject.typesAndValues[J].value.valueBlock.value,R[ne].base.value));break;case 2:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===2&&(_=_||n(Me[J].value,R[ne].base.value));break;case 4:_=_||u(we.subject,R[ne].base.value);break;case 6:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===6&&(_=_||i(Me[J].value,R[ne].base.value));break;case 7:if(Me.length>0)for(let J=0;J<Me.length;J++)Me[J].type===7&&(_=_||a(Me[J].value,R[ne].base.value));break;default:}if(_)break}if(_===!0)throw Ke.result=!1,Ke.resultCode=42,Ke.resultMessage='Failed to meet "excluded sub-trees" name constraint',Ke;F=F.concat(Je),R=R.concat(Ye)}return Ke}catch(l){return l instanceof Error?l instanceof Kd?{result:!1,resultCode:l.code,resultMessage:l.message,error:l}:{result:!1,resultCode:Zf.unknown,resultMessage:l.message,error:l}:l&&typeof l=="object"&&"resultMessage"in l?l:{result:!1,resultCode:-1,resultMessage:`${l}`}}}},sC="tbsResponseData",Vy="signatureAlgorithm",Uy="signature",$d="certs",mv="BasicOCSPResponse",vB=`${mv}.${sC}`,wB=`${mv}.${Vy}`,SB=`${mv}.${Uy}`,iC=`${mv}.${$d}`,Eie=[vB,wB,SB,iC],cv=class Uf extends Be{static{o(this,"BasicOCSPResponse")}constructor(e={}){super(),this.tbsResponseData=D(e,sC,Uf.defaultValues(sC)),this.signatureAlgorithm=D(e,Vy,Uf.defaultValues(Vy)),this.signature=D(e,Uy,Uf.defaultValues(Uy)),$d in e&&(this.certs=D(e,$d,Uf.defaultValues($d))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case sC:return new qo;case Vy:return new ge;case Uy:return new qt;case $d:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case"type":{let n=qo.compareWithDefault("tbs",t.tbs)&&qo.compareWithDefault("responderID",t.responderID)&&qo.compareWithDefault("producedAt",t.producedAt)&&qo.compareWithDefault("responses",t.responses);return"responseExtensions"in t&&(n=n&&qo.compareWithDefault("responseExtensions",t.responseExtensions)),n}case Vy:return t.algorithmId===L&&!("algorithmParams"in t);case Uy:return t.isEqual(Uf.defaultValues(e));case $d:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||mv,value:[qo.schema(t.tbsResponseData||{names:{blockName:vB}}),ge.schema(t.signatureAlgorithm||{names:{blockName:wB}}),new qt({name:t.signature||SB}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:[new Tt({name:iC,value:rs.schema(t.certs||{})})]})]})]})}fromSchema(e){_e(e,Eie);let t=Ie(e,e,Uf.schema());Ae.assertSchema(t,this.className),this.tbsResponseData=new qo({schema:t.result[vB]}),this.signatureAlgorithm=new ge({schema:t.result[wB]}),this.signature=t.result[SB],iC in t.result&&(this.certs=Array.from(t.result[iC],n=>new rs({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 ae({idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.certs,t=>t.toSchema())})]})),new W({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=_t(!0)){let s={isForCertificate:!1,status:2},i={},a=[];for(let u of this.tbsResponseData.responses){let l=n.getAlgorithmByOID(u.certID.hashAlgorithm.algorithmId,!0,"CertID.hashAlgorithm");if(!i[l.name]){i[l.name]=1;let f=new Qs;a.push(f),await f.createForCertificate(e,{hashAlgorithm:l.name,issuerCertificate:t},n)}}for(let u of this.tbsResponseData.responses)for(let l of a)if(u.certID.isEqual(l)){s.isForCertificate=!0;try{switch(u.certStatus.idBlock.isConstructed){case!0:u.certStatus.idBlock.tagNumber===1&&(s.status=1);break;case!1:switch(u.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=_t(!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 qt({valueHex:a})}async verify(e={},t=_t(!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 kr:for(let[f,h]of this.certs.entries())if(h.subject.isEqual(this.tbsResponseData.responderID)){s=f;break}break;case this.tbsResponseData.responderID instanceof Ve:for(let[f,h]of this.certs.entries()){let m=await t.digest({name:"sha-1"},h.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);if(Ju(m,this.tbsResponseData.responderID.valueBlock.valueHex)){s=f;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 f of this.certs){let h=await $U(f,n);h&&a.push(h)}if(!(await new eM({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)}};cv.CLASS_NAME="BasicOCSPResponse";var xI="tbs",NI="version",TI="subject",II="subjectPublicKeyInfo",Lp="attributes",My="signatureAlgorithm",jy="signatureValue",C0="CertificationRequestInfo",YB=`${C0}.version`,QB=`${C0}.subject`,ZB=`${C0}.subjectPublicKeyInfo`,$C=`${C0}.attributes`,Aie=[C0,YB,QB,ZB,$C,My,jy];function Cie(r={}){let e=D(r,"names",{});return new W({name:e.CertificationRequestInfo||C0,value:[new me({name:e.CertificationRequestInfoVersion||YB}),kr.schema(e.subject||{names:{blockName:QB}}),sa.schema({names:{blockName:ZB}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({optional:!0,name:e.CertificationRequestInfoAttributes||$C,value:en.schema(e.attributes||{})})]})]})}o(Cie,"CertificationRequestInfo");var bie=class $a extends Be{static{o(this,"CertificationRequest")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,xI,$a.defaultValues(xI))),this.version=D(e,NI,$a.defaultValues(NI)),this.subject=D(e,TI,$a.defaultValues(TI)),this.subjectPublicKeyInfo=D(e,II,$a.defaultValues(II)),Lp in e&&(this.attributes=D(e,Lp,$a.defaultValues(Lp))),this.signatureAlgorithm=D(e,My,$a.defaultValues(My)),this.signatureValue=D(e,jy,$a.defaultValues(jy)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case xI:return Zr;case NI:return 0;case TI:return new kr;case II:return new sa;case Lp:return[];case My:return new ge;case jy:return new qt;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({value:[Cie(t.certificationRequestInfo||{}),new W({name:t.signatureAlgorithm||My,value:[new rt,new St({optional:!0})]}),new qt({name:t.signatureValue||jy})]})}fromSchema(e){_e(e,Aie);let t=Ie(e,e,$a.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.CertificationRequestInfo.valueBeforeDecodeView,this.version=t.result[YB].valueBlock.valueDec,this.subject=new kr({schema:t.result[QB]}),this.subjectPublicKeyInfo=new sa({schema:t.result[ZB]}),$C in t.result&&(this.attributes=Array.from(t.result[$C],n=>new en({schema:n}))),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signatureValue=t.result.signatureValue}encodeTBS(){let e=[new me({value:this.version}),this.subject.toSchema(),this.subjectPublicKeyInfo.toSchema()];return Lp in this&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.attributes||[],t=>t.toSchema())})),new W({value:e})}toSchema(e=!1){let t;if(e===!1){if(this.tbsView.byteLength===0)return $a.schema();let n=Kr(this.tbsView);Ae.assert(n,"PKCS#10 Certificate Request"),t=n.result}else t=this.encodeTBS();return new W({value:[t,this.signatureAlgorithm.toSchema(),this.signatureValue]})}toJSON(){let e={tbs:Ct.ToHex(this.tbsView),version:this.version,subject:this.subject.toJSON(),subjectPublicKeyInfo:this.subjectPublicKeyInfo.toJSON(),signatureAlgorithm:this.signatureAlgorithm.toJSON(),signatureValue:this.signatureValue.toJSON()};return Lp in this&&(e.attributes=Array.from(this.attributes||[],t=>t.toJSON())),e}async sign(e,t="SHA-1",n=_t(!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 qt({valueHex:a})}async verify(e=_t(!0)){return e.verifyWithPublicKey(this.tbsView,this.signatureValue,this.subjectPublicKeyInfo,this.signatureAlgorithm)}async getPublicKey(e,t=_t(!0)){return t.getPublicKey(this.subjectPublicKeyInfo,this.signatureAlgorithm,e)}};bie.CLASS_NAME="CertificationRequest";var Mf="digestAlgorithm",jf="digest",xie=[Mf,jf],eh=class Fy extends Be{static{o(this,"DigestInfo")}constructor(e={}){super(),this.digestAlgorithm=D(e,Mf,Fy.defaultValues(Mf)),this.digest=D(e,jf,Fy.defaultValues(jf)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Mf:return new ge;case jf:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Mf:return ge.compareWithDefault("algorithmId",t.algorithmId)&&!("algorithmParams"in t);case jf:return t.isEqual(Fy.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.digestAlgorithm||{names:{blockName:Mf}}),new Ve({name:t.digest||jf})]})}fromSchema(e){_e(e,xie);let t=Ie(e,e,Fy.schema({names:{digestAlgorithm:{names:{blockName:Mf}},digest:jf}}));Ae.assertSchema(t,this.className),this.digestAlgorithm=new ge({schema:t.result.digestAlgorithm}),this.digest=t.result.digest}toSchema(){return new W({value:[this.digestAlgorithm.toSchema(),this.digest]})}toJSON(){return{digestAlgorithm:this.digestAlgorithm.toJSON(),digest:this.digest.toJSON()}}};eh.CLASS_NAME="DigestInfo";var Xd="eContentType",ta="eContent",Nie=[Xd,ta],th=class Ff extends Be{static{o(this,"EncapsulatedContentInfo")}constructor(e={}){if(super(),this.eContentType=D(e,Xd,Ff.defaultValues(Xd)),ta in e&&(this.eContent=D(e,ta,Ff.defaultValues(ta)),this.eContent.idBlock.tagClass===1&&this.eContent.idBlock.tagNumber===4&&this.eContent.idBlock.isConstructed===!1)){let t=new Ve({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),u=new ArrayBuffer(a.length),l=new Uint8Array(u);for(let f=0;f<l.length;f++)l[f]=a[f];t.valueBlock.value.push(new Ve({valueHex:u})),i-=a.length,n+=a.length}this.eContent=t}e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Xd:return L;case ta:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Xd:return t===L;case ta:return t.idBlock.tagClass===1&&t.idBlock.tagNumber===4?t.isEqual(Ff.defaultValues(ta)):!1;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.eContentType||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new St({name:t.eContent||L})]})]})}fromSchema(e){_e(e,Nie);let t=Ie(e,e,Ff.schema({names:{eContentType:Xd,eContent:ta}}));Ae.assertSchema(t,this.className),this.eContentType=t.result.eContentType.valueBlock.toString(),ta in t.result&&(this.eContent=t.result.eContent)}toSchema(){let e=[];return e.push(new rt({value:this.eContentType})),this.eContent&&Ff.compareWithDefault(ta,this.eContent)===!1&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.eContent]})),new W({value:e})}toJSON(){let e={eContentType:this.eContentType};return this.eContent&&Ff.compareWithDefault(ta,this.eContent)===!1&&(e.eContent=this.eContent.toJSON()),e}};th.CLASS_NAME="EncapsulatedContentInfo";var qf="mac",Hf="macSalt",Ho="iterations",Tie=[qf,Hf,Ho],Hl=class Kf extends Be{static{o(this,"MacData")}constructor(e={}){super(),this.mac=D(e,qf,Kf.defaultValues(qf)),this.macSalt=D(e,Hf,Kf.defaultValues(Hf)),Ho in e&&(this.iterations=D(e,Ho,Kf.defaultValues(Ho))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case qf:return new eh;case Hf:return new Ve;case Ho:return 1;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case qf:return eh.compareWithDefault("digestAlgorithm",t.digestAlgorithm)&&eh.compareWithDefault("digest",t.digest);case Hf:return t.isEqual(Kf.defaultValues(e));case Ho:return t===Kf.defaultValues(e);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,optional:t.optional||!0,value:[eh.schema(t.mac||{names:{blockName:qf}}),new Ve({name:t.macSalt||Hf}),new me({optional:!0,name:t.iterations||Ho})]})}fromSchema(e){_e(e,Tie);let t=Ie(e,e,Kf.schema({names:{mac:{names:{blockName:qf}},macSalt:Hf,iterations:Ho}}));Ae.assertSchema(t,this.className),this.mac=new eh({schema:t.result.mac}),this.macSalt=t.result.macSalt,Ho 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 me({value:this.iterations})),new W({value:e})}toJSON(){let e={mac:this.mac.toJSON(),macSalt:this.macSalt.toJSON()};return this.iterations!==void 0&&(e.iterations=this.iterations),e}};Hl.CLASS_NAME="MacData";var rh="hashAlgorithm",nh="hashedMessage",Iie=[rh,nh],na=class Gd extends Be{static{o(this,"MessageImprint")}static async create(e,t,n=_t(!0)){let s=n.getOIDByAlgorithm({name:e},!0,"hashAlgorithm"),i=await n.digest(e,t);return new Gd({hashAlgorithm:new ge({algorithmId:s,algorithmParams:new $r}),hashedMessage:new Ve({valueHex:i})})}constructor(e={}){super(),this.hashAlgorithm=D(e,rh,Gd.defaultValues(rh)),this.hashedMessage=D(e,nh,Gd.defaultValues(nh)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case rh:return new ge;case nh:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case rh:return t.algorithmId===L&&!("algorithmParams"in t);case nh:return t.isEqual(Gd.defaultValues(e))===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.hashAlgorithm||{}),new Ve({name:t.hashedMessage||L})]})}fromSchema(e){_e(e,Iie);let t=Ie(e,e,Gd.schema({names:{hashAlgorithm:{names:{blockName:rh}},hashedMessage:nh}}));Ae.assertSchema(t,this.className),this.hashAlgorithm=new ge({schema:t.result.hashAlgorithm}),this.hashedMessage=t.result.hashedMessage}toSchema(){return new W({value:[this.hashAlgorithm.toSchema(),this.hashedMessage]})}toJSON(){return{hashAlgorithm:this.hashAlgorithm.toJSON(),hashedMessage:this.hashedMessage.toJSON()}}};na.CLASS_NAME="MessageImprint";var Wd="reqCert",Kl="singleRequestExtensions",Bie=[Wd,Kl],XC=class qy extends Be{static{o(this,"Request")}constructor(e={}){super(),this.reqCert=D(e,Wd,qy.defaultValues(Wd)),Kl in e&&(this.singleRequestExtensions=D(e,Kl,qy.defaultValues(Kl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Wd:return new Qs;case Kl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Wd:return t.isEqual(qy.defaultValues(e));case Kl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[Qs.schema(t.reqCert||{}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Sn.schema(t.extensions||{names:{blockName:t.singleRequestExtensions||L}})]})]})}fromSchema(e){_e(e,Bie);let t=Ie(e,e,qy.schema({names:{reqCert:{names:{blockName:Wd}},extensions:{names:{blockName:Kl}}}}));Ae.assertSchema(t,this.className),this.reqCert=new Qs({schema:t.result.reqCert}),Kl in t.result&&(this.singleRequestExtensions=Array.from(t.result.singleRequestExtensions.valueBlock.value,n=>new Ri({schema:n})))}toSchema(){let e=[];return e.push(this.reqCert.toSchema()),this.singleRequestExtensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.singleRequestExtensions,t=>t.toSchema())})]})),new W({value:e})}toJSON(){let e={reqCert:this.reqCert.toJSON()};return this.singleRequestExtensions&&(e.singleRequestExtensions=Array.from(this.singleRequestExtensions,t=>t.toJSON())),e}};XC.CLASS_NAME="Request";var cA="tbs",Jd="version",zd="requestorName",fA="requestList",Yd="requestExtensions",b0="TBSRequest",aC=`${b0}.${Jd}`,oC=`${b0}.${zd}`,EB=`${b0}.requests`,uC=`${b0}.${Yd}`,Die=[b0,aC,oC,EB,uC],Ko=class $o extends Be{static{o(this,"TBSRequest")}get tbs(){return dt.toArrayBuffer(this.tbsView)}set tbs(e){this.tbsView=new Uint8Array(e)}constructor(e={}){super(),this.tbsView=new Uint8Array(D(e,cA,$o.defaultValues(cA))),Jd in e&&(this.version=D(e,Jd,$o.defaultValues(Jd))),zd in e&&(this.requestorName=D(e,zd,$o.defaultValues(zd))),this.requestList=D(e,fA,$o.defaultValues(fA)),Yd in e&&(this.requestExtensions=D(e,Yd,$o.defaultValues(Yd))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case cA:return Zr;case Jd:return 0;case zd:return new Cr;case fA:case Yd:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case cA:return t.byteLength===0;case Jd:return t===$o.defaultValues(e);case zd:return t.type===Cr.defaultValues("type")&&Object.keys(t.value).length===0;case fA:case Yd:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||b0,value:[new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new me({name:t.TBSRequestVersion||aC})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[Cr.schema(t.requestorName||{names:{blockName:oC}})]}),new W({name:t.requestList||"TBSRequest.requestList",value:[new Tt({name:t.requests||EB,value:XC.schema(t.requestNames||{})})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:2},value:[Sn.schema(t.extensions||{names:{blockName:t.requestExtensions||uC}})]})]})}fromSchema(e){_e(e,Die);let t=Ie(e,e,$o.schema());Ae.assertSchema(t,this.className),this.tbsView=t.result.TBSRequest.valueBeforeDecodeView,aC in t.result&&(this.version=t.result[aC].valueBlock.valueDec),oC in t.result&&(this.requestorName=new Cr({schema:t.result[oC]})),this.requestList=Array.from(t.result[EB],n=>new XC({schema:n})),uC in t.result&&(this.requestExtensions=Array.from(t.result[uC].valueBlock.value,n=>new Ri({schema:n})))}toSchema(e=!1){let t;if(e===!1){if(this.tbsView.byteLength===0)return $o.schema();let n=Kr(this.tbsView);if(Ae.assert(n,"TBS Request"),!(n.result instanceof W))throw new Error("ASN.1 result should be SEQUENCE");t=n.result}else{let n=[];this.version!==void 0&&n.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[new me({value:this.version})]})),this.requestorName&&n.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:[this.requestorName.toSchema()]})),n.push(new W({value:Array.from(this.requestList,s=>s.toSchema())})),this.requestExtensions&&n.push(new ae({idBlock:{tagClass:3,tagNumber:2},value:[new W({value:Array.from(this.requestExtensions,s=>s.toSchema())})]})),t=new W({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}};Ko.CLASS_NAME="TBSRequest";var Vp="signatureAlgorithm",Up="signature",sl="certs",$f=class Qd extends Be{static{o(this,"Signature")}constructor(e={}){super(),this.signatureAlgorithm=D(e,Vp,Qd.defaultValues(Vp)),this.signature=D(e,Up,Qd.defaultValues(Up)),sl in e&&(this.certs=D(e,sl,Qd.defaultValues(sl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Vp:return new ge;case Up:return new qt;case sl:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Vp:return t.algorithmId===L&&!("algorithmParams"in t);case Up:return t.isEqual(Qd.defaultValues(e));case sl:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[ge.schema(t.signatureAlgorithm||{}),new qt({name:t.signature||L}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:[new Tt({name:t.certs||L,value:rs.schema({})})]})]})]})}fromSchema(e){_e(e,[Vp,Up,sl]);let t=Ie(e,e,Qd.schema({names:{signatureAlgorithm:{names:{blockName:Vp}},signature:Up,certs:sl}}));Ae.assertSchema(t,this.className),this.signatureAlgorithm=new ge({schema:t.result.signatureAlgorithm}),this.signature=t.result.signature,sl in t.result&&(this.certs=Array.from(t.result.certs,n=>new rs({schema:n})))}toSchema(){let e=[];return e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.certs&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new W({value:Array.from(this.certs,t=>t.toSchema())})]})),new W({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}};$f.CLASS_NAME="Signature";var Zd="tbsRequest",$l="optionalSignature",_ie=[Zd,$l],Rie=class lC extends Be{static{o(this,"OCSPRequest")}constructor(e={}){super(),this.tbsRequest=D(e,Zd,lC.defaultValues(Zd)),$l in e&&(this.optionalSignature=D(e,$l,lC.defaultValues($l))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Zd:return new Ko;case $l:return new $f;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Zd:return Ko.compareWithDefault("tbs",t.tbs)&&Ko.compareWithDefault("version",t.version)&&Ko.compareWithDefault("requestorName",t.requestorName)&&Ko.compareWithDefault("requestList",t.requestList)&&Ko.compareWithDefault("requestExtensions",t.requestExtensions);case $l:return $f.compareWithDefault("signatureAlgorithm",t.signatureAlgorithm)&&$f.compareWithDefault("signature",t.signature)&&$f.compareWithDefault("certs",t.certs);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"OCSPRequest",value:[Ko.schema(t.tbsRequest||{names:{blockName:Zd}}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[$f.schema(t.optionalSignature||{names:{blockName:$l}})]})]})}fromSchema(e){_e(e,_ie);let t=Ie(e,e,lC.schema());Ae.assertSchema(t,this.className),this.tbsRequest=new Ko({schema:t.result.tbsRequest}),$l in t.result&&(this.optionalSignature=new $f({schema:t.result.optionalSignature}))}toSchema(e=!1){let t=[];return t.push(this.tbsRequest.toSchema(e)),this.optionalSignature&&t.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.optionalSignature.toSchema()]})),new W({value:t})}toJSON(){let e={tbsRequest:this.tbsRequest.toJSON()};return this.optionalSignature&&(e.optionalSignature=this.optionalSignature.toJSON()),e}async createForCertificate(e,t,n=_t(!0)){let s=new Qs;await s.createForCertificate(e,t,n),this.tbsRequest.requestList.push(new XC({reqCert:s}))}async sign(e,t="SHA-1",n=_t(!0)){if(fr.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),u=await n.signWithPrivateKey(a,e,i);this.optionalSignature.signature=new qt({valueHex:u})}verify(){}};Rie.CLASS_NAME="OCSPRequest";var e0="responseType",t0="response",Pie=[e0,t0],r0=class Hy extends Be{static{o(this,"ResponseBytes")}constructor(e={}){super(),this.responseType=D(e,e0,Hy.defaultValues(e0)),this.response=D(e,t0,Hy.defaultValues(t0)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case e0:return L;case t0:return new Ve;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case e0:return t===L;case t0:return t.isEqual(Hy.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new rt({name:t.responseType||L}),new Ve({name:t.response||L})]})}fromSchema(e){_e(e,Pie);let t=Ie(e,e,Hy.schema({names:{responseType:e0,response:t0}}));Ae.assertSchema(t,this.className),this.responseType=t.result.responseType.valueBlock.toString(),this.response=t.result.response}toSchema(){return new W({value:[new rt({value:this.responseType}),this.response]})}toJSON(){return{responseType:this.responseType,response:this.response.toJSON()}}};r0.CLASS_NAME="ResponseBytes";var Mp="responseStatus",Do="responseBytes",Oie=class Ky extends Be{static{o(this,"OCSPResponse")}constructor(e={}){super(),this.responseStatus=D(e,Mp,Ky.defaultValues(Mp)),Do in e&&(this.responseBytes=D(e,Do,Ky.defaultValues(Do))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Mp:return new Yu;case Do:return new r0;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Mp:return t.isEqual(Ky.defaultValues(e));case Do:return r0.compareWithDefault("responseType",t.responseType)&&r0.compareWithDefault("response",t.response);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||"OCSPResponse",value:[new Yu({name:t.responseStatus||Mp}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[r0.schema(t.responseBytes||{names:{blockName:Do}})]})]})}fromSchema(e){_e(e,[Mp,Do]);let t=Ie(e,e,Ky.schema());Ae.assertSchema(t,this.className),this.responseStatus=t.result.responseStatus,Do in t.result&&(this.responseBytes=new r0({schema:t.result.responseBytes}))}toSchema(){let e=[];return e.push(this.responseStatus),this.responseBytes&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:[this.responseBytes.toSchema()]})),new W({value:e})}toJSON(){let e={responseStatus:this.responseStatus.toJSON()};return this.responseBytes&&(e.responseBytes=this.responseBytes.toJSON()),e}async getCertificateStatus(e,t,n=_t(!0)){let s,i={isForCertificate:!1,status:2};if(!this.responseBytes||this.responseBytes.responseType!==yA)return i;try{let a=Kr(this.responseBytes.response.valueBlock.valueHexView);Ae.assert(a,"Basic OCSP response"),s=new cv({schema:a.result})}catch{return i}return s.getCertificateStatus(e,t,n)}async sign(e,t,n=_t(!0)){var s;if(this.responseBytes&&this.responseBytes.responseType===yA)return cv.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=_t(!0)){var n;if(!(Do in this))throw new Error("Empty ResponseBytes field");if(this.responseBytes&&this.responseBytes.responseType===yA){let s=cv.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"}`)}};Oie.CLASS_NAME="OCSPResponse";var Fc="type",Xo="attributes",hA="encodedValue",kie=[Xo],Ls=class Xa extends Be{static{o(this,"SignedAndUnsignedAttributes")}constructor(e={}){super(),this.type=D(e,Fc,Xa.defaultValues(Fc)),this.attributes=D(e,Xo,Xa.defaultValues(Xo)),this.encodedValue=D(e,hA,Xa.defaultValues(hA)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Fc:return-1;case Xo:return[];case hA:return Zr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Fc:return t===Xa.defaultValues(Fc);case Xo:return t.length===0;case hA:return t.byteLength===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new ae({name:t.blockName||L,optional:!0,idBlock:{tagClass:3,tagNumber:t.tagNumber||0},value:[new Tt({name:t.attributes||L,value:en.schema()})]})}fromSchema(e){_e(e,kie);let t=Ie(e,e,Xa.schema({names:{tagNumber:this.type,attributes:Xo}}));Ae.assertSchema(t,this.className),this.type=t.result.idBlock.tagNumber,this.encodedValue=dt.toArrayBuffer(t.result.valueBeforeDecodeView);let n=new Uint8Array(this.encodedValue);if(n[0]=49,!(Xo in t.result)){if(this.type===0)throw new Error("Wrong structure of SignedUnsignedAttributes");return}this.attributes=Array.from(t.result.attributes,s=>new en({schema:s}))}toSchema(){if(Xa.compareWithDefault(Fc,this.type)||Xa.compareWithDefault(Xo,this.attributes))throw new Error('Incorrectly initialized "SignedAndUnsignedAttributes" class');return new ae({optional:!0,idBlock:{tagClass:3,tagNumber:this.type},value:Array.from(this.attributes,e=>e.toSchema())})}toJSON(){if(Xa.compareWithDefault(Fc,this.type)||Xa.compareWithDefault(Xo,this.attributes))throw new Error('Incorrectly initialized "SignedAndUnsignedAttributes" class');return{type:this.type,attributes:Array.from(this.attributes,e=>e.toJSON())}}};Ls.CLASS_NAME="SignedAndUnsignedAttributes";var n0="version",Xf="sid",s0="digestAlgorithm",Xl="signedAttrs",i0="signatureAlgorithm",$y="signature",Gl="unsignedAttrs",Zl="SignerInfo",AB=`${Zl}.${n0}`,Xy=`${Zl}.${Xf}`,CB=`${Zl}.${s0}`,cC=`${Zl}.${Xl}`,bB=`${Zl}.${i0}`,xB=`${Zl}.${$y}`,fC=`${Zl}.${Gl}`,Lie=[AB,Xy,CB,cC,bB,xB,fC],GC=class Bn extends Be{static{o(this,"SignerInfo")}constructor(e={}){super(),this.version=D(e,n0,Bn.defaultValues(n0)),this.sid=D(e,Xf,Bn.defaultValues(Xf)),this.digestAlgorithm=D(e,s0,Bn.defaultValues(s0)),Xl in e&&(this.signedAttrs=D(e,Xl,Bn.defaultValues(Xl))),this.signatureAlgorithm=D(e,i0,Bn.defaultValues(i0)),this.signature=D(e,$y,Bn.defaultValues($y)),Gl in e&&(this.unsignedAttrs=D(e,Gl,Bn.defaultValues(Gl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case n0:return 0;case Xf:return new St;case s0:return new ge;case Xl:return new Ls({type:0});case i0:return new ge;case $y:return new Ve;case Gl:return new Ls({type:1});default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case n0:return Bn.defaultValues(n0)===t;case Xf:return t instanceof St;case s0:return t instanceof ge?t.isEqual(Bn.defaultValues(s0)):!1;case Xl:return Ls.compareWithDefault("type",t.type)&&Ls.compareWithDefault("attributes",t.attributes)&&Ls.compareWithDefault("encodedValue",t.encodedValue);case i0:return t instanceof ge?t.isEqual(Bn.defaultValues(i0)):!1;case $y:case Gl:return Ls.compareWithDefault("type",t.type)&&Ls.compareWithDefault("attributes",t.attributes)&&Ls.compareWithDefault("encodedValue",t.encodedValue);default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:Zl,value:[new me({name:t.version||AB}),new Or({value:[qn.schema(t.sidSchema||{names:{blockName:Xy}}),new Or({value:[new ae({optional:!0,name:t.sid||Xy,idBlock:{tagClass:3,tagNumber:0},value:[new Ve]}),new gt({optional:!0,name:t.sid||Xy,idBlock:{tagClass:3,tagNumber:0}})]})]}),ge.schema(t.digestAlgorithm||{names:{blockName:CB}}),Ls.schema(t.signedAttrs||{names:{blockName:cC,tagNumber:0}}),ge.schema(t.signatureAlgorithm||{names:{blockName:bB}}),new Ve({name:t.signature||xB}),Ls.schema(t.unsignedAttrs||{names:{blockName:fC,tagNumber:1}})]})}fromSchema(e){_e(e,Lie);let t=Ie(e,e,Bn.schema());Ae.assertSchema(t,this.className),this.version=t.result[AB].valueBlock.valueDec;let n=t.result[Xy];n.idBlock.tagClass===1?this.sid=new qn({schema:n}):this.sid=n,this.digestAlgorithm=new ge({schema:t.result[CB]}),cC in t.result&&(this.signedAttrs=new Ls({type:0,schema:t.result[cC]})),this.signatureAlgorithm=new ge({schema:t.result[bB]}),this.signature=t.result[xB],fC in t.result&&(this.unsignedAttrs=new Ls({type:1,schema:t.result[fC]}))}toSchema(){if(Bn.compareWithDefault(Xf,this.sid))throw new Error('Incorrectly initialized "SignerInfo" class');let e=[];return e.push(new me({value:this.version})),this.sid instanceof qn?e.push(this.sid.toSchema()):e.push(this.sid),e.push(this.digestAlgorithm.toSchema()),this.signedAttrs&&Bn.compareWithDefault(Xl,this.signedAttrs)===!1&&e.push(this.signedAttrs.toSchema()),e.push(this.signatureAlgorithm.toSchema()),e.push(this.signature),this.unsignedAttrs&&Bn.compareWithDefault(Gl,this.unsignedAttrs)===!1&&e.push(this.unsignedAttrs.toSchema()),new W({value:e})}toJSON(){if(Bn.compareWithDefault(Xf,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 St||(e.sid=this.sid.toJSON()),this.signedAttrs&&Bn.compareWithDefault(Xl,this.signedAttrs)===!1&&(e.signedAttrs=this.signedAttrs.toJSON()),this.unsignedAttrs&&Bn.compareWithDefault(Gl,this.unsignedAttrs)===!1&&(e.unsignedAttrs=this.unsignedAttrs.toJSON()),e}};GC.CLASS_NAME="SignerInfo";var Gy="version",Wy="policy",Jy="messageImprint",zy="serialNumber",Yy="genTime",Gf="ordering",Wf="nonce",a0="accuracy",o0="tsa",u0="extensions",ia="TSTInfo",NB=`${ia}.${Gy}`,TB=`${ia}.${Wy}`,IB=`${ia}.${Jy}`,BB=`${ia}.${zy}`,DB=`${ia}.${Yy}`,hC=`${ia}.${a0}`,pC=`${ia}.${Gf}`,dC=`${ia}.${Wf}`,mC=`${ia}.${o0}`,gC=`${ia}.${u0}`,Vie=[NB,TB,IB,BB,DB,hC,pC,dC,mC,gC],rM=class ks extends Be{static{o(this,"TSTInfo")}constructor(e={}){super(),this.version=D(e,Gy,ks.defaultValues(Gy)),this.policy=D(e,Wy,ks.defaultValues(Wy)),this.messageImprint=D(e,Jy,ks.defaultValues(Jy)),this.serialNumber=D(e,zy,ks.defaultValues(zy)),this.genTime=D(e,Yy,ks.defaultValues(Yy)),a0 in e&&(this.accuracy=D(e,a0,ks.defaultValues(a0))),Gf in e&&(this.ordering=D(e,Gf,ks.defaultValues(Gf))),Wf in e&&(this.nonce=D(e,Wf,ks.defaultValues(Wf))),o0 in e&&(this.tsa=D(e,o0,ks.defaultValues(o0))),u0 in e&&(this.extensions=D(e,u0,ks.defaultValues(u0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Gy:return 0;case Wy:return L;case Jy:return new na;case zy:return new me;case Yy:return new Date(0,0,0);case a0:return new qc;case Gf:return!1;case Wf:return new me;case o0:return new Cr;case u0:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Gy:case Wy:case Yy:case Gf:return t===ks.defaultValues(Gf);case Jy:return na.compareWithDefault(rh,t.hashAlgorithm)&&na.compareWithDefault(nh,t.hashedMessage);case zy:case Wf:return t.isEqual(ks.defaultValues(Wf));case a0:return qc.compareWithDefault(il,t.seconds)&&qc.compareWithDefault(al,t.millis)&&qc.compareWithDefault(ol,t.micros);case o0:return Cr.compareWithDefault(Lg,t.type)&&Cr.compareWithDefault(Vg,t.value);case u0:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||ia,value:[new me({name:t.version||NB}),new rt({name:t.policy||TB}),na.schema(t.messageImprint||{names:{blockName:IB}}),new me({name:t.serialNumber||BB}),new Pr({name:t.genTime||DB}),qc.schema(t.accuracy||{names:{blockName:hC}}),new Ji({name:t.ordering||pC,optional:!0}),new me({name:t.nonce||dC,optional:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[Cr.schema(t.tsa||{names:{blockName:mC}})]}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:[new Tt({name:t.extensions||gC,value:Ri.schema(t.extension||{})})]})]})}fromSchema(e){_e(e,Vie);let t=Ie(e,e,ks.schema());Ae.assertSchema(t,this.className),this.version=t.result[NB].valueBlock.valueDec,this.policy=t.result[TB].valueBlock.toString(),this.messageImprint=new na({schema:t.result[IB]}),this.serialNumber=t.result[BB],this.genTime=t.result[DB].toDate(),hC in t.result&&(this.accuracy=new qc({schema:t.result[hC]})),pC in t.result&&(this.ordering=t.result[pC].valueBlock.value),dC in t.result&&(this.nonce=t.result[dC]),mC in t.result&&(this.tsa=new Cr({schema:t.result[mC]})),gC in t.result&&(this.extensions=Array.from(t.result[gC],n=>new Ri({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(new rt({value:this.policy})),e.push(this.messageImprint.toSchema()),e.push(this.serialNumber),e.push(new Pr({valueDate:this.genTime})),this.accuracy&&e.push(this.accuracy.toSchema()),this.ordering!==void 0&&e.push(new Ji({value:this.ordering})),this.nonce&&e.push(this.nonce),this.tsa&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[this.tsa.toSchema()]})),this.extensions&&e.push(new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.extensions,t=>t.toSchema())})),new W({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=_t(!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 dt.isEqual(i,this.messageImprint.hashedMessage.valueBlock.valueHexView)}};rM.CLASS_NAME="TSTInfo";var l0="version",Qy="digestAlgorithms",Zy="encapContentInfo",c0="certificates",f0="crls",ev="signerInfos",Rg="ocsps",lh="SignedData",_B=`${lh}.${l0}`,yC=`${lh}.${Qy}`,RB=`${lh}.${Zy}`,vC=`${lh}.${c0}`,wC=`${lh}.${f0}`,SC=`${lh}.${ev}`,Uie=[_B,yC,RB,vC,wC,SC],Zn=class extends Error{static{o(this,"SignedDataVerifyError")}constructor({message:e,code:t=0,date:n=new Date,signatureVerified:s=null,signerCertificate:i=null,signerCertificateVerified:a=null,timestampSerial:u=null,certificatePath:l=[]}){super(e),this.name="SignedDataVerifyError",this.date=n,this.code=t,this.timestampSerial=u,this.signatureVerified=s,this.signerCertificate=i,this.signerCertificateVerified=a,this.certificatePath=l}},A0=class ra extends Be{static{o(this,"SignedData")}constructor(e={}){super(),this.version=D(e,l0,ra.defaultValues(l0)),this.digestAlgorithms=D(e,Qy,ra.defaultValues(Qy)),this.encapContentInfo=D(e,Zy,ra.defaultValues(Zy)),c0 in e&&(this.certificates=D(e,c0,ra.defaultValues(c0))),f0 in e&&(this.crls=D(e,f0,ra.defaultValues(f0))),Rg in e&&(this.ocsps=D(e,Rg,ra.defaultValues(Rg))),this.signerInfos=D(e,ev,ra.defaultValues(ev)),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case l0:return 0;case Qy:return[];case Zy:return new th;case c0:return[];case f0:return[];case Rg:return[];case ev:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case l0:return t===ra.defaultValues(l0);case Zy:return th.compareWithDefault("eContentType",t.eContentType)&&th.compareWithDefault("eContent",t.eContent);case Qy:case c0:case f0:case Rg:case ev:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return t.optional===void 0&&(t.optional=!1),new W({name:t.blockName||lh,optional:t.optional,value:[new me({name:t.version||_B}),new Xr({value:[new Tt({name:t.digestAlgorithms||yC,value:ge.schema()})]}),th.schema(t.encapContentInfo||{names:{blockName:RB}}),new ae({name:t.certificates||vC,optional:!0,idBlock:{tagClass:3,tagNumber:0},value:ah.schema().valueBlock.value}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:1},value:av.schema(t.crls||{names:{crls:wC}}).valueBlock.value}),new Xr({value:[new Tt({name:t.signerInfos||SC,value:GC.schema()})]})]})}fromSchema(e){_e(e,Uie);let t=Ie(e,e,ra.schema());if(Ae.assertSchema(t,this.className),this.version=t.result[_B].valueBlock.valueDec,yC in t.result&&(this.digestAlgorithms=Array.from(t.result[yC],n=>new ge({schema:n}))),this.encapContentInfo=new th({schema:t.result[RB]}),vC in t.result){let n=new ah({schema:new Xr({value:t.result[vC].valueBlock.value})});this.certificates=n.certificates.slice(0)}wC in t.result&&(this.crls=Array.from(t.result[wC],n=>n.idBlock.tagClass===1?new pv({schema:n}):(n.idBlock.tagClass=1,n.idBlock.tagNumber=16,new iv({schema:n})))),SC in t.result&&(this.signerInfos=Array.from(t.result[SC],n=>new GC({schema:n})))}toSchema(e=!1){let t=[];if(this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof KA)||this.crls&&this.crls.length&&this.crls.some(n=>n instanceof iv)?this.version=5:this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof Yl)?this.version=4:this.certificates&&this.certificates.length&&this.certificates.some(n=>n instanceof IC)||this.signerInfos.some(n=>n.version===3)||this.encapContentInfo.eContentType!==ra.ID_DATA?this.version=3:this.version=1,t.push(new me({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 ah({certificates:this.certificates}).toSchema();t.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:s.valueBlock.value}))}return this.crls&&t.push(new ae({idBlock:{tagClass:3,tagNumber:1},value:Array.from(this.crls,n=>{if(n instanceof iv){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 W({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=Zr,trustedCerts:n=[],checkDate:s=new Date,checkChain:i=!1,passedWhenNotRevValues:a=!1,extendedMode:u=!1,findOrigin:l=null,findIssuer:f=null}={},h=_t(!0)){let m=null,g=null;try{let w=Zr,y=L,S=[],E=this.signerInfos[e];if(!E)throw new Zn({date:s,code:1,message:"Unable to get signer by supplied index"});if(!this.certificates)throw new Zn({date:s,code:2,message:"No certificates attached to this signed data"});if(E.sid instanceof qn){for(let C of this.certificates)if(C instanceof rs&&C.issuer.isEqual(E.sid.issuer)&&C.serialNumber.isEqual(E.sid.serialNumber)){m=C;break}}else{let C=E.sid,x=C.idBlock.isConstructed?C.valueBlock.value[0].valueBlock.valueHex:C.valueBlock.valueHex;for(let B of this.certificates){if(!(B instanceof rs))continue;let F=await h.digest({name:"sha-1"},B.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHexView);if(Ju(F,x)){m=B;break}}}if(!m)throw new Zn({date:s,code:3,message:"Unable to find signer certificate"});if(this.encapContentInfo.eContentType===Vne){if(!this.encapContentInfo.eContent)throw new Zn({date:s,code:15,message:"Error during verification: TSTInfo eContent is empty",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0});let C;try{C=rM.fromBER(this.encapContentInfo.eContent.valueBlock.valueHexView)}catch{throw new Zn({date:s,code:15,message:"Error during verification: TSTInfo wrong ASN.1 schema ",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}if(s=C.genTime,g=C.serialNumber.valueBlock.valueHexView.slice().buffer,t.byteLength===0)throw new Zn({date:s,code:4,message:"Missed detached data input array"});if(!await C.verify({data:t},h))throw new Zn({date:s,code:15,message:"Error during verification: TSTInfo verification is failed",signatureVerified:!1,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}if(i){let C=this.certificates.filter(R=>R instanceof rs&&!!$U(R,m)),x={checkDate:s,certs:C,trustedCerts:n};f&&(x.findIssuer=f),l&&(x.findOrigin=l);let B=new eM(x);if(B.certs.push(m),this.crls)for(let R of this.crls)"thisUpdate"in R?B.crls.push(R):R.otherRevInfoFormat===yA&&B.ocsps.push(new cv({schema:R.otherRevInfo}));this.ocsps&&B.ocsps.push(...this.ocsps);let F=await B.verify({passedWhenNotRevValues:a},h).catch(R=>{throw new Zn({date:s,code:5,message:`Validation of signer's certificate failed with error: ${R instanceof Object?R.resultMessage:R}`,signerCertificate:m,signerCertificateVerified:!1})});if(F.certificatePath&&(S=F.certificatePath),!F.result)throw new Zn({date:s,code:5,message:`Validation of signer's certificate failed: ${F.resultMessage}`,signerCertificate:m,signerCertificateVerified:!1})}let b=h.getAlgorithmByOID(E.digestAlgorithm.algorithmId);if(!("name"in b))throw new Zn({date:s,code:7,message:`Unsupported signature algorithm: ${E.digestAlgorithm.algorithmId}`,signerCertificate:m,signerCertificateVerified:!0});y=b.name;let T=this.encapContentInfo.eContent;if(T)T.idBlock.tagClass===1&&T.idBlock.tagNumber===4?t=T.getValue():t=T.valueBlock.valueBeforeDecodeView.slice().buffer;else if(t.byteLength===0)throw new Zn({date:s,code:8,message:"Missed detached data input array",signerCertificate:m,signerCertificateVerified:!0});if(E.signedAttrs){let C=!1,x=!1;for(let B of E.signedAttrs.attributes)if(B.type==="1.2.840.113549.1.9.3"&&(C=!0),B.type==="1.2.840.113549.1.9.4"&&(x=!0,w=B.values[0].valueBlock.valueHex),C&&x)break;if(C===!1)throw new Zn({date:s,code:9,message:'Attribute "content-type" is a mandatory attribute for "signed attributes"',signerCertificate:m,signerCertificateVerified:!0});if(x===!1)throw new Zn({date:s,code:10,message:'Attribute "message-digest" is a mandatory attribute for "signed attributes"',signatureVerified:null,signerCertificate:m,signerCertificateVerified:!0})}if(E.signedAttrs){let C=await h.digest(y,new Uint8Array(t));if(!Ju(C,w))throw new Zn({date:s,code:15,message:"Error during verification: Message digest doesn't match",signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0});t=E.signedAttrs.encodedValue}let A=E.signatureAlgorithm.algorithmId==="1.2.840.113549.1.1.1"?await h.verifyWithPublicKey(t,E.signature,m.subjectPublicKeyInfo,E.signatureAlgorithm,y):await h.verifyWithPublicKey(t,E.signature,m.subjectPublicKeyInfo,E.signatureAlgorithm);return u?{date:s,code:14,message:L,signatureVerified:A,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0,certificatePath:S}:A}catch(w){throw w instanceof Zn?w:new Zn({date:s,code:15,message:`Error during verification: ${w instanceof Error?w.message:w}`,signatureVerified:null,signerCertificate:m,timestampSerial:g,signerCertificateVerified:!0})}}async sign(e,t,n="SHA-1",s=Zr,i=_t(!0)){var a;if(!e)throw new Error("Need to provide a private key for signing");let u=this.signerInfos[t];if(!u)throw new RangeError("SignerInfo index is out of range");!(!((a=u.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(g=>g.algorithmId===l).length===0&&this.digestAlgorithms.push(new ge({algorithmId:l,algorithmParams:new $r})),u.digestAlgorithm=new ge({algorithmId:l,algorithmParams:new $r});let f=await i.getSignatureParameters(e,n),h=f.parameters;if(u.signatureAlgorithm=f.signatureAlgorithm,u.signedAttrs)if(u.signedAttrs.encodedValue.byteLength!==0)s=u.signedAttrs.encodedValue;else{s=u.signedAttrs.toSchema().toBER();let g=dt.toUint8Array(s);g[0]=49}else{let g=this.encapContentInfo.eContent;if(g)g.idBlock.tagClass===1&&g.idBlock.tagNumber===4?s=g.getValue():s=g.valueBlock.valueBeforeDecodeView.slice().buffer;else if(s.byteLength===0)throw new Error("Missed detached data input array")}let m=await i.signWithPrivateKey(s,e,h);u.signature=new Ve({valueHex:m})}};A0.CLASS_NAME="SignedData";A0.ID_DATA=jB;var Jf="version",zf="authSafe",Go="macData",Pg="parsedValue",Mie=[Jf,zf,Go],jie=class Yf extends Be{static{o(this,"PFX")}constructor(e={}){super(),this.version=D(e,Jf,Yf.defaultValues(Jf)),this.authSafe=D(e,zf,Yf.defaultValues(zf)),Go in e&&(this.macData=D(e,Go,Yf.defaultValues(Go))),Pg in e&&(this.parsedValue=D(e,Pg,Yf.defaultValues(Pg))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case Jf:return 3;case zf:return new Wr;case Go:return new Hl;case Pg:return{};default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case Jf:return t===Yf.defaultValues(e);case zf:return Wr.compareWithDefault("contentType",t.contentType)&&Wr.compareWithDefault("content",t.content);case Go:return Hl.compareWithDefault("mac",t.mac)&&Hl.compareWithDefault("macSalt",t.macSalt)&&Hl.compareWithDefault("iterations",t.iterations);case Pg:return t instanceof Object&&Object.keys(t).length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.version||Jf}),Wr.schema(t.authSafe||{names:{blockName:zf}}),Hl.schema(t.macData||{names:{blockName:Go,optional:!0}})]})}fromSchema(e){_e(e,Mie);let t=Ie(e,e,Yf.schema({names:{version:Jf,authSafe:{names:{blockName:zf}},macData:{names:{blockName:Go}}}}));Ae.assertSchema(t,this.className),this.version=t.result.version.valueBlock.valueDec,this.authSafe=new Wr({schema:t.result.authSafe}),Go in t.result&&(this.macData=new Hl({schema:t.result.macData}))}toSchema(){let e=[new me({value:this.version}),this.authSafe.toSchema()];return this.macData&&e.push(this.macData.toSchema()),new W({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=_t(!0)){if(Ar.assert(e,"parameters","object"),!this.parsedValue)throw new Error('Please call "parseValues" function first in order to make "parsedValue" data');switch(fr.assertEmpty(this.parsedValue.integrityMode,"integrityMode","parsedValue"),fr.assertEmpty(this.parsedValue.authenticatedSafe,"authenticatedSafe","parsedValue"),this.parsedValue.integrityMode){case 0:{if(!("iterations"in e))throw new fr("iterations");fr.assertEmpty(e.pbkdf2HashAlgorithm,"pbkdf2HashAlgorithm"),fr.assertEmpty(e.hmacHashAlgorithm,"hmacHashAlgorithm"),fr.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 Wr({contentType:Wr.DATA,content:new Ve({valueHex:i})});let a=await t.stampDataWithPassword({password:e.password,hashAlgorithm:e.hmacHashAlgorithm,salt:n,iterationCount:e.iterations,contentToStamp:i});this.macData=new Hl({mac:new eh({digestAlgorithm:new ge({algorithmId:t.getOIDByAlgorithm({name:e.hmacHashAlgorithm},!0,"hmacHashAlgorithm")}),digest:new Ve({valueHex:a})}),macSalt:new Ve({valueHex:n}),iterations:e.iterations})}break;case 1:{if(!("signingCertificate"in e))throw new fr("signingCertificate");fr.assertEmpty(e.privateKey,"privateKey"),fr.assertEmpty(e.hashAlgorithm,"hashAlgorithm");let n=this.parsedValue.authenticatedSafe.toSchema().toBER(!1),s=new A0({version:1,encapContentInfo:new th({eContentType:"1.2.840.113549.1.7.1",eContent:new Ve({valueHex:n})}),certificates:[e.signingCertificate]}),i=await t.digest({name:e.hashAlgorithm},new Uint8Array(n)),a=[];a.push(new en({type:"1.2.840.113549.1.9.3",values:[new rt({value:"1.2.840.113549.1.7.1"})]})),a.push(new en({type:"1.2.840.113549.1.9.5",values:[new Lc({valueDate:new Date})]})),a.push(new en({type:"1.2.840.113549.1.9.4",values:[new Ve({valueHex:i})]})),s.signerInfos.push(new GC({version:1,sid:new qn({issuer:e.signingCertificate.issuer,serialNumber:e.signingCertificate.serialNumber}),signedAttrs:new Ls({type:0,attributes:a})})),await s.sign(e.privateKey,0,e.hashAlgorithm,void 0,t),this.authSafe=new Wr({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=_t(!0)){switch(Ar.assert(e,"parameters","object"),e.checkIntegrity===void 0&&(e.checkIntegrity=!0),this.parsedValue={},this.authSafe.contentType){case Wr.DATA:{fr.assertEmpty(e.password,"password"),this.parsedValue.integrityMode=0,Ar.assert(this.authSafe.content,"authSafe.content",Ve);let n=this.authSafe.content.getValue();if(this.parsedValue.authenticatedSafe=dB.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:dt.toArrayBuffer(this.macData.macSalt.valueBlock.valueHexView),iterationCount:this.macData.iterations||1,contentToVerify:n,signatureToVerify:dt.toArrayBuffer(this.macData.mac.digest.valueBlock.valueHexView)}))throw new Error("Integrity for the PKCS#12 data is broken!")}}break;case Wr.SIGNED_DATA:{this.parsedValue.integrityMode=1;let n=new A0({schema:this.authSafe.content}),s=n.encapContentInfo.eContent;fr.assert(s,"eContent","cmsSigned.encapContentInfo"),Ar.assert(s,"eContent",Ve);let i=s.getValue();if(this.parsedValue.authenticatedSafe=dB.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}`)}}};jie.CLASS_NAME="PFX";var h0="status",Wl="statusStrings",Jl="failInfo",Fie=[h0,Wl,Jl],pU;(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"})(pU||(pU={}));var tv=class Qf extends Be{static{o(this,"PKIStatusInfo")}constructor(e={}){super(),this.status=D(e,h0,Qf.defaultValues(h0)),Wl in e&&(this.statusStrings=D(e,Wl,Qf.defaultValues(Wl))),Jl in e&&(this.failInfo=D(e,Jl,Qf.defaultValues(Jl))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case h0:return 2;case Wl:return[];case Jl:return new qt;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case h0:return t===Qf.defaultValues(e);case Wl:return t.length===0;case Jl:return t.isEqual(Qf.defaultValues(e));default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||L,value:[new me({name:t.status||L}),new W({optional:!0,value:[new Tt({name:t.statusStrings||L,value:new Ni})]}),new qt({name:t.failInfo||L,optional:!0})]})}fromSchema(e){_e(e,Fie);let t=Ie(e,e,Qf.schema({names:{status:h0,statusStrings:Wl,failInfo:Jl}}));Ae.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,Wl in t.result&&(this.statusStrings=t.result.statusStrings),Jl in t.result&&(this.failInfo=t.result.failInfo)}toSchema(){let e=[];return e.push(new me({value:this.status})),this.statusStrings&&e.push(new W({optional:!0,value:this.statusStrings})),this.failInfo&&e.push(this.failInfo),new W({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}};tv.CLASS_NAME="PKIStatusInfo";var rv="version",nv="messageImprint",p0="reqPolicy",d0="nonce",Wo="certReq",m0="extensions",ch="TimeStampReq",PB=`${ch}.${rv}`,OB=`${ch}.${nv}`,EC=`${ch}.${p0}`,AC=`${ch}.${d0}`,CC=`${ch}.${Wo}`,bC=`${ch}.${m0}`,qie=[PB,OB,EC,AC,CC,bC],Hie=class _i extends Be{static{o(this,"TimeStampReq")}constructor(e={}){super(),this.version=D(e,rv,_i.defaultValues(rv)),this.messageImprint=D(e,nv,_i.defaultValues(nv)),p0 in e&&(this.reqPolicy=D(e,p0,_i.defaultValues(p0))),d0 in e&&(this.nonce=D(e,d0,_i.defaultValues(d0))),Wo in e&&(this.certReq=D(e,Wo,_i.defaultValues(Wo))),m0 in e&&(this.extensions=D(e,m0,_i.defaultValues(m0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case rv:return 0;case nv:return new na;case p0:return L;case d0:return new me;case Wo:return!1;case m0:return[];default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case rv:case p0:case Wo:return t===_i.defaultValues(e);case nv:return na.compareWithDefault("hashAlgorithm",t.hashAlgorithm)&&na.compareWithDefault("hashedMessage",t.hashedMessage);case d0:return t.isEqual(_i.defaultValues(e));case m0:return t.length===0;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||ch,value:[new me({name:t.version||PB}),na.schema(t.messageImprint||{names:{blockName:OB}}),new rt({name:t.reqPolicy||EC,optional:!0}),new me({name:t.nonce||AC,optional:!0}),new Ji({name:t.certReq||CC,optional:!0}),new ae({optional:!0,idBlock:{tagClass:3,tagNumber:0},value:[new Tt({name:t.extensions||bC,value:Ri.schema()})]})]})}fromSchema(e){_e(e,qie);let t=Ie(e,e,_i.schema());Ae.assertSchema(t,this.className),this.version=t.result[PB].valueBlock.valueDec,this.messageImprint=new na({schema:t.result[OB]}),EC in t.result&&(this.reqPolicy=t.result[EC].valueBlock.toString()),AC in t.result&&(this.nonce=t.result[AC]),CC in t.result&&(this.certReq=t.result[CC].valueBlock.value),bC in t.result&&(this.extensions=Array.from(t.result[bC],n=>new Ri({schema:n})))}toSchema(){let e=[];return e.push(new me({value:this.version})),e.push(this.messageImprint.toSchema()),this.reqPolicy&&e.push(new rt({value:this.reqPolicy})),this.nonce&&e.push(this.nonce),Wo in this&&_i.compareWithDefault(Wo,this.certReq)===!1&&e.push(new Ji({value:this.certReq})),this.extensions&&e.push(new ae({idBlock:{tagClass:3,tagNumber:0},value:Array.from(this.extensions,t=>t.toSchema())})),new W({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&&_i.compareWithDefault(Wo,this.certReq)===!1&&(e.certReq=this.certReq),this.extensions&&(e.extensions=Array.from(this.extensions,t=>t.toJSON())),e}};Hie.CLASS_NAME="TimeStampReq";var g0="status",y0="timeStampToken",eD="TimeStampResp",kB=`${eD}.${g0}`,xC=`${eD}.${y0}`,Kie=[kB,xC],$ie=class NC extends Be{static{o(this,"TimeStampResp")}constructor(e={}){super(),this.status=D(e,g0,NC.defaultValues(g0)),y0 in e&&(this.timeStampToken=D(e,y0,NC.defaultValues(y0))),e.schema&&this.fromSchema(e.schema)}static defaultValues(e){switch(e){case g0:return new tv;case y0:return new Wr;default:return super.defaultValues(e)}}static compareWithDefault(e,t){switch(e){case g0:return tv.compareWithDefault(g0,t.status)&&!("statusStrings"in t)&&!("failInfo"in t);case y0:return t.contentType===L&&t.content instanceof St;default:return super.defaultValues(e)}}static schema(e={}){let t=D(e,"names",{});return new W({name:t.blockName||eD,value:[tv.schema(t.status||{names:{blockName:kB}}),Wr.schema(t.timeStampToken||{names:{blockName:xC,optional:!0}})]})}fromSchema(e){_e(e,Kie);let t=Ie(e,e,NC.schema());Ae.assertSchema(t,this.className),this.status=new tv({schema:t.result[kB]}),xC in t.result&&(this.timeStampToken=new Wr({schema:t.result[xC]}))}toSchema(){let e=[];return e.push(this.status.toSchema()),this.timeStampToken&&e.push(this.timeStampToken.toSchema()),new W({value:e})}toJSON(){let e={status:this.status.toJSON()};return this.timeStampToken&&(e.timeStampToken=this.timeStampToken.toJSON()),e}async sign(e,t,n=_t(!0)){return this.assertContentType(),new A0({schema:this.timeStampToken.content}).sign(e,0,t,void 0,n)}async verify(e={signer:0,trustedCerts:[],data:Zr},t=_t(!0)){return this.assertContentType(),new A0({schema:this.timeStampToken.content}).verify(e,t)}assertContentType(){if(!this.timeStampToken)throw new Error("timeStampToken is absent in TSP response");if(this.timeStampToken.contentType!==xU)throw new Error(`Wrong format of timeStampToken: ${this.timeStampToken.contentType}`)}};$ie.CLASS_NAME="TimeStampResp";function Xie(){if(typeof globalThis<"u"&&"crypto"in globalThis){let r="webcrypto";"webkitSubtle"in globalThis.crypto&&(r="safari"),TC(r,new E0({name:r,crypto:globalThis.crypto}))}else if(typeof crypto<"u"&&"webcrypto"in crypto){let r="NodeJS ^15",e=crypto.webcrypto;TC(r,new E0({name:r,crypto:e}))}}o(Xie,"initCryptoEngine");Xie();var tD=null,pn=class{static{o(this,"Application")}static setEngine(e,t){tD=Object.assign(t,{name:e}),TC(e,new E0({name:e,crypto:t}))}static get crypto(){if(!tD)throw new Fe(Te.CRYPTOGRAPHIC_NO_MODULE);return tD}static isNodePlugin(){return typeof self>"u"&&typeof window>"u"}};function Gie(){pn.isNodePlugin()||pn.setEngine("W3 WebCrypto module",self.crypto)}o(Gie,"init");Gie();var WC=class{static{o(this,"XmlAlgorithm")}getAlgorithmName(){return this.namespaceURI}},fh=class extends WC{static{o(this,"HashAlgorithm")}async Digest(e){let t;if(typeof e=="string")t=vr.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=Ma(e);t=vr.FromString(s,"utf8")}let n=await pn.crypto.subtle.digest(this.algorithm,t);return new Uint8Array(n)}},dn=class extends WC{static{o(this,"SignatureAlgorithm")}async Sign(e,t,n){let s=vr.FromString(e,"utf8");return pn.crypto.subtle.sign(n,t,s)}async Verify(e,t,n){let s=this.algorithm,i=vr.FromString(e,"utf8");return pn.crypto.subtle.verify(s,t,n,i)}};var Dn="SHA-1",Hn="SHA-256",Kn="SHA-384",$n="SHA-512",x0="http://www.w3.org/2000/09/xmldsig#sha1",N0="http://www.w3.org/2001/04/xmlenc#sha256",T0="http://www.w3.org/2001/04/xmldsig-more#sha384",I0="http://www.w3.org/2001/04/xmlenc#sha512",JC=class extends fh{static{o(this,"Sha1")}constructor(){super(...arguments),this.algorithm={name:Dn},this.namespaceURI=x0}},gv=class extends fh{static{o(this,"Sha256")}constructor(){super(...arguments),this.algorithm={name:Hn},this.namespaceURI=N0}},zC=class extends fh{static{o(this,"Sha384")}constructor(){super(...arguments),this.algorithm={name:Kn},this.namespaceURI=T0}},YC=class extends fh{static{o(this,"Sha512")}constructor(){super(...arguments),this.algorithm={name:$n},this.namespaceURI=I0}};var Yo="ECDSA",QC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1",ZC="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256",e2="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384",t2="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512";function r2(r){if(r.name.toUpperCase()===Yo.toUpperCase())switch(r.hash.name.toUpperCase()){case Dn:return new B0;case Hn:return new D0;case Kn:return new _0;case $n:return new R0}return null}o(r2,"fromAlgorithm");var B0=class extends dn{static{o(this,"EcdsaSha1")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Dn}},this.namespaceURI=QC}static fromAlgorithm(e){return r2(e)}},D0=class extends dn{static{o(this,"EcdsaSha256")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Hn}},this.namespaceURI=ZC}static fromAlgorithm(e){return r2(e)}},_0=class extends dn{static{o(this,"EcdsaSha384")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:Kn}},this.namespaceURI=e2}static fromAlgorithm(e){return r2(e)}},R0=class extends dn{static{o(this,"EcdsaSha512")}constructor(){super(...arguments),this.algorithm={name:Yo,hash:{name:$n}},this.namespaceURI=t2}static fromAlgorithm(e){return r2(e)}};var P0="HMAC",rD="http://www.w3.org/2000/09/xmldsig#hmac-sha1",nD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha256",sD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha384",iD="http://www.w3.org/2001/04/xmldsig-more#hmac-sha512";function n2(r){if(r.name.toUpperCase()===P0.toUpperCase())switch(r.hash.name.toUpperCase()){case Dn:return new yv;case Hn:return new vv;case Kn:return new wv;case $n:return new Sv}return null}o(n2,"fromAlgorithm");var yv=class extends dn{static{o(this,"HmacSha1")}constructor(){super(...arguments),this.algorithm={name:P0,hash:{name:Dn}},this.namespaceURI=rD}static fromAlgorithm(e){return n2(e)}},vv=class extends dn{static{o(this,"HmacSha256")}constructor(){super(...arguments),this.algorithm={name:P0,hash:{name:Hn}},this.namespaceURI=nD}static fromAlgorithm(e){return n2(e)}},wv=class extends dn{static{o(this,"HmacSha384")}constructor(){super(...arguments),this.algorithm={name:P0,hash:{name:Kn}},this.namespaceURI=sD}static fromAlgorithm(e){return n2(e)}},Sv=class extends dn{static{o(this,"HmacSha512")}constructor(){super(...arguments),this.algorithm={name:P0,hash:{name:$n}},this.namespaceURI=iD}static fromAlgorithm(e){return n2(e)}};var Qo="RSASSA-PKCS1-v1_5",s2="http://www.w3.org/2000/09/xmldsig#rsa-sha1",i2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",a2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha384",o2="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";function u2(r){if(r.name.toUpperCase()===Qo.toUpperCase())switch(r.hash.name.toUpperCase()){case Dn:return new O0;case Hn:return new k0;case Kn:return new L0;case $n:return new V0}return null}o(u2,"fromAlgorithm");var O0=class extends dn{static{o(this,"RsaPkcs1Sha1")}constructor(){super(...arguments),this.algorithm={name:Qo,hash:{name:Dn}},this.namespaceURI=s2}static fromAlgorithm(e){return u2(e)}},k0=class extends dn{static{o(this,"RsaPkcs1Sha256")}constructor(){super(...arguments),this.algorithm={name:Qo,hash:{name:Hn}},this.namespaceURI=i2}static fromAlgorithm(e){return u2(e)}},L0=class extends dn{static{o(this,"RsaPkcs1Sha384")}constructor(){super(...arguments),this.algorithm={name:Qo,hash:{name:Kn}},this.namespaceURI=a2}static fromAlgorithm(e){return u2(e)}},V0=class extends dn{static{o(this,"RsaPkcs1Sha512")}constructor(){super(...arguments),this.algorithm={name:Qo,hash:{name:$n}},this.namespaceURI=o2}static fromAlgorithm(e){return u2(e)}};function He(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 u=r.length-1;u>=0;u--)(a=r[u])&&(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}o(He,"__decorate");function ft(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}o(ft,"__metadata");var de={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 qr=class extends Ds{static{o(this,"XmlSignatureObject")}};qr=He([Mt({localName:"xmldsig",namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix})],qr);var Pi=class extends Np{static{o(this,"XmlSignatureCollection")}};Pi=He([Mt({localName:"xmldsig_collection",namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix})],Pi);var Oi=class extends qr{static{o(this,"DigestMethod")}constructor(e){super(),e&&(this.Algorithm=e)}};He([Rr({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:de.DefaultDigestMethod}),ft("design:type",String)],Oi.prototype,"Algorithm",void 0);Oi=He([Mt({localName:de.ElementNames.DigestMethod}),ft("design:paramtypes",[String])],Oi);var ei=class extends qr{static{o(this,"KeyInfoClause")}static canImportCryptoKey(e){return!1}};var Wie={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},U0=class extends ei{static{o(this,"RsaKeyValue")}constructor(){super(...arguments),this.key=null,this.jwk=null,this.keyUsage=[]}static canImportCryptoKey(e){let t=e.algorithm.name.toUpperCase();return t===Qo.toUpperCase()||t===hh.toUpperCase()}async importKey(e){let t=e.algorithm.name?e.algorithm.name.toUpperCase():"";if(t!==Qo.toUpperCase()&&t!==hh.toUpperCase())throw new Fe(Te.ALGORITHM_WRONG_NAME,e.algorithm.name);this.key=e;let n=await pn.crypto.subtle.exportKey("jwk",e);return this.jwk=n,this.Modulus=vr.FromBase64Url(n.n||""),this.Exponent=vr.FromBase64Url(n.e||""),this.keyUsage=e.usages,this}async exportKey(e=Wie){if(this.key)return this.key;if(!this.Modulus)throw new Fe(Te.CRYPTOGRAPHIC,"RsaKeyValue has no Modulus");let t=vr.ToBase64Url(this.Modulus);if(!this.Exponent)throw new Fe(Te.CRYPTOGRAPHIC,"RsaKeyValue has no Exponent");let n=vr.ToBase64Url(this.Exponent),s;switch(e.name.toUpperCase()){case Qo.toUpperCase():s="R";break;case hh.toUpperCase():s="P";break;default:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}switch(e.hash.name.toUpperCase()){case Dn:s+="S1";break;case Hn:s+="S256";break;case Kn:s+="S384";break;case $n:s+="S512";break}let i={kty:"RSA",alg:s,n:t,e:n,ext:!0};return pn.crypto.subtle.importKey("jwk",i,e,!0,this.keyUsage)}LoadXml(e){super.LoadXml(e),this.keyUsage=["verify"]}};He([Xt({localName:de.ElementNames.Modulus,prefix:de.DefaultPrefix,namespaceURI:de.NamespaceURI,required:!0,converter:xi}),ft("design:type",Object)],U0.prototype,"Modulus",void 0);He([Xt({localName:de.ElementNames.Exponent,prefix:de.DefaultPrefix,namespaceURI:de.NamespaceURI,required:!0,converter:xi}),ft("design:type",Object)],U0.prototype,"Exponent",void 0);U0=He([Mt({localName:de.ElementNames.RSAKeyValue})],U0);var aD="http://www.w3.org/2007/05/xmldsig-more#",oD="pss",M0=class extends Ds{static{o(this,"MaskGenerationFunction")}};He([Xt({parser:Oi}),ft("design:type",Oi)],M0.prototype,"DigestMethod",void 0);He([Rr({localName:de.AttributeNames.Algorithm,defaultValue:"http://www.w3.org/2007/05/xmldsig-more#MGF1"}),ft("design:type",String)],M0.prototype,"Algorithm",void 0);M0=He([Mt({localName:de.ElementNames.MaskGenerationFunction,prefix:oD,namespaceURI:aD})],M0);var aa=class extends Ds{static{o(this,"PssAlgorithmParams")}};He([Xt({parser:Oi}),ft("design:type",Oi)],aa.prototype,"DigestMethod",void 0);He([Xt({parser:M0}),ft("design:type",M0)],aa.prototype,"MGF",void 0);He([Xt({converter:fg,prefix:oD,namespaceURI:aD}),ft("design:type",Number)],aa.prototype,"SaltLength",void 0);He([Xt({converter:fg}),ft("design:type",Number)],aa.prototype,"TrailerField",void 0);aa=He([Mt({localName:de.ElementNames.RSAPSSParams,prefix:oD,namespaceURI:aD})],aa);var hh="RSA-PSS",uD="http://www.w3.org/2007/05/xmldsig-more#rsa-pss",l2=class r extends dn{static{o(this,"RsaPssWithParams")}constructor(){super(...arguments),this.algorithm={name:hh,hash:{name:Dn}},this.namespaceURI=uD}static fromAlgorithm(e){let t=null;if(e.name.toUpperCase()===hh.toUpperCase()){switch(e.hash.name.toUpperCase()){case Dn:t=new r;break;case Hn:t=new r;break;case Kn:t=new r;break;case $n: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 aa){switch(t.DigestMethod.Algorithm.toLowerCase()){case x0:this.algorithm.hash.name=Dn;break;case N0:this.algorithm.hash.name=Hn;break;case T0:this.algorithm.hash.name=Kn;break;case I0:this.algorithm.hash.name=$n;break;default:throw new Fe(Te.CRYPTOGRAPHIC,`Unsupported hash algorithm: ${t.DigestMethod.Algorithm}`)}return t.SaltLength&&(this.algorithm.saltLength=t.SaltLength),!0}return!1}))throw new Fe(Te.CRYPTOGRAPHIC,"RSA-PSS parameters not found in SignatureMethod")}toMethod(e){let t=new aa;switch(this.algorithm.hash.name.toUpperCase()){case Dn:t.DigestMethod.Algorithm=x0;break;case Hn:t.DigestMethod.Algorithm=N0;break;case Kn:t.DigestMethod.Algorithm=T0;break;case $n:t.DigestMethod.Algorithm=I0;break;default:throw new Fe(Te.CRYPTOGRAPHIC,`Unsupported hash algorithm: ${this.algorithm.hash.name}`)}this.algorithm.saltLength&&(t.SaltLength=this.algorithm.saltLength),e.Any.Add(t)}};var ti;(function(r){r[r.BeforeDocElement=0]="BeforeDocElement",r[r.InsideDocElement=1]="InsideDocElement",r[r.AfterDocElement=2]="AfterDocElement"})(ti||(ti={}));var Wa=class{static{o(this,"XmlCanonicalizer")}constructor(e,t,n=new Tp){this.propagatedNamespaces=new Tp,this.result=[],this.visibleNamespaces=new Tp,this.inclusiveNamespacesPrefixList=[],this.state=ti.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 Fe(Te.CRYPTOGRAPHIC,"Parameter 1 is not Node");return this.WriteNode(e),this.result.join("")}WriteNode(e){switch(e.nodeType){case Ut.Document:case Ut.DocumentFragment:this.WriteDocumentNode(e);break;case Ut.Element:this.WriteElementNode(e);break;case Ut.CDATA:case Ut.SignificantWhitespace:case Ut.Text:_c(e.parentNode)||this.WriteTextNode(e);break;case Ut.Whitespace:this.state===ti.InsideDocElement&&this.WriteTextNode(e);break;case Ut.Comment:this.WriteCommentNode(e);break;case Ut.ProcessingInstruction:this.WriteProcessingInstructionNode(e);break;case Ut.EntityReference:for(let t=0;t<e.childNodes.length;t++)this.WriteNode(e.childNodes[t]);break;case Ut.Attribute:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.EndElement:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.EndEntity:throw new Fe(Te.CRYPTOGRAPHIC,"Attribute node is impossible here");case Ut.DocumentType:case Ut.Entity:case Ut.Notation:case Ut.XmlDeclaration:break}}WriteDocumentNode(e){this.state=ti.BeforeDocElement;for(let t=e.firstChild;t!=null;t=t.nextSibling)this.WriteNode(t)}WriteCommentNode(e){this.withComments&&(this.state===ti.AfterDocElement?this.result.push(`
91
- <!--`):this.result.push("<!--"),this.result.push(this.NormalizeString(e.nodeValue,Ut.Comment)),this.state===ti.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===ti.AfterDocElement?this.result.push(`
93
- <?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,Ut.ProcessingInstruction))),this.state===ti.BeforeDocElement?this.result.push(`?>
94
- `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===ti.BeforeDocElement&&(this.state=ti.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===ti.BeforeDocElement&&(this.state=ti.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(!lD(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let h={prefix:a.prefix,namespace:a.namespaceURI};t.push(h),this.visibleNamespaces.Add(h),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let h={prefix:a.prefix,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}let u=null,l;(l=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(u=l[1]);let f=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,u)){let h=nM(e,u);if(h>1)f=!1;else if(h===0)continue}if(!this.IsNamespaceRendered(u,a.nodeValue)&&f){let h={prefix:u,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}}if(!this.IsNamespaceRendered(e.prefix,e.namespaceURI)&&e.namespaceURI!=="http://www.w3.org/2000/xmlns/"){let i={prefix:e.prefix,namespace:e.namespaceURI};t.push(i),this.visibleNamespaces.Add(i),n++}t.sort(zie);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];lD(s)||t.push(s)}t.sort(Yie),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,Ut.Attribute)),this.result.push('"'))})}NormalizeString(e,t){let n=[];if(e)for(let s=0;s<e.length;s++){let i=e[s];i==="<"&&(t===Ut.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===Ut.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===Ut.Attribute?n.push("&quot;"):i===" "&&t===Ut.Attribute?n.push("&#x9;"):i===`
95
- `&&t===Ut.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case Ut.Text:case Ut.CDATA:case Ut.SignificantWhitespace:case Ut.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function zie(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}o(zie,"XmlDsigC14NTransformNamespacesComparer");function Yie(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}o(Yie,"XmlDsigC14NTransformAttributesComparer");function nM(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(!lD(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===Ut.Element){let a=nM(s,e,t);if(s.nodeType===Ut.Element&&a)return++t+a}return t}o(nM,"IsNamespaceUsed");function lD(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===Ut.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}o(lD,"IsNamespaceNode");var c2=class extends Pi{static{o(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Ut.Element||n.nodeName===de.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case de.ElementNames.RSAPSSParams:s=aa;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};c2=He([Mt({localName:"Other"})],c2);var Ja=class extends qr{static{o(this,"SignatureMethod")}};He([Rr({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:""}),ft("design:type",String)],Ja.prototype,"Algorithm",void 0);He([Xt({localName:de.ElementNames.HMACOutputLength,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,converter:fg}),ft("design:type",Number)],Ja.prototype,"HMACOutputLength",void 0);He([Xt({parser:c2,noRoot:!0,minOccurs:0}),ft("design:type",c2)],Ja.prototype,"Any",void 0);Ja=He([Mt({localName:de.ElementNames.SignatureMethod})],Ja);var j0=class extends qr{static{o(this,"CanonicalizationMethod")}};He([Rr({localName:de.AttributeNames.Algorithm,required:!0,defaultValue:de.DefaultCanonMethod}),ft("design:type",String)],j0.prototype,"Algorithm",void 0);j0=He([Mt({localName:de.ElementNames.CanonicalizationMethod})],j0);var F0=class extends qr{static{o(this,"DataObject")}};He([Rr({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],F0.prototype,"Id",void 0);He([Rr({localName:de.AttributeNames.MimeType,defaultValue:""}),ft("design:type",String)],F0.prototype,"MimeType",void 0);He([Rr({localName:de.AttributeNames.Encoding,defaultValue:""}),ft("design:type",String)],F0.prototype,"Encoding",void 0);F0=He([Mt({localName:de.ElementNames.Object})],F0);var Ev=class extends Pi{static{o(this,"DataObjects")}};Ev=He([Mt({localName:"xmldsig_objects",parser:F0})],Ev);var ns=class extends qr{static{o(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new Fe(Te.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};He([Rr({localName:de.AttributeNames.Algorithm,defaultValue:""}),ft("design:type",String)],ns.prototype,"Algorithm",void 0);He([Xt({localName:de.ElementNames.XPath,defaultValue:""}),ft("design:type",String)],ns.prototype,"XPath",void 0);ns=He([Mt({localName:de.ElementNames.Transform})],ns);var Zo=class extends ns{static{o(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=de.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return vr.FromString(this.innerXml.textContent||"","base64")}};var za=class extends ns{static{o(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new Wa(!1,!1)}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},Ya=class extends za{static{o(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new Wa(!0,!1)}};var eu=class extends ns{static{o(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)zs(e)&&e.localName===de.ElementNames.Signature&&e.namespaceURI===de.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var Qa=class extends ns{static{o(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new Wa(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},Za=class extends Qa{static{o(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new Wa(!0,!0)}};function sM(r){return r.parentNode?sM(r.parentNode):r}o(sM,"lookupParentNode");var q0=class extends ns{static{o(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=de.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");this.Filter(sM(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:xp("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,u=typeof self>"u"?xp("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:o(f=>i.lookupNamespaceURI(f),"lookupNamespaceURI")},u.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};He([Xt({localName:de.ElementNames.XPath,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],q0.prototype,"XPath",void 0);var H0=class extends Pi{static{o(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return ph(t,eu);case de.AlgorithmNamespaces.XmlDsigC14NTransform:return ph(t,za);case de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return ph(t,Ya);case de.AlgorithmNamespaces.XmlDsigExcC14NTransform:return ph(t,Qa);case de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return ph(t,Za);case de.AlgorithmNamespaces.XmlDsigBase64Transform:return ph(t,Zo);case de.AlgorithmNamespaces.XmlDsigXPathTransform:return ph(t,q0);default:try{let n=Av.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new Fe(Te.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};H0=He([Mt({localName:de.ElementNames.Transforms,parser:ns})],H0);function ph(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}o(ph,"ChangeTransform");var eo=class extends qr{static{o(this,"Reference")}constructor(e){super(),this.DigestMethod=new Oi,e&&(this.Uri=e)}};He([Rr({defaultValue:""}),ft("design:type",String)],eo.prototype,"Id",void 0);He([Rr({localName:de.AttributeNames.URI}),ft("design:type",String)],eo.prototype,"Uri",void 0);He([Rr({localName:de.AttributeNames.Type,defaultValue:""}),ft("design:type",String)],eo.prototype,"Type",void 0);He([Xt({parser:H0}),ft("design:type",H0)],eo.prototype,"Transforms",void 0);He([Xt({required:!0,parser:Oi}),ft("design:type",Oi)],eo.prototype,"DigestMethod",void 0);He([Xt({required:!0,localName:de.ElementNames.DigestValue,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,converter:xi}),ft("design:type",Uint8Array)],eo.prototype,"DigestValue",void 0);eo=He([Mt({localName:de.ElementNames.Reference}),ft("design:paramtypes",[String])],eo);var K0=class extends Pi{static{o(this,"References")}};K0=He([Mt({localName:"References",parser:eo})],K0);var tu=class extends qr{static{o(this,"SignedInfo")}};He([Rr({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],tu.prototype,"Id",void 0);He([Xt({parser:j0,required:!0}),ft("design:type",j0)],tu.prototype,"CanonicalizationMethod",void 0);He([Xt({parser:Ja,required:!0}),ft("design:type",Ja)],tu.prototype,"SignatureMethod",void 0);He([Xt({parser:K0,minOccurs:1,noRoot:!0}),ft("design:type",K0)],tu.prototype,"References",void 0);tu=He([Mt({localName:de.ElementNames.SignedInfo})],tu);var W0="http://www.w3.org/2001/04/xmldsig-more#",J0="ecdsa",dh=class extends Ds{static{o(this,"EcdsaPublicKey")}};He([Xt({localName:de.ElementNames.X,namespaceURI:W0,prefix:J0,required:!0,converter:xi}),ft("design:type",Uint8Array)],dh.prototype,"X",void 0);He([Xt({localName:de.ElementNames.Y,namespaceURI:W0,prefix:J0,required:!0,converter:xi}),ft("design:type",Uint8Array)],dh.prototype,"Y",void 0);dh=He([Mt({localName:de.ElementNames.PublicKey,namespaceURI:W0,prefix:J0})],dh);var $0=class extends Ds{static{o(this,"NamedCurve")}};He([Rr({localName:de.AttributeNames.URI,required:!0}),ft("design:type",String)],$0.prototype,"Uri",void 0);$0=He([Mt({localName:de.ElementNames.NamedCurve,namespaceURI:W0,prefix:J0})],$0);var X0=class extends Ds{static{o(this,"DomainParameters")}};He([Xt({parser:$0}),ft("design:type",$0)],X0.prototype,"NamedCurve",void 0);X0=He([Mt({localName:de.ElementNames.DomainParameters,namespaceURI:W0,prefix:J0})],X0);var G0=class extends ei{static{o(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=de.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===Yo.toUpperCase()}get NamedCurve(){return aM(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new Fe(Te.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await pn.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new dh,this.PublicKey.X=vr.FromString(t.x||"","base64url"),this.PublicKey.Y=vr.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new X0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new $0),this.DomainParameters.NamedCurve.Uri=aM(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=vr.ToBase64Url(this.PublicKey.X),n=vr.ToBase64Url(this.PublicKey.Y),s=Qie(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await pn.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};He([Xt({parser:X0}),ft("design:type",X0)],G0.prototype,"DomainParameters",void 0);He([Xt({parser:dh,required:!0}),ft("design:type",dh)],G0.prototype,"PublicKey",void 0);G0=He([Mt({localName:de.ElementNames.ECDSAKeyValue,namespaceURI:W0,prefix:J0})],G0);function aM(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new Fe(Te.CRYPTOGRAPHIC,"Unknown NamedCurve")}o(aM,"GetNamedCurveOid");function Qie(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new Fe(Te.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}o(Qie,"GetNamedCurveFromOid");var Zie=class extends Map{static{o(this,"KeyInfoClauseRegistry")}},ec=new Zie;ec.set(de.ElementNames.RSAKeyValue,U0);ec.set(de.ElementNames.ECDSAKeyValue,G0);var f2=class{static{o(this,"KeyInfoClauseFactory")}static create(e){let t=ec.get(e);if(!t)throw new Fe(Te.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var Cv=class extends ei{static{o(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of ec)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new Fe(Te.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new Fe(Te.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(zs(n))try{let s=n.localName,i=f2.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new Fe(Te.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};Cv=He([Mt({localName:de.ElementNames.KeyValue}),ft("design:paramtypes",[ei])],Cv);var eae={"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"}},z0=class{static{o(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return pn.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()===Yo){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=eae[i.toString()],u=a?a.short:null;n.push(`${u||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Kr(this.raw.buffer);this.simpl=new rs({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var h2=class extends qr{static{o(this,"X509IssuerSerial")}};He([Xt({localName:de.ElementNames.X509IssuerName,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],h2.prototype,"X509IssuerName",void 0);He([Xt({localName:de.ElementNames.X509SerialNumber,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0}),ft("design:type",String)],h2.prototype,"X509SerialNumber",void 0);h2=He([Mt({localName:de.ElementNames.X509IssuerSerial})],h2);var mh;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(mh||(mh={}));var Y0=class extends ei{static{o(this,"KeyInfoX509Data")}constructor(e,t=mh.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new z0(e));else if(e instanceof z0)switch(t){case mh.None:case mh.EndCertOnly:this.AddCertificate(e);break;case mh.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case mh.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new Fe(Te.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new Fe(Te.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new Fe(Te.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=vr.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(de.NamespaceURI,n+de.ElementNames.X509IssuerSerial),a=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let u=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SerialNumber);u.textContent=s.serialNumber,i.appendChild(u),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SKI);i.textContent=vr.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509Certificate);i.textContent=vr.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(de.NamespaceURI,n+de.ElementNames.X509CRL);s.textContent=vr.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(de.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=qr.GetChild(s,de.ElementNames.X509IssuerName,de.NamespaceURI,!0),a=qr.GetChild(s,de.ElementNames.X509SerialNumber,de.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(de.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=vr.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(de.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(de.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=vr.FromBase64(s.textContent);this.AddCertificate(new z0(i))}});let n=this.GetChild(de.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=vr.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};Y0=He([Mt({localName:de.ElementNames.X509Data}),ft("design:paramtypes",[Object,Object])],Y0);var bv=class extends ei{static{o(this,"SPKIData")}async importKey(e){let t=await pn.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 pn.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};He([Xt({localName:de.ElementNames.SPKIexp,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0,converter:xi}),ft("design:type",Object)],bv.prototype,"SPKIexp",void 0);bv=He([Mt({localName:de.ElementNames.SPKIData})],bv);var gh=class extends Pi{static{o(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Ut.Element)continue;let s=null;switch(n.localName){case de.ElementNames.KeyValue:s=Cv;break;case de.ElementNames.X509Data:s=Y0;break;case de.ElementNames.SPKIData:s=bv;break;case de.ElementNames.KeyName:case de.ElementNames.RetrievalMethod:case de.ElementNames.PGPData:case de.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};He([Rr({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],gh.prototype,"Id",void 0);gh=He([Mt({localName:de.ElementNames.KeyInfo})],gh);var tc=class extends qr{static{o(this,"Signature")}};He([Rr({localName:de.AttributeNames.Id,defaultValue:""}),ft("design:type",String)],tc.prototype,"Id",void 0);He([Xt({parser:tu,required:!0}),ft("design:type",tu)],tc.prototype,"SignedInfo",void 0);He([Xt({localName:de.ElementNames.SignatureValue,namespaceURI:de.NamespaceURI,prefix:de.DefaultPrefix,required:!0,converter:xi,defaultValue:null}),ft("design:type",Object)],tc.prototype,"SignatureValue",void 0);He([Xt({parser:gh}),ft("design:type",gh)],tc.prototype,"KeyInfo",void 0);He([Xt({parser:Ev,noRoot:!0}),ft("design:type",Ev)],tc.prototype,"ObjectList",void 0);tc=He([Mt({localName:de.ElementNames.Signature})],tc);var rae=class extends Map{static{o(this,"AlgorithmRegistry")}},hr=new rae;hr.set(s2,{type:"signature",algorithm:O0});hr.set(i2,{type:"signature",algorithm:k0});hr.set(a2,{type:"signature",algorithm:L0});hr.set(o2,{type:"signature",algorithm:V0});hr.set(s2,{type:"signature",algorithm:O0});hr.set(i2,{type:"signature",algorithm:k0});hr.set(a2,{type:"signature",algorithm:L0});hr.set(o2,{type:"signature",algorithm:V0});hr.set(uD,{type:"signature",algorithm:l2});hr.set(QC,{type:"signature",algorithm:B0});hr.set(ZC,{type:"signature",algorithm:D0});hr.set(e2,{type:"signature",algorithm:_0});hr.set(t2,{type:"signature",algorithm:R0});hr.set(QC.toUpperCase(),{type:"signature",algorithm:B0});hr.set(ZC.toUpperCase(),{type:"signature",algorithm:D0});hr.set(e2.toUpperCase(),{type:"signature",algorithm:_0});hr.set(t2.toUpperCase(),{type:"signature",algorithm:R0});hr.set(rD,{type:"signature",algorithm:yv});hr.set(nD,{type:"signature",algorithm:vv});hr.set(sD,{type:"signature",algorithm:wv});hr.set(iD,{type:"signature",algorithm:Sv});hr.set(x0,{type:"hash",algorithm:JC});hr.set(N0,{type:"hash",algorithm:gv});hr.set(T0,{type:"hash",algorithm:zC});hr.set(I0,{type:"hash",algorithm:YC});var yh=class{static{o(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of hr)if(n==="hash"&&t===e)return new s;throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of hr)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of hr)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of hr)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}};var nae=class extends Map{static{o(this,"TransformRegistry")}},ru=new nae;ru.set(de.AlgorithmNamespaces.XmlDsigBase64Transform,Zo);ru.set(de.AlgorithmNamespaces.XmlDsigC14NTransform,za);ru.set(de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,Ya);ru.set(de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,eu);ru.set(de.AlgorithmNamespaces.XmlDsigExcC14NTransform,Qa);ru.set(de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,Za);var Av=class{static{o(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"name");let t=ru.get(e);if(t)return new t;let n;switch(e){case de.AlgorithmNamespaces.XmlDsigBase64Transform:n=new Zo;break;case de.AlgorithmNamespaces.XmlDsigC14NTransform:n=new za;break;case de.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new Ya;break;case de.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new eu;break;case de.AlgorithmNamespaces.XmlDsigXPathTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);case de.AlgorithmNamespaces.XmlDsigXsltTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);case de.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new Qa;break;case de.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new Za;break;case de.AlgorithmNamespaces.XmlDecryptionTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);default:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return yh.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return yh.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return yh.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}),yh.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new Ja;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){hr.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){hr.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){ec.set(e,t)}static RegisterTransform(e,t){ru.set(e,t)}};var p2=dw(ZN(),1);var oM={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var uM={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var iae=o(r=>!!r&&typeof r=="object"&&"message"in r,"hasMessageInRecord"),lM=o(r=>typeof r=="string"?co(new $s(r)):r instanceof Error?co(new $s(r.message,{cause:r.cause})):iae(r)?co(new $s(r.message)):co(new $s("unexpected error")),"leftFromError");var cM=class{static{o(this,"Xml2JsToolkit")}xml2js;constructor(e=oae){this.xml2js=e,xV({XMLSerializer:p2.default.XMLSerializer,DOMParser:p2.default.DOMParser,DOMImplementation:p2.default.DOMImplementation})}async validate(e,t){try{return await Q8.validate(e,t),kh()}catch(n){return lM(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...uM,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...oM,...t}).buildObject(e))}digest(e,t,n=mm){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=mm){let n=bi(this.clear(e));return new Wa(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let s=bi(e).documentElement.getElementsByTagName(t).item(0);return s?this.clear(Ma(s)):null}getFirstNode(e){let n=bi(e).documentElement.firstChild;return n?this.clear(Ma(n)):null}getAttribute(e,t){return bi(e).documentElement.getAttribute(t)}appendNode(e,t){let n=bi(e),{documentElement:s}=bi(t);return n.documentElement.appendChild(s),this.clear(Ma(n))}hash(e,t){return aae.createHash(t).update(e,"utf8").digest().toString("base64")}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"))}};export{Bb as a,kR as b,Db as c,Ph as d,_b as e,Sr as f,lae as g,fae as h,$s as i,LR as j,Rb as k,Oh as l,Pb as m,gw as n,co as o,kh as p,VR as q,UR as r,gm as s,noe as t,soe as u,yw as v,MR as w,jR as x,FR as y,doe as z,qR as A,boe as B,_oe as C,Foe as D,$R as E,XR as F,GR as G,WR as H,JR as I,zR as J,YR as K,QR as L,ZR as M,eP as N,tP as O,rP as P,nP as Q,sP as R,iP as S,aP as T,oP as U,uP as V,lP as W,cP as X,fP as Y,hP as Z,pP as _,dP as $,mP as aa,gP as ba,yP as ca,vP as da,PP as ea,OP as fa,Q3 as ga,Z3 as ha,z8 as ia,lM as ja,cM as ka};
97
- /*! Bundled license information:
98
-
99
- lodash/lodash.js:
100
- (**
101
- * @license
102
- * Lodash <https://lodash.com/>
103
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
104
- * Released under MIT license <https://lodash.com/license>
105
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
106
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
107
- *)
108
-
109
- axios/dist/node/axios.cjs:
110
- (*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors *)
111
-
112
- js-md4/src/md4.js:
113
- (**
114
- * [js-md4]{@link https://github.com/emn178/js-md4}
115
- *
116
- * @namespace md4
117
- * @version 0.3.2
118
- * @author Yi-Cyuan Chen [emn178@gmail.com]
119
- * @copyright Yi-Cyuan Chen 2015-2027
120
- * @license MIT
121
- *)
122
-
123
- sax/lib/sax.js:
124
- (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
125
-
126
- decimal.js/decimal.mjs:
127
- (*!
128
- * decimal.js v10.6.0
129
- * An arbitrary-precision Decimal type for JavaScript.
130
- * https://github.com/MikeMcl/decimal.js
131
- * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
132
- * MIT Licence
133
- *)
134
-
135
- pvtsutils/build/index.es.js:
136
- (*!
137
- * MIT License
138
- *
139
- * Copyright (c) 2017-2024 Peculiar Ventures, LLC
140
- *
141
- * Permission is hereby granted, free of charge, to any person obtaining a copy
142
- * of this software and associated documentation files (the "Software"), to deal
143
- * in the Software without restriction, including without limitation the rights
144
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
- * copies of the Software, and to permit persons to whom the Software is
146
- * furnished to do so, subject to the following conditions:
147
- *
148
- * The above copyright notice and this permission notice shall be included in all
149
- * copies or substantial portions of the Software.
150
- *
151
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
157
- * SOFTWARE.
158
- *
159
- *)
160
-
161
- pvutils/build/utils.es.js:
162
- (*!
163
- Copyright (c) Peculiar Ventures, LLC
164
- *)
165
-
166
- asn1js/build/index.es.js:
167
- (*!
168
- * Copyright (c) 2014, GMO GlobalSign
169
- * Copyright (c) 2015-2022, Peculiar Ventures
170
- * All rights reserved.
171
- *
172
- * Author 2014-2019, Yury Strozhevsky
173
- *
174
- * Redistribution and use in source and binary forms, with or without modification,
175
- * are permitted provided that the following conditions are met:
176
- *
177
- * * Redistributions of source code must retain the above copyright notice, this
178
- * list of conditions and the following disclaimer.
179
- *
180
- * * Redistributions in binary form must reproduce the above copyright notice, this
181
- * list of conditions and the following disclaimer in the documentation and/or
182
- * other materials provided with the distribution.
183
- *
184
- * * Neither the name of the copyright holder nor the names of its
185
- * contributors may be used to endorse or promote products derived from
186
- * this software without specific prior written permission.
187
- *
188
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
189
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
190
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
191
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
192
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
193
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
194
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
195
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
196
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
197
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
198
- *
199
- *)
200
-
201
- @noble/hashes/esm/utils.js:
202
- (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
203
-
204
- pkijs/build/index.es.js:
205
- (*!
206
- * Copyright (c) 2014, GlobalSign
207
- * Copyright (c) 2015-2019, Peculiar Ventures
208
- * All rights reserved.
209
- *
210
- * Author 2014-2019, Yury Strozhevsky
211
- *
212
- * Redistribution and use in source and binary forms, with or without modification,
213
- * are permitted provided that the following conditions are met:
214
- *
215
- * * Redistributions of source code must retain the above copyright notice, this
216
- * list of conditions and the following disclaimer.
217
- *
218
- * * Redistributions in binary form must reproduce the above copyright notice, this
219
- * list of conditions and the following disclaimer in the documentation and/or
220
- * other materials provided with the distribution.
221
- *
222
- * * Neither the name of the {organization} nor the names of its
223
- * contributors may be used to endorse or promote products derived from
224
- * this software without specific prior written permission.
225
- *
226
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
227
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
228
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
229
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
230
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
231
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
232
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
233
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
234
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
235
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
236
- *
237
- *)
238
- */