@blamejs/core 0.13.16 → 0.13.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/lib/middleware/body-parser.js +95 -49
- package/lib/template.js +159 -23
- package/lib/vendor/MANIFEST.json +12 -12
- package/lib/vendor/simplewebauthn-server.cjs +31 -28
- package/package.json +1 -1
- package/sbom.cdx.json +6 -6
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
// @simplewebauthn/server v13.3.
|
|
2
|
-
//
|
|
3
|
-
// Bundled with esbuild. Exports: generateRegistrationOptions, verifyRegistrationResponse,
|
|
4
|
-
|
|
5
|
-
var T_=Object.defineProperty;var uT=Object.getOwnPropertyDescriptor;var lT=Object.getOwnPropertyNames;var dT=Object.prototype.hasOwnProperty;var Dm=(r,e)=>()=>(r&&(e=r(r=0)),e);var l=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Um=(r,e)=>{for(var t in e)T_(r,t,{get:e[t],enumerable:!0})},fT=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of lT(e))!dT.call(r,n)&&n!==t&&T_(r,n,{get:()=>e[n],enumerable:!(i=uT(e,n))||i.enumerable});return r};var v=r=>fT(T_({},"__esModule",{value:!0}),r);var Km=l((x_,O_)=>{(function(r,e){typeof x_=="object"&&typeof O_<"u"?O_.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis<"u"?globalThis:r||self,r.base64=e())})(x_,(function(){"use strict";let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",t=c=>{let u=typeof Uint8Array>"u"?[]:new Uint8Array(256),d=r.length;for(let f=0;f<d;f++)u[c.charCodeAt(f)]=f;return u},i=t(r),n=t(e),s=/^[-A-Za-z0-9\-_]*$/,o=/^[-A-Za-z0-9+/]*={0,3}$/,a={};return a.toArrayBuffer=(c,u)=>{let d=c.length,f=c.length*.75,_,g=0,x,T,I,U;c[c.length-1]==="="&&(f--,c[c.length-2]==="="&&f--);let Z=new ArrayBuffer(f),fe=new Uint8Array(Z),ge=u?n:i;for(_=0;_<d;_+=4)x=ge[c.charCodeAt(_)],T=ge[c.charCodeAt(_+1)],I=ge[c.charCodeAt(_+2)],U=ge[c.charCodeAt(_+3)],fe[g++]=x<<2|T>>4,fe[g++]=(T&15)<<4|I>>2,fe[g++]=(I&3)<<6|U&63;return Z},a.fromArrayBuffer=(c,u)=>{let d=new Uint8Array(c),f,_="",g=d.length,x=u?e:r;for(f=0;f<g;f+=3)_+=x[d[f]>>2],_+=x[(d[f]&3)<<4|d[f+1]>>4],_+=x[(d[f+1]&15)<<2|d[f+2]>>6],_+=x[d[f+2]&63];let T=g%3;return T===2?_=_.substring(0,_.length-1)+(u?"":"="):T===1&&(_=_.substring(0,_.length-2)+(u?"":"==")),_},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 Vm=l(Zt=>{"use strict";var pT=Zt&&Zt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.toBuffer=hT;Zt.fromBuffer=_T;Zt.toBase64=yT;Zt.fromUTF8String=gT;Zt.toUTF8String=AT;Zt.isBase64=vT;Zt.isBase64URL=mT;Zt.trimPadding=Lm;var Vi=pT(Km());function hT(r,e="base64url"){let t=Vi.default.toArrayBuffer(r,e==="base64url");return new Uint8Array(t)}function _T(r,e="base64url"){let t=new Uint8Array(r);return Vi.default.fromArrayBuffer(t.buffer,e==="base64url")}function yT(r){let e=Vi.default.toArrayBuffer(r,!0);return Vi.default.fromArrayBuffer(e)}function gT(r){return Vi.default.fromString(r,!0)}function AT(r){return Vi.default.toString(r,!0)}function vT(r){return Vi.default.validate(r,!1)}function mT(r){return r=Lm(r),Vi.default.validate(r,!0)}function Lm(r){return r.replace(/=/g,"")}});var Gm=l(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.encodeLength=Be.MAJOR_TYPE_SIMPLE_OR_FLOAT=Be.MAJOR_TYPE_TAG=Be.MAJOR_TYPE_MAP=Be.MAJOR_TYPE_ARRAY=Be.MAJOR_TYPE_TEXT_STRING=Be.MAJOR_TYPE_BYTE_STRING=Be.MAJOR_TYPE_NEGATIVE_INTEGER=Be.MAJOR_TYPE_UNSIGNED_INTEGER=Be.decodeLength=void 0;function bT(r,e,t){if(e<24)return[e,1];let i=r.byteLength-t-1,n=new DataView(r.buffer,t+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")}Be.decodeLength=bT;Be.MAJOR_TYPE_UNSIGNED_INTEGER=0;Be.MAJOR_TYPE_NEGATIVE_INTEGER=1;Be.MAJOR_TYPE_BYTE_STRING=2;Be.MAJOR_TYPE_TEXT_STRING=3;Be.MAJOR_TYPE_ARRAY=4;Be.MAJOR_TYPE_MAP=5;Be.MAJOR_TYPE_TAG=6;Be.MAJOR_TYPE_SIMPLE_OR_FLOAT=7;function ST(r,e){let t=r<<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(r==Be.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?[t|n[7]]:i<=255?[t|24,n[7]]:i<=65535?[t|25,...n.slice(6)]:i<=4294967295?[t|26,...n.slice(4)]:[t|27,...n]}Be.encodeLength=ST});var $m=l(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.encodeCBOR=Vr.decodeCBOR=Vr.decodePartialCBOR=Vr.CBORTag=void 0;var ce=Gm(),uc=class{constructor(e,t){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=t}get tag(){return this.tagId}get value(){return this.tagValue}};Vr.CBORTag=uc;function Hm(r,e,t){return(0,ce.decodeLength)(r,e,t)}function wT(r,e,t){let[i,n]=Hm(r,e,t);return[-i-1,n]}function Fm(r,e,t){let[i,n]=(0,ce.decodeLength)(r,e,t),s=t+n;return[new Uint8Array(r.buffer.slice(s,s+i)),n+i]}var CT=new TextDecoder;function PT(r,e,t){let[i,n]=Fm(r,e,t);return[CT.decode(i),n]}function ET(r,e,t){if(e===0)return[[],1];let[i,n]=(0,ce.decodeLength)(r,e,t),s=n,o=[];for(let a=0;a<i;a++){if(r.byteLength-t-s<=0)throw new Error("array is not supported or well formed");let[u,d]=En(r,t+s);o.push(u),s+=d}return[o,s]}var wd="Map is not supported or well formed";function TT(r,e,t){if(e===0)return[new Map,1];let[i,n]=(0,ce.decodeLength)(r,e,t),s=n,o=new Map;for(let a=0;a<i;a++){let c=r.byteLength-t-s;if(c<=0)throw new Error(wd);let[u,d]=En(r,t+s);if(s+=d,c-=d,c<=0)throw new Error(wd);if(typeof u!="string"&&typeof u!="number")throw new Error(wd);if(o.has(u))throw new Error(wd);let[f,_]=En(r,t+s);s+=_,o.set(u,f)}return[o,s]}function xT(r,e){if(e+3>r.byteLength)throw new Error("CBOR stream ended before end of Float 16");let t=r.getUint16(e+1,!1);if(t==31744)return[1/0,3];if(t==32256)return[NaN,3];if(t==64512)return[-1/0,3];throw new Error("Float16 data is unsupported")}function OT(r,e){if(e+5>r.byteLength)throw new Error("CBOR stream ended before end of Float 32");return[r.getFloat32(e+1,!1),5]}function IT(r,e){if(e+9>r.byteLength)throw new Error("CBOR stream ended before end of Float 64");return[r.getFloat64(e+1,!1),9]}function BT(r,e,t){let[i,n]=(0,ce.decodeLength)(r,e,t),[s,o]=En(r,t+n);return[new uc(i,s),n+o]}function En(r,e){if(e>=r.byteLength)throw new Error("CBOR stream ended before tag value");let t=r.getUint8(e),i=t>>5,n=t&31;switch(i){case ce.MAJOR_TYPE_UNSIGNED_INTEGER:return Hm(r,n,e);case ce.MAJOR_TYPE_NEGATIVE_INTEGER:return wT(r,n,e);case ce.MAJOR_TYPE_BYTE_STRING:return Fm(r,n,e);case ce.MAJOR_TYPE_TEXT_STRING:return PT(r,n,e);case ce.MAJOR_TYPE_ARRAY:return ET(r,n,e);case ce.MAJOR_TYPE_MAP:return TT(r,n,e);case ce.MAJOR_TYPE_TAG:return BT(r,n,e);case ce.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 xT(r,e);case 26:return OT(r,e);case 27:return IT(r,e)}}throw new Error(`Unsupported or not well formed at ${e}`)}function kT(r){return r===!0?245:r===!1?244:r===null?246:247}function jT(r){if(Math.fround(r)==r||!Number.isFinite(r)||Number.isNaN(r)){let e=new Uint8Array(5);return e[0]=250,new DataView(e.buffer).setFloat32(1,r,!1),e}else{let e=new Uint8Array(9);return e[0]=251,new DataView(e.buffer).setFloat64(1,r,!1),e}}function MT(r){return typeof r=="number"?Number.isSafeInteger(r)?r<0?(0,ce.encodeLength)(ce.MAJOR_TYPE_NEGATIVE_INTEGER,Math.abs(r)):(0,ce.encodeLength)(ce.MAJOR_TYPE_UNSIGNED_INTEGER,r):[jT(r)]:r<0n?(0,ce.encodeLength)(ce.MAJOR_TYPE_NEGATIVE_INTEGER,r*-1n):(0,ce.encodeLength)(ce.MAJOR_TYPE_UNSIGNED_INTEGER,r)}var NT=new TextEncoder;function qT(r,e){e.push(...(0,ce.encodeLength)(ce.MAJOR_TYPE_TEXT_STRING,r.length)),e.push(NT.encode(r))}function RT(r,e){e.push(...(0,ce.encodeLength)(ce.MAJOR_TYPE_BYTE_STRING,r.length)),e.push(r)}function DT(r,e){e.push(...(0,ce.encodeLength)(ce.MAJOR_TYPE_ARRAY,r.length));for(let t of r)lc(t,e)}function UT(r,e){e.push(new Uint8Array((0,ce.encodeLength)(ce.MAJOR_TYPE_MAP,r.size)));for(let[t,i]of r.entries())lc(t,e),lc(i,e)}function KT(r,e){e.push(...(0,ce.encodeLength)(ce.MAJOR_TYPE_TAG,r.tag)),lc(r.value,e)}function lc(r,e){if(typeof r=="boolean"||r===null||r==null){e.push(kT(r));return}if(typeof r=="number"||typeof r=="bigint"){e.push(...MT(r));return}if(typeof r=="string"){qT(r,e);return}if(r instanceof Uint8Array){RT(r,e);return}if(Array.isArray(r)){DT(r,e);return}if(r instanceof Map){UT(r,e);return}if(r instanceof uc){KT(r,e);return}throw new Error("Not implemented")}function Wm(r,e){if(r.byteLength===0||r.byteLength<=e||e<0)throw new Error("No data");return r instanceof Uint8Array?En(new DataView(r.buffer),e):r instanceof ArrayBuffer?En(new DataView(r),e):En(r,e)}Vr.decodePartialCBOR=Wm;function LT(r){let[e,t]=Wm(r,0);if(t!==r.byteLength)throw new Error(`Data was decoded, but the whole stream was not processed ${t} != ${r.byteLength}`);return e}Vr.decodeCBOR=LT;function VT(r){let e=[];lc(r,e);let t=0;for(let s of e)typeof s=="number"?t+=1:t+=s.length;let i=new Uint8Array(t),n=0;for(let s of e)typeof s=="number"?(i[n]=s,n+=1):(i.set(s,n),n+=s.length);return i}Vr.encodeCBOR=VT});var zm=l(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.encodeCBOR=Gr.decodePartialCBOR=Gr.decodeCBOR=Gr.CBORTag=void 0;var Cd=$m();Object.defineProperty(Gr,"CBORTag",{enumerable:!0,get:function(){return Cd.CBORTag}});Object.defineProperty(Gr,"decodeCBOR",{enumerable:!0,get:function(){return Cd.decodeCBOR}});Object.defineProperty(Gr,"decodePartialCBOR",{enumerable:!0,get:function(){return Cd.decodePartialCBOR}});Object.defineProperty(Gr,"encodeCBOR",{enumerable:!0,get:function(){return Cd.encodeCBOR}})});var Jm=l(Hr=>{"use strict";var GT=Hr&&Hr.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),HT=Hr&&Hr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),FT=Hr&&Hr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&>(e,r,t);return HT(e,r),e};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.decodeFirst=WT;Hr.encode=$T;var Ym=FT(zm());function WT(r){let e=new Uint8Array(r),t=Ym.decodePartialCBOR(e,0),[i]=t;return i}function $T(r){return Ym.encodeCBOR(r)}});var Je=l(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.COSEALG=ht.COSECRV=ht.COSEKTY=ht.COSEKEYS=void 0;ht.isCOSEPublicKeyOKP=zT;ht.isCOSEPublicKeyEC2=YT;ht.isCOSEPublicKeyRSA=JT;ht.isCOSEKty=Pd;ht.isCOSECrv=QT;ht.isCOSEAlg=XT;function zT(r){let e=r.get(dc.kty);return Pd(e)&&e===ro.OKP}function YT(r){let e=r.get(dc.kty);return Pd(e)&&e===ro.EC2}function JT(r){let e=r.get(dc.kty);return Pd(e)&&e===ro.RSA}var dc;(function(r){r[r.kty=1]="kty",r[r.alg=3]="alg",r[r.crv=-1]="crv",r[r.x=-2]="x",r[r.y=-3]="y",r[r.n=-1]="n",r[r.e=-2]="e"})(dc||(ht.COSEKEYS=dc={}));var ro;(function(r){r[r.OKP=1]="OKP",r[r.EC2=2]="EC2",r[r.RSA=3]="RSA"})(ro||(ht.COSEKTY=ro={}));function Pd(r){return Object.values(ro).indexOf(r)>=0}var I_;(function(r){r[r.P256=1]="P256",r[r.P384=2]="P384",r[r.P521=3]="P521",r[r.ED25519=6]="ED25519",r[r.SECP256K1=8]="SECP256K1"})(I_||(ht.COSECRV=I_={}));function QT(r){return Object.values(I_).indexOf(r)>=0}var B_;(function(r){r[r.ES256=-7]="ES256",r[r.EdDSA=-8]="EdDSA",r[r.ES384=-35]="ES384",r[r.ES512=-36]="ES512",r[r.PS256=-37]="PS256",r[r.PS384=-38]="PS384",r[r.PS512=-39]="PS512",r[r.ES256K=-47]="ES256K",r[r.RS256=-257]="RS256",r[r.RS384=-258]="RS384",r[r.RS512=-259]="RS512",r[r.RS1=-65535]="RS1"})(B_||(ht.COSEALG=B_={}));function XT(r){return Object.values(B_).indexOf(r)>=0}});var Ed=l(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});k_.mapCoseAlgToWebCryptoAlg=ZT;var Ar=Je();function ZT(r){if([Ar.COSEALG.RS1].indexOf(r)>=0)return"SHA-1";if([Ar.COSEALG.ES256,Ar.COSEALG.PS256,Ar.COSEALG.RS256].indexOf(r)>=0)return"SHA-256";if([Ar.COSEALG.ES384,Ar.COSEALG.PS384,Ar.COSEALG.RS384].indexOf(r)>=0)return"SHA-384";if([Ar.COSEALG.ES512,Ar.COSEALG.PS512,Ar.COSEALG.RS512,Ar.COSEALG.EdDSA].indexOf(r)>=0)return"SHA-512";throw new Error(`Could not map COSE alg value of ${r} to a WebCrypto alg`)}});var Hi=l(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi._getWebCryptoInternals=Gi.MissingWebCrypto=void 0;Gi.getWebCrypto=ex;var fc;function ex(){return new Promise((e,t)=>{if(fc)return e(fc);let i=Gi._getWebCryptoInternals.stubThisGlobalThisCrypto();return i?(fc=i,e(fc)):t(new Td)})}var Td=class extends Error{constructor(){super("An instance of the Crypto API could not be located"),this.name="MissingWebCrypto"}};Gi.MissingWebCrypto=Td;Gi._getWebCryptoInternals={stubThisGlobalThisCrypto:()=>globalThis.crypto,setCachedCrypto:r=>{fc=r}}});var Qm=l(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});j_.digest=ix;var tx=Ed(),rx=Hi();async function ix(r,e){let t=await(0,rx.getWebCrypto)(),i=(0,tx.mapCoseAlgToWebCryptoAlg)(e),n=await t.subtle.digest(i,r);return new Uint8Array(n)}});var Xm=l(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});M_.getRandomValues=sx;var nx=Hi();async function sx(r){return(await(0,nx.getWebCrypto)()).getRandomValues(r),r}});var xd=l(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.importKey=ax;var ox=Hi();async function ax(r){let e=await(0,ox.getWebCrypto)(),{keyData:t,algorithm:i}=r;return e.subtle.importKey("jwk",t,i,!1,["verify"])}});var R_=l(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.verifyEC2=lx;var Tn=Je(),Zm=Ed(),cx=xd(),eb=se(),ux=Hi();async function lx(r){let{cosePublicKey:e,signature:t,data:i,shaHashOverride:n}=r,s=await(0,ux.getWebCrypto)(),o=e.get(Tn.COSEKEYS.alg),a=e.get(Tn.COSEKEYS.crv),c=e.get(Tn.COSEKEYS.x),u=e.get(Tn.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 d;if(a===Tn.COSECRV.P256)d="P-256";else if(a===Tn.COSECRV.P384)d="P-384";else if(a===Tn.COSECRV.P521)d="P-521";else throw new Error(`Unexpected COSE crv value of ${a} (EC2)`);let f={kty:"EC",crv:d,x:eb.isoBase64URL.fromBuffer(c),y:eb.isoBase64URL.fromBuffer(u),ext:!1},_={name:"ECDSA",namedCurve:d},g=await(0,cx.importKey)({keyData:f,algorithm:_}),x=(0,Zm.mapCoseAlgToWebCryptoAlg)(o);n&&(x=(0,Zm.mapCoseAlgToWebCryptoAlg)(n));let T={name:"ECDSA",hash:{name:x}};return s.subtle.verify(T,g,t,i)}});var tb=l(D_=>{"use strict";Object.defineProperty(D_,"__esModule",{value:!0});D_.mapCoseAlgToWebCryptoKeyAlgName=dx;var er=Je();function dx(r){if([er.COSEALG.EdDSA].indexOf(r)>=0)return"Ed25519";if([er.COSEALG.ES256,er.COSEALG.ES384,er.COSEALG.ES512,er.COSEALG.ES256K].indexOf(r)>=0)return"ECDSA";if([er.COSEALG.RS256,er.COSEALG.RS384,er.COSEALG.RS512,er.COSEALG.RS1].indexOf(r)>=0)return"RSASSA-PKCS1-v1_5";if([er.COSEALG.PS256,er.COSEALG.PS384,er.COSEALG.PS512].indexOf(r)>=0)return"RSA-PSS";throw new Error(`Could not map COSE alg value of ${r} to a WebCrypto key alg name`)}});var K_=l(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});U_.verifyRSA=hx;var Od=Je(),rb=Ed(),fx=xd(),ib=se(),nb=tb(),px=Hi();async function hx(r){let{cosePublicKey:e,signature:t,data:i,shaHashOverride:n}=r,s=await(0,px.getWebCrypto)(),o=e.get(Od.COSEKEYS.alg),a=e.get(Od.COSEKEYS.n),c=e.get(Od.COSEKEYS.e);if(!o)throw new Error("Public key was missing alg (RSA)");if(!(0,Od.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:ib.isoBase64URL.fromBuffer(a),e:ib.isoBase64URL.fromBuffer(c),ext:!1},d={name:(0,nb.mapCoseAlgToWebCryptoKeyAlgName)(o),hash:{name:(0,rb.mapCoseAlgToWebCryptoAlg)(o)}},f={name:(0,nb.mapCoseAlgToWebCryptoKeyAlgName)(o)};if(n&&(d.hash.name=(0,rb.mapCoseAlgToWebCryptoAlg)(n)),d.name==="RSASSA-PKCS1-v1_5")d.hash.name==="SHA-256"?u.alg="RS256":d.hash.name==="SHA-384"?u.alg="RS384":d.hash.name==="SHA-512"?u.alg="RS512":d.hash.name==="SHA-1"&&(u.alg="RS1");else if(d.name==="RSA-PSS"){let g=0;d.hash.name==="SHA-256"?(u.alg="PS256",g=32):d.hash.name==="SHA-384"?(u.alg="PS384",g=48):d.hash.name==="SHA-512"&&(u.alg="PS512",g=64),f.saltLength=g}else throw new Error(`Unexpected RSA key algorithm ${o} (${d.name})`);let _=await(0,fx.importKey)({keyData:u,algorithm:d});return s.subtle.verify(f,_,t,i)}});var Id=l(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});L_.convertAAGUIDToString=yx;var _x=se();function yx(r){let e=_x.isoUint8Array.toHex(r);return[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,32)].join("-")}});var vr=l(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});V_.convertCertBufferToPEM=gx;var Bd=se();function gx(r){let e;if(typeof r=="string")if(Bd.isoBase64URL.isBase64URL(r))e=Bd.isoBase64URL.toBase64(r);else if(Bd.isoBase64URL.isBase64(r))e=r;else throw new Error("Certificate is not a valid base64 or base64url string");else e=Bd.isoBase64URL.fromBuffer(r,"base64");let t="";for(let i=0;i<Math.ceil(e.length/64);i+=1){let n=64*i;t+=`${e.substr(n,64)}
|
|
6
|
-
`}return t=`-----BEGIN CERTIFICATE-----
|
|
7
|
-
${t}-----END CERTIFICATE-----
|
|
8
|
-
`,t}});var pc=l(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.convertCOSEtoPKCS=Ax;var G_=se(),sb=Je();function Ax(r){let e=G_.isoCBOR.decodeFirst(r),t=Uint8Array.from([4]),i=e.get(sb.COSEKEYS.x),n=e.get(sb.COSEKEYS.y);if(!i)throw new Error("COSE public key was missing x");return n?G_.isoUint8Array.concat([t,i,n]):G_.isoUint8Array.concat([t,i])}});var F_=l(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io._decodeAttestationObjectInternals=void 0;io.decodeAttestationObject=mx;var vx=se();function mx(r){return io._decodeAttestationObjectInternals.stubThis(vx.isoCBOR.decodeFirst(r))}io._decodeAttestationObjectInternals={stubThis:r=>r}});var kd=l(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no._decodeClientDataJSONInternals=void 0;no.decodeClientDataJSON=Sx;var bx=se();function Sx(r){let e=bx.isoBase64URL.toUTF8String(r),t=JSON.parse(e);return no._decodeClientDataJSONInternals.stubThis(t)}no._decodeClientDataJSONInternals={stubThis:r=>r}});var oo=l(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so._decodeCredentialPublicKeyInternals=void 0;so.decodeCredentialPublicKey=Cx;var wx=se();function Cx(r){return so._decodeCredentialPublicKeyInternals.stubThis(wx.isoCBOR.decodeFirst(r))}so._decodeCredentialPublicKeyInternals={stubThis:r=>r}});var W_=l(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao._generateUserIDInternals=void 0;ao.generateUserID=Ex;var Px=se();async function Ex(){let r=new Uint8Array(32);return await Px.isoCrypto.getRandomValues(r),ao._generateUserIDInternals.stubThis(r)}ao._generateUserIDInternals={stubThis:r=>r}});var m={};Um(m,{__addDisposableResource:()=>Ib,__assign:()=>jd,__asyncDelegator:()=>Sb,__asyncGenerator:()=>bb,__asyncValues:()=>wb,__await:()=>co,__awaiter:()=>_b,__classPrivateFieldGet:()=>Tb,__classPrivateFieldIn:()=>Ob,__classPrivateFieldSet:()=>xb,__createBinding:()=>Nd,__decorate:()=>cb,__disposeResources:()=>Bb,__esDecorate:()=>lb,__exportStar:()=>gb,__extends:()=>ob,__generator:()=>yb,__importDefault:()=>Eb,__importStar:()=>Pb,__makeTemplateObject:()=>Cb,__metadata:()=>hb,__param:()=>ub,__propKey:()=>fb,__read:()=>Y_,__rest:()=>ab,__rewriteRelativeImportExtension:()=>kb,__runInitializers:()=>db,__setFunctionName:()=>pb,__spread:()=>Ab,__spreadArray:()=>mb,__spreadArrays:()=>vb,__values:()=>Md,default:()=>Ox});function ob(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");$_(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ab(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}function cb(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}function ub(r,e){return function(t,i){e(t,i,r)}}function lb(r,e,t,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&&r?i.static?r:r.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),f,_=!1,g=t.length-1;g>=0;g--){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(_)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(U||null))};var I=(0,t[g])(a==="accessor"?{get:d.get,set:d.set}:d[c],x);if(a==="accessor"){if(I===void 0)continue;if(I===null||typeof I!="object")throw new TypeError("Object expected");(f=o(I.get))&&(d.get=f),(f=o(I.set))&&(d.set=f),(f=o(I.init))&&n.unshift(f)}else(f=o(I))&&(a==="field"?n.unshift(f):d[c]=f)}u&&Object.defineProperty(u,i.name,d),_=!0}function db(r,e,t){for(var i=arguments.length>2,n=0;n<e.length;n++)t=i?e[n].call(r,t):e[n].call(r);return i?t:void 0}function fb(r){return typeof r=="symbol"?r:"".concat(r)}function pb(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function hb(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function _b(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(d){try{u(i.next(d))}catch(f){o(f)}}function c(d){try{u(i.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):n(d.value).then(a,c)}u((i=i.apply(r,e||[])).next())})}function yb(r,e){var t={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(d){return c([u,d])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)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 t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function gb(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Nd(e,r,t)}function Md(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y_(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),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&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}function Ab(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Y_(arguments[e]));return r}function vb(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function mb(r,e,t){if(t||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 r.concat(s||Array.prototype.slice.call(e))}function co(r){return this instanceof co?(this.v=r,this):new co(r)}function bb(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,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(g){return function(x){return Promise.resolve(x).then(g,f)}}function a(g,x){i[g]&&(n[g]=function(T){return new Promise(function(I,U){s.push([g,T,I,U])>1||c(g,T)})},x&&(n[g]=x(n[g])))}function c(g,x){try{u(i[g](x))}catch(T){_(s[0][3],T)}}function u(g){g.value instanceof co?Promise.resolve(g.value.v).then(d,f):_(s[0][2],g)}function d(g){c("next",g)}function f(g){c("throw",g)}function _(g,x){g(x),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Sb(r){var e,t;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]=r[n]?function(o){return(t=!t)?{value:co(r[n](o)),done:!1}:s?s(o):o}:s}}function wb(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Md=="function"?Md(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=r[s]&&function(o){return new Promise(function(a,c){o=r[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 Cb(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function Pb(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t=z_(r),i=0;i<t.length;i++)t[i]!=="default"&&Nd(e,r,t[i]);return Tx(e,r),e}function Eb(r){return r&&r.__esModule?r:{default:r}}function Tb(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}function xb(r,e,t,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"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t}function Ob(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}function Ib(r,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(t){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],t&&(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)}}),r.stack.push({value:e,dispose:i,async:t})}else t&&r.stack.push({async:!0});return e}function Bb(r){function e(s){r.error=r.hasError?new xx(s,r.error,"An error was suppressed during disposal."):s,r.hasError=!0}var t,i=0;function n(){for(;t=r.stack.pop();)try{if(!t.async&&i===1)return i=0,r.stack.push(t),Promise.resolve().then(n);if(t.dispose){var s=t.dispose.call(t.value);if(t.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 r.hasError?Promise.reject(r.error):Promise.resolve();if(r.hasError)throw r.error}return n()}function kb(r,e){return typeof r=="string"&&/^\.\.?\//.test(r)?r.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,i,n,s,o){return i?e?".jsx":".js":n&&(!s||!o)?t:n+s+"."+o.toLowerCase()+"js"}):r}var $_,jd,Nd,Tx,z_,xx,Ox,b=Dm(()=>{$_=function(r,e){return $_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},$_(r,e)};jd=function(){return jd=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},jd.apply(this,arguments)};Nd=Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]});Tx=Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e},z_=function(r){return z_=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},z_(r)};xx=typeof SuppressedError=="function"?SuppressedError:function(r,e,t){var i=new Error(t);return i.name="SuppressedError",i.error=r,i.suppressed=e,i};Ox={__extends:ob,__assign:jd,__rest:ab,__decorate:cb,__param:ub,__esDecorate:lb,__runInitializers:db,__propKey:fb,__setFunctionName:pb,__metadata:hb,__awaiter:_b,__generator:yb,__createBinding:Nd,__exportStar:gb,__values:Md,__read:Y_,__spread:Ab,__spreadArrays:vb,__spreadArray:mb,__await:co,__asyncGenerator:bb,__asyncDelegator:Sb,__asyncValues:wb,__makeTemplateObject:Cb,__importStar:Pb,__importDefault:Eb,__classPrivateFieldGet:Tb,__classPrivateFieldSet:xb,__classPrivateFieldIn:Ob,__addDisposableResource:Ib,__disposeResources:Bb,__rewriteRelativeImportExtension:kb}});var Ai=l(uo=>{"use strict";var Ix="[object ArrayBuffer]",gi=class r{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Ix}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let i=r.toUint8Array(e),n=r.toUint8Array(t);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 t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let i=0;for(let o of t)i+=o.byteLength;let n=new Uint8Array(i),s=0;for(let o of t){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}},J_="string",Bx=/^[0-9a-f\s]+$/i,kx=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,jx=/^[a-zA-Z0-9-_]+$/,qd=class{static fromString(e){let t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i.buffer}static toString(e){let t=gi.toUint8Array(e),i="";for(let s=0;s<t.length;s++)i+=String.fromCharCode(t[s]);return decodeURIComponent(escape(i))}},tr=class{static toString(e,t=!1){let i=gi.toArrayBuffer(e),n=new DataView(i),s="";for(let o=0;o<i.byteLength;o+=2){let a=n.getUint16(o,t);s+=String.fromCharCode(a)}return s}static fromString(e,t=!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),t);return i}},Rd=class r{static isHex(e){return typeof e===J_&&Bx.test(e)}static isBase64(e){return typeof e===J_&&kx.test(e)}static isBase64Url(e){return typeof e===J_&&jx.test(e)}static ToString(e,t="utf8"){let i=gi.toUint8Array(e);switch(t.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 tr.toString(i,!0);case"utf16":case"utf16be":return tr.toString(i);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return tr.fromString(e,!0);case"utf16":case"utf16be":return tr.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=gi.toUint8Array(e);if(typeof btoa<"u"){let i=this.ToString(t,"binary");return btoa(i)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return qd.fromString(e);case"utf16":case"utf16be":return tr.fromString(e);case"utf16le":case"usc2":return tr.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=r.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return qd.toString(e);case"utf16":case"utf16be":return tr.toString(e);case"utf16le":case"usc2":return tr.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,i=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);return i.buffer}static ToBinary(e){let t=gi.toUint8Array(e),i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){let t=gi.toUint8Array(e),i="",n=t.length;for(let s=0;s<n;s++){let o=t[s];o<16&&(i+="0"),i+=o.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!r.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let i=new Uint8Array(t.length/2);for(let n=0;n<t.length;n=n+2){let s=t.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,t=!1){return tr.toString(e,t)}static FromUtf16String(e,t=!1){return tr.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let i=0;i<t;i++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Rd.DEFAULT_UTF8_ENCODING="utf8";function Mx(r,...e){let t=arguments[0];for(let i=1;i<arguments.length;i++){let n=arguments[i];for(let s in n)t[s]=n[s]}return t}function Nx(...r){let e=r.map(n=>n.byteLength).reduce((n,s)=>n+s),t=new Uint8Array(e),i=0;return r.map(n=>new Uint8Array(n)).forEach(n=>{for(let s of n)t[i++]=s}),t.buffer}function qx(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}uo.BufferSourceConverter=gi;uo.Convert=Rd;uo.assign=Mx;uo.combine=Nx;uo.isEqual=qx});var Nb=l(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});function Rx(r){return new Date(r.getTime()+r.getTimezoneOffset()*6e4)}function Dx(r,e,t){var i;return r instanceof Object&&(i=r[e])!==null&&i!==void 0?i:t}function Ux(r,e=0,t=r.byteLength-e,i=!1){let n="";for(let s of new Uint8Array(r,e,t)){let o=s.toString(16).toUpperCase();o.length===1&&(n+="0"),n+=o,i&&(n+=" ")}return n.trim()}function Kx(r,e,t,i){return e instanceof ArrayBuffer?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):i<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-i<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error='Wrong parameter: inputBuffer must be "ArrayBuffer"',!1)}function Q_(r,e){let t=0;if(r.length===1)return r[0];for(let i=r.length-1;i>=0;i--)t+=r[r.length-1-i]*Math.pow(2,e*i);return t}function X_(r,e,t=-1){let i=t,n=r,s=0,o=Math.pow(2,e);for(let a=1;a<8;a++){if(r<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 d=a-1;d>=0;d--){let f=Math.pow(2,d*e);u[s-d-1]=Math.floor(n/f),n-=u[s-d-1]*f}return c}o*=Math.pow(2,e)}return new ArrayBuffer(0)}function Lx(...r){let e=0,t=0;for(let s of r)e+=s.byteLength;let i=new ArrayBuffer(e),n=new Uint8Array(i);for(let s of r)n.set(new Uint8Array(s),t),t+=s.byteLength;return i}function Vx(...r){let e=0,t=0;for(let s of r)e+=s.length;let i=new ArrayBuffer(e),n=new Uint8Array(i);for(let s of r)n.set(s,t),t+=s.length;return n}function Gx(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let a=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(a||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let a=0;a<this.valueHex.byteLength;a++)t[a]=0;t[0]=r[0]&128;let i=Q_(t,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let a=0;a<this.valueHex.byteLength;a++)s[a]=r[a];return s[0]&=127,Q_(s,8)-i}function Hx(r){let e=r<0?r*-1:r,t=128;for(let i=1;i<8;i++){if(e<=t){if(r<0){let o=t-e,a=X_(o,8,i),c=new Uint8Array(a);return c[0]|=128,a}let n=X_(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}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function Fx(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}function Wx(r,e){let t=r.toString(10);if(e<t.length)return"";let i=e-t.length,n=new Array(i);for(let o=0;o<i;o++)n[o]="0";return n.join("").concat(t)}var jb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Mb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function $x(r,e=!1,t=!1,i=!1){let n=0,s=0,o=0,a="",c=e?Mb:jb;if(i){let u=0;for(let d=0;d<r.length;d++)if(r.charCodeAt(d)!==0){u=d;break}r=r.slice(u)}for(;n<r.length;){let u=r.charCodeAt(n++);n>=r.length&&(s=1);let d=r.charCodeAt(n++);n>=r.length&&(o=1);let f=r.charCodeAt(n++),_=u>>2,g=(u&3)<<4|d>>4,x=(d&15)<<2|f>>6,T=f&63;s===1?x=T=64:o===1&&(T=64),t?x===64?a+=`${c.charAt(_)}${c.charAt(g)}`:T===64?a+=`${c.charAt(_)}${c.charAt(g)}${c.charAt(x)}`:a+=`${c.charAt(_)}${c.charAt(g)}${c.charAt(x)}${c.charAt(T)}`:a+=`${c.charAt(_)}${c.charAt(g)}${c.charAt(x)}${c.charAt(T)}`}return a}function zx(r,e=!1,t=!1){let i=e?Mb:jb;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<r.length;){let c=n(r.charAt(o++)),u=o>=r.length?0:n(r.charAt(o++)),d=o>=r.length?0:n(r.charAt(o++)),f=o>=r.length?0:n(r.charAt(o++)),_=s(c)<<2|s(u)>>4,g=(s(u)&15)<<4|s(d)>>2,x=(s(d)&3)<<6|s(f);a+=String.fromCharCode(_),d!==64&&(a+=String.fromCharCode(g)),f!==64&&(a+=String.fromCharCode(x))}if(t){let c=a.length,u=-1;for(let d=c-1;d>=0;d--)if(a.charCodeAt(d)!==0){u=d;break}u!==-1?a=a.slice(0,u+1):a=""}return a}function Yx(r){let e="",t=new Uint8Array(r);for(let i of t)e+=String.fromCharCode(i);return e}function Jx(r){let e=r.length,t=new ArrayBuffer(e),i=new Uint8Array(t);for(let n=0;n<e;n++)i[n]=r.charCodeAt(n);return t}var Qx=Math.log(2);function Xx(r){let e=Math.log(r)/Qx,t=Math.floor(e),i=Math.round(e);return t===i?t:i}function Zx(r,e){for(let t of e)delete r[t]}He.arrayBufferToString=Yx;He.bufferToHexCodes=Ux;He.checkBufferParams=Kx;He.clearProps=Zx;He.fromBase64=zx;He.getParametersValue=Dx;He.getUTCDate=Rx;He.isEqualBuffer=Fx;He.nearestPowerOf2=Xx;He.padNumber=Wx;He.stringToArrayBuffer=Jx;He.toBase64=$x;He.utilConcatBuf=Lx;He.utilConcatView=Vx;He.utilDecodeTC=Gx;He.utilEncodeTC=Hx;He.utilFromBase=Q_;He.utilToBase=X_});var Fi=l(Y=>{"use strict";var eO=Ai(),tO=Nb();function Ub(r){var e=Object.create(null);return r&&Object.keys(r).forEach(function(t){if(t!=="default"){var i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:function(){return r[t]}})}}),e.default=r,Object.freeze(e)}var te=Ub(eO),pe=Ub(tO);function Dd(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function ty(r){let e=0,t=0;for(let n=0;n<r.length;n++){let s=r[n];e+=s.byteLength}let i=new Uint8Array(e);for(let n=0;n<r.length;n++){let s=r[n];i.set(new Uint8Array(s),t),t+=s.byteLength}return i.buffer}function bi(r,e,t,i){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):i<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-i<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}var fo=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return ty(this.items)}},hc=[new Uint8Array([1])],qb="0123456789",Z_="name",Rb="valueHexView",rO="isHexOnly",iO="idBlock",nO="tagClass",sO="tagNumber",oO="isConstructed",aO="fromBER",cO="toBER",uO="local",Pt="",$r=new ArrayBuffer(0),ef=new Uint8Array(0),yc="EndOfContent",Kb="OCTET STRING",Lb="BIT STRING";function zr(r){var e;return e=class extends r{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?te.BufferSourceConverter.toUint8Array(s.valueHex):ef}fromBER(i,n,s){let o=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!bi(this,o,n,s))return-1;let a=n+s;return this.valueHexView=o.subarray(n,a),this.valueHexView.length?(this.blockLength=s,a):(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",$r)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:te.Convert.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}var vi=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:t=Pt,warnings:i=[],valueBeforeDecode:n=ef}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=te.BufferSourceConverter.toUint8Array(n)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:te.Convert.ToHex(this.valueBeforeDecodeView)}}};vi.NAME="baseBlock";var ut=class extends vi{fromBER(e,t,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};ut.NAME="valueBlock";var Ud=class extends zr(vi){constructor({idBlock:e={}}={}){var t,i,n,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?te.BufferSourceConverter.toUint8Array(e.valueHex):ef,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 t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",$r}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,n[0]=t}return n.buffer}if(!this.isHexOnly){let n=pe.utilToBase(this.tagNumber,7),s=new Uint8Array(n),o=n.byteLength,a=new Uint8Array(o+1);if(a[0]=t|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]=t|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,t,i){let n=te.BufferSourceConverter.toUint8Array(e);if(!bi(this,n,t,i))return-1;let s=n.subarray(t,t+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=1,u=this.valueHexView=new Uint8Array(255),d=255;for(;s[c]&128;){if(u[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===d){d+=255;let _=new Uint8Array(d);for(let g=0;g<u.length;g++)_[g]=u[g];u=this.valueHexView=new Uint8Array(d)}}this.blockLength=c+1,u[c-1]=s[c]&127;let f=new Uint8Array(c);for(let _=0;_<c;_++)f[_]=u[_];u=this.valueHexView=new Uint8Array(c),u.set(f),this.blockLength<=9?this.tagNumber=pe.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 t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};Ud.NAME="identificationBlock";var Kd=class extends vi{constructor({lenBlock:e={}}={}){var t,i,n;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!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,t,i){let n=te.BufferSourceConverter.toUint8Array(e);if(!bi(this,n,t,i))return-1;let s=n.subarray(t,t+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,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+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=t+1,c=n.subarray(a,a+o);return c[o-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=pe.utilFromBase(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=o+1,t+this.blockLength}toBER(e=!1){let t,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=128),t;if(this.longFormUsed){let n=pe.utilToBase(this.length,8);if(n.byteLength>127)return this.error="Too big length",$r;if(t=new ArrayBuffer(n.byteLength+1),e)return t;let s=new Uint8Array(n);i=new Uint8Array(t),i[0]=n.byteLength|128;for(let o=0;o<n.byteLength;o++)i[o+1]=s[o];return t}return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};Kd.NAME="lengthBlock";var N={},rt=class extends vi{constructor({name:e=Pt,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new Ud(n),this.lenBlock=new Kd(n),this.valueBlock=s?new s(n):new ut(n)}fromBER(e,t,i){let n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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)}toBER(e,t){let i=t||new fo;t||Vb(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 t?$r: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():te.Convert.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=te.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),i=e.toBER();return pe.isEqualBuffer(t,i)}};rt.NAME="BaseBlock";function Vb(r){var e;if(r instanceof N.Constructed)for(let t of r.valueBlock.value)Vb(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}var gc=class extends rt{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Pt,...t}={},i){super(t,i),e&&this.fromString(e)}fromBER(e,t,i){let n=this.valueBlock.fromBER(e,t,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}'`}};gc.NAME="BaseStringBlock";var Ld=class extends zr(ut){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};Ld.NAME="PrimitiveValueBlock";var Gb,Ac=class extends rt{constructor(e={}){super(e,Ld),this.idBlock.isConstructed=!1}};Gb=Ac;N.Primitive=Gb;Ac.NAME="PRIMITIVE";function lO(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function yo(r,e=0,t=r.length){let i=e,n=new rt({},ut),s=new vi;if(!bi(s,r,e,t))return n.error=s.error,{offset:-1,result:n};if(!r.subarray(e,e+t).length)return n.error="Zero buffer length",{offset:-1,result:n};let a=n.idBlock.fromBER(r,e,t);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),a===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(e=a,t-=n.idBlock.blockLength,a=n.lenBlock.fromBER(r,e,t),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),a===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(e=a,t-=n.lenBlock.blockLength,!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm)return n.error="Indefinite length form used for primitive encoding form",{offset:-1,result:n};let c=rt;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};c=N.EndOfContent;break;case 1:c=N.Boolean;break;case 2:c=N.Integer;break;case 3:c=N.BitString;break;case 4:c=N.OctetString;break;case 5:c=N.Null;break;case 6:c=N.ObjectIdentifier;break;case 10:c=N.Enumerated;break;case 12:c=N.Utf8String;break;case 13:c=N.RelativeObjectIdentifier;break;case 14:c=N.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:c=N.Sequence;break;case 17:c=N.Set;break;case 18:c=N.NumericString;break;case 19:c=N.PrintableString;break;case 20:c=N.TeletexString;break;case 21:c=N.VideotexString;break;case 22:c=N.IA5String;break;case 23:c=N.UTCTime;break;case 24:c=N.GeneralizedTime;break;case 25:c=N.GraphicString;break;case 26:c=N.VisibleString;break;case 27:c=N.GeneralString;break;case 28:c=N.UniversalString;break;case 29:c=N.CharacterString;break;case 30:c=N.BmpString;break;case 31:c=N.DATE;break;case 32:c=N.TimeOfDay;break;case 33:c=N.DateTime;break;case 34:c=N.Duration;break;default:{let u=n.idBlock.isConstructed?new N.Constructed:new N.Primitive;u.idBlock=n.idBlock,u.lenBlock=n.lenBlock,u.warnings=n.warnings,n=u}}break;default:c=n.idBlock.isConstructed?N.Constructed:N.Primitive}return n=lO(n,c),a=n.fromBER(r,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=r.subarray(i,i+n.blockLength),{offset:a,result:n}}function dO(r){if(!r.byteLength){let e=new rt({},ut);return e.error="Input buffer has zero length",{offset:-1,result:e}}return yo(te.BufferSourceConverter.toUint8Array(r).slice(),0,r.byteLength)}function fO(r,e){return r?1:e}var Fr=class extends ut{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){let n=te.BufferSourceConverter.toUint8Array(e);if(!bi(this,n,t,i))return-1;if(this.valueBeforeDecodeView=n.subarray(t,t+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;fO(this.isIndefiniteForm,i)>0;){let o=yo(n,s,i);if(o.offset===-1)return this.error=o.result.error,this.warnings.concat(o.result.warnings),-1;if(s=o.offset,this.blockLength+=o.result.blockLength,i-=o.result.blockLength,this.value.push(o.result),this.isIndefiniteForm&&o.result.constructor.NAME===yc)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===yc?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){let i=t||new fo;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?$r:i.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Fr.NAME="ConstructedValueBlock";var Hb,mi=class extends rt{constructor(e={}){super(e,Fr),this.idBlock.isConstructed=!0}fromBER(e,t,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(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(){let e=[];for(let i of this.valueBlock.value)e.push(i.toString("ascii").split(`
|
|
1
|
+
// @simplewebauthn/server v13.3.1 — vendored. License: MIT
|
|
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)}
|
|
4
|
+
`}return r=`-----BEGIN CERTIFICATE-----
|
|
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(`
|
|
9
7
|
`).map(n=>` ${n}`).join(`
|
|
10
|
-
`));let
|
|
8
|
+
`));let r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${r} :
|
|
11
9
|
${e.join(`
|
|
12
|
-
`)}`:`${t} :`}};Hb=mi;N.Constructed=Hb;mi.NAME="CONSTRUCTED";var Vd=class extends ut{fromBER(e,t,i){return t}toBER(e){return $r}};Vd.override="EndOfContentValueBlock";var Fb,vc=class extends rt{constructor(e={}){super(e,Vd),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};Fb=vc;N.EndOfContent=Fb;vc.NAME=yc;var Wb,mc=class extends rt{constructor(e={}){super(e,ut),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,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,t+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+i}toBER(e,t){let i=new ArrayBuffer(2);if(!e){let n=new Uint8Array(i);n[0]=5,n[1]=0}return t&&t.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}};Wb=mc;N.Null=Wb;mc.NAME="NULL";var Gd=class extends zr(ut){get value(){for(let e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=te.BufferSourceConverter.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,i){let n=te.BufferSourceConverter.toUint8Array(e);return bi(this,n,t,i)?(this.valueHexView=n.subarray(t,t+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,pe.utilDecodeTC.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}};Gd.NAME="BooleanValueBlock";var $b,bc=class extends rt{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,Gd),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};$b=bc;N.Boolean=$b;bc.NAME="BOOLEAN";var Hd=class extends zr(Fr){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=Fr.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){let o=this.value[s].constructor.NAME;if(o===yc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(o!==Kb)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(e,t,i),this.blockLength=i;return n}toBER(e,t){return this.isConstructed?Fr.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}};Hd.NAME="OctetStringValueBlock";var ry,Sc=class extends rt{constructor({idBlock:e={},lenBlock:t={},...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:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},Hd),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,i){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),t;if(!this.valueBlock.isConstructed){let s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+i);try{if(s.byteLength){let o=yo(s,0,s.byteLength);o.offset!==-1&&o.offset===i&&(this.valueBlock.value=[o.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return mi.prototype.onAsciiEncoding.call(this);let e=this.constructor.NAME,t=te.Convert.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;let e=[];for(let t of this.valueBlock.value)t instanceof ry&&e.push(t.valueBlock.valueHexView);return te.BufferSourceConverter.concat(e)}};ry=Sc;N.OctetString=ry;Sc.NAME=Kb;var Fd=class extends zr(Fr){constructor({unusedBits:e=0,isConstructed:t=!1,...i}={}){super(i),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,i){if(!i)return t;let n=-1;if(this.isConstructed){if(n=Fr.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let a of this.value){let c=a.constructor.NAME;if(c===yc){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==Lb)return this.error="BIT STRING may consists of BIT STRINGs only",-1;let u=a.valueBlock;if(this.unusedBits>0&&u.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=u.unusedBits}return n}let s=te.BufferSourceConverter.toUint8Array(e);if(!bi(this,s,t,i))return-1;let o=s.subarray(t,t+i);if(this.unusedBits=o[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){let a=o.subarray(1);try{if(a.byteLength){let c=yo(a,0,a.byteLength);c.offset!==-1&&c.offset===i-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=o.subarray(1),this.blockLength=o.length,t+i}toBER(e,t){if(this.isConstructed)return Fr.prototype.toBER.call(this,e,t);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}}};Fd.NAME="BitStringValueBlock";var zb,wc=class extends rt{constructor({idBlock:e={},lenBlock:t={},...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:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},Fd),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return mi.prototype.onAsciiEncoding.call(this);{let e=[],t=this.valueBlock.valueHexView;for(let o of t)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}`}}};zb=wc;N.BitString=zb;wc.NAME=Lb;var Yb;function pO(r,e){let t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),o=s.length-1,a=n.slice(0),c=a.length-1,u=0,d=c<o?o:c,f=0;for(let _=d;_>=0;_--,f++)!0===f<a.length?u=s[o-f]+a[c-f]+t[0]:u=s[o-f]+t[0],t[0]=u/10,!0===f>=s.length?s=pe.utilConcatView(new Uint8Array([u%10]),s):s[o-f]=u%10;return t[0]>0&&(s=pe.utilConcatView(t,s)),s}function Db(r){if(r>=hc.length)for(let e=hc.length;e<=r;e++){let t=new Uint8Array([0]),i=hc[e-1].slice(0);for(let n=i.length-1;n>=0;n--){let s=new Uint8Array([(i[n]<<1)+t[0]]);t[0]=s[0]/10,i[n]=s[0]%10}t[0]>0&&(i=pe.utilConcatView(t,i)),hc.push(i)}return hc[r]}function hO(r,e){let t=0,i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),o=s.length-1,a=n.slice(0),c=a.length-1,u,d=0;for(let f=c;f>=0;f--,d++)u=s[o-d]-a[c-d]-t,!0===u<0?(t=1,s[o-d]=u+10):(t=0,s[o-d]=u);if(t>0)for(let f=o-c+1;f>=0;f--,d++)if(u=s[o-d]-t,u<0)t=1,s[o-d]=u+10;else{t=0,s[o-d]=u;break}return s.slice()}var Cc=class extends zr(ut){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=pe.utilDecodeTC.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(pe.utilEncodeTC(e))}get valueDec(){return this._valueDec}fromDER(e,t,i,n=0){let s=this.fromBER(e,t,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 t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{let i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(t,1),this.valueHexView=i}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,i){let n=super.fromBER(e,t,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,t=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?(t=hO(Db(i),t),o="-"):t=pO(t,Db(i))),i++,n>>=1}for(let c=0;c<t.length;c++)t[c]&&(a=!0),a&&(o+=qb.charAt(t[c]));return a===!1&&(o+=qb.charAt(0)),o}};Yb=Cc;Cc.NAME="IntegerValueBlock";Object.defineProperty(Yb.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var _c,po=class extends rt{constructor(e={}){super(e,Cc),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Dd(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Dd();let t=BigInt(e),i=new fo,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(te.Convert.FromHex(n));if(t<0){let a=new Uint8Array(s.length+(s[0]&128?1:0));a[0]|=128;let u=BigInt(`0x${te.Convert.ToHex(a)}`)+t,d=te.BufferSourceConverter.toUint8Array(te.Convert.FromHex(u.toString(16)));d[0]|=128,i.write(d)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new _c({valueHex:i.final()})}convertToDER(){let e=new _c({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new _c({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};_c=po;N.Integer=_c;po.NAME="INTEGER";var Jb,Pc=class extends po{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};Jb=Pc;N.Enumerated=Jb;Pc.NAME="ENUMERATED";var Ec=class extends zr(ut){constructor({valueDec:e=-1,isFirstSid:t=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,i){if(!i)return t;let n=te.BufferSourceConverter.toUint8Array(e);if(!bi(this,n,t,i))return-1;let s=n.subarray(t,t+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=pe.utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){Dd();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;let i=new Uint8Array(t.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(t.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 t=pe.utilToBase(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",$r;let i=new Uint8Array(t.byteLength);if(!e){let n=new Uint8Array(t),s=t.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=te.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}};Ec.NAME="sidBlock";var Wd=class extends ut{constructor({value:e=Pt,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){let s=new Ec;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 t=[];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,$r;t.push(n)}return ty(t)}fromString(e){this.value=[];let t=0,i=0,n="",s=!1;do if(i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=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 Ec;if(n>Number.MAX_SAFE_INTEGER){Dd();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="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t?(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 t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};Wd.NAME="ObjectIdentifierValueBlock";var Qb,Tc=class extends rt{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Wd),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Qb=Tc;N.ObjectIdentifier=Qb;Tc.NAME="OBJECT IDENTIFIER";var xc=class extends zr(vi){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;let n=te.BufferSourceConverter.toUint8Array(e);if(!bi(this,n,t,i))return-1;let s=n.subarray(t,t+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=pe.utilFromBase(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);let 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 t=pe.utilToBase(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",$r;let i=new Uint8Array(t.byteLength);if(!e){let n=new Uint8Array(t),s=t.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=te.Convert.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}};xc.NAME="relativeSidBlock";var $d=class extends ut{constructor({value:e=Pt,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){let s=new xc;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,t){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,$r;i.push(s)}return ty(i)}fromString(e){this.value=[];let t=0,i=0,n="";do{i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1;let s=new xc;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t&&(n=`{${n}}`),e+=n}return e}toJSON(){let e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};$d.NAME="RelativeObjectIdentifierValueBlock";var Xb,Oc=class extends rt{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,$d),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}};Xb=Oc;N.RelativeObjectIdentifier=Xb;Oc.NAME="RelativeObjectIdentifier";var Zb,Ic=class extends mi{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};Zb=Ic;N.Sequence=Zb;Ic.NAME="SEQUENCE";var eS,Bc=class extends mi{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};eS=Bc;N.Set=eS;Bc.NAME="SET";var zd=class extends zr(ut){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Pt}toJSON(){return{...super.toJSON(),value:this.value}}};zd.NAME="StringValueBlock";var Yd=class extends zd{};Yd.NAME="SimpleStringValueBlock";var bt=class extends gc{constructor({...e}={}){super(e,Yd)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,te.BufferSourceConverter.toUint8Array(e))}fromString(e){let t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);this.valueBlock.value=e}};bt.NAME="SIMPLE STRING";var Jd=class extends bt{fromBuffer(e){this.valueBlock.valueHexView=te.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=te.Convert.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=te.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(te.Convert.FromUtf8String(e)),this.valueBlock.value=e}};Jd.NAME="Utf8StringValueBlock";var tS,Wr=class extends Jd{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};tS=Wr;N.Utf8String=tS;Wr.NAME="UTF8String";var Qd=class extends bt{fromBuffer(e){this.valueBlock.value=te.Convert.ToUtf16String(e),this.valueBlock.valueHexView=te.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(te.Convert.FromUtf16String(e))}};Qd.NAME="BmpStringValueBlock";var rS,kc=class extends Qd{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};rS=kc;N.BmpString=rS;kc.NAME="BMPString";var Xd=class extends bt{fromBuffer(e){let t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(t);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(t))}fromString(e){let t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let n=0;n<t;n++){let s=pe.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}};Xd.NAME="UniversalStringValueBlock";var iS,jc=class extends Xd{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};iS=jc;N.UniversalString=iS;jc.NAME="UniversalString";var nS,Mc=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};nS=Mc;N.NumericString=nS;Mc.NAME="NumericString";var sS,Nc=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};sS=Nc;N.PrintableString=sS;Nc.NAME="PrintableString";var oS,qc=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};oS=qc;N.TeletexString=oS;qc.NAME="TeletexString";var aS,Rc=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};aS=Rc;N.VideotexString=aS;Rc.NAME="VideotexString";var cS,Dc=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};cS=Dc;N.IA5String=cS;Dc.NAME="IA5String";var uS,Uc=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};uS=Uc;N.GraphicString=uS;Uc.NAME="GraphicString";var lS,ho=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};lS=ho;N.VisibleString=lS;ho.NAME="VisibleString";var dS,Kc=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};dS=Kc;N.GeneralString=dS;Kc.NAME="GeneralString";var fS,Lc=class extends bt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};fS=Lc;N.CharacterString=fS;Lc.NAME="CharacterString";var pS,_o=class extends ho{constructor({value:e,valueDate:t,...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)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,te.BufferSourceConverter.toUint8Array(e)))}toBuffer(){let e=this.toString(),t=new ArrayBuffer(e.length),i=new Uint8Array(t);for(let n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){let 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 t=new Array(7);return t[0]=pe.padNumber(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=pe.padNumber(this.month,2),t[2]=pe.padNumber(this.day,2),t[3]=pe.padNumber(this.hour,2),t[4]=pe.padNumber(this.minute,2),t[5]=pe.padNumber(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}};pS=_o;N.UTCTime=pS;_o.NAME="UTCTime";var hS,Vc=class extends _o{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){let e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,i="",n="",s=0,o,a=0,c=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{let f=new Number(e[e.length-1]);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(t){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 f=1,_=i.indexOf("+"),g="";if(_===-1&&(_=i.indexOf("-"),f=-1),_!==-1){if(g=i.substring(_+1),i=i.substring(0,_),g.length!==2&&g.length!==4)throw new Error("Wrong input string for conversion");let x=parseInt(g.substring(0,2),10);if(isNaN(x.valueOf()))throw new Error("Wrong input string for conversion");if(a=f*x,g.length===4){if(x=parseInt(g.substring(2,4),10),isNaN(x.valueOf()))throw new Error("Wrong input string for conversion");c=f*x}}}let u=i.indexOf(".");if(u===-1&&(u=i.indexOf(",")),u!==-1){let f=new Number(`0${i.substring(u)}`);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");s=f.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 f=60*s;this.minute=Math.floor(f),f=60*(f-this.minute),this.second=Math.floor(f),f=1e3*(f-this.second),this.millisecond=Math.floor(f)}break;case n.length===12:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let f=60*s;this.second=Math.floor(f),f=1e3*(f-this.second),this.millisecond=Math.floor(f)}break;case n.length===14:if(o=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let f=1e3*s;this.millisecond=Math.floor(f)}break;default:throw new Error("Wrong input string for conversion")}let d=o.exec(n);if(d===null)throw new Error("Wrong input string for conversion");for(let f=1;f<d.length;f++)switch(f){case 1:this.year=parseInt(d[f],10);break;case 2:this.month=parseInt(d[f],10);break;case 3:this.day=parseInt(d[f],10);break;case 4:this.hour=parseInt(d[f],10)+a;break;case 5:this.minute=parseInt(d[f],10)+c;break;case 6:this.second=parseInt(d[f],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){let f=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=f.getUTCFullYear(),this.month=f.getUTCMonth(),this.day=f.getUTCDay(),this.hour=f.getUTCHours(),this.minute=f.getUTCMinutes(),this.second=f.getUTCSeconds(),this.millisecond=f.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){let t=[];return t.push(pe.padNumber(this.year,4)),t.push(pe.padNumber(this.month,2)),t.push(pe.padNumber(this.day,2)),t.push(pe.padNumber(this.hour,2)),t.push(pe.padNumber(this.minute,2)),t.push(pe.padNumber(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(pe.padNumber(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}};hS=Vc;N.GeneralizedTime=hS;Vc.NAME="GeneralizedTime";var _S,Gc=class extends Wr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};_S=Gc;N.DATE=_S;Gc.NAME="DATE";var yS,Hc=class extends Wr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};yS=Hc;N.TimeOfDay=yS;Hc.NAME="TimeOfDay";var gS,Fc=class extends Wr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};gS=Fc;N.DateTime=gS;Fc.NAME="DateTime";var AS,Wc=class extends Wr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};AS=Wc;N.Duration=AS;Wc.NAME="Duration";var vS,$c=class extends Wr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};vS=$c;N.TIME=vS;$c.NAME="TIME";var xn=class{constructor({name:e=Pt,optional:t=!1}={}){this.name=e,this.optional=t}},Zd=class extends xn{constructor({value:e=[],...t}={}){super(t),this.value=e}},zc=class extends xn{constructor({value:e=new xn,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}},ey=class{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=te.BufferSourceConverter.toUint8Array(e)}constructor({data:e=ef}={}){this.dataView=te.BufferSourceConverter.toUint8Array(e)}fromBER(e,t,i){let n=t+i;return this.dataView=te.BufferSourceConverter.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}};function lo(r,e,t){if(t instanceof Zd){for(let s of t.value)if(lo(r,e,s).verified)return{verified:!0,result:r};{let s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(Z_)&&(s.name=t.name),s}}if(t instanceof xn)return t.hasOwnProperty(Z_)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(iO in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(aO in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(cO in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let i=t.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(nO)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(sO)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(oO)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(rO in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(Rb in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};let s=t.idBlock.valueHexView,o=e.idBlock.valueHexView;if(s.length!==o.length)return{verified:!1,result:r};for(let a=0;a<s.length;a++)if(s[a]!==o[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pt),t.name&&(r[t.name]=e)),t instanceof N.Constructed){let s=0,o={verified:!1,result:{error:"Unknown error"}},a=t.valueBlock.value.length;if(a>0&&t.valueBlock.value[0]instanceof zc&&(a=e.valueBlock.value.length),a===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let c=!0;for(let u=0;u<t.valueBlock.value.length;u++)c=c&&(t.valueBlock.value[u].optional||!1);return c?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pt),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let c=0;c<a;c++)if(c-s>=e.valueBlock.value.length){if(t.valueBlock.value[c].optional===!1){let u={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pt),t.name&&(delete r[t.name],u.name=t.name)),u}}else if(t.valueBlock.value[0]instanceof zc){if(o=lo(r,e.valueBlock.value[c],t.valueBlock.value[0].value),o.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pt),t.name&&delete r[t.name]),o;if(Z_ in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let u={};uO in t.valueBlock.value[0]&&t.valueBlock.value[0].local?u=e:u=r,typeof u[t.valueBlock.value[0].name]>"u"&&(u[t.valueBlock.value[0].name]=[]),u[t.valueBlock.value[0].name].push(e.valueBlock.value[c])}}else if(o=lo(r,e.valueBlock.value[c-s],t.valueBlock.value[c]),o.verified===!1)if(t.valueBlock.value[c].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pt),t.name&&delete r[t.name]),o;if(o.verified===!1){let c={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pt),t.name&&(delete r[t.name],c.name=t.name)),c}return{verified:!0,result:r}}if(t.primitiveSchema&&Rb in e.valueBlock){let s=yo(e.valueBlock.valueHexView);if(s.offset===-1){let o={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pt),t.name&&(delete r[t.name],o.name=t.name)),o}return lo(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function _O(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};let t=yo(te.BufferSourceConverter.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:lo(t.result,t.result,e)}Y.Any=xn;Y.BaseBlock=rt;Y.BaseStringBlock=gc;Y.BitString=wc;Y.BmpString=kc;Y.Boolean=bc;Y.CharacterString=Lc;Y.Choice=Zd;Y.Constructed=mi;Y.DATE=Gc;Y.DateTime=Fc;Y.Duration=Wc;Y.EndOfContent=vc;Y.Enumerated=Pc;Y.GeneralString=Kc;Y.GeneralizedTime=Vc;Y.GraphicString=Uc;Y.HexBlock=zr;Y.IA5String=Dc;Y.Integer=po;Y.Null=mc;Y.NumericString=Mc;Y.ObjectIdentifier=Tc;Y.OctetString=Sc;Y.Primitive=Ac;Y.PrintableString=Nc;Y.RawData=ey;Y.RelativeObjectIdentifier=Oc;Y.Repeated=zc;Y.Sequence=Ic;Y.Set=Bc;Y.TIME=$c;Y.TeletexString=qc;Y.TimeOfDay=Hc;Y.UTCTime=_o;Y.UniversalString=jc;Y.Utf8String=Wr;Y.ValueBlock=ut;Y.VideotexString=Rc;Y.ViewWriter=fo;Y.VisibleString=ho;Y.compareSchema=lo;Y.fromBER=dO;Y.verifySchema=_O});var On=l(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.AsnPropTypes=go.AsnTypeTypes=void 0;var mS;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(mS||(go.AsnTypeTypes=mS={}));var bS;(function(r){r[r.Any=1]="Any",r[r.Boolean=2]="Boolean",r[r.OctetString=3]="OctetString",r[r.BitString=4]="BitString",r[r.Integer=5]="Integer",r[r.Enumerated=6]="Enumerated",r[r.ObjectIdentifier=7]="ObjectIdentifier",r[r.Utf8String=8]="Utf8String",r[r.BmpString=9]="BmpString",r[r.UniversalString=10]="UniversalString",r[r.NumericString=11]="NumericString",r[r.PrintableString=12]="PrintableString",r[r.TeletexString=13]="TeletexString",r[r.VideotexString=14]="VideotexString",r[r.IA5String=15]="IA5String",r[r.GraphicString=16]="GraphicString",r[r.VisibleString=17]="VisibleString",r[r.GeneralString=18]="GeneralString",r[r.CharacterString=19]="CharacterString",r[r.UTCTime=20]="UTCTime",r[r.GeneralizedTime=21]="GeneralizedTime",r[r.DATE=22]="DATE",r[r.TimeOfDay=23]="TimeOfDay",r[r.DateTime=24]="DateTime",r[r.Duration=25]="Duration",r[r.TIME=26]="TIME",r[r.Null=27]="Null"})(bS||(go.AsnPropTypes=bS={}))});var wS=l(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.BitString=void 0;var iy=Fi(),SS=Ai(),ny=class{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(SS.BufferSourceConverter.isBufferSource(e))this.unusedBits=t,this.value=SS.BufferSourceConverter.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof iy.BitString))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new iy.BitString({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new iy.BitString({name:e})}toNumber(){let e="",t=new Uint8Array(this.value);for(let i of t)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 t=e.toString(2),i=t.length+7>>3;this.unusedBits=(i<<3)-t.length;let n=new Uint8Array(i);t=t.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(t.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}};tf.BitString=ny});var PS=l(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.OctetString=void 0;var sy=Fi(),CS=Ai(),oy=class{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):CS.BufferSourceConverter.isBufferSource(e)?this.buffer=CS.BufferSourceConverter.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof sy.OctetString))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new sy.OctetString({valueHex:this.buffer})}toSchema(e){return new sy.OctetString({name:e})}};rf.OctetString=oy});var ay=l(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});var ES=(b(),v(m));ES.__exportStar(wS(),nf);ES.__exportStar(PS(),nf)});var Yc=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=gO;var Se=Fi(),Ne=On(),yO=ay();j.AsnAnyConverter={fromASN:r=>r instanceof Se.Null?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Se.Null;let e=Se.fromBER(r);if(e.result.error)throw new Error(e.result.error);return e.result}};j.AsnIntegerConverter={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new Se.Integer({value:+r})};j.AsnEnumeratedConverter={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new Se.Enumerated({value:r})};j.AsnIntegerArrayBufferConverter={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Se.Integer({valueHex:r})};j.AsnIntegerBigIntConverter={fromASN:r=>r.toBigInt(),toASN:r=>Se.Integer.fromBigInt(r)};j.AsnBitStringConverter={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Se.BitString({valueHex:r})};j.AsnObjectIdentifierConverter={fromASN:r=>r.valueBlock.toString(),toASN:r=>new Se.ObjectIdentifier({value:r})};j.AsnBooleanConverter={fromASN:r=>r.valueBlock.value,toASN:r=>new Se.Boolean({value:r})};j.AsnOctetStringConverter={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Se.OctetString({valueHex:r})};j.AsnConstructedOctetStringConverter={fromASN:r=>new yO.OctetString(r.getValue()),toASN:r=>r.toASN()};function rr(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}j.AsnUtf8StringConverter=rr(Se.Utf8String);j.AsnBmpStringConverter=rr(Se.BmpString);j.AsnUniversalStringConverter=rr(Se.UniversalString);j.AsnNumericStringConverter=rr(Se.NumericString);j.AsnPrintableStringConverter=rr(Se.PrintableString);j.AsnTeletexStringConverter=rr(Se.TeletexString);j.AsnVideotexStringConverter=rr(Se.VideotexString);j.AsnIA5StringConverter=rr(Se.IA5String);j.AsnGraphicStringConverter=rr(Se.GraphicString);j.AsnVisibleStringConverter=rr(Se.VisibleString);j.AsnGeneralStringConverter=rr(Se.GeneralString);j.AsnCharacterStringConverter=rr(Se.CharacterString);j.AsnUTCTimeConverter={fromASN:r=>r.toDate(),toASN:r=>new Se.UTCTime({valueDate:r})};j.AsnGeneralizedTimeConverter={fromASN:r=>r.toDate(),toASN:r=>new Se.GeneralizedTime({valueDate:r})};j.AsnNullConverter={fromASN:()=>null,toASN:()=>new Se.Null};function gO(r){switch(r){case Ne.AsnPropTypes.Any:return j.AsnAnyConverter;case Ne.AsnPropTypes.BitString:return j.AsnBitStringConverter;case Ne.AsnPropTypes.BmpString:return j.AsnBmpStringConverter;case Ne.AsnPropTypes.Boolean:return j.AsnBooleanConverter;case Ne.AsnPropTypes.CharacterString:return j.AsnCharacterStringConverter;case Ne.AsnPropTypes.Enumerated:return j.AsnEnumeratedConverter;case Ne.AsnPropTypes.GeneralString:return j.AsnGeneralStringConverter;case Ne.AsnPropTypes.GeneralizedTime:return j.AsnGeneralizedTimeConverter;case Ne.AsnPropTypes.GraphicString:return j.AsnGraphicStringConverter;case Ne.AsnPropTypes.IA5String:return j.AsnIA5StringConverter;case Ne.AsnPropTypes.Integer:return j.AsnIntegerConverter;case Ne.AsnPropTypes.Null:return j.AsnNullConverter;case Ne.AsnPropTypes.NumericString:return j.AsnNumericStringConverter;case Ne.AsnPropTypes.ObjectIdentifier:return j.AsnObjectIdentifierConverter;case Ne.AsnPropTypes.OctetString:return j.AsnOctetStringConverter;case Ne.AsnPropTypes.PrintableString:return j.AsnPrintableStringConverter;case Ne.AsnPropTypes.TeletexString:return j.AsnTeletexStringConverter;case Ne.AsnPropTypes.UTCTime:return j.AsnUTCTimeConverter;case Ne.AsnPropTypes.UniversalString:return j.AsnUniversalStringConverter;case Ne.AsnPropTypes.Utf8String:return j.AsnUtf8StringConverter;case Ne.AsnPropTypes.VideotexString:return j.AsnVideotexStringConverter;case Ne.AsnPropTypes.VisibleString:return j.AsnVisibleStringConverter;default:return null}}});var sf=l(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.isConvertible=TS;Jc.isTypeOfArray=xS;Jc.isArrayEqual=AO;function TS(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:TS(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function xS(r){var e;if(r){let t=Object.getPrototypeOf(r);return((e=t?.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:xS(t)}return!1}function AO(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}});var IS=l(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.AsnSchemaStorage=void 0;var Lt=Fi(),Ao=On(),OS=sf(),cy=class{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){let i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){let t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){let t={type:Ao.AsnTypeTypes.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(t,i),t.items=Object.assign({},t.items,i.items)),t}create(e,t){let i=this.items.get(e)||this.createDefault(e),n=[];for(let s in i.items){let o=i.items[s],a=t?s:"",c;if(typeof o.type=="number"){let d=Ao.AsnPropTypes[o.type],f=Lt[d];if(!f)throw new Error(`Cannot get ASN1 class by name '${d}'`);c=new f({name:a})}else(0,OS.isConvertible)(o.type)?c=new o.type().toSchema(a):o.optional?this.get(o.type).type===Ao.AsnTypeTypes.Choice?c=new Lt.Any({name:a}):(c=this.create(o.type,!1),c.name=a):c=new Lt.Any({name:a});let u=!!o.optional||o.defaultValue!==void 0;if(o.repeated){c.name="";let d=o.repeated==="set"?Lt.Set:Lt.Sequence;c=new d({name:"",value:[new Lt.Repeated({name:a,value:c})]})}if(o.context!==null&&o.context!==void 0)if(o.implicit)if(typeof o.type=="number"||(0,OS.isConvertible)(o.type)){let d=o.repeated?Lt.Constructed:Lt.Primitive;n.push(new d({name:a,optional:u,idBlock:{tagClass:3,tagNumber:o.context}}))}else{this.cache(o.type);let d=!!o.repeated,f=d?c:this.get(o.type,!0).schema;f="valueBlock"in f?f.valueBlock.value:f.value,n.push(new Lt.Constructed({name:d?"":a,optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:f}))}else n.push(new Lt.Constructed({optional:u,idBlock:{tagClass:3,tagNumber:o.context},value:[c]}));else c.optional=u,n.push(c)}switch(i.type){case Ao.AsnTypeTypes.Sequence:return new Lt.Sequence({value:n,name:""});case Ao.AsnTypeTypes.Set:return new Lt.Set({value:n,name:""});case Ao.AsnTypeTypes.Choice:return new Lt.Choice({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){let t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}};of.AsnSchemaStorage=cy});var cf=l(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.schemaStorage=void 0;var vO=IS();af.schemaStorage=new vO.AsnSchemaStorage});var BS=l(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.AsnProp=St.AsnSequenceType=St.AsnSetType=St.AsnChoiceType=St.AsnType=void 0;var mO=Yc(),uy=On(),Wi=cf(),bO=r=>e=>{let t;Wi.schemaStorage.has(e)?t=Wi.schemaStorage.get(e):(t=Wi.schemaStorage.createDefault(e),Wi.schemaStorage.set(e,t)),Object.assign(t,r)};St.AsnType=bO;var SO=()=>(0,St.AsnType)({type:uy.AsnTypeTypes.Choice});St.AsnChoiceType=SO;var wO=r=>(0,St.AsnType)({type:uy.AsnTypeTypes.Set,...r});St.AsnSetType=wO;var CO=r=>(0,St.AsnType)({type:uy.AsnTypeTypes.Sequence,...r});St.AsnSequenceType=CO;var PO=r=>(e,t)=>{let i;Wi.schemaStorage.has(e.constructor)?i=Wi.schemaStorage.get(e.constructor):(i=Wi.schemaStorage.createDefault(e.constructor),Wi.schemaStorage.set(e.constructor,i));let n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){let s=mO.defaultConverter(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}n.raw=r.raw,i.items[t]=n};St.AsnProp=PO});var kS=l(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.AsnSchemaValidationError=void 0;var ly=class extends Error{constructor(){super(...arguments),this.schemas=[]}};uf.AsnSchemaValidationError=ly});var fy=l(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});var EO=(b(),v(m));EO.__exportStar(kS(),dy)});var _y=l(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.AsnParser=void 0;var Et=Fi(),$i=On(),py=Yc(),Qc=fy(),Xc=sf(),In=cf(),hy=class{static parse(e,t){let i=Et.fromBER(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){try{if((0,Xc.isConvertible)(t))return new t().fromASN(e);let i=In.schemaStorage.get(t);In.schemaStorage.cache(t);let n=i.schema,s=this.handleChoiceTypes(e,i,t,n);if(s?.result)return s.result;s?.targetSchema&&(n=s.targetSchema);let o=this.handleSequenceTypes(e,i,t,n),a=new t;return(0,Xc.isTypeOfArray)(t)?this.handleArrayTypes(e,i,t):(this.processSchemaItems(i,o,a),a)}catch(i){throw i instanceof Qc.AsnSchemaValidationError&&i.schemas.push(t.name),i}}static handleChoiceTypes(e,t,i,n){if(e.constructor===Et.Constructed&&t.type===$i.AsnTypeTypes.Choice&&e.idBlock.tagClass===3)for(let s in t.items){let o=t.items[s];if(o.context===e.idBlock.tagNumber&&o.implicit&&typeof o.type=="function"&&In.schemaStorage.has(o.type)){let a=In.schemaStorage.get(o.type);if(a&&a.type===$i.AsnTypeTypes.Sequence){let c=new Et.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),d=new i;return d[s]=u,{result:d}}}}}else if(e.constructor===Et.Constructed&&t.type!==$i.AsnTypeTypes.Choice){let s=new Et.Constructed({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(let o in t.items)delete e[o];return{targetSchema:s}}return null}static handleSequenceTypes(e,t,i,n){if(t.type===$i.AsnTypeTypes.Sequence){let s=Et.compareSchema({},e,n);if(!s.verified)throw new Qc.AsnSchemaValidationError(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{let s=Et.compareSchema({},e,n);if(!s.verified)throw new Qc.AsnSchemaValidationError(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,t,i){let n=e.slice(t);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=py.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,t){let i=py.defaultConverter(t.type);if(!i)throw new Error(`No converter for ASN.1 type ${t.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&In.schemaStorage.has(e.type)&&In.schemaStorage.get(e.type).type===$i.AsnTypeTypes.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(i){if(i instanceof Qc.AsnSchemaValidationError&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,t,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=t.itemType;if(typeof n=="number"){let s=py.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,t,i){for(let n in e.items){let s=t.result[n];if(!s)continue;let o=e.items[n],a=o.type,c;typeof a=="number"||(0,Xc.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,t,i){var n;let s=(n=t.converter)!==null&&n!==void 0?n:(0,Xc.isConvertible)(i)?new i:null;if(!s)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,s):this.processSinglePrimitiveItem(e,t,i,s)}static processRepeatedPrimitiveItem(e,t,i){if(t.implicit){let n=t.repeated==="sequence"?Et.Sequence:Et.Set,s=new n;s.valueBlock=e.valueBlock;let o=Et.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,t,i,n){let s=e;if(t.implicit){let o;if((0,Xc.isConvertible)(i))o=new i().toSchema("");else{let a=$i.AsnPropTypes[i],c=Et[a];if(!c)throw new Error(`Cannot get '${a}' class from asn1js module`);o=new c}o.valueBlock=s.valueBlock,s=Et.fromBER(o.toBER(!1)).result}return n.fromASN(s)}static processComplexSchemaItem(e,t,i){if(t.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,t,i);if(this.isOptionalChoiceField(t))try{return this.fromASN(n,i)}catch(s){if(s instanceof Qc.AsnSchemaValidationError&&/Wrong values for Choice type/.test(s.message))return;throw s}else{let s=this.fromASN(n,i);return t.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,t,i){if(t.implicit&&typeof t.context=="number"){let n=In.schemaStorage.get(i);if(n.type===$i.AsnTypeTypes.Sequence){let s=new Et.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===$i.AsnTypeTypes.Set){let s=new Et.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}};lf.AsnParser=hy});var Ay=l(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.AsnSerializer=void 0;var mr=Fi(),TO=Yc(),df=On(),yy=sf(),jS=cf(),gy=class r{static serialize(e){return e instanceof mr.BaseBlock?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&(0,yy.isConvertible)(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");let t=e.constructor,i=jS.schemaStorage.get(t);jS.schemaStorage.cache(t);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=TO.defaultConverter(i.itemType);if(!o)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(a=>o.toASN(a))}else n=e.map(o=>this.toAsnItem({type:i.itemType},"[]",t,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,yy.isArrayEqual)(this.serialize(a.defaultValue),this.serialize(c)))continue;let u=r.toAsnItem(a,o,t,c);if(typeof a.context=="number")if(a.implicit)if(!a.repeated&&(typeof a.type=="number"||(0,yy.isConvertible)(a.type))){let d={};d.valueHex=u instanceof mr.Null?u.valueBeforeDecodeView:u.valueBlock.toBER(),n.push(new mr.Primitive({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},...d}))}else n.push(new mr.Constructed({optional:a.optional,idBlock:{tagClass:3,tagNumber:a.context},value:u.valueBlock.value}));else n.push(new mr.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 df.AsnTypeTypes.Sequence:s=new mr.Sequence({value:n});break;case df.AsnTypeTypes.Set:s=new mr.Set({value:n});break;case df.AsnTypeTypes.Choice:if(!n[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(e,t,i,n){let s;if(typeof e.type=="number"){let o=e.converter;if(!o)throw new Error(`Property '${t}' doesn't have converter for type ${df.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"?mr.Sequence:mr.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"?mr.Sequence:mr.Set;s=new a({value:o})}else s=this.toASN(n);return s}};ff.AsnSerializer=gy});var MS=l(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.AsnArray=void 0;var vy=class extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(let t of e)this.push(t)}}};pf.AsnArray=vy});var qS=l(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.AsnConvert=void 0;var xO=Fi(),NS=Ai(),OO=_y(),IO=Ay(),my=class r{static serialize(e){return IO.AsnSerializer.serialize(e)}static parse(e,t){return OO.AsnParser.parse(e,t)}static toString(e){let t=NS.BufferSourceConverter.isBufferSource(e)?NS.BufferSourceConverter.toArrayBuffer(e):r.serialize(e),i=xO.fromBER(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}};hf.AsnConvert=my});var S=l(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.AsnSerializer=Pe.AsnParser=Pe.AsnPropTypes=Pe.AsnTypeTypes=Pe.AsnSetType=Pe.AsnSequenceType=Pe.AsnChoiceType=Pe.AsnType=Pe.AsnProp=void 0;var Zc=(b(),v(m));Zc.__exportStar(Yc(),Pe);Zc.__exportStar(ay(),Pe);var eu=BS();Object.defineProperty(Pe,"AsnProp",{enumerable:!0,get:function(){return eu.AsnProp}});Object.defineProperty(Pe,"AsnType",{enumerable:!0,get:function(){return eu.AsnType}});Object.defineProperty(Pe,"AsnChoiceType",{enumerable:!0,get:function(){return eu.AsnChoiceType}});Object.defineProperty(Pe,"AsnSequenceType",{enumerable:!0,get:function(){return eu.AsnSequenceType}});Object.defineProperty(Pe,"AsnSetType",{enumerable:!0,get:function(){return eu.AsnSetType}});var RS=On();Object.defineProperty(Pe,"AsnTypeTypes",{enumerable:!0,get:function(){return RS.AsnTypeTypes}});Object.defineProperty(Pe,"AsnPropTypes",{enumerable:!0,get:function(){return RS.AsnPropTypes}});var BO=_y();Object.defineProperty(Pe,"AsnParser",{enumerable:!0,get:function(){return BO.AsnParser}});var kO=Ay();Object.defineProperty(Pe,"AsnSerializer",{enumerable:!0,get:function(){return kO.AsnSerializer}});Zc.__exportStar(fy(),Pe);Zc.__exportStar(MS(),Pe);Zc.__exportStar(qS(),Pe)});var DS=l(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.IpConverter=void 0;var jO=Ai(),by=class{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){let t=e.split(".");if(t.length!==4)throw new Error("Invalid IPv4 address");return t.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 t=e.split("::");if(t.length>2)throw new Error("Invalid IPv6 address");let i=t[0]?t[0].split(":"):[],n=t[1]?t[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 t=[];for(let i=0;i<16;i+=2)t.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){let t=e.split(":"),i=-1,n=0,s=-1,o=0;for(let a=0;a<t.length;a++)t[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=t.slice(0,i).join(":"),c=t.slice(i+n).join(":");return`${a}::${c}`}return e}static parseCIDR(e){let[t,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(t)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),n]}else{if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),n]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;let t=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}/${t}`}static toString(e){let t=new Uint8Array(e);if(t.length===4)return Array.from(t).join(".");if(t.length===16)return this.formatIPv6(t);if(t.length===8||t.length===32){let i=t.length/2,n=t.slice(0,i),s=t.slice(i);if(t.every(c=>c===0))return t.length===8?"0.0.0.0/0":"::/0";let a=s.reduce((c,u)=>c+(u.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(n).join(".")}/${a}`:`${this.formatIPv6(n)}/${a}`}return this.decodeIP(jO.Convert.ToHex(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 t=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(t).buffer}};_f.IpConverter=by});var mo=l(Qe=>{"use strict";var Sy,wy,Cy;Object.defineProperty(Qe,"__esModule",{value:!0});Qe.Name=Qe.RDNSequence=Qe.RelativeDistinguishedName=Qe.AttributeTypeAndValue=Qe.AttributeValue=Qe.DirectoryString=void 0;var Tt=(b(),v(m)),he=S(),MO=Ai(),Si=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};Qe.DirectoryString=Si;Tt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.TeletexString})],Si.prototype,"teletexString",void 0);Tt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.PrintableString})],Si.prototype,"printableString",void 0);Tt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.UniversalString})],Si.prototype,"universalString",void 0);Tt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Utf8String})],Si.prototype,"utf8String",void 0);Tt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.BmpString})],Si.prototype,"bmpString",void 0);Qe.DirectoryString=Si=Tt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Choice})],Si);var Bn=class extends Si{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?MO.Convert.ToHex(this.anyValue):super.toString())}};Qe.AttributeValue=Bn;Tt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.IA5String})],Bn.prototype,"ia5String",void 0);Tt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.Any})],Bn.prototype,"anyValue",void 0);Qe.AttributeValue=Bn=Tt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Choice})],Bn);var vo=class{constructor(e={}){this.type="",this.value=new Bn,Object.assign(this,e)}};Qe.AttributeTypeAndValue=vo;Tt.__decorate([(0,he.AsnProp)({type:he.AsnPropTypes.ObjectIdentifier})],vo.prototype,"type",void 0);Tt.__decorate([(0,he.AsnProp)({type:Bn})],vo.prototype,"value",void 0);var yf=Sy=class extends he.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Sy.prototype)}};Qe.RelativeDistinguishedName=yf;Qe.RelativeDistinguishedName=yf=Sy=Tt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Set,itemType:vo})],yf);var gf=wy=class extends he.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,wy.prototype)}};Qe.RDNSequence=gf;Qe.RDNSequence=gf=wy=Tt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Sequence,itemType:yf})],gf);var Py=Cy=class extends gf{constructor(e){super(e),Object.setPrototypeOf(this,Cy.prototype)}};Qe.Name=Py;Qe.Name=Py=Cy=Tt.__decorate([(0,he.AsnType)({type:he.AsnTypeTypes.Sequence})],Py)});var kn=l(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.GeneralName=ir.EDIPartyName=ir.OtherName=ir.AsnIpConverter=void 0;var xt=(b(),v(m)),Ee=S(),US=DS(),Af=mo();ir.AsnIpConverter={fromASN:r=>US.IpConverter.toString(Ee.AsnOctetStringConverter.fromASN(r)),toASN:r=>Ee.AsnOctetStringConverter.toASN(US.IpConverter.fromString(r))};var bo=class{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}};ir.OtherName=bo;xt.__decorate([(0,Ee.AsnProp)({type:Ee.AsnPropTypes.ObjectIdentifier})],bo.prototype,"typeId",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Ee.AsnPropTypes.Any,context:0})],bo.prototype,"value",void 0);var So=class{constructor(e={}){this.partyName=new Af.DirectoryString,Object.assign(this,e)}};ir.EDIPartyName=So;xt.__decorate([(0,Ee.AsnProp)({type:Af.DirectoryString,optional:!0,context:0,implicit:!0})],So.prototype,"nameAssigner",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Af.DirectoryString,context:1,implicit:!0})],So.prototype,"partyName",void 0);var nr=class{constructor(e={}){Object.assign(this,e)}};ir.GeneralName=nr;xt.__decorate([(0,Ee.AsnProp)({type:bo,context:0,implicit:!0})],nr.prototype,"otherName",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Ee.AsnPropTypes.IA5String,context:1,implicit:!0})],nr.prototype,"rfc822Name",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Ee.AsnPropTypes.IA5String,context:2,implicit:!0})],nr.prototype,"dNSName",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Ee.AsnPropTypes.Any,context:3,implicit:!0})],nr.prototype,"x400Address",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Af.Name,context:4,implicit:!1})],nr.prototype,"directoryName",void 0);xt.__decorate([(0,Ee.AsnProp)({type:So,context:5})],nr.prototype,"ediPartyName",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Ee.AsnPropTypes.IA5String,context:6,implicit:!0})],nr.prototype,"uniformResourceIdentifier",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Ee.AsnPropTypes.OctetString,context:7,implicit:!0,converter:ir.AsnIpConverter})],nr.prototype,"iPAddress",void 0);xt.__decorate([(0,Ee.AsnProp)({type:Ee.AsnPropTypes.ObjectIdentifier,context:8,implicit:!0})],nr.prototype,"registeredID",void 0);ir.GeneralName=nr=xt.__decorate([(0,Ee.AsnType)({type:Ee.AsnTypeTypes.Choice})],nr)});var we=l(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.id_ce=ie.id_ad_caRepository=ie.id_ad_timeStamping=ie.id_ad_caIssuers=ie.id_ad_ocsp=ie.id_qt_unotice=ie.id_qt_csp=ie.id_ad=ie.id_kp=ie.id_qt=ie.id_pe=ie.id_pkix=void 0;ie.id_pkix="1.3.6.1.5.5.7";ie.id_pe=`${ie.id_pkix}.1`;ie.id_qt=`${ie.id_pkix}.2`;ie.id_kp=`${ie.id_pkix}.3`;ie.id_ad=`${ie.id_pkix}.48`;ie.id_qt_csp=`${ie.id_qt}.1`;ie.id_qt_unotice=`${ie.id_qt}.2`;ie.id_ad_ocsp=`${ie.id_ad}.1`;ie.id_ad_caIssuers=`${ie.id_ad}.2`;ie.id_ad_timeStamping=`${ie.id_ad}.3`;ie.id_ad_caRepository=`${ie.id_ad}.5`;ie.id_ce="2.5.29"});var Oy=l(wi=>{"use strict";var Ey;Object.defineProperty(wi,"__esModule",{value:!0});wi.AuthorityInfoAccessSyntax=wi.AccessDescription=wi.id_pe_authorityInfoAccess=void 0;var xy=(b(),v(m)),wo=S(),KS=kn(),NO=we();wi.id_pe_authorityInfoAccess=`${NO.id_pe}.1`;var Co=class{constructor(e={}){this.accessMethod="",this.accessLocation=new KS.GeneralName,Object.assign(this,e)}};wi.AccessDescription=Co;xy.__decorate([(0,wo.AsnProp)({type:wo.AsnPropTypes.ObjectIdentifier})],Co.prototype,"accessMethod",void 0);xy.__decorate([(0,wo.AsnProp)({type:KS.GeneralName})],Co.prototype,"accessLocation",void 0);var Ty=Ey=class extends wo.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Ey.prototype)}};wi.AuthorityInfoAccessSyntax=Ty;wi.AuthorityInfoAccessSyntax=Ty=Ey=xy.__decorate([(0,wo.AsnType)({type:wo.AsnTypeTypes.Sequence,itemType:Co})],Ty)});var By=l(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.AuthorityKeyIdentifier=zi.KeyIdentifier=zi.id_ce_authorityKeyIdentifier=void 0;var Iy=(b(),v(m)),Po=S(),qO=kn(),RO=we();zi.id_ce_authorityKeyIdentifier=`${RO.id_ce}.35`;var vf=class extends Po.OctetString{};zi.KeyIdentifier=vf;var Eo=class{constructor(e={}){e&&Object.assign(this,e)}};zi.AuthorityKeyIdentifier=Eo;Iy.__decorate([(0,Po.AsnProp)({type:vf,context:0,optional:!0,implicit:!0})],Eo.prototype,"keyIdentifier",void 0);Iy.__decorate([(0,Po.AsnProp)({type:qO.GeneralName,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Eo.prototype,"authorityCertIssuer",void 0);Iy.__decorate([(0,Po.AsnProp)({type:Po.AsnPropTypes.Integer,context:2,optional:!0,implicit:!0,converter:Po.AsnIntegerArrayBufferConverter})],Eo.prototype,"authorityCertSerialNumber",void 0)});var VS=l(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.BasicConstraints=To.id_ce_basicConstraints=void 0;var LS=(b(),v(m)),mf=S(),DO=we();To.id_ce_basicConstraints=`${DO.id_ce}.19`;var tu=class{constructor(e={}){this.cA=!1,Object.assign(this,e)}};To.BasicConstraints=tu;LS.__decorate([(0,mf.AsnProp)({type:mf.AsnPropTypes.Boolean,defaultValue:!1})],tu.prototype,"cA",void 0);LS.__decorate([(0,mf.AsnProp)({type:mf.AsnPropTypes.Integer,optional:!0})],tu.prototype,"pathLenConstraint",void 0)});var iu=l(ru=>{"use strict";var ky;Object.defineProperty(ru,"__esModule",{value:!0});ru.GeneralNames=void 0;var UO=(b(),v(m)),GS=S(),KO=kn(),LO=S(),jy=ky=class extends LO.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,ky.prototype)}};ru.GeneralNames=jy;ru.GeneralNames=jy=ky=UO.__decorate([(0,GS.AsnType)({type:GS.AsnTypeTypes.Sequence,itemType:KO.GeneralName})],jy)});var FS=l(jn=>{"use strict";var My;Object.defineProperty(jn,"__esModule",{value:!0});jn.CertificateIssuer=jn.id_ce_certificateIssuer=void 0;var VO=(b(),v(m)),HS=S(),GO=iu(),HO=we();jn.id_ce_certificateIssuer=`${HO.id_ce}.29`;var Ny=My=class extends GO.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,My.prototype)}};jn.CertificateIssuer=Ny;jn.CertificateIssuer=Ny=My=VO.__decorate([(0,HS.AsnType)({type:HS.AsnTypeTypes.Sequence})],Ny)});var WS=l(Ie=>{"use strict";var qy;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.CertificatePolicies=Ie.PolicyInformation=Ie.PolicyQualifierInfo=Ie.Qualifier=Ie.UserNotice=Ie.NoticeReference=Ie.DisplayText=Ie.id_ce_certificatePolicies_anyPolicy=Ie.id_ce_certificatePolicies=void 0;var lt=(b(),v(m)),le=S(),FO=we();Ie.id_ce_certificatePolicies=`${FO.id_ce}.32`;Ie.id_ce_certificatePolicies_anyPolicy=`${Ie.id_ce_certificatePolicies}.0`;var Yr=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};Ie.DisplayText=Yr;lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.IA5String})],Yr.prototype,"ia5String",void 0);lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.VisibleString})],Yr.prototype,"visibleString",void 0);lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.BmpString})],Yr.prototype,"bmpString",void 0);lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Utf8String})],Yr.prototype,"utf8String",void 0);Ie.DisplayText=Yr=lt.__decorate([(0,le.AsnType)({type:le.AsnTypeTypes.Choice})],Yr);var xo=class{constructor(e={}){this.organization=new Yr,this.noticeNumbers=[],Object.assign(this,e)}};Ie.NoticeReference=xo;lt.__decorate([(0,le.AsnProp)({type:Yr})],xo.prototype,"organization",void 0);lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Integer,repeated:"sequence"})],xo.prototype,"noticeNumbers",void 0);var Oo=class{constructor(e={}){Object.assign(this,e)}};Ie.UserNotice=Oo;lt.__decorate([(0,le.AsnProp)({type:xo,optional:!0})],Oo.prototype,"noticeRef",void 0);lt.__decorate([(0,le.AsnProp)({type:Yr,optional:!0})],Oo.prototype,"explicitText",void 0);var nu=class{constructor(e={}){Object.assign(this,e)}};Ie.Qualifier=nu;lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.IA5String})],nu.prototype,"cPSuri",void 0);lt.__decorate([(0,le.AsnProp)({type:Oo})],nu.prototype,"userNotice",void 0);Ie.Qualifier=nu=lt.__decorate([(0,le.AsnType)({type:le.AsnTypeTypes.Choice})],nu);var Io=class{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}};Ie.PolicyQualifierInfo=Io;lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.ObjectIdentifier})],Io.prototype,"policyQualifierId",void 0);lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.Any})],Io.prototype,"qualifier",void 0);var Bo=class{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}};Ie.PolicyInformation=Bo;lt.__decorate([(0,le.AsnProp)({type:le.AsnPropTypes.ObjectIdentifier})],Bo.prototype,"policyIdentifier",void 0);lt.__decorate([(0,le.AsnProp)({type:Io,repeated:"sequence",optional:!0})],Bo.prototype,"policyQualifiers",void 0);var Ry=qy=class extends le.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,qy.prototype)}};Ie.CertificatePolicies=Ry;Ie.CertificatePolicies=Ry=qy=lt.__decorate([(0,le.AsnType)({type:le.AsnTypeTypes.Sequence,itemType:Bo})],Ry)});var Dy=l(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.CRLNumber=Mn.id_ce_cRLNumber=void 0;var $S=(b(),v(m)),bf=S(),WO=we();Mn.id_ce_cRLNumber=`${WO.id_ce}.20`;var Sf=class{constructor(e=0){this.value=e}};Mn.CRLNumber=Sf;$S.__decorate([(0,bf.AsnProp)({type:bf.AsnPropTypes.Integer})],Sf.prototype,"value",void 0);Mn.CRLNumber=Sf=$S.__decorate([(0,bf.AsnType)({type:bf.AsnTypeTypes.Choice})],Sf)});var YS=l(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.BaseCRLNumber=Nn.id_ce_deltaCRLIndicator=void 0;var $O=(b(),v(m)),zS=S(),zO=we(),YO=Dy();Nn.id_ce_deltaCRLIndicator=`${zO.id_ce}.27`;var Uy=class extends YO.CRLNumber{};Nn.BaseCRLNumber=Uy;Nn.BaseCRLNumber=Uy=$O.__decorate([(0,zS.AsnType)({type:zS.AsnTypeTypes.Choice})],Uy)});var Cf=l(_t=>{"use strict";var Ky;Object.defineProperty(_t,"__esModule",{value:!0});_t.CRLDistributionPoints=_t.DistributionPoint=_t.DistributionPointName=_t.Reason=_t.ReasonFlags=_t.id_ce_cRLDistributionPoints=void 0;var Rn=(b(),v(m)),Sr=S(),JO=mo(),JS=kn(),QO=we();_t.id_ce_cRLDistributionPoints=`${QO.id_ce}.31`;var br;(function(r){r[r.unused=1]="unused",r[r.keyCompromise=2]="keyCompromise",r[r.cACompromise=4]="cACompromise",r[r.affiliationChanged=8]="affiliationChanged",r[r.superseded=16]="superseded",r[r.cessationOfOperation=32]="cessationOfOperation",r[r.certificateHold=64]="certificateHold",r[r.privilegeWithdrawn=128]="privilegeWithdrawn",r[r.aACompromise=256]="aACompromise"})(br||(_t.ReasonFlags=br={}));var wf=class extends Sr.BitString{toJSON(){let e=[],t=this.toNumber();return t&br.aACompromise&&e.push("aACompromise"),t&br.affiliationChanged&&e.push("affiliationChanged"),t&br.cACompromise&&e.push("cACompromise"),t&br.certificateHold&&e.push("certificateHold"),t&br.cessationOfOperation&&e.push("cessationOfOperation"),t&br.keyCompromise&&e.push("keyCompromise"),t&br.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&br.superseded&&e.push("superseded"),t&br.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}};_t.Reason=wf;var ko=class{constructor(e={}){Object.assign(this,e)}};_t.DistributionPointName=ko;Rn.__decorate([(0,Sr.AsnProp)({type:JS.GeneralName,context:0,repeated:"sequence",implicit:!0})],ko.prototype,"fullName",void 0);Rn.__decorate([(0,Sr.AsnProp)({type:JO.RelativeDistinguishedName,context:1,implicit:!0})],ko.prototype,"nameRelativeToCRLIssuer",void 0);_t.DistributionPointName=ko=Rn.__decorate([(0,Sr.AsnType)({type:Sr.AsnTypeTypes.Choice})],ko);var qn=class{constructor(e={}){Object.assign(this,e)}};_t.DistributionPoint=qn;Rn.__decorate([(0,Sr.AsnProp)({type:ko,context:0,optional:!0})],qn.prototype,"distributionPoint",void 0);Rn.__decorate([(0,Sr.AsnProp)({type:wf,context:1,optional:!0,implicit:!0})],qn.prototype,"reasons",void 0);Rn.__decorate([(0,Sr.AsnProp)({type:JS.GeneralName,context:2,optional:!0,repeated:"sequence",implicit:!0})],qn.prototype,"cRLIssuer",void 0);var Ly=Ky=class extends Sr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Ky.prototype)}};_t.CRLDistributionPoints=Ly;_t.CRLDistributionPoints=Ly=Ky=Rn.__decorate([(0,Sr.AsnType)({type:Sr.AsnTypeTypes.Sequence,itemType:qn})],Ly)});var ZS=l(Dn=>{"use strict";var Vy;Object.defineProperty(Dn,"__esModule",{value:!0});Dn.FreshestCRL=Dn.id_ce_freshestCRL=void 0;var XO=(b(),v(m)),QS=S(),ZO=we(),XS=Cf();Dn.id_ce_freshestCRL=`${ZO.id_ce}.46`;var Gy=Vy=class extends XS.CRLDistributionPoints{constructor(e){super(e),Object.setPrototypeOf(this,Vy.prototype)}};Dn.FreshestCRL=Gy;Dn.FreshestCRL=Gy=Vy=XO.__decorate([(0,QS.AsnType)({type:QS.AsnTypeTypes.Sequence,itemType:XS.DistributionPoint})],Gy)});var tw=l(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.IssuingDistributionPoint=jo.id_ce_issuingDistributionPoint=void 0;var Mo=(b(),v(m)),No=S(),ew=Cf(),eI=we(),Pf=S();jo.id_ce_issuingDistributionPoint=`${eI.id_ce}.28`;var Ot=class r{constructor(e={}){this.onlyContainsUserCerts=r.ONLY,this.onlyContainsCACerts=r.ONLY,this.indirectCRL=r.ONLY,this.onlyContainsAttributeCerts=r.ONLY,Object.assign(this,e)}};jo.IssuingDistributionPoint=Ot;Ot.ONLY=!1;Mo.__decorate([(0,No.AsnProp)({type:ew.DistributionPointName,context:0,optional:!0})],Ot.prototype,"distributionPoint",void 0);Mo.__decorate([(0,No.AsnProp)({type:Pf.AsnPropTypes.Boolean,context:1,defaultValue:Ot.ONLY,implicit:!0})],Ot.prototype,"onlyContainsUserCerts",void 0);Mo.__decorate([(0,No.AsnProp)({type:Pf.AsnPropTypes.Boolean,context:2,defaultValue:Ot.ONLY,implicit:!0})],Ot.prototype,"onlyContainsCACerts",void 0);Mo.__decorate([(0,No.AsnProp)({type:ew.Reason,context:3,optional:!0,implicit:!0})],Ot.prototype,"onlySomeReasons",void 0);Mo.__decorate([(0,No.AsnProp)({type:Pf.AsnPropTypes.Boolean,context:4,defaultValue:Ot.ONLY,implicit:!0})],Ot.prototype,"indirectCRL",void 0);Mo.__decorate([(0,No.AsnProp)({type:Pf.AsnPropTypes.Boolean,context:5,defaultValue:Ot.ONLY,implicit:!0})],Ot.prototype,"onlyContainsAttributeCerts",void 0)});var iw=l(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.CRLReason=Ci.CRLReasons=Ci.id_ce_cRLReasons=void 0;var rw=(b(),v(m)),Ef=S(),tI=we();Ci.id_ce_cRLReasons=`${tI.id_ce}.21`;var su;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(su||(Ci.CRLReasons=su={}));var Tf=class{constructor(e=su.unspecified){this.reason=su.unspecified,this.reason=e}toJSON(){return su[this.reason]}toString(){return this.toJSON()}};Ci.CRLReason=Tf;rw.__decorate([(0,Ef.AsnProp)({type:Ef.AsnPropTypes.Enumerated})],Tf.prototype,"reason",void 0);Ci.CRLReason=Tf=rw.__decorate([(0,Ef.AsnType)({type:Ef.AsnTypeTypes.Choice})],Tf)});var nw=l(qe=>{"use strict";var Hy;Object.defineProperty(qe,"__esModule",{value:!0});qe.id_kp_OCSPSigning=qe.id_kp_timeStamping=qe.id_kp_emailProtection=qe.id_kp_codeSigning=qe.id_kp_clientAuth=qe.id_kp_serverAuth=qe.anyExtendedKeyUsage=qe.ExtendedKeyUsage=qe.id_ce_extKeyUsage=void 0;var rI=(b(),v(m)),xf=S(),Un=we();qe.id_ce_extKeyUsage=`${Un.id_ce}.37`;var Fy=Hy=class extends xf.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Hy.prototype)}};qe.ExtendedKeyUsage=Fy;qe.ExtendedKeyUsage=Fy=Hy=rI.__decorate([(0,xf.AsnType)({type:xf.AsnTypeTypes.Sequence,itemType:xf.AsnPropTypes.ObjectIdentifier})],Fy);qe.anyExtendedKeyUsage=`${qe.id_ce_extKeyUsage}.0`;qe.id_kp_serverAuth=`${Un.id_kp}.1`;qe.id_kp_clientAuth=`${Un.id_kp}.2`;qe.id_kp_codeSigning=`${Un.id_kp}.3`;qe.id_kp_emailProtection=`${Un.id_kp}.4`;qe.id_kp_timeStamping=`${Un.id_kp}.8`;qe.id_kp_OCSPSigning=`${Un.id_kp}.9`});var ow=l(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.InhibitAnyPolicy=Kn.id_ce_inhibitAnyPolicy=void 0;var sw=(b(),v(m)),ou=S(),iI=we();Kn.id_ce_inhibitAnyPolicy=`${iI.id_ce}.54`;var Of=class{constructor(e=new ArrayBuffer(0)){this.value=e}};Kn.InhibitAnyPolicy=Of;sw.__decorate([(0,ou.AsnProp)({type:ou.AsnPropTypes.Integer,converter:ou.AsnIntegerArrayBufferConverter})],Of.prototype,"value",void 0);Kn.InhibitAnyPolicy=Of=sw.__decorate([(0,ou.AsnType)({type:ou.AsnTypeTypes.Choice})],Of)});var cw=l(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.InvalidityDate=Ln.id_ce_invalidityDate=void 0;var aw=(b(),v(m)),If=S(),nI=we();Ln.id_ce_invalidityDate=`${nI.id_ce}.24`;var Bf=class{constructor(e){this.value=new Date,e&&(this.value=e)}};Ln.InvalidityDate=Bf;aw.__decorate([(0,If.AsnProp)({type:If.AsnPropTypes.GeneralizedTime})],Bf.prototype,"value",void 0);Ln.InvalidityDate=Bf=aw.__decorate([(0,If.AsnType)({type:If.AsnTypeTypes.Choice})],Bf)});var lw=l(Vn=>{"use strict";var Wy;Object.defineProperty(Vn,"__esModule",{value:!0});Vn.IssueAlternativeName=Vn.id_ce_issuerAltName=void 0;var sI=(b(),v(m)),uw=S(),oI=iu(),aI=we();Vn.id_ce_issuerAltName=`${aI.id_ce}.18`;var $y=Wy=class extends oI.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,Wy.prototype)}};Vn.IssueAlternativeName=$y;Vn.IssueAlternativeName=$y=Wy=sI.__decorate([(0,uw.AsnType)({type:uw.AsnTypeTypes.Sequence})],$y)});var dw=l(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.KeyUsage=Yi.KeyUsageFlags=Yi.id_ce_keyUsage=void 0;var cI=S(),uI=we();Yi.id_ce_keyUsage=`${uI.id_ce}.15`;var wr;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(wr||(Yi.KeyUsageFlags=wr={}));var zy=class extends cI.BitString{toJSON(){let e=this.toNumber(),t=[];return e&wr.cRLSign&&t.push("crlSign"),e&wr.dataEncipherment&&t.push("dataEncipherment"),e&wr.decipherOnly&&t.push("decipherOnly"),e&wr.digitalSignature&&t.push("digitalSignature"),e&wr.encipherOnly&&t.push("encipherOnly"),e&wr.keyAgreement&&t.push("keyAgreement"),e&wr.keyCertSign&&t.push("keyCertSign"),e&wr.keyEncipherment&&t.push("keyEncipherment"),e&wr.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}};Yi.KeyUsage=zy});var pw=l(Cr=>{"use strict";var Yy;Object.defineProperty(Cr,"__esModule",{value:!0});Cr.NameConstraints=Cr.GeneralSubtrees=Cr.GeneralSubtree=Cr.id_ce_nameConstraints=void 0;var qo=(b(),v(m)),Jr=S(),fw=kn(),lI=we();Cr.id_ce_nameConstraints=`${lI.id_ce}.30`;var Gn=class{constructor(e={}){this.base=new fw.GeneralName,this.minimum=0,Object.assign(this,e)}};Cr.GeneralSubtree=Gn;qo.__decorate([(0,Jr.AsnProp)({type:fw.GeneralName})],Gn.prototype,"base",void 0);qo.__decorate([(0,Jr.AsnProp)({type:Jr.AsnPropTypes.Integer,context:0,defaultValue:0,implicit:!0})],Gn.prototype,"minimum",void 0);qo.__decorate([(0,Jr.AsnProp)({type:Jr.AsnPropTypes.Integer,context:1,optional:!0,implicit:!0})],Gn.prototype,"maximum",void 0);var au=Yy=class extends Jr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Yy.prototype)}};Cr.GeneralSubtrees=au;Cr.GeneralSubtrees=au=Yy=qo.__decorate([(0,Jr.AsnType)({type:Jr.AsnTypeTypes.Sequence,itemType:Gn})],au);var cu=class{constructor(e={}){Object.assign(this,e)}};Cr.NameConstraints=cu;qo.__decorate([(0,Jr.AsnProp)({type:au,context:0,optional:!0,implicit:!0})],cu.prototype,"permittedSubtrees",void 0);qo.__decorate([(0,Jr.AsnProp)({type:au,context:1,optional:!0,implicit:!0})],cu.prototype,"excludedSubtrees",void 0)});var _w=l(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.PolicyConstraints=Do.id_ce_policyConstraints=void 0;var hw=(b(),v(m)),Ro=S(),dI=we();Do.id_ce_policyConstraints=`${dI.id_ce}.36`;var uu=class{constructor(e={}){Object.assign(this,e)}};Do.PolicyConstraints=uu;hw.__decorate([(0,Ro.AsnProp)({type:Ro.AsnPropTypes.Integer,context:0,implicit:!0,optional:!0,converter:Ro.AsnIntegerArrayBufferConverter})],uu.prototype,"requireExplicitPolicy",void 0);hw.__decorate([(0,Ro.AsnProp)({type:Ro.AsnPropTypes.Integer,context:1,implicit:!0,optional:!0,converter:Ro.AsnIntegerArrayBufferConverter})],uu.prototype,"inhibitPolicyMapping",void 0)});var yw=l(Pi=>{"use strict";var Jy;Object.defineProperty(Pi,"__esModule",{value:!0});Pi.PolicyMappings=Pi.PolicyMapping=Pi.id_ce_policyMappings=void 0;var Xy=(b(),v(m)),Hn=S(),fI=we();Pi.id_ce_policyMappings=`${fI.id_ce}.33`;var Uo=class{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}};Pi.PolicyMapping=Uo;Xy.__decorate([(0,Hn.AsnProp)({type:Hn.AsnPropTypes.ObjectIdentifier})],Uo.prototype,"issuerDomainPolicy",void 0);Xy.__decorate([(0,Hn.AsnProp)({type:Hn.AsnPropTypes.ObjectIdentifier})],Uo.prototype,"subjectDomainPolicy",void 0);var Qy=Jy=class extends Hn.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Jy.prototype)}};Pi.PolicyMappings=Qy;Pi.PolicyMappings=Qy=Jy=Xy.__decorate([(0,Hn.AsnType)({type:Hn.AsnTypeTypes.Sequence,itemType:Uo})],Qy)});var Aw=l(Fn=>{"use strict";var Zy;Object.defineProperty(Fn,"__esModule",{value:!0});Fn.SubjectAlternativeName=Fn.id_ce_subjectAltName=void 0;var pI=(b(),v(m)),gw=S(),hI=iu(),_I=we();Fn.id_ce_subjectAltName=`${_I.id_ce}.17`;var eg=Zy=class extends hI.GeneralNames{constructor(e){super(e),Object.setPrototypeOf(this,Zy.prototype)}};Fn.SubjectAlternativeName=eg;Fn.SubjectAlternativeName=eg=Zy=pI.__decorate([(0,gw.AsnType)({type:gw.AsnTypeTypes.Sequence})],eg)});var tg=l(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.Attribute=void 0;var vw=(b(),v(m)),kf=S(),lu=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};jf.Attribute=lu;vw.__decorate([(0,kf.AsnProp)({type:kf.AsnPropTypes.ObjectIdentifier})],lu.prototype,"type",void 0);vw.__decorate([(0,kf.AsnProp)({type:kf.AsnPropTypes.Any,repeated:"set"})],lu.prototype,"values",void 0)});var mw=l(Wn=>{"use strict";var rg;Object.defineProperty(Wn,"__esModule",{value:!0});Wn.SubjectDirectoryAttributes=Wn.id_ce_subjectDirectoryAttributes=void 0;var yI=(b(),v(m)),ig=S(),gI=tg(),AI=we();Wn.id_ce_subjectDirectoryAttributes=`${AI.id_ce}.9`;var ng=rg=class extends ig.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,rg.prototype)}};Wn.SubjectDirectoryAttributes=ng;Wn.SubjectDirectoryAttributes=ng=rg=yI.__decorate([(0,ig.AsnType)({type:ig.AsnTypeTypes.Sequence,itemType:gI.Attribute})],ng)});var bw=l(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.SubjectKeyIdentifier=Ko.id_ce_subjectKeyIdentifier=void 0;var vI=we(),mI=By();Ko.id_ce_subjectKeyIdentifier=`${vI.id_ce}.14`;var sg=class extends mI.KeyIdentifier{};Ko.SubjectKeyIdentifier=sg});var ww=l(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.PrivateKeyUsagePeriod=Lo.id_ce_privateKeyUsagePeriod=void 0;var Sw=(b(),v(m)),Mf=S(),bI=we();Lo.id_ce_privateKeyUsagePeriod=`${bI.id_ce}.16`;var du=class{constructor(e={}){Object.assign(this,e)}};Lo.PrivateKeyUsagePeriod=du;Sw.__decorate([(0,Mf.AsnProp)({type:Mf.AsnPropTypes.GeneralizedTime,context:0,implicit:!0,optional:!0})],du.prototype,"notBefore",void 0);Sw.__decorate([(0,Mf.AsnProp)({type:Mf.AsnPropTypes.GeneralizedTime,context:1,implicit:!0,optional:!0})],du.prototype,"notAfter",void 0)});var Pw=l(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.EntrustVersionInfo=Qr.EntrustInfo=Qr.EntrustInfoFlags=Qr.id_entrust_entrustVersInfo=void 0;var Cw=(b(),v(m)),Nf=S();Qr.id_entrust_entrustVersInfo="1.2.840.113533.7.65.0";var fu;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(fu||(Qr.EntrustInfoFlags=fu={}));var pu=class extends Nf.BitString{toJSON(){let e=[],t=this.toNumber();return t&fu.pKIXCertificate&&e.push("pKIXCertificate"),t&fu.newExtensions&&e.push("newExtensions"),t&fu.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}};Qr.EntrustInfo=pu;var hu=class{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new pu,Object.assign(this,e)}};Qr.EntrustVersionInfo=hu;Cw.__decorate([(0,Nf.AsnProp)({type:Nf.AsnPropTypes.GeneralString})],hu.prototype,"entrustVers",void 0);Cw.__decorate([(0,Nf.AsnProp)({type:pu})],hu.prototype,"entrustInfoFlags",void 0)});var Ew=l($n=>{"use strict";var og;Object.defineProperty($n,"__esModule",{value:!0});$n.SubjectInfoAccessSyntax=$n.id_pe_subjectInfoAccess=void 0;var SI=(b(),v(m)),ag=S(),wI=we(),CI=Oy();$n.id_pe_subjectInfoAccess=`${wI.id_pe}.11`;var cg=og=class extends ag.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,og.prototype)}};$n.SubjectInfoAccessSyntax=cg;$n.SubjectInfoAccessSyntax=cg=og=SI.__decorate([(0,ag.AsnType)({type:ag.AsnTypeTypes.Sequence,itemType:CI.AccessDescription})],cg)});var Tw=l(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});var Te=(b(),v(m));Te.__exportStar(Oy(),Ae);Te.__exportStar(By(),Ae);Te.__exportStar(VS(),Ae);Te.__exportStar(FS(),Ae);Te.__exportStar(WS(),Ae);Te.__exportStar(YS(),Ae);Te.__exportStar(Cf(),Ae);Te.__exportStar(ZS(),Ae);Te.__exportStar(tw(),Ae);Te.__exportStar(Dy(),Ae);Te.__exportStar(iw(),Ae);Te.__exportStar(nw(),Ae);Te.__exportStar(ow(),Ae);Te.__exportStar(cw(),Ae);Te.__exportStar(lw(),Ae);Te.__exportStar(dw(),Ae);Te.__exportStar(pw(),Ae);Te.__exportStar(_w(),Ae);Te.__exportStar(yw(),Ae);Te.__exportStar(Aw(),Ae);Te.__exportStar(mw(),Ae);Te.__exportStar(bw(),Ae);Te.__exportStar(ww(),Ae);Te.__exportStar(Pw(),Ae);Te.__exportStar(Ew(),Ae)});var zn=l(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.AlgorithmIdentifier=void 0;var xw=(b(),v(m)),qf=S(),PI=Ai(),_u=class r{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof r&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&PI.isEqual(e.parameters,this.parameters)||e.parameters===this.parameters)}};Rf.AlgorithmIdentifier=_u;xw.__decorate([(0,qf.AsnProp)({type:qf.AsnPropTypes.ObjectIdentifier})],_u.prototype,"algorithm",void 0);xw.__decorate([(0,qf.AsnProp)({type:qf.AsnPropTypes.Any,optional:!0})],_u.prototype,"parameters",void 0)});var lg=l(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.SubjectPublicKeyInfo=void 0;var Ow=(b(),v(m)),ug=S(),Iw=zn(),yu=class{constructor(e={}){this.algorithm=new Iw.AlgorithmIdentifier,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}};Df.SubjectPublicKeyInfo=yu;Ow.__decorate([(0,ug.AsnProp)({type:Iw.AlgorithmIdentifier})],yu.prototype,"algorithm",void 0);Ow.__decorate([(0,ug.AsnProp)({type:ug.AsnPropTypes.BitString})],yu.prototype,"subjectPublicKey",void 0)});var Uf=l(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.Time=void 0;var dg=(b(),v(m)),Vo=S(),gu=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){let t=new Date(e);t.setMilliseconds(0),t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}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}};Au.Time=gu;dg.__decorate([(0,Vo.AsnProp)({type:Vo.AsnPropTypes.UTCTime})],gu.prototype,"utcTime",void 0);dg.__decorate([(0,Vo.AsnProp)({type:Vo.AsnPropTypes.GeneralizedTime})],gu.prototype,"generalTime",void 0);Au.Time=gu=dg.__decorate([(0,Vo.AsnType)({type:Vo.AsnTypeTypes.Choice})],gu)});var fg=l(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.Validity=void 0;var Bw=(b(),v(m)),kw=S(),Go=Uf(),vu=class{constructor(e){this.notBefore=new Go.Time(new Date),this.notAfter=new Go.Time(new Date),e&&(this.notBefore=new Go.Time(e.notBefore),this.notAfter=new Go.Time(e.notAfter))}};Kf.Validity=vu;Bw.__decorate([(0,kw.AsnProp)({type:Go.Time})],vu.prototype,"notBefore",void 0);Bw.__decorate([(0,kw.AsnProp)({type:Go.Time})],vu.prototype,"notAfter",void 0)});var Vf=l(Yn=>{"use strict";var pg;Object.defineProperty(Yn,"__esModule",{value:!0});Yn.Extensions=Yn.Extension=void 0;var Lf=(b(),v(m)),Xr=S(),Ei=class r{constructor(e={}){this.extnID="",this.critical=r.CRITICAL,this.extnValue=new Xr.OctetString,Object.assign(this,e)}};Yn.Extension=Ei;Ei.CRITICAL=!1;Lf.__decorate([(0,Xr.AsnProp)({type:Xr.AsnPropTypes.ObjectIdentifier})],Ei.prototype,"extnID",void 0);Lf.__decorate([(0,Xr.AsnProp)({type:Xr.AsnPropTypes.Boolean,defaultValue:Ei.CRITICAL})],Ei.prototype,"critical",void 0);Lf.__decorate([(0,Xr.AsnProp)({type:Xr.OctetString})],Ei.prototype,"extnValue",void 0);var hg=pg=class extends Xr.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,pg.prototype)}};Yn.Extensions=hg;Yn.Extensions=hg=pg=Lf.__decorate([(0,Xr.AsnType)({type:Xr.AsnTypeTypes.Sequence,itemType:Ei})],hg)});var _g=l(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.Version=void 0;var jw;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(jw||(Gf.Version=jw={}))});var yg=l(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});Ff.TBSCertificate=void 0;var Zr=(b(),v(m)),wt=S(),Mw=zn(),Hf=mo(),Nw=lg(),qw=fg(),EI=Vf(),Rw=_g(),Vt=class{constructor(e={}){this.version=Rw.Version.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new Mw.AlgorithmIdentifier,this.issuer=new Hf.Name,this.validity=new qw.Validity,this.subject=new Hf.Name,this.subjectPublicKeyInfo=new Nw.SubjectPublicKeyInfo,Object.assign(this,e)}};Ff.TBSCertificate=Vt;Zr.__decorate([(0,wt.AsnProp)({type:wt.AsnPropTypes.Integer,context:0,defaultValue:Rw.Version.v1})],Vt.prototype,"version",void 0);Zr.__decorate([(0,wt.AsnProp)({type:wt.AsnPropTypes.Integer,converter:wt.AsnIntegerArrayBufferConverter})],Vt.prototype,"serialNumber",void 0);Zr.__decorate([(0,wt.AsnProp)({type:Mw.AlgorithmIdentifier})],Vt.prototype,"signature",void 0);Zr.__decorate([(0,wt.AsnProp)({type:Hf.Name})],Vt.prototype,"issuer",void 0);Zr.__decorate([(0,wt.AsnProp)({type:qw.Validity})],Vt.prototype,"validity",void 0);Zr.__decorate([(0,wt.AsnProp)({type:Hf.Name})],Vt.prototype,"subject",void 0);Zr.__decorate([(0,wt.AsnProp)({type:Nw.SubjectPublicKeyInfo})],Vt.prototype,"subjectPublicKeyInfo",void 0);Zr.__decorate([(0,wt.AsnProp)({type:wt.AsnPropTypes.BitString,context:1,implicit:!0,optional:!0})],Vt.prototype,"issuerUniqueID",void 0);Zr.__decorate([(0,wt.AsnProp)({type:wt.AsnPropTypes.BitString,context:2,implicit:!0,optional:!0})],Vt.prototype,"subjectUniqueID",void 0);Zr.__decorate([(0,wt.AsnProp)({type:EI.Extensions,context:3,optional:!0})],Vt.prototype,"extensions",void 0)});var Kw=l($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});$f.Certificate=void 0;var gg=(b(),v(m)),Wf=S(),Dw=zn(),Uw=yg(),Ho=class{constructor(e={}){this.tbsCertificate=new Uw.TBSCertificate,this.signatureAlgorithm=new Dw.AlgorithmIdentifier,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}};$f.Certificate=Ho;gg.__decorate([(0,Wf.AsnProp)({type:Uw.TBSCertificate,raw:!0})],Ho.prototype,"tbsCertificate",void 0);gg.__decorate([(0,Wf.AsnProp)({type:Dw.AlgorithmIdentifier})],Ho.prototype,"signatureAlgorithm",void 0);gg.__decorate([(0,Wf.AsnProp)({type:Wf.AsnPropTypes.BitString})],Ho.prototype,"signatureValue",void 0)});var Ag=l(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.TBSCertList=Fo.RevokedCertificate=void 0;var ti=(b(),v(m)),Gt=S(),Lw=zn(),Vw=mo(),mu=Uf(),Gw=Vf(),Jn=class{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new mu.Time,Object.assign(this,e)}};Fo.RevokedCertificate=Jn;ti.__decorate([(0,Gt.AsnProp)({type:Gt.AsnPropTypes.Integer,converter:Gt.AsnIntegerArrayBufferConverter})],Jn.prototype,"userCertificate",void 0);ti.__decorate([(0,Gt.AsnProp)({type:mu.Time})],Jn.prototype,"revocationDate",void 0);ti.__decorate([(0,Gt.AsnProp)({type:Gw.Extension,optional:!0,repeated:"sequence"})],Jn.prototype,"crlEntryExtensions",void 0);var ei=class{constructor(e={}){this.signature=new Lw.AlgorithmIdentifier,this.issuer=new Vw.Name,this.thisUpdate=new mu.Time,Object.assign(this,e)}};Fo.TBSCertList=ei;ti.__decorate([(0,Gt.AsnProp)({type:Gt.AsnPropTypes.Integer,optional:!0})],ei.prototype,"version",void 0);ti.__decorate([(0,Gt.AsnProp)({type:Lw.AlgorithmIdentifier})],ei.prototype,"signature",void 0);ti.__decorate([(0,Gt.AsnProp)({type:Vw.Name})],ei.prototype,"issuer",void 0);ti.__decorate([(0,Gt.AsnProp)({type:mu.Time})],ei.prototype,"thisUpdate",void 0);ti.__decorate([(0,Gt.AsnProp)({type:mu.Time,optional:!0})],ei.prototype,"nextUpdate",void 0);ti.__decorate([(0,Gt.AsnProp)({type:Jn,repeated:"sequence",optional:!0})],ei.prototype,"revokedCertificates",void 0);ti.__decorate([(0,Gt.AsnProp)({type:Gw.Extension,optional:!0,context:0,repeated:"sequence"})],ei.prototype,"crlExtensions",void 0)});var Ww=l(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.CertificateList=void 0;var vg=(b(),v(m)),zf=S(),Hw=zn(),Fw=Ag(),Wo=class{constructor(e={}){this.tbsCertList=new Fw.TBSCertList,this.signatureAlgorithm=new Hw.AlgorithmIdentifier,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};Yf.CertificateList=Wo;vg.__decorate([(0,zf.AsnProp)({type:Fw.TBSCertList,raw:!0})],Wo.prototype,"tbsCertList",void 0);vg.__decorate([(0,zf.AsnProp)({type:Hw.AlgorithmIdentifier})],Wo.prototype,"signatureAlgorithm",void 0);vg.__decorate([(0,zf.AsnProp)({type:zf.AsnPropTypes.BitString})],Wo.prototype,"signature",void 0)});var Q=l(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});var yt=(b(),v(m));yt.__exportStar(Tw(),it);yt.__exportStar(zn(),it);yt.__exportStar(tg(),it);yt.__exportStar(Kw(),it);yt.__exportStar(Ww(),it);yt.__exportStar(Vf(),it);yt.__exportStar(kn(),it);yt.__exportStar(iu(),it);yt.__exportStar(mo(),it);yt.__exportStar(we(),it);yt.__exportStar(lg(),it);yt.__exportStar(Ag(),it);yt.__exportStar(yg(),it);yt.__exportStar(Uf(),it);yt.__exportStar(_g(),it);yt.__exportStar(fg(),it)});var bu=l(bg=>{"use strict";Object.defineProperty(bg,"__esModule",{value:!0});bg.getCertificateInfo=TI;var $w=S(),mg=Q(),zw={"2.5.4.6":"C","2.5.4.10":"O","2.5.4.11":"OU","2.5.4.3":"CN"};function TI(r){let e=$w.AsnParser.parse(r,mg.Certificate),t=e.tbsCertificate,i={combined:""};t.issuer.forEach(([o])=>{let a=zw[o.type];a&&(i[a]=o.value.toString())}),i.combined=Yw(i);let n={combined:""};t.subject.forEach(([o])=>{let a=zw[o.type];a&&(n[a]=o.value.toString())}),n.combined=Yw(n);let s=!1;if(t.extensions)for(let o of t.extensions)o.extnID===mg.id_ce_basicConstraints&&(s=$w.AsnParser.parse(o.extnValue,mg.BasicConstraints).cA);return{issuer:i,subject:n,version:t.version,basicConstraintsCA:s,notBefore:t.validity.notBefore.getTime(),notAfter:t.validity.notAfter.getTime(),parsedCertificate:e}}function Yw(r){let e=[];return r.C&&e.push(r.C),r.O&&e.push(r.O),r.OU&&e.push(r.OU),r.CN&&e.push(r.CN),e.join(" : ")}});var Qw=l(()=>{var Jw;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:a(),i=n(r);typeof t.Reflect<"u"&&(i=n(t.Reflect,i)),e(i,t),typeof t.Reflect>"u"&&(t.Reflect=r);function n(c,u){return function(d,f){Object.defineProperty(c,d,{configurable:!0,writable:!0,value:f}),u&&u(d,f)}}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,t){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,d={create:a?function(){return E_(Object.create(null))}:c?function(){return E_({__proto__:null})}:function(){return E_({})},has:u?function(h,y){return i.call(h,y)}:function(h,y){return y in h},get:u?function(h,y){return i.call(h,y)?h[y]:void 0}:function(h,y){return h[y]}},f=Object.getPrototypeOf(Function),_=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:nT(),g=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:sT(),x=typeof WeakMap=="function"?WeakMap:oT(),T=n?Symbol.for("@reflect-metadata:registry"):void 0,I=tT(),U=rT(I);function Z(h,y,w,k){if(H(w)){if(!Im(h))throw new TypeError;if(!Bm(y))throw new TypeError;return yr(h,y)}else{if(!Im(h))throw new TypeError;if(!z(y))throw new TypeError;if(!z(k)&&!H(k)&&!Kr(k))throw new TypeError;return Kr(k)&&(k=void 0),w=Lr(w),Ui(h,y,w,k)}}e("decorate",Z);function fe(h,y){function w(k,F){if(!z(k))throw new TypeError;if(!H(F)&&!ZE(F))throw new TypeError;Ur(h,y,k,F)}return w}e("metadata",fe);function ge(h,y,w,k){if(!z(w))throw new TypeError;return H(k)||(k=Lr(k)),Ur(h,y,w,k)}e("defineMetadata",ge);function ne(h,y,w){if(!z(y))throw new TypeError;return H(w)||(w=Lr(w)),ze(h,y,w)}e("hasMetadata",ne);function $e(h,y,w){if(!z(y))throw new TypeError;return H(w)||(w=Lr(w)),ft(h,y,w)}e("hasOwnMetadata",$e);function tt(h,y,w){if(!z(y))throw new TypeError;return H(w)||(w=Lr(w)),pt(h,y,w)}e("getMetadata",tt);function at(h,y,w){if(!z(y))throw new TypeError;return H(w)||(w=Lr(w)),Cn(h,y,w)}e("getOwnMetadata",at);function ct(h,y){if(!z(h))throw new TypeError;return H(y)||(y=Lr(y)),_i(h,y)}e("getMetadataKeys",ct);function _r(h,y){if(!z(h))throw new TypeError;return H(y)||(y=Lr(y)),yi(h,y)}e("getOwnMetadataKeys",_r);function Xt(h,y,w){if(!z(y))throw new TypeError;if(H(w)||(w=Lr(w)),!z(y))throw new TypeError;H(w)||(w=Lr(w));var k=cc(y,w,!1);return H(k)?!1:k.OrdinaryDeleteMetadata(h,y,w)}e("deleteMetadata",Xt);function yr(h,y){for(var w=h.length-1;w>=0;--w){var k=h[w],F=k(y);if(!H(F)&&!Kr(F)){if(!Bm(F))throw new TypeError;y=F}}return y}function Ui(h,y,w,k){for(var F=h.length-1;F>=0;--F){var Ue=h[F],Ye=Ue(y,w,k);if(!H(Ye)&&!Kr(Ye)){if(!z(Ye))throw new TypeError;k=Ye}}return k}function ze(h,y,w){var k=ft(h,y,w);if(k)return!0;var F=P_(y);return Kr(F)?!1:ze(h,F,w)}function ft(h,y,w){var k=cc(y,w,!1);return H(k)?!1:Li(k.OrdinaryHasOwnMetadata(h,y,w))}function pt(h,y,w){var k=ft(h,y,w);if(k)return Cn(h,y,w);var F=P_(y);if(!Kr(F))return pt(h,F,w)}function Cn(h,y,w){var k=cc(y,w,!1);if(!H(k))return k.OrdinaryGetOwnMetadata(h,y,w)}function Ur(h,y,w,k){var F=cc(w,k,!0);F.OrdinaryDefineOwnMetadata(h,y,w,k)}function _i(h,y){var w=yi(h,y),k=P_(h);if(k===null)return w;var F=_i(k,y);if(F.length<=0)return w;if(w.length<=0)return F;for(var Ue=new g,Ye=[],ee=0,M=w;ee<M.length;ee++){var D=M[ee],V=Ue.has(D);V||(Ue.add(D),Ye.push(D))}for(var G=0,re=F;G<re.length;G++){var D=re[G],V=Ue.has(D);V||(Ue.add(D),Ye.push(D))}return Ye}function yi(h,y){var w=cc(h,y,!1);return w?w.OrdinaryOwnMetadataKeys(h,y):[]}function Ut(h){if(h===null)return 1;switch(typeof h){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return h===null?1:6;default:return 6}}function H(h){return h===void 0}function Kr(h){return h===null}function eo(h){return typeof h=="symbol"}function z(h){return typeof h=="object"?h!==null:typeof h=="function"}function Kt(h,y){switch(Ut(h)){case 0:return h;case 1:return h;case 2:return h;case 3:return h;case 4:return h;case 5:return h}var w=y===3?"string":y===5?"number":"default",k=km(h,s);if(k!==void 0){var F=k.call(h,w);if(z(F))throw new TypeError;return F}return Ki(h,w==="default"?"number":w)}function Ki(h,y){if(y==="string"){var w=h.toString;if(to(w)){var k=w.call(h);if(!z(k))return k}var F=h.valueOf;if(to(F)){var k=F.call(h);if(!z(k))return k}}else{var F=h.valueOf;if(to(F)){var k=F.call(h);if(!z(k))return k}var Ue=h.toString;if(to(Ue)){var k=Ue.call(h);if(!z(k))return k}}throw new TypeError}function Li(h){return!!h}function Pn(h){return""+h}function Lr(h){var y=Kt(h,3);return eo(y)?y:Pn(y)}function Im(h){return Array.isArray?Array.isArray(h):h instanceof Object?h instanceof Array:Object.prototype.toString.call(h)==="[object Array]"}function to(h){return typeof h=="function"}function Bm(h){return typeof h=="function"}function ZE(h){switch(Ut(h)){case 3:return!0;case 4:return!0;default:return!1}}function C_(h,y){return h===y||h!==h&&y!==y}function km(h,y){var w=h[y];if(w!=null){if(!to(w))throw new TypeError;return w}}function jm(h){var y=km(h,o);if(!to(y))throw new TypeError;var w=y.call(h);if(!z(w))throw new TypeError;return w}function Mm(h){return h.value}function Nm(h){var y=h.next();return y.done?!1:y}function qm(h){var y=h.return;y&&y.call(h)}function P_(h){var y=Object.getPrototypeOf(h);if(typeof h!="function"||h===f||y!==f)return y;var w=h.prototype,k=w&&Object.getPrototypeOf(w);if(k==null||k===Object.prototype)return y;var F=k.constructor;return typeof F!="function"||F===h?y:F}function eT(){var h;!H(T)&&typeof t.Reflect<"u"&&!(T in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(h=iT(t.Reflect));var y,w,k,F=new x,Ue={registerProvider:Ye,getProvider:M,setProvider:V};return Ue;function Ye(G){if(!Object.isExtensible(Ue))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case h===G:break;case H(y):y=G;break;case y===G:break;case H(w):w=G;break;case w===G:break;default:k===void 0&&(k=new g),k.add(G);break}}function ee(G,re){if(!H(y)){if(y.isProviderFor(G,re))return y;if(!H(w)){if(w.isProviderFor(G,re))return y;if(!H(k))for(var Ce=jm(k);;){var Ke=Nm(Ce);if(!Ke)return;var gr=Mm(Ke);if(gr.isProviderFor(G,re))return qm(Ce),gr}}}if(!H(h)&&h.isProviderFor(G,re))return h}function M(G,re){var Ce=F.get(G),Ke;return H(Ce)||(Ke=Ce.get(re)),H(Ke)&&(Ke=ee(G,re),H(Ke)||(H(Ce)&&(Ce=new _,F.set(G,Ce)),Ce.set(re,Ke))),Ke}function D(G){if(H(G))throw new TypeError;return y===G||w===G||!H(k)&&k.has(G)}function V(G,re,Ce){if(!D(Ce))throw new Error("Metadata provider not registered.");var Ke=M(G,re);if(Ke!==Ce){if(!H(Ke))return!1;var gr=F.get(G);H(gr)&&(gr=new _,F.set(G,gr)),gr.set(re,Ce)}return!0}}function tT(){var h;return!H(T)&&z(t.Reflect)&&Object.isExtensible(t.Reflect)&&(h=t.Reflect[T]),H(h)&&(h=eT()),!H(T)&&z(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,T,{enumerable:!1,configurable:!1,writable:!1,value:h}),h}function rT(h){var y=new x,w={isProviderFor:function(D,V){var G=y.get(D);return H(G)?!1:G.has(V)},OrdinaryDefineOwnMetadata:Ye,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:Ue,OrdinaryOwnMetadataKeys:ee,OrdinaryDeleteMetadata:M};return I.registerProvider(w),w;function k(D,V,G){var re=y.get(D),Ce=!1;if(H(re)){if(!G)return;re=new _,y.set(D,re),Ce=!0}var Ke=re.get(V);if(H(Ke)){if(!G)return;if(Ke=new _,re.set(V,Ke),!h.setProvider(D,V,w))throw re.delete(V),Ce&&y.delete(D),new Error("Wrong provider for target.")}return Ke}function F(D,V,G){var re=k(V,G,!1);return H(re)?!1:Li(re.has(D))}function Ue(D,V,G){var re=k(V,G,!1);if(!H(re))return re.get(D)}function Ye(D,V,G,re){var Ce=k(G,re,!0);Ce.set(D,V)}function ee(D,V){var G=[],re=k(D,V,!1);if(H(re))return G;for(var Ce=re.keys(),Ke=jm(Ce),gr=0;;){var Rm=Nm(Ke);if(!Rm)return G.length=gr,G;var aT=Mm(Rm);try{G[gr]=aT}catch(cT){try{qm(Ke)}finally{throw cT}}gr++}}function M(D,V,G){var re=k(V,G,!1);if(H(re)||!re.delete(D))return!1;if(re.size===0){var Ce=y.get(V);H(Ce)||(Ce.delete(G),Ce.size===0&&y.delete(Ce))}return!0}}function iT(h){var y=h.defineMetadata,w=h.hasOwnMetadata,k=h.getOwnMetadata,F=h.getOwnMetadataKeys,Ue=h.deleteMetadata,Ye=new x,ee={isProviderFor:function(M,D){var V=Ye.get(M);return!H(V)&&V.has(D)?!0:F(M,D).length?(H(V)&&(V=new g,Ye.set(M,V)),V.add(D),!0):!1},OrdinaryDefineOwnMetadata:y,OrdinaryHasOwnMetadata:w,OrdinaryGetOwnMetadata:k,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:Ue};return ee}function cc(h,y,w){var k=I.getProvider(h,y);if(!H(k))return k;if(w){if(I.setProvider(h,y,U))return U;throw new Error("Illegal state.")}}function nT(){var h={},y=[],w=(function(){function ee(M,D,V){this._index=0,this._keys=M,this._values=D,this._selector=V}return ee.prototype["@@iterator"]=function(){return this},ee.prototype[o]=function(){return this},ee.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=y,this._values=y):this._index++,{value:D,done:!1}}return{value:void 0,done:!0}},ee.prototype.throw=function(M){throw this._index>=0&&(this._index=-1,this._keys=y,this._values=y),M},ee.prototype.return=function(M){return this._index>=0&&(this._index=-1,this._keys=y,this._values=y),{value:M,done:!0}},ee})(),k=(function(){function ee(){this._keys=[],this._values=[],this._cacheKey=h,this._cacheIndex=-2}return Object.defineProperty(ee.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ee.prototype.has=function(M){return this._find(M,!1)>=0},ee.prototype.get=function(M){var D=this._find(M,!1);return D>=0?this._values[D]:void 0},ee.prototype.set=function(M,D){var V=this._find(M,!0);return this._values[V]=D,this},ee.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--,C_(M,this._cacheKey)&&(this._cacheKey=h,this._cacheIndex=-2),!0}return!1},ee.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=h,this._cacheIndex=-2},ee.prototype.keys=function(){return new w(this._keys,this._values,F)},ee.prototype.values=function(){return new w(this._keys,this._values,Ue)},ee.prototype.entries=function(){return new w(this._keys,this._values,Ye)},ee.prototype["@@iterator"]=function(){return this.entries()},ee.prototype[o]=function(){return this.entries()},ee.prototype._find=function(M,D){if(!C_(this._cacheKey,M)){this._cacheIndex=-1;for(var V=0;V<this._keys.length;V++)if(C_(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},ee})();return k;function F(ee,M){return ee}function Ue(ee,M){return M}function Ye(ee,M){return[ee,M]}}function sT(){var h=(function(){function y(){this._map=new _}return Object.defineProperty(y.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),y.prototype.has=function(w){return this._map.has(w)},y.prototype.add=function(w){return this._map.set(w,w),this},y.prototype.delete=function(w){return this._map.delete(w)},y.prototype.clear=function(){this._map.clear()},y.prototype.keys=function(){return this._map.keys()},y.prototype.values=function(){return this._map.keys()},y.prototype.entries=function(){return this._map.entries()},y.prototype["@@iterator"]=function(){return this.keys()},y.prototype[o]=function(){return this.keys()},y})();return h}function oT(){var h=16,y=d.create(),w=k();return(function(){function M(){this._key=k()}return M.prototype.has=function(D){var V=F(D,!1);return V!==void 0?d.has(V,this._key):!1},M.prototype.get=function(D){var V=F(D,!1);return V!==void 0?d.get(V,this._key):void 0},M.prototype.set=function(D,V){var G=F(D,!0);return G[this._key]=V,this},M.prototype.delete=function(D){var V=F(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@@"+ee();while(d.has(y,M));return y[M]=!0,M}function F(M,D){if(!i.call(M,w)){if(!D)return;Object.defineProperty(M,w,{value:d.create()})}return M[w]}function Ue(M,D){for(var V=0;V<D;++V)M[V]=Math.random()*255|0;return M}function Ye(M){if(typeof Uint8Array=="function"){var D=new Uint8Array(M);return typeof crypto<"u"?crypto.getRandomValues(D):typeof msCrypto<"u"?msCrypto.getRandomValues(D):Ue(D,M),D}return Ue(new Array(M),M)}function ee(){var M=Ye(h);M[6]=M[6]&79|64,M[8]=M[8]&191|128;for(var D="",V=0;V<h;++V){var G=M[V];(V===4||V===6||V===8)&&(D+="-"),G<16&&(D+="0"),D+=G.toString(16).toLowerCase()}return D}}function E_(h){return h.__=void 0,delete h.__,h}})})(Jw||(Jw={}))});var wu=l(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.IssuerAndSerialNumber=void 0;var Xw=(b(),v(m)),Jf=S(),Zw=Q(),Su=class{constructor(e={}){this.issuer=new Zw.Name,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}};Qf.IssuerAndSerialNumber=Su;Xw.__decorate([(0,Jf.AsnProp)({type:Zw.Name})],Su.prototype,"issuer",void 0);Xw.__decorate([(0,Jf.AsnProp)({type:Jf.AsnPropTypes.Integer,converter:Jf.AsnIntegerArrayBufferConverter})],Su.prototype,"serialNumber",void 0)});var wg=l(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.SignerIdentifier=void 0;var Sg=(b(),v(m)),Xf=S(),xI=wu(),OI=Q(),Cu=class{constructor(e={}){Object.assign(this,e)}};Pu.SignerIdentifier=Cu;Sg.__decorate([(0,Xf.AsnProp)({type:OI.SubjectKeyIdentifier,context:0,implicit:!0})],Cu.prototype,"subjectKeyIdentifier",void 0);Sg.__decorate([(0,Xf.AsnProp)({type:xI.IssuerAndSerialNumber})],Cu.prototype,"issuerAndSerialNumber",void 0);Pu.SignerIdentifier=Cu=Sg.__decorate([(0,Xf.AsnType)({type:Xf.AsnTypeTypes.Choice})],Cu)});var ri=l(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.KeyDerivationAlgorithmIdentifier=Re.MessageAuthenticationCodeAlgorithm=Re.ContentEncryptionAlgorithmIdentifier=Re.KeyEncryptionAlgorithmIdentifier=Re.SignatureAlgorithmIdentifier=Re.DigestAlgorithmIdentifier=Re.CMSVersion=void 0;var $o=(b(),v(m)),zo=Q(),sr=S(),e1;(function(r){r[r.v0=0]="v0",r[r.v1=1]="v1",r[r.v2=2]="v2",r[r.v3=3]="v3",r[r.v4=4]="v4",r[r.v5=5]="v5"})(e1||(Re.CMSVersion=e1={}));var Cg=class extends zo.AlgorithmIdentifier{};Re.DigestAlgorithmIdentifier=Cg;Re.DigestAlgorithmIdentifier=Cg=$o.__decorate([(0,sr.AsnType)({type:sr.AsnTypeTypes.Sequence})],Cg);var Pg=class extends zo.AlgorithmIdentifier{};Re.SignatureAlgorithmIdentifier=Pg;Re.SignatureAlgorithmIdentifier=Pg=$o.__decorate([(0,sr.AsnType)({type:sr.AsnTypeTypes.Sequence})],Pg);var Eg=class extends zo.AlgorithmIdentifier{};Re.KeyEncryptionAlgorithmIdentifier=Eg;Re.KeyEncryptionAlgorithmIdentifier=Eg=$o.__decorate([(0,sr.AsnType)({type:sr.AsnTypeTypes.Sequence})],Eg);var Tg=class extends zo.AlgorithmIdentifier{};Re.ContentEncryptionAlgorithmIdentifier=Tg;Re.ContentEncryptionAlgorithmIdentifier=Tg=$o.__decorate([(0,sr.AsnType)({type:sr.AsnTypeTypes.Sequence})],Tg);var xg=class extends zo.AlgorithmIdentifier{};Re.MessageAuthenticationCodeAlgorithm=xg;Re.MessageAuthenticationCodeAlgorithm=xg=$o.__decorate([(0,sr.AsnType)({type:sr.AsnTypeTypes.Sequence})],xg);var Og=class extends zo.AlgorithmIdentifier{};Re.KeyDerivationAlgorithmIdentifier=Og;Re.KeyDerivationAlgorithmIdentifier=Og=$o.__decorate([(0,sr.AsnType)({type:sr.AsnTypeTypes.Sequence})],Og)});var tp=l(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.Attribute=void 0;var t1=(b(),v(m)),Zf=S(),Eu=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};ep.Attribute=Eu;t1.__decorate([(0,Zf.AsnProp)({type:Zf.AsnPropTypes.ObjectIdentifier})],Eu.prototype,"attrType",void 0);t1.__decorate([(0,Zf.AsnProp)({type:Zf.AsnPropTypes.Any,repeated:"set"})],Eu.prototype,"attrValues",void 0)});var rp=l(Qn=>{"use strict";var Ig;Object.defineProperty(Qn,"__esModule",{value:!0});Qn.SignerInfos=Qn.SignerInfo=void 0;var Ji=(b(),v(m)),Ht=S(),r1=wg(),Tu=ri(),i1=tp(),Pr=class{constructor(e={}){this.version=Tu.CMSVersion.v0,this.sid=new r1.SignerIdentifier,this.digestAlgorithm=new Tu.DigestAlgorithmIdentifier,this.signatureAlgorithm=new Tu.SignatureAlgorithmIdentifier,this.signature=new Ht.OctetString,Object.assign(this,e)}};Qn.SignerInfo=Pr;Ji.__decorate([(0,Ht.AsnProp)({type:Ht.AsnPropTypes.Integer})],Pr.prototype,"version",void 0);Ji.__decorate([(0,Ht.AsnProp)({type:r1.SignerIdentifier})],Pr.prototype,"sid",void 0);Ji.__decorate([(0,Ht.AsnProp)({type:Tu.DigestAlgorithmIdentifier})],Pr.prototype,"digestAlgorithm",void 0);Ji.__decorate([(0,Ht.AsnProp)({type:i1.Attribute,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],Pr.prototype,"signedAttrs",void 0);Ji.__decorate([(0,Ht.AsnProp)({type:Tu.SignatureAlgorithmIdentifier})],Pr.prototype,"signatureAlgorithm",void 0);Ji.__decorate([(0,Ht.AsnProp)({type:Ht.OctetString})],Pr.prototype,"signature",void 0);Ji.__decorate([(0,Ht.AsnProp)({type:i1.Attribute,repeated:"set",context:1,implicit:!0,optional:!0})],Pr.prototype,"unsignedAttrs",void 0);var Bg=Ig=class extends Ht.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Ig.prototype)}};Qn.SignerInfos=Bg;Qn.SignerInfos=Bg=Ig=Ji.__decorate([(0,Ht.AsnType)({type:Ht.AsnTypeTypes.Set,itemType:Pr})],Bg)});var s1=l(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.CounterSignature=Xn.id_counterSignature=void 0;var II=(b(),v(m)),n1=S(),BI=rp();Xn.id_counterSignature="1.2.840.113549.1.9.6";var kg=class extends BI.SignerInfo{};Xn.CounterSignature=kg;Xn.CounterSignature=kg=II.__decorate([(0,n1.AsnType)({type:n1.AsnTypeTypes.Sequence})],kg)});var o1=l(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.MessageDigest=Yo.id_messageDigest=void 0;var kI=S();Yo.id_messageDigest="1.2.840.113549.1.9.4";var jg=class extends kI.OctetString{};Yo.MessageDigest=jg});var c1=l(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.SigningTime=Zn.id_signingTime=void 0;var jI=(b(),v(m)),MI=Q(),a1=S();Zn.id_signingTime="1.2.840.113549.1.9.5";var Mg=class extends MI.Time{};Zn.SigningTime=Mg;Zn.SigningTime=Mg=jI.__decorate([(0,a1.AsnType)({type:a1.AsnTypeTypes.Choice})],Mg)});var u1=l(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.id_contentType=void 0;var Ng=(b(),v(m));Ng.__exportStar(s1(),es);Ng.__exportStar(o1(),es);Ng.__exportStar(c1(),es);es.id_contentType="1.2.840.113549.1.9.3"});var l1=l(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.ACClearAttrs=void 0;var qg=(b(),v(m)),ip=S(),Rg=Q(),Jo=class{constructor(e={}){this.acIssuer=new Rg.GeneralName,this.acSerial=0,this.attrs=[],Object.assign(this,e)}};np.ACClearAttrs=Jo;qg.__decorate([(0,ip.AsnProp)({type:Rg.GeneralName})],Jo.prototype,"acIssuer",void 0);qg.__decorate([(0,ip.AsnProp)({type:ip.AsnPropTypes.Integer})],Jo.prototype,"acSerial",void 0);qg.__decorate([(0,ip.AsnProp)({type:Rg.Attribute,repeated:"sequence"})],Jo.prototype,"attrs",void 0)});var Kg=l(xu=>{"use strict";var Dg;Object.defineProperty(xu,"__esModule",{value:!0});xu.AttrSpec=void 0;var NI=(b(),v(m)),sp=S(),Ug=Dg=class extends sp.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Dg.prototype)}};xu.AttrSpec=Ug;xu.AttrSpec=Ug=Dg=NI.__decorate([(0,sp.AsnType)({type:sp.AsnTypeTypes.Sequence,itemType:sp.AsnPropTypes.ObjectIdentifier})],Ug)});var f1=l(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.AAControls=void 0;var op=(b(),v(m)),Qo=S(),d1=Kg(),ts=class{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}};ap.AAControls=ts;op.__decorate([(0,Qo.AsnProp)({type:Qo.AsnPropTypes.Integer,optional:!0})],ts.prototype,"pathLenConstraint",void 0);op.__decorate([(0,Qo.AsnProp)({type:d1.AttrSpec,implicit:!0,context:0,optional:!0})],ts.prototype,"permittedAttrs",void 0);op.__decorate([(0,Qo.AsnProp)({type:d1.AttrSpec,implicit:!0,context:1,optional:!0})],ts.prototype,"excludedAttrs",void 0);op.__decorate([(0,Qo.AsnProp)({type:Qo.AsnPropTypes.Boolean,defaultValue:!0})],ts.prototype,"permitUnSpecified",void 0)});var Ou=l(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.IssuerSerial=void 0;var Lg=(b(),v(m)),Xo=S(),p1=Q(),Zo=class{constructor(e={}){this.issuer=new p1.GeneralNames,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}};cp.IssuerSerial=Zo;Lg.__decorate([(0,Xo.AsnProp)({type:p1.GeneralNames})],Zo.prototype,"issuer",void 0);Lg.__decorate([(0,Xo.AsnProp)({type:Xo.AsnPropTypes.Integer,converter:Xo.AsnIntegerArrayBufferConverter})],Zo.prototype,"serial",void 0);Lg.__decorate([(0,Xo.AsnProp)({type:Xo.AsnPropTypes.BitString,optional:!0})],Zo.prototype,"issuerUID",void 0)});var Iu=l(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.ObjectDigestInfo=ea.DigestedObjectType=void 0;var up=(b(),v(m)),rs=S(),h1=Q(),Vg;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(Vg||(ea.DigestedObjectType=Vg={}));var is=class{constructor(e={}){this.digestedObjectType=Vg.publicKey,this.digestAlgorithm=new h1.AlgorithmIdentifier,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}};ea.ObjectDigestInfo=is;up.__decorate([(0,rs.AsnProp)({type:rs.AsnPropTypes.Enumerated})],is.prototype,"digestedObjectType",void 0);up.__decorate([(0,rs.AsnProp)({type:rs.AsnPropTypes.ObjectIdentifier,optional:!0})],is.prototype,"otherObjectTypeID",void 0);up.__decorate([(0,rs.AsnProp)({type:h1.AlgorithmIdentifier})],is.prototype,"digestAlgorithm",void 0);up.__decorate([(0,rs.AsnProp)({type:rs.AsnPropTypes.BitString})],is.prototype,"objectDigest",void 0)});var Fg=l(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.V2Form=void 0;var Gg=(b(),v(m)),Hg=S(),qI=Q(),RI=Ou(),DI=Iu(),ta=class{constructor(e={}){Object.assign(this,e)}};lp.V2Form=ta;Gg.__decorate([(0,Hg.AsnProp)({type:qI.GeneralNames,optional:!0})],ta.prototype,"issuerName",void 0);Gg.__decorate([(0,Hg.AsnProp)({type:RI.IssuerSerial,context:0,implicit:!0,optional:!0})],ta.prototype,"baseCertificateID",void 0);Gg.__decorate([(0,Hg.AsnProp)({type:DI.ObjectDigestInfo,context:1,implicit:!0,optional:!0})],ta.prototype,"objectDigestInfo",void 0)});var $g=l(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.AttCertIssuer=void 0;var Wg=(b(),v(m)),dp=S(),UI=Q(),KI=Fg(),Bu=class{constructor(e={}){Object.assign(this,e)}};ku.AttCertIssuer=Bu;Wg.__decorate([(0,dp.AsnProp)({type:UI.GeneralName,repeated:"sequence"})],Bu.prototype,"v1Form",void 0);Wg.__decorate([(0,dp.AsnProp)({type:KI.V2Form,context:0,implicit:!0})],Bu.prototype,"v2Form",void 0);ku.AttCertIssuer=Bu=Wg.__decorate([(0,dp.AsnType)({type:dp.AsnTypeTypes.Choice})],Bu)});var zg=l(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.AttCertValidityPeriod=void 0;var _1=(b(),v(m)),fp=S(),ju=class{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}};pp.AttCertValidityPeriod=ju;_1.__decorate([(0,fp.AsnProp)({type:fp.AsnPropTypes.GeneralizedTime})],ju.prototype,"notBeforeTime",void 0);_1.__decorate([(0,fp.AsnProp)({type:fp.AsnPropTypes.GeneralizedTime})],ju.prototype,"notAfterTime",void 0)});var Qg=l(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.Holder=void 0;var Yg=(b(),v(m)),Jg=S(),LI=Ou(),VI=Q(),GI=Iu(),ra=class{constructor(e={}){Object.assign(this,e)}};hp.Holder=ra;Yg.__decorate([(0,Jg.AsnProp)({type:LI.IssuerSerial,implicit:!0,context:0,optional:!0})],ra.prototype,"baseCertificateID",void 0);Yg.__decorate([(0,Jg.AsnProp)({type:VI.GeneralNames,implicit:!0,context:1,optional:!0})],ra.prototype,"entityName",void 0);Yg.__decorate([(0,Jg.AsnProp)({type:GI.ObjectDigestInfo,implicit:!0,context:2,optional:!0})],ra.prototype,"objectDigestInfo",void 0)});var Zg=l(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.AttributeCertificateInfo=ia.AttCertVersion=void 0;var Ti=(b(),v(m)),Ft=S(),_p=Q(),y1=Qg(),g1=$g(),A1=zg(),Xg;(function(r){r[r.v2=1]="v2"})(Xg||(ia.AttCertVersion=Xg={}));var or=class{constructor(e={}){this.version=Xg.v2,this.holder=new y1.Holder,this.issuer=new g1.AttCertIssuer,this.signature=new _p.AlgorithmIdentifier,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new A1.AttCertValidityPeriod,this.attributes=[],Object.assign(this,e)}};ia.AttributeCertificateInfo=or;Ti.__decorate([(0,Ft.AsnProp)({type:Ft.AsnPropTypes.Integer})],or.prototype,"version",void 0);Ti.__decorate([(0,Ft.AsnProp)({type:y1.Holder})],or.prototype,"holder",void 0);Ti.__decorate([(0,Ft.AsnProp)({type:g1.AttCertIssuer})],or.prototype,"issuer",void 0);Ti.__decorate([(0,Ft.AsnProp)({type:_p.AlgorithmIdentifier})],or.prototype,"signature",void 0);Ti.__decorate([(0,Ft.AsnProp)({type:Ft.AsnPropTypes.Integer,converter:Ft.AsnIntegerArrayBufferConverter})],or.prototype,"serialNumber",void 0);Ti.__decorate([(0,Ft.AsnProp)({type:A1.AttCertValidityPeriod})],or.prototype,"attrCertValidityPeriod",void 0);Ti.__decorate([(0,Ft.AsnProp)({type:_p.Attribute,repeated:"sequence"})],or.prototype,"attributes",void 0);Ti.__decorate([(0,Ft.AsnProp)({type:Ft.AsnPropTypes.BitString,optional:!0})],or.prototype,"issuerUniqueID",void 0);Ti.__decorate([(0,Ft.AsnProp)({type:_p.Extensions,optional:!0})],or.prototype,"extensions",void 0)});var b1=l(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});gp.AttributeCertificate=void 0;var eA=(b(),v(m)),yp=S(),v1=Q(),m1=Zg(),na=class{constructor(e={}){this.acinfo=new m1.AttributeCertificateInfo,this.signatureAlgorithm=new v1.AlgorithmIdentifier,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}};gp.AttributeCertificate=na;eA.__decorate([(0,yp.AsnProp)({type:m1.AttributeCertificateInfo})],na.prototype,"acinfo",void 0);eA.__decorate([(0,yp.AsnProp)({type:v1.AlgorithmIdentifier})],na.prototype,"signatureAlgorithm",void 0);eA.__decorate([(0,yp.AsnProp)({type:yp.AsnPropTypes.BitString})],na.prototype,"signatureValue",void 0)});var rA=l(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.ClassList=sa.ClassListFlags=void 0;var HI=S(),S1;(function(r){r[r.unmarked=1]="unmarked",r[r.unclassified=2]="unclassified",r[r.restricted=4]="restricted",r[r.confidential=8]="confidential",r[r.secret=16]="secret",r[r.topSecret=32]="topSecret"})(S1||(sa.ClassListFlags=S1={}));var tA=class extends HI.BitString{};sa.ClassList=tA});var iA=l(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.SecurityCategory=void 0;var w1=(b(),v(m)),Ap=S(),Mu=class{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}};vp.SecurityCategory=Mu;w1.__decorate([(0,Ap.AsnProp)({type:Ap.AsnPropTypes.ObjectIdentifier,implicit:!0,context:0})],Mu.prototype,"type",void 0);w1.__decorate([(0,Ap.AsnProp)({type:Ap.AsnPropTypes.Any,implicit:!0,context:1})],Mu.prototype,"value",void 0)});var C1=l(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.Clearance=void 0;var nA=(b(),v(m)),mp=S(),Nu=rA(),FI=iA(),oa=class{constructor(e={}){this.policyId="",this.classList=new Nu.ClassList(Nu.ClassListFlags.unclassified),Object.assign(this,e)}};bp.Clearance=oa;nA.__decorate([(0,mp.AsnProp)({type:mp.AsnPropTypes.ObjectIdentifier})],oa.prototype,"policyId",void 0);nA.__decorate([(0,mp.AsnProp)({type:Nu.ClassList,defaultValue:new Nu.ClassList(Nu.ClassListFlags.unclassified)})],oa.prototype,"classList",void 0);nA.__decorate([(0,mp.AsnProp)({type:FI.SecurityCategory,repeated:"set"})],oa.prototype,"securityCategories",void 0)});var P1=l(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.IetfAttrSyntax=aa.IetfAttrSyntaxValueChoices=void 0;var Ru=(b(),v(m)),Qi=S(),WI=Q(),ns=class{constructor(e={}){Object.assign(this,e)}};aa.IetfAttrSyntaxValueChoices=ns;Ru.__decorate([(0,Qi.AsnProp)({type:Qi.OctetString})],ns.prototype,"cotets",void 0);Ru.__decorate([(0,Qi.AsnProp)({type:Qi.AsnPropTypes.ObjectIdentifier})],ns.prototype,"oid",void 0);Ru.__decorate([(0,Qi.AsnProp)({type:Qi.AsnPropTypes.Utf8String})],ns.prototype,"string",void 0);var qu=class{constructor(e={}){this.values=[],Object.assign(this,e)}};aa.IetfAttrSyntax=qu;Ru.__decorate([(0,Qi.AsnProp)({type:WI.GeneralNames,implicit:!0,context:0,optional:!0})],qu.prototype,"policyAuthority",void 0);Ru.__decorate([(0,Qi.AsnProp)({type:ns,repeated:"sequence"})],qu.prototype,"values",void 0)});var E1=l(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.id_at_clearance=oe.id_at_role=oe.id_at=oe.id_aca_encAttrs=oe.id_aca_group=oe.id_aca_chargingIdentity=oe.id_aca_accessIdentity=oe.id_aca_authenticationInfo=oe.id_aca=oe.id_ce_targetInformation=oe.id_pe_ac_proxying=oe.id_pe_aaControls=oe.id_pe_ac_auditIdentity=void 0;var Du=Q();oe.id_pe_ac_auditIdentity=`${Du.id_pe}.4`;oe.id_pe_aaControls=`${Du.id_pe}.6`;oe.id_pe_ac_proxying=`${Du.id_pe}.10`;oe.id_ce_targetInformation=`${Du.id_ce}.55`;oe.id_aca=`${Du.id_pkix}.10`;oe.id_aca_authenticationInfo=`${oe.id_aca}.1`;oe.id_aca_accessIdentity=`${oe.id_aca}.2`;oe.id_aca_chargingIdentity=`${oe.id_aca}.3`;oe.id_aca_group=`${oe.id_aca}.4`;oe.id_aca_encAttrs=`${oe.id_aca}.6`;oe.id_at="2.5.4";oe.id_at_role=`${oe.id_at}.72`;oe.id_at_clearance="2.5.1.5.55"});var cA=l(ii=>{"use strict";var sA;Object.defineProperty(ii,"__esModule",{value:!0});ii.Targets=ii.Target=ii.TargetCert=void 0;var Xi=(b(),v(m)),Er=S(),aA=Q(),T1=Ou(),$I=Iu(),ss=class{constructor(e={}){this.targetCertificate=new T1.IssuerSerial,Object.assign(this,e)}};ii.TargetCert=ss;Xi.__decorate([(0,Er.AsnProp)({type:T1.IssuerSerial})],ss.prototype,"targetCertificate",void 0);Xi.__decorate([(0,Er.AsnProp)({type:aA.GeneralName,optional:!0})],ss.prototype,"targetName",void 0);Xi.__decorate([(0,Er.AsnProp)({type:$I.ObjectDigestInfo,optional:!0})],ss.prototype,"certDigestInfo",void 0);var os=class{constructor(e={}){Object.assign(this,e)}};ii.Target=os;Xi.__decorate([(0,Er.AsnProp)({type:aA.GeneralName,context:0,implicit:!0})],os.prototype,"targetName",void 0);Xi.__decorate([(0,Er.AsnProp)({type:aA.GeneralName,context:1,implicit:!0})],os.prototype,"targetGroup",void 0);Xi.__decorate([(0,Er.AsnProp)({type:ss,context:2,implicit:!0})],os.prototype,"targetCert",void 0);ii.Target=os=Xi.__decorate([(0,Er.AsnType)({type:Er.AsnTypeTypes.Choice})],os);var oA=sA=class extends Er.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,sA.prototype)}};ii.Targets=oA;ii.Targets=oA=sA=Xi.__decorate([(0,Er.AsnType)({type:Er.AsnTypeTypes.Sequence,itemType:os})],oA)});var x1=l(Uu=>{"use strict";var uA;Object.defineProperty(Uu,"__esModule",{value:!0});Uu.ProxyInfo=void 0;var zI=(b(),v(m)),lA=S(),YI=cA(),dA=uA=class extends lA.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,uA.prototype)}};Uu.ProxyInfo=dA;Uu.ProxyInfo=dA=uA=zI.__decorate([(0,lA.AsnType)({type:lA.AsnTypeTypes.Sequence,itemType:YI.Targets})],dA)});var k1=l(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.RoleSyntax=void 0;var O1=(b(),v(m)),I1=S(),B1=Q(),Ku=class{constructor(e={}){Object.assign(this,e)}};Sp.RoleSyntax=Ku;O1.__decorate([(0,I1.AsnProp)({type:B1.GeneralNames,implicit:!0,context:0,optional:!0})],Ku.prototype,"roleAuthority",void 0);O1.__decorate([(0,I1.AsnProp)({type:B1.GeneralName,implicit:!0,context:1})],Ku.prototype,"roleName",void 0)});var j1=l(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.SvceAuthInfo=void 0;var fA=(b(),v(m)),wp=S(),Cp=Q(),ca=class{constructor(e={}){this.service=new Cp.GeneralName,this.ident=new Cp.GeneralName,Object.assign(this,e)}};Pp.SvceAuthInfo=ca;fA.__decorate([(0,wp.AsnProp)({type:Cp.GeneralName})],ca.prototype,"service",void 0);fA.__decorate([(0,wp.AsnProp)({type:Cp.GeneralName})],ca.prototype,"ident",void 0);fA.__decorate([(0,wp.AsnProp)({type:wp.OctetString,optional:!0})],ca.prototype,"authInfo",void 0)});var pA=l(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});var Fe=(b(),v(m));Fe.__exportStar(l1(),De);Fe.__exportStar(f1(),De);Fe.__exportStar($g(),De);Fe.__exportStar(zg(),De);Fe.__exportStar(Kg(),De);Fe.__exportStar(b1(),De);Fe.__exportStar(Zg(),De);Fe.__exportStar(rA(),De);Fe.__exportStar(C1(),De);Fe.__exportStar(Qg(),De);Fe.__exportStar(P1(),De);Fe.__exportStar(Ou(),De);Fe.__exportStar(Iu(),De);Fe.__exportStar(E1(),De);Fe.__exportStar(x1(),De);Fe.__exportStar(k1(),De);Fe.__exportStar(iA(),De);Fe.__exportStar(j1(),De);Fe.__exportStar(cA(),De);Fe.__exportStar(Fg(),De)});var Ep=l(ni=>{"use strict";var hA;Object.defineProperty(ni,"__esModule",{value:!0});ni.CertificateSet=ni.CertificateChoices=ni.OtherCertificateFormat=void 0;var cs=(b(),v(m)),ar=S(),JI=Q(),QI=pA(),ua=class{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}};ni.OtherCertificateFormat=ua;cs.__decorate([(0,ar.AsnProp)({type:ar.AsnPropTypes.ObjectIdentifier})],ua.prototype,"otherCertFormat",void 0);cs.__decorate([(0,ar.AsnProp)({type:ar.AsnPropTypes.Any})],ua.prototype,"otherCert",void 0);var as=class{constructor(e={}){Object.assign(this,e)}};ni.CertificateChoices=as;cs.__decorate([(0,ar.AsnProp)({type:JI.Certificate})],as.prototype,"certificate",void 0);cs.__decorate([(0,ar.AsnProp)({type:QI.AttributeCertificate,context:2,implicit:!0})],as.prototype,"v2AttrCert",void 0);cs.__decorate([(0,ar.AsnProp)({type:ua,context:3,implicit:!0})],as.prototype,"other",void 0);ni.CertificateChoices=as=cs.__decorate([(0,ar.AsnType)({type:ar.AsnTypeTypes.Choice})],as);var _A=hA=class extends ar.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,hA.prototype)}};ni.CertificateSet=_A;ni.CertificateSet=_A=hA=cs.__decorate([(0,ar.AsnType)({type:ar.AsnTypeTypes.Set,itemType:as})],_A)});var N1=l(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});xp.ContentInfo=void 0;var M1=(b(),v(m)),Tp=S(),Lu=class{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}};xp.ContentInfo=Lu;M1.__decorate([(0,Tp.AsnProp)({type:Tp.AsnPropTypes.ObjectIdentifier})],Lu.prototype,"contentType",void 0);M1.__decorate([(0,Tp.AsnProp)({type:Tp.AsnPropTypes.Any,context:0})],Lu.prototype,"content",void 0)});var yA=l(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.EncapsulatedContentInfo=us.EncapsulatedContent=void 0;var Gu=(b(),v(m)),xi=S(),la=class{constructor(e={}){Object.assign(this,e)}};us.EncapsulatedContent=la;Gu.__decorate([(0,xi.AsnProp)({type:xi.OctetString})],la.prototype,"single",void 0);Gu.__decorate([(0,xi.AsnProp)({type:xi.AsnPropTypes.Any})],la.prototype,"any",void 0);us.EncapsulatedContent=la=Gu.__decorate([(0,xi.AsnType)({type:xi.AsnTypeTypes.Choice})],la);var Vu=class{constructor(e={}){this.eContentType="",Object.assign(this,e)}};us.EncapsulatedContentInfo=Vu;Gu.__decorate([(0,xi.AsnProp)({type:xi.AsnPropTypes.ObjectIdentifier})],Vu.prototype,"eContentType",void 0);Gu.__decorate([(0,xi.AsnProp)({type:la,context:0,optional:!0})],Vu.prototype,"eContent",void 0)});var gA=l(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.EncryptedContentInfo=ls.EncryptedContent=void 0;var pa=(b(),v(m)),Tr=S(),q1=ri(),da=class{constructor(e={}){Object.assign(this,e)}};ls.EncryptedContent=da;pa.__decorate([(0,Tr.AsnProp)({type:Tr.OctetString,context:0,implicit:!0,optional:!0})],da.prototype,"value",void 0);pa.__decorate([(0,Tr.AsnProp)({type:Tr.OctetString,converter:Tr.AsnConstructedOctetStringConverter,context:0,implicit:!0,optional:!0,repeated:"sequence"})],da.prototype,"constructedValue",void 0);ls.EncryptedContent=da=pa.__decorate([(0,Tr.AsnType)({type:Tr.AsnTypeTypes.Choice})],da);var fa=class{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new q1.ContentEncryptionAlgorithmIdentifier,Object.assign(this,e)}};ls.EncryptedContentInfo=fa;pa.__decorate([(0,Tr.AsnProp)({type:Tr.AsnPropTypes.ObjectIdentifier})],fa.prototype,"contentType",void 0);pa.__decorate([(0,Tr.AsnProp)({type:q1.ContentEncryptionAlgorithmIdentifier})],fa.prototype,"contentEncryptionAlgorithm",void 0);pa.__decorate([(0,Tr.AsnProp)({type:da,optional:!0})],fa.prototype,"encryptedContent",void 0)});var AA=l(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.OtherKeyAttribute=void 0;var R1=(b(),v(m)),Op=S(),Hu=class{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}};Ip.OtherKeyAttribute=Hu;R1.__decorate([(0,Op.AsnProp)({type:Op.AsnPropTypes.ObjectIdentifier})],Hu.prototype,"keyAttrId",void 0);R1.__decorate([(0,Op.AsnProp)({type:Op.AsnPropTypes.Any,optional:!0})],Hu.prototype,"keyAttr",void 0)});var bA=l(Xe=>{"use strict";var vA;Object.defineProperty(Xe,"__esModule",{value:!0});Xe.KeyAgreeRecipientInfo=Xe.OriginatorIdentifierOrKey=Xe.OriginatorPublicKey=Xe.RecipientEncryptedKeys=Xe.RecipientEncryptedKey=Xe.KeyAgreeRecipientIdentifier=Xe.RecipientKeyIdentifier=void 0;var We=(b(),v(m)),de=S(),mA=ri(),D1=wu(),Wu=Q(),XI=AA(),ds=class{constructor(e={}){this.subjectKeyIdentifier=new Wu.SubjectKeyIdentifier,Object.assign(this,e)}};Xe.RecipientKeyIdentifier=ds;We.__decorate([(0,de.AsnProp)({type:Wu.SubjectKeyIdentifier})],ds.prototype,"subjectKeyIdentifier",void 0);We.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.GeneralizedTime,optional:!0})],ds.prototype,"date",void 0);We.__decorate([(0,de.AsnProp)({type:XI.OtherKeyAttribute,optional:!0})],ds.prototype,"other",void 0);var fs=class{constructor(e={}){Object.assign(this,e)}};Xe.KeyAgreeRecipientIdentifier=fs;We.__decorate([(0,de.AsnProp)({type:ds,context:0,implicit:!0,optional:!0})],fs.prototype,"rKeyId",void 0);We.__decorate([(0,de.AsnProp)({type:D1.IssuerAndSerialNumber,optional:!0})],fs.prototype,"issuerAndSerialNumber",void 0);Xe.KeyAgreeRecipientIdentifier=fs=We.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Choice})],fs);var ha=class{constructor(e={}){this.rid=new fs,this.encryptedKey=new de.OctetString,Object.assign(this,e)}};Xe.RecipientEncryptedKey=ha;We.__decorate([(0,de.AsnProp)({type:fs})],ha.prototype,"rid",void 0);We.__decorate([(0,de.AsnProp)({type:de.OctetString})],ha.prototype,"encryptedKey",void 0);var Fu=vA=class extends de.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,vA.prototype)}};Xe.RecipientEncryptedKeys=Fu;Xe.RecipientEncryptedKeys=Fu=vA=We.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Sequence,itemType:ha})],Fu);var _a=class{constructor(e={}){this.algorithm=new Wu.AlgorithmIdentifier,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}};Xe.OriginatorPublicKey=_a;We.__decorate([(0,de.AsnProp)({type:Wu.AlgorithmIdentifier})],_a.prototype,"algorithm",void 0);We.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.BitString})],_a.prototype,"publicKey",void 0);var Zi=class{constructor(e={}){Object.assign(this,e)}};Xe.OriginatorIdentifierOrKey=Zi;We.__decorate([(0,de.AsnProp)({type:Wu.SubjectKeyIdentifier,context:0,implicit:!0,optional:!0})],Zi.prototype,"subjectKeyIdentifier",void 0);We.__decorate([(0,de.AsnProp)({type:_a,context:1,implicit:!0,optional:!0})],Zi.prototype,"originatorKey",void 0);We.__decorate([(0,de.AsnProp)({type:D1.IssuerAndSerialNumber,optional:!0})],Zi.prototype,"issuerAndSerialNumber",void 0);Xe.OriginatorIdentifierOrKey=Zi=We.__decorate([(0,de.AsnType)({type:de.AsnTypeTypes.Choice})],Zi);var en=class{constructor(e={}){this.version=mA.CMSVersion.v3,this.originator=new Zi,this.keyEncryptionAlgorithm=new mA.KeyEncryptionAlgorithmIdentifier,this.recipientEncryptedKeys=new Fu,Object.assign(this,e)}};Xe.KeyAgreeRecipientInfo=en;We.__decorate([(0,de.AsnProp)({type:de.AsnPropTypes.Integer})],en.prototype,"version",void 0);We.__decorate([(0,de.AsnProp)({type:Zi,context:0})],en.prototype,"originator",void 0);We.__decorate([(0,de.AsnProp)({type:de.OctetString,context:1,optional:!0})],en.prototype,"ukm",void 0);We.__decorate([(0,de.AsnProp)({type:mA.KeyEncryptionAlgorithmIdentifier})],en.prototype,"keyEncryptionAlgorithm",void 0);We.__decorate([(0,de.AsnProp)({type:Fu})],en.prototype,"recipientEncryptedKeys",void 0)});var wA=l(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.KeyTransRecipientInfo=_s.RecipientIdentifier=void 0;var ys=(b(),v(m)),xr=S(),SA=ri(),ZI=wu(),eB=Q(),ps=class{constructor(e={}){Object.assign(this,e)}};_s.RecipientIdentifier=ps;ys.__decorate([(0,xr.AsnProp)({type:eB.SubjectKeyIdentifier,context:0,implicit:!0})],ps.prototype,"subjectKeyIdentifier",void 0);ys.__decorate([(0,xr.AsnProp)({type:ZI.IssuerAndSerialNumber})],ps.prototype,"issuerAndSerialNumber",void 0);_s.RecipientIdentifier=ps=ys.__decorate([(0,xr.AsnType)({type:xr.AsnTypeTypes.Choice})],ps);var hs=class{constructor(e={}){this.version=SA.CMSVersion.v0,this.rid=new ps,this.keyEncryptionAlgorithm=new SA.KeyEncryptionAlgorithmIdentifier,this.encryptedKey=new xr.OctetString,Object.assign(this,e)}};_s.KeyTransRecipientInfo=hs;ys.__decorate([(0,xr.AsnProp)({type:xr.AsnPropTypes.Integer})],hs.prototype,"version",void 0);ys.__decorate([(0,xr.AsnProp)({type:ps})],hs.prototype,"rid",void 0);ys.__decorate([(0,xr.AsnProp)({type:SA.KeyEncryptionAlgorithmIdentifier})],hs.prototype,"keyEncryptionAlgorithm",void 0);ys.__decorate([(0,xr.AsnProp)({type:xr.OctetString})],hs.prototype,"encryptedKey",void 0)});var PA=l(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.KEKRecipientInfo=ya.KEKIdentifier=void 0;var As=(b(),v(m)),Wt=S(),tB=AA(),CA=ri(),tn=class{constructor(e={}){this.keyIdentifier=new Wt.OctetString,Object.assign(this,e)}};ya.KEKIdentifier=tn;As.__decorate([(0,Wt.AsnProp)({type:Wt.OctetString})],tn.prototype,"keyIdentifier",void 0);As.__decorate([(0,Wt.AsnProp)({type:Wt.AsnPropTypes.GeneralizedTime,optional:!0})],tn.prototype,"date",void 0);As.__decorate([(0,Wt.AsnProp)({type:tB.OtherKeyAttribute,optional:!0})],tn.prototype,"other",void 0);var gs=class{constructor(e={}){this.version=CA.CMSVersion.v4,this.kekid=new tn,this.keyEncryptionAlgorithm=new CA.KeyEncryptionAlgorithmIdentifier,this.encryptedKey=new Wt.OctetString,Object.assign(this,e)}};ya.KEKRecipientInfo=gs;As.__decorate([(0,Wt.AsnProp)({type:Wt.AsnPropTypes.Integer})],gs.prototype,"version",void 0);As.__decorate([(0,Wt.AsnProp)({type:tn})],gs.prototype,"kekid",void 0);As.__decorate([(0,Wt.AsnProp)({type:CA.KeyEncryptionAlgorithmIdentifier})],gs.prototype,"keyEncryptionAlgorithm",void 0);As.__decorate([(0,Wt.AsnProp)({type:Wt.OctetString})],gs.prototype,"encryptedKey",void 0)});var EA=l(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.PasswordRecipientInfo=void 0;var kp=(b(),v(m)),vs=S(),Bp=ri(),ms=class{constructor(e={}){this.version=Bp.CMSVersion.v0,this.keyEncryptionAlgorithm=new Bp.KeyEncryptionAlgorithmIdentifier,this.encryptedKey=new vs.OctetString,Object.assign(this,e)}};jp.PasswordRecipientInfo=ms;kp.__decorate([(0,vs.AsnProp)({type:vs.AsnPropTypes.Integer})],ms.prototype,"version",void 0);kp.__decorate([(0,vs.AsnProp)({type:Bp.KeyDerivationAlgorithmIdentifier,context:0,optional:!0})],ms.prototype,"keyDerivationAlgorithm",void 0);kp.__decorate([(0,vs.AsnProp)({type:Bp.KeyEncryptionAlgorithmIdentifier})],ms.prototype,"keyEncryptionAlgorithm",void 0);kp.__decorate([(0,vs.AsnProp)({type:vs.OctetString})],ms.prototype,"encryptedKey",void 0)});var TA=l(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.RecipientInfo=bs.OtherRecipientInfo=void 0;var nn=(b(),v(m)),Or=S(),rB=bA(),iB=wA(),nB=PA(),sB=EA(),ga=class{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}};bs.OtherRecipientInfo=ga;nn.__decorate([(0,Or.AsnProp)({type:Or.AsnPropTypes.ObjectIdentifier})],ga.prototype,"oriType",void 0);nn.__decorate([(0,Or.AsnProp)({type:Or.AsnPropTypes.Any})],ga.prototype,"oriValue",void 0);var rn=class{constructor(e={}){Object.assign(this,e)}};bs.RecipientInfo=rn;nn.__decorate([(0,Or.AsnProp)({type:iB.KeyTransRecipientInfo,optional:!0})],rn.prototype,"ktri",void 0);nn.__decorate([(0,Or.AsnProp)({type:rB.KeyAgreeRecipientInfo,context:1,implicit:!0,optional:!0})],rn.prototype,"kari",void 0);nn.__decorate([(0,Or.AsnProp)({type:nB.KEKRecipientInfo,context:2,implicit:!0,optional:!0})],rn.prototype,"kekri",void 0);nn.__decorate([(0,Or.AsnProp)({type:sB.PasswordRecipientInfo,context:3,implicit:!0,optional:!0})],rn.prototype,"pwri",void 0);nn.__decorate([(0,Or.AsnProp)({type:ga,context:4,implicit:!0,optional:!0})],rn.prototype,"ori",void 0);bs.RecipientInfo=rn=nn.__decorate([(0,Or.AsnType)({type:Or.AsnTypeTypes.Choice})],rn)});var BA=l($u=>{"use strict";var xA;Object.defineProperty($u,"__esModule",{value:!0});$u.RecipientInfos=void 0;var oB=(b(),v(m)),OA=S(),aB=TA(),IA=xA=class extends OA.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,xA.prototype)}};$u.RecipientInfos=IA;$u.RecipientInfos=IA=xA=oB.__decorate([(0,OA.AsnType)({type:OA.AsnTypeTypes.Set,itemType:aB.RecipientInfo})],IA)});var Mp=l(nt=>{"use strict";var kA;Object.defineProperty(nt,"__esModule",{value:!0});nt.RevocationInfoChoices=nt.RevocationInfoChoice=nt.OtherRevocationInfoFormat=nt.id_ri_scvp=nt.id_ri_ocsp_response=nt.id_ri=void 0;var Yu=(b(),v(m)),si=S(),cB=Q();nt.id_ri=`${cB.id_pkix}.16`;nt.id_ri_ocsp_response=`${nt.id_ri}.2`;nt.id_ri_scvp=`${nt.id_ri}.4`;var Ss=class{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}};nt.OtherRevocationInfoFormat=Ss;Yu.__decorate([(0,si.AsnProp)({type:si.AsnPropTypes.ObjectIdentifier})],Ss.prototype,"otherRevInfoFormat",void 0);Yu.__decorate([(0,si.AsnProp)({type:si.AsnPropTypes.Any})],Ss.prototype,"otherRevInfo",void 0);var zu=class{constructor(e={}){this.other=new Ss,Object.assign(this,e)}};nt.RevocationInfoChoice=zu;Yu.__decorate([(0,si.AsnProp)({type:Ss,context:1,implicit:!0})],zu.prototype,"other",void 0);nt.RevocationInfoChoice=zu=Yu.__decorate([(0,si.AsnType)({type:si.AsnTypeTypes.Choice})],zu);var jA=kA=class extends si.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,kA.prototype)}};nt.RevocationInfoChoices=jA;nt.RevocationInfoChoices=jA=kA=Yu.__decorate([(0,si.AsnType)({type:si.AsnTypeTypes.Set,itemType:zu})],jA)});var MA=l(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.OriginatorInfo=void 0;var U1=(b(),v(m)),K1=S(),uB=Ep(),lB=Mp(),Ju=class{constructor(e={}){Object.assign(this,e)}};Np.OriginatorInfo=Ju;U1.__decorate([(0,K1.AsnProp)({type:uB.CertificateSet,context:0,implicit:!0,optional:!0})],Ju.prototype,"certs",void 0);U1.__decorate([(0,K1.AsnProp)({type:lB.RevocationInfoChoices,context:1,implicit:!0,optional:!0})],Ju.prototype,"crls",void 0)});var G1=l(ws=>{"use strict";var NA;Object.defineProperty(ws,"__esModule",{value:!0});ws.EnvelopedData=ws.UnprotectedAttributes=void 0;var Aa=(b(),v(m)),Oi=S(),dB=ri(),fB=tp(),L1=BA(),pB=MA(),V1=gA(),qp=NA=class extends Oi.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,NA.prototype)}};ws.UnprotectedAttributes=qp;ws.UnprotectedAttributes=qp=NA=Aa.__decorate([(0,Oi.AsnType)({type:Oi.AsnTypeTypes.Set,itemType:fB.Attribute})],qp);var sn=class{constructor(e={}){this.version=dB.CMSVersion.v0,this.recipientInfos=new L1.RecipientInfos,this.encryptedContentInfo=new V1.EncryptedContentInfo,Object.assign(this,e)}};ws.EnvelopedData=sn;Aa.__decorate([(0,Oi.AsnProp)({type:Oi.AsnPropTypes.Integer})],sn.prototype,"version",void 0);Aa.__decorate([(0,Oi.AsnProp)({type:pB.OriginatorInfo,context:0,implicit:!0,optional:!0})],sn.prototype,"originatorInfo",void 0);Aa.__decorate([(0,Oi.AsnProp)({type:L1.RecipientInfos})],sn.prototype,"recipientInfos",void 0);Aa.__decorate([(0,Oi.AsnProp)({type:V1.EncryptedContentInfo})],sn.prototype,"encryptedContentInfo",void 0);Aa.__decorate([(0,Oi.AsnProp)({type:qp,context:1,implicit:!0,optional:!0})],sn.prototype,"unprotectedAttrs",void 0)});var H1=l(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.id_authData=gt.id_encryptedData=gt.id_digestedData=gt.id_envelopedData=gt.id_signedData=gt.id_data=gt.id_ct_contentInfo=void 0;gt.id_ct_contentInfo="1.2.840.113549.1.9.16.1.6";gt.id_data="1.2.840.113549.1.7.1";gt.id_signedData="1.2.840.113549.1.7.2";gt.id_envelopedData="1.2.840.113549.1.7.3";gt.id_digestedData="1.2.840.113549.1.7.5";gt.id_encryptedData="1.2.840.113549.1.7.6";gt.id_authData="1.2.840.113549.1.9.16.1.2"});var z1=l(Cs=>{"use strict";var qA;Object.defineProperty(Cs,"__esModule",{value:!0});Cs.SignedData=Cs.DigestAlgorithmIdentifiers=void 0;var Ps=(b(),v(m)),oi=S(),hB=Ep(),F1=ri(),W1=yA(),_B=Mp(),$1=rp(),Qu=qA=class extends oi.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,qA.prototype)}};Cs.DigestAlgorithmIdentifiers=Qu;Cs.DigestAlgorithmIdentifiers=Qu=qA=Ps.__decorate([(0,oi.AsnType)({type:oi.AsnTypeTypes.Set,itemType:F1.DigestAlgorithmIdentifier})],Qu);var Ii=class{constructor(e={}){this.version=F1.CMSVersion.v0,this.digestAlgorithms=new Qu,this.encapContentInfo=new W1.EncapsulatedContentInfo,this.signerInfos=new $1.SignerInfos,Object.assign(this,e)}};Cs.SignedData=Ii;Ps.__decorate([(0,oi.AsnProp)({type:oi.AsnPropTypes.Integer})],Ii.prototype,"version",void 0);Ps.__decorate([(0,oi.AsnProp)({type:Qu})],Ii.prototype,"digestAlgorithms",void 0);Ps.__decorate([(0,oi.AsnProp)({type:W1.EncapsulatedContentInfo})],Ii.prototype,"encapContentInfo",void 0);Ps.__decorate([(0,oi.AsnProp)({type:hB.CertificateSet,context:0,implicit:!0,optional:!0})],Ii.prototype,"certificates",void 0);Ps.__decorate([(0,oi.AsnProp)({type:_B.RevocationInfoChoices,context:1,implicit:!0,optional:!0})],Ii.prototype,"crls",void 0);Ps.__decorate([(0,oi.AsnProp)({type:$1.SignerInfos})],Ii.prototype,"signerInfos",void 0)});var Xu=l(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});var Le=(b(),v(m));Le.__exportStar(u1(),ke);Le.__exportStar(tp(),ke);Le.__exportStar(Ep(),ke);Le.__exportStar(N1(),ke);Le.__exportStar(yA(),ke);Le.__exportStar(gA(),ke);Le.__exportStar(G1(),ke);Le.__exportStar(wu(),ke);Le.__exportStar(PA(),ke);Le.__exportStar(bA(),ke);Le.__exportStar(wA(),ke);Le.__exportStar(H1(),ke);Le.__exportStar(MA(),ke);Le.__exportStar(EA(),ke);Le.__exportStar(TA(),ke);Le.__exportStar(BA(),ke);Le.__exportStar(Mp(),ke);Le.__exportStar(z1(),ke);Le.__exportStar(wg(),ke);Le.__exportStar(rp(),ke);Le.__exportStar(ri(),ke)});var RA=l($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.id_sect571r1=$.id_sect571k1=$.id_secp521r1=$.id_sect409r1=$.id_sect409k1=$.id_secp384r1=$.id_sect283r1=$.id_sect283k1=$.id_secp256r1=$.id_sect233r1=$.id_sect233k1=$.id_secp224r1=$.id_sect163r2=$.id_sect163k1=$.id_secp192r1=$.id_ecdsaWithSHA512=$.id_ecdsaWithSHA384=$.id_ecdsaWithSHA256=$.id_ecdsaWithSHA224=$.id_ecdsaWithSHA1=$.id_ecMQV=$.id_ecDH=$.id_ecPublicKey=void 0;$.id_ecPublicKey="1.2.840.10045.2.1";$.id_ecDH="1.3.132.1.12";$.id_ecMQV="1.3.132.1.13";$.id_ecdsaWithSHA1="1.2.840.10045.4.1";$.id_ecdsaWithSHA224="1.2.840.10045.4.3.1";$.id_ecdsaWithSHA256="1.2.840.10045.4.3.2";$.id_ecdsaWithSHA384="1.2.840.10045.4.3.3";$.id_ecdsaWithSHA512="1.2.840.10045.4.3.4";$.id_secp192r1="1.2.840.10045.3.1.1";$.id_sect163k1="1.3.132.0.1";$.id_sect163r2="1.3.132.0.15";$.id_secp224r1="1.3.132.0.33";$.id_sect233k1="1.3.132.0.26";$.id_sect233r1="1.3.132.0.27";$.id_secp256r1="1.2.840.10045.3.1.7";$.id_sect283k1="1.3.132.0.16";$.id_sect283r1="1.3.132.0.17";$.id_secp384r1="1.3.132.0.34";$.id_sect409k1="1.3.132.0.36";$.id_sect409r1="1.3.132.0.37";$.id_secp521r1="1.3.132.0.35";$.id_sect571k1="1.3.132.0.38";$.id_sect571r1="1.3.132.0.39"});var Y1=l(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.ecdsaWithSHA512=cr.ecdsaWithSHA384=cr.ecdsaWithSHA256=cr.ecdsaWithSHA224=cr.ecdsaWithSHA1=void 0;var yB=Q(),Zu=RA();function el(r){return new yB.AlgorithmIdentifier({algorithm:r})}cr.ecdsaWithSHA1=el(Zu.id_ecdsaWithSHA1);cr.ecdsaWithSHA224=el(Zu.id_ecdsaWithSHA224);cr.ecdsaWithSHA256=el(Zu.id_ecdsaWithSHA256);cr.ecdsaWithSHA384=el(Zu.id_ecdsaWithSHA384);cr.ecdsaWithSHA512=el(Zu.id_ecdsaWithSHA512)});var KA=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 It=(b(),v(m)),_e=S(),va=class{constructor(e={}){Object.assign(this,e)}};dt.FieldID=va;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.ObjectIdentifier})],va.prototype,"fieldType",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.Any})],va.prototype,"parameters",void 0);dt.FieldID=va=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Sequence})],va);var Rp=class extends _e.OctetString{};dt.ECPoint=Rp;var DA=class extends _e.OctetString{};dt.FieldElement=DA;var Es=class{constructor(e={}){Object.assign(this,e)}};dt.Curve=Es;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.OctetString})],Es.prototype,"a",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.OctetString})],Es.prototype,"b",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.BitString,optional:!0})],Es.prototype,"seed",void 0);dt.Curve=Es=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Sequence})],Es);var UA;(function(r){r[r.ecpVer1=1]="ecpVer1"})(UA||(dt.ECPVer=UA={}));var Bi=class{constructor(e={}){this.version=UA.ecpVer1,Object.assign(this,e)}};dt.SpecifiedECDomain=Bi;It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.Integer})],Bi.prototype,"version",void 0);It.__decorate([(0,_e.AsnProp)({type:va})],Bi.prototype,"fieldID",void 0);It.__decorate([(0,_e.AsnProp)({type:Es})],Bi.prototype,"curve",void 0);It.__decorate([(0,_e.AsnProp)({type:Rp})],Bi.prototype,"base",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.Integer,converter:_e.AsnIntegerArrayBufferConverter})],Bi.prototype,"order",void 0);It.__decorate([(0,_e.AsnProp)({type:_e.AsnPropTypes.Integer,optional:!0})],Bi.prototype,"cofactor",void 0);dt.SpecifiedECDomain=Bi=It.__decorate([(0,_e.AsnType)({type:_e.AsnTypeTypes.Sequence})],Bi)});var LA=l(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.ECParameters=void 0;var Dp=(b(),v(m)),Ts=S(),gB=KA(),ma=class{constructor(e={}){Object.assign(this,e)}};tl.ECParameters=ma;Dp.__decorate([(0,Ts.AsnProp)({type:Ts.AsnPropTypes.ObjectIdentifier})],ma.prototype,"namedCurve",void 0);Dp.__decorate([(0,Ts.AsnProp)({type:Ts.AsnPropTypes.Null})],ma.prototype,"implicitCurve",void 0);Dp.__decorate([(0,Ts.AsnProp)({type:gB.SpecifiedECDomain})],ma.prototype,"specifiedCurve",void 0);tl.ECParameters=ma=Dp.__decorate([(0,Ts.AsnType)({type:Ts.AsnTypeTypes.Choice})],ma)});var J1=l(Kp=>{"use strict";Object.defineProperty(Kp,"__esModule",{value:!0});Kp.ECPrivateKey=void 0;var Up=(b(),v(m)),on=S(),AB=LA(),xs=class{constructor(e={}){this.version=1,this.privateKey=new on.OctetString,Object.assign(this,e)}};Kp.ECPrivateKey=xs;Up.__decorate([(0,on.AsnProp)({type:on.AsnPropTypes.Integer})],xs.prototype,"version",void 0);Up.__decorate([(0,on.AsnProp)({type:on.OctetString})],xs.prototype,"privateKey",void 0);Up.__decorate([(0,on.AsnProp)({type:AB.ECParameters,context:0,optional:!0})],xs.prototype,"parameters",void 0);Up.__decorate([(0,on.AsnProp)({type:on.AsnPropTypes.BitString,context:1,optional:!0})],xs.prototype,"publicKey",void 0)});var X1=l(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.ECDSASigValue=void 0;var Q1=(b(),v(m)),ba=S(),rl=class{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}};Lp.ECDSASigValue=rl;Q1.__decorate([(0,ba.AsnProp)({type:ba.AsnPropTypes.Integer,converter:ba.AsnIntegerArrayBufferConverter})],rl.prototype,"r",void 0);Q1.__decorate([(0,ba.AsnProp)({type:ba.AsnPropTypes.Integer,converter:ba.AsnIntegerArrayBufferConverter})],rl.prototype,"s",void 0)});var Vp=l(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});var Sa=(b(),v(m));Sa.__exportStar(Y1(),an);Sa.__exportStar(LA(),an);Sa.__exportStar(J1(),an);Sa.__exportStar(X1(),an);Sa.__exportStar(RA(),an);Sa.__exportStar(KA(),an)});var il=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 Gp=l(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.sha512_256WithRSAEncryption=J.sha512_224WithRSAEncryption=J.sha512WithRSAEncryption=J.sha384WithRSAEncryption=J.sha256WithRSAEncryption=J.sha224WithRSAEncryption=J.sha1WithRSAEncryption=J.md5WithRSAEncryption=J.md2WithRSAEncryption=J.rsaEncryption=J.pSpecifiedEmpty=J.mgf1SHA1=J.sha512_256=J.sha512_224=J.sha512=J.sha384=J.sha256=J.sha224=J.sha1=J.md4=J.md2=void 0;var VA=S(),GA=Q(),Ve=il();function Ze(r){return new GA.AlgorithmIdentifier({algorithm:r,parameters:null})}J.md2=Ze(Ve.id_md2);J.md4=Ze(Ve.id_md5);J.sha1=Ze(Ve.id_sha1);J.sha224=Ze(Ve.id_sha224);J.sha256=Ze(Ve.id_sha256);J.sha384=Ze(Ve.id_sha384);J.sha512=Ze(Ve.id_sha512);J.sha512_224=Ze(Ve.id_sha512_224);J.sha512_256=Ze(Ve.id_sha512_256);J.mgf1SHA1=new GA.AlgorithmIdentifier({algorithm:Ve.id_mgf1,parameters:VA.AsnConvert.serialize(J.sha1)});J.pSpecifiedEmpty=new GA.AlgorithmIdentifier({algorithm:Ve.id_pSpecified,parameters:VA.AsnConvert.serialize(VA.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))});J.rsaEncryption=Ze(Ve.id_rsaEncryption);J.md2WithRSAEncryption=Ze(Ve.id_md2WithRSAEncryption);J.md5WithRSAEncryption=Ze(Ve.id_md5WithRSAEncryption);J.sha1WithRSAEncryption=Ze(Ve.id_sha1WithRSAEncryption);J.sha224WithRSAEncryption=Ze(Ve.id_sha512_224WithRSAEncryption);J.sha256WithRSAEncryption=Ze(Ve.id_sha512_256WithRSAEncryption);J.sha384WithRSAEncryption=Ze(Ve.id_sha384WithRSAEncryption);J.sha512WithRSAEncryption=Ze(Ve.id_sha512WithRSAEncryption);J.sha512_224WithRSAEncryption=Ze(Ve.id_sha512_224WithRSAEncryption);J.sha512_256WithRSAEncryption=Ze(Ve.id_sha512_256WithRSAEncryption)});var eC=l(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.RSAES_OAEP=Ca.RsaEsOaepParams=void 0;var HA=(b(),v(m)),nl=S(),Os=Q(),Z1=il(),wa=Gp(),Is=class{constructor(e={}){this.hashAlgorithm=new Os.AlgorithmIdentifier(wa.sha1),this.maskGenAlgorithm=new Os.AlgorithmIdentifier({algorithm:Z1.id_mgf1,parameters:nl.AsnConvert.serialize(wa.sha1)}),this.pSourceAlgorithm=new Os.AlgorithmIdentifier(wa.pSpecifiedEmpty),Object.assign(this,e)}};Ca.RsaEsOaepParams=Is;HA.__decorate([(0,nl.AsnProp)({type:Os.AlgorithmIdentifier,context:0,defaultValue:wa.sha1})],Is.prototype,"hashAlgorithm",void 0);HA.__decorate([(0,nl.AsnProp)({type:Os.AlgorithmIdentifier,context:1,defaultValue:wa.mgf1SHA1})],Is.prototype,"maskGenAlgorithm",void 0);HA.__decorate([(0,nl.AsnProp)({type:Os.AlgorithmIdentifier,context:2,defaultValue:wa.pSpecifiedEmpty})],Is.prototype,"pSourceAlgorithm",void 0);Ca.RSAES_OAEP=new Os.AlgorithmIdentifier({algorithm:Z1.id_RSAES_OAEP,parameters:nl.AsnConvert.serialize(new Is)})});var rC=l(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.RSASSA_PSS=Pa.RsaSaPssParams=void 0;var Fp=(b(),v(m)),cn=S(),sl=Q(),tC=il(),Hp=Gp(),un=class{constructor(e={}){this.hashAlgorithm=new sl.AlgorithmIdentifier(Hp.sha1),this.maskGenAlgorithm=new sl.AlgorithmIdentifier({algorithm:tC.id_mgf1,parameters:cn.AsnConvert.serialize(Hp.sha1)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}};Pa.RsaSaPssParams=un;Fp.__decorate([(0,cn.AsnProp)({type:sl.AlgorithmIdentifier,context:0,defaultValue:Hp.sha1})],un.prototype,"hashAlgorithm",void 0);Fp.__decorate([(0,cn.AsnProp)({type:sl.AlgorithmIdentifier,context:1,defaultValue:Hp.mgf1SHA1})],un.prototype,"maskGenAlgorithm",void 0);Fp.__decorate([(0,cn.AsnProp)({type:cn.AsnPropTypes.Integer,context:2,defaultValue:20})],un.prototype,"saltLength",void 0);Fp.__decorate([(0,cn.AsnProp)({type:cn.AsnPropTypes.Integer,context:3,defaultValue:1})],un.prototype,"trailerField",void 0);Pa.RSASSA_PSS=new sl.AlgorithmIdentifier({algorithm:tC.id_RSASSA_PSS,parameters:cn.AsnConvert.serialize(new un)})});var sC=l($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.DigestInfo=void 0;var iC=(b(),v(m)),nC=Q(),Wp=S(),ol=class{constructor(e={}){this.digestAlgorithm=new nC.AlgorithmIdentifier,this.digest=new Wp.OctetString,Object.assign(this,e)}};$p.DigestInfo=ol;iC.__decorate([(0,Wp.AsnProp)({type:nC.AlgorithmIdentifier})],ol.prototype,"digestAlgorithm",void 0);iC.__decorate([(0,Wp.AsnProp)({type:Wp.OctetString})],ol.prototype,"digest",void 0)});var oC=l(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});var FA=(b(),v(m));FA.__exportStar(eC(),al);FA.__exportStar(rC(),al);FA.__exportStar(sC(),al)});var zA=l(ks=>{"use strict";var WA;Object.defineProperty(ks,"__esModule",{value:!0});ks.OtherPrimeInfos=ks.OtherPrimeInfo=void 0;var zp=(b(),v(m)),ur=S(),Bs=class{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}};ks.OtherPrimeInfo=Bs;zp.__decorate([(0,ur.AsnProp)({type:ur.AsnPropTypes.Integer,converter:ur.AsnIntegerArrayBufferConverter})],Bs.prototype,"prime",void 0);zp.__decorate([(0,ur.AsnProp)({type:ur.AsnPropTypes.Integer,converter:ur.AsnIntegerArrayBufferConverter})],Bs.prototype,"exponent",void 0);zp.__decorate([(0,ur.AsnProp)({type:ur.AsnPropTypes.Integer,converter:ur.AsnIntegerArrayBufferConverter})],Bs.prototype,"coefficient",void 0);var $A=WA=class extends ur.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,WA.prototype)}};ks.OtherPrimeInfos=$A;ks.OtherPrimeInfos=$A=WA=zp.__decorate([(0,ur.AsnType)({type:ur.AsnTypeTypes.Sequence,itemType:Bs})],$A)});var aC=l(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.RSAPrivateKey=void 0;var ai=(b(),v(m)),ve=S(),vB=zA(),$t=class{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}};Yp.RSAPrivateKey=$t;ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer})],$t.prototype,"version",void 0);ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer,converter:ve.AsnIntegerArrayBufferConverter})],$t.prototype,"modulus",void 0);ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer,converter:ve.AsnIntegerArrayBufferConverter})],$t.prototype,"publicExponent",void 0);ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer,converter:ve.AsnIntegerArrayBufferConverter})],$t.prototype,"privateExponent",void 0);ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer,converter:ve.AsnIntegerArrayBufferConverter})],$t.prototype,"prime1",void 0);ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer,converter:ve.AsnIntegerArrayBufferConverter})],$t.prototype,"prime2",void 0);ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer,converter:ve.AsnIntegerArrayBufferConverter})],$t.prototype,"exponent1",void 0);ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer,converter:ve.AsnIntegerArrayBufferConverter})],$t.prototype,"exponent2",void 0);ai.__decorate([(0,ve.AsnProp)({type:ve.AsnPropTypes.Integer,converter:ve.AsnIntegerArrayBufferConverter})],$t.prototype,"coefficient",void 0);ai.__decorate([(0,ve.AsnProp)({type:vB.OtherPrimeInfos,optional:!0})],$t.prototype,"otherPrimeInfos",void 0)});var uC=l(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});Jp.RSAPublicKey=void 0;var cC=(b(),v(m)),Ea=S(),cl=class{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}};Jp.RSAPublicKey=cl;cC.__decorate([(0,Ea.AsnProp)({type:Ea.AsnPropTypes.Integer,converter:Ea.AsnIntegerArrayBufferConverter})],cl.prototype,"modulus",void 0);cC.__decorate([(0,Ea.AsnProp)({type:Ea.AsnPropTypes.Integer,converter:Ea.AsnIntegerArrayBufferConverter})],cl.prototype,"publicExponent",void 0)});var Qp=l(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});var Ta=(b(),v(m));Ta.__exportStar(oC(),ln);Ta.__exportStar(Gp(),ln);Ta.__exportStar(il(),ln);Ta.__exportStar(zA(),ln);Ta.__exportStar(aC(),ln);Ta.__exportStar(uC(),ln)});var Xp={};Um(Xp,{__assign:()=>JA,__asyncDelegator:()=>kB,__asyncGenerator:()=>BB,__asyncValues:()=>jB,__await:()=>ul,__awaiter:()=>PB,__classPrivateFieldGet:()=>RB,__classPrivateFieldSet:()=>DB,__createBinding:()=>TB,__decorate:()=>SB,__exportStar:()=>xB,__extends:()=>mB,__generator:()=>EB,__importDefault:()=>qB,__importStar:()=>NB,__makeTemplateObject:()=>MB,__metadata:()=>CB,__param:()=>wB,__read:()=>lC,__rest:()=>bB,__spread:()=>OB,__spreadArrays:()=>IB,__values:()=>QA});function mB(r,e){YA(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function bB(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}function SB(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}function wB(r,e){return function(t,i){e(t,i,r)}}function CB(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function PB(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(d){try{u(i.next(d))}catch(f){o(f)}}function c(d){try{u(i.throw(d))}catch(f){o(f)}}function u(d){d.done?s(d.value):n(d.value).then(a,c)}u((i=i.apply(r,e||[])).next())})}function EB(r,e){var t={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(d){return c([u,d])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)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 t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function TB(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function xB(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function QA(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function lC(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),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&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}function OB(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(lC(arguments[e]));return r}function IB(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function ul(r){return this instanceof ul?(this.v=r,this):new ul(r)}function BB(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(_){i[_]&&(n[_]=function(g){return new Promise(function(x,T){s.push([_,g,x,T])>1||a(_,g)})})}function a(_,g){try{c(i[_](g))}catch(x){f(s[0][3],x)}}function c(_){_.value instanceof ul?Promise.resolve(_.value.v).then(u,d):f(s[0][2],_)}function u(_){a("next",_)}function d(_){a("throw",_)}function f(_,g){_(g),s.shift(),s.length&&a(s[0][0],s[0][1])}}function kB(r){var e,t;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]=r[n]?function(o){return(t=!t)?{value:ul(r[n](o)),done:n==="return"}:s?s(o):o}:s}}function jB(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof QA=="function"?QA(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=r[s]&&function(o){return new Promise(function(a,c){o=r[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 MB(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function NB(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function qB(r){return r&&r.__esModule?r:{default:r}}function RB(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function DB(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var YA,JA,Zp=Dm(()=>{YA=function(r,e){return YA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},YA(r,e)};JA=function(){return JA=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},JA.apply(this,arguments)}});var ev=l(ZA=>{"use strict";Object.defineProperty(ZA,"__esModule",{value:!0});var XA;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(XA||(XA={}));ZA.default=XA});var dC=l(tv=>{"use strict";Object.defineProperty(tv,"__esModule",{value:!0});var UB=ev();Object.defineProperty(tv,"Lifecycle",{enumerable:!0,get:function(){return UB.default}})});var js=l(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.defineInjectionTokenMetadata=Ir.getParamInfo=Ir.INJECTION_TOKEN_METADATA_KEY=void 0;Ir.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function KB(r){let e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(Ir.INJECTION_TOKEN_METADATA_KEY,r)||{};return Object.keys(t).forEach(i=>{e[+i]=t[i]}),e}Ir.getParamInfo=KB;function LB(r,e){return function(t,i,n){let s=Reflect.getOwnMetadata(Ir.INJECTION_TOKEN_METADATA_KEY,t)||{};s[n]=e?{token:r,transform:e.transformToken,transformArgs:e.args||[]}:r,Reflect.defineMetadata(Ir.INJECTION_TOKEN_METADATA_KEY,s,t)}}Ir.defineInjectionTokenMetadata=LB});var rv=l(eh=>{"use strict";Object.defineProperty(eh,"__esModule",{value:!0});eh.isClassProvider=void 0;function VB(r){return!!r.useClass}eh.isClassProvider=VB});var iv=l(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.isFactoryProvider=void 0;function GB(r){return!!r.useFactory}th.isFactoryProvider=GB});var ih=l(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.delay=xa.DelayedConstructor=void 0;var rh=class{constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let t={},i=!1,n,s=()=>(i||(n=e(this.wrap()),i=!0),n);return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},i=n=>{t[n]=(...s)=>{s[0]=e();let o=Reflect[n];return o(...s)}};return this.reflectMethods.forEach(i),t}};xa.DelayedConstructor=rh;function HB(r){if(typeof r>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new rh(r)}xa.delay=HB});var nh=l(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.isConstructorToken=ci.isTransformDescriptor=ci.isTokenDescriptor=ci.isNormalToken=void 0;var FB=ih();function WB(r){return typeof r=="string"||typeof r=="symbol"}ci.isNormalToken=WB;function $B(r){return typeof r=="object"&&"token"in r&&"multiple"in r}ci.isTokenDescriptor=$B;function zB(r){return typeof r=="object"&&"token"in r&&"transform"in r}ci.isTransformDescriptor=zB;function YB(r){return typeof r=="function"||r instanceof FB.DelayedConstructor}ci.isConstructorToken=YB});var nv=l(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.isTokenProvider=void 0;function JB(r){return!!r.useToken}sh.isTokenProvider=JB});var sv=l(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.isValueProvider=void 0;function QB(r){return r.useValue!=null}oh.isValueProvider=QB});var ov=l(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var XB=rv();Object.defineProperty(Ms,"isClassProvider",{enumerable:!0,get:function(){return XB.isClassProvider}});var ZB=iv();Object.defineProperty(Ms,"isFactoryProvider",{enumerable:!0,get:function(){return ZB.isFactoryProvider}});var ek=nh();Object.defineProperty(Ms,"isNormalToken",{enumerable:!0,get:function(){return ek.isNormalToken}});var tk=nv();Object.defineProperty(Ms,"isTokenProvider",{enumerable:!0,get:function(){return tk.isTokenProvider}});var rk=sv();Object.defineProperty(Ms,"isValueProvider",{enumerable:!0,get:function(){return rk.isValueProvider}})});var fC=l(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});ah.isProvider=void 0;var ik=rv(),nk=sv(),sk=nv(),ok=iv();function ak(r){return ik.isClassProvider(r)||nk.isValueProvider(r)||sk.isTokenProvider(r)||ok.isFactoryProvider(r)}ah.isProvider=ak});var uv=l(cv=>{"use strict";Object.defineProperty(cv,"__esModule",{value:!0});var av=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 t=this._registryMap.get(e);return t[t.length-1]||null}set(e,t){this.ensure(e),this._registryMap.get(e).push(t)}setAll(e,t){this._registryMap.set(e,t)}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,[])}};cv.default=av});var pC=l(dv=>{"use strict";Object.defineProperty(dv,"__esModule",{value:!0});var ck=uv(),lv=class extends ck.default{};dv.default=lv});var hC=l(pv=>{"use strict";Object.defineProperty(pv,"__esModule",{value:!0});var fv=class{constructor(){this.scopedResolutions=new Map}};pv.default=fv});var hv=l(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.formatErrorCtor=void 0;function uk(r,e){return r===null?`at position #${e}`:`"${r.split(",")[e].trim()}" at position #${e}`}function lk(r,e,t=" "){return[r,...e.message.split(`
|
|
13
|
-
|
|
14
|
-
`)}function dk(r,e,t){let[,i=null]=r.toString().match(/constructor\(([\w, ]+)\)/)||[],n=uk(i,e);return lk(`Cannot inject the dependency ${n} of "${r.name}" constructor. Reason:`,t)}ch.formatErrorCtor=dk});var _C=l(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.isDisposable=void 0;function fk(r){return!(typeof r.dispose!="function"||r.dispose.length>0)}uh.isDisposable=fk});var gC=l(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.PostResolutionInterceptors=Ns.PreResolutionInterceptors=void 0;var yC=uv(),lh=class extends yC.default{};Ns.PreResolutionInterceptors=lh;var dh=class extends yC.default{};Ns.PostResolutionInterceptors=dh;var _v=class{constructor(){this.preResolution=new lh,this.postResolution=new dh}};Ns.default=_v});var dn=l(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.instance=ki.typeInfo=void 0;var pk=(Zp(),v(Xp)),Ct=ov(),hk=fC(),fh=nh(),_k=pC(),Bt=ev(),ph=hC(),yk=hv(),gk=ih(),Ak=_C(),vk=gC();ki.typeInfo=new Map;var yv=class r{constructor(e){this.parent=e,this._registry=new _k.default,this.interceptors=new vk.default,this.disposed=!1,this.disposables=new Set}register(e,t,i={lifecycle:Bt.default.Transient}){this.ensureNotDisposed();let n;if(hk.isProvider(t)?n=t:n={useClass:t},Ct.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&&Ct.isTokenProvider(c.provider)?o=c.provider:o=null}}if((i.lifecycle===Bt.default.Singleton||i.lifecycle==Bt.default.ContainerScoped||i.lifecycle==Bt.default.ResolutionScoped)&&(Ct.isValueProvider(n)||Ct.isFactoryProvider(n)))throw new Error(`Cannot use lifecycle "${Bt.default[i.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:n,options:i}),this}registerType(e,t){return this.ensureNotDisposed(),Ct.isNormalToken(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})}registerInstance(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})}registerSingleton(e,t){if(this.ensureNotDisposed(),Ct.isNormalToken(e)){if(Ct.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Bt.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Bt.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let i=e;return t&&!Ct.isNormalToken(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:Bt.default.Singleton})}resolve(e,t=new ph.default,i=!1){this.ensureNotDisposed();let n=this.getRegistration(e);if(!n&&Ct.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,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(fh.isConstructorToken(e)){let s=this.construct(e,t);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,t){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,t);this.interceptors.preResolution.setAll(e,i)}}executePostResolutionInterceptor(e,t,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,t,i);this.interceptors.postResolution.setAll(e,n)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Bt.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let i=e.options.lifecycle===Bt.default.Singleton,n=e.options.lifecycle===Bt.default.ContainerScoped,s=i||n,o;return Ct.isValueProvider(e.provider)?o=e.provider.useValue:Ct.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Ct.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Ct.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Bt.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new ph.default,i=!1){this.ensureNotDisposed();let n=this.getAllRegistrations(e);if(!n&&Ct.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,t));return this.executePostResolutionInterceptor(e,o,"All"),o}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(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,t]of this._registry.entries())this._registry.setAll(e,t.filter(i=>!Ct.isValueProvider(i.provider)).map(i=>(i.instance=void 0,i)))}createChildContainer(){this.ensureNotDisposed();let e=new r(this);for(let[t,i]of this._registry.entries())i.some(({options:n})=>n.lifecycle===Bt.default.ContainerScoped)&&e._registry.setAll(t,i.map(n=>n.options.lifecycle===Bt.default.ContainerScoped?{provider:n.provider,options:n.options}:n));return e}beforeResolution(e,t,i={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:i})}afterResolution(e,t,i={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:i})}dispose(){return pk.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let i=t.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,t){if(e instanceof gk.DelayedConstructor)return e.createProxy(n=>this.resolve(n,t));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(t,e));return new e(...s)})();return Ak.isDisposable(i)&&this.disposables.add(i),i}resolveParams(e,t){return(i,n)=>{try{return fh.isTokenDescriptor(i)?fh.isTransformDescriptor(i)?i.multiple?this.resolve(i.transform).transform(this.resolveAll(i.token,new ph.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 ph.default,i.isOptional):this.resolve(i.token,e,i.isOptional):fh.isTransformDescriptor(i)?this.resolve(i.transform,e).transform(this.resolve(i.token,e),...i.transformArgs):this.resolve(i,e)}catch(s){throw new Error(yk.formatErrorCtor(t,n,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};ki.instance=new yv;ki.default=ki.instance});var AC=l(Av=>{"use strict";Object.defineProperty(Av,"__esModule",{value:!0});var mk=js(),ji=dn(),gv=nh(),bk=hv();function Sk(){return function(r){let e=mk.getParamInfo(r);return class extends r{constructor(...t){super(...t.concat(e.slice(t.length).map((i,n)=>{try{return gv.isTokenDescriptor(i)?gv.isTransformDescriptor(i)?i.multiple?ji.instance.resolve(i.transform).transform(ji.instance.resolveAll(i.token),...i.transformArgs):ji.instance.resolve(i.transform).transform(ji.instance.resolve(i.token),...i.transformArgs):i.multiple?ji.instance.resolveAll(i.token):ji.instance.resolve(i.token):gv.isTransformDescriptor(i)?ji.instance.resolve(i.transform).transform(ji.instance.resolve(i.token),...i.transformArgs):ji.instance.resolve(i)}catch(s){let o=n+t.length;throw new Error(bk.formatErrorCtor(r,o,s))}})))}}}}Av.default=Sk});var vC=l(vv=>{"use strict";Object.defineProperty(vv,"__esModule",{value:!0});var wk=js();function Ck(r,e){let t={token:r,multiple:!1,isOptional:e&&e.isOptional};return wk.defineInjectionTokenMetadata(t)}vv.default=Ck});var hh=l(mv=>{"use strict";Object.defineProperty(mv,"__esModule",{value:!0});var Pk=js(),Ek=dn(),mC=dn();function Tk(r){return function(e){Ek.typeInfo.set(e,Pk.getParamInfo(e)),r&&r.token&&(Array.isArray(r.token)?r.token.forEach(t=>{mC.instance.register(t,e)}):mC.instance.register(r.token,e))}}mv.default=Tk});var bC=l(bv=>{"use strict";Object.defineProperty(bv,"__esModule",{value:!0});var xk=(Zp(),v(Xp)),Ok=dn();function Ik(r=[]){return function(e){return r.forEach(t=>{var{token:i,options:n}=t,s=xk.__rest(t,["token","options"]);return Ok.instance.register(i,s,n)}),e}}bv.default=Ik});var SC=l(Sv=>{"use strict";Object.defineProperty(Sv,"__esModule",{value:!0});var Bk=hh(),kk=dn();function jk(){return function(r){Bk.default()(r),kk.instance.registerSingleton(r)}}Sv.default=jk});var wC=l(wv=>{"use strict";Object.defineProperty(wv,"__esModule",{value:!0});var Mk=js();function Nk(r,e){let t={token:r,multiple:!0,isOptional:e&&e.isOptional};return Mk.defineInjectionTokenMetadata(t)}wv.default=Nk});var CC=l(Cv=>{"use strict";Object.defineProperty(Cv,"__esModule",{value:!0});var qk=js();function Rk(r,e,...t){let i={token:r,multiple:!0,transform:e,transformArgs:t};return qk.defineInjectionTokenMetadata(i)}Cv.default=Rk});var PC=l(Pv=>{"use strict";Object.defineProperty(Pv,"__esModule",{value:!0});var Dk=js();function Uk(r,e,...t){return Dk.defineInjectionTokenMetadata(r,{transformToken:e,args:t})}Pv.default=Uk});var EC=l(Ev=>{"use strict";Object.defineProperty(Ev,"__esModule",{value:!0});var Kk=hh(),Lk=dn();function Vk(r,e){return function(t){Kk.default()(t),Lk.instance.register(e||t,t,{lifecycle:r})}}Ev.default=Vk});var TC=l(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});var Gk=AC();Object.defineProperty(Br,"autoInjectable",{enumerable:!0,get:function(){return Gk.default}});var Hk=vC();Object.defineProperty(Br,"inject",{enumerable:!0,get:function(){return Hk.default}});var Fk=hh();Object.defineProperty(Br,"injectable",{enumerable:!0,get:function(){return Fk.default}});var Wk=bC();Object.defineProperty(Br,"registry",{enumerable:!0,get:function(){return Wk.default}});var $k=SC();Object.defineProperty(Br,"singleton",{enumerable:!0,get:function(){return $k.default}});var zk=wC();Object.defineProperty(Br,"injectAll",{enumerable:!0,get:function(){return zk.default}});var Yk=CC();Object.defineProperty(Br,"injectAllWithTransform",{enumerable:!0,get:function(){return Yk.default}});var Jk=PC();Object.defineProperty(Br,"injectWithTransform",{enumerable:!0,get:function(){return Jk.default}});var Qk=EC();Object.defineProperty(Br,"scoped",{enumerable:!0,get:function(){return Qk.default}})});var xC=l(Tv=>{"use strict";Object.defineProperty(Tv,"__esModule",{value:!0});function Xk(r){let e;return t=>(e==null&&(e=r(t)),e)}Tv.default=Xk});var OC=l(xv=>{"use strict";Object.defineProperty(xv,"__esModule",{value:!0});function Zk(r){let e=new WeakMap;return t=>{let i=e.get(t);return i==null&&(i=r(t),e.set(t,i)),i}}xv.default=Zk});var IC=l(Ov=>{"use strict";Object.defineProperty(Ov,"__esModule",{value:!0});function ej(r,e,t,i=!0){let n,s;return o=>{let a=r(o);return(!i||s!==a)&&((s=a)?n=o.resolve(e):n=o.resolve(t)),n}}Ov.default=ej});var BC=l(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});var tj=xC();Object.defineProperty(ll,"instanceCachingFactory",{enumerable:!0,get:function(){return tj.default}});var rj=OC();Object.defineProperty(ll,"instancePerContainerCachingFactory",{enumerable:!0,get:function(){return rj.default}});var ij=IC();Object.defineProperty(ll,"predicateAwareClassFactory",{enumerable:!0,get:function(){return ij.default}})});var kC=l(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});var Iv=(Zp(),v(Xp));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 nj=dC();Object.defineProperty(fn,"Lifecycle",{enumerable:!0,get:function(){return nj.Lifecycle}});Iv.__exportStar(TC(),fn);Iv.__exportStar(BC(),fn);Iv.__exportStar(ov(),fn);var sj=ih();Object.defineProperty(fn,"delay",{enumerable:!0,get:function(){return sj.delay}});var oj=dn();Object.defineProperty(fn,"container",{enumerable:!0,get:function(){return oj.instance}})});var Mv=l(Rs=>{"use strict";var Bv;Object.defineProperty(Rs,"__esModule",{value:!0});Rs.PKCS12AttrSet=Rs.PKCS12Attribute=void 0;var jv=(b(),v(m)),qs=S(),Oa=class{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}};Rs.PKCS12Attribute=Oa;jv.__decorate([(0,qs.AsnProp)({type:qs.AsnPropTypes.ObjectIdentifier})],Oa.prototype,"attrId",void 0);jv.__decorate([(0,qs.AsnProp)({type:qs.AsnPropTypes.Any,repeated:"set"})],Oa.prototype,"attrValues",void 0);var kv=Bv=class extends qs.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Bv.prototype)}};Rs.PKCS12AttrSet=kv;Rs.PKCS12AttrSet=kv=Bv=jv.__decorate([(0,qs.AsnType)({type:qs.AsnTypeTypes.Sequence,itemType:Oa})],kv)});var jC=l(dl=>{"use strict";var Nv;Object.defineProperty(dl,"__esModule",{value:!0});dl.AuthenticatedSafe=void 0;var aj=(b(),v(m)),qv=S(),cj=Xu(),Rv=Nv=class extends qv.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Nv.prototype)}};dl.AuthenticatedSafe=Rv;dl.AuthenticatedSafe=Rv=Nv=aj.__decorate([(0,qv.AsnType)({type:qv.AsnTypeTypes.Sequence,itemType:cj.ContentInfo})],Rv)});var Dv=l(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.id_bagtypes=ae.id_pbewithSHAAnd40BitRC2_CBC=ae.id_pbeWithSHAAnd128BitRC2_CBC=ae.id_pbeWithSHAAnd2_KeyTripleDES_CBC=ae.id_pbeWithSHAAnd3_KeyTripleDES_CBC=ae.id_pbeWithSHAAnd40BitRC4=ae.id_pbeWithSHAAnd128BitRC4=ae.id_pkcs_12PbeIds=ae.id_pkcs_12=ae.id_pkcs=ae.id_rsadsi=void 0;ae.id_rsadsi="1.2.840.113549";ae.id_pkcs=`${ae.id_rsadsi}.1`;ae.id_pkcs_12=`${ae.id_pkcs}.12`;ae.id_pkcs_12PbeIds=`${ae.id_pkcs_12}.1`;ae.id_pbeWithSHAAnd128BitRC4=`${ae.id_pkcs_12PbeIds}.1`;ae.id_pbeWithSHAAnd40BitRC4=`${ae.id_pkcs_12PbeIds}.2`;ae.id_pbeWithSHAAnd3_KeyTripleDES_CBC=`${ae.id_pkcs_12PbeIds}.3`;ae.id_pbeWithSHAAnd2_KeyTripleDES_CBC=`${ae.id_pkcs_12PbeIds}.4`;ae.id_pbeWithSHAAnd128BitRC2_CBC=`${ae.id_pkcs_12PbeIds}.5`;ae.id_pbewithSHAAnd40BitRC2_CBC=`${ae.id_pkcs_12PbeIds}.6`;ae.id_bagtypes=`${ae.id_pkcs_12}.10.1`});var _h=l(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.id_pkcs_9=At.id_SafeContents=At.id_SecretBag=At.id_CRLBag=At.id_certBag=At.id_pkcs8ShroudedKeyBag=At.id_keyBag=void 0;var Ia=Dv();At.id_keyBag=`${Ia.id_bagtypes}.1`;At.id_pkcs8ShroudedKeyBag=`${Ia.id_bagtypes}.2`;At.id_certBag=`${Ia.id_bagtypes}.3`;At.id_CRLBag=`${Ia.id_bagtypes}.4`;At.id_SecretBag=`${Ia.id_bagtypes}.5`;At.id_SafeContents=`${Ia.id_bagtypes}.6`;At.id_pkcs_9="1.2.840.113549.1.9"});var NC=l(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.id_sdsiCertificate=lr.id_x509Certificate=lr.id_certTypes=lr.CertBag=void 0;var MC=(b(),v(m)),yh=S(),uj=_h(),fl=class{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}};lr.CertBag=fl;MC.__decorate([(0,yh.AsnProp)({type:yh.AsnPropTypes.ObjectIdentifier})],fl.prototype,"certId",void 0);MC.__decorate([(0,yh.AsnProp)({type:yh.AsnPropTypes.Any,context:0})],fl.prototype,"certValue",void 0);lr.id_certTypes=`${uj.id_pkcs_9}.22`;lr.id_x509Certificate=`${lr.id_certTypes}.1`;lr.id_sdsiCertificate=`${lr.id_certTypes}.2`});var RC=l(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.id_x509CRL=Mi.id_crlTypes=Mi.CRLBag=void 0;var qC=(b(),v(m)),gh=S(),lj=_h(),pl=class{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}};Mi.CRLBag=pl;qC.__decorate([(0,gh.AsnProp)({type:gh.AsnPropTypes.ObjectIdentifier})],pl.prototype,"crlId",void 0);qC.__decorate([(0,gh.AsnProp)({type:gh.AsnPropTypes.Any,context:0})],pl.prototype,"crltValue",void 0);Mi.id_crlTypes=`${lj.id_pkcs_9}.23`;Mi.id_x509CRL=`${Mi.id_crlTypes}.1`});var KC=l(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.EncryptedPrivateKeyInfo=Ba.EncryptedData=void 0;var DC=(b(),v(m)),Uv=S(),UC=Q(),hl=class extends Uv.OctetString{};Ba.EncryptedData=hl;var _l=class{constructor(e={}){this.encryptionAlgorithm=new UC.AlgorithmIdentifier,this.encryptedData=new hl,Object.assign(this,e)}};Ba.EncryptedPrivateKeyInfo=_l;DC.__decorate([(0,Uv.AsnProp)({type:UC.AlgorithmIdentifier})],_l.prototype,"encryptionAlgorithm",void 0);DC.__decorate([(0,Uv.AsnProp)({type:hl})],_l.prototype,"encryptedData",void 0)});var LC=l(kr=>{"use strict";var Kv;Object.defineProperty(kr,"__esModule",{value:!0});kr.PrivateKeyInfo=kr.Attributes=kr.PrivateKey=kr.Version=void 0;var gl=(b(),v(m)),Ni=S(),Vv=Q(),Lv;(function(r){r[r.v1=0]="v1"})(Lv||(kr.Version=Lv={}));var yl=class extends Ni.OctetString{};kr.PrivateKey=yl;var Ah=Kv=class extends Ni.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Kv.prototype)}};kr.Attributes=Ah;kr.Attributes=Ah=Kv=gl.__decorate([(0,Ni.AsnType)({type:Ni.AsnTypeTypes.Sequence,itemType:Vv.Attribute})],Ah);var Ds=class{constructor(e={}){this.version=Lv.v1,this.privateKeyAlgorithm=new Vv.AlgorithmIdentifier,this.privateKey=new yl,Object.assign(this,e)}};kr.PrivateKeyInfo=Ds;gl.__decorate([(0,Ni.AsnProp)({type:Ni.AsnPropTypes.Integer})],Ds.prototype,"version",void 0);gl.__decorate([(0,Ni.AsnProp)({type:Vv.AlgorithmIdentifier})],Ds.prototype,"privateKeyAlgorithm",void 0);gl.__decorate([(0,Ni.AsnProp)({type:yl})],Ds.prototype,"privateKey",void 0);gl.__decorate([(0,Ni.AsnProp)({type:Ah,implicit:!0,context:0,optional:!0})],Ds.prototype,"attributes",void 0)});var mh=l(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var VC=(b(),v(m));VC.__exportStar(KC(),vh);VC.__exportStar(LC(),vh)});var HC=l(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.KeyBag=void 0;var dj=(b(),v(m)),fj=mh(),GC=S(),Gv=class extends fj.PrivateKeyInfo{};Al.KeyBag=Gv;Al.KeyBag=Gv=dj.__decorate([(0,GC.AsnType)({type:GC.AsnTypeTypes.Sequence})],Gv)});var WC=l(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.PKCS8ShroudedKeyBag=void 0;var pj=(b(),v(m)),hj=mh(),FC=S(),Hv=class extends hj.EncryptedPrivateKeyInfo{};vl.PKCS8ShroudedKeyBag=Hv;vl.PKCS8ShroudedKeyBag=Hv=pj.__decorate([(0,FC.AsnType)({type:FC.AsnTypeTypes.Sequence})],Hv)});var zC=l(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.SecretBag=void 0;var $C=(b(),v(m)),bh=S(),ml=class{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}};Sh.SecretBag=ml;$C.__decorate([(0,bh.AsnProp)({type:bh.AsnPropTypes.ObjectIdentifier})],ml.prototype,"secretTypeId",void 0);$C.__decorate([(0,bh.AsnProp)({type:bh.AsnPropTypes.Any,context:0})],ml.prototype,"secretValue",void 0)});var YC=l(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});var ka=(b(),v(m));ka.__exportStar(NC(),pn);ka.__exportStar(RC(),pn);ka.__exportStar(HC(),pn);ka.__exportStar(WC(),pn);ka.__exportStar(zC(),pn);ka.__exportStar(_h(),pn)});var Wv=l(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.MacData=void 0;var Fv=(b(),v(m)),JC=Qp(),ja=S(),Ma=class{constructor(e={}){this.mac=new JC.DigestInfo,this.macSalt=new ja.OctetString,this.iterations=1,Object.assign(this,e)}};wh.MacData=Ma;Fv.__decorate([(0,ja.AsnProp)({type:JC.DigestInfo})],Ma.prototype,"mac",void 0);Fv.__decorate([(0,ja.AsnProp)({type:ja.OctetString})],Ma.prototype,"macSalt",void 0);Fv.__decorate([(0,ja.AsnProp)({type:ja.AsnPropTypes.Integer,defaultValue:1})],Ma.prototype,"iterations",void 0)});var ZC=l(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.PFX=void 0;var $v=(b(),v(m)),Ch=S(),QC=Xu(),XC=Wv(),Na=class{constructor(e={}){this.version=3,this.authSafe=new QC.ContentInfo,this.macData=new XC.MacData,Object.assign(this,e)}};Ph.PFX=Na;$v.__decorate([(0,Ch.AsnProp)({type:Ch.AsnPropTypes.Integer})],Na.prototype,"version",void 0);$v.__decorate([(0,Ch.AsnProp)({type:QC.ContentInfo})],Na.prototype,"authSafe",void 0);$v.__decorate([(0,Ch.AsnProp)({type:XC.MacData,optional:!0})],Na.prototype,"macData",void 0)});var eP=l(Ks=>{"use strict";var zv;Object.defineProperty(Ks,"__esModule",{value:!0});Ks.SafeContents=Ks.SafeBag=void 0;var Eh=(b(),v(m)),hn=S(),_j=Mv(),Us=class{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}};Ks.SafeBag=Us;Eh.__decorate([(0,hn.AsnProp)({type:hn.AsnPropTypes.ObjectIdentifier})],Us.prototype,"bagId",void 0);Eh.__decorate([(0,hn.AsnProp)({type:hn.AsnPropTypes.Any,context:0})],Us.prototype,"bagValue",void 0);Eh.__decorate([(0,hn.AsnProp)({type:_j.PKCS12Attribute,repeated:"set",optional:!0})],Us.prototype,"bagAttributes",void 0);var Yv=zv=class extends hn.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,zv.prototype)}};Ks.SafeContents=Yv;Ks.SafeContents=Yv=zv=Eh.__decorate([(0,hn.AsnType)({type:hn.AsnTypeTypes.Sequence,itemType:Us})],Yv)});var tP=l(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});var Ls=(b(),v(m));Ls.__exportStar(Mv(),qi);Ls.__exportStar(jC(),qi);Ls.__exportStar(YC(),qi);Ls.__exportStar(Wv(),qi);Ls.__exportStar(Dv(),qi);Ls.__exportStar(ZC(),qi);Ls.__exportStar(eP(),qi)});var rP=l(p=>{"use strict";var Jv,Qv,Xv;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 ue=(b(),v(m)),R=S(),g0=Xu(),yj=tP(),gj=mh(),Ri=Q(),Aj=pA();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=`${Aj.id_at}.65`;var bl=class extends Ri.DirectoryString{constructor(e={}){super(e)}toString(){return{}.toString(),this.ia5String||super.toString()}};p.PKCS9String=bl;ue.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.IA5String})],bl.prototype,"ia5String",void 0);p.PKCS9String=bl=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],bl);var Zv=class extends g0.ContentInfo{};p.Pkcs7PDU=Zv;p.Pkcs7PDU=Zv=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],Zv);var e0=class extends yj.PFX{};p.UserPKCS12=e0;p.UserPKCS12=e0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],e0);var t0=class extends gj.EncryptedPrivateKeyInfo{};p.EncryptedPrivateKeyInfo=t0;p.EncryptedPrivateKeyInfo=t0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],t0);var Th=class{constructor(e=""){this.value=e}toString(){return this.value}};p.EmailAddress=Th;ue.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.IA5String})],Th.prototype,"value",void 0);p.EmailAddress=Th=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Th);var r0=class extends bl{};p.UnstructuredName=r0;p.UnstructuredName=r0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],r0);var i0=class extends Ri.DirectoryString{};p.UnstructuredAddress=i0;p.UnstructuredAddress=i0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],i0);var xh=class{constructor(e=new Date){this.value=e}};p.DateOfBirth=xh;ue.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.GeneralizedTime})],xh.prototype,"value",void 0);p.DateOfBirth=xh=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],xh);var n0=class extends Ri.DirectoryString{};p.PlaceOfBirth=n0;p.PlaceOfBirth=n0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],n0);var Oh=class{constructor(e="M"){this.value=e}toString(){return this.value}};p.Gender=Oh;ue.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.PrintableString})],Oh.prototype,"value",void 0);p.Gender=Oh=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Oh);var Sl=class{constructor(e=""){this.value=e}toString(){return this.value}};p.CountryOfCitizenship=Sl;ue.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.PrintableString})],Sl.prototype,"value",void 0);p.CountryOfCitizenship=Sl=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Sl);var s0=class extends Sl{};p.CountryOfResidence=s0;p.CountryOfResidence=s0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],s0);var o0=class extends Ri.DirectoryString{};p.Pseudonym=o0;p.Pseudonym=o0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],o0);var Ih=class{constructor(e=""){this.value=e}toString(){return this.value}};p.ContentType=Ih;ue.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.ObjectIdentifier})],Ih.prototype,"value",void 0);p.ContentType=Ih=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Ih);var a0=class extends R.OctetString{};p.MessageDigest=a0;var c0=class extends Ri.Time{};p.SigningTime=c0;p.SigningTime=c0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],c0);var u0=class extends R.OctetString{};p.RandomNonce=u0;var Bh=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};p.SequenceNumber=Bh;ue.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.Integer})],Bh.prototype,"value",void 0);p.SequenceNumber=Bh=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],Bh);var l0=class extends g0.SignerInfo{};p.CounterSignature=l0;p.CounterSignature=l0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],l0);var d0=class extends Ri.DirectoryString{};p.ChallengePassword=d0;p.ChallengePassword=d0=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],d0);var f0=Jv=class extends Ri.Extensions{constructor(e){super(e),Object.setPrototypeOf(this,Jv.prototype)}};p.ExtensionRequest=f0;p.ExtensionRequest=f0=Jv=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],f0);var p0=Qv=class extends R.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Qv.prototype)}};p.ExtendedCertificateAttributes=p0;p.ExtendedCertificateAttributes=p0=Qv=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Set,itemType:g0.Attribute})],p0);var kh=class{constructor(e=""){this.value=e}toString(){return this.value}};p.FriendlyName=kh;ue.__decorate([(0,R.AsnProp)({type:R.AsnPropTypes.BmpString})],kh.prototype,"value",void 0);p.FriendlyName=kh=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Choice})],kh);var h0=class extends R.OctetString{};p.LocalKeyId=h0;var _0=class extends Ri.DirectoryString{};p.SigningDescription=_0;var jh=class extends Ri.AlgorithmIdentifier{};p.SMIMECapability=jh;p.SMIMECapability=jh=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence})],jh);var y0=Xv=class extends R.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,Xv.prototype)}};p.SMIMECapabilities=y0;p.SMIMECapabilities=y0=Xv=ue.__decorate([(0,R.AsnType)({type:R.AsnTypeTypes.Sequence,itemType:jh})],y0)});var b0=l(wl=>{"use strict";var A0;Object.defineProperty(wl,"__esModule",{value:!0});wl.Attributes=void 0;var vj=(b(),v(m)),v0=S(),mj=Q(),m0=A0=class extends v0.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,A0.prototype)}};wl.Attributes=m0;wl.Attributes=m0=A0=vj.__decorate([(0,v0.AsnType)({type:v0.AsnTypeTypes.Sequence,itemType:mj.Attribute})],m0)});var S0=l(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.CertificationRequestInfo=void 0;var Nh=(b(),v(m)),Cl=S(),Mh=Q(),iP=b0(),Vs=class{constructor(e={}){this.version=0,this.subject=new Mh.Name,this.subjectPKInfo=new Mh.SubjectPublicKeyInfo,this.attributes=new iP.Attributes,Object.assign(this,e)}};qh.CertificationRequestInfo=Vs;Nh.__decorate([(0,Cl.AsnProp)({type:Cl.AsnPropTypes.Integer})],Vs.prototype,"version",void 0);Nh.__decorate([(0,Cl.AsnProp)({type:Mh.Name})],Vs.prototype,"subject",void 0);Nh.__decorate([(0,Cl.AsnProp)({type:Mh.SubjectPublicKeyInfo})],Vs.prototype,"subjectPKInfo",void 0);Nh.__decorate([(0,Cl.AsnProp)({type:iP.Attributes,implicit:!0,context:0,optional:!0})],Vs.prototype,"attributes",void 0)});var oP=l(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.CertificationRequest=void 0;var w0=(b(),v(m)),Rh=S(),nP=S0(),sP=Q(),qa=class{constructor(e={}){this.certificationRequestInfo=new nP.CertificationRequestInfo,this.signatureAlgorithm=new sP.AlgorithmIdentifier,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};Dh.CertificationRequest=qa;w0.__decorate([(0,Rh.AsnProp)({type:nP.CertificationRequestInfo,raw:!0})],qa.prototype,"certificationRequestInfo",void 0);w0.__decorate([(0,Rh.AsnProp)({type:sP.AlgorithmIdentifier})],qa.prototype,"signatureAlgorithm",void 0);w0.__decorate([(0,Rh.AsnProp)({type:Rh.AsnPropTypes.BitString})],qa.prototype,"signature",void 0)});var aP=l(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var C0=(b(),v(m));C0.__exportStar(b0(),Pl);C0.__exportStar(oP(),Pl);C0.__exportStar(S0(),Pl)});var j0=l(B=>{"use strict";Qw();var P=S(),K=Q(),O=Ai(),E=(b(),v(m)),bj=Xu(),Xh=Vp(),jt=Qp(),be=kC(),B0=rP(),Zh=aP();function hd(r){var e=Object.create(null);return r&&Object.keys(r).forEach(function(t){if(t!=="default"){var i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:function(){return r[t]}})}}),e.default=r,Object.freeze(e)}var C=hd(K),kt=hd(bj),xe=hd(Xh),me=hd(jt),Ha=hd(B0),Ya="crypto.algorithm",e_=class{getAlgorithms(){return be.container.resolveAll(Ya)}toAsnAlgorithm(e){({...e});for(let t of this.getAlgorithms()){let i=t.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){let t=new K.AlgorithmIdentifier({algorithm:e.name});if("parameters"in e){let i=e;t.parameters=i.parameters}return t}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}}},Nr="crypto.algorithmProvider";be.container.registerSingleton(Nr,e_);var Lh,Rt="1.3.36.3.3.2.8.1.1",cP=`${Rt}.1`,uP=`${Rt}.2`,lP=`${Rt}.3`,dP=`${Rt}.4`,fP=`${Rt}.5`,pP=`${Rt}.6`,hP=`${Rt}.7`,_P=`${Rt}.8`,yP=`${Rt}.9`,gP=`${Rt}.10`,AP=`${Rt}.11`,vP=`${Rt}.12`,mP=`${Rt}.13`,bP=`${Rt}.14`,SP="brainpoolP160r1",wP="brainpoolP160t1",CP="brainpoolP192r1",PP="brainpoolP192t1",EP="brainpoolP224r1",TP="brainpoolP224t1",xP="brainpoolP256r1",OP="brainpoolP256t1",IP="brainpoolP320r1",BP="brainpoolP320t1",kP="brainpoolP384r1",jP="brainpoolP384t1",MP="brainpoolP512r1",NP="brainpoolP512t1",je="ECDSA";B.EcAlgorithm=Lh=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case je.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return xe.ecdsaWithSHA1;case"sha-256":return xe.ecdsaWithSHA256;case"sha-384":return xe.ecdsaWithSHA384;case"sha-512":return xe.ecdsaWithSHA512}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=xe.id_secp256r1;break;case"K-256":t=Lh.SECP256K1;break;case"P-384":t=xe.id_secp384r1;break;case"P-521":t=xe.id_secp521r1;break;case SP:t=cP;break;case wP:t=uP;break;case CP:t=lP;break;case PP:t=dP;break;case EP:t=fP;break;case TP:t=pP;break;case xP:t=hP;break;case OP:t=_P;break;case IP:t=yP;break;case BP:t=gP;break;case kP:t=AP;break;case jP:t=vP;break;case MP:t=mP;break;case NP:t=bP;break}if(t)return new K.AlgorithmIdentifier({algorithm:xe.id_ecPublicKey,parameters:P.AsnConvert.serialize(new xe.ECParameters({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case xe.id_ecdsaWithSHA1:return{name:je,hash:{name:"SHA-1"}};case xe.id_ecdsaWithSHA256:return{name:je,hash:{name:"SHA-256"}};case xe.id_ecdsaWithSHA384:return{name:je,hash:{name:"SHA-384"}};case xe.id_ecdsaWithSHA512:return{name:je,hash:{name:"SHA-512"}};case xe.id_ecPublicKey:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(P.AsnConvert.parse(e.parameters,xe.ECParameters).namedCurve){case xe.id_secp256r1:return{name:je,namedCurve:"P-256"};case Lh.SECP256K1:return{name:je,namedCurve:"K-256"};case xe.id_secp384r1:return{name:je,namedCurve:"P-384"};case xe.id_secp521r1:return{name:je,namedCurve:"P-521"};case cP:return{name:je,namedCurve:SP};case uP:return{name:je,namedCurve:wP};case lP:return{name:je,namedCurve:CP};case dP:return{name:je,namedCurve:PP};case fP:return{name:je,namedCurve:EP};case pP:return{name:je,namedCurve:TP};case hP:return{name:je,namedCurve:xP};case _P:return{name:je,namedCurve:OP};case yP:return{name:je,namedCurve:IP};case gP:return{name:je,namedCurve:BP};case AP:return{name:je,namedCurve:kP};case vP:return{name:je,namedCurve:jP};case mP:return{name:je,namedCurve:MP};case bP:return{name:je,namedCurve:NP}}}}return null}};B.EcAlgorithm.SECP256K1="1.3.132.0.10";B.EcAlgorithm=Lh=E.__decorate([be.injectable()],B.EcAlgorithm);be.container.registerSingleton(Ya,B.EcAlgorithm);var LP=Symbol("name"),VP=Symbol("value"),X=class{constructor(e,t={},i=""){this[LP]=e,this[VP]=i;for(let n in t)this[n]=t[n]}};X.NAME=LP;X.VALUE=VP;var t_=class{static toTextObject(e){let t=new X("Algorithm Identifier",{},dr.toString(e.algorithm));if(e.parameters)if(e.algorithm===xe.id_ecPublicKey){let i=new B.EcAlgorithm().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters}else t.Parameters=e.parameters;return t}},dr=class{static toString(e){let t=this.items[e];return t||e}};dr.items={[me.id_sha1]:"sha1",[me.id_sha224]:"sha224",[me.id_sha256]:"sha256",[me.id_sha384]:"sha384",[me.id_sha512]:"sha512",[me.id_rsaEncryption]:"rsaEncryption",[me.id_sha1WithRSAEncryption]:"sha1WithRSAEncryption",[me.id_sha224WithRSAEncryption]:"sha224WithRSAEncryption",[me.id_sha256WithRSAEncryption]:"sha256WithRSAEncryption",[me.id_sha384WithRSAEncryption]:"sha384WithRSAEncryption",[me.id_sha512WithRSAEncryption]:"sha512WithRSAEncryption",[xe.id_ecPublicKey]:"ecPublicKey",[xe.id_ecdsaWithSHA1]:"ecdsaWithSHA1",[xe.id_ecdsaWithSHA224]:"ecdsaWithSHA224",[xe.id_ecdsaWithSHA256]:"ecdsaWithSHA256",[xe.id_ecdsaWithSHA384]:"ecdsaWithSHA384",[xe.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",[kt.id_signedData]:"Signed Data"};var qr=class{static serialize(e){return this.serializeObj(e).join(`
|
|
15
|
-
|
|
16
|
-
`
|
|
17
|
-
`)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:O.BufferSourceConverter.toArrayBuffer(e)})}}static encodeStruct(e){var t;let i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((t=e.headers)===null||t===void 0)&&t.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(`
|
|
18
|
-
`)}};st.CertificateTag="CERTIFICATE";st.CrlTag="CRL";st.CertificateRequestTag="CERTIFICATE REQUEST";st.PublicKeyTag="PUBLIC KEY";st.PrivateKeyTag="PRIVATE KEY";var qt=class r extends ui{static isAsnEncoded(e){return O.BufferSourceConverter.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(st.isPem(e))return st.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 t=O.BufferSourceConverter.toUint8Array(e);if(t.length>0&&t[0]===48)return O.BufferSourceConverter.toArrayBuffer(e);let i=O.Convert.ToBinary(e);if(st.isPem(i))return st.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){r.isAsnEncoded(e[0])?super(r.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){return e==="pem"?st.encode(this.rawData,this.tag):super.toString(e)}},Mr=class r extends qt{static async create(e,t=Oe.get()){if(e instanceof r)return e;if(Fa.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");let i=await t.subtle.exportKey("spki",e);return new r(i)}else{if(e.publicKey)return e.publicKey;if(O.BufferSourceConverter.isBufferSource(e))return new r(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){qt.isAsnEncoded(e)?super(e,K.SubjectPublicKeyInfo):super(e),this.tag=st.PublicKeyTag}async export(...e){let t,i=["verify"],n={hash:"SHA-256",...this.algorithm};e.length>1?(n=e[0]||n,i=e[1]||i,t=e[2]||Oe.get()):t=e[0]||Oe.get();let s=this.rawData,o=P.AsnConvert.parse(this.rawData,K.SubjectPublicKeyInfo);return o.algorithm.algorithm===jt.id_RSASSA_PSS&&(s=Mj(o,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){let t=be.container.resolve(Nr),i=this.algorithm=t.toWebAlgorithm(e.algorithm);if(e.algorithm.algorithm===jt.id_rsaEncryption){let n=P.AsnConvert.parse(e.subjectPublicKey,jt.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 t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||Oe.get()):i=e[0]||Oe.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(...e){let t,i="SHA-1";e.length===1?typeof e[0]=="string"?(i=e[0],t=Oe.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Oe.get();let n=P.AsnConvert.parse(this.rawData,K.SubjectPublicKeyInfo);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){let e=this.toTextObjectEmpty(),t=P.AsnConvert.parse(this.rawData,K.SubjectPublicKeyInfo);switch(e.Algorithm=qr.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case Xh.id_ecPublicKey:e["EC Point"]=t.subjectPublicKey;break;case jt.id_rsaEncryption:default:e["Raw Data"]=t.subjectPublicKey}return e}};function Mj(r,e){return r.algorithm=new K.AlgorithmIdentifier({algorithm:jt.id_rsaEncryption,parameters:null}),e=P.AsnConvert.serialize(r),e}var rd=class r extends Mt{static async create(e,t=!1,i=Oe.get()){if("name"in e&&"serialNumber"in e)return new r(e,t);let s=await(await Mr.create(e,i)).getKeyIdentifier(i);return new r(O.Convert.ToHex(s),t)}constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){let t=new C.AuthorityKeyIdentifier({keyIdentifier:new C.KeyIdentifier(O.Convert.FromHex(e[0]))});super(C.id_ce_authorityKeyIdentifier,e[1],P.AsnConvert.serialize(t))}else{let t=e[0],i=t.name instanceof li?P.AsnConvert.parse(t.name.rawData,C.GeneralNames):t.name,n=new C.AuthorityKeyIdentifier({authorityCertIssuer:i,authorityCertSerialNumber:O.Convert.FromHex(t.serialNumber)});super(C.id_ce_authorityKeyIdentifier,e[1],P.AsnConvert.serialize(n))}}onInit(e){super.onInit(e);let t=P.AsnConvert.parse(e.extnValue,C.AuthorityKeyIdentifier);t.keyIdentifier&&(this.keyId=O.Convert.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?O.Convert.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){let e=this.toTextObjectWithoutValue(),t=P.AsnConvert.parse(this.value,C.AuthorityKeyIdentifier);return t.authorityCertIssuer&&(e["Authority Issuer"]=new li(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}};rd.NAME="Authority Key Identifier";var id=class extends Mt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=P.AsnConvert.parse(this.value,K.BasicConstraints);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{let t=new K.BasicConstraints({cA:e[0],pathLenConstraint:e[1]});super(K.id_ce_basicConstraints,e[2],P.AsnConvert.serialize(t)),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}};id.NAME="Basic Constraints";B.ExtendedKeyUsage=void 0;(function(r){r.serverAuth="1.3.6.1.5.5.7.3.1",r.clientAuth="1.3.6.1.5.5.7.3.2",r.codeSigning="1.3.6.1.5.5.7.3.3",r.emailProtection="1.3.6.1.5.5.7.3.4",r.timeStamping="1.3.6.1.5.5.7.3.8",r.ocspSigning="1.3.6.1.5.5.7.3.9"})(B.ExtendedKeyUsage||(B.ExtendedKeyUsage={}));var nd=class extends Mt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=P.AsnConvert.parse(this.value,C.ExtendedKeyUsage);this.usages=t.map(i=>i)}else{let t=new C.ExtendedKeyUsage(e[0]);super(C.id_ce_extKeyUsage,e[1],P.AsnConvert.serialize(t)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>dr.toString(t)).join(", "),e}};nd.NAME="Extended Key Usages";B.KeyUsageFlags=void 0;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(B.KeyUsageFlags||(B.KeyUsageFlags={}));var sd=class extends Mt{constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=P.AsnConvert.parse(this.value,K.KeyUsage);this.usages=t.toNumber()}else{let t=new K.KeyUsage(e[0]);super(K.id_ce_keyUsage,e[1],P.AsnConvert.serialize(t)),this.usages=e[0]}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=P.AsnConvert.parse(this.value,K.KeyUsage);return e[""]=t.toJSON().join(", "),e}};sd.NAME="Key Usages";var od=class r extends Mt{static async create(e,t=!1,i=Oe.get()){let s=await(await Mr.create(e,i)).getKeyIdentifier(i);return new r(O.Convert.ToHex(s),t)}constructor(...e){if(O.BufferSourceConverter.isBufferSource(e[0])){super(e[0]);let t=P.AsnConvert.parse(this.value,C.SubjectKeyIdentifier);this.keyId=O.Convert.ToHex(t)}else{let t=typeof e[0]=="string"?O.Convert.FromHex(e[0]):e[0],i=new C.SubjectKeyIdentifier(t);super(C.id_ce_subjectKeyIdentifier,e[1],P.AsnConvert.serialize(i)),this.keyId=O.Convert.ToHex(t)}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=P.AsnConvert.parse(this.value,C.SubjectKeyIdentifier);return e[""]=t,e}};od.NAME="Subject Key Identifier";var ad=class extends Mt{constructor(...e){O.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(C.id_ce_subjectAltName,e[1],new li(e[0]||[]).rawData)}onInit(e){super.onInit(e);let t=P.AsnConvert.parse(e.extnValue,C.SubjectAlternativeName);this.names=new li(t)}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(let i in t)e[i]=t[i];return e}};ad.NAME="Subject Alternative Name";var ot=class{static register(e,t){this.items.set(e,t)}static create(e){let t=new Mt(e),i=this.items.get(t.type);return i?new i(e):t}};ot.items=new Map;var cd=class extends Mt{constructor(...e){var t;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=(t=e[1])!==null&&t!==void 0?t:!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(t=>new X("",{},dr.toString(t))),e}};cd.NAME="Certificate Policies";ot.register(C.id_ce_certificatePolicies,cd);var ud=class extends Mt{constructor(...e){var t;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))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);let t=P.AsnConvert.parse(e.extnValue,C.CRLDistributionPoints);this.distributionPoints=t}toTextObject(){let e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(t=>{var i;let n={};return t.distributionPoint&&(n[""]=(i=t.distributionPoint.fullName)===null||i===void 0?void 0:i.map(s=>new jr(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}};ud.NAME="CRL Distribution Points";var ld=class extends Mt{constructor(...e){var t,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;Kh(a,o,C.id_ad_ocsp,"ocsp"),Kh(a,o,C.id_ad_caIssuers,"caIssuers"),Kh(a,o,C.id_ad_timeStamping,"timeStamping"),Kh(a,o,C.id_ad_caRepository,"caRepository"),super(C.id_pe_authorityInfoAccess,e[1],P.AsnConvert.serialize(a))}(t=this.ocsp)!==null&&t!==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 jr(i.accessLocation));break;case C.id_ad_caIssuers:this.caIssuers.push(new jr(i.accessLocation));break;case C.id_ad_timeStamping:this.timeStamping.push(new jr(i.accessLocation));break;case C.id_ad_caRepository:this.caRepository.push(new jr(i.accessLocation));break}})}toTextObject(){let e=this.toTextObjectWithoutValue();return this.ocsp.length&&Uh(e,"OCSP",this.ocsp),this.caIssuers.length&&Uh(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&Uh(e,"Time Stamping",this.timeStamping),this.caRepository.length&&Uh(e,"CA Repository",this.caRepository),e}};ld.NAME="Authority Info Access";function Uh(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{let i=new X("");t.forEach((n,s)=>{let o=n.toTextObject(),a=`${o[X.NAME]} ${s+1}`,c=i[a];Array.isArray(c)||(c=[],i[a]=c),c.push(o)}),r[e]=i}}function Kh(r,e,t,i){let n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(o=>{typeof o=="string"&&(o=new jr("url",o)),r.push(new C.AccessDescription({accessMethod:t,accessLocation:P.AsnConvert.parse(o.rawData,C.GeneralName)}))})}var dd=class extends Mt{constructor(...e){O.BufferSourceConverter.isBufferSource(e[0])?super(e[0]):super(C.id_ce_issuerAltName,e[1],new li(e[0]||[]).rawData)}onInit(e){super.onInit(e);let t=P.AsnConvert.parse(e.extnValue,C.GeneralNames);this.names=new li(t)}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(let i in t)e[i]=t[i];return e}};dd.NAME="Issuer Alternative Name";var Gs=class r extends ui{constructor(...e){let t;if(O.BufferSourceConverter.isBufferSource(e[0]))t=O.BufferSourceConverter.toArrayBuffer(e[0]);else{let i=e[0],n=Array.isArray(e[1])?e[1].map(s=>O.BufferSourceConverter.toArrayBuffer(s)):[];t=P.AsnConvert.serialize(new K.Attribute({type:i,values:n}))}super(t,K.Attribute)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){let e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new X("",{"":t})),e}toTextObjectWithoutValue(){let e=this.toTextObjectEmpty();return e[X.NAME]===r.NAME&&(e[X.NAME]=dr.toString(this.type)),e}};Gs.NAME="Attribute";var fd=class extends Gs{constructor(...e){var t;if(O.BufferSourceConverter.isBufferSource(e[0]))super(e[0]);else{let i=new Ha.ChallengePassword({printableString:e[0]});super(Ha.id_pkcs9_at_challengePassword,[P.AsnConvert.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){let t=P.AsnConvert.parse(this.values[0],Ha.ChallengePassword);this.password=t.toString()}}toTextObject(){let e=this.toTextObjectWithoutValue();return e[X.VALUE]=this.password,e}};fd.NAME="Challenge Password";var $a=class extends Gs{constructor(...e){var t;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(Ha.id_pkcs9_at_extensionRequest,[P.AsnConvert.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){let t=P.AsnConvert.parse(this.values[0],C.Extensions);this.items=t.map(i=>ot.create(P.AsnConvert.serialize(i)))}}toTextObject(){let e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(let i of t)e[i[X.NAME]]=i;return e}};$a.NAME="Extensions";var Hs=class{static register(e,t){this.items.set(e,t)}static create(e){let t=new Gs(e),i=this.items.get(t.type);return i?new i(e):t}};Hs.items=new Map;var Di="crypto.signatureFormatter",r_=class{toAsnSignature(e,t){return O.BufferSourceConverter.toArrayBuffer(t)}toWebSignature(e,t){return O.BufferSourceConverter.toArrayBuffer(t)}},Yh;B.RsaAlgorithm=Yh=class{static createPssParams(e,t){let i=Yh.getHashAlgorithm(e);return i?new me.RsaSaPssParams({hashAlgorithm:i,maskGenAlgorithm:new K.AlgorithmIdentifier({algorithm:me.id_mgf1,parameters:P.AsnConvert.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){let t=be.container.resolve(Nr);return typeof e=="string"?t.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?t.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let t;if(typeof e.hash=="string")t=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")t=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(t.toLowerCase()){case"sha-1":return new K.AlgorithmIdentifier({algorithm:me.id_sha1WithRSAEncryption,parameters:null});case"sha-256":return new K.AlgorithmIdentifier({algorithm:me.id_sha256WithRSAEncryption,parameters:null});case"sha-384":return new K.AlgorithmIdentifier({algorithm:me.id_sha384WithRSAEncryption,parameters:null});case"sha-512":return new K.AlgorithmIdentifier({algorithm:me.id_sha512WithRSAEncryption,parameters:null})}}else return new K.AlgorithmIdentifier({algorithm:me.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 t=Yh.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new K.AlgorithmIdentifier({algorithm:me.id_RSASSA_PSS,parameters:P.AsnConvert.serialize(t)})}else return new K.AlgorithmIdentifier({algorithm:me.id_RSASSA_PSS,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case me.id_rsaEncryption:return{name:"RSASSA-PKCS1-v1_5"};case me.id_sha1WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case me.id_sha256WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case me.id_sha384WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case me.id_sha512WithRSAEncryption:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case me.id_RSASSA_PSS:if(e.parameters){let t=P.AsnConvert.parse(e.parameters,me.RsaSaPssParams);return{name:"RSA-PSS",hash:be.container.resolve(Nr).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};B.RsaAlgorithm=Yh=E.__decorate([be.injectable()],B.RsaAlgorithm);be.container.registerSingleton(Ya,B.RsaAlgorithm);B.ShaAlgorithm=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new K.AlgorithmIdentifier({algorithm:jt.id_sha1});case"sha-256":return new K.AlgorithmIdentifier({algorithm:jt.id_sha256});case"sha-384":return new K.AlgorithmIdentifier({algorithm:jt.id_sha384});case"sha-512":return new K.AlgorithmIdentifier({algorithm:jt.id_sha512})}return null}toWebAlgorithm(e){switch(e.algorithm){case jt.id_sha1:return{name:"SHA-1"};case jt.id_sha256:return{name:"SHA-256"};case jt.id_sha384:return{name:"SHA-384"};case jt.id_sha512:return{name:"SHA-512"}}return null}};B.ShaAlgorithm=E.__decorate([be.injectable()],B.ShaAlgorithm);be.container.registerSingleton(Ya,B.ShaAlgorithm);var di=class r{addPadding(e,t){let i=O.BufferSourceConverter.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n.buffer}removePadding(e,t=!1){let i=O.BufferSourceConverter.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(t&&i[0]>127){let n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){let i=e.namedCurve,n=r.namedCurveSize.get(i)||r.defaultNamedCurveSize,s=new Xh.ECDSASigValue,o=O.BufferSourceConverter.toUint8Array(t);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,t){if(e.name==="ECDSA"){let i=P.AsnConvert.parse(t,Xh.ECDSASigValue),n=e.namedCurve,s=r.namedCurveSize.get(n)||r.defaultNamedCurveSize,o=this.addPadding(s,this.removePadding(i.r)),a=this.addPadding(s,this.removePadding(i.s));return O.combine(o,a)}return null}};di.namedCurveSize=new Map;di.defaultNamedCurveSize=32;var Jh="1.3.101.110",P0="1.3.101.111",Qh="1.3.101.112",E0="1.3.101.113";B.EdAlgorithm=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=Qh;break;case"x25519":t=Jh;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=Qh;break;case"ed448":t=E0;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=Jh;break;case"x448":t=P0;break}}return t?new K.AlgorithmIdentifier({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case Qh:return{name:"Ed25519"};case E0:return{name:"EdDSA",namedCurve:"Ed448"};case Jh:return{name:"X25519"};case P0:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};B.EdAlgorithm=E.__decorate([be.injectable()],B.EdAlgorithm);be.container.registerSingleton(Ya,B.EdAlgorithm);var Tl,xl,Ol,Il,Bl,kl,jl,Da,pd=class extends qt{get subjectName(){return E.__classPrivateFieldGet(this,xl,"f")||E.__classPrivateFieldSet(this,xl,new et(this.asn.certificationRequestInfo.subject),"f"),E.__classPrivateFieldGet(this,xl,"f")}get subject(){return E.__classPrivateFieldGet(this,Ol,"f")||E.__classPrivateFieldSet(this,Ol,this.subjectName.toString(),"f"),E.__classPrivateFieldGet(this,Ol,"f")}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,Il,"f")){let e=be.container.resolve(Nr);E.__classPrivateFieldSet(this,Il,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,Il,"f")}get signature(){return E.__classPrivateFieldGet(this,Bl,"f")||E.__classPrivateFieldSet(this,Bl,this.asn.signature,"f"),E.__classPrivateFieldGet(this,Bl,"f")}get publicKey(){return E.__classPrivateFieldGet(this,kl,"f")||E.__classPrivateFieldSet(this,kl,new Mr(this.asn.certificationRequestInfo.subjectPKInfo),"f"),E.__classPrivateFieldGet(this,kl,"f")}get attributes(){return E.__classPrivateFieldGet(this,jl,"f")||E.__classPrivateFieldSet(this,jl,this.asn.certificationRequestInfo.attributes.map(e=>Hs.create(P.AsnConvert.serialize(e))),"f"),E.__classPrivateFieldGet(this,jl,"f")}get extensions(){if(!E.__classPrivateFieldGet(this,Da,"f")){E.__classPrivateFieldSet(this,Da,[],"f");let e=this.getAttribute(B0.id_pkcs9_at_extensionRequest);e instanceof $a&&E.__classPrivateFieldSet(this,Da,e.items,"f")}return E.__classPrivateFieldGet(this,Da,"f")}get tbs(){return E.__classPrivateFieldGet(this,Tl,"f")||E.__classPrivateFieldSet(this,Tl,this.asn.certificationRequestInfoRaw||P.AsnConvert.serialize(this.asn.certificationRequestInfo),"f"),E.__classPrivateFieldGet(this,Tl,"f")}constructor(e){let t=qt.isAsnEncoded(e)?[e,Zh.CertificationRequest]:[e];super(t[0],t[1]),Tl.set(this,void 0),xl.set(this,void 0),Ol.set(this,void 0),Il.set(this,void 0),Bl.set(this,void 0),kl.set(this,void 0),jl.set(this,void 0),Da.set(this,void 0),this.tag=st.CertificateRequestTag}onInit(e){}getAttribute(e){for(let t of this.attributes)if(t.type===e)return t;return null}getAttributes(e){return this.attributes.filter(t=>t.type===e)}getExtension(e){for(let t of this.extensions)if(t.type===e)return t;return null}getExtensions(e){return this.extensions.filter(t=>t.type===e)}async verify(e=Oe.get()){let t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=be.container.resolveAll(Di).reverse(),s=null;for(let a of n)if(s=a.toWebSignature(t,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(),t=P.AsnConvert.parse(this.rawData,Zh.CertificationRequest),i=t.certificationRequestInfo,n=new X("",{Version:`${K.Version[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){let s=new X("");for(let o of this.attributes){let a=o.toTextObject();s[a[X.NAME]]=a}n.Attributes=s}return e.Data=n,e.Signature=new X("",{Algorithm:qr.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}};Tl=new WeakMap,xl=new WeakMap,Ol=new WeakMap,Il=new WeakMap,Bl=new WeakMap,kl=new WeakMap,jl=new WeakMap,Da=new WeakMap;pd.NAME="PKCS#10 Certificate Request";var T0=class{static async create(e,t=Oe.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 t.subtle.exportKey("spki",e.keys.publicKey),n=new Zh.CertificationRequest({certificationRequestInfo:new Zh.CertificationRequestInfo({subjectPKInfo:P.AsnConvert.parse(i,K.SubjectPublicKeyInfo)})});if(e.name){let f=e.name instanceof et?e.name:new et(e.name);n.certificationRequestInfo.subject=P.AsnConvert.parse(f.toArrayBuffer(),K.Name)}if(e.attributes)for(let f of e.attributes)n.certificationRequestInfo.attributes.push(P.AsnConvert.parse(f.rawData,K.Attribute));if(e.extensions&&e.extensions.length){let f=new K.Attribute({type:B0.id_pkcs9_at_extensionRequest}),_=new K.Extensions;for(let g of e.extensions)_.push(P.AsnConvert.parse(g.rawData,K.Extension));f.values.push(P.AsnConvert.serialize(_)),n.certificationRequestInfo.attributes.push(f)}let s={...e.signingAlgorithm,...e.keys.privateKey.algorithm},o=be.container.resolve(Nr);n.signatureAlgorithm=o.toAsnAlgorithm(s);let a=P.AsnConvert.serialize(n.certificationRequestInfo),c=await t.subtle.sign(s,e.keys.privateKey,a),u=be.container.resolveAll(Di).reverse(),d=null;for(let f of u)if(d=f.toAsnSignature(s,c),d)break;if(!d)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return n.signature=d,new pd(P.AsnConvert.serialize(n))}},Ml,Nl,ql,Rl,Dl,Ul,Kl,Ll,Vl,Gl,Ua,Hl,_n=class extends qt{get publicKey(){return E.__classPrivateFieldGet(this,Hl,"f")||E.__classPrivateFieldSet(this,Hl,new Mr(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),E.__classPrivateFieldGet(this,Hl,"f")}get serialNumber(){if(!E.__classPrivateFieldGet(this,Nl,"f")){let e=this.asn.tbsCertificate,t=new Uint8Array(e.serialNumber);t.length>1&&t[0]===0&&t[1]>127&&(t=t.slice(1)),E.__classPrivateFieldSet(this,Nl,O.Convert.ToHex(t),"f")}return E.__classPrivateFieldGet(this,Nl,"f")}get subjectName(){return E.__classPrivateFieldGet(this,ql,"f")||E.__classPrivateFieldSet(this,ql,new et(this.asn.tbsCertificate.subject),"f"),E.__classPrivateFieldGet(this,ql,"f")}get subject(){return E.__classPrivateFieldGet(this,Rl,"f")||E.__classPrivateFieldSet(this,Rl,this.subjectName.toString(),"f"),E.__classPrivateFieldGet(this,Rl,"f")}get issuerName(){return E.__classPrivateFieldGet(this,Dl,"f")||E.__classPrivateFieldSet(this,Dl,new et(this.asn.tbsCertificate.issuer),"f"),E.__classPrivateFieldGet(this,Dl,"f")}get issuer(){return E.__classPrivateFieldGet(this,Ul,"f")||E.__classPrivateFieldSet(this,Ul,this.issuerName.toString(),"f"),E.__classPrivateFieldGet(this,Ul,"f")}get notBefore(){if(!E.__classPrivateFieldGet(this,Kl,"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,Kl,e,"f")}return E.__classPrivateFieldGet(this,Kl,"f")}get notAfter(){if(!E.__classPrivateFieldGet(this,Ll,"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,Ll,e,"f")}return E.__classPrivateFieldGet(this,Ll,"f")}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,Vl,"f")){let e=be.container.resolve(Nr);E.__classPrivateFieldSet(this,Vl,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,Vl,"f")}get signature(){return E.__classPrivateFieldGet(this,Gl,"f")||E.__classPrivateFieldSet(this,Gl,this.asn.signatureValue,"f"),E.__classPrivateFieldGet(this,Gl,"f")}get extensions(){return E.__classPrivateFieldGet(this,Ua,"f")||(E.__classPrivateFieldSet(this,Ua,[],"f"),this.asn.tbsCertificate.extensions&&E.__classPrivateFieldSet(this,Ua,this.asn.tbsCertificate.extensions.map(e=>ot.create(P.AsnConvert.serialize(e))),"f")),E.__classPrivateFieldGet(this,Ua,"f")}get tbs(){return E.__classPrivateFieldGet(this,Ml,"f")||E.__classPrivateFieldSet(this,Ml,this.asn.tbsCertificateRaw||P.AsnConvert.serialize(this.asn.tbsCertificate),"f"),E.__classPrivateFieldGet(this,Ml,"f")}constructor(e){let t=qt.isAsnEncoded(e)?[e,K.Certificate]:[e];super(t[0],t[1]),Ml.set(this,void 0),Nl.set(this,void 0),ql.set(this,void 0),Rl.set(this,void 0),Dl.set(this,void 0),Ul.set(this,void 0),Kl.set(this,void 0),Ll.set(this,void 0),Vl.set(this,void 0),Gl.set(this,void 0),Ua.set(this,void 0),Hl.set(this,void 0),this.tag=st.CertificateTag}onInit(e){}getExtension(e){for(let t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e={},t=Oe.get()){let i,n,s=e.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],t);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],t);else if(s instanceof Mr)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(O.BufferSourceConverter.isBufferSource(s)){let u=new Mr(s);i={...u.algorithm,...this.signatureAlgorithm},n=await u.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}let o=be.container.resolveAll(Di).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 t.subtle.verify(this.signatureAlgorithm,n,a,this.tbs);if(e.signatureOnly)return c;{let d=(e.date||new Date).getTime();return c&&this.notBefore.getTime()<d&&d<this.notAfter.getTime()}}async getThumbprint(...e){let t,i="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(i=e[0]||i,t=e[1])),t??(t=Oe.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Oe.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){let e=this.toTextObjectEmpty(),t=P.AsnConvert.parse(this.rawData,K.Certificate),i=t.tbsCertificate,n=new X("",{Version:`${K.Version[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":qr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new X("",{"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 X("");for(let o of this.extensions){let a=o.toTextObject();s[a[X.NAME]]=a}n.Extensions=s}return e.Data=n,e.Signature=new X("",{Algorithm:qr.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}};Ml=new WeakMap,Nl=new WeakMap,ql=new WeakMap,Rl=new WeakMap,Dl=new WeakMap,Ul=new WeakMap,Kl=new WeakMap,Ll=new WeakMap,Vl=new WeakMap,Gl=new WeakMap,Ua=new WeakMap,Hl=new WeakMap;_n.NAME="Certificate";var i_=class extends Array{constructor(e){if(super(),qt.isAsnEncoded(e))this.import(e);else if(e instanceof _n)this.push(e);else if(Array.isArray(e))for(let t of e)this.push(t)}export(e){let t=new kt.SignedData;t.version=1,t.encapContentInfo.eContentType=kt.id_data,t.encapContentInfo.eContent=new kt.EncapsulatedContent({single:new P.OctetString}),t.certificates=new kt.CertificateSet(this.map(s=>new kt.CertificateChoices({certificate:P.AsnConvert.parse(s.rawData,K.Certificate)})));let i=new kt.ContentInfo({contentType:kt.id_signedData,content:P.AsnConvert.serialize(t)}),n=P.AsnConvert.serialize(i);return e==="raw"?n:this.toString(e)}import(e){let t=qt.toArrayBuffer(e),i=P.AsnConvert.parse(t,kt.ContentInfo);if(i.contentType!==kt.id_signedData)throw new TypeError("Cannot parse CMS package. Incoming data is not a SignedData object.");let n=P.AsnConvert.parse(i.content,kt.SignedData);this.clear();for(let s of n.certificates||[])s.certificate&&this.push(new _n(s.certificate))}clear(){for(;this.pop(););}toString(e="pem"){let t=this.export("raw");switch(e){case"pem":return st.encode(t,"CMS");case"pem-chain":return this.map(i=>i.toString("pem")).join(`
|
|
19
|
-
`);case"asn":return P.AsnConvert.toString(t);case"hex":return O.Convert.ToHex(t);case"base64":return O.Convert.ToBase64(t);case"base64url":return O.Convert.ToBase64Url(t);case"text":return qr.serialize(this.toTextObject());default:throw TypeError("Argument 'format' is unsupported value")}}toTextObject(){let e=P.AsnConvert.parse(this.export("raw"),kt.ContentInfo),t=P.AsnConvert.parse(e.content,kt.SignedData);return new X("X509Certificates",{"Content Type":dr.toString(e.contentType),Content:new X("",{Version:`${kt.CMSVersion[t.version]} (${t.version})`,Certificates:new X("",{Certificate:this.map(n=>n.toTextObject())})})})}},x0=class{constructor(e={}){this.certificates=[],e.certificates&&(this.certificates=e.certificates)}async build(e,t=Oe.get()){let i=new i_(e),n=e;for(;n=await this.findIssuer(n,t);){let s=await n.getThumbprint(t);for(let o of i){let a=await o.getThumbprint(t);if(O.isEqual(s,a))throw new Error("Cannot build a certificate chain. Circular dependency.")}i.push(n)}return i}async findIssuer(e,t=Oe.get()){if(!await e.isSelfSigned(t)){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"],t);if(!await e.verify({publicKey:o,signatureOnly:!0},t))continue}catch{continue}return n}}return null}};function k0(r,e=Oe.get()){let t=O.BufferSourceConverter.toUint8Array(O.Convert.FromHex(r||"")),i=t&&t.length&&t.some(s=>s>0)?new Uint8Array(t):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 O0=class{static async createSelfSigned(e,t=Oe.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},t)}static async create(e,t=Oe.get()){var i;let n;e.publicKey instanceof Mr?n=e.publicKey.rawData:"publicKey"in e.publicKey?n=e.publicKey.publicKey.rawData:O.BufferSourceConverter.isBufferSource(e.publicKey)?n=e.publicKey:n=await t.subtle.exportKey("spki",e.publicKey);let s=k0(e.serialNumber,t),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 et?e.subject:new et(e.subject);c.tbsCertificate.subject=P.AsnConvert.parse(I.toArrayBuffer(),C.Name)}if(e.issuer){let I=e.issuer instanceof et?e.issuer:new et(e.issuer);c.tbsCertificate.issuer=P.AsnConvert.parse(I.toArrayBuffer(),C.Name)}let u={hash:"SHA-256"},d="signingKey"in e?{...u,...e.signingAlgorithm,...e.signingKey.algorithm}:{...u,...e.signingAlgorithm},f=be.container.resolve(Nr);c.tbsCertificate.signature=c.signatureAlgorithm=f.toAsnAlgorithm(d);let _=P.AsnConvert.serialize(c.tbsCertificate),g="signingKey"in e?await t.subtle.sign(d,e.signingKey,_):e.signature,x=be.container.resolveAll(Di).reverse(),T=null;for(let I of x)if(T=I.toAsnSignature(d,g),T)break;if(!T)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return c.signatureValue=T,new _n(P.AsnConvert.serialize(c))}},Fl,Wl,Ka,La,Va;B.X509CrlReason=void 0;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(B.X509CrlReason||(B.X509CrlReason={}));var za=class extends ui{get serialNumber(){return E.__classPrivateFieldGet(this,Fl,"f")||E.__classPrivateFieldSet(this,Fl,O.Convert.ToHex(this.asn.userCertificate),"f"),E.__classPrivateFieldGet(this,Fl,"f")}get revocationDate(){return E.__classPrivateFieldGet(this,Wl,"f")||E.__classPrivateFieldSet(this,Wl,this.asn.revocationDate.getTime(),"f"),E.__classPrivateFieldGet(this,Wl,"f")}get reason(){return E.__classPrivateFieldGet(this,Ka,"f")===void 0&&this.extensions,E.__classPrivateFieldGet(this,Ka,"f")}get invalidity(){return E.__classPrivateFieldGet(this,La,"f")===void 0&&this.extensions,E.__classPrivateFieldGet(this,La,"f")}get extensions(){return E.__classPrivateFieldGet(this,Va,"f")||(E.__classPrivateFieldSet(this,Va,[],"f"),this.asn.crlEntryExtensions&&E.__classPrivateFieldSet(this,Va,this.asn.crlEntryExtensions.map(e=>{let t=ot.create(P.AsnConvert.serialize(e));switch(t.type){case K.id_ce_cRLReasons:E.__classPrivateFieldGet(this,Ka,"f")===void 0&&E.__classPrivateFieldSet(this,Ka,P.AsnConvert.parse(t.value,K.CRLReason).reason,"f");break;case K.id_ce_invalidityDate:E.__classPrivateFieldGet(this,La,"f")===void 0&&E.__classPrivateFieldSet(this,La,P.AsnConvert.parse(t.value,K.InvalidityDate).value,"f");break}return t}),"f")),E.__classPrivateFieldGet(this,Va,"f")}constructor(...e){let t;if(O.BufferSourceConverter.isBufferSource(e[0])?t=O.BufferSourceConverter.toArrayBuffer(e[0]):typeof e[0]=="string"?t=P.AsnConvert.serialize(new K.RevokedCertificate({userCertificate:k0(e[0]),revocationDate:new K.Time(e[1]),crlEntryExtensions:e[2]})):e[0]instanceof K.RevokedCertificate&&(t=e[0]),!t)throw new TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments.");super(t,K.RevokedCertificate),Fl.set(this,void 0),Wl.set(this,void 0),Ka.set(this,void 0),La.set(this,void 0),Va.set(this,void 0)}onInit(e){}};Fl=new WeakMap,Wl=new WeakMap,Ka=new WeakMap,La=new WeakMap,Va=new WeakMap;var $l,zl,Yl,Jl,Ql,Xl,Ga,n_=class extends qt{get version(){return this.asn.tbsCertList.version}get signatureAlgorithm(){if(!E.__classPrivateFieldGet(this,zl,"f")){let e=be.container.resolve(Nr);E.__classPrivateFieldSet(this,zl,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return E.__classPrivateFieldGet(this,zl,"f")}get signature(){return this.asn.signature}get issuer(){return this.issuerName.toString()}get issuerName(){return E.__classPrivateFieldGet(this,Yl,"f")||E.__classPrivateFieldSet(this,Yl,new et(this.asn.tbsCertList.issuer),"f"),E.__classPrivateFieldGet(this,Yl,"f")}get thisUpdate(){if(!E.__classPrivateFieldGet(this,Jl,"f")){let e=this.asn.tbsCertList.thisUpdate.getTime();if(!e)throw new Error("Cannot get 'thisUpdate' value");E.__classPrivateFieldSet(this,Jl,e,"f")}return E.__classPrivateFieldGet(this,Jl,"f")}get nextUpdate(){var e;return E.__classPrivateFieldGet(this,Ql,"f")===void 0&&E.__classPrivateFieldSet(this,Ql,((e=this.asn.tbsCertList.nextUpdate)===null||e===void 0?void 0:e.getTime())||void 0,"f"),E.__classPrivateFieldGet(this,Ql,"f")}get entries(){var e;return E.__classPrivateFieldGet(this,Xl,"f")||E.__classPrivateFieldSet(this,Xl,((e=this.asn.tbsCertList.revokedCertificates)===null||e===void 0?void 0:e.map(t=>new za(t)))||[],"f"),E.__classPrivateFieldGet(this,Xl,"f")}get extensions(){return E.__classPrivateFieldGet(this,Ga,"f")||(E.__classPrivateFieldSet(this,Ga,[],"f"),this.asn.tbsCertList.crlExtensions&&E.__classPrivateFieldSet(this,Ga,this.asn.tbsCertList.crlExtensions.map(e=>ot.create(P.AsnConvert.serialize(e))),"f")),E.__classPrivateFieldGet(this,Ga,"f")}get tbs(){return E.__classPrivateFieldGet(this,$l,"f")||E.__classPrivateFieldSet(this,$l,this.asn.tbsCertListRaw||P.AsnConvert.serialize(this.asn.tbsCertList),"f"),E.__classPrivateFieldGet(this,$l,"f")}get tbsCertListSignatureAlgorithm(){return this.asn.tbsCertList.signature}get certListSignatureAlgorithm(){return this.asn.signatureAlgorithm}constructor(e){super(e,qt.isAsnEncoded(e)?K.CertificateList:void 0),this.tag=st.CrlTag,$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),Xl.set(this,void 0),Ga.set(this,void 0)}onInit(e){}getExtension(e){for(let t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e,t=Oe.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 _n?(i={...s.publicKey.algorithm,...s.signatureAlgorithm},n=await s.publicKey.export(i,["verify"])):s instanceof Mr?(i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"])):(i={...s.algorithm,...this.signatureAlgorithm},n=s)}catch{return!1}let o=be.container.resolveAll(Di).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 t.subtle.verify(this.signatureAlgorithm,n,a,this.tbs)}async getThumbprint(...e){let t,i="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(i=e[0]||i,t=e[1])),t??(t=Oe.get()),await t.subtle.digest(i,this.rawData)}findRevoked(e){let t=typeof e=="string"?e:e.serialNumber,i=k0(t);for(let n of this.asn.tbsCertList.revokedCertificates||[])if(O.BufferSourceConverter.isEqual(n.userCertificate,i))return new za(P.AsnConvert.serialize(n));return null}};$l=new WeakMap,zl=new WeakMap,Yl=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,Xl=new WeakMap,Ga=new WeakMap;var I0=class{static async create(e,t=Oe.get()){var i;let n=e.issuer instanceof et?e.issuer:new et(e.issuer),s=new C.CertificateList({tbsCertList:new C.TBSCertList({version:C.Version.v2,issuer:P.AsnConvert.parse(n.toArrayBuffer(),C.Name),thisUpdate:new K.Time(e.thisUpdate||new Date)})});if(e.nextUpdate&&(s.tbsCertList.nextUpdate=new K.Time(e.nextUpdate)),e.extensions&&e.extensions.length&&(s.tbsCertList.crlExtensions=new C.Extensions(e.extensions.map(_=>P.AsnConvert.parse(_.rawData,C.Extension))||[])),e.entries&&e.entries.length){s.tbsCertList.revokedCertificates=[];for(let _ of e.entries){let g=qt.toArrayBuffer(_.serialNumber);if(s.tbsCertList.revokedCertificates.findIndex(I=>O.isEqual(I.userCertificate,g))>-1)throw new Error(`Certificate serial number ${_.serialNumber} already exists in tbsCertList`);let T=new K.RevokedCertificate({userCertificate:g,revocationDate:new K.Time(_.revocationDate||new Date)});if("extensions"in _&&(!((i=_.extensions)===null||i===void 0)&&i.length)?T.crlEntryExtensions=_.extensions.map(I=>P.AsnConvert.parse(I.rawData,C.Extension)):T.crlEntryExtensions=[],!(_ instanceof za)&&(_.reason&&T.crlEntryExtensions.push(new C.Extension({extnID:C.id_ce_cRLReasons,critical:!1,extnValue:new P.OctetString(P.AsnConvert.serialize(new C.CRLReason(_.reason)))})),_.invalidity&&T.crlEntryExtensions.push(new C.Extension({extnID:C.id_ce_invalidityDate,critical:!1,extnValue:new P.OctetString(P.AsnConvert.serialize(new C.InvalidityDate(_.invalidity)))})),_.issuer)){let I=e.issuer instanceof et?e.issuer:new et(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=be.container.resolve(Nr);s.tbsCertList.signature=s.signatureAlgorithm=a.toAsnAlgorithm(o);let c=P.AsnConvert.serialize(s.tbsCertList),u=await t.subtle.sign(o,e.signingKey,c),d=be.container.resolveAll(Di).reverse(),f=null;for(let _ of d)if(f=_.toAsnSignature(o,u),f)break;if(!f)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return s.signature=f,new n_(P.AsnConvert.serialize(s))}};ot.register(C.id_ce_basicConstraints,id);ot.register(C.id_ce_extKeyUsage,nd);ot.register(C.id_ce_keyUsage,sd);ot.register(C.id_ce_subjectKeyIdentifier,od);ot.register(C.id_ce_authorityKeyIdentifier,rd);ot.register(C.id_ce_subjectAltName,ad);ot.register(C.id_ce_cRLDistributionPoints,ud);ot.register(C.id_pe_authorityInfoAccess,ld);ot.register(C.id_ce_issuerAltName,dd);Hs.register(Ha.id_pkcs9_at_challengePassword,fd);Hs.register(Ha.id_pkcs9_at_extensionRequest,$a);be.container.registerSingleton(Di,r_);be.container.registerSingleton(Di,di);di.namedCurveSize.set("P-256",32);di.namedCurveSize.set("K-256",32);di.namedCurveSize.set("P-384",48);di.namedCurveSize.set("P-521",66);B.AlgorithmProvider=e_;B.AsnData=ui;B.AsnDefaultSignatureFormatter=r_;B.AsnEcSignatureFormatter=di;B.Attribute=Gs;B.AttributeFactory=Hs;B.AuthorityInfoAccessExtension=ld;B.AuthorityKeyIdentifierExtension=rd;B.BasicConstraintsExtension=id;B.CRLDistributionPointsExtension=ud;B.CertificatePolicyExtension=cd;B.ChallengePasswordAttribute=fd;B.CryptoProvider=Fa;B.DN=Gh;B.DNS=Vh;B.DefaultAlgorithmSerializer=t_;B.EMAIL=Hh;B.ExtendedKeyUsageExtension=nd;B.Extension=Mt;B.ExtensionFactory=ot;B.ExtensionsAttribute=$a;B.GUID=$h;B.GeneralName=jr;B.GeneralNames=li;B.IP=Fh;B.IssuerAlternativeNameExtension=dd;B.KeyUsagesExtension=sd;B.Name=et;B.NameIdentifier=ed;B.OidSerializer=dr;B.PemConverter=st;B.PemData=qt;B.Pkcs10CertificateRequest=pd;B.Pkcs10CertificateRequestGenerator=T0;B.PublicKey=Mr;B.REGISTERED_ID=El;B.SubjectAlternativeNameExtension=ad;B.SubjectKeyIdentifierExtension=od;B.TextConverter=qr;B.TextObject=X;B.UPN=zh;B.URL=Wh;B.X509Certificate=_n;B.X509CertificateGenerator=O0;B.X509Certificates=i_;B.X509ChainBuilder=x0;B.X509Crl=n_;B.X509CrlEntry=za;B.X509CrlGenerator=I0;B.cryptoProvider=Oe;B.diAlgorithm=Ya;B.diAlgorithmProvider=Nr;B.diAsnSignatureFormatter=Di;B.idEd25519=Qh;B.idEd448=E0;B.idX25519=Jh;B.idX448=P0});var M0=l(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja._fetchInternals=void 0;Ja.fetch=Nj;function Nj(r){return Ja._fetchInternals.stubThis(r)}Ja._fetchInternals={stubThis:r=>globalThis.fetch(r)}});var q0=l(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});N0.isCertRevoked=Rj;var s_=j0(),qj=M0(),FP={};async function Rj(r){let{extensions:e}=r;if(!e)return!1;let t,i,n;e.forEach(f=>{f instanceof s_.AuthorityKeyIdentifierExtension?t=f:f instanceof s_.SubjectKeyIdentifierExtension?i=f:f instanceof s_.CRLDistributionPointsExtension&&(n=f)});let s;if(t&&t.keyId?s=t.keyId:i&&(s=i.keyId),s){let f=FP[s];if(f){let _=new Date;if(!f.nextUpdate||f.nextUpdate>_)return f.revokedCerts.indexOf(r.serialNumber)>=0}}let o=n?.distributionPoints?.[0].distributionPoint?.fullName?.[0].uniformResourceIdentifier;if(!o)return!1;let a;try{a=await(await(0,qj.fetch)(o)).arrayBuffer()}catch{return!1}let c;try{c=new s_.X509Crl(a)}catch{return!1}let u={revokedCerts:[],nextUpdate:void 0};c.nextUpdate&&(u.nextUpdate=c.nextUpdate);let d=c.entries;if(d){for(let f of d){let _=f.serialNumber;u.revokedCerts.push(_)}return s&&(FP[s]=u),u.revokedCerts.indexOf(r.serialNumber)>=0}return!1}});var $P=l(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});R0.decodeAuthenticatorExtensions=Uj;var Dj=se();function Uj(r){let e;try{e=Dj.isoCBOR.decodeFirst(r)}catch(t){let i=t;throw new Error(`Error decoding authenticator extensions: ${i.message}`)}return WP(e)}function WP(r){let e={};for(let[t,i]of r)i instanceof Map?e[t]=WP(i):e[t]=i;return e}});var o_=l(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa._parseAuthenticatorDataInternals=void 0;Qa.parseAuthenticatorData=Lj;var Kj=$P(),Fs=se();function Lj(r){if(r.byteLength<37)throw new Error(`Authenticator data was ${r.byteLength} bytes, expected at least 37 bytes`);let e=0,t=Fs.isoUint8Array.toDataView(r),i=r.slice(e,e+=32),n=r.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=r.slice(e,e+4),c=t.getUint32(e,!1);e+=4;let u,d,f;if(o.at){u=r.slice(e,e+=16);let x=t.getUint16(e);e+=2,d=r.slice(e,e+=x);let T=Fs.isoUint8Array.fromHex("a301634f4b500327206745643235353139"),I=r.slice(e,e+T.byteLength),U=!1;Fs.isoUint8Array.areEqual(T,I)&&(U=!0,r[e]=164);let Z=Fs.isoCBOR.decodeFirst(r.slice(e)),fe=Uint8Array.from(Fs.isoCBOR.encode(Z));U&&(r[e]=163),f=fe,e+=fe.byteLength}let _,g;if(o.ed){let x=Fs.isoCBOR.decodeFirst(r.slice(e));g=Uint8Array.from(Fs.isoCBOR.encode(x)),_=(0,Kj.decodeAuthenticatorExtensions)(g),e+=g.byteLength}if(r.byteLength>e)throw new Error("Leftover bytes detected while parsing authenticator data");return Qa._parseAuthenticatorDataInternals.stubThis({rpIdHash:i,flagsBuf:n,flags:o,counter:c,counterBuf:a,aaguid:u,credentialID:d,credentialPublicKey:f,extensionsData:_,extensionsDataBuffer:g})}Qa._parseAuthenticatorDataInternals={stubThis:r=>r}});var yn=l(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});D0.toHash=Vj;var zP=se();function Vj(r,e=-7){return typeof r=="string"&&(r=zP.isoUint8Array.fromUTF8String(r)),zP.isoCrypto.digest(r,e)}});var fi=l(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.validateCertificatePath=Fj;var YP=j0(),Gj=q0(),Hj=Hi();async function Fj(r,e=[]){if(e.length===0)return!0;let t=await(0,Hj.getWebCrypto)(),i=r.map(a=>new YP.X509Certificate(a));for(let a=0;a<i.length;a++){let c=i[a],u=r[a];try{await JP(c)}catch{throw new Error(`Found revoked certificate in x5c:
|
|
20
|
-
${u}`)}
|
|
21
|
-
${
|
|
22
|
-
|
|
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=[" "," ",`
|
|
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
|
+
`?`\r
|
|
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(`
|
|
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(`
|
|
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-----
|
|
23
26
|
MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
|
|
24
27
|
A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
|
|
25
28
|
b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
|
|
@@ -40,7 +43,7 @@ AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
|
|
|
40
43
|
DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
|
|
41
44
|
HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
|
|
42
45
|
-----END CERTIFICATE-----
|
|
43
|
-
`});var
|
|
46
|
+
`});var qT=l(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.Google_Hardware_Attestation_Root_4=Si.Google_Hardware_Attestation_Root_3=Si.Google_Hardware_Attestation_Root_2=Si.Google_Hardware_Attestation_Root_1=void 0;Si.Google_Hardware_Attestation_Root_1=`-----BEGIN CERTIFICATE-----
|
|
44
47
|
MIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
|
|
45
48
|
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy
|
|
46
49
|
ODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
|
|
@@ -71,7 +74,7 @@ qwLqRBYkA3I75qppLGG9rp7UCdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic
|
|
|
71
74
|
MDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1
|
|
72
75
|
wDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk
|
|
73
76
|
-----END CERTIFICATE-----
|
|
74
|
-
`;
|
|
77
|
+
`;Si.Google_Hardware_Attestation_Root_2=`-----BEGIN CERTIFICATE-----
|
|
75
78
|
MIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
|
|
76
79
|
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz
|
|
77
80
|
NzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B
|
|
@@ -101,7 +104,7 @@ jm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB
|
|
|
101
104
|
ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH
|
|
102
105
|
ex0SdDrx+tWUDqG8At2JHA==
|
|
103
106
|
-----END CERTIFICATE-----
|
|
104
|
-
`;
|
|
107
|
+
`;Si.Google_Hardware_Attestation_Root_3=`
|
|
105
108
|
-----BEGIN CERTIFICATE-----
|
|
106
109
|
MIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
|
|
107
110
|
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx
|
|
@@ -132,7 +135,7 @@ lZKwdH+aNAyhbXRW9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2
|
|
|
132
135
|
Ob3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7
|
|
133
136
|
mD/vFDkzF+wm7cyWpQpCVQ==
|
|
134
137
|
-----END CERTIFICATE-----
|
|
135
|
-
`;
|
|
138
|
+
`;Si.Google_Hardware_Attestation_Root_4=`
|
|
136
139
|
-----BEGIN CERTIFICATE-----
|
|
137
140
|
MIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV
|
|
138
141
|
BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw
|
|
@@ -163,7 +166,7 @@ zbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo
|
|
|
163
166
|
vaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn
|
|
164
167
|
w1IdYIg2Wxg7yHcQZemFQg==
|
|
165
168
|
-----END CERTIFICATE-----
|
|
166
|
-
`});var
|
|
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-----
|
|
167
170
|
MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
|
|
168
171
|
HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
|
|
169
172
|
bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
|
|
@@ -177,7 +180,7 @@ MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3
|
|
|
177
180
|
jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B
|
|
178
181
|
1bWeT0vT
|
|
179
182
|
-----END CERTIFICATE-----
|
|
180
|
-
`});var
|
|
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-----
|
|
181
184
|
MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
|
|
182
185
|
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
|
|
183
186
|
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
|
|
@@ -198,8 +201,8 @@ mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
|
|
|
198
201
|
Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
|
|
199
202
|
WD9f
|
|
200
203
|
-----END CERTIFICATE-----
|
|
201
|
-
`});var p_=l(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.SettingsService=void 0;var oM=vr(),aM=oE(),f_=aE(),cM=cE(),uM=uE(),$0=class{constructor(){Object.defineProperty(this,"pemCertificates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pemCertificates=new Map}setRootCertificates(e){let{identifier:t,certificates:i}=e,n=[];for(let s of i)s instanceof Uint8Array?n.push((0,oM.convertCertBufferToPEM)(s)):n.push(s);this.pemCertificates.set(t,n)}getRootCertificates(e){let{identifier:t}=e;return this.pemCertificates.get(t)??[]}};An.SettingsService=new $0;An.SettingsService.setRootCertificates({identifier:"android-key",certificates:[f_.Google_Hardware_Attestation_Root_1,f_.Google_Hardware_Attestation_Root_2,f_.Google_Hardware_Attestation_Root_3,f_.Google_Hardware_Attestation_Root_4]});An.SettingsService.setRootCertificates({identifier:"android-safetynet",certificates:[aM.GlobalSign_Root_CA]});An.SettingsService.setRootCertificates({identifier:"apple",certificates:[cM.Apple_WebAuthn_Root_CA]});An.SettingsService.setRootCertificates({identifier:"mds",certificates:[uM.GlobalSign_Root_CA_R3]})});var Y0=l(z0=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});z0.verifyMDSBlob=yM;var lM=rE(),dM=nE(),fM=fi(),pM=vr(),hM=sE(),_M=p_();async function yM(r){let e=(0,lM.parseJWT)(r),t=e[0],i=e[1],n=t.x5c.map(pM.convertCertBufferToPEM);try{let _=_M.SettingsService.getRootCertificates({identifier:"mds"});await(0,fM.validateCertificatePath)(n,_)}catch(_){let g=_;throw new Error("BLOB certificate path could not be validated",{cause:g})}let s=n[0];if(!await(0,dM.verifyJWT)(r,(0,hM.convertPEMToBytes)(s)))throw new Error("BLOB signature could not be verified");let a=[];for(let _ of i.entries)_.aaguid&&_.metadataStatement&&a.push(_.metadataStatement);let[c,u,d]=i.nextUpdate.split("-"),f=new Date(parseInt(c,10),parseInt(u,10)-1,parseInt(d,10));return{statements:a,parsedNextUpdate:f,payload:i}}});var dE=l(ye=>{"use strict";var lE=ye&&ye.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),gM=ye&&ye.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),vt=ye&&ye.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&lE(e,r,t)},AM=ye&&ye.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&lE(e,r,t);return gM(e,r),e};Object.defineProperty(ye,"__esModule",{value:!0});ye.cose=void 0;vt(Id(),ye);vt(vr(),ye);vt(pc(),ye);vt(F_(),ye);vt(kd(),ye);vt(oo(),ye);vt(h_(),ye);vt(W_(),ye);vt(bu(),ye);vt(q0(),ye);vt(o_(),ye);vt(yn(),ye);vt(fi(),ye);vt(gn(),ye);vt(se(),ye);vt(Y0(),ye);ye.cose=AM(Je())});var fE=l(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});J0.verifyOKP=SM;var _d=Je(),vM=dE(),mM=xd(),bM=Hi();async function SM(r){let{cosePublicKey:e,signature:t,data:i}=r,n=await(0,bM.getWebCrypto)(),s=e.get(_d.COSEKEYS.alg),o=e.get(_d.COSEKEYS.crv),a=e.get(_d.COSEKEYS.x);if(!s)throw new Error("Public key was missing alg (OKP)");if(!(0,_d.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===_d.COSECRV.ED25519)c="Ed25519";else throw new Error(`Unexpected COSE crv value of ${o} (OKP)`);let u={kty:"OKP",crv:c,alg:"EdDSA",x:vM.isoBase64URL.fromBuffer(a),ext:!1},d={name:c,namedCurve:c},f=await(0,mM.importKey)({keyData:u,algorithm:d}),_={name:c};return n.subtle.verify(_,f,t,i)}});var hE=l(X0=>{"use strict";Object.defineProperty(X0,"__esModule",{value:!0});X0.unwrapEC2Signature=EM;var wM=S(),CM=Vp(),Q0=Je(),PM=se();function EM(r,e){let t=wM.AsnParser.parse(r,CM.ECDSASigValue),i=new Uint8Array(t.r),n=new Uint8Array(t.s),s=TM(e),o=pE(i,s),a=pE(n,s);return PM.isoUint8Array.concat([o,a])}function TM(r){switch(r){case Q0.COSECRV.P256:return 32;case Q0.COSECRV.P384:return 48;case Q0.COSECRV.P521:return 66;default:throw new Error(`Unexpected COSE crv value of ${r} (EC2)`)}}function pE(r,e){let t;if(r.length<e)t=new Uint8Array(e),t.set(r,e-r.length);else if(r.length===e)t=r;else if(r.length===e+1&&r[0]===0&&(r[1]&128)===128)t=r.subarray(1);else throw new Error(`Invalid signature component length ${r.length}, expected ${e}`);return t}});var _E=l(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});Z0.verify=kM;var ec=Je(),xM=R_(),OM=K_(),IM=fE(),BM=hE();function kM(r){let{cosePublicKey:e,signature:t,data:i,shaHashOverride:n}=r;if((0,ec.isCOSEPublicKeyEC2)(e)){let o=e.get(ec.COSEKEYS.crv);if(!(0,ec.isCOSECrv)(o))throw new Error(`unknown COSE curve ${o}`);let a=(0,BM.unwrapEC2Signature)(t,o);return(0,xM.verifyEC2)({cosePublicKey:e,signature:a,data:i,shaHashOverride:n})}else{if((0,ec.isCOSEPublicKeyRSA)(e))return(0,OM.verifyRSA)({cosePublicKey:e,signature:t,data:i,shaHashOverride:n});if((0,ec.isCOSEPublicKeyOKP)(e))return(0,IM.verifyOKP)({cosePublicKey:e,signature:t,data:i})}let s=e.get(ec.COSEKEYS.kty);throw new Error(`Signature verification with public key of kty ${s} is not supported by this method`)}});var yE=l(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.verify=vn.getRandomValues=vn.digest=void 0;var jM=Qm();Object.defineProperty(vn,"digest",{enumerable:!0,get:function(){return jM.digest}});var MM=Xm();Object.defineProperty(vn,"getRandomValues",{enumerable:!0,get:function(){return MM.getRandomValues}});var NM=_E();Object.defineProperty(vn,"verify",{enumerable:!0,get:function(){return NM.verify}})});var gE=l(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.areEqual=qM;hi.toHex=RM;hi.fromHex=DM;hi.concat=UM;hi.toUTF8String=KM;hi.fromUTF8String=LM;hi.fromASCIIString=VM;hi.toDataView=GM;function qM(r,e){return r.length!=e.length?!1:r.every((t,i)=>t===e[i])}function RM(r){return Array.from(r,t=>t.toString(16).padStart(2,"0")).join("")}function DM(r){if(!r)return Uint8Array.from([]);if(!(r.length!==0&&r.length%2===0&&!/[^a-fA-F0-9]/u.test(r)))throw new Error("Invalid hex string");let t=r.match(/.{1,2}/g)??[];return Uint8Array.from(t.map(i=>parseInt(i,16)))}function UM(r){let e=0,t=r.reduce((n,s)=>n+s.length,0),i=new Uint8Array(t);return r.forEach(n=>{i.set(n,e),e+=n.length}),i}function KM(r){return new globalThis.TextDecoder("utf-8").decode(r)}function LM(r){return new globalThis.TextEncoder().encode(r)}function VM(r){return Uint8Array.from(r.split("").map(e=>e.charCodeAt(0)))}function GM(r){return new DataView(r.buffer,r.byteOffset,r.length)}});var se=l(mt=>{"use strict";var HM=mt&&mt.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),FM=mt&&mt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),__=mt&&mt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&HM(e,r,t);return FM(e,r),e};Object.defineProperty(mt,"__esModule",{value:!0});mt.isoUint8Array=mt.isoCrypto=mt.isoCBOR=mt.isoBase64URL=void 0;mt.isoBase64URL=__(Vm());mt.isoCBOR=__(Jm());mt.isoCrypto=__(yE());mt.isoUint8Array=__(gE())});var h_=l(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc._generateChallengeInternals=void 0;tc.generateChallenge=$M;var WM=se();async function $M(){let r=new Uint8Array(32);return await WM.isoCrypto.getRandomValues(r),tc._generateChallengeInternals.stubThis(r)}tc._generateChallengeInternals={stubThis:r=>r}});var em=l(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.supportedCOSEAlgorithmIdentifiers=void 0;gd.generateRegistrationOptions=XM;var zM=h_(),YM=W_(),yd=se();gd.supportedCOSEAlgorithmIdentifiers=[-8,-7,-36,-37,-38,-39,-257,-258,-259,-65535];var JM={residentKey:"preferred",userVerification:"preferred"},QM=[-8,-7,-257];async function XM(r){let{rpName:e,rpID:t,userName:i,userID:n,challenge:s=await(0,zM.generateChallenge)(),userDisplayName:o="",timeout:a=6e4,attestationType:c="none",excludeCredentials:u=[],authenticatorSelection:d=JM,extensions:f,supportedAlgorithmIDs:_=QM,preferredAuthenticatorType:g}=r,x=_.map(Z=>({alg:Z,type:"public-key"}));d.residentKey===void 0?d.requireResidentKey&&(d.residentKey="required"):d.requireResidentKey=d.residentKey==="required";let T=s;if(typeof T=="string"&&(T=yd.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,YM.generateUserID)());let U=[];return g&&(g==="securityKey"?(U.push("security-key"),d.authenticatorAttachment="cross-platform"):g==="localDevice"?(U.push("client-device"),d.authenticatorAttachment="platform"):g==="remoteDevice"&&(U.push("hybrid"),d.authenticatorAttachment="cross-platform")),{challenge:yd.isoBase64URL.fromBuffer(T),rp:{name:e,id:t},user:{id:yd.isoBase64URL.fromBuffer(I),name:i,displayName:o},pubKeyCredParams:x,timeout:a,attestation:c,excludeCredentials:u.map(Z=>{if(!yd.isoBase64URL.isBase64URL(Z.id))throw new Error(`excludeCredential id "${Z.id}" is not a valid base64url string`);return{...Z,id:yd.isoBase64URL.trimPadding(Z.id),type:"public-key"}}),authenticatorSelection:d,extensions:{...f,credProps:!0},hints:U}}});var tm=l(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.InvalidBackupFlags=void 0;Ad.parseBackupFlags=ZM;function ZM({be:r,bs:e}){let t=e,i="singleDevice";if(r&&(i="multiDevice"),i==="singleDevice"&&t)throw new y_("Single-device credential indicated that it was backed up, which should be impossible.");return{credentialDeviceType:i,credentialBackedUp:t}}var y_=class extends Error{constructor(e){super(e),this.name="InvalidBackupFlags"}};Ad.InvalidBackupFlags=y_});var nm=l(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.matchExpectedRPID=tN;var eN=yn(),AE=se();async function tN(r,e){try{return await Promise.any(e.map(i=>new Promise((n,s)=>{(0,eN.toHash)(AE.isoUint8Array.fromASCIIString(i)).then(o=>{AE.isoUint8Array.areEqual(r,o)?n(i):s()})})))}catch(t){throw t.name==="AggregateError"?new rm:t}}var rm=class extends Error{constructor(){super("Unexpected RP ID hash"),this.name="UnexpectedRPIDHash"}}});var mE=l(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.verifyAttestationFIDOU2F=aN;var rN=pc(),iN=vr(),nN=fi(),sN=gn(),vE=se(),oN=Je();async function aN(r){let{attStmt:e,clientDataHash:t,rpIdHash:i,credentialID:n,credentialPublicKey:s,aaguid:o,rootCertificates:a}=r,c=Uint8Array.from([0]),u=(0,rN.convertCOSEtoPKCS)(s),d=vE.isoUint8Array.concat([c,i,t,n,u]),f=e.get("sig"),_=e.get("x5c");if(!_)throw new Error("No attestation certificate provided in attestation statement (FIDOU2F)");if(!f)throw new Error("No attestation signature provided in attestation statement (FIDOU2F)");let g=Number.parseInt(vE.isoUint8Array.toHex(o),16);if(g!==0)throw new Error(`AAGUID "${g}" was not expected value`);try{await(0,nN.validateCertificatePath)(_.map(iN.convertCertBufferToPEM),a)}catch(x){let T=x;throw new Error(`${T.message} (FIDOU2F)`)}return(0,sN.verifySignature)({signature:f,data:d,x509Certificate:_[0],hashAlgorithm:oN.COSEALG.ES256})}});var cm=l(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.validateExtFIDOGenCEAAGUID=cN;var bE=S(),om=se(),SE="1.3.6.1.4.1.45724.1.1.4";function cN(r,e){if(!r)return!0;let t=r.find(o=>o.extnID===SE);if(!t)return!0;let i=bE.AsnParser.parse(t.extnValue,bE.OctetString),n=new Uint8Array(i.buffer);if(!om.isoUint8Array.areEqual(e,n)){let o=om.isoUint8Array.toHex(n),a=om.isoUint8Array.toHex(e);throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${SE}) value of "${o}" was present but not equal to attestation statement AAGUID value of "${a}"`)}return!0}});var wE=l(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.getLogger=uN;function uN(r){return(e,...t)=>{}}});var ic=l(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.MetadataService=rc.BaseMetadataService=void 0;var lN=Id(),dN=Y0(),fN=wE(),pN=M0(),hN={url:"",no:0,nextUpdate:new Date(0)},_N="https://mds.fidoalliance.org/",Yt;(function(r){r[r.DISABLED=0]="DISABLED",r[r.REFRESHING=1]="REFRESHING",r[r.READY=2]="READY"})(Yt||(Yt={}));var $s=(0,fN.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:Yt.DISABLED}),Object.defineProperty(this,"verificationMode",{enumerable:!0,configurable:!0,writable:!0,value:"strict"})}async initialize(e={}){this.statementCache={};let{mdsServers:t=[_N],statements:i,verificationMode:n}=e;if(this.setState(Yt.REFRESHING),i?.length){let s=0;i.forEach(o=>{o.aaguid&&(this.statementCache[o.aaguid]={entry:{metadataStatement:o,statusReports:[],timeOfLastStatusChange:"1970-01-01"},url:hN.url},s+=1)}),$s(`Cached ${s} local statements`)}if(t?.length){let s=Object.keys(this.statementCache).length,o=t.length;for(let u of t)try{let d={url:u,no:0,nextUpdate:new Date(0)},f=await this.downloadBlob(d);await this.verifyBlob(f,d)}catch(d){$s(`Could not download BLOB from ${u}:`,d),o-=1}let c=Object.keys(this.statementCache).length-s;$s(`Cached ${c} statements from ${o} metadata server(s)`)}n&&(this.verificationMode=n),this.setState(Yt.READY)}async getStatement(e){if(this.state===Yt.DISABLED||!e)return;e instanceof Uint8Array&&(e=(0,lN.convertAAGUIDToString)(e)),await this.pauseUntilReady();let t=this.statementCache[e];if(!t){if(this.verificationMode==="strict")throw new Error(`No metadata statement found for aaguid "${e}"`);return}if(t.url){let n=this.mdsCache[t.url];if(new Date>n.nextUpdate)try{this.setState(Yt.REFRESHING);let o=await this.downloadBlob(n);await this.verifyBlob(o,n)}finally{this.setState(Yt.READY)}}let{entry:i}=t;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:t}=e;return await(await(0,pN.fetch)(t)).text()}async verifyBlob(e,t){let{url:i,no:n}=t,{payload:s,parsedNextUpdate:o}=await(0,dN.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]={...t,no:s.no,nextUpdate:o}:o<new Date&&$s(`\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===Yt.READY?new Promise(t=>{t()}):new Promise((t,i)=>{let o=700,a=globalThis.setInterval(()=>{o<1?(clearInterval(a),i(`State did not become ready in ${7e4/1e3} seconds`)):this.state===Yt.READY&&(clearInterval(a),t()),o-=1},100)})}setState(e){this.state=e,e===Yt.DISABLED?$s("MetadataService is DISABLED"):e===Yt.REFRESHING?$s("MetadataService is REFRESHING"):e===Yt.READY&&$s("MetadataService is READY")}};rc.BaseMetadataService=g_;rc.MetadataService=new g_});var vd=l(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.algSignToCOSEInfoMap=void 0;Ys.verifyAttestationWithMetadata=AN;var CE=vr(),yN=fi(),gN=oo(),zs=Je();async function AN({statement:r,credentialPublicKey:e,x5c:t,attestationStatementAlg:i}){let{authenticationAlgorithms:n,authenticatorGetInfo:s,attestationRootCertificates:o}=r,a=new Set;n.forEach(I=>{let U=Ys.algSignToCOSEInfoMap[I];U&&a.add(U)});let c=(0,gN.decodeCredentialPublicKey)(e),u=c.get(zs.COSEKEYS.kty),d=c.get(zs.COSEKEYS.alg);if(!u)throw new Error("Credential public key was missing kty");if(!d)throw new Error("Credential public key was missing alg");if(!u)throw new Error("Credential public key was missing kty");let f={kty:u,alg:d};if((0,zs.isCOSEPublicKeyEC2)(c)){let I=c.get(zs.COSEKEYS.crv);f.crv=I}let _=!1;for(let I of a)if(I.alg===f.alg&&I.kty===f.kty&&((I.kty===zs.COSEKTY.EC2||I.kty===zs.COSEKTY.OKP)&&(I.crv,f.crv),_=!0),_)break;if(!_){let I=n.map(fe=>`'${fe}' (COSE info: ${PE(Ys.algSignToCOSEInfoMap[fe])})`),U=JSON.stringify(I,null,2).replace(/"/g,""),Z=PE(f);throw new Error(`Public key parameters ${Z} did not match any of the following metadata algorithms:
|
|
202
|
-
${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 g=t.map(CE.convertCertBufferToPEM),x=o.map(CE.convertCertBufferToPEM),T=!1;if(g.length===1&&x.indexOf(g[0])>=0&&(T=!0),!T)try{await(0,yN.validateCertificatePath)(g,x)}catch(I){let U=I;throw new Error(`Could not validate certificate path with any metadata root certificates: ${U.message}`)}return!0}Ys.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 PE(r){let{kty:e,alg:t,crv:i}=r,n="";return e!==zs.COSEKTY.RSA?n=`{ kty: ${e}, alg: ${t}, crv: ${i} }`:n=`{ kty: ${e}, alg: ${t} }`,n}});var TE=l(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.verifyAttestationPacked=TN;var vN=Je(),mN=vr(),bN=fi(),SN=bu(),EE=gn(),wN=se(),CN=cm(),PN=ic(),EN=vd();async function TN(r){let{attStmt:e,clientDataHash:t,authData:i,credentialPublicKey:n,aaguid:s,rootCertificates:o}=r,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,vN.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (Packed)`);let d=wN.isoUint8Array.concat([i,t]),f=!1;if(c){let{subject:_,basicConstraintsCA:g,version:x,notBefore:T,notAfter:I,parsedCertificate:U}=(0,SN.getCertificateInfo)(c[0]),{OU:Z,CN:fe,O:ge,C:ne}=_;if(Z!=="Authenticator Attestation")throw new Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)');if(!fe)throw new Error("Certificate CN was empty (Packed|Full)");if(!ge)throw new Error("Certificate O was empty (Packed|Full)");if(!ne||ne.length!==2)throw new Error("Certificate C was not two-character ISO 3166 code (Packed|Full)");if(g)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 $e=new Date;if(T>$e)throw new Error(`Certificate not good before "${T.toString()}" (Packed|Full)`);if($e=new Date,I<$e)throw new Error(`Certificate not good after "${I.toString()}" (Packed|Full)`);try{await(0,CN.validateExtFIDOGenCEAAGUID)(U.tbsCertificate.extensions,s)}catch(at){let ct=at;throw new Error(`${ct.message} (Packed|Full)`)}let tt=await PN.MetadataService.getStatement(s);if(tt){if(tt.attestationTypes.indexOf("basic_full")<0)throw new Error("Metadata does not indicate support for full attestations (Packed|Full)");try{await(0,EN.verifyAttestationWithMetadata)({statement:tt,credentialPublicKey:n,x5c:c,attestationStatementAlg:u})}catch(at){let ct=at;throw new Error(`${ct.message} (Packed|Full)`)}}else try{await(0,bN.validateCertificatePath)(c.map(mN.convertCertBufferToPEM),o)}catch(at){let ct=at;throw new Error(`${ct.message} (Packed|Full)`)}f=await(0,EE.verifySignature)({signature:a,data:d,x509Certificate:c[0]})}else f=await(0,EE.verifySignature)({signature:a,data:d,credentialPublicKey:n,hashAlgorithm:u});return f}});var xE=l(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.verifyAttestationAndroidSafetyNet=NN;var xN=yn(),ON=gn(),IN=bu(),BN=fi(),kN=vr(),mn=se(),jN=ic(),MN=vd();async function NN(r){let{attStmt:e,clientDataHash:t,authData:i,aaguid:n,rootCertificates:s,verifyTimestampMS:o=!0,credentialPublicKey:a,attestationSafetyNetEnforceCTSCheck:c}=r,u=e.get("alg"),d=e.get("response");if(!e.get("ver"))throw new Error("No ver value in attestation (SafetyNet)");if(!d)throw new Error("No response was included in attStmt by authenticator (SafetyNet)");let g=mn.isoUint8Array.toUTF8String(d).split("."),x=JSON.parse(mn.isoBase64URL.toUTF8String(g[0])),T=JSON.parse(mn.isoBase64URL.toUTF8String(g[1])),I=g[2],{nonce:U,ctsProfileMatch:Z,timestampMs:fe}=T;if(o){let ze=Date.now();if(fe>Date.now())throw new Error(`Payload timestamp "${fe}" was later than "${ze}" (SafetyNet)`);let ft=fe+60*1e3;if(ze=Date.now(),ft<ze)throw new Error(`Payload timestamp "${ft}" has expired (SafetyNet)`)}let ge=mn.isoUint8Array.concat([i,t]),ne=await(0,xN.toHash)(ge),$e=mn.isoBase64URL.fromBuffer(ne,"base64");if(U!==$e)throw new Error("Could not verify payload nonce (SafetyNet)");if(c&&!Z)throw new Error("Could not verify device integrity (SafetyNet)");let tt=mn.isoBase64URL.toBuffer(x.x5c[0],"base64"),at=(0,IN.getCertificateInfo)(tt),{subject:ct}=at;if(ct.CN!=="attest.android.com")throw new Error('Certificate common name was not "attest.android.com" (SafetyNet)');let _r=await jN.MetadataService.getStatement(n);if(_r)try{await(0,MN.verifyAttestationWithMetadata)({statement:_r,credentialPublicKey:a,x5c:x.x5c,attestationStatementAlg:u})}catch(ze){let ft=ze;throw new Error(`${ft.message} (SafetyNet)`)}else try{await(0,BN.validateCertificatePath)(x.x5c.map(kN.convertCertBufferToPEM),s)}catch(ze){let ft=ze;throw new Error(`${ft.message} (SafetyNet)`)}let Xt=mn.isoUint8Array.fromUTF8String(`${g[0]}.${g[1]}`),yr=mn.isoBase64URL.toBuffer(I);return await(0,ON.verifySignature)({signature:yr,data:Xt,x509Certificate:tt})}});var A_=l(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.TPM_ECC_CURVE_COSE_CRV_MAP=fr.TPM_MANUFACTURERS=fr.TPM_ECC_CURVE=fr.TPM_ALG=fr.TPM_ST=void 0;fr.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"};fr.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"};fr.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"};fr.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"}};fr.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 BE=l(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.parseCertInfo=qN;var OE=A_(),IE=se();function qN(r){let e=0,t=IE.isoUint8Array.toDataView(r),i=t.getUint32(e);e+=4;let n=t.getUint16(e);e+=2;let s=OE.TPM_ST[n],o=t.getUint16(e);e+=2;let a=r.slice(e,e+=o),c=t.getUint16(e);e+=2;let u=r.slice(e,e+=c),d=r.slice(e,e+=8),f=t.getUint32(e);e+=4;let _=t.getUint32(e);e+=4;let g=!!r.slice(e,e+=1),x={clock:d,resetCount:f,restartCount:_,safe:g},T=r.slice(e,e+=8),I=t.getUint16(e);e+=2;let U=r.slice(e,e+=I),Z=IE.isoUint8Array.toDataView(U),fe=t.getUint16(e);e+=2;let ge=r.slice(e,e+=fe),ne={nameAlg:OE.TPM_ALG[Z.getUint16(0)],nameAlgBuffer:U.slice(0,2),name:U,qualifiedName:ge};return{magic:i,type:s,qualifiedSigner:a,extraData:u,clockInfo:x,firmwareVersion:T,attested:ne}}});var jE=l(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.parsePubArea=RN;var bn=A_(),kE=se();function RN(r){let e=0,t=kE.isoUint8Array.toDataView(r),i=bn.TPM_ALG[t.getUint16(e)];e+=2;let n=bn.TPM_ALG[t.getUint16(e)];e+=2;let s=t.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=t.getUint16(e);e+=2;let c=r.slice(e,e+=a),u={},d=Uint8Array.from([]);if(i==="TPM_ALG_RSA"){let f=bn.TPM_ALG[t.getUint16(e)];e+=2;let _=bn.TPM_ALG[t.getUint16(e)];e+=2;let g=t.getUint16(e);e+=2;let x=t.getUint32(e);e+=4,u.rsa={symmetric:f,scheme:_,keyBits:g,exponent:x};let T=t.getUint16(e);e+=2,d=r.slice(e,e+=T)}else if(i==="TPM_ALG_ECC"){let f=bn.TPM_ALG[t.getUint16(e)];e+=2;let _=bn.TPM_ALG[t.getUint16(e)];e+=2;let g=bn.TPM_ECC_CURVE[t.getUint16(e)];e+=2;let x=bn.TPM_ALG[t.getUint16(e)];e+=2,u.ecc={symmetric:f,scheme:_,curveID:g,kdf:x};let T=t.getUint16(e);e+=2;let I=r.slice(e,e+=T),U=t.getUint16(e);e+=2;let Z=r.slice(e,e+=U);d=kE.isoUint8Array.concat([I,Z])}else throw new Error(`Unexpected type "${i}" (TPM)`);return{type:i,nameAlg:n,objectAttributes:o,authPolicy:c,parameters:u,unique:d}}});var qE=l(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.verifyAttestationTPM=zN;var hm=S(),md=Q(),DN=oo(),Jt=Je(),ME=yn(),UN=vr(),KN=fi(),LN=bu(),VN=gn(),Js=se(),GN=cm(),HN=ic(),FN=vd(),NE=A_(),WN=BE(),$N=jE();async function zN(r){let{aaguid:e,attStmt:t,authData:i,credentialPublicKey:n,clientDataHash:s,rootCertificates:o}=r,a=t.get("ver"),c=t.get("sig"),u=t.get("alg"),d=t.get("x5c"),f=t.get("pubArea"),_=t.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,Jt.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (TPM)`);if(!d)throw new Error("No attestation certificate provided in attestation statement (TPM)");if(!f)throw new Error("Attestation statement did not contain pubArea (TPM)");if(!_)throw new Error("Attestation statement did not contain certInfo (TPM)");let g=(0,$N.parsePubArea)(f),{unique:x,type:T,parameters:I}=g,U=(0,DN.decodeCredentialPublicKey)(n);if(T==="TPM_ALG_RSA"){if(!(0,Jt.isCOSEPublicKeyRSA)(U))throw new Error(`Credential public key with kty ${U.get(Jt.COSEKEYS.kty)} did not match ${T}`);let z=U.get(Jt.COSEKEYS.n),Kt=U.get(Jt.COSEKEYS.e);if(!z)throw new Error("COSE public key missing n (TPM|RSA)");if(!Kt)throw new Error("COSE public key missing e (TPM|RSA)");if(!Js.isoUint8Array.areEqual(x,z))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 Ki=Kt,Li=I.rsa.exponent||65537,Pn=Ki[0]+(Ki[1]<<8)+(Ki[2]<<16);if(Li!==Pn)throw new Error(`Unexpected public key exp ${Pn}, expected ${Li} (TPM|RSA)`)}else if(T==="TPM_ALG_ECC"){if(!(0,Jt.isCOSEPublicKeyEC2)(U))throw new Error(`Credential public key with kty ${U.get(Jt.COSEKEYS.kty)} did not match ${T}`);let z=U.get(Jt.COSEKEYS.crv),Kt=U.get(Jt.COSEKEYS.x),Ki=U.get(Jt.COSEKEYS.y);if(!z)throw new Error("COSE public key missing crv (TPM|ECC)");if(!Kt)throw new Error("COSE public key missing x (TPM|ECC)");if(!Ki)throw new Error("COSE public key missing y (TPM|ECC)");if(!Js.isoUint8Array.areEqual(x,Js.isoUint8Array.concat([Kt,Ki])))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 Li=I.ecc.curveID,Pn=NE.TPM_ECC_CURVE_COSE_CRV_MAP[Li];if(Pn!==z)throw new Error(`Public area key curve ID "${Li}" mapped to "${Pn}" which did not match public key crv of "${z}" (TPM|ECC)`)}else throw new Error(`Unsupported pubArea.type "${T}"`);let Z=(0,WN.parseCertInfo)(_),{magic:fe,type:ge,attested:ne,extraData:$e}=Z;if(fe!==4283712327)throw new Error(`Unexpected magic value "${fe}", expected "0xff544347" (TPM)`);if(ge!=="TPM_ST_ATTEST_CERTIFY")throw new Error(`Unexpected type "${ge}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`);let tt=await(0,ME.toHash)(f,JN(ne.nameAlg)),at=Js.isoUint8Array.concat([ne.nameAlgBuffer,tt]);if(!Js.isoUint8Array.areEqual(ne.name,at))throw new Error("Attested name comparison failed (TPM)");let ct=Js.isoUint8Array.concat([i,s]),_r=await(0,ME.toHash)(ct,u);if(!Js.isoUint8Array.areEqual($e,_r))throw new Error("CertInfo extra data did not equal hashed attestation (TPM)");if(d.length<1)throw new Error("No certificates present in x5c array (TPM)");let Xt=(0,LN.getCertificateInfo)(d[0]),{basicConstraintsCA:yr,version:Ui,subject:ze,notAfter:ft,notBefore:pt}=Xt;if(yr)throw new Error("Certificate basic constraints CA was not `false` (TPM)");if(Ui!==2)throw new Error("Certificate version was not `3` (ASN.1 value of 2) (TPM)");if(ze.combined.length>0)throw new Error("Certificate subject was not empty (TPM)");let Cn=new Date;if(pt>Cn)throw new Error(`Certificate not good before "${pt.toString()}" (TPM)`);if(Cn=new Date,ft<Cn)throw new Error(`Certificate not good after "${ft.toString()}" (TPM)`);let Ur=hm.AsnParser.parse(d[0],md.Certificate);if(!Ur.tbsCertificate.extensions)throw new Error("Certificate was missing extensions (TPM)");let _i,yi;if(Ur.tbsCertificate.extensions.forEach(z=>{z.extnID===md.id_ce_subjectAltName?_i=hm.AsnParser.parse(z.extnValue,md.SubjectAlternativeName):z.extnID===md.id_ce_extKeyUsage&&(yi=hm.AsnParser.parse(z.extnValue,md.ExtendedKeyUsage))}),!_i)throw new Error("Certificate did not contain subjectAltName extension (TPM)");if(!_i[0].directoryName?.[0].length)throw new Error("Certificate subjectAltName extension directoryName was empty (TPM)");let{tcgAtTpmManufacturer:Ut,tcgAtTpmModel:H,tcgAtTpmVersion:Kr}=YN(_i[0].directoryName);if(!Ut||!H||!Kr)throw new Error("Certificate contained incomplete subjectAltName data (TPM)");if(!yi)throw new Error("Certificate did not contain ExtendedKeyUsage extension (TPM)");if(!NE.TPM_MANUFACTURERS[Ut])throw new Error(`Could not match TPM manufacturer "${Ut}" (TPM)`);if(yi[0]!=="2.23.133.8.3")throw new Error(`Unexpected extKeyUsage "${yi[0]}", expected "2.23.133.8.3" (TPM)`);try{await(0,GN.validateExtFIDOGenCEAAGUID)(Ur.tbsCertificate.extensions,e)}catch(z){let Kt=z;throw new Error(`${Kt.message} (TPM)`)}let eo=await HN.MetadataService.getStatement(e);if(eo)try{await(0,FN.verifyAttestationWithMetadata)({statement:eo,credentialPublicKey:n,x5c:d,attestationStatementAlg:u})}catch(z){let Kt=z;throw new Error(`${Kt.message} (TPM)`)}else try{await(0,KN.validateCertificatePath)(d.map(UN.convertCertBufferToPEM),o)}catch(z){let Kt=z;throw new Error(`${Kt.message} (TPM)`)}return(0,VN.verifySignature)({signature:c,data:_,x509Certificate:d[0],hashAlgorithm:u})}function YN(r){let e="2.23.133.2.1",t="2.23.133.2.2",i="2.23.133.2.3",n,s,o;return r.forEach(a=>{a.forEach(c=>{c.type===e?n=c.value.toString():c.type===t?s=c.value.toString():c.type===i&&(o=c.value.toString())})}),{tcgAtTpmManufacturer:n,tcgAtTpmModel:s,tcgAtTpmVersion:o}}function JN(r){if(r==="TPM_ALG_SHA256")return Jt.COSEALG.ES256;if(r==="TPM_ALG_SHA384")return Jt.COSEALG.ES384;if(r==="TPM_ALG_SHA512")return Jt.COSEALG.ES512;throw new Error(`Unexpected TPM attested name alg ${r}`)}});var Am=l(Ge=>{"use strict";var ym;Object.defineProperty(Ge,"__esModule",{value:!0});Ge.KeyMintKeyDescription=Ge.KeyDescription=Ge.Version=Ge.SecurityLevel=Ge.AuthorizationList=Ge.IntegerSet=Ge.RootOfTrust=Ge.VerifiedBootState=Ge.id_ce_keyDescription=void 0;var L=(b(),v(m)),A=S();Ge.id_ce_keyDescription="1.3.6.1.4.1.11129.2.1.17";var gm;(function(r){r[r.verified=0]="verified",r[r.selfSigned=1]="selfSigned",r[r.unverified=2]="unverified",r[r.failed=3]="failed"})(gm||(Ge.VerifiedBootState=gm={}));var Sn=class{constructor(e={}){this.verifiedBootKey=new A.OctetString,this.deviceLocked=!1,this.verifiedBootState=gm.verified,Object.assign(this,e)}};Ge.RootOfTrust=Sn;L.__decorate([(0,A.AsnProp)({type:A.OctetString})],Sn.prototype,"verifiedBootKey",void 0);L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Boolean})],Sn.prototype,"deviceLocked",void 0);L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Enumerated})],Sn.prototype,"verifiedBootState",void 0);L.__decorate([(0,A.AsnProp)({type:A.OctetString,optional:!0})],Sn.prototype,"verifiedBootHash",void 0);var Qs=ym=class extends A.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,ym.prototype)}};Ge.IntegerSet=Qs;Ge.IntegerSet=Qs=ym=L.__decorate([(0,A.AsnType)({type:A.AsnTypeTypes.Set,itemType:A.AsnPropTypes.Integer})],Qs);var W=class{constructor(e={}){Object.assign(this,e)}};Ge.AuthorizationList=W;L.__decorate([(0,A.AsnProp)({context:1,type:Qs,optional:!0})],W.prototype,"purpose",void 0);L.__decorate([(0,A.AsnProp)({context:2,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"algorithm",void 0);L.__decorate([(0,A.AsnProp)({context:3,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"keySize",void 0);L.__decorate([(0,A.AsnProp)({context:5,type:Qs,optional:!0})],W.prototype,"digest",void 0);L.__decorate([(0,A.AsnProp)({context:6,type:Qs,optional:!0})],W.prototype,"padding",void 0);L.__decorate([(0,A.AsnProp)({context:10,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"ecCurve",void 0);L.__decorate([(0,A.AsnProp)({context:200,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"rsaPublicExponent",void 0);L.__decorate([(0,A.AsnProp)({context:203,type:Qs,optional:!0})],W.prototype,"mgfDigest",void 0);L.__decorate([(0,A.AsnProp)({context:303,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"rollbackResistance",void 0);L.__decorate([(0,A.AsnProp)({context:305,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"earlyBootOnly",void 0);L.__decorate([(0,A.AsnProp)({context:400,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"activeDateTime",void 0);L.__decorate([(0,A.AsnProp)({context:401,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"originationExpireDateTime",void 0);L.__decorate([(0,A.AsnProp)({context:402,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"usageExpireDateTime",void 0);L.__decorate([(0,A.AsnProp)({context:405,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"usageCountLimit",void 0);L.__decorate([(0,A.AsnProp)({context:503,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"noAuthRequired",void 0);L.__decorate([(0,A.AsnProp)({context:504,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"userAuthType",void 0);L.__decorate([(0,A.AsnProp)({context:505,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"authTimeout",void 0);L.__decorate([(0,A.AsnProp)({context:506,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"allowWhileOnBody",void 0);L.__decorate([(0,A.AsnProp)({context:507,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"trustedUserPresenceRequired",void 0);L.__decorate([(0,A.AsnProp)({context:508,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"trustedConfirmationRequired",void 0);L.__decorate([(0,A.AsnProp)({context:509,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"unlockedDeviceRequired",void 0);L.__decorate([(0,A.AsnProp)({context:600,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"allApplications",void 0);L.__decorate([(0,A.AsnProp)({context:601,type:A.OctetString,optional:!0})],W.prototype,"applicationId",void 0);L.__decorate([(0,A.AsnProp)({context:701,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"creationDateTime",void 0);L.__decorate([(0,A.AsnProp)({context:702,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"origin",void 0);L.__decorate([(0,A.AsnProp)({context:703,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"rollbackResistant",void 0);L.__decorate([(0,A.AsnProp)({context:704,type:Sn,optional:!0})],W.prototype,"rootOfTrust",void 0);L.__decorate([(0,A.AsnProp)({context:705,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"osVersion",void 0);L.__decorate([(0,A.AsnProp)({context:706,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"osPatchLevel",void 0);L.__decorate([(0,A.AsnProp)({context:709,type:A.OctetString,optional:!0})],W.prototype,"attestationApplicationId",void 0);L.__decorate([(0,A.AsnProp)({context:710,type:A.OctetString,optional:!0})],W.prototype,"attestationIdBrand",void 0);L.__decorate([(0,A.AsnProp)({context:711,type:A.OctetString,optional:!0})],W.prototype,"attestationIdDevice",void 0);L.__decorate([(0,A.AsnProp)({context:712,type:A.OctetString,optional:!0})],W.prototype,"attestationIdProduct",void 0);L.__decorate([(0,A.AsnProp)({context:713,type:A.OctetString,optional:!0})],W.prototype,"attestationIdSerial",void 0);L.__decorate([(0,A.AsnProp)({context:714,type:A.OctetString,optional:!0})],W.prototype,"attestationIdImei",void 0);L.__decorate([(0,A.AsnProp)({context:715,type:A.OctetString,optional:!0})],W.prototype,"attestationIdMeid",void 0);L.__decorate([(0,A.AsnProp)({context:716,type:A.OctetString,optional:!0})],W.prototype,"attestationIdManufacturer",void 0);L.__decorate([(0,A.AsnProp)({context:717,type:A.OctetString,optional:!0})],W.prototype,"attestationIdModel",void 0);L.__decorate([(0,A.AsnProp)({context:718,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"vendorPatchLevel",void 0);L.__decorate([(0,A.AsnProp)({context:719,type:A.AsnPropTypes.Integer,optional:!0})],W.prototype,"bootPatchLevel",void 0);L.__decorate([(0,A.AsnProp)({context:720,type:A.AsnPropTypes.Null,optional:!0})],W.prototype,"deviceUniqueAttestation",void 0);L.__decorate([(0,A.AsnProp)({context:723,type:A.OctetString,optional:!0})],W.prototype,"attestationIdSecondImei",void 0);L.__decorate([(0,A.AsnProp)({context:724,type:A.OctetString,optional:!0})],W.prototype,"moduleHash",void 0);var nc;(function(r){r[r.software=0]="software",r[r.trustedEnvironment=1]="trustedEnvironment",r[r.strongBox=2]="strongBox"})(nc||(Ge.SecurityLevel=nc={}));var v_;(function(r){r[r.KM2=1]="KM2",r[r.KM3=2]="KM3",r[r.KM4=3]="KM4",r[r.KM4_1=4]="KM4_1",r[r.keyMint1=100]="keyMint1",r[r.keyMint2=200]="keyMint2",r[r.keyMint3=300]="keyMint3",r[r.keyMint4=400]="keyMint4"})(v_||(Ge.Version=v_={}));var pr=class{constructor(e={}){this.attestationVersion=v_.KM4,this.attestationSecurityLevel=nc.software,this.keymasterVersion=0,this.keymasterSecurityLevel=nc.software,this.attestationChallenge=new A.OctetString,this.uniqueId=new A.OctetString,this.softwareEnforced=new W,this.teeEnforced=new W,Object.assign(this,e)}};Ge.KeyDescription=pr;L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Integer})],pr.prototype,"attestationVersion",void 0);L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Enumerated})],pr.prototype,"attestationSecurityLevel",void 0);L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Integer})],pr.prototype,"keymasterVersion",void 0);L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Enumerated})],pr.prototype,"keymasterSecurityLevel",void 0);L.__decorate([(0,A.AsnProp)({type:A.OctetString})],pr.prototype,"attestationChallenge",void 0);L.__decorate([(0,A.AsnProp)({type:A.OctetString})],pr.prototype,"uniqueId",void 0);L.__decorate([(0,A.AsnProp)({type:W})],pr.prototype,"softwareEnforced",void 0);L.__decorate([(0,A.AsnProp)({type:W})],pr.prototype,"teeEnforced",void 0);var Rr=class r{constructor(e={}){this.attestationVersion=v_.keyMint4,this.attestationSecurityLevel=nc.software,this.keyMintVersion=0,this.keyMintSecurityLevel=nc.software,this.attestationChallenge=new A.OctetString,this.uniqueId=new A.OctetString,this.softwareEnforced=new W,this.hardwareEnforced=new W,Object.assign(this,e)}toLegacyKeyDescription(){return new pr({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 r({attestationVersion:e.attestationVersion,attestationSecurityLevel:e.attestationSecurityLevel,keyMintVersion:e.keymasterVersion,keyMintSecurityLevel:e.keymasterSecurityLevel,attestationChallenge:e.attestationChallenge,uniqueId:e.uniqueId,softwareEnforced:e.softwareEnforced,hardwareEnforced:e.teeEnforced})}};Ge.KeyMintKeyDescription=Rr;L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Integer})],Rr.prototype,"attestationVersion",void 0);L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Enumerated})],Rr.prototype,"attestationSecurityLevel",void 0);L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Integer})],Rr.prototype,"keyMintVersion",void 0);L.__decorate([(0,A.AsnProp)({type:A.AsnPropTypes.Enumerated})],Rr.prototype,"keyMintSecurityLevel",void 0);L.__decorate([(0,A.AsnProp)({type:A.OctetString})],Rr.prototype,"attestationChallenge",void 0);L.__decorate([(0,A.AsnProp)({type:A.OctetString})],Rr.prototype,"uniqueId",void 0);L.__decorate([(0,A.AsnProp)({type:W})],Rr.prototype,"softwareEnforced",void 0);L.__decorate([(0,A.AsnProp)({type:W})],Rr.prototype,"hardwareEnforced",void 0)});var RE=l(Qt=>{"use strict";var vm;Object.defineProperty(Qt,"__esModule",{value:!0});Qt.NonStandardKeyMintKeyDescription=Qt.NonStandardKeyDescription=Qt.NonStandardAuthorizationList=Qt.NonStandardAuthorization=void 0;var Dr=(b(),v(m)),Me=S(),m_=Am(),b_=class extends m_.AuthorizationList{};Qt.NonStandardAuthorization=b_;Qt.NonStandardAuthorization=b_=Dr.__decorate([(0,Me.AsnType)({type:Me.AsnTypeTypes.Choice})],b_);var Xs=vm=class extends Me.AsnArray{constructor(e){super(e),Object.setPrototypeOf(this,vm.prototype)}findProperty(e){let t=this.find(i=>e in i);if(t)return t[e]}};Qt.NonStandardAuthorizationList=Xs;Qt.NonStandardAuthorizationList=Xs=vm=Dr.__decorate([(0,Me.AsnType)({type:Me.AsnTypeTypes.Sequence,itemType:b_})],Xs);var hr=class{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={}){this.attestationVersion=m_.Version.KM4,this.attestationSecurityLevel=m_.SecurityLevel.software,this.keymasterVersion=0,this.keymasterSecurityLevel=m_.SecurityLevel.software,this.attestationChallenge=new Me.OctetString,this.uniqueId=new Me.OctetString,this.softwareEnforced=new Xs,this.teeEnforced=new Xs,Object.assign(this,e)}};Qt.NonStandardKeyDescription=hr;Dr.__decorate([(0,Me.AsnProp)({type:Me.AsnPropTypes.Integer})],hr.prototype,"attestationVersion",void 0);Dr.__decorate([(0,Me.AsnProp)({type:Me.AsnPropTypes.Enumerated})],hr.prototype,"attestationSecurityLevel",void 0);Dr.__decorate([(0,Me.AsnProp)({type:Me.AsnPropTypes.Integer})],hr.prototype,"keymasterVersion",void 0);Dr.__decorate([(0,Me.AsnProp)({type:Me.AsnPropTypes.Enumerated})],hr.prototype,"keymasterSecurityLevel",void 0);Dr.__decorate([(0,Me.AsnProp)({type:Me.OctetString})],hr.prototype,"attestationChallenge",void 0);Dr.__decorate([(0,Me.AsnProp)({type:Me.OctetString})],hr.prototype,"uniqueId",void 0);Dr.__decorate([(0,Me.AsnProp)({type:Xs})],hr.prototype,"softwareEnforced",void 0);Dr.__decorate([(0,Me.AsnProp)({type:Xs})],hr.prototype,"teeEnforced",void 0);var mm=class extends hr{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)}};Qt.NonStandardKeyMintKeyDescription=mm;Qt.NonStandardKeyMintKeyDescription=mm=Dr.__decorate([(0,Me.AsnType)({type:Me.AsnTypeTypes.Sequence})],mm)});var DE=l(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.AttestationApplicationId=oc.AttestationPackageInfo=void 0;var S_=(b(),v(m)),Zs=S(),sc=class{constructor(e={}){Object.assign(this,e)}};oc.AttestationPackageInfo=sc;S_.__decorate([(0,Zs.AsnProp)({type:Zs.AsnPropTypes.OctetString})],sc.prototype,"packageName",void 0);S_.__decorate([(0,Zs.AsnProp)({type:Zs.AsnPropTypes.Integer})],sc.prototype,"version",void 0);var bd=class{constructor(e={}){Object.assign(this,e)}};oc.AttestationApplicationId=bd;S_.__decorate([(0,Zs.AsnProp)({type:sc,repeated:"set"})],bd.prototype,"packageInfos",void 0);S_.__decorate([(0,Zs.AsnProp)({type:Zs.AsnPropTypes.OctetString,repeated:"set"})],bd.prototype,"signatureDigests",void 0)});var UE=l(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});var bm=(b(),v(m));bm.__exportStar(Am(),Sd);bm.__exportStar(RE(),Sd);bm.__exportStar(DE(),Sd)});var GE=l(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.verifyAttestationAndroidKey=nq;var KE=S(),QN=Q(),LE=UE(),VE=vr(),XN=fi(),ZN=gn(),eq=pc(),tq=Je(),Sm=se(),rq=ic(),iq=vd();async function nq(r){let{authData:e,clientDataHash:t,attStmt:i,credentialPublicKey:n,aaguid:s,rootCertificates:o}=r,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,tq.isCOSEAlg)(u))throw new Error(`Attestation statement contained invalid alg ${u} (Android Key)`);let d=KE.AsnParser.parse(a[0],QN.Certificate),f=new Uint8Array(d.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey),_=(0,eq.convertCOSEtoPKCS)(n);if(!Sm.isoUint8Array.areEqual(_,f))throw new Error("Credential public key does not equal leaf cert public key (Android Key)");let g=d.tbsCertificate.extensions?.find(ge=>ge.extnID===LE.id_ce_keyDescription);if(!g)throw new Error("Certificate did not contain extKeyStore (Android Key)");let x=KE.AsnParser.parse(g.extnValue,LE.KeyDescription),{attestationChallenge:T,teeEnforced:I,softwareEnforced:U}=x;if(!Sm.isoUint8Array.areEqual(new Uint8Array(T.buffer),t))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 Z=await rq.MetadataService.getStatement(s);if(Z)try{await(0,iq.verifyAttestationWithMetadata)({statement:Z,credentialPublicKey:n,x5c:a,attestationStatementAlg:u})}catch(ge){let ne=ge;throw new Error(`${ne.message} (Android Key)`,{cause:ne})}else{let ge=a.slice(0,-1).map(VE.convertCertBufferToPEM),ne=a.slice(-1).map(VE.convertCertBufferToPEM);try{await(0,XN.validateCertificatePath)(ge,ne)}catch($e){let tt=$e;throw new Error(`${tt.message} (Android Key)`,{cause:tt})}if(o.length>0&&o.indexOf(ne[0])<0)throw new Error("x5c root certificate was not a known root certificate (Android Key)")}let fe=Sm.isoUint8Array.concat([e,t]);return(0,ZN.verifySignature)({signature:c,data:fe,x509Certificate:a[0],hashAlgorithm:u})}});var HE=l(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.verifyAttestationApple=dq;var sq=S(),oq=Q(),aq=fi(),cq=vr(),uq=yn(),lq=pc(),Cm=se();async function dq(r){let{attStmt:e,authData:t,clientDataHash:i,credentialPublicKey:n,rootCertificates:s}=r,o=e.get("x5c");if(!o)throw new Error("No attestation certificate provided in attestation statement (Apple)");try{await(0,aq.validateCertificatePath)(o.map(cq.convertCertBufferToPEM),s)}catch(I){let U=I;throw new Error(`${U.message} (Apple)`)}let a=sq.AsnParser.parse(o[0],oq.Certificate),{extensions:c,subjectPublicKeyInfo:u}=a.tbsCertificate;if(!c)throw new Error("credCert missing extensions (Apple)");let d=c.find(I=>I.extnID==="1.2.840.113635.100.8.2");if(!d)throw new Error('credCert missing "1.2.840.113635.100.8.2" extension (Apple)');let f=Cm.isoUint8Array.concat([t,i]),_=await(0,uq.toHash)(f),g=new Uint8Array(d.extnValue.buffer).slice(6);if(!Cm.isoUint8Array.areEqual(_,g))throw new Error("credCert nonce was not expected value (Apple)");let x=(0,lq.convertCOSEtoPKCS)(n),T=new Uint8Array(u.subjectPublicKey);if(!Cm.isoUint8Array.areEqual(x,T))throw new Error("Credential public key does not equal credCert public key (Apple)");return!0}});var FE=l(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.verifyRegistrationResponse=Oq;var fq=F_(),pq=kd(),hq=o_(),_q=yn(),yq=oo(),gq=Je(),Aq=Id(),vq=tm(),mq=nm(),Em=se(),bq=p_(),Sq=em(),wq=mE(),Cq=TE(),Pq=xE(),Eq=qE(),Tq=GE(),xq=HE();async function Oq(r){let{response:e,expectedChallenge:t,expectedOrigin:i,expectedRPID:n,expectedType:s,requireUserPresence:o=!0,requireUserVerification:a=!0,supportedAlgorithmIDs:c=Sq.supportedCOSEAlgorithmIdentifiers,attestationSafetyNetEnforceCTSCheck:u=!0}=r,{id:d,rawId:f,type:_,response:g}=e;if(!d)throw new Error("Missing credential ID");if(d!==f)throw new Error("Credential ID was not base64url-encoded");if(_!=="public-key")throw new Error(`Unexpected credential type ${_}, expected "public-key"`);let x=(0,pq.decodeClientDataJSON)(g.clientDataJSON),{type:T,origin:I,challenge:U,tokenBinding:Z}=x;if(Array.isArray(s)){if(!s.includes(T)){let z=s.join(", ");throw new Error(`Unexpected registration response type "${T}", expected one of: ${z}`)}}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 t=="function"){if(!await t(U))throw new Error(`Custom challenge verifier returned false for registration response challenge "${U}"`)}else if(U!==t)throw new Error(`Unexpected registration response challenge "${U}", expected "${t}"`);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(Z){if(typeof Z!="object")throw new Error(`Unexpected value for TokenBinding "${Z}"`);if(["present","supported","not-supported"].indexOf(Z.status)<0)throw new Error(`Unexpected tokenBinding.status value of "${Z.status}"`)}let fe=Em.isoBase64URL.toBuffer(g.attestationObject),ge=(0,fq.decodeAttestationObject)(fe),ne=ge.get("fmt"),$e=ge.get("authData"),tt=ge.get("attStmt"),at=(0,hq.parseAuthenticatorData)($e),{aaguid:ct,rpIdHash:_r,flags:Xt,credentialID:yr,counter:Ui,credentialPublicKey:ze,extensionsData:ft}=at,pt;if(n){let z=[];typeof n=="string"?z=[n]:z=n,pt=await(0,mq.matchExpectedRPID)(_r,z)}if(o&&!Xt.up)throw new Error("User presence was required, but user was not present");if(a&&!Xt.uv)throw new Error("User verification was required, but user could not be verified");if(!yr)throw new Error("No credential ID was provided by authenticator");if(!ze)throw new Error("No public key was provided by authenticator");if(!ct)throw new Error("No AAGUID was present during registration");let Ur=(0,yq.decodeCredentialPublicKey)(ze).get(gq.COSEKEYS.alg);if(typeof Ur!="number")throw new Error("Credential public key was missing numeric alg");if(!c.includes(Ur)){let z=c.join(", ");throw new Error(`Unexpected public key alg "${Ur}", expected one of "${z}"`)}let _i=await(0,_q.toHash)(Em.isoBase64URL.toBuffer(g.clientDataJSON)),yi=bq.SettingsService.getRootCertificates({identifier:ne}),Ut={aaguid:ct,attStmt:tt,authData:$e,clientDataHash:_i,credentialID:yr,credentialPublicKey:ze,rootCertificates:yi,rpIdHash:_r,attestationSafetyNetEnforceCTSCheck:u},H=!1;if(ne==="fido-u2f")H=await(0,wq.verifyAttestationFIDOU2F)(Ut);else if(ne==="packed")H=await(0,Cq.verifyAttestationPacked)(Ut);else if(ne==="android-safetynet")H=await(0,Pq.verifyAttestationAndroidSafetyNet)(Ut);else if(ne==="android-key")H=await(0,Tq.verifyAttestationAndroidKey)(Ut);else if(ne==="tpm")H=await(0,Eq.verifyAttestationTPM)(Ut);else if(ne==="apple")H=await(0,xq.verifyAttestationApple)(Ut);else if(ne==="none"){if(tt.size>0)throw new Error("None attestation had unexpected attestation statement");H=!0}else throw new Error(`Unsupported Attestation Format: ${ne}`);if(!H)return{verified:!1};let{credentialDeviceType:Kr,credentialBackedUp:eo}=(0,vq.parseBackupFlags)(Xt);return{verified:!0,registrationInfo:{fmt:ne,aaguid:(0,Aq.convertAAGUIDToString)(ct),credentialType:_,credential:{id:Em.isoBase64URL.fromBuffer(yr),publicKey:ze,counter:Ui,transports:e.response.transports},attestationObject:fe,userVerified:Xt.uv,credentialDeviceType:Kr,credentialBackedUp:eo,origin:x.origin,rpID:pt,authenticatorExtensionResults:ft}}}});var WE=l(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.generateAuthenticationOptions=Bq;var w_=se(),Iq=h_();async function Bq(r){let{allowCredentials:e,challenge:t=await(0,Iq.generateChallenge)(),timeout:i=6e4,userVerification:n="preferred",extensions:s,rpID:o}=r,a=t;return typeof a=="string"&&(a=w_.isoUint8Array.fromUTF8String(a)),{rpId:o,challenge:w_.isoBase64URL.fromBuffer(a),allowCredentials:e?.map(c=>{if(!w_.isoBase64URL.isBase64URL(c.id))throw new Error(`allowCredential id "${c.id}" is not a valid base64url string`);return{...c,id:w_.isoBase64URL.trimPadding(c.id),type:"public-key"}}),timeout:i,userVerification:n,extensions:s}}});var $E=l(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.verifyAuthenticationResponse=Dq;var kq=kd(),jq=yn(),Mq=gn(),Nq=o_(),qq=tm(),Rq=nm(),ac=se();async function Dq(r){let{response:e,expectedChallenge:t,expectedOrigin:i,expectedRPID:n,expectedType:s,credential:o,requireUserVerification:a=!0,advancedFIDOConfig:c}=r,{id:u,rawId:d,type:f,response:_}=e;if(!u)throw new Error("Missing credential ID");if(u!==d)throw new Error("Credential ID was not base64url-encoded");if(f!=="public-key")throw new Error(`Unexpected credential type ${f}, expected "public-key"`);if(!e)throw new Error("Credential missing response");if(typeof _?.clientDataJSON!="string")throw new Error("Credential response clientDataJSON was not a string");let g=(0,kq.decodeClientDataJSON)(_.clientDataJSON),{type:x,origin:T,challenge:I,tokenBinding:U}=g;if(Array.isArray(s)){if(!s.includes(x)){let pt=s.join(", ");throw new Error(`Unexpected authentication response type "${x}", expected one of: ${pt}`)}}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 t=="function"){if(!await t(I))throw new Error(`Custom challenge verifier returned false for registration response challenge "${I}"`)}else if(I!==t)throw new Error(`Unexpected authentication response challenge "${I}", expected "${t}"`);if(Array.isArray(i)){if(!i.includes(T)){let pt=i.join(", ");throw new Error(`Unexpected authentication response origin "${T}", expected one of: ${pt}`)}}else if(T!==i)throw new Error(`Unexpected authentication response origin "${T}", expected "${i}"`);if(!ac.isoBase64URL.isBase64URL(_.authenticatorData))throw new Error("Credential response authenticatorData was not a base64url string");if(!ac.isoBase64URL.isBase64URL(_.signature))throw new Error("Credential response signature was not a base64url string");if(_.userHandle&&typeof _.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 Z=ac.isoBase64URL.toBuffer(_.authenticatorData),fe=(0,Nq.parseAuthenticatorData)(Z),{rpIdHash:ge,flags:ne,counter:$e,extensionsData:tt}=fe,at=[];typeof n=="string"?at=[n]:at=n;let ct=await(0,Rq.matchExpectedRPID)(ge,at);if(c!==void 0){let{userVerification:pt}=c;if(pt==="required"&&!ne.uv)throw new Error("User verification required, but user could not be verified")}else{if(!ne.up)throw new Error("User not present during authentication");if(a&&!ne.uv)throw new Error("User verification required, but user could not be verified")}let _r=await(0,jq.toHash)(ac.isoBase64URL.toBuffer(_.clientDataJSON)),Xt=ac.isoUint8Array.concat([Z,_r]),yr=ac.isoBase64URL.toBuffer(_.signature);if(($e>0||o.counter>0)&&$e<=o.counter)throw new Error(`Response counter value ${$e} was lower than expected ${o.counter}`);let{credentialDeviceType:Ui,credentialBackedUp:ze}=(0,qq.parseBackupFlags)(ne);return{verified:await(0,Mq.verifySignature)({signature:yr,data:Xt,credentialPublicKey:o.publicKey}),authenticationInfo:{newCounter:$e,credentialID:o.id,userVerified:ne.uv,credentialDeviceType:Ui,credentialBackedUp:ze,authenticatorExtensionResults:tt,origin:g.origin,rpID:ct}}}});var YE=l(zE=>{"use strict";Object.defineProperty(zE,"__esModule",{value:!0})});var QE=l(JE=>{"use strict";Object.defineProperty(JE,"__esModule",{value:!0})});var XE=l(Dt=>{"use strict";var Uq=Dt&&Dt.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),wn=Dt&&Dt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Uq(e,r,t)};Object.defineProperty(Dt,"__esModule",{value:!0});wn(em(),Dt);wn(FE(),Dt);wn(WE(),Dt);wn($E(),Dt);wn(ic(),Dt);wn(p_(),Dt);wn(YE(),Dt);wn(QE(),Dt)});module.exports=XE();
|
|
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();
|
|
203
206
|
/*! Bundled license information:
|
|
204
207
|
|
|
205
208
|
pvtsutils/build/index.js:
|