@kong-ui-public/entities-certificates 3.6.74 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(Se,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],o):(Se=typeof globalThis<"u"?globalThis:Se||self,o(Se["kong-ui-public-entities-certificates"]={},Se.Vue,Se.VueRouter,Se.KongIcons,Se["kong-ui-public-i18n"],Se["kong-ui-public-entities-shared"]))})(this,function(Se,o,ci,li,va,T){"use strict";var Yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
1
+ (function(Ae,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("@kong-ui-public/entities-shared"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/entities-shared","vue-router","@kong/icons","@kong-ui-public/i18n"],o):(Ae=typeof globalThis<"u"?globalThis:Ae||self,o(Ae["kong-ui-public-entities-certificates"]={},Ae.Vue,Ae["kong-ui-public-entities-shared"],Ae.VueRouter,Ae.KongIcons,Ae["kong-ui-public-i18n"]))})(this,function(Ae,o,N,di,At,wa){"use strict";const Zu="#d60027",Sa="#00abd2",Aa="24px";var Zn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
2
2
  Copyright (C) Microsoft. All rights reserved.
3
3
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
4
  this file except in compliance with the License. You may obtain a copy of the
@@ -11,7 +11,7 @@
11
11
 
12
12
  See the Apache Version 2.0 License for specific language governing permissions
13
13
  and limitations under the License.
14
- ***************************************************************************** */var ba;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Yn=="object"?Yn:typeof self=="object"?self:typeof this=="object"?this:u(),i=n(r);typeof t.Reflect<"u"&&(i=n(t.Reflect,i)),e(i,t),typeof t.Reflect>"u"&&(t.Reflect=r);function n(f,p){return function(v,y){Object.defineProperty(f,v,{configurable:!0,writable:!0,value:y}),p&&p(v,y)}}function s(){try{return Function("return this;")()}catch{}}function c(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||c()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",c=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,p=!u&&!f,v={create:u?function(){return ma(Object.create(null))}:f?function(){return ma({__proto__:null})}:function(){return ma({})},has:p?function(m,b){return i.call(m,b)}:function(m,b){return b in m},get:p?function(m,b){return i.call(m,b)?m[b]:void 0}:function(m,b){return m[b]}},y=Object.getPrototypeOf(Function),K=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Bp(),E=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Ip(),d=typeof WeakMap=="function"?WeakMap:Ep(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,A=kp(),w=xp(A);function N(m,b,S,_){if(O(S)){if(!Wn(m))throw new TypeError;if(!$u(b))throw new TypeError;return xe(m,b)}else{if(!Wn(m))throw new TypeError;if(!z(b))throw new TypeError;if(!z(_)&&!O(_)&&!L(_))throw new TypeError;return L(_)&&(_=void 0),S=ue(S),ae(m,b,S,_)}}e("decorate",N);function k(m,b){function S(_,G){if(!z(_))throw new TypeError;if(!O(G)&&!Ap(G))throw new TypeError;Cr(m,b,_,G)}return S}e("metadata",k);function B(m,b,S,_){if(!z(S))throw new TypeError;return O(_)||(_=ue(_)),Cr(m,b,S,_)}e("defineMetadata",B);function Y(m,b,S){if(!z(b))throw new TypeError;return O(S)||(S=ue(S)),pe(m,b,S)}e("hasMetadata",Y);function se(m,b,S){if(!z(b))throw new TypeError;return O(S)||(S=ue(S)),at(m,b,S)}e("hasOwnMetadata",se);function $(m,b,S){if(!z(b))throw new TypeError;return O(S)||(S=ue(S)),ee(m,b,S)}e("getMetadata",$);function C(m,b,S){if(!z(b))throw new TypeError;return O(S)||(S=ue(S)),bt(m,b,S)}e("getOwnMetadata",C);function V(m,b){if(!z(m))throw new TypeError;return O(b)||(b=ue(b)),Br(m,b)}e("getMetadataKeys",V);function de(m,b){if(!z(m))throw new TypeError;return O(b)||(b=ue(b)),Tt(m,b)}e("getOwnMetadataKeys",de);function ie(m,b,S){if(!z(b))throw new TypeError;if(O(S)||(S=ue(S)),!z(b))throw new TypeError;O(S)||(S=ue(S));var _=ai(b,S,!1);return O(_)?!1:_.OrdinaryDeleteMetadata(m,b,S)}e("deleteMetadata",ie);function xe(m,b){for(var S=m.length-1;S>=0;--S){var _=m[S],G=_(b);if(!O(G)&&!L(G)){if(!$u(G))throw new TypeError;b=G}}return b}function ae(m,b,S,_){for(var G=m.length-1;G>=0;--G){var ve=m[G],me=ve(b,S,_);if(!O(me)&&!L(me)){if(!z(me))throw new TypeError;_=me}}return _}function pe(m,b,S){var _=at(m,b,S);if(_)return!0;var G=ga(b);return L(G)?!1:pe(m,G,S)}function at(m,b,S){var _=ai(b,S,!1);return O(_)?!1:Ce(_.OrdinaryHasOwnMetadata(m,b,S))}function ee(m,b,S){var _=at(m,b,S);if(_)return bt(m,b,S);var G=ga(b);if(!L(G))return ee(m,G,S)}function bt(m,b,S){var _=ai(b,S,!1);if(!O(_))return _.OrdinaryGetOwnMetadata(m,b,S)}function Cr(m,b,S,_){var G=ai(S,_,!0);G.OrdinaryDefineOwnMetadata(m,b,S,_)}function Br(m,b){var S=Tt(m,b),_=ga(m);if(_===null)return S;var G=Br(_,b);if(G.length<=0)return S;if(S.length<=0)return G;for(var ve=new E,me=[],X=0,R=S;X<R.length;X++){var U=R[X],F=ve.has(U);F||(ve.add(U),me.push(U))}for(var q=0,te=G;q<te.length;q++){var U=te[q],F=ve.has(U);F||(ve.add(U),me.push(U))}return me}function Tt(m,b){var S=ai(m,b,!1);return S?S.OrdinaryOwnMetadataKeys(m,b):[]}function wt(m){if(m===null)return 1;switch(typeof m){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return m===null?1:6;default:return 6}}function O(m){return m===void 0}function L(m){return m===null}function Z(m){return typeof m=="symbol"}function z(m){return typeof m=="object"?m!==null:typeof m=="function"}function $e(m,b){switch(wt(m)){case 0:return m;case 1:return m;case 2:return m;case 3:return m;case 4:return m;case 5:return m}var S="string",_=Uu(m,s);if(_!==void 0){var G=_.call(m,S);if(z(G))throw new TypeError;return G}return Q(m)}function Q(m,b){var S,_;{var G=m.toString;if(Jn(G)){var _=G.call(m);if(!z(_))return _}var S=m.valueOf;if(Jn(S)){var _=S.call(m);if(!z(_))return _}}throw new TypeError}function Ce(m){return!!m}function W(m){return""+m}function ue(m){var b=$e(m);return Z(b)?b:W(b)}function Wn(m){return Array.isArray?Array.isArray(m):m instanceof Object?m instanceof Array:Object.prototype.toString.call(m)==="[object Array]"}function Jn(m){return typeof m=="function"}function $u(m){return typeof m=="function"}function Ap(m){switch(wt(m)){case 3:return!0;case 4:return!0;default:return!1}}function ya(m,b){return m===b||m!==m&&b!==b}function Uu(m,b){var S=m[b];if(S!=null){if(!Jn(S))throw new TypeError;return S}}function Lu(m){var b=Uu(m,c);if(!Jn(b))throw new TypeError;var S=b.call(m);if(!z(S))throw new TypeError;return S}function Hu(m){return m.value}function Fu(m){var b=m.next();return b.done?!1:b}function qu(m){var b=m.return;b&&b.call(m)}function ga(m){var b=Object.getPrototypeOf(m);if(typeof m!="function"||m===y||b!==y)return b;var S=m.prototype,_=S&&Object.getPrototypeOf(S);if(_==null||_===Object.prototype)return b;var G=_.constructor;return typeof G!="function"||G===m?b:G}function Sp(){var m;!O(g)&&typeof t.Reflect<"u"&&!(g in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(m=Cp(t.Reflect));var b,S,_,G=new d,ve={registerProvider:me,getProvider:R,setProvider:F};return ve;function me(q){if(!Object.isExtensible(ve))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case m===q:break;case O(b):b=q;break;case b===q:break;case O(S):S=q;break;case S===q:break;default:_===void 0&&(_=new E),_.add(q);break}}function X(q,te){if(!O(b)){if(b.isProviderFor(q,te))return b;if(!O(S)){if(S.isProviderFor(q,te))return b;if(!O(_))for(var le=Lu(_);;){var he=Fu(le);if(!he)return;var Qe=Hu(he);if(Qe.isProviderFor(q,te))return qu(le),Qe}}}if(!O(m)&&m.isProviderFor(q,te))return m}function R(q,te){var le=G.get(q),he;return O(le)||(he=le.get(te)),O(he)&&(he=X(q,te),O(he)||(O(le)&&(le=new K,G.set(q,le)),le.set(te,he))),he}function U(q){if(O(q))throw new TypeError;return b===q||S===q||!O(_)&&_.has(q)}function F(q,te,le){if(!U(le))throw new Error("Metadata provider not registered.");var he=R(q,te);if(he!==le){if(!O(he))return!1;var Qe=G.get(q);O(Qe)&&(Qe=new K,G.set(q,Qe)),Qe.set(te,le)}return!0}}function kp(){var m;return!O(g)&&z(t.Reflect)&&Object.isExtensible(t.Reflect)&&(m=t.Reflect[g]),O(m)&&(m=Sp()),!O(g)&&z(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:m}),m}function xp(m){var b=new d,S={isProviderFor:function(U,F){var q=b.get(U);return O(q)?!1:q.has(F)},OrdinaryDefineOwnMetadata:me,OrdinaryHasOwnMetadata:G,OrdinaryGetOwnMetadata:ve,OrdinaryOwnMetadataKeys:X,OrdinaryDeleteMetadata:R};return A.registerProvider(S),S;function _(U,F,q){var te=b.get(U),le=!1;if(O(te)){if(!q)return;te=new K,b.set(U,te),le=!0}var he=te.get(F);if(O(he)){if(!q)return;if(he=new K,te.set(F,he),!m.setProvider(U,F,S))throw te.delete(F),le&&b.delete(U),new Error("Wrong provider for target.")}return he}function G(U,F,q){var te=_(F,q,!1);return O(te)?!1:Ce(te.has(U))}function ve(U,F,q){var te=_(F,q,!1);if(!O(te))return te.get(U)}function me(U,F,q,te){var le=_(q,te,!0);le.set(U,F)}function X(U,F){var q=[],te=_(U,F,!1);if(O(te))return q;for(var le=te.keys(),he=Lu(le),Qe=0;;){var Ku=Fu(he);if(!Ku)return q.length=Qe,q;var Np=Hu(Ku);try{q[Qe]=Np}catch(Op){try{qu(he)}finally{throw Op}}Qe++}}function R(U,F,q){var te=_(F,q,!1);if(O(te)||!te.delete(U))return!1;if(te.size===0){var le=b.get(F);O(le)||(le.delete(q),le.size===0&&b.delete(le))}return!0}}function Cp(m){var b=m.defineMetadata,S=m.hasOwnMetadata,_=m.getOwnMetadata,G=m.getOwnMetadataKeys,ve=m.deleteMetadata,me=new d,X={isProviderFor:function(R,U){var F=me.get(R);return!O(F)&&F.has(U)?!0:G(R,U).length?(O(F)&&(F=new E,me.set(R,F)),F.add(U),!0):!1},OrdinaryDefineOwnMetadata:b,OrdinaryHasOwnMetadata:S,OrdinaryGetOwnMetadata:_,OrdinaryOwnMetadataKeys:G,OrdinaryDeleteMetadata:ve};return X}function ai(m,b,S){var _=A.getProvider(m,b);if(!O(_))return _;if(S){if(A.setProvider(m,b,w))return w;throw new Error("Illegal state.")}}function Bp(){var m={},b=[],S=function(){function X(R,U,F){this._index=0,this._keys=R,this._values=U,this._selector=F}return X.prototype["@@iterator"]=function(){return this},X.prototype[c]=function(){return this},X.prototype.next=function(){var R=this._index;if(R>=0&&R<this._keys.length){var U=this._selector(this._keys[R],this._values[R]);return R+1>=this._keys.length?(this._index=-1,this._keys=b,this._values=b):this._index++,{value:U,done:!1}}return{value:void 0,done:!0}},X.prototype.throw=function(R){throw this._index>=0&&(this._index=-1,this._keys=b,this._values=b),R},X.prototype.return=function(R){return this._index>=0&&(this._index=-1,this._keys=b,this._values=b),{value:R,done:!0}},X}(),_=function(){function X(){this._keys=[],this._values=[],this._cacheKey=m,this._cacheIndex=-2}return Object.defineProperty(X.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),X.prototype.has=function(R){return this._find(R,!1)>=0},X.prototype.get=function(R){var U=this._find(R,!1);return U>=0?this._values[U]:void 0},X.prototype.set=function(R,U){var F=this._find(R,!0);return this._values[F]=U,this},X.prototype.delete=function(R){var U=this._find(R,!1);if(U>=0){for(var F=this._keys.length,q=U+1;q<F;q++)this._keys[q-1]=this._keys[q],this._values[q-1]=this._values[q];return this._keys.length--,this._values.length--,ya(R,this._cacheKey)&&(this._cacheKey=m,this._cacheIndex=-2),!0}return!1},X.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=m,this._cacheIndex=-2},X.prototype.keys=function(){return new S(this._keys,this._values,G)},X.prototype.values=function(){return new S(this._keys,this._values,ve)},X.prototype.entries=function(){return new S(this._keys,this._values,me)},X.prototype["@@iterator"]=function(){return this.entries()},X.prototype[c]=function(){return this.entries()},X.prototype._find=function(R,U){if(!ya(this._cacheKey,R)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(ya(this._keys[F],R)){this._cacheIndex=F;break}}return this._cacheIndex<0&&U&&(this._cacheIndex=this._keys.length,this._keys.push(R),this._values.push(void 0)),this._cacheIndex},X}();return _;function G(X,R){return X}function ve(X,R){return R}function me(X,R){return[X,R]}}function Ip(){var m=function(){function b(){this._map=new K}return Object.defineProperty(b.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),b.prototype.has=function(S){return this._map.has(S)},b.prototype.add=function(S){return this._map.set(S,S),this},b.prototype.delete=function(S){return this._map.delete(S)},b.prototype.clear=function(){this._map.clear()},b.prototype.keys=function(){return this._map.keys()},b.prototype.values=function(){return this._map.keys()},b.prototype.entries=function(){return this._map.entries()},b.prototype["@@iterator"]=function(){return this.keys()},b.prototype[c]=function(){return this.keys()},b}();return m}function Ep(){var m=16,b=v.create(),S=_();return function(){function R(){this._key=_()}return R.prototype.has=function(U){var F=G(U,!1);return F!==void 0?v.has(F,this._key):!1},R.prototype.get=function(U){var F=G(U,!1);return F!==void 0?v.get(F,this._key):void 0},R.prototype.set=function(U,F){var q=G(U,!0);return q[this._key]=F,this},R.prototype.delete=function(U){var F=G(U,!1);return F!==void 0?delete F[this._key]:!1},R.prototype.clear=function(){this._key=_()},R}();function _(){var R;do R="@@WeakMap@@"+X();while(v.has(b,R));return b[R]=!0,R}function G(R,U){if(!i.call(R,S)){if(!U)return;Object.defineProperty(R,S,{value:v.create()})}return R[S]}function ve(R,U){for(var F=0;F<U;++F)R[F]=Math.random()*255|0;return R}function me(R){if(typeof Uint8Array=="function"){var U=new Uint8Array(R);return typeof crypto<"u"?crypto.getRandomValues(U):typeof msCrypto<"u"?msCrypto.getRandomValues(U):ve(U,R),U}return ve(new Array(R),R)}function X(){var R=me(m);R[6]=R[6]&79|64,R[8]=R[8]&191|128;for(var U="",F=0;F<m;++F){var q=R[F];(F===4||F===6||F===8)&&(U+="-"),q<16&&(U+="0"),U+=q.toString(16).toLowerCase()}return U}}function ma(m){return m.__=void 0,delete m.__,m}})})(ba||(ba={}));/*!
14
+ ***************************************************************************** */var ka;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Zn=="object"?Zn:typeof self=="object"?self:typeof this=="object"?this:u(),i=n(r);typeof t.Reflect<"u"&&(i=n(t.Reflect,i)),e(i,t),typeof t.Reflect>"u"&&(t.Reflect=r);function n(f,p){return function(b,y){Object.defineProperty(f,b,{configurable:!0,writable:!0,value:y}),p&&p(b,y)}}function s(){try{return Function("return this;")()}catch{}}function c(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||c()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",c=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,p=!u&&!f,b={create:u?function(){return va(Object.create(null))}:f?function(){return va({__proto__:null})}:function(){return va({})},has:p?function(m,v){return i.call(m,v)}:function(m,v){return v in m},get:p?function(m,v){return i.call(m,v)?m[v]:void 0}:function(m,v){return m[v]}},y=Object.getPrototypeOf(Function),K=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Vp(),O=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:_p(),d=typeof WeakMap=="function"?WeakMap:jp(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,S=Np(),w=Op(S);function E(m,v,A,V){if(G(A)){if(!Ce(m))throw new TypeError;if(!xe(v))throw new TypeError;return Ue(m,v)}else{if(!Ce(m))throw new TypeError;if(!F(v))throw new TypeError;if(!F(V)&&!G(V)&&!We(V))throw new TypeError;return We(V)&&(V=void 0),A=J(A),ae(m,v,A,V)}}e("decorate",E);function k(m,v){function A(V,z){if(!F(V))throw new TypeError;if(!G(z)&&!ga(z))throw new TypeError;_t(m,v,V,z)}return A}e("metadata",k);function I(m,v,A,V){if(!F(A))throw new TypeError;return G(V)||(V=J(V)),_t(m,v,A,V)}e("defineMetadata",I);function Q(m,v,A){if(!F(v))throw new TypeError;return G(A)||(A=J(A)),le(m,v,A)}e("hasMetadata",Q);function ee(m,v,A){if(!F(v))throw new TypeError;return G(A)||(A=J(A)),Re(m,v,A)}e("hasOwnMetadata",ee);function $(m,v,A){if(!F(v))throw new TypeError;return G(A)||(A=J(A)),re(m,v,A)}e("getMetadata",$);function x(m,v,A){if(!F(v))throw new TypeError;return G(A)||(A=J(A)),Ir(m,v,A)}e("getOwnMetadata",x);function T(m,v){if(!F(m))throw new TypeError;return G(v)||(v=J(v)),St(m,v)}e("getMetadataKeys",T);function ge(m,v){if(!F(m))throw new TypeError;return G(v)||(v=J(v)),Nr(m,v)}e("getOwnMetadataKeys",ge);function ce(m,v,A){if(!F(v))throw new TypeError;if(G(A)||(A=J(A)),!F(v))throw new TypeError;G(A)||(A=J(A));var V=fi(v,A,!1);return G(V)?!1:V.OrdinaryDeleteMetadata(m,v,A)}e("deleteMetadata",ce);function Ue(m,v){for(var A=m.length-1;A>=0;--A){var V=m[A],z=V(v);if(!G(z)&&!We(z)){if(!xe(z))throw new TypeError;v=z}}return v}function ae(m,v,A,V){for(var z=m.length-1;z>=0;--z){var be=m[z],me=be(v,A,V);if(!G(me)&&!We(me)){if(!F(me))throw new TypeError;V=me}}return V}function le(m,v,A){var V=Re(m,v,A);if(V)return!0;var z=ba(v);return We(z)?!1:le(m,z,A)}function Re(m,v,A){var V=fi(v,A,!1);return G(V)?!1:ie(V.OrdinaryHasOwnMetadata(m,v,A))}function re(m,v,A){var V=Re(m,v,A);if(V)return Ir(m,v,A);var z=ba(v);if(!We(z))return re(m,z,A)}function Ir(m,v,A){var V=fi(v,A,!1);if(!G(V))return V.OrdinaryGetOwnMetadata(m,v,A)}function _t(m,v,A,V){var z=fi(A,V,!0);z.OrdinaryDefineOwnMetadata(m,v,A,V)}function St(m,v){var A=Nr(m,v),V=ba(m);if(V===null)return A;var z=St(V,v);if(z.length<=0)return A;if(A.length<=0)return z;for(var be=new O,me=[],X=0,P=A;X<P.length;X++){var M=P[X],H=be.has(M);H||(be.add(M),me.push(M))}for(var q=0,te=z;q<te.length;q++){var M=te[q],H=be.has(M);H||(be.add(M),me.push(M))}return me}function Nr(m,v){var A=fi(m,v,!1);return A?A.OrdinaryOwnMetadataKeys(m,v):[]}function Or(m){if(m===null)return 1;switch(typeof m){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return m===null?1:6;default:return 6}}function G(m){return m===void 0}function We(m){return m===null}function jt(m){return typeof m=="symbol"}function F(m){return typeof m=="object"?m!==null:typeof m=="function"}function U(m,v){switch(Or(m)){case 0:return m;case 1:return m;case 2:return m;case 3:return m;case 4:return m;case 5:return m}var A="string",V=Fu(m,s);if(V!==void 0){var z=V.call(m,A);if(F(z))throw new TypeError;return z}return Y(m)}function Y(m,v){var A,V;{var z=m.toString;if(W(z)){var V=z.call(m);if(!F(V))return V}var A=m.valueOf;if(W(A)){var V=A.call(m);if(!F(V))return V}}throw new TypeError}function ie(m){return!!m}function Le(m){return""+m}function J(m){var v=U(m);return jt(v)?v:Le(v)}function Ce(m){return Array.isArray?Array.isArray(m):m instanceof Object?m instanceof Array:Object.prototype.toString.call(m)==="[object Array]"}function W(m){return typeof m=="function"}function xe(m){return typeof m=="function"}function ga(m){switch(Or(m)){case 3:return!0;case 4:return!0;default:return!1}}function ma(m,v){return m===v||m!==m&&v!==v}function Fu(m,v){var A=m[v];if(A!=null){if(!W(A))throw new TypeError;return A}}function qu(m){var v=Fu(m,c);if(!W(v))throw new TypeError;var A=v.call(m);if(!F(A))throw new TypeError;return A}function Ku(m){return m.value}function zu(m){var v=m.next();return v.done?!1:v}function Gu(m){var v=m.return;v&&v.call(m)}function ba(m){var v=Object.getPrototypeOf(m);if(typeof m!="function"||m===y||v!==y)return v;var A=m.prototype,V=A&&Object.getPrototypeOf(A);if(V==null||V===Object.prototype)return v;var z=V.constructor;return typeof z!="function"||z===m?v:z}function Ip(){var m;!G(g)&&typeof t.Reflect<"u"&&!(g in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(m=Tp(t.Reflect));var v,A,V,z=new d,be={registerProvider:me,getProvider:P,setProvider:H};return be;function me(q){if(!Object.isExtensible(be))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case m===q:break;case G(v):v=q;break;case v===q:break;case G(A):A=q;break;case A===q:break;default:V===void 0&&(V=new O),V.add(q);break}}function X(q,te){if(!G(v)){if(v.isProviderFor(q,te))return v;if(!G(A)){if(A.isProviderFor(q,te))return v;if(!G(V))for(var fe=qu(V);;){var pe=zu(fe);if(!pe)return;var tt=Ku(pe);if(tt.isProviderFor(q,te))return Gu(fe),tt}}}if(!G(m)&&m.isProviderFor(q,te))return m}function P(q,te){var fe=z.get(q),pe;return G(fe)||(pe=fe.get(te)),G(pe)&&(pe=X(q,te),G(pe)||(G(fe)&&(fe=new K,z.set(q,fe)),fe.set(te,pe))),pe}function M(q){if(G(q))throw new TypeError;return v===q||A===q||!G(V)&&V.has(q)}function H(q,te,fe){if(!M(fe))throw new Error("Metadata provider not registered.");var pe=P(q,te);if(pe!==fe){if(!G(pe))return!1;var tt=z.get(q);G(tt)&&(tt=new K,z.set(q,tt)),tt.set(te,fe)}return!0}}function Np(){var m;return!G(g)&&F(t.Reflect)&&Object.isExtensible(t.Reflect)&&(m=t.Reflect[g]),G(m)&&(m=Ip()),!G(g)&&F(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:m}),m}function Op(m){var v=new d,A={isProviderFor:function(M,H){var q=v.get(M);return G(q)?!1:q.has(H)},OrdinaryDefineOwnMetadata:me,OrdinaryHasOwnMetadata:z,OrdinaryGetOwnMetadata:be,OrdinaryOwnMetadataKeys:X,OrdinaryDeleteMetadata:P};return S.registerProvider(A),A;function V(M,H,q){var te=v.get(M),fe=!1;if(G(te)){if(!q)return;te=new K,v.set(M,te),fe=!0}var pe=te.get(H);if(G(pe)){if(!q)return;if(pe=new K,te.set(H,pe),!m.setProvider(M,H,A))throw te.delete(H),fe&&v.delete(M),new Error("Wrong provider for target.")}return pe}function z(M,H,q){var te=V(H,q,!1);return G(te)?!1:ie(te.has(M))}function be(M,H,q){var te=V(H,q,!1);if(!G(te))return te.get(M)}function me(M,H,q,te){var fe=V(q,te,!0);fe.set(M,H)}function X(M,H){var q=[],te=V(M,H,!1);if(G(te))return q;for(var fe=te.keys(),pe=qu(fe),tt=0;;){var Wu=zu(pe);if(!Wu)return q.length=tt,q;var Pp=Ku(Wu);try{q[tt]=Pp}catch(Rp){try{Gu(pe)}finally{throw Rp}}tt++}}function P(M,H,q){var te=V(H,q,!1);if(G(te)||!te.delete(M))return!1;if(te.size===0){var fe=v.get(H);G(fe)||(fe.delete(q),fe.size===0&&v.delete(fe))}return!0}}function Tp(m){var v=m.defineMetadata,A=m.hasOwnMetadata,V=m.getOwnMetadata,z=m.getOwnMetadataKeys,be=m.deleteMetadata,me=new d,X={isProviderFor:function(P,M){var H=me.get(P);return!G(H)&&H.has(M)?!0:z(P,M).length?(G(H)&&(H=new O,me.set(P,H)),H.add(M),!0):!1},OrdinaryDefineOwnMetadata:v,OrdinaryHasOwnMetadata:A,OrdinaryGetOwnMetadata:V,OrdinaryOwnMetadataKeys:z,OrdinaryDeleteMetadata:be};return X}function fi(m,v,A){var V=S.getProvider(m,v);if(!G(V))return V;if(A){if(S.setProvider(m,v,w))return w;throw new Error("Illegal state.")}}function Vp(){var m={},v=[],A=function(){function X(P,M,H){this._index=0,this._keys=P,this._values=M,this._selector=H}return X.prototype["@@iterator"]=function(){return this},X.prototype[c]=function(){return this},X.prototype.next=function(){var P=this._index;if(P>=0&&P<this._keys.length){var M=this._selector(this._keys[P],this._values[P]);return P+1>=this._keys.length?(this._index=-1,this._keys=v,this._values=v):this._index++,{value:M,done:!1}}return{value:void 0,done:!0}},X.prototype.throw=function(P){throw this._index>=0&&(this._index=-1,this._keys=v,this._values=v),P},X.prototype.return=function(P){return this._index>=0&&(this._index=-1,this._keys=v,this._values=v),{value:P,done:!0}},X}(),V=function(){function X(){this._keys=[],this._values=[],this._cacheKey=m,this._cacheIndex=-2}return Object.defineProperty(X.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),X.prototype.has=function(P){return this._find(P,!1)>=0},X.prototype.get=function(P){var M=this._find(P,!1);return M>=0?this._values[M]:void 0},X.prototype.set=function(P,M){var H=this._find(P,!0);return this._values[H]=M,this},X.prototype.delete=function(P){var M=this._find(P,!1);if(M>=0){for(var H=this._keys.length,q=M+1;q<H;q++)this._keys[q-1]=this._keys[q],this._values[q-1]=this._values[q];return this._keys.length--,this._values.length--,ma(P,this._cacheKey)&&(this._cacheKey=m,this._cacheIndex=-2),!0}return!1},X.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=m,this._cacheIndex=-2},X.prototype.keys=function(){return new A(this._keys,this._values,z)},X.prototype.values=function(){return new A(this._keys,this._values,be)},X.prototype.entries=function(){return new A(this._keys,this._values,me)},X.prototype["@@iterator"]=function(){return this.entries()},X.prototype[c]=function(){return this.entries()},X.prototype._find=function(P,M){if(!ma(this._cacheKey,P)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(ma(this._keys[H],P)){this._cacheIndex=H;break}}return this._cacheIndex<0&&M&&(this._cacheIndex=this._keys.length,this._keys.push(P),this._values.push(void 0)),this._cacheIndex},X}();return V;function z(X,P){return X}function be(X,P){return P}function me(X,P){return[X,P]}}function _p(){var m=function(){function v(){this._map=new K}return Object.defineProperty(v.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),v.prototype.has=function(A){return this._map.has(A)},v.prototype.add=function(A){return this._map.set(A,A),this},v.prototype.delete=function(A){return this._map.delete(A)},v.prototype.clear=function(){this._map.clear()},v.prototype.keys=function(){return this._map.keys()},v.prototype.values=function(){return this._map.keys()},v.prototype.entries=function(){return this._map.entries()},v.prototype["@@iterator"]=function(){return this.keys()},v.prototype[c]=function(){return this.keys()},v}();return m}function jp(){var m=16,v=b.create(),A=V();return function(){function P(){this._key=V()}return P.prototype.has=function(M){var H=z(M,!1);return H!==void 0?b.has(H,this._key):!1},P.prototype.get=function(M){var H=z(M,!1);return H!==void 0?b.get(H,this._key):void 0},P.prototype.set=function(M,H){var q=z(M,!0);return q[this._key]=H,this},P.prototype.delete=function(M){var H=z(M,!1);return H!==void 0?delete H[this._key]:!1},P.prototype.clear=function(){this._key=V()},P}();function V(){var P;do P="@@WeakMap@@"+X();while(b.has(v,P));return v[P]=!0,P}function z(P,M){if(!i.call(P,A)){if(!M)return;Object.defineProperty(P,A,{value:b.create()})}return P[A]}function be(P,M){for(var H=0;H<M;++H)P[H]=Math.random()*255|0;return P}function me(P){if(typeof Uint8Array=="function"){var M=new Uint8Array(P);return typeof crypto<"u"?crypto.getRandomValues(M):typeof msCrypto<"u"?msCrypto.getRandomValues(M):be(M,P),M}return be(new Array(P),P)}function X(){var P=me(m);P[6]=P[6]&79|64,P[8]=P[8]&191|128;for(var M="",H=0;H<m;++H){var q=P[H];(H===4||H===6||H===8)&&(M+="-"),q<16&&(M+="0"),M+=q.toString(16).toLowerCase()}return M}}function va(m){return m.__=void 0,delete m.__,m}})})(ka||(ka={}));/*!
15
15
  * MIT License
16
16
  *
17
17
  * Copyright (c) 2017-2022 Peculiar Ventures, LLC
@@ -34,9 +34,9 @@
34
34
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
35
  * SOFTWARE.
36
36
  *
37
- */const Wu="[object ArrayBuffer]";class j{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Wu}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){const i=j.toUint8Array(e),n=j.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(const c of t)i+=c.byteLength;const n=new Uint8Array(i);let s=0;for(const c of t){const u=this.toUint8Array(c);n.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}}const Zn="string",Ju=/^[0-9a-f]+$/i,Yu=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Zu=/^[a-zA-Z0-9-_]+$/;class wa{static fromString(e){const 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){const t=j.toUint8Array(e);let i="";for(let s=0;s<t.length;s++)i+=String.fromCharCode(t[s]);return decodeURIComponent(escape(i))}}class Xe{static toString(e,t=!1){const i=j.toArrayBuffer(e),n=new DataView(i);let s="";for(let c=0;c<i.byteLength;c+=2){const u=n.getUint16(c,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){const 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}}class H{static isHex(e){return typeof e===Zn&&Ju.test(e)}static isBase64(e){return typeof e===Zn&&Yu.test(e)}static isBase64Url(e){return typeof e===Zn&&Zu.test(e)}static ToString(e,t="utf8"){const i=j.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 Xe.toString(i,!0);case"utf16":case"utf16be":return Xe.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 Xe.fromString(e,!0);case"utf16":case"utf16be":return Xe.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){const t=j.toUint8Array(e);if(typeof btoa<"u"){const i=this.ToString(t,"binary");return btoa(i)}else return Buffer.from(t).toString("base64")}static FromBase64(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!H.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){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!H.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=H.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return wa.fromString(e);case"utf16":case"utf16be":return Xe.fromString(e);case"utf16le":case"usc2":return Xe.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=H.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return wa.toString(e);case"utf16":case"utf16be":return Xe.toString(e);case"utf16le":case"usc2":return Xe.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){const 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){const t=j.toUint8Array(e);let i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){const t=j.toUint8Array(e);let i="";const n=t.length;for(let s=0;s<n;s++){const c=t[s];c<16&&(i+="0"),i+=c.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!H.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);const i=new Uint8Array(t.length/2);for(let n=0;n<t.length;n=n+2){const s=t.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,t=!1){return Xe.toString(e,t)}static FromUtf16String(e,t=!1){return Xe.fromString(e,t)}static Base64Padding(e){const t=4-e.length%4;if(t<4)for(let i=0;i<t;i++)e+="=";return e}static formatString(e){return(e==null?void 0:e.replace(/[\n\r\t ]/g,""))||""}}H.DEFAULT_UTF8_ENCODING="utf8";function Qu(...r){const e=r.map(n=>n.byteLength).reduce((n,s)=>n+s),t=new Uint8Array(e);let i=0;return r.map(n=>new Uint8Array(n)).forEach(n=>{for(const s of n)t[i++]=s}),t.buffer}function Aa(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const 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}/*!
37
+ */const Qu="[object ArrayBuffer]";class _{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Qu}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){const i=_.toUint8Array(e),n=_.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(const c of t)i+=c.byteLength;const n=new Uint8Array(i);let s=0;for(const c of t){const u=this.toUint8Array(c);n.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}}const Qn="string",Xu=/^[0-9a-f]+$/i,ef=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,tf=/^[a-zA-Z0-9-_]+$/;class Ca{static fromString(e){const 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){const t=_.toUint8Array(e);let i="";for(let s=0;s<t.length;s++)i+=String.fromCharCode(t[s]);return decodeURIComponent(escape(i))}}class rt{static toString(e,t=!1){const i=_.toArrayBuffer(e),n=new DataView(i);let s="";for(let c=0;c<i.byteLength;c+=2){const u=n.getUint16(c,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){const 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}}class L{static isHex(e){return typeof e===Qn&&Xu.test(e)}static isBase64(e){return typeof e===Qn&&ef.test(e)}static isBase64Url(e){return typeof e===Qn&&tf.test(e)}static ToString(e,t="utf8"){const i=_.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 rt.toString(i,!0);case"utf16":case"utf16be":return rt.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 rt.fromString(e,!0);case"utf16":case"utf16be":return rt.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){const t=_.toUint8Array(e);if(typeof btoa<"u"){const i=this.ToString(t,"binary");return btoa(i)}else return Buffer.from(t).toString("base64")}static FromBase64(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.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){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.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=L.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Ca.fromString(e);case"utf16":case"utf16be":return rt.fromString(e);case"utf16le":case"usc2":return rt.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=L.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Ca.toString(e);case"utf16":case"utf16be":return rt.toString(e);case"utf16le":case"usc2":return rt.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){const 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){const t=_.toUint8Array(e);let i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){const t=_.toUint8Array(e);let i="";const n=t.length;for(let s=0;s<n;s++){const c=t[s];c<16&&(i+="0"),i+=c.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!L.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);const i=new Uint8Array(t.length/2);for(let n=0;n<t.length;n=n+2){const s=t.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,t=!1){return rt.toString(e,t)}static FromUtf16String(e,t=!1){return rt.fromString(e,t)}static Base64Padding(e){const t=4-e.length%4;if(t<4)for(let i=0;i<t;i++)e+="=";return e}static formatString(e){return(e==null?void 0:e.replace(/[\n\r\t ]/g,""))||""}}L.DEFAULT_UTF8_ENCODING="utf8";function rf(...r){const e=r.map(n=>n.byteLength).reduce((n,s)=>n+s),t=new Uint8Array(e);let i=0;return r.map(n=>new Uint8Array(n)).forEach(n=>{for(const s of n)t[i++]=s}),t.buffer}function xa(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const 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}/*!
38
38
  Copyright (c) Peculiar Ventures, LLC
39
- */function Zt(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 Vt(r,e,t=-1){const i=t;let n=r,s=0,c=Math.pow(2,e);for(let u=1;u<8;u++){if(r<c){let f;if(i<0)f=new ArrayBuffer(u),s=u;else{if(i<u)return new ArrayBuffer(0);f=new ArrayBuffer(i),s=i}const p=new Uint8Array(f);for(let v=u-1;v>=0;v--){const y=Math.pow(2,v*e);p[s-v-1]=Math.floor(n/y),n-=p[s-v-1]*y}return f}c*=Math.pow(2,e)}return new ArrayBuffer(0)}function Qn(...r){let e=0,t=0;for(const s of r)e+=s.length;const i=new ArrayBuffer(e),n=new Uint8Array(i);for(const s of r)n.set(s,t),t+=s.length;return n}function Sa(){const r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const u=r[0]===255&&r[1]&128,f=r[0]===0&&(r[1]&128)===0;(u||f)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;const i=Zt(t,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let u=0;u<this.valueHex.byteLength;u++)s[u]=r[u];return s[0]&=127,Zt(s,8)-i}function Xu(r){const e=r<0?r*-1:r;let t=128;for(let i=1;i<8;i++){if(e<=t){if(r<0){const c=t-e,u=Vt(c,8,i),f=new Uint8Array(u);return f[0]|=128,u}let n=Vt(e,8,i),s=new Uint8Array(n);if(s[0]&128){const c=n.slice(0),u=new Uint8Array(c);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let f=0;f<c.byteLength;f++)s[f+1]=u[f];s[0]=0}return n}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function ef(r,e){if(r.byteLength!==e.byteLength)return!1;const 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 Re(r,e){const t=r.toString(10);if(e<t.length)return"";const i=e-t.length,n=new Array(i);for(let c=0;c<i;c++)n[c]="0";return n.join("").concat(t)}/*!
39
+ */function er(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 Pt(r,e,t=-1){const i=t;let n=r,s=0,c=Math.pow(2,e);for(let u=1;u<8;u++){if(r<c){let f;if(i<0)f=new ArrayBuffer(u),s=u;else{if(i<u)return new ArrayBuffer(0);f=new ArrayBuffer(i),s=i}const p=new Uint8Array(f);for(let b=u-1;b>=0;b--){const y=Math.pow(2,b*e);p[s-b-1]=Math.floor(n/y),n-=p[s-b-1]*y}return f}c*=Math.pow(2,e)}return new ArrayBuffer(0)}function Xn(...r){let e=0,t=0;for(const s of r)e+=s.length;const i=new ArrayBuffer(e),n=new Uint8Array(i);for(const s of r)n.set(s,t),t+=s.length;return n}function Ba(){const r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const u=r[0]===255&&r[1]&128,f=r[0]===0&&(r[1]&128)===0;(u||f)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;const i=er(t,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let u=0;u<this.valueHex.byteLength;u++)s[u]=r[u];return s[0]&=127,er(s,8)-i}function nf(r){const e=r<0?r*-1:r;let t=128;for(let i=1;i<8;i++){if(e<=t){if(r<0){const c=t-e,u=Pt(c,8,i),f=new Uint8Array(u);return f[0]|=128,u}let n=Pt(e,8,i),s=new Uint8Array(n);if(s[0]&128){const c=n.slice(0),u=new Uint8Array(c);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let f=0;f<c.byteLength;f++)s[f+1]=u[f];s[0]=0}return n}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function of(r,e){if(r.byteLength!==e.byteLength)return!1;const 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 De(r,e){const t=r.toString(10);if(e<t.length)return"";const i=e-t.length,n=new Array(i);for(let c=0;c<i;c++)n[c]="0";return n.join("").concat(t)}/*!
40
40
  * Copyright (c) 2014, GMO GlobalSign
41
41
  * Copyright (c) 2015-2022, Peculiar Ventures
42
42
  * All rights reserved.
@@ -68,11 +68,11 @@
68
68
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
69
69
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
70
70
  *
71
- */function ui(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Xn(r){let e=0,t=0;for(let n=0;n<r.length;n++){const s=r[n];e+=s.byteLength}const i=new Uint8Array(e);for(let n=0;n<r.length;n++){const s=r[n];i.set(new Uint8Array(s),t),t+=s.byteLength}return i.buffer}function ct(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)}class fi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Xn(this.items)}}const Ir=[new Uint8Array([1])],ka="0123456789",eo="name",xa="valueHexView",tf="isHexOnly",rf="idBlock",nf="tagClass",of="tagNumber",sf="isConstructed",af="fromBER",cf="toBER",lf="local",Oe="",ze=new ArrayBuffer(0),di=new Uint8Array(0),Er="EndOfContent",Ca="OCTET STRING",Ba="BIT STRING";function et(r){var e;return e=class extends r{constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?j.toUint8Array(s.valueHex):di}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const c=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!ct(this,c,n,s))return-1;const u=n+s;return this.valueHexView=c.subarray(n,u),this.valueHexView.length?(this.blockLength=s,u):(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",ze)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:H.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class _t{constructor({blockLength:e=0,error:t=Oe,warnings:i=[],valueBeforeDecode:n=di}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=j.toUint8Array(n)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:H.ToHex(this.valueBeforeDecodeView)}}}_t.NAME="baseBlock";class Be extends _t{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'")}}Be.NAME="valueBlock";class Ia extends et(_t){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?j.toUint8Array(e.valueHex):di,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",ze}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,n[0]=t}return n.buffer}if(!this.isHexOnly){const n=Vt(this.tagNumber,7),s=new Uint8Array(n),c=n.byteLength,u=new Uint8Array(c+1);if(u[0]=t|31,!e){for(let f=0;f<c-1;f++)u[f+1]=s[f]|128;u[c]=s[c-1]}return u.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=t|31,!e){const 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){const n=j.toUint8Array(e);if(!ct(this,n,t,i))return-1;const 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;const u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let f=1,p=this.valueHexView=new Uint8Array(255),v=255;for(;s[f]&128;){if(p[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===v){v+=255;const K=new Uint8Array(v);for(let E=0;E<p.length;E++)K[E]=p[E];p=this.valueHexView=new Uint8Array(v)}}this.blockLength=f+1,p[f-1]=s[f]&127;const y=new Uint8Array(f);for(let K=0;K<f;K++)y[K]=p[K];p=this.valueHexView=new Uint8Array(f),p.set(y),this.blockLength<=9?this.tagNumber=Zt(p,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}}}Ia.NAME="identificationBlock";class Ea extends _t{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){const n=j.toUint8Array(e);if(!ct(this,n,t,i))return-1;const 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;const c=s[0]&127;if(c>8)return this.error="Too big integer",-1;if(c+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const u=t+1,f=n.subarray(u,u+c);return f[c-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Zt(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=c+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){const n=Vt(this.length,8);if(n.byteLength>127)return this.error="Too big length",ze;if(t=new ArrayBuffer(n.byteLength+1),e)return t;const s=new Uint8Array(n);i=new Uint8Array(t),i[0]=n.byteLength|128;for(let c=0;c<n.byteLength;c++)i[c+1]=s[c];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}}}Ea.NAME="lengthBlock";const M={};class be extends _t{constructor({name:e=Oe,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new Ia(n),this.lenBlock=new Ea(n),this.valueBlock=s?new s(n):new Be(n)}fromBER(e,t,i){const 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){const i=t||new fi;t||Na(this);const 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{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const c=this.lenBlock.toBER(e);i.write(c),i.write(s)}return t?ze:i.final()}toJSON(){const 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():H.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${H.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return ef(t,i)}}be.NAME="BaseBlock";function Na(r){if(r instanceof M.Constructed)for(const e of r.valueBlock.value)Na(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}class to extends be{constructor({value:e=Oe,...t}={},i){super(t,i),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,i){const 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}'`}}to.NAME="BaseStringBlock";class Oa extends et(Be){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}Oa.NAME="PrimitiveValueBlock";var Ta;class Nr extends be{constructor(e={}){super(e,Oa),this.idBlock.isConstructed=!1}}Ta=Nr,M.Primitive=Ta,Nr.NAME="PRIMITIVE";function uf(r,e){if(r instanceof e)return r;const t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function Qt(r,e=0,t=r.length){const i=e;let n=new be({},Be);const s=new _t;if(!ct(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 u=n.idBlock.fromBER(r,e,t);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),u===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(e=u,t-=n.idBlock.blockLength,u=n.lenBlock.fromBER(r,e,t),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),u===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(e=u,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 f=be;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};f=M.EndOfContent;break;case 1:f=M.Boolean;break;case 2:f=M.Integer;break;case 3:f=M.BitString;break;case 4:f=M.OctetString;break;case 5:f=M.Null;break;case 6:f=M.ObjectIdentifier;break;case 10:f=M.Enumerated;break;case 12:f=M.Utf8String;break;case 13:f=M.RelativeObjectIdentifier;break;case 14:f=M.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=M.Sequence;break;case 17:f=M.Set;break;case 18:f=M.NumericString;break;case 19:f=M.PrintableString;break;case 20:f=M.TeletexString;break;case 21:f=M.VideotexString;break;case 22:f=M.IA5String;break;case 23:f=M.UTCTime;break;case 24:f=M.GeneralizedTime;break;case 25:f=M.GraphicString;break;case 26:f=M.VisibleString;break;case 27:f=M.GeneralString;break;case 28:f=M.UniversalString;break;case 29:f=M.CharacterString;break;case 30:f=M.BmpString;break;case 31:f=M.DATE;break;case 32:f=M.TimeOfDay;break;case 33:f=M.DateTime;break;case 34:f=M.Duration;break;default:{const p=n.idBlock.isConstructed?new M.Constructed:new M.Primitive;p.idBlock=n.idBlock,p.lenBlock=n.lenBlock,p.warnings=n.warnings,n=p}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?M.Constructed:M.Primitive}return n=uf(n,f),u=n.fromBER(r,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=r.subarray(i,i+n.blockLength),{offset:u,result:n}}function Xt(r){if(!r.byteLength){const e=new be({},Be);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Qt(j.toUint8Array(r).slice(),0,r.byteLength)}function ff(r,e){return r?1:e}class At extends Be{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=j.toUint8Array(e);if(!ct(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(;ff(this.isIndefiniteForm,i)>0;){const c=Qt(n,s,i);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(s=c.offset,this.blockLength+=c.result.blockLength,i-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===Er)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Er?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new fi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?ze:i.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}At.NAME="ConstructedValueBlock";var Va;class Te extends be{constructor(e={}){super(e,At),this.idBlock.isConstructed=!0}fromBER(e,t,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const 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(){const e=[];for(const i of this.valueBlock.value)e.push(i.toString("ascii").split(`
71
+ */function pi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function eo(r){let e=0,t=0;for(let n=0;n<r.length;n++){const s=r[n];e+=s.byteLength}const i=new Uint8Array(e);for(let n=0;n<r.length;n++){const s=r[n];i.set(new Uint8Array(s),t),t+=s.byteLength}return i.buffer}function ut(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)}class hi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return eo(this.items)}}const Tr=[new Uint8Array([1])],Ea="0123456789",to="name",Ia="valueHexView",sf="isHexOnly",af="idBlock",cf="tagClass",lf="tagNumber",uf="isConstructed",ff="fromBER",df="toBER",pf="local",Oe="",Je=new ArrayBuffer(0),yi=new Uint8Array(0),Vr="EndOfContent",Na="OCTET STRING",Oa="BIT STRING";function it(r){var e;return e=class extends r{constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?_.toUint8Array(s.valueHex):yi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const c=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!ut(this,c,n,s))return-1;const u=n+s;return this.valueHexView=c.subarray(n,u),this.valueHexView.length?(this.blockLength=s,u):(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",Je)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Rt{constructor({blockLength:e=0,error:t=Oe,warnings:i=[],valueBeforeDecode:n=yi}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=_.toUint8Array(n)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:L.ToHex(this.valueBeforeDecodeView)}}}Rt.NAME="baseBlock";class Be extends Rt{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'")}}Be.NAME="valueBlock";class Ta extends it(Rt){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?_.toUint8Array(e.valueHex):yi,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",Je}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,n[0]=t}return n.buffer}if(!this.isHexOnly){const n=Pt(this.tagNumber,7),s=new Uint8Array(n),c=n.byteLength,u=new Uint8Array(c+1);if(u[0]=t|31,!e){for(let f=0;f<c-1;f++)u[f+1]=s[f]|128;u[c]=s[c-1]}return u.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=t|31,!e){const 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){const n=_.toUint8Array(e);if(!ut(this,n,t,i))return-1;const 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;const u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let f=1,p=this.valueHexView=new Uint8Array(255),b=255;for(;s[f]&128;){if(p[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===b){b+=255;const K=new Uint8Array(b);for(let O=0;O<p.length;O++)K[O]=p[O];p=this.valueHexView=new Uint8Array(b)}}this.blockLength=f+1,p[f-1]=s[f]&127;const y=new Uint8Array(f);for(let K=0;K<f;K++)y[K]=p[K];p=this.valueHexView=new Uint8Array(f),p.set(y),this.blockLength<=9?this.tagNumber=er(p,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}}}Ta.NAME="identificationBlock";class Va extends Rt{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){const n=_.toUint8Array(e);if(!ut(this,n,t,i))return-1;const 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;const c=s[0]&127;if(c>8)return this.error="Too big integer",-1;if(c+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const u=t+1,f=n.subarray(u,u+c);return f[c-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=er(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=c+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){const n=Pt(this.length,8);if(n.byteLength>127)return this.error="Too big length",Je;if(t=new ArrayBuffer(n.byteLength+1),e)return t;const s=new Uint8Array(n);i=new Uint8Array(t),i[0]=n.byteLength|128;for(let c=0;c<n.byteLength;c++)i[c+1]=s[c];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}}}Va.NAME="lengthBlock";const D={};class ve extends Rt{constructor({name:e=Oe,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new Ta(n),this.lenBlock=new Va(n),this.valueBlock=s?new s(n):new Be(n)}fromBER(e,t,i){const 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){const i=t||new hi;t||_a(this);const 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{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const c=this.lenBlock.toBER(e);i.write(c),i.write(s)}return t?Je:i.final()}toJSON(){const 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():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return of(t,i)}}ve.NAME="BaseBlock";function _a(r){if(r instanceof D.Constructed)for(const e of r.valueBlock.value)_a(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}class ro extends ve{constructor({value:e=Oe,...t}={},i){super(t,i),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,i){const 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}'`}}ro.NAME="BaseStringBlock";class ja extends it(Be){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}ja.NAME="PrimitiveValueBlock";var Pa;class _r extends ve{constructor(e={}){super(e,ja),this.idBlock.isConstructed=!1}}Pa=_r,D.Primitive=Pa,_r.NAME="PRIMITIVE";function hf(r,e){if(r instanceof e)return r;const t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function tr(r,e=0,t=r.length){const i=e;let n=new ve({},Be);const s=new Rt;if(!ut(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 u=n.idBlock.fromBER(r,e,t);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),u===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(e=u,t-=n.idBlock.blockLength,u=n.lenBlock.fromBER(r,e,t),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),u===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(e=u,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 f=ve;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};f=D.EndOfContent;break;case 1:f=D.Boolean;break;case 2:f=D.Integer;break;case 3:f=D.BitString;break;case 4:f=D.OctetString;break;case 5:f=D.Null;break;case 6:f=D.ObjectIdentifier;break;case 10:f=D.Enumerated;break;case 12:f=D.Utf8String;break;case 13:f=D.RelativeObjectIdentifier;break;case 14:f=D.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=D.Sequence;break;case 17:f=D.Set;break;case 18:f=D.NumericString;break;case 19:f=D.PrintableString;break;case 20:f=D.TeletexString;break;case 21:f=D.VideotexString;break;case 22:f=D.IA5String;break;case 23:f=D.UTCTime;break;case 24:f=D.GeneralizedTime;break;case 25:f=D.GraphicString;break;case 26:f=D.VisibleString;break;case 27:f=D.GeneralString;break;case 28:f=D.UniversalString;break;case 29:f=D.CharacterString;break;case 30:f=D.BmpString;break;case 31:f=D.DATE;break;case 32:f=D.TimeOfDay;break;case 33:f=D.DateTime;break;case 34:f=D.Duration;break;default:{const p=n.idBlock.isConstructed?new D.Constructed:new D.Primitive;p.idBlock=n.idBlock,p.lenBlock=n.lenBlock,p.warnings=n.warnings,n=p}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?D.Constructed:D.Primitive}return n=hf(n,f),u=n.fromBER(r,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=r.subarray(i,i+n.blockLength),{offset:u,result:n}}function rr(r){if(!r.byteLength){const e=new ve({},Be);return e.error="Input buffer has zero length",{offset:-1,result:e}}return tr(_.toUint8Array(r).slice(),0,r.byteLength)}function yf(r,e){return r?1:e}class kt extends Be{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=_.toUint8Array(e);if(!ut(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(;yf(this.isIndefiniteForm,i)>0;){const c=tr(n,s,i);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(s=c.offset,this.blockLength+=c.result.blockLength,i-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===Vr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Vr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new hi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?Je:i.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}kt.NAME="ConstructedValueBlock";var Ra;class Te extends ve{constructor(e={}){super(e,kt),this.idBlock.isConstructed=!0}fromBER(e,t,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const 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(){const e=[];for(const i of this.valueBlock.value)e.push(i.toString("ascii").split(`
72
72
  `).map(n=>` ${n}`).join(`
73
73
  `));const t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
74
74
  ${e.join(`
75
- `)}`:`${t} :`}}Va=Te,M.Constructed=Va,Te.NAME="CONSTRUCTED";class _a extends Be{fromBER(e,t,i){return t}toBER(e){return ze}}_a.override="EndOfContentValueBlock";var ja;class ro extends be{constructor(e={}){super(e,_a),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}ja=ro,M.EndOfContent=ja,ro.NAME=Er;var Pa;class jt extends be{constructor(e={}){super(e,Be),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){const i=new ArrayBuffer(2);if(!e){const n=new Uint8Array(i);n[0]=5,n[1]=0}return t&&t.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}Pa=jt,M.Null=Pa,jt.NAME="NULL";class Ra extends et(Be){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=j.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,i){const n=j.toUint8Array(e);return ct(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,Sa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Ra.NAME="BooleanValueBlock";var Da;let pi=class extends be{constructor(e={}){super(e,Ra),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Da=pi,M.Boolean=Da,pi.NAME="BOOLEAN";class Ma extends et(At){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=At.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const c=this.value[s].constructor.NAME;if(c===Er){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==Ca)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?At.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Ma.NAME="OctetStringValueBlock";var $a;let Pt=class zu extends be{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},Ma),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){const s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+i);try{if(s.byteLength){const c=Qt(s,0,s.byteLength);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Te.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${H.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof zu&&e.push(t.valueBlock.valueHexView);return j.concat(e)}};$a=Pt,M.OctetString=$a,Pt.NAME=Ca;class Ua extends et(At){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=At.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===Er){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==Ba)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const p=u.valueBlock;if(this.unusedBits>0&&p.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=p.unusedBits}return n}const s=j.toUint8Array(e);if(!ct(this,s,t,i))return-1;const c=s.subarray(t,t+i);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=c.subarray(1);try{if(u.byteLength){const f=Qt(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,t+i}toBER(e,t){if(this.isConstructed)return At.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return ze;const 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}}}Ua.NAME="BitStringValueBlock";var La;let Rt=class extends be{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},Ua),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 Te.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const n of t)e.push(n.toString(2).padStart(8,"0"));const i=e.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};La=Rt,M.BitString=La,Rt.NAME=Ba;var Ha;function df(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const c=s.length-1,u=n.slice(0),f=u.length-1;let p=0;const v=f<c?c:f;let y=0;for(let K=v;K>=0;K--,y++){switch(!0){case y<u.length:p=s[c-y]+u[f-y]+t[0];break;default:p=s[c-y]+t[0]}switch(t[0]=p/10,!0){case y>=s.length:s=Qn(new Uint8Array([p%10]),s);break;default:s[c-y]=p%10}}return t[0]>0&&(s=Qn(t,s)),s}function Fa(r){if(r>=Ir.length)for(let e=Ir.length;e<=r;e++){const t=new Uint8Array([0]);let i=Ir[e-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+t[0]]);t[0]=s[0]/10,i[n]=s[0]%10}t[0]>0&&(i=Qn(t,i)),Ir.push(i)}return Ir[r]}function pf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),c=s.length-1,u=n.slice(0),f=u.length-1;let p,v=0;for(let y=f;y>=0;y--,v++)switch(p=s[c-v]-u[f-v]-t,!0){case p<0:t=1,s[c-v]=p+10;break;default:t=0,s[c-v]=p}if(t>0)for(let y=c-f+1;y>=0;y--,v++)if(p=s[c-v]-t,p<0)t=1,s[c-v]=p+10;else{t=0,s[c-v]=p;break}return s.slice()}class io extends et(Be){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}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=Sa.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Xu(e))}get valueDec(){return this._valueDec}fromDER(e,t,i,n=0){const s=this.fromBER(e,t,i);if(s===-1)return s;const c=this.valueHexView;return c[0]===0&&c[1]&128?this.valueHexView=c.subarray(1):n!==0&&c.length<n&&(n-c.length>1&&(n=c.length+1),this.valueHexView=c.subarray(n-c.length)),s}toDER(e=!1){const t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{const 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){const 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(){const e=this.valueHexView.length*8-1;let t=new Uint8Array(this.valueHexView.length*8/3),i=0,n;const s=this.valueHexView;let c="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let p=0;p<8;p++){if((n&1)===1)switch(i){case e:t=pf(Fa(i),t),c="-";break;default:t=df(t,Fa(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(c+=ka.charAt(t[f]));return u===!1&&(c+=ka.charAt(0)),c}}Ha=io,io.NAME="IntegerValueBlock",Object.defineProperty(Ha.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var qa;class tt extends be{constructor(e={}){super(e,io),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return ui(),BigInt(this.valueBlock.toString())}static fromBigInt(e){ui();const t=BigInt(e),i=new fi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(H.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const p=BigInt(`0x${H.ToHex(u)}`)+t,v=j.toUint8Array(H.FromHex(p.toString(16)));v[0]|=128,i.write(v)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new tt({valueHex:i.final()})}convertToDER(){const e=new tt({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new tt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}qa=tt,M.Integer=qa,tt.NAME="INTEGER";var Ka;class hi extends tt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ka=hi,M.Enumerated=Ka,hi.NAME="ENUMERATED";class no extends et(Be){constructor({valueDec:e=-1,isFirstSid:t=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,i){if(!i)return t;const n=j.toUint8Array(e);if(!ct(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(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=Zt(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){ui();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const 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);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Vt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",ze;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=H.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}}}no.NAME="sidBlock";class za extends Be{constructor({value:e=Oe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new no;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){const t=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,ze;t.push(n)}return Xn(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){const c=this.value[0];let u=0;switch(c.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}const f=parseInt(n,10);if(isNaN(f))return;c.valueDec=f+u,s=!1}else{const c=new no;if(n>Number.MAX_SAFE_INTEGER){ui();const u=BigInt(n);c.valueBigInt=u}else if(c.valueDec=parseInt(n,10),isNaN(c.valueDec))return;this.value.length||(c.isFirstSid=!0,s=!0),this.value.push(c)}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(){const 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}}za.NAME="ObjectIdentifierValueBlock";var Ga;class yi extends be{constructor(e={}){super(e,za),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ga=yi,M.ObjectIdentifier=Ga,yi.NAME="OBJECT IDENTIFIER";class oo extends et(_t){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=j.toUint8Array(e);if(!ct(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(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=Zt(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);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Vt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",ze;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=H.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}oo.NAME="relativeSidBlock";class Wa extends Be{constructor({value:e=Oe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new oo;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){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,ze;i.push(s)}return Xn(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;const s=new oo;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(){const 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}}Wa.NAME="RelativeObjectIdentifierValueBlock";var Ja;class so extends be{constructor(e={}){super(e,Wa),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ja=so,M.RelativeObjectIdentifier=Ja,so.NAME="RelativeObjectIdentifier";var Ya;class lt extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ya=lt,M.Sequence=Ya,lt.NAME="SEQUENCE";var Za;let ut=class extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Za=ut,M.Set=Za,ut.NAME="SET";class Qa extends et(Be){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Oe}toJSON(){return{...super.toJSON(),value:this.value}}}Qa.NAME="StringValueBlock";class Xa extends Qa{}Xa.NAME="SimpleStringValueBlock";class De extends to{constructor({...e}={}){super(e,Xa)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,j.toUint8Array(e))}fromString(e){const 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}}De.NAME="SIMPLE STRING";class ec extends De{fromBuffer(e){this.valueBlock.valueHexView=j.toUint8Array(e);try{this.valueBlock.value=H.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=H.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(H.FromUtf8String(e)),this.valueBlock.value=e}}ec.NAME="Utf8StringValueBlock";var tc;class ft extends ec{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}tc=ft,M.Utf8String=tc,ft.NAME="UTF8String";class rc extends De{fromBuffer(e){this.valueBlock.value=H.ToUtf16String(e),this.valueBlock.valueHexView=j.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(H.FromUtf16String(e))}}rc.NAME="BmpStringValueBlock";var ic;class gi extends rc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}ic=gi,M.BmpString=ic,gi.NAME="BMPString";class nc extends De{fromBuffer(e){const 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){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let n=0;n<t;n++){const s=Vt(e.charCodeAt(n),8),c=new Uint8Array(s);if(c.length>4)continue;const u=4-c.length;for(let f=c.length-1;f>=0;f--)i[n*4+f+u]=c[f]}this.valueBlock.value=e}}nc.NAME="UniversalStringValueBlock";var oc;class mi extends nc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}oc=mi,M.UniversalString=oc,mi.NAME="UniversalString";var sc;class vi extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}sc=vi,M.NumericString=sc,vi.NAME="NumericString";var ac;class bi extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}ac=bi,M.PrintableString=ac,bi.NAME="PrintableString";var cc;class wi extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}cc=wi,M.TeletexString=cc,wi.NAME="TeletexString";var lc;class Ai extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}lc=Ai,M.VideotexString=lc,Ai.NAME="VideotexString";var uc;class Si extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}uc=Si,M.IA5String=uc,Si.NAME="IA5String";var fc;class ki extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}fc=ki,M.GraphicString=fc,ki.NAME="GraphicString";var dc;class Or extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}dc=Or,M.VisibleString=dc,Or.NAME="VisibleString";var pc;class xi extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}pc=xi,M.GeneralString=pc,xi.NAME="GeneralString";var hc;class Ci extends De{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}hc=Ci,M.CharacterString=hc,Ci.NAME="CharacterString";var yc;class Tr extends Or{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,j.toUint8Array(e)))}toBuffer(){const 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){const 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}const 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"){const t=new Array(7);return t[0]=Re(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Re(this.month,2),t[2]=Re(this.day,2),t[3]=Re(this.hour,2),t[4]=Re(this.minute,2),t[5]=Re(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}}}yc=Tr,M.UTCTime=yc,Tr.NAME="UTCTime";var gc;class Bi extends Tr{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(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,i="",n="",s=0,c,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const y=new Number(e[e.length-1]);if(isNaN(y.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 y=1,K=i.indexOf("+"),E="";if(K===-1&&(K=i.indexOf("-"),y=-1),K!==-1){if(E=i.substring(K+1),i=i.substring(0,K),E.length!==2&&E.length!==4)throw new Error("Wrong input string for conversion");let d=parseInt(E.substring(0,2),10);if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");if(u=y*d,E.length===4){if(d=parseInt(E.substring(2,4),10),isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");f=y*d}}}let p=i.indexOf(".");if(p===-1&&(p=i.indexOf(",")),p!==-1){const y=new Number(`0${i.substring(p)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),n=i.substring(0,p)}else n=i;switch(!0){case n.length===8:if(c=/(\d{4})(\d{2})(\d{2})/ig,p!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===12:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===14:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){const y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}const v=c.exec(n);if(v===null)throw new Error("Wrong input string for conversion");for(let y=1;y<v.length;y++)switch(y){case 1:this.year=parseInt(v[y],10);break;case 2:this.month=parseInt(v[y],10);break;case 3:this.day=parseInt(v[y],10);break;case 4:this.hour=parseInt(v[y],10)+u;break;case 5:this.minute=parseInt(v[y],10)+f;break;case 6:this.second=parseInt(v[y],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push(Re(this.year,4)),t.push(Re(this.month,2)),t.push(Re(this.day,2)),t.push(Re(this.hour,2)),t.push(Re(this.minute,2)),t.push(Re(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(Re(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}gc=Bi,M.GeneralizedTime=gc,Bi.NAME="GeneralizedTime";var mc;class ao extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}mc=ao,M.DATE=mc,ao.NAME="DATE";var vc;class co extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}vc=co,M.TimeOfDay=vc,co.NAME="TimeOfDay";var bc;class lo extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}bc=lo,M.DateTime=bc,lo.NAME="DateTime";var wc;class uo extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}wc=uo,M.Duration=wc,uo.NAME="Duration";var Ac;class fo extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Ac=fo,M.TIME=Ac,fo.NAME="TIME";class Dt{constructor({name:e=Oe,optional:t=!1}={}){this.name=e,this.optional=t}}class po extends Dt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class Ii extends Dt{constructor({value:e=new Dt,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class hf{constructor({data:e=di}={}){this.dataView=j.toUint8Array(e)}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=j.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=j.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function Mt(r,e,t){if(t instanceof po){for(let s=0;s<t.value.length;s++)if(Mt(r,e,t.value[s]).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(eo)&&(s.name=t.name),s}}if(t instanceof Dt)return t.hasOwnProperty(eo)&&(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(!(rf in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(af in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(cf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const 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(nf)===!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(of)===!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(sf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(tf 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(!(xa in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,c=e.idBlock.valueHexView;if(s.length!==c.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==c[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(r[t.name]=e)),t instanceof M.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof Ii&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let f=!0;for(let p=0;p<t.valueBlock.value.length;p++)f=f&&(t.valueBlock.value[p].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let f=0;f<u;f++)if(f-s>=e.valueBlock.value.length){if(t.valueBlock.value[f].optional===!1){const p={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,Oe),t.name&&(delete r[t.name],p.name=t.name)),p}}else if(t.valueBlock.value[0]instanceof Ii){if(c=Mt(r,e.valueBlock.value[f],t.valueBlock.value[0].value),c.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),c;if(eo in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let p={};lf in t.valueBlock.value[0]&&t.valueBlock.value[0].local?p=e:p=r,typeof p[t.valueBlock.value[0].name]>"u"&&(p[t.valueBlock.value[0].name]=[]),p[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(c=Mt(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),c.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),c;if(c.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&xa in e.valueBlock){const s=Qt(e.valueBlock.valueHexView);if(s.offset===-1){const c={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(delete r[t.name],c.name=t.name)),c}return Mt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function yf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=Qt(j.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Mt(t.result,t.result,e)}const Sc=Object.freeze(Object.defineProperty({__proto__:null,Any:Dt,BaseBlock:be,BaseStringBlock:to,BitString:Rt,BmpString:gi,Boolean:pi,CharacterString:Ci,Choice:po,Constructed:Te,DATE:ao,DateTime:lo,Duration:uo,EndOfContent:ro,Enumerated:hi,GeneralString:xi,GeneralizedTime:Bi,GraphicString:ki,HexBlock:et,IA5String:Si,Integer:tt,Null:jt,NumericString:vi,ObjectIdentifier:yi,OctetString:Pt,Primitive:Nr,PrintableString:bi,RawData:hf,RelativeObjectIdentifier:so,Repeated:Ii,Sequence:lt,Set:ut,TIME:fo,TeletexString:wi,TimeOfDay:co,UTCTime:Tr,UniversalString:mi,Utf8String:ft,ValueBlock:Be,VideotexString:Ai,ViewWriter:fi,VisibleString:Or,compareSchema:Mt,fromBER:Xt,verifySchema:yf},Symbol.toStringTag,{value:"Module"}));var x;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(x||(x={}));var h;(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"})(h||(h={}));class Ei{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(j.isBufferSource(e))this.unusedBits=t,this.value=j.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Rt))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 Rt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Rt({name:e})}toNumber(){let e="";const t=new Uint8Array(this.value);for(const 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);const i=t.length+7>>3;this.unusedBits=(i<<3)-t.length;const 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}}class re{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):j.isBufferSource(e)?this.buffer=j.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Pt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new Pt({valueHex:this.buffer})}toSchema(e){return new Pt({name:e})}}const gf={fromASN:r=>r instanceof jt?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new jt;const e=Xt(r);if(e.result.error)throw new Error(e.result.error);return e.result}},mf={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new tt({value:+r})},vf={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new hi({value:r})},ce={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new tt({valueHex:r})},bf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Rt({valueHex:r})},wf={fromASN:r=>r.valueBlock.toString(),toASN:r=>new yi({value:r})},Af={fromASN:r=>r.valueBlock.value,toASN:r=>new pi({value:r})},Ni={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Pt({valueHex:r})},Sf={fromASN:r=>new re(r.getValue()),toASN:r=>r.toASN()};function Ue(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const kc=Ue(ft),kf=Ue(gi),xf=Ue(mi),Cf=Ue(vi),Bf=Ue(bi),If=Ue(wi),Ef=Ue(Ai),Nf=Ue(Si),Of=Ue(ki),Tf=Ue(Or),Vf=Ue(xi),_f=Ue(Ci),jf={fromASN:r=>r.toDate(),toASN:r=>new Tr({valueDate:r})},Pf={fromASN:r=>r.toDate(),toASN:r=>new Bi({valueDate:r})},Rf={fromASN:()=>null,toASN:()=>new jt};function ho(r){switch(r){case h.Any:return gf;case h.BitString:return bf;case h.BmpString:return kf;case h.Boolean:return Af;case h.CharacterString:return _f;case h.Enumerated:return vf;case h.GeneralString:return Vf;case h.GeneralizedTime:return Pf;case h.GraphicString:return Of;case h.IA5String:return Nf;case h.Integer:return mf;case h.Null:return Rf;case h.NumericString:return Cf;case h.ObjectIdentifier:return wf;case h.OctetString:return Ni;case h.PrintableString:return Bf;case h.TeletexString:return If;case h.UTCTime:return jf;case h.UniversalString:return xf;case h.Utf8String:return kc;case h.VideotexString:return Ef;case h.VisibleString:return Tf;default:return null}}function dt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:dt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function xc(r){var e;if(r){const t=Object.getPrototypeOf(r);return((e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:xc(t)}return!1}function Df(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const 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}class Mf{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){const 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){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:x.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(t,i),t.items=Object.assign({},t.items,i.items)),t}create(e,t){const i=this.items.get(e)||this.createDefault(e),n=[];for(const s in i.items){const c=i.items[s],u=t?s:"";let f;if(typeof c.type=="number"){const v=h[c.type],y=Sc[v];if(!y)throw new Error(`Cannot get ASN1 class by name '${v}'`);f=new y({name:u})}else dt(c.type)?f=new c.type().toSchema(u):c.optional?this.get(c.type).type===x.Choice?f=new Dt({name:u}):(f=this.create(c.type,!1),f.name=u):f=new Dt({name:u});const p=!!c.optional||c.defaultValue!==void 0;if(c.repeated){f.name="";const v=c.repeated==="set"?ut:lt;f=new v({name:"",value:[new Ii({name:u,value:f})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||dt(c.type)){const v=c.repeated?Te:Nr;n.push(new v({name:u,optional:p,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const v=!!c.repeated;let y=v?f:this.get(c.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,n.push(new Te({name:v?"":u,optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:y}))}else n.push(new Te({optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else f.optional=p,n.push(f)}switch(i.type){case x.Sequence:return new lt({value:n,name:""});case x.Set:return new ut({value:n,name:""});case x.Choice:return new po({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){const t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}}const Le=new Mf,I=r=>e=>{let t;Le.has(e)?t=Le.get(e):(t=Le.createDefault(e),Le.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;Le.has(e.constructor)?i=Le.get(e.constructor):(i=Le.createDefault(e.constructor),Le.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=ho(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}i.items[t]=n};class Cc extends Error{constructor(){super(...arguments),this.schemas=[]}}class $f{static parse(e,t){const i=Xt(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){var i;try{if(dt(t))return new t().fromASN(e);const n=Le.get(t);Le.cache(t);let s=n.schema;if(e.constructor===Te&&n.type!==x.Choice){s=new Te({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const f in n.items)delete e[f]}const c=Mt({},e,s);if(!c.verified)throw new Cc(`Data does not match to ${t.name} ASN1 schema. ${c.result.error}`);const u=new t;if(xc(t)){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.");const f=n.itemType;if(typeof f=="number"){const p=ho(f);if(!p)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);return t.from(e.valueBlock.value,v=>p.fromASN(v))}else return t.from(e.valueBlock.value,p=>this.fromASN(p,f))}for(const f in n.items){const p=c.result[f];if(!p)continue;const v=n.items[f],y=v.type;if(typeof y=="number"||dt(y)){const K=(i=v.converter)!==null&&i!==void 0?i:dt(y)?new y:null;if(!K)throw new Error("Converter is empty");if(v.repeated)if(v.implicit){const E=v.repeated==="sequence"?lt:ut,d=new E;d.valueBlock=p.valueBlock;const g=Xt(d.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const A=g.result.valueBlock.value;u[f]=Array.from(A,w=>K.fromASN(w))}else u[f]=Array.from(p,E=>K.fromASN(E));else{let E=p;if(v.implicit){let d;if(dt(y))d=new y().toSchema("");else{const g=h[y],A=Sc[g];if(!A)throw new Error(`Cannot get '${g}' class from asn1js module`);d=new A}d.valueBlock=E.valueBlock,E=Xt(d.toBER(!1)).result}u[f]=K.fromASN(E)}}else if(v.repeated){if(!Array.isArray(p))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");u[f]=Array.from(p,K=>this.fromASN(K,y))}else u[f]=this.fromASN(p,y)}return u}catch(n){throw n instanceof Cc&&n.schemas.push(t.name),n}}}class yo{static serialize(e){return e instanceof be?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&dt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=Le.get(t);Le.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"){const c=ho(i.itemType);if(!c)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>c.toASN(u))}else n=e.map(c=>this.toAsnItem({type:i.itemType},"[]",t,c))}else for(const c in i.items){const u=i.items[c],f=e[c];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&Df(this.serialize(u.defaultValue),this.serialize(f)))continue;const p=yo.toAsnItem(u,c,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||dt(u.type))){const v={};v.valueHex=p instanceof jt?p.valueBeforeDecodeView:p.valueBlock.toBER(),n.push(new Nr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...v}))}else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:p.valueBlock.value}));else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[p]}));else u.repeated?n=n.concat(p):n.push(p)}let s;switch(i.type){case x.Sequence:s=new lt({value:n});break;case x.Set:s=new ut({value:n});break;case x.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"){const c=e.converter;if(!c)throw new Error(`Property '${t}' doesn't have converter for type ${h[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const u=Array.from(n,p=>c.toASN(p)),f=e.repeated==="sequence"?lt:ut;s=new f({value:u})}else s=c.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?lt:ut;s=new u({value:c})}else s=this.toASN(n);return s}}class oe extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class P{static serialize(e){return yo.serialize(e)}static parse(e,t){return $f.parse(e,t)}static toString(e){const t=j.isBufferSource(e)?j.toArrayBuffer(e):P.serialize(e),i=Xt(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function a(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(s=(n<3?c(s):n>3?c(e,t,s):c(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;var Bc={exports:{}};(function(r){(function(e){const t="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",f={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${c})?$`,"i")};function p(d,g){if(d.indexOf("::")!==d.lastIndexOf("::"))return null;let A=0,w=-1,N=(d.match(f.zoneIndex)||[])[0],k,B;for(N&&(N=N.substring(1),d=d.replace(/%.+$/,""));(w=d.indexOf(":",w+1))>=0;)A++;if(d.substr(0,2)==="::"&&A--,d.substr(-2,2)==="::"&&A--,A>g)return null;for(B=g-A,k=":";B--;)k+="0:";return d=d.replace("::",k),d[0]===":"&&(d=d.slice(1)),d[d.length-1]===":"&&(d=d.slice(0,-1)),g=function(){const Y=d.split(":"),se=[];for(let $=0;$<Y.length;$++)se.push(parseInt(Y[$],16));return se}(),{parts:g,zoneId:N}}function v(d,g,A,w){if(d.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let N=0,k;for(;w>0;){if(k=A-w,k<0&&(k=0),d[N]>>k!==g[N]>>k)return!1;w-=A,N+=1}return!0}function y(d){if(s.test(d))return parseInt(d,16);if(d[0]==="0"&&!isNaN(parseInt(d[1],10))){if(n.test(d))return parseInt(d,8);throw new Error(`ipaddr: cannot parse ${d} as octal`)}return parseInt(d,10)}function K(d,g){for(;d.length<g;)d=`0${d}`;return d}const E={};E.IPv4=function(){function d(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let A,w;for(A=0;A<g.length;A++)if(w=g[A],!(0<=w&&w<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return d.prototype.SpecialRanges={unspecified:[[new d([0,0,0,0]),8]],broadcast:[[new d([255,255,255,255]),32]],multicast:[[new d([224,0,0,0]),4]],linkLocal:[[new d([169,254,0,0]),16]],loopback:[[new d([127,0,0,0]),8]],carrierGradeNat:[[new d([100,64,0,0]),10]],private:[[new d([10,0,0,0]),8],[new d([172,16,0,0]),12],[new d([192,168,0,0]),16]],reserved:[[new d([192,0,0,0]),24],[new d([192,0,2,0]),24],[new d([192,88,99,0]),24],[new d([198,18,0,0]),15],[new d([198,51,100,0]),24],[new d([203,0,113,0]),24],[new d([240,0,0,0]),4]],as112:[[new d([192,175,48,0]),24],[new d([192,31,196,0]),24]],amt:[[new d([192,52,193,0]),24]]},d.prototype.kind=function(){return"ipv4"},d.prototype.match=function(g,A){let w;if(A===void 0&&(w=g,g=w[0],A=w[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,g.octets,8,A)},d.prototype.prefixLengthFromSubnetMask=function(){let g=0,A=!1;const w={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let N,k,B;for(N=3;N>=0;N-=1)if(k=this.octets[N],k in w){if(B=w[k],A&&B!==0)return null;B!==8&&(A=!0),g+=B}else return null;return 32-g},d.prototype.range=function(){return E.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){return this.octets.slice(0)},d.prototype.toIPv4MappedAddress=function(){return E.IPv6.parse(`::ffff:${this.toString()}`)},d.prototype.toNormalizedString=function(){return this.toString()},d.prototype.toString=function(){return this.octets.join(".")},d}(),E.IPv4.broadcastAddressFromCIDR=function(d){try{const g=this.parseCIDR(d),A=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),N=[];let k=0;for(;k<4;)N.push(parseInt(A[k],10)|parseInt(w[k],10)^255),k++;return new this(N)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},E.IPv4.isIPv4=function(d){return this.parser(d)!==null},E.IPv4.isValid=function(d){try{return new this(this.parser(d)),!0}catch{return!1}},E.IPv4.isValidCIDR=function(d){try{return this.parseCIDR(d),!0}catch{return!1}},E.IPv4.isValidFourPartDecimal=function(d){return!!(E.IPv4.isValid(d)&&d.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},E.IPv4.networkAddressFromCIDR=function(d){let g,A,w,N,k;try{for(g=this.parseCIDR(d),w=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),N=[],A=0;A<4;)N.push(parseInt(w[A],10)&parseInt(k[A],10)),A++;return new this(N)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},E.IPv4.parse=function(d){const g=this.parser(d);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},E.IPv4.parseCIDR=function(d){let g;if(g=d.match(/^(.+)\/(\d+)$/)){const A=parseInt(g[2]);if(A>=0&&A<=32){const w=[this.parse(g[1]),A];return Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},E.IPv4.parser=function(d){let g,A,w;if(g=d.match(i.fourOctet))return function(){const N=g.slice(1,6),k=[];for(let B=0;B<N.length;B++)A=N[B],k.push(y(A));return k}();if(g=d.match(i.longValue)){if(w=y(g[1]),w>4294967295||w<0)throw new Error("ipaddr: address outside defined range");return function(){const N=[];let k;for(k=0;k<=24;k+=8)N.push(w>>k&255);return N}().reverse()}else return(g=d.match(i.twoOctet))?function(){const N=g.slice(1,4),k=[];if(w=y(N[1]),w>16777215||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(N[0])),k.push(w>>16&255),k.push(w>>8&255),k.push(w&255),k}():(g=d.match(i.threeOctet))?function(){const N=g.slice(1,5),k=[];if(w=y(N[2]),w>65535||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(N[0])),k.push(y(N[1])),k.push(w>>8&255),k.push(w&255),k}():null},E.IPv4.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let A=0;const w=Math.floor(d/8);for(;A<w;)g[A]=255,A++;return w<4&&(g[w]=Math.pow(2,d%8)-1<<8-d%8),new this(g)},E.IPv6=function(){function d(g,A){let w,N;if(g.length===16)for(this.parts=[],w=0;w<=14;w+=2)this.parts.push(g[w]<<8|g[w+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(w=0;w<this.parts.length;w++)if(N=this.parts[w],!(0<=N&&N<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");A&&(this.zoneId=A)}return d.prototype.SpecialRanges={unspecified:[new d([0,0,0,0,0,0,0,0]),128],linkLocal:[new d([65152,0,0,0,0,0,0,0]),10],multicast:[new d([65280,0,0,0,0,0,0,0]),8],loopback:[new d([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new d([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new d([0,0,0,0,0,65535,0,0]),96],discard:[new d([256,0,0,0,0,0,0,0]),64],rfc6145:[new d([0,0,0,0,65535,0,0,0]),96],rfc6052:[new d([100,65435,0,0,0,0,0,0]),96],"6to4":[new d([8194,0,0,0,0,0,0,0]),16],teredo:[new d([8193,0,0,0,0,0,0,0]),32],benchmarking:[new d([8193,2,0,0,0,0,0,0]),48],amt:[new d([8193,3,0,0,0,0,0,0]),32],as112v6:[[new d([8193,4,274,0,0,0,0,0]),48],[new d([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new d([8193,16,0,0,0,0,0,0]),28],orchid2:[new d([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new d([8193,48,0,0,0,0,0,0]),28],reserved:[[new d([8193,0,0,0,0,0,0,0]),23],[new d([8193,3512,0,0,0,0,0,0]),32]]},d.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},d.prototype.kind=function(){return"ipv6"},d.prototype.match=function(g,A){let w;if(A===void 0&&(w=g,g=w[0],A=w[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,g.parts,16,A)},d.prototype.prefixLengthFromSubnetMask=function(){let g=0,A=!1;const w={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let N,k;for(let B=7;B>=0;B-=1)if(N=this.parts[B],N in w){if(k=w[N],A&&k!==0)return null;k!==16&&(A=!0),g+=k}else return null;return 128-g},d.prototype.range=function(){return E.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){let g;const A=[],w=this.parts;for(let N=0;N<w.length;N++)g=w[N],A.push(g>>8),A.push(g&255);return A},d.prototype.toFixedLengthString=function(){const g=(function(){const w=[];for(let N=0;N<this.parts.length;N++)w.push(K(this.parts[N].toString(16),4));return w}).call(this).join(":");let A="";return this.zoneId&&(A=`%${this.zoneId}`),g+A},d.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),A=g[0],w=g[1];return new E.IPv4([A>>8,A&255,w>>8,w&255])},d.prototype.toNormalizedString=function(){const g=(function(){const w=[];for(let N=0;N<this.parts.length;N++)w.push(this.parts[N].toString(16));return w}).call(this).join(":");let A="";return this.zoneId&&(A=`%${this.zoneId}`),g+A},d.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,A=this.toNormalizedString();let w=0,N=-1,k;for(;k=g.exec(A);)k[0].length>N&&(w=k.index,N=k[0].length);return N<0?A:`${A.substring(0,w)}::${A.substring(w+N)}`},d.prototype.toString=function(){return this.toRFC5952String()},d}(),E.IPv6.broadcastAddressFromCIDR=function(d){try{const g=this.parseCIDR(d),A=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),N=[];let k=0;for(;k<16;)N.push(parseInt(A[k],10)|parseInt(w[k],10)^255),k++;return new this(N)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},E.IPv6.isIPv6=function(d){return this.parser(d)!==null},E.IPv6.isValid=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{const g=this.parser(d);return new this(g.parts,g.zoneId),!0}catch{return!1}},E.IPv6.isValidCIDR=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{return this.parseCIDR(d),!0}catch{return!1}},E.IPv6.networkAddressFromCIDR=function(d){let g,A,w,N,k;try{for(g=this.parseCIDR(d),w=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),N=[],A=0;A<16;)N.push(parseInt(w[A],10)&parseInt(k[A],10)),A++;return new this(N)}catch(B){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${B})`)}},E.IPv6.parse=function(d){const g=this.parser(d);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},E.IPv6.parseCIDR=function(d){let g,A,w;if((A=d.match(/^(.+)\/(\d+)$/))&&(g=parseInt(A[2]),g>=0&&g<=128))return w=[this.parse(A[1]),g],Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},E.IPv6.parser=function(d){let g,A,w,N,k,B;if(w=d.match(f.deprecatedTransitional))return this.parser(`::ffff:${w[1]}`);if(f.native.test(d))return p(d,8);if((w=d.match(f.transitional))&&(B=w[6]||"",g=w[1],w[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+B,6),g.parts)){for(k=[parseInt(w[2]),parseInt(w[3]),parseInt(w[4]),parseInt(w[5])],A=0;A<k.length;A++)if(N=k[A],!(0<=N&&N<=255))return null;return g.parts.push(k[0]<<8|k[1]),g.parts.push(k[2]<<8|k[3]),{parts:g.parts,zoneId:g.zoneId}}return null},E.IPv6.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let A=0;const w=Math.floor(d/8);for(;A<w;)g[A]=255,A++;return w<16&&(g[w]=Math.pow(2,d%8)-1<<8-d%8),new this(g)},E.fromByteArray=function(d){const g=d.length;if(g===4)return new E.IPv4(d);if(g===16)return new E.IPv6(d);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},E.isValid=function(d){return E.IPv6.isValid(d)||E.IPv4.isValid(d)},E.isValidCIDR=function(d){return E.IPv6.isValidCIDR(d)||E.IPv4.isValidCIDR(d)},E.parse=function(d){if(E.IPv6.isValid(d))return E.IPv6.parse(d);if(E.IPv4.isValid(d))return E.IPv4.parse(d);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},E.parseCIDR=function(d){try{return E.IPv6.parseCIDR(d)}catch{try{return E.IPv4.parseCIDR(d)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},E.process=function(d){const g=this.parse(d);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},E.subnetMatch=function(d,g,A){let w,N,k,B;A==null&&(A="unicast");for(N in g)if(Object.prototype.hasOwnProperty.call(g,N)){for(k=g[N],k[0]&&!(k[0]instanceof Array)&&(k=[k]),w=0;w<k.length;w++)if(B=k[w],d.kind()===B[0].kind()&&d.match.apply(d,B))return N}return A},r.exports?r.exports=E:e.ipaddr=E})(Yn)})(Bc);var Ic=Bc.exports;class Ec{static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const t=parseInt(e.slice(8),16).toString(2).split("").reduce((n,s)=>n+ +s,0);let i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${t}`}static toString(e){if(e.byteLength===4||e.byteLength===16){const t=new Uint8Array(e);return Ic.fromByteArray(Array.from(t)).toString()}return this.decodeIP(H.ToHex(e))}static fromString(e){const t=Ic.parse(e);return new Uint8Array(t.toByteArray()).buffer}}var go,mo,vo;let we=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:h.TeletexString})],we.prototype,"teletexString",void 0),a([l({type:h.PrintableString})],we.prototype,"printableString",void 0),a([l({type:h.UniversalString})],we.prototype,"universalString",void 0),a([l({type:h.Utf8String})],we.prototype,"utf8String",void 0),a([l({type:h.BmpString})],we.prototype,"bmpString",void 0),we=a([I({type:x.Choice})],we);let er=class extends we{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?H.ToHex(this.anyValue):super.toString())}};a([l({type:h.IA5String})],er.prototype,"ia5String",void 0),a([l({type:h.Any})],er.prototype,"anyValue",void 0),er=a([I({type:x.Choice})],er);class Oi{constructor(e={}){this.type="",this.value=new er,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Oi.prototype,"type",void 0),a([l({type:er})],Oi.prototype,"value",void 0);let tr=go=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,go.prototype)}};tr=go=a([I({type:x.Set,itemType:Oi})],tr);let bo=mo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,mo.prototype)}};bo=mo=a([I({type:x.Sequence,itemType:tr})],bo);let ye=vo=class extends bo{constructor(e){super(e),Object.setPrototypeOf(this,vo.prototype)}};ye=vo=a([I({type:x.Sequence})],ye);const Uf={fromASN:r=>Ec.toString(Ni.fromASN(r)),toASN:r=>Ni.toASN(Ec.fromString(r))};class Vr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Vr.prototype,"typeId",void 0),a([l({type:h.Any,context:0})],Vr.prototype,"value",void 0);class wo{constructor(e={}){this.partyName=new we,Object.assign(this,e)}}a([l({type:we,optional:!0,context:0,implicit:!0})],wo.prototype,"nameAssigner",void 0),a([l({type:we,context:1,implicit:!0})],wo.prototype,"partyName",void 0);let J=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Vr,context:0,implicit:!0})],J.prototype,"otherName",void 0),a([l({type:h.IA5String,context:1,implicit:!0})],J.prototype,"rfc822Name",void 0),a([l({type:h.IA5String,context:2,implicit:!0})],J.prototype,"dNSName",void 0),a([l({type:h.Any,context:3,implicit:!0})],J.prototype,"x400Address",void 0),a([l({type:ye,context:4,implicit:!1})],J.prototype,"directoryName",void 0),a([l({type:wo,context:5})],J.prototype,"ediPartyName",void 0),a([l({type:h.IA5String,context:6,implicit:!0})],J.prototype,"uniformResourceIdentifier",void 0),a([l({type:h.OctetString,context:7,implicit:!0,converter:Uf})],J.prototype,"iPAddress",void 0),a([l({type:h.ObjectIdentifier,context:8,implicit:!0})],J.prototype,"registeredID",void 0),J=a([I({type:x.Choice})],J);const Ao="1.3.6.1.5.5.7",Lf=`${Ao}.1`,rr=`${Ao}.3`,Ti=`${Ao}.48`,Nc=`${Ti}.1`,Oc=`${Ti}.2`,Tc=`${Ti}.3`,Vc=`${Ti}.5`,St="2.5.29";var So;const ko=`${Lf}.1`;class _r{constructor(e={}){this.accessMethod="",this.accessLocation=new J,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],_r.prototype,"accessMethod",void 0),a([l({type:J})],_r.prototype,"accessLocation",void 0);let ir=So=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,So.prototype)}};ir=So=a([I({type:x.Sequence,itemType:_r})],ir);const xo=`${St}.35`;class Co extends re{}class $t{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:Co,context:0,optional:!0,implicit:!0})],$t.prototype,"keyIdentifier",void 0),a([l({type:J,context:1,optional:!0,implicit:!0,repeated:"sequence"})],$t.prototype,"authorityCertIssuer",void 0),a([l({type:h.Integer,context:2,optional:!0,implicit:!0,converter:ce})],$t.prototype,"authorityCertSerialNumber",void 0);const _c=`${St}.19`;class Vi{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:h.Boolean,defaultValue:!1})],Vi.prototype,"cA",void 0),a([l({type:h.Integer,optional:!0})],Vi.prototype,"pathLenConstraint",void 0);var Bo;let Ie=Bo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Bo.prototype)}};Ie=Bo=a([I({type:x.Sequence,itemType:J})],Ie);var Io;let jc=Io=class extends Ie{constructor(e){super(e),Object.setPrototypeOf(this,Io.prototype)}};jc=Io=a([I({type:x.Sequence})],jc);var Eo;const Pc=`${St}.32`;let pt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:h.IA5String})],pt.prototype,"ia5String",void 0),a([l({type:h.VisibleString})],pt.prototype,"visibleString",void 0),a([l({type:h.BmpString})],pt.prototype,"bmpString",void 0),a([l({type:h.Utf8String})],pt.prototype,"utf8String",void 0),pt=a([I({type:x.Choice})],pt);class No{constructor(e={}){this.organization=new pt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:pt})],No.prototype,"organization",void 0),a([l({type:h.Integer,repeated:"sequence"})],No.prototype,"noticeNumbers",void 0);class Oo{constructor(e={}){Object.assign(this,e)}}a([l({type:No,optional:!0})],Oo.prototype,"noticeRef",void 0),a([l({type:pt,optional:!0})],Oo.prototype,"explicitText",void 0);let _i=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.IA5String})],_i.prototype,"cPSuri",void 0),a([l({type:Oo})],_i.prototype,"userNotice",void 0),_i=a([I({type:x.Choice})],_i);class To{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],To.prototype,"policyQualifierId",void 0),a([l({type:h.Any})],To.prototype,"qualifier",void 0);class ji{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ji.prototype,"policyIdentifier",void 0),a([l({type:To,repeated:"sequence",optional:!0})],ji.prototype,"policyQualifiers",void 0);let Pi=Eo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Eo.prototype)}};Pi=Eo=a([I({type:x.Sequence,itemType:ji})],Pi);let Ri=class{constructor(e=0){this.value=e}};a([l({type:h.Integer})],Ri.prototype,"value",void 0),Ri=a([I({type:x.Choice})],Ri);let Rc=class extends Ri{};Rc=a([I({type:x.Choice})],Rc);var Vo;const _o=`${St}.31`;var Ge;(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"})(Ge||(Ge={}));class Dc extends Ei{toJSON(){const e=[],t=this.toNumber();return t&Ge.aACompromise&&e.push("aACompromise"),t&Ge.affiliationChanged&&e.push("affiliationChanged"),t&Ge.cACompromise&&e.push("cACompromise"),t&Ge.certificateHold&&e.push("certificateHold"),t&Ge.cessationOfOperation&&e.push("cessationOfOperation"),t&Ge.keyCompromise&&e.push("keyCompromise"),t&Ge.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Ge.superseded&&e.push("superseded"),t&Ge.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Ut=class{constructor(e={}){Object.assign(this,e)}};a([l({type:J,context:0,repeated:"sequence",implicit:!0})],Ut.prototype,"fullName",void 0),a([l({type:tr,context:1,implicit:!0})],Ut.prototype,"nameRelativeToCRLIssuer",void 0),Ut=a([I({type:x.Choice})],Ut);class nr{constructor(e={}){Object.assign(this,e)}}a([l({type:Ut,context:0,optional:!0})],nr.prototype,"distributionPoint",void 0),a([l({type:Dc,context:1,optional:!0,implicit:!0})],nr.prototype,"reasons",void 0),a([l({type:J,context:2,optional:!0,repeated:"sequence",implicit:!0})],nr.prototype,"cRLIssuer",void 0);let or=Vo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Vo.prototype)}};or=Vo=a([I({type:x.Sequence,itemType:nr})],or);var jo;let Mc=jo=class extends or{constructor(e){super(e),Object.setPrototypeOf(this,jo.prototype)}};Mc=jo=a([I({type:x.Sequence,itemType:nr})],Mc);class ke{constructor(e={}){this.onlyContainsUserCerts=ke.ONLY,this.onlyContainsCACerts=ke.ONLY,this.indirectCRL=ke.ONLY,this.onlyContainsAttributeCerts=ke.ONLY,Object.assign(this,e)}}ke.ONLY=!1,a([l({type:Ut,context:0,optional:!0})],ke.prototype,"distributionPoint",void 0),a([l({type:h.Boolean,context:1,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsUserCerts",void 0),a([l({type:h.Boolean,context:2,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsCACerts",void 0),a([l({type:Dc,context:3,optional:!0,implicit:!0})],ke.prototype,"onlySomeReasons",void 0),a([l({type:h.Boolean,context:4,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"indirectCRL",void 0),a([l({type:h.Boolean,context:5,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsAttributeCerts",void 0);var jr;(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"})(jr||(jr={}));let Po=class{constructor(e=jr.unspecified){this.reason=jr.unspecified,this.reason=e}toJSON(){return jr[this.reason]}toString(){return this.toJSON()}};a([l({type:h.Enumerated})],Po.prototype,"reason",void 0),Po=a([I({type:x.Choice})],Po);var Ro;const $c=`${St}.37`;let Di=Ro=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ro.prototype)}};Di=Ro=a([I({type:x.Sequence,itemType:h.ObjectIdentifier})],Di);const Hf=`${rr}.1`,Ff=`${rr}.2`,qf=`${rr}.3`,Kf=`${rr}.4`,zf=`${rr}.8`,Gf=`${rr}.9`;let Do=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:h.Integer,converter:ce})],Do.prototype,"value",void 0),Do=a([I({type:x.Choice})],Do);let Mo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:h.GeneralizedTime})],Mo.prototype,"value",void 0),Mo=a([I({type:x.Choice})],Mo);var $o;let Uc=$o=class extends Ie{constructor(e){super(e),Object.setPrototypeOf(this,$o.prototype)}};Uc=$o=a([I({type:x.Sequence})],Uc);const Lc=`${St}.15`;var We;(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"})(We||(We={}));class Uo extends Ei{toJSON(){const e=this.toNumber(),t=[];return e&We.cRLSign&&t.push("crlSign"),e&We.dataEncipherment&&t.push("dataEncipherment"),e&We.decipherOnly&&t.push("decipherOnly"),e&We.digitalSignature&&t.push("digitalSignature"),e&We.encipherOnly&&t.push("encipherOnly"),e&We.keyAgreement&&t.push("keyAgreement"),e&We.keyCertSign&&t.push("keyCertSign"),e&We.keyEncipherment&&t.push("keyEncipherment"),e&We.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var Lo;class Mi{constructor(e={}){this.base=new J,this.minimum=0,Object.assign(this,e)}}a([l({type:J})],Mi.prototype,"base",void 0),a([l({type:h.Integer,context:0,defaultValue:0,implicit:!0})],Mi.prototype,"minimum",void 0),a([l({type:h.Integer,context:1,optional:!0,implicit:!0})],Mi.prototype,"maximum",void 0);let $i=Lo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Lo.prototype)}};$i=Lo=a([I({type:x.Sequence,itemType:Mi})],$i);class Hc{constructor(e={}){Object.assign(this,e)}}a([l({type:$i,context:0,optional:!0,implicit:!0})],Hc.prototype,"permittedSubtrees",void 0),a([l({type:$i,context:1,optional:!0,implicit:!0})],Hc.prototype,"excludedSubtrees",void 0);class Fc{constructor(e={}){Object.assign(this,e)}}a([l({type:h.Integer,context:0,implicit:!0,optional:!0,converter:ce})],Fc.prototype,"requireExplicitPolicy",void 0),a([l({type:h.Integer,context:1,implicit:!0,optional:!0,converter:ce})],Fc.prototype,"inhibitPolicyMapping",void 0);var Ho;class Fo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Fo.prototype,"issuerDomainPolicy",void 0),a([l({type:h.ObjectIdentifier})],Fo.prototype,"subjectDomainPolicy",void 0);let qc=Ho=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ho.prototype)}};qc=Ho=a([I({type:x.Sequence,itemType:Fo})],qc);var qo;const Kc=`${St}.17`;let Ko=qo=class extends Ie{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};Ko=qo=a([I({type:x.Sequence})],Ko);let ht=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],ht.prototype,"type",void 0),a([l({type:h.Any,repeated:"set"})],ht.prototype,"values",void 0);var zo;let zc=zo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,zo.prototype)}};zc=zo=a([I({type:x.Sequence,itemType:ht})],zc);const Gc=`${St}.14`;class kt extends Co{}class Wc{constructor(e={}){Object.assign(this,e)}}a([l({type:h.GeneralizedTime,context:0,implicit:!0,optional:!0})],Wc.prototype,"notBefore",void 0),a([l({type:h.GeneralizedTime,context:1,implicit:!0,optional:!0})],Wc.prototype,"notAfter",void 0);var Pr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Pr||(Pr={}));class Jc extends Ei{toJSON(){const e=[],t=this.toNumber();return t&Pr.pKIXCertificate&&e.push("pKIXCertificate"),t&Pr.newExtensions&&e.push("newExtensions"),t&Pr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class Yc{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Jc,Object.assign(this,e)}}a([l({type:h.GeneralString})],Yc.prototype,"entrustVers",void 0),a([l({type:Jc})],Yc.prototype,"entrustInfoFlags",void 0);var Go;let Zc=Go=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Go.prototype)}};Zc=Go=a([I({type:x.Sequence,itemType:_r})],Zc);class D{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof D&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Aa(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:h.ObjectIdentifier})],D.prototype,"algorithm",void 0),a([l({type:h.Any,optional:!0})],D.prototype,"parameters",void 0);class rt{constructor(e={}){this.algorithm=new D,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:D})],rt.prototype,"algorithm",void 0),a([l({type:h.BitString})],rt.prototype,"subjectPublicKey",void 0);let Ae=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const t=new Date(e);t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};a([l({type:h.UTCTime})],Ae.prototype,"utcTime",void 0),a([l({type:h.GeneralizedTime})],Ae.prototype,"generalTime",void 0),Ae=a([I({type:x.Choice})],Ae);class Ui{constructor(e){this.notBefore=new Ae(new Date),this.notAfter=new Ae(new Date),e&&(this.notBefore=new Ae(e.notBefore),this.notAfter=new Ae(e.notAfter))}}a([l({type:Ae})],Ui.prototype,"notBefore",void 0),a([l({type:Ae})],Ui.prototype,"notAfter",void 0);var Wo;let Je=class Gu{constructor(e={}){this.extnID="",this.critical=Gu.CRITICAL,this.extnValue=new re,Object.assign(this,e)}};Je.CRITICAL=!1,a([l({type:h.ObjectIdentifier})],Je.prototype,"extnID",void 0),a([l({type:h.Boolean,defaultValue:Je.CRITICAL})],Je.prototype,"critical",void 0),a([l({type:re})],Je.prototype,"extnValue",void 0);let Lt=Wo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Wo.prototype)}};Lt=Wo=a([I({type:x.Sequence,itemType:Je})],Lt);var sr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(sr||(sr={}));class He{constructor(e={}){this.version=sr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new D,this.issuer=new ye,this.validity=new Ui,this.subject=new ye,this.subjectPublicKeyInfo=new rt,Object.assign(this,e)}}a([l({type:h.Integer,context:0,defaultValue:sr.v1})],He.prototype,"version",void 0),a([l({type:h.Integer,converter:ce})],He.prototype,"serialNumber",void 0),a([l({type:D})],He.prototype,"signature",void 0),a([l({type:ye})],He.prototype,"issuer",void 0),a([l({type:Ui})],He.prototype,"validity",void 0),a([l({type:ye})],He.prototype,"subject",void 0),a([l({type:rt})],He.prototype,"subjectPublicKeyInfo",void 0),a([l({type:h.BitString,context:1,implicit:!0,optional:!0})],He.prototype,"issuerUniqueID",void 0),a([l({type:h.BitString,context:2,implicit:!0,optional:!0})],He.prototype,"subjectUniqueID",void 0),a([l({type:Lt,context:3,optional:!0})],He.prototype,"extensions",void 0);class ar{constructor(e={}){this.tbsCertificate=new He,this.signatureAlgorithm=new D,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:He})],ar.prototype,"tbsCertificate",void 0),a([l({type:D})],ar.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],ar.prototype,"signatureValue",void 0);class Li{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Ae,Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],Li.prototype,"userCertificate",void 0),a([l({type:Ae})],Li.prototype,"revocationDate",void 0),a([l({type:Je,optional:!0,repeated:"sequence"})],Li.prototype,"crlEntryExtensions",void 0);class yt{constructor(e={}){this.signature=new D,this.issuer=new ye,this.thisUpdate=new Ae,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],yt.prototype,"version",void 0),a([l({type:D})],yt.prototype,"signature",void 0),a([l({type:ye})],yt.prototype,"issuer",void 0),a([l({type:Ae})],yt.prototype,"thisUpdate",void 0),a([l({type:Ae,optional:!0})],yt.prototype,"nextUpdate",void 0),a([l({type:Li,repeated:"sequence",optional:!0})],yt.prototype,"revokedCertificates",void 0),a([l({type:Je,optional:!0,context:0,repeated:"sequence"})],yt.prototype,"crlExtensions",void 0);let Jo=class{constructor(e={}){this.tbsCertList=new yt,this.signatureAlgorithm=new D,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:yt})],Jo.prototype,"tbsCertList",void 0),a([l({type:D})],Jo.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Jo.prototype,"signature",void 0);class cr{constructor(e={}){this.issuer=new ye,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:ye})],cr.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ce})],cr.prototype,"serialNumber",void 0);let lr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:kt,context:0,implicit:!0})],lr.prototype,"subjectKeyIdentifier",void 0),a([l({type:cr})],lr.prototype,"issuerAndSerialNumber",void 0),lr=a([I({type:x.Choice})],lr);var gt;(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"})(gt||(gt={}));let Rr=class extends D{};Rr=a([I({type:x.Sequence})],Rr);let Hi=class extends D{};Hi=a([I({type:x.Sequence})],Hi);let it=class extends D{};it=a([I({type:x.Sequence})],it);let Fi=class extends D{};Fi=a([I({type:x.Sequence})],Fi);let Qc=class extends D{};Qc=a([I({type:x.Sequence})],Qc);let Yo=class extends D{};Yo=a([I({type:x.Sequence})],Yo);let ur=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],ur.prototype,"attrType",void 0),a([l({type:h.Any,repeated:"set"})],ur.prototype,"attrValues",void 0);var Zo;class nt{constructor(e={}){this.version=gt.v0,this.sid=new lr,this.digestAlgorithm=new Rr,this.signatureAlgorithm=new Hi,this.signature=new re,Object.assign(this,e)}}a([l({type:h.Integer})],nt.prototype,"version",void 0),a([l({type:lr})],nt.prototype,"sid",void 0),a([l({type:Rr})],nt.prototype,"digestAlgorithm",void 0),a([l({type:ur,repeated:"set",context:0,implicit:!0,optional:!0})],nt.prototype,"signedAttrs",void 0),a([l({type:Hi})],nt.prototype,"signatureAlgorithm",void 0),a([l({type:re})],nt.prototype,"signature",void 0),a([l({type:ur,repeated:"set",context:1,implicit:!0,optional:!0})],nt.prototype,"unsignedAttrs",void 0);let qi=Zo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Zo.prototype)}};qi=Zo=a([I({type:x.Set,itemType:nt})],qi);let Xc=class extends Ae{};Xc=a([I({type:x.Choice})],Xc);let el=class extends nt{};el=a([I({type:x.Sequence})],el);class Qo{constructor(e={}){this.acIssuer=new J,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:J})],Qo.prototype,"acIssuer",void 0),a([l({type:h.Integer})],Qo.prototype,"acSerial",void 0),a([l({type:ht,repeated:"sequence"})],Qo.prototype,"attrs",void 0);var Xo;let Ki=Xo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Xo.prototype)}};Ki=Xo=a([I({type:x.Sequence,itemType:h.ObjectIdentifier})],Ki);class zi{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],zi.prototype,"pathLenConstraint",void 0),a([l({type:Ki,implicit:!0,context:0,optional:!0})],zi.prototype,"permittedAttrs",void 0),a([l({type:Ki,implicit:!0,context:1,optional:!0})],zi.prototype,"excludedAttrs",void 0),a([l({type:h.Boolean,defaultValue:!0})],zi.prototype,"permitUnSpecified",void 0);class Ht{constructor(e={}){this.issuer=new Ie,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ie})],Ht.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ce})],Ht.prototype,"serial",void 0),a([l({type:h.BitString,optional:!0})],Ht.prototype,"issuerUID",void 0);var es;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(es||(es={}));class Ft{constructor(e={}){this.digestedObjectType=es.publicKey,this.digestAlgorithm=new D,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Enumerated})],Ft.prototype,"digestedObjectType",void 0),a([l({type:h.ObjectIdentifier,optional:!0})],Ft.prototype,"otherObjectTypeID",void 0),a([l({type:D})],Ft.prototype,"digestAlgorithm",void 0),a([l({type:h.BitString})],Ft.prototype,"objectDigest",void 0);class Gi{constructor(e={}){Object.assign(this,e)}}a([l({type:Ie,optional:!0})],Gi.prototype,"issuerName",void 0),a([l({type:Ht,context:0,implicit:!0,optional:!0})],Gi.prototype,"baseCertificateID",void 0),a([l({type:Ft,context:1,implicit:!0,optional:!0})],Gi.prototype,"objectDigestInfo",void 0);let fr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:J,repeated:"sequence"})],fr.prototype,"v1Form",void 0),a([l({type:Gi,context:0,implicit:!0})],fr.prototype,"v2Form",void 0),fr=a([I({type:x.Choice})],fr);class Wi{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:h.GeneralizedTime})],Wi.prototype,"notBeforeTime",void 0),a([l({type:h.GeneralizedTime})],Wi.prototype,"notAfterTime",void 0);class Dr{constructor(e={}){Object.assign(this,e)}}a([l({type:Ht,implicit:!0,context:0,optional:!0})],Dr.prototype,"baseCertificateID",void 0),a([l({type:Ie,implicit:!0,context:1,optional:!0})],Dr.prototype,"entityName",void 0),a([l({type:Ft,implicit:!0,context:2,optional:!0})],Dr.prototype,"objectDigestInfo",void 0);var ts;(function(r){r[r.v2=1]="v2"})(ts||(ts={}));class Ye{constructor(e={}){this.version=ts.v2,this.holder=new Dr,this.issuer=new fr,this.signature=new D,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Wi,this.attributes=[],Object.assign(this,e)}}a([l({type:h.Integer})],Ye.prototype,"version",void 0),a([l({type:Dr})],Ye.prototype,"holder",void 0),a([l({type:fr})],Ye.prototype,"issuer",void 0),a([l({type:D})],Ye.prototype,"signature",void 0),a([l({type:h.Integer,converter:ce})],Ye.prototype,"serialNumber",void 0),a([l({type:Wi})],Ye.prototype,"attrCertValidityPeriod",void 0),a([l({type:ht,repeated:"sequence"})],Ye.prototype,"attributes",void 0),a([l({type:h.BitString,optional:!0})],Ye.prototype,"issuerUniqueID",void 0),a([l({type:Lt,optional:!0})],Ye.prototype,"extensions",void 0);class Ji{constructor(e={}){this.acinfo=new Ye,this.signatureAlgorithm=new D,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ye})],Ji.prototype,"acinfo",void 0),a([l({type:D})],Ji.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Ji.prototype,"signatureValue",void 0);var Yi;(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"})(Yi||(Yi={}));class rs extends Ei{}class is{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier,implicit:!0,context:0})],is.prototype,"type",void 0),a([l({type:h.Any,implicit:!0,context:1})],is.prototype,"value",void 0);class ns{constructor(e={}){this.policyId="",this.classList=new rs(Yi.unclassified),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ns.prototype,"policyId",void 0),a([l({type:rs,defaultValue:new rs(Yi.unclassified)})],ns.prototype,"classList",void 0),a([l({type:is,repeated:"set"})],ns.prototype,"securityCategories",void 0);class Zi{constructor(e={}){Object.assign(this,e)}}a([l({type:re})],Zi.prototype,"cotets",void 0),a([l({type:h.ObjectIdentifier})],Zi.prototype,"oid",void 0),a([l({type:h.Utf8String})],Zi.prototype,"string",void 0);class tl{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Ie,implicit:!0,context:0,optional:!0})],tl.prototype,"policyAuthority",void 0),a([l({type:Zi,repeated:"sequence"})],tl.prototype,"values",void 0);var os;class Qi{constructor(e={}){this.targetCertificate=new Ht,Object.assign(this,e)}}a([l({type:Ht})],Qi.prototype,"targetCertificate",void 0),a([l({type:J,optional:!0})],Qi.prototype,"targetName",void 0),a([l({type:Ft,optional:!0})],Qi.prototype,"certDigestInfo",void 0);let dr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:J,context:0,implicit:!0})],dr.prototype,"targetName",void 0),a([l({type:J,context:1,implicit:!0})],dr.prototype,"targetGroup",void 0),a([l({type:Qi,context:2,implicit:!0})],dr.prototype,"targetCert",void 0),dr=a([I({type:x.Choice})],dr);let ss=os=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,os.prototype)}};ss=os=a([I({type:x.Sequence,itemType:dr})],ss);var as;let rl=as=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,as.prototype)}};rl=as=a([I({type:x.Sequence,itemType:ss})],rl);class il{constructor(e={}){Object.assign(this,e)}}a([l({type:Ie,implicit:!0,context:0,optional:!0})],il.prototype,"roleAuthority",void 0),a([l({type:J,implicit:!0,context:1})],il.prototype,"roleName",void 0);class cs{constructor(e={}){this.service=new J,this.ident=new J,Object.assign(this,e)}}a([l({type:J})],cs.prototype,"service",void 0),a([l({type:J})],cs.prototype,"ident",void 0),a([l({type:re,optional:!0})],cs.prototype,"authInfo",void 0);var ls;class us{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],us.prototype,"otherCertFormat",void 0),a([l({type:h.Any})],us.prototype,"otherCert",void 0);let pr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ar})],pr.prototype,"certificate",void 0),a([l({type:Ji,context:2,implicit:!0})],pr.prototype,"v2AttrCert",void 0),a([l({type:us,context:3,implicit:!0})],pr.prototype,"other",void 0),pr=a([I({type:x.Choice})],pr);let Xi=ls=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};Xi=ls=a([I({type:x.Set,itemType:pr})],Xi);class hr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],hr.prototype,"contentType",void 0),a([l({type:h.Any,context:0})],hr.prototype,"content",void 0);let Mr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:re})],Mr.prototype,"single",void 0),a([l({type:h.Any})],Mr.prototype,"any",void 0),Mr=a([I({type:x.Choice})],Mr);class en{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],en.prototype,"eContentType",void 0),a([l({type:Mr,context:0,optional:!0})],en.prototype,"eContent",void 0);let $r=class{constructor(e={}){Object.assign(this,e)}};a([l({type:re,context:0,implicit:!0,optional:!0})],$r.prototype,"value",void 0),a([l({type:re,converter:Sf,context:0,implicit:!0,optional:!0,repeated:"sequence"})],$r.prototype,"constructedValue",void 0),$r=a([I({type:x.Choice})],$r);class Ur{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Fi,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Ur.prototype,"contentType",void 0),a([l({type:Fi})],Ur.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:$r,optional:!0})],Ur.prototype,"encryptedContent",void 0);class tn{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],tn.prototype,"keyAttrId",void 0),a([l({type:h.Any,optional:!0})],tn.prototype,"keyAttr",void 0);var fs;class rn{constructor(e={}){this.subjectKeyIdentifier=new kt,Object.assign(this,e)}}a([l({type:kt})],rn.prototype,"subjectKeyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],rn.prototype,"date",void 0),a([l({type:tn,optional:!0})],rn.prototype,"other",void 0);let yr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:rn,context:0,implicit:!0,optional:!0})],yr.prototype,"rKeyId",void 0),a([l({type:cr,optional:!0})],yr.prototype,"issuerAndSerialNumber",void 0),yr=a([I({type:x.Choice})],yr);class ds{constructor(e={}){this.rid=new yr,this.encryptedKey=new re,Object.assign(this,e)}}a([l({type:yr})],ds.prototype,"rid",void 0),a([l({type:re})],ds.prototype,"encryptedKey",void 0);let nn=fs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,fs.prototype)}};nn=fs=a([I({type:x.Sequence,itemType:ds})],nn);class ps{constructor(e={}){this.algorithm=new D,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:D})],ps.prototype,"algorithm",void 0),a([l({type:h.BitString})],ps.prototype,"publicKey",void 0);let qt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:kt,context:0,implicit:!0,optional:!0})],qt.prototype,"subjectKeyIdentifier",void 0),a([l({type:ps,context:1,implicit:!0,optional:!0})],qt.prototype,"originatorKey",void 0),a([l({type:cr,optional:!0})],qt.prototype,"issuerAndSerialNumber",void 0),qt=a([I({type:x.Choice})],qt);class gr{constructor(e={}){this.version=gt.v3,this.originator=new qt,this.keyEncryptionAlgorithm=new it,this.recipientEncryptedKeys=new nn,Object.assign(this,e)}}a([l({type:h.Integer})],gr.prototype,"version",void 0),a([l({type:qt,context:0})],gr.prototype,"originator",void 0),a([l({type:re,context:1,optional:!0})],gr.prototype,"ukm",void 0),a([l({type:it})],gr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:nn})],gr.prototype,"recipientEncryptedKeys",void 0);let mr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:kt,context:0,implicit:!0})],mr.prototype,"subjectKeyIdentifier",void 0),a([l({type:cr})],mr.prototype,"issuerAndSerialNumber",void 0),mr=a([I({type:x.Choice})],mr);class Lr{constructor(e={}){this.version=gt.v0,this.rid=new mr,this.keyEncryptionAlgorithm=new it,this.encryptedKey=new re,Object.assign(this,e)}}a([l({type:h.Integer})],Lr.prototype,"version",void 0),a([l({type:mr})],Lr.prototype,"rid",void 0),a([l({type:it})],Lr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:re})],Lr.prototype,"encryptedKey",void 0);class Hr{constructor(e={}){this.keyIdentifier=new re,Object.assign(this,e)}}a([l({type:re})],Hr.prototype,"keyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],Hr.prototype,"date",void 0),a([l({type:tn,optional:!0})],Hr.prototype,"other",void 0);class Fr{constructor(e={}){this.version=gt.v4,this.kekid=new Hr,this.keyEncryptionAlgorithm=new it,this.encryptedKey=new re,Object.assign(this,e)}}a([l({type:h.Integer})],Fr.prototype,"version",void 0),a([l({type:Hr})],Fr.prototype,"kekid",void 0),a([l({type:it})],Fr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:re})],Fr.prototype,"encryptedKey",void 0);class qr{constructor(e={}){this.version=gt.v0,this.keyEncryptionAlgorithm=new it,this.encryptedKey=new re,Object.assign(this,e)}}a([l({type:h.Integer})],qr.prototype,"version",void 0),a([l({type:Yo,context:0,optional:!0})],qr.prototype,"keyDerivationAlgorithm",void 0),a([l({type:it})],qr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:re})],qr.prototype,"encryptedKey",void 0);class hs{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],hs.prototype,"oriType",void 0),a([l({type:h.Any})],hs.prototype,"oriValue",void 0);let xt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Lr,optional:!0})],xt.prototype,"ktri",void 0),a([l({type:gr,context:1,implicit:!0,optional:!0})],xt.prototype,"kari",void 0),a([l({type:Fr,context:2,implicit:!0,optional:!0})],xt.prototype,"kekri",void 0),a([l({type:qr,context:3,implicit:!0,optional:!0})],xt.prototype,"pwri",void 0),a([l({type:hs,context:4,implicit:!0,optional:!0})],xt.prototype,"ori",void 0),xt=a([I({type:x.Choice})],xt);var ys;let on=ys=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ys.prototype)}};on=ys=a([I({type:x.Set,itemType:xt})],on);var gs;class sn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],sn.prototype,"otherRevInfoFormat",void 0),a([l({type:h.Any})],sn.prototype,"otherRevInfo",void 0);let an=class{constructor(e={}){this.other=new sn,Object.assign(this,e)}};a([l({type:sn,context:1,implicit:!0})],an.prototype,"other",void 0),an=a([I({type:x.Choice})],an);let cn=gs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,gs.prototype)}};cn=gs=a([I({type:x.Set,itemType:an})],cn);class ms{constructor(e={}){Object.assign(this,e)}}a([l({type:Xi,context:0,implicit:!0,optional:!0})],ms.prototype,"certs",void 0),a([l({type:cn,context:1,implicit:!0,optional:!0})],ms.prototype,"crls",void 0);var vs;let bs=vs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};bs=vs=a([I({type:x.Set,itemType:ur})],bs);class Kr{constructor(e={}){this.version=gt.v0,this.recipientInfos=new on,this.encryptedContentInfo=new Ur,Object.assign(this,e)}}a([l({type:h.Integer})],Kr.prototype,"version",void 0),a([l({type:ms,context:0,implicit:!0,optional:!0})],Kr.prototype,"originatorInfo",void 0),a([l({type:on})],Kr.prototype,"recipientInfos",void 0),a([l({type:Ur})],Kr.prototype,"encryptedContentInfo",void 0),a([l({type:bs,context:1,implicit:!0,optional:!0})],Kr.prototype,"unprotectedAttrs",void 0);const Wf="1.2.840.113549.1.7.2";var ws;let ln=ws=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};ln=ws=a([I({type:x.Set,itemType:Rr})],ln);class vr{constructor(e={}){this.version=gt.v0,this.digestAlgorithms=new ln,this.encapContentInfo=new en,this.signerInfos=new qi,Object.assign(this,e)}}a([l({type:h.Integer})],vr.prototype,"version",void 0),a([l({type:ln})],vr.prototype,"digestAlgorithms",void 0),a([l({type:en})],vr.prototype,"encapContentInfo",void 0),a([l({type:Xi,context:0,implicit:!0,optional:!0})],vr.prototype,"certificates",void 0),a([l({type:cn,context:1,implicit:!0,optional:!0})],vr.prototype,"crls",void 0),a([l({type:qi})],vr.prototype,"signerInfos",void 0);const zr="1.2.840.10045.2.1",As="1.2.840.10045.4.1",nl="1.2.840.10045.4.3.1",Ss="1.2.840.10045.4.3.2",ks="1.2.840.10045.4.3.3",xs="1.2.840.10045.4.3.4",ol="1.2.840.10045.3.1.7",sl="1.3.132.0.34",al="1.3.132.0.35";function Gr(r){return new D({algorithm:r})}const Jf=Gr(As);Gr(nl);const Yf=Gr(Ss),Zf=Gr(ks),Qf=Gr(xs);let Wr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],Wr.prototype,"fieldType",void 0),a([l({type:h.Any})],Wr.prototype,"parameters",void 0),Wr=a([I({type:x.Sequence})],Wr);class Xf extends re{}let br=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.OctetString})],br.prototype,"a",void 0),a([l({type:h.OctetString})],br.prototype,"b",void 0),a([l({type:h.BitString,optional:!0})],br.prototype,"seed",void 0),br=a([I({type:x.Sequence})],br);var Cs;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Cs||(Cs={}));let mt=class{constructor(e={}){this.version=Cs.ecpVer1,Object.assign(this,e)}};a([l({type:h.Integer})],mt.prototype,"version",void 0),a([l({type:Wr})],mt.prototype,"fieldID",void 0),a([l({type:br})],mt.prototype,"curve",void 0),a([l({type:Xf})],mt.prototype,"base",void 0),a([l({type:h.Integer,converter:ce})],mt.prototype,"order",void 0),a([l({type:h.Integer,optional:!0})],mt.prototype,"cofactor",void 0),mt=a([I({type:x.Sequence})],mt);let Ct=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],Ct.prototype,"namedCurve",void 0),a([l({type:h.Null})],Ct.prototype,"implicitCurve",void 0),a([l({type:mt})],Ct.prototype,"specifiedCurve",void 0),Ct=a([I({type:x.Choice})],Ct);class un{constructor(e={}){this.version=1,this.privateKey=new re,Object.assign(this,e)}}a([l({type:h.Integer})],un.prototype,"version",void 0),a([l({type:re})],un.prototype,"privateKey",void 0),a([l({type:Ct,context:0,optional:!0})],un.prototype,"parameters",void 0),a([l({type:h.BitString,context:1,optional:!0})],un.prototype,"publicKey",void 0);class fn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],fn.prototype,"r",void 0),a([l({type:h.Integer,converter:ce})],fn.prototype,"s",void 0);const Ve="1.2.840.113549.1.1",Kt=`${Ve}.1`,ed=`${Ve}.7`,td=`${Ve}.9`,Jr=`${Ve}.10`,rd=`${Ve}.2`,id=`${Ve}.4`,dn=`${Ve}.5`,nd=`${Ve}.14`,Bs=`${Ve}.11`,pn=`${Ve}.12`,hn=`${Ve}.13`,cl=`${Ve}.15`,ll=`${Ve}.16`,yn="1.3.14.3.2.26",ul="2.16.840.1.101.3.4.2.4",gn="2.16.840.1.101.3.4.2.1",mn="2.16.840.1.101.3.4.2.2",vn="2.16.840.1.101.3.4.2.3",od="2.16.840.1.101.3.4.2.5",sd="2.16.840.1.101.3.4.2.6",ad="1.2.840.113549.2.2",cd="1.2.840.113549.2.5",bn=`${Ve}.8`;function ge(r){return new D({algorithm:r,parameters:null})}ge(ad),ge(cd);const zt=ge(yn);ge(ul),ge(gn),ge(mn),ge(vn),ge(od),ge(sd);const fl=new D({algorithm:bn,parameters:P.serialize(zt)}),dl=new D({algorithm:td,parameters:P.serialize(Ni.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ge(Kt),ge(rd),ge(id),ge(dn),ge(cl),ge(ll),ge(pn),ge(hn),ge(cl),ge(ll);class wn{constructor(e={}){this.hashAlgorithm=new D(zt),this.maskGenAlgorithm=new D({algorithm:bn,parameters:P.serialize(zt)}),this.pSourceAlgorithm=new D(dl),Object.assign(this,e)}}a([l({type:D,context:0,defaultValue:zt})],wn.prototype,"hashAlgorithm",void 0),a([l({type:D,context:1,defaultValue:fl})],wn.prototype,"maskGenAlgorithm",void 0),a([l({type:D,context:2,defaultValue:dl})],wn.prototype,"pSourceAlgorithm",void 0),new D({algorithm:ed,parameters:P.serialize(new wn)});class Gt{constructor(e={}){this.hashAlgorithm=new D(zt),this.maskGenAlgorithm=new D({algorithm:bn,parameters:P.serialize(zt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:D,context:0,defaultValue:zt})],Gt.prototype,"hashAlgorithm",void 0),a([l({type:D,context:1,defaultValue:fl})],Gt.prototype,"maskGenAlgorithm",void 0),a([l({type:h.Integer,context:2,defaultValue:20})],Gt.prototype,"saltLength",void 0),a([l({type:h.Integer,context:3,defaultValue:1})],Gt.prototype,"trailerField",void 0),new D({algorithm:Jr,parameters:P.serialize(new Gt)});class An{constructor(e={}){this.digestAlgorithm=new D,this.digest=new re,Object.assign(this,e)}}a([l({type:D})],An.prototype,"digestAlgorithm",void 0),a([l({type:re})],An.prototype,"digest",void 0);var Is;class Sn{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],Sn.prototype,"prime",void 0),a([l({type:h.Integer,converter:ce})],Sn.prototype,"exponent",void 0),a([l({type:h.Integer,converter:ce})],Sn.prototype,"coefficient",void 0);let Es=Is=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Is.prototype)}};Es=Is=a([I({type:x.Sequence,itemType:Sn})],Es);class ot{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)}}a([l({type:h.Integer})],ot.prototype,"version",void 0),a([l({type:h.Integer,converter:ce})],ot.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ce})],ot.prototype,"publicExponent",void 0),a([l({type:h.Integer,converter:ce})],ot.prototype,"privateExponent",void 0),a([l({type:h.Integer,converter:ce})],ot.prototype,"prime1",void 0),a([l({type:h.Integer,converter:ce})],ot.prototype,"prime2",void 0),a([l({type:h.Integer,converter:ce})],ot.prototype,"exponent1",void 0),a([l({type:h.Integer,converter:ce})],ot.prototype,"exponent2",void 0),a([l({type:h.Integer,converter:ce})],ot.prototype,"coefficient",void 0),a([l({type:Es,optional:!0})],ot.prototype,"otherPrimeInfos",void 0);class Ns{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ce})],Ns.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ce})],Ns.prototype,"publicExponent",void 0);var Os;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(Os||(Os={}));const _e=Os;/*! *****************************************************************************
75
+ `)}`:`${t} :`}}Ra=Te,D.Constructed=Ra,Te.NAME="CONSTRUCTED";class Da extends Be{fromBER(e,t,i){return t}toBER(e){return Je}}Da.override="EndOfContentValueBlock";var $a;class io extends ve{constructor(e={}){super(e,Da),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}$a=io,D.EndOfContent=$a,io.NAME=Vr;var Ma;class Dt extends ve{constructor(e={}){super(e,Be),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){const i=new ArrayBuffer(2);if(!e){const n=new Uint8Array(i);n[0]=5,n[1]=0}return t&&t.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}Ma=Dt,D.Null=Ma,Dt.NAME="NULL";class Ua extends it(Be){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=_.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,i){const n=_.toUint8Array(e);return ut(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,Ba.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Ua.NAME="BooleanValueBlock";var La;let gi=class extends ve{constructor(e={}){super(e,Ua),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};La=gi,D.Boolean=La,gi.NAME="BOOLEAN";class Ha extends it(kt){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=kt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const c=this.value[s].constructor.NAME;if(c===Vr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==Na)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?kt.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Ha.NAME="OctetStringValueBlock";var Fa;let $t=class Ju extends ve{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},Ha),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){const s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+i);try{if(s.byteLength){const c=tr(s,0,s.byteLength);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Te.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof Ju&&e.push(t.valueBlock.valueHexView);return _.concat(e)}};Fa=$t,D.OctetString=Fa,$t.NAME=Na;class qa extends it(kt){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=kt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===Vr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==Oa)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const p=u.valueBlock;if(this.unusedBits>0&&p.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=p.unusedBits}return n}const s=_.toUint8Array(e);if(!ut(this,s,t,i))return-1;const c=s.subarray(t,t+i);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=c.subarray(1);try{if(u.byteLength){const f=tr(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,t+i}toBER(e,t){if(this.isConstructed)return kt.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Je;const 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}}}qa.NAME="BitStringValueBlock";var Ka;let Mt=class extends ve{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},qa),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 Te.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const n of t)e.push(n.toString(2).padStart(8,"0"));const i=e.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};Ka=Mt,D.BitString=Ka,Mt.NAME=Oa;var za;function gf(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const c=s.length-1,u=n.slice(0),f=u.length-1;let p=0;const b=f<c?c:f;let y=0;for(let K=b;K>=0;K--,y++){switch(!0){case y<u.length:p=s[c-y]+u[f-y]+t[0];break;default:p=s[c-y]+t[0]}switch(t[0]=p/10,!0){case y>=s.length:s=Xn(new Uint8Array([p%10]),s);break;default:s[c-y]=p%10}}return t[0]>0&&(s=Xn(t,s)),s}function Ga(r){if(r>=Tr.length)for(let e=Tr.length;e<=r;e++){const t=new Uint8Array([0]);let i=Tr[e-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+t[0]]);t[0]=s[0]/10,i[n]=s[0]%10}t[0]>0&&(i=Xn(t,i)),Tr.push(i)}return Tr[r]}function mf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),c=s.length-1,u=n.slice(0),f=u.length-1;let p,b=0;for(let y=f;y>=0;y--,b++)switch(p=s[c-b]-u[f-b]-t,!0){case p<0:t=1,s[c-b]=p+10;break;default:t=0,s[c-b]=p}if(t>0)for(let y=c-f+1;y>=0;y--,b++)if(p=s[c-b]-t,p<0)t=1,s[c-b]=p+10;else{t=0,s[c-b]=p;break}return s.slice()}class no extends it(Be){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}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=Ba.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(nf(e))}get valueDec(){return this._valueDec}fromDER(e,t,i,n=0){const s=this.fromBER(e,t,i);if(s===-1)return s;const c=this.valueHexView;return c[0]===0&&c[1]&128?this.valueHexView=c.subarray(1):n!==0&&c.length<n&&(n-c.length>1&&(n=c.length+1),this.valueHexView=c.subarray(n-c.length)),s}toDER(e=!1){const t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{const 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){const 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(){const e=this.valueHexView.length*8-1;let t=new Uint8Array(this.valueHexView.length*8/3),i=0,n;const s=this.valueHexView;let c="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let p=0;p<8;p++){if((n&1)===1)switch(i){case e:t=mf(Ga(i),t),c="-";break;default:t=gf(t,Ga(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(c+=Ea.charAt(t[f]));return u===!1&&(c+=Ea.charAt(0)),c}}za=no,no.NAME="IntegerValueBlock",Object.defineProperty(za.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Wa;class nt extends ve{constructor(e={}){super(e,no),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return pi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){pi();const t=BigInt(e),i=new hi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const p=BigInt(`0x${L.ToHex(u)}`)+t,b=_.toUint8Array(L.FromHex(p.toString(16)));b[0]|=128,i.write(b)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new nt({valueHex:i.final()})}convertToDER(){const e=new nt({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new nt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Wa=nt,D.Integer=Wa,nt.NAME="INTEGER";var Ja;class mi extends nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ja=mi,D.Enumerated=Ja,mi.NAME="ENUMERATED";class oo extends it(Be){constructor({valueDec:e=-1,isFirstSid:t=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,i){if(!i)return t;const n=_.toUint8Array(e);if(!ut(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(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=er(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){pi();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const 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);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Pt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Je;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=L.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}}}oo.NAME="sidBlock";class Ya extends Be{constructor({value:e=Oe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new oo;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){const t=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,Je;t.push(n)}return eo(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){const c=this.value[0];let u=0;switch(c.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}const f=parseInt(n,10);if(isNaN(f))return;c.valueDec=f+u,s=!1}else{const c=new oo;if(n>Number.MAX_SAFE_INTEGER){pi();const u=BigInt(n);c.valueBigInt=u}else if(c.valueDec=parseInt(n,10),isNaN(c.valueDec))return;this.value.length||(c.isFirstSid=!0,s=!0),this.value.push(c)}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(){const 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}}Ya.NAME="ObjectIdentifierValueBlock";var Za;class bi extends ve{constructor(e={}){super(e,Ya),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Za=bi,D.ObjectIdentifier=Za,bi.NAME="OBJECT IDENTIFIER";class so extends it(Rt){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=_.toUint8Array(e);if(!ut(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(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=er(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);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Pt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Je;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=L.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}so.NAME="relativeSidBlock";class Qa extends Be{constructor({value:e=Oe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new so;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){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,Je;i.push(s)}return eo(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;const s=new so;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(){const 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}}Qa.NAME="RelativeObjectIdentifierValueBlock";var Xa;class ao extends ve{constructor(e={}){super(e,Qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Xa=ao,D.RelativeObjectIdentifier=Xa,ao.NAME="RelativeObjectIdentifier";var ec;class ft extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}ec=ft,D.Sequence=ec,ft.NAME="SEQUENCE";var tc;let dt=class extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};tc=dt,D.Set=tc,dt.NAME="SET";class rc extends it(Be){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Oe}toJSON(){return{...super.toJSON(),value:this.value}}}rc.NAME="StringValueBlock";class ic extends rc{}ic.NAME="SimpleStringValueBlock";class $e extends ro{constructor({...e}={}){super(e,ic)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,_.toUint8Array(e))}fromString(e){const 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}}$e.NAME="SIMPLE STRING";class nc extends $e{fromBuffer(e){this.valueBlock.valueHexView=_.toUint8Array(e);try{this.valueBlock.value=L.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=L.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(e)),this.valueBlock.value=e}}nc.NAME="Utf8StringValueBlock";var oc;class pt extends nc{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}oc=pt,D.Utf8String=oc,pt.NAME="UTF8String";class sc extends $e{fromBuffer(e){this.valueBlock.value=L.ToUtf16String(e),this.valueBlock.valueHexView=_.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(e))}}sc.NAME="BmpStringValueBlock";var ac;class vi extends sc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}ac=vi,D.BmpString=ac,vi.NAME="BMPString";class cc extends $e{fromBuffer(e){const 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){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let n=0;n<t;n++){const s=Pt(e.charCodeAt(n),8),c=new Uint8Array(s);if(c.length>4)continue;const u=4-c.length;for(let f=c.length-1;f>=0;f--)i[n*4+f+u]=c[f]}this.valueBlock.value=e}}cc.NAME="UniversalStringValueBlock";var lc;class wi extends cc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}lc=wi,D.UniversalString=lc,wi.NAME="UniversalString";var uc;class Si extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}uc=Si,D.NumericString=uc,Si.NAME="NumericString";var fc;class Ai extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}fc=Ai,D.PrintableString=fc,Ai.NAME="PrintableString";var dc;class ki extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}dc=ki,D.TeletexString=dc,ki.NAME="TeletexString";var pc;class Ci extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}pc=Ci,D.VideotexString=pc,Ci.NAME="VideotexString";var hc;class xi extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}hc=xi,D.IA5String=hc,xi.NAME="IA5String";var yc;class Bi extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}yc=Bi,D.GraphicString=yc,Bi.NAME="GraphicString";var gc;class jr extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}gc=jr,D.VisibleString=gc,jr.NAME="VisibleString";var mc;class Ei extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}mc=Ei,D.GeneralString=mc,Ei.NAME="GeneralString";var bc;class Ii extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}bc=Ii,D.CharacterString=bc,Ii.NAME="CharacterString";var vc;class Pr extends jr{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,_.toUint8Array(e)))}toBuffer(){const 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){const 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}const 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"){const t=new Array(7);return t[0]=De(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=De(this.month,2),t[2]=De(this.day,2),t[3]=De(this.hour,2),t[4]=De(this.minute,2),t[5]=De(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}}}vc=Pr,D.UTCTime=vc,Pr.NAME="UTCTime";var wc;class Ni extends Pr{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(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,i="",n="",s=0,c,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const y=new Number(e[e.length-1]);if(isNaN(y.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 y=1,K=i.indexOf("+"),O="";if(K===-1&&(K=i.indexOf("-"),y=-1),K!==-1){if(O=i.substring(K+1),i=i.substring(0,K),O.length!==2&&O.length!==4)throw new Error("Wrong input string for conversion");let d=parseInt(O.substring(0,2),10);if(isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");if(u=y*d,O.length===4){if(d=parseInt(O.substring(2,4),10),isNaN(d.valueOf()))throw new Error("Wrong input string for conversion");f=y*d}}}let p=i.indexOf(".");if(p===-1&&(p=i.indexOf(",")),p!==-1){const y=new Number(`0${i.substring(p)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),n=i.substring(0,p)}else n=i;switch(!0){case n.length===8:if(c=/(\d{4})(\d{2})(\d{2})/ig,p!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===12:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===14:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){const y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}const b=c.exec(n);if(b===null)throw new Error("Wrong input string for conversion");for(let y=1;y<b.length;y++)switch(y){case 1:this.year=parseInt(b[y],10);break;case 2:this.month=parseInt(b[y],10);break;case 3:this.day=parseInt(b[y],10);break;case 4:this.hour=parseInt(b[y],10)+u;break;case 5:this.minute=parseInt(b[y],10)+f;break;case 6:this.second=parseInt(b[y],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push(De(this.year,4)),t.push(De(this.month,2)),t.push(De(this.day,2)),t.push(De(this.hour,2)),t.push(De(this.minute,2)),t.push(De(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(De(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}wc=Ni,D.GeneralizedTime=wc,Ni.NAME="GeneralizedTime";var Sc;class co extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Sc=co,D.DATE=Sc,co.NAME="DATE";var Ac;class lo extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Ac=lo,D.TimeOfDay=Ac,lo.NAME="TimeOfDay";var kc;class uo extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}kc=uo,D.DateTime=kc,uo.NAME="DateTime";var Cc;class fo extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Cc=fo,D.Duration=Cc,fo.NAME="Duration";var xc;class po extends pt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}xc=po,D.TIME=xc,po.NAME="TIME";class Ut{constructor({name:e=Oe,optional:t=!1}={}){this.name=e,this.optional=t}}class ho extends Ut{constructor({value:e=[],...t}={}){super(t),this.value=e}}class Oi extends Ut{constructor({value:e=new Ut,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class bf{constructor({data:e=yi}={}){this.dataView=_.toUint8Array(e)}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=_.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=_.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function Lt(r,e,t){if(t instanceof ho){for(let s=0;s<t.value.length;s++)if(Lt(r,e,t.value[s]).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(to)&&(s.name=t.name),s}}if(t instanceof Ut)return t.hasOwnProperty(to)&&(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(!(af in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ff in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(df in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const 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(cf)===!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(lf)===!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(uf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(sf 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(!(Ia in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,c=e.idBlock.valueHexView;if(s.length!==c.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==c[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(r[t.name]=e)),t instanceof D.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof Oi&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let f=!0;for(let p=0;p<t.valueBlock.value.length;p++)f=f&&(t.valueBlock.value[p].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let f=0;f<u;f++)if(f-s>=e.valueBlock.value.length){if(t.valueBlock.value[f].optional===!1){const p={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,Oe),t.name&&(delete r[t.name],p.name=t.name)),p}}else if(t.valueBlock.value[0]instanceof Oi){if(c=Lt(r,e.valueBlock.value[f],t.valueBlock.value[0].value),c.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),c;if(to in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let p={};pf in t.valueBlock.value[0]&&t.valueBlock.value[0].local?p=e:p=r,typeof p[t.valueBlock.value[0].name]>"u"&&(p[t.valueBlock.value[0].name]=[]),p[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(c=Lt(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),c.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),c;if(c.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&Ia in e.valueBlock){const s=tr(e.valueBlock.valueHexView);if(s.offset===-1){const c={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(delete r[t.name],c.name=t.name)),c}return Lt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function vf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=tr(_.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Lt(t.result,t.result,e)}const Bc=Object.freeze(Object.defineProperty({__proto__:null,Any:Ut,BaseBlock:ve,BaseStringBlock:ro,BitString:Mt,BmpString:vi,Boolean:gi,CharacterString:Ii,Choice:ho,Constructed:Te,DATE:co,DateTime:uo,Duration:fo,EndOfContent:io,Enumerated:mi,GeneralString:Ei,GeneralizedTime:Ni,GraphicString:Bi,HexBlock:it,IA5String:xi,Integer:nt,Null:Dt,NumericString:Si,ObjectIdentifier:bi,OctetString:$t,Primitive:_r,PrintableString:Ai,RawData:bf,RelativeObjectIdentifier:ao,Repeated:Oi,Sequence:ft,Set:dt,TIME:po,TeletexString:ki,TimeOfDay:lo,UTCTime:Pr,UniversalString:wi,Utf8String:pt,ValueBlock:Be,VideotexString:Ci,ViewWriter:hi,VisibleString:jr,compareSchema:Lt,fromBER:rr,verifySchema:vf},Symbol.toStringTag,{value:"Module"}));var C;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(C||(C={}));var h;(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"})(h||(h={}));class Ti{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(_.isBufferSource(e))this.unusedBits=t,this.value=_.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Mt))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 Mt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Mt({name:e})}toNumber(){let e="";const t=new Uint8Array(this.value);for(const 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);const i=t.length+7>>3;this.unusedBits=(i<<3)-t.length;const 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}}class ne{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):_.isBufferSource(e)?this.buffer=_.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof $t))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new $t({valueHex:this.buffer})}toSchema(e){return new $t({name:e})}}const wf={fromASN:r=>r instanceof Dt?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Dt;const e=rr(r);if(e.result.error)throw new Error(e.result.error);return e.result}},Sf={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new nt({value:+r})},Af={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new mi({value:r})},ue={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new nt({valueHex:r})},kf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Mt({valueHex:r})},Cf={fromASN:r=>r.valueBlock.toString(),toASN:r=>new bi({value:r})},xf={fromASN:r=>r.valueBlock.value,toASN:r=>new gi({value:r})},Vi={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new $t({valueHex:r})},Bf={fromASN:r=>new ne(r.getValue()),toASN:r=>r.toASN()};function He(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Ec=He(pt),Ef=He(vi),If=He(wi),Nf=He(Si),Of=He(Ai),Tf=He(ki),Vf=He(Ci),_f=He(xi),jf=He(Bi),Pf=He(jr),Rf=He(Ei),Df=He(Ii),$f={fromASN:r=>r.toDate(),toASN:r=>new Pr({valueDate:r})},Mf={fromASN:r=>r.toDate(),toASN:r=>new Ni({valueDate:r})},Uf={fromASN:()=>null,toASN:()=>new Dt};function yo(r){switch(r){case h.Any:return wf;case h.BitString:return kf;case h.BmpString:return Ef;case h.Boolean:return xf;case h.CharacterString:return Df;case h.Enumerated:return Af;case h.GeneralString:return Rf;case h.GeneralizedTime:return Mf;case h.GraphicString:return jf;case h.IA5String:return _f;case h.Integer:return Sf;case h.Null:return Uf;case h.NumericString:return Nf;case h.ObjectIdentifier:return Cf;case h.OctetString:return Vi;case h.PrintableString:return Of;case h.TeletexString:return Tf;case h.UTCTime:return $f;case h.UniversalString:return If;case h.Utf8String:return Ec;case h.VideotexString:return Vf;case h.VisibleString:return Pf;default:return null}}function ht(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:ht(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function Ic(r){var e;if(r){const t=Object.getPrototypeOf(r);return((e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:Ic(t)}return!1}function Lf(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const 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}class Hf{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){const 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){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:C.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(t,i),t.items=Object.assign({},t.items,i.items)),t}create(e,t){const i=this.items.get(e)||this.createDefault(e),n=[];for(const s in i.items){const c=i.items[s],u=t?s:"";let f;if(typeof c.type=="number"){const b=h[c.type],y=Bc[b];if(!y)throw new Error(`Cannot get ASN1 class by name '${b}'`);f=new y({name:u})}else ht(c.type)?f=new c.type().toSchema(u):c.optional?this.get(c.type).type===C.Choice?f=new Ut({name:u}):(f=this.create(c.type,!1),f.name=u):f=new Ut({name:u});const p=!!c.optional||c.defaultValue!==void 0;if(c.repeated){f.name="";const b=c.repeated==="set"?dt:ft;f=new b({name:"",value:[new Oi({name:u,value:f})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||ht(c.type)){const b=c.repeated?Te:_r;n.push(new b({name:u,optional:p,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const b=!!c.repeated;let y=b?f:this.get(c.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,n.push(new Te({name:b?"":u,optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:y}))}else n.push(new Te({optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else f.optional=p,n.push(f)}switch(i.type){case C.Sequence:return new ft({value:n,name:""});case C.Set:return new dt({value:n,name:""});case C.Choice:return new ho({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){const t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}}const Fe=new Hf,B=r=>e=>{let t;Fe.has(e)?t=Fe.get(e):(t=Fe.createDefault(e),Fe.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;Fe.has(e.constructor)?i=Fe.get(e.constructor):(i=Fe.createDefault(e.constructor),Fe.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=yo(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}i.items[t]=n};class Nc extends Error{constructor(){super(...arguments),this.schemas=[]}}class Ff{static parse(e,t){const i=rr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){var i;try{if(ht(t))return new t().fromASN(e);const n=Fe.get(t);Fe.cache(t);let s=n.schema;if(e.constructor===Te&&n.type!==C.Choice){s=new Te({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const f in n.items)delete e[f]}const c=Lt({},e,s);if(!c.verified)throw new Nc(`Data does not match to ${t.name} ASN1 schema. ${c.result.error}`);const u=new t;if(Ic(t)){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.");const f=n.itemType;if(typeof f=="number"){const p=yo(f);if(!p)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);return t.from(e.valueBlock.value,b=>p.fromASN(b))}else return t.from(e.valueBlock.value,p=>this.fromASN(p,f))}for(const f in n.items){const p=c.result[f];if(!p)continue;const b=n.items[f],y=b.type;if(typeof y=="number"||ht(y)){const K=(i=b.converter)!==null&&i!==void 0?i:ht(y)?new y:null;if(!K)throw new Error("Converter is empty");if(b.repeated)if(b.implicit){const O=b.repeated==="sequence"?ft:dt,d=new O;d.valueBlock=p.valueBlock;const g=rr(d.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const S=g.result.valueBlock.value;u[f]=Array.from(S,w=>K.fromASN(w))}else u[f]=Array.from(p,O=>K.fromASN(O));else{let O=p;if(b.implicit){let d;if(ht(y))d=new y().toSchema("");else{const g=h[y],S=Bc[g];if(!S)throw new Error(`Cannot get '${g}' class from asn1js module`);d=new S}d.valueBlock=O.valueBlock,O=rr(d.toBER(!1)).result}u[f]=K.fromASN(O)}}else if(b.repeated){if(!Array.isArray(p))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");u[f]=Array.from(p,K=>this.fromASN(K,y))}else u[f]=this.fromASN(p,y)}return u}catch(n){throw n instanceof Nc&&n.schemas.push(t.name),n}}}class go{static serialize(e){return e instanceof ve?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&ht(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=Fe.get(t);Fe.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"){const c=yo(i.itemType);if(!c)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>c.toASN(u))}else n=e.map(c=>this.toAsnItem({type:i.itemType},"[]",t,c))}else for(const c in i.items){const u=i.items[c],f=e[c];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&Lf(this.serialize(u.defaultValue),this.serialize(f)))continue;const p=go.toAsnItem(u,c,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||ht(u.type))){const b={};b.valueHex=p instanceof Dt?p.valueBeforeDecodeView:p.valueBlock.toBER(),n.push(new _r({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...b}))}else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:p.valueBlock.value}));else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[p]}));else u.repeated?n=n.concat(p):n.push(p)}let s;switch(i.type){case C.Sequence:s=new ft({value:n});break;case C.Set:s=new dt({value:n});break;case C.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"){const c=e.converter;if(!c)throw new Error(`Property '${t}' doesn't have converter for type ${h[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const u=Array.from(n,p=>c.toASN(p)),f=e.repeated==="sequence"?ft:dt;s=new f({value:u})}else s=c.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?ft:dt;s=new u({value:c})}else s=this.toASN(n);return s}}class se extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class j{static serialize(e){return go.serialize(e)}static parse(e,t){return Ff.parse(e,t)}static toString(e){const t=_.isBufferSource(e)?_.toArrayBuffer(e):j.serialize(e),i=rr(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function a(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(s=(n<3?c(s):n>3?c(e,t,s):c(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;var Oc={exports:{}};(function(r){(function(e){const t="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",f={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${c})?$`,"i")};function p(d,g){if(d.indexOf("::")!==d.lastIndexOf("::"))return null;let S=0,w=-1,E=(d.match(f.zoneIndex)||[])[0],k,I;for(E&&(E=E.substring(1),d=d.replace(/%.+$/,""));(w=d.indexOf(":",w+1))>=0;)S++;if(d.substr(0,2)==="::"&&S--,d.substr(-2,2)==="::"&&S--,S>g)return null;for(I=g-S,k=":";I--;)k+="0:";return d=d.replace("::",k),d[0]===":"&&(d=d.slice(1)),d[d.length-1]===":"&&(d=d.slice(0,-1)),g=function(){const Q=d.split(":"),ee=[];for(let $=0;$<Q.length;$++)ee.push(parseInt(Q[$],16));return ee}(),{parts:g,zoneId:E}}function b(d,g,S,w){if(d.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let E=0,k;for(;w>0;){if(k=S-w,k<0&&(k=0),d[E]>>k!==g[E]>>k)return!1;w-=S,E+=1}return!0}function y(d){if(s.test(d))return parseInt(d,16);if(d[0]==="0"&&!isNaN(parseInt(d[1],10))){if(n.test(d))return parseInt(d,8);throw new Error(`ipaddr: cannot parse ${d} as octal`)}return parseInt(d,10)}function K(d,g){for(;d.length<g;)d=`0${d}`;return d}const O={};O.IPv4=function(){function d(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let S,w;for(S=0;S<g.length;S++)if(w=g[S],!(0<=w&&w<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return d.prototype.SpecialRanges={unspecified:[[new d([0,0,0,0]),8]],broadcast:[[new d([255,255,255,255]),32]],multicast:[[new d([224,0,0,0]),4]],linkLocal:[[new d([169,254,0,0]),16]],loopback:[[new d([127,0,0,0]),8]],carrierGradeNat:[[new d([100,64,0,0]),10]],private:[[new d([10,0,0,0]),8],[new d([172,16,0,0]),12],[new d([192,168,0,0]),16]],reserved:[[new d([192,0,0,0]),24],[new d([192,0,2,0]),24],[new d([192,88,99,0]),24],[new d([198,18,0,0]),15],[new d([198,51,100,0]),24],[new d([203,0,113,0]),24],[new d([240,0,0,0]),4]],as112:[[new d([192,175,48,0]),24],[new d([192,31,196,0]),24]],amt:[[new d([192,52,193,0]),24]]},d.prototype.kind=function(){return"ipv4"},d.prototype.match=function(g,S){let w;if(S===void 0&&(w=g,g=w[0],S=w[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return b(this.octets,g.octets,8,S)},d.prototype.prefixLengthFromSubnetMask=function(){let g=0,S=!1;const w={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let E,k,I;for(E=3;E>=0;E-=1)if(k=this.octets[E],k in w){if(I=w[k],S&&I!==0)return null;I!==8&&(S=!0),g+=I}else return null;return 32-g},d.prototype.range=function(){return O.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){return this.octets.slice(0)},d.prototype.toIPv4MappedAddress=function(){return O.IPv6.parse(`::ffff:${this.toString()}`)},d.prototype.toNormalizedString=function(){return this.toString()},d.prototype.toString=function(){return this.octets.join(".")},d}(),O.IPv4.broadcastAddressFromCIDR=function(d){try{const g=this.parseCIDR(d),S=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[];let k=0;for(;k<4;)E.push(parseInt(S[k],10)|parseInt(w[k],10)^255),k++;return new this(E)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},O.IPv4.isIPv4=function(d){return this.parser(d)!==null},O.IPv4.isValid=function(d){try{return new this(this.parser(d)),!0}catch{return!1}},O.IPv4.isValidCIDR=function(d){try{return this.parseCIDR(d),!0}catch{return!1}},O.IPv4.isValidFourPartDecimal=function(d){return!!(O.IPv4.isValid(d)&&d.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},O.IPv4.networkAddressFromCIDR=function(d){let g,S,w,E,k;try{for(g=this.parseCIDR(d),w=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],S=0;S<4;)E.push(parseInt(w[S],10)&parseInt(k[S],10)),S++;return new this(E)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},O.IPv4.parse=function(d){const g=this.parser(d);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},O.IPv4.parseCIDR=function(d){let g;if(g=d.match(/^(.+)\/(\d+)$/)){const S=parseInt(g[2]);if(S>=0&&S<=32){const w=[this.parse(g[1]),S];return Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},O.IPv4.parser=function(d){let g,S,w;if(g=d.match(i.fourOctet))return function(){const E=g.slice(1,6),k=[];for(let I=0;I<E.length;I++)S=E[I],k.push(y(S));return k}();if(g=d.match(i.longValue)){if(w=y(g[1]),w>4294967295||w<0)throw new Error("ipaddr: address outside defined range");return function(){const E=[];let k;for(k=0;k<=24;k+=8)E.push(w>>k&255);return E}().reverse()}else return(g=d.match(i.twoOctet))?function(){const E=g.slice(1,4),k=[];if(w=y(E[1]),w>16777215||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(E[0])),k.push(w>>16&255),k.push(w>>8&255),k.push(w&255),k}():(g=d.match(i.threeOctet))?function(){const E=g.slice(1,5),k=[];if(w=y(E[2]),w>65535||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(E[0])),k.push(y(E[1])),k.push(w>>8&255),k.push(w&255),k}():null},O.IPv4.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let S=0;const w=Math.floor(d/8);for(;S<w;)g[S]=255,S++;return w<4&&(g[w]=Math.pow(2,d%8)-1<<8-d%8),new this(g)},O.IPv6=function(){function d(g,S){let w,E;if(g.length===16)for(this.parts=[],w=0;w<=14;w+=2)this.parts.push(g[w]<<8|g[w+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(w=0;w<this.parts.length;w++)if(E=this.parts[w],!(0<=E&&E<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");S&&(this.zoneId=S)}return d.prototype.SpecialRanges={unspecified:[new d([0,0,0,0,0,0,0,0]),128],linkLocal:[new d([65152,0,0,0,0,0,0,0]),10],multicast:[new d([65280,0,0,0,0,0,0,0]),8],loopback:[new d([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new d([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new d([0,0,0,0,0,65535,0,0]),96],discard:[new d([256,0,0,0,0,0,0,0]),64],rfc6145:[new d([0,0,0,0,65535,0,0,0]),96],rfc6052:[new d([100,65435,0,0,0,0,0,0]),96],"6to4":[new d([8194,0,0,0,0,0,0,0]),16],teredo:[new d([8193,0,0,0,0,0,0,0]),32],benchmarking:[new d([8193,2,0,0,0,0,0,0]),48],amt:[new d([8193,3,0,0,0,0,0,0]),32],as112v6:[[new d([8193,4,274,0,0,0,0,0]),48],[new d([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new d([8193,16,0,0,0,0,0,0]),28],orchid2:[new d([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new d([8193,48,0,0,0,0,0,0]),28],reserved:[[new d([8193,0,0,0,0,0,0,0]),23],[new d([8193,3512,0,0,0,0,0,0]),32]]},d.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},d.prototype.kind=function(){return"ipv6"},d.prototype.match=function(g,S){let w;if(S===void 0&&(w=g,g=w[0],S=w[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return b(this.parts,g.parts,16,S)},d.prototype.prefixLengthFromSubnetMask=function(){let g=0,S=!1;const w={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let E,k;for(let I=7;I>=0;I-=1)if(E=this.parts[I],E in w){if(k=w[E],S&&k!==0)return null;k!==16&&(S=!0),g+=k}else return null;return 128-g},d.prototype.range=function(){return O.subnetMatch(this,this.SpecialRanges)},d.prototype.toByteArray=function(){let g;const S=[],w=this.parts;for(let E=0;E<w.length;E++)g=w[E],S.push(g>>8),S.push(g&255);return S},d.prototype.toFixedLengthString=function(){const g=(function(){const w=[];for(let E=0;E<this.parts.length;E++)w.push(K(this.parts[E].toString(16),4));return w}).call(this).join(":");let S="";return this.zoneId&&(S=`%${this.zoneId}`),g+S},d.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),S=g[0],w=g[1];return new O.IPv4([S>>8,S&255,w>>8,w&255])},d.prototype.toNormalizedString=function(){const g=(function(){const w=[];for(let E=0;E<this.parts.length;E++)w.push(this.parts[E].toString(16));return w}).call(this).join(":");let S="";return this.zoneId&&(S=`%${this.zoneId}`),g+S},d.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,S=this.toNormalizedString();let w=0,E=-1,k;for(;k=g.exec(S);)k[0].length>E&&(w=k.index,E=k[0].length);return E<0?S:`${S.substring(0,w)}::${S.substring(w+E)}`},d.prototype.toString=function(){return this.toRFC5952String()},d}(),O.IPv6.broadcastAddressFromCIDR=function(d){try{const g=this.parseCIDR(d),S=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[];let k=0;for(;k<16;)E.push(parseInt(S[k],10)|parseInt(w[k],10)^255),k++;return new this(E)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},O.IPv6.isIPv6=function(d){return this.parser(d)!==null},O.IPv6.isValid=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{const g=this.parser(d);return new this(g.parts,g.zoneId),!0}catch{return!1}},O.IPv6.isValidCIDR=function(d){if(typeof d=="string"&&d.indexOf(":")===-1)return!1;try{return this.parseCIDR(d),!0}catch{return!1}},O.IPv6.networkAddressFromCIDR=function(d){let g,S,w,E,k;try{for(g=this.parseCIDR(d),w=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),E=[],S=0;S<16;)E.push(parseInt(w[S],10)&parseInt(k[S],10)),S++;return new this(E)}catch(I){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${I})`)}},O.IPv6.parse=function(d){const g=this.parser(d);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},O.IPv6.parseCIDR=function(d){let g,S,w;if((S=d.match(/^(.+)\/(\d+)$/))&&(g=parseInt(S[2]),g>=0&&g<=128))return w=[this.parse(S[1]),g],Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},O.IPv6.parser=function(d){let g,S,w,E,k,I;if(w=d.match(f.deprecatedTransitional))return this.parser(`::ffff:${w[1]}`);if(f.native.test(d))return p(d,8);if((w=d.match(f.transitional))&&(I=w[6]||"",g=w[1],w[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+I,6),g.parts)){for(k=[parseInt(w[2]),parseInt(w[3]),parseInt(w[4]),parseInt(w[5])],S=0;S<k.length;S++)if(E=k[S],!(0<=E&&E<=255))return null;return g.parts.push(k[0]<<8|k[1]),g.parts.push(k[2]<<8|k[3]),{parts:g.parts,zoneId:g.zoneId}}return null},O.IPv6.subnetMaskFromPrefixLength=function(d){if(d=parseInt(d),d<0||d>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let S=0;const w=Math.floor(d/8);for(;S<w;)g[S]=255,S++;return w<16&&(g[w]=Math.pow(2,d%8)-1<<8-d%8),new this(g)},O.fromByteArray=function(d){const g=d.length;if(g===4)return new O.IPv4(d);if(g===16)return new O.IPv6(d);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},O.isValid=function(d){return O.IPv6.isValid(d)||O.IPv4.isValid(d)},O.isValidCIDR=function(d){return O.IPv6.isValidCIDR(d)||O.IPv4.isValidCIDR(d)},O.parse=function(d){if(O.IPv6.isValid(d))return O.IPv6.parse(d);if(O.IPv4.isValid(d))return O.IPv4.parse(d);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},O.parseCIDR=function(d){try{return O.IPv6.parseCIDR(d)}catch{try{return O.IPv4.parseCIDR(d)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},O.process=function(d){const g=this.parse(d);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},O.subnetMatch=function(d,g,S){let w,E,k,I;S==null&&(S="unicast");for(E in g)if(Object.prototype.hasOwnProperty.call(g,E)){for(k=g[E],k[0]&&!(k[0]instanceof Array)&&(k=[k]),w=0;w<k.length;w++)if(I=k[w],d.kind()===I[0].kind()&&d.match.apply(d,I))return E}return S},r.exports?r.exports=O:e.ipaddr=O})(Zn)})(Oc);var Tc=Oc.exports;class Vc{static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const t=parseInt(e.slice(8),16).toString(2).split("").reduce((n,s)=>n+ +s,0);let i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${t}`}static toString(e){if(e.byteLength===4||e.byteLength===16){const t=new Uint8Array(e);return Tc.fromByteArray(Array.from(t)).toString()}return this.decodeIP(L.ToHex(e))}static fromString(e){const t=Tc.parse(e);return new Uint8Array(t.toByteArray()).buffer}}var mo,bo,vo;let we=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:h.TeletexString})],we.prototype,"teletexString",void 0),a([l({type:h.PrintableString})],we.prototype,"printableString",void 0),a([l({type:h.UniversalString})],we.prototype,"universalString",void 0),a([l({type:h.Utf8String})],we.prototype,"utf8String",void 0),a([l({type:h.BmpString})],we.prototype,"bmpString",void 0),we=a([B({type:C.Choice})],we);let ir=class extends we{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};a([l({type:h.IA5String})],ir.prototype,"ia5String",void 0),a([l({type:h.Any})],ir.prototype,"anyValue",void 0),ir=a([B({type:C.Choice})],ir);class _i{constructor(e={}){this.type="",this.value=new ir,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],_i.prototype,"type",void 0),a([l({type:ir})],_i.prototype,"value",void 0);let nr=mo=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,mo.prototype)}};nr=mo=a([B({type:C.Set,itemType:_i})],nr);let wo=bo=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,bo.prototype)}};wo=bo=a([B({type:C.Sequence,itemType:nr})],wo);let he=vo=class extends wo{constructor(e){super(e),Object.setPrototypeOf(this,vo.prototype)}};he=vo=a([B({type:C.Sequence})],he);const qf={fromASN:r=>Vc.toString(Vi.fromASN(r)),toASN:r=>Vi.toASN(Vc.fromString(r))};class Rr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Rr.prototype,"typeId",void 0),a([l({type:h.Any,context:0})],Rr.prototype,"value",void 0);class So{constructor(e={}){this.partyName=new we,Object.assign(this,e)}}a([l({type:we,optional:!0,context:0,implicit:!0})],So.prototype,"nameAssigner",void 0),a([l({type:we,context:1,implicit:!0})],So.prototype,"partyName",void 0);let Z=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Rr,context:0,implicit:!0})],Z.prototype,"otherName",void 0),a([l({type:h.IA5String,context:1,implicit:!0})],Z.prototype,"rfc822Name",void 0),a([l({type:h.IA5String,context:2,implicit:!0})],Z.prototype,"dNSName",void 0),a([l({type:h.Any,context:3,implicit:!0})],Z.prototype,"x400Address",void 0),a([l({type:he,context:4,implicit:!1})],Z.prototype,"directoryName",void 0),a([l({type:So,context:5})],Z.prototype,"ediPartyName",void 0),a([l({type:h.IA5String,context:6,implicit:!0})],Z.prototype,"uniformResourceIdentifier",void 0),a([l({type:h.OctetString,context:7,implicit:!0,converter:qf})],Z.prototype,"iPAddress",void 0),a([l({type:h.ObjectIdentifier,context:8,implicit:!0})],Z.prototype,"registeredID",void 0),Z=a([B({type:C.Choice})],Z);const Ao="1.3.6.1.5.5.7",Kf=`${Ao}.1`,or=`${Ao}.3`,ji=`${Ao}.48`,_c=`${ji}.1`,jc=`${ji}.2`,Pc=`${ji}.3`,Rc=`${ji}.5`,Ct="2.5.29";var ko;const Co=`${Kf}.1`;class Dr{constructor(e={}){this.accessMethod="",this.accessLocation=new Z,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Dr.prototype,"accessMethod",void 0),a([l({type:Z})],Dr.prototype,"accessLocation",void 0);let sr=ko=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,ko.prototype)}};sr=ko=a([B({type:C.Sequence,itemType:Dr})],sr);const xo=`${Ct}.35`;class Bo extends ne{}class Ht{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:Bo,context:0,optional:!0,implicit:!0})],Ht.prototype,"keyIdentifier",void 0),a([l({type:Z,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ht.prototype,"authorityCertIssuer",void 0),a([l({type:h.Integer,context:2,optional:!0,implicit:!0,converter:ue})],Ht.prototype,"authorityCertSerialNumber",void 0);const Dc=`${Ct}.19`;class Pi{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:h.Boolean,defaultValue:!1})],Pi.prototype,"cA",void 0),a([l({type:h.Integer,optional:!0})],Pi.prototype,"pathLenConstraint",void 0);var Eo;let Ee=Eo=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Eo.prototype)}};Ee=Eo=a([B({type:C.Sequence,itemType:Z})],Ee);var Io;let $c=Io=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Io.prototype)}};$c=Io=a([B({type:C.Sequence})],$c);var No;const Mc=`${Ct}.32`;let yt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:h.IA5String})],yt.prototype,"ia5String",void 0),a([l({type:h.VisibleString})],yt.prototype,"visibleString",void 0),a([l({type:h.BmpString})],yt.prototype,"bmpString",void 0),a([l({type:h.Utf8String})],yt.prototype,"utf8String",void 0),yt=a([B({type:C.Choice})],yt);class Oo{constructor(e={}){this.organization=new yt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:yt})],Oo.prototype,"organization",void 0),a([l({type:h.Integer,repeated:"sequence"})],Oo.prototype,"noticeNumbers",void 0);class To{constructor(e={}){Object.assign(this,e)}}a([l({type:Oo,optional:!0})],To.prototype,"noticeRef",void 0),a([l({type:yt,optional:!0})],To.prototype,"explicitText",void 0);let Ri=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.IA5String})],Ri.prototype,"cPSuri",void 0),a([l({type:To})],Ri.prototype,"userNotice",void 0),Ri=a([B({type:C.Choice})],Ri);class Vo{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Vo.prototype,"policyQualifierId",void 0),a([l({type:h.Any})],Vo.prototype,"qualifier",void 0);class Di{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Di.prototype,"policyIdentifier",void 0),a([l({type:Vo,repeated:"sequence",optional:!0})],Di.prototype,"policyQualifiers",void 0);let $i=No=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,No.prototype)}};$i=No=a([B({type:C.Sequence,itemType:Di})],$i);let Mi=class{constructor(e=0){this.value=e}};a([l({type:h.Integer})],Mi.prototype,"value",void 0),Mi=a([B({type:C.Choice})],Mi);let Uc=class extends Mi{};Uc=a([B({type:C.Choice})],Uc);var _o;const jo=`${Ct}.31`;var Ye;(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"})(Ye||(Ye={}));class Lc extends Ti{toJSON(){const e=[],t=this.toNumber();return t&Ye.aACompromise&&e.push("aACompromise"),t&Ye.affiliationChanged&&e.push("affiliationChanged"),t&Ye.cACompromise&&e.push("cACompromise"),t&Ye.certificateHold&&e.push("certificateHold"),t&Ye.cessationOfOperation&&e.push("cessationOfOperation"),t&Ye.keyCompromise&&e.push("keyCompromise"),t&Ye.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Ye.superseded&&e.push("superseded"),t&Ye.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Ft=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,context:0,repeated:"sequence",implicit:!0})],Ft.prototype,"fullName",void 0),a([l({type:nr,context:1,implicit:!0})],Ft.prototype,"nameRelativeToCRLIssuer",void 0),Ft=a([B({type:C.Choice})],Ft);class ar{constructor(e={}){Object.assign(this,e)}}a([l({type:Ft,context:0,optional:!0})],ar.prototype,"distributionPoint",void 0),a([l({type:Lc,context:1,optional:!0,implicit:!0})],ar.prototype,"reasons",void 0),a([l({type:Z,context:2,optional:!0,repeated:"sequence",implicit:!0})],ar.prototype,"cRLIssuer",void 0);let cr=_o=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,_o.prototype)}};cr=_o=a([B({type:C.Sequence,itemType:ar})],cr);var Po;let Hc=Po=class extends cr{constructor(e){super(e),Object.setPrototypeOf(this,Po.prototype)}};Hc=Po=a([B({type:C.Sequence,itemType:ar})],Hc);class ke{constructor(e={}){this.onlyContainsUserCerts=ke.ONLY,this.onlyContainsCACerts=ke.ONLY,this.indirectCRL=ke.ONLY,this.onlyContainsAttributeCerts=ke.ONLY,Object.assign(this,e)}}ke.ONLY=!1,a([l({type:Ft,context:0,optional:!0})],ke.prototype,"distributionPoint",void 0),a([l({type:h.Boolean,context:1,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsUserCerts",void 0),a([l({type:h.Boolean,context:2,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsCACerts",void 0),a([l({type:Lc,context:3,optional:!0,implicit:!0})],ke.prototype,"onlySomeReasons",void 0),a([l({type:h.Boolean,context:4,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"indirectCRL",void 0),a([l({type:h.Boolean,context:5,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsAttributeCerts",void 0);var $r;(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"})($r||($r={}));let Ro=class{constructor(e=$r.unspecified){this.reason=$r.unspecified,this.reason=e}toJSON(){return $r[this.reason]}toString(){return this.toJSON()}};a([l({type:h.Enumerated})],Ro.prototype,"reason",void 0),Ro=a([B({type:C.Choice})],Ro);var Do;const Fc=`${Ct}.37`;let Ui=Do=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Do.prototype)}};Ui=Do=a([B({type:C.Sequence,itemType:h.ObjectIdentifier})],Ui);const zf=`${or}.1`,Gf=`${or}.2`,Wf=`${or}.3`,Jf=`${or}.4`,Yf=`${or}.8`,Zf=`${or}.9`;let $o=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:h.Integer,converter:ue})],$o.prototype,"value",void 0),$o=a([B({type:C.Choice})],$o);let Mo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:h.GeneralizedTime})],Mo.prototype,"value",void 0),Mo=a([B({type:C.Choice})],Mo);var Uo;let qc=Uo=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Uo.prototype)}};qc=Uo=a([B({type:C.Sequence})],qc);const Kc=`${Ct}.15`;var Ze;(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"})(Ze||(Ze={}));class Lo extends Ti{toJSON(){const e=this.toNumber(),t=[];return e&Ze.cRLSign&&t.push("crlSign"),e&Ze.dataEncipherment&&t.push("dataEncipherment"),e&Ze.decipherOnly&&t.push("decipherOnly"),e&Ze.digitalSignature&&t.push("digitalSignature"),e&Ze.encipherOnly&&t.push("encipherOnly"),e&Ze.keyAgreement&&t.push("keyAgreement"),e&Ze.keyCertSign&&t.push("keyCertSign"),e&Ze.keyEncipherment&&t.push("keyEncipherment"),e&Ze.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var Ho;class Li{constructor(e={}){this.base=new Z,this.minimum=0,Object.assign(this,e)}}a([l({type:Z})],Li.prototype,"base",void 0),a([l({type:h.Integer,context:0,defaultValue:0,implicit:!0})],Li.prototype,"minimum",void 0),a([l({type:h.Integer,context:1,optional:!0,implicit:!0})],Li.prototype,"maximum",void 0);let Hi=Ho=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Ho.prototype)}};Hi=Ho=a([B({type:C.Sequence,itemType:Li})],Hi);class zc{constructor(e={}){Object.assign(this,e)}}a([l({type:Hi,context:0,optional:!0,implicit:!0})],zc.prototype,"permittedSubtrees",void 0),a([l({type:Hi,context:1,optional:!0,implicit:!0})],zc.prototype,"excludedSubtrees",void 0);class Gc{constructor(e={}){Object.assign(this,e)}}a([l({type:h.Integer,context:0,implicit:!0,optional:!0,converter:ue})],Gc.prototype,"requireExplicitPolicy",void 0),a([l({type:h.Integer,context:1,implicit:!0,optional:!0,converter:ue})],Gc.prototype,"inhibitPolicyMapping",void 0);var Fo;class qo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],qo.prototype,"issuerDomainPolicy",void 0),a([l({type:h.ObjectIdentifier})],qo.prototype,"subjectDomainPolicy",void 0);let Wc=Fo=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Fo.prototype)}};Wc=Fo=a([B({type:C.Sequence,itemType:qo})],Wc);var Ko;const Jc=`${Ct}.17`;let zo=Ko=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};zo=Ko=a([B({type:C.Sequence})],zo);let gt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],gt.prototype,"type",void 0),a([l({type:h.Any,repeated:"set"})],gt.prototype,"values",void 0);var Go;let Yc=Go=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Go.prototype)}};Yc=Go=a([B({type:C.Sequence,itemType:gt})],Yc);const Zc=`${Ct}.14`;class xt extends Bo{}class Qc{constructor(e={}){Object.assign(this,e)}}a([l({type:h.GeneralizedTime,context:0,implicit:!0,optional:!0})],Qc.prototype,"notBefore",void 0),a([l({type:h.GeneralizedTime,context:1,implicit:!0,optional:!0})],Qc.prototype,"notAfter",void 0);var Mr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Mr||(Mr={}));class Xc extends Ti{toJSON(){const e=[],t=this.toNumber();return t&Mr.pKIXCertificate&&e.push("pKIXCertificate"),t&Mr.newExtensions&&e.push("newExtensions"),t&Mr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class el{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Xc,Object.assign(this,e)}}a([l({type:h.GeneralString})],el.prototype,"entrustVers",void 0),a([l({type:Xc})],el.prototype,"entrustInfoFlags",void 0);var Wo;let tl=Wo=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Wo.prototype)}};tl=Wo=a([B({type:C.Sequence,itemType:Dr})],tl);class R{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof R&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&xa(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:h.ObjectIdentifier})],R.prototype,"algorithm",void 0),a([l({type:h.Any,optional:!0})],R.prototype,"parameters",void 0);class ot{constructor(e={}){this.algorithm=new R,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:R})],ot.prototype,"algorithm",void 0),a([l({type:h.BitString})],ot.prototype,"subjectPublicKey",void 0);let Se=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const t=new Date(e);t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};a([l({type:h.UTCTime})],Se.prototype,"utcTime",void 0),a([l({type:h.GeneralizedTime})],Se.prototype,"generalTime",void 0),Se=a([B({type:C.Choice})],Se);class Fi{constructor(e){this.notBefore=new Se(new Date),this.notAfter=new Se(new Date),e&&(this.notBefore=new Se(e.notBefore),this.notAfter=new Se(e.notAfter))}}a([l({type:Se})],Fi.prototype,"notBefore",void 0),a([l({type:Se})],Fi.prototype,"notAfter",void 0);var Jo;let Qe=class Yu{constructor(e={}){this.extnID="",this.critical=Yu.CRITICAL,this.extnValue=new ne,Object.assign(this,e)}};Qe.CRITICAL=!1,a([l({type:h.ObjectIdentifier})],Qe.prototype,"extnID",void 0),a([l({type:h.Boolean,defaultValue:Qe.CRITICAL})],Qe.prototype,"critical",void 0),a([l({type:ne})],Qe.prototype,"extnValue",void 0);let qt=Jo=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Jo.prototype)}};qt=Jo=a([B({type:C.Sequence,itemType:Qe})],qt);var lr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(lr||(lr={}));class qe{constructor(e={}){this.version=lr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new R,this.issuer=new he,this.validity=new Fi,this.subject=new he,this.subjectPublicKeyInfo=new ot,Object.assign(this,e)}}a([l({type:h.Integer,context:0,defaultValue:lr.v1})],qe.prototype,"version",void 0),a([l({type:h.Integer,converter:ue})],qe.prototype,"serialNumber",void 0),a([l({type:R})],qe.prototype,"signature",void 0),a([l({type:he})],qe.prototype,"issuer",void 0),a([l({type:Fi})],qe.prototype,"validity",void 0),a([l({type:he})],qe.prototype,"subject",void 0),a([l({type:ot})],qe.prototype,"subjectPublicKeyInfo",void 0),a([l({type:h.BitString,context:1,implicit:!0,optional:!0})],qe.prototype,"issuerUniqueID",void 0),a([l({type:h.BitString,context:2,implicit:!0,optional:!0})],qe.prototype,"subjectUniqueID",void 0),a([l({type:qt,context:3,optional:!0})],qe.prototype,"extensions",void 0);class ur{constructor(e={}){this.tbsCertificate=new qe,this.signatureAlgorithm=new R,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:qe})],ur.prototype,"tbsCertificate",void 0),a([l({type:R})],ur.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],ur.prototype,"signatureValue",void 0);class qi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Se,Object.assign(this,e)}}a([l({type:h.Integer,converter:ue})],qi.prototype,"userCertificate",void 0),a([l({type:Se})],qi.prototype,"revocationDate",void 0),a([l({type:Qe,optional:!0,repeated:"sequence"})],qi.prototype,"crlEntryExtensions",void 0);class mt{constructor(e={}){this.signature=new R,this.issuer=new he,this.thisUpdate=new Se,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],mt.prototype,"version",void 0),a([l({type:R})],mt.prototype,"signature",void 0),a([l({type:he})],mt.prototype,"issuer",void 0),a([l({type:Se})],mt.prototype,"thisUpdate",void 0),a([l({type:Se,optional:!0})],mt.prototype,"nextUpdate",void 0),a([l({type:qi,repeated:"sequence",optional:!0})],mt.prototype,"revokedCertificates",void 0),a([l({type:Qe,optional:!0,context:0,repeated:"sequence"})],mt.prototype,"crlExtensions",void 0);let Yo=class{constructor(e={}){this.tbsCertList=new mt,this.signatureAlgorithm=new R,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:mt})],Yo.prototype,"tbsCertList",void 0),a([l({type:R})],Yo.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Yo.prototype,"signature",void 0);class fr{constructor(e={}){this.issuer=new he,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:he})],fr.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ue})],fr.prototype,"serialNumber",void 0);let dr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:xt,context:0,implicit:!0})],dr.prototype,"subjectKeyIdentifier",void 0),a([l({type:fr})],dr.prototype,"issuerAndSerialNumber",void 0),dr=a([B({type:C.Choice})],dr);var bt;(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"})(bt||(bt={}));let Ur=class extends R{};Ur=a([B({type:C.Sequence})],Ur);let Ki=class extends R{};Ki=a([B({type:C.Sequence})],Ki);let st=class extends R{};st=a([B({type:C.Sequence})],st);let zi=class extends R{};zi=a([B({type:C.Sequence})],zi);let rl=class extends R{};rl=a([B({type:C.Sequence})],rl);let Zo=class extends R{};Zo=a([B({type:C.Sequence})],Zo);let pr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],pr.prototype,"attrType",void 0),a([l({type:h.Any,repeated:"set"})],pr.prototype,"attrValues",void 0);var Qo;class at{constructor(e={}){this.version=bt.v0,this.sid=new dr,this.digestAlgorithm=new Ur,this.signatureAlgorithm=new Ki,this.signature=new ne,Object.assign(this,e)}}a([l({type:h.Integer})],at.prototype,"version",void 0),a([l({type:dr})],at.prototype,"sid",void 0),a([l({type:Ur})],at.prototype,"digestAlgorithm",void 0),a([l({type:pr,repeated:"set",context:0,implicit:!0,optional:!0})],at.prototype,"signedAttrs",void 0),a([l({type:Ki})],at.prototype,"signatureAlgorithm",void 0),a([l({type:ne})],at.prototype,"signature",void 0),a([l({type:pr,repeated:"set",context:1,implicit:!0,optional:!0})],at.prototype,"unsignedAttrs",void 0);let Gi=Qo=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Gi=Qo=a([B({type:C.Set,itemType:at})],Gi);let il=class extends Se{};il=a([B({type:C.Choice})],il);let nl=class extends at{};nl=a([B({type:C.Sequence})],nl);class Xo{constructor(e={}){this.acIssuer=new Z,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:Z})],Xo.prototype,"acIssuer",void 0),a([l({type:h.Integer})],Xo.prototype,"acSerial",void 0),a([l({type:gt,repeated:"sequence"})],Xo.prototype,"attrs",void 0);var es;let Wi=es=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,es.prototype)}};Wi=es=a([B({type:C.Sequence,itemType:h.ObjectIdentifier})],Wi);class Ji{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],Ji.prototype,"pathLenConstraint",void 0),a([l({type:Wi,implicit:!0,context:0,optional:!0})],Ji.prototype,"permittedAttrs",void 0),a([l({type:Wi,implicit:!0,context:1,optional:!0})],Ji.prototype,"excludedAttrs",void 0),a([l({type:h.Boolean,defaultValue:!0})],Ji.prototype,"permitUnSpecified",void 0);class Kt{constructor(e={}){this.issuer=new Ee,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ee})],Kt.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ue})],Kt.prototype,"serial",void 0),a([l({type:h.BitString,optional:!0})],Kt.prototype,"issuerUID",void 0);var ts;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(ts||(ts={}));class zt{constructor(e={}){this.digestedObjectType=ts.publicKey,this.digestAlgorithm=new R,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Enumerated})],zt.prototype,"digestedObjectType",void 0),a([l({type:h.ObjectIdentifier,optional:!0})],zt.prototype,"otherObjectTypeID",void 0),a([l({type:R})],zt.prototype,"digestAlgorithm",void 0),a([l({type:h.BitString})],zt.prototype,"objectDigest",void 0);class Yi{constructor(e={}){Object.assign(this,e)}}a([l({type:Ee,optional:!0})],Yi.prototype,"issuerName",void 0),a([l({type:Kt,context:0,implicit:!0,optional:!0})],Yi.prototype,"baseCertificateID",void 0),a([l({type:zt,context:1,implicit:!0,optional:!0})],Yi.prototype,"objectDigestInfo",void 0);let hr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,repeated:"sequence"})],hr.prototype,"v1Form",void 0),a([l({type:Yi,context:0,implicit:!0})],hr.prototype,"v2Form",void 0),hr=a([B({type:C.Choice})],hr);class Zi{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:h.GeneralizedTime})],Zi.prototype,"notBeforeTime",void 0),a([l({type:h.GeneralizedTime})],Zi.prototype,"notAfterTime",void 0);class Lr{constructor(e={}){Object.assign(this,e)}}a([l({type:Kt,implicit:!0,context:0,optional:!0})],Lr.prototype,"baseCertificateID",void 0),a([l({type:Ee,implicit:!0,context:1,optional:!0})],Lr.prototype,"entityName",void 0),a([l({type:zt,implicit:!0,context:2,optional:!0})],Lr.prototype,"objectDigestInfo",void 0);var rs;(function(r){r[r.v2=1]="v2"})(rs||(rs={}));class Xe{constructor(e={}){this.version=rs.v2,this.holder=new Lr,this.issuer=new hr,this.signature=new R,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Zi,this.attributes=[],Object.assign(this,e)}}a([l({type:h.Integer})],Xe.prototype,"version",void 0),a([l({type:Lr})],Xe.prototype,"holder",void 0),a([l({type:hr})],Xe.prototype,"issuer",void 0),a([l({type:R})],Xe.prototype,"signature",void 0),a([l({type:h.Integer,converter:ue})],Xe.prototype,"serialNumber",void 0),a([l({type:Zi})],Xe.prototype,"attrCertValidityPeriod",void 0),a([l({type:gt,repeated:"sequence"})],Xe.prototype,"attributes",void 0),a([l({type:h.BitString,optional:!0})],Xe.prototype,"issuerUniqueID",void 0),a([l({type:qt,optional:!0})],Xe.prototype,"extensions",void 0);class Qi{constructor(e={}){this.acinfo=new Xe,this.signatureAlgorithm=new R,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Xe})],Qi.prototype,"acinfo",void 0),a([l({type:R})],Qi.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Qi.prototype,"signatureValue",void 0);var Xi;(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"})(Xi||(Xi={}));class is extends Ti{}class ns{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier,implicit:!0,context:0})],ns.prototype,"type",void 0),a([l({type:h.Any,implicit:!0,context:1})],ns.prototype,"value",void 0);class os{constructor(e={}){this.policyId="",this.classList=new is(Xi.unclassified),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],os.prototype,"policyId",void 0),a([l({type:is,defaultValue:new is(Xi.unclassified)})],os.prototype,"classList",void 0),a([l({type:ns,repeated:"set"})],os.prototype,"securityCategories",void 0);class en{constructor(e={}){Object.assign(this,e)}}a([l({type:ne})],en.prototype,"cotets",void 0),a([l({type:h.ObjectIdentifier})],en.prototype,"oid",void 0),a([l({type:h.Utf8String})],en.prototype,"string",void 0);class ol{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Ee,implicit:!0,context:0,optional:!0})],ol.prototype,"policyAuthority",void 0),a([l({type:en,repeated:"sequence"})],ol.prototype,"values",void 0);var ss;class tn{constructor(e={}){this.targetCertificate=new Kt,Object.assign(this,e)}}a([l({type:Kt})],tn.prototype,"targetCertificate",void 0),a([l({type:Z,optional:!0})],tn.prototype,"targetName",void 0),a([l({type:zt,optional:!0})],tn.prototype,"certDigestInfo",void 0);let yr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Z,context:0,implicit:!0})],yr.prototype,"targetName",void 0),a([l({type:Z,context:1,implicit:!0})],yr.prototype,"targetGroup",void 0),a([l({type:tn,context:2,implicit:!0})],yr.prototype,"targetCert",void 0),yr=a([B({type:C.Choice})],yr);let as=ss=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,ss.prototype)}};as=ss=a([B({type:C.Sequence,itemType:yr})],as);var cs;let sl=cs=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,cs.prototype)}};sl=cs=a([B({type:C.Sequence,itemType:as})],sl);class al{constructor(e={}){Object.assign(this,e)}}a([l({type:Ee,implicit:!0,context:0,optional:!0})],al.prototype,"roleAuthority",void 0),a([l({type:Z,implicit:!0,context:1})],al.prototype,"roleName",void 0);class ls{constructor(e={}){this.service=new Z,this.ident=new Z,Object.assign(this,e)}}a([l({type:Z})],ls.prototype,"service",void 0),a([l({type:Z})],ls.prototype,"ident",void 0),a([l({type:ne,optional:!0})],ls.prototype,"authInfo",void 0);var us;class fs{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],fs.prototype,"otherCertFormat",void 0),a([l({type:h.Any})],fs.prototype,"otherCert",void 0);let gr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ur})],gr.prototype,"certificate",void 0),a([l({type:Qi,context:2,implicit:!0})],gr.prototype,"v2AttrCert",void 0),a([l({type:fs,context:3,implicit:!0})],gr.prototype,"other",void 0),gr=a([B({type:C.Choice})],gr);let rn=us=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,us.prototype)}};rn=us=a([B({type:C.Set,itemType:gr})],rn);class mr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],mr.prototype,"contentType",void 0),a([l({type:h.Any,context:0})],mr.prototype,"content",void 0);let Hr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ne})],Hr.prototype,"single",void 0),a([l({type:h.Any})],Hr.prototype,"any",void 0),Hr=a([B({type:C.Choice})],Hr);class nn{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],nn.prototype,"eContentType",void 0),a([l({type:Hr,context:0,optional:!0})],nn.prototype,"eContent",void 0);let Fr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ne,context:0,implicit:!0,optional:!0})],Fr.prototype,"value",void 0),a([l({type:ne,converter:Bf,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Fr.prototype,"constructedValue",void 0),Fr=a([B({type:C.Choice})],Fr);class qr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new zi,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],qr.prototype,"contentType",void 0),a([l({type:zi})],qr.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:Fr,optional:!0})],qr.prototype,"encryptedContent",void 0);class on{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],on.prototype,"keyAttrId",void 0),a([l({type:h.Any,optional:!0})],on.prototype,"keyAttr",void 0);var ds;class sn{constructor(e={}){this.subjectKeyIdentifier=new xt,Object.assign(this,e)}}a([l({type:xt})],sn.prototype,"subjectKeyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],sn.prototype,"date",void 0),a([l({type:on,optional:!0})],sn.prototype,"other",void 0);let br=class{constructor(e={}){Object.assign(this,e)}};a([l({type:sn,context:0,implicit:!0,optional:!0})],br.prototype,"rKeyId",void 0),a([l({type:fr,optional:!0})],br.prototype,"issuerAndSerialNumber",void 0),br=a([B({type:C.Choice})],br);class ps{constructor(e={}){this.rid=new br,this.encryptedKey=new ne,Object.assign(this,e)}}a([l({type:br})],ps.prototype,"rid",void 0),a([l({type:ne})],ps.prototype,"encryptedKey",void 0);let an=ds=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,ds.prototype)}};an=ds=a([B({type:C.Sequence,itemType:ps})],an);class hs{constructor(e={}){this.algorithm=new R,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:R})],hs.prototype,"algorithm",void 0),a([l({type:h.BitString})],hs.prototype,"publicKey",void 0);let Gt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:xt,context:0,implicit:!0,optional:!0})],Gt.prototype,"subjectKeyIdentifier",void 0),a([l({type:hs,context:1,implicit:!0,optional:!0})],Gt.prototype,"originatorKey",void 0),a([l({type:fr,optional:!0})],Gt.prototype,"issuerAndSerialNumber",void 0),Gt=a([B({type:C.Choice})],Gt);class vr{constructor(e={}){this.version=bt.v3,this.originator=new Gt,this.keyEncryptionAlgorithm=new st,this.recipientEncryptedKeys=new an,Object.assign(this,e)}}a([l({type:h.Integer})],vr.prototype,"version",void 0),a([l({type:Gt,context:0})],vr.prototype,"originator",void 0),a([l({type:ne,context:1,optional:!0})],vr.prototype,"ukm",void 0),a([l({type:st})],vr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:an})],vr.prototype,"recipientEncryptedKeys",void 0);let wr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:xt,context:0,implicit:!0})],wr.prototype,"subjectKeyIdentifier",void 0),a([l({type:fr})],wr.prototype,"issuerAndSerialNumber",void 0),wr=a([B({type:C.Choice})],wr);class Kr{constructor(e={}){this.version=bt.v0,this.rid=new wr,this.keyEncryptionAlgorithm=new st,this.encryptedKey=new ne,Object.assign(this,e)}}a([l({type:h.Integer})],Kr.prototype,"version",void 0),a([l({type:wr})],Kr.prototype,"rid",void 0),a([l({type:st})],Kr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:ne})],Kr.prototype,"encryptedKey",void 0);class zr{constructor(e={}){this.keyIdentifier=new ne,Object.assign(this,e)}}a([l({type:ne})],zr.prototype,"keyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],zr.prototype,"date",void 0),a([l({type:on,optional:!0})],zr.prototype,"other",void 0);class Gr{constructor(e={}){this.version=bt.v4,this.kekid=new zr,this.keyEncryptionAlgorithm=new st,this.encryptedKey=new ne,Object.assign(this,e)}}a([l({type:h.Integer})],Gr.prototype,"version",void 0),a([l({type:zr})],Gr.prototype,"kekid",void 0),a([l({type:st})],Gr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:ne})],Gr.prototype,"encryptedKey",void 0);class Wr{constructor(e={}){this.version=bt.v0,this.keyEncryptionAlgorithm=new st,this.encryptedKey=new ne,Object.assign(this,e)}}a([l({type:h.Integer})],Wr.prototype,"version",void 0),a([l({type:Zo,context:0,optional:!0})],Wr.prototype,"keyDerivationAlgorithm",void 0),a([l({type:st})],Wr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:ne})],Wr.prototype,"encryptedKey",void 0);class ys{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ys.prototype,"oriType",void 0),a([l({type:h.Any})],ys.prototype,"oriValue",void 0);let Bt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Kr,optional:!0})],Bt.prototype,"ktri",void 0),a([l({type:vr,context:1,implicit:!0,optional:!0})],Bt.prototype,"kari",void 0),a([l({type:Gr,context:2,implicit:!0,optional:!0})],Bt.prototype,"kekri",void 0),a([l({type:Wr,context:3,implicit:!0,optional:!0})],Bt.prototype,"pwri",void 0),a([l({type:ys,context:4,implicit:!0,optional:!0})],Bt.prototype,"ori",void 0),Bt=a([B({type:C.Choice})],Bt);var gs;let cn=gs=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,gs.prototype)}};cn=gs=a([B({type:C.Set,itemType:Bt})],cn);var ms;class ln{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ln.prototype,"otherRevInfoFormat",void 0),a([l({type:h.Any})],ln.prototype,"otherRevInfo",void 0);let un=class{constructor(e={}){this.other=new ln,Object.assign(this,e)}};a([l({type:ln,context:1,implicit:!0})],un.prototype,"other",void 0),un=a([B({type:C.Choice})],un);let fn=ms=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,ms.prototype)}};fn=ms=a([B({type:C.Set,itemType:un})],fn);class bs{constructor(e={}){Object.assign(this,e)}}a([l({type:rn,context:0,implicit:!0,optional:!0})],bs.prototype,"certs",void 0),a([l({type:fn,context:1,implicit:!0,optional:!0})],bs.prototype,"crls",void 0);var vs;let ws=vs=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};ws=vs=a([B({type:C.Set,itemType:pr})],ws);class Jr{constructor(e={}){this.version=bt.v0,this.recipientInfos=new cn,this.encryptedContentInfo=new qr,Object.assign(this,e)}}a([l({type:h.Integer})],Jr.prototype,"version",void 0),a([l({type:bs,context:0,implicit:!0,optional:!0})],Jr.prototype,"originatorInfo",void 0),a([l({type:cn})],Jr.prototype,"recipientInfos",void 0),a([l({type:qr})],Jr.prototype,"encryptedContentInfo",void 0),a([l({type:ws,context:1,implicit:!0,optional:!0})],Jr.prototype,"unprotectedAttrs",void 0);const Qf="1.2.840.113549.1.7.2";var Ss;let dn=Ss=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Ss.prototype)}};dn=Ss=a([B({type:C.Set,itemType:Ur})],dn);class Sr{constructor(e={}){this.version=bt.v0,this.digestAlgorithms=new dn,this.encapContentInfo=new nn,this.signerInfos=new Gi,Object.assign(this,e)}}a([l({type:h.Integer})],Sr.prototype,"version",void 0),a([l({type:dn})],Sr.prototype,"digestAlgorithms",void 0),a([l({type:nn})],Sr.prototype,"encapContentInfo",void 0),a([l({type:rn,context:0,implicit:!0,optional:!0})],Sr.prototype,"certificates",void 0),a([l({type:fn,context:1,implicit:!0,optional:!0})],Sr.prototype,"crls",void 0),a([l({type:Gi})],Sr.prototype,"signerInfos",void 0);const Yr="1.2.840.10045.2.1",As="1.2.840.10045.4.1",cl="1.2.840.10045.4.3.1",ks="1.2.840.10045.4.3.2",Cs="1.2.840.10045.4.3.3",xs="1.2.840.10045.4.3.4",ll="1.2.840.10045.3.1.7",ul="1.3.132.0.34",fl="1.3.132.0.35";function Zr(r){return new R({algorithm:r})}const Xf=Zr(As);Zr(cl);const ed=Zr(ks),td=Zr(Cs),rd=Zr(xs);let Qr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],Qr.prototype,"fieldType",void 0),a([l({type:h.Any})],Qr.prototype,"parameters",void 0),Qr=a([B({type:C.Sequence})],Qr);class id extends ne{}let Ar=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.OctetString})],Ar.prototype,"a",void 0),a([l({type:h.OctetString})],Ar.prototype,"b",void 0),a([l({type:h.BitString,optional:!0})],Ar.prototype,"seed",void 0),Ar=a([B({type:C.Sequence})],Ar);var Bs;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Bs||(Bs={}));let vt=class{constructor(e={}){this.version=Bs.ecpVer1,Object.assign(this,e)}};a([l({type:h.Integer})],vt.prototype,"version",void 0),a([l({type:Qr})],vt.prototype,"fieldID",void 0),a([l({type:Ar})],vt.prototype,"curve",void 0),a([l({type:id})],vt.prototype,"base",void 0),a([l({type:h.Integer,converter:ue})],vt.prototype,"order",void 0),a([l({type:h.Integer,optional:!0})],vt.prototype,"cofactor",void 0),vt=a([B({type:C.Sequence})],vt);let Et=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],Et.prototype,"namedCurve",void 0),a([l({type:h.Null})],Et.prototype,"implicitCurve",void 0),a([l({type:vt})],Et.prototype,"specifiedCurve",void 0),Et=a([B({type:C.Choice})],Et);class pn{constructor(e={}){this.version=1,this.privateKey=new ne,Object.assign(this,e)}}a([l({type:h.Integer})],pn.prototype,"version",void 0),a([l({type:ne})],pn.prototype,"privateKey",void 0),a([l({type:Et,context:0,optional:!0})],pn.prototype,"parameters",void 0),a([l({type:h.BitString,context:1,optional:!0})],pn.prototype,"publicKey",void 0);class hn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ue})],hn.prototype,"r",void 0),a([l({type:h.Integer,converter:ue})],hn.prototype,"s",void 0);const Ve="1.2.840.113549.1.1",Wt=`${Ve}.1`,nd=`${Ve}.7`,od=`${Ve}.9`,Xr=`${Ve}.10`,sd=`${Ve}.2`,ad=`${Ve}.4`,yn=`${Ve}.5`,cd=`${Ve}.14`,Es=`${Ve}.11`,gn=`${Ve}.12`,mn=`${Ve}.13`,dl=`${Ve}.15`,pl=`${Ve}.16`,bn="1.3.14.3.2.26",hl="2.16.840.1.101.3.4.2.4",vn="2.16.840.1.101.3.4.2.1",wn="2.16.840.1.101.3.4.2.2",Sn="2.16.840.1.101.3.4.2.3",ld="2.16.840.1.101.3.4.2.5",ud="2.16.840.1.101.3.4.2.6",fd="1.2.840.113549.2.2",dd="1.2.840.113549.2.5",An=`${Ve}.8`;function ye(r){return new R({algorithm:r,parameters:null})}ye(fd),ye(dd);const Jt=ye(bn);ye(hl),ye(vn),ye(wn),ye(Sn),ye(ld),ye(ud);const yl=new R({algorithm:An,parameters:j.serialize(Jt)}),gl=new R({algorithm:od,parameters:j.serialize(Vi.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ye(Wt),ye(sd),ye(ad),ye(yn),ye(dl),ye(pl),ye(gn),ye(mn),ye(dl),ye(pl);class kn{constructor(e={}){this.hashAlgorithm=new R(Jt),this.maskGenAlgorithm=new R({algorithm:An,parameters:j.serialize(Jt)}),this.pSourceAlgorithm=new R(gl),Object.assign(this,e)}}a([l({type:R,context:0,defaultValue:Jt})],kn.prototype,"hashAlgorithm",void 0),a([l({type:R,context:1,defaultValue:yl})],kn.prototype,"maskGenAlgorithm",void 0),a([l({type:R,context:2,defaultValue:gl})],kn.prototype,"pSourceAlgorithm",void 0),new R({algorithm:nd,parameters:j.serialize(new kn)});class Yt{constructor(e={}){this.hashAlgorithm=new R(Jt),this.maskGenAlgorithm=new R({algorithm:An,parameters:j.serialize(Jt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:R,context:0,defaultValue:Jt})],Yt.prototype,"hashAlgorithm",void 0),a([l({type:R,context:1,defaultValue:yl})],Yt.prototype,"maskGenAlgorithm",void 0),a([l({type:h.Integer,context:2,defaultValue:20})],Yt.prototype,"saltLength",void 0),a([l({type:h.Integer,context:3,defaultValue:1})],Yt.prototype,"trailerField",void 0),new R({algorithm:Xr,parameters:j.serialize(new Yt)});class Cn{constructor(e={}){this.digestAlgorithm=new R,this.digest=new ne,Object.assign(this,e)}}a([l({type:R})],Cn.prototype,"digestAlgorithm",void 0),a([l({type:ne})],Cn.prototype,"digest",void 0);var Is;class xn{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ue})],xn.prototype,"prime",void 0),a([l({type:h.Integer,converter:ue})],xn.prototype,"exponent",void 0),a([l({type:h.Integer,converter:ue})],xn.prototype,"coefficient",void 0);let Ns=Is=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Is.prototype)}};Ns=Is=a([B({type:C.Sequence,itemType:xn})],Ns);class ct{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)}}a([l({type:h.Integer})],ct.prototype,"version",void 0),a([l({type:h.Integer,converter:ue})],ct.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ue})],ct.prototype,"publicExponent",void 0),a([l({type:h.Integer,converter:ue})],ct.prototype,"privateExponent",void 0),a([l({type:h.Integer,converter:ue})],ct.prototype,"prime1",void 0),a([l({type:h.Integer,converter:ue})],ct.prototype,"prime2",void 0),a([l({type:h.Integer,converter:ue})],ct.prototype,"exponent1",void 0),a([l({type:h.Integer,converter:ue})],ct.prototype,"exponent2",void 0),a([l({type:h.Integer,converter:ue})],ct.prototype,"coefficient",void 0),a([l({type:Ns,optional:!0})],ct.prototype,"otherPrimeInfos",void 0);class Os{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ue})],Os.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ue})],Os.prototype,"publicExponent",void 0);var Ts;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(Ts||(Ts={}));const _e=Ts;/*! *****************************************************************************
76
76
  Copyright (c) Microsoft Corporation.
77
77
 
78
78
  Permission to use, copy, modify, and/or distribute this software for any
@@ -85,9 +85,9 @@ ${e.join(`
85
85
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
86
86
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
87
87
  PERFORMANCE OF THIS SOFTWARE.
88
- ***************************************************************************** */var Ts=function(r,e){return Ts=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])},Ts(r,e)};function Vs(r,e){Ts(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ld(r,e,t,i){function n(s){return s instanceof t?s:new t(function(c){c(s)})}return new(t||(t=Promise))(function(s,c){function u(v){try{p(i.next(v))}catch(y){c(y)}}function f(v){try{p(i.throw(v))}catch(y){c(y)}}function p(v){v.done?s(v.value):n(v.value).then(u,f)}p((i=i.apply(r,[])).next())})}function ud(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(v){return f([p,v])}}function f(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=p[0]&2?n.return:p[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,p[1])).done)return s;switch(n=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){t.label=p[1];break}if(p[0]===6&&t.label<s[1]){t.label=s[1],s=p;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(p);break}s[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(v){p=[6,v],n=0}finally{i=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function kn(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 xn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],c;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){c={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}return s}function Wt(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(xn(arguments[e]));return r}var fd="injectionTokens";function dd(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(fd,r)||{};return Object.keys(t).forEach(function(i){e[+i]=t[i]}),e}function pl(r){return!!r.useClass}function _s(r){return!!r.useFactory}var hl=function(){function r(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return r.prototype.createProxy=function(e){var t=this,i={},n=!1,s,c=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(i,this.createHandler(c))},r.prototype.createHandler=function(e){var t={},i=function(n){t[n]=function(){for(var s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];s[0]=e();var u=Reflect[n];return u.apply(void 0,Wt(s))}};return this.reflectMethods.forEach(i),t},r}();function wr(r){return typeof r=="string"||typeof r=="symbol"}function pd(r){return typeof r=="object"&&"token"in r&&"multiple"in r}function yl(r){return typeof r=="object"&&"token"in r&&"transform"in r}function hd(r){return typeof r=="function"||r instanceof hl}function Cn(r){return!!r.useToken}function Bn(r){return r.useValue!=null}function yd(r){return pl(r)||Bn(r)||Cn(r)||_s(r)}var js=function(){function r(){this._registryMap=new Map}return r.prototype.entries=function(){return this._registryMap.entries()},r.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},r.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},r.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},r.prototype.setAll=function(e,t){this._registryMap.set(e,t)},r.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},r.prototype.clear=function(){this._registryMap.clear()},r.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},r}(),gd=function(r){Vs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(js),gl=function(){function r(){this.scopedResolutions=new Map}return r}();function md(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}function vd(r,e,t){return t===void 0&&(t=" "),Wt([r],e.message.split(`
88
+ ***************************************************************************** */var Vs=function(r,e){return Vs=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])},Vs(r,e)};function _s(r,e){Vs(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function pd(r,e,t,i){function n(s){return s instanceof t?s:new t(function(c){c(s)})}return new(t||(t=Promise))(function(s,c){function u(b){try{p(i.next(b))}catch(y){c(y)}}function f(b){try{p(i.throw(b))}catch(y){c(y)}}function p(b){b.done?s(b.value):n(b.value).then(u,f)}p((i=i.apply(r,[])).next())})}function hd(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(b){return f([p,b])}}function f(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=p[0]&2?n.return:p[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,p[1])).done)return s;switch(n=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){t.label=p[1];break}if(p[0]===6&&t.label<s[1]){t.label=s[1],s=p;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(p);break}s[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(b){p=[6,b],n=0}finally{i=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Bn(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 En(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],c;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){c={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}return s}function Zt(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(En(arguments[e]));return r}var yd="injectionTokens";function gd(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(yd,r)||{};return Object.keys(t).forEach(function(i){e[+i]=t[i]}),e}function ml(r){return!!r.useClass}function js(r){return!!r.useFactory}var bl=function(){function r(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return r.prototype.createProxy=function(e){var t=this,i={},n=!1,s,c=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(i,this.createHandler(c))},r.prototype.createHandler=function(e){var t={},i=function(n){t[n]=function(){for(var s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];s[0]=e();var u=Reflect[n];return u.apply(void 0,Zt(s))}};return this.reflectMethods.forEach(i),t},r}();function kr(r){return typeof r=="string"||typeof r=="symbol"}function md(r){return typeof r=="object"&&"token"in r&&"multiple"in r}function vl(r){return typeof r=="object"&&"token"in r&&"transform"in r}function bd(r){return typeof r=="function"||r instanceof bl}function In(r){return!!r.useToken}function Nn(r){return r.useValue!=null}function vd(r){return ml(r)||Nn(r)||In(r)||js(r)}var Ps=function(){function r(){this._registryMap=new Map}return r.prototype.entries=function(){return this._registryMap.entries()},r.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},r.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},r.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},r.prototype.setAll=function(e,t){this._registryMap.set(e,t)},r.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},r.prototype.clear=function(){this._registryMap.clear()},r.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},r}(),wd=function(r){_s(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ps),wl=function(){function r(){this.scopedResolutions=new Map}return r}();function Sd(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}function Ad(r,e,t){return t===void 0&&(t=" "),Zt([r],e.message.split(`
89
89
  `).map(function(i){return t+i})).join(`
90
- `)}function bd(r,e,t){var i=xn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,c=md(s,e);return vd("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function wd(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var Ad=function(r){Vs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(js),Sd=function(r){Vs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(js),kd=function(){function r(){this.preResolution=new Ad,this.postResolution=new Sd}return r}(),ml=new Map,xd=function(){function r(e){this.parent=e,this._registry=new gd,this.interceptors=new kd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:_e.Transient}),this.ensureNotDisposed();var n;if(yd(t)?n=t:n={useClass:t},Cn(n))for(var s=[e],c=n;c!=null;){var u=c.useToken;if(s.includes(u))throw new Error("Token registration cycle detected! "+Wt(s,[u]).join(" -> "));s.push(u);var f=this._registry.get(u);f&&Cn(f.provider)?c=f.provider:c=null}if((i.lifecycle===_e.Singleton||i.lifecycle==_e.ContainerScoped||i.lifecycle==_e.ResolutionScoped)&&(Bn(n)||_s(n)))throw new Error('Cannot use lifecycle "'+_e[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:i}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),wr(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},r.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},r.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),wr(e)){if(wr(t))return this.register(e,{useToken:t},{lifecycle:_e.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:_e.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!wr(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:_e.Singleton})},r.prototype.resolve=function(e,t){t===void 0&&(t=new gl),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&wr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),i){var n=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}if(hd(e)){var n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var i,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var c=kn(this.interceptors.preResolution.getAll(e)),u=c.next();!u.done;u=c.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(p){i={error:p}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(e,s)}},r.prototype.executePostResolutionInterceptor=function(e,t,i){var n,s;if(this.interceptors.postResolution.has(e)){var c=[];try{for(var u=kn(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var p=f.value;p.options.frequency!="Once"&&c.push(p),p.callback(e,t,i)}}catch(v){n={error:v}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,c)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===_e.Singleton,n=e.options.lifecycle===_e.ContainerScoped,s=i||n,c;return Bn(e.provider)?c=e.provider.useValue:Cn(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):pl(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):_s(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t){var i=this;t===void 0&&(t=new gl),this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&wr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),n){var s=n.map(function(u){return i.resolveRegistration(u,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var c=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,c,"All"),c},r.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},r.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},r.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var i=kn(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=xn(n.value,2),c=s[0],u=s[1];this._registry.setAll(c,u.filter(function(f){return!Bn(f.provider)}).map(function(f){return f.instance=void 0,f}))}}catch(f){e={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var i=new r(this);try{for(var n=kn(this._registry.entries()),s=n.next();!s.done;s=n.next()){var c=xn(s.value,2),u=c[0],f=c[1];f.some(function(p){var v=p.options;return v.lifecycle===_e.ContainerScoped})&&i._registry.setAll(u,f.map(function(p){return p.options.lifecycle===_e.ContainerScoped?{provider:p.provider,options:p.options}:p}))}}catch(p){e={error:p}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return i},r.prototype.beforeResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:i})},r.prototype.afterResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:i})},r.prototype.dispose=function(){return ld(this,void 0,void 0,function(){var e;return ud(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(i){var n=i.dispose();n&&e.push(n)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},r.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},r.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},r.prototype.construct=function(e,t){var i=this;if(e instanceof hl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=ml.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var c=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Wt([void 0],c)))}();return wd(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var c,u,f;try{return pd(n)?yl(n)?n.multiple?(c=i.resolve(n.transform)).transform.apply(c,Wt([i.resolveAll(n.token)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Wt([i.resolve(n.token,e)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,e):yl(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Wt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(p){throw new Error(bd(t,s,p))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),Ee=new xd;function In(){return function(r){ml.set(r,dd(r))}}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 Ps;class En{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:h.ObjectIdentifier})],En.prototype,"attrId",void 0),a([l({type:h.Any,repeated:"set"})],En.prototype,"attrValues",void 0);let vl=Ps=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ps.prototype)}};vl=Ps=a([I({type:x.Sequence,itemType:En})],vl);var Rs;let bl=Rs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Rs.prototype)}};bl=Rs=a([I({type:x.Sequence,itemType:hr})],bl);class wl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],wl.prototype,"certId",void 0),a([l({type:h.Any,context:0})],wl.prototype,"certValue",void 0);class Al{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Al.prototype,"crlId",void 0),a([l({type:h.Any,context:0})],Al.prototype,"crltValue",void 0);class Sl extends re{}let Nn=class{constructor(e={}){this.encryptionAlgorithm=new D,this.encryptedData=new Sl,Object.assign(this,e)}};a([l({type:D})],Nn.prototype,"encryptionAlgorithm",void 0),a([l({type:Sl})],Nn.prototype,"encryptedData",void 0);var Ds,Ms;(function(r){r[r.v1=0]="v1"})(Ms||(Ms={}));class kl extends re{}let $s=Ds=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ds.prototype)}};$s=Ds=a([I({type:x.Sequence,itemType:ht})],$s);class Yr{constructor(e={}){this.version=Ms.v1,this.privateKeyAlgorithm=new D,this.privateKey=new kl,Object.assign(this,e)}}a([l({type:h.Integer})],Yr.prototype,"version",void 0),a([l({type:D})],Yr.prototype,"privateKeyAlgorithm",void 0),a([l({type:kl})],Yr.prototype,"privateKey",void 0),a([l({type:$s,implicit:!0,context:0,optional:!0})],Yr.prototype,"attributes",void 0);let xl=class extends Yr{};xl=a([I({type:x.Sequence})],xl);let Cl=class extends Nn{};Cl=a([I({type:x.Sequence})],Cl);class Bl{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Bl.prototype,"secretTypeId",void 0),a([l({type:h.Any,context:0})],Bl.prototype,"secretValue",void 0);class Zr{constructor(e={}){this.mac=new An,this.macSalt=new re,this.iterations=1,Object.assign(this,e)}}a([l({type:An})],Zr.prototype,"mac",void 0),a([l({type:re})],Zr.prototype,"macSalt",void 0),a([l({type:h.Integer,defaultValue:1})],Zr.prototype,"iterations",void 0);class On{constructor(e={}){this.version=3,this.authSafe=new hr,this.macData=new Zr,Object.assign(this,e)}}a([l({type:h.Integer})],On.prototype,"version",void 0),a([l({type:hr})],On.prototype,"authSafe",void 0),a([l({type:Zr,optional:!0})],On.prototype,"macData",void 0);var Us;class Tn{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Tn.prototype,"bagId",void 0),a([l({type:h.Any,context:0})],Tn.prototype,"bagValue",void 0),a([l({type:En,repeated:"set",optional:!0})],Tn.prototype,"bagAttributes",void 0);let Il=Us=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Us.prototype)}};Il=Us=a([I({type:x.Sequence,itemType:Tn})],Il);var Ls,Hs,Fs;const El="1.2.840.113549.1.9",Nl=`${El}.7`,qs=`${El}.14`;let Vn=class extends we{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:h.IA5String})],Vn.prototype,"ia5String",void 0),Vn=a([I({type:x.Choice})],Vn);let Ol=class extends hr{};Ol=a([I({type:x.Sequence})],Ol);let Tl=class extends On{};Tl=a([I({type:x.Sequence})],Tl);let Vl=class extends Nn{};Vl=a([I({type:x.Sequence})],Vl);let Ks=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.IA5String})],Ks.prototype,"value",void 0),Ks=a([I({type:x.Choice})],Ks);let _l=class extends Vn{};_l=a([I({type:x.Choice})],_l);let jl=class extends we{};jl=a([I({type:x.Choice})],jl);let zs=class{constructor(e=new Date){this.value=e}};a([l({type:h.GeneralizedTime})],zs.prototype,"value",void 0),zs=a([I({type:x.Choice})],zs);let Pl=class extends we{};Pl=a([I({type:x.Choice})],Pl);let Gs=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],Gs.prototype,"value",void 0),Gs=a([I({type:x.Choice})],Gs);let _n=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],_n.prototype,"value",void 0),_n=a([I({type:x.Choice})],_n);let Rl=class extends _n{};Rl=a([I({type:x.Choice})],Rl);let Dl=class extends we{};Dl=a([I({type:x.Choice})],Dl);let Ws=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.ObjectIdentifier})],Ws.prototype,"value",void 0),Ws=a([I({type:x.Choice})],Ws);let Ml=class extends Ae{};Ml=a([I({type:x.Choice})],Ml);let Js=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:h.Integer})],Js.prototype,"value",void 0),Js=a([I({type:x.Choice})],Js);let $l=class extends nt{};$l=a([I({type:x.Sequence})],$l);let jn=class extends we{};jn=a([I({type:x.Choice})],jn);let Ul=Ls=class extends Lt{constructor(e){super(e),Object.setPrototypeOf(this,Ls.prototype)}};Ul=Ls=a([I({type:x.Sequence})],Ul);let Ll=Hs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Hs.prototype)}};Ll=Hs=a([I({type:x.Set,itemType:ur})],Ll);let Ys=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.BmpString})],Ys.prototype,"value",void 0),Ys=a([I({type:x.Choice})],Ys);let Zs=class extends D{};Zs=a([I({type:x.Sequence})],Zs);let Hl=Fs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Fs.prototype)}};Hl=Fs=a([I({type:x.Sequence,itemType:Zs})],Hl);var Qs;let Pn=Qs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Qs.prototype)}};Pn=Qs=a([I({type:x.Sequence,itemType:ht})],Pn);class Ar{constructor(e={}){this.version=0,this.subject=new ye,this.subjectPKInfo=new rt,this.attributes=new Pn,Object.assign(this,e)}}a([l({type:h.Integer})],Ar.prototype,"version",void 0),a([l({type:ye})],Ar.prototype,"subject",void 0),a([l({type:rt})],Ar.prototype,"subjectPKInfo",void 0),a([l({type:Pn,implicit:!0,context:0})],Ar.prototype,"attributes",void 0);class Qr{constructor(e={}){this.certificationRequestInfo=new Ar,this.signatureAlgorithm=new D,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ar})],Qr.prototype,"certificationRequestInfo",void 0),a([l({type:D})],Qr.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Qr.prototype,"signature",void 0);/*!
90
+ `)}function kd(r,e,t){var i=En(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,c=Sd(s,e);return Ad("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function Cd(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var xd=function(r){_s(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ps),Bd=function(r){_s(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ps),Ed=function(){function r(){this.preResolution=new xd,this.postResolution=new Bd}return r}(),Sl=new Map,Id=function(){function r(e){this.parent=e,this._registry=new wd,this.interceptors=new Ed,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:_e.Transient}),this.ensureNotDisposed();var n;if(vd(t)?n=t:n={useClass:t},In(n))for(var s=[e],c=n;c!=null;){var u=c.useToken;if(s.includes(u))throw new Error("Token registration cycle detected! "+Zt(s,[u]).join(" -> "));s.push(u);var f=this._registry.get(u);f&&In(f.provider)?c=f.provider:c=null}if((i.lifecycle===_e.Singleton||i.lifecycle==_e.ContainerScoped||i.lifecycle==_e.ResolutionScoped)&&(Nn(n)||js(n)))throw new Error('Cannot use lifecycle "'+_e[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:i}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),kr(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},r.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},r.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),kr(e)){if(kr(t))return this.register(e,{useToken:t},{lifecycle:_e.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:_e.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!kr(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:_e.Singleton})},r.prototype.resolve=function(e,t){t===void 0&&(t=new wl),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&kr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),i){var n=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}if(bd(e)){var n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var i,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var c=Bn(this.interceptors.preResolution.getAll(e)),u=c.next();!u.done;u=c.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(p){i={error:p}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(e,s)}},r.prototype.executePostResolutionInterceptor=function(e,t,i){var n,s;if(this.interceptors.postResolution.has(e)){var c=[];try{for(var u=Bn(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var p=f.value;p.options.frequency!="Once"&&c.push(p),p.callback(e,t,i)}}catch(b){n={error:b}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,c)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===_e.Singleton,n=e.options.lifecycle===_e.ContainerScoped,s=i||n,c;return Nn(e.provider)?c=e.provider.useValue:In(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):ml(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):js(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t){var i=this;t===void 0&&(t=new wl),this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&kr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),n){var s=n.map(function(u){return i.resolveRegistration(u,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var c=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,c,"All"),c},r.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},r.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},r.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var i=Bn(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=En(n.value,2),c=s[0],u=s[1];this._registry.setAll(c,u.filter(function(f){return!Nn(f.provider)}).map(function(f){return f.instance=void 0,f}))}}catch(f){e={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var i=new r(this);try{for(var n=Bn(this._registry.entries()),s=n.next();!s.done;s=n.next()){var c=En(s.value,2),u=c[0],f=c[1];f.some(function(p){var b=p.options;return b.lifecycle===_e.ContainerScoped})&&i._registry.setAll(u,f.map(function(p){return p.options.lifecycle===_e.ContainerScoped?{provider:p.provider,options:p.options}:p}))}}catch(p){e={error:p}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return i},r.prototype.beforeResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:i})},r.prototype.afterResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:i})},r.prototype.dispose=function(){return pd(this,void 0,void 0,function(){var e;return hd(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(i){var n=i.dispose();n&&e.push(n)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},r.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},r.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},r.prototype.construct=function(e,t){var i=this;if(e instanceof bl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=Sl.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var c=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Zt([void 0],c)))}();return Cd(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var c,u,f;try{return md(n)?vl(n)?n.multiple?(c=i.resolve(n.transform)).transform.apply(c,Zt([i.resolveAll(n.token)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Zt([i.resolve(n.token,e)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,e):vl(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Zt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(p){throw new Error(kd(t,s,p))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),Ie=new Id;function On(){return function(r){Sl.set(r,gd(r))}}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 Rs;class Tn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:h.ObjectIdentifier})],Tn.prototype,"attrId",void 0),a([l({type:h.Any,repeated:"set"})],Tn.prototype,"attrValues",void 0);let Al=Rs=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Rs.prototype)}};Al=Rs=a([B({type:C.Sequence,itemType:Tn})],Al);var Ds;let kl=Ds=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Ds.prototype)}};kl=Ds=a([B({type:C.Sequence,itemType:mr})],kl);class Cl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Cl.prototype,"certId",void 0),a([l({type:h.Any,context:0})],Cl.prototype,"certValue",void 0);class xl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],xl.prototype,"crlId",void 0),a([l({type:h.Any,context:0})],xl.prototype,"crltValue",void 0);class Bl extends ne{}let Vn=class{constructor(e={}){this.encryptionAlgorithm=new R,this.encryptedData=new Bl,Object.assign(this,e)}};a([l({type:R})],Vn.prototype,"encryptionAlgorithm",void 0),a([l({type:Bl})],Vn.prototype,"encryptedData",void 0);var $s,Ms;(function(r){r[r.v1=0]="v1"})(Ms||(Ms={}));class El extends ne{}let Us=$s=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,$s.prototype)}};Us=$s=a([B({type:C.Sequence,itemType:gt})],Us);class ei{constructor(e={}){this.version=Ms.v1,this.privateKeyAlgorithm=new R,this.privateKey=new El,Object.assign(this,e)}}a([l({type:h.Integer})],ei.prototype,"version",void 0),a([l({type:R})],ei.prototype,"privateKeyAlgorithm",void 0),a([l({type:El})],ei.prototype,"privateKey",void 0),a([l({type:Us,implicit:!0,context:0,optional:!0})],ei.prototype,"attributes",void 0);let Il=class extends ei{};Il=a([B({type:C.Sequence})],Il);let Nl=class extends Vn{};Nl=a([B({type:C.Sequence})],Nl);class Ol{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Ol.prototype,"secretTypeId",void 0),a([l({type:h.Any,context:0})],Ol.prototype,"secretValue",void 0);class ti{constructor(e={}){this.mac=new Cn,this.macSalt=new ne,this.iterations=1,Object.assign(this,e)}}a([l({type:Cn})],ti.prototype,"mac",void 0),a([l({type:ne})],ti.prototype,"macSalt",void 0),a([l({type:h.Integer,defaultValue:1})],ti.prototype,"iterations",void 0);class _n{constructor(e={}){this.version=3,this.authSafe=new mr,this.macData=new ti,Object.assign(this,e)}}a([l({type:h.Integer})],_n.prototype,"version",void 0),a([l({type:mr})],_n.prototype,"authSafe",void 0),a([l({type:ti,optional:!0})],_n.prototype,"macData",void 0);var Ls;class jn{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],jn.prototype,"bagId",void 0),a([l({type:h.Any,context:0})],jn.prototype,"bagValue",void 0),a([l({type:Tn,repeated:"set",optional:!0})],jn.prototype,"bagAttributes",void 0);let Tl=Ls=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Ls.prototype)}};Tl=Ls=a([B({type:C.Sequence,itemType:jn})],Tl);var Hs,Fs,qs;const Vl="1.2.840.113549.1.9",_l=`${Vl}.7`,Ks=`${Vl}.14`;let Pn=class extends we{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:h.IA5String})],Pn.prototype,"ia5String",void 0),Pn=a([B({type:C.Choice})],Pn);let jl=class extends mr{};jl=a([B({type:C.Sequence})],jl);let Pl=class extends _n{};Pl=a([B({type:C.Sequence})],Pl);let Rl=class extends Vn{};Rl=a([B({type:C.Sequence})],Rl);let zs=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.IA5String})],zs.prototype,"value",void 0),zs=a([B({type:C.Choice})],zs);let Dl=class extends Pn{};Dl=a([B({type:C.Choice})],Dl);let $l=class extends we{};$l=a([B({type:C.Choice})],$l);let Gs=class{constructor(e=new Date){this.value=e}};a([l({type:h.GeneralizedTime})],Gs.prototype,"value",void 0),Gs=a([B({type:C.Choice})],Gs);let Ml=class extends we{};Ml=a([B({type:C.Choice})],Ml);let Ws=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],Ws.prototype,"value",void 0),Ws=a([B({type:C.Choice})],Ws);let Rn=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],Rn.prototype,"value",void 0),Rn=a([B({type:C.Choice})],Rn);let Ul=class extends Rn{};Ul=a([B({type:C.Choice})],Ul);let Ll=class extends we{};Ll=a([B({type:C.Choice})],Ll);let Js=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.ObjectIdentifier})],Js.prototype,"value",void 0),Js=a([B({type:C.Choice})],Js);let Hl=class extends Se{};Hl=a([B({type:C.Choice})],Hl);let Ys=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:h.Integer})],Ys.prototype,"value",void 0),Ys=a([B({type:C.Choice})],Ys);let Fl=class extends at{};Fl=a([B({type:C.Sequence})],Fl);let Dn=class extends we{};Dn=a([B({type:C.Choice})],Dn);let ql=Hs=class extends qt{constructor(e){super(e),Object.setPrototypeOf(this,Hs.prototype)}};ql=Hs=a([B({type:C.Sequence})],ql);let Kl=Fs=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Fs.prototype)}};Kl=Fs=a([B({type:C.Set,itemType:pr})],Kl);let Zs=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.BmpString})],Zs.prototype,"value",void 0),Zs=a([B({type:C.Choice})],Zs);let Qs=class extends R{};Qs=a([B({type:C.Sequence})],Qs);let zl=qs=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,qs.prototype)}};zl=qs=a([B({type:C.Sequence,itemType:Qs})],zl);var Xs;let $n=Xs=class extends se{constructor(e){super(e),Object.setPrototypeOf(this,Xs.prototype)}};$n=Xs=a([B({type:C.Sequence,itemType:gt})],$n);class Cr{constructor(e={}){this.version=0,this.subject=new he,this.subjectPKInfo=new ot,this.attributes=new $n,Object.assign(this,e)}}a([l({type:h.Integer})],Cr.prototype,"version",void 0),a([l({type:he})],Cr.prototype,"subject",void 0),a([l({type:ot})],Cr.prototype,"subjectPKInfo",void 0),a([l({type:$n,implicit:!0,context:0})],Cr.prototype,"attributes",void 0);class ri{constructor(e={}){this.certificationRequestInfo=new Cr,this.signatureAlgorithm=new R,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Cr})],ri.prototype,"certificationRequestInfo",void 0),a([l({type:R})],ri.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],ri.prototype,"signature",void 0);/*!
91
91
  * MIT License
92
92
  *
93
93
  * Copyright (c) Peculiar Ventures. All rights reserved.
@@ -110,8 +110,8 @@ ${e.join(`
110
110
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
111
111
  * SOFTWARE.
112
112
  *
113
- */const Xr="crypto.algorithm";class Cd{getAlgorithms(){return Ee.resolveAll(Xr)}toAsnAlgorithm(e){({...e});for(const t of this.getAlgorithms()){const i=t.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){const t=new D({algorithm:e.name});if("parameters"in e){const i=e;t.parameters=i.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const i of this.getAlgorithms()){const n=i.toWebAlgorithm(e);if(n)return n}return{name:e.algorithm,parameters:e.parameters}}}const Sr="crypto.algorithmProvider";Ee.registerSingleton(Sr,Cd);var Rn;const je="1.3.36.3.3.2.8.1.1",Fl=`${je}.1`,ql=`${je}.2`,Kl=`${je}.3`,zl=`${je}.4`,Gl=`${je}.5`,Wl=`${je}.6`,Jl=`${je}.7`,Yl=`${je}.8`,Zl=`${je}.9`,Ql=`${je}.10`,Xl=`${je}.11`,eu=`${je}.12`,tu=`${je}.13`,ru=`${je}.14`,iu="brainpoolP160r1",nu="brainpoolP160t1",ou="brainpoolP192r1",su="brainpoolP192t1",au="brainpoolP224r1",cu="brainpoolP224t1",lu="brainpoolP256r1",uu="brainpoolP256t1",fu="brainpoolP320r1",du="brainpoolP320t1",pu="brainpoolP384r1",hu="brainpoolP384t1",yu="brainpoolP512r1",gu="brainpoolP512t1",fe="ECDSA";let ei=Rn=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case fe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Jf;case"sha-256":return Yf;case"sha-384":return Zf;case"sha-512":return Qf}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=ol;break;case"K-256":t=Rn.SECP256K1;break;case"P-384":t=sl;break;case"P-521":t=al;break;case iu:t=Fl;break;case nu:t=ql;break;case ou:t=Kl;break;case su:t=zl;break;case au:t=Gl;break;case cu:t=Wl;break;case lu:t=Jl;break;case uu:t=Yl;break;case fu:t=Zl;break;case du:t=Ql;break;case pu:t=Xl;break;case hu:t=eu;break;case yu:t=tu;break;case gu:t=ru;break}if(t)return new D({algorithm:zr,parameters:P.serialize(new Ct({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case As:return{name:fe,hash:{name:"SHA-1"}};case Ss:return{name:fe,hash:{name:"SHA-256"}};case ks:return{name:fe,hash:{name:"SHA-384"}};case xs:return{name:fe,hash:{name:"SHA-512"}};case zr:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(P.parse(e.parameters,Ct).namedCurve){case ol:return{name:fe,namedCurve:"P-256"};case Rn.SECP256K1:return{name:fe,namedCurve:"K-256"};case sl:return{name:fe,namedCurve:"P-384"};case al:return{name:fe,namedCurve:"P-521"};case Fl:return{name:fe,namedCurve:iu};case ql:return{name:fe,namedCurve:nu};case Kl:return{name:fe,namedCurve:ou};case zl:return{name:fe,namedCurve:su};case Gl:return{name:fe,namedCurve:au};case Wl:return{name:fe,namedCurve:cu};case Jl:return{name:fe,namedCurve:lu};case Yl:return{name:fe,namedCurve:uu};case Zl:return{name:fe,namedCurve:fu};case Ql:return{name:fe,namedCurve:du};case Xl:return{name:fe,namedCurve:pu};case eu:return{name:fe,namedCurve:hu};case tu:return{name:fe,namedCurve:yu};case ru:return{name:fe,namedCurve:gu}}}}return null}};ei.SECP256K1="1.3.132.0.10",ei=Rn=a([In()],ei),Ee.registerSingleton(Xr,ei);const mu=Symbol("name"),vu=Symbol("value");class ne{constructor(e,t={},i=""){this[mu]=e,this[vu]=i;for(const n in t)this[n]=t[n]}}ne.NAME=mu,ne.VALUE=vu;class Bd{static toTextObject(e){const t=new ne("Algorithm Identifier",{},Bt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case zr:{const i=new ei().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class Bt{static toString(e){const t=this.items[e];return t||e}}Bt.items={[yn]:"sha1",[ul]:"sha224",[gn]:"sha256",[mn]:"sha384",[vn]:"sha512",[Kt]:"rsaEncryption",[dn]:"sha1WithRSAEncryption",[nd]:"sha224WithRSAEncryption",[Bs]:"sha256WithRSAEncryption",[pn]:"sha384WithRSAEncryption",[hn]:"sha512WithRSAEncryption",[zr]:"ecPublicKey",[As]:"ecdsaWithSHA1",[nl]:"ecdsaWithSHA224",[Ss]:"ecdsaWithSHA256",[ks]:"ecdsaWithSHA384",[xs]:"ecdsaWithSHA512",[Hf]:"TLS WWW server authentication",[Ff]:"TLS WWW client authentication",[qf]:"Code Signing",[Kf]:"E-mail Protection",[zf]:"Time Stamping",[Gf]:"OCSP Signing",[Wf]:"Signed Data"};class Jt{static serialize(e){return this.serializeObj(e).join(`
114
- `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const i=[];let n=this.pad(t++),s="";const c=e[ne.VALUE];c&&(s=` ${c}`),i.push(`${n}${e[ne.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],p=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${p}${f}`);else if(f instanceof Date)i.push(`${n}${p}${f.toUTCString()}`);else if(Array.isArray(f))for(const v of f)v[ne.NAME]=u,i.push(...this.serializeObj(v,t));else if(f instanceof ne)f[ne.NAME]=u,i.push(...this.serializeObj(f,t));else if(j.isBufferSource(f))u?(i.push(`${n}${p}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const v=f.toTextObject();v[ne.NAME]=u,i.push(...this.serializeObj(v,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(e,t=0){const i=this.pad(t),n=j.toUint8Array(e),s=[];for(let c=0;c<n.length;){const u=[];for(let f=0;f<16&&c<n.length;f++){f===8&&u.push("");const p=n[c++].toString(16).padStart(2,"0");u.push(p)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Jt.oidSerializer=Bt,Jt.algorithmSerializer=Bd;class It{constructor(...e){if(e.length===1){const t=e[0];this.rawData=P.serialize(t),this.onInit(t)}else{const t=P.parse(e[0],e[1]);this.rawData=j.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof It?Aa(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return P.toString(this.rawData);case"text":return Jt.serialize(this.toTextObject());case"hex":return H.ToHex(this.rawData);case"base64":return H.ToBase64(this.rawData);case"base64url":return H.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new ne(this.getTextName(),{},e)}}It.NAME="ASN";class Fe extends It{constructor(...e){let t;j.isBufferSource(e[0])?t=j.toArrayBuffer(e[0]):t=P.serialize(new Je({extnID:e[0],critical:e[1],extnValue:new re(j.toArrayBuffer(e[2]))})),super(t,Je)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[ne.NAME]===Fe.NAME&&(e[ne.NAME]=Bt.toString(this.type)),e}}var bu;class Et{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[bu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(Et.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(Et.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,t){return this.items.forEach(e,t)}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=Et.DEFAULT){const t=this.items.get(e.toLowerCase());if(!t)throw new Error(`Cannot get Crypto by name '${e}'`);return t}set(e,t){if(typeof e=="string"){if(!t)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),t)}else this.items.set(Et.DEFAULT,e);return this}}bu=Symbol.toStringTag,Et.DEFAULT="default";const Ne=new Et,Id=/^[0-2](?:\.[1-9][0-9]*)+$/;function Ed(r){return new RegExp(Id).test(r)}class wu{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Ed(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Pe=new wu;Pe.register("CN","2.5.4.3"),Pe.register("L","2.5.4.7"),Pe.register("ST","2.5.4.8"),Pe.register("O","2.5.4.10"),Pe.register("OU","2.5.4.11"),Pe.register("C","2.5.4.6"),Pe.register("DC","0.9.2342.19200300.100.1.25"),Pe.register("E","1.2.840.113549.1.9.1"),Pe.register("G","2.5.4.42"),Pe.register("I","2.5.4.43"),Pe.register("SN","2.5.4.4"),Pe.register("T","2.5.4.12");function Nd(r,e){return`\\${H.ToHex(H.FromUtf8String(e)).toUpperCase()}`}function Od(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Nd)}class Nt{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,t={}){this.extraNames=new wu,this.asn=new ye;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];this.extraNames.register(i,n)}typeof e=="string"?this.asn=this.fromString(e):e instanceof ye?this.asn=e:j.isBufferSource(e)?this.asn=P.parse(e,ye):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Pe.findId(e),i=[];for(const n of this.asn)for(const s of n)s.type===t&&i.push(s.value.toString());return i}getName(e){return this.extraNames.get(e)||Pe.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${H.ToHex(t.value.anyValue)}`:Od(t.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var e;const t=[];for(const i of this.asn){const n={};for(const s of i){const c=this.getName(s.type)||s.type;(e=n[c])!==null&&e!==void 0||(n[c]=[]),n[c].push(s.value.anyValue?`#${H.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(n)}return t}fromString(e){const t=new ye,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${e},`);){let[,c,u]=n;const f=u[u.length-1];(f===","||f==="+")&&(u=u.slice(0,u.length-1),n[3]=f);const p=n[3];c=this.getTypeOid(c);const v=this.createAttribute(c,u);s==="+"?t[t.length-1].push(v):t.push(new tr([v])),s=p}return t}fromJSON(e){const t=new ye;for(const i of e){const n=new tr;for(const s in i){const c=this.getTypeOid(s),u=i[s];for(const f of u){const p=this.createAttribute(c,f);n.push(p)}}t.push(n)}return t}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,t){const i=new Oi({type:e});if(typeof t=="object")for(const n in t)switch(n){case"ia5String":i.value.ia5String=t[n];break;case"utf8String":i.value.utf8String=t[n];break;case"universalString":i.value.universalString=t[n];break;case"bmpString":i.value.bmpString=t[n];break;case"printableString":i.value.printableString=t[n];break}else if(t[0]==="#")i.value.anyValue=H.FromHex(t.slice(1));else{const n=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:Nt.isPrintableString(n)?i.value.printableString=n:i.value.utf8String=n}return i}processStringValue(e){const t=/"(.*?[^\\])?"/.exec(e);return t&&(e=t[1]),e.replace(/\\0a/ig,`
115
- `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return P.serialize(this.asn)}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]||Ne.get()):i=e[0]||Ne.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const Au="Cannot initialize GeneralName from ASN.1 data.",Su=`${Au} Unsupported string format in use.`,Td=`${Au} Value doesn't match to GUID regular expression.`,ku=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,xu="1.3.6.1.4.1.311.25.1",Cu="1.3.6.1.4.1.311.20.2.3",Xs="dns",ea="dn",ta="email",ra="ip",ia="url",na="guid",oa="upn",Dn="id";class Ot extends It{constructor(...e){let t;if(e.length===2)switch(e[0]){case ea:{const i=new Nt(e[1]).toArrayBuffer(),n=P.parse(i,ye);t=new J({directoryName:n});break}case Xs:t=new J({dNSName:e[1]});break;case ta:t=new J({rfc822Name:e[1]});break;case na:{const i=new RegExp(ku,"i").exec(e[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,c)=>c<3?H.ToHex(new Uint8Array(H.FromHex(s)).reverse()):s).join("");t=new J({otherName:new Vr({typeId:xu,value:P.serialize(new re(H.FromHex(n)))})});break}case ra:t=new J({iPAddress:e[1]});break;case Dn:t=new J({registeredID:e[1]});break;case oa:{t=new J({otherName:new Vr({typeId:Cu,value:P.serialize(kc.toASN(e[1]))})});break}case ia:t=new J({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else j.isBufferSource(e[0])?t=P.parse(e[0],J):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=Xs,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=ta,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=ra,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=ia,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Dn,this.value=e.registeredID;else if(e.directoryName!=null)this.type=ea,this.value=new Nt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===xu){this.type=na;const t=P.parse(e.otherName.value,re),i=new RegExp(ku,"i").exec(H.ToHex(t));if(!i)throw new Error(Td);this.value=i.slice(1).map((n,s)=>s<3?H.ToHex(new Uint8Array(H.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===Cu)this.type=oa,this.value=P.parse(e.otherName.value,we).toString();else throw new Error(Su);else throw new Error(Su)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case ea:case Xs:case na:case ra:case Dn:case oa:case ia:e=this.type.toUpperCase();break;case ta:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Dn&&(t=Bt.toString(t)),new ne(e,void 0,t)}}class ti extends It{constructor(e){let t;if(e instanceof Ie)t=e;else if(Array.isArray(e)){const i=[];for(const n of e)if(n instanceof J)i.push(n);else{const s=P.parse(new Ot(n.type,n.value).rawData,J);i.push(s)}t=new Ie(i)}else if(j.isBufferSource(e))t=P.parse(e,Ie);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){const t=[];for(const i of e){let n=null;try{n=new Ot(i)}catch{continue}t.push(n)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const t of this.items){const i=t.toTextObject();let n=e[i[ne.NAME]];Array.isArray(n)||(n=[],e[i[ne.NAME]]=n),n.push(i)}return e}}ti.NAME="GeneralNames";const ri="-{5}",ii="\\n",Vd=`[^${ii}]+`,_d=`${ri}BEGIN (${Vd}(?=${ri}))${ri}`,jd=`${ri}END \\1${ri}`,kr="\\n",Pd=`[^:${ii}]+`,Rd=`(?:[^${ii}]+${kr}(?: +[^${ii}]+${kr})*)`,Dd=`(?:[a-zA-Z0-9=+/]+${kr})+`,Bu=`${_d}${kr}(?:((?:${Pd}: ${Rd})+))?${kr}?(${Dd})${jd}`;class Me{static isPem(e){return typeof e=="string"&&new RegExp(Bu,"g").test(e)}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(Bu,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${ii}]+`,"g"),""),c={type:n[1],headers:[],rawData:H.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(kr,"g"));let p=null;for(const v of f){const[y,K]=v.split(/:(.*)/);if(K===void 0){if(!p)throw new Error("Cannot parse PEM string. Incorrect header value");p.value+=y.trim()}else p&&c.headers.push(p),p={key:y,value:K.trim()}}p&&c.headers.push(p)}i.push(c)}return i}static decode(e){return this.decodeWithHeaders(e).map(i=>i.rawData)}static decodeFirst(e){const t=this.decode(e);if(!t.length)throw new RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){const i=new Array;return t?e.forEach(n=>{if(!j.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:t,rawData:j.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(`
116
- `)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:j.toArrayBuffer(e)})}}static encodeStruct(e){var t;const i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(const p of e.headers)n.push(`${p.key}: ${p.value}`);n.push("")}const s=H.ToBase64(e.rawData);let c,u=0;const f=Array();for(;u<s.length&&(s.length-u<64?c=s.substring(u):(c=s.substring(u,u+64),u+=64),c.length!==0);)if(f.push(c),c.length<64)break;return n.push(...f),n.push(`-----END ${i}-----`),n.join(`
117
- `)}}Me.CertificateTag="CERTIFICATE",Me.CrlTag="CRL",Me.CertificateRequestTag="CERTIFICATE REQUEST",Me.PublicKeyTag="PUBLIC KEY",Me.PrivateKeyTag="PRIVATE KEY";class vt extends It{static isAsnEncoded(e){return j.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Me.isPem(e))return Me.decode(e)[0];if(H.isHex(e))return H.FromHex(e);if(H.isBase64(e))return H.FromBase64(e);if(H.isBase64Url(e))return H.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=H.ToBinary(e);return Me.isPem(t)?Me.decode(t)[0]:H.isHex(t)?H.FromHex(t):H.isBase64(t)?H.FromBase64(t):H.isBase64Url(t)?H.FromBase64Url(t):j.toArrayBuffer(e)}}constructor(...e){vt.isAsnEncoded(e[0])?super(vt.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return Me.encode(this.rawData,this.tag);default:return super.toString(e)}}}class st extends vt{static async create(e,t=Ne.get()){if(e instanceof st)return e;if(Et.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new st(i)}else{if(e.publicKey)return e.publicKey;if(j.isBufferSource(e))return new st(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){vt.isAsnEncoded(e)?super(e,rt):super(e),this.tag=Me.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]||Ne.get()):t=e[0]||Ne.get();let s=this.rawData;const c=P.parse(this.rawData,rt);return c.algorithm.algorithm===Jr&&(s=Md(c,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=Ee.resolve(Sr),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Kt:{const n=P.parse(e.subjectPublicKey,Ns),s=j.toUint8Array(n.modulus);i.publicExponent=j.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}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]||Ne.get()):i=e[0]||Ne.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=Ne.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Ne.get();const n=P.parse(this.rawData,rt);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=P.parse(this.rawData,rt);switch(e.Algorithm=Jt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case zr:e["EC Point"]=t.subjectPublicKey;break;case Kt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function Md(r,e){return r.algorithm=new D({algorithm:Kt,parameters:null}),e=P.serialize(r),e}class ni extends Fe{static async create(e,t=!1,i=Ne.get()){if("name"in e&&"serialNumber"in e)return new ni(e,t);const s=await(await st.create(e,i)).getKeyIdentifier(i);return new ni(H.ToHex(s),t)}constructor(...e){if(j.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new $t({keyIdentifier:new Co(H.FromHex(e[0]))});super(xo,e[1],P.serialize(t))}else{const t=e[0],i=t.name instanceof ti?P.parse(t.name.rawData,Ie):t.name,n=new $t({authorityCertIssuer:i,authorityCertSerialNumber:H.FromHex(t.serialNumber)});super(xo,e[1],P.serialize(n))}}onInit(e){super.onInit(e);const t=P.parse(e.extnValue,$t);t.keyIdentifier&&(this.keyId=H.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?H.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=P.parse(this.value,$t);return t.authorityCertIssuer&&(e["Authority Issuer"]=new ti(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}ni.NAME="Authority Key Identifier";class Iu extends Fe{constructor(...e){if(j.isBufferSource(e[0])){super(e[0]);const t=P.parse(this.value,Vi);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Vi({cA:e[0],pathLenConstraint:e[1]});super(_c,e[2],P.serialize(t)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}}Iu.NAME="Basic Constraints";var Eu;(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"})(Eu||(Eu={}));class Nu extends Fe{constructor(...e){if(j.isBufferSource(e[0])){super(e[0]);const t=P.parse(this.value,Di);this.usages=t.map(i=>i)}else{const t=new Di(e[0]);super($c,e[1],P.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Bt.toString(t)).join(", "),e}}Nu.NAME="Extended Key Usages";var sa;(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"})(sa||(sa={}));class aa extends Fe{constructor(...e){if(j.isBufferSource(e[0])){super(e[0]);const t=P.parse(this.value,Uo);this.usages=t.toNumber()}else{const t=new Uo(e[0]);super(Lc,e[1],P.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=P.parse(this.value,Uo);return e[""]=t.toJSON().join(", "),e}}aa.NAME="Key Usages";class Mn extends Fe{static async create(e,t=!1,i=Ne.get()){const s=await(await st.create(e,i)).getKeyIdentifier(i);return new Mn(H.ToHex(s),t)}constructor(...e){if(j.isBufferSource(e[0])){super(e[0]);const t=P.parse(this.value,kt);this.keyId=H.ToHex(t)}else{const t=typeof e[0]=="string"?H.FromHex(e[0]):e[0],i=new kt(t);super(Gc,e[1],P.serialize(i)),this.keyId=H.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=P.parse(this.value,kt);return e[""]=t,e}}Mn.NAME="Subject Key Identifier";class ca extends Fe{constructor(...e){j.isBufferSource(e[0])?super(e[0]):super(Kc,e[1],new ti(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=P.parse(e.extnValue,Ko);this.names=new ti(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}ca.NAME="Subject Alternative Name";class qe{static register(e,t){this.items.set(e,t)}static create(e){const t=new Fe(e),i=this.items.get(t.type);return i?new i(e):t}}qe.items=new Map;class Ou extends Fe{constructor(...e){var t;if(j.isBufferSource(e[0])){super(e[0]);const i=P.parse(this.value,Pi);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new Pi(i.map(c=>new ji({policyIdentifier:c})));super(Pc,n,P.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new ne("",{},Bt.toString(t))),e}}Ou.NAME="Certificate Policies",qe.register(Pc,Ou);class Tu extends Fe{constructor(...e){var t;if(j.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(c=>new nr({distributionPoint:new Ut({fullName:[new J({uniformResourceIdentifier:c})]})})),s=new or(n);super(_o,e[1],P.serialize(s))}else{const i=new or(e[0]);super(_o,e[1],P.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=P.parse(e.extnValue,or);this.distributionPoints=t}toTextObject(){const e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(t=>{var i;const n={};return t.distributionPoint&&(n[""]=(i=t.distributionPoint.fullName)===null||i===void 0?void 0:i.map(s=>new Ot(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}Tu.NAME="CRL Distribution Points";class Vu extends Fe{constructor(...e){var t,i,n,s;if(j.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof ir){const c=new ir(e[0]);super(ko,e[1],P.serialize(c))}else{const c=e[0],u=new ir;Un(u,c,Nc,"ocsp"),Un(u,c,Oc,"caIssuers"),Un(u,c,Tc,"timeStamping"),Un(u,c,Vc,"caRepository"),super(ko,e[1],P.serialize(u))}(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.parse(e.extnValue,ir).forEach(i=>{switch(i.accessMethod){case Nc:this.ocsp.push(new Ot(i.accessLocation));break;case Oc:this.caIssuers.push(new Ot(i.accessLocation));break;case Tc:this.timeStamping.push(new Ot(i.accessLocation));break;case Vc:this.caRepository.push(new Ot(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&$n(e,"OCSP",this.ocsp),this.caIssuers.length&&$n(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&$n(e,"Time Stamping",this.timeStamping),this.caRepository.length&&$n(e,"CA Repository",this.caRepository),e}}Vu.NAME="Authority Info Access";function $n(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new ne("");t.forEach((n,s)=>{const c=n.toTextObject(),u=`${c[ne.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(c)}),r[e]=i}}function Un(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(c=>{typeof c=="string"&&(c=new Ot("url",c)),r.push(new _r({accessMethod:t,accessLocation:P.parse(c.rawData,J)}))})}class xr extends It{constructor(...e){let t;if(j.isBufferSource(e[0]))t=j.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>j.toArrayBuffer(s)):[];t=P.serialize(new ht({type:i,values:n}))}super(t,ht)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new ne("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[ne.NAME]===xr.NAME&&(e[ne.NAME]=Bt.toString(this.type)),e}}xr.NAME="Attribute";class _u extends xr{constructor(...e){var t;if(j.isBufferSource(e[0]))super(e[0]);else{const i=new jn({printableString:e[0]});super(Nl,[P.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=P.parse(this.values[0],jn);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[ne.VALUE]=this.password,e}}_u.NAME="Challenge Password";class la extends xr{constructor(...e){var t;if(j.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new Lt;for(const s of i)n.push(P.parse(s.rawData,Je));super(qs,[P.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=P.parse(this.values[0],Lt);this.items=t.map(i=>qe.create(P.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[ne.NAME]]=i;return e}}la.NAME="Extensions";class Ln{static register(e,t){this.items.set(e,t)}static create(e){const t=new xr(e),i=this.items.get(t.type);return i?new i(e):t}}Ln.items=new Map;const Hn="crypto.signatureFormatter";class $d{toAsnSignature(e,t){return j.toArrayBuffer(t)}toWebSignature(e,t){return j.toArrayBuffer(t)}}var Fn;let ua=Fn=class{static createPssParams(e,t){const i=Fn.getHashAlgorithm(e);return i?new Gt({hashAlgorithm:i,maskGenAlgorithm:new D({algorithm:bn,parameters:P.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=Ee.resolve(Sr);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 D({algorithm:dn,parameters:null});case"sha-256":return new D({algorithm:Bs,parameters:null});case"sha-384":return new D({algorithm:pn,parameters:null});case"sha-512":return new D({algorithm:hn,parameters:null})}}else return new D({algorithm:Kt,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");const t=Fn.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new D({algorithm:Jr,parameters:P.serialize(t)})}else return new D({algorithm:Jr,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Kt:return{name:"RSASSA-PKCS1-v1_5"};case dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Bs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case pn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case hn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case Jr:if(e.parameters){const t=P.parse(e.parameters,Gt);return{name:"RSA-PSS",hash:Ee.resolve(Sr).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};ua=Fn=a([In()],ua),Ee.registerSingleton(Xr,ua);let fa=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new D({algorithm:yn});case"sha-256":return new D({algorithm:gn});case"sha-384":return new D({algorithm:mn});case"sha-512":return new D({algorithm:vn})}return null}toWebAlgorithm(e){switch(e.algorithm){case yn:return{name:"SHA-1"};case gn:return{name:"SHA-256"};case mn:return{name:"SHA-384"};case vn:return{name:"SHA-512"}}return null}};fa=a([In()],fa),Ee.registerSingleton(Xr,fa);class Ke{addPadding(e,t){const i=j.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}removePadding(e,t=!1){let i=j.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(t&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){const i=e.namedCurve,n=Ke.namedCurveSize.get(i)||Ke.defaultNamedCurveSize,s=new fn,c=j.toUint8Array(t);return s.r=this.removePadding(c.slice(0,n),!0),s.s=this.removePadding(c.slice(n,n+n),!0),P.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=P.parse(t,fn),n=e.namedCurve,s=Ke.namedCurveSize.get(n)||Ke.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return Qu(c,u)}return null}}Ke.namedCurveSize=new Map,Ke.defaultNamedCurveSize=32;const da="1.3.101.110",ju="1.3.101.111",pa="1.3.101.112",Pu="1.3.101.113";let ha=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=pa;break;case"x25519":t=da;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=pa;break;case"ed448":t=Pu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=da;break;case"x448":t=ju;break}}return t?new D({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case pa:return{name:"Ed25519"};case Pu:return{name:"EdDSA",namedCurve:"Ed448"};case da:return{name:"X25519"};case ju:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};ha=a([In()],ha),Ee.registerSingleton(Xr,ha);class Ud extends vt{constructor(e){vt.isAsnEncoded(e)?super(e,Qr):super(e),this.tag=Me.CertificateRequestTag}onInit(e){this.tbs=P.serialize(e.certificationRequestInfo),this.publicKey=new st(e.certificationRequestInfo.subjectPKInfo);const t=Ee.resolve(Sr);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>Ln.create(P.serialize(n)));const i=this.getAttribute(qs);this.extensions=[],i instanceof la&&(this.extensions=i.items),this.subjectName=new Nt(e.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(e){for(const 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(const 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=Ne.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=Ee.resolveAll(Hn).reverse();let s=null;for(const u of n)if(s=u.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(){const e=this.toTextObjectEmpty(),t=P.parse(this.rawData,Qr),i=t.certificationRequestInfo,n=new ne("",{Version:`${sr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ne("");for(const c of this.attributes){const u=c.toTextObject();s[u[ne.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new ne("",{Algorithm:Jt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}Ud.NAME="PKCS#10 Certificate Request";class Ru extends vt{constructor(e){vt.isAsnEncoded(e)?super(e,ar):super(e),this.tag=Me.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=P.serialize(t),this.serialNumber=H.ToHex(t.serialNumber),this.subjectName=new Nt(t.subject),this.subject=new Nt(t.subject).toString(),this.issuerName=new Nt(t.issuer),this.issuer=this.issuerName.toString();const i=Ee.resolve(Sr);this.signatureAlgorithm=i.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const n=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;const s=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(c=>qe.create(P.serialize(c)))),this.publicKey=new st(t.subjectPublicKeyInfo)}getExtension(e){for(const 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=Ne.get()){let i,n;const 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 st)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(j.isBufferSource(s)){const p=new st(s);i={...p.algorithm,...this.signatureAlgorithm},n=await p.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const c=Ee.resolveAll(Hn).reverse();let u=null;for(const p of c)if(u=p.toWebSignature(i,this.signature),u)break;if(!u)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const f=await t.subtle.verify(this.signatureAlgorithm,n,u,this.tbs);if(e.signatureOnly)return f;{const v=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<v&&v<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=Ne.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Ne.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=P.parse(this.rawData,ar),i=t.tbsCertificate,n=new ne("",{Version:`${sr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Jt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ne("",{"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){const s=new ne("");for(const c of this.extensions){const u=c.toTextObject();s[u[ne.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new ne("",{Algorithm:Jt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}Ru.NAME="Certificate";var Du;(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"})(Du||(Du={})),qe.register(_c,Iu),qe.register($c,Nu),qe.register(Lc,aa),qe.register(Gc,Mn),qe.register(xo,ni),qe.register(Kc,ca),qe.register(_o,Tu),qe.register(ko,Vu),Ln.register(Nl,_u),Ln.register(qs,la),Ee.registerSingleton(Hn,$d),Ee.registerSingleton(Hn,Ke),Ke.namedCurveSize.set("P-256",32),Ke.namedCurveSize.set("K-256",32),Ke.namedCurveSize.set("P-384",48),Ke.namedCurveSize.set("P-521",66);function Mu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new Ru(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof ca){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,p)=>{const v=p.type,y=f[v]??[];return{...f,[v]:[...y,p.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof aa){const s=Object.values(sa),c=Array(s.length/2).fill(null).reduce((u,f,p)=>{const v=s[s.length/2+p];if(n.usages&v){const y=s[p];u.push(y)}return u},[]);i.keyUsage=c}return i}}}function Ld(){const r=Mu(),e=o.ref({}),t=n=>{if(!(n.id in e.value))try{e.value[n.id]=r.parseMetaCertificateData(n.cert)}catch{e.value[n.id]=void 0}return e.value[n.id]};return{certificateDataCache:e,getCertificateData:n=>{const s=t(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Hd={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Fd(){const r=va.createI18n("en-us",Hd);return{i18n:r,i18nT:va.i18nTComponent(r)}}const Ze={useCertificate:Ld,useI18n:Fd,useX509:Mu},qn="/v2/control-planes/{controlPlaneId}/core-entities",Kn="/{workspace}",oi={list:{konnect:`${qn}/certificates`,kongManager:`${Kn}/certificates`},form:{konnect:{create:`${qn}/certificates`,edit:`${qn}/certificates/{id}`,validate:`${qn}/v1/schemas/json/certificate/validate`},kongManager:{create:`${Kn}/certificates`,edit:`${Kn}/certificates/{id}`,validate:`${Kn}/schemas/certificates/validate`}}},qd={class:"kong-ui-entities-certificates-list"},Kd={key:0},zd={key:1},Gd={key:0},Wd={key:1},Jd={key:0},Yd={key:1},Zd={key:1},Qd=o.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var O;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=Ze.useI18n(),u=ci.useRouter(),{axiosInstance:f}=T.useAxios((O=i.config)==null?void 0:O.axiosRequestConfig),p=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),y={subject:{label:n("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:n("certificates.list.table_headers.expiry")},san:{label:n("certificates.list.table_headers.san")},cert:{label:n("certificates.list.table_headers.cert")},tags:{label:n("certificates.list.table_headers.tags"),sortable:!0}},K=o.computed(()=>{var Z,z;let L=`${i.config.apiBaseUrl}${oi.list[i.config.app]}`;return i.config.app==="konnect"?L=L.replace(/{controlPlaneId}/gi,((Z=i.config)==null?void 0:Z.controlPlaneId)||""):i.config.app==="kongManager"&&(L=L.replace(/\/{workspace}/gi,(z=i.config)!=null&&z.workspace?`/${i.config.workspace}`:"")),L}),E=o.ref(""),d=o.computed(()=>{const L=i.config.app==="konnect"||i.config.isExactMatch;return L?{isExactMatch:L,placeholder:n("certificates.search.placeholder")}:{isExactMatch:L,schema:i.config.filterSchema}}),{fetcher:g,fetcherState:A,fetcherCacheKey:w}=T.useFetcher({...i.config,cacheIdentifier:i.cacheIdentifier},K.value),N=()=>{E.value=""},k=()=>{w.value++},B=o.ref(null),Y=(L,Z)=>{const z=L.id;if(!Z(z)){t("copy:error",{entity:L,field:"id",message:n("certificates.errors.copy")});return}t("copy:success",{entity:L,field:"id",message:n("certificates.copy.success",{val:z})})},se=(L,Z)=>{const z=JSON.stringify(L);if(!Z(z)){t("copy:error",{entity:L,message:n("certificates.errors.copy")});return}t("copy:success",{entity:L,message:n("certificates.copy.success_brief")})},$=async L=>{var z;await((z=i.canRetrieve)==null?void 0:z.call(i,L))&&u.push(i.config.getViewRoute(L.id))},C=L=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(L)}),V=L=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(L)}),de=L=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(L)}},ie=o.ref(void 0),xe=o.ref(!1),ae=o.ref(!1),pe=o.ref(""),at=T.useDeleteUrlBuilder(i.config,K.value),{certificateDataCache:ee,getCertificateData:bt}=Ze.useCertificate(),Cr=L=>{ie.value=L,xe.value=!0},Br=()=>{xe.value=!1},Tt=async()=>{var L,Z,z;if((L=ie.value)!=null&&L.id){ae.value=!0;try{await f.delete(at(ie.value.id)),ae.value=!1,xe.value=!1,w.value++,t("delete:success",ie.value)}catch($e){pe.value=((z=(Z=$e.response)==null?void 0:Z.data)==null?void 0:z.message)||$e.message||n("certificates.errors.delete"),t("error",$e)}finally{ae.value=!1}}};o.watch(A,L=>{var Z,z,$e;if(L.status===T.FetcherStatus.Error){B.value={title:n("certificates.errors.general")},($e=(z=(Z=L.error)==null?void 0:Z.response)==null?void 0:z.data)!=null&&$e.message&&(B.value.message=L.error.response.data.message),t("error",L.error);return}ee.value={},B.value=null});const wt=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(wt.value.title=n("certificates.list.empty_state.title"),wt.value.ctaText=n("certificates.actions.create"))}),(L,Z)=>{const z=o.resolveComponent("KButton"),$e=o.resolveComponent("KCopy"),Q=o.resolveComponent("KDropdownItem"),Ce=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",qd,[o.createVNode(o.unref(T.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":p.value,"empty-state-options":wt.value,"enable-entity-actions":"","error-message":B.value,fetcher:o.unref(g),"fetcher-cache-key":o.unref(w),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:E.value,"table-headers":o.unref(y),onClearSearchInput:N,"onClick:row":Z[1]||(Z[1]=W=>$(W)),onSort:k},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(T.EntityFilter),{modelValue:E.value,"onUpdate:modelValue":Z[0]||(Z[0]=W=>E.value=W),config:d.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.createVNode(z,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(li.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:o.withCtx(({row:W})=>{var ue;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Kd,o.toDisplayString((ue=W==null?void 0:W.metadata)!=null&&ue.subject?W.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",zd,o.toDisplayString(o.unref(bt)(W).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:W})=>{var ue;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Gd,o.toDisplayString((ue=W==null?void 0:W.metadata)!=null&&ue.expiry?o.unref(s)(W.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Wd,o.toDisplayString(o.unref(bt)(W).schemaExpiry?o.unref(s)(o.unref(bt)(W).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:W})=>{var ue;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Jd,o.toDisplayString((ue=W==null?void 0:W.metadata)!=null&&ue.dns_names?`dns=${W.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",Yd,o.toDisplayString(o.unref(bt)(W).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:W})=>[W!=null&&W.cert?(o.openBlock(),o.createBlock($e,{key:0,"data-testid":"copy-certificate-cert",text:W.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Zd,"-"))]),tags:o.withCtx(({row:W})=>[o.createVNode(o.unref(T.TableTags),{tags:W==null?void 0:W.tags},null,8,["tags"])]),actions:o.withCtx(({row:W})=>[o.createVNode(Ce,null,{default:o.withCtx(({copyToClipboard:ue})=>[o.createVNode(Q,{"data-testid":"action-entity-copy-id",onClick:Wn=>Y(W,ue)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Ce,null,{default:o.withCtx(({copyToClipboard:ue})=>[o.createVNode(Q,{"data-testid":"action-entity-copy-json",onClick:Wn=>se(W,ue)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(W)},{default:o.withCtx(()=>[o.createVNode(Q,{"data-testid":"action-entity-view","has-divider":"",item:C(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canEdit(W)},{default:o.withCtx(()=>[o.createVNode(Q,{"data-testid":"action-entity-edit",item:V(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(T.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(Q,{"data-testid":"action-entity-add-sni",item:de(W.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canDelete(W)},{default:o.withCtx(()=>[o.createVNode(Q,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ue=>Cr(W)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),o.createVNode(o.unref(T.EntityDeleteModal),{"action-pending":ae.value,"entity-type":o.unref(T.EntityTypes).Certificate,error:pe.value,title:o.unref(n)("certificates.delete.title"),visible:xe.value,onCancel:Br,onProceed:Tt},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Yt=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},Xd=Yt(Qd,[["__scopeId","data-v-f673d337"]]),ep="#d60027",tp={class:"sni-field-container"},rp={key:1,class:"sni-field-controls-container"},ip={key:0},np=Yt(o.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{i18nT:n,i18n:{t:s}}=Ze.useI18n(),c=o.ref([]);return o.watch(t.modelValue,u=>{c.value=[...u]},{immediate:!0,deep:!0}),o.watch(c,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const p=o.resolveComponent("KLabel"),v=o.resolveComponent("KInput"),y=o.resolveComponent("KButton"),K=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",tp,[o.createVNode(p,{info:o.unref(s)("certificates.form.fields.snis.tooltip")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,(E,d)=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"sni-field-input"},[!r.isEditing||c.value[d]?(o.openBlock(),o.createBlock(v,{key:0,modelValue:c.value[d],"onUpdate:modelValue":g=>c.value[d]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${d+1}`,disabled:r.isEditing,placeholder:o.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):o.createCommentVNode("",!0),r.isEditing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",rp,[o.createVNode(y,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>u.$emit("remove",d)},{default:o.withCtx(()=>[o.createVNode(o.unref(li.TrashIcon),{color:o.unref(ep)},null,8,["color"])]),_:2},1032,["onClick"]),o.createVNode(y,{appearance:"tertiary","data-testid":"add-sni",disabled:d!==c.value.length-1,icon:"",onClick:f[0]||(f[0]=g=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(li.AddIcon))]),_:2},1032,["disabled"])]))]))),128)),c.value.length===0?(o.openBlock(),o.createElementBlock("div",ip,[o.createVNode(y,{onClick:f[1]||(f[1]=E=>u.$emit("add"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):o.createCommentVNode("",!0),r.isEditing?(o.openBlock(),o.createBlock(o.unref(n),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:o.withCtx(()=>[o.createVNode(K,{to:r.sniListRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):o.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),op={class:"kong-ui-entities-certificates-form"},sp=Yt(o.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading"],setup(r,{emit:e}){var se;const t=e,i=r,n=ci.useRouter(),{i18nT:s,i18n:{t:c}}=Ze.useI18n(),{getMessageFromError:u}=T.useErrors(),{axiosInstance:f}=T.useAxios((se=i.config)==null?void 0:se.axiosRequestConfig),p=o.computed(()=>oi.form[i.config.app].edit),v=o.computed(()=>i.certificateId?T.EntityBaseFormType.Edit:T.EntityBaseFormType.Create),y=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),K=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),E=o.computed(()=>(v.value===T.EntityBaseFormType.Create||JSON.stringify(y.fields)!==JSON.stringify(K))&&!!y.fields.cert&&!!y.fields.key),d=$=>{var C,V;y.fields.cert=($==null?void 0:$.cert)||"",y.fields.key=($==null?void 0:$.key)||"",y.fields.certAlt=($==null?void 0:$.cert_alt)||"",y.fields.keyAlt=($==null?void 0:$.key_alt)||"",y.fields.snis=(C=$==null?void 0:$.snis)!=null&&C.length?$.snis:[""],y.fields.tags=((V=$==null?void 0:$.tags)==null?void 0:V.join(", "))||"",Object.assign(K,y.fields)},g=()=>{n.push(i.config.cancelRoute)},A=()=>{y.fields.snis.push("")},w=$=>{y.fields.snis.splice($,1)},N=o.computed(()=>{var C,V;let $=`${i.config.apiBaseUrl}${oi.form[i.config.app].validate}`;return i.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(V=i.config)!=null&&V.workspace?`/${i.config.workspace}`:"")),$=$.replace(/{id}/gi,i.certificateId),$}),k=o.computed(()=>{var C,V;let $=`${i.config.apiBaseUrl}${oi.form[i.config.app][v.value]}`;return i.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(V=i.config)!=null&&V.workspace?`/${i.config.workspace}`:"")),$=$.replace(/{id}/gi,i.certificateId),$}),B=o.computed(()=>{var $,C;return{cert:y.fields.cert,key:y.fields.key,cert_alt:y.fields.certAlt||null,key_alt:y.fields.keyAlt||null,...i.showSnisField?{snis:y.fields.snis.filter(Boolean)}:{},tags:(C=($=y.fields.tags.split(","))==null?void 0:$.map(V=>String(V||"").trim()))==null?void 0:C.filter(V=>V!=="")}}),Y=async()=>{var $,C,V,de,ie,xe,ae,pe,at;try{y.isReadonly=!0;let ee;await f.post(N.value,B.value),v.value==="create"?ee=await f.post(k.value,B.value):v.value==="edit"&&(ee=(($=i.config)==null?void 0:$.app)==="konnect"?await f.put(k.value,B.value):await f.patch(k.value,B.value)),y.fields.cert=((C=ee==null?void 0:ee.data)==null?void 0:C.cert)||"",y.fields.key=((V=ee==null?void 0:ee.data)==null?void 0:V.key)||"",y.fields.certAlt=((de=ee==null?void 0:ee.data)==null?void 0:de.cert_alt)||"",y.fields.keyAlt=((ie=ee==null?void 0:ee.data)==null?void 0:ie.key_alt)||"",y.fields.snis=(ae=(xe=ee==null?void 0:ee.data)==null?void 0:xe.snis)!=null&&ae.length?ee.data.snis:[""],y.fields.tags=((at=(pe=ee==null?void 0:ee.data)==null?void 0:pe.tags)==null?void 0:at.join(", "))||"",Object.assign(K,y.fields),t("update",ee==null?void 0:ee.data)}catch(ee){y.errorMessage=u(ee),t("error",ee)}finally{y.isReadonly=!1}};return($,C)=>{const V=o.resolveComponent("KTextArea"),de=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",op,[o.createVNode(o.unref(T.EntityBaseForm),{"can-submit":E.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(T.SupportedEntityType).Certificate,"error-message":y.errorMessage,"fetch-url":p.value,"form-fields":B.value,"is-readonly":y.isReadonly,onCancel:g,"onFetch:error":C[7]||(C[7]=ie=>$.$emit("error",ie)),"onFetch:success":d,onLoading:C[8]||(C[8]=ie=>$.$emit("loading",ie)),onSubmit:Y},{default:o.withCtx(()=>[o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(c)("certificates.form.sections.ssl.description"),title:o.unref(c)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(V,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=ie=>y.fields.cert=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(c)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(V,{modelValue:y.fields.key,"onUpdate:modelValue":C[1]||(C[1]=ie=>y.fields.key=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(c)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(V,{modelValue:y.fields.certAlt,"onUpdate:modelValue":C[2]||(C[2]=ie=>y.fields.certAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(c)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(V,{modelValue:y.fields.keyAlt,"onUpdate:modelValue":C[3]||(C[3]=ie=>y.fields.keyAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(c)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(np,{key:0,modelValue:y.fields.snis,"onUpdate:modelValue":C[4]||(C[4]=ie=>y.fields.snis=ie),"is-editing":v.value===o.unref(T.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:A,onRemove:C[5]||(C[5]=ie=>w(ie))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(c)("certificates.form.sections.general.description"),title:o.unref(c)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(de,{modelValue:y.fields.tags,"onUpdate:modelValue":C[6]||(C[6]=ie=>y.fields.tags=ie),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(c)("certificates.form.fields.tags.help"),label:o.unref(c)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(c)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(c)("certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-fc596de1"]]),zn="/v2/control-planes/{controlPlaneId}/core-entities",Gn="/{workspace}",si={list:{konnect:`${zn}/ca_certificates`,kongManager:`${Gn}/ca_certificates`},form:{konnect:{create:`${zn}/ca_certificates`,edit:`${zn}/ca_certificates/{id}`,validate:`${zn}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${Gn}/ca_certificates`,edit:`${Gn}/ca_certificates/{id}`,validate:`${Gn}/schemas/ca_certificates/validate`}}},ap={class:"kong-ui-ca-certificate-entity-config-card"},cp={key:0},lp=Yt(o.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=["dns_names","san_names","subject"],i=e,n=r,{i18n:{t:s,formatUnixTimeStamp:c}}=Ze.useI18n(),{convertKeyToTitle:u}=T.useStringHelpers(),{getPropValue:f}=T.useHelpers(),{getCertificateData:p}=Ze.useCertificate(),v=o.computed(()=>si.form[n.config.app].edit),y=o.ref(),K=o.computed(()=>{if(y.value)return p(y.value)}),E=o.computed(()=>{var k;return((k=K.value)==null?void 0:k.schemaIssuer)||""}),d=o.computed(()=>{var k,B;return(k=K.value)!=null&&k.schemaExpiry?c((B=K.value)==null?void 0:B.schemaExpiry):""}),g=o.computed(()=>{var k;return((k=K.value)==null?void 0:k.schemaKeyUsages)||[]}),A=(k,B)=>{const Y=f("rowValue",B);if(k==="expiry")return d.value;if(k==="key_usages")return g.value;if(Y)return Y[k]},w=k=>{y.value=k,i("fetch:success",k)},N=o.ref({id:{},updated_at:{},created_at:{},cert:{section:T.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:T.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:T.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:T.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:T.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(k,B)=>{const Y=o.resolveComponent("KCodeBlock"),se=o.resolveComponent("KLabel"),$=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",ap,[o.createVNode(o.unref(T.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":N.value,"entity-type":o.unref(T.SupportedEntityType).CaCertificate,"fetch-url":v.value,"hide-title":r.hideTitle,"onFetch:error":B[0]||(B[0]=C=>k.$emit("fetch:error",C)),"onFetch:success":w,onLoading:B[1]||(B[1]=C=>k.$emit("loading",C))},{cert:o.withCtx(C=>[o.unref(f)("rowValue",C)?(o.openBlock(),o.createBlock(Y,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",C),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(se,{class:"metadata-label"},{default:o.withCtx(()=>B[2]||(B[2]=[o.createTextVNode(" Metadata ")])),_:1})]),metadata:o.withCtx(C=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",C)).filter(V=>!t.includes(V)),V=>(o.openBlock(),o.createBlock(o.unref(T.ConfigCardItem),{key:V,"data-testid":`ca-cert-metadata-${V}`,item:{key:V,label:o.unref(u)(V),value:A(V,C),type:V==="key_usages"?o.unref(T.ConfigurationSchemaType).BadgeTag:o.unref(T.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(E.value||"–"),1)]),key_usages:o.withCtx(()=>[g.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",cp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,(C,V)=>(o.openBlock(),o.createBlock($,{key:`key_usages-badge-tag-${V}`,class:"config-badge","data-testid":`key_usages-badge-tag-${V}`,tooltip:C,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-1d42f61b"]]),up={class:"kong-ui-entities-ca-certificates-list"},fp={key:0},dp={key:1},pp={key:0},hp={key:1},yp=Yt(o.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var wt;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=Ze.useI18n(),u=ci.useRouter(),{axiosInstance:f}=T.useAxios((wt=i.config)==null?void 0:wt.axiosRequestConfig),p=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),y={issuer:{label:n("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},K=o.computed(()=>{var L,Z;let O=`${i.config.apiBaseUrl}${si.list[i.config.app]}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((L=i.config)==null?void 0:L.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(Z=i.config)!=null&&Z.workspace?`/${i.config.workspace}`:"")),O}),E=o.ref(""),d=o.computed(()=>{const O=i.config.app==="konnect"||i.config.isExactMatch;return O?{isExactMatch:O,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:O,schema:i.config.filterSchema}}),{fetcher:g,fetcherState:A,fetcherCacheKey:w}=T.useFetcher({...i.config,cacheIdentifier:i.cacheIdentifier},K.value),N=()=>{E.value=""},k=()=>{w.value++},B=o.ref(null),Y=(O,L)=>{const Z=O.id;if(!L(Z)){t("copy:error",{entity:O,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:O,field:"id",message:n("ca-certificates.copy.success",{val:Z})})},se=(O,L)=>{const Z=JSON.stringify(O);if(!L(Z)){t("copy:error",{entity:O,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:O,message:n("ca-certificates.copy.success_brief")})},$=async O=>{var Z;await((Z=i.canRetrieve)==null?void 0:Z.call(i,O))&&u.push(i.config.getViewRoute(O.id))},C=O=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(O)}),V=O=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(O)}),de=o.ref(void 0),ie=o.ref(!1),xe=o.ref(!1),ae=o.ref(""),pe=T.useDeleteUrlBuilder(i.config,K.value),{certificateDataCache:at,getCertificateData:ee}=Ze.useCertificate(),bt=O=>{de.value=O,ie.value=!0},Cr=()=>{ie.value=!1},Br=async()=>{var O,L,Z;if((O=de.value)!=null&&O.id){xe.value=!0;try{await f.delete(pe(de.value.id)),xe.value=!1,ie.value=!1,w.value++,t("delete:success",de.value)}catch(z){ae.value=((Z=(L=z.response)==null?void 0:L.data)==null?void 0:Z.message)||z.message||n("ca-certificates.errors.delete"),t("error",z)}finally{xe.value=!1}}};o.watch(A,O=>{var L,Z,z;if(O.status===T.FetcherStatus.Error){B.value={title:n("ca-certificates.errors.general")},(z=(Z=(L=O.error)==null?void 0:L.response)==null?void 0:Z.data)!=null&&z.message&&(B.value.message=O.error.response.data.message),t("error",O.error);return}at.value={},B.value=null});const Tt=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("ca-certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(Tt.value.title=n("ca-certificates.list.empty_state.title"),Tt.value.ctaText=n("ca-certificates.actions.create"))}),(O,L)=>{const Z=o.resolveComponent("KButton"),z=o.resolveComponent("KDropdownItem"),$e=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",up,[o.createVNode(o.unref(T.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":p.value,"empty-state-options":Tt.value,"enable-entity-actions":"","error-message":B.value,fetcher:o.unref(g),"fetcher-cache-key":o.unref(w),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:E.value,"table-headers":o.unref(y),onClearSearchInput:N,"onClick:row":L[1]||(L[1]=Q=>$(Q)),onSort:k},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(T.EntityFilter),{modelValue:E.value,"onUpdate:modelValue":L[0]||(L[0]=Q=>E.value=Q),config:d.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.createVNode(Z,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(li.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:o.withCtx(({row:Q})=>{var Ce;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",fp,o.toDisplayString((Ce=Q==null?void 0:Q.metadata)!=null&&Ce.issuer?Q.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",dp,o.toDisplayString(o.unref(ee)(Q).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:Q})=>{var Ce;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",pp,o.toDisplayString((Ce=Q==null?void 0:Q.metadata)!=null&&Ce.expiry?o.unref(s)(Q.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",hp,o.toDisplayString(o.unref(ee)(Q).schemaExpiry?o.unref(s)(o.unref(ee)(Q).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:Q})=>[o.createVNode(o.unref(T.TableTags),{tags:Q==null?void 0:Q.tags},null,8,["tags"])]),actions:o.withCtx(({row:Q})=>[o.createVNode($e,null,{default:o.withCtx(({copyToClipboard:Ce})=>[o.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:W=>Y(Q,Ce)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode($e,null,{default:o.withCtx(({copyToClipboard:Ce})=>[o.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:W=>se(Q,Ce)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(Q)},{default:o.withCtx(()=>[o.createVNode(z,{"data-testid":"action-entity-view","has-divider":"",item:C(Q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canEdit(Q)},{default:o.withCtx(()=>[o.createVNode(z,{"data-testid":"action-entity-edit",item:V(Q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canDelete(Q)},{default:o.withCtx(()=>[o.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>bt(Q)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),o.createVNode(o.unref(T.EntityDeleteModal),{"action-pending":xe.value,"entity-type":o.unref(T.EntityTypes).CACertificate,error:ae.value,title:o.unref(n)("ca-certificates.delete.title"),visible:ie.value,onCancel:Cr,onProceed:Br},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-56123516"]]),gp={class:"kong-ui-entities-ca-certificates-form"},mp=Yt(o.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(r,{emit:e}){var k;const t=e,i=r,n=ci.useRouter(),{i18n:{t:s}}=Ze.useI18n(),{getMessageFromError:c}=T.useErrors(),{axiosInstance:u}=T.useAxios((k=i.config)==null?void 0:k.axiosRequestConfig),f=o.computed(()=>si.form[i.config.app].edit),p=o.computed(()=>i.certificateId?T.EntityBaseFormType.Edit:T.EntityBaseFormType.Create),v=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),y=o.reactive({cert:"",certDigest:"",tags:""}),K=o.computed(()=>(p.value===T.EntityBaseFormType.Create||JSON.stringify(v.fields)!==JSON.stringify(y))&&!!v.fields.cert),E=B=>{var Y;v.fields.cert=(B==null?void 0:B.cert)||"",v.fields.certDigest=(B==null?void 0:B.cert_digest)||"",v.fields.tags=((Y=B==null?void 0:B.tags)==null?void 0:Y.join(", "))||"",Object.assign(y,v.fields)},d=()=>{n.push(i.config.cancelRoute)},g=o.computed(()=>{var Y,se;let B=`${i.config.apiBaseUrl}${si.form[i.config.app].validate}`;return i.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((Y=i.config)==null?void 0:Y.controlPlaneId)||""):i.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),B=B.replace(/{id}/gi,i.certificateId),B}),A=o.computed(()=>{var Y,se;let B=`${i.config.apiBaseUrl}${si.form[i.config.app][p.value]}`;return i.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((Y=i.config)==null?void 0:Y.controlPlaneId)||""):i.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),B=B.replace(/{id}/gi,i.certificateId),B}),w=o.computed(()=>{var B,Y;return{cert:v.fields.cert,cert_digest:v.fields.certDigest||null,tags:(Y=(B=v.fields.tags.split(","))==null?void 0:B.map(se=>String(se||"").trim()))==null?void 0:Y.filter(se=>se!=="")}}),N=async()=>{var B,Y,se,$,C;try{v.isReadonly=!0;let V;await u.post(g.value,w.value),p.value==="create"?V=await u.post(A.value,w.value):p.value==="edit"&&(V=((B=i.config)==null?void 0:B.app)==="konnect"?await u.put(A.value,w.value):await u.patch(A.value,w.value)),v.fields.cert=((Y=V==null?void 0:V.data)==null?void 0:Y.cert)||"",v.fields.certDigest=((se=V==null?void 0:V.data)==null?void 0:se.cert_digest)||"",v.fields.tags=((C=($=V==null?void 0:V.data)==null?void 0:$.tags)==null?void 0:C.join(", "))||"",Object.assign(y,v.fields),t("update",V==null?void 0:V.data)}catch(V){v.errorMessage=c(V),t("error",V)}finally{v.isReadonly=!1}};return(B,Y)=>{const se=o.resolveComponent("KTextArea"),$=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",gp,[o.createVNode(o.unref(T.EntityBaseForm),{"can-submit":K.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(T.SupportedEntityType).CaCertificate,"error-message":v.errorMessage,"fetch-url":f.value,"form-fields":w.value,"is-readonly":v.isReadonly,onCancel:d,"onFetch:error":Y[3]||(Y[3]=C=>B.$emit("error",C)),"onFetch:success":E,onLoading:Y[4]||(Y[4]=C=>B.$emit("loading",C)),onSubmit:N},{default:o.withCtx(()=>[o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.cert.description"),title:o.unref(s)("ca-certificates.form.sections.cert.title")},{default:o.withCtx(()=>[o.createVNode(se,{modelValue:v.fields.cert,"onUpdate:modelValue":Y[0]||(Y[0]=C=>v.fields.cert=C),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:o.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.cert.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:v.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode($,{modelValue:v.fields.certDigest,"onUpdate:modelValue":Y[1]||(Y[1]=C=>v.fields.certDigest=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:v.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.general.description"),title:o.unref(s)("ca-certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode($,{modelValue:v.fields.tags,"onUpdate:modelValue":Y[2]||(Y[2]=C=>v.fields.tags=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:o.unref(s)("ca-certificates.form.fields.tags.help"),label:o.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:v.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-2a3f488f"]]),vp={class:"kong-ui-certificate-entity-config-card"},bp={key:0},wp=Yt(o.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=Ze.useI18n(),{convertKeyToTitle:u}=T.useStringHelpers(),{getPropValue:f}=T.useHelpers(),{getCertificateData:p}=Ze.useCertificate(),v=o.computed(()=>oi.form[i.config.app].edit),y=o.ref(),K=o.ref({id:{},cert:{section:T.ConfigurationSchemaSection.Basic},key:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Redacted},metadata:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Json},snis:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:T.ConfigurationSchemaSection.Advanced},key_alt:{section:T.ConfigurationSchemaSection.Advanced,type:T.ConfigurationSchemaType.Redacted}}),E=C=>{y.value=C,t("fetch:success",C)},d=(C,V)=>{const de=f("rowValue",V);if(C==="expiry")return A.value;if(C==="key_usages")return B.value;if(C==="san_names")return N.value;if(de)return de[C]},g=o.computed(()=>{if(y.value)return p(y.value)}),A=o.computed(()=>{var C,V;return(C=g.value)!=null&&C.schemaExpiry?s((V=g.value)==null?void 0:V.schemaExpiry):""}),w=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaIssuer)||""}),N=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaSanNames)||""}),k=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaSubject)||""}),B=o.computed(()=>{var C;return((C=g.value)==null?void 0:C.schemaKeyUsages)||[]}),Y=o.computed(()=>{var C,V;return((V=(C=y==null?void 0:y.value)==null?void 0:C.snis)==null?void 0:V.length)>0}),se=o.computed(()=>{var C;return!!((C=y==null?void 0:y.value)!=null&&C.cert_alt)}),$=C=>{var V,de;return C==="san_names"?n("certificates.list.table_headers.san"):((de=(V=K.value)==null?void 0:V[C])==null?void 0:de.label)||u(C)};return(C,V)=>{const de=o.resolveComponent("KCodeBlock"),ie=o.resolveComponent("KLabel"),xe=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",vp,[o.createVNode(o.unref(T.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":K.value,"entity-type":o.unref(T.SupportedEntityType).Certificate,"fetch-url":v.value,"hide-title":r.hideTitle,"onFetch:error":V[0]||(V[0]=ae=>C.$emit("fetch:error",ae)),"onFetch:success":E,onLoading:V[1]||(V[1]=ae=>C.$emit("loading",ae))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:o.withCtx(ae=>[o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(de,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":o.withCtx(()=>[o.createVNode(ie,{class:"metadata-label"},{default:o.withCtx(()=>V[2]||(V[2]=[o.createTextVNode(" Metadata ")])),_:1})]),metadata:o.withCtx(ae=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",ae)),pe=>(o.openBlock(),o.createBlock(o.unref(T.ConfigCardItem),{key:pe,item:{key:pe,value:d(pe,ae),label:$(pe),type:pe==="key_usages"||pe==="snis"||pe==="dns_names"?o.unref(T.ConfigurationSchemaType).BadgeTag:o.unref(T.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(A.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(N.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:o.withCtx(()=>[B.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",bp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(B.value,(ae,pe)=>(o.openBlock(),o.createBlock(xe,{key:`key_usages-badge-tag-${pe}`,class:"config-badge","data-testid":`key_usages-badge-tag-${pe}`,tooltip:ae,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ae),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[Y.value?void 0:{name:"snis",fn:o.withCtx(()=>[V[3]||(V[3]=o.createTextVNode(" – "))]),key:"0"},se.value?{name:"cert_alt",fn:o.withCtx(ae=>[V[4]||(V[4]=o.createTextVNode(" > ")),o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(de,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-401d92d6"]]);Se.CACertificateConfigCard=lp,Se.CACertificateForm=mp,Se.CACertificateList=yp,Se.CertificateConfigCard=wp,Se.CertificateForm=sp,Se.CertificateList=Xd,Object.defineProperty(Se,Symbol.toStringTag,{value:"Module"})});
113
+ */const ii="crypto.algorithm";class Nd{getAlgorithms(){return Ie.resolveAll(ii)}toAsnAlgorithm(e){({...e});for(const t of this.getAlgorithms()){const i=t.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){const t=new R({algorithm:e.name});if("parameters"in e){const i=e;t.parameters=i.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const i of this.getAlgorithms()){const n=i.toWebAlgorithm(e);if(n)return n}return{name:e.algorithm,parameters:e.parameters}}}const xr="crypto.algorithmProvider";Ie.registerSingleton(xr,Nd);var Mn;const je="1.3.36.3.3.2.8.1.1",Gl=`${je}.1`,Wl=`${je}.2`,Jl=`${je}.3`,Yl=`${je}.4`,Zl=`${je}.5`,Ql=`${je}.6`,Xl=`${je}.7`,eu=`${je}.8`,tu=`${je}.9`,ru=`${je}.10`,iu=`${je}.11`,nu=`${je}.12`,ou=`${je}.13`,su=`${je}.14`,au="brainpoolP160r1",cu="brainpoolP160t1",lu="brainpoolP192r1",uu="brainpoolP192t1",fu="brainpoolP224r1",du="brainpoolP224t1",pu="brainpoolP256r1",hu="brainpoolP256t1",yu="brainpoolP320r1",gu="brainpoolP320t1",mu="brainpoolP384r1",bu="brainpoolP384t1",vu="brainpoolP512r1",wu="brainpoolP512t1",de="ECDSA";let ni=Mn=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case de.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Xf;case"sha-256":return ed;case"sha-384":return td;case"sha-512":return rd}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=ll;break;case"K-256":t=Mn.SECP256K1;break;case"P-384":t=ul;break;case"P-521":t=fl;break;case au:t=Gl;break;case cu:t=Wl;break;case lu:t=Jl;break;case uu:t=Yl;break;case fu:t=Zl;break;case du:t=Ql;break;case pu:t=Xl;break;case hu:t=eu;break;case yu:t=tu;break;case gu:t=ru;break;case mu:t=iu;break;case bu:t=nu;break;case vu:t=ou;break;case wu:t=su;break}if(t)return new R({algorithm:Yr,parameters:j.serialize(new Et({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case As:return{name:de,hash:{name:"SHA-1"}};case ks:return{name:de,hash:{name:"SHA-256"}};case Cs:return{name:de,hash:{name:"SHA-384"}};case xs:return{name:de,hash:{name:"SHA-512"}};case Yr:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(j.parse(e.parameters,Et).namedCurve){case ll:return{name:de,namedCurve:"P-256"};case Mn.SECP256K1:return{name:de,namedCurve:"K-256"};case ul:return{name:de,namedCurve:"P-384"};case fl:return{name:de,namedCurve:"P-521"};case Gl:return{name:de,namedCurve:au};case Wl:return{name:de,namedCurve:cu};case Jl:return{name:de,namedCurve:lu};case Yl:return{name:de,namedCurve:uu};case Zl:return{name:de,namedCurve:fu};case Ql:return{name:de,namedCurve:du};case Xl:return{name:de,namedCurve:pu};case eu:return{name:de,namedCurve:hu};case tu:return{name:de,namedCurve:yu};case ru:return{name:de,namedCurve:gu};case iu:return{name:de,namedCurve:mu};case nu:return{name:de,namedCurve:bu};case ou:return{name:de,namedCurve:vu};case su:return{name:de,namedCurve:wu}}}}return null}};ni.SECP256K1="1.3.132.0.10",ni=Mn=a([On()],ni),Ie.registerSingleton(ii,ni);const Su=Symbol("name"),Au=Symbol("value");class oe{constructor(e,t={},i=""){this[Su]=e,this[Au]=i;for(const n in t)this[n]=t[n]}}oe.NAME=Su,oe.VALUE=Au;class Od{static toTextObject(e){const t=new oe("Algorithm Identifier",{},It.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case Yr:{const i=new ni().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class It{static toString(e){const t=this.items[e];return t||e}}It.items={[bn]:"sha1",[hl]:"sha224",[vn]:"sha256",[wn]:"sha384",[Sn]:"sha512",[Wt]:"rsaEncryption",[yn]:"sha1WithRSAEncryption",[cd]:"sha224WithRSAEncryption",[Es]:"sha256WithRSAEncryption",[gn]:"sha384WithRSAEncryption",[mn]:"sha512WithRSAEncryption",[Yr]:"ecPublicKey",[As]:"ecdsaWithSHA1",[cl]:"ecdsaWithSHA224",[ks]:"ecdsaWithSHA256",[Cs]:"ecdsaWithSHA384",[xs]:"ecdsaWithSHA512",[zf]:"TLS WWW server authentication",[Gf]:"TLS WWW client authentication",[Wf]:"Code Signing",[Jf]:"E-mail Protection",[Yf]:"Time Stamping",[Zf]:"OCSP Signing",[Qf]:"Signed Data"};class Qt{static serialize(e){return this.serializeObj(e).join(`
114
+ `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const i=[];let n=this.pad(t++),s="";const c=e[oe.VALUE];c&&(s=` ${c}`),i.push(`${n}${e[oe.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],p=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${p}${f}`);else if(f instanceof Date)i.push(`${n}${p}${f.toUTCString()}`);else if(Array.isArray(f))for(const b of f)b[oe.NAME]=u,i.push(...this.serializeObj(b,t));else if(f instanceof oe)f[oe.NAME]=u,i.push(...this.serializeObj(f,t));else if(_.isBufferSource(f))u?(i.push(`${n}${p}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const b=f.toTextObject();b[oe.NAME]=u,i.push(...this.serializeObj(b,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(e,t=0){const i=this.pad(t),n=_.toUint8Array(e),s=[];for(let c=0;c<n.length;){const u=[];for(let f=0;f<16&&c<n.length;f++){f===8&&u.push("");const p=n[c++].toString(16).padStart(2,"0");u.push(p)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Qt.oidSerializer=It,Qt.algorithmSerializer=Od;class Nt{constructor(...e){if(e.length===1){const t=e[0];this.rawData=j.serialize(t),this.onInit(t)}else{const t=j.parse(e[0],e[1]);this.rawData=_.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof Nt?xa(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return j.toString(this.rawData);case"text":return Qt.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new oe(this.getTextName(),{},e)}}Nt.NAME="ASN";class Ke extends Nt{constructor(...e){let t;_.isBufferSource(e[0])?t=_.toArrayBuffer(e[0]):t=j.serialize(new Qe({extnID:e[0],critical:e[1],extnValue:new ne(_.toArrayBuffer(e[2]))})),super(t,Qe)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[oe.NAME]===Ke.NAME&&(e[oe.NAME]=It.toString(this.type)),e}}var ku;class Ot{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[ku]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(Ot.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(Ot.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,t){return this.items.forEach(e,t)}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=Ot.DEFAULT){const t=this.items.get(e.toLowerCase());if(!t)throw new Error(`Cannot get Crypto by name '${e}'`);return t}set(e,t){if(typeof e=="string"){if(!t)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),t)}else this.items.set(Ot.DEFAULT,e);return this}}ku=Symbol.toStringTag,Ot.DEFAULT="default";const Ne=new Ot,Td=/^[0-2](?:\.[1-9][0-9]*)+$/;function Vd(r){return new RegExp(Td).test(r)}class Cu{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Vd(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Pe=new Cu;Pe.register("CN","2.5.4.3"),Pe.register("L","2.5.4.7"),Pe.register("ST","2.5.4.8"),Pe.register("O","2.5.4.10"),Pe.register("OU","2.5.4.11"),Pe.register("C","2.5.4.6"),Pe.register("DC","0.9.2342.19200300.100.1.25"),Pe.register("E","1.2.840.113549.1.9.1"),Pe.register("G","2.5.4.42"),Pe.register("I","2.5.4.43"),Pe.register("SN","2.5.4.4"),Pe.register("T","2.5.4.12");function _d(r,e){return`\\${L.ToHex(L.FromUtf8String(e)).toUpperCase()}`}function jd(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,_d)}class Tt{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,t={}){this.extraNames=new Cu,this.asn=new he;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];this.extraNames.register(i,n)}typeof e=="string"?this.asn=this.fromString(e):e instanceof he?this.asn=e:_.isBufferSource(e)?this.asn=j.parse(e,he):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Pe.findId(e),i=[];for(const n of this.asn)for(const s of n)s.type===t&&i.push(s.value.toString());return i}getName(e){return this.extraNames.get(e)||Pe.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${L.ToHex(t.value.anyValue)}`:jd(t.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var e;const t=[];for(const i of this.asn){const n={};for(const s of i){const c=this.getName(s.type)||s.type;(e=n[c])!==null&&e!==void 0||(n[c]=[]),n[c].push(s.value.anyValue?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(n)}return t}fromString(e){const t=new he,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${e},`);){let[,c,u]=n;const f=u[u.length-1];(f===","||f==="+")&&(u=u.slice(0,u.length-1),n[3]=f);const p=n[3];c=this.getTypeOid(c);const b=this.createAttribute(c,u);s==="+"?t[t.length-1].push(b):t.push(new nr([b])),s=p}return t}fromJSON(e){const t=new he;for(const i of e){const n=new nr;for(const s in i){const c=this.getTypeOid(s),u=i[s];for(const f of u){const p=this.createAttribute(c,f);n.push(p)}}t.push(n)}return t}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,t){const i=new _i({type:e});if(typeof t=="object")for(const n in t)switch(n){case"ia5String":i.value.ia5String=t[n];break;case"utf8String":i.value.utf8String=t[n];break;case"universalString":i.value.universalString=t[n];break;case"bmpString":i.value.bmpString=t[n];break;case"printableString":i.value.printableString=t[n];break}else if(t[0]==="#")i.value.anyValue=L.FromHex(t.slice(1));else{const n=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:Tt.isPrintableString(n)?i.value.printableString=n:i.value.utf8String=n}return i}processStringValue(e){const t=/"(.*?[^\\])?"/.exec(e);return t&&(e=t[1]),e.replace(/\\0a/ig,`
115
+ `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return j.serialize(this.asn)}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]||Ne.get()):i=e[0]||Ne.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const xu="Cannot initialize GeneralName from ASN.1 data.",Bu=`${xu} Unsupported string format in use.`,Pd=`${xu} Value doesn't match to GUID regular expression.`,Eu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Iu="1.3.6.1.4.1.311.25.1",Nu="1.3.6.1.4.1.311.20.2.3",ea="dns",ta="dn",ra="email",ia="ip",na="url",oa="guid",sa="upn",Un="id";class Vt extends Nt{constructor(...e){let t;if(e.length===2)switch(e[0]){case ta:{const i=new Tt(e[1]).toArrayBuffer(),n=j.parse(i,he);t=new Z({directoryName:n});break}case ea:t=new Z({dNSName:e[1]});break;case ra:t=new Z({rfc822Name:e[1]});break;case oa:{const i=new RegExp(Eu,"i").exec(e[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,c)=>c<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");t=new Z({otherName:new Rr({typeId:Iu,value:j.serialize(new ne(L.FromHex(n)))})});break}case ia:t=new Z({iPAddress:e[1]});break;case Un:t=new Z({registeredID:e[1]});break;case sa:{t=new Z({otherName:new Rr({typeId:Nu,value:j.serialize(Ec.toASN(e[1]))})});break}case na:t=new Z({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else _.isBufferSource(e[0])?t=j.parse(e[0],Z):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=ea,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=ra,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=ia,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=na,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Un,this.value=e.registeredID;else if(e.directoryName!=null)this.type=ta,this.value=new Tt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===Iu){this.type=oa;const t=j.parse(e.otherName.value,ne),i=new RegExp(Eu,"i").exec(L.ToHex(t));if(!i)throw new Error(Pd);this.value=i.slice(1).map((n,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===Nu)this.type=sa,this.value=j.parse(e.otherName.value,we).toString();else throw new Error(Bu);else throw new Error(Bu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case ta:case ea:case oa:case ia:case Un:case sa:case na:e=this.type.toUpperCase();break;case ra:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Un&&(t=It.toString(t)),new oe(e,void 0,t)}}class oi extends Nt{constructor(e){let t;if(e instanceof Ee)t=e;else if(Array.isArray(e)){const i=[];for(const n of e)if(n instanceof Z)i.push(n);else{const s=j.parse(new Vt(n.type,n.value).rawData,Z);i.push(s)}t=new Ee(i)}else if(_.isBufferSource(e))t=j.parse(e,Ee);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){const t=[];for(const i of e){let n=null;try{n=new Vt(i)}catch{continue}t.push(n)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const t of this.items){const i=t.toTextObject();let n=e[i[oe.NAME]];Array.isArray(n)||(n=[],e[i[oe.NAME]]=n),n.push(i)}return e}}oi.NAME="GeneralNames";const si="-{5}",ai="\\n",Rd=`[^${ai}]+`,Dd=`${si}BEGIN (${Rd}(?=${si}))${si}`,$d=`${si}END \\1${si}`,Br="\\n",Md=`[^:${ai}]+`,Ud=`(?:[^${ai}]+${Br}(?: +[^${ai}]+${Br})*)`,Ld=`(?:[a-zA-Z0-9=+/]+${Br})+`,Ou=`${Dd}${Br}(?:((?:${Md}: ${Ud})+))?${Br}?(${Ld})${$d}`;class Me{static isPem(e){return typeof e=="string"&&new RegExp(Ou,"g").test(e)}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(Ou,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${ai}]+`,"g"),""),c={type:n[1],headers:[],rawData:L.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(Br,"g"));let p=null;for(const b of f){const[y,K]=b.split(/:(.*)/);if(K===void 0){if(!p)throw new Error("Cannot parse PEM string. Incorrect header value");p.value+=y.trim()}else p&&c.headers.push(p),p={key:y,value:K.trim()}}p&&c.headers.push(p)}i.push(c)}return i}static decode(e){return this.decodeWithHeaders(e).map(i=>i.rawData)}static decodeFirst(e){const t=this.decode(e);if(!t.length)throw new RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){const i=new Array;return t?e.forEach(n=>{if(!_.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:t,rawData:_.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(`
116
+ `)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:_.toArrayBuffer(e)})}}static encodeStruct(e){var t;const i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(const p of e.headers)n.push(`${p.key}: ${p.value}`);n.push("")}const s=L.ToBase64(e.rawData);let c,u=0;const f=Array();for(;u<s.length&&(s.length-u<64?c=s.substring(u):(c=s.substring(u,u+64),u+=64),c.length!==0);)if(f.push(c),c.length<64)break;return n.push(...f),n.push(`-----END ${i}-----`),n.join(`
117
+ `)}}Me.CertificateTag="CERTIFICATE",Me.CrlTag="CRL",Me.CertificateRequestTag="CERTIFICATE REQUEST",Me.PublicKeyTag="PUBLIC KEY",Me.PrivateKeyTag="PRIVATE KEY";class wt extends Nt{static isAsnEncoded(e){return _.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Me.isPem(e))return Me.decode(e)[0];if(L.isHex(e))return L.FromHex(e);if(L.isBase64(e))return L.FromBase64(e);if(L.isBase64Url(e))return L.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=L.ToBinary(e);return Me.isPem(t)?Me.decode(t)[0]:L.isHex(t)?L.FromHex(t):L.isBase64(t)?L.FromBase64(t):L.isBase64Url(t)?L.FromBase64Url(t):_.toArrayBuffer(e)}}constructor(...e){wt.isAsnEncoded(e[0])?super(wt.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return Me.encode(this.rawData,this.tag);default:return super.toString(e)}}}class lt extends wt{static async create(e,t=Ne.get()){if(e instanceof lt)return e;if(Ot.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new lt(i)}else{if(e.publicKey)return e.publicKey;if(_.isBufferSource(e))return new lt(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){wt.isAsnEncoded(e)?super(e,ot):super(e),this.tag=Me.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]||Ne.get()):t=e[0]||Ne.get();let s=this.rawData;const c=j.parse(this.rawData,ot);return c.algorithm.algorithm===Xr&&(s=Hd(c,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=Ie.resolve(xr),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Wt:{const n=j.parse(e.subjectPublicKey,Os),s=_.toUint8Array(n.modulus);i.publicExponent=_.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}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]||Ne.get()):i=e[0]||Ne.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=Ne.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Ne.get();const n=j.parse(this.rawData,ot);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,ot);switch(e.Algorithm=Qt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case Yr:e["EC Point"]=t.subjectPublicKey;break;case Wt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function Hd(r,e){return r.algorithm=new R({algorithm:Wt,parameters:null}),e=j.serialize(r),e}class ci extends Ke{static async create(e,t=!1,i=Ne.get()){if("name"in e&&"serialNumber"in e)return new ci(e,t);const s=await(await lt.create(e,i)).getKeyIdentifier(i);return new ci(L.ToHex(s),t)}constructor(...e){if(_.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Ht({keyIdentifier:new Bo(L.FromHex(e[0]))});super(xo,e[1],j.serialize(t))}else{const t=e[0],i=t.name instanceof oi?j.parse(t.name.rawData,Ee):t.name,n=new Ht({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(t.serialNumber)});super(xo,e[1],j.serialize(n))}}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,Ht);t.keyIdentifier&&(this.keyId=L.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?L.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,Ht);return t.authorityCertIssuer&&(e["Authority Issuer"]=new oi(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}ci.NAME="Authority Key Identifier";class Tu extends Ke{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Pi);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Pi({cA:e[0],pathLenConstraint:e[1]});super(Dc,e[2],j.serialize(t)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}}Tu.NAME="Basic Constraints";var Vu;(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"})(Vu||(Vu={}));class _u extends Ke{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Ui);this.usages=t.map(i=>i)}else{const t=new Ui(e[0]);super(Fc,e[1],j.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>It.toString(t)).join(", "),e}}_u.NAME="Extended Key Usages";var aa;(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"})(aa||(aa={}));class ca extends Ke{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,Lo);this.usages=t.toNumber()}else{const t=new Lo(e[0]);super(Kc,e[1],j.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,Lo);return e[""]=t.toJSON().join(", "),e}}ca.NAME="Key Usages";class Ln extends Ke{static async create(e,t=!1,i=Ne.get()){const s=await(await lt.create(e,i)).getKeyIdentifier(i);return new Ln(L.ToHex(s),t)}constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=j.parse(this.value,xt);this.keyId=L.ToHex(t)}else{const t=typeof e[0]=="string"?L.FromHex(e[0]):e[0],i=new xt(t);super(Zc,e[1],j.serialize(i)),this.keyId=L.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=j.parse(this.value,xt);return e[""]=t,e}}Ln.NAME="Subject Key Identifier";class la extends Ke{constructor(...e){_.isBufferSource(e[0])?super(e[0]):super(Jc,e[1],new oi(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,zo);this.names=new oi(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}la.NAME="Subject Alternative Name";class ze{static register(e,t){this.items.set(e,t)}static create(e){const t=new Ke(e),i=this.items.get(t.type);return i?new i(e):t}}ze.items=new Map;class ju extends Ke{constructor(...e){var t;if(_.isBufferSource(e[0])){super(e[0]);const i=j.parse(this.value,$i);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new $i(i.map(c=>new Di({policyIdentifier:c})));super(Mc,n,j.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new oe("",{},It.toString(t))),e}}ju.NAME="Certificate Policies",ze.register(Mc,ju);class Pu extends Ke{constructor(...e){var t;if(_.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(c=>new ar({distributionPoint:new Ft({fullName:[new Z({uniformResourceIdentifier:c})]})})),s=new cr(n);super(jo,e[1],j.serialize(s))}else{const i=new cr(e[0]);super(jo,e[1],j.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=j.parse(e.extnValue,cr);this.distributionPoints=t}toTextObject(){const e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(t=>{var i;const n={};return t.distributionPoint&&(n[""]=(i=t.distributionPoint.fullName)===null||i===void 0?void 0:i.map(s=>new Vt(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}Pu.NAME="CRL Distribution Points";class Ru extends Ke{constructor(...e){var t,i,n,s;if(_.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof sr){const c=new sr(e[0]);super(Co,e[1],j.serialize(c))}else{const c=e[0],u=new sr;Fn(u,c,_c,"ocsp"),Fn(u,c,jc,"caIssuers"),Fn(u,c,Pc,"timeStamping"),Fn(u,c,Rc,"caRepository"),super(Co,e[1],j.serialize(u))}(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=[],j.parse(e.extnValue,sr).forEach(i=>{switch(i.accessMethod){case _c:this.ocsp.push(new Vt(i.accessLocation));break;case jc:this.caIssuers.push(new Vt(i.accessLocation));break;case Pc:this.timeStamping.push(new Vt(i.accessLocation));break;case Rc:this.caRepository.push(new Vt(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&Hn(e,"OCSP",this.ocsp),this.caIssuers.length&&Hn(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&Hn(e,"Time Stamping",this.timeStamping),this.caRepository.length&&Hn(e,"CA Repository",this.caRepository),e}}Ru.NAME="Authority Info Access";function Hn(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new oe("");t.forEach((n,s)=>{const c=n.toTextObject(),u=`${c[oe.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(c)}),r[e]=i}}function Fn(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(c=>{typeof c=="string"&&(c=new Vt("url",c)),r.push(new Dr({accessMethod:t,accessLocation:j.parse(c.rawData,Z)}))})}class Er extends Nt{constructor(...e){let t;if(_.isBufferSource(e[0]))t=_.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>_.toArrayBuffer(s)):[];t=j.serialize(new gt({type:i,values:n}))}super(t,gt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new oe("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[oe.NAME]===Er.NAME&&(e[oe.NAME]=It.toString(this.type)),e}}Er.NAME="Attribute";class Du extends Er{constructor(...e){var t;if(_.isBufferSource(e[0]))super(e[0]);else{const i=new Dn({printableString:e[0]});super(_l,[j.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=j.parse(this.values[0],Dn);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[oe.VALUE]=this.password,e}}Du.NAME="Challenge Password";class ua extends Er{constructor(...e){var t;if(_.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new qt;for(const s of i)n.push(j.parse(s.rawData,Qe));super(Ks,[j.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=j.parse(this.values[0],qt);this.items=t.map(i=>ze.create(j.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[oe.NAME]]=i;return e}}ua.NAME="Extensions";class qn{static register(e,t){this.items.set(e,t)}static create(e){const t=new Er(e),i=this.items.get(t.type);return i?new i(e):t}}qn.items=new Map;const Kn="crypto.signatureFormatter";class Fd{toAsnSignature(e,t){return _.toArrayBuffer(t)}toWebSignature(e,t){return _.toArrayBuffer(t)}}var zn;let fa=zn=class{static createPssParams(e,t){const i=zn.getHashAlgorithm(e);return i?new Yt({hashAlgorithm:i,maskGenAlgorithm:new R({algorithm:An,parameters:j.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=Ie.resolve(xr);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 R({algorithm:yn,parameters:null});case"sha-256":return new R({algorithm:Es,parameters:null});case"sha-384":return new R({algorithm:gn,parameters:null});case"sha-512":return new R({algorithm:mn,parameters:null})}}else return new R({algorithm:Wt,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");const t=zn.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new R({algorithm:Xr,parameters:j.serialize(t)})}else return new R({algorithm:Xr,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Wt:return{name:"RSASSA-PKCS1-v1_5"};case yn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Es:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case gn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case Xr:if(e.parameters){const t=j.parse(e.parameters,Yt);return{name:"RSA-PSS",hash:Ie.resolve(xr).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};fa=zn=a([On()],fa),Ie.registerSingleton(ii,fa);let da=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new R({algorithm:bn});case"sha-256":return new R({algorithm:vn});case"sha-384":return new R({algorithm:wn});case"sha-512":return new R({algorithm:Sn})}return null}toWebAlgorithm(e){switch(e.algorithm){case bn:return{name:"SHA-1"};case vn:return{name:"SHA-256"};case wn:return{name:"SHA-384"};case Sn:return{name:"SHA-512"}}return null}};da=a([On()],da),Ie.registerSingleton(ii,da);class Ge{addPadding(e,t){const i=_.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}removePadding(e,t=!1){let i=_.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(t&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){const i=e.namedCurve,n=Ge.namedCurveSize.get(i)||Ge.defaultNamedCurveSize,s=new hn,c=_.toUint8Array(t);return s.r=this.removePadding(c.slice(0,n),!0),s.s=this.removePadding(c.slice(n,n+n),!0),j.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=j.parse(t,hn),n=e.namedCurve,s=Ge.namedCurveSize.get(n)||Ge.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return rf(c,u)}return null}}Ge.namedCurveSize=new Map,Ge.defaultNamedCurveSize=32;const pa="1.3.101.110",$u="1.3.101.111",ha="1.3.101.112",Mu="1.3.101.113";let ya=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=ha;break;case"x25519":t=pa;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=ha;break;case"ed448":t=Mu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=pa;break;case"x448":t=$u;break}}return t?new R({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case ha:return{name:"Ed25519"};case Mu:return{name:"EdDSA",namedCurve:"Ed448"};case pa:return{name:"X25519"};case $u:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};ya=a([On()],ya),Ie.registerSingleton(ii,ya);class qd extends wt{constructor(e){wt.isAsnEncoded(e)?super(e,ri):super(e),this.tag=Me.CertificateRequestTag}onInit(e){this.tbs=j.serialize(e.certificationRequestInfo),this.publicKey=new lt(e.certificationRequestInfo.subjectPKInfo);const t=Ie.resolve(xr);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>qn.create(j.serialize(n)));const i=this.getAttribute(Ks);this.extensions=[],i instanceof ua&&(this.extensions=i.items),this.subjectName=new Tt(e.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(e){for(const 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(const 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=Ne.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=Ie.resolveAll(Kn).reverse();let s=null;for(const u of n)if(s=u.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(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,ri),i=t.certificationRequestInfo,n=new oe("",{Version:`${lr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new oe("");for(const c of this.attributes){const u=c.toTextObject();s[u[oe.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new oe("",{Algorithm:Qt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}qd.NAME="PKCS#10 Certificate Request";class Uu extends wt{constructor(e){wt.isAsnEncoded(e)?super(e,ur):super(e),this.tag=Me.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=j.serialize(t),this.serialNumber=L.ToHex(t.serialNumber),this.subjectName=new Tt(t.subject),this.subject=new Tt(t.subject).toString(),this.issuerName=new Tt(t.issuer),this.issuer=this.issuerName.toString();const i=Ie.resolve(xr);this.signatureAlgorithm=i.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const n=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;const s=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(c=>ze.create(j.serialize(c)))),this.publicKey=new lt(t.subjectPublicKeyInfo)}getExtension(e){for(const 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=Ne.get()){let i,n;const 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 lt)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(_.isBufferSource(s)){const p=new lt(s);i={...p.algorithm,...this.signatureAlgorithm},n=await p.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const c=Ie.resolveAll(Kn).reverse();let u=null;for(const p of c)if(u=p.toWebSignature(i,this.signature),u)break;if(!u)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const f=await t.subtle.verify(this.signatureAlgorithm,n,u,this.tbs);if(e.signatureOnly)return f;{const b=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<b&&b<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=Ne.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Ne.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=j.parse(this.rawData,ur),i=t.tbsCertificate,n=new oe("",{Version:`${lr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Qt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new oe("",{"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){const s=new oe("");for(const c of this.extensions){const u=c.toTextObject();s[u[oe.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new oe("",{Algorithm:Qt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}Uu.NAME="Certificate";var Lu;(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"})(Lu||(Lu={})),ze.register(Dc,Tu),ze.register(Fc,_u),ze.register(Kc,ca),ze.register(Zc,Ln),ze.register(xo,ci),ze.register(Jc,la),ze.register(jo,Pu),ze.register(Co,Ru),qn.register(_l,Du),qn.register(Ks,ua),Ie.registerSingleton(Kn,Fd),Ie.registerSingleton(Kn,Ge),Ge.namedCurveSize.set("P-256",32),Ge.namedCurveSize.set("K-256",32),Ge.namedCurveSize.set("P-384",48),Ge.namedCurveSize.set("P-521",66);function Hu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new Uu(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof la){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,p)=>{const b=p.type,y=f[b]??[];return{...f,[b]:[...y,p.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof ca){const s=Object.values(aa),c=Array(s.length/2).fill(null).reduce((u,f,p)=>{const b=s[s.length/2+p];if(n.usages&b){const y=s[p];u.push(y)}return u},[]);i.keyUsage=c}return i}}}function Kd(){const r=Hu(),e=o.ref({}),t=n=>{if(!(n.id in e.value))try{e.value[n.id]=r.parseMetaCertificateData(n.cert)}catch{e.value[n.id]=void 0}return e.value[n.id]};return{certificateDataCache:e,getCertificateData:n=>{const s=t(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const zd={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."},empty_state_v2:{create:"New certificate",title:"Configure your first certificate",description:"Certificates manage SSL/TLS encryption, ensuring secure communication between clients and your API services."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."},empty_state_v2:{create:"New CA certificate",title:"Configure your first CA certificate",description:"CA Certificates validate the authenticity of client and server certificates, reinforcing the trust and security of your API communications."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Gd(){const r=wa.createI18n("en-us",zd);return{i18n:r,i18nT:wa.i18nTComponent(r)}}const et={useCertificate:Kd,useI18n:Gd,useX509:Hu},Gn="/v2/control-planes/{controlPlaneId}/core-entities",Wn="/{workspace}",li={list:{konnect:`${Gn}/certificates`,kongManager:`${Wn}/certificates`},form:{konnect:{create:`${Gn}/certificates`,edit:`${Gn}/certificates/{id}`,validate:`${Gn}/v1/schemas/json/certificate/validate`},kongManager:{create:`${Wn}/certificates`,edit:`${Wn}/certificates/{id}`,validate:`${Wn}/schemas/certificates/validate`}}},Wd={class:"kong-ui-entities-certificates-list"},Jd={class:"button-row"},Yd={class:"empty-state-icon-gateway"},Zd={key:0},Qd={key:1},Xd={key:0},ep={key:1},tp={key:0},rp={key:1},ip={key:1},np=o.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1},enableV2EmptyStates:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var F;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),u=di.useRouter(),{axiosInstance:f}=N.useAxios((F=i.config)==null?void 0:F.axiosRequestConfig),{hideTableToolbar:p,handleStateChange:b}=N.useTableState(()=>g.value),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),O={subject:{label:n("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:n("certificates.list.table_headers.expiry")},san:{label:n("certificates.list.table_headers.san")},cert:{label:n("certificates.list.table_headers.cert")},tags:{label:n("certificates.list.table_headers.tags"),sortable:!0}},d=o.computed(()=>{var Y,ie;let U=`${i.config.apiBaseUrl}${li.list[i.config.app]}`;return i.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((Y=i.config)==null?void 0:Y.controlPlaneId)||""):i.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(ie=i.config)!=null&&ie.workspace?`/${i.config.workspace}`:"")),U}),g=o.ref(""),S=o.computed(()=>{const U=i.config.app==="konnect"||i.config.isExactMatch;return U?{isExactMatch:U,placeholder:n("certificates.search.placeholder")}:{isExactMatch:U,schema:i.config.filterSchema}}),{fetcher:w,fetcherState:E,fetcherCacheKey:k}=N.useFetcher({...i.config,cacheIdentifier:i.cacheIdentifier},d.value),I=()=>{g.value=""},Q=()=>{k.value++},ee=o.ref(null),$=(U,Y)=>{const ie=U.id;if(!Y(ie)){t("copy:error",{entity:U,field:"id",message:n("certificates.errors.copy")});return}t("copy:success",{entity:U,field:"id",message:n("certificates.copy.success",{val:ie})})},x=(U,Y)=>{const ie=JSON.stringify(U);if(!Y(ie)){t("copy:error",{entity:U,message:n("certificates.errors.copy")});return}t("copy:success",{entity:U,message:n("certificates.copy.success_brief")})},T=async U=>{var ie;await((ie=i.canRetrieve)==null?void 0:ie.call(i,U))&&u.push(i.config.getViewRoute(U.id))},ge=U=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(U)}),ce=U=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(U)}),Ue=U=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(U)}},ae=o.ref(void 0),le=o.ref(!1),Re=o.ref(!1),re=o.ref(""),Ir=N.useDeleteUrlBuilder(i.config,d.value),{certificateDataCache:_t,getCertificateData:St}=et.useCertificate(),Nr=U=>{ae.value=U,le.value=!0},Or=()=>{le.value=!1},G=async()=>{var U,Y,ie;if((U=ae.value)!=null&&U.id){Re.value=!0;try{await f.delete(Ir(ae.value.id)),Re.value=!1,le.value=!1,k.value++,t("delete:success",ae.value)}catch(Le){re.value=((ie=(Y=Le.response)==null?void 0:Y.data)==null?void 0:ie.message)||Le.message||n("certificates.errors.delete"),t("error",Le)}finally{Re.value=!1}}},We=()=>{u.push(i.config.createRoute)};o.watch(E,U=>{var Y,ie,Le;if(U.status===N.FetcherStatus.Error){ee.value={title:n("certificates.errors.general")},(Le=(ie=(Y=U.error)==null?void 0:Y.response)==null?void 0:ie.data)!=null&&Le.message&&(ee.value.message=U.error.response.data.message),t("error",U.error);return}_t.value={},ee.value=null});const jt=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(jt.value.title=n("certificates.list.empty_state.title"),jt.value.ctaText=n("certificates.actions.create"))}),(U,Y)=>{const ie=o.resolveComponent("KButton"),Le=o.resolveComponent("KCopy"),J=o.resolveComponent("KDropdownItem"),Ce=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",Wd,[o.createVNode(o.unref(N.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":y.value,"empty-state-options":jt.value,"enable-entity-actions":"","error-message":ee.value,fetcher:o.unref(w),"fetcher-cache-key":o.unref(k),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:g.value,"table-headers":o.unref(O),onClearSearchInput:I,"onClick:row":Y[3]||(Y[3]=W=>T(W)),onSort:Q,onState:o.unref(b)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(N.EntityFilter),{modelValue:g.value,"onUpdate:modelValue":Y[0]||(Y[0]=W=>g.value=W),config:S.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",Jd,[!o.unref(p)&&r.config.app==="konnect"?(o.openBlock(),o.createBlock(ie,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"certificates-learn-more-button",icon:"",onClick:Y[1]||(Y[1]=W=>U.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(At.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),o.createVNode(o.unref(N.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.createVNode(ie,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(At.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),subject:o.withCtx(({row:W})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Zd,o.toDisplayString((xe=W==null?void 0:W.metadata)!=null&&xe.subject?W.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",Qd,o.toDisplayString(o.unref(St)(W).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:W})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Xd,o.toDisplayString((xe=W==null?void 0:W.metadata)!=null&&xe.expiry?o.unref(s)(W.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",ep,o.toDisplayString(o.unref(St)(W).schemaExpiry?o.unref(s)(o.unref(St)(W).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:W})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",tp,o.toDisplayString((xe=W==null?void 0:W.metadata)!=null&&xe.dns_names?`dns=${W.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",rp,o.toDisplayString(o.unref(St)(W).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:W})=>[W!=null&&W.cert?(o.openBlock(),o.createBlock(Le,{key:0,"data-testid":"copy-certificate-cert",text:W.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",ip,"-"))]),tags:o.withCtx(({row:W})=>[o.createVNode(o.unref(N.TableTags),{tags:W==null?void 0:W.tags},null,8,["tags"])]),actions:o.withCtx(({row:W})=>[o.createVNode(Ce,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:ga=>$(W,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Ce,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:ga=>x(W,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(N.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(W)},{default:o.withCtx(()=>[o.createVNode(J,{"data-testid":"action-entity-view","has-divider":"",item:ge(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(N.PermissionsWrapper),{"auth-function":()=>r.canEdit(W)},{default:o.withCtx(()=>[o.createVNode(J,{"data-testid":"action-entity-edit",item:ce(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(N.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(J,{"data-testid":"action-entity-add-sni",item:Ue(W.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(N.PermissionsWrapper),{"auth-function":()=>r.canDelete(W)},{default:o.withCtx(()=>[o.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Nr(W)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[r.enableV2EmptyStates&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>[o.createVNode(o.unref(N.EntityEmptyState),{"action-button-text":o.unref(n)("certificates.list.empty_state_v2.create"),appearance:"secondary","can-create":()=>r.canCreate(),description:o.unref(n)("certificates.list.empty_state_v2.description"),"learn-more":r.config.app==="konnect",title:o.unref(n)("certificates.list.empty_state_v2.title"),"onClick:create":We,"onClick:learnMore":Y[2]||(Y[2]=W=>U.$emit("click:learn-more"))},{image:o.withCtx(()=>[o.createElementVNode("div",Yd,[o.createVNode(o.unref(At.ServiceDocumentIcon),{color:o.unref(Sa),size:o.unref(Aa)},null,8,["color","size"])])]),_:1},8,["action-button-text","can-create","description","learn-more","title"])]),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),o.createVNode(o.unref(N.EntityDeleteModal),{"action-pending":Re.value,"entity-type":o.unref(N.EntityTypes).Certificate,error:re.value,title:o.unref(n)("certificates.delete.title"),visible:le.value,onCancel:Or,onProceed:G},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Xt=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},op=Xt(np,[["__scopeId","data-v-8d022f6e"]]),sp={class:"sni-field-container"},ap={key:1,class:"sni-field-controls-container"},cp={key:0},lp=Xt(o.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{i18nT:n,i18n:{t:s}}=et.useI18n(),c=o.ref([]);return o.watch(t.modelValue,u=>{c.value=[...u]},{immediate:!0,deep:!0}),o.watch(c,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const p=o.resolveComponent("KLabel"),b=o.resolveComponent("KInput"),y=o.resolveComponent("KButton"),K=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",sp,[o.createVNode(p,{info:o.unref(s)("certificates.form.fields.snis.tooltip")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,(O,d)=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"sni-field-input"},[!r.isEditing||c.value[d]?(o.openBlock(),o.createBlock(b,{key:0,modelValue:c.value[d],"onUpdate:modelValue":g=>c.value[d]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${d+1}`,disabled:r.isEditing,placeholder:o.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):o.createCommentVNode("",!0),r.isEditing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",ap,[o.createVNode(y,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>u.$emit("remove",d)},{default:o.withCtx(()=>[o.createVNode(o.unref(At.TrashIcon),{color:o.unref(Zu)},null,8,["color"])]),_:2},1032,["onClick"]),o.createVNode(y,{appearance:"tertiary","data-testid":"add-sni",disabled:d!==c.value.length-1,icon:"",onClick:f[0]||(f[0]=g=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(At.AddIcon))]),_:2},1032,["disabled"])]))]))),128)),c.value.length===0?(o.openBlock(),o.createElementBlock("div",cp,[o.createVNode(y,{onClick:f[1]||(f[1]=O=>u.$emit("add"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):o.createCommentVNode("",!0),r.isEditing?(o.openBlock(),o.createBlock(o.unref(n),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:o.withCtx(()=>[o.createVNode(K,{to:r.sniListRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):o.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),up={class:"kong-ui-entities-certificates-form"},fp=Xt(o.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading"],setup(r,{emit:e}){var ee;const t=e,i=r,n=di.useRouter(),{i18nT:s,i18n:{t:c}}=et.useI18n(),{getMessageFromError:u}=N.useErrors(),{axiosInstance:f}=N.useAxios((ee=i.config)==null?void 0:ee.axiosRequestConfig),p=o.computed(()=>li.form[i.config.app].edit),b=o.computed(()=>i.certificateId?N.EntityBaseFormType.Edit:N.EntityBaseFormType.Create),y=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),K=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),O=o.computed(()=>(b.value===N.EntityBaseFormType.Create||JSON.stringify(y.fields)!==JSON.stringify(K))&&!!y.fields.cert&&!!y.fields.key),d=$=>{var x,T;y.fields.cert=($==null?void 0:$.cert)||"",y.fields.key=($==null?void 0:$.key)||"",y.fields.certAlt=($==null?void 0:$.cert_alt)||"",y.fields.keyAlt=($==null?void 0:$.key_alt)||"",y.fields.snis=(x=$==null?void 0:$.snis)!=null&&x.length?$.snis:[""],y.fields.tags=((T=$==null?void 0:$.tags)==null?void 0:T.join(", "))||"",Object.assign(K,y.fields)},g=()=>{n.push(i.config.cancelRoute)},S=()=>{y.fields.snis.push("")},w=$=>{y.fields.snis.splice($,1)},E=o.computed(()=>{var x,T;let $=`${i.config.apiBaseUrl}${li.form[i.config.app].validate}`;return i.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((x=i.config)==null?void 0:x.controlPlaneId)||""):i.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(T=i.config)!=null&&T.workspace?`/${i.config.workspace}`:"")),$=$.replace(/{id}/gi,i.certificateId),$}),k=o.computed(()=>{var x,T;let $=`${i.config.apiBaseUrl}${li.form[i.config.app][b.value]}`;return i.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((x=i.config)==null?void 0:x.controlPlaneId)||""):i.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(T=i.config)!=null&&T.workspace?`/${i.config.workspace}`:"")),$=$.replace(/{id}/gi,i.certificateId),$}),I=o.computed(()=>{var $,x;return{cert:y.fields.cert,key:y.fields.key,cert_alt:y.fields.certAlt||null,key_alt:y.fields.keyAlt||null,...i.showSnisField?{snis:y.fields.snis.filter(Boolean)}:{},tags:(x=($=y.fields.tags.split(","))==null?void 0:$.map(T=>String(T||"").trim()))==null?void 0:x.filter(T=>T!=="")}}),Q=async()=>{var $,x,T,ge,ce,Ue,ae,le,Re;try{y.isReadonly=!0;let re;await f.post(E.value,I.value),b.value==="create"?re=await f.post(k.value,I.value):b.value==="edit"&&(re=(($=i.config)==null?void 0:$.app)==="konnect"?await f.put(k.value,I.value):await f.patch(k.value,I.value)),y.fields.cert=((x=re==null?void 0:re.data)==null?void 0:x.cert)||"",y.fields.key=((T=re==null?void 0:re.data)==null?void 0:T.key)||"",y.fields.certAlt=((ge=re==null?void 0:re.data)==null?void 0:ge.cert_alt)||"",y.fields.keyAlt=((ce=re==null?void 0:re.data)==null?void 0:ce.key_alt)||"",y.fields.snis=(ae=(Ue=re==null?void 0:re.data)==null?void 0:Ue.snis)!=null&&ae.length?re.data.snis:[""],y.fields.tags=((Re=(le=re==null?void 0:re.data)==null?void 0:le.tags)==null?void 0:Re.join(", "))||"",Object.assign(K,y.fields),t("update",re==null?void 0:re.data)}catch(re){y.errorMessage=u(re),t("error",re)}finally{y.isReadonly=!1}};return($,x)=>{const T=o.resolveComponent("KTextArea"),ge=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",up,[o.createVNode(o.unref(N.EntityBaseForm),{"can-submit":O.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(N.SupportedEntityType).Certificate,"error-message":y.errorMessage,"fetch-url":p.value,"form-fields":I.value,"is-readonly":y.isReadonly,onCancel:g,"onFetch:error":x[7]||(x[7]=ce=>$.$emit("error",ce)),"onFetch:success":d,onLoading:x[8]||(x[8]=ce=>$.$emit("loading",ce)),onSubmit:Q},{default:o.withCtx(()=>[o.createVNode(o.unref(N.EntityFormSection),{description:o.unref(c)("certificates.form.sections.ssl.description"),title:o.unref(c)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(T,{modelValue:y.fields.cert,"onUpdate:modelValue":x[0]||(x[0]=ce=>y.fields.cert=ce),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(c)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(T,{modelValue:y.fields.key,"onUpdate:modelValue":x[1]||(x[1]=ce=>y.fields.key=ce),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(c)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(T,{modelValue:y.fields.certAlt,"onUpdate:modelValue":x[2]||(x[2]=ce=>y.fields.certAlt=ce),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(c)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(T,{modelValue:y.fields.keyAlt,"onUpdate:modelValue":x[3]||(x[3]=ce=>y.fields.keyAlt=ce),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(c)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(lp,{key:0,modelValue:y.fields.snis,"onUpdate:modelValue":x[4]||(x[4]=ce=>y.fields.snis=ce),"is-editing":b.value===o.unref(N.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:S,onRemove:x[5]||(x[5]=ce=>w(ce))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(N.EntityFormSection),{description:o.unref(c)("certificates.form.sections.general.description"),title:o.unref(c)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(ge,{modelValue:y.fields.tags,"onUpdate:modelValue":x[6]||(x[6]=ce=>y.fields.tags=ce),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(c)("certificates.form.fields.tags.help"),label:o.unref(c)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(c)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(c)("certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-fc596de1"]]),Jn="/v2/control-planes/{controlPlaneId}/core-entities",Yn="/{workspace}",ui={list:{konnect:`${Jn}/ca_certificates`,kongManager:`${Yn}/ca_certificates`},form:{konnect:{create:`${Jn}/ca_certificates`,edit:`${Jn}/ca_certificates/{id}`,validate:`${Jn}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${Yn}/ca_certificates`,edit:`${Yn}/ca_certificates/{id}`,validate:`${Yn}/schemas/ca_certificates/validate`}}},dp={class:"kong-ui-ca-certificate-entity-config-card"},pp={key:0},hp=Xt(o.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=["dns_names","san_names","subject"],i=e,n=r,{i18n:{t:s,formatUnixTimeStamp:c}}=et.useI18n(),{convertKeyToTitle:u}=N.useStringHelpers(),{getPropValue:f}=N.useHelpers(),{getCertificateData:p}=et.useCertificate(),b=o.computed(()=>ui.form[n.config.app].edit),y=o.ref(),K=o.computed(()=>{if(y.value)return p(y.value)}),O=o.computed(()=>{var k;return((k=K.value)==null?void 0:k.schemaIssuer)||""}),d=o.computed(()=>{var k,I;return(k=K.value)!=null&&k.schemaExpiry?c((I=K.value)==null?void 0:I.schemaExpiry):""}),g=o.computed(()=>{var k;return((k=K.value)==null?void 0:k.schemaKeyUsages)||[]}),S=(k,I)=>{const Q=f("rowValue",I);if(k==="expiry")return d.value;if(k==="key_usages")return g.value;if(Q)return Q[k]},w=k=>{y.value=k,i("fetch:success",k)},E=o.ref({id:{},updated_at:{},created_at:{},cert:{section:N.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:N.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:N.ConfigurationSchemaSection.Basic,type:N.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:N.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:N.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:N.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(k,I)=>{const Q=o.resolveComponent("KCodeBlock"),ee=o.resolveComponent("KLabel"),$=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",dp,[o.createVNode(o.unref(N.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":E.value,"entity-type":o.unref(N.SupportedEntityType).CaCertificate,"fetch-url":b.value,"hide-title":r.hideTitle,"onFetch:error":I[0]||(I[0]=x=>k.$emit("fetch:error",x)),"onFetch:success":w,onLoading:I[1]||(I[1]=x=>k.$emit("loading",x))},{cert:o.withCtx(x=>[o.unref(f)("rowValue",x)?(o.openBlock(),o.createBlock(Q,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",x),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(ee,{class:"metadata-label"},{default:o.withCtx(()=>I[2]||(I[2]=[o.createTextVNode(" Metadata ")])),_:1})]),metadata:o.withCtx(x=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",x)).filter(T=>!t.includes(T)),T=>(o.openBlock(),o.createBlock(o.unref(N.ConfigCardItem),{key:T,"data-testid":`ca-cert-metadata-${T}`,item:{key:T,label:o.unref(u)(T),value:S(T,x),type:T==="key_usages"?o.unref(N.ConfigurationSchemaType).BadgeTag:o.unref(N.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(O.value||"–"),1)]),key_usages:o.withCtx(()=>[g.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",pp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,(x,T)=>(o.openBlock(),o.createBlock($,{key:`key_usages-badge-tag-${T}`,class:"config-badge","data-testid":`key_usages-badge-tag-${T}`,tooltip:x,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-1d42f61b"]]),yp={class:"kong-ui-entities-ca-certificates-list"},gp={class:"button-row"},mp={class:"empty-state-icon-gateway"},bp={key:0},vp={key:1},wp={key:0},Sp={key:1},Ap=Xt(o.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1},enableV2EmptyStates:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var jt;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),u=di.useRouter(),{axiosInstance:f}=N.useAxios((jt=i.config)==null?void 0:jt.axiosRequestConfig),{hideTableToolbar:p,handleStateChange:b}=N.useTableState(()=>g.value),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),O={issuer:{label:n("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},d=o.computed(()=>{var U,Y;let F=`${i.config.apiBaseUrl}${ui.list[i.config.app]}`;return i.config.app==="konnect"?F=F.replace(/{controlPlaneId}/gi,((U=i.config)==null?void 0:U.controlPlaneId)||""):i.config.app==="kongManager"&&(F=F.replace(/\/{workspace}/gi,(Y=i.config)!=null&&Y.workspace?`/${i.config.workspace}`:"")),F}),g=o.ref(""),S=o.computed(()=>{const F=i.config.app==="konnect"||i.config.isExactMatch;return F?{isExactMatch:F,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:F,schema:i.config.filterSchema}}),{fetcher:w,fetcherState:E,fetcherCacheKey:k}=N.useFetcher({...i.config,cacheIdentifier:i.cacheIdentifier},d.value),I=()=>{g.value=""},Q=()=>{k.value++},ee=o.ref(null),$=(F,U)=>{const Y=F.id;if(!U(Y)){t("copy:error",{entity:F,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:F,field:"id",message:n("ca-certificates.copy.success",{val:Y})})},x=(F,U)=>{const Y=JSON.stringify(F);if(!U(Y)){t("copy:error",{entity:F,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:F,message:n("ca-certificates.copy.success_brief")})},T=async F=>{var Y;await((Y=i.canRetrieve)==null?void 0:Y.call(i,F))&&u.push(i.config.getViewRoute(F.id))},ge=F=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(F)}),ce=F=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(F)}),Ue=o.ref(void 0),ae=o.ref(!1),le=o.ref(!1),Re=o.ref(""),re=N.useDeleteUrlBuilder(i.config,d.value),{certificateDataCache:Ir,getCertificateData:_t}=et.useCertificate(),St=F=>{Ue.value=F,ae.value=!0},Nr=()=>{ae.value=!1},Or=async()=>{var F,U,Y;if((F=Ue.value)!=null&&F.id){le.value=!0;try{await f.delete(re(Ue.value.id)),le.value=!1,ae.value=!1,k.value++,t("delete:success",Ue.value)}catch(ie){Re.value=((Y=(U=ie.response)==null?void 0:U.data)==null?void 0:Y.message)||ie.message||n("ca-certificates.errors.delete"),t("error",ie)}finally{le.value=!1}}},G=()=>{u.push(i.config.createRoute)};o.watch(E,F=>{var U,Y,ie;if(F.status===N.FetcherStatus.Error){ee.value={title:n("ca-certificates.errors.general")},(ie=(Y=(U=F.error)==null?void 0:U.response)==null?void 0:Y.data)!=null&&ie.message&&(ee.value.message=F.error.response.data.message),t("error",F.error);return}Ir.value={},ee.value=null});const We=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("ca-certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(We.value.title=n("ca-certificates.list.empty_state.title"),We.value.ctaText=n("ca-certificates.actions.create"))}),(F,U)=>{const Y=o.resolveComponent("KButton"),ie=o.resolveComponent("KDropdownItem"),Le=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",yp,[o.createVNode(o.unref(N.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":y.value,"empty-state-options":We.value,"enable-entity-actions":"","error-message":ee.value,fetcher:o.unref(w),"fetcher-cache-key":o.unref(k),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:g.value,"table-headers":o.unref(O),onClearSearchInput:I,"onClick:row":U[3]||(U[3]=J=>T(J)),onSort:Q,onState:o.unref(b)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(N.EntityFilter),{modelValue:g.value,"onUpdate:modelValue":U[0]||(U[0]=J=>g.value=J),config:S.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",gp,[!o.unref(p)&&r.config.app==="konnect"?(o.openBlock(),o.createBlock(Y,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"ca-certificates-learn-more-button",icon:"",onClick:U[1]||(U[1]=J=>F.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(At.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),o.createVNode(o.unref(N.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.createVNode(Y,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(At.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),issuer:o.withCtx(({row:J})=>{var Ce;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",bp,o.toDisplayString((Ce=J==null?void 0:J.metadata)!=null&&Ce.issuer?J.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",vp,o.toDisplayString(o.unref(_t)(J).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:J})=>{var Ce;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",wp,o.toDisplayString((Ce=J==null?void 0:J.metadata)!=null&&Ce.expiry?o.unref(s)(J.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Sp,o.toDisplayString(o.unref(_t)(J).schemaExpiry?o.unref(s)(o.unref(_t)(J).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:J})=>[o.createVNode(o.unref(N.TableTags),{tags:J==null?void 0:J.tags},null,8,["tags"])]),actions:o.withCtx(({row:J})=>[o.createVNode(Le,null,{default:o.withCtx(({copyToClipboard:Ce})=>[o.createVNode(ie,{"data-testid":"action-entity-copy-id",onClick:W=>$(J,Ce)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Le,null,{default:o.withCtx(({copyToClipboard:Ce})=>[o.createVNode(ie,{"data-testid":"action-entity-copy-json",onClick:W=>x(J,Ce)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(N.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(J)},{default:o.withCtx(()=>[o.createVNode(ie,{"data-testid":"action-entity-view","has-divider":"",item:ge(J.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(N.PermissionsWrapper),{"auth-function":()=>r.canEdit(J)},{default:o.withCtx(()=>[o.createVNode(ie,{"data-testid":"action-entity-edit",item:ce(J.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(N.PermissionsWrapper),{"auth-function":()=>r.canDelete(J)},{default:o.withCtx(()=>[o.createVNode(ie,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>St(J)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[r.enableV2EmptyStates&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>[o.createVNode(o.unref(N.EntityEmptyState),{"action-button-text":o.unref(n)("ca-certificates.list.empty_state_v2.create"),appearance:"secondary","can-create":()=>r.canCreate(),description:o.unref(n)("ca-certificates.list.empty_state_v2.description"),"learn-more":r.config.app==="konnect",title:o.unref(n)("ca-certificates.list.empty_state_v2.title"),"onClick:create":G,"onClick:learnMore":U[2]||(U[2]=J=>F.$emit("click:learn-more"))},{image:o.withCtx(()=>[o.createElementVNode("div",mp,[o.createVNode(o.unref(At.ServiceDocumentIcon),{color:o.unref(Sa),size:o.unref(Aa)},null,8,["color","size"])])]),_:1},8,["action-button-text","can-create","description","learn-more","title"])]),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),o.createVNode(o.unref(N.EntityDeleteModal),{"action-pending":le.value,"entity-type":o.unref(N.EntityTypes).CACertificate,error:Re.value,title:o.unref(n)("ca-certificates.delete.title"),visible:ae.value,onCancel:Nr,onProceed:Or},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-da844cfa"]]),kp={class:"kong-ui-entities-ca-certificates-form"},Cp=Xt(o.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(r,{emit:e}){var k;const t=e,i=r,n=di.useRouter(),{i18n:{t:s}}=et.useI18n(),{getMessageFromError:c}=N.useErrors(),{axiosInstance:u}=N.useAxios((k=i.config)==null?void 0:k.axiosRequestConfig),f=o.computed(()=>ui.form[i.config.app].edit),p=o.computed(()=>i.certificateId?N.EntityBaseFormType.Edit:N.EntityBaseFormType.Create),b=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),y=o.reactive({cert:"",certDigest:"",tags:""}),K=o.computed(()=>(p.value===N.EntityBaseFormType.Create||JSON.stringify(b.fields)!==JSON.stringify(y))&&!!b.fields.cert),O=I=>{var Q;b.fields.cert=(I==null?void 0:I.cert)||"",b.fields.certDigest=(I==null?void 0:I.cert_digest)||"",b.fields.tags=((Q=I==null?void 0:I.tags)==null?void 0:Q.join(", "))||"",Object.assign(y,b.fields)},d=()=>{n.push(i.config.cancelRoute)},g=o.computed(()=>{var Q,ee;let I=`${i.config.apiBaseUrl}${ui.form[i.config.app].validate}`;return i.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((Q=i.config)==null?void 0:Q.controlPlaneId)||""):i.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(ee=i.config)!=null&&ee.workspace?`/${i.config.workspace}`:"")),I=I.replace(/{id}/gi,i.certificateId),I}),S=o.computed(()=>{var Q,ee;let I=`${i.config.apiBaseUrl}${ui.form[i.config.app][p.value]}`;return i.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((Q=i.config)==null?void 0:Q.controlPlaneId)||""):i.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(ee=i.config)!=null&&ee.workspace?`/${i.config.workspace}`:"")),I=I.replace(/{id}/gi,i.certificateId),I}),w=o.computed(()=>{var I,Q;return{cert:b.fields.cert,cert_digest:b.fields.certDigest||null,tags:(Q=(I=b.fields.tags.split(","))==null?void 0:I.map(ee=>String(ee||"").trim()))==null?void 0:Q.filter(ee=>ee!=="")}}),E=async()=>{var I,Q,ee,$,x;try{b.isReadonly=!0;let T;await u.post(g.value,w.value),p.value==="create"?T=await u.post(S.value,w.value):p.value==="edit"&&(T=((I=i.config)==null?void 0:I.app)==="konnect"?await u.put(S.value,w.value):await u.patch(S.value,w.value)),b.fields.cert=((Q=T==null?void 0:T.data)==null?void 0:Q.cert)||"",b.fields.certDigest=((ee=T==null?void 0:T.data)==null?void 0:ee.cert_digest)||"",b.fields.tags=((x=($=T==null?void 0:T.data)==null?void 0:$.tags)==null?void 0:x.join(", "))||"",Object.assign(y,b.fields),t("update",T==null?void 0:T.data)}catch(T){b.errorMessage=c(T),t("error",T)}finally{b.isReadonly=!1}};return(I,Q)=>{const ee=o.resolveComponent("KTextArea"),$=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",kp,[o.createVNode(o.unref(N.EntityBaseForm),{"can-submit":K.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(N.SupportedEntityType).CaCertificate,"error-message":b.errorMessage,"fetch-url":f.value,"form-fields":w.value,"is-readonly":b.isReadonly,onCancel:d,"onFetch:error":Q[3]||(Q[3]=x=>I.$emit("error",x)),"onFetch:success":O,onLoading:Q[4]||(Q[4]=x=>I.$emit("loading",x)),onSubmit:E},{default:o.withCtx(()=>[o.createVNode(o.unref(N.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.cert.description"),title:o.unref(s)("ca-certificates.form.sections.cert.title")},{default:o.withCtx(()=>[o.createVNode(ee,{modelValue:b.fields.cert,"onUpdate:modelValue":Q[0]||(Q[0]=x=>b.fields.cert=x),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:o.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.cert.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:b.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode($,{modelValue:b.fields.certDigest,"onUpdate:modelValue":Q[1]||(Q[1]=x=>b.fields.certDigest=x),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:b.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(N.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.general.description"),title:o.unref(s)("ca-certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode($,{modelValue:b.fields.tags,"onUpdate:modelValue":Q[2]||(Q[2]=x=>b.fields.tags=x),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:o.unref(s)("ca-certificates.form.fields.tags.help"),label:o.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:b.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-2a3f488f"]]),xp={class:"kong-ui-certificate-entity-config-card"},Bp={key:0},Ep=Xt(o.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=et.useI18n(),{convertKeyToTitle:u}=N.useStringHelpers(),{getPropValue:f}=N.useHelpers(),{getCertificateData:p}=et.useCertificate(),b=o.computed(()=>li.form[i.config.app].edit),y=o.ref(),K=o.ref({id:{},cert:{section:N.ConfigurationSchemaSection.Basic},key:{section:N.ConfigurationSchemaSection.Basic,type:N.ConfigurationSchemaType.Redacted},metadata:{section:N.ConfigurationSchemaSection.Basic,type:N.ConfigurationSchemaType.Json},snis:{section:N.ConfigurationSchemaSection.Basic,type:N.ConfigurationSchemaType.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:N.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:N.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:N.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:N.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:N.ConfigurationSchemaSection.Advanced},key_alt:{section:N.ConfigurationSchemaSection.Advanced,type:N.ConfigurationSchemaType.Redacted}}),O=x=>{y.value=x,t("fetch:success",x)},d=(x,T)=>{const ge=f("rowValue",T);if(x==="expiry")return S.value;if(x==="key_usages")return I.value;if(x==="san_names")return E.value;if(ge)return ge[x]},g=o.computed(()=>{if(y.value)return p(y.value)}),S=o.computed(()=>{var x,T;return(x=g.value)!=null&&x.schemaExpiry?s((T=g.value)==null?void 0:T.schemaExpiry):""}),w=o.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaIssuer)||""}),E=o.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaSanNames)||""}),k=o.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaSubject)||""}),I=o.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaKeyUsages)||[]}),Q=o.computed(()=>{var x,T;return((T=(x=y==null?void 0:y.value)==null?void 0:x.snis)==null?void 0:T.length)>0}),ee=o.computed(()=>{var x;return!!((x=y==null?void 0:y.value)!=null&&x.cert_alt)}),$=x=>{var T,ge;return x==="san_names"?n("certificates.list.table_headers.san"):((ge=(T=K.value)==null?void 0:T[x])==null?void 0:ge.label)||u(x)};return(x,T)=>{const ge=o.resolveComponent("KCodeBlock"),ce=o.resolveComponent("KLabel"),Ue=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",xp,[o.createVNode(o.unref(N.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":K.value,"entity-type":o.unref(N.SupportedEntityType).Certificate,"fetch-url":b.value,"hide-title":r.hideTitle,"onFetch:error":T[0]||(T[0]=ae=>x.$emit("fetch:error",ae)),"onFetch:success":O,onLoading:T[1]||(T[1]=ae=>x.$emit("loading",ae))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:o.withCtx(ae=>[o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(ge,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":o.withCtx(()=>[o.createVNode(ce,{class:"metadata-label"},{default:o.withCtx(()=>T[2]||(T[2]=[o.createTextVNode(" Metadata ")])),_:1})]),metadata:o.withCtx(ae=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",ae)),le=>(o.openBlock(),o.createBlock(o.unref(N.ConfigCardItem),{key:le,item:{key:le,value:d(le,ae),label:$(le),type:le==="key_usages"||le==="snis"||le==="dns_names"?o.unref(N.ConfigurationSchemaType).BadgeTag:o.unref(N.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(E.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:o.withCtx(()=>[I.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Bp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(I.value,(ae,le)=>(o.openBlock(),o.createBlock(Ue,{key:`key_usages-badge-tag-${le}`,class:"config-badge","data-testid":`key_usages-badge-tag-${le}`,tooltip:ae,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ae),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[Q.value?void 0:{name:"snis",fn:o.withCtx(()=>[T[3]||(T[3]=o.createTextVNode(" – "))]),key:"0"},ee.value?{name:"cert_alt",fn:o.withCtx(ae=>[T[4]||(T[4]=o.createTextVNode(" > ")),o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(ge,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-401d92d6"]]);Ae.CACertificateConfigCard=hp,Ae.CACertificateForm=Cp,Ae.CACertificateList=Ap,Ae.CertificateConfigCard=Ep,Ae.CertificateForm=fp,Ae.CertificateList=op,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});