@blamejs/blamejs-shop 0.4.89 → 0.4.90

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,28 +1,28 @@
1
- // @simplewebauthn/server v13.3.1 — vendored. License: MIT
1
+ // @simplewebauthn/server v13.3.2 — vendored. License: MIT
2
2
  // https://github.com/MasterKale/SimpleWebAuthn
3
- var eh=Object.defineProperty;var Dx=Object.getOwnPropertyDescriptor;var Ux=Object.getOwnPropertyNames;var Lx=Object.prototype.hasOwnProperty;var Eb=(t,e)=>()=>(t&&(e=t(t=0)),e);var l=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Tb=(t,e)=>{for(var r in e)eh(t,r,{get:e[r],enumerable:!0})},Kx=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ux(e))!Lx.call(t,n)&&n!==r&&eh(t,n,{get:()=>e[n],enumerable:!(i=Dx(e,n))||i.enumerable});return t};var g=t=>Kx(eh({},"__esModule",{value:!0}),t);var xb=l((th,rh)=>{(function(t,e){typeof th=="object"&&typeof rh<"u"?rh.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.base64=e())})(th,(function(){"use strict";let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",r=c=>{let u=typeof Uint8Array>"u"?[]:new Uint8Array(256),f=t.length;for(let d=0;d<f;d++)u[c.charCodeAt(d)]=d;return u},i=r(t),n=r(e),s=/^[-A-Za-z0-9\-_]*$/,o=/^[-A-Za-z0-9+/]*={0,3}$/,a={};return a.toArrayBuffer=(c,u)=>{let f=c.length,d=c.length*.75,y,m=0,x,T,I,U;c[c.length-1]==="="&&(d--,c[c.length-2]==="="&&d--);let ee=new ArrayBuffer(d),pe=new Uint8Array(ee),Ae=u?n:i;for(y=0;y<f;y+=4)x=Ae[c.charCodeAt(y)],T=Ae[c.charCodeAt(y+1)],I=Ae[c.charCodeAt(y+2)],U=Ae[c.charCodeAt(y+3)],pe[m++]=x<<2|T>>4,pe[m++]=(T&15)<<4|I>>2,pe[m++]=(I&3)<<6|U&63;return ee},a.fromArrayBuffer=(c,u)=>{let f=new Uint8Array(c),d,y="",m=f.length,x=u?e:t;for(d=0;d<m;d+=3)y+=x[f[d]>>2],y+=x[(f[d]&3)<<4|f[d+1]>>4],y+=x[(f[d+1]&15)<<2|f[d+2]>>6],y+=x[f[d+2]&63];let T=m%3;return T===2?y=y.substring(0,y.length-1)+(u?"":"="):T===1&&(y=y.substring(0,y.length-2)+(u?"":"==")),y},a.toString=(c,u)=>new TextDecoder().decode(a.toArrayBuffer(c,u)),a.fromString=(c,u)=>a.fromArrayBuffer(new TextEncoder().encode(c),u),a.validate=(c,u)=>{if(!(typeof c=="string"||c instanceof String))return!1;try{return u?s.test(c):o.test(c)}catch{return!1}},a.base64=a,a}))});var Ib=l(nr=>{"use strict";var Vx=nr&&nr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nr,"__esModule",{value:!0});nr.toBuffer=Gx;nr.fromBuffer=Fx;nr.toBase64=Hx;nr.fromUTF8String=Wx;nr.toUTF8String=$x;nr.isBase64=zx;nr.isBase64URL=Yx;nr.trimPadding=Ob;var Qi=Vx(xb());function Gx(t,e="base64url"){let r=Qi.default.toArrayBuffer(t,e==="base64url");return new Uint8Array(r)}function Fx(t,e="base64url"){let r=new Uint8Array(t);return Qi.default.fromArrayBuffer(r.buffer,e==="base64url")}function Hx(t){let e=Qi.default.toArrayBuffer(t,!0);return Qi.default.fromArrayBuffer(e)}function Wx(t){return Qi.default.fromString(t,!0)}function $x(t){return Qi.default.toString(t,!0)}function zx(t){return Qi.default.validate(t,!1)}function Yx(t){return t=Ob(t),Qi.default.validate(t,!0)}function Ob(t){return t.replace(/=/g,"")}});var Bb=l(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.encodeLength=ke.MAJOR_TYPE_SIMPLE_OR_FLOAT=ke.MAJOR_TYPE_TAG=ke.MAJOR_TYPE_MAP=ke.MAJOR_TYPE_ARRAY=ke.MAJOR_TYPE_TEXT_STRING=ke.MAJOR_TYPE_BYTE_STRING=ke.MAJOR_TYPE_NEGATIVE_INTEGER=ke.MAJOR_TYPE_UNSIGNED_INTEGER=ke.decodeLength=void 0;function Jx(t,e,r){if(e<24)return[e,1];let i=t.byteLength-r-1,n=new DataView(t.buffer,r+1),s,o=0;switch(e){case 24:{i>0&&(s=n.getUint8(0),o=2);break}case 25:{i>1&&(s=n.getUint16(0,!1),o=3);break}case 26:{i>3&&(s=n.getUint32(0,!1),o=5);break}case 27:{if(i>7){let a=n.getBigUint64(0,!1);if(a>=24n&&a<=Number.MAX_SAFE_INTEGER)return[Number(a),9]}break}}if(s&&s>=24)return[s,o];throw new Error("Length not supported or not well formed")}ke.decodeLength=Jx;ke.MAJOR_TYPE_UNSIGNED_INTEGER=0;ke.MAJOR_TYPE_NEGATIVE_INTEGER=1;ke.MAJOR_TYPE_BYTE_STRING=2;ke.MAJOR_TYPE_TEXT_STRING=3;ke.MAJOR_TYPE_ARRAY=4;ke.MAJOR_TYPE_MAP=5;ke.MAJOR_TYPE_TAG=6;ke.MAJOR_TYPE_SIMPLE_OR_FLOAT=7;function Qx(t,e){let r=t<<5;if(e<0)throw new Error("CBOR Data Item argument must not be negative");let i;if(typeof e=="number"){if(!Number.isInteger(e))throw new Error("CBOR Data Item argument must be an integer");i=BigInt(e)}else i=e;if(t==ke.MAJOR_TYPE_NEGATIVE_INTEGER){if(i==0n)throw new Error("CBOR Data Item argument cannot be zero when negative");i=i-1n}if(i>18446744073709551615n)throw new Error("CBOR number out of range");let n=new Uint8Array(8);return new DataView(n.buffer).setBigUint64(0,i,!1),i<=23?[r|n[7]]:i<=255?[r|24,n[7]]:i<=65535?[r|25,...n.slice(6)]:i<=4294967295?[r|26,...n.slice(4)]:[r|27,...n]}ke.encodeLength=Qx});var Nb=l(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.encodeCBOR=Yr.decodeCBOR=Yr.decodePartialCBOR=Yr.CBORTag=void 0;var le=Bb(),Sc=class{constructor(e,r){Object.defineProperty(this,"tagId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tagValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tagId=e,this.tagValue=r}get tag(){return this.tagId}get value(){return this.tagValue}};Yr.CBORTag=Sc;function kb(t,e,r){return(0,le.decodeLength)(t,e,r)}function Xx(t,e,r){let[i,n]=kb(t,e,r);return[-i-1,n]}function jb(t,e,r){let[i,n]=(0,le.decodeLength)(t,e,r),s=r+n;return[new Uint8Array(t.buffer.slice(s,s+i)),n+i]}var Zx=new TextDecoder;function eO(t,e,r){let[i,n]=jb(t,e,r);return[Zx.decode(i),n]}function tO(t,e,r){if(e===0)return[[],1];let[i,n]=(0,le.decodeLength)(t,e,r),s=n,o=[];for(let a=0;a<i;a++){if(t.byteLength-r-s<=0)throw new Error("array is not supported or well formed");let[u,f]=Rn(t,r+s);o.push(u),s+=f}return[o,s]}var Vf="Map is not supported or well formed";function rO(t,e,r){if(e===0)return[new Map,1];let[i,n]=(0,le.decodeLength)(t,e,r),s=n,o=new Map;for(let a=0;a<i;a++){let c=t.byteLength-r-s;if(c<=0)throw new Error(Vf);let[u,f]=Rn(t,r+s);if(s+=f,c-=f,c<=0)throw new Error(Vf);if(typeof u!="string"&&typeof u!="number")throw new Error(Vf);if(o.has(u))throw new Error(Vf);let[d,y]=Rn(t,r+s);s+=y,o.set(u,d)}return[o,s]}function iO(t,e){if(e+3>t.byteLength)throw new Error("CBOR stream ended before end of Float 16");let r=t.getUint16(e+1,!1);if(r==31744)return[1/0,3];if(r==32256)return[NaN,3];if(r==64512)return[-1/0,3];throw new Error("Float16 data is unsupported")}function nO(t,e){if(e+5>t.byteLength)throw new Error("CBOR stream ended before end of Float 32");return[t.getFloat32(e+1,!1),5]}function sO(t,e){if(e+9>t.byteLength)throw new Error("CBOR stream ended before end of Float 64");return[t.getFloat64(e+1,!1),9]}function oO(t,e,r){let[i,n]=(0,le.decodeLength)(t,e,r),[s,o]=Rn(t,r+n);return[new Sc(i,s),n+o]}function Rn(t,e){if(e>=t.byteLength)throw new Error("CBOR stream ended before tag value");let r=t.getUint8(e),i=r>>5,n=r&31;switch(i){case le.MAJOR_TYPE_UNSIGNED_INTEGER:return kb(t,n,e);case le.MAJOR_TYPE_NEGATIVE_INTEGER:return Xx(t,n,e);case le.MAJOR_TYPE_BYTE_STRING:return jb(t,n,e);case le.MAJOR_TYPE_TEXT_STRING:return eO(t,n,e);case le.MAJOR_TYPE_ARRAY:return tO(t,n,e);case le.MAJOR_TYPE_MAP:return rO(t,n,e);case le.MAJOR_TYPE_TAG:return oO(t,n,e);case le.MAJOR_TYPE_SIMPLE_OR_FLOAT:switch(n){case 20:return[!1,1];case 21:return[!0,1];case 22:return[null,1];case 23:return[void 0,1];case 25:return iO(t,e);case 26:return nO(t,e);case 27:return sO(t,e)}}throw new Error(`Unsupported or not well formed at ${e}`)}function aO(t){return t===!0?245:t===!1?244:t===null?246:247}function cO(t){if(Math.fround(t)==t||!Number.isFinite(t)||Number.isNaN(t)){let e=new Uint8Array(5);return e[0]=250,new DataView(e.buffer).setFloat32(1,t,!1),e}else{let e=new Uint8Array(9);return e[0]=251,new DataView(e.buffer).setFloat64(1,t,!1),e}}function uO(t){return typeof t=="number"?Number.isSafeInteger(t)?t<0?(0,le.encodeLength)(le.MAJOR_TYPE_NEGATIVE_INTEGER,Math.abs(t)):(0,le.encodeLength)(le.MAJOR_TYPE_UNSIGNED_INTEGER,t):[cO(t)]:t<0n?(0,le.encodeLength)(le.MAJOR_TYPE_NEGATIVE_INTEGER,t*-1n):(0,le.encodeLength)(le.MAJOR_TYPE_UNSIGNED_INTEGER,t)}var lO=new TextEncoder;function fO(t,e){e.push(...(0,le.encodeLength)(le.MAJOR_TYPE_TEXT_STRING,t.length)),e.push(lO.encode(t))}function dO(t,e){e.push(...(0,le.encodeLength)(le.MAJOR_TYPE_BYTE_STRING,t.length)),e.push(t)}function pO(t,e){e.push(...(0,le.encodeLength)(le.MAJOR_TYPE_ARRAY,t.length));for(let r of t)wc(r,e)}function yO(t,e){e.push(new Uint8Array((0,le.encodeLength)(le.MAJOR_TYPE_MAP,t.size)));for(let[r,i]of t.entries())wc(r,e),wc(i,e)}function _O(t,e){e.push(...(0,le.encodeLength)(le.MAJOR_TYPE_TAG,t.tag)),wc(t.value,e)}function wc(t,e){if(typeof t=="boolean"||t===null||t==null){e.push(aO(t));return}if(typeof t=="number"||typeof t=="bigint"){e.push(...uO(t));return}if(typeof t=="string"){fO(t,e);return}if(t instanceof Uint8Array){dO(t,e);return}if(Array.isArray(t)){pO(t,e);return}if(t instanceof Map){yO(t,e);return}if(t instanceof Sc){_O(t,e);return}throw new Error("Not implemented")}function Mb(t,e){if(t.byteLength===0||t.byteLength<=e||e<0)throw new Error("No data");return t instanceof Uint8Array?Rn(new DataView(t.buffer),e):t instanceof ArrayBuffer?Rn(new DataView(t),e):Rn(t,e)}Yr.decodePartialCBOR=Mb;function hO(t){let[e,r]=Mb(t,0);if(r!==t.byteLength)throw new Error(`Data was decoded, but the whole stream was not processed ${r} != ${t.byteLength}`);return e}Yr.decodeCBOR=hO;function gO(t){let e=[];wc(t,e);let r=0;for(let s of e)typeof s=="number"?r+=1:r+=s.length;let i=new Uint8Array(r),n=0;for(let s of e)typeof s=="number"?(i[n]=s,n+=1):(i.set(s,n),n+=s.length);return i}Yr.encodeCBOR=gO});var qb=l(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.encodeCBOR=Jr.decodePartialCBOR=Jr.decodeCBOR=Jr.CBORTag=void 0;var Gf=Nb();Object.defineProperty(Jr,"CBORTag",{enumerable:!0,get:function(){return Gf.CBORTag}});Object.defineProperty(Jr,"decodeCBOR",{enumerable:!0,get:function(){return Gf.decodeCBOR}});Object.defineProperty(Jr,"decodePartialCBOR",{enumerable:!0,get:function(){return Gf.decodePartialCBOR}});Object.defineProperty(Jr,"encodeCBOR",{enumerable:!0,get:function(){return Gf.encodeCBOR}})});var Db=l(Qr=>{"use strict";var AO=Qr&&Qr.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),vO=Qr&&Qr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mO=Qr&&Qr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&AO(e,t,r);return vO(e,t),e};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.decodeFirst=bO;Qr.encode=SO;var Rb=mO(qb());function bO(t){let e=new Uint8Array(t),r=Rb.decodePartialCBOR(e,0),[i]=r;return i}function SO(t){return Rb.encodeCBOR(t)}});var Qe=l(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.COSEALG=_t.COSECRV=_t.COSEKTY=_t.COSEKEYS=void 0;_t.isCOSEPublicKeyOKP=wO;_t.isCOSEPublicKeyEC2=CO;_t.isCOSEPublicKeyRSA=PO;_t.isCOSEKty=Ff;_t.isCOSECrv=EO;_t.isCOSEAlg=TO;function wO(t){let e=t.get(Cc.kty);return Ff(e)&&e===_o.OKP}function CO(t){let e=t.get(Cc.kty);return Ff(e)&&e===_o.EC2}function PO(t){let e=t.get(Cc.kty);return Ff(e)&&e===_o.RSA}var Cc;(function(t){t[t.kty=1]="kty",t[t.alg=3]="alg",t[t.crv=-1]="crv",t[t.x=-2]="x",t[t.y=-3]="y",t[t.n=-1]="n",t[t.e=-2]="e"})(Cc||(_t.COSEKEYS=Cc={}));var _o;(function(t){t[t.OKP=1]="OKP",t[t.EC2=2]="EC2",t[t.RSA=3]="RSA"})(_o||(_t.COSEKTY=_o={}));function Ff(t){return Object.values(_o).indexOf(t)>=0}var ih;(function(t){t[t.P256=1]="P256",t[t.P384=2]="P384",t[t.P521=3]="P521",t[t.ED25519=6]="ED25519",t[t.SECP256K1=8]="SECP256K1"})(ih||(_t.COSECRV=ih={}));function EO(t){return Object.values(ih).indexOf(t)>=0}var nh;(function(t){t[t.ES256=-7]="ES256",t[t.EdDSA=-8]="EdDSA",t[t.ES384=-35]="ES384",t[t.ES512=-36]="ES512",t[t.PS256=-37]="PS256",t[t.PS384=-38]="PS384",t[t.PS512=-39]="PS512",t[t.ES256K=-47]="ES256K",t[t.RS256=-257]="RS256",t[t.RS384=-258]="RS384",t[t.RS512=-259]="RS512",t[t.RS1=-65535]="RS1"})(nh||(_t.COSEALG=nh={}));function TO(t){return Object.values(nh).indexOf(t)>=0}});var Hf=l(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.mapCoseAlgToWebCryptoAlg=xO;var Cr=Qe();function xO(t){if([Cr.COSEALG.RS1].indexOf(t)>=0)return"SHA-1";if([Cr.COSEALG.ES256,Cr.COSEALG.PS256,Cr.COSEALG.RS256].indexOf(t)>=0)return"SHA-256";if([Cr.COSEALG.ES384,Cr.COSEALG.PS384,Cr.COSEALG.RS384].indexOf(t)>=0)return"SHA-384";if([Cr.COSEALG.ES512,Cr.COSEALG.PS512,Cr.COSEALG.RS512,Cr.COSEALG.EdDSA].indexOf(t)>=0)return"SHA-512";throw new Error(`Could not map COSE alg value of ${t} to a WebCrypto alg`)}});var Zi=l(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi._getWebCryptoInternals=Xi.MissingWebCrypto=void 0;Xi.getWebCrypto=OO;var Pc;function OO(){return new Promise((e,r)=>{if(Pc)return e(Pc);let i=Xi._getWebCryptoInternals.stubThisGlobalThisCrypto();return i?(Pc=i,e(Pc)):r(new Wf)})}var Wf=class extends Error{constructor(){super("An instance of the Crypto API could not be located"),this.name="MissingWebCrypto"}};Xi.MissingWebCrypto=Wf;Xi._getWebCryptoInternals={stubThisGlobalThisCrypto:()=>globalThis.crypto,setCachedCrypto:t=>{Pc=t}}});var Ub=l(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.digest=kO;var IO=Hf(),BO=Zi();async function kO(t,e){let r=await(0,BO.getWebCrypto)(),i=(0,IO.mapCoseAlgToWebCryptoAlg)(e),n=await r.subtle.digest(i,t);return new Uint8Array(n)}});var Lb=l(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.getRandomValues=MO;var jO=Zi();async function MO(t){return(await(0,jO.getWebCrypto)()).getRandomValues(t),t}});var $f=l(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.importKey=qO;var NO=Zi();async function qO(t){let e=await(0,NO.getWebCrypto)(),{keyData:r,algorithm:i}=t;return e.subtle.importKey("jwk",r,i,!1,["verify"])}});var lh=l(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.verifyEC2=UO;var Dn=Qe(),Kb=Hf(),RO=$f(),Vb=ae(),DO=Zi();async function UO(t){let{cosePublicKey:e,signature:r,data:i,shaHashOverride:n}=t,s=await(0,DO.getWebCrypto)(),o=e.get(Dn.COSEKEYS.alg),a=e.get(Dn.COSEKEYS.crv),c=e.get(Dn.COSEKEYS.x),u=e.get(Dn.COSEKEYS.y);if(!o)throw new Error("Public key was missing alg (EC2)");if(!a)throw new Error("Public key was missing crv (EC2)");if(!c)throw new Error("Public key was missing x (EC2)");if(!u)throw new Error("Public key was missing y (EC2)");let f;if(a===Dn.COSECRV.P256)f="P-256";else if(a===Dn.COSECRV.P384)f="P-384";else if(a===Dn.COSECRV.P521)f="P-521";else throw new Error(`Unexpected COSE crv value of ${a} (EC2)`);let d={kty:"EC",crv:f,x:Vb.isoBase64URL.fromBuffer(c),y:Vb.isoBase64URL.fromBuffer(u),ext:!1},y={name:"ECDSA",namedCurve:f},m=await(0,RO.importKey)({keyData:d,algorithm:y}),x=(0,Kb.mapCoseAlgToWebCryptoAlg)(o);n&&(x=(0,Kb.mapCoseAlgToWebCryptoAlg)(n));let T={name:"ECDSA",hash:{name:x}};return s.subtle.verify(T,m,r,i)}});var Gb=l(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.mapCoseAlgToWebCryptoKeyAlgName=LO;var sr=Qe();function LO(t){if([sr.COSEALG.EdDSA].indexOf(t)>=0)return"Ed25519";if([sr.COSEALG.ES256,sr.COSEALG.ES384,sr.COSEALG.ES512,sr.COSEALG.ES256K].indexOf(t)>=0)return"ECDSA";if([sr.COSEALG.RS256,sr.COSEALG.RS384,sr.COSEALG.RS512,sr.COSEALG.RS1].indexOf(t)>=0)return"RSASSA-PKCS1-v1_5";if([sr.COSEALG.PS256,sr.COSEALG.PS384,sr.COSEALG.PS512].indexOf(t)>=0)return"RSA-PSS";throw new Error(`Could not map COSE alg value of ${t} to a WebCrypto key alg name`)}});var ph=l(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});dh.verifyRSA=GO;var zf=Qe(),Fb=Hf(),KO=$f(),Hb=ae(),Wb=Gb(),VO=Zi();async function GO(t){let{cosePublicKey:e,signature:r,data:i,shaHashOverride:n}=t,s=await(0,VO.getWebCrypto)(),o=e.get(zf.COSEKEYS.alg),a=e.get(zf.COSEKEYS.n),c=e.get(zf.COSEKEYS.e);if(!o)throw new Error("Public key was missing alg (RSA)");if(!(0,zf.isCOSEAlg)(o))throw new Error(`Public key had invalid alg ${o} (RSA)`);if(!a)throw new Error("Public key was missing n (RSA)");if(!c)throw new Error("Public key was missing e (RSA)");let u={kty:"RSA",alg:"",n:Hb.isoBase64URL.fromBuffer(a),e:Hb.isoBase64URL.fromBuffer(c),ext:!1},f={name:(0,Wb.mapCoseAlgToWebCryptoKeyAlgName)(o),hash:{name:(0,Fb.mapCoseAlgToWebCryptoAlg)(o)}},d={name:(0,Wb.mapCoseAlgToWebCryptoKeyAlgName)(o)};if(n&&(f.hash.name=(0,Fb.mapCoseAlgToWebCryptoAlg)(n)),f.name==="RSASSA-PKCS1-v1_5")f.hash.name==="SHA-256"?u.alg="RS256":f.hash.name==="SHA-384"?u.alg="RS384":f.hash.name==="SHA-512"?u.alg="RS512":f.hash.name==="SHA-1"&&(u.alg="RS1");else if(f.name==="RSA-PSS"){let m=0;f.hash.name==="SHA-256"?(u.alg="PS256",m=32):f.hash.name==="SHA-384"?(u.alg="PS384",m=48):f.hash.name==="SHA-512"&&(u.alg="PS512",m=64),d.saltLength=m}else throw new Error(`Unexpected RSA key algorithm ${o} (${f.name})`);let y=await(0,KO.importKey)({keyData:u,algorithm:f});return s.subtle.verify(d,y,r,i)}});var Yf=l(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.convertAAGUIDToString=HO;var FO=ae();function HO(t){let e=FO.isoUint8Array.toHex(t);return[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,32)].join("-")}});var Pr=l(_h=>{"use strict";Object.defineProperty(_h,"__esModule",{value:!0});_h.convertCertBufferToPEM=WO;var Jf=ae();function WO(t){let e;if(typeof t=="string")if(Jf.isoBase64URL.isBase64URL(t))e=Jf.isoBase64URL.toBase64(t);else if(Jf.isoBase64URL.isBase64(t))e=t;else throw new Error("Certificate is not a valid base64 or base64url string");else e=Jf.isoBase64URL.fromBuffer(t,"base64");let r="";for(let i=0;i<Math.ceil(e.length/64);i+=1){let n=64*i;r+=`${e.substr(n,64)}
3
+ var Z_=Object.defineProperty;var Dx=Object.getOwnPropertyDescriptor;var Ux=Object.getOwnPropertyNames;var Lx=Object.prototype.hasOwnProperty;var Tb=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var l=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},xb=(t,e)=>{for(var r in e)Z_(t,r,{get:e[r],enumerable:!0})},Kx=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ux(e))!Lx.call(t,n)&&n!==r&&Z_(t,n,{get:()=>e[n],enumerable:!(i=Dx(e,n))||i.enumerable});return t};var g=t=>Kx(Z_({},"__esModule",{value:!0}),t);var Ob=l((eh,th)=>{(function(t,e){typeof eh=="object"&&typeof th<"u"?th.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.base64=e())})(eh,(function(){"use strict";let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",r=c=>{let u=typeof Uint8Array>"u"?[]:new Uint8Array(256),f=t.length;for(let d=0;d<f;d++)u[c.charCodeAt(d)]=d;return u},i=r(t),n=r(e),s=/^[-A-Za-z0-9\-_]*$/,o=/^[-A-Za-z0-9+/]*={0,3}$/,a={};return a.toArrayBuffer=(c,u)=>{let f=c.length,d=c.length*.75,y,m=0,x,T,I,U;c[c.length-1]==="="&&(d--,c[c.length-2]==="="&&d--);let ee=new ArrayBuffer(d),pe=new Uint8Array(ee),Ae=u?n:i;for(y=0;y<f;y+=4)x=Ae[c.charCodeAt(y)],T=Ae[c.charCodeAt(y+1)],I=Ae[c.charCodeAt(y+2)],U=Ae[c.charCodeAt(y+3)],pe[m++]=x<<2|T>>4,pe[m++]=(T&15)<<4|I>>2,pe[m++]=(I&3)<<6|U&63;return ee},a.fromArrayBuffer=(c,u)=>{let f=new Uint8Array(c),d,y="",m=f.length,x=u?e:t;for(d=0;d<m;d+=3)y+=x[f[d]>>2],y+=x[(f[d]&3)<<4|f[d+1]>>4],y+=x[(f[d+1]&15)<<2|f[d+2]>>6],y+=x[f[d+2]&63];let T=m%3;return T===2?y=y.substring(0,y.length-1)+(u?"":"="):T===1&&(y=y.substring(0,y.length-2)+(u?"":"==")),y},a.toString=(c,u)=>new TextDecoder().decode(a.toArrayBuffer(c,u)),a.fromString=(c,u)=>a.fromArrayBuffer(new TextEncoder().encode(c),u),a.validate=(c,u)=>{if(!(typeof c=="string"||c instanceof String))return!1;try{return u?s.test(c):o.test(c)}catch{return!1}},a.base64=a,a}))});var Bb=l(nr=>{"use strict";var Vx=nr&&nr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nr,"__esModule",{value:!0});nr.toBuffer=Gx;nr.fromBuffer=Fx;nr.toBase64=Hx;nr.fromUTF8String=Wx;nr.toUTF8String=$x;nr.isBase64=zx;nr.isBase64URL=Yx;nr.trimPadding=Ib;var Qi=Vx(Ob());function Gx(t,e="base64url"){let r=Qi.default.toArrayBuffer(t,e==="base64url");return new Uint8Array(r)}function Fx(t,e="base64url"){let r=new Uint8Array(t);return Qi.default.fromArrayBuffer(r.buffer,e==="base64url")}function Hx(t){let e=Qi.default.toArrayBuffer(t,!0);return Qi.default.fromArrayBuffer(e)}function Wx(t){return Qi.default.fromString(t,!0)}function $x(t){return Qi.default.toString(t,!0)}function zx(t){return Qi.default.validate(t,!1)}function Yx(t){return t=Ib(t),Qi.default.validate(t,!0)}function Ib(t){return t.replace(/=/g,"")}});var kb=l(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.encodeLength=ke.MAJOR_TYPE_SIMPLE_OR_FLOAT=ke.MAJOR_TYPE_TAG=ke.MAJOR_TYPE_MAP=ke.MAJOR_TYPE_ARRAY=ke.MAJOR_TYPE_TEXT_STRING=ke.MAJOR_TYPE_BYTE_STRING=ke.MAJOR_TYPE_NEGATIVE_INTEGER=ke.MAJOR_TYPE_UNSIGNED_INTEGER=ke.decodeLength=void 0;function Jx(t,e,r){if(e<24)return[e,1];let i=t.byteLength-r-1,n=new DataView(t.buffer,r+1),s,o=0;switch(e){case 24:{i>0&&(s=n.getUint8(0),o=2);break}case 25:{i>1&&(s=n.getUint16(0,!1),o=3);break}case 26:{i>3&&(s=n.getUint32(0,!1),o=5);break}case 27:{if(i>7){let a=n.getBigUint64(0,!1);if(a>=24n&&a<=Number.MAX_SAFE_INTEGER)return[Number(a),9]}break}}if(s&&s>=24)return[s,o];throw new Error("Length not supported or not well formed")}ke.decodeLength=Jx;ke.MAJOR_TYPE_UNSIGNED_INTEGER=0;ke.MAJOR_TYPE_NEGATIVE_INTEGER=1;ke.MAJOR_TYPE_BYTE_STRING=2;ke.MAJOR_TYPE_TEXT_STRING=3;ke.MAJOR_TYPE_ARRAY=4;ke.MAJOR_TYPE_MAP=5;ke.MAJOR_TYPE_TAG=6;ke.MAJOR_TYPE_SIMPLE_OR_FLOAT=7;function Qx(t,e){let r=t<<5;if(e<0)throw new Error("CBOR Data Item argument must not be negative");let i;if(typeof e=="number"){if(!Number.isInteger(e))throw new Error("CBOR Data Item argument must be an integer");i=BigInt(e)}else i=e;if(t==ke.MAJOR_TYPE_NEGATIVE_INTEGER){if(i==0n)throw new Error("CBOR Data Item argument cannot be zero when negative");i=i-1n}if(i>18446744073709551615n)throw new Error("CBOR number out of range");let n=new Uint8Array(8);return new DataView(n.buffer).setBigUint64(0,i,!1),i<=23?[r|n[7]]:i<=255?[r|24,n[7]]:i<=65535?[r|25,...n.slice(6)]:i<=4294967295?[r|26,...n.slice(4)]:[r|27,...n]}ke.encodeLength=Qx});var qb=l(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.encodeCBOR=Yr.decodeCBOR=Yr.decodePartialCBOR=Yr.CBORTag=void 0;var le=kb(),bc=class{constructor(e,r){Object.defineProperty(this,"tagId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tagValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tagId=e,this.tagValue=r}get tag(){return this.tagId}get value(){return this.tagValue}};Yr.CBORTag=bc;function jb(t,e,r){return(0,le.decodeLength)(t,e,r)}function Xx(t,e,r){let[i,n]=jb(t,e,r);return[-i-1,n]}function Mb(t,e,r){let[i,n]=(0,le.decodeLength)(t,e,r),s=r+n;return[new Uint8Array(t.buffer.slice(s,s+i)),n+i]}var Zx=new TextDecoder;function eO(t,e,r){let[i,n]=Mb(t,e,r);return[Zx.decode(i),n]}function tO(t,e,r){if(e===0)return[[],1];let[i,n]=(0,le.decodeLength)(t,e,r),s=n,o=[];for(let a=0;a<i;a++){if(t.byteLength-r-s<=0)throw new Error("array is not supported or well formed");let[u,f]=qn(t,r+s);o.push(u),s+=f}return[o,s]}var Kf="Map is not supported or well formed";function rO(t,e,r){if(e===0)return[new Map,1];let[i,n]=(0,le.decodeLength)(t,e,r),s=n,o=new Map;for(let a=0;a<i;a++){let c=t.byteLength-r-s;if(c<=0)throw new Error(Kf);let[u,f]=qn(t,r+s);if(s+=f,c-=f,c<=0)throw new Error(Kf);if(typeof u!="string"&&typeof u!="number")throw new Error(Kf);if(o.has(u))throw new Error(Kf);let[d,y]=qn(t,r+s);s+=y,o.set(u,d)}return[o,s]}function iO(t,e){if(e+3>t.byteLength)throw new Error("CBOR stream ended before end of Float 16");let r=t.getUint16(e+1,!1);if(r==31744)return[1/0,3];if(r==32256)return[NaN,3];if(r==64512)return[-1/0,3];throw new Error("Float16 data is unsupported")}function nO(t,e){if(e+5>t.byteLength)throw new Error("CBOR stream ended before end of Float 32");return[t.getFloat32(e+1,!1),5]}function sO(t,e){if(e+9>t.byteLength)throw new Error("CBOR stream ended before end of Float 64");return[t.getFloat64(e+1,!1),9]}function oO(t,e,r){let[i,n]=(0,le.decodeLength)(t,e,r),[s,o]=qn(t,r+n);return[new bc(i,s),n+o]}function qn(t,e){if(e>=t.byteLength)throw new Error("CBOR stream ended before tag value");let r=t.getUint8(e),i=r>>5,n=r&31;switch(i){case le.MAJOR_TYPE_UNSIGNED_INTEGER:return jb(t,n,e);case le.MAJOR_TYPE_NEGATIVE_INTEGER:return Xx(t,n,e);case le.MAJOR_TYPE_BYTE_STRING:return Mb(t,n,e);case le.MAJOR_TYPE_TEXT_STRING:return eO(t,n,e);case le.MAJOR_TYPE_ARRAY:return tO(t,n,e);case le.MAJOR_TYPE_MAP:return rO(t,n,e);case le.MAJOR_TYPE_TAG:return oO(t,n,e);case le.MAJOR_TYPE_SIMPLE_OR_FLOAT:switch(n){case 20:return[!1,1];case 21:return[!0,1];case 22:return[null,1];case 23:return[void 0,1];case 25:return iO(t,e);case 26:return nO(t,e);case 27:return sO(t,e)}}throw new Error(`Unsupported or not well formed at ${e}`)}function aO(t){return t===!0?245:t===!1?244:t===null?246:247}function cO(t){if(Math.fround(t)==t||!Number.isFinite(t)||Number.isNaN(t)){let e=new Uint8Array(5);return e[0]=250,new DataView(e.buffer).setFloat32(1,t,!1),e}else{let e=new Uint8Array(9);return e[0]=251,new DataView(e.buffer).setFloat64(1,t,!1),e}}function uO(t){return typeof t=="number"?Number.isSafeInteger(t)?t<0?(0,le.encodeLength)(le.MAJOR_TYPE_NEGATIVE_INTEGER,Math.abs(t)):(0,le.encodeLength)(le.MAJOR_TYPE_UNSIGNED_INTEGER,t):[cO(t)]:t<0n?(0,le.encodeLength)(le.MAJOR_TYPE_NEGATIVE_INTEGER,t*-1n):(0,le.encodeLength)(le.MAJOR_TYPE_UNSIGNED_INTEGER,t)}var lO=new TextEncoder;function fO(t,e){e.push(...(0,le.encodeLength)(le.MAJOR_TYPE_TEXT_STRING,t.length)),e.push(lO.encode(t))}function dO(t,e){e.push(...(0,le.encodeLength)(le.MAJOR_TYPE_BYTE_STRING,t.length)),e.push(t)}function pO(t,e){e.push(...(0,le.encodeLength)(le.MAJOR_TYPE_ARRAY,t.length));for(let r of t)Sc(r,e)}function yO(t,e){e.push(new Uint8Array((0,le.encodeLength)(le.MAJOR_TYPE_MAP,t.size)));for(let[r,i]of t.entries())Sc(r,e),Sc(i,e)}function _O(t,e){e.push(...(0,le.encodeLength)(le.MAJOR_TYPE_TAG,t.tag)),Sc(t.value,e)}function Sc(t,e){if(typeof t=="boolean"||t===null||t==null){e.push(aO(t));return}if(typeof t=="number"||typeof t=="bigint"){e.push(...uO(t));return}if(typeof t=="string"){fO(t,e);return}if(t instanceof Uint8Array){dO(t,e);return}if(Array.isArray(t)){pO(t,e);return}if(t instanceof Map){yO(t,e);return}if(t instanceof bc){_O(t,e);return}throw new Error("Not implemented")}function Nb(t,e){if(t.byteLength===0||t.byteLength<=e||e<0)throw new Error("No data");return t instanceof Uint8Array?qn(new DataView(t.buffer),e):t instanceof ArrayBuffer?qn(new DataView(t),e):qn(t,e)}Yr.decodePartialCBOR=Nb;function hO(t){let[e,r]=Nb(t,0);if(r!==t.byteLength)throw new Error(`Data was decoded, but the whole stream was not processed ${r} != ${t.byteLength}`);return e}Yr.decodeCBOR=hO;function gO(t){let e=[];Sc(t,e);let r=0;for(let s of e)typeof s=="number"?r+=1:r+=s.length;let i=new Uint8Array(r),n=0;for(let s of e)typeof s=="number"?(i[n]=s,n+=1):(i.set(s,n),n+=s.length);return i}Yr.encodeCBOR=gO});var Rb=l(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.encodeCBOR=Jr.decodePartialCBOR=Jr.decodeCBOR=Jr.CBORTag=void 0;var Vf=qb();Object.defineProperty(Jr,"CBORTag",{enumerable:!0,get:function(){return Vf.CBORTag}});Object.defineProperty(Jr,"decodeCBOR",{enumerable:!0,get:function(){return Vf.decodeCBOR}});Object.defineProperty(Jr,"decodePartialCBOR",{enumerable:!0,get:function(){return Vf.decodePartialCBOR}});Object.defineProperty(Jr,"encodeCBOR",{enumerable:!0,get:function(){return Vf.encodeCBOR}})});var Ub=l(Qr=>{"use strict";var AO=Qr&&Qr.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),vO=Qr&&Qr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mO=Qr&&Qr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&AO(e,t,r);return vO(e,t),e};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.decodeFirst=bO;Qr.encode=SO;var Db=mO(Rb());function bO(t){let e=new Uint8Array(t),r=Db.decodePartialCBOR(e,0),[i]=r;return i}function SO(t){return Db.encodeCBOR(t)}});var Qe=l(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.COSEALG=_t.COSECRV=_t.COSEKTY=_t.COSEKEYS=void 0;_t.isCOSEPublicKeyOKP=wO;_t.isCOSEPublicKeyEC2=CO;_t.isCOSEPublicKeyRSA=PO;_t.isCOSEKty=Gf;_t.isCOSECrv=EO;_t.isCOSEAlg=TO;function wO(t){let e=t.get(wc.kty);return Gf(e)&&e===_o.OKP}function CO(t){let e=t.get(wc.kty);return Gf(e)&&e===_o.EC2}function PO(t){let e=t.get(wc.kty);return Gf(e)&&e===_o.RSA}var wc;(function(t){t[t.kty=1]="kty",t[t.alg=3]="alg",t[t.crv=-1]="crv",t[t.x=-2]="x",t[t.y=-3]="y",t[t.n=-1]="n",t[t.e=-2]="e"})(wc||(_t.COSEKEYS=wc={}));var _o;(function(t){t[t.OKP=1]="OKP",t[t.EC2=2]="EC2",t[t.RSA=3]="RSA"})(_o||(_t.COSEKTY=_o={}));function Gf(t){return Object.values(_o).indexOf(t)>=0}var rh;(function(t){t[t.P256=1]="P256",t[t.P384=2]="P384",t[t.P521=3]="P521",t[t.ED25519=6]="ED25519",t[t.SECP256K1=8]="SECP256K1"})(rh||(_t.COSECRV=rh={}));function EO(t){return Object.values(rh).indexOf(t)>=0}var ih;(function(t){t[t.ES256=-7]="ES256",t[t.EdDSA=-8]="EdDSA",t[t.ES384=-35]="ES384",t[t.ES512=-36]="ES512",t[t.PS256=-37]="PS256",t[t.PS384=-38]="PS384",t[t.PS512=-39]="PS512",t[t.ES256K=-47]="ES256K",t[t.RS256=-257]="RS256",t[t.RS384=-258]="RS384",t[t.RS512=-259]="RS512",t[t.RS1=-65535]="RS1"})(ih||(_t.COSEALG=ih={}));function TO(t){return Object.values(ih).indexOf(t)>=0}});var Ff=l(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.mapCoseAlgToWebCryptoAlg=xO;var Cr=Qe();function xO(t){if([Cr.COSEALG.RS1].indexOf(t)>=0)return"SHA-1";if([Cr.COSEALG.ES256,Cr.COSEALG.PS256,Cr.COSEALG.RS256].indexOf(t)>=0)return"SHA-256";if([Cr.COSEALG.ES384,Cr.COSEALG.PS384,Cr.COSEALG.RS384].indexOf(t)>=0)return"SHA-384";if([Cr.COSEALG.ES512,Cr.COSEALG.PS512,Cr.COSEALG.RS512,Cr.COSEALG.EdDSA].indexOf(t)>=0)return"SHA-512";throw new Error(`Could not map COSE alg value of ${t} to a WebCrypto alg`)}});var Rn=l(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi._getWebCryptoInternals=Xi.MissingWebCrypto=void 0;Xi.getWebCrypto=OO;var Cc;function OO(){return new Promise((e,r)=>{if(Cc)return e(Cc);let i=Xi._getWebCryptoInternals.stubThisGlobalThisCrypto();return i?(Cc=i,e(Cc)):r(new Hf)})}var Hf=class extends Error{constructor(){super("An instance of the Crypto API could not be located"),this.name="MissingWebCrypto"}};Xi.MissingWebCrypto=Hf;Xi._getWebCryptoInternals={stubThisGlobalThisCrypto:()=>globalThis.crypto,setCachedCrypto:t=>{Cc=t}}});var Lb=l(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.digest=kO;var IO=Ff(),BO=Rn();async function kO(t,e){let r=await(0,BO.getWebCrypto)(),i=(0,IO.mapCoseAlgToWebCryptoAlg)(e),n=await r.subtle.digest(i,t);return new Uint8Array(n)}});var Kb=l(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.getRandomValues=MO;var jO=Rn();async function MO(t){return(await(0,jO.getWebCrypto)()).getRandomValues(t),t}});var Wf=l(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.importKey=qO;var NO=Rn();async function qO(t){let e=await(0,NO.getWebCrypto)(),{keyData:r,algorithm:i}=t;return e.subtle.importKey("jwk",r,i,!1,["verify"])}});var uh=l(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.verifyEC2=UO;var Dn=Qe(),Vb=Ff(),RO=Wf(),Gb=ae(),DO=Rn();async function UO(t){let{cosePublicKey:e,signature:r,data:i,shaHashOverride:n}=t,s=await(0,DO.getWebCrypto)(),o=e.get(Dn.COSEKEYS.alg),a=e.get(Dn.COSEKEYS.crv),c=e.get(Dn.COSEKEYS.x),u=e.get(Dn.COSEKEYS.y);if(!o)throw new Error("Public key was missing alg (EC2)");if(!a)throw new Error("Public key was missing crv (EC2)");if(!c)throw new Error("Public key was missing x (EC2)");if(!u)throw new Error("Public key was missing y (EC2)");let f;if(a===Dn.COSECRV.P256)f="P-256";else if(a===Dn.COSECRV.P384)f="P-384";else if(a===Dn.COSECRV.P521)f="P-521";else throw new Error(`Unexpected COSE crv value of ${a} (EC2)`);let d={kty:"EC",crv:f,x:Gb.isoBase64URL.fromBuffer(c),y:Gb.isoBase64URL.fromBuffer(u),ext:!1},y={name:"ECDSA",namedCurve:f},m=await(0,RO.importKey)({keyData:d,algorithm:y}),x=(0,Vb.mapCoseAlgToWebCryptoAlg)(o);n&&(x=(0,Vb.mapCoseAlgToWebCryptoAlg)(n));let T={name:"ECDSA",hash:{name:x}};return s.subtle.verify(T,m,r,i)}});var Fb=l(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.mapCoseAlgToWebCryptoKeyAlgName=LO;var sr=Qe();function LO(t){if([sr.COSEALG.EdDSA].indexOf(t)>=0)return"Ed25519";if([sr.COSEALG.ES256,sr.COSEALG.ES384,sr.COSEALG.ES512,sr.COSEALG.ES256K].indexOf(t)>=0)return"ECDSA";if([sr.COSEALG.RS256,sr.COSEALG.RS384,sr.COSEALG.RS512,sr.COSEALG.RS1].indexOf(t)>=0)return"RSASSA-PKCS1-v1_5";if([sr.COSEALG.PS256,sr.COSEALG.PS384,sr.COSEALG.PS512].indexOf(t)>=0)return"RSA-PSS";throw new Error(`Could not map COSE alg value of ${t} to a WebCrypto key alg name`)}});var dh=l(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.verifyRSA=GO;var $f=Qe(),Hb=Ff(),KO=Wf(),Wb=ae(),$b=Fb(),VO=Rn();async function GO(t){let{cosePublicKey:e,signature:r,data:i,shaHashOverride:n}=t,s=await(0,VO.getWebCrypto)(),o=e.get($f.COSEKEYS.alg),a=e.get($f.COSEKEYS.n),c=e.get($f.COSEKEYS.e);if(!o)throw new Error("Public key was missing alg (RSA)");if(!(0,$f.isCOSEAlg)(o))throw new Error(`Public key had invalid alg ${o} (RSA)`);if(!a)throw new Error("Public key was missing n (RSA)");if(!c)throw new Error("Public key was missing e (RSA)");let u={kty:"RSA",alg:"",n:Wb.isoBase64URL.fromBuffer(a),e:Wb.isoBase64URL.fromBuffer(c),ext:!1},f={name:(0,$b.mapCoseAlgToWebCryptoKeyAlgName)(o),hash:{name:(0,Hb.mapCoseAlgToWebCryptoAlg)(o)}},d={name:(0,$b.mapCoseAlgToWebCryptoKeyAlgName)(o)};if(n&&(f.hash.name=(0,Hb.mapCoseAlgToWebCryptoAlg)(n)),f.name==="RSASSA-PKCS1-v1_5")f.hash.name==="SHA-256"?u.alg="RS256":f.hash.name==="SHA-384"?u.alg="RS384":f.hash.name==="SHA-512"?u.alg="RS512":f.hash.name==="SHA-1"&&(u.alg="RS1");else if(f.name==="RSA-PSS"){let m=0;f.hash.name==="SHA-256"?(u.alg="PS256",m=32):f.hash.name==="SHA-384"?(u.alg="PS384",m=48):f.hash.name==="SHA-512"&&(u.alg="PS512",m=64),d.saltLength=m}else throw new Error(`Unexpected RSA key algorithm ${o} (${f.name})`);let y=await(0,KO.importKey)({keyData:u,algorithm:f});return s.subtle.verify(d,y,r,i)}});var zf=l(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.convertAAGUIDToString=HO;var FO=ae();function HO(t){let e=FO.isoUint8Array.toHex(t);return[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,32)].join("-")}});var Pr=l(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.convertCertBufferToPEM=WO;var Yf=ae();function WO(t){let e;if(typeof t=="string")if(Yf.isoBase64URL.isBase64URL(t))e=Yf.isoBase64URL.toBase64(t);else if(Yf.isoBase64URL.isBase64(t))e=t;else throw new Error("Certificate is not a valid base64 or base64url string");else e=Yf.isoBase64URL.fromBuffer(t,"base64");let r="";for(let i=0;i<Math.ceil(e.length/64);i+=1){let n=64*i;r+=`${e.substr(n,64)}
4
4
  `}return r=`-----BEGIN CERTIFICATE-----
5
5
  ${r}-----END CERTIFICATE-----
6
- `,r}});var Ec=l(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.convertCOSEtoPKCS=$O;var hh=ae(),$b=Qe();function $O(t){let e=hh.isoCBOR.decodeFirst(t),r=Uint8Array.from([4]),i=e.get($b.COSEKEYS.x),n=e.get($b.COSEKEYS.y);if(!i)throw new Error("COSE public key was missing x");return n?hh.isoUint8Array.concat([r,i,n]):hh.isoUint8Array.concat([r,i])}});var Ah=l(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho._decodeAttestationObjectInternals=void 0;ho.decodeAttestationObject=YO;var zO=ae();function YO(t){return ho._decodeAttestationObjectInternals.stubThis(zO.isoCBOR.decodeFirst(t))}ho._decodeAttestationObjectInternals={stubThis:t=>t}});var Qf=l(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go._decodeClientDataJSONInternals=void 0;go.decodeClientDataJSON=QO;var JO=ae();function QO(t){let e=JO.isoBase64URL.toUTF8String(t),r=JSON.parse(e);return go._decodeClientDataJSONInternals.stubThis(r)}go._decodeClientDataJSONInternals={stubThis:t=>t}});var vo=l(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao._decodeCredentialPublicKeyInternals=void 0;Ao.decodeCredentialPublicKey=ZO;var XO=ae();function ZO(t){return Ao._decodeCredentialPublicKeyInternals.stubThis(XO.isoCBOR.decodeFirst(t))}Ao._decodeCredentialPublicKeyInternals={stubThis:t=>t}});var vh=l(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo._generateUserIDInternals=void 0;mo.generateUserID=tI;var eI=ae();async function tI(){let t=new Uint8Array(32);return await eI.isoCrypto.getRandomValues(t),mo._generateUserIDInternals.stubThis(t)}mo._generateUserIDInternals={stubThis:t=>t}});var A={};Tb(A,{__addDisposableResource:()=>AS,__assign:()=>Xf,__asyncDelegator:()=>lS,__asyncGenerator:()=>uS,__asyncValues:()=>fS,__await:()=>bo,__awaiter:()=>iS,__classPrivateFieldGet:()=>_S,__classPrivateFieldIn:()=>gS,__classPrivateFieldSet:()=>hS,__createBinding:()=>ed,__decorate:()=>Jb,__disposeResources:()=>vS,__esDecorate:()=>Xb,__exportStar:()=>sS,__extends:()=>zb,__generator:()=>nS,__importDefault:()=>yS,__importStar:()=>pS,__makeTemplateObject:()=>dS,__metadata:()=>rS,__param:()=>Qb,__propKey:()=>eS,__read:()=>Sh,__rest:()=>Yb,__rewriteRelativeImportExtension:()=>mS,__runInitializers:()=>Zb,__setFunctionName:()=>tS,__spread:()=>oS,__spreadArray:()=>cS,__spreadArrays:()=>aS,__values:()=>Zf,default:()=>nI});function zb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");mh(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Yb(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Jb(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function Qb(t,e){return function(r,i){e(r,i,t)}}function Xb(t,e,r,i,n,s){function o(U){if(U!==void 0&&typeof U!="function")throw new TypeError("Function expected");return U}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?i.static?t:t.prototype:null,f=e||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,y=!1,m=r.length-1;m>=0;m--){var x={};for(var T in i)x[T]=T==="access"?{}:i[T];for(var T in i.access)x.access[T]=i.access[T];x.addInitializer=function(U){if(y)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(U||null))};var I=(0,r[m])(a==="accessor"?{get:f.get,set:f.set}:f[c],x);if(a==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(d=o(I.get))&&(f.get=d),(d=o(I.set))&&(f.set=d),(d=o(I.init))&&n.unshift(d)}else(d=o(I))&&(a==="field"?n.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),y=!0}function Zb(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function eS(t){return typeof t=="symbol"?t:"".concat(t)}function tS(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function rS(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function iS(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(i.next(f))}catch(d){o(d)}}function c(f){try{u(i.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):n(f.value).then(a,c)}u((i=i.apply(t,e||[])).next())})}function nS(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(f){u=[6,f],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function sS(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ed(e,t,r)}function Zf(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sh(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function oS(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Sh(arguments[e]));return t}function aS(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function cS(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))}function bo(t){return this instanceof bo?(this.v=t,this):new bo(t)}function uS(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(m){return function(x){return Promise.resolve(x).then(m,d)}}function a(m,x){i[m]&&(n[m]=function(T){return new Promise(function(I,U){s.push([m,T,I,U])>1||c(m,T)})},x&&(n[m]=x(n[m])))}function c(m,x){try{u(i[m](x))}catch(T){y(s[0][3],T)}}function u(m){m.value instanceof bo?Promise.resolve(m.value.v).then(f,d):y(s[0][2],m)}function f(m){c("next",m)}function d(m){c("throw",m)}function y(m,x){m(x),s.shift(),s.length&&c(s[0][0],s[0][1])}}function lS(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(o){return(r=!r)?{value:bo(t[n](o)),done:!1}:s?s(o):o}:s}}function fS(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Zf=="function"?Zf(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),n(a,c,o.done,o.value)})}}function n(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function dS(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function pS(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=bh(t),i=0;i<r.length;i++)r[i]!=="default"&&ed(e,t,r[i]);return rI(e,t),e}function yS(t){return t&&t.__esModule?t:{default:t}}function _S(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function hS(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function gS(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function AS(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function vS(t){function e(s){t.error=t.hasError?new iI(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(s).then(n,function(o){return e(o),n()})}else i|=1}catch(o){e(o)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return n()}function mS(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,s,o){return i?e?".jsx":".js":n&&(!s||!o)?r:n+s+"."+o.toLowerCase()+"js"}):t}var mh,Xf,ed,rI,bh,iI,nI,v=Eb(()=>{mh=function(t,e){return mh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},mh(t,e)};Xf=function(){return Xf=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Xf.apply(this,arguments)};ed=Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]});rI=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},bh=function(t){return bh=Object.getOwnPropertyNames||function(e){var r=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[r.length]=i);return r},bh(t)};iI=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};nI={__extends:zb,__assign:Xf,__rest:Yb,__decorate:Jb,__param:Qb,__esDecorate:Xb,__runInitializers:Zb,__propKey:eS,__setFunctionName:tS,__metadata:rS,__awaiter:iS,__generator:nS,__createBinding:ed,__exportStar:sS,__values:Zf,__read:Sh,__spread:oS,__spreadArrays:aS,__spreadArray:cS,__await:bo,__asyncGenerator:uS,__asyncDelegator:lS,__asyncValues:fS,__makeTemplateObject:dS,__importStar:pS,__importDefault:yS,__classPrivateFieldGet:_S,__classPrivateFieldSet:hS,__classPrivateFieldIn:gS,__addDisposableResource:AS,__disposeResources:vS,__rewriteRelativeImportExtension:mS}});var Ch=l(So=>{"use strict";var sI="[object ArrayBuffer]",Ei=class t{static isArrayBuffer(e){return Object.prototype.toString.call(e)===sI}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,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(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,r){let i=t.toUint8Array(e),n=t.toUint8Array(r);if(i.length!==n.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let i=0;for(let o of r)i+=o.byteLength;let n=new Uint8Array(i),s=0;for(let o of r){let a=this.toUint8Array(o);n.set(a,s),s+=a.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}},wh="string",oI=/^[0-9a-f\s]+$/i,aI=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,cI=/^[a-zA-Z0-9-_]+$/,td=class{static fromString(e){let r=unescape(encodeURIComponent(e)),i=new Uint8Array(r.length);for(let n=0;n<r.length;n++)i[n]=r.charCodeAt(n);return i.buffer}static toString(e){let r=Ei.toUint8Array(e),i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}},or=class{static toString(e,r=!1){let i=Ei.toArrayBuffer(e),n=new DataView(i),s="";for(let o=0;o<i.byteLength;o+=2){let a=n.getUint16(o,r);s+=String.fromCharCode(a)}return s}static fromString(e,r=!1){let i=new ArrayBuffer(e.length*2),n=new DataView(i);for(let s=0;s<e.length;s++)n.setUint16(s*2,e.charCodeAt(s),r);return i}},rd=class t{static isHex(e){return typeof e===wh&&oI.test(e)}static isBase64(e){return typeof e===wh&&aI.test(e)}static isBase64Url(e){return typeof e===wh&&cI.test(e)}static ToString(e,r="utf8"){let i=Ei.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return or.toString(i,!0);case"utf16":case"utf16be":return or.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.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 or.fromString(e,!0);case"utf16":case"utf16be":return or.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){let r=Ei.toUint8Array(e);if(typeof btoa<"u"){let i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(e);case"utf8":return td.fromString(e);case"utf16":case"utf16be":return or.fromString(e);case"utf16le":case"usc2":return or.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(e);case"utf8":return td.toString(e);case"utf16":case"utf16be":return or.toString(e);case"utf16le":case"usc2":return or.toString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){let r=e.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=e.charCodeAt(n);return i.buffer}static ToBinary(e){let r=Ei.toUint8Array(e),i="";for(let n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);return i}static ToHex(e){let r=Ei.toUint8Array(e),i="",n=r.length;for(let s=0;s<n;s++){let o=r[s];o<16&&(i+="0"),i+=o.toString(16)}return i}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);let i=new Uint8Array(r.length/2);for(let n=0;n<r.length;n=n+2){let s=r.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,r=!1){return or.toString(e,r)}static FromUtf16String(e,r=!1){return or.fromString(e,r)}static Base64Padding(e){let r=4-e.length%4;if(r<4)for(let i=0;i<r;i++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};rd.DEFAULT_UTF8_ENCODING="utf8";function uI(t,...e){let r=arguments[0];for(let i=1;i<arguments.length;i++){let n=arguments[i];for(let s in n)r[s]=n[s]}return r}function lI(...t){let e=t.map(n=>n.byteLength).reduce((n,s)=>n+s),r=new Uint8Array(e),i=0;return t.map(n=>new Uint8Array(n)).forEach(n=>{for(let s of n)r[i++]=s}),r.buffer}function fI(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<t.byteLength;n++)if(r[n]!==i[n])return!1;return!0}So.BufferSourceConverter=Ei;So.Convert=rd;So.assign=uI;So.combine=lI;So.isEqual=fI});var wS=l(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});function dI(t){return new Date(t.getTime()+t.getTimezoneOffset()*6e4)}function pI(t,e,r){var i;return t instanceof Object&&(i=t[e])!==null&&i!==void 0?i:r}function yI(t,e=0,r=t.byteLength-e,i=!1){let n="";for(let s of new Uint8Array(t,e,r)){let o=s.toString(16).toUpperCase();o.length===1&&(n+="0"),n+=o,i&&(n+=" ")}return n.trim()}function _I(t,e,r,i){return e instanceof ArrayBuffer?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",!1):i<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-i<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error='Wrong parameter: inputBuffer must be "ArrayBuffer"',!1)}function Ph(t,e){let r=0;if(t.length===1)return t[0];for(let i=t.length-1;i>=0;i--)r+=t[t.length-1-i]*Math.pow(2,e*i);return r}function Eh(t,e,r=-1){let i=r,n=t,s=0,o=Math.pow(2,e);for(let a=1;a<8;a++){if(t<o){let c;if(i<0)c=new ArrayBuffer(a),s=a;else{if(i<a)return new ArrayBuffer(0);c=new ArrayBuffer(i),s=i}let u=new Uint8Array(c);for(let f=a-1;f>=0;f--){let d=Math.pow(2,f*e);u[s-f-1]=Math.floor(n/d),n-=u[s-f-1]*d}return c}o*=Math.pow(2,e)}return new ArrayBuffer(0)}function hI(...t){let e=0,r=0;for(let s of t)e+=s.byteLength;let i=new ArrayBuffer(e),n=new Uint8Array(i);for(let s of t)n.set(new Uint8Array(s),r),r+=s.byteLength;return i}function gI(...t){let e=0,r=0;for(let s of t)e+=s.length;let i=new ArrayBuffer(e),n=new Uint8Array(i);for(let s of t)n.set(s,r),r+=s.length;return n}function AI(){let t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=t[0]===255&&t[1]&128,c=t[0]===0&&(t[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)r[a]=0;r[0]=t[0]&128;let i=Ph(r,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let a=0;a<this.valueHex.byteLength;a++)s[a]=t[a];return s[0]&=127,Ph(s,8)-i}function vI(t){let e=t<0?t*-1:t,r=128;for(let i=1;i<8;i++){if(e<=r){if(t<0){let o=r-e,a=Eh(o,8,i),c=new Uint8Array(a);return c[0]|=128,a}let n=Eh(e,8,i),s=new Uint8Array(n);if(s[0]&128){let o=n.slice(0),a=new Uint8Array(o);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let c=0;c<o.byteLength;c++)s[c+1]=a[c];s[0]=0}return n}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function mI(t,e){if(t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<r.length;n++)if(r[n]!==i[n])return!1;return!0}function bI(t,e){let r=t.toString(10);if(e<r.length)return"";let i=e-r.length,n=new Array(i);for(let o=0;o<i;o++)n[o]="0";return n.join("").concat(r)}var bS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",SS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function SI(t,e=!1,r=!1,i=!1){let n=0,s=0,o=0,a="",c=e?SS:bS;if(i){let u=0;for(let f=0;f<t.length;f++)if(t.charCodeAt(f)!==0){u=f;break}t=t.slice(u)}for(;n<t.length;){let u=t.charCodeAt(n++);n>=t.length&&(s=1);let f=t.charCodeAt(n++);n>=t.length&&(o=1);let d=t.charCodeAt(n++),y=u>>2,m=(u&3)<<4|f>>4,x=(f&15)<<2|d>>6,T=d&63;s===1?x=T=64:o===1&&(T=64),r?x===64?a+=`${c.charAt(y)}${c.charAt(m)}`:T===64?a+=`${c.charAt(y)}${c.charAt(m)}${c.charAt(x)}`:a+=`${c.charAt(y)}${c.charAt(m)}${c.charAt(x)}${c.charAt(T)}`:a+=`${c.charAt(y)}${c.charAt(m)}${c.charAt(x)}${c.charAt(T)}`}return a}function wI(t,e=!1,r=!1){let i=e?SS:bS;function n(c){for(let u=0;u<64;u++)if(i.charAt(u)===c)return u;return 64}function s(c){return c===64?0:c}let o=0,a="";for(;o<t.length;){let c=n(t.charAt(o++)),u=o>=t.length?0:n(t.charAt(o++)),f=o>=t.length?0:n(t.charAt(o++)),d=o>=t.length?0:n(t.charAt(o++)),y=s(c)<<2|s(u)>>4,m=(s(u)&15)<<4|s(f)>>2,x=(s(f)&3)<<6|s(d);a+=String.fromCharCode(y),f!==64&&(a+=String.fromCharCode(m)),d!==64&&(a+=String.fromCharCode(x))}if(r){let c=a.length,u=-1;for(let f=c-1;f>=0;f--)if(a.charCodeAt(f)!==0){u=f;break}u!==-1?a=a.slice(0,u+1):a=""}return a}function CI(t){let e="",r=new Uint8Array(t);for(let i of r)e+=String.fromCharCode(i);return e}function PI(t){let e=t.length,r=new ArrayBuffer(e),i=new Uint8Array(r);for(let n=0;n<e;n++)i[n]=t.charCodeAt(n);return r}var EI=Math.log(2);function TI(t){let e=Math.log(t)/EI,r=Math.floor(e),i=Math.round(e);return r===i?r:i}function xI(t,e){for(let r of e)delete t[r]}He.arrayBufferToString=CI;He.bufferToHexCodes=yI;He.checkBufferParams=_I;He.clearProps=xI;He.fromBase64=wI;He.getParametersValue=pI;He.getUTCDate=dI;He.isEqualBuffer=mI;He.nearestPowerOf2=TI;He.padNumber=bI;He.stringToArrayBuffer=PI;He.toBase64=SI;He.utilConcatBuf=hI;He.utilConcatView=gI;He.utilDecodeTC=AI;He.utilEncodeTC=vI;He.utilFromBase=Ph;He.utilToBase=Eh});var en=l(z=>{"use strict";var OI=Ch(),II=wS();function TS(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(r){if(r!=="default"){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}}),e.default=t,Object.freeze(e)}var re=TS(OI),ye=TS(II);function id(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Oh(t){let e=0,r=0;for(let n=0;n<t.length;n++){let s=t[n];e+=s.byteLength}let i=new Uint8Array(e);for(let n=0;n<t.length;n++){let s=t[n];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function Oi(t,e,r,i){return e instanceof Uint8Array?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",!1):i<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-i<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Co=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Oh(this.items)}},Tc=[new Uint8Array([1])],CS="0123456789",Th="name",PS="valueHexView",BI="isHexOnly",kI="idBlock",jI="tagClass",MI="tagNumber",NI="isConstructed",qI="fromBER",RI="toBER",DI="local",Et="",ei=new ArrayBuffer(0),vd=new Uint8Array(0),Oc="EndOfContent",xS="OCTET STRING",OS="BIT STRING";function ti(t){var e;return e=class extends t{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var n;super(...i);let s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?re.BufferSourceConverter.toUint8Array(s.valueHex):vd}fromBER(i,n,s,o){let a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!Oi(this,a,n,s))return-1;let c=n+s;return this.valueHexView=a.subarray(n,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),n)}toBER(i=!1){return this.isHexOnly?i?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",ei)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:re.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var Ti=class{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:r=Et,warnings:i=[],valueBeforeDecode:n=vd}={}){this.blockLength=e,this.error=r,this.warnings=i,this.valueBeforeDecodeView=re.BufferSourceConverter.toUint8Array(n)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:re.Convert.ToHex(this.valueBeforeDecodeView)}}};Ti.NAME="baseBlock";var nt=class extends Ti{fromBER(e,r,i,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};nt.NAME="valueBlock";var nd=class extends ti(Ti){constructor({idBlock:e={}}={}){var r,i,n,s;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=e.valueHex?re.BufferSourceConverter.toUint8Array(e.valueHex):vd,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=e.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",ei}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){let n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,r|=s,n[0]=r}return n.buffer}if(!this.isHexOnly){let n=ye.utilToBase(this.tagNumber,7),s=new Uint8Array(n),o=n.byteLength,a=new Uint8Array(o+1);if(a[0]=r|31,!e){for(let c=0;c<o-1;c++)a[c+1]=s[c]|128;a[o]=s[o-1]}return a.buffer}let i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!e){let n=this.valueHexView;for(let s=0;s<n.length-1;s++)i[s+1]=n[s]|128;i[this.valueHexView.byteLength]=n[n.length-1]}return i.buffer}fromBER(e,r,i){let n=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,n,r,i))return-1;let s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;let a=s[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=0;for(;;){let f=c+1;if(f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c++,(s[f]&128)===0)break}this.blockLength=c+1;let u=this.valueHexView=new Uint8Array(c);for(let f=0;f<c;f++)u[f]=s[f+1]&127;this.blockLength<=9?this.tagNumber=ye.utilFromBase(u,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 r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};nd.NAME="identificationBlock";var sd=class extends Ti{constructor({lenBlock:e={}}={}){var r,i,n;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(n=e.length)!==null&&n!==void 0?n:0}fromBER(e,r,i){let n=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,n,r,i))return-1;let s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;let o=s[0]&127;if(o>8)return this.error="Too big integer",-1;if(o+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let a=r+1,c=n.subarray(a,a+o);return c[o-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=ye.utilFromBase(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=o+1,r+this.blockLength}toBER(e=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){let n=ye.utilToBase(this.length,8);if(n.byteLength>127)return this.error="Too big length",ei;if(r=new ArrayBuffer(n.byteLength+1),e)return r;let s=new Uint8Array(n);i=new Uint8Array(r),i[0]=n.byteLength|128;for(let o=0;o<n.byteLength;o++)i[o+1]=s[o];return r}return r=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};sd.NAME="lengthBlock";var N={},Xe=class extends Ti{constructor({name:e=Et,optional:r=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new nd(n),this.lenBlock=new sd(n),this.valueBlock=s?new s(n):new nt(n)}fromBER(e,r,i,n){let s=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length,n);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,r){let i=r||new Co;r||IS(this);let n=this.idBlock.toBER(e);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else{let s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let o=this.lenBlock.toBER(e);i.write(o),i.write(s)}return r?ei:i.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():re.Convert.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,r=re.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${r}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let r=this.toBER(),i=e.toBER();return ye.isEqualBuffer(r,i)}};Xe.NAME="BaseBlock";function IS(t){var e;if(t instanceof N.Constructed)for(let r of t.valueBlock.value)IS(r)&&(t.lenBlock.isIndefiniteForm=!0);return!!(!((e=t.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}var Ic=class extends Xe{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Et,...r}={},i){super(r,i),e&&this.fromString(e)}fromBER(e,r,i){let n=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};Ic.NAME="BaseStringBlock";var od=class extends ti(nt){constructor({isHexOnly:e=!0,...r}={}){super(r),this.isHexOnly=e}};od.NAME="PrimitiveValueBlock";var BS,Bc=class extends Xe{constructor(e={}){super(e,od),this.idBlock.isConstructed=!1}};BS=Bc;N.Primitive=BS;Bc.NAME="PRIMITIVE";var kS=100,jS=1e4,MS=16*1024*1024,UI="Maximum ASN.1 nesting depth exceeded",LI="Maximum ASN.1 node count exceeded",KI="Maximum ASN.1 content length exceeded";function cu(t={}){var e,r,i;return{depth:0,maxDepth:(e=t.maxDepth)!==null&&e!==void 0?e:kS,nodesCount:0,maxNodes:(r=t.maxNodes)!==null&&r!==void 0?r:jS,maxContentLength:(i=t.maxContentLength)!==null&&i!==void 0?i:MS}}function VI(t){let e=new Xe({},nt);return e.error=t,{offset:-1,result:e}}function GI(t){if(t.nodesCount+=1,t.nodesCount>t.maxNodes)return LI}function FI(t,e){if(t>e.maxContentLength)return KI}function Ih(t,e,r,i){let n=i.depth+1;if(n>i.maxDepth)return VI(UI);i.depth=n;try{return md(t,e,r,i)}finally{i.depth-=1}}function HI(t,e){if(t instanceof e)return t;let r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}function md(t,e=0,r=t.length,i=cu()){let n=e,s=new Xe({},nt),o=new Ti;if(!Oi(o,t,e,r))return s.error=o.error,{offset:-1,result:s};if(!t.subarray(e,e+r).length)return s.error="Zero buffer length",{offset:-1,result:s};let c=GI(i);if(c)return s.error=c,{offset:-1,result:s};let u=s.idBlock.fromBER(t,e,r);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,r-=s.idBlock.blockLength,u=s.lenBlock.fromBER(t,e,r),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};e=u,r-=s.lenBlock.blockLength;let f=s.lenBlock.isIndefiniteForm?r:s.lenBlock.length,d=FI(f,i);if(d)return s.error=d,{offset:-1,result:s};if(!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let y=Xe;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};y=N.EndOfContent;break;case 1:y=N.Boolean;break;case 2:y=N.Integer;break;case 3:y=N.BitString;break;case 4:y=N.OctetString;break;case 5:y=N.Null;break;case 6:y=N.ObjectIdentifier;break;case 10:y=N.Enumerated;break;case 12:y=N.Utf8String;break;case 13:y=N.RelativeObjectIdentifier;break;case 14:y=N.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:y=N.Sequence;break;case 17:y=N.Set;break;case 18:y=N.NumericString;break;case 19:y=N.PrintableString;break;case 20:y=N.TeletexString;break;case 21:y=N.VideotexString;break;case 22:y=N.IA5String;break;case 23:y=N.UTCTime;break;case 24:y=N.GeneralizedTime;break;case 25:y=N.GraphicString;break;case 26:y=N.VisibleString;break;case 27:y=N.GeneralString;break;case 28:y=N.UniversalString;break;case 29:y=N.CharacterString;break;case 30:y=N.BmpString;break;case 31:y=N.DATE;break;case 32:y=N.TimeOfDay;break;case 33:y=N.DateTime;break;case 34:y=N.Duration;break;default:{let m=s.idBlock.isConstructed?new N.Constructed:new N.Primitive;m.idBlock=s.idBlock,m.lenBlock=s.lenBlock,m.warnings=s.warnings,s=m}}break;default:y=s.idBlock.isConstructed?N.Constructed:N.Primitive}return s=HI(s,y),u=s.fromBER(t,e,f,i),s.valueBeforeDecodeView=t.subarray(n,n+s.blockLength),{offset:u,result:s}}function WI(t,e={}){if(!t.byteLength){let r=new Xe({},nt);return r.error="Input buffer has zero length",{offset:-1,result:r}}return md(re.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength,cu(e))}function $I(t,e){return t?1:e}var Xr=class extends nt{constructor({value:e=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=r}fromBER(e,r,i,n){let s=re.BufferSourceConverter.toUint8Array(e),o=n??cu();if(!Oi(this,s,r,i))return-1;if(this.valueBeforeDecodeView=s.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let a=r;for(;$I(this.isIndefiniteForm,i)>0;){let c=Ih(s,a,i,o);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(a=c.offset,this.blockLength+=c.result.blockLength,i-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===Oc)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Oc?this.value.pop():this.warnings.push("No EndOfContent block encoded")),a}toBER(e,r){let i=r||new Co;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return r?ei:i.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let r of this.value)e.value.push(r.toJSON());return e}};Xr.NAME="ConstructedValueBlock";var NS,xi=class extends Xe{constructor(e={}){super(e,Xr),this.idBlock.isConstructed=!0}fromBER(e,r,i,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length,n);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 i of this.valueBlock.value)e.push(i.toString("ascii").split(`
6
+ `,r}});var Pc=l(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.convertCOSEtoPKCS=$O;var _h=ae(),zb=Qe();function $O(t){let e=_h.isoCBOR.decodeFirst(t),r=Uint8Array.from([4]),i=e.get(zb.COSEKEYS.x),n=e.get(zb.COSEKEYS.y);if(!i)throw new Error("COSE public key was missing x");return n?_h.isoUint8Array.concat([r,i,n]):_h.isoUint8Array.concat([r,i])}});var gh=l(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho._decodeAttestationObjectInternals=void 0;ho.decodeAttestationObject=YO;var zO=ae();function YO(t){return ho._decodeAttestationObjectInternals.stubThis(zO.isoCBOR.decodeFirst(t))}ho._decodeAttestationObjectInternals={stubThis:t=>t}});var Jf=l(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go._decodeClientDataJSONInternals=void 0;go.decodeClientDataJSON=QO;var JO=ae();function QO(t){let e=JO.isoBase64URL.toUTF8String(t),r=JSON.parse(e);return go._decodeClientDataJSONInternals.stubThis(r)}go._decodeClientDataJSONInternals={stubThis:t=>t}});var vo=l(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao._decodeCredentialPublicKeyInternals=void 0;Ao.decodeCredentialPublicKey=ZO;var XO=ae();function ZO(t){return Ao._decodeCredentialPublicKeyInternals.stubThis(XO.isoCBOR.decodeFirst(t))}Ao._decodeCredentialPublicKeyInternals={stubThis:t=>t}});var Ah=l(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo._generateUserIDInternals=void 0;mo.generateUserID=tI;var eI=ae();async function tI(){let t=new Uint8Array(32);return await eI.isoCrypto.getRandomValues(t),mo._generateUserIDInternals.stubThis(t)}mo._generateUserIDInternals={stubThis:t=>t}});var A={};xb(A,{__addDisposableResource:()=>vS,__assign:()=>Qf,__asyncDelegator:()=>fS,__asyncGenerator:()=>lS,__asyncValues:()=>dS,__await:()=>bo,__awaiter:()=>nS,__classPrivateFieldGet:()=>hS,__classPrivateFieldIn:()=>AS,__classPrivateFieldSet:()=>gS,__createBinding:()=>Zf,__decorate:()=>Qb,__disposeResources:()=>mS,__esDecorate:()=>Zb,__exportStar:()=>oS,__extends:()=>Yb,__generator:()=>sS,__importDefault:()=>_S,__importStar:()=>yS,__makeTemplateObject:()=>pS,__metadata:()=>iS,__param:()=>Xb,__propKey:()=>tS,__read:()=>bh,__rest:()=>Jb,__rewriteRelativeImportExtension:()=>bS,__runInitializers:()=>eS,__setFunctionName:()=>rS,__spread:()=>aS,__spreadArray:()=>uS,__spreadArrays:()=>cS,__values:()=>Xf,default:()=>nI});function Yb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");vh(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Jb(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Qb(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function Xb(t,e){return function(r,i){e(r,i,t)}}function Zb(t,e,r,i,n,s){function o(U){if(U!==void 0&&typeof U!="function")throw new TypeError("Function expected");return U}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?i.static?t:t.prototype:null,f=e||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,y=!1,m=r.length-1;m>=0;m--){var x={};for(var T in i)x[T]=T==="access"?{}:i[T];for(var T in i.access)x.access[T]=i.access[T];x.addInitializer=function(U){if(y)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(U||null))};var I=(0,r[m])(a==="accessor"?{get:f.get,set:f.set}:f[c],x);if(a==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(d=o(I.get))&&(f.get=d),(d=o(I.set))&&(f.set=d),(d=o(I.init))&&n.unshift(d)}else(d=o(I))&&(a==="field"?n.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),y=!0}function eS(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function tS(t){return typeof t=="symbol"?t:"".concat(t)}function rS(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function iS(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function nS(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(i.next(f))}catch(d){o(d)}}function c(f){try{u(i.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):n(f.value).then(a,c)}u((i=i.apply(t,e||[])).next())})}function sS(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(f){u=[6,f],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function oS(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zf(e,t,r)}function Xf(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function bh(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function aS(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(bh(arguments[e]));return t}function cS(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function uS(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))}function bo(t){return this instanceof bo?(this.v=t,this):new bo(t)}function lS(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(m){return function(x){return Promise.resolve(x).then(m,d)}}function a(m,x){i[m]&&(n[m]=function(T){return new Promise(function(I,U){s.push([m,T,I,U])>1||c(m,T)})},x&&(n[m]=x(n[m])))}function c(m,x){try{u(i[m](x))}catch(T){y(s[0][3],T)}}function u(m){m.value instanceof bo?Promise.resolve(m.value.v).then(f,d):y(s[0][2],m)}function f(m){c("next",m)}function d(m){c("throw",m)}function y(m,x){m(x),s.shift(),s.length&&c(s[0][0],s[0][1])}}function fS(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(o){return(r=!r)?{value:bo(t[n](o)),done:!1}:s?s(o):o}:s}}function dS(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Xf=="function"?Xf(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),n(a,c,o.done,o.value)})}}function n(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function pS(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function yS(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=mh(t),i=0;i<r.length;i++)r[i]!=="default"&&Zf(e,t,r[i]);return rI(e,t),e}function _S(t){return t&&t.__esModule?t:{default:t}}function hS(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function gS(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function AS(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function vS(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(s){return Promise.reject(s)}}),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function mS(t){function e(s){t.error=t.hasError?new iI(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(s).then(n,function(o){return e(o),n()})}else i|=1}catch(o){e(o)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return n()}function bS(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,s,o){return i?e?".jsx":".js":n&&(!s||!o)?r:n+s+"."+o.toLowerCase()+"js"}):t}var vh,Qf,Zf,rI,mh,iI,nI,v=Tb(()=>{vh=function(t,e){return vh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},vh(t,e)};Qf=function(){return Qf=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Qf.apply(this,arguments)};Zf=Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]});rI=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},mh=function(t){return mh=Object.getOwnPropertyNames||function(e){var r=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[r.length]=i);return r},mh(t)};iI=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};nI={__extends:Yb,__assign:Qf,__rest:Jb,__decorate:Qb,__param:Xb,__esDecorate:Zb,__runInitializers:eS,__propKey:tS,__setFunctionName:rS,__metadata:iS,__awaiter:nS,__generator:sS,__createBinding:Zf,__exportStar:oS,__values:Xf,__read:bh,__spread:aS,__spreadArrays:cS,__spreadArray:uS,__await:bo,__asyncGenerator:lS,__asyncDelegator:fS,__asyncValues:dS,__makeTemplateObject:pS,__importStar:yS,__importDefault:_S,__classPrivateFieldGet:hS,__classPrivateFieldSet:gS,__classPrivateFieldIn:AS,__addDisposableResource:vS,__disposeResources:mS,__rewriteRelativeImportExtension:bS}});var wh=l(So=>{"use strict";var sI="[object ArrayBuffer]",Ei=class t{static isArrayBuffer(e){return Object.prototype.toString.call(e)===sI}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,r){if(e.constructor===r)return e;if(this.isArrayBuffer(e))return new r(e);if(this.isArrayBufferView(e))return new r(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,r){let i=t.toUint8Array(e),n=t.toUint8Array(r);if(i.length!==n.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static concat(...e){let r;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?r=e[0]:e[e.length-1]instanceof Function?r=e.slice(0,e.length-1):r=e;let i=0;for(let o of r)i+=o.byteLength;let n=new Uint8Array(i),s=0;for(let o of r){let a=this.toUint8Array(o);n.set(a,s),s+=a.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}},Sh="string",oI=/^[0-9a-f\s]+$/i,aI=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,cI=/^[a-zA-Z0-9-_]+$/,ed=class{static fromString(e){let r=unescape(encodeURIComponent(e)),i=new Uint8Array(r.length);for(let n=0;n<r.length;n++)i[n]=r.charCodeAt(n);return i.buffer}static toString(e){let r=Ei.toUint8Array(e),i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}},or=class{static toString(e,r=!1){let i=Ei.toArrayBuffer(e),n=new DataView(i),s="";for(let o=0;o<i.byteLength;o+=2){let a=n.getUint16(o,r);s+=String.fromCharCode(a)}return s}static fromString(e,r=!1){let i=new ArrayBuffer(e.length*2),n=new DataView(i);for(let s=0;s<e.length;s++)n.setUint16(s*2,e.charCodeAt(s),r);return i}},td=class t{static isHex(e){return typeof e===Sh&&oI.test(e)}static isBase64(e){return typeof e===Sh&&aI.test(e)}static isBase64Url(e){return typeof e===Sh&&cI.test(e)}static ToString(e,r="utf8"){let i=Ei.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return or.toString(i,!0);case"utf16":case"utf16be":return or.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,r="utf8"){if(!e)return new ArrayBuffer(0);switch(r.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 or.fromString(e,!0);case"utf16":case"utf16be":return or.fromString(e);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(e){let r=Ei.toUint8Array(e);if(typeof btoa<"u"){let i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(e);case"utf8":return ed.fromString(e);case"utf16":case"utf16be":return or.fromString(e);case"utf16le":case"usc2":return or.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(e,r=t.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(e);case"utf8":return ed.toString(e);case"utf16":case"utf16be":return or.toString(e);case"utf16le":case"usc2":return or.toString(e,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(e){let r=e.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=e.charCodeAt(n);return i.buffer}static ToBinary(e){let r=Ei.toUint8Array(e),i="";for(let n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);return i}static ToHex(e){let r=Ei.toUint8Array(e),i="",n=r.length;for(let s=0;s<n;s++){let o=r[s];o<16&&(i+="0"),i+=o.toString(16)}return i}static FromHex(e){let r=this.formatString(e);if(!r)return new ArrayBuffer(0);if(!t.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);let i=new Uint8Array(r.length/2);for(let n=0;n<r.length;n=n+2){let s=r.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,r=!1){return or.toString(e,r)}static FromUtf16String(e,r=!1){return or.fromString(e,r)}static Base64Padding(e){let r=4-e.length%4;if(r<4)for(let i=0;i<r;i++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};td.DEFAULT_UTF8_ENCODING="utf8";function uI(t,...e){let r=arguments[0];for(let i=1;i<arguments.length;i++){let n=arguments[i];for(let s in n)r[s]=n[s]}return r}function lI(...t){let e=t.map(n=>n.byteLength).reduce((n,s)=>n+s),r=new Uint8Array(e),i=0;return t.map(n=>new Uint8Array(n)).forEach(n=>{for(let s of n)r[i++]=s}),r.buffer}function fI(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<t.byteLength;n++)if(r[n]!==i[n])return!1;return!0}So.BufferSourceConverter=Ei;So.Convert=td;So.assign=uI;So.combine=lI;So.isEqual=fI});var CS=l(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});function dI(t){return new Date(t.getTime()+t.getTimezoneOffset()*6e4)}function pI(t,e,r){var i;return t instanceof Object&&(i=t[e])!==null&&i!==void 0?i:r}function yI(t,e=0,r=t.byteLength-e,i=!1){let n="";for(let s of new Uint8Array(t,e,r)){let o=s.toString(16).toUpperCase();o.length===1&&(n+="0"),n+=o,i&&(n+=" ")}return n.trim()}function _I(t,e,r,i){return e instanceof ArrayBuffer?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",!1):i<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-i<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error='Wrong parameter: inputBuffer must be "ArrayBuffer"',!1)}function Ch(t,e){let r=0;if(t.length===1)return t[0];for(let i=t.length-1;i>=0;i--)r+=t[t.length-1-i]*Math.pow(2,e*i);return r}function Ph(t,e,r=-1){let i=r,n=t,s=0,o=Math.pow(2,e);for(let a=1;a<8;a++){if(t<o){let c;if(i<0)c=new ArrayBuffer(a),s=a;else{if(i<a)return new ArrayBuffer(0);c=new ArrayBuffer(i),s=i}let u=new Uint8Array(c);for(let f=a-1;f>=0;f--){let d=Math.pow(2,f*e);u[s-f-1]=Math.floor(n/d),n-=u[s-f-1]*d}return c}o*=Math.pow(2,e)}return new ArrayBuffer(0)}function hI(...t){let e=0,r=0;for(let s of t)e+=s.byteLength;let i=new ArrayBuffer(e),n=new Uint8Array(i);for(let s of t)n.set(new Uint8Array(s),r),r+=s.byteLength;return i}function gI(...t){let e=0,r=0;for(let s of t)e+=s.length;let i=new ArrayBuffer(e),n=new Uint8Array(i);for(let s of t)n.set(s,r),r+=s.length;return n}function AI(){let t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=t[0]===255&&t[1]&128,c=t[0]===0&&(t[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)r[a]=0;r[0]=t[0]&128;let i=Ch(r,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let a=0;a<this.valueHex.byteLength;a++)s[a]=t[a];return s[0]&=127,Ch(s,8)-i}function vI(t){let e=t<0?t*-1:t,r=128;for(let i=1;i<8;i++){if(e<=r){if(t<0){let o=r-e,a=Ph(o,8,i),c=new Uint8Array(a);return c[0]|=128,a}let n=Ph(e,8,i),s=new Uint8Array(n);if(s[0]&128){let o=n.slice(0),a=new Uint8Array(o);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let c=0;c<o.byteLength;c++)s[c+1]=a[c];s[0]=0}return n}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function mI(t,e){if(t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<r.length;n++)if(r[n]!==i[n])return!1;return!0}function bI(t,e){let r=t.toString(10);if(e<r.length)return"";let i=e-r.length,n=new Array(i);for(let o=0;o<i;o++)n[o]="0";return n.join("").concat(r)}var SS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",wS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function SI(t,e=!1,r=!1,i=!1){let n=0,s=0,o=0,a="",c=e?wS:SS;if(i){let u=0;for(let f=0;f<t.length;f++)if(t.charCodeAt(f)!==0){u=f;break}t=t.slice(u)}for(;n<t.length;){let u=t.charCodeAt(n++);n>=t.length&&(s=1);let f=t.charCodeAt(n++);n>=t.length&&(o=1);let d=t.charCodeAt(n++),y=u>>2,m=(u&3)<<4|f>>4,x=(f&15)<<2|d>>6,T=d&63;s===1?x=T=64:o===1&&(T=64),r?x===64?a+=`${c.charAt(y)}${c.charAt(m)}`:T===64?a+=`${c.charAt(y)}${c.charAt(m)}${c.charAt(x)}`:a+=`${c.charAt(y)}${c.charAt(m)}${c.charAt(x)}${c.charAt(T)}`:a+=`${c.charAt(y)}${c.charAt(m)}${c.charAt(x)}${c.charAt(T)}`}return a}function wI(t,e=!1,r=!1){let i=e?wS:SS;function n(c){for(let u=0;u<64;u++)if(i.charAt(u)===c)return u;return 64}function s(c){return c===64?0:c}let o=0,a="";for(;o<t.length;){let c=n(t.charAt(o++)),u=o>=t.length?0:n(t.charAt(o++)),f=o>=t.length?0:n(t.charAt(o++)),d=o>=t.length?0:n(t.charAt(o++)),y=s(c)<<2|s(u)>>4,m=(s(u)&15)<<4|s(f)>>2,x=(s(f)&3)<<6|s(d);a+=String.fromCharCode(y),f!==64&&(a+=String.fromCharCode(m)),d!==64&&(a+=String.fromCharCode(x))}if(r){let c=a.length,u=-1;for(let f=c-1;f>=0;f--)if(a.charCodeAt(f)!==0){u=f;break}u!==-1?a=a.slice(0,u+1):a=""}return a}function CI(t){let e="",r=new Uint8Array(t);for(let i of r)e+=String.fromCharCode(i);return e}function PI(t){let e=t.length,r=new ArrayBuffer(e),i=new Uint8Array(r);for(let n=0;n<e;n++)i[n]=t.charCodeAt(n);return r}var EI=Math.log(2);function TI(t){let e=Math.log(t)/EI,r=Math.floor(e),i=Math.round(e);return r===i?r:i}function xI(t,e){for(let r of e)delete t[r]}He.arrayBufferToString=CI;He.bufferToHexCodes=yI;He.checkBufferParams=_I;He.clearProps=xI;He.fromBase64=wI;He.getParametersValue=pI;He.getUTCDate=dI;He.isEqualBuffer=mI;He.nearestPowerOf2=TI;He.padNumber=bI;He.stringToArrayBuffer=PI;He.toBase64=SI;He.utilConcatBuf=hI;He.utilConcatView=gI;He.utilDecodeTC=AI;He.utilEncodeTC=vI;He.utilFromBase=Ch;He.utilToBase=Ph});var Zi=l(z=>{"use strict";var OI=wh(),II=CS();function xS(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(r){if(r!=="default"){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}}),e.default=t,Object.freeze(e)}var re=xS(OI),ye=xS(II);function rd(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function xh(t){let e=0,r=0;for(let n=0;n<t.length;n++){let s=t[n];e+=s.byteLength}let i=new Uint8Array(e);for(let n=0;n<t.length;n++){let s=t[n];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function Oi(t,e,r,i){return e instanceof Uint8Array?e.byteLength?r<0?(t.error="Wrong parameter: inputOffset less than zero",!1):i<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-r-i<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var Co=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return xh(this.items)}},Ec=[new Uint8Array([1])],PS="0123456789",Eh="name",ES="valueHexView",BI="isHexOnly",kI="idBlock",jI="tagClass",MI="tagNumber",NI="isConstructed",qI="fromBER",RI="toBER",DI="local",Et="",ei=new ArrayBuffer(0),Ad=new Uint8Array(0),xc="EndOfContent",OS="OCTET STRING",IS="BIT STRING";function ti(t){var e;return e=class extends t{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var n;super(...i);let s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?re.BufferSourceConverter.toUint8Array(s.valueHex):Ad}fromBER(i,n,s,o){let a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!Oi(this,a,n,s))return-1;let c=n+s;return this.valueHexView=a.subarray(n,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),n)}toBER(i=!1){return this.isHexOnly?i?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",ei)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:re.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var Ti=class{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:r=Et,warnings:i=[],valueBeforeDecode:n=Ad}={}){this.blockLength=e,this.error=r,this.warnings=i,this.valueBeforeDecodeView=re.BufferSourceConverter.toUint8Array(n)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:re.Convert.ToHex(this.valueBeforeDecodeView)}}};Ti.NAME="baseBlock";var nt=class extends Ti{fromBER(e,r,i,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};nt.NAME="valueBlock";var id=class extends ti(Ti){constructor({idBlock:e={}}={}){var r,i,n,s;super(),e?(this.isHexOnly=(r=e.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=e.valueHex?re.BufferSourceConverter.toUint8Array(e.valueHex):Ad,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=e.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",ei}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){let n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,r|=s,n[0]=r}return n.buffer}if(!this.isHexOnly){let n=ye.utilToBase(this.tagNumber,7),s=new Uint8Array(n),o=n.byteLength,a=new Uint8Array(o+1);if(a[0]=r|31,!e){for(let c=0;c<o-1;c++)a[c+1]=s[c]|128;a[o]=s[o-1]}return a.buffer}let i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!e){let n=this.valueHexView;for(let s=0;s<n.length-1;s++)i[s+1]=n[s]|128;i[this.valueHexView.byteLength]=n[n.length-1]}return i.buffer}fromBER(e,r,i){let n=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,n,r,i))return-1;let s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;let a=s[0]&31;if(a!==31)this.tagNumber=a,this.blockLength=1;else{let c=0;for(;;){let f=c+1;if(f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c++,(s[f]&128)===0)break}this.blockLength=c+1;let u=this.valueHexView=new Uint8Array(c);for(let f=0;f<c;f++)u[f]=s[f+1]&127;this.blockLength<=9?this.tagNumber=ye.utilFromBase(u,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 r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};id.NAME="identificationBlock";var nd=class extends Ti{constructor({lenBlock:e={}}={}){var r,i,n;super(),this.isIndefiniteForm=(r=e.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(n=e.length)!==null&&n!==void 0?n:0}fromBER(e,r,i){let n=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,n,r,i))return-1;let s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;let o=s[0]&127;if(o>8)return this.error="Too big integer",-1;if(o+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let a=r+1,c=n.subarray(a,a+o);return c[o-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=ye.utilFromBase(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=o+1,r+this.blockLength}toBER(e=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){let n=ye.utilToBase(this.length,8);if(n.byteLength>127)return this.error="Too big length",ei;if(r=new ArrayBuffer(n.byteLength+1),e)return r;let s=new Uint8Array(n);i=new Uint8Array(r),i[0]=n.byteLength|128;for(let o=0;o<n.byteLength;o++)i[o+1]=s[o];return r}return r=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};nd.NAME="lengthBlock";var N={},Xe=class extends Ti{constructor({name:e=Et,optional:r=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new id(n),this.lenBlock=new nd(n),this.valueBlock=s?new s(n):new nt(n)}fromBER(e,r,i,n){let s=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length,n);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,r){let i=r||new Co;r||BS(this);let n=this.idBlock.toBER(e);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else{let s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let o=this.lenBlock.toBER(e);i.write(o),i.write(s)}return r?ei:i.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():re.Convert.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,r=re.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${r}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let r=this.toBER(),i=e.toBER();return ye.isEqualBuffer(r,i)}};Xe.NAME="BaseBlock";function BS(t){var e;if(t instanceof N.Constructed)for(let r of t.valueBlock.value)BS(r)&&(t.lenBlock.isIndefiniteForm=!0);return!!(!((e=t.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}var Oc=class extends Xe{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Et,...r}={},i){super(r,i),e&&this.fromString(e)}fromBER(e,r,i){let n=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};Oc.NAME="BaseStringBlock";var sd=class extends ti(nt){constructor({isHexOnly:e=!0,...r}={}){super(r),this.isHexOnly=e}};sd.NAME="PrimitiveValueBlock";var kS,Ic=class extends Xe{constructor(e={}){super(e,sd),this.idBlock.isConstructed=!1}};kS=Ic;N.Primitive=kS;Ic.NAME="PRIMITIVE";var jS=100,MS=1e4,NS=16*1024*1024,UI="Maximum ASN.1 nesting depth exceeded",LI="Maximum ASN.1 node count exceeded",KI="Maximum ASN.1 content length exceeded";function au(t={}){var e,r,i;return{depth:0,maxDepth:(e=t.maxDepth)!==null&&e!==void 0?e:jS,nodesCount:0,maxNodes:(r=t.maxNodes)!==null&&r!==void 0?r:MS,maxContentLength:(i=t.maxContentLength)!==null&&i!==void 0?i:NS}}function VI(t){let e=new Xe({},nt);return e.error=t,{offset:-1,result:e}}function GI(t){if(t.nodesCount+=1,t.nodesCount>t.maxNodes)return LI}function FI(t,e){if(t>e.maxContentLength)return KI}function Oh(t,e,r,i){let n=i.depth+1;if(n>i.maxDepth)return VI(UI);i.depth=n;try{return vd(t,e,r,i)}finally{i.depth-=1}}function HI(t,e){if(t instanceof e)return t;let r=new e;return r.idBlock=t.idBlock,r.lenBlock=t.lenBlock,r.warnings=t.warnings,r.valueBeforeDecodeView=t.valueBeforeDecodeView,r}function vd(t,e=0,r=t.length,i=au()){let n=e,s=new Xe({},nt),o=new Ti;if(!Oi(o,t,e,r))return s.error=o.error,{offset:-1,result:s};if(!t.subarray(e,e+r).length)return s.error="Zero buffer length",{offset:-1,result:s};let c=GI(i);if(c)return s.error=c,{offset:-1,result:s};let u=s.idBlock.fromBER(t,e,r);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,r-=s.idBlock.blockLength,u=s.lenBlock.fromBER(t,e,r),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};e=u,r-=s.lenBlock.blockLength;let f=s.lenBlock.isIndefiniteForm?r:s.lenBlock.length,d=FI(f,i);if(d)return s.error=d,{offset:-1,result:s};if(!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let y=Xe;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};y=N.EndOfContent;break;case 1:y=N.Boolean;break;case 2:y=N.Integer;break;case 3:y=N.BitString;break;case 4:y=N.OctetString;break;case 5:y=N.Null;break;case 6:y=N.ObjectIdentifier;break;case 10:y=N.Enumerated;break;case 12:y=N.Utf8String;break;case 13:y=N.RelativeObjectIdentifier;break;case 14:y=N.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:y=N.Sequence;break;case 17:y=N.Set;break;case 18:y=N.NumericString;break;case 19:y=N.PrintableString;break;case 20:y=N.TeletexString;break;case 21:y=N.VideotexString;break;case 22:y=N.IA5String;break;case 23:y=N.UTCTime;break;case 24:y=N.GeneralizedTime;break;case 25:y=N.GraphicString;break;case 26:y=N.VisibleString;break;case 27:y=N.GeneralString;break;case 28:y=N.UniversalString;break;case 29:y=N.CharacterString;break;case 30:y=N.BmpString;break;case 31:y=N.DATE;break;case 32:y=N.TimeOfDay;break;case 33:y=N.DateTime;break;case 34:y=N.Duration;break;default:{let m=s.idBlock.isConstructed?new N.Constructed:new N.Primitive;m.idBlock=s.idBlock,m.lenBlock=s.lenBlock,m.warnings=s.warnings,s=m}}break;default:y=s.idBlock.isConstructed?N.Constructed:N.Primitive}return s=HI(s,y),u=s.fromBER(t,e,f,i),s.valueBeforeDecodeView=t.subarray(n,n+s.blockLength),{offset:u,result:s}}function WI(t,e={}){if(!t.byteLength){let r=new Xe({},nt);return r.error="Input buffer has zero length",{offset:-1,result:r}}return vd(re.BufferSourceConverter.toUint8Array(t).slice(),0,t.byteLength,au(e))}function $I(t,e){return t?1:e}var Xr=class extends nt{constructor({value:e=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=r}fromBER(e,r,i,n){let s=re.BufferSourceConverter.toUint8Array(e),o=n??au();if(!Oi(this,s,r,i))return-1;if(this.valueBeforeDecodeView=s.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let a=r;for(;$I(this.isIndefiniteForm,i)>0;){let c=Oh(s,a,i,o);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(a=c.offset,this.blockLength+=c.result.blockLength,i-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===xc)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===xc?this.value.pop():this.warnings.push("No EndOfContent block encoded")),a}toBER(e,r){let i=r||new Co;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return r?ei:i.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let r of this.value)e.value.push(r.toJSON());return e}};Xr.NAME="ConstructedValueBlock";var qS,xi=class extends Xe{constructor(e={}){super(e,Xr),this.idBlock.isConstructed=!0}fromBER(e,r,i,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length,n);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 i of this.valueBlock.value)e.push(i.toString("ascii").split(`
7
7
  `).map(n=>` ${n}`).join(`
8
8
  `));let r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${r} :
9
9
  ${e.join(`
10
- `)}`:`${r} :`}};NS=xi;N.Constructed=NS;xi.NAME="CONSTRUCTED";var ad=class extends nt{fromBER(e,r,i){return r}toBER(e){return ei}};ad.override="EndOfContentValueBlock";var qS,kc=class extends Xe{constructor(e={}){super(e,ad),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};qS=kc;N.EndOfContent=qS;kc.NAME=Oc;var RS,jc=class extends Xe{constructor(e={}){super(e,nt),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,r,i){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+=i,r+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(e,r){let i=new ArrayBuffer(2);if(!e){let n=new Uint8Array(i);n[0]=5,n[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}};RS=jc;N.Null=RS;jc.NAME="NULL";var cd=class extends ti(nt){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,...r}={}){super(r),r.valueHex?this.valueHexView=re.BufferSourceConverter.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,r,i){let n=re.BufferSourceConverter.toUint8Array(e);return Oi(this,n,r,i)?(this.valueHexView=n.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ye.utilDecodeTC.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};cd.NAME="BooleanValueBlock";var DS,Mc=class extends Xe{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,cd),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};DS=Mc;N.Boolean=DS;Mc.NAME="BOOLEAN";var ud=class extends ti(Xr){constructor({isConstructed:e=!1,...r}={}){super(r),this.isConstructed=e}fromBER(e,r,i,n){let s=0;if(this.isConstructed){if(this.isHexOnly=!1,s=Xr.prototype.fromBER.call(this,e,r,i,n),s===-1)return s;for(let o=0;o<this.value.length;o++){let a=this.value[o].constructor.NAME;if(a===Oc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==xS)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,s=super.fromBER(e,r,i),this.blockLength=i;return s}toBER(e,r){return this.isConstructed?Xr.prototype.toBER.call(this,e,r):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};ud.NAME="OctetStringValueBlock";var Bh,Nc=class extends Xe{constructor({idBlock:e={},lenBlock:r={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},ud),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,r,i,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){let o=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(r,r+i);try{if(o.byteLength){let a=n??cu(),c=Ih(o,0,o.byteLength,a);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,r,i,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return xi.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,r=re.Convert.ToHex(this.valueBlock.valueHexView);return`${e} : ${r}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let r of this.valueBlock.value)r instanceof Bh&&e.push(r.valueBlock.valueHexView);return re.BufferSourceConverter.concat(e)}};Bh=Nc;N.OctetString=Bh;Nc.NAME=xS;var ld=class extends ti(Xr){constructor({unusedBits:e=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=e,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(e,r,i,n){if(!i)return r;let s=-1;if(this.isConstructed){if(s=Xr.prototype.fromBER.call(this,e,r,i,n),s===-1)return s;for(let c of this.value){let u=c.constructor.NAME;if(u===Oc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(u!==OS)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let f=c.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 o=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,o,r,i))return-1;let a=o.subarray(r,r+i);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 c=a.subarray(1);try{if(c.byteLength){let u=n??cu(),f=Ih(c,0,c.byteLength,u);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(e,r){if(this.isConstructed)return Xr.prototype.toBER.call(this,e,r);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){let n=new Uint8Array(1);return n[0]=0,n.buffer}let i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};ld.NAME="BitStringValueBlock";var US,qc=class extends Xe{constructor({idBlock:e={},lenBlock:r={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},ld),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,r,i,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,r,i,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return xi.prototype.onAsciiEncoding.call(this);{let e=[],r=this.valueBlock.valueHexView;for(let o of r)e.push(o.toString(2).padStart(8,"0"));let i=e.join(""),n=this.constructor.NAME,s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${n} : ${s}`}}};US=qc;N.BitString=US;qc.NAME=OS;var LS;function zI(t,e){let r=new Uint8Array([0]),i=new Uint8Array(t),n=new Uint8Array(e),s=i.slice(0),o=s.length-1,a=n.slice(0),c=a.length-1,u=0,f=c<o?o:c,d=0;for(let y=f;y>=0;y--,d++)!0===d<a.length?u=s[o-d]+a[c-d]+r[0]:u=s[o-d]+r[0],r[0]=u/10,!0===d>=s.length?s=ye.utilConcatView(new Uint8Array([u%10]),s):s[o-d]=u%10;return r[0]>0&&(s=ye.utilConcatView(r,s)),s}function ES(t){if(t>=Tc.length)for(let e=Tc.length;e<=t;e++){let r=new Uint8Array([0]),i=Tc[e-1].slice(0);for(let n=i.length-1;n>=0;n--){let s=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=s[0]/10,i[n]=s[0]%10}r[0]>0&&(i=ye.utilConcatView(r,i)),Tc.push(i)}return Tc[t]}function YI(t,e){let r=0,i=new Uint8Array(t),n=new Uint8Array(e),s=i.slice(0),o=s.length-1,a=n.slice(0),c=a.length-1,u,f=0;for(let d=c;d>=0;d--,f++)u=s[o-f]-a[c-f]-r,!0===u<0?(r=1,s[o-f]=u+10):(r=0,s[o-f]=u);if(r>0)for(let d=o-c+1;d>=0;d--,f++)if(u=s[o-f]-r,u<0)r=1,s[o-f]=u+10;else{r=0,s[o-f]=u;break}return s.slice()}var Rc=class extends ti(nt){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=ye.utilDecodeTC.call(this)))}constructor({value:e,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(ye.utilEncodeTC(e))}get valueDec(){return this._valueDec}fromDER(e,r,i,n=0){let s=this.fromBER(e,r,i);if(s===-1)return s;let o=this.valueHexView;return o[0]===0&&(o[1]&128)!==0?this.valueHexView=o.subarray(1):n!==0&&o.length<n&&(n-o.length>1&&(n=o.length+1),this.valueHexView=o.subarray(n-o.length)),s}toDER(e=!1){let r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{let i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,r,i){let n=super.fromBER(e,r,i);return n===-1||this.setValueHex(),n}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,r=new Uint8Array(this.valueHexView.length*8/3),i=0,n,s=this.valueHexView,o="",a=!1;for(let c=s.byteLength-1;c>=0;c--){n=s[c];for(let u=0;u<8;u++)(n&1)===1&&(i===e?(r=YI(ES(i),r),o="-"):r=zI(r,ES(i))),i++,n>>=1}for(let c=0;c<r.length;c++)r[c]&&(a=!0),a&&(o+=CS.charAt(r[c]));return a===!1&&(o+=CS.charAt(0)),o}};LS=Rc;Rc.NAME="IntegerValueBlock";Object.defineProperty(LS.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var xc,Po=class extends Xe{constructor(e={}){super(e,Rc),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return id(),BigInt(this.valueBlock.toString())}static fromBigInt(e){id();let r=BigInt(e),i=new Co,n=r.toString(16).replace(/^-/,""),s=new Uint8Array(re.Convert.FromHex(n));if(r<0){let a=new Uint8Array(s.length+(s[0]&128?1:0));a[0]|=128;let u=BigInt(`0x${re.Convert.ToHex(a)}`)+r,f=re.BufferSourceConverter.toUint8Array(re.Convert.FromHex(u.toString(16)));f[0]|=128,i.write(f)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new xc({valueHex:i.final()})}convertToDER(){let e=new xc({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new xc({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};xc=Po;N.Integer=xc;Po.NAME="INTEGER";var KS,Dc=class extends Po{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};KS=Dc;N.Enumerated=KS;Dc.NAME="ENUMERATED";var Uc=class extends ti(nt){constructor({valueDec:e=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=r}fromBER(e,r,i){if(!i)return r;let n=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,n,r,i))return-1;let s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let a=0;a<i&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let o=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)o[a]=this.valueHexView[a];return this.valueHexView=o,(s[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=ye.utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(e){id();let r=BigInt(e).toString(2);for(;r.length%7;)r="0"+r;let i=new Uint8Array(r.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(r.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let o=0;o<this.blockLength-1;o++)s[o]=n[o]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}let r=ye.utilToBase(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",ei;let i=new Uint8Array(r.byteLength);if(!e){let n=new Uint8Array(r),s=r.byteLength-1;for(let o=0;o<s;o++)i[o]=n[o]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=re.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",r-=40):(e="2.",r-=80),e+=r.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};Uc.NAME="sidBlock";var fd=class extends nt{constructor({value:e=Et,...r}={}){super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,i){let n=r;for(;i>0;){let s=new Uc;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e){let r=[];for(let i=0;i<this.value.length;i++){let n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,ei;r.push(n)}return Oh(r)}fromString(e){this.value=[];let r=0,i=0,n="",s=!1;do if(i=e.indexOf(".",r),i===-1?n=e.substring(r):n=e.substring(r,i),r=i+1,s){let o=this.value[0],a=0;switch(o.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}let c=parseInt(n,10);if(isNaN(c))return;o.valueDec=c+a,s=!1}else{let o=new Uc;if(n>Number.MAX_SAFE_INTEGER){id();let a=BigInt(n);o.valueBigInt=a}else if(o.valueDec=parseInt(n,10),isNaN(o.valueDec))return;this.value.length||(o.isFirstSid=!0,s=!0),this.value.push(o)}while(i!==-1)}toString(){let e="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),r?(n=`{${n}}`,this.value[i].isFirstSid?e=`2.{${n} - 80}`:e+=n):e+=n}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};fd.NAME="ObjectIdentifierValueBlock";var VS,Lc=class extends Xe{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,fd),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};VS=Lc;N.ObjectIdentifier=VS;Lc.NAME="OBJECT IDENTIFIER";var Kc=class extends ti(Ti){constructor({valueDec:e=0,...r}={}){super(r),this.valueDec=e}fromBER(e,r,i){if(i===0)return r;let n=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,n,r,i))return-1;let s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let a=0;a<i&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let o=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)o[a]=this.valueHexView[a];return this.valueHexView=o,(s[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=ye.utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let o=0;o<this.blockLength-1;o++)s[o]=n[o]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}let r=ye.utilToBase(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",ei;let i=new Uint8Array(r.byteLength);if(!e){let n=new Uint8Array(r),s=r.byteLength-1;for(let o=0;o<s;o++)i[o]=n[o]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=re.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};Kc.NAME="relativeSidBlock";var dd=class extends nt{constructor({value:e=Et,...r}={}){super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,i){let n=r;for(;i>0;){let s=new Kc;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e,r){let i=[];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,ei;i.push(s)}return Oh(i)}fromString(e){this.value=[];let r=0,i=0,n="";do{i=e.indexOf(".",r),i===-1?n=e.substring(r):n=e.substring(r,i),r=i+1;let s=new Kc;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let e="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),r&&(n=`{${n}}`),e+=n}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};dd.NAME="RelativeObjectIdentifierValueBlock";var GS,Vc=class extends Xe{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,dd),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};GS=Vc;N.RelativeObjectIdentifier=GS;Vc.NAME="RelativeObjectIdentifier";var FS,Gc=class extends xi{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};FS=Gc;N.Sequence=FS;Gc.NAME="SEQUENCE";var HS,Fc=class extends xi{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};HS=Fc;N.Set=HS;Fc.NAME="SET";var pd=class extends ti(nt){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Et}toJSON(){return{...super.toJSON(),value:this.value}}};pd.NAME="StringValueBlock";var yd=class extends pd{};yd.NAME="SimpleStringValueBlock";var St=class extends Ic{constructor({...e}={}){super(e,yd)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,re.BufferSourceConverter.toUint8Array(e))}fromString(e){let r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=e.charCodeAt(n);this.valueBlock.value=e}};St.NAME="SIMPLE STRING";var _d=class extends St{fromBuffer(e){this.valueBlock.valueHexView=re.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=re.Convert.ToUtf8String(e)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=re.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(re.Convert.FromUtf8String(e)),this.valueBlock.value=e}};_d.NAME="Utf8StringValueBlock";var WS,Zr=class extends _d{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};WS=Zr;N.Utf8String=WS;Zr.NAME="UTF8String";var hd=class extends St{fromBuffer(e){this.valueBlock.value=re.Convert.ToUtf16String(e),this.valueBlock.valueHexView=re.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(re.Convert.FromUtf16String(e))}};hd.NAME="BmpStringValueBlock";var $S,Hc=class extends hd{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};$S=Hc;N.BmpString=$S;Hc.NAME="BMPString";var gd=class extends St{fromBuffer(e){let r=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(r);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(e){let r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let n=0;n<r;n++){let s=ye.utilToBase(e.charCodeAt(n),8),o=new Uint8Array(s);if(o.length>4)continue;let a=4-o.length;for(let c=o.length-1;c>=0;c--)i[n*4+c+a]=o[c]}this.valueBlock.value=e}};gd.NAME="UniversalStringValueBlock";var zS,Wc=class extends gd{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};zS=Wc;N.UniversalString=zS;Wc.NAME="UniversalString";var YS,$c=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};YS=$c;N.NumericString=YS;$c.NAME="NumericString";var JS,zc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};JS=zc;N.PrintableString=JS;zc.NAME="PrintableString";var QS,Yc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};QS=Yc;N.TeletexString=QS;Yc.NAME="TeletexString";var XS,Jc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};XS=Jc;N.VideotexString=XS;Jc.NAME="VideotexString";var ZS,Qc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};ZS=Qc;N.IA5String=ZS;Qc.NAME="IA5String";var ew,Xc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};ew=Xc;N.GraphicString=ew;Xc.NAME="GraphicString";var tw,Eo=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};tw=Eo;N.VisibleString=tw;Eo.NAME="VisibleString";var rw,Zc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};rw=Zc;N.GeneralString=rw;Zc.NAME="GeneralString";var iw,eu=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};iw=eu;N.CharacterString=iw;eu.NAME="CharacterString";var nw,To=class extends Eo{constructor({value:e,valueDate:r,...i}={}){if(super(i),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 n=0;n<e.length;n++)this.valueBlock.valueHexView[n]=e.charCodeAt(n)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,re.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),r=new ArrayBuffer(e.length),i=new Uint8Array(r);for(let n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return r}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 i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}let n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(e="iso"){if(e==="iso"){let r=new Array(7);return r[0]=ye.padNumber(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=ye.padNumber(this.month,2),r[2]=ye.padNumber(this.day,2),r[3]=ye.padNumber(this.hour,2),r[4]=ye.padNumber(this.minute,2),r[5]=ye.padNumber(this.second,2),r[6]="Z",r.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}}};nw=To;N.UTCTime=nw;To.NAME="UTCTime";var sw,tu=class extends To{constructor(e={}){var r;super(e),(r=this.millisecond)!==null&&r!==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 r=!1,i="",n="",s=0,o,a=0,c=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),r=!0;else{let d=new Number(e[e.length-1]);if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let d=1,y=i.indexOf("+"),m="";if(y===-1&&(y=i.indexOf("-"),d=-1),y!==-1){if(m=i.substring(y+1),i=i.substring(0,y),m.length!==2&&m.length!==4)throw new Error("Wrong input string for conversion");let x=parseInt(m.substring(0,2),10);if(isNaN(x.valueOf()))throw new Error("Wrong input string for conversion");if(a=d*x,m.length===4){if(x=parseInt(m.substring(2,4),10),isNaN(x.valueOf()))throw new Error("Wrong input string for conversion");c=d*x}}}let u=i.indexOf(".");if(u===-1&&(u=i.indexOf(",")),u!==-1){let d=new Number(`0${i.substring(u)}`);if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");s=d.valueOf(),n=i.substring(0,u)}else n=i;switch(!0){case n.length===8:if(o=/(\d{4})(\d{2})(\d{2})/ig,u!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let d=60*s;this.minute=Math.floor(d),d=60*(d-this.minute),this.second=Math.floor(d),d=1e3*(d-this.second),this.millisecond=Math.floor(d)}break;case n.length===12:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let d=60*s;this.second=Math.floor(d),d=1e3*(d-this.second),this.millisecond=Math.floor(d)}break;case n.length===14:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let d=1e3*s;this.millisecond=Math.floor(d)}break;default:throw new Error("Wrong input string for conversion")}let f=o.exec(n);if(f===null)throw new Error("Wrong input string for conversion");for(let d=1;d<f.length;d++)switch(d){case 1:this.year=parseInt(f[d],10);break;case 2:this.month=parseInt(f[d],10);break;case 3:this.day=parseInt(f[d],10);break;case 4:this.hour=parseInt(f[d],10)+a;break;case 5:this.minute=parseInt(f[d],10)+c;break;case 6:this.second=parseInt(f[d],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){let d=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=d.getUTCFullYear(),this.month=d.getUTCMonth(),this.day=d.getUTCDay(),this.hour=d.getUTCHours(),this.minute=d.getUTCMinutes(),this.second=d.getUTCSeconds(),this.millisecond=d.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let r=[];return r.push(ye.padNumber(this.year,4)),r.push(ye.padNumber(this.month,2)),r.push(ye.padNumber(this.day,2)),r.push(ye.padNumber(this.hour,2)),r.push(ye.padNumber(this.minute,2)),r.push(ye.padNumber(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(ye.padNumber(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};sw=tu;N.GeneralizedTime=sw;tu.NAME="GeneralizedTime";var ow,ru=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};ow=ru;N.DATE=ow;ru.NAME="DATE";var aw,iu=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};aw=iu;N.TimeOfDay=aw;iu.NAME="TimeOfDay";var cw,nu=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};cw=nu;N.DateTime=cw;nu.NAME="DateTime";var uw,su=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};uw=su;N.Duration=uw;su.NAME="Duration";var lw,ou=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};lw=ou;N.TIME=lw;ou.NAME="TIME";var Un=class{constructor({name:e=Et,optional:r=!1}={}){this.name=e,this.optional=r}},Ad=class extends Un{constructor({value:e=[],...r}={}){super(r),this.value=e}},au=class extends Un{constructor({value:e=new Un,local:r=!1,...i}={}){super(i),this.value=e,this.local=r}},xh=class{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=re.BufferSourceConverter.toUint8Array(e)}constructor({data:e=vd}={}){this.dataView=re.BufferSourceConverter.toUint8Array(e)}fromBER(e,r,i){let n=r+i;return this.dataView=re.BufferSourceConverter.toUint8Array(e).subarray(r,n),n}toBER(e){return this.dataView.slice().buffer}};function wo(t,e,r){if(r instanceof Ad){for(let s of r.value)if(wo(t,e,s).verified)return{verified:!0,result:t};{let s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(Th)&&(s.name=r.name),s}}if(r instanceof Un)return r.hasOwnProperty(Th)&&(t[r.name]=e),{verified:!0,result:t};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(kI in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(qI in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(RI in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(jI)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:t};if(r.idBlock.hasOwnProperty(MI)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:t};if(r.idBlock.hasOwnProperty(NI)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:t};if(!(BI in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:t};if(r.idBlock.isHexOnly){if(!(PS in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let s=r.idBlock.valueHexView,o=e.idBlock.valueHexView;if(s.length!==o.length)return{verified:!1,result:t};for(let a=0;a<s.length;a++)if(s[a]!==o[1])return{verified:!1,result:t}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&(t[r.name]=e)),r instanceof N.Constructed){let s=0,o={verified:!1,result:{error:"Unknown error"}},a=r.valueBlock.value.length;if(a>0&&r.valueBlock.value[0]instanceof au&&(a=e.valueBlock.value.length),a===0)return{verified:!0,result:t};if(e.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let u=0;u<r.valueBlock.value.length;u++)c=c&&(r.valueBlock.value[u].optional||!1);return c?{verified:!0,result:t}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&delete t[r.name]),t.error="Inconsistent object length",{verified:!1,result:t})}for(let c=0;c<a;c++)if(c-s>=e.valueBlock.value.length){if(r.valueBlock.value[c].optional===!1){let u={verified:!1,result:t};return t.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&(delete t[r.name],u.name=r.name)),u}}else if(r.valueBlock.value[0]instanceof au){if(o=wo(t,e.valueBlock.value[c],r.valueBlock.value[0].value),o.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&delete t[r.name]),o;if(Th in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let u={};DI in r.valueBlock.value[0]&&r.valueBlock.value[0].local?u=e:u=t,typeof u[r.valueBlock.value[0].name]>"u"&&(u[r.valueBlock.value[0].name]=[]),u[r.valueBlock.value[0].name].push(e.valueBlock.value[c])}}else if(o=wo(t,e.valueBlock.value[c-s],r.valueBlock.value[c]),o.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&delete t[r.name]),o;if(o.verified===!1){let c={verified:!1,result:t};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&(delete t[r.name],c.name=r.name)),c}return{verified:!0,result:t}}if(r.primitiveSchema&&PS in e.valueBlock){let s=md(e.valueBlock.valueHexView);if(s.offset===-1){let o={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&(delete t[r.name],o.name=r.name)),o}return wo(t,s.result,r.primitiveSchema)}return{verified:!0,result:t}}function JI(t,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let r=md(re.BufferSourceConverter.toUint8Array(t));return r.offset===-1?{verified:!1,result:r.result}:wo(r.result,r.result,e)}z.Any=Un;z.BaseBlock=Xe;z.BaseStringBlock=Ic;z.BitString=qc;z.BmpString=Hc;z.Boolean=Mc;z.CharacterString=eu;z.Choice=Ad;z.Constructed=xi;z.DATE=ru;z.DEFAULT_MAX_CONTENT_LENGTH=MS;z.DEFAULT_MAX_DEPTH=kS;z.DEFAULT_MAX_NODES=jS;z.DateTime=nu;z.Duration=su;z.EndOfContent=kc;z.Enumerated=Dc;z.GeneralString=Zc;z.GeneralizedTime=tu;z.GraphicString=Xc;z.HexBlock=ti;z.IA5String=Qc;z.Integer=Po;z.Null=jc;z.NumericString=$c;z.ObjectIdentifier=Lc;z.OctetString=Nc;z.Primitive=Bc;z.PrintableString=zc;z.RawData=xh;z.RelativeObjectIdentifier=Vc;z.Repeated=au;z.Sequence=Gc;z.Set=Fc;z.TIME=ou;z.TeletexString=Yc;z.TimeOfDay=iu;z.UTCTime=To;z.UniversalString=Wc;z.Utf8String=Zr;z.ValueBlock=nt;z.VideotexString=Jc;z.ViewWriter=Co;z.VisibleString=Eo;z.compareSchema=wo;z.fromBER=WI;z.verifySchema=JI});var fu=l(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.isArrayBuffer=kh;Tt.isSharedArrayBuffer=yw;Tt.isArrayBufferLike=uu;Tt.isArrayBufferView=_w;Tt.isBufferSource=hw;Tt.assertBufferSource=lu;Tt.toUint8Array=bd;Tt.toUint8ArrayCopy=gw;Tt.toArrayBuffer=tB;Tt.toArrayBufferLike=rB;Tt.toView=Aw;Tt.toViewCopy=iB;var QI="[object ArrayBuffer]",XI="[object SharedArrayBuffer]";function fw(t){return Object.prototype.toString.call(t)}function dw(t){return t===DataView||t.prototype instanceof DataView}function ZI(t){return dw(t)?1:t.BYTES_PER_ELEMENT??1}function eB(t){if(ArrayBuffer.isView(t))return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.byteOffset=="number"&&typeof e.byteLength=="number"&&uu(e.buffer)}function pw(t){let e=bd(t),r=new Uint8Array(e.byteLength);return r.set(e),r}function kh(t){return fw(t)===QI}function yw(t){return typeof SharedArrayBuffer<"u"&&fw(t)===XI}function uu(t){return kh(t)||yw(t)}function _w(t){return eB(t)}function hw(t){return uu(t)||_w(t)}function lu(t){if(!hw(t))throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}function bd(t){return lu(t),uu(t)?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function gw(t){return pw(t)}function tB(t){if(lu(t),kh(t))return t;let e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(bd(t)),e}function rB(t){return lu(t),uu(t)?t:t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:pw(t).buffer}function Aw(t,e){if(lu(t),ArrayBuffer.isView(t)&&t.constructor===e)return t;let r=bd(t),i=ZI(e);if(r.byteOffset%i!==0||r.byteLength%i!==0)throw new RangeError(`Cannot create ${e.name} over unaligned byte range`);return dw(e)?new e(r.buffer,r.byteOffset,r.byteLength):new e(r.buffer,r.byteOffset,r.byteLength/i)}function iB(t,e){let r=gw(t);return Aw(r,e)}});var mw=l(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});wd.concatToUint8Array=vw;wd.concat=nB;var Sd=fu();function vw(t){let e=[],r=0;for(let s of t){let o=(0,Sd.toUint8Array)(s);e.push(o),r+=o.byteLength}let i=new Uint8Array(r),n=0;for(let s of e)i.set(s,n),n+=s.byteLength;return i}function nB(t,e,...r){let i,n;typeof e=="function"?(i=Array.from(t),n=e):(0,Sd.isBufferSource)(t)?i=[t,e,...r].filter(Sd.isBufferSource):(i=Array.from(t),e&&i.push(e),i.push(...r));let s=vw(i);return n?(0,Sd.toView)(s,n):s.buffer}});var Sw=l(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.equal=sB;var bw=fu();function sB(t,e,r={}){let i=(0,bw.toUint8Array)(t),n=(0,bw.toUint8Array)(e);if(!r.constantTime&&i.byteLength!==n.byteLength)return!1;let s=Math.max(i.byteLength,n.byteLength),o=i.byteLength^n.byteLength;for(let a=0;a<s;a++)o|=(i[a]??0)^(n[a]??0);return o===0}});var Pw=l(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.indexOf=Cw;Er.lastIndexOf=lB;Er.includes=fB;Er.startsWith=dB;Er.endsWith=pB;Er.slice=yB;Er.tail=_B;Er.copy=hB;Er.compare=gB;var ri=fu();function Cd(t,e,r){let i=Number.isFinite(t)?Math.trunc(t):e;return i<=0?0:i>=r?r:i}function oB(t,e){let r=Cd(e?.start,0,t),i=Cd(e?.end,t,t);return i>=r?[r,i]:[r,r]}function aB(t,e){let r=Cd(e?.start,t,t),i=Cd(e?.end,0,t);return r>=i?[i,r]:[r,r]}function ww(t,e,r){let i=Number.isFinite(t)?Math.trunc(t):e;return i<0?Math.max(r+i,0):i>r?r:i}function cB(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r)&255;return e}function uB(t){return new TextEncoder().encode(t)}function Pd(t,e){return typeof t=="string"?e?.encoding==="utf8"?uB(t):cB(t):(0,ri.toUint8Array)(t)}function Ed(t,e,r){for(let i=0;i<e.byteLength;i++)if(t[r+i]!==e[i])return!1;return!0}function Cw(t,e,r){let i=(0,ri.toUint8Array)(t),n=Pd(e,r),[s,o]=oB(i.byteLength,r);if(n.byteLength===0)return s;let a=o-n.byteLength;if(a<s)return-1;for(let c=s;c<=a;c++)if(Ed(i,n,c))return c;return-1}function lB(t,e,r){let i=(0,ri.toUint8Array)(t),n=Pd(e,r),[s,o]=aB(i.byteLength,r);if(n.byteLength===0)return o;let a=o-n.byteLength;if(a<s)return-1;for(let c=a;c>=s;c--)if(Ed(i,n,c))return c;return-1}function fB(t,e,r){return Cw(t,e,r)!==-1}function dB(t,e,r){let i=(0,ri.toUint8Array)(t),n=Pd(e,r);return n.byteLength>i.byteLength?!1:Ed(i,n,0)}function pB(t,e,r){let i=(0,ri.toUint8Array)(t),n=Pd(e,r);return n.byteLength>i.byteLength?!1:Ed(i,n,i.byteLength-n.byteLength)}function yB(t,e,r){let i=(0,ri.toUint8Array)(t),n=ww(e,0,i.byteLength),s=ww(r,i.byteLength,i.byteLength);return s<=n?i.subarray(n,n):i.subarray(n,s)}function _B(t,e){let r=(0,ri.toUint8Array)(t),i=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;return i>=r.byteLength?r:r.subarray(r.byteLength-i)}function hB(t){return(0,ri.toUint8ArrayCopy)(t)}function gB(t,e){let r=(0,ri.toUint8Array)(t),i=(0,ri.toUint8Array)(e),n=Math.min(r.byteLength,i.byteLength);for(let s=0;s<n;s++){if(r[s]<i[s])return-1;if(r[s]>i[s])return 1}return r.byteLength<i.byteLength?-1:r.byteLength>i.byteLength?1:0}});var Gt=l($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.tail=$.startsWith=$.slice=$.lastIndexOf=$.indexOf=$.includes=$.endsWith=$.copy=$.compare=$.equal=$.concatToUint8Array=$.concat=$.toViewCopy=$.toView=$.toUint8ArrayCopy=$.toUint8Array=$.toArrayBufferLike=$.toArrayBuffer=$.isSharedArrayBuffer=$.isBufferSource=$.isArrayBufferView=$.isArrayBufferLike=$.isArrayBuffer=$.assertBufferSource=void 0;var ar=fu();Object.defineProperty($,"assertBufferSource",{enumerable:!0,get:function(){return ar.assertBufferSource}});Object.defineProperty($,"isArrayBuffer",{enumerable:!0,get:function(){return ar.isArrayBuffer}});Object.defineProperty($,"isArrayBufferLike",{enumerable:!0,get:function(){return ar.isArrayBufferLike}});Object.defineProperty($,"isArrayBufferView",{enumerable:!0,get:function(){return ar.isArrayBufferView}});Object.defineProperty($,"isBufferSource",{enumerable:!0,get:function(){return ar.isBufferSource}});Object.defineProperty($,"isSharedArrayBuffer",{enumerable:!0,get:function(){return ar.isSharedArrayBuffer}});Object.defineProperty($,"toArrayBuffer",{enumerable:!0,get:function(){return ar.toArrayBuffer}});Object.defineProperty($,"toArrayBufferLike",{enumerable:!0,get:function(){return ar.toArrayBufferLike}});Object.defineProperty($,"toUint8Array",{enumerable:!0,get:function(){return ar.toUint8Array}});Object.defineProperty($,"toUint8ArrayCopy",{enumerable:!0,get:function(){return ar.toUint8ArrayCopy}});Object.defineProperty($,"toView",{enumerable:!0,get:function(){return ar.toView}});Object.defineProperty($,"toViewCopy",{enumerable:!0,get:function(){return ar.toViewCopy}});var Ew=mw();Object.defineProperty($,"concat",{enumerable:!0,get:function(){return Ew.concat}});Object.defineProperty($,"concatToUint8Array",{enumerable:!0,get:function(){return Ew.concatToUint8Array}});var AB=Sw();Object.defineProperty($,"equal",{enumerable:!0,get:function(){return AB.equal}});var Ii=Pw();Object.defineProperty($,"compare",{enumerable:!0,get:function(){return Ii.compare}});Object.defineProperty($,"copy",{enumerable:!0,get:function(){return Ii.copy}});Object.defineProperty($,"endsWith",{enumerable:!0,get:function(){return Ii.endsWith}});Object.defineProperty($,"includes",{enumerable:!0,get:function(){return Ii.includes}});Object.defineProperty($,"indexOf",{enumerable:!0,get:function(){return Ii.indexOf}});Object.defineProperty($,"lastIndexOf",{enumerable:!0,get:function(){return Ii.lastIndexOf}});Object.defineProperty($,"slice",{enumerable:!0,get:function(){return Ii.slice}});Object.defineProperty($,"startsWith",{enumerable:!0,get:function(){return Ii.startsWith}});Object.defineProperty($,"tail",{enumerable:!0,get:function(){return Ii.tail}})});var Ln=l(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.AsnPropTypes=xo.AsnTypeTypes=void 0;var Tw;(function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice"})(Tw||(xo.AsnTypeTypes=Tw={}));var xw;(function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null"})(xw||(xo.AsnPropTypes=xw={}))});var Ow=l(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.BitString=void 0;var vB=(v(),g(A)),Mh=vB.__importStar(en()),Nh=Gt(),qh=class{unusedBits=0;value=new ArrayBuffer(0);constructor(e,r=0){if(e)if(typeof e=="number")this.fromNumber(e);else if((0,Nh.isBufferSource)(e))this.unusedBits=r,this.value=(0,Nh.toArrayBuffer)(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Mh.BitString))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=(0,Nh.toArrayBuffer)(e.valueBlock.valueHex),this}toASN(){return new Mh.BitString({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Mh.BitString({name:e})}toNumber(){let e="",r=new Uint8Array(this.value);for(let i of r)e+=i.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let r=e.toString(2),i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;let n=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}};Td.BitString=qh});var Iw=l(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.OctetString=void 0;var mB=(v(),g(A)),Rh=mB.__importStar(en()),Dh=Gt(),Uh=class{buffer;get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):(0,Dh.isBufferSource)(e)?this.buffer=(0,Dh.toArrayBuffer)(e):Array.isArray(e)?this.buffer=new Uint8Array(e).buffer:this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Rh.OctetString))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=(0,Dh.toArrayBuffer)(e.valueBlock.valueHex),this}toASN(){return new Rh.OctetString({valueHex:this.buffer})}toSchema(e){return new Rh.OctetString({name:e})}};xd.OctetString=Uh});var Lh=l(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var Bw=(v(),g(A));Bw.__exportStar(Ow(),Od);Bw.__exportStar(Iw(),Od)});var du=l(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.AsnNullConverter=j.AsnGeneralizedTimeConverter=j.AsnUTCTimeConverter=j.AsnCharacterStringConverter=j.AsnGeneralStringConverter=j.AsnVisibleStringConverter=j.AsnGraphicStringConverter=j.AsnIA5StringConverter=j.AsnVideotexStringConverter=j.AsnTeletexStringConverter=j.AsnPrintableStringConverter=j.AsnNumericStringConverter=j.AsnUniversalStringConverter=j.AsnBmpStringConverter=j.AsnUtf8StringConverter=j.AsnConstructedOctetStringConverter=j.AsnOctetStringConverter=j.AsnBooleanConverter=j.AsnObjectIdentifierConverter=j.AsnBitStringConverter=j.AsnIntegerBigIntConverter=j.AsnIntegerArrayBufferConverter=j.AsnEnumeratedConverter=j.AsnIntegerConverter=j.AsnAnyConverter=void 0;j.defaultConverter=wB;var bB=(v(),g(A)),we=bB.__importStar(en()),Id=Gt(),qe=Ln(),SB=Lh();j.AsnAnyConverter={fromASN:t=>t instanceof we.Null?null:(0,Id.toArrayBuffer)(t.valueBeforeDecodeView),toASN:t=>{if(t===null)return new we.Null;let e=we.fromBER(t);if(e.result.error)throw new Error(e.result.error);return e.result}};j.AsnIntegerConverter={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new we.Integer({value:+t})};j.AsnEnumeratedConverter={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new we.Enumerated({value:t})};j.AsnIntegerArrayBufferConverter={fromASN:t=>(0,Id.toArrayBuffer)(t.valueBlock.valueHexView),toASN:t=>new we.Integer({valueHex:t})};j.AsnIntegerBigIntConverter={fromASN:t=>t.toBigInt(),toASN:t=>we.Integer.fromBigInt(t)};j.AsnBitStringConverter={fromASN:t=>(0,Id.toArrayBuffer)(t.valueBlock.valueHexView),toASN:t=>new we.BitString({valueHex:t})};j.AsnObjectIdentifierConverter={fromASN:t=>t.valueBlock.toString(),toASN:t=>new we.ObjectIdentifier({value:t})};j.AsnBooleanConverter={fromASN:t=>t.valueBlock.value,toASN:t=>new we.Boolean({value:t})};j.AsnOctetStringConverter={fromASN:t=>(0,Id.toArrayBuffer)(t.valueBlock.valueHexView),toASN:t=>new we.OctetString({valueHex:t})};j.AsnConstructedOctetStringConverter={fromASN:t=>new SB.OctetString(t.getValue()),toASN:t=>t.toASN()};function cr(t){return{fromASN:e=>e.valueBlock.value,toASN:e=>new t({value:e})}}j.AsnUtf8StringConverter=cr(we.Utf8String);j.AsnBmpStringConverter=cr(we.BmpString);j.AsnUniversalStringConverter=cr(we.UniversalString);j.AsnNumericStringConverter=cr(we.NumericString);j.AsnPrintableStringConverter=cr(we.PrintableString);j.AsnTeletexStringConverter=cr(we.TeletexString);j.AsnVideotexStringConverter=cr(we.VideotexString);j.AsnIA5StringConverter=cr(we.IA5String);j.AsnGraphicStringConverter=cr(we.GraphicString);j.AsnVisibleStringConverter=cr(we.VisibleString);j.AsnGeneralStringConverter=cr(we.GeneralString);j.AsnCharacterStringConverter=cr(we.CharacterString);j.AsnUTCTimeConverter={fromASN:t=>t.toDate(),toASN:t=>new we.UTCTime({valueDate:t})};j.AsnGeneralizedTimeConverter={fromASN:t=>t.toDate(),toASN:t=>new we.GeneralizedTime({valueDate:t})};j.AsnNullConverter={fromASN:()=>null,toASN:()=>new we.Null};function wB(t){switch(t){case qe.AsnPropTypes.Any:return j.AsnAnyConverter;case qe.AsnPropTypes.BitString:return j.AsnBitStringConverter;case qe.AsnPropTypes.BmpString:return j.AsnBmpStringConverter;case qe.AsnPropTypes.Boolean:return j.AsnBooleanConverter;case qe.AsnPropTypes.CharacterString:return j.AsnCharacterStringConverter;case qe.AsnPropTypes.Enumerated:return j.AsnEnumeratedConverter;case qe.AsnPropTypes.GeneralString:return j.AsnGeneralStringConverter;case qe.AsnPropTypes.GeneralizedTime:return j.AsnGeneralizedTimeConverter;case qe.AsnPropTypes.GraphicString:return j.AsnGraphicStringConverter;case qe.AsnPropTypes.IA5String:return j.AsnIA5StringConverter;case qe.AsnPropTypes.Integer:return j.AsnIntegerConverter;case qe.AsnPropTypes.Null:return j.AsnNullConverter;case qe.AsnPropTypes.NumericString:return j.AsnNumericStringConverter;case qe.AsnPropTypes.ObjectIdentifier:return j.AsnObjectIdentifierConverter;case qe.AsnPropTypes.OctetString:return j.AsnOctetStringConverter;case qe.AsnPropTypes.PrintableString:return j.AsnPrintableStringConverter;case qe.AsnPropTypes.TeletexString:return j.AsnTeletexStringConverter;case qe.AsnPropTypes.UTCTime:return j.AsnUTCTimeConverter;case qe.AsnPropTypes.UniversalString:return j.AsnUniversalStringConverter;case qe.AsnPropTypes.Utf8String:return j.AsnUtf8StringConverter;case qe.AsnPropTypes.VideotexString:return j.AsnVideotexStringConverter;case qe.AsnPropTypes.VisibleString:return j.AsnVisibleStringConverter;default:return null}}});var Bd=l(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.isConvertible=kw;pu.isTypeOfArray=jw;pu.isArrayEqual=CB;function kw(t){return typeof t=="function"&&t.prototype?t.prototype.toASN&&t.prototype.fromASN?!0:kw(t.prototype):!!(t&&typeof t=="object"&&"toASN"in t&&"fromASN"in t)}function jw(t){if(t){let e=Object.getPrototypeOf(t);return e?.prototype?.constructor===Array?!0:jw(e)}return!1}function CB(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<t.byteLength;n++)if(r[n]!==i[n])return!1;return!0}});var Nw=l(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.AsnSchemaStorage=void 0;var PB=(v(),g(A)),Ft=PB.__importStar(en()),Oo=Ln(),Mw=Bd(),Kh=class{items=new WeakMap;has(e){return this.items.has(e)}get(e,r=!1){let i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){let r=this.get(e);r.schema||(r.schema=this.create(e,!0))}createDefault(e){let r={type:Oo.AsnTypeTypes.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(e,r){let i=this.items.get(e)||this.createDefault(e),n=[];for(let s in i.items){let o=i.items[s],a=r?s:"",c;if(typeof o.type=="number"){let f=Oo.AsnPropTypes[o.type],d=Ft[f];if(!d)throw new Error(`Cannot get ASN1 class by name '${f}'`);c=new d({name:a})}else(0,Mw.isConvertible)(o.type)?c=new o.type().toSchema(a):o.optional?this.get(o.type).type===Oo.AsnTypeTypes.Choice?c=new Ft.Any({name:a}):(c=this.create(o.type,!1),c.name=a):c=new Ft.Any({name:a});let u=!!o.optional||o.defaultValue!==void 0;if(o.repeated){c.name="";let f=o.repeated==="set"?Ft.Set:Ft.Sequence;c=new f({name:"",value:[new Ft.Repeated({name:a,value:c})]})}if(o.context!==null&&o.context!==void 0)if(o.implicit)if(typeof o.type=="number"||(0,Mw.isConvertible)(o.type)){let f=o.repeated?Ft.Constructed:Ft.Primitive;n.push(new f({name:a,optional:u,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);let f=!!o.repeated,d=f?c:this.get(o.type,!0).schema;d="valueBlock"in d?d.valueBlock.value:d.value,n.push(new Ft.Constructed({name:f?"":a,optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:d}))}else n.push(new Ft.Constructed({optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:[c]}));else c.optional=u,n.push(c)}switch(i.type){case Oo.AsnTypeTypes.Sequence:return new Ft.Sequence({value:n,name:""});case Oo.AsnTypeTypes.Set:return new Ft.Set({value:n,name:""});case Oo.AsnTypeTypes.Choice:return new Ft.Choice({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,r){return this.items.set(e,r),this}findParentSchema(e){let r=Object.getPrototypeOf(e);return r?this.items.get(r)||this.findParentSchema(r):null}};kd.AsnSchemaStorage=Kh});var Md=l(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.schemaStorage=void 0;var EB=Nw();jd.schemaStorage=new EB.AsnSchemaStorage});var qw=l(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.AsnProp=wt.AsnSequenceType=wt.AsnSetType=wt.AsnChoiceType=wt.AsnType=void 0;var TB=(v(),g(A)),xB=TB.__importStar(du()),Vh=Ln(),tn=Md(),OB=t=>e=>{let r;tn.schemaStorage.has(e)?r=tn.schemaStorage.get(e):(r=tn.schemaStorage.createDefault(e),tn.schemaStorage.set(e,r)),Object.assign(r,t)};wt.AsnType=OB;var IB=()=>(0,wt.AsnType)({type:Vh.AsnTypeTypes.Choice});wt.AsnChoiceType=IB;var BB=t=>(0,wt.AsnType)({type:Vh.AsnTypeTypes.Set,...t});wt.AsnSetType=BB;var kB=t=>(0,wt.AsnType)({type:Vh.AsnTypeTypes.Sequence,...t});wt.AsnSequenceType=kB;var jB=t=>(e,r)=>{let i;tn.schemaStorage.has(e.constructor)?i=tn.schemaStorage.get(e.constructor):(i=tn.schemaStorage.createDefault(e.constructor),tn.schemaStorage.set(e.constructor,i));let n=Object.assign({},t);if(typeof n.type=="number"&&!n.converter){let s=xB.defaultConverter(t.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);n.converter=s}n.raw=t.raw,i.items[r]=n};wt.AsnProp=jB});var Rw=l(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.AsnSchemaValidationError=void 0;var Gh=class extends Error{schemas=[]};Nd.AsnSchemaValidationError=Gh});var Hh=l(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var MB=(v(),g(A));MB.__exportStar(Rw(),Fh)});var zh=l(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.AsnParser=void 0;var Dw=(v(),g(A)),xt=Dw.__importStar(en()),NB=Gt(),rn=Ln(),Wh=Dw.__importStar(du()),yu=Hh(),_u=Bd(),Kn=Md(),$h=class{static parse(e,r){let i=xt.fromBER((0,NB.toArrayBuffer)(e));if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(e,r){try{if((0,_u.isConvertible)(r))return new r().fromASN(e);let i=Kn.schemaStorage.get(r);Kn.schemaStorage.cache(r);let n=i.schema,s=this.handleChoiceTypes(e,i,r,n);if(s?.result)return s.result;s?.targetSchema&&(n=s.targetSchema);let o=this.handleSequenceTypes(e,i,r,n),a=new r;return(0,_u.isTypeOfArray)(r)?this.handleArrayTypes(e,i,r):(this.processSchemaItems(i,o,a),a)}catch(i){throw i instanceof yu.AsnSchemaValidationError&&i.schemas.push(r.name),i}}static handleChoiceTypes(e,r,i,n){if(e.constructor===xt.Constructed&&r.type===rn.AsnTypeTypes.Choice&&e.idBlock.tagClass===3)for(let s in r.items){let o=r.items[s];if(o.context===e.idBlock.tagNumber&&o.implicit&&typeof o.type=="function"&&Kn.schemaStorage.has(o.type)){let a=Kn.schemaStorage.get(o.type);if(a&&a.type===rn.AsnTypeTypes.Sequence){let c=new xt.Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in c.valueBlock){c.valueBlock.value=e.valueBlock.value;let u=this.fromASN(c,o.type),f=new i;return f[s]=u,{result:f}}}}}else if(e.constructor===xt.Constructed&&r.type!==rn.AsnTypeTypes.Choice){let s=new xt.Constructed({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:r.schema.valueBlock.value});for(let o in r.items)delete e[o];return{targetSchema:s}}return null}static handleSequenceTypes(e,r,i,n){if(r.type===rn.AsnTypeTypes.Sequence){let s=xt.compareSchema({},e,n);if(!s.verified)throw new yu.AsnSchemaValidationError(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{let s=xt.compareSchema({},e,n);if(!s.verified)throw new yu.AsnSchemaValidationError(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,r,i){let n=e.slice(r);if(n.length===1&&n[0].constructor.name==="Sequence"){let s=n[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(n=s.valueBlock.value)}if(typeof i.type=="number"){let s=Wh.defaultConverter(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(o=>o&&o.valueBlock).map(o=>{try{return s.fromASN(o)}catch{return}}).filter(o=>o!==void 0)}else return n.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,i.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,r){let i=Wh.defaultConverter(r.type);if(!i)throw new Error(`No converter for ASN.1 type ${r.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&Kn.schemaStorage.has(e.type)&&Kn.schemaStorage.get(e.type).type===rn.AsnTypeTypes.Choice}static processOptionalChoiceField(e,r){try{return{processed:!0,value:this.fromASN(e,r.type)}}catch(i){if(i instanceof yu.AsnSchemaValidationError&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,r,i){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let n=r.itemType;if(typeof n=="number"){let s=Wh.defaultConverter(n);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,o=>s.fromASN(o))}else return i.from(e.valueBlock.value,s=>this.fromASN(s,n))}static processSchemaItems(e,r,i){for(let n in e.items){let s=r.result[n];if(!s)continue;let o=e.items[n],a=o.type,c;typeof a=="number"||(0,_u.isConvertible)(a)?c=this.processPrimitiveSchemaItem(s,o,a):c=this.processComplexSchemaItem(s,o,a),c&&typeof c=="object"&&"value"in c&&"raw"in c?(i[n]=c.value,i[`${n}Raw`]=c.raw):i[n]=c}}static processPrimitiveSchemaItem(e,r,i){let n=r.converter??((0,_u.isConvertible)(i)?new i:null);if(!n)throw new Error("Converter is empty");return r.repeated?this.processRepeatedPrimitiveItem(e,r,n):this.processSinglePrimitiveItem(e,r,i,n)}static processRepeatedPrimitiveItem(e,r,i){if(r.implicit){let n=r.repeated==="sequence"?xt.Sequence:xt.Set,s=new n;s.valueBlock=e.valueBlock;let o=xt.fromBER(s.toBER(!1));if(o.offset===-1)throw new Error(`Cannot parse the child item. ${o.result.error}`);if(!("value"in o.result.valueBlock&&Array.isArray(o.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let a=o.result.valueBlock.value;return Array.from(a,c=>i.fromASN(c))}else return Array.from(e,n=>i.fromASN(n))}static processSinglePrimitiveItem(e,r,i,n){let s=e;if(r.implicit){let o;if((0,_u.isConvertible)(i))o=new i().toSchema("");else{let a=rn.AsnPropTypes[i],c=xt[a];if(!c)throw new Error(`Cannot get '${a}' class from asn1js module`);o=new c}o.valueBlock=s.valueBlock,s=xt.fromBER(o.toBER(!1)).result}return n.fromASN(s)}static processComplexSchemaItem(e,r,i){if(r.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,n=>this.fromASN(n,i))}else{let n=this.handleImplicitTagging(e,r,i);if(this.isOptionalChoiceField(r))try{return this.fromASN(n,i)}catch(s){if(s instanceof yu.AsnSchemaValidationError&&/Wrong values for Choice type/.test(s.message))return;throw s}else{let s=this.fromASN(n,i);return r.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,r,i){if(r.implicit&&typeof r.context=="number"){let n=Kn.schemaStorage.get(i);if(n.type===rn.AsnTypeTypes.Sequence){let s=new xt.Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(n.type===rn.AsnTypeTypes.Set){let s=new xt.Set;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}};qd.AsnParser=$h});var Qh=l(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.AsnSerializer=void 0;var Lw=(v(),g(A)),Tr=Lw.__importStar(en()),qB=Gt(),RB=Lw.__importStar(du()),Rd=Ln(),Yh=Bd(),Uw=Md(),Jh=class t{static serialize(e){return e instanceof Tr.BaseBlock?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&(0,Yh.isConvertible)(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let r=e.constructor,i=Uw.schemaStorage.get(r);Uw.schemaStorage.cache(r);let n=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){let o=RB.defaultConverter(i.itemType);if(!o)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);n=e.map(a=>o.toASN(a))}else n=e.map(o=>this.toAsnItem({type:i.itemType},"[]",r,o))}else for(let o in i.items){let a=i.items[o],c=e[o];if(c===void 0||a.defaultValue===c||typeof a.defaultValue=="object"&&typeof c=="object"&&(0,Yh.isArrayEqual)(this.serialize(a.defaultValue),this.serialize(c)))continue;let u=t.toAsnItem(a,o,r,c);if(typeof a.context=="number")if(a.implicit)if(!a.repeated&&(typeof a.type=="number"||(0,Yh.isConvertible)(a.type))){let f={};f.valueHex=u instanceof Tr.Null?(0,qB.toArrayBuffer)(u.valueBeforeDecodeView):u.valueBlock.toBER(),n.push(new Tr.Primitive({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},...f}))}else n.push(new Tr.Constructed({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:u.valueBlock.value}));else n.push(new Tr.Constructed({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:[u]}));else a.repeated?n=n.concat(u):n.push(u)}let s;switch(i.type){case Rd.AsnTypeTypes.Sequence:s=new Tr.Sequence({value:n});break;case Rd.AsnTypeTypes.Set:s=new Tr.Set({value:n});break;case Rd.AsnTypeTypes.Choice:if(!n[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(e,r,i,n){let s;if(typeof e.type=="number"){let o=e.converter;if(!o)throw new Error(`Property '${r}' doesn't have converter for type ${Rd.AsnPropTypes[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");let a=Array.from(n,u=>o.toASN(u)),c=e.repeated==="sequence"?Tr.Sequence:Tr.Set;s=new c({value:a})}else s=o.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");let o=Array.from(n,c=>this.toASN(c)),a=e.repeated==="sequence"?Tr.Sequence:Tr.Set;s=new a({value:o})}else s=this.toASN(n);return s}};Dd.AsnSerializer=Jh});var Kw=l(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.AsnArray=void 0;var Xh=class extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(let r of e)this.push(r)}}};Ud.AsnArray=Xh});var Gw=l(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.AsnConvert=void 0;var DB=(v(),g(A)),UB=DB.__importStar(en()),Vw=Gt(),LB=zh(),KB=Qh(),Zh=class t{static serialize(e){return KB.AsnSerializer.serialize(e)}static parse(e,r){return LB.AsnParser.parse(e,r)}static toString(e){let r=(0,Vw.isBufferSource)(e)?(0,Vw.toArrayBuffer)(e):t.serialize(e),i=UB.fromBER(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}};Ld.AsnConvert=Zh});var S=l(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.AsnSerializer=Ee.AsnParser=Ee.AsnPropTypes=Ee.AsnTypeTypes=Ee.AsnSetType=Ee.AsnSequenceType=Ee.AsnChoiceType=Ee.AsnType=Ee.AsnProp=void 0;var hu=(v(),g(A));hu.__exportStar(du(),Ee);hu.__exportStar(Lh(),Ee);var gu=qw();Object.defineProperty(Ee,"AsnProp",{enumerable:!0,get:function(){return gu.AsnProp}});Object.defineProperty(Ee,"AsnType",{enumerable:!0,get:function(){return gu.AsnType}});Object.defineProperty(Ee,"AsnChoiceType",{enumerable:!0,get:function(){return gu.AsnChoiceType}});Object.defineProperty(Ee,"AsnSequenceType",{enumerable:!0,get:function(){return gu.AsnSequenceType}});Object.defineProperty(Ee,"AsnSetType",{enumerable:!0,get:function(){return gu.AsnSetType}});var Fw=Ln();Object.defineProperty(Ee,"AsnTypeTypes",{enumerable:!0,get:function(){return Fw.AsnTypeTypes}});Object.defineProperty(Ee,"AsnPropTypes",{enumerable:!0,get:function(){return Fw.AsnPropTypes}});var VB=zh();Object.defineProperty(Ee,"AsnParser",{enumerable:!0,get:function(){return VB.AsnParser}});var GB=Qh();Object.defineProperty(Ee,"AsnSerializer",{enumerable:!0,get:function(){return GB.AsnSerializer}});hu.__exportStar(Hh(),Ee);hu.__exportStar(Kw(),Ee);hu.__exportStar(Gw(),Ee)});var eg=l(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.binary=void 0;Vn.encode=Hw;Vn.decode=Ww;Vn.is=$w;var FB=Gt();function Hw(t){let e=(0,FB.toUint8Array)(t),r="";for(let i of e)r+=String.fromCharCode(i);return r}function Ww(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r)&255;return e}function $w(t){return typeof t=="string"}Vn.binary={encode:Hw,decode:Ww,is:$w}});var Zw=l(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.hex=Ht.formats=void 0;Ht.normalize=Au;Ht.is=Jw;Ht.encode=tg;Ht.decode=rg;Ht.parse=Qw;Ht.format=Xw;var HB=Gt(),WB=/^[0-9a-f]$/i,$B=[" "," ",`
10
+ `)}`:`${r} :`}};qS=xi;N.Constructed=qS;xi.NAME="CONSTRUCTED";var od=class extends nt{fromBER(e,r,i){return r}toBER(e){return ei}};od.override="EndOfContentValueBlock";var RS,Bc=class extends Xe{constructor(e={}){super(e,od),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};RS=Bc;N.EndOfContent=RS;Bc.NAME=xc;var DS,kc=class extends Xe{constructor(e={}){super(e,nt),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,r,i){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+=i,r+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(e,r){let i=new ArrayBuffer(2);if(!e){let n=new Uint8Array(i);n[0]=5,n[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}};DS=kc;N.Null=DS;kc.NAME="NULL";var ad=class extends ti(nt){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,...r}={}){super(r),r.valueHex?this.valueHexView=re.BufferSourceConverter.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,r,i){let n=re.BufferSourceConverter.toUint8Array(e);return Oi(this,n,r,i)?(this.valueHexView=n.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ye.utilDecodeTC.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};ad.NAME="BooleanValueBlock";var US,jc=class extends Xe{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,ad),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};US=jc;N.Boolean=US;jc.NAME="BOOLEAN";var cd=class extends ti(Xr){constructor({isConstructed:e=!1,...r}={}){super(r),this.isConstructed=e}fromBER(e,r,i,n){let s=0;if(this.isConstructed){if(this.isHexOnly=!1,s=Xr.prototype.fromBER.call(this,e,r,i,n),s===-1)return s;for(let o=0;o<this.value.length;o++){let a=this.value[o].constructor.NAME;if(a===xc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==OS)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,s=super.fromBER(e,r,i),this.blockLength=i;return s}toBER(e,r){return this.isConstructed?Xr.prototype.toBER.call(this,e,r):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};cd.NAME="OctetStringValueBlock";var Ih,Mc=class extends Xe{constructor({idBlock:e={},lenBlock:r={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},cd),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,r,i,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){let o=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(r,r+i);try{if(o.byteLength){let a=n??au(),c=Oh(o,0,o.byteLength,a);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,r,i,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return xi.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,r=re.Convert.ToHex(this.valueBlock.valueHexView);return`${e} : ${r}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let r of this.valueBlock.value)r instanceof Ih&&e.push(r.valueBlock.valueHexView);return re.BufferSourceConverter.concat(e)}};Ih=Mc;N.OctetString=Ih;Mc.NAME=OS;var ud=class extends ti(Xr){constructor({unusedBits:e=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=e,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(e,r,i,n){if(!i)return r;let s=-1;if(this.isConstructed){if(s=Xr.prototype.fromBER.call(this,e,r,i,n),s===-1)return s;for(let c of this.value){let u=c.constructor.NAME;if(u===xc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(u!==IS)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let f=c.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 o=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,o,r,i))return-1;let a=o.subarray(r,r+i);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 c=a.subarray(1);try{if(c.byteLength){let u=n??au(),f=Oh(c,0,c.byteLength,u);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(e,r){if(this.isConstructed)return Xr.prototype.toBER.call(this,e,r);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){let n=new Uint8Array(1);return n[0]=0,n.buffer}let i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}};ud.NAME="BitStringValueBlock";var LS,Nc=class extends Xe{constructor({idBlock:e={},lenBlock:r={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},ud),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,r,i,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,r,i,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return xi.prototype.onAsciiEncoding.call(this);{let e=[],r=this.valueBlock.valueHexView;for(let o of r)e.push(o.toString(2).padStart(8,"0"));let i=e.join(""),n=this.constructor.NAME,s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${n} : ${s}`}}};LS=Nc;N.BitString=LS;Nc.NAME=IS;var KS;function zI(t,e){let r=new Uint8Array([0]),i=new Uint8Array(t),n=new Uint8Array(e),s=i.slice(0),o=s.length-1,a=n.slice(0),c=a.length-1,u=0,f=c<o?o:c,d=0;for(let y=f;y>=0;y--,d++)!0===d<a.length?u=s[o-d]+a[c-d]+r[0]:u=s[o-d]+r[0],r[0]=u/10,!0===d>=s.length?s=ye.utilConcatView(new Uint8Array([u%10]),s):s[o-d]=u%10;return r[0]>0&&(s=ye.utilConcatView(r,s)),s}function TS(t){if(t>=Ec.length)for(let e=Ec.length;e<=t;e++){let r=new Uint8Array([0]),i=Ec[e-1].slice(0);for(let n=i.length-1;n>=0;n--){let s=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=s[0]/10,i[n]=s[0]%10}r[0]>0&&(i=ye.utilConcatView(r,i)),Ec.push(i)}return Ec[t]}function YI(t,e){let r=0,i=new Uint8Array(t),n=new Uint8Array(e),s=i.slice(0),o=s.length-1,a=n.slice(0),c=a.length-1,u,f=0;for(let d=c;d>=0;d--,f++)u=s[o-f]-a[c-f]-r,!0===u<0?(r=1,s[o-f]=u+10):(r=0,s[o-f]=u);if(r>0)for(let d=o-c+1;d>=0;d--,f++)if(u=s[o-f]-r,u<0)r=1,s[o-f]=u+10;else{r=0,s[o-f]=u;break}return s.slice()}var qc=class extends ti(nt){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=ye.utilDecodeTC.call(this)))}constructor({value:e,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(ye.utilEncodeTC(e))}get valueDec(){return this._valueDec}fromDER(e,r,i,n=0){let s=this.fromBER(e,r,i);if(s===-1)return s;let o=this.valueHexView;return o[0]===0&&(o[1]&128)!==0?this.valueHexView=o.subarray(1):n!==0&&o.length<n&&(n-o.length>1&&(n=o.length+1),this.valueHexView=o.subarray(n-o.length)),s}toDER(e=!1){let r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{let i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,r,i){let n=super.fromBER(e,r,i);return n===-1||this.setValueHex(),n}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,r=new Uint8Array(this.valueHexView.length*8/3),i=0,n,s=this.valueHexView,o="",a=!1;for(let c=s.byteLength-1;c>=0;c--){n=s[c];for(let u=0;u<8;u++)(n&1)===1&&(i===e?(r=YI(TS(i),r),o="-"):r=zI(r,TS(i))),i++,n>>=1}for(let c=0;c<r.length;c++)r[c]&&(a=!0),a&&(o+=PS.charAt(r[c]));return a===!1&&(o+=PS.charAt(0)),o}};KS=qc;qc.NAME="IntegerValueBlock";Object.defineProperty(KS.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Tc,Po=class extends Xe{constructor(e={}){super(e,qc),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return rd(),BigInt(this.valueBlock.toString())}static fromBigInt(e){rd();let r=BigInt(e),i=new Co,n=r.toString(16).replace(/^-/,""),s=new Uint8Array(re.Convert.FromHex(n));if(r<0){let a=new Uint8Array(s.length+(s[0]&128?1:0));a[0]|=128;let u=BigInt(`0x${re.Convert.ToHex(a)}`)+r,f=re.BufferSourceConverter.toUint8Array(re.Convert.FromHex(u.toString(16)));f[0]|=128,i.write(f)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new Tc({valueHex:i.final()})}convertToDER(){let e=new Tc({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Tc({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};Tc=Po;N.Integer=Tc;Po.NAME="INTEGER";var VS,Rc=class extends Po{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};VS=Rc;N.Enumerated=VS;Rc.NAME="ENUMERATED";var Dc=class extends ti(nt){constructor({valueDec:e=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=r}fromBER(e,r,i){if(!i)return r;let n=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,n,r,i))return-1;let s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let a=0;a<i&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let o=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)o[a]=this.valueHexView[a];return this.valueHexView=o,(s[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=ye.utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(e){rd();let r=BigInt(e).toString(2);for(;r.length%7;)r="0"+r;let i=new Uint8Array(r.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(r.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let o=0;o<this.blockLength-1;o++)s[o]=n[o]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}let r=ye.utilToBase(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",ei;let i=new Uint8Array(r.byteLength);if(!e){let n=new Uint8Array(r),s=r.byteLength-1;for(let o=0;o<s;o++)i[o]=n[o]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=re.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",r-=40):(e="2.",r-=80),e+=r.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};Dc.NAME="sidBlock";var ld=class extends nt{constructor({value:e=Et,...r}={}){super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,i){let n=r;for(;i>0;){let s=new Dc;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e){let r=[];for(let i=0;i<this.value.length;i++){let n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,ei;r.push(n)}return xh(r)}fromString(e){this.value=[];let r=0,i=0,n="",s=!1;do if(i=e.indexOf(".",r),i===-1?n=e.substring(r):n=e.substring(r,i),r=i+1,s){let o=this.value[0],a=0;switch(o.valueDec){case 0:break;case 1:a=40;break;case 2:a=80;break;default:this.value=[];return}let c=parseInt(n,10);if(isNaN(c))return;o.valueDec=c+a,s=!1}else{let o=new Dc;if(n>Number.MAX_SAFE_INTEGER){rd();let a=BigInt(n);o.valueBigInt=a}else if(o.valueDec=parseInt(n,10),isNaN(o.valueDec))return;this.value.length||(o.isFirstSid=!0,s=!0),this.value.push(o)}while(i!==-1)}toString(){let e="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),r?(n=`{${n}}`,this.value[i].isFirstSid?e=`2.{${n} - 80}`:e+=n):e+=n}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};ld.NAME="ObjectIdentifierValueBlock";var GS,Uc=class extends Xe{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,ld),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};GS=Uc;N.ObjectIdentifier=GS;Uc.NAME="OBJECT IDENTIFIER";var Lc=class extends ti(Ti){constructor({valueDec:e=0,...r}={}){super(r),this.valueDec=e}fromBER(e,r,i){if(i===0)return r;let n=re.BufferSourceConverter.toUint8Array(e);if(!Oi(this,n,r,i))return-1;let s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let a=0;a<i&&(this.valueHexView[a]=s[a]&127,this.blockLength++,(s[a]&128)!==0);a++);let o=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength;a++)o[a]=this.valueHexView[a];return this.valueHexView=o,(s[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=ye.utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let o=0;o<this.blockLength-1;o++)s[o]=n[o]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}let r=ye.utilToBase(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",ei;let i=new Uint8Array(r.byteLength);if(!e){let n=new Uint8Array(r),s=r.byteLength-1;for(let o=0;o<s;o++)i[o]=n[o]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=re.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};Lc.NAME="relativeSidBlock";var fd=class extends nt{constructor({value:e=Et,...r}={}){super(r),this.value=[],e&&this.fromString(e)}fromBER(e,r,i){let n=r;for(;i>0;){let s=new Lc;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e,r){let i=[];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,ei;i.push(s)}return xh(i)}fromString(e){this.value=[];let r=0,i=0,n="";do{i=e.indexOf(".",r),i===-1?n=e.substring(r):n=e.substring(r,i),r=i+1;let s=new Lc;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let e="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),r&&(n=`{${n}}`),e+=n}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)e.sidArray.push(this.value[r].toJSON());return e}};fd.NAME="RelativeObjectIdentifierValueBlock";var FS,Kc=class extends Xe{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,fd),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};FS=Kc;N.RelativeObjectIdentifier=FS;Kc.NAME="RelativeObjectIdentifier";var HS,Vc=class extends xi{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};HS=Vc;N.Sequence=HS;Vc.NAME="SEQUENCE";var WS,Gc=class extends xi{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};WS=Gc;N.Set=WS;Gc.NAME="SET";var dd=class extends ti(nt){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Et}toJSON(){return{...super.toJSON(),value:this.value}}};dd.NAME="StringValueBlock";var pd=class extends dd{};pd.NAME="SimpleStringValueBlock";var St=class extends Oc{constructor({...e}={}){super(e,pd)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,re.BufferSourceConverter.toUint8Array(e))}fromString(e){let r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=e.charCodeAt(n);this.valueBlock.value=e}};St.NAME="SIMPLE STRING";var yd=class extends St{fromBuffer(e){this.valueBlock.valueHexView=re.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=re.Convert.ToUtf8String(e)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=re.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(re.Convert.FromUtf8String(e)),this.valueBlock.value=e}};yd.NAME="Utf8StringValueBlock";var $S,Zr=class extends yd{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};$S=Zr;N.Utf8String=$S;Zr.NAME="UTF8String";var _d=class extends St{fromBuffer(e){this.valueBlock.value=re.Convert.ToUtf16String(e),this.valueBlock.valueHexView=re.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(re.Convert.FromUtf16String(e))}};_d.NAME="BmpStringValueBlock";var zS,Fc=class extends _d{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};zS=Fc;N.BmpString=zS;Fc.NAME="BMPString";var hd=class extends St{fromBuffer(e){let r=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(r);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(e){let r=e.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let n=0;n<r;n++){let s=ye.utilToBase(e.charCodeAt(n),8),o=new Uint8Array(s);if(o.length>4)continue;let a=4-o.length;for(let c=o.length-1;c>=0;c--)i[n*4+c+a]=o[c]}this.valueBlock.value=e}};hd.NAME="UniversalStringValueBlock";var YS,Hc=class extends hd{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};YS=Hc;N.UniversalString=YS;Hc.NAME="UniversalString";var JS,Wc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};JS=Wc;N.NumericString=JS;Wc.NAME="NumericString";var QS,$c=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};QS=$c;N.PrintableString=QS;$c.NAME="PrintableString";var XS,zc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};XS=zc;N.TeletexString=XS;zc.NAME="TeletexString";var ZS,Yc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};ZS=Yc;N.VideotexString=ZS;Yc.NAME="VideotexString";var ew,Jc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};ew=Jc;N.IA5String=ew;Jc.NAME="IA5String";var tw,Qc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};tw=Qc;N.GraphicString=tw;Qc.NAME="GraphicString";var rw,Eo=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};rw=Eo;N.VisibleString=rw;Eo.NAME="VisibleString";var iw,Xc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};iw=Xc;N.GeneralString=iw;Xc.NAME="GeneralString";var nw,Zc=class extends St{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};nw=Zc;N.CharacterString=nw;Zc.NAME="CharacterString";var sw,To=class extends Eo{constructor({value:e,valueDate:r,...i}={}){if(super(i),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 n=0;n<e.length;n++)this.valueBlock.valueHexView[n]=e.charCodeAt(n)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,re.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),r=new ArrayBuffer(e.length),i=new Uint8Array(r);for(let n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return r}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 i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}let n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(e="iso"){if(e==="iso"){let r=new Array(7);return r[0]=ye.padNumber(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=ye.padNumber(this.month,2),r[2]=ye.padNumber(this.day,2),r[3]=ye.padNumber(this.hour,2),r[4]=ye.padNumber(this.minute,2),r[5]=ye.padNumber(this.second,2),r[6]="Z",r.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}}};sw=To;N.UTCTime=sw;To.NAME="UTCTime";var ow,eu=class extends To{constructor(e={}){var r;super(e),(r=this.millisecond)!==null&&r!==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 r=!1,i="",n="",s=0,o,a=0,c=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),r=!0;else{let d=new Number(e[e.length-1]);if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let d=1,y=i.indexOf("+"),m="";if(y===-1&&(y=i.indexOf("-"),d=-1),y!==-1){if(m=i.substring(y+1),i=i.substring(0,y),m.length!==2&&m.length!==4)throw new Error("Wrong input string for conversion");let x=parseInt(m.substring(0,2),10);if(isNaN(x.valueOf()))throw new Error("Wrong input string for conversion");if(a=d*x,m.length===4){if(x=parseInt(m.substring(2,4),10),isNaN(x.valueOf()))throw new Error("Wrong input string for conversion");c=d*x}}}let u=i.indexOf(".");if(u===-1&&(u=i.indexOf(",")),u!==-1){let d=new Number(`0${i.substring(u)}`);if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");s=d.valueOf(),n=i.substring(0,u)}else n=i;switch(!0){case n.length===8:if(o=/(\d{4})(\d{2})(\d{2})/ig,u!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let d=60*s;this.minute=Math.floor(d),d=60*(d-this.minute),this.second=Math.floor(d),d=1e3*(d-this.second),this.millisecond=Math.floor(d)}break;case n.length===12:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let d=60*s;this.second=Math.floor(d),d=1e3*(d-this.second),this.millisecond=Math.floor(d)}break;case n.length===14:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let d=1e3*s;this.millisecond=Math.floor(d)}break;default:throw new Error("Wrong input string for conversion")}let f=o.exec(n);if(f===null)throw new Error("Wrong input string for conversion");for(let d=1;d<f.length;d++)switch(d){case 1:this.year=parseInt(f[d],10);break;case 2:this.month=parseInt(f[d],10);break;case 3:this.day=parseInt(f[d],10);break;case 4:this.hour=parseInt(f[d],10)+a;break;case 5:this.minute=parseInt(f[d],10)+c;break;case 6:this.second=parseInt(f[d],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){let d=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=d.getUTCFullYear(),this.month=d.getUTCMonth(),this.day=d.getUTCDay(),this.hour=d.getUTCHours(),this.minute=d.getUTCMinutes(),this.second=d.getUTCSeconds(),this.millisecond=d.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let r=[];return r.push(ye.padNumber(this.year,4)),r.push(ye.padNumber(this.month,2)),r.push(ye.padNumber(this.day,2)),r.push(ye.padNumber(this.hour,2)),r.push(ye.padNumber(this.minute,2)),r.push(ye.padNumber(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(ye.padNumber(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};ow=eu;N.GeneralizedTime=ow;eu.NAME="GeneralizedTime";var aw,tu=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};aw=tu;N.DATE=aw;tu.NAME="DATE";var cw,ru=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};cw=ru;N.TimeOfDay=cw;ru.NAME="TimeOfDay";var uw,iu=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};uw=iu;N.DateTime=uw;iu.NAME="DateTime";var lw,nu=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};lw=nu;N.Duration=lw;nu.NAME="Duration";var fw,su=class extends Zr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};fw=su;N.TIME=fw;su.NAME="TIME";var Un=class{constructor({name:e=Et,optional:r=!1}={}){this.name=e,this.optional=r}},gd=class extends Un{constructor({value:e=[],...r}={}){super(r),this.value=e}},ou=class extends Un{constructor({value:e=new Un,local:r=!1,...i}={}){super(i),this.value=e,this.local=r}},Th=class{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=re.BufferSourceConverter.toUint8Array(e)}constructor({data:e=Ad}={}){this.dataView=re.BufferSourceConverter.toUint8Array(e)}fromBER(e,r,i){let n=r+i;return this.dataView=re.BufferSourceConverter.toUint8Array(e).subarray(r,n),n}toBER(e){return this.dataView.slice().buffer}};function wo(t,e,r){if(r instanceof gd){for(let s of r.value)if(wo(t,e,s).verified)return{verified:!0,result:t};{let s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(Eh)&&(s.name=r.name),s}}if(r instanceof Un)return r.hasOwnProperty(Eh)&&(t[r.name]=e),{verified:!0,result:t};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(kI in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(qI in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(RI in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(jI)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:t};if(r.idBlock.hasOwnProperty(MI)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:t};if(r.idBlock.hasOwnProperty(NI)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:t};if(!(BI in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:t};if(r.idBlock.isHexOnly){if(!(ES in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let s=r.idBlock.valueHexView,o=e.idBlock.valueHexView;if(s.length!==o.length)return{verified:!1,result:t};for(let a=0;a<s.length;a++)if(s[a]!==o[1])return{verified:!1,result:t}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&(t[r.name]=e)),r instanceof N.Constructed){let s=0,o={verified:!1,result:{error:"Unknown error"}},a=r.valueBlock.value.length;if(a>0&&r.valueBlock.value[0]instanceof ou&&(a=e.valueBlock.value.length),a===0)return{verified:!0,result:t};if(e.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let u=0;u<r.valueBlock.value.length;u++)c=c&&(r.valueBlock.value[u].optional||!1);return c?{verified:!0,result:t}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&delete t[r.name]),t.error="Inconsistent object length",{verified:!1,result:t})}for(let c=0;c<a;c++)if(c-s>=e.valueBlock.value.length){if(r.valueBlock.value[c].optional===!1){let u={verified:!1,result:t};return t.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&(delete t[r.name],u.name=r.name)),u}}else if(r.valueBlock.value[0]instanceof ou){if(o=wo(t,e.valueBlock.value[c],r.valueBlock.value[0].value),o.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&delete t[r.name]),o;if(Eh in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let u={};DI in r.valueBlock.value[0]&&r.valueBlock.value[0].local?u=e:u=t,typeof u[r.valueBlock.value[0].name]>"u"&&(u[r.valueBlock.value[0].name]=[]),u[r.valueBlock.value[0].name].push(e.valueBlock.value[c])}}else if(o=wo(t,e.valueBlock.value[c-s],r.valueBlock.value[c]),o.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&delete t[r.name]),o;if(o.verified===!1){let c={verified:!1,result:t};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&(delete t[r.name],c.name=r.name)),c}return{verified:!0,result:t}}if(r.primitiveSchema&&ES in e.valueBlock){let s=vd(e.valueBlock.valueHexView);if(s.offset===-1){let o={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Et),r.name&&(delete t[r.name],o.name=r.name)),o}return wo(t,s.result,r.primitiveSchema)}return{verified:!0,result:t}}function JI(t,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let r=vd(re.BufferSourceConverter.toUint8Array(t));return r.offset===-1?{verified:!1,result:r.result}:wo(r.result,r.result,e)}z.Any=Un;z.BaseBlock=Xe;z.BaseStringBlock=Oc;z.BitString=Nc;z.BmpString=Fc;z.Boolean=jc;z.CharacterString=Zc;z.Choice=gd;z.Constructed=xi;z.DATE=tu;z.DEFAULT_MAX_CONTENT_LENGTH=NS;z.DEFAULT_MAX_DEPTH=jS;z.DEFAULT_MAX_NODES=MS;z.DateTime=iu;z.Duration=nu;z.EndOfContent=Bc;z.Enumerated=Rc;z.GeneralString=Xc;z.GeneralizedTime=eu;z.GraphicString=Qc;z.HexBlock=ti;z.IA5String=Jc;z.Integer=Po;z.Null=kc;z.NumericString=Wc;z.ObjectIdentifier=Uc;z.OctetString=Mc;z.Primitive=Ic;z.PrintableString=$c;z.RawData=Th;z.RelativeObjectIdentifier=Kc;z.Repeated=ou;z.Sequence=Vc;z.Set=Gc;z.TIME=su;z.TeletexString=zc;z.TimeOfDay=ru;z.UTCTime=To;z.UniversalString=Hc;z.Utf8String=Zr;z.ValueBlock=nt;z.VideotexString=Yc;z.ViewWriter=Co;z.VisibleString=Eo;z.compareSchema=wo;z.fromBER=WI;z.verifySchema=JI});var lu=l(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.isArrayBuffer=Bh;Tt.isSharedArrayBuffer=_w;Tt.isArrayBufferLike=cu;Tt.isArrayBufferView=hw;Tt.isBufferSource=gw;Tt.assertBufferSource=uu;Tt.toUint8Array=md;Tt.toUint8ArrayCopy=Aw;Tt.toArrayBuffer=tB;Tt.toArrayBufferLike=rB;Tt.toView=vw;Tt.toViewCopy=iB;var QI="[object ArrayBuffer]",XI="[object SharedArrayBuffer]";function dw(t){return Object.prototype.toString.call(t)}function pw(t){return t===DataView||t.prototype instanceof DataView}function ZI(t){return pw(t)?1:t.BYTES_PER_ELEMENT??1}function eB(t){if(ArrayBuffer.isView(t))return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.byteOffset=="number"&&typeof e.byteLength=="number"&&cu(e.buffer)}function yw(t){let e=md(t),r=new Uint8Array(e.byteLength);return r.set(e),r}function Bh(t){return dw(t)===QI}function _w(t){return typeof SharedArrayBuffer<"u"&&dw(t)===XI}function cu(t){return Bh(t)||_w(t)}function hw(t){return eB(t)}function gw(t){return cu(t)||hw(t)}function uu(t){if(!gw(t))throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView")}function md(t){return uu(t),cu(t)?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function Aw(t){return yw(t)}function tB(t){if(uu(t),Bh(t))return t;let e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(md(t)),e}function rB(t){return uu(t),cu(t)?t:t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:yw(t).buffer}function vw(t,e){if(uu(t),ArrayBuffer.isView(t)&&t.constructor===e)return t;let r=md(t),i=ZI(e);if(r.byteOffset%i!==0||r.byteLength%i!==0)throw new RangeError(`Cannot create ${e.name} over unaligned byte range`);return pw(e)?new e(r.buffer,r.byteOffset,r.byteLength):new e(r.buffer,r.byteOffset,r.byteLength/i)}function iB(t,e){let r=Aw(t);return vw(r,e)}});var bw=l(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.concatToUint8Array=mw;Sd.concat=nB;var bd=lu();function mw(t){let e=[],r=0;for(let s of t){let o=(0,bd.toUint8Array)(s);e.push(o),r+=o.byteLength}let i=new Uint8Array(r),n=0;for(let s of e)i.set(s,n),n+=s.byteLength;return i}function nB(t,e,...r){let i,n;typeof e=="function"?(i=Array.from(t),n=e):(0,bd.isBufferSource)(t)?i=[t,e,...r].filter(bd.isBufferSource):(i=Array.from(t),e&&i.push(e),i.push(...r));let s=mw(i);return n?(0,bd.toView)(s,n):s.buffer}});var ww=l(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});kh.equal=sB;var Sw=lu();function sB(t,e,r={}){let i=(0,Sw.toUint8Array)(t),n=(0,Sw.toUint8Array)(e);if(!r.constantTime&&i.byteLength!==n.byteLength)return!1;let s=Math.max(i.byteLength,n.byteLength),o=i.byteLength^n.byteLength;for(let a=0;a<s;a++)o|=(i[a]??0)^(n[a]??0);return o===0}});var Ew=l(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.indexOf=Pw;Er.lastIndexOf=lB;Er.includes=fB;Er.startsWith=dB;Er.endsWith=pB;Er.slice=yB;Er.tail=_B;Er.copy=hB;Er.compare=gB;var ri=lu();function wd(t,e,r){let i=Number.isFinite(t)?Math.trunc(t):e;return i<=0?0:i>=r?r:i}function oB(t,e){let r=wd(e?.start,0,t),i=wd(e?.end,t,t);return i>=r?[r,i]:[r,r]}function aB(t,e){let r=wd(e?.start,t,t),i=wd(e?.end,0,t);return r>=i?[i,r]:[r,r]}function Cw(t,e,r){let i=Number.isFinite(t)?Math.trunc(t):e;return i<0?Math.max(r+i,0):i>r?r:i}function cB(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r)&255;return e}function uB(t){return new TextEncoder().encode(t)}function Cd(t,e){return typeof t=="string"?e?.encoding==="utf8"?uB(t):cB(t):(0,ri.toUint8Array)(t)}function Pd(t,e,r){for(let i=0;i<e.byteLength;i++)if(t[r+i]!==e[i])return!1;return!0}function Pw(t,e,r){let i=(0,ri.toUint8Array)(t),n=Cd(e,r),[s,o]=oB(i.byteLength,r);if(n.byteLength===0)return s;let a=o-n.byteLength;if(a<s)return-1;for(let c=s;c<=a;c++)if(Pd(i,n,c))return c;return-1}function lB(t,e,r){let i=(0,ri.toUint8Array)(t),n=Cd(e,r),[s,o]=aB(i.byteLength,r);if(n.byteLength===0)return o;let a=o-n.byteLength;if(a<s)return-1;for(let c=a;c>=s;c--)if(Pd(i,n,c))return c;return-1}function fB(t,e,r){return Pw(t,e,r)!==-1}function dB(t,e,r){let i=(0,ri.toUint8Array)(t),n=Cd(e,r);return n.byteLength>i.byteLength?!1:Pd(i,n,0)}function pB(t,e,r){let i=(0,ri.toUint8Array)(t),n=Cd(e,r);return n.byteLength>i.byteLength?!1:Pd(i,n,i.byteLength-n.byteLength)}function yB(t,e,r){let i=(0,ri.toUint8Array)(t),n=Cw(e,0,i.byteLength),s=Cw(r,i.byteLength,i.byteLength);return s<=n?i.subarray(n,n):i.subarray(n,s)}function _B(t,e){let r=(0,ri.toUint8Array)(t),i=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;return i>=r.byteLength?r:r.subarray(r.byteLength-i)}function hB(t){return(0,ri.toUint8ArrayCopy)(t)}function gB(t,e){let r=(0,ri.toUint8Array)(t),i=(0,ri.toUint8Array)(e),n=Math.min(r.byteLength,i.byteLength);for(let s=0;s<n;s++){if(r[s]<i[s])return-1;if(r[s]>i[s])return 1}return r.byteLength<i.byteLength?-1:r.byteLength>i.byteLength?1:0}});var Gt=l($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.tail=$.startsWith=$.slice=$.lastIndexOf=$.indexOf=$.includes=$.endsWith=$.copy=$.compare=$.equal=$.concatToUint8Array=$.concat=$.toViewCopy=$.toView=$.toUint8ArrayCopy=$.toUint8Array=$.toArrayBufferLike=$.toArrayBuffer=$.isSharedArrayBuffer=$.isBufferSource=$.isArrayBufferView=$.isArrayBufferLike=$.isArrayBuffer=$.assertBufferSource=void 0;var ar=lu();Object.defineProperty($,"assertBufferSource",{enumerable:!0,get:function(){return ar.assertBufferSource}});Object.defineProperty($,"isArrayBuffer",{enumerable:!0,get:function(){return ar.isArrayBuffer}});Object.defineProperty($,"isArrayBufferLike",{enumerable:!0,get:function(){return ar.isArrayBufferLike}});Object.defineProperty($,"isArrayBufferView",{enumerable:!0,get:function(){return ar.isArrayBufferView}});Object.defineProperty($,"isBufferSource",{enumerable:!0,get:function(){return ar.isBufferSource}});Object.defineProperty($,"isSharedArrayBuffer",{enumerable:!0,get:function(){return ar.isSharedArrayBuffer}});Object.defineProperty($,"toArrayBuffer",{enumerable:!0,get:function(){return ar.toArrayBuffer}});Object.defineProperty($,"toArrayBufferLike",{enumerable:!0,get:function(){return ar.toArrayBufferLike}});Object.defineProperty($,"toUint8Array",{enumerable:!0,get:function(){return ar.toUint8Array}});Object.defineProperty($,"toUint8ArrayCopy",{enumerable:!0,get:function(){return ar.toUint8ArrayCopy}});Object.defineProperty($,"toView",{enumerable:!0,get:function(){return ar.toView}});Object.defineProperty($,"toViewCopy",{enumerable:!0,get:function(){return ar.toViewCopy}});var Tw=bw();Object.defineProperty($,"concat",{enumerable:!0,get:function(){return Tw.concat}});Object.defineProperty($,"concatToUint8Array",{enumerable:!0,get:function(){return Tw.concatToUint8Array}});var AB=ww();Object.defineProperty($,"equal",{enumerable:!0,get:function(){return AB.equal}});var Ii=Ew();Object.defineProperty($,"compare",{enumerable:!0,get:function(){return Ii.compare}});Object.defineProperty($,"copy",{enumerable:!0,get:function(){return Ii.copy}});Object.defineProperty($,"endsWith",{enumerable:!0,get:function(){return Ii.endsWith}});Object.defineProperty($,"includes",{enumerable:!0,get:function(){return Ii.includes}});Object.defineProperty($,"indexOf",{enumerable:!0,get:function(){return Ii.indexOf}});Object.defineProperty($,"lastIndexOf",{enumerable:!0,get:function(){return Ii.lastIndexOf}});Object.defineProperty($,"slice",{enumerable:!0,get:function(){return Ii.slice}});Object.defineProperty($,"startsWith",{enumerable:!0,get:function(){return Ii.startsWith}});Object.defineProperty($,"tail",{enumerable:!0,get:function(){return Ii.tail}})});var Ln=l(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.AsnPropTypes=xo.AsnTypeTypes=void 0;var xw;(function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice"})(xw||(xo.AsnTypeTypes=xw={}));var Ow;(function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null"})(Ow||(xo.AsnPropTypes=Ow={}))});var Iw=l(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.BitString=void 0;var vB=(v(),g(A)),jh=vB.__importStar(Zi()),Mh=Gt(),Nh=class{unusedBits=0;value=new ArrayBuffer(0);constructor(e,r=0){if(e)if(typeof e=="number")this.fromNumber(e);else if((0,Mh.isBufferSource)(e))this.unusedBits=r,this.value=(0,Mh.toArrayBuffer)(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof jh.BitString))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=(0,Mh.toArrayBuffer)(e.valueBlock.valueHex),this}toASN(){return new jh.BitString({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new jh.BitString({name:e})}toNumber(){let e="",r=new Uint8Array(this.value);for(let i of r)e+=i.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let r=e.toString(2),i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;let n=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}};Ed.BitString=Nh});var Bw=l(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.OctetString=void 0;var mB=(v(),g(A)),qh=mB.__importStar(Zi()),Rh=Gt(),Dh=class{buffer;get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):(0,Rh.isBufferSource)(e)?this.buffer=(0,Rh.toArrayBuffer)(e):Array.isArray(e)?this.buffer=new Uint8Array(e).buffer:this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof qh.OctetString))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=(0,Rh.toArrayBuffer)(e.valueBlock.valueHex),this}toASN(){return new qh.OctetString({valueHex:this.buffer})}toSchema(e){return new qh.OctetString({name:e})}};Td.OctetString=Dh});var Uh=l(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});var kw=(v(),g(A));kw.__exportStar(Iw(),xd);kw.__exportStar(Bw(),xd)});var fu=l(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.AsnNullConverter=j.AsnGeneralizedTimeConverter=j.AsnUTCTimeConverter=j.AsnCharacterStringConverter=j.AsnGeneralStringConverter=j.AsnVisibleStringConverter=j.AsnGraphicStringConverter=j.AsnIA5StringConverter=j.AsnVideotexStringConverter=j.AsnTeletexStringConverter=j.AsnPrintableStringConverter=j.AsnNumericStringConverter=j.AsnUniversalStringConverter=j.AsnBmpStringConverter=j.AsnUtf8StringConverter=j.AsnConstructedOctetStringConverter=j.AsnOctetStringConverter=j.AsnBooleanConverter=j.AsnObjectIdentifierConverter=j.AsnBitStringConverter=j.AsnIntegerBigIntConverter=j.AsnIntegerArrayBufferConverter=j.AsnEnumeratedConverter=j.AsnIntegerConverter=j.AsnAnyConverter=void 0;j.defaultConverter=wB;var bB=(v(),g(A)),we=bB.__importStar(Zi()),Od=Gt(),qe=Ln(),SB=Uh();j.AsnAnyConverter={fromASN:t=>t instanceof we.Null?null:(0,Od.toArrayBuffer)(t.valueBeforeDecodeView),toASN:t=>{if(t===null)return new we.Null;let e=we.fromBER(t);if(e.result.error)throw new Error(e.result.error);return e.result}};j.AsnIntegerConverter={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new we.Integer({value:+t})};j.AsnEnumeratedConverter={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new we.Enumerated({value:t})};j.AsnIntegerArrayBufferConverter={fromASN:t=>(0,Od.toArrayBuffer)(t.valueBlock.valueHexView),toASN:t=>new we.Integer({valueHex:t})};j.AsnIntegerBigIntConverter={fromASN:t=>t.toBigInt(),toASN:t=>we.Integer.fromBigInt(t)};j.AsnBitStringConverter={fromASN:t=>(0,Od.toArrayBuffer)(t.valueBlock.valueHexView),toASN:t=>new we.BitString({valueHex:t})};j.AsnObjectIdentifierConverter={fromASN:t=>t.valueBlock.toString(),toASN:t=>new we.ObjectIdentifier({value:t})};j.AsnBooleanConverter={fromASN:t=>t.valueBlock.value,toASN:t=>new we.Boolean({value:t})};j.AsnOctetStringConverter={fromASN:t=>(0,Od.toArrayBuffer)(t.valueBlock.valueHexView),toASN:t=>new we.OctetString({valueHex:t})};j.AsnConstructedOctetStringConverter={fromASN:t=>new SB.OctetString(t.getValue()),toASN:t=>t.toASN()};function cr(t){return{fromASN:e=>e.valueBlock.value,toASN:e=>new t({value:e})}}j.AsnUtf8StringConverter=cr(we.Utf8String);j.AsnBmpStringConverter=cr(we.BmpString);j.AsnUniversalStringConverter=cr(we.UniversalString);j.AsnNumericStringConverter=cr(we.NumericString);j.AsnPrintableStringConverter=cr(we.PrintableString);j.AsnTeletexStringConverter=cr(we.TeletexString);j.AsnVideotexStringConverter=cr(we.VideotexString);j.AsnIA5StringConverter=cr(we.IA5String);j.AsnGraphicStringConverter=cr(we.GraphicString);j.AsnVisibleStringConverter=cr(we.VisibleString);j.AsnGeneralStringConverter=cr(we.GeneralString);j.AsnCharacterStringConverter=cr(we.CharacterString);j.AsnUTCTimeConverter={fromASN:t=>t.toDate(),toASN:t=>new we.UTCTime({valueDate:t})};j.AsnGeneralizedTimeConverter={fromASN:t=>t.toDate(),toASN:t=>new we.GeneralizedTime({valueDate:t})};j.AsnNullConverter={fromASN:()=>null,toASN:()=>new we.Null};function wB(t){switch(t){case qe.AsnPropTypes.Any:return j.AsnAnyConverter;case qe.AsnPropTypes.BitString:return j.AsnBitStringConverter;case qe.AsnPropTypes.BmpString:return j.AsnBmpStringConverter;case qe.AsnPropTypes.Boolean:return j.AsnBooleanConverter;case qe.AsnPropTypes.CharacterString:return j.AsnCharacterStringConverter;case qe.AsnPropTypes.Enumerated:return j.AsnEnumeratedConverter;case qe.AsnPropTypes.GeneralString:return j.AsnGeneralStringConverter;case qe.AsnPropTypes.GeneralizedTime:return j.AsnGeneralizedTimeConverter;case qe.AsnPropTypes.GraphicString:return j.AsnGraphicStringConverter;case qe.AsnPropTypes.IA5String:return j.AsnIA5StringConverter;case qe.AsnPropTypes.Integer:return j.AsnIntegerConverter;case qe.AsnPropTypes.Null:return j.AsnNullConverter;case qe.AsnPropTypes.NumericString:return j.AsnNumericStringConverter;case qe.AsnPropTypes.ObjectIdentifier:return j.AsnObjectIdentifierConverter;case qe.AsnPropTypes.OctetString:return j.AsnOctetStringConverter;case qe.AsnPropTypes.PrintableString:return j.AsnPrintableStringConverter;case qe.AsnPropTypes.TeletexString:return j.AsnTeletexStringConverter;case qe.AsnPropTypes.UTCTime:return j.AsnUTCTimeConverter;case qe.AsnPropTypes.UniversalString:return j.AsnUniversalStringConverter;case qe.AsnPropTypes.Utf8String:return j.AsnUtf8StringConverter;case qe.AsnPropTypes.VideotexString:return j.AsnVideotexStringConverter;case qe.AsnPropTypes.VisibleString:return j.AsnVisibleStringConverter;default:return null}}});var Id=l(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.isConvertible=jw;du.isTypeOfArray=Mw;du.isArrayEqual=CB;function jw(t){return typeof t=="function"&&t.prototype?t.prototype.toASN&&t.prototype.fromASN?!0:jw(t.prototype):!!(t&&typeof t=="object"&&"toASN"in t&&"fromASN"in t)}function Mw(t){if(t){let e=Object.getPrototypeOf(t);return e?.prototype?.constructor===Array?!0:Mw(e)}return!1}function CB(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),i=new Uint8Array(e);for(let n=0;n<t.byteLength;n++)if(r[n]!==i[n])return!1;return!0}});var qw=l(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.AsnSchemaStorage=void 0;var PB=(v(),g(A)),Ft=PB.__importStar(Zi()),Oo=Ln(),Nw=Id(),Lh=class{items=new WeakMap;has(e){return this.items.has(e)}get(e,r=!1){let i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){let r=this.get(e);r.schema||(r.schema=this.create(e,!0))}createDefault(e){let r={type:Oo.AsnTypeTypes.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(e,r){let i=this.items.get(e)||this.createDefault(e),n=[];for(let s in i.items){let o=i.items[s],a=r?s:"",c;if(typeof o.type=="number"){let f=Oo.AsnPropTypes[o.type],d=Ft[f];if(!d)throw new Error(`Cannot get ASN1 class by name '${f}'`);c=new d({name:a})}else(0,Nw.isConvertible)(o.type)?c=new o.type().toSchema(a):o.optional?this.get(o.type).type===Oo.AsnTypeTypes.Choice?c=new Ft.Any({name:a}):(c=this.create(o.type,!1),c.name=a):c=new Ft.Any({name:a});let u=!!o.optional||o.defaultValue!==void 0;if(o.repeated){c.name="";let f=o.repeated==="set"?Ft.Set:Ft.Sequence;c=new f({name:"",value:[new Ft.Repeated({name:a,value:c})]})}if(o.context!==null&&o.context!==void 0)if(o.implicit)if(typeof o.type=="number"||(0,Nw.isConvertible)(o.type)){let f=o.repeated?Ft.Constructed:Ft.Primitive;n.push(new f({name:a,optional:u,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);let f=!!o.repeated,d=f?c:this.get(o.type,!0).schema;d="valueBlock"in d?d.valueBlock.value:d.value,n.push(new Ft.Constructed({name:f?"":a,optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:d}))}else n.push(new Ft.Constructed({optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:[c]}));else c.optional=u,n.push(c)}switch(i.type){case Oo.AsnTypeTypes.Sequence:return new Ft.Sequence({value:n,name:""});case Oo.AsnTypeTypes.Set:return new Ft.Set({value:n,name:""});case Oo.AsnTypeTypes.Choice:return new Ft.Choice({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,r){return this.items.set(e,r),this}findParentSchema(e){let r=Object.getPrototypeOf(e);return r?this.items.get(r)||this.findParentSchema(r):null}};Bd.AsnSchemaStorage=Lh});var jd=l(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.schemaStorage=void 0;var EB=qw();kd.schemaStorage=new EB.AsnSchemaStorage});var Rw=l(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.AsnProp=wt.AsnSequenceType=wt.AsnSetType=wt.AsnChoiceType=wt.AsnType=void 0;var TB=(v(),g(A)),xB=TB.__importStar(fu()),Kh=Ln(),en=jd(),OB=t=>e=>{let r;en.schemaStorage.has(e)?r=en.schemaStorage.get(e):(r=en.schemaStorage.createDefault(e),en.schemaStorage.set(e,r)),Object.assign(r,t)};wt.AsnType=OB;var IB=()=>(0,wt.AsnType)({type:Kh.AsnTypeTypes.Choice});wt.AsnChoiceType=IB;var BB=t=>(0,wt.AsnType)({type:Kh.AsnTypeTypes.Set,...t});wt.AsnSetType=BB;var kB=t=>(0,wt.AsnType)({type:Kh.AsnTypeTypes.Sequence,...t});wt.AsnSequenceType=kB;var jB=t=>(e,r)=>{let i;en.schemaStorage.has(e.constructor)?i=en.schemaStorage.get(e.constructor):(i=en.schemaStorage.createDefault(e.constructor),en.schemaStorage.set(e.constructor,i));let n=Object.assign({},t);if(typeof n.type=="number"&&!n.converter){let s=xB.defaultConverter(t.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${e.constructor.name}`);n.converter=s}n.raw=t.raw,i.items[r]=n};wt.AsnProp=jB});var Dw=l(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.AsnSchemaValidationError=void 0;var Vh=class extends Error{schemas=[]};Md.AsnSchemaValidationError=Vh});var Fh=l(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});var MB=(v(),g(A));MB.__exportStar(Dw(),Gh)});var $h=l(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.AsnParser=void 0;var Uw=(v(),g(A)),xt=Uw.__importStar(Zi()),NB=Gt(),tn=Ln(),Hh=Uw.__importStar(fu()),pu=Fh(),yu=Id(),Kn=jd(),Wh=class{static parse(e,r,i){let n=xt.fromBER((0,NB.toArrayBuffer)(e),i?.berOptions);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r,i)}static fromASN(e,r,i){try{if((0,yu.isConvertible)(r))return new r().fromASN(e);let n=Kn.schemaStorage.get(r);Kn.schemaStorage.cache(r);let s=n.schema,o=this.handleChoiceTypes(e,n,r,s,i);if(o?.result)return o.result;o?.targetSchema&&(s=o.targetSchema);let a=this.handleSequenceTypes(e,n,r,s),c=new r;return(0,yu.isTypeOfArray)(r)?this.handleArrayTypes(e,n,r,i):(this.processSchemaItems(n,a,c,i),c)}catch(n){throw n instanceof pu.AsnSchemaValidationError&&n.schemas.push(r.name),n}}static handleChoiceTypes(e,r,i,n,s){if(e.constructor===xt.Constructed&&r.type===tn.AsnTypeTypes.Choice&&e.idBlock.tagClass===3)for(let o in r.items){let a=r.items[o];if(a.context===e.idBlock.tagNumber&&a.implicit&&typeof a.type=="function"&&Kn.schemaStorage.has(a.type)){let c=Kn.schemaStorage.get(a.type);if(c&&c.type===tn.AsnTypeTypes.Sequence){let u=new xt.Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in u.valueBlock){u.valueBlock.value=e.valueBlock.value;let f=this.fromASN(u,a.type,s),d=new i;return d[o]=f,{result:d}}}}}else if(e.constructor===xt.Constructed&&r.type!==tn.AsnTypeTypes.Choice){let o=new xt.Constructed({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:r.schema.valueBlock.value});for(let a in r.items)delete e[a];return{targetSchema:o}}return null}static handleSequenceTypes(e,r,i,n){if(r.type===tn.AsnTypeTypes.Sequence){let s=xt.compareSchema({},e,n);if(!s.verified)throw new pu.AsnSchemaValidationError(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{let s=xt.compareSchema({},e,n);if(!s.verified)throw new pu.AsnSchemaValidationError(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,r,i){let n=e.slice(r);if(n.length===1&&n[0].constructor.name==="Sequence"){let s=n[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(n=s.valueBlock.value)}if(typeof i.type=="number"){let s=Hh.defaultConverter(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(o=>o&&o.valueBlock).map(o=>{try{return s.fromASN(o)}catch{return}}).filter(o=>o!==void 0)}else return n.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,i.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,r){let i=Hh.defaultConverter(r.type);if(!i)throw new Error(`No converter for ASN.1 type ${r.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&Kn.schemaStorage.has(e.type)&&Kn.schemaStorage.get(e.type).type===tn.AsnTypeTypes.Choice}static processOptionalChoiceField(e,r){try{return{processed:!0,value:this.fromASN(e,r.type)}}catch(i){if(i instanceof pu.AsnSchemaValidationError&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,r,i,n){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let s=r.itemType;if(typeof s=="number"){let o=Hh.defaultConverter(s);if(!o)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,a=>o.fromASN(a))}else return i.from(e.valueBlock.value,o=>this.fromASN(o,s,n))}static processSchemaItems(e,r,i,n){for(let s in e.items){let o=r.result[s];if(!o)continue;let a=e.items[s],c=a.type,u;typeof c=="number"||(0,yu.isConvertible)(c)?u=this.processPrimitiveSchemaItem(o,a,c,n):u=this.processComplexSchemaItem(o,a,c,n),u&&typeof u=="object"&&"value"in u&&"raw"in u?(i[s]=u.value,i[`${s}Raw`]=u.raw):i[s]=u}}static processPrimitiveSchemaItem(e,r,i,n){let s=r.converter??((0,yu.isConvertible)(i)?new i:null);if(!s)throw new Error("Converter is empty");return r.repeated?this.processRepeatedPrimitiveItem(e,r,s,n):this.processSinglePrimitiveItem(e,r,i,s,n)}static processRepeatedPrimitiveItem(e,r,i,n){if(r.implicit){let s=r.repeated==="sequence"?xt.Sequence:xt.Set,o=new s;o.valueBlock=e.valueBlock;let a=xt.fromBER(o.toBER(!1),n?.berOptions);if(a.offset===-1)throw new Error(`Cannot parse the child item. ${a.result.error}`);if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");let c=a.result.valueBlock.value;return Array.from(c,u=>i.fromASN(u))}else return Array.from(e,s=>i.fromASN(s))}static processSinglePrimitiveItem(e,r,i,n,s){let o=e;if(r.implicit){let a;if((0,yu.isConvertible)(i))a=new i().toSchema("");else{let c=tn.AsnPropTypes[i],u=xt[c];if(!u)throw new Error(`Cannot get '${c}' class from asn1js module`);a=new u}a.valueBlock=o.valueBlock,o=xt.fromBER(a.toBER(!1),s?.berOptions).result}return n.fromASN(o)}static processComplexSchemaItem(e,r,i,n){if(r.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,s=>this.fromASN(s,i,n))}else{let s=this.handleImplicitTagging(e,r,i);if(this.isOptionalChoiceField(r))try{return this.fromASN(s,i,n)}catch(o){if(o instanceof pu.AsnSchemaValidationError&&/Wrong values for Choice type/.test(o.message))return;throw o}else{let o=this.fromASN(s,i,n);return r.raw?{value:o,raw:e.valueBeforeDecodeView}:o}}}static handleImplicitTagging(e,r,i){if(r.implicit&&typeof r.context=="number"){let n=Kn.schemaStorage.get(i);if(n.type===tn.AsnTypeTypes.Sequence){let s=new xt.Sequence;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(n.type===tn.AsnTypeTypes.Set){let s=new xt.Set;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}};Nd.AsnParser=Wh});var Jh=l(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.AsnSerializer=void 0;var Kw=(v(),g(A)),Tr=Kw.__importStar(Zi()),qB=Gt(),RB=Kw.__importStar(fu()),qd=Ln(),zh=Id(),Lw=jd(),Yh=class t{static serialize(e){return e instanceof Tr.BaseBlock?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&(0,zh.isConvertible)(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let r=e.constructor,i=Lw.schemaStorage.get(r);Lw.schemaStorage.cache(r);let n=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){let o=RB.defaultConverter(i.itemType);if(!o)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);n=e.map(a=>o.toASN(a))}else n=e.map(o=>this.toAsnItem({type:i.itemType},"[]",r,o))}else for(let o in i.items){let a=i.items[o],c=e[o];if(c===void 0||a.defaultValue===c||typeof a.defaultValue=="object"&&typeof c=="object"&&(0,zh.isArrayEqual)(this.serialize(a.defaultValue),this.serialize(c)))continue;let u=t.toAsnItem(a,o,r,c);if(typeof a.context=="number")if(a.implicit)if(!a.repeated&&(typeof a.type=="number"||(0,zh.isConvertible)(a.type))){let f={};f.valueHex=u instanceof Tr.Null?(0,qB.toArrayBuffer)(u.valueBeforeDecodeView):u.valueBlock.toBER(),n.push(new Tr.Primitive({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},...f}))}else n.push(new Tr.Constructed({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:u.valueBlock.value}));else n.push(new Tr.Constructed({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:[u]}));else a.repeated?n=n.concat(u):n.push(u)}let s;switch(i.type){case qd.AsnTypeTypes.Sequence:s=new Tr.Sequence({value:n});break;case qd.AsnTypeTypes.Set:s=new Tr.Set({value:n});break;case qd.AsnTypeTypes.Choice:if(!n[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(e,r,i,n){let s;if(typeof e.type=="number"){let o=e.converter;if(!o)throw new Error(`Property '${r}' doesn't have converter for type ${qd.AsnPropTypes[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");let a=Array.from(n,u=>o.toASN(u)),c=e.repeated==="sequence"?Tr.Sequence:Tr.Set;s=new c({value:a})}else s=o.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");let o=Array.from(n,c=>this.toASN(c)),a=e.repeated==="sequence"?Tr.Sequence:Tr.Set;s=new a({value:o})}else s=this.toASN(n);return s}};Rd.AsnSerializer=Yh});var Vw=l(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.AsnArray=void 0;var Qh=class extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(let r of e)this.push(r)}}};Dd.AsnArray=Qh});var Fw=l(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.AsnConvert=void 0;var DB=(v(),g(A)),UB=DB.__importStar(Zi()),Gw=Gt(),LB=$h(),KB=Jh(),Xh=class t{static serialize(e){return KB.AsnSerializer.serialize(e)}static parse(e,r,i){return LB.AsnParser.parse(e,r,i)}static toString(e,r){let i=(0,Gw.isBufferSource)(e)?(0,Gw.toArrayBuffer)(e):t.serialize(e),n=UB.fromBER(i,r?.berOptions);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}};Ud.AsnConvert=Xh});var S=l(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.AsnSerializer=Ee.AsnParser=Ee.AsnPropTypes=Ee.AsnTypeTypes=Ee.AsnSetType=Ee.AsnSequenceType=Ee.AsnChoiceType=Ee.AsnType=Ee.AsnProp=void 0;var _u=(v(),g(A));_u.__exportStar(fu(),Ee);_u.__exportStar(Uh(),Ee);var hu=Rw();Object.defineProperty(Ee,"AsnProp",{enumerable:!0,get:function(){return hu.AsnProp}});Object.defineProperty(Ee,"AsnType",{enumerable:!0,get:function(){return hu.AsnType}});Object.defineProperty(Ee,"AsnChoiceType",{enumerable:!0,get:function(){return hu.AsnChoiceType}});Object.defineProperty(Ee,"AsnSequenceType",{enumerable:!0,get:function(){return hu.AsnSequenceType}});Object.defineProperty(Ee,"AsnSetType",{enumerable:!0,get:function(){return hu.AsnSetType}});var Hw=Ln();Object.defineProperty(Ee,"AsnTypeTypes",{enumerable:!0,get:function(){return Hw.AsnTypeTypes}});Object.defineProperty(Ee,"AsnPropTypes",{enumerable:!0,get:function(){return Hw.AsnPropTypes}});var VB=$h();Object.defineProperty(Ee,"AsnParser",{enumerable:!0,get:function(){return VB.AsnParser}});var GB=Jh();Object.defineProperty(Ee,"AsnSerializer",{enumerable:!0,get:function(){return GB.AsnSerializer}});_u.__exportStar(Fh(),Ee);_u.__exportStar(Vw(),Ee);_u.__exportStar(Fw(),Ee)});var Zh=l(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.binary=void 0;Vn.encode=Ww;Vn.decode=$w;Vn.is=zw;var FB=Gt();function Ww(t){let e=(0,FB.toUint8Array)(t),r="";for(let i of e)r+=String.fromCharCode(i);return r}function $w(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r)&255;return e}function zw(t){return typeof t=="string"}Vn.binary={encode:Ww,decode:$w,is:zw}});var e1=l(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.hex=Ht.formats=void 0;Ht.normalize=gu;Ht.is=Qw;Ht.encode=eg;Ht.decode=tg;Ht.parse=Xw;Ht.format=Zw;var HB=Gt(),WB=/^[0-9a-f]$/i,$B=[" "," ",`
11
11
  `,"\r",":","-","."];function zB(t){return t.separators==="none"?[]:!t.separators||t.separators==="common"?$B:t.separators}function YB(t){if(!t)throw new TypeError("Hex separators must be non-empty strings")}function JB(t,e,r){for(let i of r)if(t.startsWith(i,e))return i}function QB(t){let e=/[A-F]/.test(t),r=/[a-f]/.test(t);return e&&!r?"upper":"lower"}function XB(t){let e=/\r\n|\n/.exec(t);if(e)return e[0]===`\r
12
12
  `?`\r
13
13
  `:`
14
- `}function zw(t){return t.replace(/[^0-9a-f]/gi,"")}function ZB(t){let e=t.match(/[0-9A-Fa-f]+|[^0-9A-Fa-f]+/g)??[];if(e.length<3)return;let r=e.filter((o,a)=>a%2===0),i=e.filter((o,a)=>a%2===1),n=i[0];if(!n||i.some(o=>o!==n)||r.some(o=>o.length===0||o.length%2!==0))return;let s=r[0]?.length??0;if(s&&!r.slice(0,-1).some(o=>o.length!==s)&&!((r[r.length-1]?.length??0)>s))return{size:s/2,separator:n}}function ek(t){let e=t.trim(),r=/^0x/i.test(e)?"0x":"",i=r?e.slice(2):e,n=XB(i),s=i.split(/\r\n|\n/).filter(u=>u.length>0),o=s[0]?.trim()??"",a=ZB(o),c={case:QB(e),prefix:r};if(a&&(c.group=a),n&&s.length>1){let u=zw(s[0]??"").length/2;u>0&&s.slice(0,-1).every(f=>zw(f).length/2===u)&&(c.line={bytesPerLine:u,separator:n})}return c}function tk(t,e){let r=e.allowPrefix??!0,i=[...zB(e)].sort((a,c)=>c.length-a.length);for(let a of i)YB(a);let n=t.trim();if(/^0x/i.test(n)){if(!r)throw new TypeError("Hexadecimal text must not include a 0x prefix");n=n.slice(2)}let s="",o=!1;for(let a=0;a<n.length;){let c=n[a]??"";if(WB.test(c)){s+=c,o=!1,a+=1;continue}let u=JB(n,a,i);if(!u)throw new TypeError("Input is not valid hexadecimal text");if(e.strict&&(o||s.length===0))throw new TypeError("Hexadecimal text contains misplaced separators");o=!0,a+=u.length}if(e.strict&&o&&s.length>0)throw new TypeError("Hexadecimal text must not end with a separator");if(s.length%2!==0){if(!e.allowOddLength)throw new TypeError("Hexadecimal text must contain an even number of characters");s=`0${s}`}return s.toLowerCase()}function Yw(t,e){if(!e)return t.join("");if(!Number.isInteger(e.size)||e.size<1)throw new RangeError("Hex group size must be a positive integer");let r=[];for(let i=0;i<t.length;i+=e.size)r.push(t.slice(i,i+e.size).join(""));return r.join(e.separator)}function Au(t,e={}){return tk(t,e)}function Jw(t,e={}){if(typeof t!="string")return!1;try{return Au(t,e),!0}catch{return!1}}function tg(t,e={}){let r=(0,HB.toUint8Array)(t),i=e.case??"lower",n=Array.from(r,o=>{let a=o.toString(16).padStart(2,"0");return i==="upper"?a.toUpperCase():a}),s="";if(e.line){let o=e.line.bytesPerLine;if(!Number.isInteger(o)||o<1)throw new RangeError("Hex bytesPerLine must be a positive integer");let a=e.line.separator??`
15
- `,c=[];for(let u=0;u<n.length;u+=o)c.push(Yw(n.slice(u,u+o),e.group));s=c.join(a)}else s=Yw(n,e.group);return`${e.prefix??""}${s}`}function rg(t,e={}){let r=Au(t,e),i=new Uint8Array(r.length/2);for(let n=0;n<r.length;n+=2)i[n/2]=Number.parseInt(r.slice(n,n+2),16);return i}function Qw(t,e={}){let r=Au(t,e);return{bytes:rg(r),format:ek(t),normalized:r}}function Xw(t,e){return tg(t,e)}Ht.formats={compact:Object.freeze({}),upper:Object.freeze({case:"upper"}),colon:Object.freeze({group:{size:1,separator:":"}}),colonUpper:Object.freeze({case:"upper",group:{size:1,separator:":"}}),groupsOf4:Object.freeze({group:{size:4,separator:" "}}),prefixed:Object.freeze({prefix:"0x"})};Ht.hex={encode:tg,decode:rg,format:Xw,formats:Ht.formats,is:Jw,normalize:Au,parse:Qw}});var r1=l(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.utf8=void 0;Io.encode=e1;Io.decode=t1;var rk=Gt();function e1(t){return new TextEncoder().encode(t)}function t1(t){return new TextDecoder("utf-8",{fatal:!1}).decode((0,rk.toUint8Array)(t))}Io.utf8={encode:e1,decode:t1}});var s1=l(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.utf16=void 0;Bo.encode=i1;Bo.decode=n1;var ik=Gt();function i1(t,e={}){let r=new ArrayBuffer(t.length*2),i=new DataView(r);for(let n=0;n<t.length;n++)i.setUint16(n*2,t.charCodeAt(n),e.littleEndian??!1);return new Uint8Array(r)}function n1(t,e={}){let r=(0,ik.toArrayBuffer)(t),i=new DataView(r),n="";for(let s=0;s<r.byteLength;s+=2)n+=String.fromCharCode(i.getUint16(s,e.littleEndian??!1));return n}Bo.utf16={encode:i1,decode:n1}});var ng=l(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.base64=void 0;Bi.normalize=Kd;Bi.pad=c1;Bi.is=ig;Bi.encode=u1;Bi.decode=l1;var nk=Gt(),o1=eg(),sk=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function a1(){return globalThis.Buffer}function Kd(t){return t.replace(/[\n\r\t ]/g,"")}function c1(t){let e=t.length%4;return e?t+"=".repeat(4-e):t}function ig(t){if(typeof t!="string")return!1;let e=Kd(t);return e===""||sk.test(e)}function u1(t,e){let r=(0,nk.toUint8Array)(t),i=a1();return i?i.from(r).toString("base64"):btoa((0,o1.encode)(r))}function l1(t,e){let r=Kd(t);if(!ig(r))throw new TypeError("Input is not valid Base64 text");let i=a1();return i?new Uint8Array(i.from(r,"base64")):(0,o1.decode)(atob(r))}Bi.base64={encode:u1,decode:l1,is:ig,normalize:Kd,pad:c1}});var p1=l(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.base64url=void 0;nn.normalize=Vd;nn.is=og;nn.encode=f1;nn.decode=d1;var sg=ng(),ok=/^[A-Za-z0-9_-]*$/;function Vd(t){return t.replace(/[\n\r\t ]/g,"")}function og(t){return typeof t=="string"&&ok.test(Vd(t))}function f1(t,e){return sg.base64.encode(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function d1(t,e){let r=Vd(t);if(!og(r))throw new TypeError("Input is not valid Base64Url text");return sg.base64.decode(sg.base64.pad(r.replace(/-/g,"+").replace(/_/g,"/")))}nn.base64url={encode:f1,decode:d1,is:og,normalize:Vd}});var ag=l(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.base64url=Ot.base64=Ot.utf16=Ot.utf8=Ot.hex=Ot.binary=void 0;var ko=(v(),g(A));Ot.binary=ko.__importStar(eg());Ot.hex=ko.__importStar(Zw());Ot.utf8=ko.__importStar(r1());Ot.utf16=ko.__importStar(s1());Ot.base64=ko.__importStar(ng());Ot.base64url=ko.__importStar(p1())});var y1=l(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.IpConverter=void 0;var ak=ag(),cg=class{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let r=e.split(".");if(r.length!==4)throw new Error("Invalid IPv4 address");return r.map(i=>{let n=parseInt(i,10);if(isNaN(n)||n<0||n>255)throw new Error("Invalid IPv4 address part");return n})}static parseIPv6(e){let i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((n,s)=>{let o=parseInt(s,16);if(isNaN(o)||o<0||o>65535)throw new Error("Invalid IPv6 address part");return n.push(o>>8&255),n.push(o&255),n},[])}static expandIPv6(e){if(!e.includes("::"))return e;let r=e.split("::");if(r.length>2)throw new Error("Invalid IPv6 address");let i=r[0]?r[0].split(":"):[],n=r[1]?r[1].split(":"):[],s=8-(i.length+n.length);if(s<0)throw new Error("Invalid IPv6 address");return[...i,...Array(s).fill("0"),...n].join(":")}static formatIPv6(e){let r=[];for(let i=0;i<16;i+=2)r.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(r.join(":"))}static compressIPv6(e){let r=e.split(":"),i=-1,n=0,s=-1,o=0;for(let a=0;a<r.length;a++)r[a]==="0"?(s===-1&&(s=a),o++):(o>n&&(i=s,n=o),s=-1,o=0);if(o>n&&(i=s,n=o),n>1){let a=r.slice(0,i).join(":"),c=r.slice(i+n).join(":");return`${a}::${c}`}return e}static parseCIDR(e){let[r,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(r)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(r),n]}else{if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(r),n]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;let r=parseInt(e.slice(8),16).toString(2).split("").reduce((n,s)=>n+ +s,0),i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(e){let r=new Uint8Array(e);if(r.length===4)return Array.from(r).join(".");if(r.length===16)return this.formatIPv6(r);if(r.length===8||r.length===32){let i=r.length/2,n=r.slice(0,i),s=r.slice(i);if(r.every(c=>c===0))return r.length===8?"0.0.0.0/0":"::/0";let a=s.reduce((c,u)=>c+(u.toString(2).match(/1/g)||[]).length,0);return r.length===8?`${Array.from(n).join(".")}/${a}`:`${this.formatIPv6(n)}/${a}`}return this.decodeIP(ak.hex.encode(e))}static fromString(e){if(e.includes("/")){let[i,n]=this.parseCIDR(e),s=new Uint8Array(i.length),o=n;for(let c=0;c<s.length;c++)o>=8?(s[c]=255,o-=8):o>0&&(s[c]=255<<8-o,o=0);let a=new Uint8Array(i.length*2);return a.set(i,0),a.set(s,i.length),a.buffer}let r=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(r).buffer}};Gd.IpConverter=cg});var Mo=l(Ze=>{"use strict";var ug,lg,fg;Object.defineProperty(Ze,"__esModule",{value:!0});Ze.Name=Ze.RDNSequence=Ze.RelativeDistinguishedName=Ze.AttributeTypeAndValue=Ze.AttributeValue=Ze.DirectoryString=void 0;var It=(v(),g(A)),_e=S(),ck=ag(),ki=class{teletexString;printableString;universalString;utf8String;bmpString;constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};Ze.DirectoryString=ki;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.TeletexString})],ki.prototype,"teletexString",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.PrintableString})],ki.prototype,"printableString",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.UniversalString})],ki.prototype,"universalString",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.Utf8String})],ki.prototype,"utf8String",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.BmpString})],ki.prototype,"bmpString",void 0);Ze.DirectoryString=ki=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Choice})],ki);var Gn=class extends ki{ia5String;anyValue;constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?ck.hex.encode(this.anyValue):super.toString())}};Ze.AttributeValue=Gn;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.IA5String})],Gn.prototype,"ia5String",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.Any})],Gn.prototype,"anyValue",void 0);Ze.AttributeValue=Gn=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Choice})],Gn);var jo=class{type="";value=new Gn;constructor(e={}){Object.assign(this,e)}};Ze.AttributeTypeAndValue=jo;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.ObjectIdentifier})],jo.prototype,"type",void 0);It.__decorate([(0,_e.AsnProp)({type:Gn})],jo.prototype,"value",void 0);var Fd=ug=class extends _e.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,ug.prototype)}};Ze.RelativeDistinguishedName=Fd;Ze.RelativeDistinguishedName=Fd=ug=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Set,itemType:jo})],Fd);var Hd=lg=class extends _e.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,lg.prototype)}};Ze.RDNSequence=Hd;Ze.RDNSequence=Hd=lg=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Sequence,itemType:Fd})],Hd);var dg=fg=class extends Hd{constructor(e){super(e),Object.setPrototypeOf(this,fg.prototype)}};Ze.Name=dg;Ze.Name=dg=fg=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Sequence})],dg)});var Fn=l(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.GeneralName=ur.EDIPartyName=ur.OtherName=ur.AsnIpConverter=void 0;var Bt=(v(),g(A)),Te=S(),_1=y1(),Wd=Mo();ur.AsnIpConverter={fromASN:t=>_1.IpConverter.toString(Te.AsnOctetStringConverter.fromASN(t)),toASN:t=>Te.AsnOctetStringConverter.toASN(_1.IpConverter.fromString(t))};var No=class{typeId="";value=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};ur.OtherName=No;Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.ObjectIdentifier})],No.prototype,"typeId",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.Any,context:0})],No.prototype,"value",void 0);var qo=class{nameAssigner;partyName=new Wd.DirectoryString;constructor(e={}){Object.assign(this,e)}};ur.EDIPartyName=qo;Bt.__decorate([(0,Te.AsnProp)({type:Wd.DirectoryString,optional:!0,context:0,implicit:!0})],qo.prototype,"nameAssigner",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Wd.DirectoryString,context:1,implicit:!0})],qo.prototype,"partyName",void 0);var lr=class{otherName;rfc822Name;dNSName;x400Address;directoryName;ediPartyName;uniformResourceIdentifier;iPAddress;registeredID;constructor(e={}){Object.assign(this,e)}};ur.GeneralName=lr;Bt.__decorate([(0,Te.AsnProp)({type:No,context:0,implicit:!0})],lr.prototype,"otherName",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.IA5String,context:1,implicit:!0})],lr.prototype,"rfc822Name",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.IA5String,context:2,implicit:!0})],lr.prototype,"dNSName",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.Any,context:3,implicit:!0})],lr.prototype,"x400Address",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Wd.Name,context:4,implicit:!1})],lr.prototype,"directoryName",void 0);Bt.__decorate([(0,Te.AsnProp)({type:qo,context:5})],lr.prototype,"ediPartyName",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.IA5String,context:6,implicit:!0})],lr.prototype,"uniformResourceIdentifier",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.OctetString,context:7,implicit:!0,converter:ur.AsnIpConverter})],lr.prototype,"iPAddress",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.ObjectIdentifier,context:8,implicit:!0})],lr.prototype,"registeredID",void 0);ur.GeneralName=lr=Bt.__decorate([(0,Te.AsnType)({type:Te.AsnTypeTypes.Choice})],lr)});var Ce=l(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.id_ce=ne.id_ad_caRepository=ne.id_ad_timeStamping=ne.id_ad_caIssuers=ne.id_ad_ocsp=ne.id_qt_unotice=ne.id_qt_csp=ne.id_ad=ne.id_kp=ne.id_qt=ne.id_pe=ne.id_pkix=void 0;ne.id_pkix="1.3.6.1.5.5.7";ne.id_pe=`${ne.id_pkix}.1`;ne.id_qt=`${ne.id_pkix}.2`;ne.id_kp=`${ne.id_pkix}.3`;ne.id_ad=`${ne.id_pkix}.48`;ne.id_qt_csp=`${ne.id_qt}.1`;ne.id_qt_unotice=`${ne.id_qt}.2`;ne.id_ad_ocsp=`${ne.id_ad}.1`;ne.id_ad_caIssuers=`${ne.id_ad}.2`;ne.id_ad_timeStamping=`${ne.id_ad}.3`;ne.id_ad_caRepository=`${ne.id_ad}.5`;ne.id_ce="2.5.29"});var hg=l(ji=>{"use strict";var pg;Object.defineProperty(ji,"__esModule",{value:!0});ji.AuthorityInfoAccessSyntax=ji.AccessDescription=ji.id_pe_authorityInfoAccess=void 0;var _g=(v(),g(A)),Ro=S(),h1=Fn(),uk=Ce();ji.id_pe_authorityInfoAccess=`${uk.id_pe}.1`;var Do=class{accessMethod="";accessLocation=new h1.GeneralName;constructor(e={}){Object.assign(this,e)}};ji.AccessDescription=Do;_g.__decorate([(0,Ro.AsnProp)({type:Ro.AsnPropTypes.ObjectIdentifier})],Do.prototype,"accessMethod",void 0);_g.__decorate([(0,Ro.AsnProp)({type:h1.GeneralName})],Do.prototype,"accessLocation",void 0);var yg=pg=class extends Ro.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,pg.prototype)}};ji.AuthorityInfoAccessSyntax=yg;ji.AuthorityInfoAccessSyntax=yg=pg=_g.__decorate([(0,Ro.AsnType)({type:Ro.AsnTypeTypes.Sequence,itemType:Do})],yg)});var Ag=l(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.AuthorityKeyIdentifier=sn.KeyIdentifier=sn.id_ce_authorityKeyIdentifier=void 0;var gg=(v(),g(A)),Uo=S(),lk=Fn(),fk=Ce();sn.id_ce_authorityKeyIdentifier=`${fk.id_ce}.35`;var $d=class extends Uo.OctetString{};sn.KeyIdentifier=$d;var Lo=class{keyIdentifier;authorityCertIssuer;authorityCertSerialNumber;constructor(e={}){e&&Object.assign(this,e)}};sn.AuthorityKeyIdentifier=Lo;gg.__decorate([(0,Uo.AsnProp)({type:$d,context:0,optional:!0,implicit:!0})],Lo.prototype,"keyIdentifier",void 0);gg.__decorate([(0,Uo.AsnProp)({type:lk.GeneralName,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Lo.prototype,"authorityCertIssuer",void 0);gg.__decorate([(0,Uo.AsnProp)({type:Uo.AsnPropTypes.Integer,context:2,optional:!0,implicit:!0,converter:Uo.AsnIntegerArrayBufferConverter})],Lo.prototype,"authorityCertSerialNumber",void 0)});var A1=l(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.BasicConstraints=Ko.id_ce_basicConstraints=void 0;var g1=(v(),g(A)),zd=S(),dk=Ce();Ko.id_ce_basicConstraints=`${dk.id_ce}.19`;var vu=class{cA=!1;pathLenConstraint;constructor(e={}){Object.assign(this,e)}};Ko.BasicConstraints=vu;g1.__decorate([(0,zd.AsnProp)({type:zd.AsnPropTypes.Boolean,defaultValue:!1})],vu.prototype,"cA",void 0);g1.__decorate([(0,zd.AsnProp)({type:zd.AsnPropTypes.Integer,optional:!0})],vu.prototype,"pathLenConstraint",void 0)});var bu=l(mu=>{"use strict";var vg;Object.defineProperty(mu,"__esModule",{value:!0});mu.GeneralNames=void 0;var pk=(v(),g(A)),mg=S(),yk=Fn(),bg=vg=class extends mg.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,vg.prototype)}};mu.GeneralNames=bg;mu.GeneralNames=bg=vg=pk.__decorate([(0,mg.AsnType)({type:mg.AsnTypeTypes.Sequence,itemType:yk.GeneralName})],bg)});var m1=l(Hn=>{"use strict";var Sg;Object.defineProperty(Hn,"__esModule",{value:!0});Hn.CertificateIssuer=Hn.id_ce_certificateIssuer=void 0;var _k=(v(),g(A)),v1=S(),hk=bu(),gk=Ce();Hn.id_ce_certificateIssuer=`${gk.id_ce}.29`;var wg=Sg=class extends hk.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,Sg.prototype)}};Hn.CertificateIssuer=wg;Hn.CertificateIssuer=wg=Sg=_k.__decorate([(0,v1.AsnType)({type:v1.AsnTypeTypes.Sequence})],wg)});var b1=l(Be=>{"use strict";var Cg;Object.defineProperty(Be,"__esModule",{value:!0});Be.CertificatePolicies=Be.PolicyInformation=Be.PolicyQualifierInfo=Be.Qualifier=Be.UserNotice=Be.NoticeReference=Be.DisplayText=Be.id_ce_certificatePolicies_anyPolicy=Be.id_ce_certificatePolicies=void 0;var ft=(v(),g(A)),fe=S(),Ak=Ce();Be.id_ce_certificatePolicies=`${Ak.id_ce}.32`;Be.id_ce_certificatePolicies_anyPolicy=`${Be.id_ce_certificatePolicies}.0`;var ii=class{ia5String;visibleString;bmpString;utf8String;constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};Be.DisplayText=ii;ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.IA5String})],ii.prototype,"ia5String",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.VisibleString})],ii.prototype,"visibleString",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.BmpString})],ii.prototype,"bmpString",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.Utf8String})],ii.prototype,"utf8String",void 0);Be.DisplayText=ii=ft.__decorate([(0,fe.AsnType)({type:fe.AsnTypeTypes.Choice})],ii);var Vo=class{organization=new ii;noticeNumbers=[];constructor(e={}){Object.assign(this,e)}};Be.NoticeReference=Vo;ft.__decorate([(0,fe.AsnProp)({type:ii})],Vo.prototype,"organization",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.Integer,repeated:"sequence"})],Vo.prototype,"noticeNumbers",void 0);var Go=class{noticeRef;explicitText;constructor(e={}){Object.assign(this,e)}};Be.UserNotice=Go;ft.__decorate([(0,fe.AsnProp)({type:Vo,optional:!0})],Go.prototype,"noticeRef",void 0);ft.__decorate([(0,fe.AsnProp)({type:ii,optional:!0})],Go.prototype,"explicitText",void 0);var Su=class{cPSuri;userNotice;constructor(e={}){Object.assign(this,e)}};Be.Qualifier=Su;ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.IA5String})],Su.prototype,"cPSuri",void 0);ft.__decorate([(0,fe.AsnProp)({type:Go})],Su.prototype,"userNotice",void 0);Be.Qualifier=Su=ft.__decorate([(0,fe.AsnType)({type:fe.AsnTypeTypes.Choice})],Su);var Fo=class{policyQualifierId="";qualifier=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Be.PolicyQualifierInfo=Fo;ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.ObjectIdentifier})],Fo.prototype,"policyQualifierId",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.Any})],Fo.prototype,"qualifier",void 0);var Ho=class{policyIdentifier="";policyQualifiers;constructor(e={}){Object.assign(this,e)}};Be.PolicyInformation=Ho;ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.ObjectIdentifier})],Ho.prototype,"policyIdentifier",void 0);ft.__decorate([(0,fe.AsnProp)({type:Fo,repeated:"sequence",optional:!0})],Ho.prototype,"policyQualifiers",void 0);var Pg=Cg=class extends fe.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Cg.prototype)}};Be.CertificatePolicies=Pg;Be.CertificatePolicies=Pg=Cg=ft.__decorate([(0,fe.AsnType)({type:fe.AsnTypeTypes.Sequence,itemType:Ho})],Pg)});var Eg=l(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.CRLNumber=Wn.id_ce_cRLNumber=void 0;var S1=(v(),g(A)),Yd=S(),vk=Ce();Wn.id_ce_cRLNumber=`${vk.id_ce}.20`;var Jd=class{value;constructor(e=0){this.value=e}};Wn.CRLNumber=Jd;S1.__decorate([(0,Yd.AsnProp)({type:Yd.AsnPropTypes.Integer})],Jd.prototype,"value",void 0);Wn.CRLNumber=Jd=S1.__decorate([(0,Yd.AsnType)({type:Yd.AsnTypeTypes.Choice})],Jd)});var C1=l($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.BaseCRLNumber=$n.id_ce_deltaCRLIndicator=void 0;var mk=(v(),g(A)),w1=S(),bk=Ce(),Sk=Eg();$n.id_ce_deltaCRLIndicator=`${bk.id_ce}.27`;var Tg=class extends Sk.CRLNumber{};$n.BaseCRLNumber=Tg;$n.BaseCRLNumber=Tg=mk.__decorate([(0,w1.AsnType)({type:w1.AsnTypeTypes.Choice})],Tg)});var Xd=l(ht=>{"use strict";var xg;Object.defineProperty(ht,"__esModule",{value:!0});ht.CRLDistributionPoints=ht.DistributionPoint=ht.DistributionPointName=ht.Reason=ht.ReasonFlags=ht.id_ce_cRLDistributionPoints=void 0;var Yn=(v(),g(A)),Or=S(),wk=Mo(),P1=Fn(),Ck=Ce();ht.id_ce_cRLDistributionPoints=`${Ck.id_ce}.31`;var xr;(function(t){t[t.unused=1]="unused",t[t.keyCompromise=2]="keyCompromise",t[t.cACompromise=4]="cACompromise",t[t.affiliationChanged=8]="affiliationChanged",t[t.superseded=16]="superseded",t[t.cessationOfOperation=32]="cessationOfOperation",t[t.certificateHold=64]="certificateHold",t[t.privilegeWithdrawn=128]="privilegeWithdrawn",t[t.aACompromise=256]="aACompromise"})(xr||(ht.ReasonFlags=xr={}));var Qd=class extends Or.BitString{toJSON(){let e=[],r=this.toNumber();return r&xr.aACompromise&&e.push("aACompromise"),r&xr.affiliationChanged&&e.push("affiliationChanged"),r&xr.cACompromise&&e.push("cACompromise"),r&xr.certificateHold&&e.push("certificateHold"),r&xr.cessationOfOperation&&e.push("cessationOfOperation"),r&xr.keyCompromise&&e.push("keyCompromise"),r&xr.privilegeWithdrawn&&e.push("privilegeWithdrawn"),r&xr.superseded&&e.push("superseded"),r&xr.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}};ht.Reason=Qd;var Wo=class{fullName;nameRelativeToCRLIssuer;constructor(e={}){Object.assign(this,e)}};ht.DistributionPointName=Wo;Yn.__decorate([(0,Or.AsnProp)({type:P1.GeneralName,context:0,repeated:"sequence",implicit:!0})],Wo.prototype,"fullName",void 0);Yn.__decorate([(0,Or.AsnProp)({type:wk.RelativeDistinguishedName,context:1,implicit:!0})],Wo.prototype,"nameRelativeToCRLIssuer",void 0);ht.DistributionPointName=Wo=Yn.__decorate([(0,Or.AsnType)({type:Or.AsnTypeTypes.Choice})],Wo);var zn=class{distributionPoint;reasons;cRLIssuer;constructor(e={}){Object.assign(this,e)}};ht.DistributionPoint=zn;Yn.__decorate([(0,Or.AsnProp)({type:Wo,context:0,optional:!0})],zn.prototype,"distributionPoint",void 0);Yn.__decorate([(0,Or.AsnProp)({type:Qd,context:1,optional:!0,implicit:!0})],zn.prototype,"reasons",void 0);Yn.__decorate([(0,Or.AsnProp)({type:P1.GeneralName,context:2,optional:!0,repeated:"sequence",implicit:!0})],zn.prototype,"cRLIssuer",void 0);var Og=xg=class extends Or.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,xg.prototype)}};ht.CRLDistributionPoints=Og;ht.CRLDistributionPoints=Og=xg=Yn.__decorate([(0,Or.AsnType)({type:Or.AsnTypeTypes.Sequence,itemType:zn})],Og)});var x1=l(Jn=>{"use strict";var Ig;Object.defineProperty(Jn,"__esModule",{value:!0});Jn.FreshestCRL=Jn.id_ce_freshestCRL=void 0;var Pk=(v(),g(A)),E1=S(),Ek=Ce(),T1=Xd();Jn.id_ce_freshestCRL=`${Ek.id_ce}.46`;var Bg=Ig=class extends T1.CRLDistributionPoints{constructor(e){super(e),Object.setPrototypeOf(this,Ig.prototype)}};Jn.FreshestCRL=Bg;Jn.FreshestCRL=Bg=Ig=Pk.__decorate([(0,E1.AsnType)({type:E1.AsnTypeTypes.Sequence,itemType:T1.DistributionPoint})],Bg)});var I1=l($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.IssuingDistributionPoint=$o.id_ce_issuingDistributionPoint=void 0;var zo=(v(),g(A)),ni=S(),Tk=Ce(),O1=Xd();$o.id_ce_issuingDistributionPoint=`${Tk.id_ce}.28`;var Wt=class t{static ONLY=!1;distributionPoint;onlyContainsUserCerts=t.ONLY;onlyContainsCACerts=t.ONLY;onlySomeReasons;indirectCRL=t.ONLY;onlyContainsAttributeCerts=t.ONLY;constructor(e={}){Object.assign(this,e)}};$o.IssuingDistributionPoint=Wt;zo.__decorate([(0,ni.AsnProp)({type:O1.DistributionPointName,context:0,optional:!0})],Wt.prototype,"distributionPoint",void 0);zo.__decorate([(0,ni.AsnProp)({type:ni.AsnPropTypes.Boolean,context:1,defaultValue:Wt.ONLY,implicit:!0})],Wt.prototype,"onlyContainsUserCerts",void 0);zo.__decorate([(0,ni.AsnProp)({type:ni.AsnPropTypes.Boolean,context:2,defaultValue:Wt.ONLY,implicit:!0})],Wt.prototype,"onlyContainsCACerts",void 0);zo.__decorate([(0,ni.AsnProp)({type:O1.Reason,context:3,optional:!0,implicit:!0})],Wt.prototype,"onlySomeReasons",void 0);zo.__decorate([(0,ni.AsnProp)({type:ni.AsnPropTypes.Boolean,context:4,defaultValue:Wt.ONLY,implicit:!0})],Wt.prototype,"indirectCRL",void 0);zo.__decorate([(0,ni.AsnProp)({type:ni.AsnPropTypes.Boolean,context:5,defaultValue:Wt.ONLY,implicit:!0})],Wt.prototype,"onlyContainsAttributeCerts",void 0)});var k1=l(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.CRLReason=Mi.CRLReasons=Mi.id_ce_cRLReasons=void 0;var B1=(v(),g(A)),Zd=S(),xk=Ce();Mi.id_ce_cRLReasons=`${xk.id_ce}.21`;var wu;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(wu||(Mi.CRLReasons=wu={}));var ep=class{reason=wu.unspecified;constructor(e=wu.unspecified){this.reason=e}toJSON(){return wu[this.reason]}toString(){return this.toJSON()}};Mi.CRLReason=ep;B1.__decorate([(0,Zd.AsnProp)({type:Zd.AsnPropTypes.Enumerated})],ep.prototype,"reason",void 0);Mi.CRLReason=ep=B1.__decorate([(0,Zd.AsnType)({type:Zd.AsnTypeTypes.Choice})],ep)});var j1=l(Re=>{"use strict";var kg;Object.defineProperty(Re,"__esModule",{value:!0});Re.id_kp_OCSPSigning=Re.id_kp_timeStamping=Re.id_kp_emailProtection=Re.id_kp_codeSigning=Re.id_kp_clientAuth=Re.id_kp_serverAuth=Re.anyExtendedKeyUsage=Re.ExtendedKeyUsage=Re.id_ce_extKeyUsage=void 0;var Ok=(v(),g(A)),tp=S(),Qn=Ce();Re.id_ce_extKeyUsage=`${Qn.id_ce}.37`;var jg=kg=class extends tp.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,kg.prototype)}};Re.ExtendedKeyUsage=jg;Re.ExtendedKeyUsage=jg=kg=Ok.__decorate([(0,tp.AsnType)({type:tp.AsnTypeTypes.Sequence,itemType:tp.AsnPropTypes.ObjectIdentifier})],jg);Re.anyExtendedKeyUsage=`${Re.id_ce_extKeyUsage}.0`;Re.id_kp_serverAuth=`${Qn.id_kp}.1`;Re.id_kp_clientAuth=`${Qn.id_kp}.2`;Re.id_kp_codeSigning=`${Qn.id_kp}.3`;Re.id_kp_emailProtection=`${Qn.id_kp}.4`;Re.id_kp_timeStamping=`${Qn.id_kp}.8`;Re.id_kp_OCSPSigning=`${Qn.id_kp}.9`});var N1=l(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.InhibitAnyPolicy=Xn.id_ce_inhibitAnyPolicy=void 0;var M1=(v(),g(A)),Cu=S(),Ik=Ce();Xn.id_ce_inhibitAnyPolicy=`${Ik.id_ce}.54`;var rp=class{value;constructor(e=new ArrayBuffer(0)){this.value=e}};Xn.InhibitAnyPolicy=rp;M1.__decorate([(0,Cu.AsnProp)({type:Cu.AsnPropTypes.Integer,converter:Cu.AsnIntegerArrayBufferConverter})],rp.prototype,"value",void 0);Xn.InhibitAnyPolicy=rp=M1.__decorate([(0,Cu.AsnType)({type:Cu.AsnTypeTypes.Choice})],rp)});var R1=l(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.InvalidityDate=Zn.id_ce_invalidityDate=void 0;var q1=(v(),g(A)),ip=S(),Bk=Ce();Zn.id_ce_invalidityDate=`${Bk.id_ce}.24`;var np=class{value=new Date;constructor(e){e&&(this.value=e)}};Zn.InvalidityDate=np;q1.__decorate([(0,ip.AsnProp)({type:ip.AsnPropTypes.GeneralizedTime})],np.prototype,"value",void 0);Zn.InvalidityDate=np=q1.__decorate([(0,ip.AsnType)({type:ip.AsnTypeTypes.Choice})],np)});var U1=l(es=>{"use strict";var Mg;Object.defineProperty(es,"__esModule",{value:!0});es.IssueAlternativeName=es.id_ce_issuerAltName=void 0;var kk=(v(),g(A)),D1=S(),jk=bu(),Mk=Ce();es.id_ce_issuerAltName=`${Mk.id_ce}.18`;var Ng=Mg=class extends jk.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,Mg.prototype)}};es.IssueAlternativeName=Ng;es.IssueAlternativeName=Ng=Mg=kk.__decorate([(0,D1.AsnType)({type:D1.AsnTypeTypes.Sequence})],Ng)});var L1=l(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.KeyUsage=on.KeyUsageFlags=on.id_ce_keyUsage=void 0;var Nk=S(),qk=Ce();on.id_ce_keyUsage=`${qk.id_ce}.15`;var Ir;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(Ir||(on.KeyUsageFlags=Ir={}));var qg=class extends Nk.BitString{toJSON(){let e=this.toNumber(),r=[];return e&Ir.cRLSign&&r.push("crlSign"),e&Ir.dataEncipherment&&r.push("dataEncipherment"),e&Ir.decipherOnly&&r.push("decipherOnly"),e&Ir.digitalSignature&&r.push("digitalSignature"),e&Ir.encipherOnly&&r.push("encipherOnly"),e&Ir.keyAgreement&&r.push("keyAgreement"),e&Ir.keyCertSign&&r.push("keyCertSign"),e&Ir.keyEncipherment&&r.push("keyEncipherment"),e&Ir.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}};on.KeyUsage=qg});var V1=l(Br=>{"use strict";var Rg;Object.defineProperty(Br,"__esModule",{value:!0});Br.NameConstraints=Br.GeneralSubtrees=Br.GeneralSubtree=Br.id_ce_nameConstraints=void 0;var Yo=(v(),g(A)),si=S(),K1=Fn(),Rk=Ce();Br.id_ce_nameConstraints=`${Rk.id_ce}.30`;var ts=class{base=new K1.GeneralName;minimum=0;maximum;constructor(e={}){Object.assign(this,e)}};Br.GeneralSubtree=ts;Yo.__decorate([(0,si.AsnProp)({type:K1.GeneralName})],ts.prototype,"base",void 0);Yo.__decorate([(0,si.AsnProp)({type:si.AsnPropTypes.Integer,context:0,defaultValue:0,implicit:!0})],ts.prototype,"minimum",void 0);Yo.__decorate([(0,si.AsnProp)({type:si.AsnPropTypes.Integer,context:1,optional:!0,implicit:!0})],ts.prototype,"maximum",void 0);var Pu=Rg=class extends si.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Rg.prototype)}};Br.GeneralSubtrees=Pu;Br.GeneralSubtrees=Pu=Rg=Yo.__decorate([(0,si.AsnType)({type:si.AsnTypeTypes.Sequence,itemType:ts})],Pu);var Eu=class{permittedSubtrees;excludedSubtrees;constructor(e={}){Object.assign(this,e)}};Br.NameConstraints=Eu;Yo.__decorate([(0,si.AsnProp)({type:Pu,context:0,optional:!0,implicit:!0})],Eu.prototype,"permittedSubtrees",void 0);Yo.__decorate([(0,si.AsnProp)({type:Pu,context:1,optional:!0,implicit:!0})],Eu.prototype,"excludedSubtrees",void 0)});var F1=l(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.PolicyConstraints=Qo.id_ce_policyConstraints=void 0;var G1=(v(),g(A)),Jo=S(),Dk=Ce();Qo.id_ce_policyConstraints=`${Dk.id_ce}.36`;var Tu=class{requireExplicitPolicy;inhibitPolicyMapping;constructor(e={}){Object.assign(this,e)}};Qo.PolicyConstraints=Tu;G1.__decorate([(0,Jo.AsnProp)({type:Jo.AsnPropTypes.Integer,context:0,implicit:!0,optional:!0,converter:Jo.AsnIntegerArrayBufferConverter})],Tu.prototype,"requireExplicitPolicy",void 0);G1.__decorate([(0,Jo.AsnProp)({type:Jo.AsnPropTypes.Integer,context:1,implicit:!0,optional:!0,converter:Jo.AsnIntegerArrayBufferConverter})],Tu.prototype,"inhibitPolicyMapping",void 0)});var H1=l(Ni=>{"use strict";var Dg;Object.defineProperty(Ni,"__esModule",{value:!0});Ni.PolicyMappings=Ni.PolicyMapping=Ni.id_ce_policyMappings=void 0;var Lg=(v(),g(A)),rs=S(),Uk=Ce();Ni.id_ce_policyMappings=`${Uk.id_ce}.33`;var Xo=class{issuerDomainPolicy="";subjectDomainPolicy="";constructor(e={}){Object.assign(this,e)}};Ni.PolicyMapping=Xo;Lg.__decorate([(0,rs.AsnProp)({type:rs.AsnPropTypes.ObjectIdentifier})],Xo.prototype,"issuerDomainPolicy",void 0);Lg.__decorate([(0,rs.AsnProp)({type:rs.AsnPropTypes.ObjectIdentifier})],Xo.prototype,"subjectDomainPolicy",void 0);var Ug=Dg=class extends rs.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Dg.prototype)}};Ni.PolicyMappings=Ug;Ni.PolicyMappings=Ug=Dg=Lg.__decorate([(0,rs.AsnType)({type:rs.AsnTypeTypes.Sequence,itemType:Xo})],Ug)});var $1=l(is=>{"use strict";var Kg;Object.defineProperty(is,"__esModule",{value:!0});is.SubjectAlternativeName=is.id_ce_subjectAltName=void 0;var Lk=(v(),g(A)),W1=S(),Kk=bu(),Vk=Ce();is.id_ce_subjectAltName=`${Vk.id_ce}.17`;var Vg=Kg=class extends Kk.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,Kg.prototype)}};is.SubjectAlternativeName=Vg;is.SubjectAlternativeName=Vg=Kg=Lk.__decorate([(0,W1.AsnType)({type:W1.AsnTypeTypes.Sequence})],Vg)});var Gg=l(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.Attribute=void 0;var z1=(v(),g(A)),sp=S(),xu=class{type="";values=[];constructor(e={}){Object.assign(this,e)}};op.Attribute=xu;z1.__decorate([(0,sp.AsnProp)({type:sp.AsnPropTypes.ObjectIdentifier})],xu.prototype,"type",void 0);z1.__decorate([(0,sp.AsnProp)({type:sp.AsnPropTypes.Any,repeated:"set"})],xu.prototype,"values",void 0)});var Y1=l(ns=>{"use strict";var Fg;Object.defineProperty(ns,"__esModule",{value:!0});ns.SubjectDirectoryAttributes=ns.id_ce_subjectDirectoryAttributes=void 0;var Gk=(v(),g(A)),Hg=S(),Fk=Gg(),Hk=Ce();ns.id_ce_subjectDirectoryAttributes=`${Hk.id_ce}.9`;var Wg=Fg=class extends Hg.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Fg.prototype)}};ns.SubjectDirectoryAttributes=Wg;ns.SubjectDirectoryAttributes=Wg=Fg=Gk.__decorate([(0,Hg.AsnType)({type:Hg.AsnTypeTypes.Sequence,itemType:Fk.Attribute})],Wg)});var J1=l(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.SubjectKeyIdentifier=Zo.id_ce_subjectKeyIdentifier=void 0;var Wk=Ce(),$k=Ag();Zo.id_ce_subjectKeyIdentifier=`${Wk.id_ce}.14`;var $g=class extends $k.KeyIdentifier{};Zo.SubjectKeyIdentifier=$g});var X1=l(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.PrivateKeyUsagePeriod=ea.id_ce_privateKeyUsagePeriod=void 0;var Q1=(v(),g(A)),ap=S(),zk=Ce();ea.id_ce_privateKeyUsagePeriod=`${zk.id_ce}.16`;var Ou=class{notBefore;notAfter;constructor(e={}){Object.assign(this,e)}};ea.PrivateKeyUsagePeriod=Ou;Q1.__decorate([(0,ap.AsnProp)({type:ap.AsnPropTypes.GeneralizedTime,context:0,implicit:!0,optional:!0})],Ou.prototype,"notBefore",void 0);Q1.__decorate([(0,ap.AsnProp)({type:ap.AsnPropTypes.GeneralizedTime,context:1,implicit:!0,optional:!0})],Ou.prototype,"notAfter",void 0)});var eC=l(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.EntrustVersionInfo=oi.EntrustInfo=oi.EntrustInfoFlags=oi.id_entrust_entrustVersInfo=void 0;var Z1=(v(),g(A)),cp=S();oi.id_entrust_entrustVersInfo="1.2.840.113533.7.65.0";var Iu;(function(t){t[t.keyUpdateAllowed=1]="keyUpdateAllowed",t[t.newExtensions=2]="newExtensions",t[t.pKIXCertificate=4]="pKIXCertificate"})(Iu||(oi.EntrustInfoFlags=Iu={}));var Bu=class extends cp.BitString{toJSON(){let e=[],r=this.toNumber();return r&Iu.pKIXCertificate&&e.push("pKIXCertificate"),r&Iu.newExtensions&&e.push("newExtensions"),r&Iu.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}};oi.EntrustInfo=Bu;var ku=class{entrustVers="";entrustInfoFlags=new Bu;constructor(e={}){Object.assign(this,e)}};oi.EntrustVersionInfo=ku;Z1.__decorate([(0,cp.AsnProp)({type:cp.AsnPropTypes.GeneralString})],ku.prototype,"entrustVers",void 0);Z1.__decorate([(0,cp.AsnProp)({type:Bu})],ku.prototype,"entrustInfoFlags",void 0)});var tC=l(ss=>{"use strict";var zg;Object.defineProperty(ss,"__esModule",{value:!0});ss.SubjectInfoAccessSyntax=ss.id_pe_subjectInfoAccess=void 0;var Yk=(v(),g(A)),Yg=S(),Jk=Ce(),Qk=hg();ss.id_pe_subjectInfoAccess=`${Jk.id_pe}.11`;var Jg=zg=class extends Yg.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,zg.prototype)}};ss.SubjectInfoAccessSyntax=Jg;ss.SubjectInfoAccessSyntax=Jg=zg=Yk.__decorate([(0,Yg.AsnType)({type:Yg.AsnTypeTypes.Sequence,itemType:Qk.AccessDescription})],Jg)});var rC=l(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var xe=(v(),g(A));xe.__exportStar(hg(),ve);xe.__exportStar(Ag(),ve);xe.__exportStar(A1(),ve);xe.__exportStar(m1(),ve);xe.__exportStar(b1(),ve);xe.__exportStar(C1(),ve);xe.__exportStar(Xd(),ve);xe.__exportStar(x1(),ve);xe.__exportStar(I1(),ve);xe.__exportStar(Eg(),ve);xe.__exportStar(k1(),ve);xe.__exportStar(j1(),ve);xe.__exportStar(N1(),ve);xe.__exportStar(R1(),ve);xe.__exportStar(U1(),ve);xe.__exportStar(L1(),ve);xe.__exportStar(V1(),ve);xe.__exportStar(F1(),ve);xe.__exportStar(H1(),ve);xe.__exportStar($1(),ve);xe.__exportStar(Y1(),ve);xe.__exportStar(J1(),ve);xe.__exportStar(X1(),ve);xe.__exportStar(eC(),ve);xe.__exportStar(tC(),ve)});var os=l(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.AlgorithmIdentifier=void 0;var iC=(v(),g(A)),up=S(),Xk=Gt(),ju=class t{algorithm="";parameters;constructor(e={}){Object.assign(this,e)}isEqual(e){return e instanceof t&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&(0,Xk.equal)(e.parameters,this.parameters)||e.parameters===this.parameters)}};lp.AlgorithmIdentifier=ju;iC.__decorate([(0,up.AsnProp)({type:up.AsnPropTypes.ObjectIdentifier})],ju.prototype,"algorithm",void 0);iC.__decorate([(0,up.AsnProp)({type:up.AsnPropTypes.Any,optional:!0})],ju.prototype,"parameters",void 0)});var Xg=l(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.SubjectPublicKeyInfo=void 0;var nC=(v(),g(A)),Qg=S(),sC=os(),Mu=class{algorithm=new sC.AlgorithmIdentifier;subjectPublicKey=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};fp.SubjectPublicKeyInfo=Mu;nC.__decorate([(0,Qg.AsnProp)({type:sC.AlgorithmIdentifier})],Mu.prototype,"algorithm",void 0);nC.__decorate([(0,Qg.AsnProp)({type:Qg.AsnPropTypes.BitString})],Mu.prototype,"subjectPublicKey",void 0)});var dp=l(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.Time=void 0;var Zg=(v(),g(A)),ta=S(),Nu=class{utcTime;generalTime;constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){let r=new Date(e);r.setMilliseconds(0),r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,e)}getTime(){let e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};qu.Time=Nu;Zg.__decorate([(0,ta.AsnProp)({type:ta.AsnPropTypes.UTCTime})],Nu.prototype,"utcTime",void 0);Zg.__decorate([(0,ta.AsnProp)({type:ta.AsnPropTypes.GeneralizedTime})],Nu.prototype,"generalTime",void 0);qu.Time=Nu=Zg.__decorate([(0,ta.AsnType)({type:ta.AsnTypeTypes.Choice})],Nu)});var eA=l(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.Validity=void 0;var oC=(v(),g(A)),aC=S(),ra=dp(),Ru=class{notBefore=new ra.Time(new Date);notAfter=new ra.Time(new Date);constructor(e){e&&(this.notBefore=new ra.Time(e.notBefore),this.notAfter=new ra.Time(e.notAfter))}};pp.Validity=Ru;oC.__decorate([(0,aC.AsnProp)({type:ra.Time})],Ru.prototype,"notBefore",void 0);oC.__decorate([(0,aC.AsnProp)({type:ra.Time})],Ru.prototype,"notAfter",void 0)});var _p=l(as=>{"use strict";var tA;Object.defineProperty(as,"__esModule",{value:!0});as.Extensions=as.Extension=void 0;var yp=(v(),g(A)),ai=S(),an=class t{static CRITICAL=!1;extnID="";critical=t.CRITICAL;extnValue=new ai.OctetString;constructor(e={}){Object.assign(this,e)}};as.Extension=an;yp.__decorate([(0,ai.AsnProp)({type:ai.AsnPropTypes.ObjectIdentifier})],an.prototype,"extnID",void 0);yp.__decorate([(0,ai.AsnProp)({type:ai.AsnPropTypes.Boolean,defaultValue:an.CRITICAL})],an.prototype,"critical",void 0);yp.__decorate([(0,ai.AsnProp)({type:ai.OctetString})],an.prototype,"extnValue",void 0);var rA=tA=class extends ai.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,tA.prototype)}};as.Extensions=rA;as.Extensions=rA=tA=yp.__decorate([(0,ai.AsnType)({type:ai.AsnTypeTypes.Sequence,itemType:an})],rA)});var iA=l(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.Version=void 0;var cC;(function(t){t[t.v1=0]="v1",t[t.v2=1]="v2",t[t.v3=2]="v3"})(cC||(hp.Version=cC={}))});var nA=l(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.TBSCertificate=void 0;var ci=(v(),g(A)),Ct=S(),uC=os(),gp=Mo(),lC=Xg(),fC=eA(),Zk=_p(),dC=iA(),$t=class{version=dC.Version.v1;serialNumber=new ArrayBuffer(0);signature=new uC.AlgorithmIdentifier;issuer=new gp.Name;validity=new fC.Validity;subject=new gp.Name;subjectPublicKeyInfo=new lC.SubjectPublicKeyInfo;issuerUniqueID;subjectUniqueID;extensions;constructor(e={}){Object.assign(this,e)}};Ap.TBSCertificate=$t;ci.__decorate([(0,Ct.AsnProp)({type:Ct.AsnPropTypes.Integer,context:0,defaultValue:dC.Version.v1})],$t.prototype,"version",void 0);ci.__decorate([(0,Ct.AsnProp)({type:Ct.AsnPropTypes.Integer,converter:Ct.AsnIntegerArrayBufferConverter})],$t.prototype,"serialNumber",void 0);ci.__decorate([(0,Ct.AsnProp)({type:uC.AlgorithmIdentifier})],$t.prototype,"signature",void 0);ci.__decorate([(0,Ct.AsnProp)({type:gp.Name})],$t.prototype,"issuer",void 0);ci.__decorate([(0,Ct.AsnProp)({type:fC.Validity})],$t.prototype,"validity",void 0);ci.__decorate([(0,Ct.AsnProp)({type:gp.Name})],$t.prototype,"subject",void 0);ci.__decorate([(0,Ct.AsnProp)({type:lC.SubjectPublicKeyInfo})],$t.prototype,"subjectPublicKeyInfo",void 0);ci.__decorate([(0,Ct.AsnProp)({type:Ct.AsnPropTypes.BitString,context:1,implicit:!0,optional:!0})],$t.prototype,"issuerUniqueID",void 0);ci.__decorate([(0,Ct.AsnProp)({type:Ct.AsnPropTypes.BitString,context:2,implicit:!0,optional:!0})],$t.prototype,"subjectUniqueID",void 0);ci.__decorate([(0,Ct.AsnProp)({type:Zk.Extensions,context:3,optional:!0})],$t.prototype,"extensions",void 0)});var _C=l(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.Certificate=void 0;var sA=(v(),g(A)),vp=S(),pC=os(),yC=nA(),ia=class{tbsCertificate=new yC.TBSCertificate;tbsCertificateRaw;signatureAlgorithm=new pC.AlgorithmIdentifier;signatureValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};mp.Certificate=ia;sA.__decorate([(0,vp.AsnProp)({type:yC.TBSCertificate,raw:!0})],ia.prototype,"tbsCertificate",void 0);sA.__decorate([(0,vp.AsnProp)({type:pC.AlgorithmIdentifier})],ia.prototype,"signatureAlgorithm",void 0);sA.__decorate([(0,vp.AsnProp)({type:vp.AsnPropTypes.BitString})],ia.prototype,"signatureValue",void 0)});var oA=l(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.TBSCertList=na.RevokedCertificate=void 0;var li=(v(),g(A)),zt=S(),hC=os(),gC=Mo(),Du=dp(),AC=_p(),cs=class{userCertificate=new ArrayBuffer(0);revocationDate=new Du.Time;crlEntryExtensions;constructor(e={}){Object.assign(this,e)}};na.RevokedCertificate=cs;li.__decorate([(0,zt.AsnProp)({type:zt.AsnPropTypes.Integer,converter:zt.AsnIntegerArrayBufferConverter})],cs.prototype,"userCertificate",void 0);li.__decorate([(0,zt.AsnProp)({type:Du.Time})],cs.prototype,"revocationDate",void 0);li.__decorate([(0,zt.AsnProp)({type:AC.Extension,optional:!0,repeated:"sequence"})],cs.prototype,"crlEntryExtensions",void 0);var ui=class{version;signature=new hC.AlgorithmIdentifier;issuer=new gC.Name;thisUpdate=new Du.Time;nextUpdate;revokedCertificates;crlExtensions;constructor(e={}){Object.assign(this,e)}};na.TBSCertList=ui;li.__decorate([(0,zt.AsnProp)({type:zt.AsnPropTypes.Integer,optional:!0})],ui.prototype,"version",void 0);li.__decorate([(0,zt.AsnProp)({type:hC.AlgorithmIdentifier})],ui.prototype,"signature",void 0);li.__decorate([(0,zt.AsnProp)({type:gC.Name})],ui.prototype,"issuer",void 0);li.__decorate([(0,zt.AsnProp)({type:Du.Time})],ui.prototype,"thisUpdate",void 0);li.__decorate([(0,zt.AsnProp)({type:Du.Time,optional:!0})],ui.prototype,"nextUpdate",void 0);li.__decorate([(0,zt.AsnProp)({type:cs,repeated:"sequence",optional:!0})],ui.prototype,"revokedCertificates",void 0);li.__decorate([(0,zt.AsnProp)({type:AC.Extension,optional:!0,context:0,repeated:"sequence"})],ui.prototype,"crlExtensions",void 0)});var bC=l(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.CertificateList=void 0;var aA=(v(),g(A)),bp=S(),vC=os(),mC=oA(),sa=class{tbsCertList=new mC.TBSCertList;tbsCertListRaw;signatureAlgorithm=new vC.AlgorithmIdentifier;signature=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Sp.CertificateList=sa;aA.__decorate([(0,bp.AsnProp)({type:mC.TBSCertList,raw:!0})],sa.prototype,"tbsCertList",void 0);aA.__decorate([(0,bp.AsnProp)({type:vC.AlgorithmIdentifier})],sa.prototype,"signatureAlgorithm",void 0);aA.__decorate([(0,bp.AsnProp)({type:bp.AsnPropTypes.BitString})],sa.prototype,"signature",void 0)});var X=l(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});var gt=(v(),g(A));gt.__exportStar(rC(),st);gt.__exportStar(os(),st);gt.__exportStar(Gg(),st);gt.__exportStar(_C(),st);gt.__exportStar(bC(),st);gt.__exportStar(_p(),st);gt.__exportStar(Fn(),st);gt.__exportStar(bu(),st);gt.__exportStar(Mo(),st);gt.__exportStar(Ce(),st);gt.__exportStar(Xg(),st);gt.__exportStar(oA(),st);gt.__exportStar(nA(),st);gt.__exportStar(dp(),st);gt.__exportStar(iA(),st);gt.__exportStar(eA(),st)});var Uu=l(uA=>{"use strict";Object.defineProperty(uA,"__esModule",{value:!0});uA.getCertificateInfo=ej;var SC=S(),cA=X(),wC={"2.5.4.6":"C","2.5.4.10":"O","2.5.4.11":"OU","2.5.4.3":"CN"};function ej(t){let e=SC.AsnParser.parse(t,cA.Certificate),r=e.tbsCertificate,i={combined:""};r.issuer.forEach(([o])=>{let a=wC[o.type];a&&(i[a]=o.value.toString())}),i.combined=CC(i);let n={combined:""};r.subject.forEach(([o])=>{let a=wC[o.type];a&&(n[a]=o.value.toString())}),n.combined=CC(n);let s=!1;if(r.extensions)for(let o of r.extensions)o.extnID===cA.id_ce_basicConstraints&&(s=SC.AsnParser.parse(o.extnValue,cA.BasicConstraints).cA);return{issuer:i,subject:n,version:r.version,basicConstraintsCA:s,notBefore:r.validity.notBefore.getTime(),notAfter:r.validity.notAfter.getTime(),parsedCertificate:e}}function CC(t){let e=[];return t.C&&e.push(t.C),t.O&&e.push(t.O),t.OU&&e.push(t.OU),t.CN&&e.push(t.CN),e.join(" : ")}});var EC=l(()=>{var PC;(function(t){(function(e){var r=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),i=n(t);typeof r.Reflect<"u"&&(i=n(r.Reflect,i)),e(i,r),typeof r.Reflect>"u"&&(r.Reflect=t);function n(c,u){return function(f,d){Object.defineProperty(c,f,{configurable:!0,writable:!0,value:d}),u&&u(f,d)}}function s(){try{return Function("return this;")()}catch{}}function o(){try{return(0,eval)("(function() { return this; })()")}catch{}}function a(){return s()||o()}})(function(e,r){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,u=!a&&!c,f={create:a?function(){return Z_(Object.create(null))}:c?function(){return Z_({__proto__:null})}:function(){return Z_({})},has:u?function(_,h){return i.call(_,h)}:function(_,h){return h in _},get:u?function(_,h){return i.call(_,h)?_[h]:void 0}:function(_,h){return _[h]}},d=Object.getPrototypeOf(Function),y=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:jx(),m=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Mx(),x=typeof WeakMap=="function"?WeakMap:Nx(),T=n?Symbol.for("@reflect-metadata:registry"):void 0,I=Ix(),U=Bx(I);function ee(_,h,w,k){if(F(w)){if(!Ab(_))throw new TypeError;if(!vb(h))throw new TypeError;return Sr(_,h)}else{if(!Ab(_))throw new TypeError;if(!J(h))throw new TypeError;if(!J(k)&&!F(k)&&!$r(k))throw new TypeError;return $r(k)&&(k=void 0),w=zr(w),zi(_,h,w,k)}}e("decorate",ee);function pe(_,h){function w(k,H){if(!J(k))throw new TypeError;if(!F(H)&&!xx(H))throw new TypeError;Wr(_,h,k,H)}return w}e("metadata",pe);function Ae(_,h,w,k){if(!J(w))throw new TypeError;return F(k)||(k=zr(k)),Wr(_,h,w,k)}e("defineMetadata",Ae);function oe(_,h,w){if(!J(h))throw new TypeError;return F(w)||(w=zr(w)),Ye(_,h,w)}e("hasMetadata",oe);function ze(_,h,w){if(!J(h))throw new TypeError;return F(w)||(w=zr(w)),pt(_,h,w)}e("hasOwnMetadata",ze);function it(_,h,w){if(!J(h))throw new TypeError;return F(w)||(w=zr(w)),yt(_,h,w)}e("getMetadata",it);function ut(_,h,w){if(!J(h))throw new TypeError;return F(w)||(w=zr(w)),Nn(_,h,w)}e("getOwnMetadata",ut);function lt(_,h){if(!J(_))throw new TypeError;return F(h)||(h=zr(h)),Ci(_,h)}e("getMetadataKeys",lt);function br(_,h){if(!J(_))throw new TypeError;return F(h)||(h=zr(h)),Pi(_,h)}e("getOwnMetadataKeys",br);function ir(_,h,w){if(!J(h))throw new TypeError;if(F(w)||(w=zr(w)),!J(h))throw new TypeError;F(w)||(w=zr(w));var k=bc(h,w,!1);return F(k)?!1:k.OrdinaryDeleteMetadata(_,h,w)}e("deleteMetadata",ir);function Sr(_,h){for(var w=_.length-1;w>=0;--w){var k=_[w],H=k(h);if(!F(H)&&!$r(H)){if(!vb(H))throw new TypeError;h=H}}return h}function zi(_,h,w,k){for(var H=_.length-1;H>=0;--H){var Le=_[H],Je=Le(h,w,k);if(!F(Je)&&!$r(Je)){if(!J(Je))throw new TypeError;k=Je}}return k}function Ye(_,h,w){var k=pt(_,h,w);if(k)return!0;var H=X_(h);return $r(H)?!1:Ye(_,H,w)}function pt(_,h,w){var k=bc(h,w,!1);return F(k)?!1:Ji(k.OrdinaryHasOwnMetadata(_,h,w))}function yt(_,h,w){var k=pt(_,h,w);if(k)return Nn(_,h,w);var H=X_(h);if(!$r(H))return yt(_,H,w)}function Nn(_,h,w){var k=bc(h,w,!1);if(!F(k))return k.OrdinaryGetOwnMetadata(_,h,w)}function Wr(_,h,w,k){var H=bc(w,k,!0);H.OrdinaryDefineOwnMetadata(_,h,w,k)}function Ci(_,h){var w=Pi(_,h),k=X_(_);if(k===null)return w;var H=Ci(k,h);if(H.length<=0)return w;if(w.length<=0)return H;for(var Le=new m,Je=[],te=0,M=w;te<M.length;te++){var D=M[te],V=Le.has(D);V||(Le.add(D),Je.push(D))}for(var G=0,ie=H;G<ie.length;G++){var D=ie[G],V=Le.has(D);V||(Le.add(D),Je.push(D))}return Je}function Pi(_,h){var w=bc(_,h,!1);return w?w.OrdinaryOwnMetadataKeys(_,h):[]}function Kt(_){if(_===null)return 1;switch(typeof _){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return _===null?1:6;default:return 6}}function F(_){return _===void 0}function $r(_){return _===null}function po(_){return typeof _=="symbol"}function J(_){return typeof _=="object"?_!==null:typeof _=="function"}function Vt(_,h){switch(Kt(_)){case 0:return _;case 1:return _;case 2:return _;case 3:return _;case 4:return _;case 5:return _}var w=h===3?"string":h===5?"number":"default",k=mb(_,s);if(k!==void 0){var H=k.call(_,w);if(J(H))throw new TypeError;return H}return Yi(_,w==="default"?"number":w)}function Yi(_,h){if(h==="string"){var w=_.toString;if(yo(w)){var k=w.call(_);if(!J(k))return k}var H=_.valueOf;if(yo(H)){var k=H.call(_);if(!J(k))return k}}else{var H=_.valueOf;if(yo(H)){var k=H.call(_);if(!J(k))return k}var Le=_.toString;if(yo(Le)){var k=Le.call(_);if(!J(k))return k}}throw new TypeError}function Ji(_){return!!_}function qn(_){return""+_}function zr(_){var h=Vt(_,3);return po(h)?h:qn(h)}function Ab(_){return Array.isArray?Array.isArray(_):_ instanceof Object?_ instanceof Array:Object.prototype.toString.call(_)==="[object Array]"}function yo(_){return typeof _=="function"}function vb(_){return typeof _=="function"}function xx(_){switch(Kt(_)){case 3:return!0;case 4:return!0;default:return!1}}function Q_(_,h){return _===h||_!==_&&h!==h}function mb(_,h){var w=_[h];if(w!=null){if(!yo(w))throw new TypeError;return w}}function bb(_){var h=mb(_,o);if(!yo(h))throw new TypeError;var w=h.call(_);if(!J(w))throw new TypeError;return w}function Sb(_){return _.value}function wb(_){var h=_.next();return h.done?!1:h}function Cb(_){var h=_.return;h&&h.call(_)}function X_(_){var h=Object.getPrototypeOf(_);if(typeof _!="function"||_===d||h!==d)return h;var w=_.prototype,k=w&&Object.getPrototypeOf(w);if(k==null||k===Object.prototype)return h;var H=k.constructor;return typeof H!="function"||H===_?h:H}function Ox(){var _;!F(T)&&typeof r.Reflect<"u"&&!(T in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(_=kx(r.Reflect));var h,w,k,H=new x,Le={registerProvider:Je,getProvider:M,setProvider:V};return Le;function Je(G){if(!Object.isExtensible(Le))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case _===G:break;case F(h):h=G;break;case h===G:break;case F(w):w=G;break;case w===G:break;default:k===void 0&&(k=new m),k.add(G);break}}function te(G,ie){if(!F(h)){if(h.isProviderFor(G,ie))return h;if(!F(w)){if(w.isProviderFor(G,ie))return h;if(!F(k))for(var Pe=bb(k);;){var Ke=wb(Pe);if(!Ke)return;var wr=Sb(Ke);if(wr.isProviderFor(G,ie))return Cb(Pe),wr}}}if(!F(_)&&_.isProviderFor(G,ie))return _}function M(G,ie){var Pe=H.get(G),Ke;return F(Pe)||(Ke=Pe.get(ie)),F(Ke)&&(Ke=te(G,ie),F(Ke)||(F(Pe)&&(Pe=new y,H.set(G,Pe)),Pe.set(ie,Ke))),Ke}function D(G){if(F(G))throw new TypeError;return h===G||w===G||!F(k)&&k.has(G)}function V(G,ie,Pe){if(!D(Pe))throw new Error("Metadata provider not registered.");var Ke=M(G,ie);if(Ke!==Pe){if(!F(Ke))return!1;var wr=H.get(G);F(wr)&&(wr=new y,H.set(G,wr)),wr.set(ie,Pe)}return!0}}function Ix(){var _;return!F(T)&&J(r.Reflect)&&Object.isExtensible(r.Reflect)&&(_=r.Reflect[T]),F(_)&&(_=Ox()),!F(T)&&J(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,T,{enumerable:!1,configurable:!1,writable:!1,value:_}),_}function Bx(_){var h=new x,w={isProviderFor:function(D,V){var G=h.get(D);return F(G)?!1:G.has(V)},OrdinaryDefineOwnMetadata:Je,OrdinaryHasOwnMetadata:H,OrdinaryGetOwnMetadata:Le,OrdinaryOwnMetadataKeys:te,OrdinaryDeleteMetadata:M};return I.registerProvider(w),w;function k(D,V,G){var ie=h.get(D),Pe=!1;if(F(ie)){if(!G)return;ie=new y,h.set(D,ie),Pe=!0}var Ke=ie.get(V);if(F(Ke)){if(!G)return;if(Ke=new y,ie.set(V,Ke),!_.setProvider(D,V,w))throw ie.delete(V),Pe&&h.delete(D),new Error("Wrong provider for target.")}return Ke}function H(D,V,G){var ie=k(V,G,!1);return F(ie)?!1:Ji(ie.has(D))}function Le(D,V,G){var ie=k(V,G,!1);if(!F(ie))return ie.get(D)}function Je(D,V,G,ie){var Pe=k(G,ie,!0);Pe.set(D,V)}function te(D,V){var G=[],ie=k(D,V,!1);if(F(ie))return G;for(var Pe=ie.keys(),Ke=bb(Pe),wr=0;;){var Pb=wb(Ke);if(!Pb)return G.length=wr,G;var qx=Sb(Pb);try{G[wr]=qx}catch(Rx){try{Cb(Ke)}finally{throw Rx}}wr++}}function M(D,V,G){var ie=k(V,G,!1);if(F(ie)||!ie.delete(D))return!1;if(ie.size===0){var Pe=h.get(V);F(Pe)||(Pe.delete(G),Pe.size===0&&h.delete(Pe))}return!0}}function kx(_){var h=_.defineMetadata,w=_.hasOwnMetadata,k=_.getOwnMetadata,H=_.getOwnMetadataKeys,Le=_.deleteMetadata,Je=new x,te={isProviderFor:function(M,D){var V=Je.get(M);return!F(V)&&V.has(D)?!0:H(M,D).length?(F(V)&&(V=new m,Je.set(M,V)),V.add(D),!0):!1},OrdinaryDefineOwnMetadata:h,OrdinaryHasOwnMetadata:w,OrdinaryGetOwnMetadata:k,OrdinaryOwnMetadataKeys:H,OrdinaryDeleteMetadata:Le};return te}function bc(_,h,w){var k=I.getProvider(_,h);if(!F(k))return k;if(w){if(I.setProvider(_,h,U))return U;throw new Error("Illegal state.")}}function jx(){var _={},h=[],w=(function(){function te(M,D,V){this._index=0,this._keys=M,this._values=D,this._selector=V}return te.prototype["@@iterator"]=function(){return this},te.prototype[o]=function(){return this},te.prototype.next=function(){var M=this._index;if(M>=0&&M<this._keys.length){var D=this._selector(this._keys[M],this._values[M]);return M+1>=this._keys.length?(this._index=-1,this._keys=h,this._values=h):this._index++,{value:D,done:!1}}return{value:void 0,done:!0}},te.prototype.throw=function(M){throw this._index>=0&&(this._index=-1,this._keys=h,this._values=h),M},te.prototype.return=function(M){return this._index>=0&&(this._index=-1,this._keys=h,this._values=h),{value:M,done:!0}},te})(),k=(function(){function te(){this._keys=[],this._values=[],this._cacheKey=_,this._cacheIndex=-2}return Object.defineProperty(te.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),te.prototype.has=function(M){return this._find(M,!1)>=0},te.prototype.get=function(M){var D=this._find(M,!1);return D>=0?this._values[D]:void 0},te.prototype.set=function(M,D){var V=this._find(M,!0);return this._values[V]=D,this},te.prototype.delete=function(M){var D=this._find(M,!1);if(D>=0){for(var V=this._keys.length,G=D+1;G<V;G++)this._keys[G-1]=this._keys[G],this._values[G-1]=this._values[G];return this._keys.length--,this._values.length--,Q_(M,this._cacheKey)&&(this._cacheKey=_,this._cacheIndex=-2),!0}return!1},te.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=_,this._cacheIndex=-2},te.prototype.keys=function(){return new w(this._keys,this._values,H)},te.prototype.values=function(){return new w(this._keys,this._values,Le)},te.prototype.entries=function(){return new w(this._keys,this._values,Je)},te.prototype["@@iterator"]=function(){return this.entries()},te.prototype[o]=function(){return this.entries()},te.prototype._find=function(M,D){if(!Q_(this._cacheKey,M)){this._cacheIndex=-1;for(var V=0;V<this._keys.length;V++)if(Q_(this._keys[V],M)){this._cacheIndex=V;break}}return this._cacheIndex<0&&D&&(this._cacheIndex=this._keys.length,this._keys.push(M),this._values.push(void 0)),this._cacheIndex},te})();return k;function H(te,M){return te}function Le(te,M){return M}function Je(te,M){return[te,M]}}function Mx(){var _=(function(){function h(){this._map=new y}return Object.defineProperty(h.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),h.prototype.has=function(w){return this._map.has(w)},h.prototype.add=function(w){return this._map.set(w,w),this},h.prototype.delete=function(w){return this._map.delete(w)},h.prototype.clear=function(){this._map.clear()},h.prototype.keys=function(){return this._map.keys()},h.prototype.values=function(){return this._map.keys()},h.prototype.entries=function(){return this._map.entries()},h.prototype["@@iterator"]=function(){return this.keys()},h.prototype[o]=function(){return this.keys()},h})();return _}function Nx(){var _=16,h=f.create(),w=k();return(function(){function M(){this._key=k()}return M.prototype.has=function(D){var V=H(D,!1);return V!==void 0?f.has(V,this._key):!1},M.prototype.get=function(D){var V=H(D,!1);return V!==void 0?f.get(V,this._key):void 0},M.prototype.set=function(D,V){var G=H(D,!0);return G[this._key]=V,this},M.prototype.delete=function(D){var V=H(D,!1);return V!==void 0?delete V[this._key]:!1},M.prototype.clear=function(){this._key=k()},M})();function k(){var M;do M="@@WeakMap@@"+te();while(f.has(h,M));return h[M]=!0,M}function H(M,D){if(!i.call(M,w)){if(!D)return;Object.defineProperty(M,w,{value:f.create()})}return M[w]}function Le(M,D){for(var V=0;V<D;++V)M[V]=Math.random()*255|0;return M}function Je(M){if(typeof Uint8Array=="function"){var D=new Uint8Array(M);return typeof crypto<"u"?crypto.getRandomValues(D):typeof msCrypto<"u"?msCrypto.getRandomValues(D):Le(D,M),D}return Le(new Array(M),M)}function te(){var M=Je(_);M[6]=M[6]&79|64,M[8]=M[8]&191|128;for(var D="",V=0;V<_;++V){var G=M[V];(V===4||V===6||V===8)&&(D+="-"),G<16&&(D+="0"),D+=G.toString(16).toLowerCase()}return D}}function Z_(_){return _.__=void 0,delete _.__,_}})})(PC||(PC={}))});var Ku=l(Cp=>{"use strict";Object.defineProperty(Cp,"__esModule",{value:!0});Cp.IssuerAndSerialNumber=void 0;var TC=(v(),g(A)),wp=S(),xC=X(),Lu=class{issuer=new xC.Name;serialNumber=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Cp.IssuerAndSerialNumber=Lu;TC.__decorate([(0,wp.AsnProp)({type:xC.Name})],Lu.prototype,"issuer",void 0);TC.__decorate([(0,wp.AsnProp)({type:wp.AsnPropTypes.Integer,converter:wp.AsnIntegerArrayBufferConverter})],Lu.prototype,"serialNumber",void 0)});var fA=l(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.SignerIdentifier=void 0;var lA=(v(),g(A)),Pp=S(),tj=X(),rj=Ku(),Vu=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};Gu.SignerIdentifier=Vu;lA.__decorate([(0,Pp.AsnProp)({type:tj.SubjectKeyIdentifier,context:0,implicit:!0})],Vu.prototype,"subjectKeyIdentifier",void 0);lA.__decorate([(0,Pp.AsnProp)({type:rj.IssuerAndSerialNumber})],Vu.prototype,"issuerAndSerialNumber",void 0);Gu.SignerIdentifier=Vu=lA.__decorate([(0,Pp.AsnType)({type:Pp.AsnTypeTypes.Choice})],Vu)});var fi=l(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.KeyDerivationAlgorithmIdentifier=De.MessageAuthenticationCodeAlgorithm=De.ContentEncryptionAlgorithmIdentifier=De.KeyEncryptionAlgorithmIdentifier=De.SignatureAlgorithmIdentifier=De.DigestAlgorithmIdentifier=De.CMSVersion=void 0;var oa=(v(),g(A)),aa=X(),fr=S(),OC;(function(t){t[t.v0=0]="v0",t[t.v1=1]="v1",t[t.v2=2]="v2",t[t.v3=3]="v3",t[t.v4=4]="v4",t[t.v5=5]="v5"})(OC||(De.CMSVersion=OC={}));var dA=class extends aa.AlgorithmIdentifier{};De.DigestAlgorithmIdentifier=dA;De.DigestAlgorithmIdentifier=dA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],dA);var pA=class extends aa.AlgorithmIdentifier{};De.SignatureAlgorithmIdentifier=pA;De.SignatureAlgorithmIdentifier=pA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],pA);var yA=class extends aa.AlgorithmIdentifier{};De.KeyEncryptionAlgorithmIdentifier=yA;De.KeyEncryptionAlgorithmIdentifier=yA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],yA);var _A=class extends aa.AlgorithmIdentifier{};De.ContentEncryptionAlgorithmIdentifier=_A;De.ContentEncryptionAlgorithmIdentifier=_A=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],_A);var hA=class extends aa.AlgorithmIdentifier{};De.MessageAuthenticationCodeAlgorithm=hA;De.MessageAuthenticationCodeAlgorithm=hA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],hA);var gA=class extends aa.AlgorithmIdentifier{};De.KeyDerivationAlgorithmIdentifier=gA;De.KeyDerivationAlgorithmIdentifier=gA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],gA)});var xp=l(Tp=>{"use strict";Object.defineProperty(Tp,"__esModule",{value:!0});Tp.Attribute=void 0;var IC=(v(),g(A)),Ep=S(),Fu=class{attrType="";attrValues=[];constructor(e={}){Object.assign(this,e)}};Tp.Attribute=Fu;IC.__decorate([(0,Ep.AsnProp)({type:Ep.AsnPropTypes.ObjectIdentifier})],Fu.prototype,"attrType",void 0);IC.__decorate([(0,Ep.AsnProp)({type:Ep.AsnPropTypes.Any,repeated:"set"})],Fu.prototype,"attrValues",void 0)});var Op=l(us=>{"use strict";var AA;Object.defineProperty(us,"__esModule",{value:!0});us.SignerInfos=us.SignerInfo=void 0;var cn=(v(),g(A)),Yt=S(),BC=fA(),Hu=fi(),kC=xp(),kr=class{version=Hu.CMSVersion.v0;sid=new BC.SignerIdentifier;digestAlgorithm=new Hu.DigestAlgorithmIdentifier;signedAttrs;signedAttrsRaw;signatureAlgorithm=new Hu.SignatureAlgorithmIdentifier;signature=new Yt.OctetString;unsignedAttrs;constructor(e={}){Object.assign(this,e)}};us.SignerInfo=kr;cn.__decorate([(0,Yt.AsnProp)({type:Yt.AsnPropTypes.Integer})],kr.prototype,"version",void 0);cn.__decorate([(0,Yt.AsnProp)({type:BC.SignerIdentifier})],kr.prototype,"sid",void 0);cn.__decorate([(0,Yt.AsnProp)({type:Hu.DigestAlgorithmIdentifier})],kr.prototype,"digestAlgorithm",void 0);cn.__decorate([(0,Yt.AsnProp)({type:kC.Attribute,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],kr.prototype,"signedAttrs",void 0);cn.__decorate([(0,Yt.AsnProp)({type:Hu.SignatureAlgorithmIdentifier})],kr.prototype,"signatureAlgorithm",void 0);cn.__decorate([(0,Yt.AsnProp)({type:Yt.OctetString})],kr.prototype,"signature",void 0);cn.__decorate([(0,Yt.AsnProp)({type:kC.Attribute,repeated:"set",context:1,implicit:!0,optional:!0})],kr.prototype,"unsignedAttrs",void 0);var vA=AA=class extends Yt.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,AA.prototype)}};us.SignerInfos=vA;us.SignerInfos=vA=AA=cn.__decorate([(0,Yt.AsnType)({type:Yt.AsnTypeTypes.Set,itemType:kr})],vA)});var MC=l(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.CounterSignature=ls.id_counterSignature=void 0;var ij=(v(),g(A)),jC=S(),nj=Op();ls.id_counterSignature="1.2.840.113549.1.9.6";var mA=class extends nj.SignerInfo{};ls.CounterSignature=mA;ls.CounterSignature=mA=ij.__decorate([(0,jC.AsnType)({type:jC.AsnTypeTypes.Sequence})],mA)});var NC=l(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.MessageDigest=ca.id_messageDigest=void 0;var sj=S();ca.id_messageDigest="1.2.840.113549.1.9.4";var bA=class extends sj.OctetString{};ca.MessageDigest=bA});var RC=l(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.SigningTime=fs.id_signingTime=void 0;var oj=(v(),g(A)),aj=X(),qC=S();fs.id_signingTime="1.2.840.113549.1.9.5";var SA=class extends aj.Time{};fs.SigningTime=SA;fs.SigningTime=SA=oj.__decorate([(0,qC.AsnType)({type:qC.AsnTypeTypes.Choice})],SA)});var DC=l(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.id_contentType=void 0;var wA=(v(),g(A));wA.__exportStar(MC(),ds);wA.__exportStar(NC(),ds);wA.__exportStar(RC(),ds);ds.id_contentType="1.2.840.113549.1.9.3"});var UC=l(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.ACClearAttrs=void 0;var CA=(v(),g(A)),Ip=S(),PA=X(),ua=class{acIssuer=new PA.GeneralName;acSerial=0;attrs=[];constructor(e={}){Object.assign(this,e)}};Bp.ACClearAttrs=ua;CA.__decorate([(0,Ip.AsnProp)({type:PA.GeneralName})],ua.prototype,"acIssuer",void 0);CA.__decorate([(0,Ip.AsnProp)({type:Ip.AsnPropTypes.Integer})],ua.prototype,"acSerial",void 0);CA.__decorate([(0,Ip.AsnProp)({type:PA.Attribute,repeated:"sequence"})],ua.prototype,"attrs",void 0)});var xA=l(Wu=>{"use strict";var EA;Object.defineProperty(Wu,"__esModule",{value:!0});Wu.AttrSpec=void 0;var cj=(v(),g(A)),kp=S(),TA=EA=class extends kp.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,EA.prototype)}};Wu.AttrSpec=TA;Wu.AttrSpec=TA=EA=cj.__decorate([(0,kp.AsnType)({type:kp.AsnTypeTypes.Sequence,itemType:kp.AsnPropTypes.ObjectIdentifier})],TA)});var KC=l(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.AAControls=void 0;var jp=(v(),g(A)),la=S(),LC=xA(),ps=class{pathLenConstraint;permittedAttrs;excludedAttrs;permitUnSpecified=!0;constructor(e={}){Object.assign(this,e)}};Mp.AAControls=ps;jp.__decorate([(0,la.AsnProp)({type:la.AsnPropTypes.Integer,optional:!0})],ps.prototype,"pathLenConstraint",void 0);jp.__decorate([(0,la.AsnProp)({type:LC.AttrSpec,implicit:!0,context:0,optional:!0})],ps.prototype,"permittedAttrs",void 0);jp.__decorate([(0,la.AsnProp)({type:LC.AttrSpec,implicit:!0,context:1,optional:!0})],ps.prototype,"excludedAttrs",void 0);jp.__decorate([(0,la.AsnProp)({type:la.AsnPropTypes.Boolean,defaultValue:!0})],ps.prototype,"permitUnSpecified",void 0)});var $u=l(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.IssuerSerial=void 0;var OA=(v(),g(A)),fa=S(),VC=X(),da=class{issuer=new VC.GeneralNames;serial=new ArrayBuffer(0);issuerUID=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Np.IssuerSerial=da;OA.__decorate([(0,fa.AsnProp)({type:VC.GeneralNames})],da.prototype,"issuer",void 0);OA.__decorate([(0,fa.AsnProp)({type:fa.AsnPropTypes.Integer,converter:fa.AsnIntegerArrayBufferConverter})],da.prototype,"serial",void 0);OA.__decorate([(0,fa.AsnProp)({type:fa.AsnPropTypes.BitString,optional:!0})],da.prototype,"issuerUID",void 0)});var zu=l(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.ObjectDigestInfo=pa.DigestedObjectType=void 0;var qp=(v(),g(A)),ys=S(),GC=X(),IA;(function(t){t[t.publicKey=0]="publicKey",t[t.publicKeyCert=1]="publicKeyCert",t[t.otherObjectTypes=2]="otherObjectTypes"})(IA||(pa.DigestedObjectType=IA={}));var _s=class{digestedObjectType=IA.publicKey;otherObjectTypeID;digestAlgorithm=new GC.AlgorithmIdentifier;objectDigest=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};pa.ObjectDigestInfo=_s;qp.__decorate([(0,ys.AsnProp)({type:ys.AsnPropTypes.Enumerated})],_s.prototype,"digestedObjectType",void 0);qp.__decorate([(0,ys.AsnProp)({type:ys.AsnPropTypes.ObjectIdentifier,optional:!0})],_s.prototype,"otherObjectTypeID",void 0);qp.__decorate([(0,ys.AsnProp)({type:GC.AlgorithmIdentifier})],_s.prototype,"digestAlgorithm",void 0);qp.__decorate([(0,ys.AsnProp)({type:ys.AsnPropTypes.BitString})],_s.prototype,"objectDigest",void 0)});var jA=l(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.V2Form=void 0;var BA=(v(),g(A)),kA=S(),uj=X(),lj=$u(),fj=zu(),ya=class{issuerName;baseCertificateID;objectDigestInfo;constructor(e={}){Object.assign(this,e)}};Rp.V2Form=ya;BA.__decorate([(0,kA.AsnProp)({type:uj.GeneralNames,optional:!0})],ya.prototype,"issuerName",void 0);BA.__decorate([(0,kA.AsnProp)({type:lj.IssuerSerial,context:0,implicit:!0,optional:!0})],ya.prototype,"baseCertificateID",void 0);BA.__decorate([(0,kA.AsnProp)({type:fj.ObjectDigestInfo,context:1,implicit:!0,optional:!0})],ya.prototype,"objectDigestInfo",void 0)});var NA=l(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.AttCertIssuer=void 0;var MA=(v(),g(A)),Dp=S(),dj=X(),pj=jA(),Yu=class{v1Form;v2Form;constructor(e={}){Object.assign(this,e)}};Ju.AttCertIssuer=Yu;MA.__decorate([(0,Dp.AsnProp)({type:dj.GeneralName,repeated:"sequence"})],Yu.prototype,"v1Form",void 0);MA.__decorate([(0,Dp.AsnProp)({type:pj.V2Form,context:0,implicit:!0})],Yu.prototype,"v2Form",void 0);Ju.AttCertIssuer=Yu=MA.__decorate([(0,Dp.AsnType)({type:Dp.AsnTypeTypes.Choice})],Yu)});var qA=l(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.AttCertValidityPeriod=void 0;var FC=(v(),g(A)),Up=S(),Qu=class{notBeforeTime=new Date;notAfterTime=new Date;constructor(e={}){Object.assign(this,e)}};Lp.AttCertValidityPeriod=Qu;FC.__decorate([(0,Up.AsnProp)({type:Up.AsnPropTypes.GeneralizedTime})],Qu.prototype,"notBeforeTime",void 0);FC.__decorate([(0,Up.AsnProp)({type:Up.AsnPropTypes.GeneralizedTime})],Qu.prototype,"notAfterTime",void 0)});var UA=l(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.Holder=void 0;var RA=(v(),g(A)),DA=S(),yj=X(),_j=$u(),hj=zu(),_a=class{baseCertificateID;entityName;objectDigestInfo;constructor(e={}){Object.assign(this,e)}};Kp.Holder=_a;RA.__decorate([(0,DA.AsnProp)({type:_j.IssuerSerial,implicit:!0,context:0,optional:!0})],_a.prototype,"baseCertificateID",void 0);RA.__decorate([(0,DA.AsnProp)({type:yj.GeneralNames,implicit:!0,context:1,optional:!0})],_a.prototype,"entityName",void 0);RA.__decorate([(0,DA.AsnProp)({type:hj.ObjectDigestInfo,implicit:!0,context:2,optional:!0})],_a.prototype,"objectDigestInfo",void 0)});var KA=l(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.AttributeCertificateInfo=ha.AttCertVersion=void 0;var qi=(v(),g(A)),Jt=S(),Vp=X(),HC=UA(),WC=NA(),$C=qA(),LA;(function(t){t[t.v2=1]="v2"})(LA||(ha.AttCertVersion=LA={}));var dr=class{version=LA.v2;holder=new HC.Holder;issuer=new WC.AttCertIssuer;signature=new Vp.AlgorithmIdentifier;serialNumber=new ArrayBuffer(0);attrCertValidityPeriod=new $C.AttCertValidityPeriod;attributes=[];issuerUniqueID;extensions;constructor(e={}){Object.assign(this,e)}};ha.AttributeCertificateInfo=dr;qi.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.Integer})],dr.prototype,"version",void 0);qi.__decorate([(0,Jt.AsnProp)({type:HC.Holder})],dr.prototype,"holder",void 0);qi.__decorate([(0,Jt.AsnProp)({type:WC.AttCertIssuer})],dr.prototype,"issuer",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Vp.AlgorithmIdentifier})],dr.prototype,"signature",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.Integer,converter:Jt.AsnIntegerArrayBufferConverter})],dr.prototype,"serialNumber",void 0);qi.__decorate([(0,Jt.AsnProp)({type:$C.AttCertValidityPeriod})],dr.prototype,"attrCertValidityPeriod",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Vp.Attribute,repeated:"sequence"})],dr.prototype,"attributes",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.BitString,optional:!0})],dr.prototype,"issuerUniqueID",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Vp.Extensions,optional:!0})],dr.prototype,"extensions",void 0)});var JC=l(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.AttributeCertificate=void 0;var VA=(v(),g(A)),Gp=S(),zC=X(),YC=KA(),ga=class{acinfo=new YC.AttributeCertificateInfo;signatureAlgorithm=new zC.AlgorithmIdentifier;signatureValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Fp.AttributeCertificate=ga;VA.__decorate([(0,Gp.AsnProp)({type:YC.AttributeCertificateInfo})],ga.prototype,"acinfo",void 0);VA.__decorate([(0,Gp.AsnProp)({type:zC.AlgorithmIdentifier})],ga.prototype,"signatureAlgorithm",void 0);VA.__decorate([(0,Gp.AsnProp)({type:Gp.AsnPropTypes.BitString})],ga.prototype,"signatureValue",void 0)});var FA=l(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.ClassList=Aa.ClassListFlags=void 0;var gj=S(),QC;(function(t){t[t.unmarked=1]="unmarked",t[t.unclassified=2]="unclassified",t[t.restricted=4]="restricted",t[t.confidential=8]="confidential",t[t.secret=16]="secret",t[t.topSecret=32]="topSecret"})(QC||(Aa.ClassListFlags=QC={}));var GA=class extends gj.BitString{};Aa.ClassList=GA});var HA=l(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});Wp.SecurityCategory=void 0;var XC=(v(),g(A)),Hp=S(),Xu=class{type="";value=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Wp.SecurityCategory=Xu;XC.__decorate([(0,Hp.AsnProp)({type:Hp.AsnPropTypes.ObjectIdentifier,implicit:!0,context:0})],Xu.prototype,"type",void 0);XC.__decorate([(0,Hp.AsnProp)({type:Hp.AsnPropTypes.Any,implicit:!0,context:1})],Xu.prototype,"value",void 0)});var ZC=l(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.Clearance=void 0;var WA=(v(),g(A)),$p=S(),Zu=FA(),Aj=HA(),va=class{policyId="";classList=new Zu.ClassList(Zu.ClassListFlags.unclassified);securityCategories;constructor(e={}){Object.assign(this,e)}};zp.Clearance=va;WA.__decorate([(0,$p.AsnProp)({type:$p.AsnPropTypes.ObjectIdentifier})],va.prototype,"policyId",void 0);WA.__decorate([(0,$p.AsnProp)({type:Zu.ClassList,defaultValue:new Zu.ClassList(Zu.ClassListFlags.unclassified)})],va.prototype,"classList",void 0);WA.__decorate([(0,$p.AsnProp)({type:Aj.SecurityCategory,repeated:"set"})],va.prototype,"securityCategories",void 0)});var eP=l(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.IetfAttrSyntax=ma.IetfAttrSyntaxValueChoices=void 0;var tl=(v(),g(A)),un=S(),vj=X(),hs=class{cotets;oid;string;constructor(e={}){Object.assign(this,e)}};ma.IetfAttrSyntaxValueChoices=hs;tl.__decorate([(0,un.AsnProp)({type:un.OctetString})],hs.prototype,"cotets",void 0);tl.__decorate([(0,un.AsnProp)({type:un.AsnPropTypes.ObjectIdentifier})],hs.prototype,"oid",void 0);tl.__decorate([(0,un.AsnProp)({type:un.AsnPropTypes.Utf8String})],hs.prototype,"string",void 0);var el=class{policyAuthority;values=[];constructor(e={}){Object.assign(this,e)}};ma.IetfAttrSyntax=el;tl.__decorate([(0,un.AsnProp)({type:vj.GeneralNames,implicit:!0,context:0,optional:!0})],el.prototype,"policyAuthority",void 0);tl.__decorate([(0,un.AsnProp)({type:hs,repeated:"sequence"})],el.prototype,"values",void 0)});var tP=l(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.id_at_clearance=ce.id_at_role=ce.id_at=ce.id_aca_encAttrs=ce.id_aca_group=ce.id_aca_chargingIdentity=ce.id_aca_accessIdentity=ce.id_aca_authenticationInfo=ce.id_aca=ce.id_ce_targetInformation=ce.id_pe_ac_proxying=ce.id_pe_aaControls=ce.id_pe_ac_auditIdentity=void 0;var rl=X();ce.id_pe_ac_auditIdentity=`${rl.id_pe}.4`;ce.id_pe_aaControls=`${rl.id_pe}.6`;ce.id_pe_ac_proxying=`${rl.id_pe}.10`;ce.id_ce_targetInformation=`${rl.id_ce}.55`;ce.id_aca=`${rl.id_pkix}.10`;ce.id_aca_authenticationInfo=`${ce.id_aca}.1`;ce.id_aca_accessIdentity=`${ce.id_aca}.2`;ce.id_aca_chargingIdentity=`${ce.id_aca}.3`;ce.id_aca_group=`${ce.id_aca}.4`;ce.id_aca_encAttrs=`${ce.id_aca}.6`;ce.id_at="2.5.4";ce.id_at_role=`${ce.id_at}.72`;ce.id_at_clearance="2.5.1.5.55"});var JA=l(di=>{"use strict";var $A;Object.defineProperty(di,"__esModule",{value:!0});di.Targets=di.Target=di.TargetCert=void 0;var ln=(v(),g(A)),jr=S(),YA=X(),rP=$u(),mj=zu(),gs=class{targetCertificate=new rP.IssuerSerial;targetName;certDigestInfo;constructor(e={}){Object.assign(this,e)}};di.TargetCert=gs;ln.__decorate([(0,jr.AsnProp)({type:rP.IssuerSerial})],gs.prototype,"targetCertificate",void 0);ln.__decorate([(0,jr.AsnProp)({type:YA.GeneralName,optional:!0})],gs.prototype,"targetName",void 0);ln.__decorate([(0,jr.AsnProp)({type:mj.ObjectDigestInfo,optional:!0})],gs.prototype,"certDigestInfo",void 0);var As=class{targetName;targetGroup;targetCert;constructor(e={}){Object.assign(this,e)}};di.Target=As;ln.__decorate([(0,jr.AsnProp)({type:YA.GeneralName,context:0,implicit:!0})],As.prototype,"targetName",void 0);ln.__decorate([(0,jr.AsnProp)({type:YA.GeneralName,context:1,implicit:!0})],As.prototype,"targetGroup",void 0);ln.__decorate([(0,jr.AsnProp)({type:gs,context:2,implicit:!0})],As.prototype,"targetCert",void 0);di.Target=As=ln.__decorate([(0,jr.AsnType)({type:jr.AsnTypeTypes.Choice})],As);var zA=$A=class extends jr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,$A.prototype)}};di.Targets=zA;di.Targets=zA=$A=ln.__decorate([(0,jr.AsnType)({type:jr.AsnTypeTypes.Sequence,itemType:As})],zA)});var iP=l(il=>{"use strict";var QA;Object.defineProperty(il,"__esModule",{value:!0});il.ProxyInfo=void 0;var bj=(v(),g(A)),XA=S(),Sj=JA(),ZA=QA=class extends XA.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,QA.prototype)}};il.ProxyInfo=ZA;il.ProxyInfo=ZA=QA=bj.__decorate([(0,XA.AsnType)({type:XA.AsnTypeTypes.Sequence,itemType:Sj.Targets})],ZA)});var aP=l(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.RoleSyntax=void 0;var nP=(v(),g(A)),sP=S(),oP=X(),nl=class{roleAuthority;roleName;constructor(e={}){Object.assign(this,e)}};Yp.RoleSyntax=nl;nP.__decorate([(0,sP.AsnProp)({type:oP.GeneralNames,implicit:!0,context:0,optional:!0})],nl.prototype,"roleAuthority",void 0);nP.__decorate([(0,sP.AsnProp)({type:oP.GeneralName,implicit:!0,context:1})],nl.prototype,"roleName",void 0)});var cP=l(Xp=>{"use strict";Object.defineProperty(Xp,"__esModule",{value:!0});Xp.SvceAuthInfo=void 0;var ev=(v(),g(A)),Jp=S(),Qp=X(),ba=class{service=new Qp.GeneralName;ident=new Qp.GeneralName;authInfo;constructor(e={}){Object.assign(this,e)}};Xp.SvceAuthInfo=ba;ev.__decorate([(0,Jp.AsnProp)({type:Qp.GeneralName})],ba.prototype,"service",void 0);ev.__decorate([(0,Jp.AsnProp)({type:Qp.GeneralName})],ba.prototype,"ident",void 0);ev.__decorate([(0,Jp.AsnProp)({type:Jp.OctetString,optional:!0})],ba.prototype,"authInfo",void 0)});var tv=l(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});var We=(v(),g(A));We.__exportStar(UC(),Ue);We.__exportStar(KC(),Ue);We.__exportStar(NA(),Ue);We.__exportStar(qA(),Ue);We.__exportStar(xA(),Ue);We.__exportStar(JC(),Ue);We.__exportStar(KA(),Ue);We.__exportStar(FA(),Ue);We.__exportStar(ZC(),Ue);We.__exportStar(UA(),Ue);We.__exportStar(eP(),Ue);We.__exportStar($u(),Ue);We.__exportStar(zu(),Ue);We.__exportStar(tP(),Ue);We.__exportStar(iP(),Ue);We.__exportStar(aP(),Ue);We.__exportStar(HA(),Ue);We.__exportStar(cP(),Ue);We.__exportStar(JA(),Ue);We.__exportStar(jA(),Ue)});var Zp=l(pi=>{"use strict";var rv;Object.defineProperty(pi,"__esModule",{value:!0});pi.CertificateSet=pi.CertificateChoices=pi.OtherCertificateFormat=void 0;var ms=(v(),g(A)),pr=S(),wj=X(),Cj=tv(),Sa=class{otherCertFormat="";otherCert=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};pi.OtherCertificateFormat=Sa;ms.__decorate([(0,pr.AsnProp)({type:pr.AsnPropTypes.ObjectIdentifier})],Sa.prototype,"otherCertFormat",void 0);ms.__decorate([(0,pr.AsnProp)({type:pr.AsnPropTypes.Any})],Sa.prototype,"otherCert",void 0);var vs=class{certificate;v2AttrCert;other;constructor(e={}){Object.assign(this,e)}};pi.CertificateChoices=vs;ms.__decorate([(0,pr.AsnProp)({type:wj.Certificate})],vs.prototype,"certificate",void 0);ms.__decorate([(0,pr.AsnProp)({type:Cj.AttributeCertificate,context:2,implicit:!0})],vs.prototype,"v2AttrCert",void 0);ms.__decorate([(0,pr.AsnProp)({type:Sa,context:3,implicit:!0})],vs.prototype,"other",void 0);pi.CertificateChoices=vs=ms.__decorate([(0,pr.AsnType)({type:pr.AsnTypeTypes.Choice})],vs);var iv=rv=class extends pr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,rv.prototype)}};pi.CertificateSet=iv;pi.CertificateSet=iv=rv=ms.__decorate([(0,pr.AsnType)({type:pr.AsnTypeTypes.Set,itemType:vs})],iv)});var lP=l(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.ContentInfo=void 0;var uP=(v(),g(A)),ey=S(),sl=class{contentType="";content=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};ty.ContentInfo=sl;uP.__decorate([(0,ey.AsnProp)({type:ey.AsnPropTypes.ObjectIdentifier})],sl.prototype,"contentType",void 0);uP.__decorate([(0,ey.AsnProp)({type:ey.AsnPropTypes.Any,context:0})],sl.prototype,"content",void 0)});var nv=l(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.EncapsulatedContentInfo=bs.EncapsulatedContent=void 0;var al=(v(),g(A)),Ri=S(),wa=class{single;any;constructor(e={}){Object.assign(this,e)}};bs.EncapsulatedContent=wa;al.__decorate([(0,Ri.AsnProp)({type:Ri.OctetString})],wa.prototype,"single",void 0);al.__decorate([(0,Ri.AsnProp)({type:Ri.AsnPropTypes.Any})],wa.prototype,"any",void 0);bs.EncapsulatedContent=wa=al.__decorate([(0,Ri.AsnType)({type:Ri.AsnTypeTypes.Choice})],wa);var ol=class{eContentType="";eContent;constructor(e={}){Object.assign(this,e)}};bs.EncapsulatedContentInfo=ol;al.__decorate([(0,Ri.AsnProp)({type:Ri.AsnPropTypes.ObjectIdentifier})],ol.prototype,"eContentType",void 0);al.__decorate([(0,Ri.AsnProp)({type:wa,context:0,optional:!0})],ol.prototype,"eContent",void 0)});var sv=l(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.EncryptedContentInfo=Ss.EncryptedContent=void 0;var Ea=(v(),g(A)),Mr=S(),fP=fi(),Ca=class{value;constructedValue;constructor(e={}){Object.assign(this,e)}};Ss.EncryptedContent=Ca;Ea.__decorate([(0,Mr.AsnProp)({type:Mr.OctetString,context:0,implicit:!0,optional:!0})],Ca.prototype,"value",void 0);Ea.__decorate([(0,Mr.AsnProp)({type:Mr.OctetString,converter:Mr.AsnConstructedOctetStringConverter,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Ca.prototype,"constructedValue",void 0);Ss.EncryptedContent=Ca=Ea.__decorate([(0,Mr.AsnType)({type:Mr.AsnTypeTypes.Choice})],Ca);var Pa=class{contentType="";contentEncryptionAlgorithm=new fP.ContentEncryptionAlgorithmIdentifier;encryptedContent;constructor(e={}){Object.assign(this,e)}};Ss.EncryptedContentInfo=Pa;Ea.__decorate([(0,Mr.AsnProp)({type:Mr.AsnPropTypes.ObjectIdentifier})],Pa.prototype,"contentType",void 0);Ea.__decorate([(0,Mr.AsnProp)({type:fP.ContentEncryptionAlgorithmIdentifier})],Pa.prototype,"contentEncryptionAlgorithm",void 0);Ea.__decorate([(0,Mr.AsnProp)({type:Ca,optional:!0})],Pa.prototype,"encryptedContent",void 0)});var ov=l(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.OtherKeyAttribute=void 0;var dP=(v(),g(A)),ry=S(),cl=class{keyAttrId="";keyAttr;constructor(e={}){Object.assign(this,e)}};iy.OtherKeyAttribute=cl;dP.__decorate([(0,ry.AsnProp)({type:ry.AsnPropTypes.ObjectIdentifier})],cl.prototype,"keyAttrId",void 0);dP.__decorate([(0,ry.AsnProp)({type:ry.AsnPropTypes.Any,optional:!0})],cl.prototype,"keyAttr",void 0)});var uv=l(et=>{"use strict";var av;Object.defineProperty(et,"__esModule",{value:!0});et.KeyAgreeRecipientInfo=et.OriginatorIdentifierOrKey=et.OriginatorPublicKey=et.RecipientEncryptedKeys=et.RecipientEncryptedKey=et.KeyAgreeRecipientIdentifier=et.RecipientKeyIdentifier=void 0;var $e=(v(),g(A)),de=S(),ll=X(),cv=fi(),pP=Ku(),Pj=ov(),ws=class{subjectKeyIdentifier=new ll.SubjectKeyIdentifier;date;other;constructor(e={}){Object.assign(this,e)}};et.RecipientKeyIdentifier=ws;$e.__decorate([(0,de.AsnProp)({type:ll.SubjectKeyIdentifier})],ws.prototype,"subjectKeyIdentifier",void 0);$e.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.GeneralizedTime,optional:!0})],ws.prototype,"date",void 0);$e.__decorate([(0,de.AsnProp)({type:Pj.OtherKeyAttribute,optional:!0})],ws.prototype,"other",void 0);var Cs=class{rKeyId;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};et.KeyAgreeRecipientIdentifier=Cs;$e.__decorate([(0,de.AsnProp)({type:ws,context:0,implicit:!0,optional:!0})],Cs.prototype,"rKeyId",void 0);$e.__decorate([(0,de.AsnProp)({type:pP.IssuerAndSerialNumber,optional:!0})],Cs.prototype,"issuerAndSerialNumber",void 0);et.KeyAgreeRecipientIdentifier=Cs=$e.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Choice})],Cs);var Ta=class{rid=new Cs;encryptedKey=new de.OctetString;constructor(e={}){Object.assign(this,e)}};et.RecipientEncryptedKey=Ta;$e.__decorate([(0,de.AsnProp)({type:Cs})],Ta.prototype,"rid",void 0);$e.__decorate([(0,de.AsnProp)({type:de.OctetString})],Ta.prototype,"encryptedKey",void 0);var ul=av=class extends de.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,av.prototype)}};et.RecipientEncryptedKeys=ul;et.RecipientEncryptedKeys=ul=av=$e.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Sequence,itemType:Ta})],ul);var xa=class{algorithm=new ll.AlgorithmIdentifier;publicKey=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};et.OriginatorPublicKey=xa;$e.__decorate([(0,de.AsnProp)({type:ll.AlgorithmIdentifier})],xa.prototype,"algorithm",void 0);$e.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.BitString})],xa.prototype,"publicKey",void 0);var fn=class{subjectKeyIdentifier;originatorKey;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};et.OriginatorIdentifierOrKey=fn;$e.__decorate([(0,de.AsnProp)({type:ll.SubjectKeyIdentifier,context:0,implicit:!0,optional:!0})],fn.prototype,"subjectKeyIdentifier",void 0);$e.__decorate([(0,de.AsnProp)({type:xa,context:1,implicit:!0,optional:!0})],fn.prototype,"originatorKey",void 0);$e.__decorate([(0,de.AsnProp)({type:pP.IssuerAndSerialNumber,optional:!0})],fn.prototype,"issuerAndSerialNumber",void 0);et.OriginatorIdentifierOrKey=fn=$e.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Choice})],fn);var dn=class{version=cv.CMSVersion.v3;originator=new fn;ukm;keyEncryptionAlgorithm=new cv.KeyEncryptionAlgorithmIdentifier;recipientEncryptedKeys=new ul;constructor(e={}){Object.assign(this,e)}};et.KeyAgreeRecipientInfo=dn;$e.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.Integer})],dn.prototype,"version",void 0);$e.__decorate([(0,de.AsnProp)({type:fn,context:0})],dn.prototype,"originator",void 0);$e.__decorate([(0,de.AsnProp)({type:de.OctetString,context:1,optional:!0})],dn.prototype,"ukm",void 0);$e.__decorate([(0,de.AsnProp)({type:cv.KeyEncryptionAlgorithmIdentifier})],dn.prototype,"keyEncryptionAlgorithm",void 0);$e.__decorate([(0,de.AsnProp)({type:ul})],dn.prototype,"recipientEncryptedKeys",void 0)});var fv=l(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.KeyTransRecipientInfo=Ts.RecipientIdentifier=void 0;var xs=(v(),g(A)),Nr=S(),Ej=X(),lv=fi(),Tj=Ku(),Ps=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};Ts.RecipientIdentifier=Ps;xs.__decorate([(0,Nr.AsnProp)({type:Ej.SubjectKeyIdentifier,context:0,implicit:!0})],Ps.prototype,"subjectKeyIdentifier",void 0);xs.__decorate([(0,Nr.AsnProp)({type:Tj.IssuerAndSerialNumber})],Ps.prototype,"issuerAndSerialNumber",void 0);Ts.RecipientIdentifier=Ps=xs.__decorate([(0,Nr.AsnType)({type:Nr.AsnTypeTypes.Choice})],Ps);var Es=class{version=lv.CMSVersion.v0;rid=new Ps;keyEncryptionAlgorithm=new lv.KeyEncryptionAlgorithmIdentifier;encryptedKey=new Nr.OctetString;constructor(e={}){Object.assign(this,e)}};Ts.KeyTransRecipientInfo=Es;xs.__decorate([(0,Nr.AsnProp)({type:Nr.AsnPropTypes.Integer})],Es.prototype,"version",void 0);xs.__decorate([(0,Nr.AsnProp)({type:Ps})],Es.prototype,"rid",void 0);xs.__decorate([(0,Nr.AsnProp)({type:lv.KeyEncryptionAlgorithmIdentifier})],Es.prototype,"keyEncryptionAlgorithm",void 0);xs.__decorate([(0,Nr.AsnProp)({type:Nr.OctetString})],Es.prototype,"encryptedKey",void 0)});var pv=l(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.KEKRecipientInfo=Oa.KEKIdentifier=void 0;var Is=(v(),g(A)),Qt=S(),xj=ov(),dv=fi(),pn=class{keyIdentifier=new Qt.OctetString;date;other;constructor(e={}){Object.assign(this,e)}};Oa.KEKIdentifier=pn;Is.__decorate([(0,Qt.AsnProp)({type:Qt.OctetString})],pn.prototype,"keyIdentifier",void 0);Is.__decorate([(0,Qt.AsnProp)({type:Qt.AsnPropTypes.GeneralizedTime,optional:!0})],pn.prototype,"date",void 0);Is.__decorate([(0,Qt.AsnProp)({type:xj.OtherKeyAttribute,optional:!0})],pn.prototype,"other",void 0);var Os=class{version=dv.CMSVersion.v4;kekid=new pn;keyEncryptionAlgorithm=new dv.KeyEncryptionAlgorithmIdentifier;encryptedKey=new Qt.OctetString;constructor(e={}){Object.assign(this,e)}};Oa.KEKRecipientInfo=Os;Is.__decorate([(0,Qt.AsnProp)({type:Qt.AsnPropTypes.Integer})],Os.prototype,"version",void 0);Is.__decorate([(0,Qt.AsnProp)({type:pn})],Os.prototype,"kekid",void 0);Is.__decorate([(0,Qt.AsnProp)({type:dv.KeyEncryptionAlgorithmIdentifier})],Os.prototype,"keyEncryptionAlgorithm",void 0);Is.__decorate([(0,Qt.AsnProp)({type:Qt.OctetString})],Os.prototype,"encryptedKey",void 0)});var yv=l(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});oy.PasswordRecipientInfo=void 0;var sy=(v(),g(A)),Bs=S(),ny=fi(),ks=class{version=ny.CMSVersion.v0;keyDerivationAlgorithm;keyEncryptionAlgorithm=new ny.KeyEncryptionAlgorithmIdentifier;encryptedKey=new Bs.OctetString;constructor(e={}){Object.assign(this,e)}};oy.PasswordRecipientInfo=ks;sy.__decorate([(0,Bs.AsnProp)({type:Bs.AsnPropTypes.Integer})],ks.prototype,"version",void 0);sy.__decorate([(0,Bs.AsnProp)({type:ny.KeyDerivationAlgorithmIdentifier,context:0,optional:!0})],ks.prototype,"keyDerivationAlgorithm",void 0);sy.__decorate([(0,Bs.AsnProp)({type:ny.KeyEncryptionAlgorithmIdentifier})],ks.prototype,"keyEncryptionAlgorithm",void 0);sy.__decorate([(0,Bs.AsnProp)({type:Bs.OctetString})],ks.prototype,"encryptedKey",void 0)});var _v=l(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.RecipientInfo=js.OtherRecipientInfo=void 0;var _n=(v(),g(A)),qr=S(),Oj=uv(),Ij=fv(),Bj=pv(),kj=yv(),Ia=class{oriType="";oriValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};js.OtherRecipientInfo=Ia;_n.__decorate([(0,qr.AsnProp)({type:qr.AsnPropTypes.ObjectIdentifier})],Ia.prototype,"oriType",void 0);_n.__decorate([(0,qr.AsnProp)({type:qr.AsnPropTypes.Any})],Ia.prototype,"oriValue",void 0);var yn=class{ktri;kari;kekri;pwri;ori;constructor(e={}){Object.assign(this,e)}};js.RecipientInfo=yn;_n.__decorate([(0,qr.AsnProp)({type:Ij.KeyTransRecipientInfo,optional:!0})],yn.prototype,"ktri",void 0);_n.__decorate([(0,qr.AsnProp)({type:Oj.KeyAgreeRecipientInfo,context:1,implicit:!0,optional:!0})],yn.prototype,"kari",void 0);_n.__decorate([(0,qr.AsnProp)({type:Bj.KEKRecipientInfo,context:2,implicit:!0,optional:!0})],yn.prototype,"kekri",void 0);_n.__decorate([(0,qr.AsnProp)({type:kj.PasswordRecipientInfo,context:3,implicit:!0,optional:!0})],yn.prototype,"pwri",void 0);_n.__decorate([(0,qr.AsnProp)({type:Ia,context:4,implicit:!0,optional:!0})],yn.prototype,"ori",void 0);js.RecipientInfo=yn=_n.__decorate([(0,qr.AsnType)({type:qr.AsnTypeTypes.Choice})],yn)});var vv=l(fl=>{"use strict";var hv;Object.defineProperty(fl,"__esModule",{value:!0});fl.RecipientInfos=void 0;var jj=(v(),g(A)),gv=S(),Mj=_v(),Av=hv=class extends gv.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,hv.prototype)}};fl.RecipientInfos=Av;fl.RecipientInfos=Av=hv=jj.__decorate([(0,gv.AsnType)({type:gv.AsnTypeTypes.Set,itemType:Mj.RecipientInfo})],Av)});var ay=l(ot=>{"use strict";var mv;Object.defineProperty(ot,"__esModule",{value:!0});ot.RevocationInfoChoices=ot.RevocationInfoChoice=ot.OtherRevocationInfoFormat=ot.id_ri_scvp=ot.id_ri_ocsp_response=ot.id_ri=void 0;var pl=(v(),g(A)),yi=S(),Nj=X();ot.id_ri=`${Nj.id_pkix}.16`;ot.id_ri_ocsp_response=`${ot.id_ri}.2`;ot.id_ri_scvp=`${ot.id_ri}.4`;var Ms=class{otherRevInfoFormat="";otherRevInfo=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};ot.OtherRevocationInfoFormat=Ms;pl.__decorate([(0,yi.AsnProp)({type:yi.AsnPropTypes.ObjectIdentifier})],Ms.prototype,"otherRevInfoFormat",void 0);pl.__decorate([(0,yi.AsnProp)({type:yi.AsnPropTypes.Any})],Ms.prototype,"otherRevInfo",void 0);var dl=class{other=new Ms;constructor(e={}){Object.assign(this,e)}};ot.RevocationInfoChoice=dl;pl.__decorate([(0,yi.AsnProp)({type:Ms,context:1,implicit:!0})],dl.prototype,"other",void 0);ot.RevocationInfoChoice=dl=pl.__decorate([(0,yi.AsnType)({type:yi.AsnTypeTypes.Choice})],dl);var bv=mv=class extends yi.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,mv.prototype)}};ot.RevocationInfoChoices=bv;ot.RevocationInfoChoices=bv=mv=pl.__decorate([(0,yi.AsnType)({type:yi.AsnTypeTypes.Set,itemType:dl})],bv)});var Sv=l(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.OriginatorInfo=void 0;var yP=(v(),g(A)),_P=S(),qj=Zp(),Rj=ay(),yl=class{certs;crls;constructor(e={}){Object.assign(this,e)}};cy.OriginatorInfo=yl;yP.__decorate([(0,_P.AsnProp)({type:qj.CertificateSet,context:0,implicit:!0,optional:!0})],yl.prototype,"certs",void 0);yP.__decorate([(0,_P.AsnProp)({type:Rj.RevocationInfoChoices,context:1,implicit:!0,optional:!0})],yl.prototype,"crls",void 0)});var AP=l(Ns=>{"use strict";var wv;Object.defineProperty(Ns,"__esModule",{value:!0});Ns.EnvelopedData=Ns.UnprotectedAttributes=void 0;var Ba=(v(),g(A)),Di=S(),Dj=fi(),Uj=xp(),hP=vv(),Lj=Sv(),gP=sv(),uy=wv=class extends Di.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,wv.prototype)}};Ns.UnprotectedAttributes=uy;Ns.UnprotectedAttributes=uy=wv=Ba.__decorate([(0,Di.AsnType)({type:Di.AsnTypeTypes.Set,itemType:Uj.Attribute})],uy);var hn=class{version=Dj.CMSVersion.v0;originatorInfo;recipientInfos=new hP.RecipientInfos;encryptedContentInfo=new gP.EncryptedContentInfo;unprotectedAttrs;constructor(e={}){Object.assign(this,e)}};Ns.EnvelopedData=hn;Ba.__decorate([(0,Di.AsnProp)({type:Di.AsnPropTypes.Integer})],hn.prototype,"version",void 0);Ba.__decorate([(0,Di.AsnProp)({type:Lj.OriginatorInfo,context:0,implicit:!0,optional:!0})],hn.prototype,"originatorInfo",void 0);Ba.__decorate([(0,Di.AsnProp)({type:hP.RecipientInfos})],hn.prototype,"recipientInfos",void 0);Ba.__decorate([(0,Di.AsnProp)({type:gP.EncryptedContentInfo})],hn.prototype,"encryptedContentInfo",void 0);Ba.__decorate([(0,Di.AsnProp)({type:uy,context:1,implicit:!0,optional:!0})],hn.prototype,"unprotectedAttrs",void 0)});var vP=l(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.id_authData=At.id_encryptedData=At.id_digestedData=At.id_envelopedData=At.id_signedData=At.id_data=At.id_ct_contentInfo=void 0;At.id_ct_contentInfo="1.2.840.113549.1.9.16.1.6";At.id_data="1.2.840.113549.1.7.1";At.id_signedData="1.2.840.113549.1.7.2";At.id_envelopedData="1.2.840.113549.1.7.3";At.id_digestedData="1.2.840.113549.1.7.5";At.id_encryptedData="1.2.840.113549.1.7.6";At.id_authData="1.2.840.113549.1.9.16.1.2"});var wP=l(qs=>{"use strict";var Cv;Object.defineProperty(qs,"__esModule",{value:!0});qs.SignedData=qs.DigestAlgorithmIdentifiers=void 0;var Rs=(v(),g(A)),_i=S(),Kj=Zp(),mP=fi(),bP=nv(),Vj=ay(),SP=Op(),_l=Cv=class extends _i.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Cv.prototype)}};qs.DigestAlgorithmIdentifiers=_l;qs.DigestAlgorithmIdentifiers=_l=Cv=Rs.__decorate([(0,_i.AsnType)({type:_i.AsnTypeTypes.Set,itemType:mP.DigestAlgorithmIdentifier})],_l);var Ui=class{version=mP.CMSVersion.v0;digestAlgorithms=new _l;encapContentInfo=new bP.EncapsulatedContentInfo;certificates;crls;signerInfos=new SP.SignerInfos;constructor(e={}){Object.assign(this,e)}};qs.SignedData=Ui;Rs.__decorate([(0,_i.AsnProp)({type:_i.AsnPropTypes.Integer})],Ui.prototype,"version",void 0);Rs.__decorate([(0,_i.AsnProp)({type:_l})],Ui.prototype,"digestAlgorithms",void 0);Rs.__decorate([(0,_i.AsnProp)({type:bP.EncapsulatedContentInfo})],Ui.prototype,"encapContentInfo",void 0);Rs.__decorate([(0,_i.AsnProp)({type:Kj.CertificateSet,context:0,implicit:!0,optional:!0})],Ui.prototype,"certificates",void 0);Rs.__decorate([(0,_i.AsnProp)({type:Vj.RevocationInfoChoices,context:1,implicit:!0,optional:!0})],Ui.prototype,"crls",void 0);Rs.__decorate([(0,_i.AsnProp)({type:SP.SignerInfos})],Ui.prototype,"signerInfos",void 0)});var hl=l(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});var Ve=(v(),g(A));Ve.__exportStar(DC(),je);Ve.__exportStar(xp(),je);Ve.__exportStar(Zp(),je);Ve.__exportStar(lP(),je);Ve.__exportStar(nv(),je);Ve.__exportStar(sv(),je);Ve.__exportStar(AP(),je);Ve.__exportStar(Ku(),je);Ve.__exportStar(pv(),je);Ve.__exportStar(uv(),je);Ve.__exportStar(fv(),je);Ve.__exportStar(vP(),je);Ve.__exportStar(Sv(),je);Ve.__exportStar(yv(),je);Ve.__exportStar(_v(),je);Ve.__exportStar(vv(),je);Ve.__exportStar(ay(),je);Ve.__exportStar(wP(),je);Ve.__exportStar(fA(),je);Ve.__exportStar(Op(),je);Ve.__exportStar(fi(),je)});var Pv=l(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.id_sect571r1=Y.id_sect571k1=Y.id_secp521r1=Y.id_sect409r1=Y.id_sect409k1=Y.id_secp384r1=Y.id_sect283r1=Y.id_sect283k1=Y.id_secp256r1=Y.id_sect233r1=Y.id_sect233k1=Y.id_secp224r1=Y.id_sect163r2=Y.id_sect163k1=Y.id_secp192r1=Y.id_ecdsaWithSHA512=Y.id_ecdsaWithSHA384=Y.id_ecdsaWithSHA256=Y.id_ecdsaWithSHA224=Y.id_ecdsaWithSHA1=Y.id_ecMQV=Y.id_ecDH=Y.id_ecPublicKey=void 0;Y.id_ecPublicKey="1.2.840.10045.2.1";Y.id_ecDH="1.3.132.1.12";Y.id_ecMQV="1.3.132.1.13";Y.id_ecdsaWithSHA1="1.2.840.10045.4.1";Y.id_ecdsaWithSHA224="1.2.840.10045.4.3.1";Y.id_ecdsaWithSHA256="1.2.840.10045.4.3.2";Y.id_ecdsaWithSHA384="1.2.840.10045.4.3.3";Y.id_ecdsaWithSHA512="1.2.840.10045.4.3.4";Y.id_secp192r1="1.2.840.10045.3.1.1";Y.id_sect163k1="1.3.132.0.1";Y.id_sect163r2="1.3.132.0.15";Y.id_secp224r1="1.3.132.0.33";Y.id_sect233k1="1.3.132.0.26";Y.id_sect233r1="1.3.132.0.27";Y.id_secp256r1="1.2.840.10045.3.1.7";Y.id_sect283k1="1.3.132.0.16";Y.id_sect283r1="1.3.132.0.17";Y.id_secp384r1="1.3.132.0.34";Y.id_sect409k1="1.3.132.0.36";Y.id_sect409r1="1.3.132.0.37";Y.id_secp521r1="1.3.132.0.35";Y.id_sect571k1="1.3.132.0.38";Y.id_sect571r1="1.3.132.0.39"});var CP=l(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.ecdsaWithSHA512=yr.ecdsaWithSHA384=yr.ecdsaWithSHA256=yr.ecdsaWithSHA224=yr.ecdsaWithSHA1=void 0;var Gj=(v(),g(A)),Fj=X(),gl=Gj.__importStar(Pv());function Al(t){return new Fj.AlgorithmIdentifier({algorithm:t})}yr.ecdsaWithSHA1=Al(gl.id_ecdsaWithSHA1);yr.ecdsaWithSHA224=Al(gl.id_ecdsaWithSHA224);yr.ecdsaWithSHA256=Al(gl.id_ecdsaWithSHA256);yr.ecdsaWithSHA384=Al(gl.id_ecdsaWithSHA384);yr.ecdsaWithSHA512=Al(gl.id_ecdsaWithSHA512)});var xv=l(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.SpecifiedECDomain=dt.ECPVer=dt.Curve=dt.FieldElement=dt.ECPoint=dt.FieldID=void 0;var kt=(v(),g(A)),he=S(),ka=class{fieldType;parameters;constructor(e={}){Object.assign(this,e)}};dt.FieldID=ka;kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.ObjectIdentifier})],ka.prototype,"fieldType",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Any})],ka.prototype,"parameters",void 0);dt.FieldID=ka=kt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Sequence})],ka);var ly=class extends he.OctetString{};dt.ECPoint=ly;var Ev=class extends he.OctetString{};dt.FieldElement=Ev;var Ds=class{a;b;seed;constructor(e={}){Object.assign(this,e)}};dt.Curve=Ds;kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.OctetString})],Ds.prototype,"a",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.OctetString})],Ds.prototype,"b",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.BitString,optional:!0})],Ds.prototype,"seed",void 0);dt.Curve=Ds=kt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Sequence})],Ds);var Tv;(function(t){t[t.ecpVer1=1]="ecpVer1"})(Tv||(dt.ECPVer=Tv={}));var Li=class{version=Tv.ecpVer1;fieldID;curve;base;order;cofactor;constructor(e={}){Object.assign(this,e)}};dt.SpecifiedECDomain=Li;kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Integer})],Li.prototype,"version",void 0);kt.__decorate([(0,he.AsnProp)({type:ka})],Li.prototype,"fieldID",void 0);kt.__decorate([(0,he.AsnProp)({type:Ds})],Li.prototype,"curve",void 0);kt.__decorate([(0,he.AsnProp)({type:ly})],Li.prototype,"base",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Integer,converter:he.AsnIntegerArrayBufferConverter})],Li.prototype,"order",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Integer,optional:!0})],Li.prototype,"cofactor",void 0);dt.SpecifiedECDomain=Li=kt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Sequence})],Li)});var Ov=l(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.ECParameters=void 0;var fy=(v(),g(A)),Us=S(),Hj=xv(),ja=class{namedCurve;implicitCurve;specifiedCurve;constructor(e={}){Object.assign(this,e)}};vl.ECParameters=ja;fy.__decorate([(0,Us.AsnProp)({type:Us.AsnPropTypes.ObjectIdentifier})],ja.prototype,"namedCurve",void 0);fy.__decorate([(0,Us.AsnProp)({type:Us.AsnPropTypes.Null})],ja.prototype,"implicitCurve",void 0);fy.__decorate([(0,Us.AsnProp)({type:Hj.SpecifiedECDomain})],ja.prototype,"specifiedCurve",void 0);vl.ECParameters=ja=fy.__decorate([(0,Us.AsnType)({type:Us.AsnTypeTypes.Choice})],ja)});var PP=l(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.ECPrivateKey=void 0;var dy=(v(),g(A)),gn=S(),Wj=Ov(),Ls=class{version=1;privateKey=new gn.OctetString;parameters;publicKey;constructor(e={}){Object.assign(this,e)}};py.ECPrivateKey=Ls;dy.__decorate([(0,gn.AsnProp)({type:gn.AsnPropTypes.Integer})],Ls.prototype,"version",void 0);dy.__decorate([(0,gn.AsnProp)({type:gn.OctetString})],Ls.prototype,"privateKey",void 0);dy.__decorate([(0,gn.AsnProp)({type:Wj.ECParameters,context:0,optional:!0})],Ls.prototype,"parameters",void 0);dy.__decorate([(0,gn.AsnProp)({type:gn.AsnPropTypes.BitString,context:1,optional:!0})],Ls.prototype,"publicKey",void 0)});var TP=l(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.ECDSASigValue=void 0;var EP=(v(),g(A)),Ma=S(),ml=class{r=new ArrayBuffer(0);s=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};yy.ECDSASigValue=ml;EP.__decorate([(0,Ma.AsnProp)({type:Ma.AsnPropTypes.Integer,converter:Ma.AsnIntegerArrayBufferConverter})],ml.prototype,"r",void 0);EP.__decorate([(0,Ma.AsnProp)({type:Ma.AsnPropTypes.Integer,converter:Ma.AsnIntegerArrayBufferConverter})],ml.prototype,"s",void 0)});var _y=l(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});var Na=(v(),g(A));Na.__exportStar(CP(),An);Na.__exportStar(Ov(),An);Na.__exportStar(PP(),An);Na.__exportStar(TP(),An);Na.__exportStar(Pv(),An);Na.__exportStar(xv(),An)});var bl=l(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.id_mgf1=q.id_md5=q.id_md2=q.id_sha512_256=q.id_sha512_224=q.id_sha512=q.id_sha384=q.id_sha256=q.id_sha224=q.id_sha1=q.id_sha512_256WithRSAEncryption=q.id_sha512_224WithRSAEncryption=q.id_sha512WithRSAEncryption=q.id_sha384WithRSAEncryption=q.id_sha256WithRSAEncryption=q.id_ssha224WithRSAEncryption=q.id_sha224WithRSAEncryption=q.id_sha1WithRSAEncryption=q.id_md5WithRSAEncryption=q.id_md2WithRSAEncryption=q.id_RSASSA_PSS=q.id_pSpecified=q.id_RSAES_OAEP=q.id_rsaEncryption=q.id_pkcs_1=void 0;q.id_pkcs_1="1.2.840.113549.1.1";q.id_rsaEncryption=`${q.id_pkcs_1}.1`;q.id_RSAES_OAEP=`${q.id_pkcs_1}.7`;q.id_pSpecified=`${q.id_pkcs_1}.9`;q.id_RSASSA_PSS=`${q.id_pkcs_1}.10`;q.id_md2WithRSAEncryption=`${q.id_pkcs_1}.2`;q.id_md5WithRSAEncryption=`${q.id_pkcs_1}.4`;q.id_sha1WithRSAEncryption=`${q.id_pkcs_1}.5`;q.id_sha224WithRSAEncryption=`${q.id_pkcs_1}.14`;q.id_ssha224WithRSAEncryption=q.id_sha224WithRSAEncryption;q.id_sha256WithRSAEncryption=`${q.id_pkcs_1}.11`;q.id_sha384WithRSAEncryption=`${q.id_pkcs_1}.12`;q.id_sha512WithRSAEncryption=`${q.id_pkcs_1}.13`;q.id_sha512_224WithRSAEncryption=`${q.id_pkcs_1}.15`;q.id_sha512_256WithRSAEncryption=`${q.id_pkcs_1}.16`;q.id_sha1="1.3.14.3.2.26";q.id_sha224="2.16.840.1.101.3.4.2.4";q.id_sha256="2.16.840.1.101.3.4.2.1";q.id_sha384="2.16.840.1.101.3.4.2.2";q.id_sha512="2.16.840.1.101.3.4.2.3";q.id_sha512_224="2.16.840.1.101.3.4.2.5";q.id_sha512_256="2.16.840.1.101.3.4.2.6";q.id_md2="1.2.840.113549.2.2";q.id_md5="1.2.840.113549.2.5";q.id_mgf1=`${q.id_pkcs_1}.8`});var hy=l(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.sha512_256WithRSAEncryption=Q.sha512_224WithRSAEncryption=Q.sha512WithRSAEncryption=Q.sha384WithRSAEncryption=Q.sha256WithRSAEncryption=Q.sha224WithRSAEncryption=Q.sha1WithRSAEncryption=Q.md5WithRSAEncryption=Q.md2WithRSAEncryption=Q.rsaEncryption=Q.pSpecifiedEmpty=Q.mgf1SHA1=Q.sha512_256=Q.sha512_224=Q.sha512=Q.sha384=Q.sha256=Q.sha224=Q.sha1=Q.md4=Q.md2=void 0;var $j=(v(),g(A)),Iv=S(),Bv=X(),Ge=$j.__importStar(bl());function tt(t){return new Bv.AlgorithmIdentifier({algorithm:t,parameters:null})}Q.md2=tt(Ge.id_md2);Q.md4=tt(Ge.id_md5);Q.sha1=tt(Ge.id_sha1);Q.sha224=tt(Ge.id_sha224);Q.sha256=tt(Ge.id_sha256);Q.sha384=tt(Ge.id_sha384);Q.sha512=tt(Ge.id_sha512);Q.sha512_224=tt(Ge.id_sha512_224);Q.sha512_256=tt(Ge.id_sha512_256);Q.mgf1SHA1=new Bv.AlgorithmIdentifier({algorithm:Ge.id_mgf1,parameters:Iv.AsnConvert.serialize(Q.sha1)});Q.pSpecifiedEmpty=new Bv.AlgorithmIdentifier({algorithm:Ge.id_pSpecified,parameters:Iv.AsnConvert.serialize(Iv.AsnOctetStringConverter.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Q.rsaEncryption=tt(Ge.id_rsaEncryption);Q.md2WithRSAEncryption=tt(Ge.id_md2WithRSAEncryption);Q.md5WithRSAEncryption=tt(Ge.id_md5WithRSAEncryption);Q.sha1WithRSAEncryption=tt(Ge.id_sha1WithRSAEncryption);Q.sha224WithRSAEncryption=tt(Ge.id_sha512_224WithRSAEncryption);Q.sha256WithRSAEncryption=tt(Ge.id_sha512_256WithRSAEncryption);Q.sha384WithRSAEncryption=tt(Ge.id_sha384WithRSAEncryption);Q.sha512WithRSAEncryption=tt(Ge.id_sha512WithRSAEncryption);Q.sha512_224WithRSAEncryption=tt(Ge.id_sha512_224WithRSAEncryption);Q.sha512_256WithRSAEncryption=tt(Ge.id_sha512_256WithRSAEncryption)});var OP=l(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.RSAES_OAEP=Ra.RsaEsOaepParams=void 0;var kv=(v(),g(A)),Sl=S(),Ks=X(),xP=bl(),qa=hy(),Vs=class{hashAlgorithm=new Ks.AlgorithmIdentifier(qa.sha1);maskGenAlgorithm=new Ks.AlgorithmIdentifier({algorithm:xP.id_mgf1,parameters:Sl.AsnConvert.serialize(qa.sha1)});pSourceAlgorithm=new Ks.AlgorithmIdentifier(qa.pSpecifiedEmpty);constructor(e={}){Object.assign(this,e)}};Ra.RsaEsOaepParams=Vs;kv.__decorate([(0,Sl.AsnProp)({type:Ks.AlgorithmIdentifier,context:0,defaultValue:qa.sha1})],Vs.prototype,"hashAlgorithm",void 0);kv.__decorate([(0,Sl.AsnProp)({type:Ks.AlgorithmIdentifier,context:1,defaultValue:qa.mgf1SHA1})],Vs.prototype,"maskGenAlgorithm",void 0);kv.__decorate([(0,Sl.AsnProp)({type:Ks.AlgorithmIdentifier,context:2,defaultValue:qa.pSpecifiedEmpty})],Vs.prototype,"pSourceAlgorithm",void 0);Ra.RSAES_OAEP=new Ks.AlgorithmIdentifier({algorithm:xP.id_RSAES_OAEP,parameters:Sl.AsnConvert.serialize(new Vs)})});var BP=l(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.RSASSA_PSS=Da.RsaSaPssParams=void 0;var Ay=(v(),g(A)),vn=S(),wl=X(),IP=bl(),gy=hy(),mn=class{hashAlgorithm=new wl.AlgorithmIdentifier(gy.sha1);maskGenAlgorithm=new wl.AlgorithmIdentifier({algorithm:IP.id_mgf1,parameters:vn.AsnConvert.serialize(gy.sha1)});saltLength=20;trailerField=1;constructor(e={}){Object.assign(this,e)}};Da.RsaSaPssParams=mn;Ay.__decorate([(0,vn.AsnProp)({type:wl.AlgorithmIdentifier,context:0,defaultValue:gy.sha1})],mn.prototype,"hashAlgorithm",void 0);Ay.__decorate([(0,vn.AsnProp)({type:wl.AlgorithmIdentifier,context:1,defaultValue:gy.mgf1SHA1})],mn.prototype,"maskGenAlgorithm",void 0);Ay.__decorate([(0,vn.AsnProp)({type:vn.AsnPropTypes.Integer,context:2,defaultValue:20})],mn.prototype,"saltLength",void 0);Ay.__decorate([(0,vn.AsnProp)({type:vn.AsnPropTypes.Integer,context:3,defaultValue:1})],mn.prototype,"trailerField",void 0);Da.RSASSA_PSS=new wl.AlgorithmIdentifier({algorithm:IP.id_RSASSA_PSS,parameters:vn.AsnConvert.serialize(new mn)})});var MP=l(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.DigestInfo=void 0;var kP=(v(),g(A)),jP=X(),vy=S(),Cl=class{digestAlgorithm=new jP.AlgorithmIdentifier;digest=new vy.OctetString;constructor(e={}){Object.assign(this,e)}};my.DigestInfo=Cl;kP.__decorate([(0,vy.AsnProp)({type:jP.AlgorithmIdentifier})],Cl.prototype,"digestAlgorithm",void 0);kP.__decorate([(0,vy.AsnProp)({type:vy.OctetString})],Cl.prototype,"digest",void 0)});var NP=l(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var jv=(v(),g(A));jv.__exportStar(OP(),Pl);jv.__exportStar(BP(),Pl);jv.__exportStar(MP(),Pl)});var qv=l(Fs=>{"use strict";var Mv;Object.defineProperty(Fs,"__esModule",{value:!0});Fs.OtherPrimeInfos=Fs.OtherPrimeInfo=void 0;var by=(v(),g(A)),_r=S(),Gs=class{prime=new ArrayBuffer(0);exponent=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Fs.OtherPrimeInfo=Gs;by.__decorate([(0,_r.AsnProp)({type:_r.AsnPropTypes.Integer,converter:_r.AsnIntegerArrayBufferConverter})],Gs.prototype,"prime",void 0);by.__decorate([(0,_r.AsnProp)({type:_r.AsnPropTypes.Integer,converter:_r.AsnIntegerArrayBufferConverter})],Gs.prototype,"exponent",void 0);by.__decorate([(0,_r.AsnProp)({type:_r.AsnPropTypes.Integer,converter:_r.AsnIntegerArrayBufferConverter})],Gs.prototype,"coefficient",void 0);var Nv=Mv=class extends _r.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Mv.prototype)}};Fs.OtherPrimeInfos=Nv;Fs.OtherPrimeInfos=Nv=Mv=by.__decorate([(0,_r.AsnType)({type:_r.AsnTypeTypes.Sequence,itemType:Gs})],Nv)});var qP=l(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.RSAPrivateKey=void 0;var hi=(v(),g(A)),me=S(),zj=qv(),Xt=class{version=0;modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);privateExponent=new ArrayBuffer(0);prime1=new ArrayBuffer(0);prime2=new ArrayBuffer(0);exponent1=new ArrayBuffer(0);exponent2=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);otherPrimeInfos;constructor(e={}){Object.assign(this,e)}};Sy.RSAPrivateKey=Xt;hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer})],Xt.prototype,"version",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"modulus",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"publicExponent",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"privateExponent",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"prime1",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"prime2",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"exponent1",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"exponent2",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"coefficient",void 0);hi.__decorate([(0,me.AsnProp)({type:zj.OtherPrimeInfos,optional:!0})],Xt.prototype,"otherPrimeInfos",void 0)});var DP=l(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});wy.RSAPublicKey=void 0;var RP=(v(),g(A)),Ua=S(),El=class{modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};wy.RSAPublicKey=El;RP.__decorate([(0,Ua.AsnProp)({type:Ua.AsnPropTypes.Integer,converter:Ua.AsnIntegerArrayBufferConverter})],El.prototype,"modulus",void 0);RP.__decorate([(0,Ua.AsnProp)({type:Ua.AsnPropTypes.Integer,converter:Ua.AsnIntegerArrayBufferConverter})],El.prototype,"publicExponent",void 0)});var Cy=l(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});var La=(v(),g(A));La.__exportStar(NP(),bn);La.__exportStar(hy(),bn);La.__exportStar(bl(),bn);La.__exportStar(qv(),bn);La.__exportStar(qP(),bn);La.__exportStar(DP(),bn)});var Py={};Tb(Py,{__assign:()=>Dv,__asyncDelegator:()=>aM,__asyncGenerator:()=>oM,__asyncValues:()=>cM,__await:()=>Tl,__awaiter:()=>eM,__classPrivateFieldGet:()=>dM,__classPrivateFieldSet:()=>pM,__createBinding:()=>rM,__decorate:()=>Qj,__exportStar:()=>iM,__extends:()=>Yj,__generator:()=>tM,__importDefault:()=>fM,__importStar:()=>lM,__makeTemplateObject:()=>uM,__metadata:()=>Zj,__param:()=>Xj,__read:()=>UP,__rest:()=>Jj,__spread:()=>nM,__spreadArrays:()=>sM,__values:()=>Uv});function Yj(t,e){Rv(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Jj(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Qj(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function Xj(t,e){return function(r,i){e(r,i,t)}}function Zj(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function eM(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(i.next(f))}catch(d){o(d)}}function c(f){try{u(i.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):n(f.value).then(a,c)}u((i=i.apply(t,e||[])).next())})}function tM(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(f){u=[6,f],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function rM(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function iM(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Uv(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function UP(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function nM(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(UP(arguments[e]));return t}function sM(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function Tl(t){return this instanceof Tl?(this.v=t,this):new Tl(t)}function oM(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(y){i[y]&&(n[y]=function(m){return new Promise(function(x,T){s.push([y,m,x,T])>1||a(y,m)})})}function a(y,m){try{c(i[y](m))}catch(x){d(s[0][3],x)}}function c(y){y.value instanceof Tl?Promise.resolve(y.value.v).then(u,f):d(s[0][2],y)}function u(y){a("next",y)}function f(y){a("throw",y)}function d(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function aM(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(o){return(r=!r)?{value:Tl(t[n](o)),done:n==="return"}:s?s(o):o}:s}}function cM(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Uv=="function"?Uv(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),n(a,c,o.done,o.value)})}}function n(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function uM(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function lM(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function fM(t){return t&&t.__esModule?t:{default:t}}function dM(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function pM(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var Rv,Dv,Ey=Eb(()=>{Rv=function(t,e){return Rv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},Rv(t,e)};Dv=function(){return Dv=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Dv.apply(this,arguments)}});var Vv=l(Kv=>{"use strict";Object.defineProperty(Kv,"__esModule",{value:!0});var Lv;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(Lv||(Lv={}));Kv.default=Lv});var LP=l(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var yM=Vv();Object.defineProperty(Gv,"Lifecycle",{enumerable:!0,get:function(){return yM.default}})});var Hs=l(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.defineInjectionTokenMetadata=Rr.getParamInfo=Rr.INJECTION_TOKEN_METADATA_KEY=void 0;Rr.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function _M(t){let e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(Rr.INJECTION_TOKEN_METADATA_KEY,t)||{};return Object.keys(r).forEach(i=>{e[+i]=r[i]}),e}Rr.getParamInfo=_M;function hM(t,e){return function(r,i,n){let s=Reflect.getOwnMetadata(Rr.INJECTION_TOKEN_METADATA_KEY,r)||{};s[n]=e?{token:t,transform:e.transformToken,transformArgs:e.args||[]}:t,Reflect.defineMetadata(Rr.INJECTION_TOKEN_METADATA_KEY,s,r)}}Rr.defineInjectionTokenMetadata=hM});var Fv=l(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.isClassProvider=void 0;function gM(t){return!!t.useClass}Ty.isClassProvider=gM});var Hv=l(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0});xy.isFactoryProvider=void 0;function AM(t){return!!t.useFactory}xy.isFactoryProvider=AM});var Iy=l(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.delay=Ka.DelayedConstructor=void 0;var Oy=class{constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let r={},i=!1,n,s=()=>(i||(n=e(this.wrap()),i=!0),n);return new Proxy(r,this.createHandler(s))}createHandler(e){let r={},i=n=>{r[n]=(...s)=>{s[0]=e();let o=Reflect[n];return o(...s)}};return this.reflectMethods.forEach(i),r}};Ka.DelayedConstructor=Oy;function vM(t){if(typeof t>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new Oy(t)}Ka.delay=vM});var By=l(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.isConstructorToken=gi.isTransformDescriptor=gi.isTokenDescriptor=gi.isNormalToken=void 0;var mM=Iy();function bM(t){return typeof t=="string"||typeof t=="symbol"}gi.isNormalToken=bM;function SM(t){return typeof t=="object"&&"token"in t&&"multiple"in t}gi.isTokenDescriptor=SM;function wM(t){return typeof t=="object"&&"token"in t&&"transform"in t}gi.isTransformDescriptor=wM;function CM(t){return typeof t=="function"||t instanceof mM.DelayedConstructor}gi.isConstructorToken=CM});var Wv=l(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});ky.isTokenProvider=void 0;function PM(t){return!!t.useToken}ky.isTokenProvider=PM});var $v=l(jy=>{"use strict";Object.defineProperty(jy,"__esModule",{value:!0});jy.isValueProvider=void 0;function EM(t){return t.useValue!=null}jy.isValueProvider=EM});var zv=l(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});var TM=Fv();Object.defineProperty(Ws,"isClassProvider",{enumerable:!0,get:function(){return TM.isClassProvider}});var xM=Hv();Object.defineProperty(Ws,"isFactoryProvider",{enumerable:!0,get:function(){return xM.isFactoryProvider}});var OM=By();Object.defineProperty(Ws,"isNormalToken",{enumerable:!0,get:function(){return OM.isNormalToken}});var IM=Wv();Object.defineProperty(Ws,"isTokenProvider",{enumerable:!0,get:function(){return IM.isTokenProvider}});var BM=$v();Object.defineProperty(Ws,"isValueProvider",{enumerable:!0,get:function(){return BM.isValueProvider}})});var KP=l(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0});My.isProvider=void 0;var kM=Fv(),jM=$v(),MM=Wv(),NM=Hv();function qM(t){return kM.isClassProvider(t)||jM.isValueProvider(t)||MM.isTokenProvider(t)||NM.isFactoryProvider(t)}My.isProvider=qM});var Qv=l(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});var Yv=class{constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(e){return this.ensure(e),this._registryMap.get(e)}get(e){this.ensure(e);let r=this._registryMap.get(e);return r[r.length-1]||null}set(e,r){this.ensure(e),this._registryMap.get(e).push(r)}setAll(e,r){this._registryMap.set(e,r)}has(e){return this.ensure(e),this._registryMap.get(e).length>0}clear(){this._registryMap.clear()}ensure(e){this._registryMap.has(e)||this._registryMap.set(e,[])}};Jv.default=Yv});var VP=l(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});var RM=Qv(),Xv=class extends RM.default{};Zv.default=Xv});var GP=l(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});var em=class{constructor(){this.scopedResolutions=new Map}};tm.default=em});var rm=l(Ny=>{"use strict";Object.defineProperty(Ny,"__esModule",{value:!0});Ny.formatErrorCtor=void 0;function DM(t,e){return t===null?`at position #${e}`:`"${t.split(",")[e].trim()}" at position #${e}`}function UM(t,e,r=" "){return[t,...e.message.split(`
14
+ `}function Yw(t){return t.replace(/[^0-9a-f]/gi,"")}function ZB(t){let e=t.match(/[0-9A-Fa-f]+|[^0-9A-Fa-f]+/g)??[];if(e.length<3)return;let r=e.filter((o,a)=>a%2===0),i=e.filter((o,a)=>a%2===1),n=i[0];if(!n||i.some(o=>o!==n)||r.some(o=>o.length===0||o.length%2!==0))return;let s=r[0]?.length??0;if(s&&!r.slice(0,-1).some(o=>o.length!==s)&&!((r[r.length-1]?.length??0)>s))return{size:s/2,separator:n}}function ek(t){let e=t.trim(),r=/^0x/i.test(e)?"0x":"",i=r?e.slice(2):e,n=XB(i),s=i.split(/\r\n|\n/).filter(u=>u.length>0),o=s[0]?.trim()??"",a=ZB(o),c={case:QB(e),prefix:r};if(a&&(c.group=a),n&&s.length>1){let u=Yw(s[0]??"").length/2;u>0&&s.slice(0,-1).every(f=>Yw(f).length/2===u)&&(c.line={bytesPerLine:u,separator:n})}return c}function tk(t,e){let r=e.allowPrefix??!0,i=[...zB(e)].sort((a,c)=>c.length-a.length);for(let a of i)YB(a);let n=t.trim();if(/^0x/i.test(n)){if(!r)throw new TypeError("Hexadecimal text must not include a 0x prefix");n=n.slice(2)}let s="",o=!1;for(let a=0;a<n.length;){let c=n[a]??"";if(WB.test(c)){s+=c,o=!1,a+=1;continue}let u=JB(n,a,i);if(!u)throw new TypeError("Input is not valid hexadecimal text");if(e.strict&&(o||s.length===0))throw new TypeError("Hexadecimal text contains misplaced separators");o=!0,a+=u.length}if(e.strict&&o&&s.length>0)throw new TypeError("Hexadecimal text must not end with a separator");if(s.length%2!==0){if(!e.allowOddLength)throw new TypeError("Hexadecimal text must contain an even number of characters");s=`0${s}`}return s.toLowerCase()}function Jw(t,e){if(!e)return t.join("");if(!Number.isInteger(e.size)||e.size<1)throw new RangeError("Hex group size must be a positive integer");let r=[];for(let i=0;i<t.length;i+=e.size)r.push(t.slice(i,i+e.size).join(""));return r.join(e.separator)}function gu(t,e={}){return tk(t,e)}function Qw(t,e={}){if(typeof t!="string")return!1;try{return gu(t,e),!0}catch{return!1}}function eg(t,e={}){let r=(0,HB.toUint8Array)(t),i=e.case??"lower",n=Array.from(r,o=>{let a=o.toString(16).padStart(2,"0");return i==="upper"?a.toUpperCase():a}),s="";if(e.line){let o=e.line.bytesPerLine;if(!Number.isInteger(o)||o<1)throw new RangeError("Hex bytesPerLine must be a positive integer");let a=e.line.separator??`
15
+ `,c=[];for(let u=0;u<n.length;u+=o)c.push(Jw(n.slice(u,u+o),e.group));s=c.join(a)}else s=Jw(n,e.group);return`${e.prefix??""}${s}`}function tg(t,e={}){let r=gu(t,e),i=new Uint8Array(r.length/2);for(let n=0;n<r.length;n+=2)i[n/2]=Number.parseInt(r.slice(n,n+2),16);return i}function Xw(t,e={}){let r=gu(t,e);return{bytes:tg(r),format:ek(t),normalized:r}}function Zw(t,e){return eg(t,e)}Ht.formats={compact:Object.freeze({}),upper:Object.freeze({case:"upper"}),colon:Object.freeze({group:{size:1,separator:":"}}),colonUpper:Object.freeze({case:"upper",group:{size:1,separator:":"}}),groupsOf4:Object.freeze({group:{size:4,separator:" "}}),prefixed:Object.freeze({prefix:"0x"})};Ht.hex={encode:eg,decode:tg,format:Zw,formats:Ht.formats,is:Qw,normalize:gu,parse:Xw}});var i1=l(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.utf8=void 0;Io.encode=t1;Io.decode=r1;var rk=Gt();function t1(t){return new TextEncoder().encode(t)}function r1(t){return new TextDecoder("utf-8",{fatal:!1}).decode((0,rk.toUint8Array)(t))}Io.utf8={encode:t1,decode:r1}});var o1=l(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.utf16=void 0;Bo.encode=n1;Bo.decode=s1;var ik=Gt();function n1(t,e={}){let r=new ArrayBuffer(t.length*2),i=new DataView(r);for(let n=0;n<t.length;n++)i.setUint16(n*2,t.charCodeAt(n),e.littleEndian??!1);return new Uint8Array(r)}function s1(t,e={}){let r=(0,ik.toArrayBuffer)(t),i=new DataView(r),n="";for(let s=0;s<r.byteLength;s+=2)n+=String.fromCharCode(i.getUint16(s,e.littleEndian??!1));return n}Bo.utf16={encode:n1,decode:s1}});var ig=l(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.base64=void 0;Bi.normalize=Ld;Bi.pad=u1;Bi.is=rg;Bi.encode=l1;Bi.decode=f1;var nk=Gt(),a1=Zh(),sk=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;function c1(){return globalThis.Buffer}function Ld(t){return t.replace(/[\n\r\t ]/g,"")}function u1(t){let e=t.length%4;return e?t+"=".repeat(4-e):t}function rg(t){if(typeof t!="string")return!1;let e=Ld(t);return e===""||sk.test(e)}function l1(t,e){let r=(0,nk.toUint8Array)(t),i=c1();return i?i.from(r).toString("base64"):btoa((0,a1.encode)(r))}function f1(t,e){let r=Ld(t);if(!rg(r))throw new TypeError("Input is not valid Base64 text");let i=c1();return i?new Uint8Array(i.from(r,"base64")):(0,a1.decode)(atob(r))}Bi.base64={encode:l1,decode:f1,is:rg,normalize:Ld,pad:u1}});var y1=l(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.base64url=void 0;rn.normalize=Kd;rn.is=sg;rn.encode=d1;rn.decode=p1;var ng=ig(),ok=/^[A-Za-z0-9_-]*$/;function Kd(t){return t.replace(/[\n\r\t ]/g,"")}function sg(t){return typeof t=="string"&&ok.test(Kd(t))}function d1(t,e){return ng.base64.encode(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function p1(t,e){let r=Kd(t);if(!sg(r))throw new TypeError("Input is not valid Base64Url text");return ng.base64.decode(ng.base64.pad(r.replace(/-/g,"+").replace(/_/g,"/")))}rn.base64url={encode:d1,decode:p1,is:sg,normalize:Kd}});var og=l(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.base64url=Ot.base64=Ot.utf16=Ot.utf8=Ot.hex=Ot.binary=void 0;var ko=(v(),g(A));Ot.binary=ko.__importStar(Zh());Ot.hex=ko.__importStar(e1());Ot.utf8=ko.__importStar(i1());Ot.utf16=ko.__importStar(o1());Ot.base64=ko.__importStar(ig());Ot.base64url=ko.__importStar(y1())});var _1=l(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.IpConverter=void 0;var ak=og(),ag=class{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let r=e.split(".");if(r.length!==4)throw new Error("Invalid IPv4 address");return r.map(i=>{let n=parseInt(i,10);if(isNaN(n)||n<0||n>255)throw new Error("Invalid IPv4 address part");return n})}static parseIPv6(e){let i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((n,s)=>{let o=parseInt(s,16);if(isNaN(o)||o<0||o>65535)throw new Error("Invalid IPv6 address part");return n.push(o>>8&255),n.push(o&255),n},[])}static expandIPv6(e){if(!e.includes("::"))return e;let r=e.split("::");if(r.length>2)throw new Error("Invalid IPv6 address");let i=r[0]?r[0].split(":"):[],n=r[1]?r[1].split(":"):[],s=8-(i.length+n.length);if(s<0)throw new Error("Invalid IPv6 address");return[...i,...Array(s).fill("0"),...n].join(":")}static formatIPv6(e){let r=[];for(let i=0;i<16;i+=2)r.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(r.join(":"))}static compressIPv6(e){let r=e.split(":"),i=-1,n=0,s=-1,o=0;for(let a=0;a<r.length;a++)r[a]==="0"?(s===-1&&(s=a),o++):(o>n&&(i=s,n=o),s=-1,o=0);if(o>n&&(i=s,n=o),n>1){let a=r.slice(0,i).join(":"),c=r.slice(i+n).join(":");return`${a}::${c}`}return e}static parseCIDR(e){let[r,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(r)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(r),n]}else{if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(r),n]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;let r=parseInt(e.slice(8),16).toString(2).split("").reduce((n,s)=>n+ +s,0),i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(e){let r=new Uint8Array(e);if(r.length===4)return Array.from(r).join(".");if(r.length===16)return this.formatIPv6(r);if(r.length===8||r.length===32){let i=r.length/2,n=r.slice(0,i),s=r.slice(i);if(r.every(c=>c===0))return r.length===8?"0.0.0.0/0":"::/0";let a=s.reduce((c,u)=>c+(u.toString(2).match(/1/g)||[]).length,0);return r.length===8?`${Array.from(n).join(".")}/${a}`:`${this.formatIPv6(n)}/${a}`}return this.decodeIP(ak.hex.encode(e))}static fromString(e){if(e.includes("/")){let[i,n]=this.parseCIDR(e),s=new Uint8Array(i.length),o=n;for(let c=0;c<s.length;c++)o>=8?(s[c]=255,o-=8):o>0&&(s[c]=255<<8-o,o=0);let a=new Uint8Array(i.length*2);return a.set(i,0),a.set(s,i.length),a.buffer}let r=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(r).buffer}};Vd.IpConverter=ag});var Mo=l(Ze=>{"use strict";var cg,ug,lg;Object.defineProperty(Ze,"__esModule",{value:!0});Ze.Name=Ze.RDNSequence=Ze.RelativeDistinguishedName=Ze.AttributeTypeAndValue=Ze.AttributeValue=Ze.DirectoryString=void 0;var It=(v(),g(A)),_e=S(),ck=og(),ki=class{teletexString;printableString;universalString;utf8String;bmpString;constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};Ze.DirectoryString=ki;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.TeletexString})],ki.prototype,"teletexString",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.PrintableString})],ki.prototype,"printableString",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.UniversalString})],ki.prototype,"universalString",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.Utf8String})],ki.prototype,"utf8String",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.BmpString})],ki.prototype,"bmpString",void 0);Ze.DirectoryString=ki=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Choice})],ki);var Gn=class extends ki{ia5String;anyValue;constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?ck.hex.encode(this.anyValue):super.toString())}};Ze.AttributeValue=Gn;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.IA5String})],Gn.prototype,"ia5String",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.Any})],Gn.prototype,"anyValue",void 0);Ze.AttributeValue=Gn=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Choice})],Gn);var jo=class{type="";value=new Gn;constructor(e={}){Object.assign(this,e)}};Ze.AttributeTypeAndValue=jo;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.ObjectIdentifier})],jo.prototype,"type",void 0);It.__decorate([(0,_e.AsnProp)({type:Gn})],jo.prototype,"value",void 0);var Gd=cg=class extends _e.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,cg.prototype)}};Ze.RelativeDistinguishedName=Gd;Ze.RelativeDistinguishedName=Gd=cg=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Set,itemType:jo})],Gd);var Fd=ug=class extends _e.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,ug.prototype)}};Ze.RDNSequence=Fd;Ze.RDNSequence=Fd=ug=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Sequence,itemType:Gd})],Fd);var fg=lg=class extends Fd{constructor(e){super(e),Object.setPrototypeOf(this,lg.prototype)}};Ze.Name=fg;Ze.Name=fg=lg=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Sequence})],fg)});var Fn=l(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.GeneralName=ur.EDIPartyName=ur.OtherName=ur.AsnIpConverter=void 0;var Bt=(v(),g(A)),Te=S(),h1=_1(),Hd=Mo();ur.AsnIpConverter={fromASN:t=>h1.IpConverter.toString(Te.AsnOctetStringConverter.fromASN(t)),toASN:t=>Te.AsnOctetStringConverter.toASN(h1.IpConverter.fromString(t))};var No=class{typeId="";value=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};ur.OtherName=No;Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.ObjectIdentifier})],No.prototype,"typeId",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.Any,context:0})],No.prototype,"value",void 0);var qo=class{nameAssigner;partyName=new Hd.DirectoryString;constructor(e={}){Object.assign(this,e)}};ur.EDIPartyName=qo;Bt.__decorate([(0,Te.AsnProp)({type:Hd.DirectoryString,optional:!0,context:0,implicit:!0})],qo.prototype,"nameAssigner",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Hd.DirectoryString,context:1,implicit:!0})],qo.prototype,"partyName",void 0);var lr=class{otherName;rfc822Name;dNSName;x400Address;directoryName;ediPartyName;uniformResourceIdentifier;iPAddress;registeredID;constructor(e={}){Object.assign(this,e)}};ur.GeneralName=lr;Bt.__decorate([(0,Te.AsnProp)({type:No,context:0,implicit:!0})],lr.prototype,"otherName",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.IA5String,context:1,implicit:!0})],lr.prototype,"rfc822Name",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.IA5String,context:2,implicit:!0})],lr.prototype,"dNSName",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.Any,context:3,implicit:!0})],lr.prototype,"x400Address",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Hd.Name,context:4,implicit:!1})],lr.prototype,"directoryName",void 0);Bt.__decorate([(0,Te.AsnProp)({type:qo,context:5})],lr.prototype,"ediPartyName",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.IA5String,context:6,implicit:!0})],lr.prototype,"uniformResourceIdentifier",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.OctetString,context:7,implicit:!0,converter:ur.AsnIpConverter})],lr.prototype,"iPAddress",void 0);Bt.__decorate([(0,Te.AsnProp)({type:Te.AsnPropTypes.ObjectIdentifier,context:8,implicit:!0})],lr.prototype,"registeredID",void 0);ur.GeneralName=lr=Bt.__decorate([(0,Te.AsnType)({type:Te.AsnTypeTypes.Choice})],lr)});var Ce=l(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.id_ce=ne.id_ad_caRepository=ne.id_ad_timeStamping=ne.id_ad_caIssuers=ne.id_ad_ocsp=ne.id_qt_unotice=ne.id_qt_csp=ne.id_ad=ne.id_kp=ne.id_qt=ne.id_pe=ne.id_pkix=void 0;ne.id_pkix="1.3.6.1.5.5.7";ne.id_pe=`${ne.id_pkix}.1`;ne.id_qt=`${ne.id_pkix}.2`;ne.id_kp=`${ne.id_pkix}.3`;ne.id_ad=`${ne.id_pkix}.48`;ne.id_qt_csp=`${ne.id_qt}.1`;ne.id_qt_unotice=`${ne.id_qt}.2`;ne.id_ad_ocsp=`${ne.id_ad}.1`;ne.id_ad_caIssuers=`${ne.id_ad}.2`;ne.id_ad_timeStamping=`${ne.id_ad}.3`;ne.id_ad_caRepository=`${ne.id_ad}.5`;ne.id_ce="2.5.29"});var _g=l(ji=>{"use strict";var dg;Object.defineProperty(ji,"__esModule",{value:!0});ji.AuthorityInfoAccessSyntax=ji.AccessDescription=ji.id_pe_authorityInfoAccess=void 0;var yg=(v(),g(A)),Ro=S(),g1=Fn(),uk=Ce();ji.id_pe_authorityInfoAccess=`${uk.id_pe}.1`;var Do=class{accessMethod="";accessLocation=new g1.GeneralName;constructor(e={}){Object.assign(this,e)}};ji.AccessDescription=Do;yg.__decorate([(0,Ro.AsnProp)({type:Ro.AsnPropTypes.ObjectIdentifier})],Do.prototype,"accessMethod",void 0);yg.__decorate([(0,Ro.AsnProp)({type:g1.GeneralName})],Do.prototype,"accessLocation",void 0);var pg=dg=class extends Ro.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,dg.prototype)}};ji.AuthorityInfoAccessSyntax=pg;ji.AuthorityInfoAccessSyntax=pg=dg=yg.__decorate([(0,Ro.AsnType)({type:Ro.AsnTypeTypes.Sequence,itemType:Do})],pg)});var gg=l(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.AuthorityKeyIdentifier=nn.KeyIdentifier=nn.id_ce_authorityKeyIdentifier=void 0;var hg=(v(),g(A)),Uo=S(),lk=Fn(),fk=Ce();nn.id_ce_authorityKeyIdentifier=`${fk.id_ce}.35`;var Wd=class extends Uo.OctetString{};nn.KeyIdentifier=Wd;var Lo=class{keyIdentifier;authorityCertIssuer;authorityCertSerialNumber;constructor(e={}){e&&Object.assign(this,e)}};nn.AuthorityKeyIdentifier=Lo;hg.__decorate([(0,Uo.AsnProp)({type:Wd,context:0,optional:!0,implicit:!0})],Lo.prototype,"keyIdentifier",void 0);hg.__decorate([(0,Uo.AsnProp)({type:lk.GeneralName,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Lo.prototype,"authorityCertIssuer",void 0);hg.__decorate([(0,Uo.AsnProp)({type:Uo.AsnPropTypes.Integer,context:2,optional:!0,implicit:!0,converter:Uo.AsnIntegerArrayBufferConverter})],Lo.prototype,"authorityCertSerialNumber",void 0)});var v1=l(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.BasicConstraints=Ko.id_ce_basicConstraints=void 0;var A1=(v(),g(A)),$d=S(),dk=Ce();Ko.id_ce_basicConstraints=`${dk.id_ce}.19`;var Au=class{cA=!1;pathLenConstraint;constructor(e={}){Object.assign(this,e)}};Ko.BasicConstraints=Au;A1.__decorate([(0,$d.AsnProp)({type:$d.AsnPropTypes.Boolean,defaultValue:!1})],Au.prototype,"cA",void 0);A1.__decorate([(0,$d.AsnProp)({type:$d.AsnPropTypes.Integer,optional:!0})],Au.prototype,"pathLenConstraint",void 0)});var mu=l(vu=>{"use strict";var Ag;Object.defineProperty(vu,"__esModule",{value:!0});vu.GeneralNames=void 0;var pk=(v(),g(A)),vg=S(),yk=Fn(),mg=Ag=class extends vg.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Ag.prototype)}};vu.GeneralNames=mg;vu.GeneralNames=mg=Ag=pk.__decorate([(0,vg.AsnType)({type:vg.AsnTypeTypes.Sequence,itemType:yk.GeneralName})],mg)});var b1=l(Hn=>{"use strict";var bg;Object.defineProperty(Hn,"__esModule",{value:!0});Hn.CertificateIssuer=Hn.id_ce_certificateIssuer=void 0;var _k=(v(),g(A)),m1=S(),hk=mu(),gk=Ce();Hn.id_ce_certificateIssuer=`${gk.id_ce}.29`;var Sg=bg=class extends hk.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,bg.prototype)}};Hn.CertificateIssuer=Sg;Hn.CertificateIssuer=Sg=bg=_k.__decorate([(0,m1.AsnType)({type:m1.AsnTypeTypes.Sequence})],Sg)});var S1=l(Be=>{"use strict";var wg;Object.defineProperty(Be,"__esModule",{value:!0});Be.CertificatePolicies=Be.PolicyInformation=Be.PolicyQualifierInfo=Be.Qualifier=Be.UserNotice=Be.NoticeReference=Be.DisplayText=Be.id_ce_certificatePolicies_anyPolicy=Be.id_ce_certificatePolicies=void 0;var ft=(v(),g(A)),fe=S(),Ak=Ce();Be.id_ce_certificatePolicies=`${Ak.id_ce}.32`;Be.id_ce_certificatePolicies_anyPolicy=`${Be.id_ce_certificatePolicies}.0`;var ii=class{ia5String;visibleString;bmpString;utf8String;constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};Be.DisplayText=ii;ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.IA5String})],ii.prototype,"ia5String",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.VisibleString})],ii.prototype,"visibleString",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.BmpString})],ii.prototype,"bmpString",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.Utf8String})],ii.prototype,"utf8String",void 0);Be.DisplayText=ii=ft.__decorate([(0,fe.AsnType)({type:fe.AsnTypeTypes.Choice})],ii);var Vo=class{organization=new ii;noticeNumbers=[];constructor(e={}){Object.assign(this,e)}};Be.NoticeReference=Vo;ft.__decorate([(0,fe.AsnProp)({type:ii})],Vo.prototype,"organization",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.Integer,repeated:"sequence"})],Vo.prototype,"noticeNumbers",void 0);var Go=class{noticeRef;explicitText;constructor(e={}){Object.assign(this,e)}};Be.UserNotice=Go;ft.__decorate([(0,fe.AsnProp)({type:Vo,optional:!0})],Go.prototype,"noticeRef",void 0);ft.__decorate([(0,fe.AsnProp)({type:ii,optional:!0})],Go.prototype,"explicitText",void 0);var bu=class{cPSuri;userNotice;constructor(e={}){Object.assign(this,e)}};Be.Qualifier=bu;ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.IA5String})],bu.prototype,"cPSuri",void 0);ft.__decorate([(0,fe.AsnProp)({type:Go})],bu.prototype,"userNotice",void 0);Be.Qualifier=bu=ft.__decorate([(0,fe.AsnType)({type:fe.AsnTypeTypes.Choice})],bu);var Fo=class{policyQualifierId="";qualifier=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Be.PolicyQualifierInfo=Fo;ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.ObjectIdentifier})],Fo.prototype,"policyQualifierId",void 0);ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.Any})],Fo.prototype,"qualifier",void 0);var Ho=class{policyIdentifier="";policyQualifiers;constructor(e={}){Object.assign(this,e)}};Be.PolicyInformation=Ho;ft.__decorate([(0,fe.AsnProp)({type:fe.AsnPropTypes.ObjectIdentifier})],Ho.prototype,"policyIdentifier",void 0);ft.__decorate([(0,fe.AsnProp)({type:Fo,repeated:"sequence",optional:!0})],Ho.prototype,"policyQualifiers",void 0);var Cg=wg=class extends fe.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,wg.prototype)}};Be.CertificatePolicies=Cg;Be.CertificatePolicies=Cg=wg=ft.__decorate([(0,fe.AsnType)({type:fe.AsnTypeTypes.Sequence,itemType:Ho})],Cg)});var Pg=l(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.CRLNumber=Wn.id_ce_cRLNumber=void 0;var w1=(v(),g(A)),zd=S(),vk=Ce();Wn.id_ce_cRLNumber=`${vk.id_ce}.20`;var Yd=class{value;constructor(e=0){this.value=e}};Wn.CRLNumber=Yd;w1.__decorate([(0,zd.AsnProp)({type:zd.AsnPropTypes.Integer})],Yd.prototype,"value",void 0);Wn.CRLNumber=Yd=w1.__decorate([(0,zd.AsnType)({type:zd.AsnTypeTypes.Choice})],Yd)});var P1=l($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.BaseCRLNumber=$n.id_ce_deltaCRLIndicator=void 0;var mk=(v(),g(A)),C1=S(),bk=Ce(),Sk=Pg();$n.id_ce_deltaCRLIndicator=`${bk.id_ce}.27`;var Eg=class extends Sk.CRLNumber{};$n.BaseCRLNumber=Eg;$n.BaseCRLNumber=Eg=mk.__decorate([(0,C1.AsnType)({type:C1.AsnTypeTypes.Choice})],Eg)});var Qd=l(ht=>{"use strict";var Tg;Object.defineProperty(ht,"__esModule",{value:!0});ht.CRLDistributionPoints=ht.DistributionPoint=ht.DistributionPointName=ht.Reason=ht.ReasonFlags=ht.id_ce_cRLDistributionPoints=void 0;var Yn=(v(),g(A)),Or=S(),wk=Mo(),E1=Fn(),Ck=Ce();ht.id_ce_cRLDistributionPoints=`${Ck.id_ce}.31`;var xr;(function(t){t[t.unused=1]="unused",t[t.keyCompromise=2]="keyCompromise",t[t.cACompromise=4]="cACompromise",t[t.affiliationChanged=8]="affiliationChanged",t[t.superseded=16]="superseded",t[t.cessationOfOperation=32]="cessationOfOperation",t[t.certificateHold=64]="certificateHold",t[t.privilegeWithdrawn=128]="privilegeWithdrawn",t[t.aACompromise=256]="aACompromise"})(xr||(ht.ReasonFlags=xr={}));var Jd=class extends Or.BitString{toJSON(){let e=[],r=this.toNumber();return r&xr.aACompromise&&e.push("aACompromise"),r&xr.affiliationChanged&&e.push("affiliationChanged"),r&xr.cACompromise&&e.push("cACompromise"),r&xr.certificateHold&&e.push("certificateHold"),r&xr.cessationOfOperation&&e.push("cessationOfOperation"),r&xr.keyCompromise&&e.push("keyCompromise"),r&xr.privilegeWithdrawn&&e.push("privilegeWithdrawn"),r&xr.superseded&&e.push("superseded"),r&xr.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}};ht.Reason=Jd;var Wo=class{fullName;nameRelativeToCRLIssuer;constructor(e={}){Object.assign(this,e)}};ht.DistributionPointName=Wo;Yn.__decorate([(0,Or.AsnProp)({type:E1.GeneralName,context:0,repeated:"sequence",implicit:!0})],Wo.prototype,"fullName",void 0);Yn.__decorate([(0,Or.AsnProp)({type:wk.RelativeDistinguishedName,context:1,implicit:!0})],Wo.prototype,"nameRelativeToCRLIssuer",void 0);ht.DistributionPointName=Wo=Yn.__decorate([(0,Or.AsnType)({type:Or.AsnTypeTypes.Choice})],Wo);var zn=class{distributionPoint;reasons;cRLIssuer;constructor(e={}){Object.assign(this,e)}};ht.DistributionPoint=zn;Yn.__decorate([(0,Or.AsnProp)({type:Wo,context:0,optional:!0})],zn.prototype,"distributionPoint",void 0);Yn.__decorate([(0,Or.AsnProp)({type:Jd,context:1,optional:!0,implicit:!0})],zn.prototype,"reasons",void 0);Yn.__decorate([(0,Or.AsnProp)({type:E1.GeneralName,context:2,optional:!0,repeated:"sequence",implicit:!0})],zn.prototype,"cRLIssuer",void 0);var xg=Tg=class extends Or.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Tg.prototype)}};ht.CRLDistributionPoints=xg;ht.CRLDistributionPoints=xg=Tg=Yn.__decorate([(0,Or.AsnType)({type:Or.AsnTypeTypes.Sequence,itemType:zn})],xg)});var O1=l(Jn=>{"use strict";var Og;Object.defineProperty(Jn,"__esModule",{value:!0});Jn.FreshestCRL=Jn.id_ce_freshestCRL=void 0;var Pk=(v(),g(A)),T1=S(),Ek=Ce(),x1=Qd();Jn.id_ce_freshestCRL=`${Ek.id_ce}.46`;var Ig=Og=class extends x1.CRLDistributionPoints{constructor(e){super(e),Object.setPrototypeOf(this,Og.prototype)}};Jn.FreshestCRL=Ig;Jn.FreshestCRL=Ig=Og=Pk.__decorate([(0,T1.AsnType)({type:T1.AsnTypeTypes.Sequence,itemType:x1.DistributionPoint})],Ig)});var B1=l($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.IssuingDistributionPoint=$o.id_ce_issuingDistributionPoint=void 0;var zo=(v(),g(A)),ni=S(),Tk=Ce(),I1=Qd();$o.id_ce_issuingDistributionPoint=`${Tk.id_ce}.28`;var Wt=class t{static ONLY=!1;distributionPoint;onlyContainsUserCerts=t.ONLY;onlyContainsCACerts=t.ONLY;onlySomeReasons;indirectCRL=t.ONLY;onlyContainsAttributeCerts=t.ONLY;constructor(e={}){Object.assign(this,e)}};$o.IssuingDistributionPoint=Wt;zo.__decorate([(0,ni.AsnProp)({type:I1.DistributionPointName,context:0,optional:!0})],Wt.prototype,"distributionPoint",void 0);zo.__decorate([(0,ni.AsnProp)({type:ni.AsnPropTypes.Boolean,context:1,defaultValue:Wt.ONLY,implicit:!0})],Wt.prototype,"onlyContainsUserCerts",void 0);zo.__decorate([(0,ni.AsnProp)({type:ni.AsnPropTypes.Boolean,context:2,defaultValue:Wt.ONLY,implicit:!0})],Wt.prototype,"onlyContainsCACerts",void 0);zo.__decorate([(0,ni.AsnProp)({type:I1.Reason,context:3,optional:!0,implicit:!0})],Wt.prototype,"onlySomeReasons",void 0);zo.__decorate([(0,ni.AsnProp)({type:ni.AsnPropTypes.Boolean,context:4,defaultValue:Wt.ONLY,implicit:!0})],Wt.prototype,"indirectCRL",void 0);zo.__decorate([(0,ni.AsnProp)({type:ni.AsnPropTypes.Boolean,context:5,defaultValue:Wt.ONLY,implicit:!0})],Wt.prototype,"onlyContainsAttributeCerts",void 0)});var j1=l(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.CRLReason=Mi.CRLReasons=Mi.id_ce_cRLReasons=void 0;var k1=(v(),g(A)),Xd=S(),xk=Ce();Mi.id_ce_cRLReasons=`${xk.id_ce}.21`;var Su;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(Su||(Mi.CRLReasons=Su={}));var Zd=class{reason=Su.unspecified;constructor(e=Su.unspecified){this.reason=e}toJSON(){return Su[this.reason]}toString(){return this.toJSON()}};Mi.CRLReason=Zd;k1.__decorate([(0,Xd.AsnProp)({type:Xd.AsnPropTypes.Enumerated})],Zd.prototype,"reason",void 0);Mi.CRLReason=Zd=k1.__decorate([(0,Xd.AsnType)({type:Xd.AsnTypeTypes.Choice})],Zd)});var M1=l(Re=>{"use strict";var Bg;Object.defineProperty(Re,"__esModule",{value:!0});Re.id_kp_OCSPSigning=Re.id_kp_timeStamping=Re.id_kp_emailProtection=Re.id_kp_codeSigning=Re.id_kp_clientAuth=Re.id_kp_serverAuth=Re.anyExtendedKeyUsage=Re.ExtendedKeyUsage=Re.id_ce_extKeyUsage=void 0;var Ok=(v(),g(A)),ep=S(),Qn=Ce();Re.id_ce_extKeyUsage=`${Qn.id_ce}.37`;var kg=Bg=class extends ep.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Bg.prototype)}};Re.ExtendedKeyUsage=kg;Re.ExtendedKeyUsage=kg=Bg=Ok.__decorate([(0,ep.AsnType)({type:ep.AsnTypeTypes.Sequence,itemType:ep.AsnPropTypes.ObjectIdentifier})],kg);Re.anyExtendedKeyUsage=`${Re.id_ce_extKeyUsage}.0`;Re.id_kp_serverAuth=`${Qn.id_kp}.1`;Re.id_kp_clientAuth=`${Qn.id_kp}.2`;Re.id_kp_codeSigning=`${Qn.id_kp}.3`;Re.id_kp_emailProtection=`${Qn.id_kp}.4`;Re.id_kp_timeStamping=`${Qn.id_kp}.8`;Re.id_kp_OCSPSigning=`${Qn.id_kp}.9`});var q1=l(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.InhibitAnyPolicy=Xn.id_ce_inhibitAnyPolicy=void 0;var N1=(v(),g(A)),wu=S(),Ik=Ce();Xn.id_ce_inhibitAnyPolicy=`${Ik.id_ce}.54`;var tp=class{value;constructor(e=new ArrayBuffer(0)){this.value=e}};Xn.InhibitAnyPolicy=tp;N1.__decorate([(0,wu.AsnProp)({type:wu.AsnPropTypes.Integer,converter:wu.AsnIntegerArrayBufferConverter})],tp.prototype,"value",void 0);Xn.InhibitAnyPolicy=tp=N1.__decorate([(0,wu.AsnType)({type:wu.AsnTypeTypes.Choice})],tp)});var D1=l(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.InvalidityDate=Zn.id_ce_invalidityDate=void 0;var R1=(v(),g(A)),rp=S(),Bk=Ce();Zn.id_ce_invalidityDate=`${Bk.id_ce}.24`;var ip=class{value=new Date;constructor(e){e&&(this.value=e)}};Zn.InvalidityDate=ip;R1.__decorate([(0,rp.AsnProp)({type:rp.AsnPropTypes.GeneralizedTime})],ip.prototype,"value",void 0);Zn.InvalidityDate=ip=R1.__decorate([(0,rp.AsnType)({type:rp.AsnTypeTypes.Choice})],ip)});var L1=l(es=>{"use strict";var jg;Object.defineProperty(es,"__esModule",{value:!0});es.IssueAlternativeName=es.id_ce_issuerAltName=void 0;var kk=(v(),g(A)),U1=S(),jk=mu(),Mk=Ce();es.id_ce_issuerAltName=`${Mk.id_ce}.18`;var Mg=jg=class extends jk.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,jg.prototype)}};es.IssueAlternativeName=Mg;es.IssueAlternativeName=Mg=jg=kk.__decorate([(0,U1.AsnType)({type:U1.AsnTypeTypes.Sequence})],Mg)});var K1=l(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.KeyUsage=sn.KeyUsageFlags=sn.id_ce_keyUsage=void 0;var Nk=S(),qk=Ce();sn.id_ce_keyUsage=`${qk.id_ce}.15`;var Ir;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(Ir||(sn.KeyUsageFlags=Ir={}));var Ng=class extends Nk.BitString{toJSON(){let e=this.toNumber(),r=[];return e&Ir.cRLSign&&r.push("crlSign"),e&Ir.dataEncipherment&&r.push("dataEncipherment"),e&Ir.decipherOnly&&r.push("decipherOnly"),e&Ir.digitalSignature&&r.push("digitalSignature"),e&Ir.encipherOnly&&r.push("encipherOnly"),e&Ir.keyAgreement&&r.push("keyAgreement"),e&Ir.keyCertSign&&r.push("keyCertSign"),e&Ir.keyEncipherment&&r.push("keyEncipherment"),e&Ir.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}};sn.KeyUsage=Ng});var G1=l(Br=>{"use strict";var qg;Object.defineProperty(Br,"__esModule",{value:!0});Br.NameConstraints=Br.GeneralSubtrees=Br.GeneralSubtree=Br.id_ce_nameConstraints=void 0;var Yo=(v(),g(A)),si=S(),V1=Fn(),Rk=Ce();Br.id_ce_nameConstraints=`${Rk.id_ce}.30`;var ts=class{base=new V1.GeneralName;minimum=0;maximum;constructor(e={}){Object.assign(this,e)}};Br.GeneralSubtree=ts;Yo.__decorate([(0,si.AsnProp)({type:V1.GeneralName})],ts.prototype,"base",void 0);Yo.__decorate([(0,si.AsnProp)({type:si.AsnPropTypes.Integer,context:0,defaultValue:0,implicit:!0})],ts.prototype,"minimum",void 0);Yo.__decorate([(0,si.AsnProp)({type:si.AsnPropTypes.Integer,context:1,optional:!0,implicit:!0})],ts.prototype,"maximum",void 0);var Cu=qg=class extends si.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,qg.prototype)}};Br.GeneralSubtrees=Cu;Br.GeneralSubtrees=Cu=qg=Yo.__decorate([(0,si.AsnType)({type:si.AsnTypeTypes.Sequence,itemType:ts})],Cu);var Pu=class{permittedSubtrees;excludedSubtrees;constructor(e={}){Object.assign(this,e)}};Br.NameConstraints=Pu;Yo.__decorate([(0,si.AsnProp)({type:Cu,context:0,optional:!0,implicit:!0})],Pu.prototype,"permittedSubtrees",void 0);Yo.__decorate([(0,si.AsnProp)({type:Cu,context:1,optional:!0,implicit:!0})],Pu.prototype,"excludedSubtrees",void 0)});var H1=l(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.PolicyConstraints=Qo.id_ce_policyConstraints=void 0;var F1=(v(),g(A)),Jo=S(),Dk=Ce();Qo.id_ce_policyConstraints=`${Dk.id_ce}.36`;var Eu=class{requireExplicitPolicy;inhibitPolicyMapping;constructor(e={}){Object.assign(this,e)}};Qo.PolicyConstraints=Eu;F1.__decorate([(0,Jo.AsnProp)({type:Jo.AsnPropTypes.Integer,context:0,implicit:!0,optional:!0,converter:Jo.AsnIntegerArrayBufferConverter})],Eu.prototype,"requireExplicitPolicy",void 0);F1.__decorate([(0,Jo.AsnProp)({type:Jo.AsnPropTypes.Integer,context:1,implicit:!0,optional:!0,converter:Jo.AsnIntegerArrayBufferConverter})],Eu.prototype,"inhibitPolicyMapping",void 0)});var W1=l(Ni=>{"use strict";var Rg;Object.defineProperty(Ni,"__esModule",{value:!0});Ni.PolicyMappings=Ni.PolicyMapping=Ni.id_ce_policyMappings=void 0;var Ug=(v(),g(A)),rs=S(),Uk=Ce();Ni.id_ce_policyMappings=`${Uk.id_ce}.33`;var Xo=class{issuerDomainPolicy="";subjectDomainPolicy="";constructor(e={}){Object.assign(this,e)}};Ni.PolicyMapping=Xo;Ug.__decorate([(0,rs.AsnProp)({type:rs.AsnPropTypes.ObjectIdentifier})],Xo.prototype,"issuerDomainPolicy",void 0);Ug.__decorate([(0,rs.AsnProp)({type:rs.AsnPropTypes.ObjectIdentifier})],Xo.prototype,"subjectDomainPolicy",void 0);var Dg=Rg=class extends rs.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Rg.prototype)}};Ni.PolicyMappings=Dg;Ni.PolicyMappings=Dg=Rg=Ug.__decorate([(0,rs.AsnType)({type:rs.AsnTypeTypes.Sequence,itemType:Xo})],Dg)});var z1=l(is=>{"use strict";var Lg;Object.defineProperty(is,"__esModule",{value:!0});is.SubjectAlternativeName=is.id_ce_subjectAltName=void 0;var Lk=(v(),g(A)),$1=S(),Kk=mu(),Vk=Ce();is.id_ce_subjectAltName=`${Vk.id_ce}.17`;var Kg=Lg=class extends Kk.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,Lg.prototype)}};is.SubjectAlternativeName=Kg;is.SubjectAlternativeName=Kg=Lg=Lk.__decorate([(0,$1.AsnType)({type:$1.AsnTypeTypes.Sequence})],Kg)});var Vg=l(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.Attribute=void 0;var Y1=(v(),g(A)),np=S(),Tu=class{type="";values=[];constructor(e={}){Object.assign(this,e)}};sp.Attribute=Tu;Y1.__decorate([(0,np.AsnProp)({type:np.AsnPropTypes.ObjectIdentifier})],Tu.prototype,"type",void 0);Y1.__decorate([(0,np.AsnProp)({type:np.AsnPropTypes.Any,repeated:"set"})],Tu.prototype,"values",void 0)});var J1=l(ns=>{"use strict";var Gg;Object.defineProperty(ns,"__esModule",{value:!0});ns.SubjectDirectoryAttributes=ns.id_ce_subjectDirectoryAttributes=void 0;var Gk=(v(),g(A)),Fg=S(),Fk=Vg(),Hk=Ce();ns.id_ce_subjectDirectoryAttributes=`${Hk.id_ce}.9`;var Hg=Gg=class extends Fg.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Gg.prototype)}};ns.SubjectDirectoryAttributes=Hg;ns.SubjectDirectoryAttributes=Hg=Gg=Gk.__decorate([(0,Fg.AsnType)({type:Fg.AsnTypeTypes.Sequence,itemType:Fk.Attribute})],Hg)});var Q1=l(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.SubjectKeyIdentifier=Zo.id_ce_subjectKeyIdentifier=void 0;var Wk=Ce(),$k=gg();Zo.id_ce_subjectKeyIdentifier=`${Wk.id_ce}.14`;var Wg=class extends $k.KeyIdentifier{};Zo.SubjectKeyIdentifier=Wg});var Z1=l(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.PrivateKeyUsagePeriod=ea.id_ce_privateKeyUsagePeriod=void 0;var X1=(v(),g(A)),op=S(),zk=Ce();ea.id_ce_privateKeyUsagePeriod=`${zk.id_ce}.16`;var xu=class{notBefore;notAfter;constructor(e={}){Object.assign(this,e)}};ea.PrivateKeyUsagePeriod=xu;X1.__decorate([(0,op.AsnProp)({type:op.AsnPropTypes.GeneralizedTime,context:0,implicit:!0,optional:!0})],xu.prototype,"notBefore",void 0);X1.__decorate([(0,op.AsnProp)({type:op.AsnPropTypes.GeneralizedTime,context:1,implicit:!0,optional:!0})],xu.prototype,"notAfter",void 0)});var tC=l(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.EntrustVersionInfo=oi.EntrustInfo=oi.EntrustInfoFlags=oi.id_entrust_entrustVersInfo=void 0;var eC=(v(),g(A)),ap=S();oi.id_entrust_entrustVersInfo="1.2.840.113533.7.65.0";var Ou;(function(t){t[t.keyUpdateAllowed=1]="keyUpdateAllowed",t[t.newExtensions=2]="newExtensions",t[t.pKIXCertificate=4]="pKIXCertificate"})(Ou||(oi.EntrustInfoFlags=Ou={}));var Iu=class extends ap.BitString{toJSON(){let e=[],r=this.toNumber();return r&Ou.pKIXCertificate&&e.push("pKIXCertificate"),r&Ou.newExtensions&&e.push("newExtensions"),r&Ou.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}};oi.EntrustInfo=Iu;var Bu=class{entrustVers="";entrustInfoFlags=new Iu;constructor(e={}){Object.assign(this,e)}};oi.EntrustVersionInfo=Bu;eC.__decorate([(0,ap.AsnProp)({type:ap.AsnPropTypes.GeneralString})],Bu.prototype,"entrustVers",void 0);eC.__decorate([(0,ap.AsnProp)({type:Iu})],Bu.prototype,"entrustInfoFlags",void 0)});var rC=l(ss=>{"use strict";var $g;Object.defineProperty(ss,"__esModule",{value:!0});ss.SubjectInfoAccessSyntax=ss.id_pe_subjectInfoAccess=void 0;var Yk=(v(),g(A)),zg=S(),Jk=Ce(),Qk=_g();ss.id_pe_subjectInfoAccess=`${Jk.id_pe}.11`;var Yg=$g=class extends zg.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,$g.prototype)}};ss.SubjectInfoAccessSyntax=Yg;ss.SubjectInfoAccessSyntax=Yg=$g=Yk.__decorate([(0,zg.AsnType)({type:zg.AsnTypeTypes.Sequence,itemType:Qk.AccessDescription})],Yg)});var iC=l(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var xe=(v(),g(A));xe.__exportStar(_g(),ve);xe.__exportStar(gg(),ve);xe.__exportStar(v1(),ve);xe.__exportStar(b1(),ve);xe.__exportStar(S1(),ve);xe.__exportStar(P1(),ve);xe.__exportStar(Qd(),ve);xe.__exportStar(O1(),ve);xe.__exportStar(B1(),ve);xe.__exportStar(Pg(),ve);xe.__exportStar(j1(),ve);xe.__exportStar(M1(),ve);xe.__exportStar(q1(),ve);xe.__exportStar(D1(),ve);xe.__exportStar(L1(),ve);xe.__exportStar(K1(),ve);xe.__exportStar(G1(),ve);xe.__exportStar(H1(),ve);xe.__exportStar(W1(),ve);xe.__exportStar(z1(),ve);xe.__exportStar(J1(),ve);xe.__exportStar(Q1(),ve);xe.__exportStar(Z1(),ve);xe.__exportStar(tC(),ve);xe.__exportStar(rC(),ve)});var os=l(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.AlgorithmIdentifier=void 0;var nC=(v(),g(A)),cp=S(),Xk=Gt(),ku=class t{algorithm="";parameters;constructor(e={}){Object.assign(this,e)}isEqual(e){return e instanceof t&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&(0,Xk.equal)(e.parameters,this.parameters)||e.parameters===this.parameters)}};up.AlgorithmIdentifier=ku;nC.__decorate([(0,cp.AsnProp)({type:cp.AsnPropTypes.ObjectIdentifier})],ku.prototype,"algorithm",void 0);nC.__decorate([(0,cp.AsnProp)({type:cp.AsnPropTypes.Any,optional:!0})],ku.prototype,"parameters",void 0)});var Qg=l(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.SubjectPublicKeyInfo=void 0;var sC=(v(),g(A)),Jg=S(),oC=os(),ju=class{algorithm=new oC.AlgorithmIdentifier;subjectPublicKey=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};lp.SubjectPublicKeyInfo=ju;sC.__decorate([(0,Jg.AsnProp)({type:oC.AlgorithmIdentifier})],ju.prototype,"algorithm",void 0);sC.__decorate([(0,Jg.AsnProp)({type:Jg.AsnPropTypes.BitString})],ju.prototype,"subjectPublicKey",void 0)});var fp=l(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.Time=void 0;var Xg=(v(),g(A)),ta=S(),Mu=class{utcTime;generalTime;constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){let r=new Date(e);r.setMilliseconds(0),r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,e)}getTime(){let e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};Nu.Time=Mu;Xg.__decorate([(0,ta.AsnProp)({type:ta.AsnPropTypes.UTCTime})],Mu.prototype,"utcTime",void 0);Xg.__decorate([(0,ta.AsnProp)({type:ta.AsnPropTypes.GeneralizedTime})],Mu.prototype,"generalTime",void 0);Nu.Time=Mu=Xg.__decorate([(0,ta.AsnType)({type:ta.AsnTypeTypes.Choice})],Mu)});var Zg=l(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});dp.Validity=void 0;var aC=(v(),g(A)),cC=S(),ra=fp(),qu=class{notBefore=new ra.Time(new Date);notAfter=new ra.Time(new Date);constructor(e){e&&(this.notBefore=new ra.Time(e.notBefore),this.notAfter=new ra.Time(e.notAfter))}};dp.Validity=qu;aC.__decorate([(0,cC.AsnProp)({type:ra.Time})],qu.prototype,"notBefore",void 0);aC.__decorate([(0,cC.AsnProp)({type:ra.Time})],qu.prototype,"notAfter",void 0)});var yp=l(as=>{"use strict";var eA;Object.defineProperty(as,"__esModule",{value:!0});as.Extensions=as.Extension=void 0;var pp=(v(),g(A)),ai=S(),on=class t{static CRITICAL=!1;extnID="";critical=t.CRITICAL;extnValue=new ai.OctetString;constructor(e={}){Object.assign(this,e)}};as.Extension=on;pp.__decorate([(0,ai.AsnProp)({type:ai.AsnPropTypes.ObjectIdentifier})],on.prototype,"extnID",void 0);pp.__decorate([(0,ai.AsnProp)({type:ai.AsnPropTypes.Boolean,defaultValue:on.CRITICAL})],on.prototype,"critical",void 0);pp.__decorate([(0,ai.AsnProp)({type:ai.OctetString})],on.prototype,"extnValue",void 0);var tA=eA=class extends ai.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,eA.prototype)}};as.Extensions=tA;as.Extensions=tA=eA=pp.__decorate([(0,ai.AsnType)({type:ai.AsnTypeTypes.Sequence,itemType:on})],tA)});var rA=l(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.Version=void 0;var uC;(function(t){t[t.v1=0]="v1",t[t.v2=1]="v2",t[t.v3=2]="v3"})(uC||(_p.Version=uC={}))});var iA=l(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.TBSCertificate=void 0;var ci=(v(),g(A)),Ct=S(),lC=os(),hp=Mo(),fC=Qg(),dC=Zg(),Zk=yp(),pC=rA(),$t=class{version=pC.Version.v1;serialNumber=new ArrayBuffer(0);signature=new lC.AlgorithmIdentifier;issuer=new hp.Name;validity=new dC.Validity;subject=new hp.Name;subjectPublicKeyInfo=new fC.SubjectPublicKeyInfo;issuerUniqueID;subjectUniqueID;extensions;constructor(e={}){Object.assign(this,e)}};gp.TBSCertificate=$t;ci.__decorate([(0,Ct.AsnProp)({type:Ct.AsnPropTypes.Integer,context:0,defaultValue:pC.Version.v1})],$t.prototype,"version",void 0);ci.__decorate([(0,Ct.AsnProp)({type:Ct.AsnPropTypes.Integer,converter:Ct.AsnIntegerArrayBufferConverter})],$t.prototype,"serialNumber",void 0);ci.__decorate([(0,Ct.AsnProp)({type:lC.AlgorithmIdentifier})],$t.prototype,"signature",void 0);ci.__decorate([(0,Ct.AsnProp)({type:hp.Name})],$t.prototype,"issuer",void 0);ci.__decorate([(0,Ct.AsnProp)({type:dC.Validity})],$t.prototype,"validity",void 0);ci.__decorate([(0,Ct.AsnProp)({type:hp.Name})],$t.prototype,"subject",void 0);ci.__decorate([(0,Ct.AsnProp)({type:fC.SubjectPublicKeyInfo})],$t.prototype,"subjectPublicKeyInfo",void 0);ci.__decorate([(0,Ct.AsnProp)({type:Ct.AsnPropTypes.BitString,context:1,implicit:!0,optional:!0})],$t.prototype,"issuerUniqueID",void 0);ci.__decorate([(0,Ct.AsnProp)({type:Ct.AsnPropTypes.BitString,context:2,implicit:!0,optional:!0})],$t.prototype,"subjectUniqueID",void 0);ci.__decorate([(0,Ct.AsnProp)({type:Zk.Extensions,context:3,optional:!0})],$t.prototype,"extensions",void 0)});var hC=l(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.Certificate=void 0;var nA=(v(),g(A)),Ap=S(),yC=os(),_C=iA(),ia=class{tbsCertificate=new _C.TBSCertificate;tbsCertificateRaw;signatureAlgorithm=new yC.AlgorithmIdentifier;signatureValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};vp.Certificate=ia;nA.__decorate([(0,Ap.AsnProp)({type:_C.TBSCertificate,raw:!0})],ia.prototype,"tbsCertificate",void 0);nA.__decorate([(0,Ap.AsnProp)({type:yC.AlgorithmIdentifier})],ia.prototype,"signatureAlgorithm",void 0);nA.__decorate([(0,Ap.AsnProp)({type:Ap.AsnPropTypes.BitString})],ia.prototype,"signatureValue",void 0)});var sA=l(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.TBSCertList=na.RevokedCertificate=void 0;var li=(v(),g(A)),zt=S(),gC=os(),AC=Mo(),Ru=fp(),vC=yp(),cs=class{userCertificate=new ArrayBuffer(0);revocationDate=new Ru.Time;crlEntryExtensions;constructor(e={}){Object.assign(this,e)}};na.RevokedCertificate=cs;li.__decorate([(0,zt.AsnProp)({type:zt.AsnPropTypes.Integer,converter:zt.AsnIntegerArrayBufferConverter})],cs.prototype,"userCertificate",void 0);li.__decorate([(0,zt.AsnProp)({type:Ru.Time})],cs.prototype,"revocationDate",void 0);li.__decorate([(0,zt.AsnProp)({type:vC.Extension,optional:!0,repeated:"sequence"})],cs.prototype,"crlEntryExtensions",void 0);var ui=class{version;signature=new gC.AlgorithmIdentifier;issuer=new AC.Name;thisUpdate=new Ru.Time;nextUpdate;revokedCertificates;crlExtensions;constructor(e={}){Object.assign(this,e)}};na.TBSCertList=ui;li.__decorate([(0,zt.AsnProp)({type:zt.AsnPropTypes.Integer,optional:!0})],ui.prototype,"version",void 0);li.__decorate([(0,zt.AsnProp)({type:gC.AlgorithmIdentifier})],ui.prototype,"signature",void 0);li.__decorate([(0,zt.AsnProp)({type:AC.Name})],ui.prototype,"issuer",void 0);li.__decorate([(0,zt.AsnProp)({type:Ru.Time})],ui.prototype,"thisUpdate",void 0);li.__decorate([(0,zt.AsnProp)({type:Ru.Time,optional:!0})],ui.prototype,"nextUpdate",void 0);li.__decorate([(0,zt.AsnProp)({type:cs,repeated:"sequence",optional:!0})],ui.prototype,"revokedCertificates",void 0);li.__decorate([(0,zt.AsnProp)({type:vC.Extension,optional:!0,context:0,repeated:"sequence"})],ui.prototype,"crlExtensions",void 0)});var SC=l(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.CertificateList=void 0;var oA=(v(),g(A)),mp=S(),mC=os(),bC=sA(),sa=class{tbsCertList=new bC.TBSCertList;tbsCertListRaw;signatureAlgorithm=new mC.AlgorithmIdentifier;signature=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};bp.CertificateList=sa;oA.__decorate([(0,mp.AsnProp)({type:bC.TBSCertList,raw:!0})],sa.prototype,"tbsCertList",void 0);oA.__decorate([(0,mp.AsnProp)({type:mC.AlgorithmIdentifier})],sa.prototype,"signatureAlgorithm",void 0);oA.__decorate([(0,mp.AsnProp)({type:mp.AsnPropTypes.BitString})],sa.prototype,"signature",void 0)});var X=l(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});var gt=(v(),g(A));gt.__exportStar(iC(),st);gt.__exportStar(os(),st);gt.__exportStar(Vg(),st);gt.__exportStar(hC(),st);gt.__exportStar(SC(),st);gt.__exportStar(yp(),st);gt.__exportStar(Fn(),st);gt.__exportStar(mu(),st);gt.__exportStar(Mo(),st);gt.__exportStar(Ce(),st);gt.__exportStar(Qg(),st);gt.__exportStar(sA(),st);gt.__exportStar(iA(),st);gt.__exportStar(fp(),st);gt.__exportStar(rA(),st);gt.__exportStar(Zg(),st)});var Du=l(cA=>{"use strict";Object.defineProperty(cA,"__esModule",{value:!0});cA.getCertificateInfo=ej;var wC=S(),aA=X(),CC={"2.5.4.6":"C","2.5.4.10":"O","2.5.4.11":"OU","2.5.4.3":"CN"};function ej(t){let e=wC.AsnParser.parse(t,aA.Certificate),r=e.tbsCertificate,i={combined:""};r.issuer.forEach(([o])=>{let a=CC[o.type];a&&(i[a]=o.value.toString())}),i.combined=PC(i);let n={combined:""};r.subject.forEach(([o])=>{let a=CC[o.type];a&&(n[a]=o.value.toString())}),n.combined=PC(n);let s=!1;if(r.extensions)for(let o of r.extensions)o.extnID===aA.id_ce_basicConstraints&&(s=wC.AsnParser.parse(o.extnValue,aA.BasicConstraints).cA);return{issuer:i,subject:n,version:r.version,basicConstraintsCA:s,notBefore:r.validity.notBefore.getTime(),notAfter:r.validity.notAfter.getTime(),parsedCertificate:e}}function PC(t){let e=[];return t.C&&e.push(t.C),t.O&&e.push(t.O),t.OU&&e.push(t.OU),t.CN&&e.push(t.CN),e.join(" : ")}});var TC=l(()=>{var EC;(function(t){(function(e){var r=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),i=n(t);typeof r.Reflect<"u"&&(i=n(r.Reflect,i)),e(i,r),typeof r.Reflect>"u"&&(r.Reflect=t);function n(c,u){return function(f,d){Object.defineProperty(c,f,{configurable:!0,writable:!0,value:d}),u&&u(f,d)}}function s(){try{return Function("return this;")()}catch{}}function o(){try{return(0,eval)("(function() { return this; })()")}catch{}}function a(){return s()||o()}})(function(e,r){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,u=!a&&!c,f={create:a?function(){return X_(Object.create(null))}:c?function(){return X_({__proto__:null})}:function(){return X_({})},has:u?function(_,h){return i.call(_,h)}:function(_,h){return h in _},get:u?function(_,h){return i.call(_,h)?_[h]:void 0}:function(_,h){return _[h]}},d=Object.getPrototypeOf(Function),y=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:jx(),m=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Mx(),x=typeof WeakMap=="function"?WeakMap:Nx(),T=n?Symbol.for("@reflect-metadata:registry"):void 0,I=Ix(),U=Bx(I);function ee(_,h,w,k){if(F(w)){if(!vb(_))throw new TypeError;if(!mb(h))throw new TypeError;return Sr(_,h)}else{if(!vb(_))throw new TypeError;if(!J(h))throw new TypeError;if(!J(k)&&!F(k)&&!$r(k))throw new TypeError;return $r(k)&&(k=void 0),w=zr(w),zi(_,h,w,k)}}e("decorate",ee);function pe(_,h){function w(k,H){if(!J(k))throw new TypeError;if(!F(H)&&!xx(H))throw new TypeError;Wr(_,h,k,H)}return w}e("metadata",pe);function Ae(_,h,w,k){if(!J(w))throw new TypeError;return F(k)||(k=zr(k)),Wr(_,h,w,k)}e("defineMetadata",Ae);function oe(_,h,w){if(!J(h))throw new TypeError;return F(w)||(w=zr(w)),Ye(_,h,w)}e("hasMetadata",oe);function ze(_,h,w){if(!J(h))throw new TypeError;return F(w)||(w=zr(w)),pt(_,h,w)}e("hasOwnMetadata",ze);function it(_,h,w){if(!J(h))throw new TypeError;return F(w)||(w=zr(w)),yt(_,h,w)}e("getMetadata",it);function ut(_,h,w){if(!J(h))throw new TypeError;return F(w)||(w=zr(w)),Mn(_,h,w)}e("getOwnMetadata",ut);function lt(_,h){if(!J(_))throw new TypeError;return F(h)||(h=zr(h)),Ci(_,h)}e("getMetadataKeys",lt);function br(_,h){if(!J(_))throw new TypeError;return F(h)||(h=zr(h)),Pi(_,h)}e("getOwnMetadataKeys",br);function ir(_,h,w){if(!J(h))throw new TypeError;if(F(w)||(w=zr(w)),!J(h))throw new TypeError;F(w)||(w=zr(w));var k=mc(h,w,!1);return F(k)?!1:k.OrdinaryDeleteMetadata(_,h,w)}e("deleteMetadata",ir);function Sr(_,h){for(var w=_.length-1;w>=0;--w){var k=_[w],H=k(h);if(!F(H)&&!$r(H)){if(!mb(H))throw new TypeError;h=H}}return h}function zi(_,h,w,k){for(var H=_.length-1;H>=0;--H){var Le=_[H],Je=Le(h,w,k);if(!F(Je)&&!$r(Je)){if(!J(Je))throw new TypeError;k=Je}}return k}function Ye(_,h,w){var k=pt(_,h,w);if(k)return!0;var H=Q_(h);return $r(H)?!1:Ye(_,H,w)}function pt(_,h,w){var k=mc(h,w,!1);return F(k)?!1:Ji(k.OrdinaryHasOwnMetadata(_,h,w))}function yt(_,h,w){var k=pt(_,h,w);if(k)return Mn(_,h,w);var H=Q_(h);if(!$r(H))return yt(_,H,w)}function Mn(_,h,w){var k=mc(h,w,!1);if(!F(k))return k.OrdinaryGetOwnMetadata(_,h,w)}function Wr(_,h,w,k){var H=mc(w,k,!0);H.OrdinaryDefineOwnMetadata(_,h,w,k)}function Ci(_,h){var w=Pi(_,h),k=Q_(_);if(k===null)return w;var H=Ci(k,h);if(H.length<=0)return w;if(w.length<=0)return H;for(var Le=new m,Je=[],te=0,M=w;te<M.length;te++){var D=M[te],V=Le.has(D);V||(Le.add(D),Je.push(D))}for(var G=0,ie=H;G<ie.length;G++){var D=ie[G],V=Le.has(D);V||(Le.add(D),Je.push(D))}return Je}function Pi(_,h){var w=mc(_,h,!1);return w?w.OrdinaryOwnMetadataKeys(_,h):[]}function Kt(_){if(_===null)return 1;switch(typeof _){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return _===null?1:6;default:return 6}}function F(_){return _===void 0}function $r(_){return _===null}function po(_){return typeof _=="symbol"}function J(_){return typeof _=="object"?_!==null:typeof _=="function"}function Vt(_,h){switch(Kt(_)){case 0:return _;case 1:return _;case 2:return _;case 3:return _;case 4:return _;case 5:return _}var w=h===3?"string":h===5?"number":"default",k=bb(_,s);if(k!==void 0){var H=k.call(_,w);if(J(H))throw new TypeError;return H}return Yi(_,w==="default"?"number":w)}function Yi(_,h){if(h==="string"){var w=_.toString;if(yo(w)){var k=w.call(_);if(!J(k))return k}var H=_.valueOf;if(yo(H)){var k=H.call(_);if(!J(k))return k}}else{var H=_.valueOf;if(yo(H)){var k=H.call(_);if(!J(k))return k}var Le=_.toString;if(yo(Le)){var k=Le.call(_);if(!J(k))return k}}throw new TypeError}function Ji(_){return!!_}function Nn(_){return""+_}function zr(_){var h=Vt(_,3);return po(h)?h:Nn(h)}function vb(_){return Array.isArray?Array.isArray(_):_ instanceof Object?_ instanceof Array:Object.prototype.toString.call(_)==="[object Array]"}function yo(_){return typeof _=="function"}function mb(_){return typeof _=="function"}function xx(_){switch(Kt(_)){case 3:return!0;case 4:return!0;default:return!1}}function J_(_,h){return _===h||_!==_&&h!==h}function bb(_,h){var w=_[h];if(w!=null){if(!yo(w))throw new TypeError;return w}}function Sb(_){var h=bb(_,o);if(!yo(h))throw new TypeError;var w=h.call(_);if(!J(w))throw new TypeError;return w}function wb(_){return _.value}function Cb(_){var h=_.next();return h.done?!1:h}function Pb(_){var h=_.return;h&&h.call(_)}function Q_(_){var h=Object.getPrototypeOf(_);if(typeof _!="function"||_===d||h!==d)return h;var w=_.prototype,k=w&&Object.getPrototypeOf(w);if(k==null||k===Object.prototype)return h;var H=k.constructor;return typeof H!="function"||H===_?h:H}function Ox(){var _;!F(T)&&typeof r.Reflect<"u"&&!(T in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(_=kx(r.Reflect));var h,w,k,H=new x,Le={registerProvider:Je,getProvider:M,setProvider:V};return Le;function Je(G){if(!Object.isExtensible(Le))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case _===G:break;case F(h):h=G;break;case h===G:break;case F(w):w=G;break;case w===G:break;default:k===void 0&&(k=new m),k.add(G);break}}function te(G,ie){if(!F(h)){if(h.isProviderFor(G,ie))return h;if(!F(w)){if(w.isProviderFor(G,ie))return h;if(!F(k))for(var Pe=Sb(k);;){var Ke=Cb(Pe);if(!Ke)return;var wr=wb(Ke);if(wr.isProviderFor(G,ie))return Pb(Pe),wr}}}if(!F(_)&&_.isProviderFor(G,ie))return _}function M(G,ie){var Pe=H.get(G),Ke;return F(Pe)||(Ke=Pe.get(ie)),F(Ke)&&(Ke=te(G,ie),F(Ke)||(F(Pe)&&(Pe=new y,H.set(G,Pe)),Pe.set(ie,Ke))),Ke}function D(G){if(F(G))throw new TypeError;return h===G||w===G||!F(k)&&k.has(G)}function V(G,ie,Pe){if(!D(Pe))throw new Error("Metadata provider not registered.");var Ke=M(G,ie);if(Ke!==Pe){if(!F(Ke))return!1;var wr=H.get(G);F(wr)&&(wr=new y,H.set(G,wr)),wr.set(ie,Pe)}return!0}}function Ix(){var _;return!F(T)&&J(r.Reflect)&&Object.isExtensible(r.Reflect)&&(_=r.Reflect[T]),F(_)&&(_=Ox()),!F(T)&&J(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,T,{enumerable:!1,configurable:!1,writable:!1,value:_}),_}function Bx(_){var h=new x,w={isProviderFor:function(D,V){var G=h.get(D);return F(G)?!1:G.has(V)},OrdinaryDefineOwnMetadata:Je,OrdinaryHasOwnMetadata:H,OrdinaryGetOwnMetadata:Le,OrdinaryOwnMetadataKeys:te,OrdinaryDeleteMetadata:M};return I.registerProvider(w),w;function k(D,V,G){var ie=h.get(D),Pe=!1;if(F(ie)){if(!G)return;ie=new y,h.set(D,ie),Pe=!0}var Ke=ie.get(V);if(F(Ke)){if(!G)return;if(Ke=new y,ie.set(V,Ke),!_.setProvider(D,V,w))throw ie.delete(V),Pe&&h.delete(D),new Error("Wrong provider for target.")}return Ke}function H(D,V,G){var ie=k(V,G,!1);return F(ie)?!1:Ji(ie.has(D))}function Le(D,V,G){var ie=k(V,G,!1);if(!F(ie))return ie.get(D)}function Je(D,V,G,ie){var Pe=k(G,ie,!0);Pe.set(D,V)}function te(D,V){var G=[],ie=k(D,V,!1);if(F(ie))return G;for(var Pe=ie.keys(),Ke=Sb(Pe),wr=0;;){var Eb=Cb(Ke);if(!Eb)return G.length=wr,G;var qx=wb(Eb);try{G[wr]=qx}catch(Rx){try{Pb(Ke)}finally{throw Rx}}wr++}}function M(D,V,G){var ie=k(V,G,!1);if(F(ie)||!ie.delete(D))return!1;if(ie.size===0){var Pe=h.get(V);F(Pe)||(Pe.delete(G),Pe.size===0&&h.delete(Pe))}return!0}}function kx(_){var h=_.defineMetadata,w=_.hasOwnMetadata,k=_.getOwnMetadata,H=_.getOwnMetadataKeys,Le=_.deleteMetadata,Je=new x,te={isProviderFor:function(M,D){var V=Je.get(M);return!F(V)&&V.has(D)?!0:H(M,D).length?(F(V)&&(V=new m,Je.set(M,V)),V.add(D),!0):!1},OrdinaryDefineOwnMetadata:h,OrdinaryHasOwnMetadata:w,OrdinaryGetOwnMetadata:k,OrdinaryOwnMetadataKeys:H,OrdinaryDeleteMetadata:Le};return te}function mc(_,h,w){var k=I.getProvider(_,h);if(!F(k))return k;if(w){if(I.setProvider(_,h,U))return U;throw new Error("Illegal state.")}}function jx(){var _={},h=[],w=(function(){function te(M,D,V){this._index=0,this._keys=M,this._values=D,this._selector=V}return te.prototype["@@iterator"]=function(){return this},te.prototype[o]=function(){return this},te.prototype.next=function(){var M=this._index;if(M>=0&&M<this._keys.length){var D=this._selector(this._keys[M],this._values[M]);return M+1>=this._keys.length?(this._index=-1,this._keys=h,this._values=h):this._index++,{value:D,done:!1}}return{value:void 0,done:!0}},te.prototype.throw=function(M){throw this._index>=0&&(this._index=-1,this._keys=h,this._values=h),M},te.prototype.return=function(M){return this._index>=0&&(this._index=-1,this._keys=h,this._values=h),{value:M,done:!0}},te})(),k=(function(){function te(){this._keys=[],this._values=[],this._cacheKey=_,this._cacheIndex=-2}return Object.defineProperty(te.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),te.prototype.has=function(M){return this._find(M,!1)>=0},te.prototype.get=function(M){var D=this._find(M,!1);return D>=0?this._values[D]:void 0},te.prototype.set=function(M,D){var V=this._find(M,!0);return this._values[V]=D,this},te.prototype.delete=function(M){var D=this._find(M,!1);if(D>=0){for(var V=this._keys.length,G=D+1;G<V;G++)this._keys[G-1]=this._keys[G],this._values[G-1]=this._values[G];return this._keys.length--,this._values.length--,J_(M,this._cacheKey)&&(this._cacheKey=_,this._cacheIndex=-2),!0}return!1},te.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=_,this._cacheIndex=-2},te.prototype.keys=function(){return new w(this._keys,this._values,H)},te.prototype.values=function(){return new w(this._keys,this._values,Le)},te.prototype.entries=function(){return new w(this._keys,this._values,Je)},te.prototype["@@iterator"]=function(){return this.entries()},te.prototype[o]=function(){return this.entries()},te.prototype._find=function(M,D){if(!J_(this._cacheKey,M)){this._cacheIndex=-1;for(var V=0;V<this._keys.length;V++)if(J_(this._keys[V],M)){this._cacheIndex=V;break}}return this._cacheIndex<0&&D&&(this._cacheIndex=this._keys.length,this._keys.push(M),this._values.push(void 0)),this._cacheIndex},te})();return k;function H(te,M){return te}function Le(te,M){return M}function Je(te,M){return[te,M]}}function Mx(){var _=(function(){function h(){this._map=new y}return Object.defineProperty(h.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),h.prototype.has=function(w){return this._map.has(w)},h.prototype.add=function(w){return this._map.set(w,w),this},h.prototype.delete=function(w){return this._map.delete(w)},h.prototype.clear=function(){this._map.clear()},h.prototype.keys=function(){return this._map.keys()},h.prototype.values=function(){return this._map.keys()},h.prototype.entries=function(){return this._map.entries()},h.prototype["@@iterator"]=function(){return this.keys()},h.prototype[o]=function(){return this.keys()},h})();return _}function Nx(){var _=16,h=f.create(),w=k();return(function(){function M(){this._key=k()}return M.prototype.has=function(D){var V=H(D,!1);return V!==void 0?f.has(V,this._key):!1},M.prototype.get=function(D){var V=H(D,!1);return V!==void 0?f.get(V,this._key):void 0},M.prototype.set=function(D,V){var G=H(D,!0);return G[this._key]=V,this},M.prototype.delete=function(D){var V=H(D,!1);return V!==void 0?delete V[this._key]:!1},M.prototype.clear=function(){this._key=k()},M})();function k(){var M;do M="@@WeakMap@@"+te();while(f.has(h,M));return h[M]=!0,M}function H(M,D){if(!i.call(M,w)){if(!D)return;Object.defineProperty(M,w,{value:f.create()})}return M[w]}function Le(M,D){for(var V=0;V<D;++V)M[V]=Math.random()*255|0;return M}function Je(M){if(typeof Uint8Array=="function"){var D=new Uint8Array(M);return typeof crypto<"u"?crypto.getRandomValues(D):typeof msCrypto<"u"?msCrypto.getRandomValues(D):Le(D,M),D}return Le(new Array(M),M)}function te(){var M=Je(_);M[6]=M[6]&79|64,M[8]=M[8]&191|128;for(var D="",V=0;V<_;++V){var G=M[V];(V===4||V===6||V===8)&&(D+="-"),G<16&&(D+="0"),D+=G.toString(16).toLowerCase()}return D}}function X_(_){return _.__=void 0,delete _.__,_}})})(EC||(EC={}))});var Lu=l(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.IssuerAndSerialNumber=void 0;var xC=(v(),g(A)),Sp=S(),OC=X(),Uu=class{issuer=new OC.Name;serialNumber=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};wp.IssuerAndSerialNumber=Uu;xC.__decorate([(0,Sp.AsnProp)({type:OC.Name})],Uu.prototype,"issuer",void 0);xC.__decorate([(0,Sp.AsnProp)({type:Sp.AsnPropTypes.Integer,converter:Sp.AsnIntegerArrayBufferConverter})],Uu.prototype,"serialNumber",void 0)});var lA=l(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.SignerIdentifier=void 0;var uA=(v(),g(A)),Cp=S(),tj=X(),rj=Lu(),Ku=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};Vu.SignerIdentifier=Ku;uA.__decorate([(0,Cp.AsnProp)({type:tj.SubjectKeyIdentifier,context:0,implicit:!0})],Ku.prototype,"subjectKeyIdentifier",void 0);uA.__decorate([(0,Cp.AsnProp)({type:rj.IssuerAndSerialNumber})],Ku.prototype,"issuerAndSerialNumber",void 0);Vu.SignerIdentifier=Ku=uA.__decorate([(0,Cp.AsnType)({type:Cp.AsnTypeTypes.Choice})],Ku)});var fi=l(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.KeyDerivationAlgorithmIdentifier=De.MessageAuthenticationCodeAlgorithm=De.ContentEncryptionAlgorithmIdentifier=De.KeyEncryptionAlgorithmIdentifier=De.SignatureAlgorithmIdentifier=De.DigestAlgorithmIdentifier=De.CMSVersion=void 0;var oa=(v(),g(A)),aa=X(),fr=S(),IC;(function(t){t[t.v0=0]="v0",t[t.v1=1]="v1",t[t.v2=2]="v2",t[t.v3=3]="v3",t[t.v4=4]="v4",t[t.v5=5]="v5"})(IC||(De.CMSVersion=IC={}));var fA=class extends aa.AlgorithmIdentifier{};De.DigestAlgorithmIdentifier=fA;De.DigestAlgorithmIdentifier=fA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],fA);var dA=class extends aa.AlgorithmIdentifier{};De.SignatureAlgorithmIdentifier=dA;De.SignatureAlgorithmIdentifier=dA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],dA);var pA=class extends aa.AlgorithmIdentifier{};De.KeyEncryptionAlgorithmIdentifier=pA;De.KeyEncryptionAlgorithmIdentifier=pA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],pA);var yA=class extends aa.AlgorithmIdentifier{};De.ContentEncryptionAlgorithmIdentifier=yA;De.ContentEncryptionAlgorithmIdentifier=yA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],yA);var _A=class extends aa.AlgorithmIdentifier{};De.MessageAuthenticationCodeAlgorithm=_A;De.MessageAuthenticationCodeAlgorithm=_A=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],_A);var hA=class extends aa.AlgorithmIdentifier{};De.KeyDerivationAlgorithmIdentifier=hA;De.KeyDerivationAlgorithmIdentifier=hA=oa.__decorate([(0,fr.AsnType)({type:fr.AsnTypeTypes.Sequence})],hA)});var Tp=l(Ep=>{"use strict";Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Attribute=void 0;var BC=(v(),g(A)),Pp=S(),Gu=class{attrType="";attrValues=[];constructor(e={}){Object.assign(this,e)}};Ep.Attribute=Gu;BC.__decorate([(0,Pp.AsnProp)({type:Pp.AsnPropTypes.ObjectIdentifier})],Gu.prototype,"attrType",void 0);BC.__decorate([(0,Pp.AsnProp)({type:Pp.AsnPropTypes.Any,repeated:"set"})],Gu.prototype,"attrValues",void 0)});var xp=l(us=>{"use strict";var gA;Object.defineProperty(us,"__esModule",{value:!0});us.SignerInfos=us.SignerInfo=void 0;var an=(v(),g(A)),Yt=S(),kC=lA(),Fu=fi(),jC=Tp(),kr=class{version=Fu.CMSVersion.v0;sid=new kC.SignerIdentifier;digestAlgorithm=new Fu.DigestAlgorithmIdentifier;signedAttrs;signedAttrsRaw;signatureAlgorithm=new Fu.SignatureAlgorithmIdentifier;signature=new Yt.OctetString;unsignedAttrs;constructor(e={}){Object.assign(this,e)}};us.SignerInfo=kr;an.__decorate([(0,Yt.AsnProp)({type:Yt.AsnPropTypes.Integer})],kr.prototype,"version",void 0);an.__decorate([(0,Yt.AsnProp)({type:kC.SignerIdentifier})],kr.prototype,"sid",void 0);an.__decorate([(0,Yt.AsnProp)({type:Fu.DigestAlgorithmIdentifier})],kr.prototype,"digestAlgorithm",void 0);an.__decorate([(0,Yt.AsnProp)({type:jC.Attribute,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],kr.prototype,"signedAttrs",void 0);an.__decorate([(0,Yt.AsnProp)({type:Fu.SignatureAlgorithmIdentifier})],kr.prototype,"signatureAlgorithm",void 0);an.__decorate([(0,Yt.AsnProp)({type:Yt.OctetString})],kr.prototype,"signature",void 0);an.__decorate([(0,Yt.AsnProp)({type:jC.Attribute,repeated:"set",context:1,implicit:!0,optional:!0})],kr.prototype,"unsignedAttrs",void 0);var AA=gA=class extends Yt.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,gA.prototype)}};us.SignerInfos=AA;us.SignerInfos=AA=gA=an.__decorate([(0,Yt.AsnType)({type:Yt.AsnTypeTypes.Set,itemType:kr})],AA)});var NC=l(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.CounterSignature=ls.id_counterSignature=void 0;var ij=(v(),g(A)),MC=S(),nj=xp();ls.id_counterSignature="1.2.840.113549.1.9.6";var vA=class extends nj.SignerInfo{};ls.CounterSignature=vA;ls.CounterSignature=vA=ij.__decorate([(0,MC.AsnType)({type:MC.AsnTypeTypes.Sequence})],vA)});var qC=l(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.MessageDigest=ca.id_messageDigest=void 0;var sj=S();ca.id_messageDigest="1.2.840.113549.1.9.4";var mA=class extends sj.OctetString{};ca.MessageDigest=mA});var DC=l(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.SigningTime=fs.id_signingTime=void 0;var oj=(v(),g(A)),aj=X(),RC=S();fs.id_signingTime="1.2.840.113549.1.9.5";var bA=class extends aj.Time{};fs.SigningTime=bA;fs.SigningTime=bA=oj.__decorate([(0,RC.AsnType)({type:RC.AsnTypeTypes.Choice})],bA)});var UC=l(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.id_contentType=void 0;var SA=(v(),g(A));SA.__exportStar(NC(),ds);SA.__exportStar(qC(),ds);SA.__exportStar(DC(),ds);ds.id_contentType="1.2.840.113549.1.9.3"});var LC=l(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.ACClearAttrs=void 0;var wA=(v(),g(A)),Op=S(),CA=X(),ua=class{acIssuer=new CA.GeneralName;acSerial=0;attrs=[];constructor(e={}){Object.assign(this,e)}};Ip.ACClearAttrs=ua;wA.__decorate([(0,Op.AsnProp)({type:CA.GeneralName})],ua.prototype,"acIssuer",void 0);wA.__decorate([(0,Op.AsnProp)({type:Op.AsnPropTypes.Integer})],ua.prototype,"acSerial",void 0);wA.__decorate([(0,Op.AsnProp)({type:CA.Attribute,repeated:"sequence"})],ua.prototype,"attrs",void 0)});var TA=l(Hu=>{"use strict";var PA;Object.defineProperty(Hu,"__esModule",{value:!0});Hu.AttrSpec=void 0;var cj=(v(),g(A)),Bp=S(),EA=PA=class extends Bp.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,PA.prototype)}};Hu.AttrSpec=EA;Hu.AttrSpec=EA=PA=cj.__decorate([(0,Bp.AsnType)({type:Bp.AsnTypeTypes.Sequence,itemType:Bp.AsnPropTypes.ObjectIdentifier})],EA)});var VC=l(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.AAControls=void 0;var kp=(v(),g(A)),la=S(),KC=TA(),ps=class{pathLenConstraint;permittedAttrs;excludedAttrs;permitUnSpecified=!0;constructor(e={}){Object.assign(this,e)}};jp.AAControls=ps;kp.__decorate([(0,la.AsnProp)({type:la.AsnPropTypes.Integer,optional:!0})],ps.prototype,"pathLenConstraint",void 0);kp.__decorate([(0,la.AsnProp)({type:KC.AttrSpec,implicit:!0,context:0,optional:!0})],ps.prototype,"permittedAttrs",void 0);kp.__decorate([(0,la.AsnProp)({type:KC.AttrSpec,implicit:!0,context:1,optional:!0})],ps.prototype,"excludedAttrs",void 0);kp.__decorate([(0,la.AsnProp)({type:la.AsnPropTypes.Boolean,defaultValue:!0})],ps.prototype,"permitUnSpecified",void 0)});var Wu=l(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.IssuerSerial=void 0;var xA=(v(),g(A)),fa=S(),GC=X(),da=class{issuer=new GC.GeneralNames;serial=new ArrayBuffer(0);issuerUID=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Mp.IssuerSerial=da;xA.__decorate([(0,fa.AsnProp)({type:GC.GeneralNames})],da.prototype,"issuer",void 0);xA.__decorate([(0,fa.AsnProp)({type:fa.AsnPropTypes.Integer,converter:fa.AsnIntegerArrayBufferConverter})],da.prototype,"serial",void 0);xA.__decorate([(0,fa.AsnProp)({type:fa.AsnPropTypes.BitString,optional:!0})],da.prototype,"issuerUID",void 0)});var $u=l(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.ObjectDigestInfo=pa.DigestedObjectType=void 0;var Np=(v(),g(A)),ys=S(),FC=X(),OA;(function(t){t[t.publicKey=0]="publicKey",t[t.publicKeyCert=1]="publicKeyCert",t[t.otherObjectTypes=2]="otherObjectTypes"})(OA||(pa.DigestedObjectType=OA={}));var _s=class{digestedObjectType=OA.publicKey;otherObjectTypeID;digestAlgorithm=new FC.AlgorithmIdentifier;objectDigest=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};pa.ObjectDigestInfo=_s;Np.__decorate([(0,ys.AsnProp)({type:ys.AsnPropTypes.Enumerated})],_s.prototype,"digestedObjectType",void 0);Np.__decorate([(0,ys.AsnProp)({type:ys.AsnPropTypes.ObjectIdentifier,optional:!0})],_s.prototype,"otherObjectTypeID",void 0);Np.__decorate([(0,ys.AsnProp)({type:FC.AlgorithmIdentifier})],_s.prototype,"digestAlgorithm",void 0);Np.__decorate([(0,ys.AsnProp)({type:ys.AsnPropTypes.BitString})],_s.prototype,"objectDigest",void 0)});var kA=l(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.V2Form=void 0;var IA=(v(),g(A)),BA=S(),uj=X(),lj=Wu(),fj=$u(),ya=class{issuerName;baseCertificateID;objectDigestInfo;constructor(e={}){Object.assign(this,e)}};qp.V2Form=ya;IA.__decorate([(0,BA.AsnProp)({type:uj.GeneralNames,optional:!0})],ya.prototype,"issuerName",void 0);IA.__decorate([(0,BA.AsnProp)({type:lj.IssuerSerial,context:0,implicit:!0,optional:!0})],ya.prototype,"baseCertificateID",void 0);IA.__decorate([(0,BA.AsnProp)({type:fj.ObjectDigestInfo,context:1,implicit:!0,optional:!0})],ya.prototype,"objectDigestInfo",void 0)});var MA=l(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.AttCertIssuer=void 0;var jA=(v(),g(A)),Rp=S(),dj=X(),pj=kA(),zu=class{v1Form;v2Form;constructor(e={}){Object.assign(this,e)}};Yu.AttCertIssuer=zu;jA.__decorate([(0,Rp.AsnProp)({type:dj.GeneralName,repeated:"sequence"})],zu.prototype,"v1Form",void 0);jA.__decorate([(0,Rp.AsnProp)({type:pj.V2Form,context:0,implicit:!0})],zu.prototype,"v2Form",void 0);Yu.AttCertIssuer=zu=jA.__decorate([(0,Rp.AsnType)({type:Rp.AsnTypeTypes.Choice})],zu)});var NA=l(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.AttCertValidityPeriod=void 0;var HC=(v(),g(A)),Dp=S(),Ju=class{notBeforeTime=new Date;notAfterTime=new Date;constructor(e={}){Object.assign(this,e)}};Up.AttCertValidityPeriod=Ju;HC.__decorate([(0,Dp.AsnProp)({type:Dp.AsnPropTypes.GeneralizedTime})],Ju.prototype,"notBeforeTime",void 0);HC.__decorate([(0,Dp.AsnProp)({type:Dp.AsnPropTypes.GeneralizedTime})],Ju.prototype,"notAfterTime",void 0)});var DA=l(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.Holder=void 0;var qA=(v(),g(A)),RA=S(),yj=X(),_j=Wu(),hj=$u(),_a=class{baseCertificateID;entityName;objectDigestInfo;constructor(e={}){Object.assign(this,e)}};Lp.Holder=_a;qA.__decorate([(0,RA.AsnProp)({type:_j.IssuerSerial,implicit:!0,context:0,optional:!0})],_a.prototype,"baseCertificateID",void 0);qA.__decorate([(0,RA.AsnProp)({type:yj.GeneralNames,implicit:!0,context:1,optional:!0})],_a.prototype,"entityName",void 0);qA.__decorate([(0,RA.AsnProp)({type:hj.ObjectDigestInfo,implicit:!0,context:2,optional:!0})],_a.prototype,"objectDigestInfo",void 0)});var LA=l(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.AttributeCertificateInfo=ha.AttCertVersion=void 0;var qi=(v(),g(A)),Jt=S(),Kp=X(),WC=DA(),$C=MA(),zC=NA(),UA;(function(t){t[t.v2=1]="v2"})(UA||(ha.AttCertVersion=UA={}));var dr=class{version=UA.v2;holder=new WC.Holder;issuer=new $C.AttCertIssuer;signature=new Kp.AlgorithmIdentifier;serialNumber=new ArrayBuffer(0);attrCertValidityPeriod=new zC.AttCertValidityPeriod;attributes=[];issuerUniqueID;extensions;constructor(e={}){Object.assign(this,e)}};ha.AttributeCertificateInfo=dr;qi.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.Integer})],dr.prototype,"version",void 0);qi.__decorate([(0,Jt.AsnProp)({type:WC.Holder})],dr.prototype,"holder",void 0);qi.__decorate([(0,Jt.AsnProp)({type:$C.AttCertIssuer})],dr.prototype,"issuer",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Kp.AlgorithmIdentifier})],dr.prototype,"signature",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.Integer,converter:Jt.AsnIntegerArrayBufferConverter})],dr.prototype,"serialNumber",void 0);qi.__decorate([(0,Jt.AsnProp)({type:zC.AttCertValidityPeriod})],dr.prototype,"attrCertValidityPeriod",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Kp.Attribute,repeated:"sequence"})],dr.prototype,"attributes",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Jt.AsnPropTypes.BitString,optional:!0})],dr.prototype,"issuerUniqueID",void 0);qi.__decorate([(0,Jt.AsnProp)({type:Kp.Extensions,optional:!0})],dr.prototype,"extensions",void 0)});var QC=l(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.AttributeCertificate=void 0;var KA=(v(),g(A)),Vp=S(),YC=X(),JC=LA(),ga=class{acinfo=new JC.AttributeCertificateInfo;signatureAlgorithm=new YC.AlgorithmIdentifier;signatureValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Gp.AttributeCertificate=ga;KA.__decorate([(0,Vp.AsnProp)({type:JC.AttributeCertificateInfo})],ga.prototype,"acinfo",void 0);KA.__decorate([(0,Vp.AsnProp)({type:YC.AlgorithmIdentifier})],ga.prototype,"signatureAlgorithm",void 0);KA.__decorate([(0,Vp.AsnProp)({type:Vp.AsnPropTypes.BitString})],ga.prototype,"signatureValue",void 0)});var GA=l(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.ClassList=Aa.ClassListFlags=void 0;var gj=S(),XC;(function(t){t[t.unmarked=1]="unmarked",t[t.unclassified=2]="unclassified",t[t.restricted=4]="restricted",t[t.confidential=8]="confidential",t[t.secret=16]="secret",t[t.topSecret=32]="topSecret"})(XC||(Aa.ClassListFlags=XC={}));var VA=class extends gj.BitString{};Aa.ClassList=VA});var FA=l(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.SecurityCategory=void 0;var ZC=(v(),g(A)),Fp=S(),Qu=class{type="";value=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Hp.SecurityCategory=Qu;ZC.__decorate([(0,Fp.AsnProp)({type:Fp.AsnPropTypes.ObjectIdentifier,implicit:!0,context:0})],Qu.prototype,"type",void 0);ZC.__decorate([(0,Fp.AsnProp)({type:Fp.AsnPropTypes.Any,implicit:!0,context:1})],Qu.prototype,"value",void 0)});var eP=l($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.Clearance=void 0;var HA=(v(),g(A)),Wp=S(),Xu=GA(),Aj=FA(),va=class{policyId="";classList=new Xu.ClassList(Xu.ClassListFlags.unclassified);securityCategories;constructor(e={}){Object.assign(this,e)}};$p.Clearance=va;HA.__decorate([(0,Wp.AsnProp)({type:Wp.AsnPropTypes.ObjectIdentifier})],va.prototype,"policyId",void 0);HA.__decorate([(0,Wp.AsnProp)({type:Xu.ClassList,defaultValue:new Xu.ClassList(Xu.ClassListFlags.unclassified)})],va.prototype,"classList",void 0);HA.__decorate([(0,Wp.AsnProp)({type:Aj.SecurityCategory,repeated:"set"})],va.prototype,"securityCategories",void 0)});var tP=l(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.IetfAttrSyntax=ma.IetfAttrSyntaxValueChoices=void 0;var el=(v(),g(A)),cn=S(),vj=X(),hs=class{cotets;oid;string;constructor(e={}){Object.assign(this,e)}};ma.IetfAttrSyntaxValueChoices=hs;el.__decorate([(0,cn.AsnProp)({type:cn.OctetString})],hs.prototype,"cotets",void 0);el.__decorate([(0,cn.AsnProp)({type:cn.AsnPropTypes.ObjectIdentifier})],hs.prototype,"oid",void 0);el.__decorate([(0,cn.AsnProp)({type:cn.AsnPropTypes.Utf8String})],hs.prototype,"string",void 0);var Zu=class{policyAuthority;values=[];constructor(e={}){Object.assign(this,e)}};ma.IetfAttrSyntax=Zu;el.__decorate([(0,cn.AsnProp)({type:vj.GeneralNames,implicit:!0,context:0,optional:!0})],Zu.prototype,"policyAuthority",void 0);el.__decorate([(0,cn.AsnProp)({type:hs,repeated:"sequence"})],Zu.prototype,"values",void 0)});var rP=l(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.id_at_clearance=ce.id_at_role=ce.id_at=ce.id_aca_encAttrs=ce.id_aca_group=ce.id_aca_chargingIdentity=ce.id_aca_accessIdentity=ce.id_aca_authenticationInfo=ce.id_aca=ce.id_ce_targetInformation=ce.id_pe_ac_proxying=ce.id_pe_aaControls=ce.id_pe_ac_auditIdentity=void 0;var tl=X();ce.id_pe_ac_auditIdentity=`${tl.id_pe}.4`;ce.id_pe_aaControls=`${tl.id_pe}.6`;ce.id_pe_ac_proxying=`${tl.id_pe}.10`;ce.id_ce_targetInformation=`${tl.id_ce}.55`;ce.id_aca=`${tl.id_pkix}.10`;ce.id_aca_authenticationInfo=`${ce.id_aca}.1`;ce.id_aca_accessIdentity=`${ce.id_aca}.2`;ce.id_aca_chargingIdentity=`${ce.id_aca}.3`;ce.id_aca_group=`${ce.id_aca}.4`;ce.id_aca_encAttrs=`${ce.id_aca}.6`;ce.id_at="2.5.4";ce.id_at_role=`${ce.id_at}.72`;ce.id_at_clearance="2.5.1.5.55"});var YA=l(di=>{"use strict";var WA;Object.defineProperty(di,"__esModule",{value:!0});di.Targets=di.Target=di.TargetCert=void 0;var un=(v(),g(A)),jr=S(),zA=X(),iP=Wu(),mj=$u(),gs=class{targetCertificate=new iP.IssuerSerial;targetName;certDigestInfo;constructor(e={}){Object.assign(this,e)}};di.TargetCert=gs;un.__decorate([(0,jr.AsnProp)({type:iP.IssuerSerial})],gs.prototype,"targetCertificate",void 0);un.__decorate([(0,jr.AsnProp)({type:zA.GeneralName,optional:!0})],gs.prototype,"targetName",void 0);un.__decorate([(0,jr.AsnProp)({type:mj.ObjectDigestInfo,optional:!0})],gs.prototype,"certDigestInfo",void 0);var As=class{targetName;targetGroup;targetCert;constructor(e={}){Object.assign(this,e)}};di.Target=As;un.__decorate([(0,jr.AsnProp)({type:zA.GeneralName,context:0,implicit:!0})],As.prototype,"targetName",void 0);un.__decorate([(0,jr.AsnProp)({type:zA.GeneralName,context:1,implicit:!0})],As.prototype,"targetGroup",void 0);un.__decorate([(0,jr.AsnProp)({type:gs,context:2,implicit:!0})],As.prototype,"targetCert",void 0);di.Target=As=un.__decorate([(0,jr.AsnType)({type:jr.AsnTypeTypes.Choice})],As);var $A=WA=class extends jr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,WA.prototype)}};di.Targets=$A;di.Targets=$A=WA=un.__decorate([(0,jr.AsnType)({type:jr.AsnTypeTypes.Sequence,itemType:As})],$A)});var nP=l(rl=>{"use strict";var JA;Object.defineProperty(rl,"__esModule",{value:!0});rl.ProxyInfo=void 0;var bj=(v(),g(A)),QA=S(),Sj=YA(),XA=JA=class extends QA.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,JA.prototype)}};rl.ProxyInfo=XA;rl.ProxyInfo=XA=JA=bj.__decorate([(0,QA.AsnType)({type:QA.AsnTypeTypes.Sequence,itemType:Sj.Targets})],XA)});var cP=l(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.RoleSyntax=void 0;var sP=(v(),g(A)),oP=S(),aP=X(),il=class{roleAuthority;roleName;constructor(e={}){Object.assign(this,e)}};zp.RoleSyntax=il;sP.__decorate([(0,oP.AsnProp)({type:aP.GeneralNames,implicit:!0,context:0,optional:!0})],il.prototype,"roleAuthority",void 0);sP.__decorate([(0,oP.AsnProp)({type:aP.GeneralName,implicit:!0,context:1})],il.prototype,"roleName",void 0)});var uP=l(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.SvceAuthInfo=void 0;var ZA=(v(),g(A)),Yp=S(),Jp=X(),ba=class{service=new Jp.GeneralName;ident=new Jp.GeneralName;authInfo;constructor(e={}){Object.assign(this,e)}};Qp.SvceAuthInfo=ba;ZA.__decorate([(0,Yp.AsnProp)({type:Jp.GeneralName})],ba.prototype,"service",void 0);ZA.__decorate([(0,Yp.AsnProp)({type:Jp.GeneralName})],ba.prototype,"ident",void 0);ZA.__decorate([(0,Yp.AsnProp)({type:Yp.OctetString,optional:!0})],ba.prototype,"authInfo",void 0)});var ev=l(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});var We=(v(),g(A));We.__exportStar(LC(),Ue);We.__exportStar(VC(),Ue);We.__exportStar(MA(),Ue);We.__exportStar(NA(),Ue);We.__exportStar(TA(),Ue);We.__exportStar(QC(),Ue);We.__exportStar(LA(),Ue);We.__exportStar(GA(),Ue);We.__exportStar(eP(),Ue);We.__exportStar(DA(),Ue);We.__exportStar(tP(),Ue);We.__exportStar(Wu(),Ue);We.__exportStar($u(),Ue);We.__exportStar(rP(),Ue);We.__exportStar(nP(),Ue);We.__exportStar(cP(),Ue);We.__exportStar(FA(),Ue);We.__exportStar(uP(),Ue);We.__exportStar(YA(),Ue);We.__exportStar(kA(),Ue)});var Xp=l(pi=>{"use strict";var tv;Object.defineProperty(pi,"__esModule",{value:!0});pi.CertificateSet=pi.CertificateChoices=pi.OtherCertificateFormat=void 0;var ms=(v(),g(A)),pr=S(),wj=X(),Cj=ev(),Sa=class{otherCertFormat="";otherCert=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};pi.OtherCertificateFormat=Sa;ms.__decorate([(0,pr.AsnProp)({type:pr.AsnPropTypes.ObjectIdentifier})],Sa.prototype,"otherCertFormat",void 0);ms.__decorate([(0,pr.AsnProp)({type:pr.AsnPropTypes.Any})],Sa.prototype,"otherCert",void 0);var vs=class{certificate;v2AttrCert;other;constructor(e={}){Object.assign(this,e)}};pi.CertificateChoices=vs;ms.__decorate([(0,pr.AsnProp)({type:wj.Certificate})],vs.prototype,"certificate",void 0);ms.__decorate([(0,pr.AsnProp)({type:Cj.AttributeCertificate,context:2,implicit:!0})],vs.prototype,"v2AttrCert",void 0);ms.__decorate([(0,pr.AsnProp)({type:Sa,context:3,implicit:!0})],vs.prototype,"other",void 0);pi.CertificateChoices=vs=ms.__decorate([(0,pr.AsnType)({type:pr.AsnTypeTypes.Choice})],vs);var rv=tv=class extends pr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,tv.prototype)}};pi.CertificateSet=rv;pi.CertificateSet=rv=tv=ms.__decorate([(0,pr.AsnType)({type:pr.AsnTypeTypes.Set,itemType:vs})],rv)});var fP=l(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});ey.ContentInfo=void 0;var lP=(v(),g(A)),Zp=S(),nl=class{contentType="";content=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};ey.ContentInfo=nl;lP.__decorate([(0,Zp.AsnProp)({type:Zp.AsnPropTypes.ObjectIdentifier})],nl.prototype,"contentType",void 0);lP.__decorate([(0,Zp.AsnProp)({type:Zp.AsnPropTypes.Any,context:0})],nl.prototype,"content",void 0)});var iv=l(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.EncapsulatedContentInfo=bs.EncapsulatedContent=void 0;var ol=(v(),g(A)),Ri=S(),wa=class{single;any;constructor(e={}){Object.assign(this,e)}};bs.EncapsulatedContent=wa;ol.__decorate([(0,Ri.AsnProp)({type:Ri.OctetString})],wa.prototype,"single",void 0);ol.__decorate([(0,Ri.AsnProp)({type:Ri.AsnPropTypes.Any})],wa.prototype,"any",void 0);bs.EncapsulatedContent=wa=ol.__decorate([(0,Ri.AsnType)({type:Ri.AsnTypeTypes.Choice})],wa);var sl=class{eContentType="";eContent;constructor(e={}){Object.assign(this,e)}};bs.EncapsulatedContentInfo=sl;ol.__decorate([(0,Ri.AsnProp)({type:Ri.AsnPropTypes.ObjectIdentifier})],sl.prototype,"eContentType",void 0);ol.__decorate([(0,Ri.AsnProp)({type:wa,context:0,optional:!0})],sl.prototype,"eContent",void 0)});var nv=l(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.EncryptedContentInfo=Ss.EncryptedContent=void 0;var Ea=(v(),g(A)),Mr=S(),dP=fi(),Ca=class{value;constructedValue;constructor(e={}){Object.assign(this,e)}};Ss.EncryptedContent=Ca;Ea.__decorate([(0,Mr.AsnProp)({type:Mr.OctetString,context:0,implicit:!0,optional:!0})],Ca.prototype,"value",void 0);Ea.__decorate([(0,Mr.AsnProp)({type:Mr.OctetString,converter:Mr.AsnConstructedOctetStringConverter,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Ca.prototype,"constructedValue",void 0);Ss.EncryptedContent=Ca=Ea.__decorate([(0,Mr.AsnType)({type:Mr.AsnTypeTypes.Choice})],Ca);var Pa=class{contentType="";contentEncryptionAlgorithm=new dP.ContentEncryptionAlgorithmIdentifier;encryptedContent;constructor(e={}){Object.assign(this,e)}};Ss.EncryptedContentInfo=Pa;Ea.__decorate([(0,Mr.AsnProp)({type:Mr.AsnPropTypes.ObjectIdentifier})],Pa.prototype,"contentType",void 0);Ea.__decorate([(0,Mr.AsnProp)({type:dP.ContentEncryptionAlgorithmIdentifier})],Pa.prototype,"contentEncryptionAlgorithm",void 0);Ea.__decorate([(0,Mr.AsnProp)({type:Ca,optional:!0})],Pa.prototype,"encryptedContent",void 0)});var sv=l(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.OtherKeyAttribute=void 0;var pP=(v(),g(A)),ty=S(),al=class{keyAttrId="";keyAttr;constructor(e={}){Object.assign(this,e)}};ry.OtherKeyAttribute=al;pP.__decorate([(0,ty.AsnProp)({type:ty.AsnPropTypes.ObjectIdentifier})],al.prototype,"keyAttrId",void 0);pP.__decorate([(0,ty.AsnProp)({type:ty.AsnPropTypes.Any,optional:!0})],al.prototype,"keyAttr",void 0)});var cv=l(et=>{"use strict";var ov;Object.defineProperty(et,"__esModule",{value:!0});et.KeyAgreeRecipientInfo=et.OriginatorIdentifierOrKey=et.OriginatorPublicKey=et.RecipientEncryptedKeys=et.RecipientEncryptedKey=et.KeyAgreeRecipientIdentifier=et.RecipientKeyIdentifier=void 0;var $e=(v(),g(A)),de=S(),ul=X(),av=fi(),yP=Lu(),Pj=sv(),ws=class{subjectKeyIdentifier=new ul.SubjectKeyIdentifier;date;other;constructor(e={}){Object.assign(this,e)}};et.RecipientKeyIdentifier=ws;$e.__decorate([(0,de.AsnProp)({type:ul.SubjectKeyIdentifier})],ws.prototype,"subjectKeyIdentifier",void 0);$e.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.GeneralizedTime,optional:!0})],ws.prototype,"date",void 0);$e.__decorate([(0,de.AsnProp)({type:Pj.OtherKeyAttribute,optional:!0})],ws.prototype,"other",void 0);var Cs=class{rKeyId;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};et.KeyAgreeRecipientIdentifier=Cs;$e.__decorate([(0,de.AsnProp)({type:ws,context:0,implicit:!0,optional:!0})],Cs.prototype,"rKeyId",void 0);$e.__decorate([(0,de.AsnProp)({type:yP.IssuerAndSerialNumber,optional:!0})],Cs.prototype,"issuerAndSerialNumber",void 0);et.KeyAgreeRecipientIdentifier=Cs=$e.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Choice})],Cs);var Ta=class{rid=new Cs;encryptedKey=new de.OctetString;constructor(e={}){Object.assign(this,e)}};et.RecipientEncryptedKey=Ta;$e.__decorate([(0,de.AsnProp)({type:Cs})],Ta.prototype,"rid",void 0);$e.__decorate([(0,de.AsnProp)({type:de.OctetString})],Ta.prototype,"encryptedKey",void 0);var cl=ov=class extends de.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,ov.prototype)}};et.RecipientEncryptedKeys=cl;et.RecipientEncryptedKeys=cl=ov=$e.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Sequence,itemType:Ta})],cl);var xa=class{algorithm=new ul.AlgorithmIdentifier;publicKey=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};et.OriginatorPublicKey=xa;$e.__decorate([(0,de.AsnProp)({type:ul.AlgorithmIdentifier})],xa.prototype,"algorithm",void 0);$e.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.BitString})],xa.prototype,"publicKey",void 0);var ln=class{subjectKeyIdentifier;originatorKey;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};et.OriginatorIdentifierOrKey=ln;$e.__decorate([(0,de.AsnProp)({type:ul.SubjectKeyIdentifier,context:0,implicit:!0,optional:!0})],ln.prototype,"subjectKeyIdentifier",void 0);$e.__decorate([(0,de.AsnProp)({type:xa,context:1,implicit:!0,optional:!0})],ln.prototype,"originatorKey",void 0);$e.__decorate([(0,de.AsnProp)({type:yP.IssuerAndSerialNumber,optional:!0})],ln.prototype,"issuerAndSerialNumber",void 0);et.OriginatorIdentifierOrKey=ln=$e.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Choice})],ln);var fn=class{version=av.CMSVersion.v3;originator=new ln;ukm;keyEncryptionAlgorithm=new av.KeyEncryptionAlgorithmIdentifier;recipientEncryptedKeys=new cl;constructor(e={}){Object.assign(this,e)}};et.KeyAgreeRecipientInfo=fn;$e.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.Integer})],fn.prototype,"version",void 0);$e.__decorate([(0,de.AsnProp)({type:ln,context:0})],fn.prototype,"originator",void 0);$e.__decorate([(0,de.AsnProp)({type:de.OctetString,context:1,optional:!0})],fn.prototype,"ukm",void 0);$e.__decorate([(0,de.AsnProp)({type:av.KeyEncryptionAlgorithmIdentifier})],fn.prototype,"keyEncryptionAlgorithm",void 0);$e.__decorate([(0,de.AsnProp)({type:cl})],fn.prototype,"recipientEncryptedKeys",void 0)});var lv=l(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.KeyTransRecipientInfo=Ts.RecipientIdentifier=void 0;var xs=(v(),g(A)),Nr=S(),Ej=X(),uv=fi(),Tj=Lu(),Ps=class{subjectKeyIdentifier;issuerAndSerialNumber;constructor(e={}){Object.assign(this,e)}};Ts.RecipientIdentifier=Ps;xs.__decorate([(0,Nr.AsnProp)({type:Ej.SubjectKeyIdentifier,context:0,implicit:!0})],Ps.prototype,"subjectKeyIdentifier",void 0);xs.__decorate([(0,Nr.AsnProp)({type:Tj.IssuerAndSerialNumber})],Ps.prototype,"issuerAndSerialNumber",void 0);Ts.RecipientIdentifier=Ps=xs.__decorate([(0,Nr.AsnType)({type:Nr.AsnTypeTypes.Choice})],Ps);var Es=class{version=uv.CMSVersion.v0;rid=new Ps;keyEncryptionAlgorithm=new uv.KeyEncryptionAlgorithmIdentifier;encryptedKey=new Nr.OctetString;constructor(e={}){Object.assign(this,e)}};Ts.KeyTransRecipientInfo=Es;xs.__decorate([(0,Nr.AsnProp)({type:Nr.AsnPropTypes.Integer})],Es.prototype,"version",void 0);xs.__decorate([(0,Nr.AsnProp)({type:Ps})],Es.prototype,"rid",void 0);xs.__decorate([(0,Nr.AsnProp)({type:uv.KeyEncryptionAlgorithmIdentifier})],Es.prototype,"keyEncryptionAlgorithm",void 0);xs.__decorate([(0,Nr.AsnProp)({type:Nr.OctetString})],Es.prototype,"encryptedKey",void 0)});var dv=l(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.KEKRecipientInfo=Oa.KEKIdentifier=void 0;var Is=(v(),g(A)),Qt=S(),xj=sv(),fv=fi(),dn=class{keyIdentifier=new Qt.OctetString;date;other;constructor(e={}){Object.assign(this,e)}};Oa.KEKIdentifier=dn;Is.__decorate([(0,Qt.AsnProp)({type:Qt.OctetString})],dn.prototype,"keyIdentifier",void 0);Is.__decorate([(0,Qt.AsnProp)({type:Qt.AsnPropTypes.GeneralizedTime,optional:!0})],dn.prototype,"date",void 0);Is.__decorate([(0,Qt.AsnProp)({type:xj.OtherKeyAttribute,optional:!0})],dn.prototype,"other",void 0);var Os=class{version=fv.CMSVersion.v4;kekid=new dn;keyEncryptionAlgorithm=new fv.KeyEncryptionAlgorithmIdentifier;encryptedKey=new Qt.OctetString;constructor(e={}){Object.assign(this,e)}};Oa.KEKRecipientInfo=Os;Is.__decorate([(0,Qt.AsnProp)({type:Qt.AsnPropTypes.Integer})],Os.prototype,"version",void 0);Is.__decorate([(0,Qt.AsnProp)({type:dn})],Os.prototype,"kekid",void 0);Is.__decorate([(0,Qt.AsnProp)({type:fv.KeyEncryptionAlgorithmIdentifier})],Os.prototype,"keyEncryptionAlgorithm",void 0);Is.__decorate([(0,Qt.AsnProp)({type:Qt.OctetString})],Os.prototype,"encryptedKey",void 0)});var pv=l(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.PasswordRecipientInfo=void 0;var ny=(v(),g(A)),Bs=S(),iy=fi(),ks=class{version=iy.CMSVersion.v0;keyDerivationAlgorithm;keyEncryptionAlgorithm=new iy.KeyEncryptionAlgorithmIdentifier;encryptedKey=new Bs.OctetString;constructor(e={}){Object.assign(this,e)}};sy.PasswordRecipientInfo=ks;ny.__decorate([(0,Bs.AsnProp)({type:Bs.AsnPropTypes.Integer})],ks.prototype,"version",void 0);ny.__decorate([(0,Bs.AsnProp)({type:iy.KeyDerivationAlgorithmIdentifier,context:0,optional:!0})],ks.prototype,"keyDerivationAlgorithm",void 0);ny.__decorate([(0,Bs.AsnProp)({type:iy.KeyEncryptionAlgorithmIdentifier})],ks.prototype,"keyEncryptionAlgorithm",void 0);ny.__decorate([(0,Bs.AsnProp)({type:Bs.OctetString})],ks.prototype,"encryptedKey",void 0)});var yv=l(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.RecipientInfo=js.OtherRecipientInfo=void 0;var yn=(v(),g(A)),qr=S(),Oj=cv(),Ij=lv(),Bj=dv(),kj=pv(),Ia=class{oriType="";oriValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};js.OtherRecipientInfo=Ia;yn.__decorate([(0,qr.AsnProp)({type:qr.AsnPropTypes.ObjectIdentifier})],Ia.prototype,"oriType",void 0);yn.__decorate([(0,qr.AsnProp)({type:qr.AsnPropTypes.Any})],Ia.prototype,"oriValue",void 0);var pn=class{ktri;kari;kekri;pwri;ori;constructor(e={}){Object.assign(this,e)}};js.RecipientInfo=pn;yn.__decorate([(0,qr.AsnProp)({type:Ij.KeyTransRecipientInfo,optional:!0})],pn.prototype,"ktri",void 0);yn.__decorate([(0,qr.AsnProp)({type:Oj.KeyAgreeRecipientInfo,context:1,implicit:!0,optional:!0})],pn.prototype,"kari",void 0);yn.__decorate([(0,qr.AsnProp)({type:Bj.KEKRecipientInfo,context:2,implicit:!0,optional:!0})],pn.prototype,"kekri",void 0);yn.__decorate([(0,qr.AsnProp)({type:kj.PasswordRecipientInfo,context:3,implicit:!0,optional:!0})],pn.prototype,"pwri",void 0);yn.__decorate([(0,qr.AsnProp)({type:Ia,context:4,implicit:!0,optional:!0})],pn.prototype,"ori",void 0);js.RecipientInfo=pn=yn.__decorate([(0,qr.AsnType)({type:qr.AsnTypeTypes.Choice})],pn)});var Av=l(ll=>{"use strict";var _v;Object.defineProperty(ll,"__esModule",{value:!0});ll.RecipientInfos=void 0;var jj=(v(),g(A)),hv=S(),Mj=yv(),gv=_v=class extends hv.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,_v.prototype)}};ll.RecipientInfos=gv;ll.RecipientInfos=gv=_v=jj.__decorate([(0,hv.AsnType)({type:hv.AsnTypeTypes.Set,itemType:Mj.RecipientInfo})],gv)});var oy=l(ot=>{"use strict";var vv;Object.defineProperty(ot,"__esModule",{value:!0});ot.RevocationInfoChoices=ot.RevocationInfoChoice=ot.OtherRevocationInfoFormat=ot.id_ri_scvp=ot.id_ri_ocsp_response=ot.id_ri=void 0;var dl=(v(),g(A)),yi=S(),Nj=X();ot.id_ri=`${Nj.id_pkix}.16`;ot.id_ri_ocsp_response=`${ot.id_ri}.2`;ot.id_ri_scvp=`${ot.id_ri}.4`;var Ms=class{otherRevInfoFormat="";otherRevInfo=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};ot.OtherRevocationInfoFormat=Ms;dl.__decorate([(0,yi.AsnProp)({type:yi.AsnPropTypes.ObjectIdentifier})],Ms.prototype,"otherRevInfoFormat",void 0);dl.__decorate([(0,yi.AsnProp)({type:yi.AsnPropTypes.Any})],Ms.prototype,"otherRevInfo",void 0);var fl=class{other=new Ms;constructor(e={}){Object.assign(this,e)}};ot.RevocationInfoChoice=fl;dl.__decorate([(0,yi.AsnProp)({type:Ms,context:1,implicit:!0})],fl.prototype,"other",void 0);ot.RevocationInfoChoice=fl=dl.__decorate([(0,yi.AsnType)({type:yi.AsnTypeTypes.Choice})],fl);var mv=vv=class extends yi.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,vv.prototype)}};ot.RevocationInfoChoices=mv;ot.RevocationInfoChoices=mv=vv=dl.__decorate([(0,yi.AsnType)({type:yi.AsnTypeTypes.Set,itemType:fl})],mv)});var bv=l(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});ay.OriginatorInfo=void 0;var _P=(v(),g(A)),hP=S(),qj=Xp(),Rj=oy(),pl=class{certs;crls;constructor(e={}){Object.assign(this,e)}};ay.OriginatorInfo=pl;_P.__decorate([(0,hP.AsnProp)({type:qj.CertificateSet,context:0,implicit:!0,optional:!0})],pl.prototype,"certs",void 0);_P.__decorate([(0,hP.AsnProp)({type:Rj.RevocationInfoChoices,context:1,implicit:!0,optional:!0})],pl.prototype,"crls",void 0)});var vP=l(Ns=>{"use strict";var Sv;Object.defineProperty(Ns,"__esModule",{value:!0});Ns.EnvelopedData=Ns.UnprotectedAttributes=void 0;var Ba=(v(),g(A)),Di=S(),Dj=fi(),Uj=Tp(),gP=Av(),Lj=bv(),AP=nv(),cy=Sv=class extends Di.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Sv.prototype)}};Ns.UnprotectedAttributes=cy;Ns.UnprotectedAttributes=cy=Sv=Ba.__decorate([(0,Di.AsnType)({type:Di.AsnTypeTypes.Set,itemType:Uj.Attribute})],cy);var _n=class{version=Dj.CMSVersion.v0;originatorInfo;recipientInfos=new gP.RecipientInfos;encryptedContentInfo=new AP.EncryptedContentInfo;unprotectedAttrs;constructor(e={}){Object.assign(this,e)}};Ns.EnvelopedData=_n;Ba.__decorate([(0,Di.AsnProp)({type:Di.AsnPropTypes.Integer})],_n.prototype,"version",void 0);Ba.__decorate([(0,Di.AsnProp)({type:Lj.OriginatorInfo,context:0,implicit:!0,optional:!0})],_n.prototype,"originatorInfo",void 0);Ba.__decorate([(0,Di.AsnProp)({type:gP.RecipientInfos})],_n.prototype,"recipientInfos",void 0);Ba.__decorate([(0,Di.AsnProp)({type:AP.EncryptedContentInfo})],_n.prototype,"encryptedContentInfo",void 0);Ba.__decorate([(0,Di.AsnProp)({type:cy,context:1,implicit:!0,optional:!0})],_n.prototype,"unprotectedAttrs",void 0)});var mP=l(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.id_authData=At.id_encryptedData=At.id_digestedData=At.id_envelopedData=At.id_signedData=At.id_data=At.id_ct_contentInfo=void 0;At.id_ct_contentInfo="1.2.840.113549.1.9.16.1.6";At.id_data="1.2.840.113549.1.7.1";At.id_signedData="1.2.840.113549.1.7.2";At.id_envelopedData="1.2.840.113549.1.7.3";At.id_digestedData="1.2.840.113549.1.7.5";At.id_encryptedData="1.2.840.113549.1.7.6";At.id_authData="1.2.840.113549.1.9.16.1.2"});var CP=l(qs=>{"use strict";var wv;Object.defineProperty(qs,"__esModule",{value:!0});qs.SignedData=qs.DigestAlgorithmIdentifiers=void 0;var Rs=(v(),g(A)),_i=S(),Kj=Xp(),bP=fi(),SP=iv(),Vj=oy(),wP=xp(),yl=wv=class extends _i.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,wv.prototype)}};qs.DigestAlgorithmIdentifiers=yl;qs.DigestAlgorithmIdentifiers=yl=wv=Rs.__decorate([(0,_i.AsnType)({type:_i.AsnTypeTypes.Set,itemType:bP.DigestAlgorithmIdentifier})],yl);var Ui=class{version=bP.CMSVersion.v0;digestAlgorithms=new yl;encapContentInfo=new SP.EncapsulatedContentInfo;certificates;crls;signerInfos=new wP.SignerInfos;constructor(e={}){Object.assign(this,e)}};qs.SignedData=Ui;Rs.__decorate([(0,_i.AsnProp)({type:_i.AsnPropTypes.Integer})],Ui.prototype,"version",void 0);Rs.__decorate([(0,_i.AsnProp)({type:yl})],Ui.prototype,"digestAlgorithms",void 0);Rs.__decorate([(0,_i.AsnProp)({type:SP.EncapsulatedContentInfo})],Ui.prototype,"encapContentInfo",void 0);Rs.__decorate([(0,_i.AsnProp)({type:Kj.CertificateSet,context:0,implicit:!0,optional:!0})],Ui.prototype,"certificates",void 0);Rs.__decorate([(0,_i.AsnProp)({type:Vj.RevocationInfoChoices,context:1,implicit:!0,optional:!0})],Ui.prototype,"crls",void 0);Rs.__decorate([(0,_i.AsnProp)({type:wP.SignerInfos})],Ui.prototype,"signerInfos",void 0)});var _l=l(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});var Ve=(v(),g(A));Ve.__exportStar(UC(),je);Ve.__exportStar(Tp(),je);Ve.__exportStar(Xp(),je);Ve.__exportStar(fP(),je);Ve.__exportStar(iv(),je);Ve.__exportStar(nv(),je);Ve.__exportStar(vP(),je);Ve.__exportStar(Lu(),je);Ve.__exportStar(dv(),je);Ve.__exportStar(cv(),je);Ve.__exportStar(lv(),je);Ve.__exportStar(mP(),je);Ve.__exportStar(bv(),je);Ve.__exportStar(pv(),je);Ve.__exportStar(yv(),je);Ve.__exportStar(Av(),je);Ve.__exportStar(oy(),je);Ve.__exportStar(CP(),je);Ve.__exportStar(lA(),je);Ve.__exportStar(xp(),je);Ve.__exportStar(fi(),je)});var Cv=l(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.id_sect571r1=Y.id_sect571k1=Y.id_secp521r1=Y.id_sect409r1=Y.id_sect409k1=Y.id_secp384r1=Y.id_sect283r1=Y.id_sect283k1=Y.id_secp256r1=Y.id_sect233r1=Y.id_sect233k1=Y.id_secp224r1=Y.id_sect163r2=Y.id_sect163k1=Y.id_secp192r1=Y.id_ecdsaWithSHA512=Y.id_ecdsaWithSHA384=Y.id_ecdsaWithSHA256=Y.id_ecdsaWithSHA224=Y.id_ecdsaWithSHA1=Y.id_ecMQV=Y.id_ecDH=Y.id_ecPublicKey=void 0;Y.id_ecPublicKey="1.2.840.10045.2.1";Y.id_ecDH="1.3.132.1.12";Y.id_ecMQV="1.3.132.1.13";Y.id_ecdsaWithSHA1="1.2.840.10045.4.1";Y.id_ecdsaWithSHA224="1.2.840.10045.4.3.1";Y.id_ecdsaWithSHA256="1.2.840.10045.4.3.2";Y.id_ecdsaWithSHA384="1.2.840.10045.4.3.3";Y.id_ecdsaWithSHA512="1.2.840.10045.4.3.4";Y.id_secp192r1="1.2.840.10045.3.1.1";Y.id_sect163k1="1.3.132.0.1";Y.id_sect163r2="1.3.132.0.15";Y.id_secp224r1="1.3.132.0.33";Y.id_sect233k1="1.3.132.0.26";Y.id_sect233r1="1.3.132.0.27";Y.id_secp256r1="1.2.840.10045.3.1.7";Y.id_sect283k1="1.3.132.0.16";Y.id_sect283r1="1.3.132.0.17";Y.id_secp384r1="1.3.132.0.34";Y.id_sect409k1="1.3.132.0.36";Y.id_sect409r1="1.3.132.0.37";Y.id_secp521r1="1.3.132.0.35";Y.id_sect571k1="1.3.132.0.38";Y.id_sect571r1="1.3.132.0.39"});var PP=l(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.ecdsaWithSHA512=yr.ecdsaWithSHA384=yr.ecdsaWithSHA256=yr.ecdsaWithSHA224=yr.ecdsaWithSHA1=void 0;var Gj=(v(),g(A)),Fj=X(),hl=Gj.__importStar(Cv());function gl(t){return new Fj.AlgorithmIdentifier({algorithm:t})}yr.ecdsaWithSHA1=gl(hl.id_ecdsaWithSHA1);yr.ecdsaWithSHA224=gl(hl.id_ecdsaWithSHA224);yr.ecdsaWithSHA256=gl(hl.id_ecdsaWithSHA256);yr.ecdsaWithSHA384=gl(hl.id_ecdsaWithSHA384);yr.ecdsaWithSHA512=gl(hl.id_ecdsaWithSHA512)});var Tv=l(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.SpecifiedECDomain=dt.ECPVer=dt.Curve=dt.FieldElement=dt.ECPoint=dt.FieldID=void 0;var kt=(v(),g(A)),he=S(),ka=class{fieldType;parameters;constructor(e={}){Object.assign(this,e)}};dt.FieldID=ka;kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.ObjectIdentifier})],ka.prototype,"fieldType",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Any})],ka.prototype,"parameters",void 0);dt.FieldID=ka=kt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Sequence})],ka);var uy=class extends he.OctetString{};dt.ECPoint=uy;var Pv=class extends he.OctetString{};dt.FieldElement=Pv;var Ds=class{a;b;seed;constructor(e={}){Object.assign(this,e)}};dt.Curve=Ds;kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.OctetString})],Ds.prototype,"a",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.OctetString})],Ds.prototype,"b",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.BitString,optional:!0})],Ds.prototype,"seed",void 0);dt.Curve=Ds=kt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Sequence})],Ds);var Ev;(function(t){t[t.ecpVer1=1]="ecpVer1"})(Ev||(dt.ECPVer=Ev={}));var Li=class{version=Ev.ecpVer1;fieldID;curve;base;order;cofactor;constructor(e={}){Object.assign(this,e)}};dt.SpecifiedECDomain=Li;kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Integer})],Li.prototype,"version",void 0);kt.__decorate([(0,he.AsnProp)({type:ka})],Li.prototype,"fieldID",void 0);kt.__decorate([(0,he.AsnProp)({type:Ds})],Li.prototype,"curve",void 0);kt.__decorate([(0,he.AsnProp)({type:uy})],Li.prototype,"base",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Integer,converter:he.AsnIntegerArrayBufferConverter})],Li.prototype,"order",void 0);kt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Integer,optional:!0})],Li.prototype,"cofactor",void 0);dt.SpecifiedECDomain=Li=kt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Sequence})],Li)});var xv=l(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.ECParameters=void 0;var ly=(v(),g(A)),Us=S(),Hj=Tv(),ja=class{namedCurve;implicitCurve;specifiedCurve;constructor(e={}){Object.assign(this,e)}};Al.ECParameters=ja;ly.__decorate([(0,Us.AsnProp)({type:Us.AsnPropTypes.ObjectIdentifier})],ja.prototype,"namedCurve",void 0);ly.__decorate([(0,Us.AsnProp)({type:Us.AsnPropTypes.Null})],ja.prototype,"implicitCurve",void 0);ly.__decorate([(0,Us.AsnProp)({type:Hj.SpecifiedECDomain})],ja.prototype,"specifiedCurve",void 0);Al.ECParameters=ja=ly.__decorate([(0,Us.AsnType)({type:Us.AsnTypeTypes.Choice})],ja)});var EP=l(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.ECPrivateKey=void 0;var fy=(v(),g(A)),hn=S(),Wj=xv(),Ls=class{version=1;privateKey=new hn.OctetString;parameters;publicKey;constructor(e={}){Object.assign(this,e)}};dy.ECPrivateKey=Ls;fy.__decorate([(0,hn.AsnProp)({type:hn.AsnPropTypes.Integer})],Ls.prototype,"version",void 0);fy.__decorate([(0,hn.AsnProp)({type:hn.OctetString})],Ls.prototype,"privateKey",void 0);fy.__decorate([(0,hn.AsnProp)({type:Wj.ECParameters,context:0,optional:!0})],Ls.prototype,"parameters",void 0);fy.__decorate([(0,hn.AsnProp)({type:hn.AsnPropTypes.BitString,context:1,optional:!0})],Ls.prototype,"publicKey",void 0)});var xP=l(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.ECDSASigValue=void 0;var TP=(v(),g(A)),Ma=S(),vl=class{r=new ArrayBuffer(0);s=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};py.ECDSASigValue=vl;TP.__decorate([(0,Ma.AsnProp)({type:Ma.AsnPropTypes.Integer,converter:Ma.AsnIntegerArrayBufferConverter})],vl.prototype,"r",void 0);TP.__decorate([(0,Ma.AsnProp)({type:Ma.AsnPropTypes.Integer,converter:Ma.AsnIntegerArrayBufferConverter})],vl.prototype,"s",void 0)});var yy=l(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});var Na=(v(),g(A));Na.__exportStar(PP(),gn);Na.__exportStar(xv(),gn);Na.__exportStar(EP(),gn);Na.__exportStar(xP(),gn);Na.__exportStar(Cv(),gn);Na.__exportStar(Tv(),gn)});var ml=l(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.id_mgf1=q.id_md5=q.id_md2=q.id_sha512_256=q.id_sha512_224=q.id_sha512=q.id_sha384=q.id_sha256=q.id_sha224=q.id_sha1=q.id_sha512_256WithRSAEncryption=q.id_sha512_224WithRSAEncryption=q.id_sha512WithRSAEncryption=q.id_sha384WithRSAEncryption=q.id_sha256WithRSAEncryption=q.id_ssha224WithRSAEncryption=q.id_sha224WithRSAEncryption=q.id_sha1WithRSAEncryption=q.id_md5WithRSAEncryption=q.id_md2WithRSAEncryption=q.id_RSASSA_PSS=q.id_pSpecified=q.id_RSAES_OAEP=q.id_rsaEncryption=q.id_pkcs_1=void 0;q.id_pkcs_1="1.2.840.113549.1.1";q.id_rsaEncryption=`${q.id_pkcs_1}.1`;q.id_RSAES_OAEP=`${q.id_pkcs_1}.7`;q.id_pSpecified=`${q.id_pkcs_1}.9`;q.id_RSASSA_PSS=`${q.id_pkcs_1}.10`;q.id_md2WithRSAEncryption=`${q.id_pkcs_1}.2`;q.id_md5WithRSAEncryption=`${q.id_pkcs_1}.4`;q.id_sha1WithRSAEncryption=`${q.id_pkcs_1}.5`;q.id_sha224WithRSAEncryption=`${q.id_pkcs_1}.14`;q.id_ssha224WithRSAEncryption=q.id_sha224WithRSAEncryption;q.id_sha256WithRSAEncryption=`${q.id_pkcs_1}.11`;q.id_sha384WithRSAEncryption=`${q.id_pkcs_1}.12`;q.id_sha512WithRSAEncryption=`${q.id_pkcs_1}.13`;q.id_sha512_224WithRSAEncryption=`${q.id_pkcs_1}.15`;q.id_sha512_256WithRSAEncryption=`${q.id_pkcs_1}.16`;q.id_sha1="1.3.14.3.2.26";q.id_sha224="2.16.840.1.101.3.4.2.4";q.id_sha256="2.16.840.1.101.3.4.2.1";q.id_sha384="2.16.840.1.101.3.4.2.2";q.id_sha512="2.16.840.1.101.3.4.2.3";q.id_sha512_224="2.16.840.1.101.3.4.2.5";q.id_sha512_256="2.16.840.1.101.3.4.2.6";q.id_md2="1.2.840.113549.2.2";q.id_md5="1.2.840.113549.2.5";q.id_mgf1=`${q.id_pkcs_1}.8`});var _y=l(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.sha512_256WithRSAEncryption=Q.sha512_224WithRSAEncryption=Q.sha512WithRSAEncryption=Q.sha384WithRSAEncryption=Q.sha256WithRSAEncryption=Q.sha224WithRSAEncryption=Q.sha1WithRSAEncryption=Q.md5WithRSAEncryption=Q.md2WithRSAEncryption=Q.rsaEncryption=Q.pSpecifiedEmpty=Q.mgf1SHA1=Q.sha512_256=Q.sha512_224=Q.sha512=Q.sha384=Q.sha256=Q.sha224=Q.sha1=Q.md4=Q.md2=void 0;var $j=(v(),g(A)),Ov=S(),Iv=X(),Ge=$j.__importStar(ml());function tt(t){return new Iv.AlgorithmIdentifier({algorithm:t,parameters:null})}Q.md2=tt(Ge.id_md2);Q.md4=tt(Ge.id_md5);Q.sha1=tt(Ge.id_sha1);Q.sha224=tt(Ge.id_sha224);Q.sha256=tt(Ge.id_sha256);Q.sha384=tt(Ge.id_sha384);Q.sha512=tt(Ge.id_sha512);Q.sha512_224=tt(Ge.id_sha512_224);Q.sha512_256=tt(Ge.id_sha512_256);Q.mgf1SHA1=new Iv.AlgorithmIdentifier({algorithm:Ge.id_mgf1,parameters:Ov.AsnConvert.serialize(Q.sha1)});Q.pSpecifiedEmpty=new Iv.AlgorithmIdentifier({algorithm:Ge.id_pSpecified,parameters:Ov.AsnConvert.serialize(Ov.AsnOctetStringConverter.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Q.rsaEncryption=tt(Ge.id_rsaEncryption);Q.md2WithRSAEncryption=tt(Ge.id_md2WithRSAEncryption);Q.md5WithRSAEncryption=tt(Ge.id_md5WithRSAEncryption);Q.sha1WithRSAEncryption=tt(Ge.id_sha1WithRSAEncryption);Q.sha224WithRSAEncryption=tt(Ge.id_sha512_224WithRSAEncryption);Q.sha256WithRSAEncryption=tt(Ge.id_sha512_256WithRSAEncryption);Q.sha384WithRSAEncryption=tt(Ge.id_sha384WithRSAEncryption);Q.sha512WithRSAEncryption=tt(Ge.id_sha512WithRSAEncryption);Q.sha512_224WithRSAEncryption=tt(Ge.id_sha512_224WithRSAEncryption);Q.sha512_256WithRSAEncryption=tt(Ge.id_sha512_256WithRSAEncryption)});var IP=l(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.RSAES_OAEP=Ra.RsaEsOaepParams=void 0;var Bv=(v(),g(A)),bl=S(),Ks=X(),OP=ml(),qa=_y(),Vs=class{hashAlgorithm=new Ks.AlgorithmIdentifier(qa.sha1);maskGenAlgorithm=new Ks.AlgorithmIdentifier({algorithm:OP.id_mgf1,parameters:bl.AsnConvert.serialize(qa.sha1)});pSourceAlgorithm=new Ks.AlgorithmIdentifier(qa.pSpecifiedEmpty);constructor(e={}){Object.assign(this,e)}};Ra.RsaEsOaepParams=Vs;Bv.__decorate([(0,bl.AsnProp)({type:Ks.AlgorithmIdentifier,context:0,defaultValue:qa.sha1})],Vs.prototype,"hashAlgorithm",void 0);Bv.__decorate([(0,bl.AsnProp)({type:Ks.AlgorithmIdentifier,context:1,defaultValue:qa.mgf1SHA1})],Vs.prototype,"maskGenAlgorithm",void 0);Bv.__decorate([(0,bl.AsnProp)({type:Ks.AlgorithmIdentifier,context:2,defaultValue:qa.pSpecifiedEmpty})],Vs.prototype,"pSourceAlgorithm",void 0);Ra.RSAES_OAEP=new Ks.AlgorithmIdentifier({algorithm:OP.id_RSAES_OAEP,parameters:bl.AsnConvert.serialize(new Vs)})});var kP=l(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.RSASSA_PSS=Da.RsaSaPssParams=void 0;var gy=(v(),g(A)),An=S(),Sl=X(),BP=ml(),hy=_y(),vn=class{hashAlgorithm=new Sl.AlgorithmIdentifier(hy.sha1);maskGenAlgorithm=new Sl.AlgorithmIdentifier({algorithm:BP.id_mgf1,parameters:An.AsnConvert.serialize(hy.sha1)});saltLength=20;trailerField=1;constructor(e={}){Object.assign(this,e)}};Da.RsaSaPssParams=vn;gy.__decorate([(0,An.AsnProp)({type:Sl.AlgorithmIdentifier,context:0,defaultValue:hy.sha1})],vn.prototype,"hashAlgorithm",void 0);gy.__decorate([(0,An.AsnProp)({type:Sl.AlgorithmIdentifier,context:1,defaultValue:hy.mgf1SHA1})],vn.prototype,"maskGenAlgorithm",void 0);gy.__decorate([(0,An.AsnProp)({type:An.AsnPropTypes.Integer,context:2,defaultValue:20})],vn.prototype,"saltLength",void 0);gy.__decorate([(0,An.AsnProp)({type:An.AsnPropTypes.Integer,context:3,defaultValue:1})],vn.prototype,"trailerField",void 0);Da.RSASSA_PSS=new Sl.AlgorithmIdentifier({algorithm:BP.id_RSASSA_PSS,parameters:An.AsnConvert.serialize(new vn)})});var NP=l(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.DigestInfo=void 0;var jP=(v(),g(A)),MP=X(),Ay=S(),wl=class{digestAlgorithm=new MP.AlgorithmIdentifier;digest=new Ay.OctetString;constructor(e={}){Object.assign(this,e)}};vy.DigestInfo=wl;jP.__decorate([(0,Ay.AsnProp)({type:MP.AlgorithmIdentifier})],wl.prototype,"digestAlgorithm",void 0);jP.__decorate([(0,Ay.AsnProp)({type:Ay.OctetString})],wl.prototype,"digest",void 0)});var qP=l(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});var kv=(v(),g(A));kv.__exportStar(IP(),Cl);kv.__exportStar(kP(),Cl);kv.__exportStar(NP(),Cl)});var Nv=l(Fs=>{"use strict";var jv;Object.defineProperty(Fs,"__esModule",{value:!0});Fs.OtherPrimeInfos=Fs.OtherPrimeInfo=void 0;var my=(v(),g(A)),_r=S(),Gs=class{prime=new ArrayBuffer(0);exponent=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Fs.OtherPrimeInfo=Gs;my.__decorate([(0,_r.AsnProp)({type:_r.AsnPropTypes.Integer,converter:_r.AsnIntegerArrayBufferConverter})],Gs.prototype,"prime",void 0);my.__decorate([(0,_r.AsnProp)({type:_r.AsnPropTypes.Integer,converter:_r.AsnIntegerArrayBufferConverter})],Gs.prototype,"exponent",void 0);my.__decorate([(0,_r.AsnProp)({type:_r.AsnPropTypes.Integer,converter:_r.AsnIntegerArrayBufferConverter})],Gs.prototype,"coefficient",void 0);var Mv=jv=class extends _r.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,jv.prototype)}};Fs.OtherPrimeInfos=Mv;Fs.OtherPrimeInfos=Mv=jv=my.__decorate([(0,_r.AsnType)({type:_r.AsnTypeTypes.Sequence,itemType:Gs})],Mv)});var RP=l(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.RSAPrivateKey=void 0;var hi=(v(),g(A)),me=S(),zj=Nv(),Xt=class{version=0;modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);privateExponent=new ArrayBuffer(0);prime1=new ArrayBuffer(0);prime2=new ArrayBuffer(0);exponent1=new ArrayBuffer(0);exponent2=new ArrayBuffer(0);coefficient=new ArrayBuffer(0);otherPrimeInfos;constructor(e={}){Object.assign(this,e)}};by.RSAPrivateKey=Xt;hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer})],Xt.prototype,"version",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"modulus",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"publicExponent",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"privateExponent",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"prime1",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"prime2",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"exponent1",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"exponent2",void 0);hi.__decorate([(0,me.AsnProp)({type:me.AsnPropTypes.Integer,converter:me.AsnIntegerArrayBufferConverter})],Xt.prototype,"coefficient",void 0);hi.__decorate([(0,me.AsnProp)({type:zj.OtherPrimeInfos,optional:!0})],Xt.prototype,"otherPrimeInfos",void 0)});var UP=l(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.RSAPublicKey=void 0;var DP=(v(),g(A)),Ua=S(),Pl=class{modulus=new ArrayBuffer(0);publicExponent=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Sy.RSAPublicKey=Pl;DP.__decorate([(0,Ua.AsnProp)({type:Ua.AsnPropTypes.Integer,converter:Ua.AsnIntegerArrayBufferConverter})],Pl.prototype,"modulus",void 0);DP.__decorate([(0,Ua.AsnProp)({type:Ua.AsnPropTypes.Integer,converter:Ua.AsnIntegerArrayBufferConverter})],Pl.prototype,"publicExponent",void 0)});var wy=l(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});var La=(v(),g(A));La.__exportStar(qP(),mn);La.__exportStar(_y(),mn);La.__exportStar(ml(),mn);La.__exportStar(Nv(),mn);La.__exportStar(RP(),mn);La.__exportStar(UP(),mn)});var Cy={};xb(Cy,{__assign:()=>Rv,__asyncDelegator:()=>aM,__asyncGenerator:()=>oM,__asyncValues:()=>cM,__await:()=>El,__awaiter:()=>eM,__classPrivateFieldGet:()=>dM,__classPrivateFieldSet:()=>pM,__createBinding:()=>rM,__decorate:()=>Qj,__exportStar:()=>iM,__extends:()=>Yj,__generator:()=>tM,__importDefault:()=>fM,__importStar:()=>lM,__makeTemplateObject:()=>uM,__metadata:()=>Zj,__param:()=>Xj,__read:()=>LP,__rest:()=>Jj,__spread:()=>nM,__spreadArrays:()=>sM,__values:()=>Dv});function Yj(t,e){qv(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Jj(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Qj(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function Xj(t,e){return function(r,i){e(r,i,t)}}function Zj(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function eM(t,e,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(f){try{u(i.next(f))}catch(d){o(d)}}function c(f){try{u(i.throw(f))}catch(d){o(d)}}function u(f){f.done?s(f.value):n(f.value).then(a,c)}u((i=i.apply(t,e||[])).next())})}function tM(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){r.label=u[1];break}if(u[0]===6&&r.label<s[1]){r.label=s[1],s=u;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(u);break}s[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(f){u=[6,f],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function rM(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function iM(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Dv(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function LP(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function nM(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(LP(arguments[e]));return t}function sM(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function El(t){return this instanceof El?(this.v=t,this):new El(t)}function oM(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(y){i[y]&&(n[y]=function(m){return new Promise(function(x,T){s.push([y,m,x,T])>1||a(y,m)})})}function a(y,m){try{c(i[y](m))}catch(x){d(s[0][3],x)}}function c(y){y.value instanceof El?Promise.resolve(y.value.v).then(u,f):d(s[0][2],y)}function u(y){a("next",y)}function f(y){a("throw",y)}function d(y,m){y(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function aM(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(o){return(r=!r)?{value:El(t[n](o)),done:n==="return"}:s?s(o):o}:s}}function cM(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Dv=="function"?Dv(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),n(a,c,o.done,o.value)})}}function n(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}}function uM(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function lM(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function fM(t){return t&&t.__esModule?t:{default:t}}function dM(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function pM(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var qv,Rv,Py=Tb(()=>{qv=function(t,e){return qv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},qv(t,e)};Rv=function(){return Rv=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Rv.apply(this,arguments)}});var Kv=l(Lv=>{"use strict";Object.defineProperty(Lv,"__esModule",{value:!0});var Uv;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(Uv||(Uv={}));Lv.default=Uv});var KP=l(Vv=>{"use strict";Object.defineProperty(Vv,"__esModule",{value:!0});var yM=Kv();Object.defineProperty(Vv,"Lifecycle",{enumerable:!0,get:function(){return yM.default}})});var Hs=l(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.defineInjectionTokenMetadata=Rr.getParamInfo=Rr.INJECTION_TOKEN_METADATA_KEY=void 0;Rr.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function _M(t){let e=Reflect.getMetadata("design:paramtypes",t)||[],r=Reflect.getOwnMetadata(Rr.INJECTION_TOKEN_METADATA_KEY,t)||{};return Object.keys(r).forEach(i=>{e[+i]=r[i]}),e}Rr.getParamInfo=_M;function hM(t,e){return function(r,i,n){let s=Reflect.getOwnMetadata(Rr.INJECTION_TOKEN_METADATA_KEY,r)||{};s[n]=e?{token:t,transform:e.transformToken,transformArgs:e.args||[]}:t,Reflect.defineMetadata(Rr.INJECTION_TOKEN_METADATA_KEY,s,r)}}Rr.defineInjectionTokenMetadata=hM});var Gv=l(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.isClassProvider=void 0;function gM(t){return!!t.useClass}Ey.isClassProvider=gM});var Fv=l(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.isFactoryProvider=void 0;function AM(t){return!!t.useFactory}Ty.isFactoryProvider=AM});var Oy=l(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.delay=Ka.DelayedConstructor=void 0;var xy=class{constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let r={},i=!1,n,s=()=>(i||(n=e(this.wrap()),i=!0),n);return new Proxy(r,this.createHandler(s))}createHandler(e){let r={},i=n=>{r[n]=(...s)=>{s[0]=e();let o=Reflect[n];return o(...s)}};return this.reflectMethods.forEach(i),r}};Ka.DelayedConstructor=xy;function vM(t){if(typeof t>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new xy(t)}Ka.delay=vM});var Iy=l(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.isConstructorToken=gi.isTransformDescriptor=gi.isTokenDescriptor=gi.isNormalToken=void 0;var mM=Oy();function bM(t){return typeof t=="string"||typeof t=="symbol"}gi.isNormalToken=bM;function SM(t){return typeof t=="object"&&"token"in t&&"multiple"in t}gi.isTokenDescriptor=SM;function wM(t){return typeof t=="object"&&"token"in t&&"transform"in t}gi.isTransformDescriptor=wM;function CM(t){return typeof t=="function"||t instanceof mM.DelayedConstructor}gi.isConstructorToken=CM});var Hv=l(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.isTokenProvider=void 0;function PM(t){return!!t.useToken}By.isTokenProvider=PM});var Wv=l(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});ky.isValueProvider=void 0;function EM(t){return t.useValue!=null}ky.isValueProvider=EM});var $v=l(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});var TM=Gv();Object.defineProperty(Ws,"isClassProvider",{enumerable:!0,get:function(){return TM.isClassProvider}});var xM=Fv();Object.defineProperty(Ws,"isFactoryProvider",{enumerable:!0,get:function(){return xM.isFactoryProvider}});var OM=Iy();Object.defineProperty(Ws,"isNormalToken",{enumerable:!0,get:function(){return OM.isNormalToken}});var IM=Hv();Object.defineProperty(Ws,"isTokenProvider",{enumerable:!0,get:function(){return IM.isTokenProvider}});var BM=Wv();Object.defineProperty(Ws,"isValueProvider",{enumerable:!0,get:function(){return BM.isValueProvider}})});var VP=l(jy=>{"use strict";Object.defineProperty(jy,"__esModule",{value:!0});jy.isProvider=void 0;var kM=Gv(),jM=Wv(),MM=Hv(),NM=Fv();function qM(t){return kM.isClassProvider(t)||jM.isValueProvider(t)||MM.isTokenProvider(t)||NM.isFactoryProvider(t)}jy.isProvider=qM});var Jv=l(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0});var zv=class{constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(e){return this.ensure(e),this._registryMap.get(e)}get(e){this.ensure(e);let r=this._registryMap.get(e);return r[r.length-1]||null}set(e,r){this.ensure(e),this._registryMap.get(e).push(r)}setAll(e,r){this._registryMap.set(e,r)}has(e){return this.ensure(e),this._registryMap.get(e).length>0}clear(){this._registryMap.clear()}ensure(e){this._registryMap.has(e)||this._registryMap.set(e,[])}};Yv.default=zv});var GP=l(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var RM=Jv(),Qv=class extends RM.default{};Xv.default=Qv});var FP=l(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var Zv=class{constructor(){this.scopedResolutions=new Map}};em.default=Zv});var tm=l(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0});My.formatErrorCtor=void 0;function DM(t,e){return t===null?`at position #${e}`:`"${t.split(",")[e].trim()}" at position #${e}`}function UM(t,e,r=" "){return[t,...e.message.split(`
16
16
  `).map(i=>r+i)].join(`
17
- `)}function LM(t,e,r){let[,i=null]=t.toString().match(/constructor\(([\w, ]+)\)/)||[],n=DM(i,e);return UM(`Cannot inject the dependency ${n} of "${t.name}" constructor. Reason:`,r)}Ny.formatErrorCtor=LM});var FP=l(qy=>{"use strict";Object.defineProperty(qy,"__esModule",{value:!0});qy.isDisposable=void 0;function KM(t){return!(typeof t.dispose!="function"||t.dispose.length>0)}qy.isDisposable=KM});var WP=l($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.PostResolutionInterceptors=$s.PreResolutionInterceptors=void 0;var HP=Qv(),Ry=class extends HP.default{};$s.PreResolutionInterceptors=Ry;var Dy=class extends HP.default{};$s.PostResolutionInterceptors=Dy;var im=class{constructor(){this.preResolution=new Ry,this.postResolution=new Dy}};$s.default=im});var Sn=l(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.instance=Ki.typeInfo=void 0;var VM=(Ey(),g(Py)),Pt=zv(),GM=KP(),Uy=By(),FM=VP(),jt=Vv(),Ly=GP(),HM=rm(),WM=Iy(),$M=FP(),zM=WP();Ki.typeInfo=new Map;var nm=class t{constructor(e){this.parent=e,this._registry=new FM.default,this.interceptors=new zM.default,this.disposed=!1,this.disposables=new Set}register(e,r,i={lifecycle:jt.default.Transient}){this.ensureNotDisposed();let n;if(GM.isProvider(r)?n=r:n={useClass:r},Pt.isTokenProvider(n)){let s=[e],o=n;for(;o!=null;){let a=o.useToken;if(s.includes(a))throw new Error(`Token registration cycle detected! ${[...s,a].join(" -> ")}`);s.push(a);let c=this._registry.get(a);c&&Pt.isTokenProvider(c.provider)?o=c.provider:o=null}}if((i.lifecycle===jt.default.Singleton||i.lifecycle==jt.default.ContainerScoped||i.lifecycle==jt.default.ResolutionScoped)&&(Pt.isValueProvider(n)||Pt.isFactoryProvider(n)))throw new Error(`Cannot use lifecycle "${jt.default[i.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:n,options:i}),this}registerType(e,r){return this.ensureNotDisposed(),Pt.isNormalToken(r)?this.register(e,{useToken:r}):this.register(e,{useClass:r})}registerInstance(e,r){return this.ensureNotDisposed(),this.register(e,{useValue:r})}registerSingleton(e,r){if(this.ensureNotDisposed(),Pt.isNormalToken(e)){if(Pt.isNormalToken(r))return this.register(e,{useToken:r},{lifecycle:jt.default.Singleton});if(r)return this.register(e,{useClass:r},{lifecycle:jt.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let i=e;return r&&!Pt.isNormalToken(r)&&(i=r),this.register(e,{useClass:i},{lifecycle:jt.default.Singleton})}resolve(e,r=new Ly.default,i=!1){this.ensureNotDisposed();let n=this.getRegistration(e);if(!n&&Pt.isNormalToken(e)){if(i)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),n){let s=this.resolveRegistration(n,r);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(Uy.isConstructorToken(e)){let s=this.construct(e,r);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,r){if(this.interceptors.preResolution.has(e)){let i=[];for(let n of this.interceptors.preResolution.getAll(e))n.options.frequency!="Once"&&i.push(n),n.callback(e,r);this.interceptors.preResolution.setAll(e,i)}}executePostResolutionInterceptor(e,r,i){if(this.interceptors.postResolution.has(e)){let n=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&n.push(s),s.callback(e,r,i);this.interceptors.postResolution.setAll(e,n)}}resolveRegistration(e,r){if(this.ensureNotDisposed(),e.options.lifecycle===jt.default.ResolutionScoped&&r.scopedResolutions.has(e))return r.scopedResolutions.get(e);let i=e.options.lifecycle===jt.default.Singleton,n=e.options.lifecycle===jt.default.ContainerScoped,s=i||n,o;return Pt.isValueProvider(e.provider)?o=e.provider.useValue:Pt.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,r)):this.resolve(e.provider.useToken,r):Pt.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,r)):this.construct(e.provider.useClass,r):Pt.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,r),e.options.lifecycle===jt.default.ResolutionScoped&&r.scopedResolutions.set(e,o),o}resolveAll(e,r=new Ly.default,i=!1){this.ensureNotDisposed();let n=this.getAllRegistrations(e);if(!n&&Pt.isNormalToken(e)){if(i)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),n){let o=n.map(a=>this.resolveRegistration(a,r));return this.executePostResolutionInterceptor(e,o,"All"),o}let s=[this.construct(e,r)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,r=!1){return this.ensureNotDisposed(),this._registry.has(e)||r&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,r]of this._registry.entries())this._registry.setAll(e,r.filter(i=>!Pt.isValueProvider(i.provider)).map(i=>(i.instance=void 0,i)))}createChildContainer(){this.ensureNotDisposed();let e=new t(this);for(let[r,i]of this._registry.entries())i.some(({options:n})=>n.lifecycle===jt.default.ContainerScoped)&&e._registry.setAll(r,i.map(n=>n.options.lifecycle===jt.default.ContainerScoped?{provider:n.provider,options:n.options}:n));return e}beforeResolution(e,r,i={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:r,options:i})}afterResolution(e,r,i={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:r,options:i})}dispose(){return VM.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(r=>{let i=r.dispose();i&&e.push(i)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,r){if(e instanceof WM.DelayedConstructor)return e.createProxy(n=>this.resolve(n,r));let i=(()=>{let n=Ki.typeInfo.get(e);if(!n||n.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=n.map(this.resolveParams(r,e));return new e(...s)})();return $M.isDisposable(i)&&this.disposables.add(i),i}resolveParams(e,r){return(i,n)=>{try{return Uy.isTokenDescriptor(i)?Uy.isTransformDescriptor(i)?i.multiple?this.resolve(i.transform).transform(this.resolveAll(i.token,new Ly.default,i.isOptional),...i.transformArgs):this.resolve(i.transform).transform(this.resolve(i.token,e,i.isOptional),...i.transformArgs):i.multiple?this.resolveAll(i.token,new Ly.default,i.isOptional):this.resolve(i.token,e,i.isOptional):Uy.isTransformDescriptor(i)?this.resolve(i.transform,e).transform(this.resolve(i.token,e),...i.transformArgs):this.resolve(i,e)}catch(s){throw new Error(HM.formatErrorCtor(r,n,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};Ki.instance=new nm;Ki.default=Ki.instance});var $P=l(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var YM=Hs(),Vi=Sn(),sm=By(),JM=rm();function QM(){return function(t){let e=YM.getParamInfo(t);return class extends t{constructor(...r){super(...r.concat(e.slice(r.length).map((i,n)=>{try{return sm.isTokenDescriptor(i)?sm.isTransformDescriptor(i)?i.multiple?Vi.instance.resolve(i.transform).transform(Vi.instance.resolveAll(i.token),...i.transformArgs):Vi.instance.resolve(i.transform).transform(Vi.instance.resolve(i.token),...i.transformArgs):i.multiple?Vi.instance.resolveAll(i.token):Vi.instance.resolve(i.token):sm.isTransformDescriptor(i)?Vi.instance.resolve(i.transform).transform(Vi.instance.resolve(i.token),...i.transformArgs):Vi.instance.resolve(i)}catch(s){let o=n+r.length;throw new Error(JM.formatErrorCtor(t,o,s))}})))}}}}om.default=QM});var zP=l(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var XM=Hs();function ZM(t,e){let r={token:t,multiple:!1,isOptional:e&&e.isOptional};return XM.defineInjectionTokenMetadata(r)}am.default=ZM});var Ky=l(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var eN=Hs(),tN=Sn(),YP=Sn();function rN(t){return function(e){tN.typeInfo.set(e,eN.getParamInfo(e)),t&&t.token&&(Array.isArray(t.token)?t.token.forEach(r=>{YP.instance.register(r,e)}):YP.instance.register(t.token,e))}}cm.default=rN});var JP=l(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var iN=(Ey(),g(Py)),nN=Sn();function sN(t=[]){return function(e){return t.forEach(r=>{var{token:i,options:n}=r,s=iN.__rest(r,["token","options"]);return nN.instance.register(i,s,n)}),e}}um.default=sN});var QP=l(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var oN=Ky(),aN=Sn();function cN(){return function(t){oN.default()(t),aN.instance.registerSingleton(t)}}lm.default=cN});var XP=l(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var uN=Hs();function lN(t,e){let r={token:t,multiple:!0,isOptional:e&&e.isOptional};return uN.defineInjectionTokenMetadata(r)}fm.default=lN});var ZP=l(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var fN=Hs();function dN(t,e,...r){let i={token:t,multiple:!0,transform:e,transformArgs:r};return fN.defineInjectionTokenMetadata(i)}dm.default=dN});var eE=l(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var pN=Hs();function yN(t,e,...r){return pN.defineInjectionTokenMetadata(t,{transformToken:e,args:r})}pm.default=yN});var tE=l(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});var _N=Ky(),hN=Sn();function gN(t,e){return function(r){_N.default()(r),hN.instance.register(e||r,r,{lifecycle:t})}}ym.default=gN});var rE=l(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});var AN=$P();Object.defineProperty(Dr,"autoInjectable",{enumerable:!0,get:function(){return AN.default}});var vN=zP();Object.defineProperty(Dr,"inject",{enumerable:!0,get:function(){return vN.default}});var mN=Ky();Object.defineProperty(Dr,"injectable",{enumerable:!0,get:function(){return mN.default}});var bN=JP();Object.defineProperty(Dr,"registry",{enumerable:!0,get:function(){return bN.default}});var SN=QP();Object.defineProperty(Dr,"singleton",{enumerable:!0,get:function(){return SN.default}});var wN=XP();Object.defineProperty(Dr,"injectAll",{enumerable:!0,get:function(){return wN.default}});var CN=ZP();Object.defineProperty(Dr,"injectAllWithTransform",{enumerable:!0,get:function(){return CN.default}});var PN=eE();Object.defineProperty(Dr,"injectWithTransform",{enumerable:!0,get:function(){return PN.default}});var EN=tE();Object.defineProperty(Dr,"scoped",{enumerable:!0,get:function(){return EN.default}})});var iE=l(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});function TN(t){let e;return r=>(e==null&&(e=t(r)),e)}_m.default=TN});var nE=l(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});function xN(t){let e=new WeakMap;return r=>{let i=e.get(r);return i==null&&(i=t(r),e.set(r,i)),i}}hm.default=xN});var sE=l(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});function ON(t,e,r,i=!0){let n,s;return o=>{let a=t(o);return(!i||s!==a)&&((s=a)?n=o.resolve(e):n=o.resolve(r)),n}}gm.default=ON});var oE=l(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});var IN=iE();Object.defineProperty(xl,"instanceCachingFactory",{enumerable:!0,get:function(){return IN.default}});var BN=nE();Object.defineProperty(xl,"instancePerContainerCachingFactory",{enumerable:!0,get:function(){return BN.default}});var kN=sE();Object.defineProperty(xl,"predicateAwareClassFactory",{enumerable:!0,get:function(){return kN.default}})});var aE=l(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});var Am=(Ey(),g(Py));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var jN=LP();Object.defineProperty(wn,"Lifecycle",{enumerable:!0,get:function(){return jN.Lifecycle}});Am.__exportStar(rE(),wn);Am.__exportStar(oE(),wn);Am.__exportStar(zv(),wn);var MN=Iy();Object.defineProperty(wn,"delay",{enumerable:!0,get:function(){return MN.delay}});var NN=Sn();Object.defineProperty(wn,"container",{enumerable:!0,get:function(){return NN.instance}})});var Sm=l(Ys=>{"use strict";var vm;Object.defineProperty(Ys,"__esModule",{value:!0});Ys.PKCS12AttrSet=Ys.PKCS12Attribute=void 0;var bm=(v(),g(A)),zs=S(),Va=class{attrId="";attrValues=[];constructor(e={}){Object.assign(e)}};Ys.PKCS12Attribute=Va;bm.__decorate([(0,zs.AsnProp)({type:zs.AsnPropTypes.ObjectIdentifier})],Va.prototype,"attrId",void 0);bm.__decorate([(0,zs.AsnProp)({type:zs.AsnPropTypes.Any,repeated:"set"})],Va.prototype,"attrValues",void 0);var mm=vm=class extends zs.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,vm.prototype)}};Ys.PKCS12AttrSet=mm;Ys.PKCS12AttrSet=mm=vm=bm.__decorate([(0,zs.AsnType)({type:zs.AsnTypeTypes.Sequence,itemType:Va})],mm)});var cE=l(Ol=>{"use strict";var wm;Object.defineProperty(Ol,"__esModule",{value:!0});Ol.AuthenticatedSafe=void 0;var qN=(v(),g(A)),Cm=S(),RN=hl(),Pm=wm=class extends Cm.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,wm.prototype)}};Ol.AuthenticatedSafe=Pm;Ol.AuthenticatedSafe=Pm=wm=qN.__decorate([(0,Cm.AsnType)({type:Cm.AsnTypeTypes.Sequence,itemType:RN.ContentInfo})],Pm)});var Em=l(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.id_bagtypes=ue.id_pbewithSHAAnd40BitRC2_CBC=ue.id_pbeWithSHAAnd128BitRC2_CBC=ue.id_pbeWithSHAAnd2_KeyTripleDES_CBC=ue.id_pbeWithSHAAnd3_KeyTripleDES_CBC=ue.id_pbeWithSHAAnd40BitRC4=ue.id_pbeWithSHAAnd128BitRC4=ue.id_pkcs_12PbeIds=ue.id_pkcs_12=ue.id_pkcs=ue.id_rsadsi=void 0;ue.id_rsadsi="1.2.840.113549";ue.id_pkcs=`${ue.id_rsadsi}.1`;ue.id_pkcs_12=`${ue.id_pkcs}.12`;ue.id_pkcs_12PbeIds=`${ue.id_pkcs_12}.1`;ue.id_pbeWithSHAAnd128BitRC4=`${ue.id_pkcs_12PbeIds}.1`;ue.id_pbeWithSHAAnd40BitRC4=`${ue.id_pkcs_12PbeIds}.2`;ue.id_pbeWithSHAAnd3_KeyTripleDES_CBC=`${ue.id_pkcs_12PbeIds}.3`;ue.id_pbeWithSHAAnd2_KeyTripleDES_CBC=`${ue.id_pkcs_12PbeIds}.4`;ue.id_pbeWithSHAAnd128BitRC2_CBC=`${ue.id_pkcs_12PbeIds}.5`;ue.id_pbewithSHAAnd40BitRC2_CBC=`${ue.id_pkcs_12PbeIds}.6`;ue.id_bagtypes=`${ue.id_pkcs_12}.10.1`});var Vy=l(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.id_pkcs_9=vt.id_SafeContents=vt.id_SecretBag=vt.id_CRLBag=vt.id_certBag=vt.id_pkcs8ShroudedKeyBag=vt.id_keyBag=void 0;var Ga=Em();vt.id_keyBag=`${Ga.id_bagtypes}.1`;vt.id_pkcs8ShroudedKeyBag=`${Ga.id_bagtypes}.2`;vt.id_certBag=`${Ga.id_bagtypes}.3`;vt.id_CRLBag=`${Ga.id_bagtypes}.4`;vt.id_SecretBag=`${Ga.id_bagtypes}.5`;vt.id_SafeContents=`${Ga.id_bagtypes}.6`;vt.id_pkcs_9="1.2.840.113549.1.9"});var lE=l(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.id_sdsiCertificate=hr.id_x509Certificate=hr.id_certTypes=hr.CertBag=void 0;var uE=(v(),g(A)),Gy=S(),DN=Vy(),Il=class{certId="";certValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};hr.CertBag=Il;uE.__decorate([(0,Gy.AsnProp)({type:Gy.AsnPropTypes.ObjectIdentifier})],Il.prototype,"certId",void 0);uE.__decorate([(0,Gy.AsnProp)({type:Gy.AsnPropTypes.Any,context:0})],Il.prototype,"certValue",void 0);hr.id_certTypes=`${DN.id_pkcs_9}.22`;hr.id_x509Certificate=`${hr.id_certTypes}.1`;hr.id_sdsiCertificate=`${hr.id_certTypes}.2`});var dE=l(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.id_x509CRL=Gi.id_crlTypes=Gi.CRLBag=void 0;var fE=(v(),g(A)),Fy=S(),UN=Vy(),Bl=class{crlId="";crltValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Gi.CRLBag=Bl;fE.__decorate([(0,Fy.AsnProp)({type:Fy.AsnPropTypes.ObjectIdentifier})],Bl.prototype,"crlId",void 0);fE.__decorate([(0,Fy.AsnProp)({type:Fy.AsnPropTypes.Any,context:0})],Bl.prototype,"crltValue",void 0);Gi.id_crlTypes=`${UN.id_pkcs_9}.23`;Gi.id_x509CRL=`${Gi.id_crlTypes}.1`});var _E=l(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.EncryptedPrivateKeyInfo=Fa.EncryptedData=void 0;var pE=(v(),g(A)),Tm=S(),yE=X(),kl=class extends Tm.OctetString{};Fa.EncryptedData=kl;var jl=class{encryptionAlgorithm=new yE.AlgorithmIdentifier;encryptedData=new kl;constructor(e={}){Object.assign(this,e)}};Fa.EncryptedPrivateKeyInfo=jl;pE.__decorate([(0,Tm.AsnProp)({type:yE.AlgorithmIdentifier})],jl.prototype,"encryptionAlgorithm",void 0);pE.__decorate([(0,Tm.AsnProp)({type:kl})],jl.prototype,"encryptedData",void 0)});var hE=l(Ur=>{"use strict";var xm;Object.defineProperty(Ur,"__esModule",{value:!0});Ur.PrivateKeyInfo=Ur.Attributes=Ur.PrivateKey=Ur.Version=void 0;var Nl=(v(),g(A)),Fi=S(),Im=X(),Om;(function(t){t[t.v1=0]="v1"})(Om||(Ur.Version=Om={}));var Ml=class extends Fi.OctetString{};Ur.PrivateKey=Ml;var Hy=xm=class extends Fi.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,xm.prototype)}};Ur.Attributes=Hy;Ur.Attributes=Hy=xm=Nl.__decorate([(0,Fi.AsnType)({type:Fi.AsnTypeTypes.Sequence,itemType:Im.Attribute})],Hy);var Js=class{version=Om.v1;privateKeyAlgorithm=new Im.AlgorithmIdentifier;privateKey=new Ml;attributes;constructor(e={}){Object.assign(this,e)}};Ur.PrivateKeyInfo=Js;Nl.__decorate([(0,Fi.AsnProp)({type:Fi.AsnPropTypes.Integer})],Js.prototype,"version",void 0);Nl.__decorate([(0,Fi.AsnProp)({type:Im.AlgorithmIdentifier})],Js.prototype,"privateKeyAlgorithm",void 0);Nl.__decorate([(0,Fi.AsnProp)({type:Ml})],Js.prototype,"privateKey",void 0);Nl.__decorate([(0,Fi.AsnProp)({type:Hy,implicit:!0,context:0,optional:!0})],Js.prototype,"attributes",void 0)});var $y=l(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});var gE=(v(),g(A));gE.__exportStar(_E(),Wy);gE.__exportStar(hE(),Wy)});var vE=l(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.KeyBag=void 0;var LN=(v(),g(A)),KN=$y(),AE=S(),Bm=class extends KN.PrivateKeyInfo{};ql.KeyBag=Bm;ql.KeyBag=Bm=LN.__decorate([(0,AE.AsnType)({type:AE.AsnTypeTypes.Sequence})],Bm)});var bE=l(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.PKCS8ShroudedKeyBag=void 0;var VN=(v(),g(A)),GN=$y(),mE=S(),km=class extends GN.EncryptedPrivateKeyInfo{};Rl.PKCS8ShroudedKeyBag=km;Rl.PKCS8ShroudedKeyBag=km=VN.__decorate([(0,mE.AsnType)({type:mE.AsnTypeTypes.Sequence})],km)});var wE=l(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});Yy.SecretBag=void 0;var SE=(v(),g(A)),zy=S(),Dl=class{secretTypeId="";secretValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Yy.SecretBag=Dl;SE.__decorate([(0,zy.AsnProp)({type:zy.AsnPropTypes.ObjectIdentifier})],Dl.prototype,"secretTypeId",void 0);SE.__decorate([(0,zy.AsnProp)({type:zy.AsnPropTypes.Any,context:0})],Dl.prototype,"secretValue",void 0)});var CE=l(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});var Ha=(v(),g(A));Ha.__exportStar(lE(),Cn);Ha.__exportStar(dE(),Cn);Ha.__exportStar(vE(),Cn);Ha.__exportStar(bE(),Cn);Ha.__exportStar(wE(),Cn);Ha.__exportStar(Vy(),Cn)});var Mm=l(Jy=>{"use strict";Object.defineProperty(Jy,"__esModule",{value:!0});Jy.MacData=void 0;var jm=(v(),g(A)),PE=Cy(),Wa=S(),$a=class{mac=new PE.DigestInfo;macSalt=new Wa.OctetString;iterations=1;constructor(e={}){Object.assign(this,e)}};Jy.MacData=$a;jm.__decorate([(0,Wa.AsnProp)({type:PE.DigestInfo})],$a.prototype,"mac",void 0);jm.__decorate([(0,Wa.AsnProp)({type:Wa.OctetString})],$a.prototype,"macSalt",void 0);jm.__decorate([(0,Wa.AsnProp)({type:Wa.AsnPropTypes.Integer,defaultValue:1})],$a.prototype,"iterations",void 0)});var xE=l(Xy=>{"use strict";Object.defineProperty(Xy,"__esModule",{value:!0});Xy.PFX=void 0;var Nm=(v(),g(A)),Qy=S(),EE=hl(),TE=Mm(),za=class{version=3;authSafe=new EE.ContentInfo;macData=new TE.MacData;constructor(e={}){Object.assign(this,e)}};Xy.PFX=za;Nm.__decorate([(0,Qy.AsnProp)({type:Qy.AsnPropTypes.Integer})],za.prototype,"version",void 0);Nm.__decorate([(0,Qy.AsnProp)({type:EE.ContentInfo})],za.prototype,"authSafe",void 0);Nm.__decorate([(0,Qy.AsnProp)({type:TE.MacData,optional:!0})],za.prototype,"macData",void 0)});var OE=l(Xs=>{"use strict";var qm;Object.defineProperty(Xs,"__esModule",{value:!0});Xs.SafeContents=Xs.SafeBag=void 0;var Zy=(v(),g(A)),Pn=S(),FN=Sm(),Qs=class{bagId="";bagValue=new ArrayBuffer(0);bagAttributes;constructor(e={}){Object.assign(this,e)}};Xs.SafeBag=Qs;Zy.__decorate([(0,Pn.AsnProp)({type:Pn.AsnPropTypes.ObjectIdentifier})],Qs.prototype,"bagId",void 0);Zy.__decorate([(0,Pn.AsnProp)({type:Pn.AsnPropTypes.Any,context:0})],Qs.prototype,"bagValue",void 0);Zy.__decorate([(0,Pn.AsnProp)({type:FN.PKCS12Attribute,repeated:"set",optional:!0})],Qs.prototype,"bagAttributes",void 0);var Rm=qm=class extends Pn.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,qm.prototype)}};Xs.SafeContents=Rm;Xs.SafeContents=Rm=qm=Zy.__decorate([(0,Pn.AsnType)({type:Pn.AsnTypeTypes.Sequence,itemType:Qs})],Rm)});var IE=l(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var Zs=(v(),g(A));Zs.__exportStar(Sm(),Hi);Zs.__exportStar(cE(),Hi);Zs.__exportStar(CE(),Hi);Zs.__exportStar(Mm(),Hi);Zs.__exportStar(Em(),Hi);Zs.__exportStar(xE(),Hi);Zs.__exportStar(OE(),Hi)});var BE=l(p=>{"use strict";var Dm,Um,Lm;Object.defineProperty(p,"__esModule",{value:!0});p.DateOfBirth=p.UnstructuredAddress=p.UnstructuredName=p.EmailAddress=p.EncryptedPrivateKeyInfo=p.UserPKCS12=p.Pkcs7PDU=p.PKCS9String=p.id_at_pseudonym=p.crlTypes=p.id_certTypes=p.id_smime=p.id_pkcs9_mr_signingTimeMatch=p.id_pkcs9_mr_caseIgnoreMatch=p.id_pkcs9_sx_signingTime=p.id_pkcs9_sx_pkcs9String=p.id_pkcs9_at_countryOfResidence=p.id_pkcs9_at_countryOfCitizenship=p.id_pkcs9_at_gender=p.id_pkcs9_at_placeOfBirth=p.id_pkcs9_at_dateOfBirth=p.id_ietf_at=p.id_pkcs9_at_pkcs7PDU=p.id_pkcs9_at_sequenceNumber=p.id_pkcs9_at_randomNonce=p.id_pkcs9_at_encryptedPrivateKeyInfo=p.id_pkcs9_at_pkcs15Token=p.id_pkcs9_at_userPKCS12=p.id_pkcs9_at_localKeyId=p.id_pkcs9_at_friendlyName=p.id_pkcs9_at_smimeCapabilities=p.id_pkcs9_at_extensionRequest=p.id_pkcs9_at_signingDescription=p.id_pkcs9_at_extendedCertificateAttributes=p.id_pkcs9_at_unstructuredAddress=p.id_pkcs9_at_challengePassword=p.id_pkcs9_at_counterSignature=p.id_pkcs9_at_signingTime=p.id_pkcs9_at_messageDigest=p.id_pkcs9_at_contentType=p.id_pkcs9_at_unstructuredName=p.id_pkcs9_at_emailAddress=p.id_pkcs9_oc_naturalPerson=p.id_pkcs9_oc_pkcsEntity=p.id_pkcs9_mr=p.id_pkcs9_sx=p.id_pkcs9_at=p.id_pkcs9_oc=p.id_pkcs9_mo=p.id_pkcs9=void 0;p.SMIMECapabilities=p.SMIMECapability=p.SigningDescription=p.LocalKeyId=p.FriendlyName=p.ExtendedCertificateAttributes=p.ExtensionRequest=p.ChallengePassword=p.CounterSignature=p.SequenceNumber=p.RandomNonce=p.SigningTime=p.MessageDigest=p.ContentType=p.Pseudonym=p.CountryOfResidence=p.CountryOfCitizenship=p.Gender=p.PlaceOfBirth=void 0;var se=(v(),g(A)),R=S(),s0=se.__importStar(hl()),HN=se.__importStar(IE()),WN=se.__importStar($y()),Wi=se.__importStar(X()),$N=se.__importStar(tv());p.id_pkcs9="1.2.840.113549.1.9";p.id_pkcs9_mo=`${p.id_pkcs9}.0`;p.id_pkcs9_oc=`${p.id_pkcs9}.24`;p.id_pkcs9_at=`${p.id_pkcs9}.25`;p.id_pkcs9_sx=`${p.id_pkcs9}.26`;p.id_pkcs9_mr=`${p.id_pkcs9}.27`;p.id_pkcs9_oc_pkcsEntity=`${p.id_pkcs9_oc}.1`;p.id_pkcs9_oc_naturalPerson=`${p.id_pkcs9_oc}.2`;p.id_pkcs9_at_emailAddress=`${p.id_pkcs9}.1`;p.id_pkcs9_at_unstructuredName=`${p.id_pkcs9}.2`;p.id_pkcs9_at_contentType=`${p.id_pkcs9}.3`;p.id_pkcs9_at_messageDigest=`${p.id_pkcs9}.4`;p.id_pkcs9_at_signingTime=`${p.id_pkcs9}.5`;p.id_pkcs9_at_counterSignature=`${p.id_pkcs9}.6`;p.id_pkcs9_at_challengePassword=`${p.id_pkcs9}.7`;p.id_pkcs9_at_unstructuredAddress=`${p.id_pkcs9}.8`;p.id_pkcs9_at_extendedCertificateAttributes=`${p.id_pkcs9}.9`;p.id_pkcs9_at_signingDescription=`${p.id_pkcs9}.13`;p.id_pkcs9_at_extensionRequest=`${p.id_pkcs9}.14`;p.id_pkcs9_at_smimeCapabilities=`${p.id_pkcs9}.15`;p.id_pkcs9_at_friendlyName=`${p.id_pkcs9}.20`;p.id_pkcs9_at_localKeyId=`${p.id_pkcs9}.21`;p.id_pkcs9_at_userPKCS12="2.16.840.1.113730.3.1.216";p.id_pkcs9_at_pkcs15Token=`${p.id_pkcs9_at}.1`;p.id_pkcs9_at_encryptedPrivateKeyInfo=`${p.id_pkcs9_at}.2`;p.id_pkcs9_at_randomNonce=`${p.id_pkcs9_at}.3`;p.id_pkcs9_at_sequenceNumber=`${p.id_pkcs9_at}.4`;p.id_pkcs9_at_pkcs7PDU=`${p.id_pkcs9_at}.5`;p.id_ietf_at="1.3.6.1.5.5.7.9";p.id_pkcs9_at_dateOfBirth=`${p.id_ietf_at}.1`;p.id_pkcs9_at_placeOfBirth=`${p.id_ietf_at}.2`;p.id_pkcs9_at_gender=`${p.id_ietf_at}.3`;p.id_pkcs9_at_countryOfCitizenship=`${p.id_ietf_at}.4`;p.id_pkcs9_at_countryOfResidence=`${p.id_ietf_at}.5`;p.id_pkcs9_sx_pkcs9String=`${p.id_pkcs9_sx}.1`;p.id_pkcs9_sx_signingTime=`${p.id_pkcs9_sx}.2`;p.id_pkcs9_mr_caseIgnoreMatch=`${p.id_pkcs9_mr}.1`;p.id_pkcs9_mr_signingTimeMatch=`${p.id_pkcs9_mr}.2`;p.id_smime=`${p.id_pkcs9}.16`;p.id_certTypes=`${p.id_pkcs9}.22`;p.crlTypes=`${p.id_pkcs9}.23`;p.id_at_pseudonym=`${$N.id_at}.65`;var Ul=class extends Wi.DirectoryString{ia5String;constructor(e={}){super(e)}toString(){return{}.toString(),this.ia5String||super.toString()}};p.PKCS9String=Ul;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.IA5String})],Ul.prototype,"ia5String",void 0);p.PKCS9String=Ul=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Ul);var Km=class extends s0.ContentInfo{};p.Pkcs7PDU=Km;p.Pkcs7PDU=Km=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Km);var Vm=class extends HN.PFX{};p.UserPKCS12=Vm;p.UserPKCS12=Vm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Vm);var Gm=class extends WN.EncryptedPrivateKeyInfo{};p.EncryptedPrivateKeyInfo=Gm;p.EncryptedPrivateKeyInfo=Gm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Gm);var e_=class{value;constructor(e=""){this.value=e}toString(){return this.value}};p.EmailAddress=e_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.IA5String})],e_.prototype,"value",void 0);p.EmailAddress=e_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],e_);var Fm=class extends Ul{};p.UnstructuredName=Fm;p.UnstructuredName=Fm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Fm);var Hm=class extends Wi.DirectoryString{};p.UnstructuredAddress=Hm;p.UnstructuredAddress=Hm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Hm);var t_=class{value;constructor(e=new Date){this.value=e}};p.DateOfBirth=t_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.GeneralizedTime})],t_.prototype,"value",void 0);p.DateOfBirth=t_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],t_);var Wm=class extends Wi.DirectoryString{};p.PlaceOfBirth=Wm;p.PlaceOfBirth=Wm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Wm);var r_=class{value;constructor(e="M"){this.value=e}toString(){return this.value}};p.Gender=r_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.PrintableString})],r_.prototype,"value",void 0);p.Gender=r_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],r_);var Ll=class{value;constructor(e=""){this.value=e}toString(){return this.value}};p.CountryOfCitizenship=Ll;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.PrintableString})],Ll.prototype,"value",void 0);p.CountryOfCitizenship=Ll=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Ll);var $m=class extends Ll{};p.CountryOfResidence=$m;p.CountryOfResidence=$m=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],$m);var zm=class extends Wi.DirectoryString{};p.Pseudonym=zm;p.Pseudonym=zm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],zm);var i_=class{value;constructor(e=""){this.value=e}toString(){return this.value}};p.ContentType=i_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.ObjectIdentifier})],i_.prototype,"value",void 0);p.ContentType=i_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],i_);var Ym=class extends R.OctetString{};p.MessageDigest=Ym;var Jm=class extends Wi.Time{};p.SigningTime=Jm;p.SigningTime=Jm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Jm);var Qm=class extends R.OctetString{};p.RandomNonce=Qm;var n_=class{value;constructor(e=0){this.value=e}toString(){return this.value.toString()}};p.SequenceNumber=n_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.Integer})],n_.prototype,"value",void 0);p.SequenceNumber=n_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],n_);var Xm=class extends s0.SignerInfo{};p.CounterSignature=Xm;p.CounterSignature=Xm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Xm);var Zm=class extends Wi.DirectoryString{};p.ChallengePassword=Zm;p.ChallengePassword=Zm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Zm);var e0=Dm=class extends Wi.Extensions{constructor(e){super(e),Object.setPrototypeOf(this,Dm.prototype)}};p.ExtensionRequest=e0;p.ExtensionRequest=e0=Dm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],e0);var t0=Um=class extends R.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Um.prototype)}};p.ExtendedCertificateAttributes=t0;p.ExtendedCertificateAttributes=t0=Um=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Set,itemType:s0.Attribute})],t0);var s_=class{value;constructor(e=""){this.value=e}toString(){return this.value}};p.FriendlyName=s_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.BmpString})],s_.prototype,"value",void 0);p.FriendlyName=s_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],s_);var r0=class extends R.OctetString{};p.LocalKeyId=r0;var i0=class extends Wi.DirectoryString{};p.SigningDescription=i0;var o_=class extends Wi.AlgorithmIdentifier{};p.SMIMECapability=o_;p.SMIMECapability=o_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],o_);var n0=Lm=class extends R.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Lm.prototype)}};p.SMIMECapabilities=n0;p.SMIMECapabilities=n0=Lm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence,itemType:o_})],n0)});var u0=l(Kl=>{"use strict";var o0;Object.defineProperty(Kl,"__esModule",{value:!0});Kl.Attributes=void 0;var zN=(v(),g(A)),a0=S(),YN=X(),c0=o0=class extends a0.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,o0.prototype)}};Kl.Attributes=c0;Kl.Attributes=c0=o0=zN.__decorate([(0,a0.AsnType)({type:a0.AsnTypeTypes.Sequence,itemType:YN.Attribute})],c0)});var l0=l(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});u_.CertificationRequestInfo=void 0;var c_=(v(),g(A)),Vl=S(),a_=X(),kE=u0(),eo=class{version=0;subject=new a_.Name;subjectPKInfo=new a_.SubjectPublicKeyInfo;attributes=new kE.Attributes;constructor(e={}){Object.assign(this,e)}};u_.CertificationRequestInfo=eo;c_.__decorate([(0,Vl.AsnProp)({type:Vl.AsnPropTypes.Integer})],eo.prototype,"version",void 0);c_.__decorate([(0,Vl.AsnProp)({type:a_.Name})],eo.prototype,"subject",void 0);c_.__decorate([(0,Vl.AsnProp)({type:a_.SubjectPublicKeyInfo})],eo.prototype,"subjectPKInfo",void 0);c_.__decorate([(0,Vl.AsnProp)({type:kE.Attributes,implicit:!0,context:0,optional:!0})],eo.prototype,"attributes",void 0)});var NE=l(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});f_.CertificationRequest=void 0;var f0=(v(),g(A)),l_=S(),jE=X(),ME=l0(),Ya=class{certificationRequestInfo=new ME.CertificationRequestInfo;certificationRequestInfoRaw;signatureAlgorithm=new jE.AlgorithmIdentifier;signature=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};f_.CertificationRequest=Ya;f0.__decorate([(0,l_.AsnProp)({type:ME.CertificationRequestInfo,raw:!0})],Ya.prototype,"certificationRequestInfo",void 0);f0.__decorate([(0,l_.AsnProp)({type:jE.AlgorithmIdentifier})],Ya.prototype,"signatureAlgorithm",void 0);f0.__decorate([(0,l_.AsnProp)({type:l_.AsnPropTypes.BitString})],Ya.prototype,"signature",void 0)});var qE=l(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var d0=(v(),g(A));d0.__exportStar(u0(),Gl);d0.__exportStar(NE(),Gl);d0.__exportStar(l0(),Gl)});var b0=l(B=>{"use strict";EC();var P=S(),L=X(),O=Ch(),E=(v(),g(A)),JN=hl(),P_=_y(),Nt=Cy(),Se=aE(),v0=BE(),E_=qE();function jf(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(r){if(r!=="default"){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}}),e.default=t,Object.freeze(e)}var C=jf(L),Mt=jf(JN),Oe=jf(P_),be=jf(Nt),ic=jf(v0),cc="crypto.algorithm",T_=class{getAlgorithms(){return Se.container.resolveAll(cc)}toAsnAlgorithm(e){({...e});for(let r of this.getAlgorithms()){let i=r.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){let r=new L.AlgorithmIdentifier({algorithm:e.name});if("parameters"in e){let i=e;r.parameters=i.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(let i of this.getAlgorithms()){let n=i.toWebAlgorithm(e);if(n)return n}return{name:e.algorithm,parameters:e.parameters}}},Vr="crypto.algorithmProvider";Se.container.registerSingleton(Vr,T_);var y_,Ut="1.3.36.3.3.2.8.1.1",RE=`${Ut}.1`,DE=`${Ut}.2`,UE=`${Ut}.3`,LE=`${Ut}.4`,KE=`${Ut}.5`,VE=`${Ut}.6`,GE=`${Ut}.7`,FE=`${Ut}.8`,HE=`${Ut}.9`,WE=`${Ut}.10`,$E=`${Ut}.11`,zE=`${Ut}.12`,YE=`${Ut}.13`,JE=`${Ut}.14`,QE="brainpoolP160r1",XE="brainpoolP160t1",ZE="brainpoolP192r1",eT="brainpoolP192t1",tT="brainpoolP224r1",rT="brainpoolP224t1",iT="brainpoolP256r1",nT="brainpoolP256t1",sT="brainpoolP320r1",oT="brainpoolP320t1",aT="brainpoolP384r1",cT="brainpoolP384t1",uT="brainpoolP512r1",lT="brainpoolP512t1",Me="ECDSA";B.EcAlgorithm=y_=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case Me.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Oe.ecdsaWithSHA1;case"sha-256":return Oe.ecdsaWithSHA256;case"sha-384":return Oe.ecdsaWithSHA384;case"sha-512":return Oe.ecdsaWithSHA512}else if("namedCurve"in e){let r="";switch(e.namedCurve){case"P-256":r=Oe.id_secp256r1;break;case"K-256":r=y_.SECP256K1;break;case"P-384":r=Oe.id_secp384r1;break;case"P-521":r=Oe.id_secp521r1;break;case QE:r=RE;break;case XE:r=DE;break;case ZE:r=UE;break;case eT:r=LE;break;case tT:r=KE;break;case rT:r=VE;break;case iT:r=GE;break;case nT:r=FE;break;case sT:r=HE;break;case oT:r=WE;break;case aT:r=$E;break;case cT:r=zE;break;case uT:r=YE;break;case lT:r=JE;break}if(r)return new L.AlgorithmIdentifier({algorithm:Oe.id_ecPublicKey,parameters:P.AsnConvert.serialize(new Oe.ECParameters({namedCurve:r}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case Oe.id_ecdsaWithSHA1:return{name:Me,hash:{name:"SHA-1"}};case Oe.id_ecdsaWithSHA256:return{name:Me,hash:{name:"SHA-256"}};case Oe.id_ecdsaWithSHA384:return{name:Me,hash:{name:"SHA-384"}};case Oe.id_ecdsaWithSHA512:return{name:Me,hash:{name:"SHA-512"}};case Oe.id_ecPublicKey:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(P.AsnConvert.parse(e.parameters,Oe.ECParameters).namedCurve){case Oe.id_secp256r1:return{name:Me,namedCurve:"P-256"};case y_.SECP256K1:return{name:Me,namedCurve:"K-256"};case Oe.id_secp384r1:return{name:Me,namedCurve:"P-384"};case Oe.id_secp521r1:return{name:Me,namedCurve:"P-521"};case RE:return{name:Me,namedCurve:QE};case DE:return{name:Me,namedCurve:XE};case UE:return{name:Me,namedCurve:ZE};case LE:return{name:Me,namedCurve:eT};case KE:return{name:Me,namedCurve:tT};case VE:return{name:Me,namedCurve:rT};case GE:return{name:Me,namedCurve:iT};case FE:return{name:Me,namedCurve:nT};case HE:return{name:Me,namedCurve:sT};case WE:return{name:Me,namedCurve:oT};case $E:return{name:Me,namedCurve:aT};case zE:return{name:Me,namedCurve:cT};case YE:return{name:Me,namedCurve:uT};case JE:return{name:Me,namedCurve:lT}}}}return null}};B.EcAlgorithm.SECP256K1="1.3.132.0.10";B.EcAlgorithm=y_=E.__decorate([Se.injectable()],B.EcAlgorithm);Se.container.registerSingleton(cc,B.EcAlgorithm);var hT=Symbol("name"),gT=Symbol("value"),Z=class{constructor(e,r={},i=""){this[hT]=e,this[gT]=i;for(let n in r)this[n]=r[n]}};Z.NAME=hT;Z.VALUE=gT;var x_=class{static toTextObject(e){let r=new Z("Algorithm Identifier",{},gr.toString(e.algorithm));if(e.parameters)if(e.algorithm===Oe.id_ecPublicKey){let i=new B.EcAlgorithm().toWebAlgorithm(e);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=e.parameters}else r.Parameters=e.parameters;return r}},gr=class{static toString(e){let r=this.items[e];return r||e}};gr.items={[be.id_sha1]:"sha1",[be.id_sha224]:"sha224",[be.id_sha256]:"sha256",[be.id_sha384]:"sha384",[be.id_sha512]:"sha512",[be.id_rsaEncryption]:"rsaEncryption",[be.id_sha1WithRSAEncryption]:"sha1WithRSAEncryption",[be.id_sha224WithRSAEncryption]:"sha224WithRSAEncryption",[be.id_sha256WithRSAEncryption]:"sha256WithRSAEncryption",[be.id_sha384WithRSAEncryption]:"sha384WithRSAEncryption",[be.id_sha512WithRSAEncryption]:"sha512WithRSAEncryption",[Oe.id_ecPublicKey]:"ecPublicKey",[Oe.id_ecdsaWithSHA1]:"ecdsaWithSHA1",[Oe.id_ecdsaWithSHA224]:"ecdsaWithSHA224",[Oe.id_ecdsaWithSHA256]:"ecdsaWithSHA256",[Oe.id_ecdsaWithSHA384]:"ecdsaWithSHA384",[Oe.id_ecdsaWithSHA512]:"ecdsaWithSHA512",[C.id_kp_serverAuth]:"TLS WWW server authentication",[C.id_kp_clientAuth]:"TLS WWW client authentication",[C.id_kp_codeSigning]:"Code Signing",[C.id_kp_emailProtection]:"E-mail Protection",[C.id_kp_timeStamping]:"Time Stamping",[C.id_kp_OCSPSigning]:"OCSP Signing",[Mt.id_signedData]:"Signed Data"};var Gr=class{static serialize(e){return this.serializeObj(e).join(`
18
- `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,r=0){let i=[],n=this.pad(r++),s="",o=e[Z.VALUE];o&&(s=` ${o}`),i.push(`${n}${e[Z.NAME]}:${s}`),n=this.pad(r);for(let a in e){if(typeof a=="symbol")continue;let c=e[a],u=a?`${a}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")i.push(`${n}${u}${c}`);else if(c instanceof Date)i.push(`${n}${u}${c.toUTCString()}`);else if(Array.isArray(c))for(let f of c)f[Z.NAME]=a,i.push(...this.serializeObj(f,r));else if(c instanceof Z)c[Z.NAME]=a,i.push(...this.serializeObj(c,r));else if(O.BufferSourceConverter.isBufferSource(c))a?(i.push(`${n}${u}`),i.push(...this.serializeBufferSource(c,r+1))):i.push(...this.serializeBufferSource(c,r));else if("toTextObject"in c){let f=c.toTextObject();f[Z.NAME]=a,i.push(...this.serializeObj(f,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(e,r=0){let i=this.pad(r),n=O.BufferSourceConverter.toUint8Array(e),s=[];for(let o=0;o<n.length;){let a=[];for(let c=0;c<16&&o<n.length;c++){c===8&&a.push("");let u=n[o++].toString(16).padStart(2,"0");a.push(u)}s.push(`${i}${a.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}};Gr.oidSerializer=gr;Gr.algorithmSerializer=x_;var Ja,Ai=class t{get rawData(){return E.__classPrivateFieldGet(this,Ja,"f")||E.__classPrivateFieldSet(this,Ja,P.AsnConvert.serialize(this.asn),"f"),E.__classPrivateFieldGet(this,Ja,"f")}constructor(...e){Ja.set(this,void 0),O.BufferSourceConverter.isBufferSource(e[0])?(this.asn=P.AsnConvert.parse(e[0],e[1]),E.__classPrivateFieldSet(this,Ja,O.BufferSourceConverter.toArrayBuffer(e[0]),"f"),this.onInit(this.asn)):(this.asn=e[0],this.onInit(this.asn))}equal(e){return e instanceof t?O.isEqual(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return P.AsnConvert.toString(this.rawData);case"text":return Gr.serialize(this.toTextObject());case"hex":return O.Convert.ToHex(this.rawData);case"base64":return O.Convert.ToBase64(this.rawData);case"base64url":return O.Convert.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){let e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new Z(this.getTextName(),{},e)}};Ja=new WeakMap;Ai.NAME="ASN";var qt=class t extends Ai{constructor(...e){let r;O.BufferSourceConverter.isBufferSource(e[0])?r=O.BufferSourceConverter.toArrayBuffer(e[0]):r=P.AsnConvert.serialize(new L.Extension({extnID:e[0],critical:e[1],extnValue:new P.OctetString(O.BufferSourceConverter.toArrayBuffer(e[2]))})),super(r,L.Extension)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[Z.NAME]===t.NAME&&(e[Z.NAME]=gr.toString(this.type)),e}},AT,nc=class t{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[AT]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(t.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(t.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,r){return this.items.forEach(e,r)}has(e){return this.items.has(e)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(e=t.DEFAULT){let r=this.items.get(e.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${e}'`);return r}set(e,r){if(typeof e=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),r)}else this.items.set(t.DEFAULT,e);return this}};AT=Symbol.toStringTag;nc.DEFAULT="default";var Ie=new nc,QN=/^[0-2](?:\.[1-9][0-9]*)+$/;function XN(t){return new RegExp(QN).test(t)}var vf=class{constructor(e={}){this.items={};for(let r in e)this.register(r,e[r])}get(e){return this.items[e]||null}findId(e){return XN(e)?e:this.get(e)}register(e,r){this.items[e]=r,this.items[r]=e}},Rt=new vf;Rt.register("CN","2.5.4.3");Rt.register("L","2.5.4.7");Rt.register("ST","2.5.4.8");Rt.register("O","2.5.4.10");Rt.register("OU","2.5.4.11");Rt.register("C","2.5.4.6");Rt.register("DC","0.9.2342.19200300.100.1.25");Rt.register("E","1.2.840.113549.1.9.1");Rt.register("G","2.5.4.42");Rt.register("I","2.5.4.43");Rt.register("SN","2.5.4.4");Rt.register("T","2.5.4.12");function ZN(t,e){return`\\${O.Convert.ToHex(O.Convert.FromUtf8String(e)).toUpperCase()}`}function eq(t){return t.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,ZN)}var rt=class t{static isASCII(e){for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,r={}){this.extraNames=new vf,this.asn=new L.Name;for(let i in r)if(Object.prototype.hasOwnProperty.call(r,i)){let n=r[i];this.extraNames.register(i,n)}typeof e=="string"?this.asn=this.fromString(e):e instanceof L.Name?this.asn=e:O.BufferSourceConverter.isBufferSource(e)?this.asn=P.AsnConvert.parse(e,L.Name):this.asn=this.fromJSON(e)}getField(e){let r=this.extraNames.findId(e)||Rt.findId(e),i=[];for(let n of this.asn)for(let s of n)s.type===r&&i.push(s.value.toString());return i}getName(e){return this.extraNames.get(e)||Rt.get(e)}toString(){return this.asn.map(e=>e.map(r=>{let i=this.getName(r.type)||r.type,n=r.value.anyValue?`#${O.Convert.ToHex(r.value.anyValue)}`:eq(r.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var e;let r=[];for(let i of this.asn){let n={};for(let s of i){let o=this.getName(s.type)||s.type;(e=n[o])!==null&&e!==void 0||(n[o]=[]),n[o].push(s.value.anyValue?`#${O.Convert.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(n)}return r}fromString(e){let r=new L.Name,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g,n=null,s=",";for(;n=i.exec(`${e},`);){let[,o,a]=n,c=a[a.length-1];(c===","||c==="+")&&(a=a.slice(0,a.length-1),n[3]=c);let u=n[3];o=this.getTypeOid(o);let f=this.createAttribute(o,a);s==="+"?r[r.length-1].push(f):r.push(new L.RelativeDistinguishedName([f])),s=u}return r}fromJSON(e){let r=new L.Name;for(let i of e){let n=new L.RelativeDistinguishedName;for(let s in i){let o=this.getTypeOid(s),a=i[s];for(let c of a){let u=this.createAttribute(o,c);n.push(u)}}r.push(n)}return r}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw new Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,r){let i=new L.AttributeTypeAndValue({type:e});if(typeof r=="object")for(let n in r)switch(n){case"ia5String":i.value.ia5String=r[n];break;case"utf8String":i.value.utf8String=r[n];break;case"universalString":i.value.universalString=r[n];break;case"bmpString":i.value.bmpString=r[n];break;case"printableString":i.value.printableString=r[n];break}else if(r[0]==="#")i.value.anyValue=O.Convert.FromHex(r.slice(1));else{let n=this.processStringValue(r);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:t.isPrintableString(n)?i.value.printableString=n:i.value.utf8String=n}return i}processStringValue(e){let r=/"(.*?[^\\])?"/.exec(e);return r&&(e=r[1]),e.replace(/\\0a/ig,`
19
- `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return P.AsnConvert.serialize(this.asn)}async getThumbprint(...e){var r;let i,n="SHA-1";return e.length>=1&&!(!((r=e[0])===null||r===void 0)&&r.subtle)?(n=e[0]||n,i=e[1]||Ie.get()):i=e[0]||Ie.get(),await i.subtle.digest(n,this.toArrayBuffer())}},vT="Cannot initialize GeneralName from ASN.1 data.",fT=`${vT} Unsupported string format in use.`,tq=`${vT} Value doesn't match to GUID regular expression.`,dT=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,pT="1.3.6.1.4.1.311.25.1",yT="1.3.6.1.4.1.311.20.2.3",__="dns",h_="dn",g_="email",A_="ip",v_="url",m_="guid",b_="upn",Fl="id",Lr=class extends Ai{constructor(...e){let r;if(e.length===2)switch(e[0]){case h_:{let i=new rt(e[1]).toArrayBuffer(),n=P.AsnConvert.parse(i,C.Name);r=new C.GeneralName({directoryName:n});break}case __:r=new C.GeneralName({dNSName:e[1]});break;case g_:r=new C.GeneralName({rfc822Name:e[1]});break;case m_:{let i=new RegExp(dT,"i").exec(e[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");let n=i.slice(1).map((s,o)=>o<3?O.Convert.ToHex(new Uint8Array(O.Convert.FromHex(s)).reverse()):s).join("");r=new C.GeneralName({otherName:new C.OtherName({typeId:pT,value:P.AsnConvert.serialize(new P.OctetString(O.Convert.FromHex(n)))})});break}case A_:r=new C.GeneralName({iPAddress:e[1]});break;case Fl:r=new C.GeneralName({registeredID:e[1]});break;case b_:{r=new C.GeneralName({otherName:new C.OtherName({typeId:yT,value:P.AsnConvert.serialize(P.AsnUtf8StringConverter.toASN(e[1]))})});break}case v_:r=new C.GeneralName({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else O.BufferSourceConverter.isBufferSource(e[0])?r=P.AsnConvert.parse(e[0],C.GeneralName):r=e[0];super(r)}onInit(e){if(e.dNSName!=null)this.type=__,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=g_,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=A_,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=v_,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Fl,this.value=e.registeredID;else if(e.directoryName!=null)this.type=h_,this.value=new rt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===pT){this.type=m_;let r=P.AsnConvert.parse(e.otherName.value,P.OctetString),i=new RegExp(dT,"i").exec(O.Convert.ToHex(r));if(!i)throw new Error(tq);this.value=i.slice(1).map((n,s)=>s<3?O.Convert.ToHex(new Uint8Array(O.Convert.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===yT)this.type=b_,this.value=P.AsnConvert.parse(e.otherName.value,C.DirectoryString).toString();else throw new Error(fT);else throw new Error(fT)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case h_:case __:case m_:case A_:case Fl:case b_:case v_:e=this.type.toUpperCase();break;case g_:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===Fl&&(r=gr.toString(r)),new Z(e,void 0,r)}},vi=class extends Ai{constructor(e){let r;if(e instanceof C.GeneralNames)r=e;else if(Array.isArray(e)){let i=[];for(let n of e)if(n instanceof C.GeneralName)i.push(n);else{let s=P.AsnConvert.parse(new Lr(n.type,n.value).rawData,C.GeneralName);i.push(s)}r=new C.GeneralNames(i)}else if(O.BufferSourceConverter.isBufferSource(e))r=P.AsnConvert.parse(e,C.GeneralNames);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(e){let r=[];for(let i of e){let n=null;try{n=new Lr(i)}catch{continue}r.push(n)}this.items=r}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){let e=super.toTextObjectEmpty();for(let r of this.items){let i=r.toTextObject(),n=e[i[Z.NAME]];Array.isArray(n)||(n=[],e[i[Z.NAME]]=n),n.push(i)}return e}};vi.NAME="GeneralNames";var Af="-{5}",mf="\\n",rq=`[^${mf}]+`,iq=`${Af}BEGIN (${rq}(?=${Af}))${Af}`,nq=`${Af}END \\1${Af}`,sc="\\n",sq=`[^:${mf}]+`,oq=`(?:[^${mf}]+${sc}(?: +[^${mf}]+${sc})*)`,aq="[a-zA-Z0-9=+/]+",cq=`(?:${aq}${sc})+`,_T=`${iq}${sc}(?:((?:${sq}: ${oq})+))?${sc}?(${cq})${nq}`,at=class{static isPem(e){return typeof e=="string"&&new RegExp(_T,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");let r=new RegExp(_T,"g"),i=[],n=null;for(;n=r.exec(e);){let s=n[3].replace(new RegExp(`[${mf}]+`,"g"),""),o={type:n[1],headers:[],rawData:O.Convert.FromBase64(s)},a=n[2];if(a){let c=a.split(new RegExp(sc,"g")),u=null;for(let f of c){let[d,y]=f.split(/:(.*)/);if(y===void 0){if(!u)throw new Error("Cannot parse PEM string. Incorrect header value");u.value+=d.trim()}else u&&o.headers.push(u),u={key:d,value:y.trim()}}u&&o.headers.push(u)}i.push(o)}return i}static decode(e){return this.decodeWithHeaders(e).map(i=>i.rawData)}static decodeFirst(e){let r=this.decode(e);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(e,r){if(Array.isArray(e)){let i=new Array;return r?e.forEach(n=>{if(!O.BufferSourceConverter.isBufferSource(n))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:O.BufferSourceConverter.toArrayBuffer(n)}))}):e.forEach(n=>{if(!("type"in n))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(n))}),i.join(`
17
+ `)}function LM(t,e,r){let[,i=null]=t.toString().match(/constructor\(([\w, ]+)\)/)||[],n=DM(i,e);return UM(`Cannot inject the dependency ${n} of "${t.name}" constructor. Reason:`,r)}My.formatErrorCtor=LM});var HP=l(Ny=>{"use strict";Object.defineProperty(Ny,"__esModule",{value:!0});Ny.isDisposable=void 0;function KM(t){return!(typeof t.dispose!="function"||t.dispose.length>0)}Ny.isDisposable=KM});var $P=l($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.PostResolutionInterceptors=$s.PreResolutionInterceptors=void 0;var WP=Jv(),qy=class extends WP.default{};$s.PreResolutionInterceptors=qy;var Ry=class extends WP.default{};$s.PostResolutionInterceptors=Ry;var rm=class{constructor(){this.preResolution=new qy,this.postResolution=new Ry}};$s.default=rm});var bn=l(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.instance=Ki.typeInfo=void 0;var VM=(Py(),g(Cy)),Pt=$v(),GM=VP(),Dy=Iy(),FM=GP(),jt=Kv(),Uy=FP(),HM=tm(),WM=Oy(),$M=HP(),zM=$P();Ki.typeInfo=new Map;var im=class t{constructor(e){this.parent=e,this._registry=new FM.default,this.interceptors=new zM.default,this.disposed=!1,this.disposables=new Set}register(e,r,i={lifecycle:jt.default.Transient}){this.ensureNotDisposed();let n;if(GM.isProvider(r)?n=r:n={useClass:r},Pt.isTokenProvider(n)){let s=[e],o=n;for(;o!=null;){let a=o.useToken;if(s.includes(a))throw new Error(`Token registration cycle detected! ${[...s,a].join(" -> ")}`);s.push(a);let c=this._registry.get(a);c&&Pt.isTokenProvider(c.provider)?o=c.provider:o=null}}if((i.lifecycle===jt.default.Singleton||i.lifecycle==jt.default.ContainerScoped||i.lifecycle==jt.default.ResolutionScoped)&&(Pt.isValueProvider(n)||Pt.isFactoryProvider(n)))throw new Error(`Cannot use lifecycle "${jt.default[i.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:n,options:i}),this}registerType(e,r){return this.ensureNotDisposed(),Pt.isNormalToken(r)?this.register(e,{useToken:r}):this.register(e,{useClass:r})}registerInstance(e,r){return this.ensureNotDisposed(),this.register(e,{useValue:r})}registerSingleton(e,r){if(this.ensureNotDisposed(),Pt.isNormalToken(e)){if(Pt.isNormalToken(r))return this.register(e,{useToken:r},{lifecycle:jt.default.Singleton});if(r)return this.register(e,{useClass:r},{lifecycle:jt.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let i=e;return r&&!Pt.isNormalToken(r)&&(i=r),this.register(e,{useClass:i},{lifecycle:jt.default.Singleton})}resolve(e,r=new Uy.default,i=!1){this.ensureNotDisposed();let n=this.getRegistration(e);if(!n&&Pt.isNormalToken(e)){if(i)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),n){let s=this.resolveRegistration(n,r);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(Dy.isConstructorToken(e)){let s=this.construct(e,r);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,r){if(this.interceptors.preResolution.has(e)){let i=[];for(let n of this.interceptors.preResolution.getAll(e))n.options.frequency!="Once"&&i.push(n),n.callback(e,r);this.interceptors.preResolution.setAll(e,i)}}executePostResolutionInterceptor(e,r,i){if(this.interceptors.postResolution.has(e)){let n=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&n.push(s),s.callback(e,r,i);this.interceptors.postResolution.setAll(e,n)}}resolveRegistration(e,r){if(this.ensureNotDisposed(),e.options.lifecycle===jt.default.ResolutionScoped&&r.scopedResolutions.has(e))return r.scopedResolutions.get(e);let i=e.options.lifecycle===jt.default.Singleton,n=e.options.lifecycle===jt.default.ContainerScoped,s=i||n,o;return Pt.isValueProvider(e.provider)?o=e.provider.useValue:Pt.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,r)):this.resolve(e.provider.useToken,r):Pt.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,r)):this.construct(e.provider.useClass,r):Pt.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,r),e.options.lifecycle===jt.default.ResolutionScoped&&r.scopedResolutions.set(e,o),o}resolveAll(e,r=new Uy.default,i=!1){this.ensureNotDisposed();let n=this.getAllRegistrations(e);if(!n&&Pt.isNormalToken(e)){if(i)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),n){let o=n.map(a=>this.resolveRegistration(a,r));return this.executePostResolutionInterceptor(e,o,"All"),o}let s=[this.construct(e,r)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,r=!1){return this.ensureNotDisposed(),this._registry.has(e)||r&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,r]of this._registry.entries())this._registry.setAll(e,r.filter(i=>!Pt.isValueProvider(i.provider)).map(i=>(i.instance=void 0,i)))}createChildContainer(){this.ensureNotDisposed();let e=new t(this);for(let[r,i]of this._registry.entries())i.some(({options:n})=>n.lifecycle===jt.default.ContainerScoped)&&e._registry.setAll(r,i.map(n=>n.options.lifecycle===jt.default.ContainerScoped?{provider:n.provider,options:n.options}:n));return e}beforeResolution(e,r,i={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:r,options:i})}afterResolution(e,r,i={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:r,options:i})}dispose(){return VM.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(r=>{let i=r.dispose();i&&e.push(i)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,r){if(e instanceof WM.DelayedConstructor)return e.createProxy(n=>this.resolve(n,r));let i=(()=>{let n=Ki.typeInfo.get(e);if(!n||n.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=n.map(this.resolveParams(r,e));return new e(...s)})();return $M.isDisposable(i)&&this.disposables.add(i),i}resolveParams(e,r){return(i,n)=>{try{return Dy.isTokenDescriptor(i)?Dy.isTransformDescriptor(i)?i.multiple?this.resolve(i.transform).transform(this.resolveAll(i.token,new Uy.default,i.isOptional),...i.transformArgs):this.resolve(i.transform).transform(this.resolve(i.token,e,i.isOptional),...i.transformArgs):i.multiple?this.resolveAll(i.token,new Uy.default,i.isOptional):this.resolve(i.token,e,i.isOptional):Dy.isTransformDescriptor(i)?this.resolve(i.transform,e).transform(this.resolve(i.token,e),...i.transformArgs):this.resolve(i,e)}catch(s){throw new Error(HM.formatErrorCtor(r,n,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};Ki.instance=new im;Ki.default=Ki.instance});var zP=l(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});var YM=Hs(),Vi=bn(),nm=Iy(),JM=tm();function QM(){return function(t){let e=YM.getParamInfo(t);return class extends t{constructor(...r){super(...r.concat(e.slice(r.length).map((i,n)=>{try{return nm.isTokenDescriptor(i)?nm.isTransformDescriptor(i)?i.multiple?Vi.instance.resolve(i.transform).transform(Vi.instance.resolveAll(i.token),...i.transformArgs):Vi.instance.resolve(i.transform).transform(Vi.instance.resolve(i.token),...i.transformArgs):i.multiple?Vi.instance.resolveAll(i.token):Vi.instance.resolve(i.token):nm.isTransformDescriptor(i)?Vi.instance.resolve(i.transform).transform(Vi.instance.resolve(i.token),...i.transformArgs):Vi.instance.resolve(i)}catch(s){let o=n+r.length;throw new Error(JM.formatErrorCtor(t,o,s))}})))}}}}sm.default=QM});var YP=l(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var XM=Hs();function ZM(t,e){let r={token:t,multiple:!1,isOptional:e&&e.isOptional};return XM.defineInjectionTokenMetadata(r)}om.default=ZM});var Ly=l(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var eN=Hs(),tN=bn(),JP=bn();function rN(t){return function(e){tN.typeInfo.set(e,eN.getParamInfo(e)),t&&t.token&&(Array.isArray(t.token)?t.token.forEach(r=>{JP.instance.register(r,e)}):JP.instance.register(t.token,e))}}am.default=rN});var QP=l(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});var iN=(Py(),g(Cy)),nN=bn();function sN(t=[]){return function(e){return t.forEach(r=>{var{token:i,options:n}=r,s=iN.__rest(r,["token","options"]);return nN.instance.register(i,s,n)}),e}}cm.default=sN});var XP=l(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var oN=Ly(),aN=bn();function cN(){return function(t){oN.default()(t),aN.instance.registerSingleton(t)}}um.default=cN});var ZP=l(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});var uN=Hs();function lN(t,e){let r={token:t,multiple:!0,isOptional:e&&e.isOptional};return uN.defineInjectionTokenMetadata(r)}lm.default=lN});var eE=l(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var fN=Hs();function dN(t,e,...r){let i={token:t,multiple:!0,transform:e,transformArgs:r};return fN.defineInjectionTokenMetadata(i)}fm.default=dN});var tE=l(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var pN=Hs();function yN(t,e,...r){return pN.defineInjectionTokenMetadata(t,{transformToken:e,args:r})}dm.default=yN});var rE=l(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var _N=Ly(),hN=bn();function gN(t,e){return function(r){_N.default()(r),hN.instance.register(e||r,r,{lifecycle:t})}}pm.default=gN});var iE=l(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});var AN=zP();Object.defineProperty(Dr,"autoInjectable",{enumerable:!0,get:function(){return AN.default}});var vN=YP();Object.defineProperty(Dr,"inject",{enumerable:!0,get:function(){return vN.default}});var mN=Ly();Object.defineProperty(Dr,"injectable",{enumerable:!0,get:function(){return mN.default}});var bN=QP();Object.defineProperty(Dr,"registry",{enumerable:!0,get:function(){return bN.default}});var SN=XP();Object.defineProperty(Dr,"singleton",{enumerable:!0,get:function(){return SN.default}});var wN=ZP();Object.defineProperty(Dr,"injectAll",{enumerable:!0,get:function(){return wN.default}});var CN=eE();Object.defineProperty(Dr,"injectAllWithTransform",{enumerable:!0,get:function(){return CN.default}});var PN=tE();Object.defineProperty(Dr,"injectWithTransform",{enumerable:!0,get:function(){return PN.default}});var EN=rE();Object.defineProperty(Dr,"scoped",{enumerable:!0,get:function(){return EN.default}})});var nE=l(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});function TN(t){let e;return r=>(e==null&&(e=t(r)),e)}ym.default=TN});var sE=l(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});function xN(t){let e=new WeakMap;return r=>{let i=e.get(r);return i==null&&(i=t(r),e.set(r,i)),i}}_m.default=xN});var oE=l(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});function ON(t,e,r,i=!0){let n,s;return o=>{let a=t(o);return(!i||s!==a)&&((s=a)?n=o.resolve(e):n=o.resolve(r)),n}}hm.default=ON});var aE=l(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});var IN=nE();Object.defineProperty(Tl,"instanceCachingFactory",{enumerable:!0,get:function(){return IN.default}});var BN=sE();Object.defineProperty(Tl,"instancePerContainerCachingFactory",{enumerable:!0,get:function(){return BN.default}});var kN=oE();Object.defineProperty(Tl,"predicateAwareClassFactory",{enumerable:!0,get:function(){return kN.default}})});var cE=l(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var gm=(Py(),g(Cy));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var jN=KP();Object.defineProperty(Sn,"Lifecycle",{enumerable:!0,get:function(){return jN.Lifecycle}});gm.__exportStar(iE(),Sn);gm.__exportStar(aE(),Sn);gm.__exportStar($v(),Sn);var MN=Oy();Object.defineProperty(Sn,"delay",{enumerable:!0,get:function(){return MN.delay}});var NN=bn();Object.defineProperty(Sn,"container",{enumerable:!0,get:function(){return NN.instance}})});var bm=l(Ys=>{"use strict";var Am;Object.defineProperty(Ys,"__esModule",{value:!0});Ys.PKCS12AttrSet=Ys.PKCS12Attribute=void 0;var mm=(v(),g(A)),zs=S(),Va=class{attrId="";attrValues=[];constructor(e={}){Object.assign(e)}};Ys.PKCS12Attribute=Va;mm.__decorate([(0,zs.AsnProp)({type:zs.AsnPropTypes.ObjectIdentifier})],Va.prototype,"attrId",void 0);mm.__decorate([(0,zs.AsnProp)({type:zs.AsnPropTypes.Any,repeated:"set"})],Va.prototype,"attrValues",void 0);var vm=Am=class extends zs.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Am.prototype)}};Ys.PKCS12AttrSet=vm;Ys.PKCS12AttrSet=vm=Am=mm.__decorate([(0,zs.AsnType)({type:zs.AsnTypeTypes.Sequence,itemType:Va})],vm)});var uE=l(xl=>{"use strict";var Sm;Object.defineProperty(xl,"__esModule",{value:!0});xl.AuthenticatedSafe=void 0;var qN=(v(),g(A)),wm=S(),RN=_l(),Cm=Sm=class extends wm.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Sm.prototype)}};xl.AuthenticatedSafe=Cm;xl.AuthenticatedSafe=Cm=Sm=qN.__decorate([(0,wm.AsnType)({type:wm.AsnTypeTypes.Sequence,itemType:RN.ContentInfo})],Cm)});var Pm=l(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.id_bagtypes=ue.id_pbewithSHAAnd40BitRC2_CBC=ue.id_pbeWithSHAAnd128BitRC2_CBC=ue.id_pbeWithSHAAnd2_KeyTripleDES_CBC=ue.id_pbeWithSHAAnd3_KeyTripleDES_CBC=ue.id_pbeWithSHAAnd40BitRC4=ue.id_pbeWithSHAAnd128BitRC4=ue.id_pkcs_12PbeIds=ue.id_pkcs_12=ue.id_pkcs=ue.id_rsadsi=void 0;ue.id_rsadsi="1.2.840.113549";ue.id_pkcs=`${ue.id_rsadsi}.1`;ue.id_pkcs_12=`${ue.id_pkcs}.12`;ue.id_pkcs_12PbeIds=`${ue.id_pkcs_12}.1`;ue.id_pbeWithSHAAnd128BitRC4=`${ue.id_pkcs_12PbeIds}.1`;ue.id_pbeWithSHAAnd40BitRC4=`${ue.id_pkcs_12PbeIds}.2`;ue.id_pbeWithSHAAnd3_KeyTripleDES_CBC=`${ue.id_pkcs_12PbeIds}.3`;ue.id_pbeWithSHAAnd2_KeyTripleDES_CBC=`${ue.id_pkcs_12PbeIds}.4`;ue.id_pbeWithSHAAnd128BitRC2_CBC=`${ue.id_pkcs_12PbeIds}.5`;ue.id_pbewithSHAAnd40BitRC2_CBC=`${ue.id_pkcs_12PbeIds}.6`;ue.id_bagtypes=`${ue.id_pkcs_12}.10.1`});var Ky=l(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.id_pkcs_9=vt.id_SafeContents=vt.id_SecretBag=vt.id_CRLBag=vt.id_certBag=vt.id_pkcs8ShroudedKeyBag=vt.id_keyBag=void 0;var Ga=Pm();vt.id_keyBag=`${Ga.id_bagtypes}.1`;vt.id_pkcs8ShroudedKeyBag=`${Ga.id_bagtypes}.2`;vt.id_certBag=`${Ga.id_bagtypes}.3`;vt.id_CRLBag=`${Ga.id_bagtypes}.4`;vt.id_SecretBag=`${Ga.id_bagtypes}.5`;vt.id_SafeContents=`${Ga.id_bagtypes}.6`;vt.id_pkcs_9="1.2.840.113549.1.9"});var fE=l(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.id_sdsiCertificate=hr.id_x509Certificate=hr.id_certTypes=hr.CertBag=void 0;var lE=(v(),g(A)),Vy=S(),DN=Ky(),Ol=class{certId="";certValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};hr.CertBag=Ol;lE.__decorate([(0,Vy.AsnProp)({type:Vy.AsnPropTypes.ObjectIdentifier})],Ol.prototype,"certId",void 0);lE.__decorate([(0,Vy.AsnProp)({type:Vy.AsnPropTypes.Any,context:0})],Ol.prototype,"certValue",void 0);hr.id_certTypes=`${DN.id_pkcs_9}.22`;hr.id_x509Certificate=`${hr.id_certTypes}.1`;hr.id_sdsiCertificate=`${hr.id_certTypes}.2`});var pE=l(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.id_x509CRL=Gi.id_crlTypes=Gi.CRLBag=void 0;var dE=(v(),g(A)),Gy=S(),UN=Ky(),Il=class{crlId="";crltValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};Gi.CRLBag=Il;dE.__decorate([(0,Gy.AsnProp)({type:Gy.AsnPropTypes.ObjectIdentifier})],Il.prototype,"crlId",void 0);dE.__decorate([(0,Gy.AsnProp)({type:Gy.AsnPropTypes.Any,context:0})],Il.prototype,"crltValue",void 0);Gi.id_crlTypes=`${UN.id_pkcs_9}.23`;Gi.id_x509CRL=`${Gi.id_crlTypes}.1`});var hE=l(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.EncryptedPrivateKeyInfo=Fa.EncryptedData=void 0;var yE=(v(),g(A)),Em=S(),_E=X(),Bl=class extends Em.OctetString{};Fa.EncryptedData=Bl;var kl=class{encryptionAlgorithm=new _E.AlgorithmIdentifier;encryptedData=new Bl;constructor(e={}){Object.assign(this,e)}};Fa.EncryptedPrivateKeyInfo=kl;yE.__decorate([(0,Em.AsnProp)({type:_E.AlgorithmIdentifier})],kl.prototype,"encryptionAlgorithm",void 0);yE.__decorate([(0,Em.AsnProp)({type:Bl})],kl.prototype,"encryptedData",void 0)});var gE=l(Ur=>{"use strict";var Tm;Object.defineProperty(Ur,"__esModule",{value:!0});Ur.PrivateKeyInfo=Ur.Attributes=Ur.PrivateKey=Ur.Version=void 0;var Ml=(v(),g(A)),Fi=S(),Om=X(),xm;(function(t){t[t.v1=0]="v1"})(xm||(Ur.Version=xm={}));var jl=class extends Fi.OctetString{};Ur.PrivateKey=jl;var Fy=Tm=class extends Fi.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Tm.prototype)}};Ur.Attributes=Fy;Ur.Attributes=Fy=Tm=Ml.__decorate([(0,Fi.AsnType)({type:Fi.AsnTypeTypes.Sequence,itemType:Om.Attribute})],Fy);var Js=class{version=xm.v1;privateKeyAlgorithm=new Om.AlgorithmIdentifier;privateKey=new jl;attributes;constructor(e={}){Object.assign(this,e)}};Ur.PrivateKeyInfo=Js;Ml.__decorate([(0,Fi.AsnProp)({type:Fi.AsnPropTypes.Integer})],Js.prototype,"version",void 0);Ml.__decorate([(0,Fi.AsnProp)({type:Om.AlgorithmIdentifier})],Js.prototype,"privateKeyAlgorithm",void 0);Ml.__decorate([(0,Fi.AsnProp)({type:jl})],Js.prototype,"privateKey",void 0);Ml.__decorate([(0,Fi.AsnProp)({type:Fy,implicit:!0,context:0,optional:!0})],Js.prototype,"attributes",void 0)});var Wy=l(Hy=>{"use strict";Object.defineProperty(Hy,"__esModule",{value:!0});var AE=(v(),g(A));AE.__exportStar(hE(),Hy);AE.__exportStar(gE(),Hy)});var mE=l(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.KeyBag=void 0;var LN=(v(),g(A)),KN=Wy(),vE=S(),Im=class extends KN.PrivateKeyInfo{};Nl.KeyBag=Im;Nl.KeyBag=Im=LN.__decorate([(0,vE.AsnType)({type:vE.AsnTypeTypes.Sequence})],Im)});var SE=l(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});ql.PKCS8ShroudedKeyBag=void 0;var VN=(v(),g(A)),GN=Wy(),bE=S(),Bm=class extends GN.EncryptedPrivateKeyInfo{};ql.PKCS8ShroudedKeyBag=Bm;ql.PKCS8ShroudedKeyBag=Bm=VN.__decorate([(0,bE.AsnType)({type:bE.AsnTypeTypes.Sequence})],Bm)});var CE=l(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});zy.SecretBag=void 0;var wE=(v(),g(A)),$y=S(),Rl=class{secretTypeId="";secretValue=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};zy.SecretBag=Rl;wE.__decorate([(0,$y.AsnProp)({type:$y.AsnPropTypes.ObjectIdentifier})],Rl.prototype,"secretTypeId",void 0);wE.__decorate([(0,$y.AsnProp)({type:$y.AsnPropTypes.Any,context:0})],Rl.prototype,"secretValue",void 0)});var PE=l(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});var Ha=(v(),g(A));Ha.__exportStar(fE(),wn);Ha.__exportStar(pE(),wn);Ha.__exportStar(mE(),wn);Ha.__exportStar(SE(),wn);Ha.__exportStar(CE(),wn);Ha.__exportStar(Ky(),wn)});var jm=l(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});Yy.MacData=void 0;var km=(v(),g(A)),EE=wy(),Wa=S(),$a=class{mac=new EE.DigestInfo;macSalt=new Wa.OctetString;iterations=1;constructor(e={}){Object.assign(this,e)}};Yy.MacData=$a;km.__decorate([(0,Wa.AsnProp)({type:EE.DigestInfo})],$a.prototype,"mac",void 0);km.__decorate([(0,Wa.AsnProp)({type:Wa.OctetString})],$a.prototype,"macSalt",void 0);km.__decorate([(0,Wa.AsnProp)({type:Wa.AsnPropTypes.Integer,defaultValue:1})],$a.prototype,"iterations",void 0)});var OE=l(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.PFX=void 0;var Mm=(v(),g(A)),Jy=S(),TE=_l(),xE=jm(),za=class{version=3;authSafe=new TE.ContentInfo;macData=new xE.MacData;constructor(e={}){Object.assign(this,e)}};Qy.PFX=za;Mm.__decorate([(0,Jy.AsnProp)({type:Jy.AsnPropTypes.Integer})],za.prototype,"version",void 0);Mm.__decorate([(0,Jy.AsnProp)({type:TE.ContentInfo})],za.prototype,"authSafe",void 0);Mm.__decorate([(0,Jy.AsnProp)({type:xE.MacData,optional:!0})],za.prototype,"macData",void 0)});var IE=l(Xs=>{"use strict";var Nm;Object.defineProperty(Xs,"__esModule",{value:!0});Xs.SafeContents=Xs.SafeBag=void 0;var Xy=(v(),g(A)),Cn=S(),FN=bm(),Qs=class{bagId="";bagValue=new ArrayBuffer(0);bagAttributes;constructor(e={}){Object.assign(this,e)}};Xs.SafeBag=Qs;Xy.__decorate([(0,Cn.AsnProp)({type:Cn.AsnPropTypes.ObjectIdentifier})],Qs.prototype,"bagId",void 0);Xy.__decorate([(0,Cn.AsnProp)({type:Cn.AsnPropTypes.Any,context:0})],Qs.prototype,"bagValue",void 0);Xy.__decorate([(0,Cn.AsnProp)({type:FN.PKCS12Attribute,repeated:"set",optional:!0})],Qs.prototype,"bagAttributes",void 0);var qm=Nm=class extends Cn.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Nm.prototype)}};Xs.SafeContents=qm;Xs.SafeContents=qm=Nm=Xy.__decorate([(0,Cn.AsnType)({type:Cn.AsnTypeTypes.Sequence,itemType:Qs})],qm)});var BE=l(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});var Zs=(v(),g(A));Zs.__exportStar(bm(),Hi);Zs.__exportStar(uE(),Hi);Zs.__exportStar(PE(),Hi);Zs.__exportStar(jm(),Hi);Zs.__exportStar(Pm(),Hi);Zs.__exportStar(OE(),Hi);Zs.__exportStar(IE(),Hi)});var kE=l(p=>{"use strict";var Rm,Dm,Um;Object.defineProperty(p,"__esModule",{value:!0});p.DateOfBirth=p.UnstructuredAddress=p.UnstructuredName=p.EmailAddress=p.EncryptedPrivateKeyInfo=p.UserPKCS12=p.Pkcs7PDU=p.PKCS9String=p.id_at_pseudonym=p.crlTypes=p.id_certTypes=p.id_smime=p.id_pkcs9_mr_signingTimeMatch=p.id_pkcs9_mr_caseIgnoreMatch=p.id_pkcs9_sx_signingTime=p.id_pkcs9_sx_pkcs9String=p.id_pkcs9_at_countryOfResidence=p.id_pkcs9_at_countryOfCitizenship=p.id_pkcs9_at_gender=p.id_pkcs9_at_placeOfBirth=p.id_pkcs9_at_dateOfBirth=p.id_ietf_at=p.id_pkcs9_at_pkcs7PDU=p.id_pkcs9_at_sequenceNumber=p.id_pkcs9_at_randomNonce=p.id_pkcs9_at_encryptedPrivateKeyInfo=p.id_pkcs9_at_pkcs15Token=p.id_pkcs9_at_userPKCS12=p.id_pkcs9_at_localKeyId=p.id_pkcs9_at_friendlyName=p.id_pkcs9_at_smimeCapabilities=p.id_pkcs9_at_extensionRequest=p.id_pkcs9_at_signingDescription=p.id_pkcs9_at_extendedCertificateAttributes=p.id_pkcs9_at_unstructuredAddress=p.id_pkcs9_at_challengePassword=p.id_pkcs9_at_counterSignature=p.id_pkcs9_at_signingTime=p.id_pkcs9_at_messageDigest=p.id_pkcs9_at_contentType=p.id_pkcs9_at_unstructuredName=p.id_pkcs9_at_emailAddress=p.id_pkcs9_oc_naturalPerson=p.id_pkcs9_oc_pkcsEntity=p.id_pkcs9_mr=p.id_pkcs9_sx=p.id_pkcs9_at=p.id_pkcs9_oc=p.id_pkcs9_mo=p.id_pkcs9=void 0;p.SMIMECapabilities=p.SMIMECapability=p.SigningDescription=p.LocalKeyId=p.FriendlyName=p.ExtendedCertificateAttributes=p.ExtensionRequest=p.ChallengePassword=p.CounterSignature=p.SequenceNumber=p.RandomNonce=p.SigningTime=p.MessageDigest=p.ContentType=p.Pseudonym=p.CountryOfResidence=p.CountryOfCitizenship=p.Gender=p.PlaceOfBirth=void 0;var se=(v(),g(A)),R=S(),n0=se.__importStar(_l()),HN=se.__importStar(BE()),WN=se.__importStar(Wy()),Wi=se.__importStar(X()),$N=se.__importStar(ev());p.id_pkcs9="1.2.840.113549.1.9";p.id_pkcs9_mo=`${p.id_pkcs9}.0`;p.id_pkcs9_oc=`${p.id_pkcs9}.24`;p.id_pkcs9_at=`${p.id_pkcs9}.25`;p.id_pkcs9_sx=`${p.id_pkcs9}.26`;p.id_pkcs9_mr=`${p.id_pkcs9}.27`;p.id_pkcs9_oc_pkcsEntity=`${p.id_pkcs9_oc}.1`;p.id_pkcs9_oc_naturalPerson=`${p.id_pkcs9_oc}.2`;p.id_pkcs9_at_emailAddress=`${p.id_pkcs9}.1`;p.id_pkcs9_at_unstructuredName=`${p.id_pkcs9}.2`;p.id_pkcs9_at_contentType=`${p.id_pkcs9}.3`;p.id_pkcs9_at_messageDigest=`${p.id_pkcs9}.4`;p.id_pkcs9_at_signingTime=`${p.id_pkcs9}.5`;p.id_pkcs9_at_counterSignature=`${p.id_pkcs9}.6`;p.id_pkcs9_at_challengePassword=`${p.id_pkcs9}.7`;p.id_pkcs9_at_unstructuredAddress=`${p.id_pkcs9}.8`;p.id_pkcs9_at_extendedCertificateAttributes=`${p.id_pkcs9}.9`;p.id_pkcs9_at_signingDescription=`${p.id_pkcs9}.13`;p.id_pkcs9_at_extensionRequest=`${p.id_pkcs9}.14`;p.id_pkcs9_at_smimeCapabilities=`${p.id_pkcs9}.15`;p.id_pkcs9_at_friendlyName=`${p.id_pkcs9}.20`;p.id_pkcs9_at_localKeyId=`${p.id_pkcs9}.21`;p.id_pkcs9_at_userPKCS12="2.16.840.1.113730.3.1.216";p.id_pkcs9_at_pkcs15Token=`${p.id_pkcs9_at}.1`;p.id_pkcs9_at_encryptedPrivateKeyInfo=`${p.id_pkcs9_at}.2`;p.id_pkcs9_at_randomNonce=`${p.id_pkcs9_at}.3`;p.id_pkcs9_at_sequenceNumber=`${p.id_pkcs9_at}.4`;p.id_pkcs9_at_pkcs7PDU=`${p.id_pkcs9_at}.5`;p.id_ietf_at="1.3.6.1.5.5.7.9";p.id_pkcs9_at_dateOfBirth=`${p.id_ietf_at}.1`;p.id_pkcs9_at_placeOfBirth=`${p.id_ietf_at}.2`;p.id_pkcs9_at_gender=`${p.id_ietf_at}.3`;p.id_pkcs9_at_countryOfCitizenship=`${p.id_ietf_at}.4`;p.id_pkcs9_at_countryOfResidence=`${p.id_ietf_at}.5`;p.id_pkcs9_sx_pkcs9String=`${p.id_pkcs9_sx}.1`;p.id_pkcs9_sx_signingTime=`${p.id_pkcs9_sx}.2`;p.id_pkcs9_mr_caseIgnoreMatch=`${p.id_pkcs9_mr}.1`;p.id_pkcs9_mr_signingTimeMatch=`${p.id_pkcs9_mr}.2`;p.id_smime=`${p.id_pkcs9}.16`;p.id_certTypes=`${p.id_pkcs9}.22`;p.crlTypes=`${p.id_pkcs9}.23`;p.id_at_pseudonym=`${$N.id_at}.65`;var Dl=class extends Wi.DirectoryString{ia5String;constructor(e={}){super(e)}toString(){return{}.toString(),this.ia5String||super.toString()}};p.PKCS9String=Dl;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.IA5String})],Dl.prototype,"ia5String",void 0);p.PKCS9String=Dl=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Dl);var Lm=class extends n0.ContentInfo{};p.Pkcs7PDU=Lm;p.Pkcs7PDU=Lm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Lm);var Km=class extends HN.PFX{};p.UserPKCS12=Km;p.UserPKCS12=Km=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Km);var Vm=class extends WN.EncryptedPrivateKeyInfo{};p.EncryptedPrivateKeyInfo=Vm;p.EncryptedPrivateKeyInfo=Vm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Vm);var Zy=class{value;constructor(e=""){this.value=e}toString(){return this.value}};p.EmailAddress=Zy;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.IA5String})],Zy.prototype,"value",void 0);p.EmailAddress=Zy=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Zy);var Gm=class extends Dl{};p.UnstructuredName=Gm;p.UnstructuredName=Gm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Gm);var Fm=class extends Wi.DirectoryString{};p.UnstructuredAddress=Fm;p.UnstructuredAddress=Fm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Fm);var e_=class{value;constructor(e=new Date){this.value=e}};p.DateOfBirth=e_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.GeneralizedTime})],e_.prototype,"value",void 0);p.DateOfBirth=e_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],e_);var Hm=class extends Wi.DirectoryString{};p.PlaceOfBirth=Hm;p.PlaceOfBirth=Hm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Hm);var t_=class{value;constructor(e="M"){this.value=e}toString(){return this.value}};p.Gender=t_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.PrintableString})],t_.prototype,"value",void 0);p.Gender=t_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],t_);var Ul=class{value;constructor(e=""){this.value=e}toString(){return this.value}};p.CountryOfCitizenship=Ul;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.PrintableString})],Ul.prototype,"value",void 0);p.CountryOfCitizenship=Ul=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Ul);var Wm=class extends Ul{};p.CountryOfResidence=Wm;p.CountryOfResidence=Wm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Wm);var $m=class extends Wi.DirectoryString{};p.Pseudonym=$m;p.Pseudonym=$m=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],$m);var r_=class{value;constructor(e=""){this.value=e}toString(){return this.value}};p.ContentType=r_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.ObjectIdentifier})],r_.prototype,"value",void 0);p.ContentType=r_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],r_);var zm=class extends R.OctetString{};p.MessageDigest=zm;var Ym=class extends Wi.Time{};p.SigningTime=Ym;p.SigningTime=Ym=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Ym);var Jm=class extends R.OctetString{};p.RandomNonce=Jm;var i_=class{value;constructor(e=0){this.value=e}toString(){return this.value.toString()}};p.SequenceNumber=i_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.Integer})],i_.prototype,"value",void 0);p.SequenceNumber=i_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],i_);var Qm=class extends n0.SignerInfo{};p.CounterSignature=Qm;p.CounterSignature=Qm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Qm);var Xm=class extends Wi.DirectoryString{};p.ChallengePassword=Xm;p.ChallengePassword=Xm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Xm);var Zm=Rm=class extends Wi.Extensions{constructor(e){super(e),Object.setPrototypeOf(this,Rm.prototype)}};p.ExtensionRequest=Zm;p.ExtensionRequest=Zm=Rm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Zm);var e0=Dm=class extends R.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Dm.prototype)}};p.ExtendedCertificateAttributes=e0;p.ExtendedCertificateAttributes=e0=Dm=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Set,itemType:n0.Attribute})],e0);var n_=class{value;constructor(e=""){this.value=e}toString(){return this.value}};p.FriendlyName=n_;se.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.BmpString})],n_.prototype,"value",void 0);p.FriendlyName=n_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],n_);var t0=class extends R.OctetString{};p.LocalKeyId=t0;var r0=class extends Wi.DirectoryString{};p.SigningDescription=r0;var s_=class extends Wi.AlgorithmIdentifier{};p.SMIMECapability=s_;p.SMIMECapability=s_=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],s_);var i0=Um=class extends R.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Um.prototype)}};p.SMIMECapabilities=i0;p.SMIMECapabilities=i0=Um=se.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence,itemType:s_})],i0)});var c0=l(Ll=>{"use strict";var s0;Object.defineProperty(Ll,"__esModule",{value:!0});Ll.Attributes=void 0;var zN=(v(),g(A)),o0=S(),YN=X(),a0=s0=class extends o0.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,s0.prototype)}};Ll.Attributes=a0;Ll.Attributes=a0=s0=zN.__decorate([(0,o0.AsnType)({type:o0.AsnTypeTypes.Sequence,itemType:YN.Attribute})],a0)});var u0=l(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.CertificationRequestInfo=void 0;var a_=(v(),g(A)),Kl=S(),o_=X(),jE=c0(),eo=class{version=0;subject=new o_.Name;subjectPKInfo=new o_.SubjectPublicKeyInfo;attributes=new jE.Attributes;constructor(e={}){Object.assign(this,e)}};c_.CertificationRequestInfo=eo;a_.__decorate([(0,Kl.AsnProp)({type:Kl.AsnPropTypes.Integer})],eo.prototype,"version",void 0);a_.__decorate([(0,Kl.AsnProp)({type:o_.Name})],eo.prototype,"subject",void 0);a_.__decorate([(0,Kl.AsnProp)({type:o_.SubjectPublicKeyInfo})],eo.prototype,"subjectPKInfo",void 0);a_.__decorate([(0,Kl.AsnProp)({type:jE.Attributes,implicit:!0,context:0,optional:!0})],eo.prototype,"attributes",void 0)});var qE=l(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});l_.CertificationRequest=void 0;var l0=(v(),g(A)),u_=S(),ME=X(),NE=u0(),Ya=class{certificationRequestInfo=new NE.CertificationRequestInfo;certificationRequestInfoRaw;signatureAlgorithm=new ME.AlgorithmIdentifier;signature=new ArrayBuffer(0);constructor(e={}){Object.assign(this,e)}};l_.CertificationRequest=Ya;l0.__decorate([(0,u_.AsnProp)({type:NE.CertificationRequestInfo,raw:!0})],Ya.prototype,"certificationRequestInfo",void 0);l0.__decorate([(0,u_.AsnProp)({type:ME.AlgorithmIdentifier})],Ya.prototype,"signatureAlgorithm",void 0);l0.__decorate([(0,u_.AsnProp)({type:u_.AsnPropTypes.BitString})],Ya.prototype,"signature",void 0)});var RE=l(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var f0=(v(),g(A));f0.__exportStar(c0(),Vl);f0.__exportStar(qE(),Vl);f0.__exportStar(u0(),Vl)});var m0=l(B=>{"use strict";TC();var P=S(),L=X(),O=wh(),E=(v(),g(A)),JN=_l(),C_=yy(),Nt=wy(),Se=cE(),A0=kE(),P_=RE();function kf(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(r){if(r!=="default"){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}}),e.default=t,Object.freeze(e)}var C=kf(L),Mt=kf(JN),Oe=kf(C_),be=kf(Nt),ic=kf(A0),cc="crypto.algorithm",E_=class{getAlgorithms(){return Se.container.resolveAll(cc)}toAsnAlgorithm(e){({...e});for(let r of this.getAlgorithms()){let i=r.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){let r=new L.AlgorithmIdentifier({algorithm:e.name});if("parameters"in e){let i=e;r.parameters=i.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(let i of this.getAlgorithms()){let n=i.toWebAlgorithm(e);if(n)return n}return{name:e.algorithm,parameters:e.parameters}}},Vr="crypto.algorithmProvider";Se.container.registerSingleton(Vr,E_);var p_,Ut="1.3.36.3.3.2.8.1.1",DE=`${Ut}.1`,UE=`${Ut}.2`,LE=`${Ut}.3`,KE=`${Ut}.4`,VE=`${Ut}.5`,GE=`${Ut}.6`,FE=`${Ut}.7`,HE=`${Ut}.8`,WE=`${Ut}.9`,$E=`${Ut}.10`,zE=`${Ut}.11`,YE=`${Ut}.12`,JE=`${Ut}.13`,QE=`${Ut}.14`,XE="brainpoolP160r1",ZE="brainpoolP160t1",eT="brainpoolP192r1",tT="brainpoolP192t1",rT="brainpoolP224r1",iT="brainpoolP224t1",nT="brainpoolP256r1",sT="brainpoolP256t1",oT="brainpoolP320r1",aT="brainpoolP320t1",cT="brainpoolP384r1",uT="brainpoolP384t1",lT="brainpoolP512r1",fT="brainpoolP512t1",Me="ECDSA";B.EcAlgorithm=p_=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case Me.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Oe.ecdsaWithSHA1;case"sha-256":return Oe.ecdsaWithSHA256;case"sha-384":return Oe.ecdsaWithSHA384;case"sha-512":return Oe.ecdsaWithSHA512}else if("namedCurve"in e){let r="";switch(e.namedCurve){case"P-256":r=Oe.id_secp256r1;break;case"K-256":r=p_.SECP256K1;break;case"P-384":r=Oe.id_secp384r1;break;case"P-521":r=Oe.id_secp521r1;break;case XE:r=DE;break;case ZE:r=UE;break;case eT:r=LE;break;case tT:r=KE;break;case rT:r=VE;break;case iT:r=GE;break;case nT:r=FE;break;case sT:r=HE;break;case oT:r=WE;break;case aT:r=$E;break;case cT:r=zE;break;case uT:r=YE;break;case lT:r=JE;break;case fT:r=QE;break}if(r)return new L.AlgorithmIdentifier({algorithm:Oe.id_ecPublicKey,parameters:P.AsnConvert.serialize(new Oe.ECParameters({namedCurve:r}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case Oe.id_ecdsaWithSHA1:return{name:Me,hash:{name:"SHA-1"}};case Oe.id_ecdsaWithSHA256:return{name:Me,hash:{name:"SHA-256"}};case Oe.id_ecdsaWithSHA384:return{name:Me,hash:{name:"SHA-384"}};case Oe.id_ecdsaWithSHA512:return{name:Me,hash:{name:"SHA-512"}};case Oe.id_ecPublicKey:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(P.AsnConvert.parse(e.parameters,Oe.ECParameters).namedCurve){case Oe.id_secp256r1:return{name:Me,namedCurve:"P-256"};case p_.SECP256K1:return{name:Me,namedCurve:"K-256"};case Oe.id_secp384r1:return{name:Me,namedCurve:"P-384"};case Oe.id_secp521r1:return{name:Me,namedCurve:"P-521"};case DE:return{name:Me,namedCurve:XE};case UE:return{name:Me,namedCurve:ZE};case LE:return{name:Me,namedCurve:eT};case KE:return{name:Me,namedCurve:tT};case VE:return{name:Me,namedCurve:rT};case GE:return{name:Me,namedCurve:iT};case FE:return{name:Me,namedCurve:nT};case HE:return{name:Me,namedCurve:sT};case WE:return{name:Me,namedCurve:oT};case $E:return{name:Me,namedCurve:aT};case zE:return{name:Me,namedCurve:cT};case YE:return{name:Me,namedCurve:uT};case JE:return{name:Me,namedCurve:lT};case QE:return{name:Me,namedCurve:fT}}}}return null}};B.EcAlgorithm.SECP256K1="1.3.132.0.10";B.EcAlgorithm=p_=E.__decorate([Se.injectable()],B.EcAlgorithm);Se.container.registerSingleton(cc,B.EcAlgorithm);var gT=Symbol("name"),AT=Symbol("value"),Z=class{constructor(e,r={},i=""){this[gT]=e,this[AT]=i;for(let n in r)this[n]=r[n]}};Z.NAME=gT;Z.VALUE=AT;var T_=class{static toTextObject(e){let r=new Z("Algorithm Identifier",{},gr.toString(e.algorithm));if(e.parameters)if(e.algorithm===Oe.id_ecPublicKey){let i=new B.EcAlgorithm().toWebAlgorithm(e);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=e.parameters}else r.Parameters=e.parameters;return r}},gr=class{static toString(e){let r=this.items[e];return r||e}};gr.items={[be.id_sha1]:"sha1",[be.id_sha224]:"sha224",[be.id_sha256]:"sha256",[be.id_sha384]:"sha384",[be.id_sha512]:"sha512",[be.id_rsaEncryption]:"rsaEncryption",[be.id_sha1WithRSAEncryption]:"sha1WithRSAEncryption",[be.id_sha224WithRSAEncryption]:"sha224WithRSAEncryption",[be.id_sha256WithRSAEncryption]:"sha256WithRSAEncryption",[be.id_sha384WithRSAEncryption]:"sha384WithRSAEncryption",[be.id_sha512WithRSAEncryption]:"sha512WithRSAEncryption",[Oe.id_ecPublicKey]:"ecPublicKey",[Oe.id_ecdsaWithSHA1]:"ecdsaWithSHA1",[Oe.id_ecdsaWithSHA224]:"ecdsaWithSHA224",[Oe.id_ecdsaWithSHA256]:"ecdsaWithSHA256",[Oe.id_ecdsaWithSHA384]:"ecdsaWithSHA384",[Oe.id_ecdsaWithSHA512]:"ecdsaWithSHA512",[C.id_kp_serverAuth]:"TLS WWW server authentication",[C.id_kp_clientAuth]:"TLS WWW client authentication",[C.id_kp_codeSigning]:"Code Signing",[C.id_kp_emailProtection]:"E-mail Protection",[C.id_kp_timeStamping]:"Time Stamping",[C.id_kp_OCSPSigning]:"OCSP Signing",[Mt.id_signedData]:"Signed Data"};var Gr=class{static serialize(e){return this.serializeObj(e).join(`
18
+ `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,r=0){let i=[],n=this.pad(r++),s="",o=e[Z.VALUE];o&&(s=` ${o}`),i.push(`${n}${e[Z.NAME]}:${s}`),n=this.pad(r);for(let a in e){if(typeof a=="symbol")continue;let c=e[a],u=a?`${a}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")i.push(`${n}${u}${c}`);else if(c instanceof Date)i.push(`${n}${u}${c.toUTCString()}`);else if(Array.isArray(c))for(let f of c)f[Z.NAME]=a,i.push(...this.serializeObj(f,r));else if(c instanceof Z)c[Z.NAME]=a,i.push(...this.serializeObj(c,r));else if(O.BufferSourceConverter.isBufferSource(c))a?(i.push(`${n}${u}`),i.push(...this.serializeBufferSource(c,r+1))):i.push(...this.serializeBufferSource(c,r));else if("toTextObject"in c){let f=c.toTextObject();f[Z.NAME]=a,i.push(...this.serializeObj(f,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(e,r=0){let i=this.pad(r),n=O.BufferSourceConverter.toUint8Array(e),s=[];for(let o=0;o<n.length;){let a=[];for(let c=0;c<16&&o<n.length;c++){c===8&&a.push("");let u=n[o++].toString(16).padStart(2,"0");a.push(u)}s.push(`${i}${a.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}};Gr.oidSerializer=gr;Gr.algorithmSerializer=T_;var Ja,Ai=class t{get rawData(){return E.__classPrivateFieldGet(this,Ja,"f")||E.__classPrivateFieldSet(this,Ja,P.AsnConvert.serialize(this.asn),"f"),E.__classPrivateFieldGet(this,Ja,"f")}constructor(...e){Ja.set(this,void 0),O.BufferSourceConverter.isBufferSource(e[0])?(this.asn=P.AsnConvert.parse(e[0],e[1]),E.__classPrivateFieldSet(this,Ja,O.BufferSourceConverter.toArrayBuffer(e[0]),"f"),this.onInit(this.asn)):(this.asn=e[0],this.onInit(this.asn))}equal(e){return e instanceof t?O.isEqual(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return P.AsnConvert.toString(this.rawData);case"text":return Gr.serialize(this.toTextObject());case"hex":return O.Convert.ToHex(this.rawData);case"base64":return O.Convert.ToBase64(this.rawData);case"base64url":return O.Convert.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){let e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new Z(this.getTextName(),{},e)}};Ja=new WeakMap;Ai.NAME="ASN";var qt=class t extends Ai{constructor(...e){let r;O.BufferSourceConverter.isBufferSource(e[0])?r=O.BufferSourceConverter.toArrayBuffer(e[0]):r=P.AsnConvert.serialize(new L.Extension({extnID:e[0],critical:e[1],extnValue:new P.OctetString(O.BufferSourceConverter.toArrayBuffer(e[2]))})),super(r,L.Extension)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[Z.NAME]===t.NAME&&(e[Z.NAME]=gr.toString(this.type)),e}},vT,nc=class t{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[vT]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(t.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(t.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,r){return this.items.forEach(e,r)}has(e){return this.items.has(e)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(e=t.DEFAULT){let r=this.items.get(e.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${e}'`);return r}set(e,r){if(typeof e=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),r)}else this.items.set(t.DEFAULT,e);return this}};vT=Symbol.toStringTag;nc.DEFAULT="default";var Ie=new nc,QN=/^[0-2](?:\.[1-9][0-9]*)+$/;function XN(t){return new RegExp(QN).test(t)}var Af=class{constructor(e={}){this.items={};for(let r in e)this.register(r,e[r])}get(e){return this.items[e]||null}findId(e){return XN(e)?e:this.get(e)}register(e,r){this.items[e]=r,this.items[r]=e}},Rt=new Af;Rt.register("CN","2.5.4.3");Rt.register("L","2.5.4.7");Rt.register("ST","2.5.4.8");Rt.register("O","2.5.4.10");Rt.register("OU","2.5.4.11");Rt.register("C","2.5.4.6");Rt.register("DC","0.9.2342.19200300.100.1.25");Rt.register("E","1.2.840.113549.1.9.1");Rt.register("G","2.5.4.42");Rt.register("I","2.5.4.43");Rt.register("SN","2.5.4.4");Rt.register("T","2.5.4.12");function ZN(t,e){return`\\${O.Convert.ToHex(O.Convert.FromUtf8String(e)).toUpperCase()}`}function eq(t){return t.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,ZN)}var rt=class t{static isASCII(e){for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,r={}){this.extraNames=new Af,this.asn=new L.Name;for(let i in r)if(Object.prototype.hasOwnProperty.call(r,i)){let n=r[i];this.extraNames.register(i,n)}typeof e=="string"?this.asn=this.fromString(e):e instanceof L.Name?this.asn=e:O.BufferSourceConverter.isBufferSource(e)?this.asn=P.AsnConvert.parse(e,L.Name):this.asn=this.fromJSON(e)}getField(e){let r=this.extraNames.findId(e)||Rt.findId(e),i=[];for(let n of this.asn)for(let s of n)s.type===r&&i.push(s.value.toString());return i}getName(e){return this.extraNames.get(e)||Rt.get(e)}toString(){return this.asn.map(e=>e.map(r=>{let i=this.getName(r.type)||r.type,n=r.value.anyValue?`#${O.Convert.ToHex(r.value.anyValue)}`:eq(r.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var e;let r=[];for(let i of this.asn){let n={};for(let s of i){let o=this.getName(s.type)||s.type;(e=n[o])!==null&&e!==void 0||(n[o]=[]),n[o].push(s.value.anyValue?`#${O.Convert.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(n)}return r}fromString(e){let r=new L.Name,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g,n=null,s=",";for(;n=i.exec(`${e},`);){let[,o,a]=n,c=a[a.length-1];(c===","||c==="+")&&(a=a.slice(0,a.length-1),n[3]=c);let u=n[3];o=this.getTypeOid(o);let f=this.createAttribute(o,a);s==="+"?r[r.length-1].push(f):r.push(new L.RelativeDistinguishedName([f])),s=u}return r}fromJSON(e){let r=new L.Name;for(let i of e){let n=new L.RelativeDistinguishedName;for(let s in i){let o=this.getTypeOid(s),a=i[s];for(let c of a){let u=this.createAttribute(o,c);n.push(u)}}r.push(n)}return r}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw new Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,r){let i=new L.AttributeTypeAndValue({type:e});if(typeof r=="object")for(let n in r)switch(n){case"ia5String":i.value.ia5String=r[n];break;case"utf8String":i.value.utf8String=r[n];break;case"universalString":i.value.universalString=r[n];break;case"bmpString":i.value.bmpString=r[n];break;case"printableString":i.value.printableString=r[n];break}else if(r[0]==="#")i.value.anyValue=O.Convert.FromHex(r.slice(1));else{let n=this.processStringValue(r);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:t.isPrintableString(n)?i.value.printableString=n:i.value.utf8String=n}return i}processStringValue(e){let r=/"(.*?[^\\])?"/.exec(e);return r&&(e=r[1]),e.replace(/\\0a/ig,`
19
+ `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return P.AsnConvert.serialize(this.asn)}async getThumbprint(...e){var r;let i,n="SHA-1";return e.length>=1&&!(!((r=e[0])===null||r===void 0)&&r.subtle)?(n=e[0]||n,i=e[1]||Ie.get()):i=e[0]||Ie.get(),await i.subtle.digest(n,this.toArrayBuffer())}},mT="Cannot initialize GeneralName from ASN.1 data.",dT=`${mT} Unsupported string format in use.`,tq=`${mT} Value doesn't match to GUID regular expression.`,pT=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,yT="1.3.6.1.4.1.311.25.1",_T="1.3.6.1.4.1.311.20.2.3",y_="dns",__="dn",h_="email",g_="ip",A_="url",v_="guid",m_="upn",Gl="id",Lr=class extends Ai{constructor(...e){let r;if(e.length===2)switch(e[0]){case __:{let i=new rt(e[1]).toArrayBuffer(),n=P.AsnConvert.parse(i,C.Name);r=new C.GeneralName({directoryName:n});break}case y_:r=new C.GeneralName({dNSName:e[1]});break;case h_:r=new C.GeneralName({rfc822Name:e[1]});break;case v_:{let i=new RegExp(pT,"i").exec(e[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");let n=i.slice(1).map((s,o)=>o<3?O.Convert.ToHex(new Uint8Array(O.Convert.FromHex(s)).reverse()):s).join("");r=new C.GeneralName({otherName:new C.OtherName({typeId:yT,value:P.AsnConvert.serialize(new P.OctetString(O.Convert.FromHex(n)))})});break}case g_:r=new C.GeneralName({iPAddress:e[1]});break;case Gl:r=new C.GeneralName({registeredID:e[1]});break;case m_:{r=new C.GeneralName({otherName:new C.OtherName({typeId:_T,value:P.AsnConvert.serialize(P.AsnUtf8StringConverter.toASN(e[1]))})});break}case A_:r=new C.GeneralName({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else O.BufferSourceConverter.isBufferSource(e[0])?r=P.AsnConvert.parse(e[0],C.GeneralName):r=e[0];super(r)}onInit(e){if(e.dNSName!=null)this.type=y_,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=h_,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=g_,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=A_,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Gl,this.value=e.registeredID;else if(e.directoryName!=null)this.type=__,this.value=new rt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===yT){this.type=v_;let r=P.AsnConvert.parse(e.otherName.value,P.OctetString),i=new RegExp(pT,"i").exec(O.Convert.ToHex(r));if(!i)throw new Error(tq);this.value=i.slice(1).map((n,s)=>s<3?O.Convert.ToHex(new Uint8Array(O.Convert.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===_T)this.type=m_,this.value=P.AsnConvert.parse(e.otherName.value,C.DirectoryString).toString();else throw new Error(dT);else throw new Error(dT)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case __:case y_:case v_:case g_:case Gl:case m_:case A_:e=this.type.toUpperCase();break;case h_:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===Gl&&(r=gr.toString(r)),new Z(e,void 0,r)}},vi=class extends Ai{constructor(e){let r;if(e instanceof C.GeneralNames)r=e;else if(Array.isArray(e)){let i=[];for(let n of e)if(n instanceof C.GeneralName)i.push(n);else{let s=P.AsnConvert.parse(new Lr(n.type,n.value).rawData,C.GeneralName);i.push(s)}r=new C.GeneralNames(i)}else if(O.BufferSourceConverter.isBufferSource(e))r=P.AsnConvert.parse(e,C.GeneralNames);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(e){let r=[];for(let i of e){let n=null;try{n=new Lr(i)}catch{continue}r.push(n)}this.items=r}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){let e=super.toTextObjectEmpty();for(let r of this.items){let i=r.toTextObject(),n=e[i[Z.NAME]];Array.isArray(n)||(n=[],e[i[Z.NAME]]=n),n.push(i)}return e}};vi.NAME="GeneralNames";var gf="-{5}",vf="\\n",rq=`[^${vf}]+`,iq=`${gf}BEGIN (${rq}(?=${gf}))${gf}`,nq=`${gf}END \\1${gf}`,sc="\\n",sq=`[^:${vf}]+`,oq=`(?:[^${vf}]+${sc}(?: +[^${vf}]+${sc})*)`,aq="[a-zA-Z0-9=+/]+",cq=`(?:${aq}${sc})+`,hT=`${iq}${sc}(?:((?:${sq}: ${oq})+))?${sc}?(${cq})${nq}`,at=class{static isPem(e){return typeof e=="string"&&new RegExp(hT,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");let r=new RegExp(hT,"g"),i=[],n=null;for(;n=r.exec(e);){let s=n[3].replace(new RegExp(`[${vf}]+`,"g"),""),o={type:n[1],headers:[],rawData:O.Convert.FromBase64(s)},a=n[2];if(a){let c=a.split(new RegExp(sc,"g")),u=null;for(let f of c){let[d,y]=f.split(/:(.*)/);if(y===void 0){if(!u)throw new Error("Cannot parse PEM string. Incorrect header value");u.value+=d.trim()}else u&&o.headers.push(u),u={key:d,value:y.trim()}}u&&o.headers.push(u)}i.push(o)}return i}static decode(e){return this.decodeWithHeaders(e).map(i=>i.rawData)}static decodeFirst(e){let r=this.decode(e);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(e,r){if(Array.isArray(e)){let i=new Array;return r?e.forEach(n=>{if(!O.BufferSourceConverter.isBufferSource(n))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:O.BufferSourceConverter.toArrayBuffer(n)}))}):e.forEach(n=>{if(!("type"in n))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(n))}),i.join(`
20
20
  `)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:O.BufferSourceConverter.toArrayBuffer(e)})}}static encodeStruct(e){var r;let i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((r=e.headers)===null||r===void 0)&&r.length){for(let u of e.headers)n.push(`${u.key}: ${u.value}`);n.push("")}let s=O.Convert.ToBase64(e.rawData),o,a=0,c=Array();for(;a<s.length&&(s.length-a<64?o=s.substring(a):(o=s.substring(a,a+64),a+=64),o.length!==0);)if(c.push(o),o.length<64)break;return n.push(...c),n.push(`-----END ${i}-----`),n.join(`
21
- `)}};at.CertificateTag="CERTIFICATE";at.CrlTag="CRL";at.CertificateRequestTag="CERTIFICATE REQUEST";at.PublicKeyTag="PUBLIC KEY";at.PrivateKeyTag="PRIVATE KEY";var Dt=class t extends Ai{static isAsnEncoded(e){return O.BufferSourceConverter.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(at.isPem(e))return at.decode(e)[0];if(O.Convert.isHex(e))return O.Convert.FromHex(e);if(O.Convert.isBase64(e))return O.Convert.FromBase64(e);if(O.Convert.isBase64Url(e))return O.Convert.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{let r=O.BufferSourceConverter.toUint8Array(e);if(r.length>0&&r[0]===48)return O.BufferSourceConverter.toArrayBuffer(e);let i=O.Convert.ToBinary(e);if(at.isPem(i))return at.decode(i)[0];if(O.Convert.isHex(i))return O.Convert.FromHex(i);if(O.Convert.isBase64(i))return O.Convert.FromBase64(i);if(O.Convert.isBase64Url(i))return O.Convert.FromBase64Url(i);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){t.isAsnEncoded(e[0])?super(t.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){return e==="pem"?at.encode(this.rawData,this.tag):super.toString(e)}},Kr=class t extends Dt{static async create(e,r=Ie.get()){if(e instanceof t)return e;if(nc.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");let i=await r.subtle.exportKey("spki",e);return new t(i)}else{if(e.publicKey)return e.publicKey;if(O.BufferSourceConverter.isBufferSource(e))return new t(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){Dt.isAsnEncoded(e)?super(e,L.SubjectPublicKeyInfo):super(e),this.tag=at.PublicKeyTag}async export(...e){let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};e.length>1?(n=e[0]||n,i=e[1]||i,r=e[2]||Ie.get()):r=e[0]||Ie.get();let s=this.rawData,o=P.AsnConvert.parse(this.rawData,L.SubjectPublicKeyInfo);return o.algorithm.algorithm===Nt.id_RSASSA_PSS&&(s=uq(o,s)),r.subtle.importKey("spki",s,n,!0,i)}onInit(e){let r=Se.container.resolve(Vr),i=this.algorithm=r.toWebAlgorithm(e.algorithm);if(e.algorithm.algorithm===Nt.id_rsaEncryption){let n=P.AsnConvert.parse(e.subjectPublicKey,Nt.RSAPublicKey),s=O.BufferSourceConverter.toUint8Array(n.modulus);i.publicExponent=O.BufferSourceConverter.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3}}async getThumbprint(...e){var r;let i,n="SHA-1";return e.length>=1&&!(!((r=e[0])===null||r===void 0)&&r.subtle)?(n=e[0]||n,i=e[1]||Ie.get()):i=e[0]||Ie.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(...e){let r,i="SHA-1";e.length===1?typeof e[0]=="string"?(i=e[0],r=Ie.get()):r=e[0]:e.length===2?(i=e[0],r=e[1]):r=Ie.get();let n=P.AsnConvert.parse(this.rawData,L.SubjectPublicKeyInfo);return await r.subtle.digest(i,n.subjectPublicKey)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.AsnConvert.parse(this.rawData,L.SubjectPublicKeyInfo);switch(e.Algorithm=Gr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case P_.id_ecPublicKey:e["EC Point"]=r.subjectPublicKey;break;case Nt.id_rsaEncryption:default:e["Raw Data"]=r.subjectPublicKey}return e}};function uq(t,e){return t.algorithm=new L.AlgorithmIdentifier({algorithm:Nt.id_rsaEncryption,parameters:null}),e=P.AsnConvert.serialize(t),e}var bf=class t extends qt{static async create(e,r=!1,i=Ie.get()){if("name"in e&&"serialNumber"in e)return new t(e,r);let s=await(await Kr.create(e,i)).getKeyIdentifier(i);return new t(O.Convert.ToHex(s),r)}constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){let r=new C.AuthorityKeyIdentifier({keyIdentifier:new C.KeyIdentifier(O.Convert.FromHex(e[0]))});super(C.id_ce_authorityKeyIdentifier,e[1],P.AsnConvert.serialize(r))}else{let r=e[0],i=r.name instanceof vi?P.AsnConvert.parse(r.name.rawData,C.GeneralNames):r.name,n=new C.AuthorityKeyIdentifier({authorityCertIssuer:i,authorityCertSerialNumber:O.Convert.FromHex(r.serialNumber)});super(C.id_ce_authorityKeyIdentifier,e[1],P.AsnConvert.serialize(n))}}onInit(e){super.onInit(e);let r=P.AsnConvert.parse(e.extnValue,C.AuthorityKeyIdentifier);r.keyIdentifier&&(this.keyId=O.Convert.ToHex(r.keyIdentifier)),(r.authorityCertIssuer||r.authorityCertSerialNumber)&&(this.certId={name:r.authorityCertIssuer||[],serialNumber:r.authorityCertSerialNumber?O.Convert.ToHex(r.authorityCertSerialNumber):""})}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.AsnConvert.parse(this.value,C.AuthorityKeyIdentifier);return r.authorityCertIssuer&&(e["Authority Issuer"]=new vi(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(e["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(e[""]=r.keyIdentifier),e}};bf.NAME="Authority Key Identifier";var Sf=class extends qt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.AsnConvert.parse(this.value,L.BasicConstraints);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{let r=new L.BasicConstraints({cA:e[0],pathLenConstraint:e[1]});super(L.id_ce_basicConstraints,e[2],P.AsnConvert.serialize(r)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}};Sf.NAME="Basic Constraints";B.ExtendedKeyUsage=void 0;(function(t){t.serverAuth="1.3.6.1.5.5.7.3.1",t.clientAuth="1.3.6.1.5.5.7.3.2",t.codeSigning="1.3.6.1.5.5.7.3.3",t.emailProtection="1.3.6.1.5.5.7.3.4",t.timeStamping="1.3.6.1.5.5.7.3.8",t.ocspSigning="1.3.6.1.5.5.7.3.9"})(B.ExtendedKeyUsage||(B.ExtendedKeyUsage={}));var wf=class extends qt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.AsnConvert.parse(this.value,C.ExtendedKeyUsage);this.usages=r.map(i=>i)}else{let r=new C.ExtendedKeyUsage(e[0]);super(C.id_ce_extKeyUsage,e[1],P.AsnConvert.serialize(r)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(r=>gr.toString(r)).join(", "),e}};wf.NAME="Extended Key Usages";B.KeyUsageFlags=void 0;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(B.KeyUsageFlags||(B.KeyUsageFlags={}));var Cf=class extends qt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.AsnConvert.parse(this.value,L.KeyUsage);this.usages=r.toNumber()}else{let r=new L.KeyUsage(e[0]);super(L.id_ce_keyUsage,e[1],P.AsnConvert.serialize(r)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.AsnConvert.parse(this.value,L.KeyUsage);return e[""]=r.toJSON().join(", "),e}};Cf.NAME="Key Usages";var Pf=class t extends qt{static async create(e,r=!1,i=Ie.get()){let s=await(await Kr.create(e,i)).getKeyIdentifier(i);return new t(O.Convert.ToHex(s),r)}constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.AsnConvert.parse(this.value,C.SubjectKeyIdentifier);this.keyId=O.Convert.ToHex(r)}else{let r=typeof e[0]=="string"?O.Convert.FromHex(e[0]):e[0],i=new C.SubjectKeyIdentifier(r);super(C.id_ce_subjectKeyIdentifier,e[1],P.AsnConvert.serialize(i)),this.keyId=O.Convert.ToHex(r)}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.AsnConvert.parse(this.value,C.SubjectKeyIdentifier);return e[""]=r,e}};Pf.NAME="Subject Key Identifier";var Ef=class extends qt{constructor(...e){O.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(C.id_ce_subjectAltName,e[1],new vi(e[0]||[]).rawData)}onInit(e){super.onInit(e);let r=P.AsnConvert.parse(e.extnValue,C.SubjectAlternativeName);this.names=new vi(r)}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(let i in r)e[i]=r[i];return e}};Ef.NAME="Subject Alternative Name";var ct=class{static register(e,r){this.items.set(e,r)}static create(e){let r=new qt(e),i=this.items.get(r.type);return i?new i(e):r}};ct.items=new Map;var Tf=class extends qt{constructor(...e){var r;if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let i=P.AsnConvert.parse(this.value,C.CertificatePolicies);this.policies=i.map(n=>n.policyIdentifier)}else{let i=e[0],n=(r=e[1])!==null&&r!==void 0?r:!1,s=new C.CertificatePolicies(i.map(o=>new C.PolicyInformation({policyIdentifier:o})));super(C.id_ce_certificatePolicies,n,P.AsnConvert.serialize(s)),this.policies=i}}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(r=>new Z("",{},gr.toString(r))),e}};Tf.NAME="Certificate Policies";ct.register(C.id_ce_certificatePolicies,Tf);var xf=class extends qt{constructor(...e){var r;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){let n=e[0].map(o=>new C.DistributionPoint({distributionPoint:new C.DistributionPointName({fullName:[new C.GeneralName({uniformResourceIdentifier:o})]})})),s=new C.CRLDistributionPoints(n);super(C.id_ce_cRLDistributionPoints,e[1],P.AsnConvert.serialize(s))}else{let i=new C.CRLDistributionPoints(e[0]);super(C.id_ce_cRLDistributionPoints,e[1],P.AsnConvert.serialize(i))}(r=this.distributionPoints)!==null&&r!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);let r=P.AsnConvert.parse(e.extnValue,C.CRLDistributionPoints);this.distributionPoints=r}toTextObject(){let e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(r=>{var i;let n={};return r.distributionPoint&&(n[""]=(i=r.distributionPoint.fullName)===null||i===void 0?void 0:i.map(s=>new Lr(s).toString()).join(", ")),r.reasons&&(n.Reasons=r.reasons.toString()),r.cRLIssuer&&(n["CRL Issuer"]=r.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}};xf.NAME="CRL Distribution Points";var Of=class extends qt{constructor(...e){var r,i,n,s;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof C.AuthorityInfoAccessSyntax){let o=new C.AuthorityInfoAccessSyntax(e[0]);super(C.id_pe_authorityInfoAccess,e[1],P.AsnConvert.serialize(o))}else{let o=e[0],a=new C.AuthorityInfoAccessSyntax;p_(a,o,C.id_ad_ocsp,"ocsp"),p_(a,o,C.id_ad_caIssuers,"caIssuers"),p_(a,o,C.id_ad_timeStamping,"timeStamping"),p_(a,o,C.id_ad_caRepository,"caRepository"),super(C.id_pe_authorityInfoAccess,e[1],P.AsnConvert.serialize(a))}(r=this.ocsp)!==null&&r!==void 0||(this.ocsp=[]),(i=this.caIssuers)!==null&&i!==void 0||(this.caIssuers=[]),(n=this.timeStamping)!==null&&n!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],P.AsnConvert.parse(e.extnValue,C.AuthorityInfoAccessSyntax).forEach(i=>{switch(i.accessMethod){case C.id_ad_ocsp:this.ocsp.push(new Lr(i.accessLocation));break;case C.id_ad_caIssuers:this.caIssuers.push(new Lr(i.accessLocation));break;case C.id_ad_timeStamping:this.timeStamping.push(new Lr(i.accessLocation));break;case C.id_ad_caRepository:this.caRepository.push(new Lr(i.accessLocation));break}})}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ocsp.length&&d_(e,"OCSP",this.ocsp),this.caIssuers.length&&d_(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&d_(e,"Time Stamping",this.timeStamping),this.caRepository.length&&d_(e,"CA Repository",this.caRepository),e}};Of.NAME="Authority Info Access";function d_(t,e,r){if(r.length===1)t[e]=r[0].toTextObject();else{let i=new Z("");r.forEach((n,s)=>{let o=n.toTextObject(),a=`${o[Z.NAME]} ${s+1}`,c=i[a];Array.isArray(c)||(c=[],i[a]=c),c.push(o)}),t[e]=i}}function p_(t,e,r,i){let n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(o=>{typeof o=="string"&&(o=new Lr("url",o)),t.push(new C.AccessDescription({accessMethod:r,accessLocation:P.AsnConvert.parse(o.rawData,C.GeneralName)}))})}var If=class extends qt{constructor(...e){O.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(C.id_ce_issuerAltName,e[1],new vi(e[0]||[]).rawData)}onInit(e){super.onInit(e);let r=P.AsnConvert.parse(e.extnValue,C.GeneralNames);this.names=new vi(r)}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(let i in r)e[i]=r[i];return e}};If.NAME="Issuer Alternative Name";var to=class t extends Ai{constructor(...e){let r;if(O.BufferSourceConverter.isBufferSource(e[0]))r=O.BufferSourceConverter.toArrayBuffer(e[0]);else{let i=e[0],n=Array.isArray(e[1])?e[1].map(s=>O.BufferSourceConverter.toArrayBuffer(s)):[];r=P.AsnConvert.serialize(new L.Attribute({type:i,values:n}))}super(r,L.Attribute)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Value=this.values.map(r=>new Z("",{"":r})),e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty();return e[Z.NAME]===t.NAME&&(e[Z.NAME]=gr.toString(this.type)),e}};to.NAME="Attribute";var Bf=class extends to{constructor(...e){var r;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let i=new ic.ChallengePassword({printableString:e[0]});super(ic.id_pkcs9_at_challengePassword,[P.AsnConvert.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){let r=P.AsnConvert.parse(this.values[0],ic.ChallengePassword);this.password=r.toString()}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[Z.VALUE]=this.password,e}};Bf.NAME="Challenge Password";var oc=class extends to{constructor(...e){var r;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let i=e[0],n=new C.Extensions;for(let s of i)n.push(P.AsnConvert.parse(s.rawData,C.Extension));super(ic.id_pkcs9_at_extensionRequest,[P.AsnConvert.serialize(n)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){let r=P.AsnConvert.parse(this.values[0],C.Extensions);this.items=r.map(i=>ct.create(P.AsnConvert.serialize(i)))}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(let i of r)e[i[Z.NAME]]=i;return e}};oc.NAME="Extensions";var ro=class{static register(e,r){this.items.set(e,r)}static create(e){let r=new to(e),i=this.items.get(r.type);return i?new i(e):r}};ro.items=new Map;var $i="crypto.signatureFormatter",O_=class{toAsnSignature(e,r){return O.BufferSourceConverter.toArrayBuffer(r)}toWebSignature(e,r){return O.BufferSourceConverter.toArrayBuffer(r)}},S_;B.RsaAlgorithm=S_=class{static createPssParams(e,r){let i=S_.getHashAlgorithm(e);return i?new be.RsaSaPssParams({hashAlgorithm:i,maskGenAlgorithm:new L.AlgorithmIdentifier({algorithm:be.id_mgf1,parameters:P.AsnConvert.serialize(i)}),saltLength:r}):null}static getHashAlgorithm(e){let r=Se.container.resolve(Vr);return typeof e=="string"?r.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?r.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let r;if(typeof e.hash=="string")r=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")r=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new L.AlgorithmIdentifier({algorithm:be.id_sha1WithRSAEncryption,parameters:null});case"sha-256":return new L.AlgorithmIdentifier({algorithm:be.id_sha256WithRSAEncryption,parameters:null});case"sha-384":return new L.AlgorithmIdentifier({algorithm:be.id_sha384WithRSAEncryption,parameters:null});case"sha-512":return new L.AlgorithmIdentifier({algorithm:be.id_sha512WithRSAEncryption,parameters:null})}}else return new L.AlgorithmIdentifier({algorithm:be.id_rsaEncryption,parameters:null});break;case"rsa-pss":if("hash"in e){if(!("saltLength"in e&&typeof e.saltLength=="number"))throw new Error("Cannot get 'saltLength' from 'alg' argument");let r=S_.createPssParams(e.hash,e.saltLength);if(!r)throw new Error("Cannot create PSS parameters");return new L.AlgorithmIdentifier({algorithm:be.id_RSASSA_PSS,parameters:P.AsnConvert.serialize(r)})}else return new L.AlgorithmIdentifier({algorithm:be.id_RSASSA_PSS,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case be.id_rsaEncryption:return{name:"RSASSA-PKCS1-v1_5"};case be.id_sha1WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case be.id_sha256WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case be.id_sha384WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case be.id_sha512WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case be.id_RSASSA_PSS:if(e.parameters){let r=P.AsnConvert.parse(e.parameters,be.RsaSaPssParams);return{name:"RSA-PSS",hash:Se.container.resolve(Vr).toWebAlgorithm(r.hashAlgorithm),saltLength:r.saltLength}}else return{name:"RSA-PSS"}}return null}};B.RsaAlgorithm=S_=E.__decorate([Se.injectable()],B.RsaAlgorithm);Se.container.registerSingleton(cc,B.RsaAlgorithm);B.ShaAlgorithm=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new L.AlgorithmIdentifier({algorithm:Nt.id_sha1});case"sha-256":return new L.AlgorithmIdentifier({algorithm:Nt.id_sha256});case"sha-384":return new L.AlgorithmIdentifier({algorithm:Nt.id_sha384});case"sha-512":return new L.AlgorithmIdentifier({algorithm:Nt.id_sha512})}return null}toWebAlgorithm(e){switch(e.algorithm){case Nt.id_sha1:return{name:"SHA-1"};case Nt.id_sha256:return{name:"SHA-256"};case Nt.id_sha384:return{name:"SHA-384"};case Nt.id_sha512:return{name:"SHA-512"}}return null}};B.ShaAlgorithm=E.__decorate([Se.injectable()],B.ShaAlgorithm);Se.container.registerSingleton(cc,B.ShaAlgorithm);var mi=class t{addPadding(e,r){let i=O.BufferSourceConverter.toUint8Array(r),n=new Uint8Array(e);return n.set(i,e-i.length),n.buffer}removePadding(e,r=!1){let i=O.BufferSourceConverter.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(r&&i[0]>127){let n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,r){if(e.name==="ECDSA"){let i=e.namedCurve,n=t.namedCurveSize.get(i)||t.defaultNamedCurveSize,s=new P_.ECDSASigValue,o=O.BufferSourceConverter.toUint8Array(r);return s.r=this.removePadding(o.slice(0,n),!0),s.s=this.removePadding(o.slice(n,n+n),!0),P.AsnConvert.serialize(s)}return null}toWebSignature(e,r){if(e.name==="ECDSA"){let i=P.AsnConvert.parse(r,P_.ECDSASigValue),n=e.namedCurve,s=t.namedCurveSize.get(n)||t.defaultNamedCurveSize,o=this.addPadding(s,this.removePadding(i.r)),a=this.addPadding(s,this.removePadding(i.s));return O.combine(o,a)}return null}};mi.namedCurveSize=new Map;mi.defaultNamedCurveSize=32;var w_="1.3.101.110",p0="1.3.101.111",C_="1.3.101.112",y0="1.3.101.113";B.EdAlgorithm=class{toAsnAlgorithm(e){let r=null;switch(e.name.toLowerCase()){case"ed25519":r=C_;break;case"x25519":r=w_;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":r=C_;break;case"ed448":r=y0;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":r=w_;break;case"x448":r=p0;break}}return r?new L.AlgorithmIdentifier({algorithm:r}):null}toWebAlgorithm(e){switch(e.algorithm){case C_:return{name:"Ed25519"};case y0:return{name:"EdDSA",namedCurve:"Ed448"};case w_:return{name:"X25519"};case p0:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};B.EdAlgorithm=E.__decorate([Se.injectable()],B.EdAlgorithm);Se.container.registerSingleton(cc,B.EdAlgorithm);var Hl,Wl,$l,zl,Yl,Jl,Ql,Qa,kf=class extends Dt{get subjectName(){return E.__classPrivateFieldGet(this,Wl,"f")||E.__classPrivateFieldSet(this,Wl,new rt(this.asn.certificationRequestInfo.subject),"f"),E.__classPrivateFieldGet(this,Wl,"f")}get subject(){return E.__classPrivateFieldGet(this,$l,"f")||E.__classPrivateFieldSet(this,$l,this.subjectName.toString(),"f"),E.__classPrivateFieldGet(this,$l,"f")}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,zl,"f")){let e=Se.container.resolve(Vr);E.__classPrivateFieldSet(this,zl,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,zl,"f")}get signature(){return E.__classPrivateFieldGet(this,Yl,"f")||E.__classPrivateFieldSet(this,Yl,this.asn.signature,"f"),E.__classPrivateFieldGet(this,Yl,"f")}get publicKey(){return E.__classPrivateFieldGet(this,Jl,"f")||E.__classPrivateFieldSet(this,Jl,new Kr(this.asn.certificationRequestInfo.subjectPKInfo),"f"),E.__classPrivateFieldGet(this,Jl,"f")}get attributes(){return E.__classPrivateFieldGet(this,Ql,"f")||E.__classPrivateFieldSet(this,Ql,this.asn.certificationRequestInfo.attributes.map(e=>ro.create(P.AsnConvert.serialize(e))),"f"),E.__classPrivateFieldGet(this,Ql,"f")}get extensions(){if(!E.__classPrivateFieldGet(this,Qa,"f")){E.__classPrivateFieldSet(this,Qa,[],"f");let e=this.getAttribute(v0.id_pkcs9_at_extensionRequest);e instanceof oc&&E.__classPrivateFieldSet(this,Qa,e.items,"f")}return E.__classPrivateFieldGet(this,Qa,"f")}get tbs(){return E.__classPrivateFieldGet(this,Hl,"f")||E.__classPrivateFieldSet(this,Hl,this.asn.certificationRequestInfoRaw||P.AsnConvert.serialize(this.asn.certificationRequestInfo),"f"),E.__classPrivateFieldGet(this,Hl,"f")}constructor(e){let r=Dt.isAsnEncoded(e)?[e,E_.CertificationRequest]:[e];super(r[0],r[1]),Hl.set(this,void 0),Wl.set(this,void 0),$l.set(this,void 0),zl.set(this,void 0),Yl.set(this,void 0),Jl.set(this,void 0),Ql.set(this,void 0),Qa.set(this,void 0),this.tag=at.CertificateRequestTag}onInit(e){}getAttribute(e){for(let r of this.attributes)if(r.type===e)return r;return null}getAttributes(e){return this.attributes.filter(r=>r.type===e)}getExtension(e){for(let r of this.extensions)if(r.type===e)return r;return null}getExtensions(e){return this.extensions.filter(r=>r.type===e)}async verify(e=Ie.get()){let r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],e),n=Se.container.resolveAll($i).reverse(),s=null;for(let a of n)if(s=a.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.AsnConvert.parse(this.rawData,E_.CertificationRequest),i=r.certificationRequestInfo,n=new Z("",{Version:`${L.Version[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let s=new Z("");for(let o of this.attributes){let a=o.toTextObject();s[a[Z.NAME]]=a}n.Attributes=s}return e.Data=n,e.Signature=new Z("",{Algorithm:Gr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),e}};Hl=new WeakMap,Wl=new WeakMap,$l=new WeakMap,zl=new WeakMap,Yl=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,Qa=new WeakMap;kf.NAME="PKCS#10 Certificate Request";var _0=class{static async create(e,r=Ie.get()){if(!e.keys.privateKey)throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty");if(!e.keys.publicKey)throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty");let i=await r.subtle.exportKey("spki",e.keys.publicKey),n=new E_.CertificationRequest({certificationRequestInfo:new E_.CertificationRequestInfo({subjectPKInfo:P.AsnConvert.parse(i,L.SubjectPublicKeyInfo)})});if(e.name){let d=e.name instanceof rt?e.name:new rt(e.name);n.certificationRequestInfo.subject=P.AsnConvert.parse(d.toArrayBuffer(),L.Name)}if(e.attributes)for(let d of e.attributes)n.certificationRequestInfo.attributes.push(P.AsnConvert.parse(d.rawData,L.Attribute));if(e.extensions&&e.extensions.length){let d=new L.Attribute({type:v0.id_pkcs9_at_extensionRequest}),y=new L.Extensions;for(let m of e.extensions)y.push(P.AsnConvert.parse(m.rawData,L.Extension));d.values.push(P.AsnConvert.serialize(y)),n.certificationRequestInfo.attributes.push(d)}let s={...e.signingAlgorithm,...e.keys.privateKey.algorithm},o=Se.container.resolve(Vr);n.signatureAlgorithm=o.toAsnAlgorithm(s);let a=P.AsnConvert.serialize(n.certificationRequestInfo),c=await r.subtle.sign(s,e.keys.privateKey,a),u=Se.container.resolveAll($i).reverse(),f=null;for(let d of u)if(f=d.toAsnSignature(s,c),f)break;if(!f)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return n.signature=f,new kf(P.AsnConvert.serialize(n))}},Xl,Zl,ef,tf,rf,nf,sf,of,af,cf,Xa,uf,En=class extends Dt{get publicKey(){return E.__classPrivateFieldGet(this,uf,"f")||E.__classPrivateFieldSet(this,uf,new Kr(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),E.__classPrivateFieldGet(this,uf,"f")}get serialNumber(){if(!E.__classPrivateFieldGet(this,Zl,"f")){let e=this.asn.tbsCertificate,r=new Uint8Array(e.serialNumber);r.length>1&&r[0]===0&&r[1]>127&&(r=r.slice(1)),E.__classPrivateFieldSet(this,Zl,O.Convert.ToHex(r),"f")}return E.__classPrivateFieldGet(this,Zl,"f")}get subjectName(){return E.__classPrivateFieldGet(this,ef,"f")||E.__classPrivateFieldSet(this,ef,new rt(this.asn.tbsCertificate.subject),"f"),E.__classPrivateFieldGet(this,ef,"f")}get subject(){return E.__classPrivateFieldGet(this,tf,"f")||E.__classPrivateFieldSet(this,tf,this.subjectName.toString(),"f"),E.__classPrivateFieldGet(this,tf,"f")}get issuerName(){return E.__classPrivateFieldGet(this,rf,"f")||E.__classPrivateFieldSet(this,rf,new rt(this.asn.tbsCertificate.issuer),"f"),E.__classPrivateFieldGet(this,rf,"f")}get issuer(){return E.__classPrivateFieldGet(this,nf,"f")||E.__classPrivateFieldSet(this,nf,this.issuerName.toString(),"f"),E.__classPrivateFieldGet(this,nf,"f")}get notBefore(){if(!E.__classPrivateFieldGet(this,sf,"f")){let e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");E.__classPrivateFieldSet(this,sf,e,"f")}return E.__classPrivateFieldGet(this,sf,"f")}get notAfter(){if(!E.__classPrivateFieldGet(this,of,"f")){let e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");E.__classPrivateFieldSet(this,of,e,"f")}return E.__classPrivateFieldGet(this,of,"f")}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,af,"f")){let e=Se.container.resolve(Vr);E.__classPrivateFieldSet(this,af,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,af,"f")}get signature(){return E.__classPrivateFieldGet(this,cf,"f")||E.__classPrivateFieldSet(this,cf,this.asn.signatureValue,"f"),E.__classPrivateFieldGet(this,cf,"f")}get extensions(){return E.__classPrivateFieldGet(this,Xa,"f")||(E.__classPrivateFieldSet(this,Xa,[],"f"),this.asn.tbsCertificate.extensions&&E.__classPrivateFieldSet(this,Xa,this.asn.tbsCertificate.extensions.map(e=>ct.create(P.AsnConvert.serialize(e))),"f")),E.__classPrivateFieldGet(this,Xa,"f")}get tbs(){return E.__classPrivateFieldGet(this,Xl,"f")||E.__classPrivateFieldSet(this,Xl,this.asn.tbsCertificateRaw||P.AsnConvert.serialize(this.asn.tbsCertificate),"f"),E.__classPrivateFieldGet(this,Xl,"f")}constructor(e){let r=Dt.isAsnEncoded(e)?[e,L.Certificate]:[e];super(r[0],r[1]),Xl.set(this,void 0),Zl.set(this,void 0),ef.set(this,void 0),tf.set(this,void 0),rf.set(this,void 0),nf.set(this,void 0),sf.set(this,void 0),of.set(this,void 0),af.set(this,void 0),cf.set(this,void 0),Xa.set(this,void 0),uf.set(this,void 0),this.tag=at.CertificateTag}onInit(e){}getExtension(e){for(let r of this.extensions)if(typeof e=="string"){if(r.type===e)return r}else if(r instanceof e)return r;return null}getExtensions(e){return this.extensions.filter(r=>typeof e=="string"?r.type===e:r instanceof e)}async verify(e={},r=Ie.get()){let i,n,s=e.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],r);else if(s instanceof Kr)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],r);else if(O.BufferSourceConverter.isBufferSource(s)){let u=new Kr(s);i={...u.algorithm,...this.signatureAlgorithm},n=await u.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}let o=Se.container.resolveAll($i).reverse(),a=null;for(let u of o)if(a=u.toWebSignature(i,this.signature),a)break;if(!a)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");let c=await r.subtle.verify(this.signatureAlgorithm,n,a,this.tbs);if(e.signatureOnly)return c;{let f=(e.date||new Date).getTime();return c&&this.notBefore.getTime()<f&&f<this.notAfter.getTime()}}async getThumbprint(...e){let r,i="SHA-1";return e[0]&&(e[0].subtle?r=e[0]:(i=e[0]||i,r=e[1])),r??(r=Ie.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(e=Ie.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.AsnConvert.parse(this.rawData,L.Certificate),i=r.tbsCertificate,n=new Z("",{Version:`${L.Version[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Gr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new Z("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){let s=new Z("");for(let o of this.extensions){let a=o.toTextObject();s[a[Z.NAME]]=a}n.Extensions=s}return e.Data=n,e.Signature=new Z("",{Algorithm:Gr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),e}};Xl=new WeakMap,Zl=new WeakMap,ef=new WeakMap,tf=new WeakMap,rf=new WeakMap,nf=new WeakMap,sf=new WeakMap,of=new WeakMap,af=new WeakMap,cf=new WeakMap,Xa=new WeakMap,uf=new WeakMap;En.NAME="Certificate";var I_=class extends Array{constructor(e){if(super(),Dt.isAsnEncoded(e))this.import(e);else if(e instanceof En)this.push(e);else if(Array.isArray(e))for(let r of e)this.push(r)}export(e){let r=new Mt.SignedData;r.version=1,r.encapContentInfo.eContentType=Mt.id_data,r.encapContentInfo.eContent=new Mt.EncapsulatedContent({single:new P.OctetString}),r.certificates=new Mt.CertificateSet(this.map(s=>new Mt.CertificateChoices({certificate:P.AsnConvert.parse(s.rawData,L.Certificate)})));let i=new Mt.ContentInfo({contentType:Mt.id_signedData,content:P.AsnConvert.serialize(r)}),n=P.AsnConvert.serialize(i);return e==="raw"?n:this.toString(e)}import(e){let r=Dt.toArrayBuffer(e),i=P.AsnConvert.parse(r,Mt.ContentInfo);if(i.contentType!==Mt.id_signedData)throw new TypeError("Cannot parse CMS package. Incoming data is not a SignedData object.");let n=P.AsnConvert.parse(i.content,Mt.SignedData);this.clear();for(let s of n.certificates||[])s.certificate&&this.push(new En(s.certificate))}clear(){for(;this.pop(););}toString(e="pem"){let r=this.export("raw");switch(e){case"pem":return at.encode(r,"CMS");case"pem-chain":return this.map(i=>i.toString("pem")).join(`
22
- `);case"asn":return P.AsnConvert.toString(r);case"hex":return O.Convert.ToHex(r);case"base64":return O.Convert.ToBase64(r);case"base64url":return O.Convert.ToBase64Url(r);case"text":return Gr.serialize(this.toTextObject());default:throw TypeError("Argument 'format' is unsupported value")}}toTextObject(){let e=P.AsnConvert.parse(this.export("raw"),Mt.ContentInfo),r=P.AsnConvert.parse(e.content,Mt.SignedData);return new Z("X509Certificates",{"Content Type":gr.toString(e.contentType),Content:new Z("",{Version:`${Mt.CMSVersion[r.version]} (${r.version})`,Certificates:new Z("",{Certificate:this.map(n=>n.toTextObject())})})})}},h0=class{constructor(e={}){this.certificates=[],e.certificates&&(this.certificates=e.certificates)}async build(e,r=Ie.get()){let i=new I_(e),n=e;for(;n=await this.findIssuer(n,r);){let s=await n.getThumbprint(r);for(let o of i){let a=await o.getThumbprint(r);if(O.isEqual(s,a))throw new Error("Cannot build a certificate chain. Circular dependency.")}i.push(n)}return i}async findIssuer(e,r=Ie.get()){if(!await e.isSelfSigned(r)){let i=e.getExtension(C.id_ce_authorityKeyIdentifier);for(let n of this.certificates)if(n.subject===e.issuer){if(i){if(i.keyId){let s=n.getExtension(C.id_ce_subjectKeyIdentifier);if(s&&s.keyId!==i.keyId)continue}else if(i.certId){let s=n.getExtension(C.id_ce_subjectAltName);if(s&&!(i.certId.serialNumber===n.serialNumber&&O.isEqual(P.AsnConvert.serialize(i.certId.name),P.AsnConvert.serialize(s))))continue}}try{let s={...n.publicKey.algorithm,...e.signatureAlgorithm},o=await n.publicKey.export(s,["verify"],r);if(!await e.verify({publicKey:o,signatureOnly:!0},r))continue}catch{continue}return n}}return null}};function m0(t,e=Ie.get()){let r=O.BufferSourceConverter.toUint8Array(O.Convert.FromHex(t||"")),i=r&&r.length&&r.some(s=>s>0)?new Uint8Array(r):void 0;i||(i=e.getRandomValues(new Uint8Array(16)));let n=0;for(;n<i.length-1&&i[n]===0;)n++;if(i=i.slice(n),i[0]>127){let s=new Uint8Array(i.length+1);s[0]=0,s.set(i,1),i=s}return i.buffer}var g0=class{static async createSelfSigned(e,r=Ie.get()){if(!e.keys.privateKey)throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty");if(!e.keys.publicKey)throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty");return this.create({serialNumber:e.serialNumber,subject:e.name,issuer:e.name,notBefore:e.notBefore,notAfter:e.notAfter,publicKey:e.keys.publicKey,signingKey:e.keys.privateKey,signingAlgorithm:e.signingAlgorithm,extensions:e.extensions},r)}static async create(e,r=Ie.get()){var i;let n;e.publicKey instanceof Kr?n=e.publicKey.rawData:"publicKey"in e.publicKey?n=e.publicKey.publicKey.rawData:O.BufferSourceConverter.isBufferSource(e.publicKey)?n=e.publicKey:n=await r.subtle.exportKey("spki",e.publicKey);let s=m0(e.serialNumber,r),o=e.notBefore||new Date,a=e.notAfter||new Date(o.getTime()+31536e6),c=new C.Certificate({tbsCertificate:new C.TBSCertificate({version:C.Version.v3,serialNumber:s,validity:new C.Validity({notBefore:o,notAfter:a}),extensions:new C.Extensions(((i=e.extensions)===null||i===void 0?void 0:i.map(I=>P.AsnConvert.parse(I.rawData,C.Extension)))||[]),subjectPublicKeyInfo:P.AsnConvert.parse(n,C.SubjectPublicKeyInfo)})});if(e.subject){let I=e.subject instanceof rt?e.subject:new rt(e.subject);c.tbsCertificate.subject=P.AsnConvert.parse(I.toArrayBuffer(),C.Name)}if(e.issuer){let I=e.issuer instanceof rt?e.issuer:new rt(e.issuer);c.tbsCertificate.issuer=P.AsnConvert.parse(I.toArrayBuffer(),C.Name)}let u={hash:"SHA-256"},f="signingKey"in e?{...u,...e.signingAlgorithm,...e.signingKey.algorithm}:{...u,...e.signingAlgorithm},d=Se.container.resolve(Vr);c.tbsCertificate.signature=c.signatureAlgorithm=d.toAsnAlgorithm(f);let y=P.AsnConvert.serialize(c.tbsCertificate),m="signingKey"in e?await r.subtle.sign(f,e.signingKey,y):e.signature,x=Se.container.resolveAll($i).reverse(),T=null;for(let I of x)if(T=I.toAsnSignature(f,m),T)break;if(!T)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return c.signatureValue=T,new En(P.AsnConvert.serialize(c))}},lf,ff,Za,ec,tc;B.X509CrlReason=void 0;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(B.X509CrlReason||(B.X509CrlReason={}));var ac=class extends Ai{get serialNumber(){return E.__classPrivateFieldGet(this,lf,"f")||E.__classPrivateFieldSet(this,lf,O.Convert.ToHex(this.asn.userCertificate),"f"),E.__classPrivateFieldGet(this,lf,"f")}get revocationDate(){return E.__classPrivateFieldGet(this,ff,"f")||E.__classPrivateFieldSet(this,ff,this.asn.revocationDate.getTime(),"f"),E.__classPrivateFieldGet(this,ff,"f")}get reason(){return E.__classPrivateFieldGet(this,Za,"f")===void 0&&this.extensions,E.__classPrivateFieldGet(this,Za,"f")}get invalidity(){return E.__classPrivateFieldGet(this,ec,"f")===void 0&&this.extensions,E.__classPrivateFieldGet(this,ec,"f")}get extensions(){return E.__classPrivateFieldGet(this,tc,"f")||(E.__classPrivateFieldSet(this,tc,[],"f"),this.asn.crlEntryExtensions&&E.__classPrivateFieldSet(this,tc,this.asn.crlEntryExtensions.map(e=>{let r=ct.create(P.AsnConvert.serialize(e));switch(r.type){case L.id_ce_cRLReasons:E.__classPrivateFieldGet(this,Za,"f")===void 0&&E.__classPrivateFieldSet(this,Za,P.AsnConvert.parse(r.value,L.CRLReason).reason,"f");break;case L.id_ce_invalidityDate:E.__classPrivateFieldGet(this,ec,"f")===void 0&&E.__classPrivateFieldSet(this,ec,P.AsnConvert.parse(r.value,L.InvalidityDate).value,"f");break}return r}),"f")),E.__classPrivateFieldGet(this,tc,"f")}constructor(...e){let r;if(O.BufferSourceConverter.isBufferSource(e[0])?r=O.BufferSourceConverter.toArrayBuffer(e[0]):typeof e[0]=="string"?r=P.AsnConvert.serialize(new L.RevokedCertificate({userCertificate:m0(e[0]),revocationDate:new L.Time(e[1]),crlEntryExtensions:e[2]})):e[0]instanceof L.RevokedCertificate&&(r=e[0]),!r)throw new TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments.");super(r,L.RevokedCertificate),lf.set(this,void 0),ff.set(this,void 0),Za.set(this,void 0),ec.set(this,void 0),tc.set(this,void 0)}onInit(e){}};lf=new WeakMap,ff=new WeakMap,Za=new WeakMap,ec=new WeakMap,tc=new WeakMap;var df,pf,yf,_f,hf,gf,rc,B_=class extends Dt{get version(){return this.asn.tbsCertList.version}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,pf,"f")){let e=Se.container.resolve(Vr);E.__classPrivateFieldSet(this,pf,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,pf,"f")}get signature(){return this.asn.signature}get issuer(){return this.issuerName.toString()}get issuerName(){return E.__classPrivateFieldGet(this,yf,"f")||E.__classPrivateFieldSet(this,yf,new rt(this.asn.tbsCertList.issuer),"f"),E.__classPrivateFieldGet(this,yf,"f")}get thisUpdate(){if(!E.__classPrivateFieldGet(this,_f,"f")){let e=this.asn.tbsCertList.thisUpdate.getTime();if(!e)throw new Error("Cannot get 'thisUpdate' value");E.__classPrivateFieldSet(this,_f,e,"f")}return E.__classPrivateFieldGet(this,_f,"f")}get nextUpdate(){var e;return E.__classPrivateFieldGet(this,hf,"f")===void 0&&E.__classPrivateFieldSet(this,hf,((e=this.asn.tbsCertList.nextUpdate)===null||e===void 0?void 0:e.getTime())||void 0,"f"),E.__classPrivateFieldGet(this,hf,"f")}get entries(){var e;return E.__classPrivateFieldGet(this,gf,"f")||E.__classPrivateFieldSet(this,gf,((e=this.asn.tbsCertList.revokedCertificates)===null||e===void 0?void 0:e.map(r=>new ac(r)))||[],"f"),E.__classPrivateFieldGet(this,gf,"f")}get extensions(){return E.__classPrivateFieldGet(this,rc,"f")||(E.__classPrivateFieldSet(this,rc,[],"f"),this.asn.tbsCertList.crlExtensions&&E.__classPrivateFieldSet(this,rc,this.asn.tbsCertList.crlExtensions.map(e=>ct.create(P.AsnConvert.serialize(e))),"f")),E.__classPrivateFieldGet(this,rc,"f")}get tbs(){return E.__classPrivateFieldGet(this,df,"f")||E.__classPrivateFieldSet(this,df,this.asn.tbsCertListRaw||P.AsnConvert.serialize(this.asn.tbsCertList),"f"),E.__classPrivateFieldGet(this,df,"f")}get tbsCertListSignatureAlgorithm(){return this.asn.tbsCertList.signature}get certListSignatureAlgorithm(){return this.asn.signatureAlgorithm}constructor(e){super(e,Dt.isAsnEncoded(e)?L.CertificateList:void 0),this.tag=at.CrlTag,df.set(this,void 0),pf.set(this,void 0),yf.set(this,void 0),_f.set(this,void 0),hf.set(this,void 0),gf.set(this,void 0),rc.set(this,void 0)}onInit(e){}getExtension(e){for(let r of this.extensions)if(typeof e=="string"){if(r.type===e)return r}else if(r instanceof e)return r;return null}getExtensions(e){return this.extensions.filter(r=>typeof e=="string"?r.type===e:r instanceof e)}async verify(e,r=Ie.get()){if(!this.certListSignatureAlgorithm.isEqual(this.tbsCertListSignatureAlgorithm))throw new Error("algorithm identifier in the sequence tbsCertList and CertificateList mismatch");let i,n,s=e.publicKey;try{s instanceof En?(i={...s.publicKey.algorithm,...s.signatureAlgorithm},n=await s.publicKey.export(i,["verify"])):s instanceof Kr?(i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"])):(i={...s.algorithm,...this.signatureAlgorithm},n=s)}catch{return!1}let o=Se.container.resolveAll($i).reverse(),a=null;for(let c of o)if(a=c.toWebSignature(i,this.signature),a)break;if(!a)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return await r.subtle.verify(this.signatureAlgorithm,n,a,this.tbs)}async getThumbprint(...e){let r,i="SHA-1";return e[0]&&(e[0].subtle?r=e[0]:(i=e[0]||i,r=e[1])),r??(r=Ie.get()),await r.subtle.digest(i,this.rawData)}findRevoked(e){let r=typeof e=="string"?e:e.serialNumber,i=m0(r);for(let n of this.asn.tbsCertList.revokedCertificates||[])if(O.BufferSourceConverter.isEqual(n.userCertificate,i))return new ac(P.AsnConvert.serialize(n));return null}};df=new WeakMap,pf=new WeakMap,yf=new WeakMap,_f=new WeakMap,hf=new WeakMap,gf=new WeakMap,rc=new WeakMap;var A0=class{static async create(e,r=Ie.get()){var i;let n=e.issuer instanceof rt?e.issuer:new rt(e.issuer),s=new C.CertificateList({tbsCertList:new C.TBSCertList({version:C.Version.v2,issuer:P.AsnConvert.parse(n.toArrayBuffer(),C.Name),thisUpdate:new L.Time(e.thisUpdate||new Date)})});if(e.nextUpdate&&(s.tbsCertList.nextUpdate=new L.Time(e.nextUpdate)),e.extensions&&e.extensions.length&&(s.tbsCertList.crlExtensions=new C.Extensions(e.extensions.map(y=>P.AsnConvert.parse(y.rawData,C.Extension))||[])),e.entries&&e.entries.length){s.tbsCertList.revokedCertificates=[];for(let y of e.entries){let m=Dt.toArrayBuffer(y.serialNumber);if(s.tbsCertList.revokedCertificates.findIndex(I=>O.isEqual(I.userCertificate,m))>-1)throw new Error(`Certificate serial number ${y.serialNumber} already exists in tbsCertList`);let T=new L.RevokedCertificate({userCertificate:m,revocationDate:new L.Time(y.revocationDate||new Date)});if("extensions"in y&&(!((i=y.extensions)===null||i===void 0)&&i.length)?T.crlEntryExtensions=y.extensions.map(I=>P.AsnConvert.parse(I.rawData,C.Extension)):T.crlEntryExtensions=[],!(y instanceof ac)&&(y.reason&&T.crlEntryExtensions.push(new C.Extension({extnID:C.id_ce_cRLReasons,critical:!1,extnValue:new P.OctetString(P.AsnConvert.serialize(new C.CRLReason(y.reason)))})),y.invalidity&&T.crlEntryExtensions.push(new C.Extension({extnID:C.id_ce_invalidityDate,critical:!1,extnValue:new P.OctetString(P.AsnConvert.serialize(new C.InvalidityDate(y.invalidity)))})),y.issuer)){let I=e.issuer instanceof rt?e.issuer:new rt(e.issuer);T.crlEntryExtensions.push(new C.Extension({extnID:C.id_ce_certificateIssuer,critical:!1,extnValue:new P.OctetString(P.AsnConvert.serialize(P.AsnConvert.parse(I.toArrayBuffer(),C.Name)))}))}s.tbsCertList.revokedCertificates.push(T)}}let o={...e.signingAlgorithm,...e.signingKey.algorithm},a=Se.container.resolve(Vr);s.tbsCertList.signature=s.signatureAlgorithm=a.toAsnAlgorithm(o);let c=P.AsnConvert.serialize(s.tbsCertList),u=await r.subtle.sign(o,e.signingKey,c),f=Se.container.resolveAll($i).reverse(),d=null;for(let y of f)if(d=y.toAsnSignature(o,u),d)break;if(!d)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return s.signature=d,new B_(P.AsnConvert.serialize(s))}};ct.register(C.id_ce_basicConstraints,Sf);ct.register(C.id_ce_extKeyUsage,wf);ct.register(C.id_ce_keyUsage,Cf);ct.register(C.id_ce_subjectKeyIdentifier,Pf);ct.register(C.id_ce_authorityKeyIdentifier,bf);ct.register(C.id_ce_subjectAltName,Ef);ct.register(C.id_ce_cRLDistributionPoints,xf);ct.register(C.id_pe_authorityInfoAccess,Of);ct.register(C.id_ce_issuerAltName,If);ro.register(ic.id_pkcs9_at_challengePassword,Bf);ro.register(ic.id_pkcs9_at_extensionRequest,oc);Se.container.registerSingleton($i,O_);Se.container.registerSingleton($i,mi);mi.namedCurveSize.set("P-256",32);mi.namedCurveSize.set("K-256",32);mi.namedCurveSize.set("P-384",48);mi.namedCurveSize.set("P-521",66);B.AlgorithmProvider=T_;B.AsnData=Ai;B.AsnDefaultSignatureFormatter=O_;B.AsnEcSignatureFormatter=mi;B.Attribute=to;B.AttributeFactory=ro;B.AuthorityInfoAccessExtension=Of;B.AuthorityKeyIdentifierExtension=bf;B.BasicConstraintsExtension=Sf;B.CRLDistributionPointsExtension=xf;B.CertificatePolicyExtension=Tf;B.ChallengePasswordAttribute=Bf;B.CryptoProvider=nc;B.DN=h_;B.DNS=__;B.DefaultAlgorithmSerializer=x_;B.EMAIL=g_;B.ExtendedKeyUsageExtension=wf;B.Extension=qt;B.ExtensionFactory=ct;B.ExtensionsAttribute=oc;B.GUID=m_;B.GeneralName=Lr;B.GeneralNames=vi;B.IP=A_;B.IssuerAlternativeNameExtension=If;B.KeyUsagesExtension=Cf;B.Name=rt;B.NameIdentifier=vf;B.OidSerializer=gr;B.PemConverter=at;B.PemData=Dt;B.Pkcs10CertificateRequest=kf;B.Pkcs10CertificateRequestGenerator=_0;B.PublicKey=Kr;B.REGISTERED_ID=Fl;B.SubjectAlternativeNameExtension=Ef;B.SubjectKeyIdentifierExtension=Pf;B.TextConverter=Gr;B.TextObject=Z;B.UPN=b_;B.URL=v_;B.X509Certificate=En;B.X509CertificateGenerator=g0;B.X509Certificates=I_;B.X509ChainBuilder=h0;B.X509Crl=B_;B.X509CrlEntry=ac;B.X509CrlGenerator=A0;B.cryptoProvider=Ie;B.diAlgorithm=cc;B.diAlgorithmProvider=Vr;B.diAsnSignatureFormatter=$i;B.idEd25519=C_;B.idEd448=y0;B.idX25519=w_;B.idX448=p0});var S0=l(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc._fetchInternals=void 0;uc.fetch=lq;function lq(t){return uc._fetchInternals.stubThis(t)}uc._fetchInternals={stubThis:t=>globalThis.fetch(t)}});var C0=l(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.isCertRevoked=dq;var k_=b0(),fq=S0(),mT={};async function dq(t){let{extensions:e}=t;if(!e)return!1;let r,i,n;e.forEach(d=>{d instanceof k_.AuthorityKeyIdentifierExtension?r=d:d instanceof k_.SubjectKeyIdentifierExtension?i=d:d instanceof k_.CRLDistributionPointsExtension&&(n=d)});let s;if(r&&r.keyId?s=r.keyId:i&&(s=i.keyId),s){let d=mT[s];if(d){let y=new Date;if(!d.nextUpdate||d.nextUpdate>y)return d.revokedCerts.indexOf(t.serialNumber)>=0}}let o=n?.distributionPoints?.[0].distributionPoint?.fullName?.[0].uniformResourceIdentifier;if(!o)return!1;let a;try{a=await(await(0,fq.fetch)(o)).arrayBuffer()}catch{return!1}let c;try{c=new k_.X509Crl(a)}catch{return!1}let u={revokedCerts:[],nextUpdate:void 0};c.nextUpdate&&(u.nextUpdate=c.nextUpdate);let f=c.entries;if(f){for(let d of f){let y=d.serialNumber;u.revokedCerts.push(y)}return s&&(mT[s]=u),u.revokedCerts.indexOf(t.serialNumber)>=0}return!1}});var ST=l(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.decodeAuthenticatorExtensions=yq;var pq=ae();function yq(t){let e;try{e=pq.isoCBOR.decodeFirst(t)}catch(r){let i=r;throw new Error(`Error decoding authenticator extensions: ${i.message}`)}return bT(e)}function bT(t){let e={};for(let[r,i]of t)i instanceof Map?e[r]=bT(i):e[r]=i;return e}});var j_=l(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc._parseAuthenticatorDataInternals=void 0;lc.parseAuthenticatorData=hq;var _q=ST(),io=ae();function hq(t){if(t.byteLength<37)throw new Error(`Authenticator data was ${t.byteLength} bytes, expected at least 37 bytes`);let e=0,r=io.isoUint8Array.toDataView(t),i=t.slice(e,e+=32),n=t.slice(e,e+=1),s=n[0],o={up:!!(s&1),uv:!!(s&4),be:!!(s&8),bs:!!(s&16),at:!!(s&64),ed:!!(s&128),flagsInt:s},a=t.slice(e,e+4),c=r.getUint32(e,!1);e+=4;let u,f,d;if(o.at){u=t.slice(e,e+=16);let x=r.getUint16(e);e+=2,f=t.slice(e,e+=x);let T=io.isoUint8Array.fromHex("a301634f4b500327206745643235353139"),I=t.slice(e,e+T.byteLength),U=!1;io.isoUint8Array.areEqual(T,I)&&(U=!0,t[e]=164);let ee=io.isoCBOR.decodeFirst(t.slice(e)),pe=Uint8Array.from(io.isoCBOR.encode(ee));U&&(t[e]=163),d=pe,e+=pe.byteLength}let y,m;if(o.ed){let x=io.isoCBOR.decodeFirst(t.slice(e));m=Uint8Array.from(io.isoCBOR.encode(x)),y=(0,_q.decodeAuthenticatorExtensions)(m),e+=m.byteLength}if(t.byteLength>e)throw new Error("Leftover bytes detected while parsing authenticator data");return lc._parseAuthenticatorDataInternals.stubThis({rpIdHash:i,flagsBuf:n,flags:o,counter:c,counterBuf:a,aaguid:u,credentialID:f,credentialPublicKey:d,extensionsData:y,extensionsDataBuffer:m})}lc._parseAuthenticatorDataInternals={stubThis:t=>t}});var Tn=l(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});E0.toHash=gq;var wT=ae();function gq(t,e=-7){return typeof t=="string"&&(t=wT.isoUint8Array.fromUTF8String(t)),wT.isoCrypto.digest(t,e)}});var bi=l(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});T0.validateCertificatePath=mq;var CT=b0(),Aq=C0(),vq=Zi();async function mq(t,e=[]){if(e.length===0)return!0;let r=await(0,vq.getWebCrypto)(),i=t.map(a=>new CT.X509Certificate(a));for(let a=0;a<i.length;a++){let c=i[a],u=t[a];try{await PT(c)}catch{throw new Error(`Found revoked certificate in x5c:
23
- ${u}`)}try{ET(c.notBefore,c.notAfter)}catch{throw new Error(`Found certificate out of validity period in x5c:
24
- ${u}`)}}let n=e.map(a=>{try{return new CT.X509Certificate(a)}catch(c){let u=c;throw new Error(`Could not parse trust anchor certificate:
25
- ${a}`,{cause:u})}}),s=[];for(let a=0;a<n.length;a++){let c=n[a];try{await PT(c)}catch{continue}try{ET(c.notBefore,c.notAfter)}catch{continue}s.push(c)}if(s.length===0)throw new Error("No specified trust anchor was valid for verifying x5c");let o=!1;for(let a of n)try{let c=i.concat([a]);if(new Set(c).size!==c.length)throw new Error("Invalid certificate path: found duplicate certificates");for(let u=0;u<c.length-1;u++){let f=c[u],d=c[u+1];if(!await f.verify({publicKey:d.publicKey,signatureOnly:!0},r))throw new fc;if(d.subject===d.issuer){if(!await d.verify({publicKey:d.publicKey,signatureOnly:!0},r))throw new fc;break}}o=!1;break}catch(c){if(c instanceof fc)o=!0;else throw new Error("Unexpected error while validating certificate path",{cause:c})}if(o)throw new fc;return!0}async function PT(t){if(await(0,Aq.isCertRevoked)(t))throw new Error("Found revoked certificate in certificate path")}function ET(t,e){let r=new Date(Date.now());if(t>r||e<r)throw new Error("Certificate is not yet valid or expired")}var fc=class extends Error{constructor(){super("Subject issuer did not match issuer subject"),this.name="InvalidSubjectAndIssuer"}}});var TT=l(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});x0.mapX509SignatureAlgToCOSEAlg=bq;var no=Qe();function bq(t){let e;if(t==="1.2.840.10045.4.3.2")e=no.COSEALG.ES256;else if(t==="1.2.840.10045.4.3.3")e=no.COSEALG.ES384;else if(t==="1.2.840.10045.4.3.4")e=no.COSEALG.ES512;else if(t==="1.2.840.113549.1.1.11")e=no.COSEALG.RS256;else if(t==="1.2.840.113549.1.1.12")e=no.COSEALG.RS384;else if(t==="1.2.840.113549.1.1.13")e=no.COSEALG.RS512;else if(t==="1.2.840.113549.1.1.5")e=no.COSEALG.RS1;else throw new Error(`Unable to map X.509 signature algorithm ${t} to a COSE algorithm`);return e}});var B0=l(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.convertX509PublicKeyToCOSE=wq;var O0=S(),Sq=X(),M_=_y(),xT=Cy(),Zt=Qe(),OT=TT();function wq(t){let e=new Map,r=O0.AsnParser.parse(t,Sq.Certificate),{tbsCertificate:i}=r,{subjectPublicKeyInfo:n,signature:s}=i,o=s.algorithm,a=n.algorithm.algorithm;if(a===M_.id_ecPublicKey){if(!n.algorithm.parameters)throw new Error("Certificate public key was missing parameters (EC2)");let c=O0.AsnParser.parse(new Uint8Array(n.algorithm.parameters),M_.ECParameters),u=-999,{namedCurve:f}=c;if(f===M_.id_secp256r1)u=Zt.COSECRV.P256;else if(f===M_.id_secp384r1)u=Zt.COSECRV.P384;else throw new Error(`Certificate public key contained unexpected namedCurve ${f} (EC2)`);let d=new Uint8Array(n.subjectPublicKey),y,m;if(d[0]===4){let T=1,I=(d.length-1)/2;y=d.slice(T,T+=I),m=d.slice(T)}else throw new Error('TODO: Figure out how to handle public keys in "compressed form"');let x=new Map;x.set(Zt.COSEKEYS.kty,Zt.COSEKTY.EC2),x.set(Zt.COSEKEYS.alg,(0,OT.mapX509SignatureAlgToCOSEAlg)(o)),x.set(Zt.COSEKEYS.crv,u),x.set(Zt.COSEKEYS.x,y),x.set(Zt.COSEKEYS.y,m),e=x}else if(a===xT.id_rsaEncryption){let c=O0.AsnParser.parse(n.subjectPublicKey,xT.RSAPublicKey),u=new Map;u.set(Zt.COSEKEYS.kty,Zt.COSEKTY.RSA),u.set(Zt.COSEKEYS.alg,(0,OT.mapX509SignatureAlgToCOSEAlg)(o)),u.set(Zt.COSEKEYS.n,new Uint8Array(c.modulus)),u.set(Zt.COSEKEYS.e,new Uint8Array(c.publicExponent)),e=u}else throw new Error(`Certificate public key contained unexpected algorithm ID ${a}`);return e}});var xn=l(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc._verifySignatureInternals=void 0;dc.verifySignature=Tq;var Cq=ae(),Pq=vo(),Eq=B0();function Tq(t){let{signature:e,data:r,credentialPublicKey:i,x509Certificate:n,hashAlgorithm:s}=t;if(!n&&!i)throw new Error('Must declare either "leafCert" or "credentialPublicKey"');if(n&&i)throw new Error('Must not declare both "leafCert" and "credentialPublicKey"');let o=new Map;return i?o=(0,Pq.decodeCredentialPublicKey)(i):n&&(o=(0,Eq.convertX509PublicKeyToCOSE)(n)),dc._verifySignatureInternals.stubThis(Cq.isoCrypto.verify({cosePublicKey:o,signature:e,data:r,shaHashOverride:s}))}dc._verifySignatureInternals={stubThis:t=>t}});var BT=l(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});k0.parseJWT=xq;var IT=ae();function xq(t){let e=t.split(".");return[JSON.parse(IT.isoBase64URL.toUTF8String(e[0])),JSON.parse(IT.isoBase64URL.toUTF8String(e[1])),e[2]]}});var jT=l(j0=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});j0.verifyJWT=kq;var Oq=B0(),kT=ae(),N_=Qe(),Iq=lh(),Bq=ph();function kq(t,e){let[r,i,n]=t.split("."),s=(0,Oq.convertX509PublicKeyToCOSE)(e),o=kT.isoUint8Array.fromUTF8String(`${r}.${i}`),a=kT.isoBase64URL.toBuffer(n);if((0,N_.isCOSEPublicKeyEC2)(s))return(0,Iq.verifyEC2)({data:o,signature:a,cosePublicKey:s,shaHashOverride:N_.COSEALG.ES256});if((0,N_.isCOSEPublicKeyRSA)(s))return(0,Bq.verifyRSA)({data:o,signature:a,cosePublicKey:s});let c=s.get(N_.COSEKEYS.kty);throw new Error(`JWT verification with public key of kty ${c} is not supported by this method`)}});var MT=l(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.convertPEMToBytes=Mq;var jq=ae();function Mq(t){let e=t.replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/[\n ]/g,"");return jq.isoBase64URL.toBuffer(e,"base64")}});var NT=l(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.GlobalSign_Root_CA=void 0;q_.GlobalSign_Root_CA=`-----BEGIN CERTIFICATE-----
21
+ `)}};at.CertificateTag="CERTIFICATE";at.CrlTag="CRL";at.CertificateRequestTag="CERTIFICATE REQUEST";at.PublicKeyTag="PUBLIC KEY";at.PrivateKeyTag="PRIVATE KEY";var Dt=class t extends Ai{static isAsnEncoded(e){return O.BufferSourceConverter.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(at.isPem(e))return at.decode(e)[0];if(O.Convert.isHex(e))return O.Convert.FromHex(e);if(O.Convert.isBase64(e))return O.Convert.FromBase64(e);if(O.Convert.isBase64Url(e))return O.Convert.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{let r=O.BufferSourceConverter.toUint8Array(e);if(r.length>0&&r[0]===48)return O.BufferSourceConverter.toArrayBuffer(e);let i=O.Convert.ToBinary(e);if(at.isPem(i))return at.decode(i)[0];if(O.Convert.isHex(i))return O.Convert.FromHex(i);if(O.Convert.isBase64(i))return O.Convert.FromBase64(i);if(O.Convert.isBase64Url(i))return O.Convert.FromBase64Url(i);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){t.isAsnEncoded(e[0])?super(t.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){return e==="pem"?at.encode(this.rawData,this.tag):super.toString(e)}},Kr=class t extends Dt{static async create(e,r=Ie.get()){if(e instanceof t)return e;if(nc.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");let i=await r.subtle.exportKey("spki",e);return new t(i)}else{if(e.publicKey)return e.publicKey;if(O.BufferSourceConverter.isBufferSource(e))return new t(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){Dt.isAsnEncoded(e)?super(e,L.SubjectPublicKeyInfo):super(e),this.tag=at.PublicKeyTag}async export(...e){let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};e.length>1?(n=e[0]||n,i=e[1]||i,r=e[2]||Ie.get()):r=e[0]||Ie.get();let s=this.rawData,o=P.AsnConvert.parse(this.rawData,L.SubjectPublicKeyInfo);return o.algorithm.algorithm===Nt.id_RSASSA_PSS&&(s=uq(o,s)),r.subtle.importKey("spki",s,n,!0,i)}onInit(e){let r=Se.container.resolve(Vr),i=this.algorithm=r.toWebAlgorithm(e.algorithm);if(e.algorithm.algorithm===Nt.id_rsaEncryption){let n=P.AsnConvert.parse(e.subjectPublicKey,Nt.RSAPublicKey),s=O.BufferSourceConverter.toUint8Array(n.modulus);i.publicExponent=O.BufferSourceConverter.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3}}async getThumbprint(...e){var r;let i,n="SHA-1";return e.length>=1&&!(!((r=e[0])===null||r===void 0)&&r.subtle)?(n=e[0]||n,i=e[1]||Ie.get()):i=e[0]||Ie.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(...e){let r,i="SHA-1";e.length===1?typeof e[0]=="string"?(i=e[0],r=Ie.get()):r=e[0]:e.length===2?(i=e[0],r=e[1]):r=Ie.get();let n=P.AsnConvert.parse(this.rawData,L.SubjectPublicKeyInfo);return await r.subtle.digest(i,n.subjectPublicKey)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.AsnConvert.parse(this.rawData,L.SubjectPublicKeyInfo);switch(e.Algorithm=Gr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case C_.id_ecPublicKey:e["EC Point"]=r.subjectPublicKey;break;case Nt.id_rsaEncryption:default:e["Raw Data"]=r.subjectPublicKey}return e}};function uq(t,e){return t.algorithm=new L.AlgorithmIdentifier({algorithm:Nt.id_rsaEncryption,parameters:null}),e=P.AsnConvert.serialize(t),e}var mf=class t extends qt{static async create(e,r=!1,i=Ie.get()){if("name"in e&&"serialNumber"in e)return new t(e,r);let s=await(await Kr.create(e,i)).getKeyIdentifier(i);return new t(O.Convert.ToHex(s),r)}constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){let r=new C.AuthorityKeyIdentifier({keyIdentifier:new C.KeyIdentifier(O.Convert.FromHex(e[0]))});super(C.id_ce_authorityKeyIdentifier,e[1],P.AsnConvert.serialize(r))}else{let r=e[0],i=r.name instanceof vi?P.AsnConvert.parse(r.name.rawData,C.GeneralNames):r.name,n=new C.AuthorityKeyIdentifier({authorityCertIssuer:i,authorityCertSerialNumber:O.Convert.FromHex(r.serialNumber)});super(C.id_ce_authorityKeyIdentifier,e[1],P.AsnConvert.serialize(n))}}onInit(e){super.onInit(e);let r=P.AsnConvert.parse(e.extnValue,C.AuthorityKeyIdentifier);r.keyIdentifier&&(this.keyId=O.Convert.ToHex(r.keyIdentifier)),(r.authorityCertIssuer||r.authorityCertSerialNumber)&&(this.certId={name:r.authorityCertIssuer||[],serialNumber:r.authorityCertSerialNumber?O.Convert.ToHex(r.authorityCertSerialNumber):""})}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.AsnConvert.parse(this.value,C.AuthorityKeyIdentifier);return r.authorityCertIssuer&&(e["Authority Issuer"]=new vi(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(e["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(e[""]=r.keyIdentifier),e}};mf.NAME="Authority Key Identifier";var bf=class extends qt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.AsnConvert.parse(this.value,L.BasicConstraints);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{let r=new L.BasicConstraints({cA:e[0],pathLenConstraint:e[1]});super(L.id_ce_basicConstraints,e[2],P.AsnConvert.serialize(r)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}};bf.NAME="Basic Constraints";B.ExtendedKeyUsage=void 0;(function(t){t.serverAuth="1.3.6.1.5.5.7.3.1",t.clientAuth="1.3.6.1.5.5.7.3.2",t.codeSigning="1.3.6.1.5.5.7.3.3",t.emailProtection="1.3.6.1.5.5.7.3.4",t.timeStamping="1.3.6.1.5.5.7.3.8",t.ocspSigning="1.3.6.1.5.5.7.3.9"})(B.ExtendedKeyUsage||(B.ExtendedKeyUsage={}));var Sf=class extends qt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.AsnConvert.parse(this.value,C.ExtendedKeyUsage);this.usages=r.map(i=>i)}else{let r=new C.ExtendedKeyUsage(e[0]);super(C.id_ce_extKeyUsage,e[1],P.AsnConvert.serialize(r)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(r=>gr.toString(r)).join(", "),e}};Sf.NAME="Extended Key Usages";B.KeyUsageFlags=void 0;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(B.KeyUsageFlags||(B.KeyUsageFlags={}));var wf=class extends qt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.AsnConvert.parse(this.value,L.KeyUsage);this.usages=r.toNumber()}else{let r=new L.KeyUsage(e[0]);super(L.id_ce_keyUsage,e[1],P.AsnConvert.serialize(r)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.AsnConvert.parse(this.value,L.KeyUsage);return e[""]=r.toJSON().join(", "),e}};wf.NAME="Key Usages";var Cf=class t extends qt{static async create(e,r=!1,i=Ie.get()){let s=await(await Kr.create(e,i)).getKeyIdentifier(i);return new t(O.Convert.ToHex(s),r)}constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let r=P.AsnConvert.parse(this.value,C.SubjectKeyIdentifier);this.keyId=O.Convert.ToHex(r)}else{let r=typeof e[0]=="string"?O.Convert.FromHex(e[0]):e[0],i=new C.SubjectKeyIdentifier(r);super(C.id_ce_subjectKeyIdentifier,e[1],P.AsnConvert.serialize(i)),this.keyId=O.Convert.ToHex(r)}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=P.AsnConvert.parse(this.value,C.SubjectKeyIdentifier);return e[""]=r,e}};Cf.NAME="Subject Key Identifier";var Pf=class extends qt{constructor(...e){O.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(C.id_ce_subjectAltName,e[1],new vi(e[0]||[]).rawData)}onInit(e){super.onInit(e);let r=P.AsnConvert.parse(e.extnValue,C.SubjectAlternativeName);this.names=new vi(r)}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(let i in r)e[i]=r[i];return e}};Pf.NAME="Subject Alternative Name";var ct=class{static register(e,r){this.items.set(e,r)}static create(e){let r=new qt(e),i=this.items.get(r.type);return i?new i(e):r}};ct.items=new Map;var Ef=class extends qt{constructor(...e){var r;if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let i=P.AsnConvert.parse(this.value,C.CertificatePolicies);this.policies=i.map(n=>n.policyIdentifier)}else{let i=e[0],n=(r=e[1])!==null&&r!==void 0?r:!1,s=new C.CertificatePolicies(i.map(o=>new C.PolicyInformation({policyIdentifier:o})));super(C.id_ce_certificatePolicies,n,P.AsnConvert.serialize(s)),this.policies=i}}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(r=>new Z("",{},gr.toString(r))),e}};Ef.NAME="Certificate Policies";ct.register(C.id_ce_certificatePolicies,Ef);var Tf=class extends qt{constructor(...e){var r;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){let n=e[0].map(o=>new C.DistributionPoint({distributionPoint:new C.DistributionPointName({fullName:[new C.GeneralName({uniformResourceIdentifier:o})]})})),s=new C.CRLDistributionPoints(n);super(C.id_ce_cRLDistributionPoints,e[1],P.AsnConvert.serialize(s))}else{let i=new C.CRLDistributionPoints(e[0]);super(C.id_ce_cRLDistributionPoints,e[1],P.AsnConvert.serialize(i))}(r=this.distributionPoints)!==null&&r!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);let r=P.AsnConvert.parse(e.extnValue,C.CRLDistributionPoints);this.distributionPoints=r}toTextObject(){let e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(r=>{var i;let n={};return r.distributionPoint&&(n[""]=(i=r.distributionPoint.fullName)===null||i===void 0?void 0:i.map(s=>new Lr(s).toString()).join(", ")),r.reasons&&(n.Reasons=r.reasons.toString()),r.cRLIssuer&&(n["CRL Issuer"]=r.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}};Tf.NAME="CRL Distribution Points";var xf=class extends qt{constructor(...e){var r,i,n,s;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof C.AuthorityInfoAccessSyntax){let o=new C.AuthorityInfoAccessSyntax(e[0]);super(C.id_pe_authorityInfoAccess,e[1],P.AsnConvert.serialize(o))}else{let o=e[0],a=new C.AuthorityInfoAccessSyntax;d_(a,o,C.id_ad_ocsp,"ocsp"),d_(a,o,C.id_ad_caIssuers,"caIssuers"),d_(a,o,C.id_ad_timeStamping,"timeStamping"),d_(a,o,C.id_ad_caRepository,"caRepository"),super(C.id_pe_authorityInfoAccess,e[1],P.AsnConvert.serialize(a))}(r=this.ocsp)!==null&&r!==void 0||(this.ocsp=[]),(i=this.caIssuers)!==null&&i!==void 0||(this.caIssuers=[]),(n=this.timeStamping)!==null&&n!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],P.AsnConvert.parse(e.extnValue,C.AuthorityInfoAccessSyntax).forEach(i=>{switch(i.accessMethod){case C.id_ad_ocsp:this.ocsp.push(new Lr(i.accessLocation));break;case C.id_ad_caIssuers:this.caIssuers.push(new Lr(i.accessLocation));break;case C.id_ad_timeStamping:this.timeStamping.push(new Lr(i.accessLocation));break;case C.id_ad_caRepository:this.caRepository.push(new Lr(i.accessLocation));break}})}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ocsp.length&&f_(e,"OCSP",this.ocsp),this.caIssuers.length&&f_(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&f_(e,"Time Stamping",this.timeStamping),this.caRepository.length&&f_(e,"CA Repository",this.caRepository),e}};xf.NAME="Authority Info Access";function f_(t,e,r){if(r.length===1)t[e]=r[0].toTextObject();else{let i=new Z("");r.forEach((n,s)=>{let o=n.toTextObject(),a=`${o[Z.NAME]} ${s+1}`,c=i[a];Array.isArray(c)||(c=[],i[a]=c),c.push(o)}),t[e]=i}}function d_(t,e,r,i){let n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(o=>{typeof o=="string"&&(o=new Lr("url",o)),t.push(new C.AccessDescription({accessMethod:r,accessLocation:P.AsnConvert.parse(o.rawData,C.GeneralName)}))})}var Of=class extends qt{constructor(...e){O.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(C.id_ce_issuerAltName,e[1],new vi(e[0]||[]).rawData)}onInit(e){super.onInit(e);let r=P.AsnConvert.parse(e.extnValue,C.GeneralNames);this.names=new vi(r)}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(let i in r)e[i]=r[i];return e}};Of.NAME="Issuer Alternative Name";var to=class t extends Ai{constructor(...e){let r;if(O.BufferSourceConverter.isBufferSource(e[0]))r=O.BufferSourceConverter.toArrayBuffer(e[0]);else{let i=e[0],n=Array.isArray(e[1])?e[1].map(s=>O.BufferSourceConverter.toArrayBuffer(s)):[];r=P.AsnConvert.serialize(new L.Attribute({type:i,values:n}))}super(r,L.Attribute)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Value=this.values.map(r=>new Z("",{"":r})),e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty();return e[Z.NAME]===t.NAME&&(e[Z.NAME]=gr.toString(this.type)),e}};to.NAME="Attribute";var If=class extends to{constructor(...e){var r;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let i=new ic.ChallengePassword({printableString:e[0]});super(ic.id_pkcs9_at_challengePassword,[P.AsnConvert.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){let r=P.AsnConvert.parse(this.values[0],ic.ChallengePassword);this.password=r.toString()}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[Z.VALUE]=this.password,e}};If.NAME="Challenge Password";var oc=class extends to{constructor(...e){var r;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let i=e[0],n=new C.Extensions;for(let s of i)n.push(P.AsnConvert.parse(s.rawData,C.Extension));super(ic.id_pkcs9_at_extensionRequest,[P.AsnConvert.serialize(n)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){let r=P.AsnConvert.parse(this.values[0],C.Extensions);this.items=r.map(i=>ct.create(P.AsnConvert.serialize(i)))}}toTextObject(){let e=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(let i of r)e[i[Z.NAME]]=i;return e}};oc.NAME="Extensions";var ro=class{static register(e,r){this.items.set(e,r)}static create(e){let r=new to(e),i=this.items.get(r.type);return i?new i(e):r}};ro.items=new Map;var $i="crypto.signatureFormatter",x_=class{toAsnSignature(e,r){return O.BufferSourceConverter.toArrayBuffer(r)}toWebSignature(e,r){return O.BufferSourceConverter.toArrayBuffer(r)}},b_;B.RsaAlgorithm=b_=class{static createPssParams(e,r){let i=b_.getHashAlgorithm(e);return i?new be.RsaSaPssParams({hashAlgorithm:i,maskGenAlgorithm:new L.AlgorithmIdentifier({algorithm:be.id_mgf1,parameters:P.AsnConvert.serialize(i)}),saltLength:r}):null}static getHashAlgorithm(e){let r=Se.container.resolve(Vr);return typeof e=="string"?r.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?r.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let r;if(typeof e.hash=="string")r=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")r=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new L.AlgorithmIdentifier({algorithm:be.id_sha1WithRSAEncryption,parameters:null});case"sha-256":return new L.AlgorithmIdentifier({algorithm:be.id_sha256WithRSAEncryption,parameters:null});case"sha-384":return new L.AlgorithmIdentifier({algorithm:be.id_sha384WithRSAEncryption,parameters:null});case"sha-512":return new L.AlgorithmIdentifier({algorithm:be.id_sha512WithRSAEncryption,parameters:null})}}else return new L.AlgorithmIdentifier({algorithm:be.id_rsaEncryption,parameters:null});break;case"rsa-pss":if("hash"in e){if(!("saltLength"in e&&typeof e.saltLength=="number"))throw new Error("Cannot get 'saltLength' from 'alg' argument");let r=b_.createPssParams(e.hash,e.saltLength);if(!r)throw new Error("Cannot create PSS parameters");return new L.AlgorithmIdentifier({algorithm:be.id_RSASSA_PSS,parameters:P.AsnConvert.serialize(r)})}else return new L.AlgorithmIdentifier({algorithm:be.id_RSASSA_PSS,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case be.id_rsaEncryption:return{name:"RSASSA-PKCS1-v1_5"};case be.id_sha1WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case be.id_sha256WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case be.id_sha384WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case be.id_sha512WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case be.id_RSASSA_PSS:if(e.parameters){let r=P.AsnConvert.parse(e.parameters,be.RsaSaPssParams);return{name:"RSA-PSS",hash:Se.container.resolve(Vr).toWebAlgorithm(r.hashAlgorithm),saltLength:r.saltLength}}else return{name:"RSA-PSS"}}return null}};B.RsaAlgorithm=b_=E.__decorate([Se.injectable()],B.RsaAlgorithm);Se.container.registerSingleton(cc,B.RsaAlgorithm);B.ShaAlgorithm=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new L.AlgorithmIdentifier({algorithm:Nt.id_sha1});case"sha-256":return new L.AlgorithmIdentifier({algorithm:Nt.id_sha256});case"sha-384":return new L.AlgorithmIdentifier({algorithm:Nt.id_sha384});case"sha-512":return new L.AlgorithmIdentifier({algorithm:Nt.id_sha512})}return null}toWebAlgorithm(e){switch(e.algorithm){case Nt.id_sha1:return{name:"SHA-1"};case Nt.id_sha256:return{name:"SHA-256"};case Nt.id_sha384:return{name:"SHA-384"};case Nt.id_sha512:return{name:"SHA-512"}}return null}};B.ShaAlgorithm=E.__decorate([Se.injectable()],B.ShaAlgorithm);Se.container.registerSingleton(cc,B.ShaAlgorithm);var mi=class t{addPadding(e,r){let i=O.BufferSourceConverter.toUint8Array(r),n=new Uint8Array(e);return n.set(i,e-i.length),n.buffer}removePadding(e,r=!1){let i=O.BufferSourceConverter.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(r&&i[0]>127){let n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,r){if(e.name==="ECDSA"){let i=e.namedCurve,n=t.namedCurveSize.get(i)||t.defaultNamedCurveSize,s=new C_.ECDSASigValue,o=O.BufferSourceConverter.toUint8Array(r);return s.r=this.removePadding(o.slice(0,n),!0),s.s=this.removePadding(o.slice(n,n+n),!0),P.AsnConvert.serialize(s)}return null}toWebSignature(e,r){if(e.name==="ECDSA"){let i=P.AsnConvert.parse(r,C_.ECDSASigValue),n=e.namedCurve,s=t.namedCurveSize.get(n)||t.defaultNamedCurveSize,o=this.addPadding(s,this.removePadding(i.r)),a=this.addPadding(s,this.removePadding(i.s));return O.combine(o,a)}return null}};mi.namedCurveSize=new Map;mi.defaultNamedCurveSize=32;var S_="1.3.101.110",d0="1.3.101.111",w_="1.3.101.112",p0="1.3.101.113";B.EdAlgorithm=class{toAsnAlgorithm(e){let r=null;switch(e.name.toLowerCase()){case"ed25519":r=w_;break;case"x25519":r=S_;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":r=w_;break;case"ed448":r=p0;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":r=S_;break;case"x448":r=d0;break}}return r?new L.AlgorithmIdentifier({algorithm:r}):null}toWebAlgorithm(e){switch(e.algorithm){case w_:return{name:"Ed25519"};case p0:return{name:"EdDSA",namedCurve:"Ed448"};case S_:return{name:"X25519"};case d0:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};B.EdAlgorithm=E.__decorate([Se.injectable()],B.EdAlgorithm);Se.container.registerSingleton(cc,B.EdAlgorithm);var Fl,Hl,Wl,$l,zl,Yl,Jl,Qa,Bf=class extends Dt{get subjectName(){return E.__classPrivateFieldGet(this,Hl,"f")||E.__classPrivateFieldSet(this,Hl,new rt(this.asn.certificationRequestInfo.subject),"f"),E.__classPrivateFieldGet(this,Hl,"f")}get subject(){return E.__classPrivateFieldGet(this,Wl,"f")||E.__classPrivateFieldSet(this,Wl,this.subjectName.toString(),"f"),E.__classPrivateFieldGet(this,Wl,"f")}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,$l,"f")){let e=Se.container.resolve(Vr);E.__classPrivateFieldSet(this,$l,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,$l,"f")}get signature(){return E.__classPrivateFieldGet(this,zl,"f")||E.__classPrivateFieldSet(this,zl,this.asn.signature,"f"),E.__classPrivateFieldGet(this,zl,"f")}get publicKey(){return E.__classPrivateFieldGet(this,Yl,"f")||E.__classPrivateFieldSet(this,Yl,new Kr(this.asn.certificationRequestInfo.subjectPKInfo),"f"),E.__classPrivateFieldGet(this,Yl,"f")}get attributes(){return E.__classPrivateFieldGet(this,Jl,"f")||E.__classPrivateFieldSet(this,Jl,this.asn.certificationRequestInfo.attributes.map(e=>ro.create(P.AsnConvert.serialize(e))),"f"),E.__classPrivateFieldGet(this,Jl,"f")}get extensions(){if(!E.__classPrivateFieldGet(this,Qa,"f")){E.__classPrivateFieldSet(this,Qa,[],"f");let e=this.getAttribute(A0.id_pkcs9_at_extensionRequest);e instanceof oc&&E.__classPrivateFieldSet(this,Qa,e.items,"f")}return E.__classPrivateFieldGet(this,Qa,"f")}get tbs(){return E.__classPrivateFieldGet(this,Fl,"f")||E.__classPrivateFieldSet(this,Fl,this.asn.certificationRequestInfoRaw||P.AsnConvert.serialize(this.asn.certificationRequestInfo),"f"),E.__classPrivateFieldGet(this,Fl,"f")}constructor(e){let r=Dt.isAsnEncoded(e)?[e,P_.CertificationRequest]:[e];super(r[0],r[1]),Fl.set(this,void 0),Hl.set(this,void 0),Wl.set(this,void 0),$l.set(this,void 0),zl.set(this,void 0),Yl.set(this,void 0),Jl.set(this,void 0),Qa.set(this,void 0),this.tag=at.CertificateRequestTag}onInit(e){}getAttribute(e){for(let r of this.attributes)if(r.type===e)return r;return null}getAttributes(e){return this.attributes.filter(r=>r.type===e)}getExtension(e){for(let r of this.extensions)if(r.type===e)return r;return null}getExtensions(e){return this.extensions.filter(r=>r.type===e)}async verify(e=Ie.get()){let r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],e),n=Se.container.resolveAll($i).reverse(),s=null;for(let a of n)if(s=a.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.AsnConvert.parse(this.rawData,P_.CertificationRequest),i=r.certificationRequestInfo,n=new Z("",{Version:`${L.Version[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let s=new Z("");for(let o of this.attributes){let a=o.toTextObject();s[a[Z.NAME]]=a}n.Attributes=s}return e.Data=n,e.Signature=new Z("",{Algorithm:Gr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),e}};Fl=new WeakMap,Hl=new WeakMap,Wl=new WeakMap,$l=new WeakMap,zl=new WeakMap,Yl=new WeakMap,Jl=new WeakMap,Qa=new WeakMap;Bf.NAME="PKCS#10 Certificate Request";var y0=class{static async create(e,r=Ie.get()){if(!e.keys.privateKey)throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty");if(!e.keys.publicKey)throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty");let i=await r.subtle.exportKey("spki",e.keys.publicKey),n=new P_.CertificationRequest({certificationRequestInfo:new P_.CertificationRequestInfo({subjectPKInfo:P.AsnConvert.parse(i,L.SubjectPublicKeyInfo)})});if(e.name){let d=e.name instanceof rt?e.name:new rt(e.name);n.certificationRequestInfo.subject=P.AsnConvert.parse(d.toArrayBuffer(),L.Name)}if(e.attributes)for(let d of e.attributes)n.certificationRequestInfo.attributes.push(P.AsnConvert.parse(d.rawData,L.Attribute));if(e.extensions&&e.extensions.length){let d=new L.Attribute({type:A0.id_pkcs9_at_extensionRequest}),y=new L.Extensions;for(let m of e.extensions)y.push(P.AsnConvert.parse(m.rawData,L.Extension));d.values.push(P.AsnConvert.serialize(y)),n.certificationRequestInfo.attributes.push(d)}let s={...e.signingAlgorithm,...e.keys.privateKey.algorithm},o=Se.container.resolve(Vr);n.signatureAlgorithm=o.toAsnAlgorithm(s);let a=P.AsnConvert.serialize(n.certificationRequestInfo),c=await r.subtle.sign(s,e.keys.privateKey,a),u=Se.container.resolveAll($i).reverse(),f=null;for(let d of u)if(f=d.toAsnSignature(s,c),f)break;if(!f)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return n.signature=f,new Bf(P.AsnConvert.serialize(n))}},Ql,Xl,Zl,ef,tf,rf,nf,sf,of,af,Xa,cf,Pn=class extends Dt{get publicKey(){return E.__classPrivateFieldGet(this,cf,"f")||E.__classPrivateFieldSet(this,cf,new Kr(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),E.__classPrivateFieldGet(this,cf,"f")}get serialNumber(){if(!E.__classPrivateFieldGet(this,Xl,"f")){let e=this.asn.tbsCertificate,r=new Uint8Array(e.serialNumber);r.length>1&&r[0]===0&&r[1]>127&&(r=r.slice(1)),E.__classPrivateFieldSet(this,Xl,O.Convert.ToHex(r),"f")}return E.__classPrivateFieldGet(this,Xl,"f")}get subjectName(){return E.__classPrivateFieldGet(this,Zl,"f")||E.__classPrivateFieldSet(this,Zl,new rt(this.asn.tbsCertificate.subject),"f"),E.__classPrivateFieldGet(this,Zl,"f")}get subject(){return E.__classPrivateFieldGet(this,ef,"f")||E.__classPrivateFieldSet(this,ef,this.subjectName.toString(),"f"),E.__classPrivateFieldGet(this,ef,"f")}get issuerName(){return E.__classPrivateFieldGet(this,tf,"f")||E.__classPrivateFieldSet(this,tf,new rt(this.asn.tbsCertificate.issuer),"f"),E.__classPrivateFieldGet(this,tf,"f")}get issuer(){return E.__classPrivateFieldGet(this,rf,"f")||E.__classPrivateFieldSet(this,rf,this.issuerName.toString(),"f"),E.__classPrivateFieldGet(this,rf,"f")}get notBefore(){if(!E.__classPrivateFieldGet(this,nf,"f")){let e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");E.__classPrivateFieldSet(this,nf,e,"f")}return E.__classPrivateFieldGet(this,nf,"f")}get notAfter(){if(!E.__classPrivateFieldGet(this,sf,"f")){let e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");E.__classPrivateFieldSet(this,sf,e,"f")}return E.__classPrivateFieldGet(this,sf,"f")}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,of,"f")){let e=Se.container.resolve(Vr);E.__classPrivateFieldSet(this,of,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,of,"f")}get signature(){return E.__classPrivateFieldGet(this,af,"f")||E.__classPrivateFieldSet(this,af,this.asn.signatureValue,"f"),E.__classPrivateFieldGet(this,af,"f")}get extensions(){return E.__classPrivateFieldGet(this,Xa,"f")||(E.__classPrivateFieldSet(this,Xa,[],"f"),this.asn.tbsCertificate.extensions&&E.__classPrivateFieldSet(this,Xa,this.asn.tbsCertificate.extensions.map(e=>ct.create(P.AsnConvert.serialize(e))),"f")),E.__classPrivateFieldGet(this,Xa,"f")}get tbs(){return E.__classPrivateFieldGet(this,Ql,"f")||E.__classPrivateFieldSet(this,Ql,this.asn.tbsCertificateRaw||P.AsnConvert.serialize(this.asn.tbsCertificate),"f"),E.__classPrivateFieldGet(this,Ql,"f")}constructor(e){let r=Dt.isAsnEncoded(e)?[e,L.Certificate]:[e];super(r[0],r[1]),Ql.set(this,void 0),Xl.set(this,void 0),Zl.set(this,void 0),ef.set(this,void 0),tf.set(this,void 0),rf.set(this,void 0),nf.set(this,void 0),sf.set(this,void 0),of.set(this,void 0),af.set(this,void 0),Xa.set(this,void 0),cf.set(this,void 0),this.tag=at.CertificateTag}onInit(e){}getExtension(e){for(let r of this.extensions)if(typeof e=="string"){if(r.type===e)return r}else if(r instanceof e)return r;return null}getExtensions(e){return this.extensions.filter(r=>typeof e=="string"?r.type===e:r instanceof e)}async verify(e={},r=Ie.get()){let i,n,s=e.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],r);else if(s instanceof Kr)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],r);else if(O.BufferSourceConverter.isBufferSource(s)){let u=new Kr(s);i={...u.algorithm,...this.signatureAlgorithm},n=await u.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}let o=Se.container.resolveAll($i).reverse(),a=null;for(let u of o)if(a=u.toWebSignature(i,this.signature),a)break;if(!a)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");let c=await r.subtle.verify(this.signatureAlgorithm,n,a,this.tbs);if(e.signatureOnly)return c;{let f=(e.date||new Date).getTime();return c&&this.notBefore.getTime()<f&&f<this.notAfter.getTime()}}async getThumbprint(...e){let r,i="SHA-1";return e[0]&&(e[0].subtle?r=e[0]:(i=e[0]||i,r=e[1])),r??(r=Ie.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(e=Ie.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){let e=this.toTextObjectEmpty(),r=P.AsnConvert.parse(this.rawData,L.Certificate),i=r.tbsCertificate,n=new Z("",{Version:`${L.Version[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Gr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new Z("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){let s=new Z("");for(let o of this.extensions){let a=o.toTextObject();s[a[Z.NAME]]=a}n.Extensions=s}return e.Data=n,e.Signature=new Z("",{Algorithm:Gr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),e}};Ql=new WeakMap,Xl=new WeakMap,Zl=new WeakMap,ef=new WeakMap,tf=new WeakMap,rf=new WeakMap,nf=new WeakMap,sf=new WeakMap,of=new WeakMap,af=new WeakMap,Xa=new WeakMap,cf=new WeakMap;Pn.NAME="Certificate";var O_=class extends Array{constructor(e){if(super(),Dt.isAsnEncoded(e))this.import(e);else if(e instanceof Pn)this.push(e);else if(Array.isArray(e))for(let r of e)this.push(r)}export(e){let r=new Mt.SignedData;r.version=1,r.encapContentInfo.eContentType=Mt.id_data,r.encapContentInfo.eContent=new Mt.EncapsulatedContent({single:new P.OctetString}),r.certificates=new Mt.CertificateSet(this.map(s=>new Mt.CertificateChoices({certificate:P.AsnConvert.parse(s.rawData,L.Certificate)})));let i=new Mt.ContentInfo({contentType:Mt.id_signedData,content:P.AsnConvert.serialize(r)}),n=P.AsnConvert.serialize(i);return e==="raw"?n:this.toString(e)}import(e){let r=Dt.toArrayBuffer(e),i=P.AsnConvert.parse(r,Mt.ContentInfo);if(i.contentType!==Mt.id_signedData)throw new TypeError("Cannot parse CMS package. Incoming data is not a SignedData object.");let n=P.AsnConvert.parse(i.content,Mt.SignedData);this.clear();for(let s of n.certificates||[])s.certificate&&this.push(new Pn(s.certificate))}clear(){for(;this.pop(););}toString(e="pem"){let r=this.export("raw");switch(e){case"pem":return at.encode(r,"CMS");case"pem-chain":return this.map(i=>i.toString("pem")).join(`
22
+ `);case"asn":return P.AsnConvert.toString(r);case"hex":return O.Convert.ToHex(r);case"base64":return O.Convert.ToBase64(r);case"base64url":return O.Convert.ToBase64Url(r);case"text":return Gr.serialize(this.toTextObject());default:throw TypeError("Argument 'format' is unsupported value")}}toTextObject(){let e=P.AsnConvert.parse(this.export("raw"),Mt.ContentInfo),r=P.AsnConvert.parse(e.content,Mt.SignedData);return new Z("X509Certificates",{"Content Type":gr.toString(e.contentType),Content:new Z("",{Version:`${Mt.CMSVersion[r.version]} (${r.version})`,Certificates:new Z("",{Certificate:this.map(n=>n.toTextObject())})})})}},_0=class{constructor(e={}){this.certificates=[],e.certificates&&(this.certificates=e.certificates)}async build(e,r=Ie.get()){let i=new O_(e),n=e;for(;n=await this.findIssuer(n,r);){let s=await n.getThumbprint(r);for(let o of i){let a=await o.getThumbprint(r);if(O.isEqual(s,a))throw new Error("Cannot build a certificate chain. Circular dependency.")}i.push(n)}return i}async findIssuer(e,r=Ie.get()){if(!await e.isSelfSigned(r)){let i=e.getExtension(C.id_ce_authorityKeyIdentifier);for(let n of this.certificates)if(n.subject===e.issuer){if(i){if(i.keyId){let s=n.getExtension(C.id_ce_subjectKeyIdentifier);if(s&&s.keyId!==i.keyId)continue}else if(i.certId){let s=n.getExtension(C.id_ce_subjectAltName);if(s&&!(i.certId.serialNumber===n.serialNumber&&O.isEqual(P.AsnConvert.serialize(i.certId.name),P.AsnConvert.serialize(s))))continue}}try{let s={...n.publicKey.algorithm,...e.signatureAlgorithm},o=await n.publicKey.export(s,["verify"],r);if(!await e.verify({publicKey:o,signatureOnly:!0},r))continue}catch{continue}return n}}return null}};function v0(t,e=Ie.get()){let r=O.BufferSourceConverter.toUint8Array(O.Convert.FromHex(t||"")),i=r&&r.length&&r.some(s=>s>0)?new Uint8Array(r):void 0;i||(i=e.getRandomValues(new Uint8Array(16)));let n=0;for(;n<i.length-1&&i[n]===0;)n++;if(i=i.slice(n),i[0]>127){let s=new Uint8Array(i.length+1);s[0]=0,s.set(i,1),i=s}return i.buffer}var h0=class{static async createSelfSigned(e,r=Ie.get()){if(!e.keys.privateKey)throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty");if(!e.keys.publicKey)throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty");return this.create({serialNumber:e.serialNumber,subject:e.name,issuer:e.name,notBefore:e.notBefore,notAfter:e.notAfter,publicKey:e.keys.publicKey,signingKey:e.keys.privateKey,signingAlgorithm:e.signingAlgorithm,extensions:e.extensions},r)}static async create(e,r=Ie.get()){var i;let n;e.publicKey instanceof Kr?n=e.publicKey.rawData:"publicKey"in e.publicKey?n=e.publicKey.publicKey.rawData:O.BufferSourceConverter.isBufferSource(e.publicKey)?n=e.publicKey:n=await r.subtle.exportKey("spki",e.publicKey);let s=v0(e.serialNumber,r),o=e.notBefore||new Date,a=e.notAfter||new Date(o.getTime()+31536e6),c=new C.Certificate({tbsCertificate:new C.TBSCertificate({version:C.Version.v3,serialNumber:s,validity:new C.Validity({notBefore:o,notAfter:a}),extensions:new C.Extensions(((i=e.extensions)===null||i===void 0?void 0:i.map(I=>P.AsnConvert.parse(I.rawData,C.Extension)))||[]),subjectPublicKeyInfo:P.AsnConvert.parse(n,C.SubjectPublicKeyInfo)})});if(e.subject){let I=e.subject instanceof rt?e.subject:new rt(e.subject);c.tbsCertificate.subject=P.AsnConvert.parse(I.toArrayBuffer(),C.Name)}if(e.issuer){let I=e.issuer instanceof rt?e.issuer:new rt(e.issuer);c.tbsCertificate.issuer=P.AsnConvert.parse(I.toArrayBuffer(),C.Name)}let u={hash:"SHA-256"},f="signingKey"in e?{...u,...e.signingAlgorithm,...e.signingKey.algorithm}:{...u,...e.signingAlgorithm},d=Se.container.resolve(Vr);c.tbsCertificate.signature=c.signatureAlgorithm=d.toAsnAlgorithm(f);let y=P.AsnConvert.serialize(c.tbsCertificate),m="signingKey"in e?await r.subtle.sign(f,e.signingKey,y):e.signature,x=Se.container.resolveAll($i).reverse(),T=null;for(let I of x)if(T=I.toAsnSignature(f,m),T)break;if(!T)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return c.signatureValue=T,new Pn(P.AsnConvert.serialize(c))}},uf,lf,Za,ec,tc;B.X509CrlReason=void 0;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(B.X509CrlReason||(B.X509CrlReason={}));var ac=class extends Ai{get serialNumber(){return E.__classPrivateFieldGet(this,uf,"f")||E.__classPrivateFieldSet(this,uf,O.Convert.ToHex(this.asn.userCertificate),"f"),E.__classPrivateFieldGet(this,uf,"f")}get revocationDate(){return E.__classPrivateFieldGet(this,lf,"f")||E.__classPrivateFieldSet(this,lf,this.asn.revocationDate.getTime(),"f"),E.__classPrivateFieldGet(this,lf,"f")}get reason(){return E.__classPrivateFieldGet(this,Za,"f")===void 0&&this.extensions,E.__classPrivateFieldGet(this,Za,"f")}get invalidity(){return E.__classPrivateFieldGet(this,ec,"f")===void 0&&this.extensions,E.__classPrivateFieldGet(this,ec,"f")}get extensions(){return E.__classPrivateFieldGet(this,tc,"f")||(E.__classPrivateFieldSet(this,tc,[],"f"),this.asn.crlEntryExtensions&&E.__classPrivateFieldSet(this,tc,this.asn.crlEntryExtensions.map(e=>{let r=ct.create(P.AsnConvert.serialize(e));switch(r.type){case L.id_ce_cRLReasons:E.__classPrivateFieldGet(this,Za,"f")===void 0&&E.__classPrivateFieldSet(this,Za,P.AsnConvert.parse(r.value,L.CRLReason).reason,"f");break;case L.id_ce_invalidityDate:E.__classPrivateFieldGet(this,ec,"f")===void 0&&E.__classPrivateFieldSet(this,ec,P.AsnConvert.parse(r.value,L.InvalidityDate).value,"f");break}return r}),"f")),E.__classPrivateFieldGet(this,tc,"f")}constructor(...e){let r;if(O.BufferSourceConverter.isBufferSource(e[0])?r=O.BufferSourceConverter.toArrayBuffer(e[0]):typeof e[0]=="string"?r=P.AsnConvert.serialize(new L.RevokedCertificate({userCertificate:v0(e[0]),revocationDate:new L.Time(e[1]),crlEntryExtensions:e[2]})):e[0]instanceof L.RevokedCertificate&&(r=e[0]),!r)throw new TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments.");super(r,L.RevokedCertificate),uf.set(this,void 0),lf.set(this,void 0),Za.set(this,void 0),ec.set(this,void 0),tc.set(this,void 0)}onInit(e){}};uf=new WeakMap,lf=new WeakMap,Za=new WeakMap,ec=new WeakMap,tc=new WeakMap;var ff,df,pf,yf,_f,hf,rc,I_=class extends Dt{get version(){return this.asn.tbsCertList.version}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,df,"f")){let e=Se.container.resolve(Vr);E.__classPrivateFieldSet(this,df,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,df,"f")}get signature(){return this.asn.signature}get issuer(){return this.issuerName.toString()}get issuerName(){return E.__classPrivateFieldGet(this,pf,"f")||E.__classPrivateFieldSet(this,pf,new rt(this.asn.tbsCertList.issuer),"f"),E.__classPrivateFieldGet(this,pf,"f")}get thisUpdate(){if(!E.__classPrivateFieldGet(this,yf,"f")){let e=this.asn.tbsCertList.thisUpdate.getTime();if(!e)throw new Error("Cannot get 'thisUpdate' value");E.__classPrivateFieldSet(this,yf,e,"f")}return E.__classPrivateFieldGet(this,yf,"f")}get nextUpdate(){var e;return E.__classPrivateFieldGet(this,_f,"f")===void 0&&E.__classPrivateFieldSet(this,_f,((e=this.asn.tbsCertList.nextUpdate)===null||e===void 0?void 0:e.getTime())||void 0,"f"),E.__classPrivateFieldGet(this,_f,"f")}get entries(){var e;return E.__classPrivateFieldGet(this,hf,"f")||E.__classPrivateFieldSet(this,hf,((e=this.asn.tbsCertList.revokedCertificates)===null||e===void 0?void 0:e.map(r=>new ac(r)))||[],"f"),E.__classPrivateFieldGet(this,hf,"f")}get extensions(){return E.__classPrivateFieldGet(this,rc,"f")||(E.__classPrivateFieldSet(this,rc,[],"f"),this.asn.tbsCertList.crlExtensions&&E.__classPrivateFieldSet(this,rc,this.asn.tbsCertList.crlExtensions.map(e=>ct.create(P.AsnConvert.serialize(e))),"f")),E.__classPrivateFieldGet(this,rc,"f")}get tbs(){return E.__classPrivateFieldGet(this,ff,"f")||E.__classPrivateFieldSet(this,ff,this.asn.tbsCertListRaw||P.AsnConvert.serialize(this.asn.tbsCertList),"f"),E.__classPrivateFieldGet(this,ff,"f")}get tbsCertListSignatureAlgorithm(){return this.asn.tbsCertList.signature}get certListSignatureAlgorithm(){return this.asn.signatureAlgorithm}constructor(e){super(e,Dt.isAsnEncoded(e)?L.CertificateList:void 0),this.tag=at.CrlTag,ff.set(this,void 0),df.set(this,void 0),pf.set(this,void 0),yf.set(this,void 0),_f.set(this,void 0),hf.set(this,void 0),rc.set(this,void 0)}onInit(e){}getExtension(e){for(let r of this.extensions)if(typeof e=="string"){if(r.type===e)return r}else if(r instanceof e)return r;return null}getExtensions(e){return this.extensions.filter(r=>typeof e=="string"?r.type===e:r instanceof e)}async verify(e,r=Ie.get()){if(!this.certListSignatureAlgorithm.isEqual(this.tbsCertListSignatureAlgorithm))throw new Error("algorithm identifier in the sequence tbsCertList and CertificateList mismatch");let i,n,s=e.publicKey;try{s instanceof Pn?(i={...s.publicKey.algorithm,...s.signatureAlgorithm},n=await s.publicKey.export(i,["verify"])):s instanceof Kr?(i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"])):(i={...s.algorithm,...this.signatureAlgorithm},n=s)}catch{return!1}let o=Se.container.resolveAll($i).reverse(),a=null;for(let c of o)if(a=c.toWebSignature(i,this.signature),a)break;if(!a)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return await r.subtle.verify(this.signatureAlgorithm,n,a,this.tbs)}async getThumbprint(...e){let r,i="SHA-1";return e[0]&&(e[0].subtle?r=e[0]:(i=e[0]||i,r=e[1])),r??(r=Ie.get()),await r.subtle.digest(i,this.rawData)}findRevoked(e){let r=typeof e=="string"?e:e.serialNumber,i=v0(r);for(let n of this.asn.tbsCertList.revokedCertificates||[])if(O.BufferSourceConverter.isEqual(n.userCertificate,i))return new ac(P.AsnConvert.serialize(n));return null}};ff=new WeakMap,df=new WeakMap,pf=new WeakMap,yf=new WeakMap,_f=new WeakMap,hf=new WeakMap,rc=new WeakMap;var g0=class{static async create(e,r=Ie.get()){var i;let n=e.issuer instanceof rt?e.issuer:new rt(e.issuer),s=new C.CertificateList({tbsCertList:new C.TBSCertList({version:C.Version.v2,issuer:P.AsnConvert.parse(n.toArrayBuffer(),C.Name),thisUpdate:new L.Time(e.thisUpdate||new Date)})});if(e.nextUpdate&&(s.tbsCertList.nextUpdate=new L.Time(e.nextUpdate)),e.extensions&&e.extensions.length&&(s.tbsCertList.crlExtensions=new C.Extensions(e.extensions.map(y=>P.AsnConvert.parse(y.rawData,C.Extension))||[])),e.entries&&e.entries.length){s.tbsCertList.revokedCertificates=[];for(let y of e.entries){let m=Dt.toArrayBuffer(y.serialNumber);if(s.tbsCertList.revokedCertificates.findIndex(I=>O.isEqual(I.userCertificate,m))>-1)throw new Error(`Certificate serial number ${y.serialNumber} already exists in tbsCertList`);let T=new L.RevokedCertificate({userCertificate:m,revocationDate:new L.Time(y.revocationDate||new Date)});if("extensions"in y&&(!((i=y.extensions)===null||i===void 0)&&i.length)?T.crlEntryExtensions=y.extensions.map(I=>P.AsnConvert.parse(I.rawData,C.Extension)):T.crlEntryExtensions=[],!(y instanceof ac)&&(y.reason&&T.crlEntryExtensions.push(new C.Extension({extnID:C.id_ce_cRLReasons,critical:!1,extnValue:new P.OctetString(P.AsnConvert.serialize(new C.CRLReason(y.reason)))})),y.invalidity&&T.crlEntryExtensions.push(new C.Extension({extnID:C.id_ce_invalidityDate,critical:!1,extnValue:new P.OctetString(P.AsnConvert.serialize(new C.InvalidityDate(y.invalidity)))})),y.issuer)){let I=e.issuer instanceof rt?e.issuer:new rt(e.issuer);T.crlEntryExtensions.push(new C.Extension({extnID:C.id_ce_certificateIssuer,critical:!1,extnValue:new P.OctetString(P.AsnConvert.serialize(P.AsnConvert.parse(I.toArrayBuffer(),C.Name)))}))}s.tbsCertList.revokedCertificates.push(T)}}let o={...e.signingAlgorithm,...e.signingKey.algorithm},a=Se.container.resolve(Vr);s.tbsCertList.signature=s.signatureAlgorithm=a.toAsnAlgorithm(o);let c=P.AsnConvert.serialize(s.tbsCertList),u=await r.subtle.sign(o,e.signingKey,c),f=Se.container.resolveAll($i).reverse(),d=null;for(let y of f)if(d=y.toAsnSignature(o,u),d)break;if(!d)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return s.signature=d,new I_(P.AsnConvert.serialize(s))}};ct.register(C.id_ce_basicConstraints,bf);ct.register(C.id_ce_extKeyUsage,Sf);ct.register(C.id_ce_keyUsage,wf);ct.register(C.id_ce_subjectKeyIdentifier,Cf);ct.register(C.id_ce_authorityKeyIdentifier,mf);ct.register(C.id_ce_subjectAltName,Pf);ct.register(C.id_ce_cRLDistributionPoints,Tf);ct.register(C.id_pe_authorityInfoAccess,xf);ct.register(C.id_ce_issuerAltName,Of);ro.register(ic.id_pkcs9_at_challengePassword,If);ro.register(ic.id_pkcs9_at_extensionRequest,oc);Se.container.registerSingleton($i,x_);Se.container.registerSingleton($i,mi);mi.namedCurveSize.set("P-256",32);mi.namedCurveSize.set("K-256",32);mi.namedCurveSize.set("P-384",48);mi.namedCurveSize.set("P-521",66);B.AlgorithmProvider=E_;B.AsnData=Ai;B.AsnDefaultSignatureFormatter=x_;B.AsnEcSignatureFormatter=mi;B.Attribute=to;B.AttributeFactory=ro;B.AuthorityInfoAccessExtension=xf;B.AuthorityKeyIdentifierExtension=mf;B.BasicConstraintsExtension=bf;B.CRLDistributionPointsExtension=Tf;B.CertificatePolicyExtension=Ef;B.ChallengePasswordAttribute=If;B.CryptoProvider=nc;B.DN=__;B.DNS=y_;B.DefaultAlgorithmSerializer=T_;B.EMAIL=h_;B.ExtendedKeyUsageExtension=Sf;B.Extension=qt;B.ExtensionFactory=ct;B.ExtensionsAttribute=oc;B.GUID=v_;B.GeneralName=Lr;B.GeneralNames=vi;B.IP=g_;B.IssuerAlternativeNameExtension=Of;B.KeyUsagesExtension=wf;B.Name=rt;B.NameIdentifier=Af;B.OidSerializer=gr;B.PemConverter=at;B.PemData=Dt;B.Pkcs10CertificateRequest=Bf;B.Pkcs10CertificateRequestGenerator=y0;B.PublicKey=Kr;B.REGISTERED_ID=Gl;B.SubjectAlternativeNameExtension=Pf;B.SubjectKeyIdentifierExtension=Cf;B.TextConverter=Gr;B.TextObject=Z;B.UPN=m_;B.URL=A_;B.X509Certificate=Pn;B.X509CertificateGenerator=h0;B.X509Certificates=O_;B.X509ChainBuilder=_0;B.X509Crl=I_;B.X509CrlEntry=ac;B.X509CrlGenerator=g0;B.cryptoProvider=Ie;B.diAlgorithm=cc;B.diAlgorithmProvider=Vr;B.diAsnSignatureFormatter=$i;B.idEd25519=w_;B.idEd448=p0;B.idX25519=S_;B.idX448=d0});var b0=l(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc._fetchInternals=void 0;uc.fetch=lq;function lq(t){return uc._fetchInternals.stubThis(t)}uc._fetchInternals={stubThis:t=>globalThis.fetch(t)}});var w0=l(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});S0.isCertRevoked=dq;var B_=m0(),fq=b0(),bT={};async function dq(t){let{extensions:e}=t;if(!e)return!1;let r,i,n;e.forEach(d=>{d instanceof B_.AuthorityKeyIdentifierExtension?r=d:d instanceof B_.SubjectKeyIdentifierExtension?i=d:d instanceof B_.CRLDistributionPointsExtension&&(n=d)});let s;if(r&&r.keyId?s=r.keyId:i&&(s=i.keyId),s){let d=bT[s];if(d){let y=new Date;if(!d.nextUpdate||d.nextUpdate>y)return d.revokedCerts.indexOf(t.serialNumber)>=0}}let o=n?.distributionPoints?.[0].distributionPoint?.fullName?.[0].uniformResourceIdentifier;if(!o)return!1;let a;try{a=await(await(0,fq.fetch)(o)).arrayBuffer()}catch{return!1}let c;try{c=new B_.X509Crl(a)}catch{return!1}let u={revokedCerts:[],nextUpdate:void 0};c.nextUpdate&&(u.nextUpdate=c.nextUpdate);let f=c.entries;if(f){for(let d of f){let y=d.serialNumber;u.revokedCerts.push(y)}return s&&(bT[s]=u),u.revokedCerts.indexOf(t.serialNumber)>=0}return!1}});var wT=l(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});C0.decodeAuthenticatorExtensions=yq;var pq=ae();function yq(t){let e;try{e=pq.isoCBOR.decodeFirst(t)}catch(r){let i=r;throw new Error(`Error decoding authenticator extensions: ${i.message}`)}return ST(e)}function ST(t){let e={};for(let[r,i]of t)i instanceof Map?e[r]=ST(i):e[r]=i;return e}});var k_=l(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc._parseAuthenticatorDataInternals=void 0;lc.parseAuthenticatorData=hq;var _q=wT(),io=ae();function hq(t){if(t.byteLength<37)throw new Error(`Authenticator data was ${t.byteLength} bytes, expected at least 37 bytes`);let e=0,r=io.isoUint8Array.toDataView(t),i=t.slice(e,e+=32),n=t.slice(e,e+=1),s=n[0],o={up:!!(s&1),uv:!!(s&4),be:!!(s&8),bs:!!(s&16),at:!!(s&64),ed:!!(s&128),flagsInt:s},a=t.slice(e,e+4),c=r.getUint32(e,!1);e+=4;let u,f,d;if(o.at){u=t.slice(e,e+=16);let x=r.getUint16(e);e+=2,f=t.slice(e,e+=x);let T=io.isoUint8Array.fromHex("a301634f4b500327206745643235353139"),I=t.slice(e,e+T.byteLength),U=!1;io.isoUint8Array.areEqual(T,I)&&(U=!0,t[e]=164);let ee=io.isoCBOR.decodeFirst(t.slice(e)),pe=Uint8Array.from(io.isoCBOR.encode(ee));U&&(t[e]=163),d=pe,e+=pe.byteLength}let y,m;if(o.ed){let x=io.isoCBOR.decodeFirst(t.slice(e));m=Uint8Array.from(io.isoCBOR.encode(x)),y=(0,_q.decodeAuthenticatorExtensions)(m),e+=m.byteLength}if(t.byteLength>e)throw new Error("Leftover bytes detected while parsing authenticator data");return lc._parseAuthenticatorDataInternals.stubThis({rpIdHash:i,flagsBuf:n,flags:o,counter:c,counterBuf:a,aaguid:u,credentialID:f,credentialPublicKey:d,extensionsData:y,extensionsDataBuffer:m})}lc._parseAuthenticatorDataInternals={stubThis:t=>t}});var En=l(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.toHash=gq;var CT=ae();function gq(t,e=-7){return typeof t=="string"&&(t=CT.isoUint8Array.fromUTF8String(t)),CT.isoCrypto.digest(t,e)}});var bi=l(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});x0.validateCertificatePath=vq;var E0=m0(),Aq=w0();async function vq(t,e=[]){if(e.length===0)return!0;let r=t.map(o=>new E0.X509Certificate(o));for(let o=0;o<r.length;o++){let a=r[o],c=t[o];try{await PT(a)}catch{throw new Error(`Found revoked certificate in x5c:
23
+ ${c}`)}try{ET(a.notBefore,a.notAfter)}catch{throw new Error(`Found certificate out of validity period in x5c:
24
+ ${c}`)}}let i=e.map(o=>{try{return new E0.X509Certificate(o)}catch(a){let c=a;throw new Error(`Could not parse trust anchor certificate:
25
+ ${o}`,{cause:c})}}),n=[];for(let o=0;o<i.length;o++){let a=i[o];try{await PT(a)}catch{continue}try{ET(a.notBefore,a.notAfter)}catch{continue}n.push(a)}if(n.length===0)throw new Error("No specified trust anchor was valid for verifying x5c");let s=!0;for(let o of n)try{let a=r.concat([o]),c=new Set(a.map(m=>m.toString("pem"))).size;if(c!==a.length)throw new Error("Invalid certificate path: found duplicate certificates");let u=r[0],f=[];r.length>1&&(f=r.slice(1));let y=await new E0.X509ChainBuilder({certificates:[...f,o]}).build(u);if(y.length<c||y[y.length-1].subject!==o.subject)continue;s=!1;break}catch(a){throw new Error("Unexpected error while validating certificate path",{cause:a})}if(s)throw new T0;return!0}async function PT(t){if(await(0,Aq.isCertRevoked)(t))throw new Error("Found revoked certificate in certificate path")}function ET(t,e){let r=new Date(Date.now());if(t>r||e<r)throw new Error("Certificate is not yet valid or expired")}var T0=class extends Error{constructor(){super("x5c could not be chained to any specified trust anchor"),this.name="InvalidX5CChain"}}});var TT=l(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.mapX509SignatureAlgToCOSEAlg=mq;var no=Qe();function mq(t){let e;if(t==="1.2.840.10045.4.3.2")e=no.COSEALG.ES256;else if(t==="1.2.840.10045.4.3.3")e=no.COSEALG.ES384;else if(t==="1.2.840.10045.4.3.4")e=no.COSEALG.ES512;else if(t==="1.2.840.113549.1.1.11")e=no.COSEALG.RS256;else if(t==="1.2.840.113549.1.1.12")e=no.COSEALG.RS384;else if(t==="1.2.840.113549.1.1.13")e=no.COSEALG.RS512;else if(t==="1.2.840.113549.1.1.5")e=no.COSEALG.RS1;else throw new Error(`Unable to map X.509 signature algorithm ${t} to a COSE algorithm`);return e}});var k0=l(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.convertX509PublicKeyToCOSE=Sq;var I0=S(),bq=X(),j_=yy(),xT=wy(),Zt=Qe(),OT=TT();function Sq(t){let e=new Map,r=I0.AsnParser.parse(t,bq.Certificate),{tbsCertificate:i}=r,{subjectPublicKeyInfo:n,signature:s}=i,o=s.algorithm,a=n.algorithm.algorithm;if(a===j_.id_ecPublicKey){if(!n.algorithm.parameters)throw new Error("Certificate public key was missing parameters (EC2)");let c=I0.AsnParser.parse(new Uint8Array(n.algorithm.parameters),j_.ECParameters),u=-999,{namedCurve:f}=c;if(f===j_.id_secp256r1)u=Zt.COSECRV.P256;else if(f===j_.id_secp384r1)u=Zt.COSECRV.P384;else throw new Error(`Certificate public key contained unexpected namedCurve ${f} (EC2)`);let d=new Uint8Array(n.subjectPublicKey),y,m;if(d[0]===4){let T=1,I=(d.length-1)/2;y=d.slice(T,T+=I),m=d.slice(T)}else throw new Error('TODO: Figure out how to handle public keys in "compressed form"');let x=new Map;x.set(Zt.COSEKEYS.kty,Zt.COSEKTY.EC2),x.set(Zt.COSEKEYS.alg,(0,OT.mapX509SignatureAlgToCOSEAlg)(o)),x.set(Zt.COSEKEYS.crv,u),x.set(Zt.COSEKEYS.x,y),x.set(Zt.COSEKEYS.y,m),e=x}else if(a===xT.id_rsaEncryption){let c=I0.AsnParser.parse(n.subjectPublicKey,xT.RSAPublicKey),u=new Map;u.set(Zt.COSEKEYS.kty,Zt.COSEKTY.RSA),u.set(Zt.COSEKEYS.alg,(0,OT.mapX509SignatureAlgToCOSEAlg)(o)),u.set(Zt.COSEKEYS.n,new Uint8Array(c.modulus)),u.set(Zt.COSEKEYS.e,new Uint8Array(c.publicExponent)),e=u}else throw new Error(`Certificate public key contained unexpected algorithm ID ${a}`);return e}});var Tn=l(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc._verifySignatureInternals=void 0;fc.verifySignature=Eq;var wq=ae(),Cq=vo(),Pq=k0();function Eq(t){let{signature:e,data:r,credentialPublicKey:i,x509Certificate:n,hashAlgorithm:s}=t;if(!n&&!i)throw new Error('Must declare either "leafCert" or "credentialPublicKey"');if(n&&i)throw new Error('Must not declare both "leafCert" and "credentialPublicKey"');let o=new Map;return i?o=(0,Cq.decodeCredentialPublicKey)(i):n&&(o=(0,Pq.convertX509PublicKeyToCOSE)(n)),fc._verifySignatureInternals.stubThis(wq.isoCrypto.verify({cosePublicKey:o,signature:e,data:r,shaHashOverride:s}))}fc._verifySignatureInternals={stubThis:t=>t}});var BT=l(j0=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});j0.parseJWT=Tq;var IT=ae();function Tq(t){let e=t.split(".");return[JSON.parse(IT.isoBase64URL.toUTF8String(e[0])),JSON.parse(IT.isoBase64URL.toUTF8String(e[1])),e[2]]}});var jT=l(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.verifyJWT=Bq;var xq=k0(),kT=ae(),M_=Qe(),Oq=uh(),Iq=dh();function Bq(t,e){let[r,i,n]=t.split("."),s=(0,xq.convertX509PublicKeyToCOSE)(e),o=kT.isoUint8Array.fromUTF8String(`${r}.${i}`),a=kT.isoBase64URL.toBuffer(n);if((0,M_.isCOSEPublicKeyEC2)(s))return(0,Oq.verifyEC2)({data:o,signature:a,cosePublicKey:s,shaHashOverride:M_.COSEALG.ES256});if((0,M_.isCOSEPublicKeyRSA)(s))return(0,Iq.verifyRSA)({data:o,signature:a,cosePublicKey:s});let c=s.get(M_.COSEKEYS.kty);throw new Error(`JWT verification with public key of kty ${c} is not supported by this method`)}});var MT=l(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});N0.convertPEMToBytes=jq;var kq=ae();function jq(t){let e=t.replace("-----BEGIN CERTIFICATE-----","").replace("-----END CERTIFICATE-----","").replace(/[\n ]/g,"");return kq.isoBase64URL.toBuffer(e,"base64")}});var NT=l(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.GlobalSign_Root_CA=void 0;N_.GlobalSign_Root_CA=`-----BEGIN CERTIFICATE-----
26
26
  MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
27
27
  A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
28
28
  b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
@@ -166,7 +166,7 @@ zbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo
166
166
  vaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn
167
167
  w1IdYIg2Wxg7yHcQZemFQg==
168
168
  -----END CERTIFICATE-----
169
- `});var RT=l(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});R_.Apple_WebAuthn_Root_CA=void 0;R_.Apple_WebAuthn_Root_CA=`-----BEGIN CERTIFICATE-----
169
+ `});var RT=l(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.Apple_WebAuthn_Root_CA=void 0;q_.Apple_WebAuthn_Root_CA=`-----BEGIN CERTIFICATE-----
170
170
  MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
171
171
  HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
172
172
  bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
@@ -180,7 +180,7 @@ MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
180
180
  jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
181
181
  1bWeT0vT
182
182
  -----END CERTIFICATE-----
183
- `});var DT=l(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});D_.GlobalSign_Root_CA_R3=void 0;D_.GlobalSign_Root_CA_R3=`-----BEGIN CERTIFICATE-----
183
+ `});var DT=l(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});R_.GlobalSign_Root_CA_R3=void 0;R_.GlobalSign_Root_CA_R3=`-----BEGIN CERTIFICATE-----
184
184
  MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
185
185
  A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
186
186
  Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
@@ -201,8 +201,8 @@ mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
201
201
  Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
202
202
  WD9f
203
203
  -----END CERTIFICATE-----
204
- `});var L_=l(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.SettingsService=void 0;var Nq=Pr(),qq=NT(),U_=qT(),Rq=RT(),Dq=DT(),N0=class{constructor(){Object.defineProperty(this,"pemCertificates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pemCertificates=new Map}setRootCertificates(e){let{identifier:r,certificates:i}=e,n=[];for(let s of i)s instanceof Uint8Array?n.push((0,Nq.convertCertBufferToPEM)(s)):n.push(s);this.pemCertificates.set(r,n)}getRootCertificates(e){let{identifier:r}=e;return this.pemCertificates.get(r)??[]}};On.SettingsService=new N0;On.SettingsService.setRootCertificates({identifier:"android-key",certificates:[U_.Google_Hardware_Attestation_Root_1,U_.Google_Hardware_Attestation_Root_2,U_.Google_Hardware_Attestation_Root_3,U_.Google_Hardware_Attestation_Root_4]});On.SettingsService.setRootCertificates({identifier:"android-safetynet",certificates:[qq.GlobalSign_Root_CA]});On.SettingsService.setRootCertificates({identifier:"apple",certificates:[Rq.Apple_WebAuthn_Root_CA]});On.SettingsService.setRootCertificates({identifier:"mds",certificates:[Dq.GlobalSign_Root_CA_R3]})});var R0=l(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});q0.verifyMDSBlob=Hq;var Uq=BT(),Lq=jT(),Kq=bi(),Vq=Pr(),Gq=MT(),Fq=L_();async function Hq(t){let e=(0,Uq.parseJWT)(t),r=e[0],i=e[1],n=r.x5c.map(Vq.convertCertBufferToPEM);try{let y=Fq.SettingsService.getRootCertificates({identifier:"mds"});await(0,Kq.validateCertificatePath)(n,y)}catch(y){let m=y;throw new Error("BLOB certificate path could not be validated",{cause:m})}let s=n[0];if(!await(0,Lq.verifyJWT)(t,(0,Gq.convertPEMToBytes)(s)))throw new Error("BLOB signature could not be verified");let a=[];for(let y of i.entries)y.aaguid&&y.metadataStatement&&a.push(y.metadataStatement);let[c,u,f]=i.nextUpdate.split("-"),d=new Date(parseInt(c,10),parseInt(u,10)-1,parseInt(f,10));return{statements:a,parsedNextUpdate:d,payload:i}}});var LT=l(ge=>{"use strict";var UT=ge&&ge.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Wq=ge&&ge.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mt=ge&&ge.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UT(e,t,r)},$q=ge&&ge.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&UT(e,t,r);return Wq(e,t),e};Object.defineProperty(ge,"__esModule",{value:!0});ge.cose=void 0;mt(Yf(),ge);mt(Pr(),ge);mt(Ec(),ge);mt(Ah(),ge);mt(Qf(),ge);mt(vo(),ge);mt(K_(),ge);mt(vh(),ge);mt(Uu(),ge);mt(C0(),ge);mt(j_(),ge);mt(Tn(),ge);mt(bi(),ge);mt(xn(),ge);mt(ae(),ge);mt(R0(),ge);ge.cose=$q(Qe())});var KT=l(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});D0.verifyOKP=Qq;var Mf=Qe(),zq=LT(),Yq=$f(),Jq=Zi();async function Qq(t){let{cosePublicKey:e,signature:r,data:i}=t,n=await(0,Jq.getWebCrypto)(),s=e.get(Mf.COSEKEYS.alg),o=e.get(Mf.COSEKEYS.crv),a=e.get(Mf.COSEKEYS.x);if(!s)throw new Error("Public key was missing alg (OKP)");if(!(0,Mf.isCOSEAlg)(s))throw new Error(`Public key had invalid alg ${s} (OKP)`);if(!o)throw new Error("Public key was missing crv (OKP)");if(!a)throw new Error("Public key was missing x (OKP)");let c;if(o===Mf.COSECRV.ED25519)c="Ed25519";else throw new Error(`Unexpected COSE crv value of ${o} (OKP)`);let u={kty:"OKP",crv:c,alg:"EdDSA",x:zq.isoBase64URL.fromBuffer(a),ext:!1},f={name:c,namedCurve:c},d=await(0,Yq.importKey)({keyData:u,algorithm:f}),y={name:c};return n.subtle.verify(y,d,r,i)}});var GT=l(L0=>{"use strict";Object.defineProperty(L0,"__esModule",{value:!0});L0.unwrapEC2Signature=t2;var Xq=S(),Zq=_y(),U0=Qe(),e2=ae();function t2(t,e){let r=Xq.AsnParser.parse(t,Zq.ECDSASigValue),i=new Uint8Array(r.r),n=new Uint8Array(r.s),s=r2(e),o=VT(i,s),a=VT(n,s);return e2.isoUint8Array.concat([o,a])}function r2(t){switch(t){case U0.COSECRV.P256:return 32;case U0.COSECRV.P384:return 48;case U0.COSECRV.P521:return 66;default:throw new Error(`Unexpected COSE crv value of ${t} (EC2)`)}}function VT(t,e){let r;if(t.length<e)r=new Uint8Array(e),r.set(t,e-t.length);else if(t.length===e)r=t;else if(t.length===e+1&&t[0]===0&&(t[1]&128)===128)r=t.subarray(1);else throw new Error(`Invalid signature component length ${t.length}, expected ${e}`);return r}});var FT=l(K0=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});K0.verify=a2;var pc=Qe(),i2=lh(),n2=ph(),s2=KT(),o2=GT();function a2(t){let{cosePublicKey:e,signature:r,data:i,shaHashOverride:n}=t;if((0,pc.isCOSEPublicKeyEC2)(e)){let o=e.get(pc.COSEKEYS.crv);if(!(0,pc.isCOSECrv)(o))throw new Error(`unknown COSE curve ${o}`);let a=(0,o2.unwrapEC2Signature)(r,o);return(0,i2.verifyEC2)({cosePublicKey:e,signature:a,data:i,shaHashOverride:n})}else{if((0,pc.isCOSEPublicKeyRSA)(e))return(0,n2.verifyRSA)({cosePublicKey:e,signature:r,data:i,shaHashOverride:n});if((0,pc.isCOSEPublicKeyOKP)(e))return(0,s2.verifyOKP)({cosePublicKey:e,signature:r,data:i})}let s=e.get(pc.COSEKEYS.kty);throw new Error(`Signature verification with public key of kty ${s} is not supported by this method`)}});var HT=l(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.verify=In.getRandomValues=In.digest=void 0;var c2=Ub();Object.defineProperty(In,"digest",{enumerable:!0,get:function(){return c2.digest}});var u2=Lb();Object.defineProperty(In,"getRandomValues",{enumerable:!0,get:function(){return u2.getRandomValues}});var l2=FT();Object.defineProperty(In,"verify",{enumerable:!0,get:function(){return l2.verify}})});var WT=l(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.areEqual=f2;wi.toHex=d2;wi.fromHex=p2;wi.concat=y2;wi.toUTF8String=_2;wi.fromUTF8String=h2;wi.fromASCIIString=g2;wi.toDataView=A2;function f2(t,e){return t.length!=e.length?!1:t.every((r,i)=>r===e[i])}function d2(t){return Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function p2(t){if(!t)return Uint8Array.from([]);if(!(t.length!==0&&t.length%2===0&&!/[^a-fA-F0-9]/u.test(t)))throw new Error("Invalid hex string");let r=t.match(/.{1,2}/g)??[];return Uint8Array.from(r.map(i=>parseInt(i,16)))}function y2(t){let e=0,r=t.reduce((n,s)=>n+s.length,0),i=new Uint8Array(r);return t.forEach(n=>{i.set(n,e),e+=n.length}),i}function _2(t){return new globalThis.TextDecoder("utf-8").decode(t)}function h2(t){return new globalThis.TextEncoder().encode(t)}function g2(t){return Uint8Array.from(t.split("").map(e=>e.charCodeAt(0)))}function A2(t){return new DataView(t.buffer,t.byteOffset,t.length)}});var ae=l(bt=>{"use strict";var v2=bt&&bt.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),m2=bt&&bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V_=bt&&bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&v2(e,t,r);return m2(e,t),e};Object.defineProperty(bt,"__esModule",{value:!0});bt.isoUint8Array=bt.isoCrypto=bt.isoCBOR=bt.isoBase64URL=void 0;bt.isoBase64URL=V_(Ib());bt.isoCBOR=V_(Db());bt.isoCrypto=V_(HT());bt.isoUint8Array=V_(WT())});var K_=l(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc._generateChallengeInternals=void 0;yc.generateChallenge=S2;var b2=ae();async function S2(){let t=new Uint8Array(32);return await b2.isoCrypto.getRandomValues(t),yc._generateChallengeInternals.stubThis(t)}yc._generateChallengeInternals={stubThis:t=>t}});var V0=l(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.supportedCOSEAlgorithmIdentifiers=void 0;qf.generateRegistrationOptions=T2;var w2=K_(),C2=vh(),Nf=ae();qf.supportedCOSEAlgorithmIdentifiers=[-8,-7,-36,-37,-38,-39,-257,-258,-259,-65535];var P2={residentKey:"preferred",userVerification:"preferred"},E2=[-8,-7,-257];async function T2(t){let{rpName:e,rpID:r,userName:i,userID:n,challenge:s=await(0,w2.generateChallenge)(),userDisplayName:o="",timeout:a=6e4,attestationType:c="none",excludeCredentials:u=[],authenticatorSelection:f=P2,extensions:d,supportedAlgorithmIDs:y=E2,preferredAuthenticatorType:m}=t,x=y.map(ee=>({alg:ee,type:"public-key"}));f.residentKey===void 0?f.requireResidentKey&&(f.residentKey="required"):f.requireResidentKey=f.residentKey==="required";let T=s;if(typeof T=="string"&&(T=Nf.isoUint8Array.fromUTF8String(T)),typeof n=="string")throw new Error("String values for `userID` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids");let I=n;I||(I=await(0,C2.generateUserID)());let U=[];return m&&(m==="securityKey"?(U.push("security-key"),f.authenticatorAttachment="cross-platform"):m==="localDevice"?(U.push("client-device"),f.authenticatorAttachment="platform"):m==="remoteDevice"&&(U.push("hybrid"),f.authenticatorAttachment="cross-platform")),{challenge:Nf.isoBase64URL.fromBuffer(T),rp:{name:e,id:r},user:{id:Nf.isoBase64URL.fromBuffer(I),name:i,displayName:o},pubKeyCredParams:x,timeout:a,attestation:c,excludeCredentials:u.map(ee=>{if(!Nf.isoBase64URL.isBase64URL(ee.id))throw new Error(`excludeCredential id "${ee.id}" is not a valid base64url string`);return{...ee,id:Nf.isoBase64URL.trimPadding(ee.id),type:"public-key"}}),authenticatorSelection:f,extensions:{...d,credProps:!0},hints:U}}});var G0=l(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.InvalidBackupFlags=void 0;Rf.parseBackupFlags=x2;function x2({be:t,bs:e}){let r=e,i="singleDevice";if(t&&(i="multiDevice"),i==="singleDevice"&&r)throw new G_("Single-device credential indicated that it was backed up, which should be impossible.");return{credentialDeviceType:i,credentialBackedUp:r}}var G_=class extends Error{constructor(e){super(e),this.name="InvalidBackupFlags"}};Rf.InvalidBackupFlags=G_});var W0=l(H0=>{"use strict";Object.defineProperty(H0,"__esModule",{value:!0});H0.matchExpectedRPID=I2;var O2=Tn(),$T=ae();async function I2(t,e){try{return await Promise.any(e.map(i=>new Promise((n,s)=>{(0,O2.toHash)($T.isoUint8Array.fromASCIIString(i)).then(o=>{$T.isoUint8Array.areEqual(t,o)?n(i):s()})})))}catch(r){throw r.name==="AggregateError"?new F0:r}}var F0=class extends Error{constructor(){super("Unexpected RP ID hash"),this.name="UnexpectedRPIDHash"}}});var YT=l($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0.verifyAttestationFIDOU2F=q2;var B2=Ec(),k2=Pr(),j2=bi(),M2=xn(),zT=ae(),N2=Qe();async function q2(t){let{attStmt:e,clientDataHash:r,rpIdHash:i,credentialID:n,credentialPublicKey:s,aaguid:o,rootCertificates:a}=t,c=Uint8Array.from([0]),u=(0,B2.convertCOSEtoPKCS)(s),f=zT.isoUint8Array.concat([c,i,r,n,u]),d=e.get("sig"),y=e.get("x5c");if(!y)throw new Error("No attestation certificate provided in attestation statement (FIDOU2F)");if(!d)throw new Error("No attestation signature provided in attestation statement (FIDOU2F)");let m=Number.parseInt(zT.isoUint8Array.toHex(o),16);if(m!==0)throw new Error(`AAGUID "${m}" was not expected value`);try{await(0,j2.validateCertificatePath)(y.map(k2.convertCertBufferToPEM),a)}catch(x){let T=x;throw new Error(`${T.message} (FIDOU2F)`)}return(0,M2.verifySignature)({signature:d,data:f,x509Certificate:y[0],hashAlgorithm:N2.COSEALG.ES256})}});var J0=l(Y0=>{"use strict";Object.defineProperty(Y0,"__esModule",{value:!0});Y0.validateExtFIDOGenCEAAGUID=R2;var JT=S(),z0=ae(),QT="1.3.6.1.4.1.45724.1.1.4";function R2(t,e){if(!t)return!0;let r=t.find(o=>o.extnID===QT);if(!r)return!0;let i=JT.AsnParser.parse(r.extnValue,JT.OctetString),n=new Uint8Array(i.buffer);if(!z0.isoUint8Array.areEqual(e,n)){let o=z0.isoUint8Array.toHex(n),a=z0.isoUint8Array.toHex(e);throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${QT}) value of "${o}" was present but not equal to attestation statement AAGUID value of "${a}"`)}return!0}});var XT=l(Q0=>{"use strict";Object.defineProperty(Q0,"__esModule",{value:!0});Q0.getLogger=D2;function D2(t){return(e,...r)=>{}}});var hc=l(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.MetadataService=_c.BaseMetadataService=void 0;var U2=Yf(),L2=R0(),K2=XT(),V2=S0(),G2={url:"",no:0,nextUpdate:new Date(0)},F2="https://mds.fidoalliance.org/",er;(function(t){t[t.DISABLED=0]="DISABLED",t[t.REFRESHING=1]="REFRESHING",t[t.READY=2]="READY"})(er||(er={}));var so=(0,K2.getLogger)("MetadataService"),F_=class{constructor(){Object.defineProperty(this,"mdsCache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"statementCache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:er.DISABLED}),Object.defineProperty(this,"verificationMode",{enumerable:!0,configurable:!0,writable:!0,value:"strict"})}async initialize(e={}){this.statementCache={};let{mdsServers:r=[F2],statements:i,verificationMode:n}=e;if(this.setState(er.REFRESHING),i?.length){let s=0;i.forEach(o=>{o.aaguid&&(this.statementCache[o.aaguid]={entry:{metadataStatement:o,statusReports:[],timeOfLastStatusChange:"1970-01-01"},url:G2.url},s+=1)}),so(`Cached ${s} local statements`)}if(r?.length){let s=Object.keys(this.statementCache).length,o=r.length;for(let u of r)try{let f={url:u,no:0,nextUpdate:new Date(0)},d=await this.downloadBlob(f);await this.verifyBlob(d,f)}catch(f){so(`Could not download BLOB from ${u}:`,f),o-=1}let c=Object.keys(this.statementCache).length-s;so(`Cached ${c} statements from ${o} metadata server(s)`)}n&&(this.verificationMode=n),this.setState(er.READY)}async getStatement(e){if(this.state===er.DISABLED||!e)return;e instanceof Uint8Array&&(e=(0,U2.convertAAGUIDToString)(e)),await this.pauseUntilReady();let r=this.statementCache[e];if(!r){if(this.verificationMode==="strict")throw new Error(`No metadata statement found for aaguid "${e}"`);return}if(r.url){let n=this.mdsCache[r.url];if(new Date>n.nextUpdate)try{this.setState(er.REFRESHING);let o=await this.downloadBlob(n);await this.verifyBlob(o,n)}finally{this.setState(er.READY)}}let{entry:i}=r;for(let n of i.statusReports){let{status:s}=n;if(s==="USER_VERIFICATION_BYPASS"||s==="ATTESTATION_KEY_COMPROMISE"||s==="USER_KEY_REMOTE_COMPROMISE"||s==="USER_KEY_PHYSICAL_COMPROMISE")throw new Error(`Detected compromised aaguid "${e}"`)}return i.metadataStatement}async downloadBlob(e){let{url:r}=e;return await(await(0,V2.fetch)(r)).text()}async verifyBlob(e,r){let{url:i,no:n}=r,{payload:s,parsedNextUpdate:o}=await(0,L2.verifyMDSBlob)(e);if(s.no<=n)throw new Error(`Latest BLOB no. ${s.no} is not greater than previous no. ${n}`);for(let a of s.entries)a.aaguid&&(this.statementCache[a.aaguid]={entry:a,url:i});i?this.mdsCache[i]={...r,no:s.no,nextUpdate:o}:o<new Date&&so(`\u26A0\uFE0F This MDS blob (serial: ${s.no}) contains stale data as of ${o.toISOString()}. Please consider re-initializing MetadataService with a newer MDS blob.`)}pauseUntilReady(){return this.state===er.READY?new Promise(r=>{r()}):new Promise((r,i)=>{let o=700,a=globalThis.setInterval(()=>{o<1?(clearInterval(a),i(`State did not become ready in ${7e4/1e3} seconds`)):this.state===er.READY&&(clearInterval(a),r()),o-=1},100)})}setState(e){this.state=e,e===er.DISABLED?so("MetadataService is DISABLED"):e===er.REFRESHING?so("MetadataService is REFRESHING"):e===er.READY&&so("MetadataService is READY")}};_c.BaseMetadataService=F_;_c.MetadataService=new F_});var Df=l(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.algSignToCOSEInfoMap=void 0;ao.verifyAttestationWithMetadata=$2;var ZT=Pr(),H2=bi(),W2=vo(),oo=Qe();async function $2({statement:t,credentialPublicKey:e,x5c:r,attestationStatementAlg:i}){let{authenticationAlgorithms:n,authenticatorGetInfo:s,attestationRootCertificates:o}=t,a=new Set;n.forEach(I=>{let U=ao.algSignToCOSEInfoMap[I];U&&a.add(U)});let c=(0,W2.decodeCredentialPublicKey)(e),u=c.get(oo.COSEKEYS.kty),f=c.get(oo.COSEKEYS.alg);if(!u)throw new Error("Credential public key was missing kty");if(!f)throw new Error("Credential public key was missing alg");if(!u)throw new Error("Credential public key was missing kty");let d={kty:u,alg:f};if((0,oo.isCOSEPublicKeyEC2)(c)){let I=c.get(oo.COSEKEYS.crv);d.crv=I}let y=!1;for(let I of a)if(I.alg===d.alg&&I.kty===d.kty&&((I.kty===oo.COSEKTY.EC2||I.kty===oo.COSEKTY.OKP)&&(I.crv,d.crv),y=!0),y)break;if(!y){let I=n.map(pe=>`'${pe}' (COSE info: ${ex(ao.algSignToCOSEInfoMap[pe])})`),U=JSON.stringify(I,null,2).replace(/"/g,""),ee=ex(d);throw new Error(`Public key parameters ${ee} did not match any of the following metadata algorithms:
205
- ${U}`)}if(i!==void 0&&s?.algorithms!==void 0){let I=s.algorithms.map(U=>U.alg);if(I.indexOf(i)<0)throw new Error(`Attestation statement alg ${i} did not match one of ${I}`)}let m=r.map(ZT.convertCertBufferToPEM),x=o.map(ZT.convertCertBufferToPEM),T=!1;if(m.length===1&&x.indexOf(m[0])>=0&&(T=!0),!T)try{await(0,H2.validateCertificatePath)(m,x)}catch(I){let U=I;throw new Error(`Could not validate certificate path with any metadata root certificates: ${U.message}`)}return!0}ao.algSignToCOSEInfoMap={secp256r1_ecdsa_sha256_raw:{kty:2,alg:-7,crv:1},secp256r1_ecdsa_sha256_der:{kty:2,alg:-7,crv:1},rsassa_pss_sha256_raw:{kty:3,alg:-37},rsassa_pss_sha256_der:{kty:3,alg:-37},secp256k1_ecdsa_sha256_raw:{kty:2,alg:-47,crv:8},secp256k1_ecdsa_sha256_der:{kty:2,alg:-47,crv:8},rsassa_pss_sha384_raw:{kty:3,alg:-38},rsassa_pkcsv15_sha256_raw:{kty:3,alg:-257},rsassa_pkcsv15_sha384_raw:{kty:3,alg:-258},rsassa_pkcsv15_sha512_raw:{kty:3,alg:-259},rsassa_pkcsv15_sha1_raw:{kty:3,alg:-65535},secp384r1_ecdsa_sha384_raw:{kty:2,alg:-35,crv:2},secp512r1_ecdsa_sha256_raw:{kty:2,alg:-36,crv:3},ed25519_eddsa_sha512_raw:{kty:1,alg:-8,crv:6}};function ex(t){let{kty:e,alg:r,crv:i}=t,n="";return e!==oo.COSEKTY.RSA?n=`{ kty: ${e}, alg: ${r}, crv: ${i} }`:n=`{ kty: ${e}, alg: ${r} }`,n}});var rx=l(X0=>{"use strict";Object.defineProperty(X0,"__esModule",{value:!0});X0.verifyAttestationPacked=rR;var z2=Qe(),Y2=Pr(),J2=bi(),Q2=Uu(),tx=xn(),X2=ae(),Z2=J0(),eR=hc(),tR=Df();async function rR(t){let{attStmt:e,clientDataHash:r,authData:i,credentialPublicKey:n,aaguid:s,rootCertificates:o}=t,a=e.get("sig"),c=e.get("x5c"),u=e.get("alg");if(!a)throw new Error("No attestation signature provided in attestation statement (Packed)");if(!u)throw new Error("Attestation statement did not contain alg (Packed)");if(!(0,z2.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (Packed)`);let f=X2.isoUint8Array.concat([i,r]),d=!1;if(c){let{subject:y,basicConstraintsCA:m,version:x,notBefore:T,notAfter:I,parsedCertificate:U}=(0,Q2.getCertificateInfo)(c[0]),{OU:ee,CN:pe,O:Ae,C:oe}=y;if(ee!=="Authenticator Attestation")throw new Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)');if(!pe)throw new Error("Certificate CN was empty (Packed|Full)");if(!Ae)throw new Error("Certificate O was empty (Packed|Full)");if(!oe||oe.length!==2)throw new Error("Certificate C was not two-character ISO 3166 code (Packed|Full)");if(m)throw new Error("Certificate basic constraints CA was not `false` (Packed|Full)");if(x!==2)throw new Error("Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)");let ze=new Date;if(T>ze)throw new Error(`Certificate not good before "${T.toString()}" (Packed|Full)`);if(ze=new Date,I<ze)throw new Error(`Certificate not good after "${I.toString()}" (Packed|Full)`);try{await(0,Z2.validateExtFIDOGenCEAAGUID)(U.tbsCertificate.extensions,s)}catch(ut){let lt=ut;throw new Error(`${lt.message} (Packed|Full)`)}let it=await eR.MetadataService.getStatement(s);if(it){if(it.attestationTypes.indexOf("basic_full")<0)throw new Error("Metadata does not indicate support for full attestations (Packed|Full)");try{await(0,tR.verifyAttestationWithMetadata)({statement:it,credentialPublicKey:n,x5c:c,attestationStatementAlg:u})}catch(ut){let lt=ut;throw new Error(`${lt.message} (Packed|Full)`)}}else try{await(0,J2.validateCertificatePath)(c.map(Y2.convertCertBufferToPEM),o)}catch(ut){let lt=ut;throw new Error(`${lt.message} (Packed|Full)`)}d=await(0,tx.verifySignature)({signature:a,data:f,x509Certificate:c[0],hashAlgorithm:u})}else d=await(0,tx.verifySignature)({signature:a,data:f,credentialPublicKey:n,hashAlgorithm:u});return d}});var ix=l(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});Z0.verifyAttestationAndroidSafetyNet=lR;var iR=Tn(),nR=xn(),sR=Uu(),oR=bi(),aR=Pr(),Bn=ae(),cR=hc(),uR=Df();async function lR(t){let{attStmt:e,clientDataHash:r,authData:i,aaguid:n,rootCertificates:s,verifyTimestampMS:o=!0,credentialPublicKey:a,attestationSafetyNetEnforceCTSCheck:c}=t,u=e.get("alg"),f=e.get("response");if(!e.get("ver"))throw new Error("No ver value in attestation (SafetyNet)");if(!f)throw new Error("No response was included in attStmt by authenticator (SafetyNet)");let m=Bn.isoUint8Array.toUTF8String(f).split("."),x=JSON.parse(Bn.isoBase64URL.toUTF8String(m[0])),T=JSON.parse(Bn.isoBase64URL.toUTF8String(m[1])),I=m[2],{nonce:U,ctsProfileMatch:ee,timestampMs:pe}=T;if(o){let Ye=Date.now();if(pe>Date.now())throw new Error(`Payload timestamp "${pe}" was later than "${Ye}" (SafetyNet)`);let pt=pe+60*1e3;if(Ye=Date.now(),pt<Ye)throw new Error(`Payload timestamp "${pt}" has expired (SafetyNet)`)}let Ae=Bn.isoUint8Array.concat([i,r]),oe=await(0,iR.toHash)(Ae),ze=Bn.isoBase64URL.fromBuffer(oe,"base64");if(U!==ze)throw new Error("Could not verify payload nonce (SafetyNet)");if(c&&!ee)throw new Error("Could not verify device integrity (SafetyNet)");let it=Bn.isoBase64URL.toBuffer(x.x5c[0],"base64"),ut=(0,sR.getCertificateInfo)(it),{subject:lt}=ut;if(lt.CN!=="attest.android.com")throw new Error('Certificate common name was not "attest.android.com" (SafetyNet)');let br=await cR.MetadataService.getStatement(n);if(br)try{await(0,uR.verifyAttestationWithMetadata)({statement:br,credentialPublicKey:a,x5c:x.x5c,attestationStatementAlg:u})}catch(Ye){let pt=Ye;throw new Error(`${pt.message} (SafetyNet)`)}else try{await(0,oR.validateCertificatePath)(x.x5c.map(aR.convertCertBufferToPEM),s)}catch(Ye){let pt=Ye;throw new Error(`${pt.message} (SafetyNet)`)}let ir=Bn.isoUint8Array.fromUTF8String(`${m[0]}.${m[1]}`),Sr=Bn.isoBase64URL.toBuffer(I);return await(0,nR.verifySignature)({signature:Sr,data:ir,x509Certificate:it,hashAlgorithm:u})}});var H_=l(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.TPM_ECC_CURVE_COSE_CRV_MAP=Ar.TPM_MANUFACTURERS=Ar.TPM_ECC_CURVE=Ar.TPM_ALG=Ar.TPM_ST=void 0;Ar.TPM_ST={196:"TPM_ST_RSP_COMMAND",32768:"TPM_ST_NULL",32769:"TPM_ST_NO_SESSIONS",32770:"TPM_ST_SESSIONS",32788:"TPM_ST_ATTEST_NV",32789:"TPM_ST_ATTEST_COMMAND_AUDIT",32790:"TPM_ST_ATTEST_SESSION_AUDIT",32791:"TPM_ST_ATTEST_CERTIFY",32792:"TPM_ST_ATTEST_QUOTE",32793:"TPM_ST_ATTEST_TIME",32794:"TPM_ST_ATTEST_CREATION",32801:"TPM_ST_CREATION",32802:"TPM_ST_VERIFIED",32803:"TPM_ST_AUTH_SECRET",32804:"TPM_ST_HASHCHECK",32805:"TPM_ST_AUTH_SIGNED",32809:"TPM_ST_FU_MANIFEST"};Ar.TPM_ALG={0:"TPM_ALG_ERROR",1:"TPM_ALG_RSA",4:"TPM_ALG_SHA",4:"TPM_ALG_SHA1",5:"TPM_ALG_HMAC",6:"TPM_ALG_AES",7:"TPM_ALG_MGF1",8:"TPM_ALG_KEYEDHASH",10:"TPM_ALG_XOR",11:"TPM_ALG_SHA256",12:"TPM_ALG_SHA384",13:"TPM_ALG_SHA512",16:"TPM_ALG_NULL",18:"TPM_ALG_SM3_256",19:"TPM_ALG_SM4",20:"TPM_ALG_RSASSA",21:"TPM_ALG_RSAES",22:"TPM_ALG_RSAPSS",23:"TPM_ALG_OAEP",24:"TPM_ALG_ECDSA",25:"TPM_ALG_ECDH",26:"TPM_ALG_ECDAA",27:"TPM_ALG_SM2",28:"TPM_ALG_ECSCHNORR",29:"TPM_ALG_ECMQV",32:"TPM_ALG_KDF1_SP800_56A",33:"TPM_ALG_KDF2",34:"TPM_ALG_KDF1_SP800_108",35:"TPM_ALG_ECC",37:"TPM_ALG_SYMCIPHER",38:"TPM_ALG_CAMELLIA",64:"TPM_ALG_CTR",65:"TPM_ALG_OFB",66:"TPM_ALG_CBC",67:"TPM_ALG_CFB",68:"TPM_ALG_ECB"};Ar.TPM_ECC_CURVE={0:"TPM_ECC_NONE",1:"TPM_ECC_NIST_P192",2:"TPM_ECC_NIST_P224",3:"TPM_ECC_NIST_P256",4:"TPM_ECC_NIST_P384",5:"TPM_ECC_NIST_P521",16:"TPM_ECC_BN_P256",17:"TPM_ECC_BN_P638",32:"TPM_ECC_SM2_P256"};Ar.TPM_MANUFACTURERS={"id:414D4400":{name:"AMD",id:"AMD"},"id:414E5400":{name:"Ant Group",id:"ANT"},"id:41544D4C":{name:"Atmel",id:"ATML"},"id:4252434D":{name:"Broadcom",id:"BRCM"},"id:4353434F":{name:"Cisco",id:"CSCO"},"id:464C5953":{name:"Flyslice Technologies",id:"FLYS"},"id:524F4343":{name:"Fuzhou Rockchip",id:"ROCC"},"id:474F4F47":{name:"Google",id:"GOOG"},"id:48504900":{name:"HPI",id:"HPI"},"id:48504500":{name:"HPE",id:"HPE"},"id:48495349":{name:"Huawei",id:"HISI"},"id:49424d00":{name:"IBM",id:"IBM"},"id:49424D00":{name:"IBM",id:"IBM"},"id:49465800":{name:"Infineon",id:"IFX"},"id:494E5443":{name:"Intel",id:"INTC"},"id:4C454E00":{name:"Lenovo",id:"LEN"},"id:4D534654":{name:"Microsoft",id:"MSFT"},"id:4E534D20":{name:"National Semiconductor",id:"NSM"},"id:4E545A00":{name:"Nationz",id:"NTZ"},"id:4E534700":{name:"NSING",id:"NSG"},"id:4E544300":{name:"Nuvoton Technology",id:"NTC"},"id:51434F4D":{name:"Qualcomm",id:"QCOM"},"id:534D534E":{name:"Samsung",id:"SMSN"},"id:53454345":{name:"SecEdge",id:"SECE"},"id:534E5300":{name:"Sinosun",id:"SNS"},"id:534D5343":{name:"SMSC",id:"SMSC"},"id:53544D20":{name:"STMicroelectronics",id:"STM"},"id:54584E00":{name:"Texas Instruments",id:"TXN"},"id:57454300":{name:"Winbond",id:"WEC"},"id:5345414C":{name:"Wisekey",id:"SEAL"},"id:FFFFF1D0":{name:"FIDO Alliance",id:"FIDO"}};Ar.TPM_ECC_CURVE_COSE_CRV_MAP={TPM_ECC_NIST_P256:1,TPM_ECC_NIST_P384:2,TPM_ECC_NIST_P521:3,TPM_ECC_BN_P256:1,TPM_ECC_SM2_P256:1}});var ox=l(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});eb.parseCertInfo=fR;var nx=H_(),sx=ae();function fR(t){let e=0,r=sx.isoUint8Array.toDataView(t),i=r.getUint32(e);e+=4;let n=r.getUint16(e);e+=2;let s=nx.TPM_ST[n],o=r.getUint16(e);e+=2;let a=t.slice(e,e+=o),c=r.getUint16(e);e+=2;let u=t.slice(e,e+=c),f=t.slice(e,e+=8),d=r.getUint32(e);e+=4;let y=r.getUint32(e);e+=4;let m=!!t.slice(e,e+=1),x={clock:f,resetCount:d,restartCount:y,safe:m},T=t.slice(e,e+=8),I=r.getUint16(e);e+=2;let U=t.slice(e,e+=I),ee=sx.isoUint8Array.toDataView(U),pe=r.getUint16(e);e+=2;let Ae=t.slice(e,e+=pe),oe={nameAlg:nx.TPM_ALG[ee.getUint16(0)],nameAlgBuffer:U.slice(0,2),name:U,qualifiedName:Ae};return{magic:i,type:s,qualifiedSigner:a,extraData:u,clockInfo:x,firmwareVersion:T,attested:oe}}});var cx=l(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});tb.parsePubArea=dR;var kn=H_(),ax=ae();function dR(t){let e=0,r=ax.isoUint8Array.toDataView(t),i=kn.TPM_ALG[r.getUint16(e)];e+=2;let n=kn.TPM_ALG[r.getUint16(e)];e+=2;let s=r.getUint32(e);e+=4;let o={fixedTPM:!!(s&1),stClear:!!(s&2),fixedParent:!!(s&8),sensitiveDataOrigin:!!(s&16),userWithAuth:!!(s&32),adminWithPolicy:!!(s&64),noDA:!!(s&512),encryptedDuplication:!!(s&1024),restricted:!!(s&32768),decrypt:!!(s&65536),signOrEncrypt:!!(s&131072)},a=r.getUint16(e);e+=2;let c=t.slice(e,e+=a),u={},f=Uint8Array.from([]);if(i==="TPM_ALG_RSA"){let d=kn.TPM_ALG[r.getUint16(e)];e+=2;let y=kn.TPM_ALG[r.getUint16(e)];e+=2;let m=r.getUint16(e);e+=2;let x=r.getUint32(e);e+=4,u.rsa={symmetric:d,scheme:y,keyBits:m,exponent:x};let T=r.getUint16(e);e+=2,f=t.slice(e,e+=T)}else if(i==="TPM_ALG_ECC"){let d=kn.TPM_ALG[r.getUint16(e)];e+=2;let y=kn.TPM_ALG[r.getUint16(e)];e+=2;let m=kn.TPM_ECC_CURVE[r.getUint16(e)];e+=2;let x=kn.TPM_ALG[r.getUint16(e)];e+=2,u.ecc={symmetric:d,scheme:y,curveID:m,kdf:x};let T=r.getUint16(e);e+=2;let I=t.slice(e,e+=T),U=r.getUint16(e);e+=2;let ee=t.slice(e,e+=U);f=ax.isoUint8Array.concat([I,ee])}else throw new Error(`Unexpected type "${i}" (TPM)`);return{type:i,nameAlg:n,objectAttributes:o,authPolicy:c,parameters:u,unique:f}}});var fx=l(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});ib.verifyAttestationTPM=wR;var rb=S(),Uf=X(),pR=vo(),tr=Qe(),ux=Tn(),yR=Pr(),_R=bi(),hR=Uu(),gR=xn(),co=ae(),AR=J0(),vR=hc(),mR=Df(),lx=H_(),bR=ox(),SR=cx();async function wR(t){let{aaguid:e,attStmt:r,authData:i,credentialPublicKey:n,clientDataHash:s,rootCertificates:o}=t,a=r.get("ver"),c=r.get("sig"),u=r.get("alg"),f=r.get("x5c"),d=r.get("pubArea"),y=r.get("certInfo");if(a!=="2.0")throw new Error(`Unexpected ver "${a}", expected "2.0" (TPM)`);if(!c)throw new Error("No attestation signature provided in attestation statement (TPM)");if(!u)throw new Error("Attestation statement did not contain alg (TPM)");if(!(0,tr.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (TPM)`);if(!f)throw new Error("No attestation certificate provided in attestation statement (TPM)");if(!d)throw new Error("Attestation statement did not contain pubArea (TPM)");if(!y)throw new Error("Attestation statement did not contain certInfo (TPM)");let m=(0,SR.parsePubArea)(d),{unique:x,type:T,parameters:I}=m,U=(0,pR.decodeCredentialPublicKey)(n);if(T==="TPM_ALG_RSA"){if(!(0,tr.isCOSEPublicKeyRSA)(U))throw new Error(`Credential public key with kty ${U.get(tr.COSEKEYS.kty)} did not match ${T}`);let J=U.get(tr.COSEKEYS.n),Vt=U.get(tr.COSEKEYS.e);if(!J)throw new Error("COSE public key missing n (TPM|RSA)");if(!Vt)throw new Error("COSE public key missing e (TPM|RSA)");if(!co.isoUint8Array.areEqual(x,J))throw new Error("PubArea unique is not same as credentialPublicKey (TPM|RSA)");if(!I.rsa)throw new Error("Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)");let Yi=Vt,Ji=I.rsa.exponent||65537,qn=Yi[0]+(Yi[1]<<8)+(Yi[2]<<16);if(Ji!==qn)throw new Error(`Unexpected public key exp ${qn}, expected ${Ji} (TPM|RSA)`)}else if(T==="TPM_ALG_ECC"){if(!(0,tr.isCOSEPublicKeyEC2)(U))throw new Error(`Credential public key with kty ${U.get(tr.COSEKEYS.kty)} did not match ${T}`);let J=U.get(tr.COSEKEYS.crv),Vt=U.get(tr.COSEKEYS.x),Yi=U.get(tr.COSEKEYS.y);if(!J)throw new Error("COSE public key missing crv (TPM|ECC)");if(!Vt)throw new Error("COSE public key missing x (TPM|ECC)");if(!Yi)throw new Error("COSE public key missing y (TPM|ECC)");if(!co.isoUint8Array.areEqual(x,co.isoUint8Array.concat([Vt,Yi])))throw new Error("PubArea unique is not same as public key x and y (TPM|ECC)");if(!I.ecc)throw new Error("Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)");let Ji=I.ecc.curveID,qn=lx.TPM_ECC_CURVE_COSE_CRV_MAP[Ji];if(qn!==J)throw new Error(`Public area key curve ID "${Ji}" mapped to "${qn}" which did not match public key crv of "${J}" (TPM|ECC)`)}else throw new Error(`Unsupported pubArea.type "${T}"`);let ee=(0,bR.parseCertInfo)(y),{magic:pe,type:Ae,attested:oe,extraData:ze}=ee;if(pe!==4283712327)throw new Error(`Unexpected magic value "${pe}", expected "0xff544347" (TPM)`);if(Ae!=="TPM_ST_ATTEST_CERTIFY")throw new Error(`Unexpected type "${Ae}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`);let it=await(0,ux.toHash)(d,PR(oe.nameAlg)),ut=co.isoUint8Array.concat([oe.nameAlgBuffer,it]);if(!co.isoUint8Array.areEqual(oe.name,ut))throw new Error("Attested name comparison failed (TPM)");let lt=co.isoUint8Array.concat([i,s]),br=await(0,ux.toHash)(lt,u);if(!co.isoUint8Array.areEqual(ze,br))throw new Error("CertInfo extra data did not equal hashed attestation (TPM)");if(f.length<1)throw new Error("No certificates present in x5c array (TPM)");let ir=(0,hR.getCertificateInfo)(f[0]),{basicConstraintsCA:Sr,version:zi,subject:Ye,notAfter:pt,notBefore:yt}=ir;if(Sr)throw new Error("Certificate basic constraints CA was not `false` (TPM)");if(zi!==2)throw new Error("Certificate version was not `3` (ASN.1 value of 2) (TPM)");if(Ye.combined.length>0)throw new Error("Certificate subject was not empty (TPM)");let Nn=new Date;if(yt>Nn)throw new Error(`Certificate not good before "${yt.toString()}" (TPM)`);if(Nn=new Date,pt<Nn)throw new Error(`Certificate not good after "${pt.toString()}" (TPM)`);let Wr=rb.AsnParser.parse(f[0],Uf.Certificate);if(!Wr.tbsCertificate.extensions)throw new Error("Certificate was missing extensions (TPM)");let Ci,Pi;if(Wr.tbsCertificate.extensions.forEach(J=>{J.extnID===Uf.id_ce_subjectAltName?Ci=rb.AsnParser.parse(J.extnValue,Uf.SubjectAlternativeName):J.extnID===Uf.id_ce_extKeyUsage&&(Pi=rb.AsnParser.parse(J.extnValue,Uf.ExtendedKeyUsage))}),!Ci)throw new Error("Certificate did not contain subjectAltName extension (TPM)");if(!Ci[0].directoryName?.[0].length)throw new Error("Certificate subjectAltName extension directoryName was empty (TPM)");let{tcgAtTpmManufacturer:Kt,tcgAtTpmModel:F,tcgAtTpmVersion:$r}=CR(Ci[0].directoryName);if(!Kt||!F||!$r)throw new Error("Certificate contained incomplete subjectAltName data (TPM)");if(!Pi)throw new Error("Certificate did not contain ExtendedKeyUsage extension (TPM)");if(!lx.TPM_MANUFACTURERS[Kt])throw new Error(`Could not match TPM manufacturer "${Kt}" (TPM)`);if(Pi[0]!=="2.23.133.8.3")throw new Error(`Unexpected extKeyUsage "${Pi[0]}", expected "2.23.133.8.3" (TPM)`);try{await(0,AR.validateExtFIDOGenCEAAGUID)(Wr.tbsCertificate.extensions,e)}catch(J){let Vt=J;throw new Error(`${Vt.message} (TPM)`)}let po=await vR.MetadataService.getStatement(e);if(po)try{await(0,mR.verifyAttestationWithMetadata)({statement:po,credentialPublicKey:n,x5c:f,attestationStatementAlg:u})}catch(J){let Vt=J;throw new Error(`${Vt.message} (TPM)`)}else try{await(0,_R.validateCertificatePath)(f.map(yR.convertCertBufferToPEM),o)}catch(J){let Vt=J;throw new Error(`${Vt.message} (TPM)`)}return(0,gR.verifySignature)({signature:c,data:y,x509Certificate:f[0],hashAlgorithm:u})}function CR(t){let e="2.23.133.2.1",r="2.23.133.2.2",i="2.23.133.2.3",n,s,o;return t.forEach(a=>{a.forEach(c=>{c.type===e?n=c.value.toString():c.type===r?s=c.value.toString():c.type===i&&(o=c.value.toString())})}),{tcgAtTpmManufacturer:n,tcgAtTpmModel:s,tcgAtTpmVersion:o}}function PR(t){if(t==="TPM_ALG_SHA256")return tr.COSEALG.ES256;if(t==="TPM_ALG_SHA384")return tr.COSEALG.ES384;if(t==="TPM_ALG_SHA512")return tr.COSEALG.ES512;throw new Error(`Unexpected TPM attested name alg ${t}`)}});var ob=l(Fe=>{"use strict";var nb;Object.defineProperty(Fe,"__esModule",{value:!0});Fe.KeyMintKeyDescription=Fe.KeyDescription=Fe.Version=Fe.SecurityLevel=Fe.AuthorizationList=Fe.IntegerSet=Fe.RootOfTrust=Fe.VerifiedBootState=Fe.id_ce_keyDescription=void 0;var K=(v(),g(A)),b=S();Fe.id_ce_keyDescription="1.3.6.1.4.1.11129.2.1.17";var sb;(function(t){t[t.verified=0]="verified",t[t.selfSigned=1]="selfSigned",t[t.unverified=2]="unverified",t[t.failed=3]="failed"})(sb||(Fe.VerifiedBootState=sb={}));var jn=class{verifiedBootKey=new b.OctetString;deviceLocked=!1;verifiedBootState=sb.verified;verifiedBootHash;constructor(e={}){Object.assign(this,e)}};Fe.RootOfTrust=jn;K.__decorate([(0,b.AsnProp)({type:b.OctetString})],jn.prototype,"verifiedBootKey",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Boolean})],jn.prototype,"deviceLocked",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],jn.prototype,"verifiedBootState",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString,optional:!0})],jn.prototype,"verifiedBootHash",void 0);var uo=nb=class extends b.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,nb.prototype)}};Fe.IntegerSet=uo;Fe.IntegerSet=uo=nb=K.__decorate([(0,b.AsnType)({type:b.AsnTypeTypes.Set,itemType:b.AsnPropTypes.Integer})],uo);var W=class{purpose;algorithm;keySize;digest;padding;ecCurve;rsaPublicExponent;mgfDigest;rollbackResistance;earlyBootOnly;activeDateTime;originationExpireDateTime;usageExpireDateTime;usageCountLimit;noAuthRequired;userAuthType;authTimeout;allowWhileOnBody;trustedUserPresenceRequired;trustedConfirmationRequired;unlockedDeviceRequired;allApplications;applicationId;creationDateTime;origin;rollbackResistant;rootOfTrust;osVersion;osPatchLevel;attestationApplicationId;attestationIdBrand;attestationIdDevice;attestationIdProduct;attestationIdSerial;attestationIdImei;attestationIdMeid;attestationIdManufacturer;attestationIdModel;vendorPatchLevel;bootPatchLevel;deviceUniqueAttestation;attestationIdSecondImei;moduleHash;constructor(e={}){Object.assign(this,e)}};Fe.AuthorizationList=W;K.__decorate([(0,b.AsnProp)({context:1,type:uo,optional:!0})],W.prototype,"purpose",void 0);K.__decorate([(0,b.AsnProp)({context:2,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"algorithm",void 0);K.__decorate([(0,b.AsnProp)({context:3,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"keySize",void 0);K.__decorate([(0,b.AsnProp)({context:5,type:uo,optional:!0})],W.prototype,"digest",void 0);K.__decorate([(0,b.AsnProp)({context:6,type:uo,optional:!0})],W.prototype,"padding",void 0);K.__decorate([(0,b.AsnProp)({context:10,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"ecCurve",void 0);K.__decorate([(0,b.AsnProp)({context:200,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"rsaPublicExponent",void 0);K.__decorate([(0,b.AsnProp)({context:203,type:uo,optional:!0})],W.prototype,"mgfDigest",void 0);K.__decorate([(0,b.AsnProp)({context:303,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"rollbackResistance",void 0);K.__decorate([(0,b.AsnProp)({context:305,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"earlyBootOnly",void 0);K.__decorate([(0,b.AsnProp)({context:400,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"activeDateTime",void 0);K.__decorate([(0,b.AsnProp)({context:401,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"originationExpireDateTime",void 0);K.__decorate([(0,b.AsnProp)({context:402,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"usageExpireDateTime",void 0);K.__decorate([(0,b.AsnProp)({context:405,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"usageCountLimit",void 0);K.__decorate([(0,b.AsnProp)({context:503,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"noAuthRequired",void 0);K.__decorate([(0,b.AsnProp)({context:504,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"userAuthType",void 0);K.__decorate([(0,b.AsnProp)({context:505,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"authTimeout",void 0);K.__decorate([(0,b.AsnProp)({context:506,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"allowWhileOnBody",void 0);K.__decorate([(0,b.AsnProp)({context:507,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"trustedUserPresenceRequired",void 0);K.__decorate([(0,b.AsnProp)({context:508,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"trustedConfirmationRequired",void 0);K.__decorate([(0,b.AsnProp)({context:509,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"unlockedDeviceRequired",void 0);K.__decorate([(0,b.AsnProp)({context:600,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"allApplications",void 0);K.__decorate([(0,b.AsnProp)({context:601,type:b.OctetString,optional:!0})],W.prototype,"applicationId",void 0);K.__decorate([(0,b.AsnProp)({context:701,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"creationDateTime",void 0);K.__decorate([(0,b.AsnProp)({context:702,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"origin",void 0);K.__decorate([(0,b.AsnProp)({context:703,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"rollbackResistant",void 0);K.__decorate([(0,b.AsnProp)({context:704,type:jn,optional:!0})],W.prototype,"rootOfTrust",void 0);K.__decorate([(0,b.AsnProp)({context:705,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"osVersion",void 0);K.__decorate([(0,b.AsnProp)({context:706,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"osPatchLevel",void 0);K.__decorate([(0,b.AsnProp)({context:709,type:b.OctetString,optional:!0})],W.prototype,"attestationApplicationId",void 0);K.__decorate([(0,b.AsnProp)({context:710,type:b.OctetString,optional:!0})],W.prototype,"attestationIdBrand",void 0);K.__decorate([(0,b.AsnProp)({context:711,type:b.OctetString,optional:!0})],W.prototype,"attestationIdDevice",void 0);K.__decorate([(0,b.AsnProp)({context:712,type:b.OctetString,optional:!0})],W.prototype,"attestationIdProduct",void 0);K.__decorate([(0,b.AsnProp)({context:713,type:b.OctetString,optional:!0})],W.prototype,"attestationIdSerial",void 0);K.__decorate([(0,b.AsnProp)({context:714,type:b.OctetString,optional:!0})],W.prototype,"attestationIdImei",void 0);K.__decorate([(0,b.AsnProp)({context:715,type:b.OctetString,optional:!0})],W.prototype,"attestationIdMeid",void 0);K.__decorate([(0,b.AsnProp)({context:716,type:b.OctetString,optional:!0})],W.prototype,"attestationIdManufacturer",void 0);K.__decorate([(0,b.AsnProp)({context:717,type:b.OctetString,optional:!0})],W.prototype,"attestationIdModel",void 0);K.__decorate([(0,b.AsnProp)({context:718,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"vendorPatchLevel",void 0);K.__decorate([(0,b.AsnProp)({context:719,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"bootPatchLevel",void 0);K.__decorate([(0,b.AsnProp)({context:720,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"deviceUniqueAttestation",void 0);K.__decorate([(0,b.AsnProp)({context:723,type:b.OctetString,optional:!0})],W.prototype,"attestationIdSecondImei",void 0);K.__decorate([(0,b.AsnProp)({context:724,type:b.OctetString,optional:!0})],W.prototype,"moduleHash",void 0);var gc;(function(t){t[t.software=0]="software",t[t.trustedEnvironment=1]="trustedEnvironment",t[t.strongBox=2]="strongBox"})(gc||(Fe.SecurityLevel=gc={}));var W_;(function(t){t[t.KM2=1]="KM2",t[t.KM3=2]="KM3",t[t.KM4=3]="KM4",t[t.KM4_1=4]="KM4_1",t[t.keyMint1=100]="keyMint1",t[t.keyMint2=200]="keyMint2",t[t.keyMint3=300]="keyMint3",t[t.keyMint4=400]="keyMint4"})(W_||(Fe.Version=W_={}));var vr=class{attestationVersion=W_.KM4;attestationSecurityLevel=gc.software;keymasterVersion=0;keymasterSecurityLevel=gc.software;attestationChallenge=new b.OctetString;uniqueId=new b.OctetString;softwareEnforced=new W;teeEnforced=new W;constructor(e={}){Object.assign(this,e)}};Fe.KeyDescription=vr;K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Integer})],vr.prototype,"attestationVersion",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],vr.prototype,"attestationSecurityLevel",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Integer})],vr.prototype,"keymasterVersion",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],vr.prototype,"keymasterSecurityLevel",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString})],vr.prototype,"attestationChallenge",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString})],vr.prototype,"uniqueId",void 0);K.__decorate([(0,b.AsnProp)({type:W})],vr.prototype,"softwareEnforced",void 0);K.__decorate([(0,b.AsnProp)({type:W})],vr.prototype,"teeEnforced",void 0);var Fr=class t{attestationVersion=W_.keyMint4;attestationSecurityLevel=gc.software;keyMintVersion=0;keyMintSecurityLevel=gc.software;attestationChallenge=new b.OctetString;uniqueId=new b.OctetString;softwareEnforced=new W;hardwareEnforced=new W;constructor(e={}){Object.assign(this,e)}toLegacyKeyDescription(){return new vr({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})}static fromLegacyKeyDescription(e){return new t({attestationVersion:e.attestationVersion,attestationSecurityLevel:e.attestationSecurityLevel,keyMintVersion:e.keymasterVersion,keyMintSecurityLevel:e.keymasterSecurityLevel,attestationChallenge:e.attestationChallenge,uniqueId:e.uniqueId,softwareEnforced:e.softwareEnforced,hardwareEnforced:e.teeEnforced})}};Fe.KeyMintKeyDescription=Fr;K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Integer})],Fr.prototype,"attestationVersion",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],Fr.prototype,"attestationSecurityLevel",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Integer})],Fr.prototype,"keyMintVersion",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],Fr.prototype,"keyMintSecurityLevel",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString})],Fr.prototype,"attestationChallenge",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString})],Fr.prototype,"uniqueId",void 0);K.__decorate([(0,b.AsnProp)({type:W})],Fr.prototype,"softwareEnforced",void 0);K.__decorate([(0,b.AsnProp)({type:W})],Fr.prototype,"hardwareEnforced",void 0)});var dx=l(rr=>{"use strict";var ab;Object.defineProperty(rr,"__esModule",{value:!0});rr.NonStandardKeyMintKeyDescription=rr.NonStandardKeyDescription=rr.NonStandardAuthorizationList=rr.NonStandardAuthorization=void 0;var Hr=(v(),g(A)),Ne=S(),$_=ob(),z_=class extends $_.AuthorizationList{};rr.NonStandardAuthorization=z_;rr.NonStandardAuthorization=z_=Hr.__decorate([(0,Ne.AsnType)({type:Ne.AsnTypeTypes.Choice})],z_);var lo=ab=class extends Ne.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,ab.prototype)}findProperty(e){let r=this.find(i=>i[e]!==void 0);if(r)return r[e]}};rr.NonStandardAuthorizationList=lo;rr.NonStandardAuthorizationList=lo=ab=Hr.__decorate([(0,Ne.AsnType)({type:Ne.AsnTypeTypes.Sequence,itemType:z_})],lo);var mr=class{attestationVersion=$_.Version.KM4;attestationSecurityLevel=$_.SecurityLevel.software;keymasterVersion=0;keymasterSecurityLevel=$_.SecurityLevel.software;attestationChallenge=new Ne.OctetString;uniqueId=new Ne.OctetString;softwareEnforced=new lo;teeEnforced=new lo;get keyMintVersion(){return this.keymasterVersion}set keyMintVersion(e){this.keymasterVersion=e}get keyMintSecurityLevel(){return this.keymasterSecurityLevel}set keyMintSecurityLevel(e){this.keymasterSecurityLevel=e}get hardwareEnforced(){return this.teeEnforced}set hardwareEnforced(e){this.teeEnforced=e}constructor(e={}){Object.assign(this,e)}};rr.NonStandardKeyDescription=mr;Hr.__decorate([(0,Ne.AsnProp)({type:Ne.AsnPropTypes.Integer})],mr.prototype,"attestationVersion",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.AsnPropTypes.Enumerated})],mr.prototype,"attestationSecurityLevel",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.AsnPropTypes.Integer})],mr.prototype,"keymasterVersion",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.AsnPropTypes.Enumerated})],mr.prototype,"keymasterSecurityLevel",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.OctetString})],mr.prototype,"attestationChallenge",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.OctetString})],mr.prototype,"uniqueId",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:lo})],mr.prototype,"softwareEnforced",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:lo})],mr.prototype,"teeEnforced",void 0);var cb=class extends mr{constructor(e={}){"keymasterVersion"in e&&!("keyMintVersion"in e)&&(e.keyMintVersion=e.keymasterVersion),"keymasterSecurityLevel"in e&&!("keyMintSecurityLevel"in e)&&(e.keyMintSecurityLevel=e.keymasterSecurityLevel),"teeEnforced"in e&&!("hardwareEnforced"in e)&&(e.hardwareEnforced=e.teeEnforced),super(e)}};rr.NonStandardKeyMintKeyDescription=cb;rr.NonStandardKeyMintKeyDescription=cb=Hr.__decorate([(0,Ne.AsnType)({type:Ne.AsnTypeTypes.Sequence})],cb)});var px=l(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.AttestationApplicationId=vc.AttestationPackageInfo=void 0;var Y_=(v(),g(A)),fo=S(),Ac=class{packageName;version;constructor(e={}){Object.assign(this,e)}};vc.AttestationPackageInfo=Ac;Y_.__decorate([(0,fo.AsnProp)({type:fo.AsnPropTypes.OctetString})],Ac.prototype,"packageName",void 0);Y_.__decorate([(0,fo.AsnProp)({type:fo.AsnPropTypes.Integer})],Ac.prototype,"version",void 0);var Lf=class{packageInfos;signatureDigests;constructor(e={}){Object.assign(this,e)}};vc.AttestationApplicationId=Lf;Y_.__decorate([(0,fo.AsnProp)({type:Ac,repeated:"set"})],Lf.prototype,"packageInfos",void 0);Y_.__decorate([(0,fo.AsnProp)({type:fo.AsnPropTypes.OctetString,repeated:"set"})],Lf.prototype,"signatureDigests",void 0)});var yx=l(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});var ub=(v(),g(A));ub.__exportStar(ob(),Kf);ub.__exportStar(dx(),Kf);ub.__exportStar(px(),Kf)});var Ax=l(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});fb.verifyAttestationAndroidKey=jR;var _x=S(),ER=X(),hx=yx(),gx=Pr(),TR=bi(),xR=xn(),OR=Ec(),IR=Qe(),lb=ae(),BR=hc(),kR=Df();async function jR(t){let{authData:e,clientDataHash:r,attStmt:i,credentialPublicKey:n,aaguid:s,rootCertificates:o}=t,a=i.get("x5c"),c=i.get("sig"),u=i.get("alg");if(!a)throw new Error("No attestation certificate provided in attestation statement (Android Key)");if(!c)throw new Error("No attestation signature provided in attestation statement (Android Key)");if(!u)throw new Error("Attestation statement did not contain alg (Android Key)");if(!(0,IR.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (Android Key)`);let f=_x.AsnParser.parse(a[0],ER.Certificate),d=new Uint8Array(f.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey),y=(0,OR.convertCOSEtoPKCS)(n);if(!lb.isoUint8Array.areEqual(y,d))throw new Error("Credential public key does not equal leaf cert public key (Android Key)");let m=f.tbsCertificate.extensions?.find(Ae=>Ae.extnID===hx.id_ce_keyDescription);if(!m)throw new Error("Certificate did not contain extKeyStore (Android Key)");let x=_x.AsnParser.parse(m.extnValue,hx.KeyDescription),{attestationChallenge:T,teeEnforced:I,softwareEnforced:U}=x;if(!lb.isoUint8Array.areEqual(new Uint8Array(T.buffer),r))throw new Error("Attestation challenge was not equal to client data hash (Android Key)");if(I.allApplications!==void 0)throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');if(U.allApplications!==void 0)throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');let ee=await BR.MetadataService.getStatement(s);if(ee)try{await(0,kR.verifyAttestationWithMetadata)({statement:ee,credentialPublicKey:n,x5c:a,attestationStatementAlg:u})}catch(Ae){let oe=Ae;throw new Error(`${oe.message} (Android Key)`,{cause:oe})}else{let Ae=a.slice(0,-1).map(gx.convertCertBufferToPEM),oe=a.slice(-1).map(gx.convertCertBufferToPEM);try{await(0,TR.validateCertificatePath)(Ae,oe)}catch(ze){let it=ze;throw new Error(`${it.message} (Android Key)`,{cause:it})}if(o.length>0&&o.indexOf(oe[0])<0)throw new Error("x5c root certificate was not a known root certificate (Android Key)")}let pe=lb.isoUint8Array.concat([e,r]);return(0,xR.verifySignature)({signature:c,data:pe,x509Certificate:a[0],hashAlgorithm:u})}});var vx=l(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});pb.verifyAttestationApple=LR;var MR=S(),NR=X(),qR=bi(),RR=Pr(),DR=Tn(),UR=Ec(),db=ae();async function LR(t){let{attStmt:e,authData:r,clientDataHash:i,credentialPublicKey:n,rootCertificates:s}=t,o=e.get("x5c");if(!o)throw new Error("No attestation certificate provided in attestation statement (Apple)");try{await(0,qR.validateCertificatePath)(o.map(RR.convertCertBufferToPEM),s)}catch(I){let U=I;throw new Error(`${U.message} (Apple)`)}let a=MR.AsnParser.parse(o[0],NR.Certificate),{extensions:c,subjectPublicKeyInfo:u}=a.tbsCertificate;if(!c)throw new Error("credCert missing extensions (Apple)");let f=c.find(I=>I.extnID==="1.2.840.113635.100.8.2");if(!f)throw new Error('credCert missing "1.2.840.113635.100.8.2" extension (Apple)');let d=db.isoUint8Array.concat([r,i]),y=await(0,DR.toHash)(d),m=new Uint8Array(f.extnValue.buffer).slice(6);if(!db.isoUint8Array.areEqual(y,m))throw new Error("credCert nonce was not expected value (Apple)");let x=(0,UR.convertCOSEtoPKCS)(n),T=new Uint8Array(u.subjectPublicKey);if(!db.isoUint8Array.areEqual(x,T))throw new Error("Credential public key does not equal credCert public key (Apple)");return!0}});var mx=l(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});_b.verifyRegistrationResponse=nD;var KR=Ah(),VR=Qf(),GR=j_(),FR=Tn(),HR=vo(),WR=Qe(),$R=Yf(),zR=G0(),YR=W0(),yb=ae(),JR=L_(),QR=V0(),XR=YT(),ZR=rx(),eD=ix(),tD=fx(),rD=Ax(),iD=vx();async function nD(t){let{response:e,expectedChallenge:r,expectedOrigin:i,expectedRPID:n,expectedType:s,requireUserPresence:o=!0,requireUserVerification:a=!0,supportedAlgorithmIDs:c=QR.supportedCOSEAlgorithmIdentifiers,attestationSafetyNetEnforceCTSCheck:u=!0}=t,{id:f,rawId:d,type:y,response:m}=e;if(!f)throw new Error("Missing credential ID");if(f!==d)throw new Error("Credential ID was not base64url-encoded");if(y!=="public-key")throw new Error(`Unexpected credential type ${y}, expected "public-key"`);let x=(0,VR.decodeClientDataJSON)(m.clientDataJSON),{type:T,origin:I,challenge:U,tokenBinding:ee}=x;if(Array.isArray(s)){if(!s.includes(T)){let J=s.join(", ");throw new Error(`Unexpected registration response type "${T}", expected one of: ${J}`)}}else if(s){if(T!==s)throw new Error(`Unexpected registration response type "${T}", expected "${s}"`)}else if(T!=="webauthn.create")throw new Error(`Unexpected registration response type: ${T}`);if(typeof r=="function"){if(!await r(U))throw new Error(`Custom challenge verifier returned false for registration response challenge "${U}"`)}else if(U!==r)throw new Error(`Unexpected registration response challenge "${U}", expected "${r}"`);if(Array.isArray(i)){if(!i.includes(I))throw new Error(`Unexpected registration response origin "${I}", expected one of: ${i.join(", ")}`)}else if(I!==i)throw new Error(`Unexpected registration response origin "${I}", expected "${i}"`);if(ee){if(typeof ee!="object")throw new Error(`Unexpected value for TokenBinding "${ee}"`);if(["present","supported","not-supported"].indexOf(ee.status)<0)throw new Error(`Unexpected tokenBinding.status value of "${ee.status}"`)}let pe=yb.isoBase64URL.toBuffer(m.attestationObject),Ae=(0,KR.decodeAttestationObject)(pe),oe=Ae.get("fmt"),ze=Ae.get("authData"),it=Ae.get("attStmt"),ut=(0,GR.parseAuthenticatorData)(ze),{aaguid:lt,rpIdHash:br,flags:ir,credentialID:Sr,counter:zi,credentialPublicKey:Ye,extensionsData:pt}=ut,yt;if(n){let J=[];typeof n=="string"?J=[n]:J=n,yt=await(0,YR.matchExpectedRPID)(br,J)}if(o&&!ir.up)throw new Error("User presence was required, but user was not present");if(a&&!ir.uv)throw new Error("User verification was required, but user could not be verified");if(!Sr)throw new Error("No credential ID was provided by authenticator");if(!Ye)throw new Error("No public key was provided by authenticator");if(!lt)throw new Error("No AAGUID was present during registration");let Wr=(0,HR.decodeCredentialPublicKey)(Ye).get(WR.COSEKEYS.alg);if(typeof Wr!="number")throw new Error("Credential public key was missing numeric alg");if(!c.includes(Wr)){let J=c.join(", ");throw new Error(`Unexpected public key alg "${Wr}", expected one of "${J}"`)}let Ci=await(0,FR.toHash)(yb.isoBase64URL.toBuffer(m.clientDataJSON)),Pi=JR.SettingsService.getRootCertificates({identifier:oe}),Kt={aaguid:lt,attStmt:it,authData:ze,clientDataHash:Ci,credentialID:Sr,credentialPublicKey:Ye,rootCertificates:Pi,rpIdHash:br,attestationSafetyNetEnforceCTSCheck:u},F=!1;if(oe==="fido-u2f")F=await(0,XR.verifyAttestationFIDOU2F)(Kt);else if(oe==="packed")F=await(0,ZR.verifyAttestationPacked)(Kt);else if(oe==="android-safetynet")F=await(0,eD.verifyAttestationAndroidSafetyNet)(Kt);else if(oe==="android-key")F=await(0,rD.verifyAttestationAndroidKey)(Kt);else if(oe==="tpm")F=await(0,tD.verifyAttestationTPM)(Kt);else if(oe==="apple")F=await(0,iD.verifyAttestationApple)(Kt);else if(oe==="none"){if(it.size>0)throw new Error("None attestation had unexpected attestation statement");F=!0}else throw new Error(`Unsupported Attestation Format: ${oe}`);if(!F)return{verified:!1};let{credentialDeviceType:$r,credentialBackedUp:po}=(0,zR.parseBackupFlags)(ir);return{verified:!0,registrationInfo:{fmt:oe,aaguid:(0,$R.convertAAGUIDToString)(lt),credentialType:y,credential:{id:yb.isoBase64URL.fromBuffer(Sr),publicKey:Ye,counter:zi,transports:e.response.transports},attestationObject:pe,userVerified:ir.uv,credentialDeviceType:$r,credentialBackedUp:po,origin:x.origin,rpID:yt,authenticatorExtensionResults:pt}}}});var bx=l(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});hb.generateAuthenticationOptions=oD;var J_=ae(),sD=K_();async function oD(t){let{allowCredentials:e,challenge:r=await(0,sD.generateChallenge)(),timeout:i=6e4,userVerification:n="preferred",extensions:s,rpID:o}=t,a=r;return typeof a=="string"&&(a=J_.isoUint8Array.fromUTF8String(a)),{rpId:o,challenge:J_.isoBase64URL.fromBuffer(a),allowCredentials:e?.map(c=>{if(!J_.isoBase64URL.isBase64URL(c.id))throw new Error(`allowCredential id "${c.id}" is not a valid base64url string`);return{...c,id:J_.isoBase64URL.trimPadding(c.id),type:"public-key"}}),timeout:i,userVerification:n,extensions:s}}});var Sx=l(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});gb.verifyAuthenticationResponse=pD;var aD=Qf(),cD=Tn(),uD=xn(),lD=j_(),fD=G0(),dD=W0(),mc=ae();async function pD(t){let{response:e,expectedChallenge:r,expectedOrigin:i,expectedRPID:n,expectedType:s,credential:o,requireUserVerification:a=!0,advancedFIDOConfig:c}=t,{id:u,rawId:f,type:d,response:y}=e;if(!u)throw new Error("Missing credential ID");if(u!==f)throw new Error("Credential ID was not base64url-encoded");if(d!=="public-key")throw new Error(`Unexpected credential type ${d}, expected "public-key"`);if(!e)throw new Error("Credential missing response");if(typeof y?.clientDataJSON!="string")throw new Error("Credential response clientDataJSON was not a string");let m=(0,aD.decodeClientDataJSON)(y.clientDataJSON),{type:x,origin:T,challenge:I,tokenBinding:U}=m;if(Array.isArray(s)){if(!s.includes(x)){let yt=s.join(", ");throw new Error(`Unexpected authentication response type "${x}", expected one of: ${yt}`)}}else if(s){if(x!==s)throw new Error(`Unexpected authentication response type "${x}", expected "${s}"`)}else if(x!=="webauthn.get")throw new Error(`Unexpected authentication response type: ${x}`);if(typeof r=="function"){if(!await r(I))throw new Error(`Custom challenge verifier returned false for registration response challenge "${I}"`)}else if(I!==r)throw new Error(`Unexpected authentication response challenge "${I}", expected "${r}"`);if(Array.isArray(i)){if(!i.includes(T)){let yt=i.join(", ");throw new Error(`Unexpected authentication response origin "${T}", expected one of: ${yt}`)}}else if(T!==i)throw new Error(`Unexpected authentication response origin "${T}", expected "${i}"`);if(!mc.isoBase64URL.isBase64URL(y.authenticatorData))throw new Error("Credential response authenticatorData was not a base64url string");if(!mc.isoBase64URL.isBase64URL(y.signature))throw new Error("Credential response signature was not a base64url string");if(y.userHandle&&typeof y.userHandle!="string")throw new Error("Credential response userHandle was not a string");if(U){if(typeof U!="object")throw new Error("ClientDataJSON tokenBinding was not an object");if(["present","supported","notSupported"].indexOf(U.status)<0)throw new Error(`Unexpected tokenBinding status ${U.status}`)}let ee=mc.isoBase64URL.toBuffer(y.authenticatorData),pe=(0,lD.parseAuthenticatorData)(ee),{rpIdHash:Ae,flags:oe,counter:ze,extensionsData:it}=pe,ut=[];typeof n=="string"?ut=[n]:ut=n;let lt=await(0,dD.matchExpectedRPID)(Ae,ut);if(c!==void 0){let{userVerification:yt}=c;if(yt==="required"&&!oe.uv)throw new Error("User verification required, but user could not be verified")}else{if(!oe.up)throw new Error("User not present during authentication");if(a&&!oe.uv)throw new Error("User verification required, but user could not be verified")}let br=await(0,cD.toHash)(mc.isoBase64URL.toBuffer(y.clientDataJSON)),ir=mc.isoUint8Array.concat([ee,br]),Sr=mc.isoBase64URL.toBuffer(y.signature);if((ze>0||o.counter>0)&&ze<=o.counter)throw new Error(`Response counter value ${ze} was lower than expected ${o.counter}`);let{credentialDeviceType:zi,credentialBackedUp:Ye}=(0,fD.parseBackupFlags)(oe);return{verified:await(0,uD.verifySignature)({signature:Sr,data:ir,credentialPublicKey:o.publicKey}),authenticationInfo:{newCounter:ze,credentialID:o.id,userVerified:oe.uv,credentialDeviceType:zi,credentialBackedUp:Ye,authenticatorExtensionResults:it,origin:m.origin,rpID:lt}}}});var Cx=l(wx=>{"use strict";Object.defineProperty(wx,"__esModule",{value:!0})});var Ex=l(Px=>{"use strict";Object.defineProperty(Px,"__esModule",{value:!0})});var Tx=l(Lt=>{"use strict";var yD=Lt&&Lt.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Mn=Lt&&Lt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yD(e,t,r)};Object.defineProperty(Lt,"__esModule",{value:!0});Mn(V0(),Lt);Mn(mx(),Lt);Mn(bx(),Lt);Mn(Sx(),Lt);Mn(hc(),Lt);Mn(L_(),Lt);Mn(Cx(),Lt);Mn(Ex(),Lt)});module.exports=Tx();
204
+ `});var U_=l(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.SettingsService=void 0;var Mq=Pr(),Nq=NT(),D_=qT(),qq=RT(),Rq=DT(),q0=class{constructor(){Object.defineProperty(this,"pemCertificates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pemCertificates=new Map}setRootCertificates(e){let{identifier:r,certificates:i}=e,n=[];for(let s of i)s instanceof Uint8Array?n.push((0,Mq.convertCertBufferToPEM)(s)):n.push(s);this.pemCertificates.set(r,n)}getRootCertificates(e){let{identifier:r}=e;return this.pemCertificates.get(r)??[]}};xn.SettingsService=new q0;xn.SettingsService.setRootCertificates({identifier:"android-key",certificates:[D_.Google_Hardware_Attestation_Root_1,D_.Google_Hardware_Attestation_Root_2,D_.Google_Hardware_Attestation_Root_3,D_.Google_Hardware_Attestation_Root_4]});xn.SettingsService.setRootCertificates({identifier:"android-safetynet",certificates:[Nq.GlobalSign_Root_CA]});xn.SettingsService.setRootCertificates({identifier:"apple",certificates:[qq.Apple_WebAuthn_Root_CA]});xn.SettingsService.setRootCertificates({identifier:"mds",certificates:[Rq.GlobalSign_Root_CA_R3]})});var D0=l(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});R0.verifyMDSBlob=Fq;var Dq=BT(),Uq=jT(),Lq=bi(),Kq=Pr(),Vq=MT(),Gq=U_();async function Fq(t){let e=(0,Dq.parseJWT)(t),r=e[0],i=e[1],n=r.x5c.map(Kq.convertCertBufferToPEM);try{let y=Gq.SettingsService.getRootCertificates({identifier:"mds"});await(0,Lq.validateCertificatePath)(n,y)}catch(y){let m=y;throw new Error("BLOB certificate path could not be validated",{cause:m})}let s=n[0];if(!await(0,Uq.verifyJWT)(t,(0,Vq.convertPEMToBytes)(s)))throw new Error("BLOB signature could not be verified");let a=[];for(let y of i.entries)y.aaguid&&y.metadataStatement&&a.push(y.metadataStatement);let[c,u,f]=i.nextUpdate.split("-"),d=new Date(parseInt(c,10),parseInt(u,10)-1,parseInt(f,10));return{statements:a,parsedNextUpdate:d,payload:i}}});var LT=l(ge=>{"use strict";var UT=ge&&ge.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),Hq=ge&&ge.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mt=ge&&ge.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UT(e,t,r)},Wq=ge&&ge.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&UT(e,t,r);return Hq(e,t),e};Object.defineProperty(ge,"__esModule",{value:!0});ge.cose=void 0;mt(zf(),ge);mt(Pr(),ge);mt(Pc(),ge);mt(gh(),ge);mt(Jf(),ge);mt(vo(),ge);mt(L_(),ge);mt(Ah(),ge);mt(Du(),ge);mt(w0(),ge);mt(k_(),ge);mt(En(),ge);mt(bi(),ge);mt(Tn(),ge);mt(ae(),ge);mt(D0(),ge);ge.cose=Wq(Qe())});var KT=l(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.verifyOKP=Jq;var jf=Qe(),$q=LT(),zq=Wf(),Yq=Rn();async function Jq(t){let{cosePublicKey:e,signature:r,data:i}=t,n=await(0,Yq.getWebCrypto)(),s=e.get(jf.COSEKEYS.alg),o=e.get(jf.COSEKEYS.crv),a=e.get(jf.COSEKEYS.x);if(!s)throw new Error("Public key was missing alg (OKP)");if(!(0,jf.isCOSEAlg)(s))throw new Error(`Public key had invalid alg ${s} (OKP)`);if(!o)throw new Error("Public key was missing crv (OKP)");if(!a)throw new Error("Public key was missing x (OKP)");let c;if(o===jf.COSECRV.ED25519)c="Ed25519";else throw new Error(`Unexpected COSE crv value of ${o} (OKP)`);let u={kty:"OKP",crv:c,alg:"EdDSA",x:$q.isoBase64URL.fromBuffer(a),ext:!1},f={name:c,namedCurve:c},d=await(0,zq.importKey)({keyData:u,algorithm:f}),y={name:c};return n.subtle.verify(y,d,r,i)}});var GT=l(K0=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});K0.unwrapEC2Signature=e2;var Qq=S(),Xq=yy(),L0=Qe(),Zq=ae();function e2(t,e){let r=Qq.AsnParser.parse(t,Xq.ECDSASigValue),i=new Uint8Array(r.r),n=new Uint8Array(r.s),s=t2(e),o=VT(i,s),a=VT(n,s);return Zq.isoUint8Array.concat([o,a])}function t2(t){switch(t){case L0.COSECRV.P256:return 32;case L0.COSECRV.P384:return 48;case L0.COSECRV.P521:return 66;default:throw new Error(`Unexpected COSE crv value of ${t} (EC2)`)}}function VT(t,e){let r;if(t.length<e)r=new Uint8Array(e),r.set(t,e-t.length);else if(t.length===e)r=t;else if(t.length===e+1&&t[0]===0&&(t[1]&128)===128)r=t.subarray(1);else throw new Error(`Invalid signature component length ${t.length}, expected ${e}`);return r}});var FT=l(V0=>{"use strict";Object.defineProperty(V0,"__esModule",{value:!0});V0.verify=o2;var dc=Qe(),r2=uh(),i2=dh(),n2=KT(),s2=GT();function o2(t){let{cosePublicKey:e,signature:r,data:i,shaHashOverride:n}=t;if((0,dc.isCOSEPublicKeyEC2)(e)){let o=e.get(dc.COSEKEYS.crv);if(!(0,dc.isCOSECrv)(o))throw new Error(`unknown COSE curve ${o}`);let a=(0,s2.unwrapEC2Signature)(r,o);return(0,r2.verifyEC2)({cosePublicKey:e,signature:a,data:i,shaHashOverride:n})}else{if((0,dc.isCOSEPublicKeyRSA)(e))return(0,i2.verifyRSA)({cosePublicKey:e,signature:r,data:i,shaHashOverride:n});if((0,dc.isCOSEPublicKeyOKP)(e))return(0,n2.verifyOKP)({cosePublicKey:e,signature:r,data:i})}let s=e.get(dc.COSEKEYS.kty);throw new Error(`Signature verification with public key of kty ${s} is not supported by this method`)}});var HT=l(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.verify=On.getRandomValues=On.digest=void 0;var a2=Lb();Object.defineProperty(On,"digest",{enumerable:!0,get:function(){return a2.digest}});var c2=Kb();Object.defineProperty(On,"getRandomValues",{enumerable:!0,get:function(){return c2.getRandomValues}});var u2=FT();Object.defineProperty(On,"verify",{enumerable:!0,get:function(){return u2.verify}})});var WT=l(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.areEqual=l2;wi.toHex=f2;wi.fromHex=d2;wi.concat=p2;wi.toUTF8String=y2;wi.fromUTF8String=_2;wi.fromASCIIString=h2;wi.toDataView=g2;function l2(t,e){return t.length!=e.length?!1:t.every((r,i)=>r===e[i])}function f2(t){return Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function d2(t){if(!t)return Uint8Array.from([]);if(!(t.length!==0&&t.length%2===0&&!/[^a-fA-F0-9]/u.test(t)))throw new Error("Invalid hex string");let r=t.match(/.{1,2}/g)??[];return Uint8Array.from(r.map(i=>parseInt(i,16)))}function p2(t){let e=0,r=t.reduce((n,s)=>n+s.length,0),i=new Uint8Array(r);return t.forEach(n=>{i.set(n,e),e+=n.length}),i}function y2(t){return new globalThis.TextDecoder("utf-8").decode(t)}function _2(t){return new globalThis.TextEncoder().encode(t)}function h2(t){return Uint8Array.from(t.split("").map(e=>e.charCodeAt(0)))}function g2(t){return new DataView(t.buffer,t.byteOffset,t.length)}});var ae=l(bt=>{"use strict";var A2=bt&&bt.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),v2=bt&&bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K_=bt&&bt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&A2(e,t,r);return v2(e,t),e};Object.defineProperty(bt,"__esModule",{value:!0});bt.isoUint8Array=bt.isoCrypto=bt.isoCBOR=bt.isoBase64URL=void 0;bt.isoBase64URL=K_(Bb());bt.isoCBOR=K_(Ub());bt.isoCrypto=K_(HT());bt.isoUint8Array=K_(WT())});var L_=l(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc._generateChallengeInternals=void 0;pc.generateChallenge=b2;var m2=ae();async function b2(){let t=new Uint8Array(32);return await m2.isoCrypto.getRandomValues(t),pc._generateChallengeInternals.stubThis(t)}pc._generateChallengeInternals={stubThis:t=>t}});var G0=l(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.supportedCOSEAlgorithmIdentifiers=void 0;Nf.generateRegistrationOptions=E2;var S2=L_(),w2=Ah(),Mf=ae();Nf.supportedCOSEAlgorithmIdentifiers=[-8,-7,-36,-37,-38,-39,-257,-258,-259,-65535];var C2={residentKey:"preferred",userVerification:"preferred"},P2=[-8,-7,-257];async function E2(t){let{rpName:e,rpID:r,userName:i,userID:n,challenge:s=await(0,S2.generateChallenge)(),userDisplayName:o="",timeout:a=6e4,attestationType:c="none",excludeCredentials:u=[],authenticatorSelection:f=C2,extensions:d,supportedAlgorithmIDs:y=P2,preferredAuthenticatorType:m}=t,x=y.map(ee=>({alg:ee,type:"public-key"}));f.residentKey===void 0?f.requireResidentKey&&(f.residentKey="required"):f.requireResidentKey=f.residentKey==="required";let T=s;if(typeof T=="string"&&(T=Mf.isoUint8Array.fromUTF8String(T)),typeof n=="string")throw new Error("String values for `userID` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids");let I=n;I||(I=await(0,w2.generateUserID)());let U=[];return m&&(m==="securityKey"?(U.push("security-key"),f.authenticatorAttachment="cross-platform"):m==="localDevice"?(U.push("client-device"),f.authenticatorAttachment="platform"):m==="remoteDevice"&&(U.push("hybrid"),f.authenticatorAttachment="cross-platform")),{challenge:Mf.isoBase64URL.fromBuffer(T),rp:{name:e,id:r},user:{id:Mf.isoBase64URL.fromBuffer(I),name:i,displayName:o},pubKeyCredParams:x,timeout:a,attestation:c,excludeCredentials:u.map(ee=>{if(!Mf.isoBase64URL.isBase64URL(ee.id))throw new Error(`excludeCredential id "${ee.id}" is not a valid base64url string`);return{...ee,id:Mf.isoBase64URL.trimPadding(ee.id),type:"public-key"}}),authenticatorSelection:f,extensions:{...d,credProps:!0},hints:U}}});var F0=l(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});qf.InvalidBackupFlags=void 0;qf.parseBackupFlags=T2;function T2({be:t,bs:e}){let r=e,i="singleDevice";if(t&&(i="multiDevice"),i==="singleDevice"&&r)throw new V_("Single-device credential indicated that it was backed up, which should be impossible.");return{credentialDeviceType:i,credentialBackedUp:r}}var V_=class extends Error{constructor(e){super(e),this.name="InvalidBackupFlags"}};qf.InvalidBackupFlags=V_});var $0=l(W0=>{"use strict";Object.defineProperty(W0,"__esModule",{value:!0});W0.matchExpectedRPID=O2;var x2=En(),$T=ae();async function O2(t,e){try{return await Promise.any(e.map(i=>new Promise((n,s)=>{(0,x2.toHash)($T.isoUint8Array.fromASCIIString(i)).then(o=>{$T.isoUint8Array.areEqual(t,o)?n(i):s()})})))}catch(r){throw r.name==="AggregateError"?new H0:r}}var H0=class extends Error{constructor(){super("Unexpected RP ID hash"),this.name="UnexpectedRPIDHash"}}});var YT=l(z0=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});z0.verifyAttestationFIDOU2F=N2;var I2=Pc(),B2=Pr(),k2=bi(),j2=Tn(),zT=ae(),M2=Qe();async function N2(t){let{attStmt:e,clientDataHash:r,rpIdHash:i,credentialID:n,credentialPublicKey:s,aaguid:o,rootCertificates:a}=t,c=Uint8Array.from([0]),u=(0,I2.convertCOSEtoPKCS)(s),f=zT.isoUint8Array.concat([c,i,r,n,u]),d=e.get("sig"),y=e.get("x5c");if(!y)throw new Error("No attestation certificate provided in attestation statement (FIDOU2F)");if(!d)throw new Error("No attestation signature provided in attestation statement (FIDOU2F)");let m=Number.parseInt(zT.isoUint8Array.toHex(o),16);if(m!==0)throw new Error(`AAGUID "${m}" was not expected value`);try{await(0,k2.validateCertificatePath)(y.map(B2.convertCertBufferToPEM),a)}catch(x){let T=x;throw new Error(`${T.message} (FIDOU2F)`)}return(0,j2.verifySignature)({signature:d,data:f,x509Certificate:y[0],hashAlgorithm:M2.COSEALG.ES256})}});var Q0=l(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});J0.validateExtFIDOGenCEAAGUID=q2;var JT=S(),Y0=ae(),QT="1.3.6.1.4.1.45724.1.1.4";function q2(t,e){if(!t)return!0;let r=t.find(o=>o.extnID===QT);if(!r)return!0;let i=JT.AsnParser.parse(r.extnValue,JT.OctetString),n=new Uint8Array(i.buffer);if(!Y0.isoUint8Array.areEqual(e,n)){let o=Y0.isoUint8Array.toHex(n),a=Y0.isoUint8Array.toHex(e);throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${QT}) value of "${o}" was present but not equal to attestation statement AAGUID value of "${a}"`)}return!0}});var XT=l(X0=>{"use strict";Object.defineProperty(X0,"__esModule",{value:!0});X0.getLogger=R2;function R2(t){return(e,...r)=>{}}});var _c=l(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.MetadataService=yc.BaseMetadataService=void 0;var D2=zf(),U2=D0(),L2=XT(),K2=b0(),V2={url:"",no:0,nextUpdate:new Date(0)},G2="https://mds.fidoalliance.org/",er;(function(t){t[t.DISABLED=0]="DISABLED",t[t.REFRESHING=1]="REFRESHING",t[t.READY=2]="READY"})(er||(er={}));var so=(0,L2.getLogger)("MetadataService"),G_=class{constructor(){Object.defineProperty(this,"mdsCache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"statementCache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:er.DISABLED}),Object.defineProperty(this,"verificationMode",{enumerable:!0,configurable:!0,writable:!0,value:"strict"})}async initialize(e={}){this.statementCache={};let{mdsServers:r=[G2],statements:i,verificationMode:n}=e;if(this.setState(er.REFRESHING),i?.length){let s=0;i.forEach(o=>{o.aaguid&&(this.statementCache[o.aaguid]={entry:{metadataStatement:o,statusReports:[],timeOfLastStatusChange:"1970-01-01"},url:V2.url},s+=1)}),so(`Cached ${s} local statements`)}if(r?.length){let s=Object.keys(this.statementCache).length,o=r.length;for(let u of r)try{let f={url:u,no:0,nextUpdate:new Date(0)},d=await this.downloadBlob(f);await this.verifyBlob(d,f)}catch(f){so(`Could not download BLOB from ${u}:`,f),o-=1}let c=Object.keys(this.statementCache).length-s;so(`Cached ${c} statements from ${o} metadata server(s)`)}n&&(this.verificationMode=n),this.setState(er.READY)}async getStatement(e){if(this.state===er.DISABLED||!e)return;e instanceof Uint8Array&&(e=(0,D2.convertAAGUIDToString)(e)),await this.pauseUntilReady();let r=this.statementCache[e];if(!r){if(this.verificationMode==="strict")throw new Error(`No metadata statement found for aaguid "${e}"`);return}if(r.url){let n=this.mdsCache[r.url];if(new Date>n.nextUpdate)try{this.setState(er.REFRESHING);let o=await this.downloadBlob(n);await this.verifyBlob(o,n)}finally{this.setState(er.READY)}}let{entry:i}=r;for(let n of i.statusReports){let{status:s}=n;if(s==="USER_VERIFICATION_BYPASS"||s==="ATTESTATION_KEY_COMPROMISE"||s==="USER_KEY_REMOTE_COMPROMISE"||s==="USER_KEY_PHYSICAL_COMPROMISE")throw new Error(`Detected compromised aaguid "${e}"`)}return i.metadataStatement}async downloadBlob(e){let{url:r}=e;return await(await(0,K2.fetch)(r)).text()}async verifyBlob(e,r){let{url:i,no:n}=r,{payload:s,parsedNextUpdate:o}=await(0,U2.verifyMDSBlob)(e);if(s.no<=n)throw new Error(`Latest BLOB no. ${s.no} is not greater than previous no. ${n}`);for(let a of s.entries)a.aaguid&&(this.statementCache[a.aaguid]={entry:a,url:i});i?this.mdsCache[i]={...r,no:s.no,nextUpdate:o}:o<new Date&&so(`\u26A0\uFE0F This MDS blob (serial: ${s.no}) contains stale data as of ${o.toISOString()}. Please consider re-initializing MetadataService with a newer MDS blob.`)}pauseUntilReady(){return this.state===er.READY?new Promise(r=>{r()}):new Promise((r,i)=>{let o=700,a=globalThis.setInterval(()=>{o<1?(clearInterval(a),i(`State did not become ready in ${7e4/1e3} seconds`)):this.state===er.READY&&(clearInterval(a),r()),o-=1},100)})}setState(e){this.state=e,e===er.DISABLED?so("MetadataService is DISABLED"):e===er.REFRESHING?so("MetadataService is REFRESHING"):e===er.READY&&so("MetadataService is READY")}};yc.BaseMetadataService=G_;yc.MetadataService=new G_});var Rf=l(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.algSignToCOSEInfoMap=void 0;ao.verifyAttestationWithMetadata=W2;var ZT=Pr(),F2=bi(),H2=vo(),oo=Qe();async function W2({statement:t,credentialPublicKey:e,x5c:r,attestationStatementAlg:i}){let{authenticationAlgorithms:n,authenticatorGetInfo:s,attestationRootCertificates:o}=t,a=new Set;n.forEach(I=>{let U=ao.algSignToCOSEInfoMap[I];U&&a.add(U)});let c=(0,H2.decodeCredentialPublicKey)(e),u=c.get(oo.COSEKEYS.kty),f=c.get(oo.COSEKEYS.alg);if(!u)throw new Error("Credential public key was missing kty");if(!f)throw new Error("Credential public key was missing alg");if(!u)throw new Error("Credential public key was missing kty");let d={kty:u,alg:f};if((0,oo.isCOSEPublicKeyEC2)(c)){let I=c.get(oo.COSEKEYS.crv);d.crv=I}let y=!1;for(let I of a)if(I.alg===d.alg&&I.kty===d.kty&&((I.kty===oo.COSEKTY.EC2||I.kty===oo.COSEKTY.OKP)&&(I.crv,d.crv),y=!0),y)break;if(!y){let I=n.map(pe=>`'${pe}' (COSE info: ${ex(ao.algSignToCOSEInfoMap[pe])})`),U=JSON.stringify(I,null,2).replace(/"/g,""),ee=ex(d);throw new Error(`Public key parameters ${ee} did not match any of the following metadata algorithms:
205
+ ${U}`)}if(i!==void 0&&s?.algorithms!==void 0){let I=s.algorithms.map(U=>U.alg);if(I.indexOf(i)<0)throw new Error(`Attestation statement alg ${i} did not match one of ${I}`)}let m=r.map(ZT.convertCertBufferToPEM),x=o.map(ZT.convertCertBufferToPEM),T=!1;if(m.length===1&&x.indexOf(m[0])>=0&&(T=!0),!T)try{await(0,F2.validateCertificatePath)(m,x)}catch(I){let U=I;throw new Error(`Could not validate certificate path with any metadata root certificates: ${U.message}`)}return!0}ao.algSignToCOSEInfoMap={secp256r1_ecdsa_sha256_raw:{kty:2,alg:-7,crv:1},secp256r1_ecdsa_sha256_der:{kty:2,alg:-7,crv:1},rsassa_pss_sha256_raw:{kty:3,alg:-37},rsassa_pss_sha256_der:{kty:3,alg:-37},secp256k1_ecdsa_sha256_raw:{kty:2,alg:-47,crv:8},secp256k1_ecdsa_sha256_der:{kty:2,alg:-47,crv:8},rsassa_pss_sha384_raw:{kty:3,alg:-38},rsassa_pkcsv15_sha256_raw:{kty:3,alg:-257},rsassa_pkcsv15_sha384_raw:{kty:3,alg:-258},rsassa_pkcsv15_sha512_raw:{kty:3,alg:-259},rsassa_pkcsv15_sha1_raw:{kty:3,alg:-65535},secp384r1_ecdsa_sha384_raw:{kty:2,alg:-35,crv:2},secp512r1_ecdsa_sha256_raw:{kty:2,alg:-36,crv:3},ed25519_eddsa_sha512_raw:{kty:1,alg:-8,crv:6}};function ex(t){let{kty:e,alg:r,crv:i}=t,n="";return e!==oo.COSEKTY.RSA?n=`{ kty: ${e}, alg: ${r}, crv: ${i} }`:n=`{ kty: ${e}, alg: ${r} }`,n}});var rx=l(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});Z0.verifyAttestationPacked=tR;var $2=Qe(),z2=Pr(),Y2=bi(),J2=Du(),tx=Tn(),Q2=ae(),X2=Q0(),Z2=_c(),eR=Rf();async function tR(t){let{attStmt:e,clientDataHash:r,authData:i,credentialPublicKey:n,aaguid:s,rootCertificates:o}=t,a=e.get("sig"),c=e.get("x5c"),u=e.get("alg");if(!a)throw new Error("No attestation signature provided in attestation statement (Packed)");if(!u)throw new Error("Attestation statement did not contain alg (Packed)");if(!(0,$2.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (Packed)`);let f=Q2.isoUint8Array.concat([i,r]),d=!1;if(c){let{subject:y,basicConstraintsCA:m,version:x,notBefore:T,notAfter:I,parsedCertificate:U}=(0,J2.getCertificateInfo)(c[0]),{OU:ee,CN:pe,O:Ae,C:oe}=y;if(ee!=="Authenticator Attestation")throw new Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)');if(!pe)throw new Error("Certificate CN was empty (Packed|Full)");if(!Ae)throw new Error("Certificate O was empty (Packed|Full)");if(!oe||oe.length!==2)throw new Error("Certificate C was not two-character ISO 3166 code (Packed|Full)");if(m)throw new Error("Certificate basic constraints CA was not `false` (Packed|Full)");if(x!==2)throw new Error("Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)");let ze=new Date;if(T>ze)throw new Error(`Certificate not good before "${T.toString()}" (Packed|Full)`);if(ze=new Date,I<ze)throw new Error(`Certificate not good after "${I.toString()}" (Packed|Full)`);try{await(0,X2.validateExtFIDOGenCEAAGUID)(U.tbsCertificate.extensions,s)}catch(ut){let lt=ut;throw new Error(`${lt.message} (Packed|Full)`)}let it=await Z2.MetadataService.getStatement(s);if(it){if(it.attestationTypes.indexOf("basic_full")<0)throw new Error("Metadata does not indicate support for full attestations (Packed|Full)");try{await(0,eR.verifyAttestationWithMetadata)({statement:it,credentialPublicKey:n,x5c:c,attestationStatementAlg:u})}catch(ut){let lt=ut;throw new Error(`${lt.message} (Packed|Full)`)}}else try{await(0,Y2.validateCertificatePath)(c.map(z2.convertCertBufferToPEM),o)}catch(ut){let lt=ut;throw new Error(`${lt.message} (Packed|Full)`)}d=await(0,tx.verifySignature)({signature:a,data:f,x509Certificate:c[0],hashAlgorithm:u})}else d=await(0,tx.verifySignature)({signature:a,data:f,credentialPublicKey:n,hashAlgorithm:u});return d}});var ix=l(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});eb.verifyAttestationAndroidSafetyNet=uR;var rR=En(),iR=Tn(),nR=Du(),sR=bi(),oR=Pr(),In=ae(),aR=_c(),cR=Rf();async function uR(t){let{attStmt:e,clientDataHash:r,authData:i,aaguid:n,rootCertificates:s,verifyTimestampMS:o=!0,credentialPublicKey:a,attestationSafetyNetEnforceCTSCheck:c}=t,u=e.get("alg"),f=e.get("response");if(!e.get("ver"))throw new Error("No ver value in attestation (SafetyNet)");if(!f)throw new Error("No response was included in attStmt by authenticator (SafetyNet)");let m=In.isoUint8Array.toUTF8String(f).split("."),x=JSON.parse(In.isoBase64URL.toUTF8String(m[0])),T=JSON.parse(In.isoBase64URL.toUTF8String(m[1])),I=m[2],{nonce:U,ctsProfileMatch:ee,timestampMs:pe}=T;if(o){let Ye=Date.now();if(pe>Date.now())throw new Error(`Payload timestamp "${pe}" was later than "${Ye}" (SafetyNet)`);let pt=pe+60*1e3;if(Ye=Date.now(),pt<Ye)throw new Error(`Payload timestamp "${pt}" has expired (SafetyNet)`)}let Ae=In.isoUint8Array.concat([i,r]),oe=await(0,rR.toHash)(Ae),ze=In.isoBase64URL.fromBuffer(oe,"base64");if(U!==ze)throw new Error("Could not verify payload nonce (SafetyNet)");if(c&&!ee)throw new Error("Could not verify device integrity (SafetyNet)");let it=In.isoBase64URL.toBuffer(x.x5c[0],"base64"),ut=(0,nR.getCertificateInfo)(it),{subject:lt}=ut;if(lt.CN!=="attest.android.com")throw new Error('Certificate common name was not "attest.android.com" (SafetyNet)');let br=await aR.MetadataService.getStatement(n);if(br)try{await(0,cR.verifyAttestationWithMetadata)({statement:br,credentialPublicKey:a,x5c:x.x5c,attestationStatementAlg:u})}catch(Ye){let pt=Ye;throw new Error(`${pt.message} (SafetyNet)`)}else try{await(0,sR.validateCertificatePath)(x.x5c.map(oR.convertCertBufferToPEM),s)}catch(Ye){let pt=Ye;throw new Error(`${pt.message} (SafetyNet)`)}let ir=In.isoUint8Array.fromUTF8String(`${m[0]}.${m[1]}`),Sr=In.isoBase64URL.toBuffer(I);return await(0,iR.verifySignature)({signature:Sr,data:ir,x509Certificate:it,hashAlgorithm:u})}});var F_=l(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.TPM_ECC_CURVE_COSE_CRV_MAP=Ar.TPM_MANUFACTURERS=Ar.TPM_ECC_CURVE=Ar.TPM_ALG=Ar.TPM_ST=void 0;Ar.TPM_ST={196:"TPM_ST_RSP_COMMAND",32768:"TPM_ST_NULL",32769:"TPM_ST_NO_SESSIONS",32770:"TPM_ST_SESSIONS",32788:"TPM_ST_ATTEST_NV",32789:"TPM_ST_ATTEST_COMMAND_AUDIT",32790:"TPM_ST_ATTEST_SESSION_AUDIT",32791:"TPM_ST_ATTEST_CERTIFY",32792:"TPM_ST_ATTEST_QUOTE",32793:"TPM_ST_ATTEST_TIME",32794:"TPM_ST_ATTEST_CREATION",32801:"TPM_ST_CREATION",32802:"TPM_ST_VERIFIED",32803:"TPM_ST_AUTH_SECRET",32804:"TPM_ST_HASHCHECK",32805:"TPM_ST_AUTH_SIGNED",32809:"TPM_ST_FU_MANIFEST"};Ar.TPM_ALG={0:"TPM_ALG_ERROR",1:"TPM_ALG_RSA",4:"TPM_ALG_SHA",4:"TPM_ALG_SHA1",5:"TPM_ALG_HMAC",6:"TPM_ALG_AES",7:"TPM_ALG_MGF1",8:"TPM_ALG_KEYEDHASH",10:"TPM_ALG_XOR",11:"TPM_ALG_SHA256",12:"TPM_ALG_SHA384",13:"TPM_ALG_SHA512",16:"TPM_ALG_NULL",18:"TPM_ALG_SM3_256",19:"TPM_ALG_SM4",20:"TPM_ALG_RSASSA",21:"TPM_ALG_RSAES",22:"TPM_ALG_RSAPSS",23:"TPM_ALG_OAEP",24:"TPM_ALG_ECDSA",25:"TPM_ALG_ECDH",26:"TPM_ALG_ECDAA",27:"TPM_ALG_SM2",28:"TPM_ALG_ECSCHNORR",29:"TPM_ALG_ECMQV",32:"TPM_ALG_KDF1_SP800_56A",33:"TPM_ALG_KDF2",34:"TPM_ALG_KDF1_SP800_108",35:"TPM_ALG_ECC",37:"TPM_ALG_SYMCIPHER",38:"TPM_ALG_CAMELLIA",64:"TPM_ALG_CTR",65:"TPM_ALG_OFB",66:"TPM_ALG_CBC",67:"TPM_ALG_CFB",68:"TPM_ALG_ECB"};Ar.TPM_ECC_CURVE={0:"TPM_ECC_NONE",1:"TPM_ECC_NIST_P192",2:"TPM_ECC_NIST_P224",3:"TPM_ECC_NIST_P256",4:"TPM_ECC_NIST_P384",5:"TPM_ECC_NIST_P521",16:"TPM_ECC_BN_P256",17:"TPM_ECC_BN_P638",32:"TPM_ECC_SM2_P256"};Ar.TPM_MANUFACTURERS={"id:414D4400":{name:"AMD",id:"AMD"},"id:414E5400":{name:"Ant Group",id:"ANT"},"id:41544D4C":{name:"Atmel",id:"ATML"},"id:4252434D":{name:"Broadcom",id:"BRCM"},"id:4353434F":{name:"Cisco",id:"CSCO"},"id:464C5953":{name:"Flyslice Technologies",id:"FLYS"},"id:524F4343":{name:"Fuzhou Rockchip",id:"ROCC"},"id:474F4F47":{name:"Google",id:"GOOG"},"id:48504900":{name:"HPI",id:"HPI"},"id:48504500":{name:"HPE",id:"HPE"},"id:48495349":{name:"Huawei",id:"HISI"},"id:49424d00":{name:"IBM",id:"IBM"},"id:49424D00":{name:"IBM",id:"IBM"},"id:49465800":{name:"Infineon",id:"IFX"},"id:494E5443":{name:"Intel",id:"INTC"},"id:4C454E00":{name:"Lenovo",id:"LEN"},"id:4D534654":{name:"Microsoft",id:"MSFT"},"id:4E534D20":{name:"National Semiconductor",id:"NSM"},"id:4E545A00":{name:"Nationz",id:"NTZ"},"id:4E534700":{name:"NSING",id:"NSG"},"id:4E544300":{name:"Nuvoton Technology",id:"NTC"},"id:51434F4D":{name:"Qualcomm",id:"QCOM"},"id:534D534E":{name:"Samsung",id:"SMSN"},"id:53454345":{name:"SecEdge",id:"SECE"},"id:534E5300":{name:"Sinosun",id:"SNS"},"id:534D5343":{name:"SMSC",id:"SMSC"},"id:53544D20":{name:"STMicroelectronics",id:"STM"},"id:54584E00":{name:"Texas Instruments",id:"TXN"},"id:57454300":{name:"Winbond",id:"WEC"},"id:5345414C":{name:"Wisekey",id:"SEAL"},"id:FFFFF1D0":{name:"FIDO Alliance",id:"FIDO"}};Ar.TPM_ECC_CURVE_COSE_CRV_MAP={TPM_ECC_NIST_P256:1,TPM_ECC_NIST_P384:2,TPM_ECC_NIST_P521:3,TPM_ECC_BN_P256:1,TPM_ECC_SM2_P256:1}});var ox=l(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});tb.parseCertInfo=lR;var nx=F_(),sx=ae();function lR(t){let e=0,r=sx.isoUint8Array.toDataView(t),i=r.getUint32(e);e+=4;let n=r.getUint16(e);e+=2;let s=nx.TPM_ST[n],o=r.getUint16(e);e+=2;let a=t.slice(e,e+=o),c=r.getUint16(e);e+=2;let u=t.slice(e,e+=c),f=t.slice(e,e+=8),d=r.getUint32(e);e+=4;let y=r.getUint32(e);e+=4;let m=!!t.slice(e,e+=1),x={clock:f,resetCount:d,restartCount:y,safe:m},T=t.slice(e,e+=8),I=r.getUint16(e);e+=2;let U=t.slice(e,e+=I),ee=sx.isoUint8Array.toDataView(U),pe=r.getUint16(e);e+=2;let Ae=t.slice(e,e+=pe),oe={nameAlg:nx.TPM_ALG[ee.getUint16(0)],nameAlgBuffer:U.slice(0,2),name:U,qualifiedName:Ae};return{magic:i,type:s,qualifiedSigner:a,extraData:u,clockInfo:x,firmwareVersion:T,attested:oe}}});var cx=l(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});rb.parsePubArea=fR;var Bn=F_(),ax=ae();function fR(t){let e=0,r=ax.isoUint8Array.toDataView(t),i=Bn.TPM_ALG[r.getUint16(e)];e+=2;let n=Bn.TPM_ALG[r.getUint16(e)];e+=2;let s=r.getUint32(e);e+=4;let o={fixedTPM:!!(s&1),stClear:!!(s&2),fixedParent:!!(s&8),sensitiveDataOrigin:!!(s&16),userWithAuth:!!(s&32),adminWithPolicy:!!(s&64),noDA:!!(s&512),encryptedDuplication:!!(s&1024),restricted:!!(s&32768),decrypt:!!(s&65536),signOrEncrypt:!!(s&131072)},a=r.getUint16(e);e+=2;let c=t.slice(e,e+=a),u={},f=Uint8Array.from([]);if(i==="TPM_ALG_RSA"){let d=Bn.TPM_ALG[r.getUint16(e)];e+=2;let y=Bn.TPM_ALG[r.getUint16(e)];e+=2;let m=r.getUint16(e);e+=2;let x=r.getUint32(e);e+=4,u.rsa={symmetric:d,scheme:y,keyBits:m,exponent:x};let T=r.getUint16(e);e+=2,f=t.slice(e,e+=T)}else if(i==="TPM_ALG_ECC"){let d=Bn.TPM_ALG[r.getUint16(e)];e+=2;let y=Bn.TPM_ALG[r.getUint16(e)];e+=2;let m=Bn.TPM_ECC_CURVE[r.getUint16(e)];e+=2;let x=Bn.TPM_ALG[r.getUint16(e)];e+=2,u.ecc={symmetric:d,scheme:y,curveID:m,kdf:x};let T=r.getUint16(e);e+=2;let I=t.slice(e,e+=T),U=r.getUint16(e);e+=2;let ee=t.slice(e,e+=U);f=ax.isoUint8Array.concat([I,ee])}else throw new Error(`Unexpected type "${i}" (TPM)`);return{type:i,nameAlg:n,objectAttributes:o,authPolicy:c,parameters:u,unique:f}}});var fx=l(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});nb.verifyAttestationTPM=SR;var ib=S(),Df=X(),dR=vo(),tr=Qe(),ux=En(),pR=Pr(),yR=bi(),_R=Du(),hR=Tn(),co=ae(),gR=Q0(),AR=_c(),vR=Rf(),lx=F_(),mR=ox(),bR=cx();async function SR(t){let{aaguid:e,attStmt:r,authData:i,credentialPublicKey:n,clientDataHash:s,rootCertificates:o}=t,a=r.get("ver"),c=r.get("sig"),u=r.get("alg"),f=r.get("x5c"),d=r.get("pubArea"),y=r.get("certInfo");if(a!=="2.0")throw new Error(`Unexpected ver "${a}", expected "2.0" (TPM)`);if(!c)throw new Error("No attestation signature provided in attestation statement (TPM)");if(!u)throw new Error("Attestation statement did not contain alg (TPM)");if(!(0,tr.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (TPM)`);if(!f)throw new Error("No attestation certificate provided in attestation statement (TPM)");if(!d)throw new Error("Attestation statement did not contain pubArea (TPM)");if(!y)throw new Error("Attestation statement did not contain certInfo (TPM)");let m=(0,bR.parsePubArea)(d),{unique:x,type:T,parameters:I}=m,U=(0,dR.decodeCredentialPublicKey)(n);if(T==="TPM_ALG_RSA"){if(!(0,tr.isCOSEPublicKeyRSA)(U))throw new Error(`Credential public key with kty ${U.get(tr.COSEKEYS.kty)} did not match ${T}`);let J=U.get(tr.COSEKEYS.n),Vt=U.get(tr.COSEKEYS.e);if(!J)throw new Error("COSE public key missing n (TPM|RSA)");if(!Vt)throw new Error("COSE public key missing e (TPM|RSA)");if(!co.isoUint8Array.areEqual(x,J))throw new Error("PubArea unique is not same as credentialPublicKey (TPM|RSA)");if(!I.rsa)throw new Error("Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)");let Yi=Vt,Ji=I.rsa.exponent||65537,Nn=Yi[0]+(Yi[1]<<8)+(Yi[2]<<16);if(Ji!==Nn)throw new Error(`Unexpected public key exp ${Nn}, expected ${Ji} (TPM|RSA)`)}else if(T==="TPM_ALG_ECC"){if(!(0,tr.isCOSEPublicKeyEC2)(U))throw new Error(`Credential public key with kty ${U.get(tr.COSEKEYS.kty)} did not match ${T}`);let J=U.get(tr.COSEKEYS.crv),Vt=U.get(tr.COSEKEYS.x),Yi=U.get(tr.COSEKEYS.y);if(!J)throw new Error("COSE public key missing crv (TPM|ECC)");if(!Vt)throw new Error("COSE public key missing x (TPM|ECC)");if(!Yi)throw new Error("COSE public key missing y (TPM|ECC)");if(!co.isoUint8Array.areEqual(x,co.isoUint8Array.concat([Vt,Yi])))throw new Error("PubArea unique is not same as public key x and y (TPM|ECC)");if(!I.ecc)throw new Error("Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)");let Ji=I.ecc.curveID,Nn=lx.TPM_ECC_CURVE_COSE_CRV_MAP[Ji];if(Nn!==J)throw new Error(`Public area key curve ID "${Ji}" mapped to "${Nn}" which did not match public key crv of "${J}" (TPM|ECC)`)}else throw new Error(`Unsupported pubArea.type "${T}"`);let ee=(0,mR.parseCertInfo)(y),{magic:pe,type:Ae,attested:oe,extraData:ze}=ee;if(pe!==4283712327)throw new Error(`Unexpected magic value "${pe}", expected "0xff544347" (TPM)`);if(Ae!=="TPM_ST_ATTEST_CERTIFY")throw new Error(`Unexpected type "${Ae}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`);let it=await(0,ux.toHash)(d,CR(oe.nameAlg)),ut=co.isoUint8Array.concat([oe.nameAlgBuffer,it]);if(!co.isoUint8Array.areEqual(oe.name,ut))throw new Error("Attested name comparison failed (TPM)");let lt=co.isoUint8Array.concat([i,s]),br=await(0,ux.toHash)(lt,u);if(!co.isoUint8Array.areEqual(ze,br))throw new Error("CertInfo extra data did not equal hashed attestation (TPM)");if(f.length<1)throw new Error("No certificates present in x5c array (TPM)");let ir=(0,_R.getCertificateInfo)(f[0]),{basicConstraintsCA:Sr,version:zi,subject:Ye,notAfter:pt,notBefore:yt}=ir;if(Sr)throw new Error("Certificate basic constraints CA was not `false` (TPM)");if(zi!==2)throw new Error("Certificate version was not `3` (ASN.1 value of 2) (TPM)");if(Ye.combined.length>0)throw new Error("Certificate subject was not empty (TPM)");let Mn=new Date;if(yt>Mn)throw new Error(`Certificate not good before "${yt.toString()}" (TPM)`);if(Mn=new Date,pt<Mn)throw new Error(`Certificate not good after "${pt.toString()}" (TPM)`);let Wr=ib.AsnParser.parse(f[0],Df.Certificate);if(!Wr.tbsCertificate.extensions)throw new Error("Certificate was missing extensions (TPM)");let Ci,Pi;if(Wr.tbsCertificate.extensions.forEach(J=>{J.extnID===Df.id_ce_subjectAltName?Ci=ib.AsnParser.parse(J.extnValue,Df.SubjectAlternativeName):J.extnID===Df.id_ce_extKeyUsage&&(Pi=ib.AsnParser.parse(J.extnValue,Df.ExtendedKeyUsage))}),!Ci)throw new Error("Certificate did not contain subjectAltName extension (TPM)");if(!Ci[0].directoryName?.[0].length)throw new Error("Certificate subjectAltName extension directoryName was empty (TPM)");let{tcgAtTpmManufacturer:Kt,tcgAtTpmModel:F,tcgAtTpmVersion:$r}=wR(Ci[0].directoryName);if(!Kt||!F||!$r)throw new Error("Certificate contained incomplete subjectAltName data (TPM)");if(!Pi)throw new Error("Certificate did not contain ExtendedKeyUsage extension (TPM)");if(!lx.TPM_MANUFACTURERS[Kt])throw new Error(`Could not match TPM manufacturer "${Kt}" (TPM)`);if(Pi[0]!=="2.23.133.8.3")throw new Error(`Unexpected extKeyUsage "${Pi[0]}", expected "2.23.133.8.3" (TPM)`);try{await(0,gR.validateExtFIDOGenCEAAGUID)(Wr.tbsCertificate.extensions,e)}catch(J){let Vt=J;throw new Error(`${Vt.message} (TPM)`)}let po=await AR.MetadataService.getStatement(e);if(po)try{await(0,vR.verifyAttestationWithMetadata)({statement:po,credentialPublicKey:n,x5c:f,attestationStatementAlg:u})}catch(J){let Vt=J;throw new Error(`${Vt.message} (TPM)`)}else try{await(0,yR.validateCertificatePath)(f.map(pR.convertCertBufferToPEM),o)}catch(J){let Vt=J;throw new Error(`${Vt.message} (TPM)`)}return(0,hR.verifySignature)({signature:c,data:y,x509Certificate:f[0],hashAlgorithm:u})}function wR(t){let e="2.23.133.2.1",r="2.23.133.2.2",i="2.23.133.2.3",n,s,o;return t.forEach(a=>{a.forEach(c=>{c.type===e?n=c.value.toString():c.type===r?s=c.value.toString():c.type===i&&(o=c.value.toString())})}),{tcgAtTpmManufacturer:n,tcgAtTpmModel:s,tcgAtTpmVersion:o}}function CR(t){if(t==="TPM_ALG_SHA256")return tr.COSEALG.ES256;if(t==="TPM_ALG_SHA384")return tr.COSEALG.ES384;if(t==="TPM_ALG_SHA512")return tr.COSEALG.ES512;throw new Error(`Unexpected TPM attested name alg ${t}`)}});var ab=l(Fe=>{"use strict";var sb;Object.defineProperty(Fe,"__esModule",{value:!0});Fe.KeyMintKeyDescription=Fe.KeyDescription=Fe.Version=Fe.SecurityLevel=Fe.AuthorizationList=Fe.IntegerSet=Fe.RootOfTrust=Fe.VerifiedBootState=Fe.id_ce_keyDescription=void 0;var K=(v(),g(A)),b=S();Fe.id_ce_keyDescription="1.3.6.1.4.1.11129.2.1.17";var ob;(function(t){t[t.verified=0]="verified",t[t.selfSigned=1]="selfSigned",t[t.unverified=2]="unverified",t[t.failed=3]="failed"})(ob||(Fe.VerifiedBootState=ob={}));var kn=class{verifiedBootKey=new b.OctetString;deviceLocked=!1;verifiedBootState=ob.verified;verifiedBootHash;constructor(e={}){Object.assign(this,e)}};Fe.RootOfTrust=kn;K.__decorate([(0,b.AsnProp)({type:b.OctetString})],kn.prototype,"verifiedBootKey",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Boolean})],kn.prototype,"deviceLocked",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],kn.prototype,"verifiedBootState",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString,optional:!0})],kn.prototype,"verifiedBootHash",void 0);var uo=sb=class extends b.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,sb.prototype)}};Fe.IntegerSet=uo;Fe.IntegerSet=uo=sb=K.__decorate([(0,b.AsnType)({type:b.AsnTypeTypes.Set,itemType:b.AsnPropTypes.Integer})],uo);var W=class{purpose;algorithm;keySize;digest;padding;ecCurve;rsaPublicExponent;mgfDigest;rollbackResistance;earlyBootOnly;activeDateTime;originationExpireDateTime;usageExpireDateTime;usageCountLimit;noAuthRequired;userAuthType;authTimeout;allowWhileOnBody;trustedUserPresenceRequired;trustedConfirmationRequired;unlockedDeviceRequired;allApplications;applicationId;creationDateTime;origin;rollbackResistant;rootOfTrust;osVersion;osPatchLevel;attestationApplicationId;attestationIdBrand;attestationIdDevice;attestationIdProduct;attestationIdSerial;attestationIdImei;attestationIdMeid;attestationIdManufacturer;attestationIdModel;vendorPatchLevel;bootPatchLevel;deviceUniqueAttestation;attestationIdSecondImei;moduleHash;constructor(e={}){Object.assign(this,e)}};Fe.AuthorizationList=W;K.__decorate([(0,b.AsnProp)({context:1,type:uo,optional:!0})],W.prototype,"purpose",void 0);K.__decorate([(0,b.AsnProp)({context:2,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"algorithm",void 0);K.__decorate([(0,b.AsnProp)({context:3,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"keySize",void 0);K.__decorate([(0,b.AsnProp)({context:5,type:uo,optional:!0})],W.prototype,"digest",void 0);K.__decorate([(0,b.AsnProp)({context:6,type:uo,optional:!0})],W.prototype,"padding",void 0);K.__decorate([(0,b.AsnProp)({context:10,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"ecCurve",void 0);K.__decorate([(0,b.AsnProp)({context:200,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"rsaPublicExponent",void 0);K.__decorate([(0,b.AsnProp)({context:203,type:uo,optional:!0})],W.prototype,"mgfDigest",void 0);K.__decorate([(0,b.AsnProp)({context:303,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"rollbackResistance",void 0);K.__decorate([(0,b.AsnProp)({context:305,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"earlyBootOnly",void 0);K.__decorate([(0,b.AsnProp)({context:400,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"activeDateTime",void 0);K.__decorate([(0,b.AsnProp)({context:401,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"originationExpireDateTime",void 0);K.__decorate([(0,b.AsnProp)({context:402,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"usageExpireDateTime",void 0);K.__decorate([(0,b.AsnProp)({context:405,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"usageCountLimit",void 0);K.__decorate([(0,b.AsnProp)({context:503,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"noAuthRequired",void 0);K.__decorate([(0,b.AsnProp)({context:504,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"userAuthType",void 0);K.__decorate([(0,b.AsnProp)({context:505,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"authTimeout",void 0);K.__decorate([(0,b.AsnProp)({context:506,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"allowWhileOnBody",void 0);K.__decorate([(0,b.AsnProp)({context:507,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"trustedUserPresenceRequired",void 0);K.__decorate([(0,b.AsnProp)({context:508,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"trustedConfirmationRequired",void 0);K.__decorate([(0,b.AsnProp)({context:509,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"unlockedDeviceRequired",void 0);K.__decorate([(0,b.AsnProp)({context:600,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"allApplications",void 0);K.__decorate([(0,b.AsnProp)({context:601,type:b.OctetString,optional:!0})],W.prototype,"applicationId",void 0);K.__decorate([(0,b.AsnProp)({context:701,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"creationDateTime",void 0);K.__decorate([(0,b.AsnProp)({context:702,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"origin",void 0);K.__decorate([(0,b.AsnProp)({context:703,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"rollbackResistant",void 0);K.__decorate([(0,b.AsnProp)({context:704,type:kn,optional:!0})],W.prototype,"rootOfTrust",void 0);K.__decorate([(0,b.AsnProp)({context:705,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"osVersion",void 0);K.__decorate([(0,b.AsnProp)({context:706,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"osPatchLevel",void 0);K.__decorate([(0,b.AsnProp)({context:709,type:b.OctetString,optional:!0})],W.prototype,"attestationApplicationId",void 0);K.__decorate([(0,b.AsnProp)({context:710,type:b.OctetString,optional:!0})],W.prototype,"attestationIdBrand",void 0);K.__decorate([(0,b.AsnProp)({context:711,type:b.OctetString,optional:!0})],W.prototype,"attestationIdDevice",void 0);K.__decorate([(0,b.AsnProp)({context:712,type:b.OctetString,optional:!0})],W.prototype,"attestationIdProduct",void 0);K.__decorate([(0,b.AsnProp)({context:713,type:b.OctetString,optional:!0})],W.prototype,"attestationIdSerial",void 0);K.__decorate([(0,b.AsnProp)({context:714,type:b.OctetString,optional:!0})],W.prototype,"attestationIdImei",void 0);K.__decorate([(0,b.AsnProp)({context:715,type:b.OctetString,optional:!0})],W.prototype,"attestationIdMeid",void 0);K.__decorate([(0,b.AsnProp)({context:716,type:b.OctetString,optional:!0})],W.prototype,"attestationIdManufacturer",void 0);K.__decorate([(0,b.AsnProp)({context:717,type:b.OctetString,optional:!0})],W.prototype,"attestationIdModel",void 0);K.__decorate([(0,b.AsnProp)({context:718,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"vendorPatchLevel",void 0);K.__decorate([(0,b.AsnProp)({context:719,type:b.AsnPropTypes.Integer,optional:!0})],W.prototype,"bootPatchLevel",void 0);K.__decorate([(0,b.AsnProp)({context:720,type:b.AsnPropTypes.Null,optional:!0})],W.prototype,"deviceUniqueAttestation",void 0);K.__decorate([(0,b.AsnProp)({context:723,type:b.OctetString,optional:!0})],W.prototype,"attestationIdSecondImei",void 0);K.__decorate([(0,b.AsnProp)({context:724,type:b.OctetString,optional:!0})],W.prototype,"moduleHash",void 0);var hc;(function(t){t[t.software=0]="software",t[t.trustedEnvironment=1]="trustedEnvironment",t[t.strongBox=2]="strongBox"})(hc||(Fe.SecurityLevel=hc={}));var H_;(function(t){t[t.KM2=1]="KM2",t[t.KM3=2]="KM3",t[t.KM4=3]="KM4",t[t.KM4_1=4]="KM4_1",t[t.keyMint1=100]="keyMint1",t[t.keyMint2=200]="keyMint2",t[t.keyMint3=300]="keyMint3",t[t.keyMint4=400]="keyMint4"})(H_||(Fe.Version=H_={}));var vr=class{attestationVersion=H_.KM4;attestationSecurityLevel=hc.software;keymasterVersion=0;keymasterSecurityLevel=hc.software;attestationChallenge=new b.OctetString;uniqueId=new b.OctetString;softwareEnforced=new W;teeEnforced=new W;constructor(e={}){Object.assign(this,e)}};Fe.KeyDescription=vr;K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Integer})],vr.prototype,"attestationVersion",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],vr.prototype,"attestationSecurityLevel",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Integer})],vr.prototype,"keymasterVersion",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],vr.prototype,"keymasterSecurityLevel",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString})],vr.prototype,"attestationChallenge",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString})],vr.prototype,"uniqueId",void 0);K.__decorate([(0,b.AsnProp)({type:W})],vr.prototype,"softwareEnforced",void 0);K.__decorate([(0,b.AsnProp)({type:W})],vr.prototype,"teeEnforced",void 0);var Fr=class t{attestationVersion=H_.keyMint4;attestationSecurityLevel=hc.software;keyMintVersion=0;keyMintSecurityLevel=hc.software;attestationChallenge=new b.OctetString;uniqueId=new b.OctetString;softwareEnforced=new W;hardwareEnforced=new W;constructor(e={}){Object.assign(this,e)}toLegacyKeyDescription(){return new vr({attestationVersion:this.attestationVersion,attestationSecurityLevel:this.attestationSecurityLevel,keymasterVersion:this.keyMintVersion,keymasterSecurityLevel:this.keyMintSecurityLevel,attestationChallenge:this.attestationChallenge,uniqueId:this.uniqueId,softwareEnforced:this.softwareEnforced,teeEnforced:this.hardwareEnforced})}static fromLegacyKeyDescription(e){return new t({attestationVersion:e.attestationVersion,attestationSecurityLevel:e.attestationSecurityLevel,keyMintVersion:e.keymasterVersion,keyMintSecurityLevel:e.keymasterSecurityLevel,attestationChallenge:e.attestationChallenge,uniqueId:e.uniqueId,softwareEnforced:e.softwareEnforced,hardwareEnforced:e.teeEnforced})}};Fe.KeyMintKeyDescription=Fr;K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Integer})],Fr.prototype,"attestationVersion",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],Fr.prototype,"attestationSecurityLevel",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Integer})],Fr.prototype,"keyMintVersion",void 0);K.__decorate([(0,b.AsnProp)({type:b.AsnPropTypes.Enumerated})],Fr.prototype,"keyMintSecurityLevel",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString})],Fr.prototype,"attestationChallenge",void 0);K.__decorate([(0,b.AsnProp)({type:b.OctetString})],Fr.prototype,"uniqueId",void 0);K.__decorate([(0,b.AsnProp)({type:W})],Fr.prototype,"softwareEnforced",void 0);K.__decorate([(0,b.AsnProp)({type:W})],Fr.prototype,"hardwareEnforced",void 0)});var dx=l(rr=>{"use strict";var cb;Object.defineProperty(rr,"__esModule",{value:!0});rr.NonStandardKeyMintKeyDescription=rr.NonStandardKeyDescription=rr.NonStandardAuthorizationList=rr.NonStandardAuthorization=void 0;var Hr=(v(),g(A)),Ne=S(),W_=ab(),$_=class extends W_.AuthorizationList{};rr.NonStandardAuthorization=$_;rr.NonStandardAuthorization=$_=Hr.__decorate([(0,Ne.AsnType)({type:Ne.AsnTypeTypes.Choice})],$_);var lo=cb=class extends Ne.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,cb.prototype)}findProperty(e){let r=this.find(i=>i[e]!==void 0);if(r)return r[e]}};rr.NonStandardAuthorizationList=lo;rr.NonStandardAuthorizationList=lo=cb=Hr.__decorate([(0,Ne.AsnType)({type:Ne.AsnTypeTypes.Sequence,itemType:$_})],lo);var mr=class{attestationVersion=W_.Version.KM4;attestationSecurityLevel=W_.SecurityLevel.software;keymasterVersion=0;keymasterSecurityLevel=W_.SecurityLevel.software;attestationChallenge=new Ne.OctetString;uniqueId=new Ne.OctetString;softwareEnforced=new lo;teeEnforced=new lo;get keyMintVersion(){return this.keymasterVersion}set keyMintVersion(e){this.keymasterVersion=e}get keyMintSecurityLevel(){return this.keymasterSecurityLevel}set keyMintSecurityLevel(e){this.keymasterSecurityLevel=e}get hardwareEnforced(){return this.teeEnforced}set hardwareEnforced(e){this.teeEnforced=e}constructor(e={}){Object.assign(this,e)}};rr.NonStandardKeyDescription=mr;Hr.__decorate([(0,Ne.AsnProp)({type:Ne.AsnPropTypes.Integer})],mr.prototype,"attestationVersion",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.AsnPropTypes.Enumerated})],mr.prototype,"attestationSecurityLevel",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.AsnPropTypes.Integer})],mr.prototype,"keymasterVersion",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.AsnPropTypes.Enumerated})],mr.prototype,"keymasterSecurityLevel",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.OctetString})],mr.prototype,"attestationChallenge",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:Ne.OctetString})],mr.prototype,"uniqueId",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:lo})],mr.prototype,"softwareEnforced",void 0);Hr.__decorate([(0,Ne.AsnProp)({type:lo})],mr.prototype,"teeEnforced",void 0);var ub=class extends mr{constructor(e={}){"keymasterVersion"in e&&!("keyMintVersion"in e)&&(e.keyMintVersion=e.keymasterVersion),"keymasterSecurityLevel"in e&&!("keyMintSecurityLevel"in e)&&(e.keyMintSecurityLevel=e.keymasterSecurityLevel),"teeEnforced"in e&&!("hardwareEnforced"in e)&&(e.hardwareEnforced=e.teeEnforced),super(e)}};rr.NonStandardKeyMintKeyDescription=ub;rr.NonStandardKeyMintKeyDescription=ub=Hr.__decorate([(0,Ne.AsnType)({type:Ne.AsnTypeTypes.Sequence})],ub)});var px=l(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.AttestationApplicationId=Ac.AttestationPackageInfo=void 0;var z_=(v(),g(A)),fo=S(),gc=class{packageName;version;constructor(e={}){Object.assign(this,e)}};Ac.AttestationPackageInfo=gc;z_.__decorate([(0,fo.AsnProp)({type:fo.AsnPropTypes.OctetString})],gc.prototype,"packageName",void 0);z_.__decorate([(0,fo.AsnProp)({type:fo.AsnPropTypes.Integer})],gc.prototype,"version",void 0);var Uf=class{packageInfos;signatureDigests;constructor(e={}){Object.assign(this,e)}};Ac.AttestationApplicationId=Uf;z_.__decorate([(0,fo.AsnProp)({type:gc,repeated:"set"})],Uf.prototype,"packageInfos",void 0);z_.__decorate([(0,fo.AsnProp)({type:fo.AsnPropTypes.OctetString,repeated:"set"})],Uf.prototype,"signatureDigests",void 0)});var yx=l(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});var lb=(v(),g(A));lb.__exportStar(ab(),Lf);lb.__exportStar(dx(),Lf);lb.__exportStar(px(),Lf)});var Ax=l(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});db.verifyAttestationAndroidKey=kR;var _x=S(),PR=X(),hx=yx(),gx=Pr(),ER=bi(),TR=Tn(),xR=Pc(),OR=Qe(),fb=ae(),IR=_c(),BR=Rf();async function kR(t){let{authData:e,clientDataHash:r,attStmt:i,credentialPublicKey:n,aaguid:s,rootCertificates:o}=t,a=i.get("x5c"),c=i.get("sig"),u=i.get("alg");if(!a)throw new Error("No attestation certificate provided in attestation statement (Android Key)");if(!c)throw new Error("No attestation signature provided in attestation statement (Android Key)");if(!u)throw new Error("Attestation statement did not contain alg (Android Key)");if(!(0,OR.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (Android Key)`);let f=_x.AsnParser.parse(a[0],PR.Certificate),d=new Uint8Array(f.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey),y=(0,xR.convertCOSEtoPKCS)(n);if(!fb.isoUint8Array.areEqual(y,d))throw new Error("Credential public key does not equal leaf cert public key (Android Key)");let m=f.tbsCertificate.extensions?.find(Ae=>Ae.extnID===hx.id_ce_keyDescription);if(!m)throw new Error("Certificate did not contain extKeyStore (Android Key)");let x=_x.AsnParser.parse(m.extnValue,hx.KeyDescription),{attestationChallenge:T,teeEnforced:I,softwareEnforced:U}=x;if(!fb.isoUint8Array.areEqual(new Uint8Array(T.buffer),r))throw new Error("Attestation challenge was not equal to client data hash (Android Key)");if(I.allApplications!==void 0)throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');if(U.allApplications!==void 0)throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)');let ee=await IR.MetadataService.getStatement(s);if(ee)try{await(0,BR.verifyAttestationWithMetadata)({statement:ee,credentialPublicKey:n,x5c:a,attestationStatementAlg:u})}catch(Ae){let oe=Ae;throw new Error(`${oe.message} (Android Key)`,{cause:oe})}else{let Ae=a.slice(0,-1).map(gx.convertCertBufferToPEM),oe=a.slice(-1).map(gx.convertCertBufferToPEM);try{await(0,ER.validateCertificatePath)(Ae,oe)}catch(ze){let it=ze;throw new Error(`${it.message} (Android Key)`,{cause:it})}if(o.length>0&&o.indexOf(oe[0])<0)throw new Error("x5c root certificate was not a known root certificate (Android Key)")}let pe=fb.isoUint8Array.concat([e,r]);return(0,TR.verifySignature)({signature:c,data:pe,x509Certificate:a[0],hashAlgorithm:u})}});var vx=l(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});yb.verifyAttestationApple=UR;var jR=S(),MR=X(),NR=bi(),qR=Pr(),RR=En(),DR=Pc(),pb=ae();async function UR(t){let{attStmt:e,authData:r,clientDataHash:i,credentialPublicKey:n,rootCertificates:s}=t,o=e.get("x5c");if(!o)throw new Error("No attestation certificate provided in attestation statement (Apple)");try{await(0,NR.validateCertificatePath)(o.map(qR.convertCertBufferToPEM),s)}catch(I){let U=I;throw new Error(`${U.message} (Apple)`)}let a=jR.AsnParser.parse(o[0],MR.Certificate),{extensions:c,subjectPublicKeyInfo:u}=a.tbsCertificate;if(!c)throw new Error("credCert missing extensions (Apple)");let f=c.find(I=>I.extnID==="1.2.840.113635.100.8.2");if(!f)throw new Error('credCert missing "1.2.840.113635.100.8.2" extension (Apple)');let d=pb.isoUint8Array.concat([r,i]),y=await(0,RR.toHash)(d),m=new Uint8Array(f.extnValue.buffer).slice(6);if(!pb.isoUint8Array.areEqual(y,m))throw new Error("credCert nonce was not expected value (Apple)");let x=(0,DR.convertCOSEtoPKCS)(n),T=new Uint8Array(u.subjectPublicKey);if(!pb.isoUint8Array.areEqual(x,T))throw new Error("Credential public key does not equal credCert public key (Apple)");return!0}});var mx=l(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});hb.verifyRegistrationResponse=iD;var LR=gh(),KR=Jf(),VR=k_(),GR=En(),FR=vo(),HR=Qe(),WR=zf(),$R=F0(),zR=$0(),_b=ae(),YR=U_(),JR=G0(),QR=YT(),XR=rx(),ZR=ix(),eD=fx(),tD=Ax(),rD=vx();async function iD(t){let{response:e,expectedChallenge:r,expectedOrigin:i,expectedRPID:n,expectedType:s,requireUserPresence:o=!0,requireUserVerification:a=!0,supportedAlgorithmIDs:c=JR.supportedCOSEAlgorithmIdentifiers,attestationSafetyNetEnforceCTSCheck:u=!0}=t,{id:f,rawId:d,type:y,response:m}=e;if(!f)throw new Error("Missing credential ID");if(f!==d)throw new Error("Credential ID was not base64url-encoded");if(y!=="public-key")throw new Error(`Unexpected credential type ${y}, expected "public-key"`);let x=(0,KR.decodeClientDataJSON)(m.clientDataJSON),{type:T,origin:I,challenge:U,tokenBinding:ee}=x;if(Array.isArray(s)){if(!s.includes(T)){let J=s.join(", ");throw new Error(`Unexpected registration response type "${T}", expected one of: ${J}`)}}else if(s){if(T!==s)throw new Error(`Unexpected registration response type "${T}", expected "${s}"`)}else if(T!=="webauthn.create")throw new Error(`Unexpected registration response type: ${T}`);if(typeof r=="function"){if(!await r(U))throw new Error(`Custom challenge verifier returned false for registration response challenge "${U}"`)}else if(U!==r)throw new Error(`Unexpected registration response challenge "${U}", expected "${r}"`);if(Array.isArray(i)){if(!i.includes(I))throw new Error(`Unexpected registration response origin "${I}", expected one of: ${i.join(", ")}`)}else if(I!==i)throw new Error(`Unexpected registration response origin "${I}", expected "${i}"`);if(ee){if(typeof ee!="object")throw new Error(`Unexpected value for TokenBinding "${ee}"`);if(["present","supported","not-supported"].indexOf(ee.status)<0)throw new Error(`Unexpected tokenBinding.status value of "${ee.status}"`)}let pe=_b.isoBase64URL.toBuffer(m.attestationObject),Ae=(0,LR.decodeAttestationObject)(pe),oe=Ae.get("fmt"),ze=Ae.get("authData"),it=Ae.get("attStmt"),ut=(0,VR.parseAuthenticatorData)(ze),{aaguid:lt,rpIdHash:br,flags:ir,credentialID:Sr,counter:zi,credentialPublicKey:Ye,extensionsData:pt}=ut,yt;if(n){let J=[];typeof n=="string"?J=[n]:J=n,yt=await(0,zR.matchExpectedRPID)(br,J)}if(o&&!ir.up)throw new Error("User presence was required, but user was not present");if(a&&!ir.uv)throw new Error("User verification was required, but user could not be verified");if(!Sr)throw new Error("No credential ID was provided by authenticator");if(!Ye)throw new Error("No public key was provided by authenticator");if(!lt)throw new Error("No AAGUID was present during registration");let Wr=(0,FR.decodeCredentialPublicKey)(Ye).get(HR.COSEKEYS.alg);if(typeof Wr!="number")throw new Error("Credential public key was missing numeric alg");if(!c.includes(Wr)){let J=c.join(", ");throw new Error(`Unexpected public key alg "${Wr}", expected one of "${J}"`)}let Ci=await(0,GR.toHash)(_b.isoBase64URL.toBuffer(m.clientDataJSON)),Pi=YR.SettingsService.getRootCertificates({identifier:oe}),Kt={aaguid:lt,attStmt:it,authData:ze,clientDataHash:Ci,credentialID:Sr,credentialPublicKey:Ye,rootCertificates:Pi,rpIdHash:br,attestationSafetyNetEnforceCTSCheck:u},F=!1;if(oe==="fido-u2f")F=await(0,QR.verifyAttestationFIDOU2F)(Kt);else if(oe==="packed")F=await(0,XR.verifyAttestationPacked)(Kt);else if(oe==="android-safetynet")F=await(0,ZR.verifyAttestationAndroidSafetyNet)(Kt);else if(oe==="android-key")F=await(0,tD.verifyAttestationAndroidKey)(Kt);else if(oe==="tpm")F=await(0,eD.verifyAttestationTPM)(Kt);else if(oe==="apple")F=await(0,rD.verifyAttestationApple)(Kt);else if(oe==="none"){if(it.size>0)throw new Error("None attestation had unexpected attestation statement");F=!0}else throw new Error(`Unsupported Attestation Format: ${oe}`);if(!F)return{verified:!1};let{credentialDeviceType:$r,credentialBackedUp:po}=(0,$R.parseBackupFlags)(ir);return{verified:!0,registrationInfo:{fmt:oe,aaguid:(0,WR.convertAAGUIDToString)(lt),credentialType:y,credential:{id:_b.isoBase64URL.fromBuffer(Sr),publicKey:Ye,counter:zi,transports:e.response.transports},attestationObject:pe,userVerified:ir.uv,credentialDeviceType:$r,credentialBackedUp:po,origin:x.origin,rpID:yt,authenticatorExtensionResults:pt}}}});var bx=l(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});gb.generateAuthenticationOptions=sD;var Y_=ae(),nD=L_();async function sD(t){let{allowCredentials:e,challenge:r=await(0,nD.generateChallenge)(),timeout:i=6e4,userVerification:n="preferred",extensions:s,rpID:o}=t,a=r;return typeof a=="string"&&(a=Y_.isoUint8Array.fromUTF8String(a)),{rpId:o,challenge:Y_.isoBase64URL.fromBuffer(a),allowCredentials:e?.map(c=>{if(!Y_.isoBase64URL.isBase64URL(c.id))throw new Error(`allowCredential id "${c.id}" is not a valid base64url string`);return{...c,id:Y_.isoBase64URL.trimPadding(c.id),type:"public-key"}}),timeout:i,userVerification:n,extensions:s}}});var Sx=l(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});Ab.verifyAuthenticationResponse=dD;var oD=Jf(),aD=En(),cD=Tn(),uD=k_(),lD=F0(),fD=$0(),vc=ae();async function dD(t){let{response:e,expectedChallenge:r,expectedOrigin:i,expectedRPID:n,expectedType:s,credential:o,requireUserVerification:a=!0,advancedFIDOConfig:c}=t,{id:u,rawId:f,type:d,response:y}=e;if(!u)throw new Error("Missing credential ID");if(u!==f)throw new Error("Credential ID was not base64url-encoded");if(d!=="public-key")throw new Error(`Unexpected credential type ${d}, expected "public-key"`);if(!e)throw new Error("Credential missing response");if(typeof y?.clientDataJSON!="string")throw new Error("Credential response clientDataJSON was not a string");let m=(0,oD.decodeClientDataJSON)(y.clientDataJSON),{type:x,origin:T,challenge:I,tokenBinding:U}=m;if(Array.isArray(s)){if(!s.includes(x)){let yt=s.join(", ");throw new Error(`Unexpected authentication response type "${x}", expected one of: ${yt}`)}}else if(s){if(x!==s)throw new Error(`Unexpected authentication response type "${x}", expected "${s}"`)}else if(x!=="webauthn.get")throw new Error(`Unexpected authentication response type: ${x}`);if(typeof r=="function"){if(!await r(I))throw new Error(`Custom challenge verifier returned false for registration response challenge "${I}"`)}else if(I!==r)throw new Error(`Unexpected authentication response challenge "${I}", expected "${r}"`);if(Array.isArray(i)){if(!i.includes(T)){let yt=i.join(", ");throw new Error(`Unexpected authentication response origin "${T}", expected one of: ${yt}`)}}else if(T!==i)throw new Error(`Unexpected authentication response origin "${T}", expected "${i}"`);if(!vc.isoBase64URL.isBase64URL(y.authenticatorData))throw new Error("Credential response authenticatorData was not a base64url string");if(!vc.isoBase64URL.isBase64URL(y.signature))throw new Error("Credential response signature was not a base64url string");if(y.userHandle&&typeof y.userHandle!="string")throw new Error("Credential response userHandle was not a string");if(U){if(typeof U!="object")throw new Error("ClientDataJSON tokenBinding was not an object");if(["present","supported","notSupported"].indexOf(U.status)<0)throw new Error(`Unexpected tokenBinding status ${U.status}`)}let ee=vc.isoBase64URL.toBuffer(y.authenticatorData),pe=(0,uD.parseAuthenticatorData)(ee),{rpIdHash:Ae,flags:oe,counter:ze,extensionsData:it}=pe,ut=[];typeof n=="string"?ut=[n]:ut=n;let lt=await(0,fD.matchExpectedRPID)(Ae,ut);if(c!==void 0){let{userVerification:yt}=c;if(yt==="required"&&!oe.uv)throw new Error("User verification required, but user could not be verified")}else{if(!oe.up)throw new Error("User not present during authentication");if(a&&!oe.uv)throw new Error("User verification required, but user could not be verified")}let br=await(0,aD.toHash)(vc.isoBase64URL.toBuffer(y.clientDataJSON)),ir=vc.isoUint8Array.concat([ee,br]),Sr=vc.isoBase64URL.toBuffer(y.signature);if((ze>0||o.counter>0)&&ze<=o.counter)throw new Error(`Response counter value ${ze} was lower than expected ${o.counter}`);let{credentialDeviceType:zi,credentialBackedUp:Ye}=(0,lD.parseBackupFlags)(oe);return{verified:await(0,cD.verifySignature)({signature:Sr,data:ir,credentialPublicKey:o.publicKey}),authenticationInfo:{newCounter:ze,credentialID:o.id,userVerified:oe.uv,credentialDeviceType:zi,credentialBackedUp:Ye,authenticatorExtensionResults:it,origin:m.origin,rpID:lt}}}});var Cx=l(wx=>{"use strict";Object.defineProperty(wx,"__esModule",{value:!0})});var Ex=l(Px=>{"use strict";Object.defineProperty(Px,"__esModule",{value:!0})});var Tx=l(Lt=>{"use strict";var pD=Lt&&Lt.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,n)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),jn=Lt&&Lt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pD(e,t,r)};Object.defineProperty(Lt,"__esModule",{value:!0});jn(G0(),Lt);jn(mx(),Lt);jn(bx(),Lt);jn(Sx(),Lt);jn(_c(),Lt);jn(U_(),Lt);jn(Cx(),Lt);jn(Ex(),Lt)});module.exports=Tx();
206
206
  /*! Bundled license information:
207
207
 
208
208
  pvtsutils/build/index.js: