@kong-ui-public/entities-certificates 3.10.9 → 3.10.11
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,17 +1,17 @@
|
|
|
1
|
-
(function(xe,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
(function(xe,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):(xe=typeof globalThis<"u"?globalThis:xe||self,o(xe["kong-ui-public-entities-certificates"]={},xe.Vue,xe.VueRouter,xe.KongIcons,xe["kong-ui-public-i18n"],xe["kong-ui-public-entities-shared"]))})(this,function(xe,o,bi,je,xa,A){"use strict";var Ba=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
|
|
2
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
***************************************************************************** */var Ea;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Ba=="object"?Ba: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,d){return function(g,h){Object.defineProperty(f,g,{configurable:!0,writable:!0,value:h}),d&&d(g,h)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||a()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,d=!u&&!f,g={create:u?function(){return Sa(Object.create(null))}:f?function(){return Sa({__proto__:null})}:function(){return Sa({})},has:d?function(y,m){return i.call(y,m)}:function(y,m){return m in y},get:d?function(y,m){return i.call(y,m)?y[m]:void 0}:function(y,m){return y[m]}},h=Object.getPrototypeOf(Function),H=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Tp(),ne=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:_p(),te=typeof WeakMap=="function"?WeakMap:Vp(),X=n?Symbol.for("@reflect-metadata:registry"):void 0,re=Ip(),Ae=Np(re);function Ue(y,m,b,C){if(D(b)){if(!q(y))throw new TypeError;if(!M(m))throw new TypeError;return ft(y,m)}else{if(!q(y))throw new TypeError;if(!ce(m))throw new TypeError;if(!ce(C)&&!D(C)&&!dt(C))throw new TypeError;return dt(C)&&(C=void 0),b=de(b),se(y,m,b,C)}}e("decorate",Ue);function Z(y,m){function b(C,U){if(!ce(C))throw new TypeError;if(!D(U)&&!Ne(U))throw new TypeError;Tr(y,m,C,U)}return b}e("metadata",Z);function T(y,m,b,C){if(!ce(b))throw new TypeError;return D(C)||(C=de(C)),Tr(y,m,b,C)}e("defineMetadata",T);function K(y,m,b){if(!ce(m))throw new TypeError;return D(b)||(b=de(b)),ae(y,m,b)}e("hasMetadata",K);function oe(y,m,b){if(!ce(m))throw new TypeError;return D(b)||(b=de(b)),Ie(y,m,b)}e("hasOwnMetadata",oe);function O(y,m,b){if(!ce(m))throw new TypeError;return D(b)||(b=de(b)),W(y,m,b)}e("getMetadata",O);function w(y,m,b){if(!ce(m))throw new TypeError;return D(b)||(b=de(b)),er(y,m,b)}e("getOwnMetadata",w);function k(y,m){if(!ce(y))throw new TypeError;return D(m)||(m=de(m)),jt(y,m)}e("getMetadataKeys",k);function be(y,m){if(!ce(y))throw new TypeError;return D(m)||(m=de(m)),kt(y,m)}e("getOwnMetadataKeys",be);function ie(y,m,b){if(!ce(m))throw new TypeError;if(D(b)||(b=de(b)),!ce(m))throw new TypeError;D(b)||(b=de(b));var C=gi(m,b,!1);return D(C)?!1:C.OrdinaryDeleteMetadata(y,m,b)}e("deleteMetadata",ie);function ft(y,m){for(var b=y.length-1;b>=0;--b){var C=y[b],U=C(m);if(!D(U)&&!dt(U)){if(!M(U))throw new TypeError;m=U}}return m}function se(y,m,b,C){for(var U=y.length-1;U>=0;--U){var pe=y[U],we=pe(m,b,C);if(!D(we)&&!dt(we)){if(!ce(we))throw new TypeError;C=we}}return C}function ae(y,m,b){var C=Ie(y,m,b);if(C)return!0;var U=Aa(m);return dt(U)?!1:ae(y,U,b)}function Ie(y,m,b){var C=gi(m,b,!1);return D(C)?!1:$(C.OrdinaryHasOwnMetadata(y,m,b))}function W(y,m,b){var C=Ie(y,m,b);if(C)return er(y,m,b);var U=Aa(m);if(!dt(U))return W(y,U,b)}function er(y,m,b){var C=gi(m,b,!1);if(!D(C))return C.OrdinaryGetOwnMetadata(y,m,b)}function Tr(y,m,b,C){var U=gi(b,C,!0);U.OrdinaryDefineOwnMetadata(y,m,b,C)}function jt(y,m){var b=kt(y,m),C=Aa(y);if(C===null)return b;var U=jt(C,m);if(U.length<=0)return b;if(b.length<=0)return U;for(var pe=new ne,we=[],G=0,E=b;G<E.length;G++){var _=E[G],P=pe.has(_);P||(pe.add(_),we.push(_))}for(var R=0,z=U;R<z.length;R++){var _=z[R],P=pe.has(_);P||(pe.add(_),we.push(_))}return we}function kt(y,m){var b=gi(y,m,!1);return b?b.OrdinaryOwnMetadataKeys(y,m):[]}function _r(y){if(y===null)return 1;switch(typeof y){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return y===null?1:6;default:return 6}}function D(y){return y===void 0}function dt(y){return y===null}function tr(y){return typeof y=="symbol"}function ce(y){return typeof y=="object"?y!==null:typeof y=="function"}function F(y,m){switch(_r(y)){case 0:return y;case 1:return y;case 2:return y;case 3:return y;case 4:return y;case 5:return y}var b="string",C=Fu(y,s);if(C!==void 0){var U=C.call(y,b);if(ce(U))throw new TypeError;return U}return V(y)}function V(y,m){var b,C,U;{var pe=y.toString;if(ve(pe)){var C=pe.call(y);if(!ce(C))return C}var b=y.valueOf;if(ve(b)){var C=b.call(y);if(!ce(C))return C}}throw new TypeError}function $(y){return!!y}function J(y){return""+y}function de(y){var m=F(y);return tr(m)?m:J(m)}function q(y){return Array.isArray?Array.isArray(y):y instanceof Object?y instanceof Array:Object.prototype.toString.call(y)==="[object Array]"}function ve(y){return typeof y=="function"}function M(y){return typeof y=="function"}function Ne(y){switch(_r(y)){case 3:return!0;case 4:return!0;default:return!1}}function yi(y,m){return y===m||y!==y&&m!==m}function Fu(y,m){var b=y[m];if(b!=null){if(!ve(b))throw new TypeError;return b}}function qu(y){var m=Fu(y,a);if(!ve(m))throw new TypeError;var b=m.call(y);if(!ce(b))throw new TypeError;return b}function Ku(y){return y.value}function Wu(y){var m=y.next();return m.done?!1:m}function Gu(y){var m=y.return;m&&m.call(y)}function Aa(y){var m=Object.getPrototypeOf(y);if(typeof y!="function"||y===h||m!==h)return m;var b=y.prototype,C=b&&Object.getPrototypeOf(b);if(C==null||C===Object.prototype)return m;var U=C.constructor;return typeof U!="function"||U===y?m:U}function Ep(){var y;!D(X)&&typeof t.Reflect<"u"&&!(X in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(y=Op(t.Reflect));var m,b,C,U=new te,pe={registerProvider:we,getProvider:E,setProvider:P};return pe;function we(R){if(!Object.isExtensible(pe))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case y===R:break;case D(m):m=R;break;case m===R:break;case D(b):b=R;break;case b===R:break;default:C===void 0&&(C=new ne),C.add(R);break}}function G(R,z){if(!D(m)){if(m.isProviderFor(R,z))return m;if(!D(b)){if(b.isProviderFor(R,z))return m;if(!D(C))for(var ue=qu(C);;){var he=Wu(ue);if(!he)return;var tt=Ku(he);if(tt.isProviderFor(R,z))return Gu(ue),tt}}}if(!D(y)&&y.isProviderFor(R,z))return y}function E(R,z){var ue=U.get(R),he;return D(ue)||(he=ue.get(z)),D(he)&&(he=G(R,z),D(he)||(D(ue)&&(ue=new H,U.set(R,ue)),ue.set(z,he))),he}function _(R){if(D(R))throw new TypeError;return m===R||b===R||!D(C)&&C.has(R)}function P(R,z,ue){if(!_(ue))throw new Error("Metadata provider not registered.");var he=E(R,z);if(he!==ue){if(!D(he))return!1;var tt=U.get(R);D(tt)&&(tt=new H,U.set(R,tt)),tt.set(z,ue)}return!0}}function Ip(){var y;return!D(X)&&ce(t.Reflect)&&Object.isExtensible(t.Reflect)&&(y=t.Reflect[X]),D(y)&&(y=Ep()),!D(X)&&ce(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,X,{enumerable:!1,configurable:!1,writable:!1,value:y}),y}function Np(y){var m=new te,b={isProviderFor:function(_,P){var R=m.get(_);return D(R)?!1:R.has(P)},OrdinaryDefineOwnMetadata:we,OrdinaryHasOwnMetadata:U,OrdinaryGetOwnMetadata:pe,OrdinaryOwnMetadataKeys:G,OrdinaryDeleteMetadata:E};return re.registerProvider(b),b;function C(_,P,R){var z=m.get(_),ue=!1;if(D(z)){if(!R)return;z=new H,m.set(_,z),ue=!0}var he=z.get(P);if(D(he)){if(!R)return;if(he=new H,z.set(P,he),!y.setProvider(_,P,b))throw z.delete(P),ue&&m.delete(_),new Error("Wrong provider for target.")}return he}function U(_,P,R){var z=C(P,R,!1);return D(z)?!1:$(z.has(_))}function pe(_,P,R){var z=C(P,R,!1);if(!D(z))return z.get(_)}function we(_,P,R,z){var ue=C(R,z,!0);ue.set(_,P)}function G(_,P){var R=[],z=C(_,P,!1);if(D(z))return R;for(var ue=z.keys(),he=qu(ue),tt=0;;){var zu=Wu(he);if(!zu)return R.length=tt,R;var jp=Ku(zu);try{R[tt]=jp}catch(Pp){try{Gu(he)}finally{throw Pp}}tt++}}function E(_,P,R){var z=C(P,R,!1);if(D(z)||!z.delete(_))return!1;if(z.size===0){var ue=m.get(P);D(ue)||(ue.delete(R),ue.size===0&&m.delete(ue))}return!0}}function Op(y){var m=y.defineMetadata,b=y.hasOwnMetadata,C=y.getOwnMetadata,U=y.getOwnMetadataKeys,pe=y.deleteMetadata,we=new te,G={isProviderFor:function(E,_){var P=we.get(E);return!D(P)&&P.has(_)?!0:U(E,_).length?(D(P)&&(P=new ne,we.set(E,P)),P.add(_),!0):!1},OrdinaryDefineOwnMetadata:m,OrdinaryHasOwnMetadata:b,OrdinaryGetOwnMetadata:C,OrdinaryOwnMetadataKeys:U,OrdinaryDeleteMetadata:pe};return G}function gi(y,m,b){var C=re.getProvider(y,m);if(!D(C))return C;if(b){if(re.setProvider(y,m,Ae))return Ae;throw new Error("Illegal state.")}}function Tp(){var y={},m=[],b=function(){function G(E,_,P){this._index=0,this._keys=E,this._values=_,this._selector=P}return G.prototype["@@iterator"]=function(){return this},G.prototype[a]=function(){return this},G.prototype.next=function(){var E=this._index;if(E>=0&&E<this._keys.length){var _=this._selector(this._keys[E],this._values[E]);return E+1>=this._keys.length?(this._index=-1,this._keys=m,this._values=m):this._index++,{value:_,done:!1}}return{value:void 0,done:!0}},G.prototype.throw=function(E){throw this._index>=0&&(this._index=-1,this._keys=m,this._values=m),E},G.prototype.return=function(E){return this._index>=0&&(this._index=-1,this._keys=m,this._values=m),{value:E,done:!0}},G}(),C=function(){function G(){this._keys=[],this._values=[],this._cacheKey=y,this._cacheIndex=-2}return Object.defineProperty(G.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),G.prototype.has=function(E){return this._find(E,!1)>=0},G.prototype.get=function(E){var _=this._find(E,!1);return _>=0?this._values[_]:void 0},G.prototype.set=function(E,_){var P=this._find(E,!0);return this._values[P]=_,this},G.prototype.delete=function(E){var _=this._find(E,!1);if(_>=0){for(var P=this._keys.length,R=_+1;R<P;R++)this._keys[R-1]=this._keys[R],this._values[R-1]=this._values[R];return this._keys.length--,this._values.length--,yi(E,this._cacheKey)&&(this._cacheKey=y,this._cacheIndex=-2),!0}return!1},G.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=y,this._cacheIndex=-2},G.prototype.keys=function(){return new b(this._keys,this._values,U)},G.prototype.values=function(){return new b(this._keys,this._values,pe)},G.prototype.entries=function(){return new b(this._keys,this._values,we)},G.prototype["@@iterator"]=function(){return this.entries()},G.prototype[a]=function(){return this.entries()},G.prototype._find=function(E,_){if(!yi(this._cacheKey,E)){this._cacheIndex=-1;for(var P=0;P<this._keys.length;P++)if(yi(this._keys[P],E)){this._cacheIndex=P;break}}return this._cacheIndex<0&&_&&(this._cacheIndex=this._keys.length,this._keys.push(E),this._values.push(void 0)),this._cacheIndex},G}();return C;function U(G,E){return G}function pe(G,E){return E}function we(G,E){return[G,E]}}function _p(){var y=function(){function m(){this._map=new H}return Object.defineProperty(m.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),m.prototype.has=function(b){return this._map.has(b)},m.prototype.add=function(b){return this._map.set(b,b),this},m.prototype.delete=function(b){return this._map.delete(b)},m.prototype.clear=function(){this._map.clear()},m.prototype.keys=function(){return this._map.keys()},m.prototype.values=function(){return this._map.keys()},m.prototype.entries=function(){return this._map.entries()},m.prototype["@@iterator"]=function(){return this.keys()},m.prototype[a]=function(){return this.keys()},m}();return y}function Vp(){var y=16,m=g.create(),b=C();return function(){function E(){this._key=C()}return E.prototype.has=function(_){var P=U(_,!1);return P!==void 0?g.has(P,this._key):!1},E.prototype.get=function(_){var P=U(_,!1);return P!==void 0?g.get(P,this._key):void 0},E.prototype.set=function(_,P){var R=U(_,!0);return R[this._key]=P,this},E.prototype.delete=function(_){var P=U(_,!1);return P!==void 0?delete P[this._key]:!1},E.prototype.clear=function(){this._key=C()},E}();function C(){var E;do E="@@WeakMap@@"+G();while(g.has(m,E));return m[E]=!0,E}function U(E,_){if(!i.call(E,b)){if(!_)return;Object.defineProperty(E,b,{value:g.create()})}return E[b]}function pe(E,_){for(var P=0;P<_;++P)E[P]=Math.random()*255|0;return E}function we(E){if(typeof Uint8Array=="function"){var _=new Uint8Array(E);return typeof crypto<"u"?crypto.getRandomValues(_):typeof msCrypto<"u"?msCrypto.getRandomValues(_):pe(_,E),_}return pe(new Array(E),E)}function G(){var E=we(y);E[6]=E[6]&79|64,E[8]=E[8]&191|128;for(var _="",P=0;P<y;++P){var R=E[P];(P===4||P===6||P===8)&&(_+="-"),R<16&&(_+="0"),_+=R.toString(16).toLowerCase()}return _}}function Sa(y){return y.__=void 0,delete y.__,y}})})(Ea||(Ea={}));/*!
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */var Ea;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Ba=="object"?Ba: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,d){return function(g,h){Object.defineProperty(f,g,{configurable:!0,writable:!0,value:h}),d&&d(g,h)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||a()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,d=!u&&!f,g={create:u?function(){return Ca(Object.create(null))}:f?function(){return Ca({__proto__:null})}:function(){return Ca({})},has:d?function(y,m){return i.call(y,m)}:function(y,m){return m in y},get:d?function(y,m){return i.call(y,m)?y[m]:void 0}:function(y,m){return y[m]}},h=Object.getPrototypeOf(Function),H=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ep(),ne=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Np(),te=typeof WeakMap=="function"?WeakMap:Ip(),X=n?Symbol.for("@reflect-metadata:registry"):void 0,re=Cp(),ve=xp(re);function $e(y,m,b,C){if(M(b)){if(!ke(y))throw new TypeError;if(!F(m))throw new TypeError;return ft(y,m)}else{if(!ke(y))throw new TypeError;if(!ae(m))throw new TypeError;if(!ae(C)&&!M(C)&&!dt(C))throw new TypeError;return dt(C)&&(C=void 0),b=K(b),se(y,m,b,C)}}e("decorate",$e);function Z(y,m){function b(C,U){if(!ae(C))throw new TypeError;if(!M(U)&&!Ie(U))throw new TypeError;Vr(y,m,C,U)}return b}e("metadata",Z);function T(y,m,b,C){if(!ae(b))throw new TypeError;return M(C)||(C=K(C)),Vr(y,m,b,C)}e("defineMetadata",T);function W(y,m,b){if(!ae(m))throw new TypeError;return M(b)||(b=K(b)),ce(y,m,b)}e("hasMetadata",W);function oe(y,m,b){if(!ae(m))throw new TypeError;return M(b)||(b=K(b)),Ne(y,m,b)}e("hasOwnMetadata",oe);function O(y,m,b){if(!ae(m))throw new TypeError;return M(b)||(b=K(b)),G(y,m,b)}e("getMetadata",O);function w(y,m,b){if(!ae(m))throw new TypeError;return M(b)||(b=K(b)),rr(y,m,b)}e("getOwnMetadata",w);function k(y,m){if(!ae(y))throw new TypeError;return M(m)||(m=K(m)),Pt(y,m)}e("getMetadataKeys",k);function me(y,m){if(!ae(y))throw new TypeError;return M(m)||(m=K(m)),kt(y,m)}e("getOwnMetadataKeys",me);function ie(y,m,b){if(!ae(m))throw new TypeError;if(M(b)||(b=K(b)),!ae(m))throw new TypeError;M(b)||(b=K(b));var C=mi(m,b,!1);return M(C)?!1:C.OrdinaryDeleteMetadata(y,m,b)}e("deleteMetadata",ie);function ft(y,m){for(var b=y.length-1;b>=0;--b){var C=y[b],U=C(m);if(!M(U)&&!dt(U)){if(!F(U))throw new TypeError;m=U}}return m}function se(y,m,b,C){for(var U=y.length-1;U>=0;--U){var de=y[U],be=de(m,b,C);if(!M(be)&&!dt(be)){if(!ae(be))throw new TypeError;C=be}}return C}function ce(y,m,b){var C=Ne(y,m,b);if(C)return!0;var U=ka(m);return dt(U)?!1:ce(y,U,b)}function Ne(y,m,b){var C=mi(m,b,!1);return M(C)?!1:V(C.OrdinaryHasOwnMetadata(y,m,b))}function G(y,m,b){var C=Ne(y,m,b);if(C)return rr(y,m,b);var U=ka(m);if(!dt(U))return G(y,U,b)}function rr(y,m,b){var C=mi(m,b,!1);if(!M(C))return C.OrdinaryGetOwnMetadata(y,m,b)}function Vr(y,m,b,C){var U=mi(b,C,!0);U.OrdinaryDefineOwnMetadata(y,m,b,C)}function Pt(y,m){var b=kt(y,m),C=ka(y);if(C===null)return b;var U=Pt(C,m);if(U.length<=0)return b;if(b.length<=0)return U;for(var de=new ne,be=[],z=0,E=b;z<E.length;z++){var _=E[z],P=de.has(_);P||(de.add(_),be.push(_))}for(var R=0,J=U;R<J.length;R++){var _=J[R],P=de.has(_);P||(de.add(_),be.push(_))}return be}function kt(y,m){var b=mi(y,m,!1);return b?b.OrdinaryOwnMetadataKeys(y,m):[]}function jr(y){if(y===null)return 1;switch(typeof y){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return y===null?1:6;default:return 6}}function M(y){return y===void 0}function dt(y){return y===null}function ir(y){return typeof y=="symbol"}function ae(y){return typeof y=="object"?y!==null:typeof y=="function"}function Rt(y,m){switch(jr(y)){case 0:return y;case 1:return y;case 2:return y;case 3:return y;case 4:return y;case 5:return y}var b="string",C=Ce(y,s);if(C!==void 0){var U=C.call(y,b);if(ae(U))throw new TypeError;return U}return q(y)}function q(y,m){var b,C,U;{var de=y.toString;if(Ct(de)){var C=de.call(y);if(!ae(C))return C}var b=y.valueOf;if(Ct(b)){var C=b.call(y);if(!ae(C))return C}}throw new TypeError}function V(y){return!!y}function $(y){return""+y}function K(y){var m=Rt(y);return ir(m)?m:$(m)}function ke(y){return Array.isArray?Array.isArray(y):y instanceof Object?y instanceof Array:Object.prototype.toString.call(y)==="[object Array]"}function Ct(y){return typeof y=="function"}function F(y){return typeof y=="function"}function Ie(y){switch(jr(y)){case 3:return!0;case 4:return!0;default:return!1}}function D(y,m){return y===m||y!==y&&m!==m}function Ce(y,m){var b=y[m];if(b!=null){if(!Ct(b))throw new TypeError;return b}}function no(y){var m=Ce(y,a);if(!Ct(m))throw new TypeError;var b=m.call(y);if(!ae(b))throw new TypeError;return b}function Fu(y){return y.value}function qu(y){var m=y.next();return m.done?!1:m}function Ku(y){var m=y.return;m&&m.call(y)}function ka(y){var m=Object.getPrototypeOf(y);if(typeof y!="function"||y===h||m!==h)return m;var b=y.prototype,C=b&&Object.getPrototypeOf(b);if(C==null||C===Object.prototype)return m;var U=C.constructor;return typeof U!="function"||U===y?m:U}function kp(){var y;!M(X)&&typeof t.Reflect<"u"&&!(X in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(y=Bp(t.Reflect));var m,b,C,U=new te,de={registerProvider:be,getProvider:E,setProvider:P};return de;function be(R){if(!Object.isExtensible(de))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case y===R:break;case M(m):m=R;break;case m===R:break;case M(b):b=R;break;case b===R:break;default:C===void 0&&(C=new ne),C.add(R);break}}function z(R,J){if(!M(m)){if(m.isProviderFor(R,J))return m;if(!M(b)){if(b.isProviderFor(R,J))return m;if(!M(C))for(var ue=no(C);;){var pe=qu(ue);if(!pe)return;var rt=Fu(pe);if(rt.isProviderFor(R,J))return Ku(ue),rt}}}if(!M(y)&&y.isProviderFor(R,J))return y}function E(R,J){var ue=U.get(R),pe;return M(ue)||(pe=ue.get(J)),M(pe)&&(pe=z(R,J),M(pe)||(M(ue)&&(ue=new H,U.set(R,ue)),ue.set(J,pe))),pe}function _(R){if(M(R))throw new TypeError;return m===R||b===R||!M(C)&&C.has(R)}function P(R,J,ue){if(!_(ue))throw new Error("Metadata provider not registered.");var pe=E(R,J);if(pe!==ue){if(!M(pe))return!1;var rt=U.get(R);M(rt)&&(rt=new H,U.set(R,rt)),rt.set(J,ue)}return!0}}function Cp(){var y;return!M(X)&&ae(t.Reflect)&&Object.isExtensible(t.Reflect)&&(y=t.Reflect[X]),M(y)&&(y=kp()),!M(X)&&ae(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,X,{enumerable:!1,configurable:!1,writable:!1,value:y}),y}function xp(y){var m=new te,b={isProviderFor:function(_,P){var R=m.get(_);return M(R)?!1:R.has(P)},OrdinaryDefineOwnMetadata:be,OrdinaryHasOwnMetadata:U,OrdinaryGetOwnMetadata:de,OrdinaryOwnMetadataKeys:z,OrdinaryDeleteMetadata:E};return re.registerProvider(b),b;function C(_,P,R){var J=m.get(_),ue=!1;if(M(J)){if(!R)return;J=new H,m.set(_,J),ue=!0}var pe=J.get(P);if(M(pe)){if(!R)return;if(pe=new H,J.set(P,pe),!y.setProvider(_,P,b))throw J.delete(P),ue&&m.delete(_),new Error("Wrong provider for target.")}return pe}function U(_,P,R){var J=C(P,R,!1);return M(J)?!1:V(J.has(_))}function de(_,P,R){var J=C(P,R,!1);if(!M(J))return J.get(_)}function be(_,P,R,J){var ue=C(R,J,!0);ue.set(_,P)}function z(_,P){var R=[],J=C(_,P,!1);if(M(J))return R;for(var ue=J.keys(),pe=no(ue),rt=0;;){var Wu=qu(pe);if(!Wu)return R.length=rt,R;var Op=Fu(Wu);try{R[rt]=Op}catch(Tp){try{Ku(pe)}finally{throw Tp}}rt++}}function E(_,P,R){var J=C(P,R,!1);if(M(J)||!J.delete(_))return!1;if(J.size===0){var ue=m.get(P);M(ue)||(ue.delete(R),ue.size===0&&m.delete(ue))}return!0}}function Bp(y){var m=y.defineMetadata,b=y.hasOwnMetadata,C=y.getOwnMetadata,U=y.getOwnMetadataKeys,de=y.deleteMetadata,be=new te,z={isProviderFor:function(E,_){var P=be.get(E);return!M(P)&&P.has(_)?!0:U(E,_).length?(M(P)&&(P=new ne,be.set(E,P)),P.add(_),!0):!1},OrdinaryDefineOwnMetadata:m,OrdinaryHasOwnMetadata:b,OrdinaryGetOwnMetadata:C,OrdinaryOwnMetadataKeys:U,OrdinaryDeleteMetadata:de};return z}function mi(y,m,b){var C=re.getProvider(y,m);if(!M(C))return C;if(b){if(re.setProvider(y,m,ve))return ve;throw new Error("Illegal state.")}}function Ep(){var y={},m=[],b=function(){function z(E,_,P){this._index=0,this._keys=E,this._values=_,this._selector=P}return z.prototype["@@iterator"]=function(){return this},z.prototype[a]=function(){return this},z.prototype.next=function(){var E=this._index;if(E>=0&&E<this._keys.length){var _=this._selector(this._keys[E],this._values[E]);return E+1>=this._keys.length?(this._index=-1,this._keys=m,this._values=m):this._index++,{value:_,done:!1}}return{value:void 0,done:!0}},z.prototype.throw=function(E){throw this._index>=0&&(this._index=-1,this._keys=m,this._values=m),E},z.prototype.return=function(E){return this._index>=0&&(this._index=-1,this._keys=m,this._values=m),{value:E,done:!0}},z}(),C=function(){function z(){this._keys=[],this._values=[],this._cacheKey=y,this._cacheIndex=-2}return Object.defineProperty(z.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),z.prototype.has=function(E){return this._find(E,!1)>=0},z.prototype.get=function(E){var _=this._find(E,!1);return _>=0?this._values[_]:void 0},z.prototype.set=function(E,_){var P=this._find(E,!0);return this._values[P]=_,this},z.prototype.delete=function(E){var _=this._find(E,!1);if(_>=0){for(var P=this._keys.length,R=_+1;R<P;R++)this._keys[R-1]=this._keys[R],this._values[R-1]=this._values[R];return this._keys.length--,this._values.length--,D(E,this._cacheKey)&&(this._cacheKey=y,this._cacheIndex=-2),!0}return!1},z.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=y,this._cacheIndex=-2},z.prototype.keys=function(){return new b(this._keys,this._values,U)},z.prototype.values=function(){return new b(this._keys,this._values,de)},z.prototype.entries=function(){return new b(this._keys,this._values,be)},z.prototype["@@iterator"]=function(){return this.entries()},z.prototype[a]=function(){return this.entries()},z.prototype._find=function(E,_){if(!D(this._cacheKey,E)){this._cacheIndex=-1;for(var P=0;P<this._keys.length;P++)if(D(this._keys[P],E)){this._cacheIndex=P;break}}return this._cacheIndex<0&&_&&(this._cacheIndex=this._keys.length,this._keys.push(E),this._values.push(void 0)),this._cacheIndex},z}();return C;function U(z,E){return z}function de(z,E){return E}function be(z,E){return[z,E]}}function Np(){var y=function(){function m(){this._map=new H}return Object.defineProperty(m.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),m.prototype.has=function(b){return this._map.has(b)},m.prototype.add=function(b){return this._map.set(b,b),this},m.prototype.delete=function(b){return this._map.delete(b)},m.prototype.clear=function(){this._map.clear()},m.prototype.keys=function(){return this._map.keys()},m.prototype.values=function(){return this._map.keys()},m.prototype.entries=function(){return this._map.entries()},m.prototype["@@iterator"]=function(){return this.keys()},m.prototype[a]=function(){return this.keys()},m}();return y}function Ip(){var y=16,m=g.create(),b=C();return function(){function E(){this._key=C()}return E.prototype.has=function(_){var P=U(_,!1);return P!==void 0?g.has(P,this._key):!1},E.prototype.get=function(_){var P=U(_,!1);return P!==void 0?g.get(P,this._key):void 0},E.prototype.set=function(_,P){var R=U(_,!0);return R[this._key]=P,this},E.prototype.delete=function(_){var P=U(_,!1);return P!==void 0?delete P[this._key]:!1},E.prototype.clear=function(){this._key=C()},E}();function C(){var E;do E="@@WeakMap@@"+z();while(g.has(m,E));return m[E]=!0,E}function U(E,_){if(!i.call(E,b)){if(!_)return;Object.defineProperty(E,b,{value:g.create()})}return E[b]}function de(E,_){for(var P=0;P<_;++P)E[P]=Math.random()*255|0;return E}function be(E){if(typeof Uint8Array=="function"){var _=new Uint8Array(E);return typeof crypto<"u"?crypto.getRandomValues(_):typeof msCrypto<"u"?msCrypto.getRandomValues(_):de(_,E),_}return de(new Array(E),E)}function z(){var E=be(y);E[6]=E[6]&79|64,E[8]=E[8]&191|128;for(var _="",P=0;P<y;++P){var R=E[P];(P===4||P===6||P===8)&&(_+="-"),R<16&&(_+="0"),_+=R.toString(16).toLowerCase()}return _}}function Ca(y){return y.__=void 0,delete y.__,y}})})(Ea||(Ea={}));/*!
|
|
15
15
|
* MIT License
|
|
16
16
|
*
|
|
17
17
|
* Copyright (c) 2017-2024 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
|
|
37
|
+
*/const zu="[object ArrayBuffer]";class x{static isArrayBuffer(e){return Object.prototype.toString.call(e)===zu}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=x.toUint8Array(e),n=x.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 a of t)i+=a.byteLength;const n=new Uint8Array(i);let s=0;for(const a of t){const u=this.toUint8Array(a);n.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}}const oo="string",Ju=/^[0-9a-f\s]+$/i,Yu=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Zu=/^[a-zA-Z0-9-_]+$/;class Na{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=x.toUint8Array(e);let i="";for(let s=0;s<t.length;s++)i+=String.fromCharCode(t[s]);return decodeURIComponent(escape(i))}}class it{static toString(e,t=!1){const i=x.toArrayBuffer(e),n=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const u=n.getUint16(a,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 j{static isHex(e){return typeof e===oo&&Ju.test(e)}static isBase64(e){return typeof e===oo&&Yu.test(e)}static isBase64Url(e){return typeof e===oo&&Zu.test(e)}static ToString(e,t="utf8"){const i=x.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 it.toString(i,!0);case"utf16":case"utf16be":return it.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 it.fromString(e,!0);case"utf16":case"utf16be":return it.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){const t=x.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(!j.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(!j.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=j.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Na.fromString(e);case"utf16":case"utf16be":return it.fromString(e);case"utf16le":case"usc2":return it.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=j.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Na.toString(e);case"utf16":case"utf16be":return it.toString(e);case"utf16le":case"usc2":return it.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=x.toUint8Array(e);let i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){const t=x.toUint8Array(e);let i="";const n=t.length;for(let s=0;s<n;s++){const a=t[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!j.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 it.toString(e,t)}static FromUtf16String(e,t=!1){return it.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,""))||""}}j.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 Ia(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
|
|
39
|
+
*/function nr(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 Dt(r,e,t=-1){const i=t;let n=r,s=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){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 d=new Uint8Array(f);for(let g=u-1;g>=0;g--){const h=Math.pow(2,g*e);d[s-g-1]=Math.floor(n/h),n-=d[s-g-1]*h}return f}a*=Math.pow(2,e)}return new ArrayBuffer(0)}function so(...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 Oa(){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=nr(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,nr(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 a=t-e,u=Dt(a,8,i),f=new Uint8Array(u);return f[0]|=128,u}let n=Dt(e,8,i),s=new Uint8Array(n);if(s[0]&128){const a=n.slice(0),u=new Uint8Array(a);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let f=0;f<a.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 He(r,e){const t=r.toString(10);if(e<t.length)return"";const i=e-t.length,n=new Array(i);for(let a=0;a<i;a++)n[a]="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,26 +68,26 @@
|
|
|
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 bi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function oo(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 pt(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 vi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return oo(this.items)}}const Vr=[new Uint8Array([1])],Ta="0123456789",so="name",_a="valueHexView",of="isHexOnly",sf="idBlock",af="tagClass",cf="tagNumber",lf="isConstructed",uf="fromBER",ff="toBER",df="local",je="",ze=new ArrayBuffer(0),wi=new Uint8Array(0),jr="EndOfContent",Va="OCTET STRING",ja="BIT STRING";function nt(r){var e;return e=class extends r{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?x.toUint8Array(s.valueHex):wi}fromBER(i,n,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!pt(this,a,n,s))return-1;const u=n+s;return this.valueHexView=a.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:j.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Rt{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=je,warnings:i=[],valueBeforeDecode:n=wi}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=x.toUint8Array(n)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:j.ToHex(this.valueBeforeDecodeView)}}}Rt.NAME="baseBlock";class Oe 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'")}}Oe.NAME="valueBlock";class Pa extends nt(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?x.toUint8Array(e.valueHex):wi,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=Pt(this.tagNumber,7),s=new Uint8Array(n),a=n.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let f=0;f<a-1;f++)u[f+1]=s[f]|128;u[a]=s[a-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=x.toUint8Array(e);if(!pt(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,d=this.valueHexView=new Uint8Array(255),g=255;for(;s[f]&128;){if(d[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===g){g+=255;const H=new Uint8Array(g);for(let ne=0;ne<d.length;ne++)H[ne]=d[ne];d=this.valueHexView=new Uint8Array(g)}}this.blockLength=f+1,d[f-1]=s[f]&127;const h=new Uint8Array(f);for(let H=0;H<f;H++)h[H]=d[H];d=this.valueHexView=new Uint8Array(f),d.set(h),this.blockLength<=9?this.tagNumber=rr(d,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}}}Pa.NAME="identificationBlock";class Ra 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=x.toUint8Array(e);if(!pt(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 a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+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+a);return f[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=rr(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,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",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 a=0;a<n.byteLength;a++)i[a+1]=s[a];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}}}Ra.NAME="lengthBlock";const N={};class Se extends Rt{constructor({name:e=je,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new Pa(n),this.lenBlock=new Ra(n),this.valueBlock=s?new s(n):new Oe(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 vi;t||Da(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 a=this.lenBlock.toBER(e);i.write(a),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():j.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,t=j.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return nf(t,i)}}Se.NAME="BaseBlock";function Da(r){var e;if(r instanceof N.Constructed)for(const t of r.valueBlock.value)Da(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class ao extends Se{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=je,...t}={},i){super(t,i),e&&this.fromString(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}'`}}ao.NAME="BaseStringBlock";class Ma extends nt(Oe){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}Ma.NAME="PrimitiveValueBlock";var Ua;class Pr extends Se{constructor(e={}){super(e,Ma),this.idBlock.isConstructed=!1}}Ua=Pr,N.Primitive=Ua,Pr.NAME="PRIMITIVE";function pf(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 ir(r,e=0,t=r.length){const i=e;let n=new Se({},Oe);const s=new Rt;if(!pt(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=Se;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=N.EndOfContent;break;case 1:f=N.Boolean;break;case 2:f=N.Integer;break;case 3:f=N.BitString;break;case 4:f=N.OctetString;break;case 5:f=N.Null;break;case 6:f=N.ObjectIdentifier;break;case 10:f=N.Enumerated;break;case 12:f=N.Utf8String;break;case 13:f=N.RelativeObjectIdentifier;break;case 14:f=N.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=N.Sequence;break;case 17:f=N.Set;break;case 18:f=N.NumericString;break;case 19:f=N.PrintableString;break;case 20:f=N.TeletexString;break;case 21:f=N.VideotexString;break;case 22:f=N.IA5String;break;case 23:f=N.UTCTime;break;case 24:f=N.GeneralizedTime;break;case 25:f=N.GraphicString;break;case 26:f=N.VisibleString;break;case 27:f=N.GeneralString;break;case 28:f=N.UniversalString;break;case 29:f=N.CharacterString;break;case 30:f=N.BmpString;break;case 31:f=N.DATE;break;case 32:f=N.TimeOfDay;break;case 33:f=N.DateTime;break;case 34:f=N.Duration;break;default:{const d=n.idBlock.isConstructed?new N.Constructed:new N.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?N.Constructed:N.Primitive}return n=pf(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 nr(r){if(!r.byteLength){const e=new Se({},Oe);return e.error="Input buffer has zero length",{offset:-1,result:e}}return ir(x.toUint8Array(r).slice(),0,r.byteLength)}function hf(r,e){return r?1:e}class Ct extends Oe{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=x.toUint8Array(e);if(!pt(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(;hf(this.isIndefiniteForm,i)>0;){const a=ir(n,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===jr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===jr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new vi;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}}Ct.NAME="ConstructedValueBlock";var $a;class Te extends Se{constructor(e={}){super(e,Ct),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 vi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function ao(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 pt(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 wi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return ao(this.items)}}const Pr=[new Uint8Array([1])],Ta="0123456789",co="name",_a="valueHexView",tf="isHexOnly",rf="idBlock",nf="tagClass",of="tagNumber",sf="isConstructed",af="fromBER",cf="toBER",lf="local",Pe="",Je=new ArrayBuffer(0),Si=new Uint8Array(0),Rr="EndOfContent",Va="OCTET STRING",ja="BIT STRING";function nt(r){var e;return e=class extends r{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?x.toUint8Array(s.valueHex):Si}fromBER(i,n,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!pt(this,a,n,s))return-1;const u=n+s;return this.valueHexView=a.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:j.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Mt{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Pe,warnings:i=[],valueBeforeDecode:n=Si}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=x.toUint8Array(n)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:j.ToHex(this.valueBeforeDecodeView)}}}Mt.NAME="baseBlock";class Oe extends Mt{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'")}}Oe.NAME="valueBlock";class Pa extends nt(Mt){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?x.toUint8Array(e.valueHex):Si,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=Dt(this.tagNumber,7),s=new Uint8Array(n),a=n.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let f=0;f<a-1;f++)u[f+1]=s[f]|128;u[a]=s[a-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=x.toUint8Array(e);if(!pt(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,d=this.valueHexView=new Uint8Array(255),g=255;for(;s[f]&128;){if(d[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===g){g+=255;const H=new Uint8Array(g);for(let ne=0;ne<d.length;ne++)H[ne]=d[ne];d=this.valueHexView=new Uint8Array(g)}}this.blockLength=f+1,d[f-1]=s[f]&127;const h=new Uint8Array(f);for(let H=0;H<f;H++)h[H]=d[H];d=this.valueHexView=new Uint8Array(f),d.set(h),this.blockLength<=9?this.tagNumber=nr(d,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}}}Pa.NAME="identificationBlock";class Ra extends Mt{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=x.toUint8Array(e);if(!pt(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 a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+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+a);return f[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=nr(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,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=Dt(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 a=0;a<n.byteLength;a++)i[a+1]=s[a];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}}}Ra.NAME="lengthBlock";const I={};class we extends Mt{constructor({name:e=Pe,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new Pa(n),this.lenBlock=new Ra(n),this.valueBlock=s?new s(n):new Oe(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 wi;t||Da(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 a=this.lenBlock.toBER(e);i.write(a),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():j.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,t=j.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}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)}}we.NAME="BaseBlock";function Da(r){var e;if(r instanceof I.Constructed)for(const t of r.valueBlock.value)Da(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class lo extends we{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Pe,...t}={},i){super(t,i),e&&this.fromString(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}'`}}lo.NAME="BaseStringBlock";class Ma extends nt(Oe){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}Ma.NAME="PrimitiveValueBlock";var Ua;class Dr extends we{constructor(e={}){super(e,Ma),this.idBlock.isConstructed=!1}}Ua=Dr,I.Primitive=Ua,Dr.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 or(r,e=0,t=r.length){const i=e;let n=new we({},Oe);const s=new Mt;if(!pt(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=we;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=I.EndOfContent;break;case 1:f=I.Boolean;break;case 2:f=I.Integer;break;case 3:f=I.BitString;break;case 4:f=I.OctetString;break;case 5:f=I.Null;break;case 6:f=I.ObjectIdentifier;break;case 10:f=I.Enumerated;break;case 12:f=I.Utf8String;break;case 13:f=I.RelativeObjectIdentifier;break;case 14:f=I.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=I.Sequence;break;case 17:f=I.Set;break;case 18:f=I.NumericString;break;case 19:f=I.PrintableString;break;case 20:f=I.TeletexString;break;case 21:f=I.VideotexString;break;case 22:f=I.IA5String;break;case 23:f=I.UTCTime;break;case 24:f=I.GeneralizedTime;break;case 25:f=I.GraphicString;break;case 26:f=I.VisibleString;break;case 27:f=I.GeneralString;break;case 28:f=I.UniversalString;break;case 29:f=I.CharacterString;break;case 30:f=I.BmpString;break;case 31:f=I.DATE;break;case 32:f=I.TimeOfDay;break;case 33:f=I.DateTime;break;case 34:f=I.Duration;break;default:{const d=n.idBlock.isConstructed?new I.Constructed:new I.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?I.Constructed:I.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 sr(r){if(!r.byteLength){const e=new we({},Oe);return e.error="Input buffer has zero length",{offset:-1,result:e}}return or(x.toUint8Array(r).slice(),0,r.byteLength)}function ff(r,e){return r?1:e}class xt extends Oe{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=x.toUint8Array(e);if(!pt(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 a=or(n,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Rr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Rr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new wi;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}}xt.NAME="ConstructedValueBlock";var $a;class Te extends we{constructor(e={}){super(e,xt),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} :`}}$a=Te,N.Constructed=$a,Te.NAME="CONSTRUCTED";class Ha extends Oe{fromBER(e,t,i){return t}toBER(e){return ze}}Ha.override="EndOfContentValueBlock";var La;class co extends Se{constructor(e={}){super(e,Ha),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}La=co,N.EndOfContent=La,co.NAME=jr;var Fa;class Dt extends Se{constructor(e={}){super(e,Oe),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}`}}Fa=Dt,N.Null=Fa,Dt.NAME="NULL";class qa extends nt(Oe){get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=x.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,i){const n=x.toUint8Array(e);return pt(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,Oa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}qa.NAME="BooleanValueBlock";var Ka;let Ai=class extends Se{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Ka=Ai,N.Boolean=Ka,Ai.NAME="BOOLEAN";class Wa extends nt(Ct){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=Ct.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Va)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?Ct.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Wa.NAME="OctetStringValueBlock";var lo;let Mt=class extends Se{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},Wa),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 a=ir(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return 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=this.constructor.NAME,t=j.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof lo&&e.push(t.valueBlock.valueHexView);return x.concat(e)}};lo=Mt,N.OctetString=lo,Mt.NAME=Va;class Ga extends nt(Ct){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=Ct.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==ja)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=u.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return n}const s=x.toUint8Array(e);if(!pt(this,s,t,i))return-1;const a=s.subarray(t,t+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=a.subarray(1);try{if(u.byteLength){const f=ir(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,t+i}toBER(e,t){if(this.isConstructed)return Ct.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}}}Ga.NAME="BitStringValueBlock";var za;let Ut=class extends Se{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},Ga),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 a of t)e.push(a.toString(2).padStart(8,"0"));const i=e.join(""),n=this.constructor.NAME,s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${n} : ${s}`}}};za=Ut,N.BitString=za,Ut.NAME=ja;var Ja;function yf(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const a=s.length-1,u=n.slice(0),f=u.length-1;let d=0;const g=f<a?a:f;let h=0;for(let H=g;H>=0;H--,h++){switch(!0){case h<u.length:d=s[a-h]+u[f-h]+t[0];break;default:d=s[a-h]+t[0]}switch(t[0]=d/10,!0){case h>=s.length:s=no(new Uint8Array([d%10]),s);break;default:s[a-h]=d%10}}return t[0]>0&&(s=no(t,s)),s}function Ya(r){if(r>=Vr.length)for(let e=Vr.length;e<=r;e++){const t=new Uint8Array([0]);let i=Vr[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=no(t,i)),Vr.push(i)}return Vr[r]}function gf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),a=s.length-1,u=n.slice(0),f=u.length-1;let d,g=0;for(let h=f;h>=0;h--,g++)switch(d=s[a-g]-u[f-g]-t,!0){case d<0:t=1,s[a-g]=d+10;break;default:t=0,s[a-g]=d}if(t>0)for(let h=a-f+1;h>=0;h--,g++)if(d=s[a-g]-t,d<0)t=1,s[a-g]=d+10;else{t=0,s[a-g]=d;break}return s.slice()}class uo extends nt(Oe){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=Oa.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(rf(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 a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):n!==0&&a.length<n&&(n-a.length>1&&(n=a.length+1),this.valueHexView=a.subarray(n-a.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 a="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case e:t=gf(Ya(i),t),a="-";break;default:t=yf(t,Ya(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(a+=Ta.charAt(t[f]));return u===!1&&(a+=Ta.charAt(0)),a}}Ja=uo,uo.NAME="IntegerValueBlock",Object.defineProperty(Ja.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Rr;class or extends Se{constructor(e={}){super(e,uo),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return bi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){bi();const t=BigInt(e),i=new vi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(j.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const d=BigInt(`0x${j.ToHex(u)}`)+t,g=x.toUint8Array(j.FromHex(d.toString(16)));g[0]|=128,i.write(g)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new Rr({valueHex:i.final()})}convertToDER(){const e=new Rr({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Rr({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Rr=or,N.Integer=Rr,or.NAME="INTEGER";var Za;class Si extends or{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Za=Si,N.Enumerated=Za,Si.NAME="ENUMERATED";class fo extends nt(Oe){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=x.toUint8Array(e);if(!pt(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 a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,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=rr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){bi();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 a=0;a<this.blockLength-1;a++)s[a]=n[a]|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",ze;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=j.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}}}fo.NAME="sidBlock";class Qa extends Oe{constructor({value:e=je,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new fo;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 oo(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 a=this.value[0];let u=0;switch(a.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;a.valueDec=f+u,s=!1}else{const a=new fo;if(n>Number.MAX_SAFE_INTEGER){bi();const u=BigInt(n);a.valueBigInt=u}else if(a.valueDec=parseInt(n,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}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}}Qa.NAME="ObjectIdentifierValueBlock";var Xa;class ki extends Se{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Xa=ki,N.ObjectIdentifier=Xa,ki.NAME="OBJECT IDENTIFIER";class po extends nt(Rt){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=x.toUint8Array(e);if(!pt(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 a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,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=rr(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 a=0;a<this.blockLength-1;a++)s[a]=n[a]|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",ze;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=j.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}po.NAME="relativeSidBlock";class ec extends Oe{constructor({value:e=je,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new po;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 oo(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 po;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}}ec.NAME="RelativeObjectIdentifierValueBlock";var tc;class ho extends Se{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,ec),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}tc=ho,N.RelativeObjectIdentifier=tc,ho.NAME="RelativeObjectIdentifier";var rc;class Je extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}rc=Je,N.Sequence=rc,Je.NAME="SEQUENCE";var ic;let ot=class extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};ic=ot,N.Set=ic,ot.NAME="SET";class nc extends nt(Oe){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=je}toJSON(){return{...super.toJSON(),value:this.value}}}nc.NAME="StringValueBlock";class oc extends nc{}oc.NAME="SimpleStringValueBlock";class He extends ao{constructor({...e}={}){super(e,oc)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,x.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}}He.NAME="SIMPLE STRING";class sc extends He{fromBuffer(e){this.valueBlock.valueHexView=x.toUint8Array(e);try{this.valueBlock.value=j.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=j.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(j.FromUtf8String(e)),this.valueBlock.value=e}}sc.NAME="Utf8StringValueBlock";var ac;class ht extends sc{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ac=ht,N.Utf8String=ac,ht.NAME="UTF8String";class cc extends He{fromBuffer(e){this.valueBlock.value=j.ToUtf16String(e),this.valueBlock.valueHexView=x.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(j.FromUtf16String(e))}}cc.NAME="BmpStringValueBlock";var lc;class Ci extends cc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}lc=Ci,N.BmpString=lc,Ci.NAME="BMPString";class uc extends He{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),a=new Uint8Array(s);if(a.length>4)continue;const u=4-a.length;for(let f=a.length-1;f>=0;f--)i[n*4+f+u]=a[f]}this.valueBlock.value=e}}uc.NAME="UniversalStringValueBlock";var fc;class xi extends uc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}fc=xi,N.UniversalString=fc,xi.NAME="UniversalString";var dc;class Bi extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}dc=Bi,N.NumericString=dc,Bi.NAME="NumericString";var pc;class Ei extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}pc=Ei,N.PrintableString=pc,Ei.NAME="PrintableString";var hc;class Ii extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}hc=Ii,N.TeletexString=hc,Ii.NAME="TeletexString";var yc;class Ni extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}yc=Ni,N.VideotexString=yc,Ni.NAME="VideotexString";var gc;class Oi extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}gc=Oi,N.IA5String=gc,Oi.NAME="IA5String";var mc;class Ti extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}mc=Ti,N.GraphicString=mc,Ti.NAME="GraphicString";var bc;class Dr extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}bc=Dr,N.VisibleString=bc,Dr.NAME="VisibleString";var vc;class _i extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}vc=_i,N.GeneralString=vc,_i.NAME="GeneralString";var wc;class Vi extends He{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}wc=Vi,N.CharacterString=wc,Vi.NAME="CharacterString";var Ac;class Mr extends Dr{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,x.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]=$e(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=$e(this.month,2),t[2]=$e(this.day,2),t[3]=$e(this.hour,2),t[4]=$e(this.minute,2),t[5]=$e(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}}}Ac=Mr,N.UTCTime=Ac,Mr.NAME="UTCTime";var Sc;class ji extends Mr{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(){const e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,i="",n="",s=0,a,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const h=new Number(e[e.length-1]);if(isNaN(h.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 h=1,H=i.indexOf("+"),ne="";if(H===-1&&(H=i.indexOf("-"),h=-1),H!==-1){if(ne=i.substring(H+1),i=i.substring(0,H),ne.length!==2&&ne.length!==4)throw new Error("Wrong input string for conversion");let te=parseInt(ne.substring(0,2),10);if(isNaN(te.valueOf()))throw new Error("Wrong input string for conversion");if(u=h*te,ne.length===4){if(te=parseInt(ne.substring(2,4),10),isNaN(te.valueOf()))throw new Error("Wrong input string for conversion");f=h*te}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const h=new Number(`0${i.substring(d)}`);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");s=h.valueOf(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let h=60*s;this.minute=Math.floor(h),h=60*(h-this.minute),this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let h=60*s;this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const h=1e3*s;this.millisecond=Math.floor(h)}break;default:throw new Error("Wrong input string for conversion")}const g=a.exec(n);if(g===null)throw new Error("Wrong input string for conversion");for(let h=1;h<g.length;h++)switch(h){case 1:this.year=parseInt(g[h],10);break;case 2:this.month=parseInt(g[h],10);break;case 3:this.day=parseInt(g[h],10);break;case 4:this.hour=parseInt(g[h],10)+u;break;case 5:this.minute=parseInt(g[h],10)+f;break;case 6:this.second=parseInt(g[h],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const h=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=h.getUTCFullYear(),this.month=h.getUTCMonth(),this.day=h.getUTCDay(),this.hour=h.getUTCHours(),this.minute=h.getUTCMinutes(),this.second=h.getUTCSeconds(),this.millisecond=h.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push($e(this.year,4)),t.push($e(this.month,2)),t.push($e(this.day,2)),t.push($e(this.hour,2)),t.push($e(this.minute,2)),t.push($e(this.second,2)),this.millisecond!==0&&(t.push("."),t.push($e(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Sc=ji,N.GeneralizedTime=Sc,ji.NAME="GeneralizedTime";var kc;class yo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}kc=yo,N.DATE=kc,yo.NAME="DATE";var Cc;class go extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Cc=go,N.TimeOfDay=Cc,go.NAME="TimeOfDay";var xc;class mo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}xc=mo,N.DateTime=xc,mo.NAME="DateTime";var Bc;class bo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Bc=bo,N.Duration=Bc,bo.NAME="Duration";var Ec;class vo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Ec=vo,N.TIME=Ec,vo.NAME="TIME";class $t{constructor({name:e=je,optional:t=!1}={}){this.name=e,this.optional=t}}class wo extends $t{constructor({value:e=[],...t}={}){super(t),this.value=e}}class Pi extends $t{constructor({value:e=new $t,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class mf{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=x.toUint8Array(e)}constructor({data:e=wi}={}){this.dataView=x.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=x.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function xt(r,e,t){if(t instanceof wo){for(const s of t.value)if(xt(r,e,s).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(so)&&(s.name=t.name),s}}if(t instanceof $t)return t.hasOwnProperty(so)&&(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(!(sf in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(uf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ff 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(af)===!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(cf)===!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(lf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(of 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(!(_a in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,a=e.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==a[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,je),t.name&&(r[t.name]=e)),t instanceof N.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof Pi&&(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 d=0;d<t.valueBlock.value.length;d++)f=f&&(t.valueBlock.value[d].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,je),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 d={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,je),t.name&&(delete r[t.name],d.name=t.name)),d}}else if(t.valueBlock.value[0]instanceof Pi){if(a=xt(r,e.valueBlock.value[f],t.valueBlock.value[0].value),a.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,je),t.name&&delete r[t.name]),a;if(so in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let d={};df in t.valueBlock.value[0]&&t.valueBlock.value[0].local?d=e:d=r,typeof d[t.valueBlock.value[0].name]>"u"&&(d[t.valueBlock.value[0].name]=[]),d[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(a=xt(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),a.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,je),t.name&&delete r[t.name]),a;if(a.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,je),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&_a in e.valueBlock){const s=ir(e.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,je),t.name&&(delete r[t.name],a.name=t.name)),a}return xt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function bf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=ir(x.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:xt(t.result,t.result,e)}const Ic=Object.freeze(Object.defineProperty({__proto__:null,Any:$t,BaseBlock:Se,BaseStringBlock:ao,BitString:Ut,BmpString:Ci,Boolean:Ai,CharacterString:Vi,Choice:wo,Constructed:Te,DATE:yo,DateTime:mo,Duration:bo,EndOfContent:co,Enumerated:Si,GeneralString:_i,GeneralizedTime:ji,GraphicString:Ti,HexBlock:nt,IA5String:Oi,Integer:or,Null:Dt,NumericString:Bi,ObjectIdentifier:ki,OctetString:Mt,Primitive:Pr,PrintableString:Ei,RawData:mf,RelativeObjectIdentifier:ho,Repeated:Pi,Sequence:Je,Set:ot,TIME:vo,TeletexString:Ii,TimeOfDay:go,UTCTime:Mr,UniversalString:xi,Utf8String:ht,ValueBlock:Oe,VideotexString:Ni,ViewWriter:vi,VisibleString:Dr,compareSchema:xt,fromBER:nr,verifySchema:bf},Symbol.toStringTag,{value:"Module"}));var v;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(v||(v={}));var p;(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"})(p||(p={}));class Ri{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(x.isBufferSource(e))this.unusedBits=t,this.value=x.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Ut))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 Ut({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ut({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 Y{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):x.isBufferSource(e)?this.buffer=x.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Mt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new Mt({valueHex:this.buffer})}toSchema(e){return new Mt({name:e})}}const vf={fromASN:r=>r instanceof Dt?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Dt;const e=nr(r);if(e.result.error)throw new Error(e.result.error);return e.result}},wf={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new or({value:+r})},Af={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new Si({value:r})},le={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new or({valueHex:r})},Sf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ut({valueHex:r})},kf={fromASN:r=>r.valueBlock.toString(),toASN:r=>new ki({value:r})},Cf={fromASN:r=>r.valueBlock.value,toASN:r=>new Ai({value:r})},Di={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Mt({valueHex:r})},xf={fromASN:r=>new Y(r.getValue()),toASN:r=>r.toASN()};function Ke(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Nc=Ke(ht),Bf=Ke(Ci),Ef=Ke(xi),If=Ke(Bi),Nf=Ke(Ei),Of=Ke(Ii),Tf=Ke(Ni),_f=Ke(Oi),Vf=Ke(Ti),jf=Ke(Dr),Pf=Ke(_i),Rf=Ke(Vi),Df={fromASN:r=>r.toDate(),toASN:r=>new Mr({valueDate:r})},Mf={fromASN:r=>r.toDate(),toASN:r=>new ji({valueDate:r})},Uf={fromASN:()=>null,toASN:()=>new Dt};function Ur(r){switch(r){case p.Any:return vf;case p.BitString:return Sf;case p.BmpString:return Bf;case p.Boolean:return Cf;case p.CharacterString:return Rf;case p.Enumerated:return Af;case p.GeneralString:return Pf;case p.GeneralizedTime:return Mf;case p.GraphicString:return Vf;case p.IA5String:return _f;case p.Integer:return wf;case p.Null:return Uf;case p.NumericString:return If;case p.ObjectIdentifier:return kf;case p.OctetString:return Di;case p.PrintableString:return Nf;case p.TeletexString:return Of;case p.UTCTime:return Df;case p.UniversalString:return Ef;case p.Utf8String:return Nc;case p.VideotexString:return Tf;case p.VisibleString:return jf;default:return null}}function yt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:yt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function Oc(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:Oc(t)}return!1}function $f(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:v.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 a=i.items[s],u=t?s:"";let f;if(typeof a.type=="number"){const g=p[a.type],h=Ic[g];if(!h)throw new Error(`Cannot get ASN1 class by name '${g}'`);f=new h({name:u})}else yt(a.type)?f=new a.type().toSchema(u):a.optional?this.get(a.type).type===v.Choice?f=new $t({name:u}):(f=this.create(a.type,!1),f.name=u):f=new $t({name:u});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){f.name="";const g=a.repeated==="set"?ot:Je;f=new g({name:"",value:[new Pi({name:u,value:f})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||yt(a.type)){const g=a.repeated?Te:Pr;n.push(new g({name:u,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const g=!!a.repeated;let h=g?f:this.get(a.type,!0).schema;h="valueBlock"in h?h.valueBlock.value:h.value,n.push(new Te({name:g?"":u,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:h}))}else n.push(new Te({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[f]}));else f.optional=d,n.push(f)}switch(i.type){case v.Sequence:return new Je({value:n,name:""});case v.Set:return new ot({value:n,name:""});case v.Choice:return new wo({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 ye=new Hf,A=r=>e=>{let t;ye.has(e)?t=ye.get(e):(t=ye.createDefault(e),ye.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;ye.has(e.constructor)?i=ye.get(e.constructor):(i=ye.createDefault(e.constructor),ye.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=Ur(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 $r extends Error{constructor(){super(...arguments),this.schemas=[]}}class Lf{static parse(e,t){const i=nr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){try{if(yt(t))return new t().fromASN(e);const i=ye.get(t);ye.cache(t);let n=i.schema;const s=this.handleChoiceTypes(e,i,t,n);if(s!=null&&s.result)return s.result;s!=null&&s.targetSchema&&(n=s.targetSchema);const a=this.handleSequenceTypes(e,i,t,n);if(a&&"isManualMapping"in a)return a.result;const u=a,f=new t;return Oc(t)?this.handleArrayTypes(e,i,t):(this.processSchemaItems(i,u,f),f)}catch(i){throw i instanceof $r&&i.schemas.push(t.name),i}}static handleChoiceTypes(e,t,i,n){if(e.constructor===Te&&t.type===v.Choice&&e.idBlock.tagClass===3)for(const s in t.items){const a=t.items[s];if(a.context===e.idBlock.tagNumber&&a.implicit&&typeof a.type=="function"&&ye.has(a.type)){const u=ye.get(a.type);if(u&&u.type===v.Sequence){const f=new Je;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in f.valueBlock){f.valueBlock.value=e.valueBlock.value;const d=this.fromASN(f,a.type),g=new i;return g[s]=d,{result:g}}}}}else if(e.constructor===Te&&t.type!==v.Choice){const s=new Te({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(const a in t.items)delete e[a];return{targetSchema:s}}return null}static handleSequenceTypes(e,t,i,n){if(t.type===v.Sequence){if(Object.keys(t.items).filter(u=>{const f=t.items[u];return f.optional&&typeof f.type=="function"&&ye.has(f.type)&&ye.get(f.type).type===v.Choice}).length>0&&"value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&i.name==="CertReqMsg")return this.handleManualMapping(e,t,i);const a=xt({},e,n);if(!a.verified)throw new $r(`Data does not match to ${i.name} ASN1 schema. ${a.result.error}`);return a}else{const s=xt({},e,n);if(!s.verified)throw new $r(`Data does not match to ${i.name} ASN1 schema. ${s.result.error}`);return s}}static handleManualMapping(e,t,i){const n=new i,s=e.valueBlock.value,a=Object.keys(t.items);let u=0;for(let f=0;f<a.length;f++){const d=a[f],g=t.items[d];if(u>=s.length)break;if(g.repeated){n[d]=this.processRepeatedField(s,u,g);break}else if(typeof g.type=="number")n[d]=this.processPrimitiveField(s[u],g),u++;else if(this.isOptionalChoiceField(g)){const h=this.processOptionalChoiceField(s[u],g);h.processed&&(n[d]=h.value,u++)}else n[d]=this.fromASN(s[u],g.type),u++}return{result:n,verified:!0,isManualMapping:!0}}static processRepeatedField(e,t,i){let n=e.slice(t);if(n.length===1&&n[0].constructor.name==="Sequence"){const s=n[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(n=s.valueBlock.value)}if(typeof i.type=="number"){const s=Ur(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(a=>a&&a.valueBlock).map(a=>{try{return s.fromASN(a)}catch{return}}).filter(a=>a!==void 0)}else return n.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,i.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,t){const i=Ur(t.type);if(!i)throw new Error(`No converter for ASN.1 type ${t.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&ye.has(e.type)&&ye.get(e.type).type===v.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(i){if(i instanceof $r&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,t,i){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const n=t.itemType;if(typeof n=="number"){const s=Ur(n);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,a=>s.fromASN(a))}else return i.from(e.valueBlock.value,s=>this.fromASN(s,n))}static processSchemaItems(e,t,i){for(const n in e.items){const s=t.result[n];if(!s)continue;const a=e.items[n],u=a.type;typeof u=="number"||yt(u)?i[n]=this.processPrimitiveSchemaItem(s,a,u):i[n]=this.processComplexSchemaItem(s,a,u)}}static processPrimitiveSchemaItem(e,t,i){var n;const s=(n=t.converter)!==null&&n!==void 0?n:yt(i)?new i:null;if(!s)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,s):this.processSinglePrimitiveItem(e,t,i,s)}static processRepeatedPrimitiveItem(e,t,i){if(t.implicit){const n=t.repeated==="sequence"?Je:ot,s=new n;s.valueBlock=e.valueBlock;const a=nr(s.toBER(!1));if(a.offset===-1)throw new Error(`Cannot parse the child item. ${a.result.error}`);if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const u=a.result.valueBlock.value;return Array.from(u,f=>i.fromASN(f))}else return Array.from(e,n=>i.fromASN(n))}static processSinglePrimitiveItem(e,t,i,n){let s=e;if(t.implicit){let a;if(yt(i))a=new i().toSchema("");else{const u=p[i],f=Ic[u];if(!f)throw new Error(`Cannot get '${u}' class from asn1js module`);a=new f}a.valueBlock=s.valueBlock,s=nr(a.toBER(!1)).result}return n.fromASN(s)}static processComplexSchemaItem(e,t,i){if(t.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,n=>this.fromASN(n,i))}else{const n=this.handleImplicitTagging(e,t,i);if(this.isOptionalChoiceField(t))try{return this.fromASN(n,i)}catch(s){if(s instanceof $r&&/Wrong values for Choice type/.test(s.message))return;throw s}else return this.fromASN(n,i)}}static handleImplicitTagging(e,t,i){if(t.implicit&&typeof t.context=="number"){const n=ye.get(i);if(n.type===v.Sequence){const s=new Je;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(n.type===v.Set){const s=new ot;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}}class Ao{static serialize(e){return e instanceof Se?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&yt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=ye.get(t);ye.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 a=Ur(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>a.toASN(u))}else n=e.map(a=>this.toAsnItem({type:i.itemType},"[]",t,a))}else for(const a in i.items){const u=i.items[a],f=e[a];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&$f(this.serialize(u.defaultValue),this.serialize(f)))continue;const d=Ao.toAsnItem(u,a,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||yt(u.type))){const g={};g.valueHex=d instanceof Dt?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Pr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...g}))}else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:d.valueBlock.value}));else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[d]}));else u.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case v.Sequence:s=new Je({value:n});break;case v.Set:s=new ot({value:n});break;case v.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 a=e.converter;if(!a)throw new Error(`Property '${t}' doesn't have converter for type ${p[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,d=>a.toASN(d)),f=e.repeated==="sequence"?Je:ot;s=new f({value:u})}else s=a.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?Je:ot;s=new u({value:a})}else s=this.toASN(n);return s}}class ee extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class B{static serialize(e){return Ao.serialize(e)}static parse(e,t){return Lf.parse(e,t)}static toString(e){const t=x.isBufferSource(e)?x.toArrayBuffer(e):B.serialize(e),i=nr(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function c(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;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--)(a=r[u])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;class Tc{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){const t=e.split(".");if(t.length!==4)throw new Error("Invalid IPv4 address");return t.map(i=>{const n=parseInt(i,10);if(isNaN(n)||n<0||n>255)throw new Error("Invalid IPv4 address part");return n})}static parseIPv6(e){const i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((n,s)=>{const a=parseInt(s,16);if(isNaN(a)||a<0||a>65535)throw new Error("Invalid IPv6 address part");return n.push(a>>8&255),n.push(a&255),n},[])}static expandIPv6(e){if(!e.includes("::"))return e;const t=e.split("::");if(t.length>2)throw new Error("Invalid IPv6 address");const i=t[0]?t[0].split(":"):[],n=t[1]?t[1].split(":"):[],s=8-(i.length+n.length);if(s<0)throw new Error("Invalid IPv6 address");return[...i,...Array(s).fill("0"),...n].join(":")}static formatIPv6(e){const t=[];for(let i=0;i<16;i+=2)t.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){const t=e.split(":");let i=-1,n=0,s=-1,a=0;for(let u=0;u<t.length;u++)t[u]==="0"?(s===-1&&(s=u),a++):(a>n&&(i=s,n=a),s=-1,a=0);if(a>n&&(i=s,n=a),n>1){const u=t.slice(0,i).join(":"),f=t.slice(i+n).join(":");return`${u}::${f}`}return e}static parseCIDR(e){const[t,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(t)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),n]}else{if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),n]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;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){const t=new Uint8Array(e);if(t.length===4)return Array.from(t).join(".");if(t.length===16)return this.formatIPv6(t);if(t.length===8||t.length===32){const i=t.length/2,n=t.slice(0,i),s=t.slice(i);if(t.every(f=>f===0))return t.length===8?"0.0.0.0/0":"::/0";const u=s.reduce((f,d)=>f+(d.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(n).join(".")}/${u}`:`${this.formatIPv6(n)}/${u}`}return this.decodeIP(j.ToHex(e))}static fromString(e){if(e.includes("/")){const[i,n]=this.parseCIDR(e),s=new Uint8Array(i.length);let a=n;for(let f=0;f<s.length;f++)a>=8?(s[f]=255,a-=8):a>0&&(s[f]=255<<8-a,a=0);const u=new Uint8Array(i.length*2);return u.set(i,0),u.set(s,i.length),u.buffer}const t=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(t).buffer}}var So,ko,Co;let ke=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};c([l({type:p.TeletexString})],ke.prototype,"teletexString",void 0),c([l({type:p.PrintableString})],ke.prototype,"printableString",void 0),c([l({type:p.UniversalString})],ke.prototype,"universalString",void 0),c([l({type:p.Utf8String})],ke.prototype,"utf8String",void 0),c([l({type:p.BmpString})],ke.prototype,"bmpString",void 0),ke=c([A({type:v.Choice})],ke);let sr=class extends ke{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?j.ToHex(this.anyValue):super.toString())}};c([l({type:p.IA5String})],sr.prototype,"ia5String",void 0),c([l({type:p.Any})],sr.prototype,"anyValue",void 0),sr=c([A({type:v.Choice})],sr);class Mi{constructor(e={}){this.type="",this.value=new sr,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Mi.prototype,"type",void 0),c([l({type:sr})],Mi.prototype,"value",void 0);let ar=So=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,So.prototype)}};ar=So=c([A({type:v.Set,itemType:Mi})],ar);let xo=ko=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ko.prototype)}};xo=ko=c([A({type:v.Sequence,itemType:ar})],xo);let ge=Co=class extends xo{constructor(e){super(e),Object.setPrototypeOf(this,Co.prototype)}};ge=Co=c([A({type:v.Sequence})],ge);const Ff={fromASN:r=>Tc.toString(Di.fromASN(r)),toASN:r=>Di.toASN(Tc.fromString(r))};class Hr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Hr.prototype,"typeId",void 0),c([l({type:p.Any,context:0})],Hr.prototype,"value",void 0);class Bo{constructor(e={}){this.partyName=new ke,Object.assign(this,e)}}c([l({type:ke,optional:!0,context:0,implicit:!0})],Bo.prototype,"nameAssigner",void 0),c([l({type:ke,context:1,implicit:!0})],Bo.prototype,"partyName",void 0);let L=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Hr,context:0,implicit:!0})],L.prototype,"otherName",void 0),c([l({type:p.IA5String,context:1,implicit:!0})],L.prototype,"rfc822Name",void 0),c([l({type:p.IA5String,context:2,implicit:!0})],L.prototype,"dNSName",void 0),c([l({type:p.Any,context:3,implicit:!0})],L.prototype,"x400Address",void 0),c([l({type:ge,context:4,implicit:!1})],L.prototype,"directoryName",void 0),c([l({type:Bo,context:5})],L.prototype,"ediPartyName",void 0),c([l({type:p.IA5String,context:6,implicit:!0})],L.prototype,"uniformResourceIdentifier",void 0),c([l({type:p.OctetString,context:7,implicit:!0,converter:Ff})],L.prototype,"iPAddress",void 0),c([l({type:p.ObjectIdentifier,context:8,implicit:!0})],L.prototype,"registeredID",void 0),L=c([A({type:v.Choice})],L);const Eo="1.3.6.1.5.5.7",qf=`${Eo}.1`,cr=`${Eo}.3`,Ui=`${Eo}.48`,_c=`${Ui}.1`,Vc=`${Ui}.2`,jc=`${Ui}.3`,Pc=`${Ui}.5`,gt="2.5.29";var Io;const No=`${qf}.1`;class Lr{constructor(e={}){this.accessMethod="",this.accessLocation=new L,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Lr.prototype,"accessMethod",void 0),c([l({type:L})],Lr.prototype,"accessLocation",void 0);let lr=Io=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Io.prototype)}};lr=Io=c([A({type:v.Sequence,itemType:Lr})],lr);const Oo=`${gt}.35`;class To extends Y{}class Ht{constructor(e={}){e&&Object.assign(this,e)}}c([l({type:To,context:0,optional:!0,implicit:!0})],Ht.prototype,"keyIdentifier",void 0),c([l({type:L,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ht.prototype,"authorityCertIssuer",void 0),c([l({type:p.Integer,context:2,optional:!0,implicit:!0,converter:le})],Ht.prototype,"authorityCertSerialNumber",void 0);const Rc=`${gt}.19`;class $i{constructor(e={}){this.cA=!1,Object.assign(this,e)}}c([l({type:p.Boolean,defaultValue:!1})],$i.prototype,"cA",void 0),c([l({type:p.Integer,optional:!0})],$i.prototype,"pathLenConstraint",void 0);var _o;let Be=_o=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,_o.prototype)}};Be=_o=c([A({type:v.Sequence,itemType:L})],Be);var Vo;let Dc=Vo=class extends Be{constructor(e){super(e),Object.setPrototypeOf(this,Vo.prototype)}};Dc=Vo=c([A({type:v.Sequence})],Dc);var jo;const Mc=`${gt}.32`;let mt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};c([l({type:p.IA5String})],mt.prototype,"ia5String",void 0),c([l({type:p.VisibleString})],mt.prototype,"visibleString",void 0),c([l({type:p.BmpString})],mt.prototype,"bmpString",void 0),c([l({type:p.Utf8String})],mt.prototype,"utf8String",void 0),mt=c([A({type:v.Choice})],mt);class Po{constructor(e={}){this.organization=new mt,this.noticeNumbers=[],Object.assign(this,e)}}c([l({type:mt})],Po.prototype,"organization",void 0),c([l({type:p.Integer,repeated:"sequence"})],Po.prototype,"noticeNumbers",void 0);class Ro{constructor(e={}){Object.assign(this,e)}}c([l({type:Po,optional:!0})],Ro.prototype,"noticeRef",void 0),c([l({type:mt,optional:!0})],Ro.prototype,"explicitText",void 0);let Hi=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.IA5String})],Hi.prototype,"cPSuri",void 0),c([l({type:Ro})],Hi.prototype,"userNotice",void 0),Hi=c([A({type:v.Choice})],Hi);class Do{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Do.prototype,"policyQualifierId",void 0),c([l({type:p.Any})],Do.prototype,"qualifier",void 0);class Li{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Li.prototype,"policyIdentifier",void 0),c([l({type:Do,repeated:"sequence",optional:!0})],Li.prototype,"policyQualifiers",void 0);let Fi=jo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,jo.prototype)}};Fi=jo=c([A({type:v.Sequence,itemType:Li})],Fi);let qi=class{constructor(e=0){this.value=e}};c([l({type:p.Integer})],qi.prototype,"value",void 0),qi=c([A({type:v.Choice})],qi);let Uc=class extends qi{};Uc=c([A({type:v.Choice})],Uc);var Mo;const Uo=`${gt}.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 $c extends Ri{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 Lt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:L,context:0,repeated:"sequence",implicit:!0})],Lt.prototype,"fullName",void 0),c([l({type:ar,context:1,implicit:!0})],Lt.prototype,"nameRelativeToCRLIssuer",void 0),Lt=c([A({type:v.Choice})],Lt);class ur{constructor(e={}){Object.assign(this,e)}}c([l({type:Lt,context:0,optional:!0})],ur.prototype,"distributionPoint",void 0),c([l({type:$c,context:1,optional:!0,implicit:!0})],ur.prototype,"reasons",void 0),c([l({type:L,context:2,optional:!0,repeated:"sequence",implicit:!0})],ur.prototype,"cRLIssuer",void 0);let fr=Mo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Mo.prototype)}};fr=Mo=c([A({type:v.Sequence,itemType:ur})],fr);var $o;let Hc=$o=class extends fr{constructor(e){super(e),Object.setPrototypeOf(this,$o.prototype)}};Hc=$o=c([A({type:v.Sequence,itemType:ur})],Hc);class Ee{constructor(e={}){this.onlyContainsUserCerts=Ee.ONLY,this.onlyContainsCACerts=Ee.ONLY,this.indirectCRL=Ee.ONLY,this.onlyContainsAttributeCerts=Ee.ONLY,Object.assign(this,e)}}Ee.ONLY=!1,c([l({type:Lt,context:0,optional:!0})],Ee.prototype,"distributionPoint",void 0),c([l({type:p.Boolean,context:1,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsUserCerts",void 0),c([l({type:p.Boolean,context:2,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsCACerts",void 0),c([l({type:$c,context:3,optional:!0,implicit:!0})],Ee.prototype,"onlySomeReasons",void 0),c([l({type:p.Boolean,context:4,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"indirectCRL",void 0),c([l({type:p.Boolean,context:5,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsAttributeCerts",void 0);var Fr;(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"})(Fr||(Fr={}));let Ho=class{constructor(e=Fr.unspecified){this.reason=Fr.unspecified,this.reason=e}toJSON(){return Fr[this.reason]}toString(){return this.toJSON()}};c([l({type:p.Enumerated})],Ho.prototype,"reason",void 0),Ho=c([A({type:v.Choice})],Ho);var Lo;const Lc=`${gt}.37`;let Ki=Lo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Lo.prototype)}};Ki=Lo=c([A({type:v.Sequence,itemType:p.ObjectIdentifier})],Ki);const Kf=`${cr}.1`,Wf=`${cr}.2`,Gf=`${cr}.3`,zf=`${cr}.4`,Jf=`${cr}.8`,Yf=`${cr}.9`;let Fo=class{constructor(e=new ArrayBuffer(0)){this.value=e}};c([l({type:p.Integer,converter:le})],Fo.prototype,"value",void 0),Fo=c([A({type:v.Choice})],Fo);let qo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};c([l({type:p.GeneralizedTime})],qo.prototype,"value",void 0),qo=c([A({type:v.Choice})],qo);var Ko;const Fc=`${gt}.18`;let qc=Ko=class extends Be{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};qc=Ko=c([A({type:v.Sequence})],qc);const Kc=`${gt}.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 Wo extends Ri{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 Go;class Wi{constructor(e={}){this.base=new L,this.minimum=0,Object.assign(this,e)}}c([l({type:L})],Wi.prototype,"base",void 0),c([l({type:p.Integer,context:0,defaultValue:0,implicit:!0})],Wi.prototype,"minimum",void 0),c([l({type:p.Integer,context:1,optional:!0,implicit:!0})],Wi.prototype,"maximum",void 0);let Gi=Go=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Go.prototype)}};Gi=Go=c([A({type:v.Sequence,itemType:Wi})],Gi);class Wc{constructor(e={}){Object.assign(this,e)}}c([l({type:Gi,context:0,optional:!0,implicit:!0})],Wc.prototype,"permittedSubtrees",void 0),c([l({type:Gi,context:1,optional:!0,implicit:!0})],Wc.prototype,"excludedSubtrees",void 0);class Gc{constructor(e={}){Object.assign(this,e)}}c([l({type:p.Integer,context:0,implicit:!0,optional:!0,converter:le})],Gc.prototype,"requireExplicitPolicy",void 0),c([l({type:p.Integer,context:1,implicit:!0,optional:!0,converter:le})],Gc.prototype,"inhibitPolicyMapping",void 0);var zo;class Jo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Jo.prototype,"issuerDomainPolicy",void 0),c([l({type:p.ObjectIdentifier})],Jo.prototype,"subjectDomainPolicy",void 0);let zc=zo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,zo.prototype)}};zc=zo=c([A({type:v.Sequence,itemType:Jo})],zc);var Yo;const Jc=`${gt}.17`;let Zo=Yo=class extends Be{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};Zo=Yo=c([A({type:v.Sequence})],Zo);let bt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],bt.prototype,"type",void 0),c([l({type:p.Any,repeated:"set"})],bt.prototype,"values",void 0);var Qo;let Yc=Qo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Yc=Qo=c([A({type:v.Sequence,itemType:bt})],Yc);const Zc=`${gt}.14`;class Bt extends To{}class Qc{constructor(e={}){Object.assign(this,e)}}c([l({type:p.GeneralizedTime,context:0,implicit:!0,optional:!0})],Qc.prototype,"notBefore",void 0),c([l({type:p.GeneralizedTime,context:1,implicit:!0,optional:!0})],Qc.prototype,"notAfter",void 0);var qr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(qr||(qr={}));class Xc extends Ri{toJSON(){const e=[],t=this.toNumber();return t&qr.pKIXCertificate&&e.push("pKIXCertificate"),t&qr.newExtensions&&e.push("newExtensions"),t&qr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class el{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Xc,Object.assign(this,e)}}c([l({type:p.GeneralString})],el.prototype,"entrustVers",void 0),c([l({type:Xc})],el.prototype,"entrustInfoFlags",void 0);var Xo;let tl=Xo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Xo.prototype)}};tl=Xo=c([A({type:v.Sequence,itemType:Lr})],tl);class I{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof I&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Na(e.parameters,this.parameters)||e.parameters===this.parameters)}}c([l({type:p.ObjectIdentifier})],I.prototype,"algorithm",void 0),c([l({type:p.Any,optional:!0})],I.prototype,"parameters",void 0);class st{constructor(e={}){this.algorithm=new I,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:I})],st.prototype,"algorithm",void 0),c([l({type:p.BitString})],st.prototype,"subjectPublicKey",void 0);let Ce=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}};c([l({type:p.UTCTime})],Ce.prototype,"utcTime",void 0),c([l({type:p.GeneralizedTime})],Ce.prototype,"generalTime",void 0),Ce=c([A({type:v.Choice})],Ce);class zi{constructor(e){this.notBefore=new Ce(new Date),this.notAfter=new Ce(new Date),e&&(this.notBefore=new Ce(e.notBefore),this.notAfter=new Ce(e.notAfter))}}c([l({type:Ce})],zi.prototype,"notBefore",void 0),c([l({type:Ce})],zi.prototype,"notAfter",void 0);var es;let Qe=class Ju{constructor(e={}){this.extnID="",this.critical=Ju.CRITICAL,this.extnValue=new Y,Object.assign(this,e)}};Qe.CRITICAL=!1,c([l({type:p.ObjectIdentifier})],Qe.prototype,"extnID",void 0),c([l({type:p.Boolean,defaultValue:Qe.CRITICAL})],Qe.prototype,"critical",void 0),c([l({type:Y})],Qe.prototype,"extnValue",void 0);let Ft=es=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,es.prototype)}};Ft=es=c([A({type:v.Sequence,itemType:Qe})],Ft);var dr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(dr||(dr={}));class We{constructor(e={}){this.version=dr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new I,this.issuer=new ge,this.validity=new zi,this.subject=new ge,this.subjectPublicKeyInfo=new st,Object.assign(this,e)}}c([l({type:p.Integer,context:0,defaultValue:dr.v1})],We.prototype,"version",void 0),c([l({type:p.Integer,converter:le})],We.prototype,"serialNumber",void 0),c([l({type:I})],We.prototype,"signature",void 0),c([l({type:ge})],We.prototype,"issuer",void 0),c([l({type:zi})],We.prototype,"validity",void 0),c([l({type:ge})],We.prototype,"subject",void 0),c([l({type:st})],We.prototype,"subjectPublicKeyInfo",void 0),c([l({type:p.BitString,context:1,implicit:!0,optional:!0})],We.prototype,"issuerUniqueID",void 0),c([l({type:p.BitString,context:2,implicit:!0,optional:!0})],We.prototype,"subjectUniqueID",void 0),c([l({type:Ft,context:3,optional:!0})],We.prototype,"extensions",void 0);class pr{constructor(e={}){this.tbsCertificate=new We,this.signatureAlgorithm=new I,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:We})],pr.prototype,"tbsCertificate",void 0),c([l({type:I})],pr.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],pr.prototype,"signatureValue",void 0);class Ji{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Ce,Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],Ji.prototype,"userCertificate",void 0),c([l({type:Ce})],Ji.prototype,"revocationDate",void 0),c([l({type:Qe,optional:!0,repeated:"sequence"})],Ji.prototype,"crlEntryExtensions",void 0);class vt{constructor(e={}){this.signature=new I,this.issuer=new ge,this.thisUpdate=new Ce,Object.assign(this,e)}}c([l({type:p.Integer,optional:!0})],vt.prototype,"version",void 0),c([l({type:I})],vt.prototype,"signature",void 0),c([l({type:ge})],vt.prototype,"issuer",void 0),c([l({type:Ce})],vt.prototype,"thisUpdate",void 0),c([l({type:Ce,optional:!0})],vt.prototype,"nextUpdate",void 0),c([l({type:Ji,repeated:"sequence",optional:!0})],vt.prototype,"revokedCertificates",void 0),c([l({type:Qe,optional:!0,context:0,repeated:"sequence"})],vt.prototype,"crlExtensions",void 0);let ts=class{constructor(e={}){this.tbsCertList=new vt,this.signatureAlgorithm=new I,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};c([l({type:vt})],ts.prototype,"tbsCertList",void 0),c([l({type:I})],ts.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],ts.prototype,"signature",void 0);class hr{constructor(e={}){this.issuer=new ge,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:ge})],hr.prototype,"issuer",void 0),c([l({type:p.Integer,converter:le})],hr.prototype,"serialNumber",void 0);let yr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Bt,context:0,implicit:!0})],yr.prototype,"subjectKeyIdentifier",void 0),c([l({type:hr})],yr.prototype,"issuerAndSerialNumber",void 0),yr=c([A({type:v.Choice})],yr);var wt;(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"})(wt||(wt={}));let Kr=class extends I{};Kr=c([A({type:v.Sequence})],Kr);let Yi=class extends I{};Yi=c([A({type:v.Sequence})],Yi);let at=class extends I{};at=c([A({type:v.Sequence})],at);let Zi=class extends I{};Zi=c([A({type:v.Sequence})],Zi);let rl=class extends I{};rl=c([A({type:v.Sequence})],rl);let rs=class extends I{};rs=c([A({type:v.Sequence})],rs);let gr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],gr.prototype,"attrType",void 0),c([l({type:p.Any,repeated:"set"})],gr.prototype,"attrValues",void 0);var is;class ct{constructor(e={}){this.version=wt.v0,this.sid=new yr,this.digestAlgorithm=new Kr,this.signatureAlgorithm=new Yi,this.signature=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],ct.prototype,"version",void 0),c([l({type:yr})],ct.prototype,"sid",void 0),c([l({type:Kr})],ct.prototype,"digestAlgorithm",void 0),c([l({type:gr,repeated:"set",context:0,implicit:!0,optional:!0})],ct.prototype,"signedAttrs",void 0),c([l({type:Yi})],ct.prototype,"signatureAlgorithm",void 0),c([l({type:Y})],ct.prototype,"signature",void 0),c([l({type:gr,repeated:"set",context:1,implicit:!0,optional:!0})],ct.prototype,"unsignedAttrs",void 0);let Qi=is=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,is.prototype)}};Qi=is=c([A({type:v.Set,itemType:ct})],Qi);let il=class extends Ce{};il=c([A({type:v.Choice})],il);let nl=class extends ct{};nl=c([A({type:v.Sequence})],nl);class ns{constructor(e={}){this.acIssuer=new L,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}c([l({type:L})],ns.prototype,"acIssuer",void 0),c([l({type:p.Integer})],ns.prototype,"acSerial",void 0),c([l({type:bt,repeated:"sequence"})],ns.prototype,"attrs",void 0);var os;let Xi=os=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,os.prototype)}};Xi=os=c([A({type:v.Sequence,itemType:p.ObjectIdentifier})],Xi);class en{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}c([l({type:p.Integer,optional:!0})],en.prototype,"pathLenConstraint",void 0),c([l({type:Xi,implicit:!0,context:0,optional:!0})],en.prototype,"permittedAttrs",void 0),c([l({type:Xi,implicit:!0,context:1,optional:!0})],en.prototype,"excludedAttrs",void 0),c([l({type:p.Boolean,defaultValue:!0})],en.prototype,"permitUnSpecified",void 0);class qt{constructor(e={}){this.issuer=new Be,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Be})],qt.prototype,"issuer",void 0),c([l({type:p.Integer,converter:le})],qt.prototype,"serial",void 0),c([l({type:p.BitString,optional:!0})],qt.prototype,"issuerUID",void 0);var ss;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(ss||(ss={}));class Kt{constructor(e={}){this.digestedObjectType=ss.publicKey,this.digestAlgorithm=new I,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Enumerated})],Kt.prototype,"digestedObjectType",void 0),c([l({type:p.ObjectIdentifier,optional:!0})],Kt.prototype,"otherObjectTypeID",void 0),c([l({type:I})],Kt.prototype,"digestAlgorithm",void 0),c([l({type:p.BitString})],Kt.prototype,"objectDigest",void 0);class tn{constructor(e={}){Object.assign(this,e)}}c([l({type:Be,optional:!0})],tn.prototype,"issuerName",void 0),c([l({type:qt,context:0,implicit:!0,optional:!0})],tn.prototype,"baseCertificateID",void 0),c([l({type:Kt,context:1,implicit:!0,optional:!0})],tn.prototype,"objectDigestInfo",void 0);let mr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:L,repeated:"sequence"})],mr.prototype,"v1Form",void 0),c([l({type:tn,context:0,implicit:!0})],mr.prototype,"v2Form",void 0),mr=c([A({type:v.Choice})],mr);class rn{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}c([l({type:p.GeneralizedTime})],rn.prototype,"notBeforeTime",void 0),c([l({type:p.GeneralizedTime})],rn.prototype,"notAfterTime",void 0);class Wr{constructor(e={}){Object.assign(this,e)}}c([l({type:qt,implicit:!0,context:0,optional:!0})],Wr.prototype,"baseCertificateID",void 0),c([l({type:Be,implicit:!0,context:1,optional:!0})],Wr.prototype,"entityName",void 0),c([l({type:Kt,implicit:!0,context:2,optional:!0})],Wr.prototype,"objectDigestInfo",void 0);var as;(function(r){r[r.v2=1]="v2"})(as||(as={}));class Xe{constructor(e={}){this.version=as.v2,this.holder=new Wr,this.issuer=new mr,this.signature=new I,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new rn,this.attributes=[],Object.assign(this,e)}}c([l({type:p.Integer})],Xe.prototype,"version",void 0),c([l({type:Wr})],Xe.prototype,"holder",void 0),c([l({type:mr})],Xe.prototype,"issuer",void 0),c([l({type:I})],Xe.prototype,"signature",void 0),c([l({type:p.Integer,converter:le})],Xe.prototype,"serialNumber",void 0),c([l({type:rn})],Xe.prototype,"attrCertValidityPeriod",void 0),c([l({type:bt,repeated:"sequence"})],Xe.prototype,"attributes",void 0),c([l({type:p.BitString,optional:!0})],Xe.prototype,"issuerUniqueID",void 0),c([l({type:Ft,optional:!0})],Xe.prototype,"extensions",void 0);class nn{constructor(e={}){this.acinfo=new Xe,this.signatureAlgorithm=new I,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Xe})],nn.prototype,"acinfo",void 0),c([l({type:I})],nn.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],nn.prototype,"signatureValue",void 0);var on;(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"})(on||(on={}));class cs extends Ri{}class ls{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier,implicit:!0,context:0})],ls.prototype,"type",void 0),c([l({type:p.Any,implicit:!0,context:1})],ls.prototype,"value",void 0);class us{constructor(e={}){this.policyId="",this.classList=new cs(on.unclassified),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],us.prototype,"policyId",void 0),c([l({type:cs,defaultValue:new cs(on.unclassified)})],us.prototype,"classList",void 0),c([l({type:ls,repeated:"set"})],us.prototype,"securityCategories",void 0);class sn{constructor(e={}){Object.assign(this,e)}}c([l({type:Y})],sn.prototype,"cotets",void 0),c([l({type:p.ObjectIdentifier})],sn.prototype,"oid",void 0),c([l({type:p.Utf8String})],sn.prototype,"string",void 0);class ol{constructor(e={}){this.values=[],Object.assign(this,e)}}c([l({type:Be,implicit:!0,context:0,optional:!0})],ol.prototype,"policyAuthority",void 0),c([l({type:sn,repeated:"sequence"})],ol.prototype,"values",void 0);var fs;class an{constructor(e={}){this.targetCertificate=new qt,Object.assign(this,e)}}c([l({type:qt})],an.prototype,"targetCertificate",void 0),c([l({type:L,optional:!0})],an.prototype,"targetName",void 0),c([l({type:Kt,optional:!0})],an.prototype,"certDigestInfo",void 0);let br=class{constructor(e={}){Object.assign(this,e)}};c([l({type:L,context:0,implicit:!0})],br.prototype,"targetName",void 0),c([l({type:L,context:1,implicit:!0})],br.prototype,"targetGroup",void 0),c([l({type:an,context:2,implicit:!0})],br.prototype,"targetCert",void 0),br=c([A({type:v.Choice})],br);let ds=fs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,fs.prototype)}};ds=fs=c([A({type:v.Sequence,itemType:br})],ds);var ps;let sl=ps=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ps.prototype)}};sl=ps=c([A({type:v.Sequence,itemType:ds})],sl);class al{constructor(e={}){Object.assign(this,e)}}c([l({type:Be,implicit:!0,context:0,optional:!0})],al.prototype,"roleAuthority",void 0),c([l({type:L,implicit:!0,context:1})],al.prototype,"roleName",void 0);class hs{constructor(e={}){this.service=new L,this.ident=new L,Object.assign(this,e)}}c([l({type:L})],hs.prototype,"service",void 0),c([l({type:L})],hs.prototype,"ident",void 0),c([l({type:Y,optional:!0})],hs.prototype,"authInfo",void 0);var ys;class gs{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],gs.prototype,"otherCertFormat",void 0),c([l({type:p.Any})],gs.prototype,"otherCert",void 0);let vr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:pr})],vr.prototype,"certificate",void 0),c([l({type:nn,context:2,implicit:!0})],vr.prototype,"v2AttrCert",void 0),c([l({type:gs,context:3,implicit:!0})],vr.prototype,"other",void 0),vr=c([A({type:v.Choice})],vr);let cn=ys=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ys.prototype)}};cn=ys=c([A({type:v.Set,itemType:vr})],cn);class wr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],wr.prototype,"contentType",void 0),c([l({type:p.Any,context:0})],wr.prototype,"content",void 0);let Gr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Y})],Gr.prototype,"single",void 0),c([l({type:p.Any})],Gr.prototype,"any",void 0),Gr=c([A({type:v.Choice})],Gr);class ln{constructor(e={}){this.eContentType="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],ln.prototype,"eContentType",void 0),c([l({type:Gr,context:0,optional:!0})],ln.prototype,"eContent",void 0);let zr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Y,context:0,implicit:!0,optional:!0})],zr.prototype,"value",void 0),c([l({type:Y,converter:xf,context:0,implicit:!0,optional:!0,repeated:"sequence"})],zr.prototype,"constructedValue",void 0),zr=c([A({type:v.Choice})],zr);class Jr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Zi,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Jr.prototype,"contentType",void 0),c([l({type:Zi})],Jr.prototype,"contentEncryptionAlgorithm",void 0),c([l({type:zr,optional:!0})],Jr.prototype,"encryptedContent",void 0);class un{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],un.prototype,"keyAttrId",void 0),c([l({type:p.Any,optional:!0})],un.prototype,"keyAttr",void 0);var ms;class fn{constructor(e={}){this.subjectKeyIdentifier=new Bt,Object.assign(this,e)}}c([l({type:Bt})],fn.prototype,"subjectKeyIdentifier",void 0),c([l({type:p.GeneralizedTime,optional:!0})],fn.prototype,"date",void 0),c([l({type:un,optional:!0})],fn.prototype,"other",void 0);let Ar=class{constructor(e={}){Object.assign(this,e)}};c([l({type:fn,context:0,implicit:!0,optional:!0})],Ar.prototype,"rKeyId",void 0),c([l({type:hr,optional:!0})],Ar.prototype,"issuerAndSerialNumber",void 0),Ar=c([A({type:v.Choice})],Ar);class bs{constructor(e={}){this.rid=new Ar,this.encryptedKey=new Y,Object.assign(this,e)}}c([l({type:Ar})],bs.prototype,"rid",void 0),c([l({type:Y})],bs.prototype,"encryptedKey",void 0);let dn=ms=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ms.prototype)}};dn=ms=c([A({type:v.Sequence,itemType:bs})],dn);class vs{constructor(e={}){this.algorithm=new I,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:I})],vs.prototype,"algorithm",void 0),c([l({type:p.BitString})],vs.prototype,"publicKey",void 0);let Wt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Bt,context:0,implicit:!0,optional:!0})],Wt.prototype,"subjectKeyIdentifier",void 0),c([l({type:vs,context:1,implicit:!0,optional:!0})],Wt.prototype,"originatorKey",void 0),c([l({type:hr,optional:!0})],Wt.prototype,"issuerAndSerialNumber",void 0),Wt=c([A({type:v.Choice})],Wt);class Sr{constructor(e={}){this.version=wt.v3,this.originator=new Wt,this.keyEncryptionAlgorithm=new at,this.recipientEncryptedKeys=new dn,Object.assign(this,e)}}c([l({type:p.Integer})],Sr.prototype,"version",void 0),c([l({type:Wt,context:0})],Sr.prototype,"originator",void 0),c([l({type:Y,context:1,optional:!0})],Sr.prototype,"ukm",void 0),c([l({type:at})],Sr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:dn})],Sr.prototype,"recipientEncryptedKeys",void 0);let kr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Bt,context:0,implicit:!0})],kr.prototype,"subjectKeyIdentifier",void 0),c([l({type:hr})],kr.prototype,"issuerAndSerialNumber",void 0),kr=c([A({type:v.Choice})],kr);class Yr{constructor(e={}){this.version=wt.v0,this.rid=new kr,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],Yr.prototype,"version",void 0),c([l({type:kr})],Yr.prototype,"rid",void 0),c([l({type:at})],Yr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Y})],Yr.prototype,"encryptedKey",void 0);class Zr{constructor(e={}){this.keyIdentifier=new Y,Object.assign(this,e)}}c([l({type:Y})],Zr.prototype,"keyIdentifier",void 0),c([l({type:p.GeneralizedTime,optional:!0})],Zr.prototype,"date",void 0),c([l({type:un,optional:!0})],Zr.prototype,"other",void 0);class Qr{constructor(e={}){this.version=wt.v4,this.kekid=new Zr,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],Qr.prototype,"version",void 0),c([l({type:Zr})],Qr.prototype,"kekid",void 0),c([l({type:at})],Qr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Y})],Qr.prototype,"encryptedKey",void 0);class Xr{constructor(e={}){this.version=wt.v0,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],Xr.prototype,"version",void 0),c([l({type:rs,context:0,optional:!0})],Xr.prototype,"keyDerivationAlgorithm",void 0),c([l({type:at})],Xr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Y})],Xr.prototype,"encryptedKey",void 0);class ws{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],ws.prototype,"oriType",void 0),c([l({type:p.Any})],ws.prototype,"oriValue",void 0);let Et=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Yr,optional:!0})],Et.prototype,"ktri",void 0),c([l({type:Sr,context:1,implicit:!0,optional:!0})],Et.prototype,"kari",void 0),c([l({type:Qr,context:2,implicit:!0,optional:!0})],Et.prototype,"kekri",void 0),c([l({type:Xr,context:3,implicit:!0,optional:!0})],Et.prototype,"pwri",void 0),c([l({type:ws,context:4,implicit:!0,optional:!0})],Et.prototype,"ori",void 0),Et=c([A({type:v.Choice})],Et);var As;let pn=As=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};pn=As=c([A({type:v.Set,itemType:Et})],pn);var Ss;class hn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],hn.prototype,"otherRevInfoFormat",void 0),c([l({type:p.Any})],hn.prototype,"otherRevInfo",void 0);let yn=class{constructor(e={}){this.other=new hn,Object.assign(this,e)}};c([l({type:hn,context:1,implicit:!0})],yn.prototype,"other",void 0),yn=c([A({type:v.Choice})],yn);let gn=Ss=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Ss.prototype)}};gn=Ss=c([A({type:v.Set,itemType:yn})],gn);class ks{constructor(e={}){Object.assign(this,e)}}c([l({type:cn,context:0,implicit:!0,optional:!0})],ks.prototype,"certs",void 0),c([l({type:gn,context:1,implicit:!0,optional:!0})],ks.prototype,"crls",void 0);var Cs;let xs=Cs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};xs=Cs=c([A({type:v.Set,itemType:gr})],xs);class ei{constructor(e={}){this.version=wt.v0,this.recipientInfos=new pn,this.encryptedContentInfo=new Jr,Object.assign(this,e)}}c([l({type:p.Integer})],ei.prototype,"version",void 0),c([l({type:ks,context:0,implicit:!0,optional:!0})],ei.prototype,"originatorInfo",void 0),c([l({type:pn})],ei.prototype,"recipientInfos",void 0),c([l({type:Jr})],ei.prototype,"encryptedContentInfo",void 0),c([l({type:xs,context:1,implicit:!0,optional:!0})],ei.prototype,"unprotectedAttrs",void 0);const Zf="1.2.840.113549.1.7.2";var Bs;let mn=Bs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Bs.prototype)}};mn=Bs=c([A({type:v.Set,itemType:Kr})],mn);class Cr{constructor(e={}){this.version=wt.v0,this.digestAlgorithms=new mn,this.encapContentInfo=new ln,this.signerInfos=new Qi,Object.assign(this,e)}}c([l({type:p.Integer})],Cr.prototype,"version",void 0),c([l({type:mn})],Cr.prototype,"digestAlgorithms",void 0),c([l({type:ln})],Cr.prototype,"encapContentInfo",void 0),c([l({type:cn,context:0,implicit:!0,optional:!0})],Cr.prototype,"certificates",void 0),c([l({type:gn,context:1,implicit:!0,optional:!0})],Cr.prototype,"crls",void 0),c([l({type:Qi})],Cr.prototype,"signerInfos",void 0);const ti="1.2.840.10045.2.1",Es="1.2.840.10045.4.1",cl="1.2.840.10045.4.3.1",Is="1.2.840.10045.4.3.2",Ns="1.2.840.10045.4.3.3",Os="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 ri(r){return new I({algorithm:r})}const Qf=ri(Es);ri(cl);const Xf=ri(Is),ed=ri(Ns),td=ri(Os);let ii=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],ii.prototype,"fieldType",void 0),c([l({type:p.Any})],ii.prototype,"parameters",void 0),ii=c([A({type:v.Sequence})],ii);class rd extends Y{}let xr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.OctetString})],xr.prototype,"a",void 0),c([l({type:p.OctetString})],xr.prototype,"b",void 0),c([l({type:p.BitString,optional:!0})],xr.prototype,"seed",void 0),xr=c([A({type:v.Sequence})],xr);var Ts;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Ts||(Ts={}));let At=class{constructor(e={}){this.version=Ts.ecpVer1,Object.assign(this,e)}};c([l({type:p.Integer})],At.prototype,"version",void 0),c([l({type:ii})],At.prototype,"fieldID",void 0),c([l({type:xr})],At.prototype,"curve",void 0),c([l({type:rd})],At.prototype,"base",void 0),c([l({type:p.Integer,converter:le})],At.prototype,"order",void 0),c([l({type:p.Integer,optional:!0})],At.prototype,"cofactor",void 0),At=c([A({type:v.Sequence})],At);let It=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],It.prototype,"namedCurve",void 0),c([l({type:p.Null})],It.prototype,"implicitCurve",void 0),c([l({type:At})],It.prototype,"specifiedCurve",void 0),It=c([A({type:v.Choice})],It);class bn{constructor(e={}){this.version=1,this.privateKey=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],bn.prototype,"version",void 0),c([l({type:Y})],bn.prototype,"privateKey",void 0),c([l({type:It,context:0,optional:!0})],bn.prototype,"parameters",void 0),c([l({type:p.BitString,context:1,optional:!0})],bn.prototype,"publicKey",void 0);class vn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],vn.prototype,"r",void 0),c([l({type:p.Integer,converter:le})],vn.prototype,"s",void 0);const Pe="1.2.840.113549.1.1",Gt=`${Pe}.1`,id=`${Pe}.7`,nd=`${Pe}.9`,ni=`${Pe}.10`,od=`${Pe}.2`,sd=`${Pe}.4`,wn=`${Pe}.5`,ad=`${Pe}.14`,_s=`${Pe}.11`,An=`${Pe}.12`,Sn=`${Pe}.13`,dl=`${Pe}.15`,pl=`${Pe}.16`,kn="1.3.14.3.2.26",hl="2.16.840.1.101.3.4.2.4",Cn="2.16.840.1.101.3.4.2.1",xn="2.16.840.1.101.3.4.2.2",Bn="2.16.840.1.101.3.4.2.3",cd="2.16.840.1.101.3.4.2.5",ld="2.16.840.1.101.3.4.2.6",ud="1.2.840.113549.2.2",fd="1.2.840.113549.2.5",En=`${Pe}.8`;function me(r){return new I({algorithm:r,parameters:null})}me(ud),me(fd);const zt=me(kn);me(hl),me(Cn),me(xn),me(Bn),me(cd),me(ld);const yl=new I({algorithm:En,parameters:B.serialize(zt)}),gl=new I({algorithm:nd,parameters:B.serialize(Di.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});me(Gt),me(od),me(sd),me(wn),me(dl),me(pl),me(An),me(Sn),me(dl),me(pl);class In{constructor(e={}){this.hashAlgorithm=new I(zt),this.maskGenAlgorithm=new I({algorithm:En,parameters:B.serialize(zt)}),this.pSourceAlgorithm=new I(gl),Object.assign(this,e)}}c([l({type:I,context:0,defaultValue:zt})],In.prototype,"hashAlgorithm",void 0),c([l({type:I,context:1,defaultValue:yl})],In.prototype,"maskGenAlgorithm",void 0),c([l({type:I,context:2,defaultValue:gl})],In.prototype,"pSourceAlgorithm",void 0),new I({algorithm:id,parameters:B.serialize(new In)});class Jt{constructor(e={}){this.hashAlgorithm=new I(zt),this.maskGenAlgorithm=new I({algorithm:En,parameters:B.serialize(zt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}c([l({type:I,context:0,defaultValue:zt})],Jt.prototype,"hashAlgorithm",void 0),c([l({type:I,context:1,defaultValue:yl})],Jt.prototype,"maskGenAlgorithm",void 0),c([l({type:p.Integer,context:2,defaultValue:20})],Jt.prototype,"saltLength",void 0),c([l({type:p.Integer,context:3,defaultValue:1})],Jt.prototype,"trailerField",void 0),new I({algorithm:ni,parameters:B.serialize(new Jt)});class Nn{constructor(e={}){this.digestAlgorithm=new I,this.digest=new Y,Object.assign(this,e)}}c([l({type:I})],Nn.prototype,"digestAlgorithm",void 0),c([l({type:Y})],Nn.prototype,"digest",void 0);var Vs;class On{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],On.prototype,"prime",void 0),c([l({type:p.Integer,converter:le})],On.prototype,"exponent",void 0),c([l({type:p.Integer,converter:le})],On.prototype,"coefficient",void 0);let js=Vs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Vs.prototype)}};js=Vs=c([A({type:v.Sequence,itemType:On})],js);class lt{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)}}c([l({type:p.Integer})],lt.prototype,"version",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"modulus",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"publicExponent",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"privateExponent",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"prime1",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"prime2",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"exponent1",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"exponent2",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"coefficient",void 0),c([l({type:js,optional:!0})],lt.prototype,"otherPrimeInfos",void 0);class Ps{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],Ps.prototype,"modulus",void 0),c([l({type:p.Integer,converter:le})],Ps.prototype,"publicExponent",void 0);var Rs;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(Rs||(Rs={}));const Re=Rs;/*! *****************************************************************************
|
|
76
|
-
|
|
75
|
+
`)}`:`${t} :`}}$a=Te,I.Constructed=$a,Te.NAME="CONSTRUCTED";class Ha extends Oe{fromBER(e,t,i){return t}toBER(e){return Je}}Ha.override="EndOfContentValueBlock";var La;class uo extends we{constructor(e={}){super(e,Ha),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}La=uo,I.EndOfContent=La,uo.NAME=Rr;var Fa;class Ut extends we{constructor(e={}){super(e,Oe),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}`}}Fa=Ut,I.Null=Fa,Ut.NAME="NULL";class qa extends nt(Oe){get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=x.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,i){const n=x.toUint8Array(e);return pt(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,Oa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}qa.NAME="BooleanValueBlock";var Ka;let Ai=class extends we{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Ka=Ai,I.Boolean=Ka,Ai.NAME="BOOLEAN";class Wa extends nt(xt){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=xt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Rr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Va)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?xt.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Wa.NAME="OctetStringValueBlock";var fo;let $t=class extends we{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},Wa),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 a=or(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return 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=this.constructor.NAME,t=j.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof fo&&e.push(t.valueBlock.valueHexView);return x.concat(e)}};fo=$t,I.OctetString=fo,$t.NAME=Va;class Ga extends nt(xt){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=xt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===Rr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==ja)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=u.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return n}const s=x.toUint8Array(e);if(!pt(this,s,t,i))return-1;const a=s.subarray(t,t+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=a.subarray(1);try{if(u.byteLength){const f=or(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,t+i}toBER(e,t){if(this.isConstructed)return xt.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}}}Ga.NAME="BitStringValueBlock";var za;let Ht=class extends we{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},Ga),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 a of t)e.push(a.toString(2).padStart(8,"0"));const i=e.join(""),n=this.constructor.NAME,s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${n} : ${s}`}}};za=Ht,I.BitString=za,Ht.NAME=ja;var Ja;function df(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const a=s.length-1,u=n.slice(0),f=u.length-1;let d=0;const g=f<a?a:f;let h=0;for(let H=g;H>=0;H--,h++){switch(!0){case h<u.length:d=s[a-h]+u[f-h]+t[0];break;default:d=s[a-h]+t[0]}switch(t[0]=d/10,!0){case h>=s.length:s=so(new Uint8Array([d%10]),s);break;default:s[a-h]=d%10}}return t[0]>0&&(s=so(t,s)),s}function Ya(r){if(r>=Pr.length)for(let e=Pr.length;e<=r;e++){const t=new Uint8Array([0]);let i=Pr[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=so(t,i)),Pr.push(i)}return Pr[r]}function pf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),a=s.length-1,u=n.slice(0),f=u.length-1;let d,g=0;for(let h=f;h>=0;h--,g++)switch(d=s[a-g]-u[f-g]-t,!0){case d<0:t=1,s[a-g]=d+10;break;default:t=0,s[a-g]=d}if(t>0)for(let h=a-f+1;h>=0;h--,g++)if(d=s[a-g]-t,d<0)t=1,s[a-g]=d+10;else{t=0,s[a-g]=d;break}return s.slice()}class po extends nt(Oe){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=Oa.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(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 a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):n!==0&&a.length<n&&(n-a.length>1&&(n=a.length+1),this.valueHexView=a.subarray(n-a.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 a="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case e:t=pf(Ya(i),t),a="-";break;default:t=df(t,Ya(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(a+=Ta.charAt(t[f]));return u===!1&&(a+=Ta.charAt(0)),a}}Ja=po,po.NAME="IntegerValueBlock",Object.defineProperty(Ja.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Mr;class ar extends we{constructor(e={}){super(e,po),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return vi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){vi();const t=BigInt(e),i=new wi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(j.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const d=BigInt(`0x${j.ToHex(u)}`)+t,g=x.toUint8Array(j.FromHex(d.toString(16)));g[0]|=128,i.write(g)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new Mr({valueHex:i.final()})}convertToDER(){const e=new Mr({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Mr({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Mr=ar,I.Integer=Mr,ar.NAME="INTEGER";var Za;class ki extends ar{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Za=ki,I.Enumerated=Za,ki.NAME="ENUMERATED";class ho extends nt(Oe){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=x.toUint8Array(e);if(!pt(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 a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,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=nr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){vi();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 a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Dt(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 a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=j.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}}}ho.NAME="sidBlock";class Qa extends Oe{constructor({value:e=Pe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new ho;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 ao(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 a=this.value[0];let u=0;switch(a.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;a.valueDec=f+u,s=!1}else{const a=new ho;if(n>Number.MAX_SAFE_INTEGER){vi();const u=BigInt(n);a.valueBigInt=u}else if(a.valueDec=parseInt(n,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}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}}Qa.NAME="ObjectIdentifierValueBlock";var Xa;class Ci extends we{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Xa=Ci,I.ObjectIdentifier=Xa,Ci.NAME="OBJECT IDENTIFIER";class yo extends nt(Mt){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=x.toUint8Array(e);if(!pt(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 a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,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=nr(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 a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Dt(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 a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=j.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}yo.NAME="relativeSidBlock";class ec extends Oe{constructor({value:e=Pe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new yo;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 ao(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 yo;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}}ec.NAME="RelativeObjectIdentifierValueBlock";var tc;class go extends we{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,ec),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}tc=go,I.RelativeObjectIdentifier=tc,go.NAME="RelativeObjectIdentifier";var rc;class Ye extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}rc=Ye,I.Sequence=rc,Ye.NAME="SEQUENCE";var ic;let ot=class extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};ic=ot,I.Set=ic,ot.NAME="SET";class nc extends nt(Oe){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Pe}toJSON(){return{...super.toJSON(),value:this.value}}}nc.NAME="StringValueBlock";class oc extends nc{}oc.NAME="SimpleStringValueBlock";class Le extends lo{constructor({...e}={}){super(e,oc)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,x.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}}Le.NAME="SIMPLE STRING";class sc extends Le{fromBuffer(e){this.valueBlock.valueHexView=x.toUint8Array(e);try{this.valueBlock.value=j.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=j.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(j.FromUtf8String(e)),this.valueBlock.value=e}}sc.NAME="Utf8StringValueBlock";var ac;class ht extends sc{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ac=ht,I.Utf8String=ac,ht.NAME="UTF8String";class cc extends Le{fromBuffer(e){this.valueBlock.value=j.ToUtf16String(e),this.valueBlock.valueHexView=x.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(j.FromUtf16String(e))}}cc.NAME="BmpStringValueBlock";var lc;class xi extends cc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}lc=xi,I.BmpString=lc,xi.NAME="BMPString";class uc extends Le{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=Dt(e.charCodeAt(n),8),a=new Uint8Array(s);if(a.length>4)continue;const u=4-a.length;for(let f=a.length-1;f>=0;f--)i[n*4+f+u]=a[f]}this.valueBlock.value=e}}uc.NAME="UniversalStringValueBlock";var fc;class Bi extends uc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}fc=Bi,I.UniversalString=fc,Bi.NAME="UniversalString";var dc;class Ei extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}dc=Ei,I.NumericString=dc,Ei.NAME="NumericString";var pc;class Ni extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}pc=Ni,I.PrintableString=pc,Ni.NAME="PrintableString";var hc;class Ii extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}hc=Ii,I.TeletexString=hc,Ii.NAME="TeletexString";var yc;class Oi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}yc=Oi,I.VideotexString=yc,Oi.NAME="VideotexString";var gc;class Ti extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}gc=Ti,I.IA5String=gc,Ti.NAME="IA5String";var mc;class _i extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}mc=_i,I.GraphicString=mc,_i.NAME="GraphicString";var bc;class Ur extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}bc=Ur,I.VisibleString=bc,Ur.NAME="VisibleString";var vc;class Vi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}vc=Vi,I.GeneralString=vc,Vi.NAME="GeneralString";var wc;class ji extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}wc=ji,I.CharacterString=wc,ji.NAME="CharacterString";var Sc;class $r extends Ur{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,x.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]=He(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=He(this.month,2),t[2]=He(this.day,2),t[3]=He(this.hour,2),t[4]=He(this.minute,2),t[5]=He(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}}}Sc=$r,I.UTCTime=Sc,$r.NAME="UTCTime";var Ac;class Pi extends $r{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(){const e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,i="",n="",s=0,a,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const h=new Number(e[e.length-1]);if(isNaN(h.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 h=1,H=i.indexOf("+"),ne="";if(H===-1&&(H=i.indexOf("-"),h=-1),H!==-1){if(ne=i.substring(H+1),i=i.substring(0,H),ne.length!==2&&ne.length!==4)throw new Error("Wrong input string for conversion");let te=parseInt(ne.substring(0,2),10);if(isNaN(te.valueOf()))throw new Error("Wrong input string for conversion");if(u=h*te,ne.length===4){if(te=parseInt(ne.substring(2,4),10),isNaN(te.valueOf()))throw new Error("Wrong input string for conversion");f=h*te}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const h=new Number(`0${i.substring(d)}`);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");s=h.valueOf(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let h=60*s;this.minute=Math.floor(h),h=60*(h-this.minute),this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let h=60*s;this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const h=1e3*s;this.millisecond=Math.floor(h)}break;default:throw new Error("Wrong input string for conversion")}const g=a.exec(n);if(g===null)throw new Error("Wrong input string for conversion");for(let h=1;h<g.length;h++)switch(h){case 1:this.year=parseInt(g[h],10);break;case 2:this.month=parseInt(g[h],10);break;case 3:this.day=parseInt(g[h],10);break;case 4:this.hour=parseInt(g[h],10)+u;break;case 5:this.minute=parseInt(g[h],10)+f;break;case 6:this.second=parseInt(g[h],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const h=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=h.getUTCFullYear(),this.month=h.getUTCMonth(),this.day=h.getUTCDay(),this.hour=h.getUTCHours(),this.minute=h.getUTCMinutes(),this.second=h.getUTCSeconds(),this.millisecond=h.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push(He(this.year,4)),t.push(He(this.month,2)),t.push(He(this.day,2)),t.push(He(this.hour,2)),t.push(He(this.minute,2)),t.push(He(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(He(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Ac=Pi,I.GeneralizedTime=Ac,Pi.NAME="GeneralizedTime";var kc;class mo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}kc=mo,I.DATE=kc,mo.NAME="DATE";var Cc;class bo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Cc=bo,I.TimeOfDay=Cc,bo.NAME="TimeOfDay";var xc;class vo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}xc=vo,I.DateTime=xc,vo.NAME="DateTime";var Bc;class wo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Bc=wo,I.Duration=Bc,wo.NAME="Duration";var Ec;class So extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Ec=So,I.TIME=Ec,So.NAME="TIME";class Lt{constructor({name:e=Pe,optional:t=!1}={}){this.name=e,this.optional=t}}class Ao extends Lt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class Ri extends Lt{constructor({value:e=new Lt,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class hf{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=x.toUint8Array(e)}constructor({data:e=Si}={}){this.dataView=x.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=x.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function Bt(r,e,t){if(t instanceof Ao){for(const s of t.value)if(Bt(r,e,s).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(co)&&(s.name=t.name),s}}if(t instanceof Lt)return t.hasOwnProperty(co)&&(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(!(_a in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,a=e.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==a[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&(r[t.name]=e)),t instanceof I.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof Ri&&(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 d=0;d<t.valueBlock.value.length;d++)f=f&&(t.valueBlock.value[d].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),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 d={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,Pe),t.name&&(delete r[t.name],d.name=t.name)),d}}else if(t.valueBlock.value[0]instanceof Ri){if(a=Bt(r,e.valueBlock.value[f],t.valueBlock.value[0].value),a.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&delete r[t.name]),a;if(co in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let d={};lf in t.valueBlock.value[0]&&t.valueBlock.value[0].local?d=e:d=r,typeof d[t.valueBlock.value[0].name]>"u"&&(d[t.valueBlock.value[0].name]=[]),d[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(a=Bt(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),a.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&delete r[t.name]),a;if(a.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&_a in e.valueBlock){const s=or(e.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&(delete r[t.name],a.name=t.name)),a}return Bt(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=or(x.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Bt(t.result,t.result,e)}const Nc=Object.freeze(Object.defineProperty({__proto__:null,Any:Lt,BaseBlock:we,BaseStringBlock:lo,BitString:Ht,BmpString:xi,Boolean:Ai,CharacterString:ji,Choice:Ao,Constructed:Te,DATE:mo,DateTime:vo,Duration:wo,EndOfContent:uo,Enumerated:ki,GeneralString:Vi,GeneralizedTime:Pi,GraphicString:_i,HexBlock:nt,IA5String:Ti,Integer:ar,Null:Ut,NumericString:Ei,ObjectIdentifier:Ci,OctetString:$t,Primitive:Dr,PrintableString:Ni,RawData:hf,RelativeObjectIdentifier:go,Repeated:Ri,Sequence:Ye,Set:ot,TIME:So,TeletexString:Ii,TimeOfDay:bo,UTCTime:$r,UniversalString:Bi,Utf8String:ht,ValueBlock:Oe,VideotexString:Oi,ViewWriter:wi,VisibleString:Ur,compareSchema:Bt,fromBER:sr,verifySchema:yf},Symbol.toStringTag,{value:"Module"}));var v;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(v||(v={}));var p;(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"})(p||(p={}));class Di{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(x.isBufferSource(e))this.unusedBits=t,this.value=x.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Ht))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 Ht({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ht({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 Y{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):x.isBufferSource(e)?this.buffer=x.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 gf={fromASN:r=>r instanceof Ut?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Ut;const e=sr(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 ar({value:+r})},bf={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new ki({value:r})},le={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new ar({valueHex:r})},vf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ht({valueHex:r})},wf={fromASN:r=>r.valueBlock.toString(),toASN:r=>new Ci({value:r})},Sf={fromASN:r=>r.valueBlock.value,toASN:r=>new Ai({value:r})},Mi={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new $t({valueHex:r})},Af={fromASN:r=>new Y(r.getValue()),toASN:r=>r.toASN()};function We(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Ic=We(ht),kf=We(xi),Cf=We(Bi),xf=We(Ei),Bf=We(Ni),Ef=We(Ii),Nf=We(Oi),If=We(Ti),Of=We(_i),Tf=We(Ur),_f=We(Vi),Vf=We(ji),jf={fromASN:r=>r.toDate(),toASN:r=>new $r({valueDate:r})},Pf={fromASN:r=>r.toDate(),toASN:r=>new Pi({valueDate:r})},Rf={fromASN:()=>null,toASN:()=>new Ut};function Hr(r){switch(r){case p.Any:return gf;case p.BitString:return vf;case p.BmpString:return kf;case p.Boolean:return Sf;case p.CharacterString:return Vf;case p.Enumerated:return bf;case p.GeneralString:return _f;case p.GeneralizedTime:return Pf;case p.GraphicString:return Of;case p.IA5String:return If;case p.Integer:return mf;case p.Null:return Rf;case p.NumericString:return xf;case p.ObjectIdentifier:return wf;case p.OctetString:return Mi;case p.PrintableString:return Bf;case p.TeletexString:return Ef;case p.UTCTime:return jf;case p.UniversalString:return Cf;case p.Utf8String:return Ic;case p.VideotexString:return Nf;case p.VisibleString:return Tf;default:return null}}function yt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:yt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function Oc(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:Oc(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:v.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 a=i.items[s],u=t?s:"";let f;if(typeof a.type=="number"){const g=p[a.type],h=Nc[g];if(!h)throw new Error(`Cannot get ASN1 class by name '${g}'`);f=new h({name:u})}else yt(a.type)?f=new a.type().toSchema(u):a.optional?this.get(a.type).type===v.Choice?f=new Lt({name:u}):(f=this.create(a.type,!1),f.name=u):f=new Lt({name:u});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){f.name="";const g=a.repeated==="set"?ot:Ye;f=new g({name:"",value:[new Ri({name:u,value:f})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||yt(a.type)){const g=a.repeated?Te:Dr;n.push(new g({name:u,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const g=!!a.repeated;let h=g?f:this.get(a.type,!0).schema;h="valueBlock"in h?h.valueBlock.value:h.value,n.push(new Te({name:g?"":u,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:h}))}else n.push(new Te({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[f]}));else f.optional=d,n.push(f)}switch(i.type){case v.Sequence:return new Ye({value:n,name:""});case v.Set:return new ot({value:n,name:""});case v.Choice:return new Ao({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 he=new Mf,S=r=>e=>{let t;he.has(e)?t=he.get(e):(t=he.createDefault(e),he.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;he.has(e.constructor)?i=he.get(e.constructor):(i=he.createDefault(e.constructor),he.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=Hr(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 Lr extends Error{constructor(){super(...arguments),this.schemas=[]}}class Uf{static parse(e,t){const i=sr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){try{if(yt(t))return new t().fromASN(e);const i=he.get(t);he.cache(t);let n=i.schema;const s=this.handleChoiceTypes(e,i,t,n);if(s!=null&&s.result)return s.result;s!=null&&s.targetSchema&&(n=s.targetSchema);const a=this.handleSequenceTypes(e,i,t,n);if(a&&"isManualMapping"in a)return a.result;const u=a,f=new t;return Oc(t)?this.handleArrayTypes(e,i,t):(this.processSchemaItems(i,u,f),f)}catch(i){throw i instanceof Lr&&i.schemas.push(t.name),i}}static handleChoiceTypes(e,t,i,n){if(e.constructor===Te&&t.type===v.Choice&&e.idBlock.tagClass===3)for(const s in t.items){const a=t.items[s];if(a.context===e.idBlock.tagNumber&&a.implicit&&typeof a.type=="function"&&he.has(a.type)){const u=he.get(a.type);if(u&&u.type===v.Sequence){const f=new Ye;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in f.valueBlock){f.valueBlock.value=e.valueBlock.value;const d=this.fromASN(f,a.type),g=new i;return g[s]=d,{result:g}}}}}else if(e.constructor===Te&&t.type!==v.Choice){const s=new Te({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(const a in t.items)delete e[a];return{targetSchema:s}}return null}static handleSequenceTypes(e,t,i,n){if(t.type===v.Sequence){if(Object.keys(t.items).filter(u=>{const f=t.items[u];return f.optional&&typeof f.type=="function"&&he.has(f.type)&&he.get(f.type).type===v.Choice}).length>0&&"value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&i.name==="CertReqMsg")return this.handleManualMapping(e,t,i);const a=Bt({},e,n);if(!a.verified)throw new Lr(`Data does not match to ${i.name} ASN1 schema. ${a.result.error}`);return a}else{const s=Bt({},e,n);if(!s.verified)throw new Lr(`Data does not match to ${i.name} ASN1 schema. ${s.result.error}`);return s}}static handleManualMapping(e,t,i){const n=new i,s=e.valueBlock.value,a=Object.keys(t.items);let u=0;for(let f=0;f<a.length;f++){const d=a[f],g=t.items[d];if(u>=s.length)break;if(g.repeated){n[d]=this.processRepeatedField(s,u,g);break}else if(typeof g.type=="number")n[d]=this.processPrimitiveField(s[u],g),u++;else if(this.isOptionalChoiceField(g)){const h=this.processOptionalChoiceField(s[u],g);h.processed&&(n[d]=h.value,u++)}else n[d]=this.fromASN(s[u],g.type),u++}return{result:n,verified:!0,isManualMapping:!0}}static processRepeatedField(e,t,i){let n=e.slice(t);if(n.length===1&&n[0].constructor.name==="Sequence"){const s=n[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(n=s.valueBlock.value)}if(typeof i.type=="number"){const s=Hr(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(a=>a&&a.valueBlock).map(a=>{try{return s.fromASN(a)}catch{return}}).filter(a=>a!==void 0)}else return n.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,i.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,t){const i=Hr(t.type);if(!i)throw new Error(`No converter for ASN.1 type ${t.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&he.has(e.type)&&he.get(e.type).type===v.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(i){if(i instanceof Lr&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,t,i){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const n=t.itemType;if(typeof n=="number"){const s=Hr(n);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,a=>s.fromASN(a))}else return i.from(e.valueBlock.value,s=>this.fromASN(s,n))}static processSchemaItems(e,t,i){for(const n in e.items){const s=t.result[n];if(!s)continue;const a=e.items[n],u=a.type;typeof u=="number"||yt(u)?i[n]=this.processPrimitiveSchemaItem(s,a,u):i[n]=this.processComplexSchemaItem(s,a,u)}}static processPrimitiveSchemaItem(e,t,i){var n;const s=(n=t.converter)!==null&&n!==void 0?n:yt(i)?new i:null;if(!s)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,s):this.processSinglePrimitiveItem(e,t,i,s)}static processRepeatedPrimitiveItem(e,t,i){if(t.implicit){const n=t.repeated==="sequence"?Ye:ot,s=new n;s.valueBlock=e.valueBlock;const a=sr(s.toBER(!1));if(a.offset===-1)throw new Error(`Cannot parse the child item. ${a.result.error}`);if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const u=a.result.valueBlock.value;return Array.from(u,f=>i.fromASN(f))}else return Array.from(e,n=>i.fromASN(n))}static processSinglePrimitiveItem(e,t,i,n){let s=e;if(t.implicit){let a;if(yt(i))a=new i().toSchema("");else{const u=p[i],f=Nc[u];if(!f)throw new Error(`Cannot get '${u}' class from asn1js module`);a=new f}a.valueBlock=s.valueBlock,s=sr(a.toBER(!1)).result}return n.fromASN(s)}static processComplexSchemaItem(e,t,i){if(t.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,n=>this.fromASN(n,i))}else{const n=this.handleImplicitTagging(e,t,i);if(this.isOptionalChoiceField(t))try{return this.fromASN(n,i)}catch(s){if(s instanceof Lr&&/Wrong values for Choice type/.test(s.message))return;throw s}else return this.fromASN(n,i)}}static handleImplicitTagging(e,t,i){if(t.implicit&&typeof t.context=="number"){const n=he.get(i);if(n.type===v.Sequence){const s=new Ye;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(n.type===v.Set){const s=new ot;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}}class ko{static serialize(e){return e instanceof we?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&yt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=he.get(t);he.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 a=Hr(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>a.toASN(u))}else n=e.map(a=>this.toAsnItem({type:i.itemType},"[]",t,a))}else for(const a in i.items){const u=i.items[a],f=e[a];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&Df(this.serialize(u.defaultValue),this.serialize(f)))continue;const d=ko.toAsnItem(u,a,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||yt(u.type))){const g={};g.valueHex=d instanceof Ut?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Dr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...g}))}else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:d.valueBlock.value}));else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[d]}));else u.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case v.Sequence:s=new Ye({value:n});break;case v.Set:s=new ot({value:n});break;case v.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 a=e.converter;if(!a)throw new Error(`Property '${t}' doesn't have converter for type ${p[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,d=>a.toASN(d)),f=e.repeated==="sequence"?Ye:ot;s=new f({value:u})}else s=a.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?Ye:ot;s=new u({value:a})}else s=this.toASN(n);return s}}class ee extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class B{static serialize(e){return ko.serialize(e)}static parse(e,t){return Uf.parse(e,t)}static toString(e){const t=x.isBufferSource(e)?x.toArrayBuffer(e):B.serialize(e),i=sr(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function c(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;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--)(a=r[u])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;class Tc{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){const t=e.split(".");if(t.length!==4)throw new Error("Invalid IPv4 address");return t.map(i=>{const n=parseInt(i,10);if(isNaN(n)||n<0||n>255)throw new Error("Invalid IPv4 address part");return n})}static parseIPv6(e){const i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((n,s)=>{const a=parseInt(s,16);if(isNaN(a)||a<0||a>65535)throw new Error("Invalid IPv6 address part");return n.push(a>>8&255),n.push(a&255),n},[])}static expandIPv6(e){if(!e.includes("::"))return e;const t=e.split("::");if(t.length>2)throw new Error("Invalid IPv6 address");const i=t[0]?t[0].split(":"):[],n=t[1]?t[1].split(":"):[],s=8-(i.length+n.length);if(s<0)throw new Error("Invalid IPv6 address");return[...i,...Array(s).fill("0"),...n].join(":")}static formatIPv6(e){const t=[];for(let i=0;i<16;i+=2)t.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){const t=e.split(":");let i=-1,n=0,s=-1,a=0;for(let u=0;u<t.length;u++)t[u]==="0"?(s===-1&&(s=u),a++):(a>n&&(i=s,n=a),s=-1,a=0);if(a>n&&(i=s,n=a),n>1){const u=t.slice(0,i).join(":"),f=t.slice(i+n).join(":");return`${u}::${f}`}return e}static parseCIDR(e){const[t,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(t)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),n]}else{if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),n]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;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){const t=new Uint8Array(e);if(t.length===4)return Array.from(t).join(".");if(t.length===16)return this.formatIPv6(t);if(t.length===8||t.length===32){const i=t.length/2,n=t.slice(0,i),s=t.slice(i);if(t.every(f=>f===0))return t.length===8?"0.0.0.0/0":"::/0";const u=s.reduce((f,d)=>f+(d.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(n).join(".")}/${u}`:`${this.formatIPv6(n)}/${u}`}return this.decodeIP(j.ToHex(e))}static fromString(e){if(e.includes("/")){const[i,n]=this.parseCIDR(e),s=new Uint8Array(i.length);let a=n;for(let f=0;f<s.length;f++)a>=8?(s[f]=255,a-=8):a>0&&(s[f]=255<<8-a,a=0);const u=new Uint8Array(i.length*2);return u.set(i,0),u.set(s,i.length),u.buffer}const t=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(t).buffer}}var Co,xo,Bo;let Se=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};c([l({type:p.TeletexString})],Se.prototype,"teletexString",void 0),c([l({type:p.PrintableString})],Se.prototype,"printableString",void 0),c([l({type:p.UniversalString})],Se.prototype,"universalString",void 0),c([l({type:p.Utf8String})],Se.prototype,"utf8String",void 0),c([l({type:p.BmpString})],Se.prototype,"bmpString",void 0),Se=c([S({type:v.Choice})],Se);let cr=class extends Se{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?j.ToHex(this.anyValue):super.toString())}};c([l({type:p.IA5String})],cr.prototype,"ia5String",void 0),c([l({type:p.Any})],cr.prototype,"anyValue",void 0),cr=c([S({type:v.Choice})],cr);class Ui{constructor(e={}){this.type="",this.value=new cr,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Ui.prototype,"type",void 0),c([l({type:cr})],Ui.prototype,"value",void 0);let lr=Co=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Co.prototype)}};lr=Co=c([S({type:v.Set,itemType:Ui})],lr);let Eo=xo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,xo.prototype)}};Eo=xo=c([S({type:v.Sequence,itemType:lr})],Eo);let ye=Bo=class extends Eo{constructor(e){super(e),Object.setPrototypeOf(this,Bo.prototype)}};ye=Bo=c([S({type:v.Sequence})],ye);const $f={fromASN:r=>Tc.toString(Mi.fromASN(r)),toASN:r=>Mi.toASN(Tc.fromString(r))};class Fr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Fr.prototype,"typeId",void 0),c([l({type:p.Any,context:0})],Fr.prototype,"value",void 0);class No{constructor(e={}){this.partyName=new Se,Object.assign(this,e)}}c([l({type:Se,optional:!0,context:0,implicit:!0})],No.prototype,"nameAssigner",void 0),c([l({type:Se,context:1,implicit:!0})],No.prototype,"partyName",void 0);let L=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Fr,context:0,implicit:!0})],L.prototype,"otherName",void 0),c([l({type:p.IA5String,context:1,implicit:!0})],L.prototype,"rfc822Name",void 0),c([l({type:p.IA5String,context:2,implicit:!0})],L.prototype,"dNSName",void 0),c([l({type:p.Any,context:3,implicit:!0})],L.prototype,"x400Address",void 0),c([l({type:ye,context:4,implicit:!1})],L.prototype,"directoryName",void 0),c([l({type:No,context:5})],L.prototype,"ediPartyName",void 0),c([l({type:p.IA5String,context:6,implicit:!0})],L.prototype,"uniformResourceIdentifier",void 0),c([l({type:p.OctetString,context:7,implicit:!0,converter:$f})],L.prototype,"iPAddress",void 0),c([l({type:p.ObjectIdentifier,context:8,implicit:!0})],L.prototype,"registeredID",void 0),L=c([S({type:v.Choice})],L);const Io="1.3.6.1.5.5.7",Hf=`${Io}.1`,ur=`${Io}.3`,$i=`${Io}.48`,_c=`${$i}.1`,Vc=`${$i}.2`,jc=`${$i}.3`,Pc=`${$i}.5`,gt="2.5.29";var Oo;const To=`${Hf}.1`;class qr{constructor(e={}){this.accessMethod="",this.accessLocation=new L,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],qr.prototype,"accessMethod",void 0),c([l({type:L})],qr.prototype,"accessLocation",void 0);let fr=Oo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Oo.prototype)}};fr=Oo=c([S({type:v.Sequence,itemType:qr})],fr);const _o=`${gt}.35`;class Vo extends Y{}class Ft{constructor(e={}){e&&Object.assign(this,e)}}c([l({type:Vo,context:0,optional:!0,implicit:!0})],Ft.prototype,"keyIdentifier",void 0),c([l({type:L,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ft.prototype,"authorityCertIssuer",void 0),c([l({type:p.Integer,context:2,optional:!0,implicit:!0,converter:le})],Ft.prototype,"authorityCertSerialNumber",void 0);const Rc=`${gt}.19`;class Hi{constructor(e={}){this.cA=!1,Object.assign(this,e)}}c([l({type:p.Boolean,defaultValue:!1})],Hi.prototype,"cA",void 0),c([l({type:p.Integer,optional:!0})],Hi.prototype,"pathLenConstraint",void 0);var jo;let Be=jo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,jo.prototype)}};Be=jo=c([S({type:v.Sequence,itemType:L})],Be);var Po;let Dc=Po=class extends Be{constructor(e){super(e),Object.setPrototypeOf(this,Po.prototype)}};Dc=Po=c([S({type:v.Sequence})],Dc);var Ro;const Mc=`${gt}.32`;let mt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};c([l({type:p.IA5String})],mt.prototype,"ia5String",void 0),c([l({type:p.VisibleString})],mt.prototype,"visibleString",void 0),c([l({type:p.BmpString})],mt.prototype,"bmpString",void 0),c([l({type:p.Utf8String})],mt.prototype,"utf8String",void 0),mt=c([S({type:v.Choice})],mt);class Do{constructor(e={}){this.organization=new mt,this.noticeNumbers=[],Object.assign(this,e)}}c([l({type:mt})],Do.prototype,"organization",void 0),c([l({type:p.Integer,repeated:"sequence"})],Do.prototype,"noticeNumbers",void 0);class Mo{constructor(e={}){Object.assign(this,e)}}c([l({type:Do,optional:!0})],Mo.prototype,"noticeRef",void 0),c([l({type:mt,optional:!0})],Mo.prototype,"explicitText",void 0);let Li=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.IA5String})],Li.prototype,"cPSuri",void 0),c([l({type:Mo})],Li.prototype,"userNotice",void 0),Li=c([S({type:v.Choice})],Li);class Uo{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Uo.prototype,"policyQualifierId",void 0),c([l({type:p.Any})],Uo.prototype,"qualifier",void 0);class Fi{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Fi.prototype,"policyIdentifier",void 0),c([l({type:Uo,repeated:"sequence",optional:!0})],Fi.prototype,"policyQualifiers",void 0);let qi=Ro=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Ro.prototype)}};qi=Ro=c([S({type:v.Sequence,itemType:Fi})],qi);let Ki=class{constructor(e=0){this.value=e}};c([l({type:p.Integer})],Ki.prototype,"value",void 0),Ki=c([S({type:v.Choice})],Ki);let Uc=class extends Ki{};Uc=c([S({type:v.Choice})],Uc);var $o;const Ho=`${gt}.31`;var Ze;(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"})(Ze||(Ze={}));class $c extends Di{toJSON(){const e=[],t=this.toNumber();return t&Ze.aACompromise&&e.push("aACompromise"),t&Ze.affiliationChanged&&e.push("affiliationChanged"),t&Ze.cACompromise&&e.push("cACompromise"),t&Ze.certificateHold&&e.push("certificateHold"),t&Ze.cessationOfOperation&&e.push("cessationOfOperation"),t&Ze.keyCompromise&&e.push("keyCompromise"),t&Ze.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Ze.superseded&&e.push("superseded"),t&Ze.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let qt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:L,context:0,repeated:"sequence",implicit:!0})],qt.prototype,"fullName",void 0),c([l({type:lr,context:1,implicit:!0})],qt.prototype,"nameRelativeToCRLIssuer",void 0),qt=c([S({type:v.Choice})],qt);class dr{constructor(e={}){Object.assign(this,e)}}c([l({type:qt,context:0,optional:!0})],dr.prototype,"distributionPoint",void 0),c([l({type:$c,context:1,optional:!0,implicit:!0})],dr.prototype,"reasons",void 0),c([l({type:L,context:2,optional:!0,repeated:"sequence",implicit:!0})],dr.prototype,"cRLIssuer",void 0);let pr=$o=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,$o.prototype)}};pr=$o=c([S({type:v.Sequence,itemType:dr})],pr);var Lo;let Hc=Lo=class extends pr{constructor(e){super(e),Object.setPrototypeOf(this,Lo.prototype)}};Hc=Lo=c([S({type:v.Sequence,itemType:dr})],Hc);class Ee{constructor(e={}){this.onlyContainsUserCerts=Ee.ONLY,this.onlyContainsCACerts=Ee.ONLY,this.indirectCRL=Ee.ONLY,this.onlyContainsAttributeCerts=Ee.ONLY,Object.assign(this,e)}}Ee.ONLY=!1,c([l({type:qt,context:0,optional:!0})],Ee.prototype,"distributionPoint",void 0),c([l({type:p.Boolean,context:1,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsUserCerts",void 0),c([l({type:p.Boolean,context:2,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsCACerts",void 0),c([l({type:$c,context:3,optional:!0,implicit:!0})],Ee.prototype,"onlySomeReasons",void 0),c([l({type:p.Boolean,context:4,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"indirectCRL",void 0),c([l({type:p.Boolean,context:5,defaultValue:Ee.ONLY,implicit:!0})],Ee.prototype,"onlyContainsAttributeCerts",void 0);var Kr;(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"})(Kr||(Kr={}));let Fo=class{constructor(e=Kr.unspecified){this.reason=Kr.unspecified,this.reason=e}toJSON(){return Kr[this.reason]}toString(){return this.toJSON()}};c([l({type:p.Enumerated})],Fo.prototype,"reason",void 0),Fo=c([S({type:v.Choice})],Fo);var qo;const Lc=`${gt}.37`;let Wi=qo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};Wi=qo=c([S({type:v.Sequence,itemType:p.ObjectIdentifier})],Wi);const Lf=`${ur}.1`,Ff=`${ur}.2`,qf=`${ur}.3`,Kf=`${ur}.4`,Wf=`${ur}.8`,Gf=`${ur}.9`;let Ko=class{constructor(e=new ArrayBuffer(0)){this.value=e}};c([l({type:p.Integer,converter:le})],Ko.prototype,"value",void 0),Ko=c([S({type:v.Choice})],Ko);let Wo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};c([l({type:p.GeneralizedTime})],Wo.prototype,"value",void 0),Wo=c([S({type:v.Choice})],Wo);var Go;const Fc=`${gt}.18`;let qc=Go=class extends Be{constructor(e){super(e),Object.setPrototypeOf(this,Go.prototype)}};qc=Go=c([S({type:v.Sequence})],qc);const Kc=`${gt}.15`;var Qe;(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"})(Qe||(Qe={}));class zo extends Di{toJSON(){const e=this.toNumber(),t=[];return e&Qe.cRLSign&&t.push("crlSign"),e&Qe.dataEncipherment&&t.push("dataEncipherment"),e&Qe.decipherOnly&&t.push("decipherOnly"),e&Qe.digitalSignature&&t.push("digitalSignature"),e&Qe.encipherOnly&&t.push("encipherOnly"),e&Qe.keyAgreement&&t.push("keyAgreement"),e&Qe.keyCertSign&&t.push("keyCertSign"),e&Qe.keyEncipherment&&t.push("keyEncipherment"),e&Qe.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var Jo;class Gi{constructor(e={}){this.base=new L,this.minimum=0,Object.assign(this,e)}}c([l({type:L})],Gi.prototype,"base",void 0),c([l({type:p.Integer,context:0,defaultValue:0,implicit:!0})],Gi.prototype,"minimum",void 0),c([l({type:p.Integer,context:1,optional:!0,implicit:!0})],Gi.prototype,"maximum",void 0);let zi=Jo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Jo.prototype)}};zi=Jo=c([S({type:v.Sequence,itemType:Gi})],zi);class Wc{constructor(e={}){Object.assign(this,e)}}c([l({type:zi,context:0,optional:!0,implicit:!0})],Wc.prototype,"permittedSubtrees",void 0),c([l({type:zi,context:1,optional:!0,implicit:!0})],Wc.prototype,"excludedSubtrees",void 0);class Gc{constructor(e={}){Object.assign(this,e)}}c([l({type:p.Integer,context:0,implicit:!0,optional:!0,converter:le})],Gc.prototype,"requireExplicitPolicy",void 0),c([l({type:p.Integer,context:1,implicit:!0,optional:!0,converter:le})],Gc.prototype,"inhibitPolicyMapping",void 0);var Yo;class Zo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Zo.prototype,"issuerDomainPolicy",void 0),c([l({type:p.ObjectIdentifier})],Zo.prototype,"subjectDomainPolicy",void 0);let zc=Yo=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};zc=Yo=c([S({type:v.Sequence,itemType:Zo})],zc);var Qo;const Jc=`${gt}.17`;let Xo=Qo=class extends Be{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Xo=Qo=c([S({type:v.Sequence})],Xo);let bt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],bt.prototype,"type",void 0),c([l({type:p.Any,repeated:"set"})],bt.prototype,"values",void 0);var es;let Yc=es=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,es.prototype)}};Yc=es=c([S({type:v.Sequence,itemType:bt})],Yc);const Zc=`${gt}.14`;class Et extends Vo{}class Qc{constructor(e={}){Object.assign(this,e)}}c([l({type:p.GeneralizedTime,context:0,implicit:!0,optional:!0})],Qc.prototype,"notBefore",void 0),c([l({type:p.GeneralizedTime,context:1,implicit:!0,optional:!0})],Qc.prototype,"notAfter",void 0);var Wr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Wr||(Wr={}));class Xc extends Di{toJSON(){const e=[],t=this.toNumber();return t&Wr.pKIXCertificate&&e.push("pKIXCertificate"),t&Wr.newExtensions&&e.push("newExtensions"),t&Wr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class el{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Xc,Object.assign(this,e)}}c([l({type:p.GeneralString})],el.prototype,"entrustVers",void 0),c([l({type:Xc})],el.prototype,"entrustInfoFlags",void 0);var ts;let tl=ts=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ts.prototype)}};tl=ts=c([S({type:v.Sequence,itemType:qr})],tl);class N{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof N&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Ia(e.parameters,this.parameters)||e.parameters===this.parameters)}}c([l({type:p.ObjectIdentifier})],N.prototype,"algorithm",void 0),c([l({type:p.Any,optional:!0})],N.prototype,"parameters",void 0);class st{constructor(e={}){this.algorithm=new N,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:N})],st.prototype,"algorithm",void 0),c([l({type:p.BitString})],st.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}};c([l({type:p.UTCTime})],Ae.prototype,"utcTime",void 0),c([l({type:p.GeneralizedTime})],Ae.prototype,"generalTime",void 0),Ae=c([S({type:v.Choice})],Ae);class Ji{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))}}c([l({type:Ae})],Ji.prototype,"notBefore",void 0),c([l({type:Ae})],Ji.prototype,"notAfter",void 0);var rs;let Xe=class Gu{constructor(e={}){this.extnID="",this.critical=Gu.CRITICAL,this.extnValue=new Y,Object.assign(this,e)}};Xe.CRITICAL=!1,c([l({type:p.ObjectIdentifier})],Xe.prototype,"extnID",void 0),c([l({type:p.Boolean,defaultValue:Xe.CRITICAL})],Xe.prototype,"critical",void 0),c([l({type:Y})],Xe.prototype,"extnValue",void 0);let Kt=rs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,rs.prototype)}};Kt=rs=c([S({type:v.Sequence,itemType:Xe})],Kt);var hr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(hr||(hr={}));class Ge{constructor(e={}){this.version=hr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new N,this.issuer=new ye,this.validity=new Ji,this.subject=new ye,this.subjectPublicKeyInfo=new st,Object.assign(this,e)}}c([l({type:p.Integer,context:0,defaultValue:hr.v1})],Ge.prototype,"version",void 0),c([l({type:p.Integer,converter:le})],Ge.prototype,"serialNumber",void 0),c([l({type:N})],Ge.prototype,"signature",void 0),c([l({type:ye})],Ge.prototype,"issuer",void 0),c([l({type:Ji})],Ge.prototype,"validity",void 0),c([l({type:ye})],Ge.prototype,"subject",void 0),c([l({type:st})],Ge.prototype,"subjectPublicKeyInfo",void 0),c([l({type:p.BitString,context:1,implicit:!0,optional:!0})],Ge.prototype,"issuerUniqueID",void 0),c([l({type:p.BitString,context:2,implicit:!0,optional:!0})],Ge.prototype,"subjectUniqueID",void 0),c([l({type:Kt,context:3,optional:!0})],Ge.prototype,"extensions",void 0);class yr{constructor(e={}){this.tbsCertificate=new Ge,this.signatureAlgorithm=new N,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Ge})],yr.prototype,"tbsCertificate",void 0),c([l({type:N})],yr.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],yr.prototype,"signatureValue",void 0);class Yi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Ae,Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],Yi.prototype,"userCertificate",void 0),c([l({type:Ae})],Yi.prototype,"revocationDate",void 0),c([l({type:Xe,optional:!0,repeated:"sequence"})],Yi.prototype,"crlEntryExtensions",void 0);class vt{constructor(e={}){this.signature=new N,this.issuer=new ye,this.thisUpdate=new Ae,Object.assign(this,e)}}c([l({type:p.Integer,optional:!0})],vt.prototype,"version",void 0),c([l({type:N})],vt.prototype,"signature",void 0),c([l({type:ye})],vt.prototype,"issuer",void 0),c([l({type:Ae})],vt.prototype,"thisUpdate",void 0),c([l({type:Ae,optional:!0})],vt.prototype,"nextUpdate",void 0),c([l({type:Yi,repeated:"sequence",optional:!0})],vt.prototype,"revokedCertificates",void 0),c([l({type:Xe,optional:!0,context:0,repeated:"sequence"})],vt.prototype,"crlExtensions",void 0);let is=class{constructor(e={}){this.tbsCertList=new vt,this.signatureAlgorithm=new N,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};c([l({type:vt})],is.prototype,"tbsCertList",void 0),c([l({type:N})],is.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],is.prototype,"signature",void 0);class gr{constructor(e={}){this.issuer=new ye,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:ye})],gr.prototype,"issuer",void 0),c([l({type:p.Integer,converter:le})],gr.prototype,"serialNumber",void 0);let mr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0})],mr.prototype,"subjectKeyIdentifier",void 0),c([l({type:gr})],mr.prototype,"issuerAndSerialNumber",void 0),mr=c([S({type:v.Choice})],mr);var wt;(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"})(wt||(wt={}));let Gr=class extends N{};Gr=c([S({type:v.Sequence})],Gr);let Zi=class extends N{};Zi=c([S({type:v.Sequence})],Zi);let at=class extends N{};at=c([S({type:v.Sequence})],at);let Qi=class extends N{};Qi=c([S({type:v.Sequence})],Qi);let rl=class extends N{};rl=c([S({type:v.Sequence})],rl);let ns=class extends N{};ns=c([S({type:v.Sequence})],ns);let br=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],br.prototype,"attrType",void 0),c([l({type:p.Any,repeated:"set"})],br.prototype,"attrValues",void 0);var os;class ct{constructor(e={}){this.version=wt.v0,this.sid=new mr,this.digestAlgorithm=new Gr,this.signatureAlgorithm=new Zi,this.signature=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],ct.prototype,"version",void 0),c([l({type:mr})],ct.prototype,"sid",void 0),c([l({type:Gr})],ct.prototype,"digestAlgorithm",void 0),c([l({type:br,repeated:"set",context:0,implicit:!0,optional:!0})],ct.prototype,"signedAttrs",void 0),c([l({type:Zi})],ct.prototype,"signatureAlgorithm",void 0),c([l({type:Y})],ct.prototype,"signature",void 0),c([l({type:br,repeated:"set",context:1,implicit:!0,optional:!0})],ct.prototype,"unsignedAttrs",void 0);let Xi=os=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,os.prototype)}};Xi=os=c([S({type:v.Set,itemType:ct})],Xi);let il=class extends Ae{};il=c([S({type:v.Choice})],il);let nl=class extends ct{};nl=c([S({type:v.Sequence})],nl);class ss{constructor(e={}){this.acIssuer=new L,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}c([l({type:L})],ss.prototype,"acIssuer",void 0),c([l({type:p.Integer})],ss.prototype,"acSerial",void 0),c([l({type:bt,repeated:"sequence"})],ss.prototype,"attrs",void 0);var as;let en=as=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,as.prototype)}};en=as=c([S({type:v.Sequence,itemType:p.ObjectIdentifier})],en);class tn{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}c([l({type:p.Integer,optional:!0})],tn.prototype,"pathLenConstraint",void 0),c([l({type:en,implicit:!0,context:0,optional:!0})],tn.prototype,"permittedAttrs",void 0),c([l({type:en,implicit:!0,context:1,optional:!0})],tn.prototype,"excludedAttrs",void 0),c([l({type:p.Boolean,defaultValue:!0})],tn.prototype,"permitUnSpecified",void 0);class Wt{constructor(e={}){this.issuer=new Be,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Be})],Wt.prototype,"issuer",void 0),c([l({type:p.Integer,converter:le})],Wt.prototype,"serial",void 0),c([l({type:p.BitString,optional:!0})],Wt.prototype,"issuerUID",void 0);var cs;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(cs||(cs={}));class Gt{constructor(e={}){this.digestedObjectType=cs.publicKey,this.digestAlgorithm=new N,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Enumerated})],Gt.prototype,"digestedObjectType",void 0),c([l({type:p.ObjectIdentifier,optional:!0})],Gt.prototype,"otherObjectTypeID",void 0),c([l({type:N})],Gt.prototype,"digestAlgorithm",void 0),c([l({type:p.BitString})],Gt.prototype,"objectDigest",void 0);class rn{constructor(e={}){Object.assign(this,e)}}c([l({type:Be,optional:!0})],rn.prototype,"issuerName",void 0),c([l({type:Wt,context:0,implicit:!0,optional:!0})],rn.prototype,"baseCertificateID",void 0),c([l({type:Gt,context:1,implicit:!0,optional:!0})],rn.prototype,"objectDigestInfo",void 0);let vr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:L,repeated:"sequence"})],vr.prototype,"v1Form",void 0),c([l({type:rn,context:0,implicit:!0})],vr.prototype,"v2Form",void 0),vr=c([S({type:v.Choice})],vr);class nn{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}c([l({type:p.GeneralizedTime})],nn.prototype,"notBeforeTime",void 0),c([l({type:p.GeneralizedTime})],nn.prototype,"notAfterTime",void 0);class zr{constructor(e={}){Object.assign(this,e)}}c([l({type:Wt,implicit:!0,context:0,optional:!0})],zr.prototype,"baseCertificateID",void 0),c([l({type:Be,implicit:!0,context:1,optional:!0})],zr.prototype,"entityName",void 0),c([l({type:Gt,implicit:!0,context:2,optional:!0})],zr.prototype,"objectDigestInfo",void 0);var ls;(function(r){r[r.v2=1]="v2"})(ls||(ls={}));class et{constructor(e={}){this.version=ls.v2,this.holder=new zr,this.issuer=new vr,this.signature=new N,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new nn,this.attributes=[],Object.assign(this,e)}}c([l({type:p.Integer})],et.prototype,"version",void 0),c([l({type:zr})],et.prototype,"holder",void 0),c([l({type:vr})],et.prototype,"issuer",void 0),c([l({type:N})],et.prototype,"signature",void 0),c([l({type:p.Integer,converter:le})],et.prototype,"serialNumber",void 0),c([l({type:nn})],et.prototype,"attrCertValidityPeriod",void 0),c([l({type:bt,repeated:"sequence"})],et.prototype,"attributes",void 0),c([l({type:p.BitString,optional:!0})],et.prototype,"issuerUniqueID",void 0),c([l({type:Kt,optional:!0})],et.prototype,"extensions",void 0);class on{constructor(e={}){this.acinfo=new et,this.signatureAlgorithm=new N,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:et})],on.prototype,"acinfo",void 0),c([l({type:N})],on.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],on.prototype,"signatureValue",void 0);var sn;(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"})(sn||(sn={}));class us extends Di{}class fs{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier,implicit:!0,context:0})],fs.prototype,"type",void 0),c([l({type:p.Any,implicit:!0,context:1})],fs.prototype,"value",void 0);class ds{constructor(e={}){this.policyId="",this.classList=new us(sn.unclassified),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],ds.prototype,"policyId",void 0),c([l({type:us,defaultValue:new us(sn.unclassified)})],ds.prototype,"classList",void 0),c([l({type:fs,repeated:"set"})],ds.prototype,"securityCategories",void 0);class an{constructor(e={}){Object.assign(this,e)}}c([l({type:Y})],an.prototype,"cotets",void 0),c([l({type:p.ObjectIdentifier})],an.prototype,"oid",void 0),c([l({type:p.Utf8String})],an.prototype,"string",void 0);class ol{constructor(e={}){this.values=[],Object.assign(this,e)}}c([l({type:Be,implicit:!0,context:0,optional:!0})],ol.prototype,"policyAuthority",void 0),c([l({type:an,repeated:"sequence"})],ol.prototype,"values",void 0);var ps;class cn{constructor(e={}){this.targetCertificate=new Wt,Object.assign(this,e)}}c([l({type:Wt})],cn.prototype,"targetCertificate",void 0),c([l({type:L,optional:!0})],cn.prototype,"targetName",void 0),c([l({type:Gt,optional:!0})],cn.prototype,"certDigestInfo",void 0);let wr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:L,context:0,implicit:!0})],wr.prototype,"targetName",void 0),c([l({type:L,context:1,implicit:!0})],wr.prototype,"targetGroup",void 0),c([l({type:cn,context:2,implicit:!0})],wr.prototype,"targetCert",void 0),wr=c([S({type:v.Choice})],wr);let hs=ps=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ps.prototype)}};hs=ps=c([S({type:v.Sequence,itemType:wr})],hs);var ys;let sl=ys=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ys.prototype)}};sl=ys=c([S({type:v.Sequence,itemType:hs})],sl);class al{constructor(e={}){Object.assign(this,e)}}c([l({type:Be,implicit:!0,context:0,optional:!0})],al.prototype,"roleAuthority",void 0),c([l({type:L,implicit:!0,context:1})],al.prototype,"roleName",void 0);class gs{constructor(e={}){this.service=new L,this.ident=new L,Object.assign(this,e)}}c([l({type:L})],gs.prototype,"service",void 0),c([l({type:L})],gs.prototype,"ident",void 0),c([l({type:Y,optional:!0})],gs.prototype,"authInfo",void 0);var ms;class bs{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],bs.prototype,"otherCertFormat",void 0),c([l({type:p.Any})],bs.prototype,"otherCert",void 0);let Sr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:yr})],Sr.prototype,"certificate",void 0),c([l({type:on,context:2,implicit:!0})],Sr.prototype,"v2AttrCert",void 0),c([l({type:bs,context:3,implicit:!0})],Sr.prototype,"other",void 0),Sr=c([S({type:v.Choice})],Sr);let ln=ms=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ms.prototype)}};ln=ms=c([S({type:v.Set,itemType:Sr})],ln);class Ar{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Ar.prototype,"contentType",void 0),c([l({type:p.Any,context:0})],Ar.prototype,"content",void 0);let Jr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Y})],Jr.prototype,"single",void 0),c([l({type:p.Any})],Jr.prototype,"any",void 0),Jr=c([S({type:v.Choice})],Jr);class un{constructor(e={}){this.eContentType="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],un.prototype,"eContentType",void 0),c([l({type:Jr,context:0,optional:!0})],un.prototype,"eContent",void 0);let Yr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Y,context:0,implicit:!0,optional:!0})],Yr.prototype,"value",void 0),c([l({type:Y,converter:Af,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Yr.prototype,"constructedValue",void 0),Yr=c([S({type:v.Choice})],Yr);class Zr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Qi,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Zr.prototype,"contentType",void 0),c([l({type:Qi})],Zr.prototype,"contentEncryptionAlgorithm",void 0),c([l({type:Yr,optional:!0})],Zr.prototype,"encryptedContent",void 0);class fn{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],fn.prototype,"keyAttrId",void 0),c([l({type:p.Any,optional:!0})],fn.prototype,"keyAttr",void 0);var vs;class dn{constructor(e={}){this.subjectKeyIdentifier=new Et,Object.assign(this,e)}}c([l({type:Et})],dn.prototype,"subjectKeyIdentifier",void 0),c([l({type:p.GeneralizedTime,optional:!0})],dn.prototype,"date",void 0),c([l({type:fn,optional:!0})],dn.prototype,"other",void 0);let kr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:dn,context:0,implicit:!0,optional:!0})],kr.prototype,"rKeyId",void 0),c([l({type:gr,optional:!0})],kr.prototype,"issuerAndSerialNumber",void 0),kr=c([S({type:v.Choice})],kr);class ws{constructor(e={}){this.rid=new kr,this.encryptedKey=new Y,Object.assign(this,e)}}c([l({type:kr})],ws.prototype,"rid",void 0),c([l({type:Y})],ws.prototype,"encryptedKey",void 0);let pn=vs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};pn=vs=c([S({type:v.Sequence,itemType:ws})],pn);class Ss{constructor(e={}){this.algorithm=new N,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:N})],Ss.prototype,"algorithm",void 0),c([l({type:p.BitString})],Ss.prototype,"publicKey",void 0);let zt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0,optional:!0})],zt.prototype,"subjectKeyIdentifier",void 0),c([l({type:Ss,context:1,implicit:!0,optional:!0})],zt.prototype,"originatorKey",void 0),c([l({type:gr,optional:!0})],zt.prototype,"issuerAndSerialNumber",void 0),zt=c([S({type:v.Choice})],zt);class Cr{constructor(e={}){this.version=wt.v3,this.originator=new zt,this.keyEncryptionAlgorithm=new at,this.recipientEncryptedKeys=new pn,Object.assign(this,e)}}c([l({type:p.Integer})],Cr.prototype,"version",void 0),c([l({type:zt,context:0})],Cr.prototype,"originator",void 0),c([l({type:Y,context:1,optional:!0})],Cr.prototype,"ukm",void 0),c([l({type:at})],Cr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:pn})],Cr.prototype,"recipientEncryptedKeys",void 0);let xr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0})],xr.prototype,"subjectKeyIdentifier",void 0),c([l({type:gr})],xr.prototype,"issuerAndSerialNumber",void 0),xr=c([S({type:v.Choice})],xr);class Qr{constructor(e={}){this.version=wt.v0,this.rid=new xr,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],Qr.prototype,"version",void 0),c([l({type:xr})],Qr.prototype,"rid",void 0),c([l({type:at})],Qr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Y})],Qr.prototype,"encryptedKey",void 0);class Xr{constructor(e={}){this.keyIdentifier=new Y,Object.assign(this,e)}}c([l({type:Y})],Xr.prototype,"keyIdentifier",void 0),c([l({type:p.GeneralizedTime,optional:!0})],Xr.prototype,"date",void 0),c([l({type:fn,optional:!0})],Xr.prototype,"other",void 0);class ei{constructor(e={}){this.version=wt.v4,this.kekid=new Xr,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],ei.prototype,"version",void 0),c([l({type:Xr})],ei.prototype,"kekid",void 0),c([l({type:at})],ei.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Y})],ei.prototype,"encryptedKey",void 0);class ti{constructor(e={}){this.version=wt.v0,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],ti.prototype,"version",void 0),c([l({type:ns,context:0,optional:!0})],ti.prototype,"keyDerivationAlgorithm",void 0),c([l({type:at})],ti.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Y})],ti.prototype,"encryptedKey",void 0);class As{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],As.prototype,"oriType",void 0),c([l({type:p.Any})],As.prototype,"oriValue",void 0);let Nt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Qr,optional:!0})],Nt.prototype,"ktri",void 0),c([l({type:Cr,context:1,implicit:!0,optional:!0})],Nt.prototype,"kari",void 0),c([l({type:ei,context:2,implicit:!0,optional:!0})],Nt.prototype,"kekri",void 0),c([l({type:ti,context:3,implicit:!0,optional:!0})],Nt.prototype,"pwri",void 0),c([l({type:As,context:4,implicit:!0,optional:!0})],Nt.prototype,"ori",void 0),Nt=c([S({type:v.Choice})],Nt);var ks;let hn=ks=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,ks.prototype)}};hn=ks=c([S({type:v.Set,itemType:Nt})],hn);var Cs;class yn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],yn.prototype,"otherRevInfoFormat",void 0),c([l({type:p.Any})],yn.prototype,"otherRevInfo",void 0);let gn=class{constructor(e={}){this.other=new yn,Object.assign(this,e)}};c([l({type:yn,context:1,implicit:!0})],gn.prototype,"other",void 0),gn=c([S({type:v.Choice})],gn);let mn=Cs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};mn=Cs=c([S({type:v.Set,itemType:gn})],mn);class xs{constructor(e={}){Object.assign(this,e)}}c([l({type:ln,context:0,implicit:!0,optional:!0})],xs.prototype,"certs",void 0),c([l({type:mn,context:1,implicit:!0,optional:!0})],xs.prototype,"crls",void 0);var Bs;let Es=Bs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Bs.prototype)}};Es=Bs=c([S({type:v.Set,itemType:br})],Es);class ri{constructor(e={}){this.version=wt.v0,this.recipientInfos=new hn,this.encryptedContentInfo=new Zr,Object.assign(this,e)}}c([l({type:p.Integer})],ri.prototype,"version",void 0),c([l({type:xs,context:0,implicit:!0,optional:!0})],ri.prototype,"originatorInfo",void 0),c([l({type:hn})],ri.prototype,"recipientInfos",void 0),c([l({type:Zr})],ri.prototype,"encryptedContentInfo",void 0),c([l({type:Es,context:1,implicit:!0,optional:!0})],ri.prototype,"unprotectedAttrs",void 0);const zf="1.2.840.113549.1.7.2";var Ns;let bn=Ns=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Ns.prototype)}};bn=Ns=c([S({type:v.Set,itemType:Gr})],bn);class Br{constructor(e={}){this.version=wt.v0,this.digestAlgorithms=new bn,this.encapContentInfo=new un,this.signerInfos=new Xi,Object.assign(this,e)}}c([l({type:p.Integer})],Br.prototype,"version",void 0),c([l({type:bn})],Br.prototype,"digestAlgorithms",void 0),c([l({type:un})],Br.prototype,"encapContentInfo",void 0),c([l({type:ln,context:0,implicit:!0,optional:!0})],Br.prototype,"certificates",void 0),c([l({type:mn,context:1,implicit:!0,optional:!0})],Br.prototype,"crls",void 0),c([l({type:Xi})],Br.prototype,"signerInfos",void 0);const ii="1.2.840.10045.2.1",Is="1.2.840.10045.4.1",cl="1.2.840.10045.4.3.1",Os="1.2.840.10045.4.3.2",Ts="1.2.840.10045.4.3.3",_s="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 ni(r){return new N({algorithm:r})}const Jf=ni(Is);ni(cl);const Yf=ni(Os),Zf=ni(Ts),Qf=ni(_s);let oi=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],oi.prototype,"fieldType",void 0),c([l({type:p.Any})],oi.prototype,"parameters",void 0),oi=c([S({type:v.Sequence})],oi);class Xf extends Y{}let Er=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.OctetString})],Er.prototype,"a",void 0),c([l({type:p.OctetString})],Er.prototype,"b",void 0),c([l({type:p.BitString,optional:!0})],Er.prototype,"seed",void 0),Er=c([S({type:v.Sequence})],Er);var Vs;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Vs||(Vs={}));let St=class{constructor(e={}){this.version=Vs.ecpVer1,Object.assign(this,e)}};c([l({type:p.Integer})],St.prototype,"version",void 0),c([l({type:oi})],St.prototype,"fieldID",void 0),c([l({type:Er})],St.prototype,"curve",void 0),c([l({type:Xf})],St.prototype,"base",void 0),c([l({type:p.Integer,converter:le})],St.prototype,"order",void 0),c([l({type:p.Integer,optional:!0})],St.prototype,"cofactor",void 0),St=c([S({type:v.Sequence})],St);let It=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],It.prototype,"namedCurve",void 0),c([l({type:p.Null})],It.prototype,"implicitCurve",void 0),c([l({type:St})],It.prototype,"specifiedCurve",void 0),It=c([S({type:v.Choice})],It);class vn{constructor(e={}){this.version=1,this.privateKey=new Y,Object.assign(this,e)}}c([l({type:p.Integer})],vn.prototype,"version",void 0),c([l({type:Y})],vn.prototype,"privateKey",void 0),c([l({type:It,context:0,optional:!0})],vn.prototype,"parameters",void 0),c([l({type:p.BitString,context:1,optional:!0})],vn.prototype,"publicKey",void 0);class wn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],wn.prototype,"r",void 0),c([l({type:p.Integer,converter:le})],wn.prototype,"s",void 0);const Re="1.2.840.113549.1.1",Jt=`${Re}.1`,ed=`${Re}.7`,td=`${Re}.9`,si=`${Re}.10`,rd=`${Re}.2`,id=`${Re}.4`,Sn=`${Re}.5`,nd=`${Re}.14`,js=`${Re}.11`,An=`${Re}.12`,kn=`${Re}.13`,dl=`${Re}.15`,pl=`${Re}.16`,Cn="1.3.14.3.2.26",hl="2.16.840.1.101.3.4.2.4",xn="2.16.840.1.101.3.4.2.1",Bn="2.16.840.1.101.3.4.2.2",En="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",Nn=`${Re}.8`;function ge(r){return new N({algorithm:r,parameters:null})}ge(ad),ge(cd);const Yt=ge(Cn);ge(hl),ge(xn),ge(Bn),ge(En),ge(od),ge(sd);const yl=new N({algorithm:Nn,parameters:B.serialize(Yt)}),gl=new N({algorithm:td,parameters:B.serialize(Mi.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(Jt),ge(rd),ge(id),ge(Sn),ge(dl),ge(pl),ge(An),ge(kn),ge(dl),ge(pl);class In{constructor(e={}){this.hashAlgorithm=new N(Yt),this.maskGenAlgorithm=new N({algorithm:Nn,parameters:B.serialize(Yt)}),this.pSourceAlgorithm=new N(gl),Object.assign(this,e)}}c([l({type:N,context:0,defaultValue:Yt})],In.prototype,"hashAlgorithm",void 0),c([l({type:N,context:1,defaultValue:yl})],In.prototype,"maskGenAlgorithm",void 0),c([l({type:N,context:2,defaultValue:gl})],In.prototype,"pSourceAlgorithm",void 0),new N({algorithm:ed,parameters:B.serialize(new In)});class Zt{constructor(e={}){this.hashAlgorithm=new N(Yt),this.maskGenAlgorithm=new N({algorithm:Nn,parameters:B.serialize(Yt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}c([l({type:N,context:0,defaultValue:Yt})],Zt.prototype,"hashAlgorithm",void 0),c([l({type:N,context:1,defaultValue:yl})],Zt.prototype,"maskGenAlgorithm",void 0),c([l({type:p.Integer,context:2,defaultValue:20})],Zt.prototype,"saltLength",void 0),c([l({type:p.Integer,context:3,defaultValue:1})],Zt.prototype,"trailerField",void 0),new N({algorithm:si,parameters:B.serialize(new Zt)});class On{constructor(e={}){this.digestAlgorithm=new N,this.digest=new Y,Object.assign(this,e)}}c([l({type:N})],On.prototype,"digestAlgorithm",void 0),c([l({type:Y})],On.prototype,"digest",void 0);var Ps;class Tn{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],Tn.prototype,"prime",void 0),c([l({type:p.Integer,converter:le})],Tn.prototype,"exponent",void 0),c([l({type:p.Integer,converter:le})],Tn.prototype,"coefficient",void 0);let Rs=Ps=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Ps.prototype)}};Rs=Ps=c([S({type:v.Sequence,itemType:Tn})],Rs);class lt{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)}}c([l({type:p.Integer})],lt.prototype,"version",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"modulus",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"publicExponent",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"privateExponent",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"prime1",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"prime2",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"exponent1",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"exponent2",void 0),c([l({type:p.Integer,converter:le})],lt.prototype,"coefficient",void 0),c([l({type:Rs,optional:!0})],lt.prototype,"otherPrimeInfos",void 0);class Ds{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],Ds.prototype,"modulus",void 0),c([l({type:p.Integer,converter:le})],Ds.prototype,"publicExponent",void 0);var Ms;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(Ms||(Ms={}));const De=Ms;/*! *****************************************************************************
|
|
76
|
+
Copyright (c) Microsoft Corporation.
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
79
|
+
purpose with or without fee is hereby granted.
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
82
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
83
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
84
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
85
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
+
***************************************************************************** */var Us=function(r,e){return Us=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])},Us(r,e)};function $s(r,e){Us(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(a){a(s)})}return new(t||(t=Promise))(function(s,a){function u(g){try{d(i.next(g))}catch(h){a(h)}}function f(g){try{d(i.throw(g))}catch(h){a(h)}}function d(g){g.done?s(g.value):n(g.value).then(u,f)}d((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,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(d){return function(g){return f([d,g])}}function f(d){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,n=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){t.label=d[1];break}if(d[0]===6&&t.label<s[1]){t.label=s[1],s=d;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(d);break}s[2]&&t.ops.pop(),t.trys.pop();continue}d=e.call(r,t)}catch(g){d=[6,g],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function _n(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 Vn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return s}function Qt(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Vn(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 ml(r){return!!r.useClass}function Hs(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,a=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(i,this.createHandler(a))},r.prototype.createHandler=function(e){var t={},i=function(n){t[n]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=e();var u=Reflect[n];return u.apply(void 0,Qt(s))}};return this.reflectMethods.forEach(i),t},r}();function Nr(r){return typeof r=="string"||typeof r=="symbol"}function pd(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 hd(r){return typeof r=="function"||r instanceof bl}function jn(r){return!!r.useToken}function Pn(r){return r.useValue!=null}function yd(r){return ml(r)||Pn(r)||jn(r)||Hs(r)}var Ls=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){$s(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ls),Rn=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 bd(r,e,t){return t===void 0&&(t=" "),Qt([r],e.message.split(`
|
|
89
89
|
`).map(function(i){return t+i})).join(`
|
|
90
|
-
`)}function Sd(r,e,t){var i=_n(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,a=wd(s,e);return Ad("Cannot inject the dependency "+a+' of "'+r.name+'" constructor. Reason:',t)}function kd(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var Cd=function(r){Ms(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}($s),xd=function(r){Ms(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}($s),Bd=function(){function r(){this.preResolution=new Cd,this.postResolution=new xd}return r}(),wl=new Map,Ed=function(){function r(e){this.parent=e,this._registry=new vd,this.interceptors=new Bd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:Re.Transient}),this.ensureNotDisposed();var n;if(bd(t)?n=t:n={useClass:t},Vn(n))for(var s=[e],a=n;a!=null;){var u=a.useToken;if(s.includes(u))throw new Error("Token registration cycle detected! "+Yt(s,[u]).join(" -> "));s.push(u);var f=this._registry.get(u);f&&Vn(f.provider)?a=f.provider:a=null}if((i.lifecycle===Re.Singleton||i.lifecycle==Re.ContainerScoped||i.lifecycle==Re.ResolutionScoped)&&(jn(n)||Us(n)))throw new Error('Cannot use lifecycle "'+Re[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(),Br(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(),Br(e)){if(Br(t))return this.register(e,{useToken:t},{lifecycle:Re.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Re.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!Br(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:Re.Singleton})},r.prototype.resolve=function(e,t,i){t===void 0&&(t=new Pn),i===void 0&&(i=!1),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&Br(e)){if(i)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),n){var s=this.resolveRegistration(n,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(md(e)){var s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var i,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var a=Tn(this.interceptors.preResolution.getAll(e)),u=a.next();!u.done;u=a.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(d){i={error:d}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}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 a=[];try{for(var u=Tn(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var d=f.value;d.options.frequency!="Once"&&a.push(d),d.callback(e,t,i)}}catch(g){n={error:g}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,a)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Re.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===Re.Singleton,n=e.options.lifecycle===Re.ContainerScoped,s=i||n,a;return jn(e.provider)?a=e.provider.useValue:Vn(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):ml(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Us(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,t),e.options.lifecycle===Re.ResolutionScoped&&t.scopedResolutions.set(e,a),a},r.prototype.resolveAll=function(e,t,i){var n=this;t===void 0&&(t=new Pn),i===void 0&&(i=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&Br(e)){if(i)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var a=s.map(function(f){return n.resolveRegistration(f,t)});return this.executePostResolutionInterceptor(e,a,"All"),a}var u=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,u,"All"),u},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=Tn(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=_n(n.value,2),a=s[0],u=s[1];this._registry.setAll(a,u.filter(function(f){return!jn(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=Tn(this._registry.entries()),s=n.next();!s.done;s=n.next()){var a=_n(s.value,2),u=a[0],f=a[1];f.some(function(d){var g=d.options;return g.lifecycle===Re.ContainerScoped})&&i._registry.setAll(u,f.map(function(d){return d.options.lifecycle===Re.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){e={error:d}}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 dd(this,void 0,void 0,function(){var e;return pd(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=wl.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var a=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Yt([void 0],a)))}();return kd(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var a,u,f;try{return gd(n)?vl(n)?n.multiple?(a=i.resolve(n.transform)).transform.apply(a,Yt([i.resolveAll(n.token,new Pn,n.isOptional)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Yt([i.resolve(n.token,e,n.isOptional)],n.transformArgs)):n.multiple?i.resolveAll(n.token,new Pn,n.isOptional):i.resolve(n.token,e,n.isOptional):vl(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Yt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(d){throw new Error(Sd(t,s,d))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),_e=new Ed;function Rn(r){return function(e){wl.set(e,yd(e))}}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 Hs;class Dn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}c([l({type:p.ObjectIdentifier})],Dn.prototype,"attrId",void 0),c([l({type:p.Any,repeated:"set"})],Dn.prototype,"attrValues",void 0);let Al=Hs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Hs.prototype)}};Al=Hs=c([A({type:v.Sequence,itemType:Dn})],Al);var Ls;let Sl=Ls=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Ls.prototype)}};Sl=Ls=c([A({type:v.Sequence,itemType:wr})],Sl);class kl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],kl.prototype,"certId",void 0),c([l({type:p.Any,context:0})],kl.prototype,"certValue",void 0);class Cl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Cl.prototype,"crlId",void 0),c([l({type:p.Any,context:0})],Cl.prototype,"crltValue",void 0);class xl extends Y{}let Mn=class{constructor(e={}){this.encryptionAlgorithm=new I,this.encryptedData=new xl,Object.assign(this,e)}};c([l({type:I})],Mn.prototype,"encryptionAlgorithm",void 0),c([l({type:xl})],Mn.prototype,"encryptedData",void 0);var Fs,qs;(function(r){r[r.v1=0]="v1"})(qs||(qs={}));class Bl extends Y{}let Ks=Fs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Fs.prototype)}};Ks=Fs=c([A({type:v.Sequence,itemType:bt})],Ks);class oi{constructor(e={}){this.version=qs.v1,this.privateKeyAlgorithm=new I,this.privateKey=new Bl,Object.assign(this,e)}}c([l({type:p.Integer})],oi.prototype,"version",void 0),c([l({type:I})],oi.prototype,"privateKeyAlgorithm",void 0),c([l({type:Bl})],oi.prototype,"privateKey",void 0),c([l({type:Ks,implicit:!0,context:0,optional:!0})],oi.prototype,"attributes",void 0);let El=class extends oi{};El=c([A({type:v.Sequence})],El);let Il=class extends Mn{};Il=c([A({type:v.Sequence})],Il);class Nl{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Nl.prototype,"secretTypeId",void 0),c([l({type:p.Any,context:0})],Nl.prototype,"secretValue",void 0);class si{constructor(e={}){this.mac=new Nn,this.macSalt=new Y,this.iterations=1,Object.assign(this,e)}}c([l({type:Nn})],si.prototype,"mac",void 0),c([l({type:Y})],si.prototype,"macSalt",void 0),c([l({type:p.Integer,defaultValue:1})],si.prototype,"iterations",void 0);class Un{constructor(e={}){this.version=3,this.authSafe=new wr,this.macData=new si,Object.assign(this,e)}}c([l({type:p.Integer})],Un.prototype,"version",void 0),c([l({type:wr})],Un.prototype,"authSafe",void 0),c([l({type:si,optional:!0})],Un.prototype,"macData",void 0);var Ws;class $n{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],$n.prototype,"bagId",void 0),c([l({type:p.Any,context:0})],$n.prototype,"bagValue",void 0),c([l({type:Dn,repeated:"set",optional:!0})],$n.prototype,"bagAttributes",void 0);let Ol=Ws=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Ws.prototype)}};Ol=Ws=c([A({type:v.Sequence,itemType:$n})],Ol);var Gs,zs,Js;const Tl="1.2.840.113549.1.9",_l=`${Tl}.7`,Ys=`${Tl}.14`;let Hn=class extends ke{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};c([l({type:p.IA5String})],Hn.prototype,"ia5String",void 0),Hn=c([A({type:v.Choice})],Hn);let Vl=class extends wr{};Vl=c([A({type:v.Sequence})],Vl);let jl=class extends Un{};jl=c([A({type:v.Sequence})],jl);let Pl=class extends Mn{};Pl=c([A({type:v.Sequence})],Pl);let Zs=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.IA5String})],Zs.prototype,"value",void 0),Zs=c([A({type:v.Choice})],Zs);let Rl=class extends Hn{};Rl=c([A({type:v.Choice})],Rl);let Dl=class extends ke{};Dl=c([A({type:v.Choice})],Dl);let Qs=class{constructor(e=new Date){this.value=e}};c([l({type:p.GeneralizedTime})],Qs.prototype,"value",void 0),Qs=c([A({type:v.Choice})],Qs);let Ml=class extends ke{};Ml=c([A({type:v.Choice})],Ml);let Xs=class{constructor(e="M"){this.value=e}toString(){return this.value}};c([l({type:p.PrintableString})],Xs.prototype,"value",void 0),Xs=c([A({type:v.Choice})],Xs);let Ln=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.PrintableString})],Ln.prototype,"value",void 0),Ln=c([A({type:v.Choice})],Ln);let Ul=class extends Ln{};Ul=c([A({type:v.Choice})],Ul);let $l=class extends ke{};$l=c([A({type:v.Choice})],$l);let ea=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.ObjectIdentifier})],ea.prototype,"value",void 0),ea=c([A({type:v.Choice})],ea);let Hl=class extends Ce{};Hl=c([A({type:v.Choice})],Hl);let ta=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};c([l({type:p.Integer})],ta.prototype,"value",void 0),ta=c([A({type:v.Choice})],ta);let Ll=class extends ct{};Ll=c([A({type:v.Sequence})],Ll);let Fn=class extends ke{};Fn=c([A({type:v.Choice})],Fn);let Fl=Gs=class extends Ft{constructor(e){super(e),Object.setPrototypeOf(this,Gs.prototype)}};Fl=Gs=c([A({type:v.Sequence})],Fl);let ql=zs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,zs.prototype)}};ql=zs=c([A({type:v.Set,itemType:gr})],ql);let ra=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.BmpString})],ra.prototype,"value",void 0),ra=c([A({type:v.Choice})],ra);let ia=class extends I{};ia=c([A({type:v.Sequence})],ia);let Kl=Js=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Js.prototype)}};Kl=Js=c([A({type:v.Sequence,itemType:ia})],Kl);var na;let qn=na=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,na.prototype)}};qn=na=c([A({type:v.Sequence,itemType:bt})],qn);class Er{constructor(e={}){this.version=0,this.subject=new ge,this.subjectPKInfo=new st,this.attributes=new qn,Object.assign(this,e)}}c([l({type:p.Integer})],Er.prototype,"version",void 0),c([l({type:ge})],Er.prototype,"subject",void 0),c([l({type:st})],Er.prototype,"subjectPKInfo",void 0),c([l({type:qn,implicit:!0,context:0})],Er.prototype,"attributes",void 0);class ai{constructor(e={}){this.certificationRequestInfo=new Er,this.signatureAlgorithm=new I,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Er})],ai.prototype,"certificationRequestInfo",void 0),c([l({type:I})],ai.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],ai.prototype,"signature",void 0);/*!
|
|
90
|
+
`)}function vd(r,e,t){var i=Vn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,a=md(s,e);return bd("Cannot inject the dependency "+a+' 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 Sd=function(r){$s(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ls),Ad=function(r){$s(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ls),kd=function(){function r(){this.preResolution=new Sd,this.postResolution=new Ad}return r}(),wl=new Map,Cd=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:De.Transient}),this.ensureNotDisposed();var n;if(yd(t)?n=t:n={useClass:t},jn(n))for(var s=[e],a=n;a!=null;){var u=a.useToken;if(s.includes(u))throw new Error("Token registration cycle detected! "+Qt(s,[u]).join(" -> "));s.push(u);var f=this._registry.get(u);f&&jn(f.provider)?a=f.provider:a=null}if((i.lifecycle===De.Singleton||i.lifecycle==De.ContainerScoped||i.lifecycle==De.ResolutionScoped)&&(Pn(n)||Hs(n)))throw new Error('Cannot use lifecycle "'+De[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(),Nr(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(),Nr(e)){if(Nr(t))return this.register(e,{useToken:t},{lifecycle:De.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:De.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!Nr(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:De.Singleton})},r.prototype.resolve=function(e,t,i){t===void 0&&(t=new Rn),i===void 0&&(i=!1),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&Nr(e)){if(i)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),n){var s=this.resolveRegistration(n,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(hd(e)){var s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var i,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var a=_n(this.interceptors.preResolution.getAll(e)),u=a.next();!u.done;u=a.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(d){i={error:d}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}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 a=[];try{for(var u=_n(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var d=f.value;d.options.frequency!="Once"&&a.push(d),d.callback(e,t,i)}}catch(g){n={error:g}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,a)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===De.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===De.Singleton,n=e.options.lifecycle===De.ContainerScoped,s=i||n,a;return Pn(e.provider)?a=e.provider.useValue:jn(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):ml(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Hs(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,t),e.options.lifecycle===De.ResolutionScoped&&t.scopedResolutions.set(e,a),a},r.prototype.resolveAll=function(e,t,i){var n=this;t===void 0&&(t=new Rn),i===void 0&&(i=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&Nr(e)){if(i)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var a=s.map(function(f){return n.resolveRegistration(f,t)});return this.executePostResolutionInterceptor(e,a,"All"),a}var u=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,u,"All"),u},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=_n(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Vn(n.value,2),a=s[0],u=s[1];this._registry.setAll(a,u.filter(function(f){return!Pn(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=_n(this._registry.entries()),s=n.next();!s.done;s=n.next()){var a=Vn(s.value,2),u=a[0],f=a[1];f.some(function(d){var g=d.options;return g.lifecycle===De.ContainerScoped})&&i._registry.setAll(u,f.map(function(d){return d.options.lifecycle===De.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){e={error:d}}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 bl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=wl.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var a=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Qt([void 0],a)))}();return wd(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var a,u,f;try{return pd(n)?vl(n)?n.multiple?(a=i.resolve(n.transform)).transform.apply(a,Qt([i.resolveAll(n.token,new Rn,n.isOptional)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Qt([i.resolve(n.token,e,n.isOptional)],n.transformArgs)):n.multiple?i.resolveAll(n.token,new Rn,n.isOptional):i.resolve(n.token,e,n.isOptional):vl(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Qt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(d){throw new Error(vd(t,s,d))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),_e=new Cd;function Dn(r){return function(e){wl.set(e,dd(e))}}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 Fs;class Mn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}c([l({type:p.ObjectIdentifier})],Mn.prototype,"attrId",void 0),c([l({type:p.Any,repeated:"set"})],Mn.prototype,"attrValues",void 0);let Sl=Fs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Fs.prototype)}};Sl=Fs=c([S({type:v.Sequence,itemType:Mn})],Sl);var qs;let Al=qs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,qs.prototype)}};Al=qs=c([S({type:v.Sequence,itemType:Ar})],Al);class kl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],kl.prototype,"certId",void 0),c([l({type:p.Any,context:0})],kl.prototype,"certValue",void 0);class Cl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Cl.prototype,"crlId",void 0),c([l({type:p.Any,context:0})],Cl.prototype,"crltValue",void 0);class xl extends Y{}let Un=class{constructor(e={}){this.encryptionAlgorithm=new N,this.encryptedData=new xl,Object.assign(this,e)}};c([l({type:N})],Un.prototype,"encryptionAlgorithm",void 0),c([l({type:xl})],Un.prototype,"encryptedData",void 0);var Ks,Ws;(function(r){r[r.v1=0]="v1"})(Ws||(Ws={}));class Bl extends Y{}let Gs=Ks=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Ks.prototype)}};Gs=Ks=c([S({type:v.Sequence,itemType:bt})],Gs);class ai{constructor(e={}){this.version=Ws.v1,this.privateKeyAlgorithm=new N,this.privateKey=new Bl,Object.assign(this,e)}}c([l({type:p.Integer})],ai.prototype,"version",void 0),c([l({type:N})],ai.prototype,"privateKeyAlgorithm",void 0),c([l({type:Bl})],ai.prototype,"privateKey",void 0),c([l({type:Gs,implicit:!0,context:0,optional:!0})],ai.prototype,"attributes",void 0);let El=class extends ai{};El=c([S({type:v.Sequence})],El);let Nl=class extends Un{};Nl=c([S({type:v.Sequence})],Nl);class Il{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Il.prototype,"secretTypeId",void 0),c([l({type:p.Any,context:0})],Il.prototype,"secretValue",void 0);class ci{constructor(e={}){this.mac=new On,this.macSalt=new Y,this.iterations=1,Object.assign(this,e)}}c([l({type:On})],ci.prototype,"mac",void 0),c([l({type:Y})],ci.prototype,"macSalt",void 0),c([l({type:p.Integer,defaultValue:1})],ci.prototype,"iterations",void 0);class $n{constructor(e={}){this.version=3,this.authSafe=new Ar,this.macData=new ci,Object.assign(this,e)}}c([l({type:p.Integer})],$n.prototype,"version",void 0),c([l({type:Ar})],$n.prototype,"authSafe",void 0),c([l({type:ci,optional:!0})],$n.prototype,"macData",void 0);var zs;class Hn{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Hn.prototype,"bagId",void 0),c([l({type:p.Any,context:0})],Hn.prototype,"bagValue",void 0),c([l({type:Mn,repeated:"set",optional:!0})],Hn.prototype,"bagAttributes",void 0);let Ol=zs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,zs.prototype)}};Ol=zs=c([S({type:v.Sequence,itemType:Hn})],Ol);var Js,Ys,Zs;const Tl="1.2.840.113549.1.9",_l=`${Tl}.7`,Qs=`${Tl}.14`;let Ln=class extends Se{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};c([l({type:p.IA5String})],Ln.prototype,"ia5String",void 0),Ln=c([S({type:v.Choice})],Ln);let Vl=class extends Ar{};Vl=c([S({type:v.Sequence})],Vl);let jl=class extends $n{};jl=c([S({type:v.Sequence})],jl);let Pl=class extends Un{};Pl=c([S({type:v.Sequence})],Pl);let Xs=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.IA5String})],Xs.prototype,"value",void 0),Xs=c([S({type:v.Choice})],Xs);let Rl=class extends Ln{};Rl=c([S({type:v.Choice})],Rl);let Dl=class extends Se{};Dl=c([S({type:v.Choice})],Dl);let ea=class{constructor(e=new Date){this.value=e}};c([l({type:p.GeneralizedTime})],ea.prototype,"value",void 0),ea=c([S({type:v.Choice})],ea);let Ml=class extends Se{};Ml=c([S({type:v.Choice})],Ml);let ta=class{constructor(e="M"){this.value=e}toString(){return this.value}};c([l({type:p.PrintableString})],ta.prototype,"value",void 0),ta=c([S({type:v.Choice})],ta);let Fn=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.PrintableString})],Fn.prototype,"value",void 0),Fn=c([S({type:v.Choice})],Fn);let Ul=class extends Fn{};Ul=c([S({type:v.Choice})],Ul);let $l=class extends Se{};$l=c([S({type:v.Choice})],$l);let ra=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.ObjectIdentifier})],ra.prototype,"value",void 0),ra=c([S({type:v.Choice})],ra);let Hl=class extends Ae{};Hl=c([S({type:v.Choice})],Hl);let ia=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};c([l({type:p.Integer})],ia.prototype,"value",void 0),ia=c([S({type:v.Choice})],ia);let Ll=class extends ct{};Ll=c([S({type:v.Sequence})],Ll);let qn=class extends Se{};qn=c([S({type:v.Choice})],qn);let Fl=Js=class extends Kt{constructor(e){super(e),Object.setPrototypeOf(this,Js.prototype)}};Fl=Js=c([S({type:v.Sequence})],Fl);let ql=Ys=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Ys.prototype)}};ql=Ys=c([S({type:v.Set,itemType:br})],ql);let na=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.BmpString})],na.prototype,"value",void 0),na=c([S({type:v.Choice})],na);let oa=class extends N{};oa=c([S({type:v.Sequence})],oa);let Kl=Zs=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,Zs.prototype)}};Kl=Zs=c([S({type:v.Sequence,itemType:oa})],Kl);var sa;let Kn=sa=class extends ee{constructor(e){super(e),Object.setPrototypeOf(this,sa.prototype)}};Kn=sa=c([S({type:v.Sequence,itemType:bt})],Kn);class Ir{constructor(e={}){this.version=0,this.subject=new ye,this.subjectPKInfo=new st,this.attributes=new Kn,Object.assign(this,e)}}c([l({type:p.Integer})],Ir.prototype,"version",void 0),c([l({type:ye})],Ir.prototype,"subject",void 0),c([l({type:st})],Ir.prototype,"subjectPKInfo",void 0),c([l({type:Kn,implicit:!0,context:0})],Ir.prototype,"attributes",void 0);class li{constructor(e={}){this.certificationRequestInfo=new Ir,this.signatureAlgorithm=new N,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Ir})],li.prototype,"certificationRequestInfo",void 0),c([l({type:N})],li.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],li.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
|
|
114
|
-
`)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const i=[];let n=this.pad(t++),s="";const a=e[Q.VALUE];a&&(s=` ${a}`),i.push(`${n}${e[Q.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],d=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${d}${f}`);else if(f instanceof Date)i.push(`${n}${d}${f.toUTCString()}`);else if(Array.isArray(f))for(const g of f)g[Q.NAME]=u,i.push(...this.serializeObj(g,t));else if(f instanceof Q)f[Q.NAME]=u,i.push(...this.serializeObj(f,t));else if(x.isBufferSource(f))u?(i.push(`${n}${d}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const g=f.toTextObject();g[Q.NAME]=u,i.push(...this.serializeObj(g,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=x.toUint8Array(e),s=[];for(let a=0;a<n.length;){const u=[];for(let f=0;f<16&&a<n.length;f++){f===8&&u.push("");const d=n[a++].toString(16).padStart(2,"0");u.push(d)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return B.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]||Ve.get()):i=e[0]||Ve.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const Cu="Cannot initialize GeneralName from ASN.1 data.",xu=`${Cu} Unsupported string format in use.`,
|
|
113
|
+
*/const ui="crypto.algorithm";class xd{getAlgorithms(){return _e.resolveAll(ui)}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 N({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 Or="crypto.algorithmProvider";_e.registerSingleton(Or,xd);var Wn;const Me="1.3.36.3.3.2.8.1.1",Wl=`${Me}.1`,Gl=`${Me}.2`,zl=`${Me}.3`,Jl=`${Me}.4`,Yl=`${Me}.5`,Zl=`${Me}.6`,Ql=`${Me}.7`,Xl=`${Me}.8`,eu=`${Me}.9`,tu=`${Me}.10`,ru=`${Me}.11`,iu=`${Me}.12`,nu=`${Me}.13`,ou=`${Me}.14`,su="brainpoolP160r1",au="brainpoolP160t1",cu="brainpoolP192r1",lu="brainpoolP192t1",uu="brainpoolP224r1",fu="brainpoolP224t1",du="brainpoolP256r1",pu="brainpoolP256t1",hu="brainpoolP320r1",yu="brainpoolP320t1",gu="brainpoolP384r1",mu="brainpoolP384t1",bu="brainpoolP512r1",vu="brainpoolP512t1",fe="ECDSA";let fi=Wn=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=ll;break;case"K-256":t=Wn.SECP256K1;break;case"P-384":t=ul;break;case"P-521":t=fl;break;case su:t=Wl;break;case au:t=Gl;break;case cu:t=zl;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}if(t)return new N({algorithm:ii,parameters:B.serialize(new It({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case Is:return{name:fe,hash:{name:"SHA-1"}};case Os:return{name:fe,hash:{name:"SHA-256"}};case Ts:return{name:fe,hash:{name:"SHA-384"}};case _s:return{name:fe,hash:{name:"SHA-512"}};case ii:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(B.parse(e.parameters,It).namedCurve){case ll:return{name:fe,namedCurve:"P-256"};case Wn.SECP256K1:return{name:fe,namedCurve:"K-256"};case ul:return{name:fe,namedCurve:"P-384"};case fl:return{name:fe,namedCurve:"P-521"};case Wl:return{name:fe,namedCurve:su};case Gl:return{name:fe,namedCurve:au};case zl: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};case iu:return{name:fe,namedCurve:mu};case nu:return{name:fe,namedCurve:bu};case ou:return{name:fe,namedCurve:vu}}}}return null}};fi.SECP256K1="1.3.132.0.10",fi=Wn=c([Dn()],fi),_e.registerSingleton(ui,fi);const wu=Symbol("name"),Su=Symbol("value");class Q{constructor(e,t={},i=""){this[wu]=e,this[Su]=i;for(const n in t)this[n]=t[n]}}Q.NAME=wu,Q.VALUE=Su;class Bd{static toTextObject(e){const t=new Q("Algorithm Identifier",{},Ot.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case ii:{const i=new fi().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class Ot{static toString(e){const t=this.items[e];return t||e}}Ot.items={[Cn]:"sha1",[hl]:"sha224",[xn]:"sha256",[Bn]:"sha384",[En]:"sha512",[Jt]:"rsaEncryption",[Sn]:"sha1WithRSAEncryption",[nd]:"sha224WithRSAEncryption",[js]:"sha256WithRSAEncryption",[An]:"sha384WithRSAEncryption",[kn]:"sha512WithRSAEncryption",[ii]:"ecPublicKey",[Is]:"ecdsaWithSHA1",[cl]:"ecdsaWithSHA224",[Os]:"ecdsaWithSHA256",[Ts]:"ecdsaWithSHA384",[_s]:"ecdsaWithSHA512",[Lf]:"TLS WWW server authentication",[Ff]:"TLS WWW client authentication",[qf]:"Code Signing",[Kf]:"E-mail Protection",[Wf]:"Time Stamping",[Gf]:"OCSP Signing",[zf]:"Signed Data"};class Xt{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 a=e[Q.VALUE];a&&(s=` ${a}`),i.push(`${n}${e[Q.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],d=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${d}${f}`);else if(f instanceof Date)i.push(`${n}${d}${f.toUTCString()}`);else if(Array.isArray(f))for(const g of f)g[Q.NAME]=u,i.push(...this.serializeObj(g,t));else if(f instanceof Q)f[Q.NAME]=u,i.push(...this.serializeObj(f,t));else if(x.isBufferSource(f))u?(i.push(`${n}${d}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const g=f.toTextObject();g[Q.NAME]=u,i.push(...this.serializeObj(g,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=x.toUint8Array(e),s=[];for(let a=0;a<n.length;){const u=[];for(let f=0;f<16&&a<n.length;f++){f===8&&u.push("");const d=n[a++].toString(16).padStart(2,"0");u.push(d)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Xt.oidSerializer=Ot,Xt.algorithmSerializer=Bd;class Tt{constructor(...e){if(e.length===1){const t=e[0];this.rawData=B.serialize(t),this.onInit(t)}else{const t=B.parse(e[0],e[1]);this.rawData=x.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof Tt?Ia(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return B.toString(this.rawData);case"text":return Xt.serialize(this.toTextObject());case"hex":return j.ToHex(this.rawData);case"base64":return j.ToBase64(this.rawData);case"base64url":return j.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 Q(this.getTextName(),{},e)}}Tt.NAME="ASN";class Fe extends Tt{constructor(...e){let t;x.isBufferSource(e[0])?t=x.toArrayBuffer(e[0]):t=B.serialize(new Xe({extnID:e[0],critical:e[1],extnValue:new Y(x.toArrayBuffer(e[2]))})),super(t,Xe)}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[Q.NAME]===Fe.NAME&&(e[Q.NAME]=Ot.toString(this.type)),e}}var Au;class _t{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[Au]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(_t.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(_t.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,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=_t.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(_t.DEFAULT,e);return this}}Au=Symbol.toStringTag,_t.DEFAULT="default";const Ve=new _t,Ed=/^[0-2](?:\.[1-9][0-9]*)+$/;function Nd(r){return new RegExp(Ed).test(r)}class ku{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Nd(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Ue=new ku;Ue.register("CN","2.5.4.3"),Ue.register("L","2.5.4.7"),Ue.register("ST","2.5.4.8"),Ue.register("O","2.5.4.10"),Ue.register("OU","2.5.4.11"),Ue.register("C","2.5.4.6"),Ue.register("DC","0.9.2342.19200300.100.1.25"),Ue.register("E","1.2.840.113549.1.9.1"),Ue.register("G","2.5.4.42"),Ue.register("I","2.5.4.43"),Ue.register("SN","2.5.4.4"),Ue.register("T","2.5.4.12");function Id(r,e){return`\\${j.ToHex(j.FromUtf8String(e)).toUpperCase()}`}function Od(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Id)}class Vt{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 ku,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:x.isBufferSource(e)?this.asn=B.parse(e,ye):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Ue.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)||Ue.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${j.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 a=this.getName(s.type)||s.type;(e=n[a])!==null&&e!==void 0||(n[a]=[]),n[a].push(s.value.anyValue?`#${j.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[,a,u]=n;const f=u[u.length-1];(f===","||f==="+")&&(u=u.slice(0,u.length-1),n[3]=f);const d=n[3];a=this.getTypeOid(a);const g=this.createAttribute(a,u);s==="+"?t[t.length-1].push(g):t.push(new lr([g])),s=d}return t}fromJSON(e){const t=new ye;for(const i of e){const n=new lr;for(const s in i){const a=this.getTypeOid(s),u=i[s];for(const f of u){const d=this.createAttribute(a,f);n.push(d)}}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 Ui({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=j.FromHex(t.slice(1));else{const n=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:Vt.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 B.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]||Ve.get()):i=e[0]||Ve.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const Cu="Cannot initialize GeneralName from ASN.1 data.",xu=`${Cu} Unsupported string format in use.`,Td=`${Cu} Value doesn't match to GUID regular expression.`,Bu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Eu="1.3.6.1.4.1.311.25.1",Nu="1.3.6.1.4.1.311.20.2.3",aa="dns",ca="dn",la="email",ua="ip",fa="url",da="guid",pa="upn",Gn="id";class jt extends Tt{constructor(...e){let t;if(e.length===2)switch(e[0]){case ca:{const i=new Vt(e[1]).toArrayBuffer(),n=B.parse(i,ye);t=new L({directoryName:n});break}case aa:t=new L({dNSName:e[1]});break;case la:t=new L({rfc822Name:e[1]});break;case da:{const i=new RegExp(Bu,"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,a)=>a<3?j.ToHex(new Uint8Array(j.FromHex(s)).reverse()):s).join("");t=new L({otherName:new Fr({typeId:Eu,value:B.serialize(new Y(j.FromHex(n)))})});break}case ua:t=new L({iPAddress:e[1]});break;case Gn:t=new L({registeredID:e[1]});break;case pa:{t=new L({otherName:new Fr({typeId:Nu,value:B.serialize(Ic.toASN(e[1]))})});break}case fa:t=new L({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else x.isBufferSource(e[0])?t=B.parse(e[0],L):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=aa,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=la,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=ua,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=fa,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Gn,this.value=e.registeredID;else if(e.directoryName!=null)this.type=ca,this.value=new Vt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===Eu){this.type=da;const t=B.parse(e.otherName.value,Y),i=new RegExp(Bu,"i").exec(j.ToHex(t));if(!i)throw new Error(Td);this.value=i.slice(1).map((n,s)=>s<3?j.ToHex(new Uint8Array(j.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===Nu)this.type=pa,this.value=B.parse(e.otherName.value,Se).toString();else throw new Error(xu);else throw new Error(xu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case ca:case aa:case da:case ua:case Gn:case pa:case fa:e=this.type.toUpperCase();break;case la:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Gn&&(t=Ot.toString(t)),new Q(e,void 0,t)}}class er extends Tt{constructor(e){let t;if(e instanceof Be)t=e;else if(Array.isArray(e)){const i=[];for(const n of e)if(n instanceof L)i.push(n);else{const s=B.parse(new jt(n.type,n.value).rawData,L);i.push(s)}t=new Be(i)}else if(x.isBufferSource(e))t=B.parse(e,Be);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 jt(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[Q.NAME]];Array.isArray(n)||(n=[],e[i[Q.NAME]]=n),n.push(i)}return e}}er.NAME="GeneralNames";const di="-{5}",pi="\\n",_d=`[^${pi}]+`,Vd=`${di}BEGIN (${_d}(?=${di}))${di}`,jd=`${di}END \\1${di}`,Tr="\\n",Pd=`[^:${pi}]+`,Rd=`(?:[^${pi}]+${Tr}(?: +[^${pi}]+${Tr})*)`,Dd=`(?:[a-zA-Z0-9=+/]+${Tr})+`,Iu=`${Vd}${Tr}(?:((?:${Pd}: ${Rd})+))?${Tr}?(${Dd})${jd}`;class qe{static isPem(e){return typeof e=="string"&&new RegExp(Iu,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(Iu,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${pi}]+`,"g"),""),a={type:n[1],headers:[],rawData:j.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(Tr,"g"));let d=null;for(const g of f){const[h,H]=g.split(/:(.*)/);if(H===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=h.trim()}else d&&a.headers.push(d),d={key:h,value:H.trim()}}d&&a.headers.push(d)}i.push(a)}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(!x.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:x.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
116
|
`)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:x.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 d of e.headers)n.push(`${d.key}: ${d.value}`);n.push("")}const s=j.ToBase64(e.rawData);let a,u=0;const f=Array();for(;u<s.length&&(s.length-u<64?a=s.substring(u):(a=s.substring(u,u+64),u+=64),a.length!==0);)if(f.push(a),a.length<64)break;return n.push(...f),n.push(`-----END ${i}-----`),n.join(`
|
|
117
|
-
`)}}Fe.CertificateTag="CERTIFICATE",Fe.CrlTag="CRL",Fe.CertificateRequestTag="CERTIFICATE REQUEST",Fe.PublicKeyTag="PUBLIC KEY",Fe.PrivateKeyTag="PRIVATE KEY";class St extends Ot{static isAsnEncoded(e){return x.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Fe.isPem(e))return Fe.decode(e)[0];if(j.isHex(e))return j.FromHex(e);if(j.isBase64(e))return j.FromBase64(e);if(j.isBase64Url(e))return j.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=j.ToBinary(e);return Fe.isPem(t)?Fe.decode(t)[0]:j.isHex(t)?j.FromHex(t):j.isBase64(t)?j.FromBase64(t):j.isBase64Url(t)?j.FromBase64Url(t):x.toArrayBuffer(e)}}constructor(...e){St.isAsnEncoded(e[0])?super(St.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return Fe.encode(this.rawData,this.tag);default:return super.toString(e)}}}class ut extends St{static async create(e,t=Ve.get()){if(e instanceof ut)return e;if(Tt.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new ut(i)}else{if(e.publicKey)return e.publicKey;if(x.isBufferSource(e))return new ut(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){St.isAsnEncoded(e)?super(e,st):super(e),this.tag=Fe.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]||Ve.get()):t=e[0]||Ve.get();let s=this.rawData;const a=B.parse(this.rawData,st);return a.algorithm.algorithm===ni&&(s=Hd(a,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=_e.resolve(Ir),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Gt:{const n=B.parse(e.subjectPublicKey,Ps),s=x.toUint8Array(n.modulus);i.publicExponent=x.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]||Ve.get()):i=e[0]||Ve.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=Ve.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Ve.get();const n=B.parse(this.rawData,st);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=B.parse(this.rawData,st);switch(e.Algorithm=Zt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case ti:e["EC Point"]=t.subjectPublicKey;break;case Gt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function Hd(r,e){return r.algorithm=new I({algorithm:Gt,parameters:null}),e=B.serialize(r),e}class di extends Le{static async create(e,t=!1,i=Ve.get()){if("name"in e&&"serialNumber"in e)return new di(e,t);const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new di(j.ToHex(s),t)}constructor(...e){if(x.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Ht({keyIdentifier:new To(j.FromHex(e[0]))});super(Oo,e[1],B.serialize(t))}else{const t=e[0],i=t.name instanceof Qt?B.parse(t.name.rawData,Be):t.name,n=new Ht({authorityCertIssuer:i,authorityCertSerialNumber:j.FromHex(t.serialNumber)});super(Oo,e[1],B.serialize(n))}}onInit(e){super.onInit(e);const t=B.parse(e.extnValue,Ht);t.keyIdentifier&&(this.keyId=j.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?j.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=B.parse(this.value,Ht);return t.authorityCertIssuer&&(e["Authority Issuer"]=new Qt(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}di.NAME="Authority Key Identifier";class Ou extends Le{constructor(...e){if(x.isBufferSource(e[0])){super(e[0]);const t=B.parse(this.value,$i);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new $i({cA:e[0],pathLenConstraint:e[1]});super(Rc,e[2],B.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}}Ou.NAME="Basic Constraints";var Tu;(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"})(Tu||(Tu={}));class _u extends Le{constructor(...e){if(x.isBufferSource(e[0])){super(e[0]);const t=B.parse(this.value,Ki);this.usages=t.map(i=>i)}else{const t=new Ki(e[0]);super(Lc,e[1],B.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Nt.toString(t)).join(", "),e}}_u.NAME="Extended Key Usages";var da;(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"})(da||(da={}));class pa extends Le{constructor(...e){if(x.isBufferSource(e[0])){super(e[0]);const t=B.parse(this.value,Wo);this.usages=t.toNumber()}else{const t=new Wo(e[0]);super(Kc,e[1],B.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=B.parse(this.value,Wo);return e[""]=t.toJSON().join(", "),e}}pa.NAME="Key Usages";class Gn extends Le{static async create(e,t=!1,i=Ve.get()){const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new Gn(j.ToHex(s),t)}constructor(...e){if(x.isBufferSource(e[0])){super(e[0]);const t=B.parse(this.value,Bt);this.keyId=j.ToHex(t)}else{const t=typeof e[0]=="string"?j.FromHex(e[0]):e[0],i=new Bt(t);super(Zc,e[1],B.serialize(i)),this.keyId=j.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=B.parse(this.value,Bt);return e[""]=t,e}}Gn.NAME="Subject Key Identifier";class ha extends Le{constructor(...e){x.isBufferSource(e[0])?super(e[0]):super(Jc,e[1],new Qt(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=B.parse(e.extnValue,Zo);this.names=new Qt(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}ha.NAME="Subject Alternative Name";class qe{static register(e,t){this.items.set(e,t)}static create(e){const t=new Le(e),i=this.items.get(t.type);return i?new i(e):t}}qe.items=new Map;class Vu extends Le{constructor(...e){var t;if(x.isBufferSource(e[0])){super(e[0]);const i=B.parse(this.value,Fi);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new Fi(i.map(a=>new Li({policyIdentifier:a})));super(Mc,n,B.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new Q("",{},Nt.toString(t))),e}}Vu.NAME="Certificate Policies",qe.register(Mc,Vu);class ju extends Le{constructor(...e){var t;if(x.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(a=>new ur({distributionPoint:new Lt({fullName:[new L({uniformResourceIdentifier:a})]})})),s=new fr(n);super(Uo,e[1],B.serialize(s))}else{const i=new fr(e[0]);super(Uo,e[1],B.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=B.parse(e.extnValue,fr);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}}ju.NAME="CRL Distribution Points";class Pu extends Le{constructor(...e){var t,i,n,s;if(x.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof lr){const a=new lr(e[0]);super(No,e[1],B.serialize(a))}else{const a=e[0],u=new lr;Jn(u,a,_c,"ocsp"),Jn(u,a,Vc,"caIssuers"),Jn(u,a,jc,"timeStamping"),Jn(u,a,Pc,"caRepository"),super(No,e[1],B.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=[],B.parse(e.extnValue,lr).forEach(i=>{switch(i.accessMethod){case _c:this.ocsp.push(new Vt(i.accessLocation));break;case Vc:this.caIssuers.push(new Vt(i.accessLocation));break;case jc:this.timeStamping.push(new Vt(i.accessLocation));break;case Pc:this.caRepository.push(new Vt(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&zn(e,"OCSP",this.ocsp),this.caIssuers.length&&zn(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&zn(e,"Time Stamping",this.timeStamping),this.caRepository.length&&zn(e,"CA Repository",this.caRepository),e}}Pu.NAME="Authority Info Access";function zn(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new Q("");t.forEach((n,s)=>{const a=n.toTextObject(),u=`${a[Q.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(a)}),r[e]=i}}function Jn(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(a=>{typeof a=="string"&&(a=new Vt("url",a)),r.push(new Lr({accessMethod:t,accessLocation:B.parse(a.rawData,L)}))})}class Ru extends Le{constructor(...e){x.isBufferSource(e[0])?super(e[0]):super(Fc,e[1],new Qt(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=B.parse(e.extnValue,Be);this.names=new Qt(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}Ru.NAME="Issuer Alternative Name";class Or extends Ot{constructor(...e){let t;if(x.isBufferSource(e[0]))t=x.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>x.toArrayBuffer(s)):[];t=B.serialize(new bt({type:i,values:n}))}super(t,bt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new Q("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[Q.NAME]===Or.NAME&&(e[Q.NAME]=Nt.toString(this.type)),e}}Or.NAME="Attribute";class Du extends Or{constructor(...e){var t;if(x.isBufferSource(e[0]))super(e[0]);else{const i=new Fn({printableString:e[0]});super(_l,[B.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=B.parse(this.values[0],Fn);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[Q.VALUE]=this.password,e}}Du.NAME="Challenge Password";class ya extends Or{constructor(...e){var t;if(x.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new Ft;for(const s of i)n.push(B.parse(s.rawData,Qe));super(Ys,[B.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=B.parse(this.values[0],Ft);this.items=t.map(i=>qe.create(B.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[Q.NAME]]=i;return e}}ya.NAME="Extensions";class Yn{static register(e,t){this.items.set(e,t)}static create(e){const t=new Or(e),i=this.items.get(t.type);return i?new i(e):t}}Yn.items=new Map;const Zn="crypto.signatureFormatter";class Ld{toAsnSignature(e,t){return x.toArrayBuffer(t)}toWebSignature(e,t){return x.toArrayBuffer(t)}}var Qn;let ga=Qn=class{static createPssParams(e,t){const i=Qn.getHashAlgorithm(e);return i?new Jt({hashAlgorithm:i,maskGenAlgorithm:new I({algorithm:En,parameters:B.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=_e.resolve(Ir);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 I({algorithm:wn,parameters:null});case"sha-256":return new I({algorithm:_s,parameters:null});case"sha-384":return new I({algorithm:An,parameters:null});case"sha-512":return new I({algorithm:Sn,parameters:null})}}else return new I({algorithm:Gt,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=Qn.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new I({algorithm:ni,parameters:B.serialize(t)})}else return new I({algorithm:ni,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Gt:return{name:"RSASSA-PKCS1-v1_5"};case wn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case _s:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case An:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Sn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case ni:if(e.parameters){const t=B.parse(e.parameters,Jt);return{name:"RSA-PSS",hash:_e.resolve(Ir).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};ga=Qn=c([Rn()],ga),_e.registerSingleton(ci,ga);let ma=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new I({algorithm:kn});case"sha-256":return new I({algorithm:Cn});case"sha-384":return new I({algorithm:xn});case"sha-512":return new I({algorithm:Bn})}return null}toWebAlgorithm(e){switch(e.algorithm){case kn:return{name:"SHA-1"};case Cn:return{name:"SHA-256"};case xn:return{name:"SHA-384"};case Bn:return{name:"SHA-512"}}return null}};ma=c([Rn()],ma),_e.registerSingleton(ci,ma);class Ge{addPadding(e,t){const i=x.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}removePadding(e,t=!1){let i=x.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 vn,a=x.toUint8Array(t);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),B.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=B.parse(t,vn),n=e.namedCurve,s=Ge.namedCurveSize.get(n)||Ge.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return tf(a,u)}return null}}Ge.namedCurveSize=new Map,Ge.defaultNamedCurveSize=32;const ba="1.3.101.110",Mu="1.3.101.111",va="1.3.101.112",Uu="1.3.101.113";let wa=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=va;break;case"x25519":t=ba;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=va;break;case"ed448":t=Uu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=ba;break;case"x448":t=Mu;break}}return t?new I({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case va:return{name:"Ed25519"};case Uu:return{name:"EdDSA",namedCurve:"Ed448"};case ba:return{name:"X25519"};case Mu:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};wa=c([Rn()],wa),_e.registerSingleton(ci,wa);class Fd extends St{constructor(e){St.isAsnEncoded(e)?super(e,ai):super(e),this.tag=Fe.CertificateRequestTag}onInit(e){this.tbs=B.serialize(e.certificationRequestInfo),this.publicKey=new ut(e.certificationRequestInfo.subjectPKInfo);const t=_e.resolve(Ir);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>Yn.create(B.serialize(n)));const i=this.getAttribute(Ys);this.extensions=[],i instanceof ya&&(this.extensions=i.items),this.subjectName=new _t(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=Ve.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=_e.resolveAll(Zn).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=B.parse(this.rawData,ai),i=t.certificationRequestInfo,n=new Q("",{Version:`${dr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new Q("");for(const a of this.attributes){const u=a.toTextObject();s[u[Q.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new Q("",{Algorithm:Zt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}Fd.NAME="PKCS#10 Certificate Request";class $u extends St{constructor(e){St.isAsnEncoded(e)?super(e,pr):super(e),this.tag=Fe.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=B.serialize(t);let i=new Uint8Array(t.serialNumber);i.length>1&&i[0]===0&&i[1]>127&&(i=i.slice(1)),this.serialNumber=j.ToHex(i),this.subjectName=new _t(t.subject),this.subject=new _t(t.subject).toString(),this.issuerName=new _t(t.issuer),this.issuer=this.issuerName.toString();const n=_e.resolve(Ir);this.signatureAlgorithm=n.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const s=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!s)throw new Error("Cannot get 'notBefore' value");this.notBefore=s;const a=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!a)throw new Error("Cannot get 'notAfter' value");this.notAfter=a,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(u=>qe.create(B.serialize(u)))),this.publicKey=new ut(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=Ve.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 ut)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(x.isBufferSource(s)){const d=new ut(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=_e.resolveAll(Zn).reverse();let u=null;for(const d of a)if(u=d.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 g=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<g&&g<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=Ve.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Ve.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=B.parse(this.rawData,pr),i=t.tbsCertificate,n=new Q("",{Version:`${dr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Zt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new Q("",{"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 Q("");for(const a of this.extensions){const u=a.toTextObject();s[u[Q.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new Q("",{Algorithm:Zt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}$u.NAME="Certificate";var Hu;(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"})(Hu||(Hu={})),qe.register(Rc,Ou),qe.register(Lc,_u),qe.register(Kc,pa),qe.register(Zc,Gn),qe.register(Oo,di),qe.register(Jc,ha),qe.register(Uo,ju),qe.register(No,Pu),qe.register(Fc,Ru),Yn.register(_l,Du),Yn.register(Ys,ya),_e.registerSingleton(Zn,Ld),_e.registerSingleton(Zn,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 Lu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new $u(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof ha){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,d)=>{const g=d.type,h=f[g]??[];return{...f,[g]:[...h,d.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof pa){const s=Object.values(da),a=Array(s.length/2).fill(null).reduce((u,f,d)=>{const g=s[s.length/2+d];if(n.usages&g){const h=s[d];u.push(h)}return u},[]);i.keyUsage=a}return i}}}function qd(){const r=Lu(),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 Kd={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",group:"Certificates created in gateways within this group will automatically appear here.",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",group:"CA Certificates created in gateways within this group will automatically appear here.",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 Wd(){const r=ka.createI18n("en-us",Kd);return{i18n:r,i18nT:ka.i18nTComponent(r)}}const et={useCertificate:qd,useI18n:Wd,useX509:Lu},Xn="/v2/control-planes/{controlPlaneId}/core-entities",eo="/{workspace}",pi={list:{konnect:`${Xn}/certificates`,kongManager:`${eo}/certificates`},form:{konnect:{create:`${Xn}/certificates`,edit:`${Xn}/certificates/{id}`,validate:`${Xn}/v1/schemas/json/certificate/validate`},kongManager:{create:`${eo}/certificates`,edit:`${eo}/certificates/{id}`,validate:`${eo}/schemas/certificates/validate`}}},Gd={class:"kong-ui-entities-certificates-list"},zd={class:"button-row"},Jd={class:"empty-state-icon-gateway"},Yd={key:0},Zd={key:1},Qd={key:0},Xd={key:1},ep={key:0},tp={key:1},rp={key:1},ip=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},useToolbarCreationButton:{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:a}=et.useI18n(),u=mi.useRouter(),{axiosInstance:f}=S.useAxios((F=i.config)==null?void 0:F.axiosRequestConfig),{handleStateChange:d,hasRecords:g}=S.useTableState(()=>re.value),h=o.computed(()=>g.value&&i.config.app==="konnect"),H=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),te={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}},X=o.computed(()=>{var $,J;let V=`${i.config.apiBaseUrl}${pi.list[i.config.app]}`;return i.config.app==="konnect"?V=V.replace(/{controlPlaneId}/gi,(($=i.config)==null?void 0:$.controlPlaneId)||""):i.config.app==="kongManager"&&(V=V.replace(/\/{workspace}/gi,(J=i.config)!=null&&J.workspace?`/${i.config.workspace}`:"")),V}),re=o.ref(""),Ae=o.computed(()=>{const V=i.config.app==="konnect"||i.config.isExactMatch;return V?{isExactMatch:V,placeholder:n("certificates.search.placeholder")}:{isExactMatch:V,schema:i.config.filterSchema}}),{fetcher:Ue,fetcherState:Z,fetcherCacheKey:T}=S.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),X),K=()=>{re.value=""},oe=()=>{T.value++},O=o.ref(null),w=async(V,$)=>{const J=V.id;if(!await $(J)){t("copy:error",{entity:V,field:"id",message:n("certificates.errors.copy")});return}t("copy:success",{entity:V,field:"id",message:n("certificates.copy.success",{val:J})})},k=async(V,$)=>{const J=JSON.stringify(V);if(!await $(J)){t("copy:error",{entity:V,message:n("certificates.errors.copy")});return}t("copy:success",{entity:V,message:n("certificates.copy.success_brief")})},be=async V=>{var J;await((J=i.canRetrieve)==null?void 0:J.call(i,V))&&u.push(i.config.getViewRoute(V.id))},ie=V=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(V)}),ft=V=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(V)}),se=V=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(V)}},ae=o.ref(void 0),Ie=o.ref(!1),W=o.ref(!1),er=o.ref(""),Tr=S.useDeleteUrlBuilder(i.config,X.value),{certificateDataCache:jt,getCertificateData:kt}=et.useCertificate(),_r=V=>{ae.value=V,Ie.value=!0},D=()=>{Ie.value=!1},dt=async()=>{var V,$,J;if((V=ae.value)!=null&&V.id){W.value=!0;try{await f.delete(Tr(ae.value.id)),W.value=!1,Ie.value=!1,T.value++,t("delete:success",ae.value)}catch(de){er.value=((J=($=de.response)==null?void 0:$.data)==null?void 0:J.message)||de.message||n("certificates.errors.delete"),t("error",de)}finally{W.value=!1}}},tr=()=>{u.push(i.config.createRoute)};o.watch(Z,V=>{var $,J,de;if(V.status===S.FetcherStatus.Error){O.value={title:n("certificates.errors.general")},(de=(J=($=V.error)==null?void 0:$.response)==null?void 0:J.data)!=null&&de.message&&(O.value.message=V.error.response.data.message),t("error",V.error);return}jt.value={},O.value=null});const ce=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()&&(ce.value.title=n("certificates.list.empty_state.title"),ce.value.ctaText=n("certificates.actions.create"))}),(V,$)=>{const J=o.resolveComponent("KButton"),de=o.resolveComponent("KCopy"),q=o.resolveComponent("KDropdownItem"),ve=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",Gd,[o.createVNode(o.unref(S.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":H.value,"empty-state-options":ce.value,"enable-entity-actions":"","error-message":O.value,fetcher:o.unref(Ue),"fetcher-cache-key":o.unref(T),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:re.value,"table-headers":o.unref(te),onClearSearchInput:K,"onClick:row":$[3]||($[3]=M=>be(M)),onSort:oe,onState:o.unref(d)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(S.EntityFilter),{modelValue:re.value,"onUpdate:modelValue":$[0]||($[0]=M=>re.value=M),config:Ae.value},null,8,["modelValue","config"]),o.createVNode(o.unref(S.PermissionsWrapper),{"auth-function":r.canCreate},{default:o.withCtx(()=>[r.useToolbarCreationButton?(o.openBlock(),o.createBlock(J,{key:0,appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(rt.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])):o.createCommentVNode("",!0)]),_:1},8,["auth-function"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",zd,[h.value?(o.openBlock(),o.createBlock(J,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"certificates-learn-more-button",icon:"",onClick:$[1]||($[1]=M=>V.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(rt.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(S.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(J,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(rt.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:M})=>{var Ne;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Yd,o.toDisplayString((Ne=M==null?void 0:M.metadata)!=null&&Ne.subject?M.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",Zd,o.toDisplayString(o.unref(kt)(M).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:M})=>{var Ne;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Qd,o.toDisplayString((Ne=M==null?void 0:M.metadata)!=null&&Ne.expiry?o.unref(s)(M.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Xd,o.toDisplayString(o.unref(kt)(M).schemaExpiry?o.unref(s)(o.unref(kt)(M).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:M})=>{var Ne;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",ep,o.toDisplayString((Ne=M==null?void 0:M.metadata)!=null&&Ne.dns_names?`dns=${M.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",tp,o.toDisplayString(o.unref(kt)(M).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:M})=>[M!=null&&M.cert?(o.openBlock(),o.createBlock(de,{key:0,"data-testid":"copy-certificate-cert",text:M.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",rp,"-"))]),tags:o.withCtx(({row:M})=>[o.createVNode(o.unref(S.TableTags),{tags:M==null?void 0:M.tags},null,8,["tags"])]),actions:o.withCtx(({row:M})=>[o.createVNode(ve,null,{default:o.withCtx(({copyToClipboard:Ne})=>[o.createVNode(q,{"data-testid":"action-entity-copy-id",onClick:yi=>w(M,Ne)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(ve,null,{default:o.withCtx(({copyToClipboard:Ne})=>[o.createVNode(q,{"data-testid":"action-entity-copy-json",onClick:yi=>k(M,Ne)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(S.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(M)},{default:o.withCtx(()=>[o.createVNode(q,{"data-testid":"action-entity-view","has-divider":"",item:ie(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(S.PermissionsWrapper),{"auth-function":()=>r.canEdit(M)},{default:o.withCtx(()=>[o.createVNode(q,{"data-testid":"action-entity-edit",item:ft(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(S.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(q,{"data-testid":"action-entity-add-sni",item:se(M.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(S.PermissionsWrapper),{"auth-function":()=>r.canDelete(M)},{default:o.withCtx(()=>[o.createVNode(q,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ne=>_r(M)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!re.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var M;return[o.createVNode(o.unref(S.EntityEmptyState),{"action-button-text":o.unref(n)("certificates.list.empty_state_v2.create"),appearance:"secondary","can-create":()=>r.canCreate(),"data-testid":"certificates-entity-empty-state",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":tr,"onClick:learnMore":$[2]||($[2]=Ne=>V.$emit("click:learn-more"))},o.createSlots({image:o.withCtx(()=>[o.createElementVNode("div",Jd,[o.createVNode(o.unref(rt.ServiceDocumentIcon),{color:o.unref(Ca),size:o.unref(xa)},null,8,["color","size"])])]),_:2},[(M=r.config)!=null&&M.isControlPlaneGroup?{name:"message",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["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(S.EntityDeleteModal),{"action-pending":W.value,"entity-type":o.unref(S.EntityTypes).Certificate,error:er.value,title:o.unref(n)("certificates.delete.title"),visible:Ie.value,onCancel:D,onProceed:dt},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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},np=Xt(ip,[["__scopeId","data-v-91e0fc28"]]),op={class:"sni-field-container"},sp={key:1,class:"sni-field-controls-container"},ap={key:0},cp=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(),a=o.ref([]);return o.watch(t.modelValue,u=>{a.value=[...u]},{immediate:!0,deep:!0}),o.watch(a,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const d=o.resolveComponent("KLabel"),g=o.resolveComponent("KInput"),h=o.resolveComponent("KButton"),H=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",op,[o.createVNode(d,{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(a.value,(ne,te)=>(o.openBlock(),o.createElementBlock("div",{key:te,class:"sni-field-input"},[!r.isEditing||a.value[te]?(o.openBlock(),o.createBlock(g,{key:0,modelValue:a.value[te],"onUpdate:modelValue":X=>a.value[te]=X,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${te+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",sp,[o.createVNode(h,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:X=>u.$emit("remove",te)},{default:o.withCtx(()=>[o.createVNode(o.unref(rt.TrashIcon),{color:o.unref(Yu)},null,8,["color"])]),_:2},1032,["onClick"]),o.createVNode(h,{appearance:"tertiary","data-testid":"add-sni",disabled:te!==a.value.length-1,icon:"",onClick:f[0]||(f[0]=X=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(rt.AddIcon))]),_:2},1032,["disabled"])]))]))),128)),a.value.length===0?(o.openBlock(),o.createElementBlock("div",ap,[o.createVNode(h,{onClick:f[1]||(f[1]=ne=>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(H,{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-a5577ce8"]]),lp={class:"kong-ui-entities-certificates-form"},up=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 oe;const t=e,i=r,n=mi.useRouter(),{i18nT:s,i18n:{t:a}}=et.useI18n(),{getMessageFromError:u}=S.useErrors(),{axiosInstance:f}=S.useAxios((oe=i.config)==null?void 0:oe.axiosRequestConfig),d=o.computed(()=>pi.form[i.config.app].edit),g=o.computed(()=>i.certificateId?S.EntityBaseFormType.Edit:S.EntityBaseFormType.Create),h=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),H=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),ne=o.computed(()=>(g.value===S.EntityBaseFormType.Create||JSON.stringify(h.fields)!==JSON.stringify(H))&&!!h.fields.cert&&!!h.fields.key),te=O=>{var w,k;h.fields.cert=(O==null?void 0:O.cert)||"",h.fields.key=(O==null?void 0:O.key)||"",h.fields.certAlt=(O==null?void 0:O.cert_alt)||"",h.fields.keyAlt=(O==null?void 0:O.key_alt)||"",h.fields.snis=(w=O==null?void 0:O.snis)!=null&&w.length?O.snis:[""],h.fields.tags=((k=O==null?void 0:O.tags)==null?void 0:k.join(", "))||"",Object.assign(H,h.fields)},X=()=>{n.push(i.config.cancelRoute)},re=()=>{h.fields.snis.push("")},Ae=O=>{h.fields.snis.splice(O,1)},Ue=o.computed(()=>{var w,k;let O=`${i.config.apiBaseUrl}${pi.form[i.config.app].validate}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(k=i.config)!=null&&k.workspace?`/${i.config.workspace}`:"")),O=O.replace(/{id}/gi,i.certificateId),O}),Z=o.computed(()=>{var w,k;let O=`${i.config.apiBaseUrl}${pi.form[i.config.app][g.value]}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(k=i.config)!=null&&k.workspace?`/${i.config.workspace}`:"")),O=O.replace(/{id}/gi,i.certificateId),O}),T=o.computed(()=>{var O,w;return{cert:h.fields.cert,key:h.fields.key,cert_alt:h.fields.certAlt||null,key_alt:h.fields.keyAlt||null,...i.showSnisField?{snis:h.fields.snis.filter(Boolean)}:{},tags:(w=(O=h.fields.tags.split(","))==null?void 0:O.map(k=>String(k||"").trim()))==null?void 0:w.filter(k=>k!=="")}}),K=async()=>{var O,w,k,be,ie,ft,se,ae,Ie;try{h.isReadonly=!0;let W;await f.post(Ue.value,T.value),g.value==="create"?W=await f.post(Z.value,T.value):g.value==="edit"&&(W=((O=i.config)==null?void 0:O.app)==="konnect"?await f.put(Z.value,T.value):await f.patch(Z.value,T.value)),h.fields.cert=((w=W==null?void 0:W.data)==null?void 0:w.cert)||"",h.fields.key=((k=W==null?void 0:W.data)==null?void 0:k.key)||"",h.fields.certAlt=((be=W==null?void 0:W.data)==null?void 0:be.cert_alt)||"",h.fields.keyAlt=((ie=W==null?void 0:W.data)==null?void 0:ie.key_alt)||"",h.fields.snis=(se=(ft=W==null?void 0:W.data)==null?void 0:ft.snis)!=null&&se.length?W.data.snis:[""],h.fields.tags=((Ie=(ae=W==null?void 0:W.data)==null?void 0:ae.tags)==null?void 0:Ie.join(", "))||"",Object.assign(H,h.fields),t("update",W==null?void 0:W.data)}catch(W){h.errorMessage=u(W),t("error",W)}finally{h.isReadonly=!1}};return(O,w)=>{const k=o.resolveComponent("KTextArea"),be=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",lp,[o.createVNode(o.unref(S.EntityBaseForm),{"can-submit":ne.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(S.SupportedEntityType).Certificate,"error-message":h.errorMessage,"fetch-url":d.value,"form-fields":T.value,"is-readonly":h.isReadonly,onCancel:X,"onFetch:error":w[7]||(w[7]=ie=>O.$emit("error",ie)),"onFetch:success":te,onLoading:w[8]||(w[8]=ie=>O.$emit("loading",ie)),onSubmit:K},{default:o.withCtx(()=>[o.createVNode(o.unref(S.EntityFormSection),{description:o.unref(a)("certificates.form.sections.ssl.description"),title:o.unref(a)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(k,{modelValue:h.fields.cert,"onUpdate:modelValue":w[0]||(w[0]=ie=>h.fields.cert=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(a)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(k,{modelValue:h.fields.key,"onUpdate:modelValue":w[1]||(w[1]=ie=>h.fields.key=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(a)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(k,{modelValue:h.fields.certAlt,"onUpdate:modelValue":w[2]||(w[2]=ie=>h.fields.certAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(a)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(k,{modelValue:h.fields.keyAlt,"onUpdate:modelValue":w[3]||(w[3]=ie=>h.fields.keyAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(a)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(cp,{key:0,modelValue:h.fields.snis,"onUpdate:modelValue":w[4]||(w[4]=ie=>h.fields.snis=ie),"is-editing":g.value===o.unref(S.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:re,onRemove:w[5]||(w[5]=ie=>Ae(ie))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(S.EntityFormSection),{description:o.unref(a)("certificates.form.sections.general.description"),title:o.unref(a)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(be,{modelValue:h.fields.tags,"onUpdate:modelValue":w[6]||(w[6]=ie=>h.fields.tags=ie),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(a)("certificates.form.fields.tags.help"),label:o.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(a)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(a)("certificates.form.fields.tags.placeholder"),readonly:h.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-7988c8e6"]]),to="/v2/control-planes/{controlPlaneId}/core-entities",ro="/{workspace}",hi={list:{konnect:`${to}/ca_certificates`,kongManager:`${ro}/ca_certificates`},form:{konnect:{create:`${to}/ca_certificates`,edit:`${to}/ca_certificates/{id}`,validate:`${to}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${ro}/ca_certificates`,edit:`${ro}/ca_certificates/{id}`,validate:`${ro}/schemas/ca_certificates/validate`}}},fp={class:"kong-ui-ca-certificate-entity-config-card"},dp={key:0},pp=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:a}}=et.useI18n(),{convertKeyToTitle:u}=S.useStringHelpers(),{getPropValue:f}=S.useHelpers(),{getCertificateData:d}=et.useCertificate(),g=o.computed(()=>hi.form[n.config.app].edit),h=o.ref(),H=o.computed(()=>{if(h.value)return d(h.value)}),ne=o.computed(()=>{var Z;return((Z=H.value)==null?void 0:Z.schemaIssuer)||""}),te=o.computed(()=>{var Z,T;return(Z=H.value)!=null&&Z.schemaExpiry?a((T=H.value)==null?void 0:T.schemaExpiry):""}),X=o.computed(()=>{var Z;return((Z=H.value)==null?void 0:Z.schemaKeyUsages)||[]}),re=(Z,T)=>{const K=f("rowValue",T);if(Z==="expiry")return te.value;if(Z==="key_usages")return X.value;if(K)return K[Z]},Ae=Z=>{h.value=Z,i("fetch:success",Z)},Ue=o.ref({id:{},updated_at:{},created_at:{},cert:{section:S.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:S.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:S.ConfigurationSchemaSection.Basic,type:S.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:S.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:S.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:S.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(Z,T)=>{const K=o.resolveComponent("KCodeBlock"),oe=o.resolveComponent("KLabel"),O=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",fp,[o.createVNode(o.unref(S.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":Ue.value,"entity-type":o.unref(S.SupportedEntityType).CaCertificate,"fetch-url":g.value,"hide-title":r.hideTitle,"onFetch:error":T[0]||(T[0]=w=>Z.$emit("fetch:error",w)),"onFetch:success":Ae,onLoading:T[1]||(T[1]=w=>Z.$emit("loading",w))},{cert:o.withCtx(w=>[o.unref(f)("rowValue",w)?(o.openBlock(),o.createBlock(K,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",w),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(oe,{class:"metadata-label"},{default:o.withCtx(()=>T[2]||(T[2]=[o.createTextVNode(" Metadata ",-1)])),_:1,__:[2]})]),metadata:o.withCtx(w=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",w)).filter(k=>!t.includes(k)),k=>(o.openBlock(),o.createBlock(o.unref(S.ConfigCardItem),{key:k,"data-testid":`ca-cert-metadata-${k}`,item:{key:k,label:o.unref(u)(k),value:re(k,w),type:k==="key_usages"?o.unref(S.ConfigurationSchemaType).BadgeTag:o.unref(S.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(te.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ne.value||"–"),1)]),key_usages:o.withCtx(()=>[X.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",dp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(X.value,(w,k)=>(o.openBlock(),o.createBlock(O,{key:`key_usages-badge-tag-${k}`,class:"config-badge","data-testid":`key_usages-badge-tag-${k}`,tooltip:w,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-83648433"]]),hp={class:"kong-ui-entities-ca-certificates-list"},yp={class:"button-row"},gp={class:"empty-state-icon-gateway"},mp={key:0},bp={key:1},vp={key:0},wp={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},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var ce;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=et.useI18n(),u=mi.useRouter(),{axiosInstance:f}=S.useAxios((ce=i.config)==null?void 0:ce.axiosRequestConfig),{hasRecords:d,handleStateChange:g}=S.useTableState(()=>re.value),h=o.computed(()=>d.value&&i.config.app==="konnect"),H=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),te={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}},X=o.computed(()=>{var V,$;let F=`${i.config.apiBaseUrl}${hi.list[i.config.app]}`;return i.config.app==="konnect"?F=F.replace(/{controlPlaneId}/gi,((V=i.config)==null?void 0:V.controlPlaneId)||""):i.config.app==="kongManager"&&(F=F.replace(/\/{workspace}/gi,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),F}),re=o.ref(""),Ae=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:Ue,fetcherState:Z,fetcherCacheKey:T}=S.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),X),K=()=>{re.value=""},oe=()=>{T.value++},O=o.ref(null),w=async(F,V)=>{const $=F.id;if(!await V($)){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:$})})},k=async(F,V)=>{const $=JSON.stringify(F);if(!await V($)){t("copy:error",{entity:F,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:F,message:n("ca-certificates.copy.success_brief")})},be=async F=>{var $;await(($=i.canRetrieve)==null?void 0:$.call(i,F))&&u.push(i.config.getViewRoute(F.id))},ie=F=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(F)}),ft=F=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(F)}),se=o.ref(void 0),ae=o.ref(!1),Ie=o.ref(!1),W=o.ref(""),er=S.useDeleteUrlBuilder(i.config,X.value),{certificateDataCache:Tr,getCertificateData:jt}=et.useCertificate(),kt=F=>{se.value=F,ae.value=!0},_r=()=>{ae.value=!1},D=async()=>{var F,V,$;if((F=se.value)!=null&&F.id){Ie.value=!0;try{await f.delete(er(se.value.id)),Ie.value=!1,ae.value=!1,T.value++,t("delete:success",se.value)}catch(J){W.value=(($=(V=J.response)==null?void 0:V.data)==null?void 0:$.message)||J.message||n("ca-certificates.errors.delete"),t("error",J)}finally{Ie.value=!1}}},dt=()=>{u.push(i.config.createRoute)};o.watch(Z,F=>{var V,$,J;if(F.status===S.FetcherStatus.Error){O.value={title:n("ca-certificates.errors.general")},(J=($=(V=F.error)==null?void 0:V.response)==null?void 0:$.data)!=null&&J.message&&(O.value.message=F.error.response.data.message),t("error",F.error);return}Tr.value={},O.value=null});const tr=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()&&(tr.value.title=n("ca-certificates.list.empty_state.title"),tr.value.ctaText=n("ca-certificates.actions.create"))}),(F,V)=>{const $=o.resolveComponent("KButton"),J=o.resolveComponent("KDropdownItem"),de=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",hp,[o.createVNode(o.unref(S.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":H.value,"empty-state-options":tr.value,"enable-entity-actions":"","error-message":O.value,fetcher:o.unref(Ue),"fetcher-cache-key":o.unref(T),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:re.value,"table-headers":o.unref(te),onClearSearchInput:K,"onClick:row":V[3]||(V[3]=q=>be(q)),onSort:oe,onState:o.unref(g)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(S.EntityFilter),{modelValue:re.value,"onUpdate:modelValue":V[0]||(V[0]=q=>re.value=q),config:Ae.value},null,8,["modelValue","config"]),r.useToolbarCreationButton?(o.openBlock(),o.createBlock(o.unref(S.PermissionsWrapper),{key:0,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode($,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(rt.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])):o.createCommentVNode("",!0)]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",yp,[h.value?(o.openBlock(),o.createBlock($,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"ca-certificates-learn-more-button",icon:"",onClick:V[1]||(V[1]=q=>F.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(rt.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(S.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode($,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(rt.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 ve;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",mp,o.toDisplayString((ve=q==null?void 0:q.metadata)!=null&&ve.issuer?q.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",bp,o.toDisplayString(o.unref(jt)(q).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:q})=>{var ve;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",vp,o.toDisplayString((ve=q==null?void 0:q.metadata)!=null&&ve.expiry?o.unref(s)(q.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",wp,o.toDisplayString(o.unref(jt)(q).schemaExpiry?o.unref(s)(o.unref(jt)(q).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:q})=>[o.createVNode(o.unref(S.TableTags),{tags:q==null?void 0:q.tags},null,8,["tags"])]),actions:o.withCtx(({row:q})=>[o.createVNode(de,null,{default:o.withCtx(({copyToClipboard:ve})=>[o.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:M=>w(q,ve)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(de,null,{default:o.withCtx(({copyToClipboard:ve})=>[o.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:M=>k(q,ve)},{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(S.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(q)},{default:o.withCtx(()=>[o.createVNode(J,{"data-testid":"action-entity-view","has-divider":"",item:ie(q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(S.PermissionsWrapper),{"auth-function":()=>r.canEdit(q)},{default:o.withCtx(()=>[o.createVNode(J,{"data-testid":"action-entity-edit",item:ft(q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(S.PermissionsWrapper),{"auth-function":()=>r.canDelete(q)},{default:o.withCtx(()=>[o.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ve=>kt(q)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!re.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var q;return[o.createVNode(o.unref(S.EntityEmptyState),{"action-button-text":o.unref(n)("ca-certificates.list.empty_state_v2.create"),appearance:"secondary","can-create":()=>r.canCreate(),"data-testid":"ca-certificates-entity-empty-state",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":dt,"onClick:learnMore":V[2]||(V[2]=ve=>F.$emit("click:learn-more"))},o.createSlots({image:o.withCtx(()=>[o.createElementVNode("div",gp,[o.createVNode(o.unref(rt.ServiceDocumentIcon),{color:o.unref(Ca),size:o.unref(xa)},null,8,["color","size"])])]),_:2},[(q=r.config)!=null&&q.isControlPlaneGroup?{name:"message",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["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(S.EntityDeleteModal),{"action-pending":Ie.value,"entity-type":o.unref(S.EntityTypes).CACertificate,error:W.value,title:o.unref(n)("ca-certificates.delete.title"),visible:ae.value,onCancel:_r,onProceed:D},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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-ee9855bc"]]),Sp={class:"kong-ui-entities-ca-certificates-form"},kp=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 Z;const t=e,i=r,n=mi.useRouter(),{i18n:{t:s}}=et.useI18n(),{getMessageFromError:a}=S.useErrors(),{axiosInstance:u}=S.useAxios((Z=i.config)==null?void 0:Z.axiosRequestConfig),f=o.computed(()=>hi.form[i.config.app].edit),d=o.computed(()=>i.certificateId?S.EntityBaseFormType.Edit:S.EntityBaseFormType.Create),g=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),h=o.reactive({cert:"",certDigest:"",tags:""}),H=o.computed(()=>(d.value===S.EntityBaseFormType.Create||JSON.stringify(g.fields)!==JSON.stringify(h))&&!!g.fields.cert),ne=T=>{var K;g.fields.cert=(T==null?void 0:T.cert)||"",g.fields.certDigest=(T==null?void 0:T.cert_digest)||"",g.fields.tags=((K=T==null?void 0:T.tags)==null?void 0:K.join(", "))||"",Object.assign(h,g.fields)},te=()=>{n.push(i.config.cancelRoute)},X=o.computed(()=>{var K,oe;let T=`${i.config.apiBaseUrl}${hi.form[i.config.app].validate}`;return i.config.app==="konnect"?T=T.replace(/{controlPlaneId}/gi,((K=i.config)==null?void 0:K.controlPlaneId)||""):i.config.app==="kongManager"&&(T=T.replace(/\/{workspace}/gi,(oe=i.config)!=null&&oe.workspace?`/${i.config.workspace}`:"")),T=T.replace(/{id}/gi,i.certificateId),T}),re=o.computed(()=>{var K,oe;let T=`${i.config.apiBaseUrl}${hi.form[i.config.app][d.value]}`;return i.config.app==="konnect"?T=T.replace(/{controlPlaneId}/gi,((K=i.config)==null?void 0:K.controlPlaneId)||""):i.config.app==="kongManager"&&(T=T.replace(/\/{workspace}/gi,(oe=i.config)!=null&&oe.workspace?`/${i.config.workspace}`:"")),T=T.replace(/{id}/gi,i.certificateId),T}),Ae=o.computed(()=>{var T,K;return{cert:g.fields.cert,cert_digest:g.fields.certDigest||null,tags:(K=(T=g.fields.tags.split(","))==null?void 0:T.map(oe=>String(oe||"").trim()))==null?void 0:K.filter(oe=>oe!=="")}}),Ue=async()=>{var T,K,oe,O,w;try{g.isReadonly=!0;let k;await u.post(X.value,Ae.value),d.value==="create"?k=await u.post(re.value,Ae.value):d.value==="edit"&&(k=((T=i.config)==null?void 0:T.app)==="konnect"?await u.put(re.value,Ae.value):await u.patch(re.value,Ae.value)),g.fields.cert=((K=k==null?void 0:k.data)==null?void 0:K.cert)||"",g.fields.certDigest=((oe=k==null?void 0:k.data)==null?void 0:oe.cert_digest)||"",g.fields.tags=((w=(O=k==null?void 0:k.data)==null?void 0:O.tags)==null?void 0:w.join(", "))||"",Object.assign(h,g.fields),t("update",k==null?void 0:k.data)}catch(k){g.errorMessage=a(k),t("error",k)}finally{g.isReadonly=!1}};return(T,K)=>{const oe=o.resolveComponent("KTextArea"),O=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",Sp,[o.createVNode(o.unref(S.EntityBaseForm),{"can-submit":H.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(S.SupportedEntityType).CaCertificate,"error-message":g.errorMessage,"fetch-url":f.value,"form-fields":Ae.value,"is-readonly":g.isReadonly,onCancel:te,"onFetch:error":K[3]||(K[3]=w=>T.$emit("error",w)),"onFetch:success":ne,onLoading:K[4]||(K[4]=w=>T.$emit("loading",w)),onSubmit:Ue},{default:o.withCtx(()=>[o.createVNode(o.unref(S.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(oe,{modelValue:g.fields.cert,"onUpdate:modelValue":K[0]||(K[0]=w=>g.fields.cert=w),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:g.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(O,{modelValue:g.fields.certDigest,"onUpdate:modelValue":K[1]||(K[1]=w=>g.fields.certDigest=w),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:g.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(S.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(O,{modelValue:g.fields.tags,"onUpdate:modelValue":K[2]||(K[2]=w=>g.fields.tags=w),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:g.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-a850d9bb"]]),Cp={class:"kong-ui-certificate-entity-config-card"},xp={key:0},Bp=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:a}=et.useI18n(),{convertKeyToTitle:u}=S.useStringHelpers(),{getPropValue:f}=S.useHelpers(),{getCertificateData:d}=et.useCertificate(),g=o.computed(()=>pi.form[i.config.app].edit),h=o.ref(),H=o.ref({id:{},cert:{section:S.ConfigurationSchemaSection.Basic},key:{section:S.ConfigurationSchemaSection.Basic,type:S.ConfigurationSchemaType.Redacted},metadata:{section:S.ConfigurationSchemaSection.Basic,type:S.ConfigurationSchemaType.Json},snis:{section:S.ConfigurationSchemaSection.Basic,type:S.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:S.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:S.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:S.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:S.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:S.ConfigurationSchemaSection.Advanced},key_alt:{section:S.ConfigurationSchemaSection.Advanced,type:S.ConfigurationSchemaType.Redacted}}),ne=w=>{h.value=w,t("fetch:success",w)},te=(w,k)=>{const be=f("rowValue",k);if(w==="expiry")return re.value;if(w==="key_usages")return T.value;if(w==="san_names")return Ue.value;if(be)return be[w]},X=o.computed(()=>{if(h.value)return d(h.value)}),re=o.computed(()=>{var w,k;return(w=X.value)!=null&&w.schemaExpiry?s((k=X.value)==null?void 0:k.schemaExpiry):""}),Ae=o.computed(()=>{var w;return((w=X.value)==null?void 0:w.schemaIssuer)||""}),Ue=o.computed(()=>{var w;return((w=X.value)==null?void 0:w.schemaSanNames)||""}),Z=o.computed(()=>{var w;return((w=X.value)==null?void 0:w.schemaSubject)||""}),T=o.computed(()=>{var w;return((w=X.value)==null?void 0:w.schemaKeyUsages)||[]}),K=o.computed(()=>{var w,k;return((k=(w=h==null?void 0:h.value)==null?void 0:w.snis)==null?void 0:k.length)>0}),oe=o.computed(()=>{var w;return!!((w=h==null?void 0:h.value)!=null&&w.cert_alt)}),O=w=>{var k,be;return w==="san_names"?n("certificates.list.table_headers.san"):((be=(k=H.value)==null?void 0:k[w])==null?void 0:be.label)||u(w)};return(w,k)=>{const be=o.resolveComponent("KCodeBlock"),ie=o.resolveComponent("KLabel"),ft=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",Cp,[o.createVNode(o.unref(S.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":H.value,"entity-type":o.unref(S.SupportedEntityType).Certificate,"fetch-url":g.value,"hide-title":r.hideTitle,"onFetch:error":k[0]||(k[0]=se=>w.$emit("fetch:error",se)),"onFetch:success":ne,onLoading:k[1]||(k[1]=se=>w.$emit("loading",se))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(se=>[o.unref(f)("rowValue",se)?(o.openBlock(),o.createBlock(be,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",se),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(()=>k[2]||(k[2]=[o.createTextVNode(" Metadata ",-1)])),_:1,__:[2]})]),metadata:o.withCtx(se=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",se)),ae=>(o.openBlock(),o.createBlock(o.unref(S.ConfigCardItem),{key:ae,item:{key:ae,value:te(ae,se),label:O(ae),type:ae==="key_usages"||ae==="snis"||ae==="dns_names"?o.unref(S.ConfigurationSchemaType).BadgeTag:o.unref(S.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(re.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Ae.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Ue.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Z.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(a),{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(()=>[T.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",xp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(T.value,(se,ae)=>(o.openBlock(),o.createBlock(ft,{key:`key_usages-badge-tag-${ae}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ae}`,tooltip:se,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(se),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[K.value?void 0:{name:"snis",fn:o.withCtx(()=>[k[3]||(k[3]=o.createTextVNode(" – ",-1))]),key:"0"},oe.value?{name:"cert_alt",fn:o.withCtx(se=>[k[4]||(k[4]=o.createTextVNode(" > ",-1)),o.unref(f)("rowValue",se)?(o.openBlock(),o.createBlock(be,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",se),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-de8f90ef"]]);xe.CACertificateConfigCard=pp,xe.CACertificateForm=kp,xe.CACertificateList=Ap,xe.CertificateConfigCard=Bp,xe.CertificateForm=up,xe.CertificateList=np,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})});
|
|
117
|
+
`)}}qe.CertificateTag="CERTIFICATE",qe.CrlTag="CRL",qe.CertificateRequestTag="CERTIFICATE REQUEST",qe.PublicKeyTag="PUBLIC KEY",qe.PrivateKeyTag="PRIVATE KEY";class At extends Tt{static isAsnEncoded(e){return x.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(qe.isPem(e))return qe.decode(e)[0];if(j.isHex(e))return j.FromHex(e);if(j.isBase64(e))return j.FromBase64(e);if(j.isBase64Url(e))return j.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=j.ToBinary(e);return qe.isPem(t)?qe.decode(t)[0]:j.isHex(t)?j.FromHex(t):j.isBase64(t)?j.FromBase64(t):j.isBase64Url(t)?j.FromBase64Url(t):x.toArrayBuffer(e)}}constructor(...e){At.isAsnEncoded(e[0])?super(At.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return qe.encode(this.rawData,this.tag);default:return super.toString(e)}}}class ut extends At{static async create(e,t=Ve.get()){if(e instanceof ut)return e;if(_t.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new ut(i)}else{if(e.publicKey)return e.publicKey;if(x.isBufferSource(e))return new ut(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){At.isAsnEncoded(e)?super(e,st):super(e),this.tag=qe.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]||Ve.get()):t=e[0]||Ve.get();let s=this.rawData;const a=B.parse(this.rawData,st);return a.algorithm.algorithm===si&&(s=Md(a,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=_e.resolve(Or),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Jt:{const n=B.parse(e.subjectPublicKey,Ds),s=x.toUint8Array(n.modulus);i.publicExponent=x.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]||Ve.get()):i=e[0]||Ve.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=Ve.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Ve.get();const n=B.parse(this.rawData,st);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=B.parse(this.rawData,st);switch(e.Algorithm=Xt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case ii:e["EC Point"]=t.subjectPublicKey;break;case Jt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function Md(r,e){return r.algorithm=new N({algorithm:Jt,parameters:null}),e=B.serialize(r),e}class hi extends Fe{static async create(e,t=!1,i=Ve.get()){if("name"in e&&"serialNumber"in e)return new hi(e,t);const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new hi(j.ToHex(s),t)}constructor(...e){if(x.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Ft({keyIdentifier:new Vo(j.FromHex(e[0]))});super(_o,e[1],B.serialize(t))}else{const t=e[0],i=t.name instanceof er?B.parse(t.name.rawData,Be):t.name,n=new Ft({authorityCertIssuer:i,authorityCertSerialNumber:j.FromHex(t.serialNumber)});super(_o,e[1],B.serialize(n))}}onInit(e){super.onInit(e);const t=B.parse(e.extnValue,Ft);t.keyIdentifier&&(this.keyId=j.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?j.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=B.parse(this.value,Ft);return t.authorityCertIssuer&&(e["Authority Issuer"]=new er(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}hi.NAME="Authority Key Identifier";class Ou extends Fe{constructor(...e){if(x.isBufferSource(e[0])){super(e[0]);const t=B.parse(this.value,Hi);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Hi({cA:e[0],pathLenConstraint:e[1]});super(Rc,e[2],B.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}}Ou.NAME="Basic Constraints";var Tu;(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"})(Tu||(Tu={}));class _u extends Fe{constructor(...e){if(x.isBufferSource(e[0])){super(e[0]);const t=B.parse(this.value,Wi);this.usages=t.map(i=>i)}else{const t=new Wi(e[0]);super(Lc,e[1],B.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Ot.toString(t)).join(", "),e}}_u.NAME="Extended Key Usages";var ha;(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"})(ha||(ha={}));class ya extends Fe{constructor(...e){if(x.isBufferSource(e[0])){super(e[0]);const t=B.parse(this.value,zo);this.usages=t.toNumber()}else{const t=new zo(e[0]);super(Kc,e[1],B.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=B.parse(this.value,zo);return e[""]=t.toJSON().join(", "),e}}ya.NAME="Key Usages";class zn extends Fe{static async create(e,t=!1,i=Ve.get()){const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new zn(j.ToHex(s),t)}constructor(...e){if(x.isBufferSource(e[0])){super(e[0]);const t=B.parse(this.value,Et);this.keyId=j.ToHex(t)}else{const t=typeof e[0]=="string"?j.FromHex(e[0]):e[0],i=new Et(t);super(Zc,e[1],B.serialize(i)),this.keyId=j.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=B.parse(this.value,Et);return e[""]=t,e}}zn.NAME="Subject Key Identifier";class ga extends Fe{constructor(...e){x.isBufferSource(e[0])?super(e[0]):super(Jc,e[1],new er(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=B.parse(e.extnValue,Xo);this.names=new er(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}ga.NAME="Subject Alternative Name";class Ke{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}}Ke.items=new Map;class Vu extends Fe{constructor(...e){var t;if(x.isBufferSource(e[0])){super(e[0]);const i=B.parse(this.value,qi);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new qi(i.map(a=>new Fi({policyIdentifier:a})));super(Mc,n,B.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new Q("",{},Ot.toString(t))),e}}Vu.NAME="Certificate Policies",Ke.register(Mc,Vu);class ju extends Fe{constructor(...e){var t;if(x.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(a=>new dr({distributionPoint:new qt({fullName:[new L({uniformResourceIdentifier:a})]})})),s=new pr(n);super(Ho,e[1],B.serialize(s))}else{const i=new pr(e[0]);super(Ho,e[1],B.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=B.parse(e.extnValue,pr);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 jt(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}ju.NAME="CRL Distribution Points";class Pu extends Fe{constructor(...e){var t,i,n,s;if(x.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof fr){const a=new fr(e[0]);super(To,e[1],B.serialize(a))}else{const a=e[0],u=new fr;Yn(u,a,_c,"ocsp"),Yn(u,a,Vc,"caIssuers"),Yn(u,a,jc,"timeStamping"),Yn(u,a,Pc,"caRepository"),super(To,e[1],B.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=[],B.parse(e.extnValue,fr).forEach(i=>{switch(i.accessMethod){case _c:this.ocsp.push(new jt(i.accessLocation));break;case Vc:this.caIssuers.push(new jt(i.accessLocation));break;case jc:this.timeStamping.push(new jt(i.accessLocation));break;case Pc:this.caRepository.push(new jt(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&Jn(e,"OCSP",this.ocsp),this.caIssuers.length&&Jn(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&Jn(e,"Time Stamping",this.timeStamping),this.caRepository.length&&Jn(e,"CA Repository",this.caRepository),e}}Pu.NAME="Authority Info Access";function Jn(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new Q("");t.forEach((n,s)=>{const a=n.toTextObject(),u=`${a[Q.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(a)}),r[e]=i}}function Yn(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(a=>{typeof a=="string"&&(a=new jt("url",a)),r.push(new qr({accessMethod:t,accessLocation:B.parse(a.rawData,L)}))})}class Ru extends Fe{constructor(...e){x.isBufferSource(e[0])?super(e[0]):super(Fc,e[1],new er(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=B.parse(e.extnValue,Be);this.names=new er(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}Ru.NAME="Issuer Alternative Name";class _r extends Tt{constructor(...e){let t;if(x.isBufferSource(e[0]))t=x.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>x.toArrayBuffer(s)):[];t=B.serialize(new bt({type:i,values:n}))}super(t,bt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new Q("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[Q.NAME]===_r.NAME&&(e[Q.NAME]=Ot.toString(this.type)),e}}_r.NAME="Attribute";class Du extends _r{constructor(...e){var t;if(x.isBufferSource(e[0]))super(e[0]);else{const i=new qn({printableString:e[0]});super(_l,[B.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=B.parse(this.values[0],qn);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[Q.VALUE]=this.password,e}}Du.NAME="Challenge Password";class ma extends _r{constructor(...e){var t;if(x.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new Kt;for(const s of i)n.push(B.parse(s.rawData,Xe));super(Qs,[B.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=B.parse(this.values[0],Kt);this.items=t.map(i=>Ke.create(B.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[Q.NAME]]=i;return e}}ma.NAME="Extensions";class Zn{static register(e,t){this.items.set(e,t)}static create(e){const t=new _r(e),i=this.items.get(t.type);return i?new i(e):t}}Zn.items=new Map;const Qn="crypto.signatureFormatter";class Ud{toAsnSignature(e,t){return x.toArrayBuffer(t)}toWebSignature(e,t){return x.toArrayBuffer(t)}}var Xn;let ba=Xn=class{static createPssParams(e,t){const i=Xn.getHashAlgorithm(e);return i?new Zt({hashAlgorithm:i,maskGenAlgorithm:new N({algorithm:Nn,parameters:B.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=_e.resolve(Or);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 N({algorithm:Sn,parameters:null});case"sha-256":return new N({algorithm:js,parameters:null});case"sha-384":return new N({algorithm:An,parameters:null});case"sha-512":return new N({algorithm:kn,parameters:null})}}else return new N({algorithm:Jt,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=Xn.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new N({algorithm:si,parameters:B.serialize(t)})}else return new N({algorithm:si,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Jt:return{name:"RSASSA-PKCS1-v1_5"};case Sn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case js:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case An:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case kn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case si:if(e.parameters){const t=B.parse(e.parameters,Zt);return{name:"RSA-PSS",hash:_e.resolve(Or).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};ba=Xn=c([Dn()],ba),_e.registerSingleton(ui,ba);let va=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new N({algorithm:Cn});case"sha-256":return new N({algorithm:xn});case"sha-384":return new N({algorithm:Bn});case"sha-512":return new N({algorithm:En})}return null}toWebAlgorithm(e){switch(e.algorithm){case Cn:return{name:"SHA-1"};case xn:return{name:"SHA-256"};case Bn:return{name:"SHA-384"};case En:return{name:"SHA-512"}}return null}};va=c([Dn()],va),_e.registerSingleton(ui,va);class ze{addPadding(e,t){const i=x.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}removePadding(e,t=!1){let i=x.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=ze.namedCurveSize.get(i)||ze.defaultNamedCurveSize,s=new wn,a=x.toUint8Array(t);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),B.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=B.parse(t,wn),n=e.namedCurve,s=ze.namedCurveSize.get(n)||ze.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return Qu(a,u)}return null}}ze.namedCurveSize=new Map,ze.defaultNamedCurveSize=32;const wa="1.3.101.110",Mu="1.3.101.111",Sa="1.3.101.112",Uu="1.3.101.113";let Aa=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=Sa;break;case"x25519":t=wa;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=Sa;break;case"ed448":t=Uu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=wa;break;case"x448":t=Mu;break}}return t?new N({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case Sa:return{name:"Ed25519"};case Uu:return{name:"EdDSA",namedCurve:"Ed448"};case wa:return{name:"X25519"};case Mu:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Aa=c([Dn()],Aa),_e.registerSingleton(ui,Aa);class $d extends At{constructor(e){At.isAsnEncoded(e)?super(e,li):super(e),this.tag=qe.CertificateRequestTag}onInit(e){this.tbs=B.serialize(e.certificationRequestInfo),this.publicKey=new ut(e.certificationRequestInfo.subjectPKInfo);const t=_e.resolve(Or);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>Zn.create(B.serialize(n)));const i=this.getAttribute(Qs);this.extensions=[],i instanceof ma&&(this.extensions=i.items),this.subjectName=new Vt(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=Ve.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=_e.resolveAll(Qn).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=B.parse(this.rawData,li),i=t.certificationRequestInfo,n=new Q("",{Version:`${hr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new Q("");for(const a of this.attributes){const u=a.toTextObject();s[u[Q.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new Q("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}$d.NAME="PKCS#10 Certificate Request";class $u extends At{constructor(e){At.isAsnEncoded(e)?super(e,yr):super(e),this.tag=qe.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=B.serialize(t);let i=new Uint8Array(t.serialNumber);i.length>1&&i[0]===0&&i[1]>127&&(i=i.slice(1)),this.serialNumber=j.ToHex(i),this.subjectName=new Vt(t.subject),this.subject=new Vt(t.subject).toString(),this.issuerName=new Vt(t.issuer),this.issuer=this.issuerName.toString();const n=_e.resolve(Or);this.signatureAlgorithm=n.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const s=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!s)throw new Error("Cannot get 'notBefore' value");this.notBefore=s;const a=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!a)throw new Error("Cannot get 'notAfter' value");this.notAfter=a,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(u=>Ke.create(B.serialize(u)))),this.publicKey=new ut(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=Ve.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 ut)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(x.isBufferSource(s)){const d=new ut(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=_e.resolveAll(Qn).reverse();let u=null;for(const d of a)if(u=d.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 g=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<g&&g<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=Ve.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Ve.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=B.parse(this.rawData,yr),i=t.tbsCertificate,n=new Q("",{Version:`${hr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Xt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new Q("",{"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 Q("");for(const a of this.extensions){const u=a.toTextObject();s[u[Q.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new Q("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}$u.NAME="Certificate";var Hu;(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"})(Hu||(Hu={})),Ke.register(Rc,Ou),Ke.register(Lc,_u),Ke.register(Kc,ya),Ke.register(Zc,zn),Ke.register(_o,hi),Ke.register(Jc,ga),Ke.register(Ho,ju),Ke.register(To,Pu),Ke.register(Fc,Ru),Zn.register(_l,Du),Zn.register(Qs,ma),_e.registerSingleton(Qn,Ud),_e.registerSingleton(Qn,ze),ze.namedCurveSize.set("P-256",32),ze.namedCurveSize.set("K-256",32),ze.namedCurveSize.set("P-384",48),ze.namedCurveSize.set("P-521",66);function Lu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new $u(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof ga){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,d)=>{const g=d.type,h=f[g]??[];return{...f,[g]:[...h,d.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof ya){const s=Object.values(ha),a=Array(s.length/2).fill(null).reduce((u,f,d)=>{const g=s[s.length/2+d];if(n.usages&g){const h=s[d];u.push(h)}return u},[]);i.keyUsage=a}return i}}}function Hd(){const r=Lu(),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 Ld={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",group:"Certificates created in gateways within this group will automatically appear here.",description:"Certificates manage SSL/TLS encryption, ensuring secure communication between clients and your API services.",learn_more:"Learn more"}},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",group:"CA Certificates created in gateways within this group will automatically appear here.",description:"CA Certificates validate the authenticity of client and server certificates, reinforcing the trust and security of your API communications.",learn_more:"Learn more"}},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=xa.createI18n("en-us",Ld);return{i18n:r,i18nT:xa.i18nTComponent(r)}}const tt={useCertificate:Hd,useI18n:Fd,useX509:Lu},eo="/v2/control-planes/{controlPlaneId}/core-entities",to="/{workspace}",yi={list:{konnect:`${eo}/certificates`,kongManager:`${to}/certificates`},form:{konnect:{create:`${eo}/certificates`,edit:`${eo}/certificates/{id}`,validate:`${eo}/v1/schemas/json/certificate/validate`},kongManager:{create:`${to}/certificates`,edit:`${to}/certificates/{id}`,validate:`${to}/schemas/certificates/validate`}}},qd={class:"kong-ui-entities-certificates-list"},Kd={class:"button-row"},Wd={key:0},Gd={key:1},zd={key:0},Jd={key:1},Yd={key:0},Zd={key:1},Qd={key:1},Xd=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},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var q;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=tt.useI18n(),u=bi.useRouter(),{axiosInstance:f}=A.useAxios((q=i.config)==null?void 0:q.axiosRequestConfig),{handleStateChange:d,hasRecords:g}=A.useTableState(()=>re.value),h=o.computed(()=>g.value&&i.config.app==="konnect"),H=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),te={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}},X=o.computed(()=>{var $,K;let V=`${i.config.apiBaseUrl}${yi.list[i.config.app]}`;return i.config.app==="konnect"?V=V.replace(/{controlPlaneId}/gi,(($=i.config)==null?void 0:$.controlPlaneId)||""):i.config.app==="kongManager"&&(V=V.replace(/\/{workspace}/gi,(K=i.config)!=null&&K.workspace?`/${i.config.workspace}`:"")),V}),re=o.ref(""),ve=o.computed(()=>{const V=i.config.app==="konnect"||i.config.isExactMatch;return V?{isExactMatch:V,placeholder:n("certificates.search.placeholder")}:{isExactMatch:V,schema:i.config.filterSchema}}),{fetcher:$e,fetcherState:Z,fetcherCacheKey:T}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),X),W=()=>{re.value=""},oe=()=>{T.value++},O=o.ref(null),w=async(V,$)=>{const K=V.id;if(!await $(K)){t("copy:error",{entity:V,field:"id",message:n("certificates.errors.copy")});return}t("copy:success",{entity:V,field:"id",message:n("certificates.copy.success",{val:K})})},k=async(V,$)=>{const K=JSON.stringify(V);if(!await $(K)){t("copy:error",{entity:V,message:n("certificates.errors.copy")});return}t("copy:success",{entity:V,message:n("certificates.copy.success_brief")})},me=async V=>{var K;await((K=i.canRetrieve)==null?void 0:K.call(i,V))&&u.push(i.config.getViewRoute(V.id))},ie=V=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(V)}),ft=V=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(V)}),se=V=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(V)}},ce=o.ref(void 0),Ne=o.ref(!1),G=o.ref(!1),rr=o.ref(""),Vr=A.useDeleteUrlBuilder(i.config,X.value),{certificateDataCache:Pt,getCertificateData:kt}=tt.useCertificate(),jr=V=>{ce.value=V,Ne.value=!0},M=()=>{Ne.value=!1},dt=async()=>{var V,$,K;if((V=ce.value)!=null&&V.id){G.value=!0;try{await f.delete(Vr(ce.value.id)),G.value=!1,Ne.value=!1,T.value++,t("delete:success",ce.value)}catch(ke){rr.value=((K=($=ke.response)==null?void 0:$.data)==null?void 0:K.message)||ke.message||n("certificates.errors.delete"),t("error",ke)}finally{G.value=!1}}},ir=()=>{u.push(i.config.createRoute)};o.watch(Z,V=>{var $,K,ke;if(V.status===A.FetcherStatus.Error){O.value={title:n("certificates.errors.general")},(ke=(K=($=V.error)==null?void 0:$.response)==null?void 0:K.data)!=null&&ke.message&&(O.value.message=V.error.response.data.message),t("error",V.error);return}Pt.value={},O.value=null});const ae=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")}),Rt=o.ref(!1);return o.onBeforeMount(async()=>{Rt.value=await i.canCreate(),Rt.value&&(ae.value.title=n("certificates.list.empty_state.title"),ae.value.ctaText=n("certificates.actions.create"))}),(V,$)=>{const K=o.resolveComponent("KButton"),ke=o.resolveComponent("KEmptyState"),Ct=o.resolveComponent("KCopy"),F=o.resolveComponent("KDropdownItem"),Ie=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",qd,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":H.value,"empty-state-options":ae.value,"enable-entity-actions":"","error-message":O.value,fetcher:o.unref($e),"fetcher-cache-key":o.unref(T),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:re.value,"table-headers":o.unref(te),onClearSearchInput:W,"onClick:row":$[3]||($[3]=D=>me(D)),onSort:oe,onState:o.unref(d)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:re.value,"onUpdate:modelValue":$[0]||($[0]=D=>re.value=D),config:ve.value},null,8,["modelValue","config"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":r.canCreate},{default:o.withCtx(()=>[r.useToolbarCreationButton?(o.openBlock(),o.createBlock(K,{key:0,appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])):o.createCommentVNode("",!0)]),_:1},8,["auth-function"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",Kd,[h.value?(o.openBlock(),o.createBlock(K,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"certificates-learn-more-button",icon:"",onClick:$[1]||($[1]=D=>V.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.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:D})=>{var Ce;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Wd,o.toDisplayString((Ce=D==null?void 0:D.metadata)!=null&&Ce.subject?D.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",Gd,o.toDisplayString(o.unref(kt)(D).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:D})=>{var Ce;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",zd,o.toDisplayString((Ce=D==null?void 0:D.metadata)!=null&&Ce.expiry?o.unref(s)(D.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Jd,o.toDisplayString(o.unref(kt)(D).schemaExpiry?o.unref(s)(o.unref(kt)(D).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:D})=>{var Ce;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Yd,o.toDisplayString((Ce=D==null?void 0:D.metadata)!=null&&Ce.dns_names?`dns=${D.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",Zd,o.toDisplayString(o.unref(kt)(D).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:D})=>[D!=null&&D.cert?(o.openBlock(),o.createBlock(Ct,{key:0,"data-testid":"copy-certificate-cert",text:D.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Qd,"-"))]),tags:o.withCtx(({row:D})=>[o.createVNode(o.unref(A.TableTags),{tags:D==null?void 0:D.tags},null,8,["tags"])]),actions:o.withCtx(({row:D})=>[o.createVNode(Ie,null,{default:o.withCtx(({copyToClipboard:Ce})=>[o.createVNode(F,{"data-testid":"action-entity-copy-id",onClick:no=>w(D,Ce)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Ie,null,{default:o.withCtx(({copyToClipboard:Ce})=>[o.createVNode(F,{"data-testid":"action-entity-copy-json",onClick:no=>k(D,Ce)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(D)},{default:o.withCtx(()=>[o.createVNode(F,{"data-testid":"action-entity-view","has-divider":"",item:ie(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canEdit(D)},{default:o.withCtx(()=>[o.createVNode(F,{"data-testid":"action-entity-edit",item:ft(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(F,{"data-testid":"action-entity-add-sni",item:se(D.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canDelete(D)},{default:o.withCtx(()=>[o.createVNode(F,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>jr(D)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!re.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var D;return[o.createVNode(ke,{"data-testid":"certificates-entity-empty-state","icon-background":"",message:o.unref(n)("certificates.list.empty_state_v2.description"),title:o.unref(n)("certificates.list.empty_state_v2.title")},o.createSlots({icon:o.withCtx(()=>[o.createVNode(o.unref(je.ServiceDocumentIcon),{decoration:""})]),action:o.withCtx(()=>[Rt.value?(o.openBlock(),o.createBlock(K,{key:0,"data-testid":"entity-create-button",onClick:ir},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(K,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:$[2]||($[2]=Ce=>V.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(D=r.config)!=null&&D.isControlPlaneGroup?{name:"default",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","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(A.EntityDeleteModal),{"action-pending":G.value,"entity-type":o.unref(A.EntityTypes).Certificate,error:rr.value,title:o.unref(n)("certificates.delete.title"),visible:Ne.value,onCancel:M,onProceed:dt},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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"])])}}}),tr=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},ep=tr(Xd,[["__scopeId","data-v-198dc311"]]),tp="#d60027",rp={class:"sni-field-container"},ip={key:1,class:"sni-field-controls-container"},np={key:0},op=tr(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}}=tt.useI18n(),a=o.ref([]);return o.watch(t.modelValue,u=>{a.value=[...u]},{immediate:!0,deep:!0}),o.watch(a,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const d=o.resolveComponent("KLabel"),g=o.resolveComponent("KInput"),h=o.resolveComponent("KButton"),H=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",rp,[o.createVNode(d,{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(a.value,(ne,te)=>(o.openBlock(),o.createElementBlock("div",{key:te,class:"sni-field-input"},[!r.isEditing||a.value[te]?(o.openBlock(),o.createBlock(g,{key:0,modelValue:a.value[te],"onUpdate:modelValue":X=>a.value[te]=X,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${te+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",ip,[o.createVNode(h,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:X=>u.$emit("remove",te)},{default:o.withCtx(()=>[o.createVNode(o.unref(je.TrashIcon),{color:o.unref(tp)},null,8,["color"])]),_:2},1032,["onClick"]),o.createVNode(h,{appearance:"tertiary","data-testid":"add-sni",disabled:te!==a.value.length-1,icon:"",onClick:f[0]||(f[0]=X=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon))]),_:2},1032,["disabled"])]))]))),128)),a.value.length===0?(o.openBlock(),o.createElementBlock("div",np,[o.createVNode(h,{onClick:f[1]||(f[1]=ne=>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(H,{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-a5577ce8"]]),sp={class:"kong-ui-entities-certificates-form"},ap=tr(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 oe;const t=e,i=r,n=bi.useRouter(),{i18nT:s,i18n:{t:a}}=tt.useI18n(),{getMessageFromError:u}=A.useErrors(),{axiosInstance:f}=A.useAxios((oe=i.config)==null?void 0:oe.axiosRequestConfig),d=o.computed(()=>yi.form[i.config.app].edit),g=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),h=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),H=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),ne=o.computed(()=>(g.value===A.EntityBaseFormType.Create||JSON.stringify(h.fields)!==JSON.stringify(H))&&!!h.fields.cert&&!!h.fields.key),te=O=>{var w,k;h.fields.cert=(O==null?void 0:O.cert)||"",h.fields.key=(O==null?void 0:O.key)||"",h.fields.certAlt=(O==null?void 0:O.cert_alt)||"",h.fields.keyAlt=(O==null?void 0:O.key_alt)||"",h.fields.snis=(w=O==null?void 0:O.snis)!=null&&w.length?O.snis:[""],h.fields.tags=((k=O==null?void 0:O.tags)==null?void 0:k.join(", "))||"",Object.assign(H,h.fields)},X=()=>{n.push(i.config.cancelRoute)},re=()=>{h.fields.snis.push("")},ve=O=>{h.fields.snis.splice(O,1)},$e=o.computed(()=>{var w,k;let O=`${i.config.apiBaseUrl}${yi.form[i.config.app].validate}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(k=i.config)!=null&&k.workspace?`/${i.config.workspace}`:"")),O=O.replace(/{id}/gi,i.certificateId),O}),Z=o.computed(()=>{var w,k;let O=`${i.config.apiBaseUrl}${yi.form[i.config.app][g.value]}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(k=i.config)!=null&&k.workspace?`/${i.config.workspace}`:"")),O=O.replace(/{id}/gi,i.certificateId),O}),T=o.computed(()=>{var O,w;return{cert:h.fields.cert,key:h.fields.key,cert_alt:h.fields.certAlt||null,key_alt:h.fields.keyAlt||null,...i.showSnisField?{snis:h.fields.snis.filter(Boolean)}:{},tags:(w=(O=h.fields.tags.split(","))==null?void 0:O.map(k=>String(k||"").trim()))==null?void 0:w.filter(k=>k!=="")}}),W=async()=>{var O,w,k,me,ie,ft,se,ce,Ne;try{h.isReadonly=!0;let G;await f.post($e.value,T.value),g.value==="create"?G=await f.post(Z.value,T.value):g.value==="edit"&&(G=((O=i.config)==null?void 0:O.app)==="konnect"?await f.put(Z.value,T.value):await f.patch(Z.value,T.value)),h.fields.cert=((w=G==null?void 0:G.data)==null?void 0:w.cert)||"",h.fields.key=((k=G==null?void 0:G.data)==null?void 0:k.key)||"",h.fields.certAlt=((me=G==null?void 0:G.data)==null?void 0:me.cert_alt)||"",h.fields.keyAlt=((ie=G==null?void 0:G.data)==null?void 0:ie.key_alt)||"",h.fields.snis=(se=(ft=G==null?void 0:G.data)==null?void 0:ft.snis)!=null&&se.length?G.data.snis:[""],h.fields.tags=((Ne=(ce=G==null?void 0:G.data)==null?void 0:ce.tags)==null?void 0:Ne.join(", "))||"",Object.assign(H,h.fields),t("update",G==null?void 0:G.data)}catch(G){h.errorMessage=u(G),t("error",G)}finally{h.isReadonly=!1}};return(O,w)=>{const k=o.resolveComponent("KTextArea"),me=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",sp,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":ne.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).Certificate,"error-message":h.errorMessage,"fetch-url":d.value,"form-fields":T.value,"is-readonly":h.isReadonly,onCancel:X,"onFetch:error":w[7]||(w[7]=ie=>O.$emit("error",ie)),"onFetch:success":te,onLoading:w[8]||(w[8]=ie=>O.$emit("loading",ie)),onSubmit:W},{default:o.withCtx(()=>[o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(a)("certificates.form.sections.ssl.description"),title:o.unref(a)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(k,{modelValue:h.fields.cert,"onUpdate:modelValue":w[0]||(w[0]=ie=>h.fields.cert=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(a)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(k,{modelValue:h.fields.key,"onUpdate:modelValue":w[1]||(w[1]=ie=>h.fields.key=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(a)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(k,{modelValue:h.fields.certAlt,"onUpdate:modelValue":w[2]||(w[2]=ie=>h.fields.certAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(a)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(k,{modelValue:h.fields.keyAlt,"onUpdate:modelValue":w[3]||(w[3]=ie=>h.fields.keyAlt=ie),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(a)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(op,{key:0,modelValue:h.fields.snis,"onUpdate:modelValue":w[4]||(w[4]=ie=>h.fields.snis=ie),"is-editing":g.value===o.unref(A.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:re,onRemove:w[5]||(w[5]=ie=>ve(ie))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(a)("certificates.form.sections.general.description"),title:o.unref(a)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(me,{modelValue:h.fields.tags,"onUpdate:modelValue":w[6]||(w[6]=ie=>h.fields.tags=ie),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(a)("certificates.form.fields.tags.help"),label:o.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(a)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(a)("certificates.form.fields.tags.placeholder"),readonly:h.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-7988c8e6"]]),ro="/v2/control-planes/{controlPlaneId}/core-entities",io="/{workspace}",gi={list:{konnect:`${ro}/ca_certificates`,kongManager:`${io}/ca_certificates`},form:{konnect:{create:`${ro}/ca_certificates`,edit:`${ro}/ca_certificates/{id}`,validate:`${ro}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${io}/ca_certificates`,edit:`${io}/ca_certificates/{id}`,validate:`${io}/schemas/ca_certificates/validate`}}},cp={class:"kong-ui-ca-certificate-entity-config-card"},lp={key:0},up=tr(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:a}}=tt.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:d}=tt.useCertificate(),g=o.computed(()=>gi.form[n.config.app].edit),h=o.ref(),H=o.computed(()=>{if(h.value)return d(h.value)}),ne=o.computed(()=>{var Z;return((Z=H.value)==null?void 0:Z.schemaIssuer)||""}),te=o.computed(()=>{var Z,T;return(Z=H.value)!=null&&Z.schemaExpiry?a((T=H.value)==null?void 0:T.schemaExpiry):""}),X=o.computed(()=>{var Z;return((Z=H.value)==null?void 0:Z.schemaKeyUsages)||[]}),re=(Z,T)=>{const W=f("rowValue",T);if(Z==="expiry")return te.value;if(Z==="key_usages")return X.value;if(W)return W[Z]},ve=Z=>{h.value=Z,i("fetch:success",Z)},$e=o.ref({id:{},updated_at:{},created_at:{},cert:{section:A.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:A.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:A.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:A.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:A.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(Z,T)=>{const W=o.resolveComponent("KCodeBlock"),oe=o.resolveComponent("KLabel"),O=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",cp,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":$e.value,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"fetch-url":g.value,"hide-title":r.hideTitle,"onFetch:error":T[0]||(T[0]=w=>Z.$emit("fetch:error",w)),"onFetch:success":ve,onLoading:T[1]||(T[1]=w=>Z.$emit("loading",w))},{cert:o.withCtx(w=>[o.unref(f)("rowValue",w)?(o.openBlock(),o.createBlock(W,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",w),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(oe,{class:"metadata-label"},{default:o.withCtx(()=>T[2]||(T[2]=[o.createTextVNode(" Metadata ",-1)])),_:1,__:[2]})]),metadata:o.withCtx(w=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",w)).filter(k=>!t.includes(k)),k=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:k,"data-testid":`ca-cert-metadata-${k}`,item:{key:k,label:o.unref(u)(k),value:re(k,w),type:k==="key_usages"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(te.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ne.value||"–"),1)]),key_usages:o.withCtx(()=>[X.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",lp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(X.value,(w,k)=>(o.openBlock(),o.createBlock(O,{key:`key_usages-badge-tag-${k}`,class:"config-badge","data-testid":`key_usages-badge-tag-${k}`,tooltip:w,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-83648433"]]),fp={class:"kong-ui-entities-ca-certificates-list"},dp={class:"button-row"},pp={key:0},hp={key:1},yp={key:0},gp={key:1},mp=tr(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},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var Rt;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=tt.useI18n(),u=bi.useRouter(),{axiosInstance:f}=A.useAxios((Rt=i.config)==null?void 0:Rt.axiosRequestConfig),{hasRecords:d,handleStateChange:g}=A.useTableState(()=>re.value),h=o.computed(()=>d.value&&i.config.app==="konnect"),H=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),te={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}},X=o.computed(()=>{var V,$;let q=`${i.config.apiBaseUrl}${gi.list[i.config.app]}`;return i.config.app==="konnect"?q=q.replace(/{controlPlaneId}/gi,((V=i.config)==null?void 0:V.controlPlaneId)||""):i.config.app==="kongManager"&&(q=q.replace(/\/{workspace}/gi,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),q}),re=o.ref(""),ve=o.computed(()=>{const q=i.config.app==="konnect"||i.config.isExactMatch;return q?{isExactMatch:q,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:q,schema:i.config.filterSchema}}),{fetcher:$e,fetcherState:Z,fetcherCacheKey:T}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),X),W=()=>{re.value=""},oe=()=>{T.value++},O=o.ref(null),w=async(q,V)=>{const $=q.id;if(!await V($)){t("copy:error",{entity:q,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:q,field:"id",message:n("ca-certificates.copy.success",{val:$})})},k=async(q,V)=>{const $=JSON.stringify(q);if(!await V($)){t("copy:error",{entity:q,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:q,message:n("ca-certificates.copy.success_brief")})},me=async q=>{var $;await(($=i.canRetrieve)==null?void 0:$.call(i,q))&&u.push(i.config.getViewRoute(q.id))},ie=q=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(q)}),ft=q=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(q)}),se=o.ref(void 0),ce=o.ref(!1),Ne=o.ref(!1),G=o.ref(""),rr=A.useDeleteUrlBuilder(i.config,X.value),{certificateDataCache:Vr,getCertificateData:Pt}=tt.useCertificate(),kt=q=>{se.value=q,ce.value=!0},jr=()=>{ce.value=!1},M=async()=>{var q,V,$;if((q=se.value)!=null&&q.id){Ne.value=!0;try{await f.delete(rr(se.value.id)),Ne.value=!1,ce.value=!1,T.value++,t("delete:success",se.value)}catch(K){G.value=(($=(V=K.response)==null?void 0:V.data)==null?void 0:$.message)||K.message||n("ca-certificates.errors.delete"),t("error",K)}finally{Ne.value=!1}}},dt=()=>{u.push(i.config.createRoute)};o.watch(Z,q=>{var V,$,K;if(q.status===A.FetcherStatus.Error){O.value={title:n("ca-certificates.errors.general")},(K=($=(V=q.error)==null?void 0:V.response)==null?void 0:$.data)!=null&&K.message&&(O.value.message=q.error.response.data.message),t("error",q.error);return}Vr.value={},O.value=null});const ir=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")}),ae=o.ref(!1);return o.onBeforeMount(async()=>{ae.value=await i.canCreate(),ae.value&&(ir.value.title=n("ca-certificates.list.empty_state.title"),ir.value.ctaText=n("ca-certificates.actions.create"))}),(q,V)=>{const $=o.resolveComponent("KButton"),K=o.resolveComponent("KEmptyState"),ke=o.resolveComponent("KDropdownItem"),Ct=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",fp,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":H.value,"empty-state-options":ir.value,"enable-entity-actions":"","error-message":O.value,fetcher:o.unref($e),"fetcher-cache-key":o.unref(T),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:re.value,"table-headers":o.unref(te),onClearSearchInput:W,"onClick:row":V[3]||(V[3]=F=>me(F)),onSort:oe,onState:o.unref(g)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:re.value,"onUpdate:modelValue":V[0]||(V[0]=F=>re.value=F),config:ve.value},null,8,["modelValue","config"]),r.useToolbarCreationButton?(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:0,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode($,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])):o.createCommentVNode("",!0)]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",dp,[h.value?(o.openBlock(),o.createBlock($,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"ca-certificates-learn-more-button",icon:"",onClick:V[1]||(V[1]=F=>q.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode($,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.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:F})=>{var Ie;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",pp,o.toDisplayString((Ie=F==null?void 0:F.metadata)!=null&&Ie.issuer?F.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",hp,o.toDisplayString(o.unref(Pt)(F).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:F})=>{var Ie;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",yp,o.toDisplayString((Ie=F==null?void 0:F.metadata)!=null&&Ie.expiry?o.unref(s)(F.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",gp,o.toDisplayString(o.unref(Pt)(F).schemaExpiry?o.unref(s)(o.unref(Pt)(F).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:F})=>[o.createVNode(o.unref(A.TableTags),{tags:F==null?void 0:F.tags},null,8,["tags"])]),actions:o.withCtx(({row:F})=>[o.createVNode(Ct,null,{default:o.withCtx(({copyToClipboard:Ie})=>[o.createVNode(ke,{"data-testid":"action-entity-copy-id",onClick:D=>w(F,Ie)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Ct,null,{default:o.withCtx(({copyToClipboard:Ie})=>[o.createVNode(ke,{"data-testid":"action-entity-copy-json",onClick:D=>k(F,Ie)},{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(A.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(F)},{default:o.withCtx(()=>[o.createVNode(ke,{"data-testid":"action-entity-view","has-divider":"",item:ie(F.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canEdit(F)},{default:o.withCtx(()=>[o.createVNode(ke,{"data-testid":"action-entity-edit",item:ft(F.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canDelete(F)},{default:o.withCtx(()=>[o.createVNode(ke,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ie=>kt(F)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!re.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var F;return[o.createVNode(K,{"data-testid":"ca-certificates-entity-empty-state","icon-background":"",message:o.unref(n)("ca-certificates.list.empty_state_v2.description"),title:o.unref(n)("ca-certificates.list.empty_state_v2.title")},o.createSlots({icon:o.withCtx(()=>[o.createVNode(o.unref(je.ServiceDocumentIcon),{decorative:""})]),action:o.withCtx(()=>[ae.value?(o.openBlock(),o.createBlock($,{key:0,"data-testid":"entity-create-button",onClick:dt},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode($,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:V[2]||(V[2]=Ie=>q.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(F=r.config)!=null&&F.isControlPlaneGroup?{name:"default",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","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(A.EntityDeleteModal),{"action-pending":Ne.value,"entity-type":o.unref(A.EntityTypes).CACertificate,error:G.value,title:o.unref(n)("ca-certificates.delete.title"),visible:ce.value,onCancel:jr,onProceed:M},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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-c4525d48"]]),bp={class:"kong-ui-entities-ca-certificates-form"},vp=tr(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 Z;const t=e,i=r,n=bi.useRouter(),{i18n:{t:s}}=tt.useI18n(),{getMessageFromError:a}=A.useErrors(),{axiosInstance:u}=A.useAxios((Z=i.config)==null?void 0:Z.axiosRequestConfig),f=o.computed(()=>gi.form[i.config.app].edit),d=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),g=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),h=o.reactive({cert:"",certDigest:"",tags:""}),H=o.computed(()=>(d.value===A.EntityBaseFormType.Create||JSON.stringify(g.fields)!==JSON.stringify(h))&&!!g.fields.cert),ne=T=>{var W;g.fields.cert=(T==null?void 0:T.cert)||"",g.fields.certDigest=(T==null?void 0:T.cert_digest)||"",g.fields.tags=((W=T==null?void 0:T.tags)==null?void 0:W.join(", "))||"",Object.assign(h,g.fields)},te=()=>{n.push(i.config.cancelRoute)},X=o.computed(()=>{var W,oe;let T=`${i.config.apiBaseUrl}${gi.form[i.config.app].validate}`;return i.config.app==="konnect"?T=T.replace(/{controlPlaneId}/gi,((W=i.config)==null?void 0:W.controlPlaneId)||""):i.config.app==="kongManager"&&(T=T.replace(/\/{workspace}/gi,(oe=i.config)!=null&&oe.workspace?`/${i.config.workspace}`:"")),T=T.replace(/{id}/gi,i.certificateId),T}),re=o.computed(()=>{var W,oe;let T=`${i.config.apiBaseUrl}${gi.form[i.config.app][d.value]}`;return i.config.app==="konnect"?T=T.replace(/{controlPlaneId}/gi,((W=i.config)==null?void 0:W.controlPlaneId)||""):i.config.app==="kongManager"&&(T=T.replace(/\/{workspace}/gi,(oe=i.config)!=null&&oe.workspace?`/${i.config.workspace}`:"")),T=T.replace(/{id}/gi,i.certificateId),T}),ve=o.computed(()=>{var T,W;return{cert:g.fields.cert,cert_digest:g.fields.certDigest||null,tags:(W=(T=g.fields.tags.split(","))==null?void 0:T.map(oe=>String(oe||"").trim()))==null?void 0:W.filter(oe=>oe!=="")}}),$e=async()=>{var T,W,oe,O,w;try{g.isReadonly=!0;let k;await u.post(X.value,ve.value),d.value==="create"?k=await u.post(re.value,ve.value):d.value==="edit"&&(k=((T=i.config)==null?void 0:T.app)==="konnect"?await u.put(re.value,ve.value):await u.patch(re.value,ve.value)),g.fields.cert=((W=k==null?void 0:k.data)==null?void 0:W.cert)||"",g.fields.certDigest=((oe=k==null?void 0:k.data)==null?void 0:oe.cert_digest)||"",g.fields.tags=((w=(O=k==null?void 0:k.data)==null?void 0:O.tags)==null?void 0:w.join(", "))||"",Object.assign(h,g.fields),t("update",k==null?void 0:k.data)}catch(k){g.errorMessage=a(k),t("error",k)}finally{g.isReadonly=!1}};return(T,W)=>{const oe=o.resolveComponent("KTextArea"),O=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",bp,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":H.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"error-message":g.errorMessage,"fetch-url":f.value,"form-fields":ve.value,"is-readonly":g.isReadonly,onCancel:te,"onFetch:error":W[3]||(W[3]=w=>T.$emit("error",w)),"onFetch:success":ne,onLoading:W[4]||(W[4]=w=>T.$emit("loading",w)),onSubmit:$e},{default:o.withCtx(()=>[o.createVNode(o.unref(A.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(oe,{modelValue:g.fields.cert,"onUpdate:modelValue":W[0]||(W[0]=w=>g.fields.cert=w),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:g.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(O,{modelValue:g.fields.certDigest,"onUpdate:modelValue":W[1]||(W[1]=w=>g.fields.certDigest=w),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:g.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(A.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(O,{modelValue:g.fields.tags,"onUpdate:modelValue":W[2]||(W[2]=w=>g.fields.tags=w),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:g.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-a850d9bb"]]),wp={class:"kong-ui-certificate-entity-config-card"},Sp={key:0},Ap=tr(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:a}=tt.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:d}=tt.useCertificate(),g=o.computed(()=>yi.form[i.config.app].edit),h=o.ref(),H=o.ref({id:{},cert:{section:A.ConfigurationSchemaSection.Basic},key:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Redacted},metadata:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Json},snis:{section:A.ConfigurationSchemaSection.Basic,type:A.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:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:A.ConfigurationSchemaSection.Advanced},key_alt:{section:A.ConfigurationSchemaSection.Advanced,type:A.ConfigurationSchemaType.Redacted}}),ne=w=>{h.value=w,t("fetch:success",w)},te=(w,k)=>{const me=f("rowValue",k);if(w==="expiry")return re.value;if(w==="key_usages")return T.value;if(w==="san_names")return $e.value;if(me)return me[w]},X=o.computed(()=>{if(h.value)return d(h.value)}),re=o.computed(()=>{var w,k;return(w=X.value)!=null&&w.schemaExpiry?s((k=X.value)==null?void 0:k.schemaExpiry):""}),ve=o.computed(()=>{var w;return((w=X.value)==null?void 0:w.schemaIssuer)||""}),$e=o.computed(()=>{var w;return((w=X.value)==null?void 0:w.schemaSanNames)||""}),Z=o.computed(()=>{var w;return((w=X.value)==null?void 0:w.schemaSubject)||""}),T=o.computed(()=>{var w;return((w=X.value)==null?void 0:w.schemaKeyUsages)||[]}),W=o.computed(()=>{var w,k;return((k=(w=h==null?void 0:h.value)==null?void 0:w.snis)==null?void 0:k.length)>0}),oe=o.computed(()=>{var w;return!!((w=h==null?void 0:h.value)!=null&&w.cert_alt)}),O=w=>{var k,me;return w==="san_names"?n("certificates.list.table_headers.san"):((me=(k=H.value)==null?void 0:k[w])==null?void 0:me.label)||u(w)};return(w,k)=>{const me=o.resolveComponent("KCodeBlock"),ie=o.resolveComponent("KLabel"),ft=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",wp,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":H.value,"entity-type":o.unref(A.SupportedEntityType).Certificate,"fetch-url":g.value,"hide-title":r.hideTitle,"onFetch:error":k[0]||(k[0]=se=>w.$emit("fetch:error",se)),"onFetch:success":ne,onLoading:k[1]||(k[1]=se=>w.$emit("loading",se))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(se=>[o.unref(f)("rowValue",se)?(o.openBlock(),o.createBlock(me,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",se),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(()=>k[2]||(k[2]=[o.createTextVNode(" Metadata ",-1)])),_:1,__:[2]})]),metadata:o.withCtx(se=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",se)),ce=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:ce,item:{key:ce,value:te(ce,se),label:O(ce),type:ce==="key_usages"||ce==="snis"||ce==="dns_names"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(re.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ve.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString($e.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Z.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(a),{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(()=>[T.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Sp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(T.value,(se,ce)=>(o.openBlock(),o.createBlock(ft,{key:`key_usages-badge-tag-${ce}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ce}`,tooltip:se,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(se),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[W.value?void 0:{name:"snis",fn:o.withCtx(()=>[k[3]||(k[3]=o.createTextVNode(" – ",-1))]),key:"0"},oe.value?{name:"cert_alt",fn:o.withCtx(se=>[k[4]||(k[4]=o.createTextVNode(" > ",-1)),o.unref(f)("rowValue",se)?(o.openBlock(),o.createBlock(me,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",se),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-de8f90ef"]]);xe.CACertificateConfigCard=up,xe.CACertificateForm=vp,xe.CACertificateList=mp,xe.CertificateConfigCard=Ap,xe.CertificateForm=ap,xe.CertificateList=ep,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})});
|