@kong-ui-public/entities-certificates 3.4.6 → 3.4.7
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.
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
13
|
and limitations under the License.
|
|
14
|
-
***************************************************************************** */var cl;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof Bo=="object"?Bo:typeof self=="object"?self:typeof this=="object"?this:l(),n=o(e);typeof r.Reflect<"u"&&(n=o(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(c,d){return function(y,p){Object.defineProperty(c,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function l(){return s()||a()}})(function(t,r){var n=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",s=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,y={create:l?function(){return sl(Object.create(null))}:c?function(){return sl({__proto__:null})}:function(){return sl({})},has:d?function(k,A){return n.call(k,A)}:function(k,A){return A in k},get:d?function(k,A){return n.call(k,A)?k[A]:void 0}:function(k,A){return k[A]}},p=Object.getPrototypeOf(Function),E=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Fb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:qb(),h=typeof WeakMap=="function"?WeakMap:Kb(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,b=Ub(),v=Lb(b);function B(k,A,_,D){if(X(_)){if(!xe(k))throw new TypeError;if(!Ae(A))throw new TypeError;return J(k,A)}else{if(!xe(k))throw new TypeError;if(!q(A))throw new TypeError;if(!q(D)&&!X(D)&&!te(D))throw new TypeError;return te(D)&&(D=void 0),_=re(_),ee(k,A,_,D)}}t("decorate",B);function C(k,A){function _(D,Q){if(!q(D))throw new TypeError;if(!X(Q)&&!Gr(Q))throw new TypeError;qr(k,A,D,Q)}return _}t("metadata",C);function S(k,A,_,D){if(!q(_))throw new TypeError;return X(D)||(D=re(D)),qr(k,A,_,D)}t("defineMetadata",S);function T(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),ne(k,A,_)}t("hasMetadata",T);function N(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),me(k,A,_)}t("hasOwnMetadata",N);function I(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),ie(k,A,_)}t("getMetadata",I);function x(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),Ne(k,A,_)}t("getOwnMetadata",x);function O(k,A){if(!q(k))throw new TypeError;return X(A)||(A=re(A)),Kr(k,A)}t("getMetadataKeys",O);function G(k,A){if(!q(k))throw new TypeError;return X(A)||(A=re(A)),fr(k,A)}t("getOwnMetadataKeys",G);function R(k,A,_){if(!q(A))throw new TypeError;if(X(_)||(_=re(_)),!q(A))throw new TypeError;X(_)||(_=re(_));var D=Di(A,_,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(k,A,_)}t("deleteMetadata",R);function J(k,A){for(var _=k.length-1;_>=0;--_){var D=k[_],Q=D(A);if(!X(Q)&&!te(Q)){if(!Ae(Q))throw new TypeError;A=Q}}return A}function ee(k,A,_,D){for(var Q=k.length-1;Q>=0;--Q){var be=k[Q],Be=be(A,_,D);if(!X(Be)&&!te(Be)){if(!q(Be))throw new TypeError;D=Be}}return D}function ne(k,A,_){var D=me(k,A,_);if(D)return!0;var Q=ol(A);return te(Q)?!1:ne(k,Q,_)}function me(k,A,_){var D=Di(A,_,!1);return X(D)?!1:Qe(D.OrdinaryHasOwnMetadata(k,A,_))}function ie(k,A,_){var D=me(k,A,_);if(D)return Ne(k,A,_);var Q=ol(A);if(!te(Q))return ie(k,Q,_)}function Ne(k,A,_){var D=Di(A,_,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(k,A,_)}function qr(k,A,_,D){var Q=Di(_,D,!0);Q.OrdinaryDefineOwnMetadata(k,A,_,D)}function Kr(k,A){var _=fr(k,A),D=ol(k);if(D===null)return _;var Q=Kr(D,A);if(Q.length<=0)return _;if(_.length<=0)return Q;for(var be=new w,Be=[],se=0,$=_;se<$.length;se++){var K=$[se],H=be.has(K);H||(be.add(K),Be.push(K))}for(var W=0,ae=Q;W<ae.length;W++){var K=ae[W],H=be.has(K);H||(be.add(K),Be.push(K))}return Be}function fr(k,A){var _=Di(k,A,!1);return _?_.OrdinaryOwnMetadataKeys(k,A):[]}function Dt(k){if(k===null)return 1;switch(typeof k){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return k===null?1:6;default:return 6}}function X(k){return k===void 0}function te(k){return k===null}function U(k){return typeof k=="symbol"}function q(k){return typeof k=="object"?k!==null:typeof k=="function"}function fe(k,A){switch(Dt(k)){case 0:return k;case 1:return k;case 2:return k;case 3:return k;case 4:return k;case 5:return k}var _=A===3?"string":A===5?"number":"default",D=np(k,s);if(D!==void 0){var Q=D.call(k,_);if(q(Q))throw new TypeError;return Q}return Ue(k,_==="default"?"number":_)}function Ue(k,A){if(A==="string"){var _=k.toString;if(Z(_)){var D=_.call(k);if(!q(D))return D}var Q=k.valueOf;if(Z(Q)){var D=Q.call(k);if(!q(D))return D}}else{var Q=k.valueOf;if(Z(Q)){var D=Q.call(k);if(!q(D))return D}var be=k.toString;if(Z(be)){var D=be.call(k);if(!q(D))return D}}throw new TypeError}function Qe(k){return!!k}function zr(k){return""+k}function re(k){var A=fe(k,3);return U(A)?A:zr(A)}function xe(k){return Array.isArray?Array.isArray(k):k instanceof Object?k instanceof Array:Object.prototype.toString.call(k)==="[object Array]"}function Z(k){return typeof k=="function"}function Ae(k){return typeof k=="function"}function Gr(k){switch(Dt(k)){case 3:return!0;case 4:return!0;default:return!1}}function nl(k,A){return k===A||k!==k&&A!==A}function np(k,A){var _=k[A];if(_!=null){if(!Z(_))throw new TypeError;return _}}function op(k){var A=np(k,a);if(!Z(A))throw new TypeError;var _=A.call(k);if(!q(_))throw new TypeError;return _}function sp(k){return k.value}function ap(k){var A=k.next();return A.done?!1:A}function lp(k){var A=k.return;A&&A.call(k)}function ol(k){var A=Object.getPrototypeOf(k);if(typeof k!="function"||k===p||A!==p)return A;var _=k.prototype,D=_&&Object.getPrototypeOf(_);if(D==null||D===Object.prototype)return A;var Q=D.constructor;return typeof Q!="function"||Q===k?A:Q}function Pb(){var k;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(k=Hb(r.Reflect));var A,_,D,Q=new h,be={registerProvider:Be,getProvider:$,setProvider:H};return be;function Be(W){if(!Object.isExtensible(be))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case k===W:break;case X(A):A=W;break;case A===W:break;case X(_):_=W;break;case _===W:break;default:D===void 0&&(D=new w),D.add(W);break}}function se(W,ae){if(!X(A)){if(A.isProviderFor(W,ae))return A;if(!X(_)){if(_.isProviderFor(W,ae))return A;if(!X(D))for(var he=op(D);;){var we=ap(he);if(!we)return;var dt=sp(we);if(dt.isProviderFor(W,ae))return lp(he),dt}}}if(!X(k)&&k.isProviderFor(W,ae))return k}function $(W,ae){var he=Q.get(W),we;return X(he)||(we=he.get(ae)),X(we)&&(we=se(W,ae),X(we)||(X(he)&&(he=new E,Q.set(W,he)),he.set(ae,we))),we}function K(W){if(X(W))throw new TypeError;return A===W||_===W||!X(D)&&D.has(W)}function H(W,ae,he){if(!K(he))throw new Error("Metadata provider not registered.");var we=$(W,ae);if(we!==he){if(!X(we))return!1;var dt=Q.get(W);X(dt)&&(dt=new E,Q.set(W,dt)),dt.set(ae,he)}return!0}}function Ub(){var k;return!X(g)&&q(r.Reflect)&&Object.isExtensible(r.Reflect)&&(k=r.Reflect[g]),X(k)&&(k=Pb()),!X(g)&&q(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:k}),k}function Lb(k){var A=new h,_={isProviderFor:function(K,H){var W=A.get(K);return X(W)?!1:W.has(H)},OrdinaryDefineOwnMetadata:Be,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:be,OrdinaryOwnMetadataKeys:se,OrdinaryDeleteMetadata:$};return b.registerProvider(_),_;function D(K,H,W){var ae=A.get(K),he=!1;if(X(ae)){if(!W)return;ae=new E,A.set(K,ae),he=!0}var we=ae.get(H);if(X(we)){if(!W)return;if(we=new E,ae.set(H,we),!k.setProvider(K,H,_))throw ae.delete(H),he&&A.delete(K),new Error("Wrong provider for target.")}return we}function Q(K,H,W){var ae=D(H,W,!1);return X(ae)?!1:Qe(ae.has(K))}function be(K,H,W){var ae=D(H,W,!1);if(!X(ae))return ae.get(K)}function Be(K,H,W,ae){var he=D(W,ae,!0);he.set(K,H)}function se(K,H){var W=[],ae=D(K,H,!1);if(X(ae))return W;for(var he=ae.keys(),we=op(he),dt=0;;){var cp=ap(we);if(!cp)return W.length=dt,W;var zb=sp(cp);try{W[dt]=zb}catch(Gb){try{lp(we)}finally{throw Gb}}dt++}}function $(K,H,W){var ae=D(H,W,!1);if(X(ae)||!ae.delete(K))return!1;if(ae.size===0){var he=A.get(H);X(he)||(he.delete(W),he.size===0&&A.delete(he))}return!0}}function Hb(k){var A=k.defineMetadata,_=k.hasOwnMetadata,D=k.getOwnMetadata,Q=k.getOwnMetadataKeys,be=k.deleteMetadata,Be=new h,se={isProviderFor:function($,K){var H=Be.get($);return X(H)?Q($,K).length?(X(H)&&(H=new w,Be.set($,H)),H.add(K),!0):!1:H.has(K)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:_,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:be};return se}function Di(k,A,_){var D=b.getProvider(k,A);if(!X(D))return D;if(_){if(b.setProvider(k,A,v))return v;throw new Error("Illegal state.")}}function Fb(){var k={},A=[],_=function(){function se($,K,H){this._index=0,this._keys=$,this._values=K,this._selector=H}return se.prototype["@@iterator"]=function(){return this},se.prototype[a]=function(){return this},se.prototype.next=function(){var $=this._index;if($>=0&&$<this._keys.length){var K=this._selector(this._keys[$],this._values[$]);return $+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:K,done:!1}}return{value:void 0,done:!0}},se.prototype.throw=function($){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),$},se.prototype.return=function($){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:$,done:!0}},se}(),D=function(){function se(){this._keys=[],this._values=[],this._cacheKey=k,this._cacheIndex=-2}return Object.defineProperty(se.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),se.prototype.has=function($){return this._find($,!1)>=0},se.prototype.get=function($){var K=this._find($,!1);return K>=0?this._values[K]:void 0},se.prototype.set=function($,K){var H=this._find($,!0);return this._values[H]=K,this},se.prototype.delete=function($){var K=this._find($,!1);if(K>=0){for(var H=this._keys.length,W=K+1;W<H;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,nl($,this._cacheKey)&&(this._cacheKey=k,this._cacheIndex=-2),!0}return!1},se.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=k,this._cacheIndex=-2},se.prototype.keys=function(){return new _(this._keys,this._values,Q)},se.prototype.values=function(){return new _(this._keys,this._values,be)},se.prototype.entries=function(){return new _(this._keys,this._values,Be)},se.prototype["@@iterator"]=function(){return this.entries()},se.prototype[a]=function(){return this.entries()},se.prototype._find=function($,K){if(!nl(this._cacheKey,$)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(nl(this._keys[H],$)){this._cacheIndex=H;break}}return this._cacheIndex<0&&K&&(this._cacheIndex=this._keys.length,this._keys.push($),this._values.push(void 0)),this._cacheIndex},se}();return D;function Q(se,$){return se}function be(se,$){return $}function Be(se,$){return[se,$]}}function qb(){var k=function(){function A(){this._map=new E}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(_){return this._map.has(_)},A.prototype.add=function(_){return this._map.set(_,_),this},A.prototype.delete=function(_){return this._map.delete(_)},A.prototype.clear=function(){this._map.clear()},A.prototype.keys=function(){return this._map.keys()},A.prototype.values=function(){return this._map.keys()},A.prototype.entries=function(){return this._map.entries()},A.prototype["@@iterator"]=function(){return this.keys()},A.prototype[a]=function(){return this.keys()},A}();return k}function Kb(){var k=16,A=y.create(),_=D();return function(){function $(){this._key=D()}return $.prototype.has=function(K){var H=Q(K,!1);return H!==void 0?y.has(H,this._key):!1},$.prototype.get=function(K){var H=Q(K,!1);return H!==void 0?y.get(H,this._key):void 0},$.prototype.set=function(K,H){var W=Q(K,!0);return W[this._key]=H,this},$.prototype.delete=function(K){var H=Q(K,!1);return H!==void 0?delete H[this._key]:!1},$.prototype.clear=function(){this._key=D()},$}();function D(){var $;do $="@@WeakMap@@"+se();while(y.has(A,$));return A[$]=!0,$}function Q($,K){if(!n.call($,_)){if(!K)return;Object.defineProperty($,_,{value:y.create()})}return $[_]}function be($,K){for(var H=0;H<K;++H)$[H]=Math.random()*255|0;return $}function Be($){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array($)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array($)):be(new Uint8Array($),$):be(new Array($),$)}function se(){var $=Be(k);$[6]=$[6]&79|64,$[8]=$[8]&191|128;for(var K="",H=0;H<k;++H){var W=$[H];(H===4||H===6||H===8)&&(K+="-"),W<16&&(K+="0"),K+=W.toString(16).toLowerCase()}return K}}function sl(k){return k.__=void 0,delete k.__,k}})})(cl||(cl={}));/*!
|
|
14
|
+
***************************************************************************** */var cl;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof Bo=="object"?Bo:typeof self=="object"?self:typeof this=="object"?this:l(),n=o(e);typeof r.Reflect<"u"&&(n=o(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(c,d){return function(y,p){Object.defineProperty(c,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function l(){return s()||a()}})(function(t,r){var n=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",s=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,y={create:l?function(){return sl(Object.create(null))}:c?function(){return sl({__proto__:null})}:function(){return sl({})},has:d?function(k,A){return n.call(k,A)}:function(k,A){return A in k},get:d?function(k,A){return n.call(k,A)?k[A]:void 0}:function(k,A){return k[A]}},p=Object.getPrototypeOf(Function),E=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Fb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:qb(),h=typeof WeakMap=="function"?WeakMap:Kb(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,b=Ub(),v=Lb(b);function B(k,A,_,D){if(X(_)){if(!xe(k))throw new TypeError;if(!Ae(A))throw new TypeError;return J(k,A)}else{if(!xe(k))throw new TypeError;if(!q(A))throw new TypeError;if(!q(D)&&!X(D)&&!te(D))throw new TypeError;return te(D)&&(D=void 0),_=re(_),ee(k,A,_,D)}}t("decorate",B);function S(k,A){function _(D,Q){if(!q(D))throw new TypeError;if(!X(Q)&&!Gr(Q))throw new TypeError;qr(k,A,D,Q)}return _}t("metadata",S);function C(k,A,_,D){if(!q(_))throw new TypeError;return X(D)||(D=re(D)),qr(k,A,_,D)}t("defineMetadata",C);function T(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),ne(k,A,_)}t("hasMetadata",T);function N(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),me(k,A,_)}t("hasOwnMetadata",N);function I(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),ie(k,A,_)}t("getMetadata",I);function x(k,A,_){if(!q(A))throw new TypeError;return X(_)||(_=re(_)),Ne(k,A,_)}t("getOwnMetadata",x);function O(k,A){if(!q(k))throw new TypeError;return X(A)||(A=re(A)),Kr(k,A)}t("getMetadataKeys",O);function G(k,A){if(!q(k))throw new TypeError;return X(A)||(A=re(A)),fr(k,A)}t("getOwnMetadataKeys",G);function R(k,A,_){if(!q(A))throw new TypeError;if(X(_)||(_=re(_)),!q(A))throw new TypeError;X(_)||(_=re(_));var D=Di(A,_,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(k,A,_)}t("deleteMetadata",R);function J(k,A){for(var _=k.length-1;_>=0;--_){var D=k[_],Q=D(A);if(!X(Q)&&!te(Q)){if(!Ae(Q))throw new TypeError;A=Q}}return A}function ee(k,A,_,D){for(var Q=k.length-1;Q>=0;--Q){var be=k[Q],Be=be(A,_,D);if(!X(Be)&&!te(Be)){if(!q(Be))throw new TypeError;D=Be}}return D}function ne(k,A,_){var D=me(k,A,_);if(D)return!0;var Q=ol(A);return te(Q)?!1:ne(k,Q,_)}function me(k,A,_){var D=Di(A,_,!1);return X(D)?!1:Qe(D.OrdinaryHasOwnMetadata(k,A,_))}function ie(k,A,_){var D=me(k,A,_);if(D)return Ne(k,A,_);var Q=ol(A);if(!te(Q))return ie(k,Q,_)}function Ne(k,A,_){var D=Di(A,_,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(k,A,_)}function qr(k,A,_,D){var Q=Di(_,D,!0);Q.OrdinaryDefineOwnMetadata(k,A,_,D)}function Kr(k,A){var _=fr(k,A),D=ol(k);if(D===null)return _;var Q=Kr(D,A);if(Q.length<=0)return _;if(_.length<=0)return Q;for(var be=new w,Be=[],se=0,$=_;se<$.length;se++){var K=$[se],H=be.has(K);H||(be.add(K),Be.push(K))}for(var W=0,ae=Q;W<ae.length;W++){var K=ae[W],H=be.has(K);H||(be.add(K),Be.push(K))}return Be}function fr(k,A){var _=Di(k,A,!1);return _?_.OrdinaryOwnMetadataKeys(k,A):[]}function Dt(k){if(k===null)return 1;switch(typeof k){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return k===null?1:6;default:return 6}}function X(k){return k===void 0}function te(k){return k===null}function U(k){return typeof k=="symbol"}function q(k){return typeof k=="object"?k!==null:typeof k=="function"}function fe(k,A){switch(Dt(k)){case 0:return k;case 1:return k;case 2:return k;case 3:return k;case 4:return k;case 5:return k}var _=A===3?"string":A===5?"number":"default",D=np(k,s);if(D!==void 0){var Q=D.call(k,_);if(q(Q))throw new TypeError;return Q}return Ue(k,_==="default"?"number":_)}function Ue(k,A){if(A==="string"){var _=k.toString;if(Z(_)){var D=_.call(k);if(!q(D))return D}var Q=k.valueOf;if(Z(Q)){var D=Q.call(k);if(!q(D))return D}}else{var Q=k.valueOf;if(Z(Q)){var D=Q.call(k);if(!q(D))return D}var be=k.toString;if(Z(be)){var D=be.call(k);if(!q(D))return D}}throw new TypeError}function Qe(k){return!!k}function zr(k){return""+k}function re(k){var A=fe(k,3);return U(A)?A:zr(A)}function xe(k){return Array.isArray?Array.isArray(k):k instanceof Object?k instanceof Array:Object.prototype.toString.call(k)==="[object Array]"}function Z(k){return typeof k=="function"}function Ae(k){return typeof k=="function"}function Gr(k){switch(Dt(k)){case 3:return!0;case 4:return!0;default:return!1}}function nl(k,A){return k===A||k!==k&&A!==A}function np(k,A){var _=k[A];if(_!=null){if(!Z(_))throw new TypeError;return _}}function op(k){var A=np(k,a);if(!Z(A))throw new TypeError;var _=A.call(k);if(!q(_))throw new TypeError;return _}function sp(k){return k.value}function ap(k){var A=k.next();return A.done?!1:A}function lp(k){var A=k.return;A&&A.call(k)}function ol(k){var A=Object.getPrototypeOf(k);if(typeof k!="function"||k===p||A!==p)return A;var _=k.prototype,D=_&&Object.getPrototypeOf(_);if(D==null||D===Object.prototype)return A;var Q=D.constructor;return typeof Q!="function"||Q===k?A:Q}function Pb(){var k;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(k=Hb(r.Reflect));var A,_,D,Q=new h,be={registerProvider:Be,getProvider:$,setProvider:H};return be;function Be(W){if(!Object.isExtensible(be))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case k===W:break;case X(A):A=W;break;case A===W:break;case X(_):_=W;break;case _===W:break;default:D===void 0&&(D=new w),D.add(W);break}}function se(W,ae){if(!X(A)){if(A.isProviderFor(W,ae))return A;if(!X(_)){if(_.isProviderFor(W,ae))return A;if(!X(D))for(var he=op(D);;){var we=ap(he);if(!we)return;var dt=sp(we);if(dt.isProviderFor(W,ae))return lp(he),dt}}}if(!X(k)&&k.isProviderFor(W,ae))return k}function $(W,ae){var he=Q.get(W),we;return X(he)||(we=he.get(ae)),X(we)&&(we=se(W,ae),X(we)||(X(he)&&(he=new E,Q.set(W,he)),he.set(ae,we))),we}function K(W){if(X(W))throw new TypeError;return A===W||_===W||!X(D)&&D.has(W)}function H(W,ae,he){if(!K(he))throw new Error("Metadata provider not registered.");var we=$(W,ae);if(we!==he){if(!X(we))return!1;var dt=Q.get(W);X(dt)&&(dt=new E,Q.set(W,dt)),dt.set(ae,he)}return!0}}function Ub(){var k;return!X(g)&&q(r.Reflect)&&Object.isExtensible(r.Reflect)&&(k=r.Reflect[g]),X(k)&&(k=Pb()),!X(g)&&q(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:k}),k}function Lb(k){var A=new h,_={isProviderFor:function(K,H){var W=A.get(K);return X(W)?!1:W.has(H)},OrdinaryDefineOwnMetadata:Be,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:be,OrdinaryOwnMetadataKeys:se,OrdinaryDeleteMetadata:$};return b.registerProvider(_),_;function D(K,H,W){var ae=A.get(K),he=!1;if(X(ae)){if(!W)return;ae=new E,A.set(K,ae),he=!0}var we=ae.get(H);if(X(we)){if(!W)return;if(we=new E,ae.set(H,we),!k.setProvider(K,H,_))throw ae.delete(H),he&&A.delete(K),new Error("Wrong provider for target.")}return we}function Q(K,H,W){var ae=D(H,W,!1);return X(ae)?!1:Qe(ae.has(K))}function be(K,H,W){var ae=D(H,W,!1);if(!X(ae))return ae.get(K)}function Be(K,H,W,ae){var he=D(W,ae,!0);he.set(K,H)}function se(K,H){var W=[],ae=D(K,H,!1);if(X(ae))return W;for(var he=ae.keys(),we=op(he),dt=0;;){var cp=ap(we);if(!cp)return W.length=dt,W;var zb=sp(cp);try{W[dt]=zb}catch(Gb){try{lp(we)}finally{throw Gb}}dt++}}function $(K,H,W){var ae=D(H,W,!1);if(X(ae)||!ae.delete(K))return!1;if(ae.size===0){var he=A.get(H);X(he)||(he.delete(W),he.size===0&&A.delete(he))}return!0}}function Hb(k){var A=k.defineMetadata,_=k.hasOwnMetadata,D=k.getOwnMetadata,Q=k.getOwnMetadataKeys,be=k.deleteMetadata,Be=new h,se={isProviderFor:function($,K){var H=Be.get($);return X(H)?Q($,K).length?(X(H)&&(H=new w,Be.set($,H)),H.add(K),!0):!1:H.has(K)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:_,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:be};return se}function Di(k,A,_){var D=b.getProvider(k,A);if(!X(D))return D;if(_){if(b.setProvider(k,A,v))return v;throw new Error("Illegal state.")}}function Fb(){var k={},A=[],_=function(){function se($,K,H){this._index=0,this._keys=$,this._values=K,this._selector=H}return se.prototype["@@iterator"]=function(){return this},se.prototype[a]=function(){return this},se.prototype.next=function(){var $=this._index;if($>=0&&$<this._keys.length){var K=this._selector(this._keys[$],this._values[$]);return $+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:K,done:!1}}return{value:void 0,done:!0}},se.prototype.throw=function($){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),$},se.prototype.return=function($){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:$,done:!0}},se}(),D=function(){function se(){this._keys=[],this._values=[],this._cacheKey=k,this._cacheIndex=-2}return Object.defineProperty(se.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),se.prototype.has=function($){return this._find($,!1)>=0},se.prototype.get=function($){var K=this._find($,!1);return K>=0?this._values[K]:void 0},se.prototype.set=function($,K){var H=this._find($,!0);return this._values[H]=K,this},se.prototype.delete=function($){var K=this._find($,!1);if(K>=0){for(var H=this._keys.length,W=K+1;W<H;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,nl($,this._cacheKey)&&(this._cacheKey=k,this._cacheIndex=-2),!0}return!1},se.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=k,this._cacheIndex=-2},se.prototype.keys=function(){return new _(this._keys,this._values,Q)},se.prototype.values=function(){return new _(this._keys,this._values,be)},se.prototype.entries=function(){return new _(this._keys,this._values,Be)},se.prototype["@@iterator"]=function(){return this.entries()},se.prototype[a]=function(){return this.entries()},se.prototype._find=function($,K){if(!nl(this._cacheKey,$)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(nl(this._keys[H],$)){this._cacheIndex=H;break}}return this._cacheIndex<0&&K&&(this._cacheIndex=this._keys.length,this._keys.push($),this._values.push(void 0)),this._cacheIndex},se}();return D;function Q(se,$){return se}function be(se,$){return $}function Be(se,$){return[se,$]}}function qb(){var k=function(){function A(){this._map=new E}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(_){return this._map.has(_)},A.prototype.add=function(_){return this._map.set(_,_),this},A.prototype.delete=function(_){return this._map.delete(_)},A.prototype.clear=function(){this._map.clear()},A.prototype.keys=function(){return this._map.keys()},A.prototype.values=function(){return this._map.keys()},A.prototype.entries=function(){return this._map.entries()},A.prototype["@@iterator"]=function(){return this.keys()},A.prototype[a]=function(){return this.keys()},A}();return k}function Kb(){var k=16,A=y.create(),_=D();return function(){function $(){this._key=D()}return $.prototype.has=function(K){var H=Q(K,!1);return H!==void 0?y.has(H,this._key):!1},$.prototype.get=function(K){var H=Q(K,!1);return H!==void 0?y.get(H,this._key):void 0},$.prototype.set=function(K,H){var W=Q(K,!0);return W[this._key]=H,this},$.prototype.delete=function(K){var H=Q(K,!1);return H!==void 0?delete H[this._key]:!1},$.prototype.clear=function(){this._key=D()},$}();function D(){var $;do $="@@WeakMap@@"+se();while(y.has(A,$));return A[$]=!0,$}function Q($,K){if(!n.call($,_)){if(!K)return;Object.defineProperty($,_,{value:y.create()})}return $[_]}function be($,K){for(var H=0;H<K;++H)$[H]=Math.random()*255|0;return $}function Be($){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array($)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array($)):be(new Uint8Array($),$):be(new Array($),$)}function se(){var $=Be(k);$[6]=$[6]&79|64,$[8]=$[8]&191|128;for(var K="",H=0;H<k;++H){var W=$[H];(H===4||H===6||H===8)&&(K+="-"),W<16&&(K+="0"),K+=W.toString(16).toLowerCase()}return K}}function sl(k){return k.__=void 0,delete k.__,k}})})(cl||(cl={}));/*!
|
|
15
15
|
* MIT License
|
|
16
16
|
*
|
|
17
17
|
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
`).map(o=>` ${o}`).join(`
|
|
73
73
|
`));const r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${r} :
|
|
74
74
|
${t.join(`
|
|
75
|
-
`)}`:`${r} :`}}Cl=He,P.Constructed=Cl,He.NAME="CONSTRUCTED";class Sl extends Me{fromBER(t,r,n){return r}toBER(t){return nt}}Sl.override="EndOfContentValueBlock";var xl;class Vo extends Ee{constructor(t={}){super(t,Sl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}xl=Vo,P.EndOfContent=xl,Vo.NAME=Yr;var Al;class Wt extends Ee{constructor(t={}){super(t,Me),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,r+n>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+n}toBER(t,r){const n=new ArrayBuffer(2);if(!t){const o=new Uint8Array(n);o[0]=5,o[1]=0}return r&&r.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}}Al=Wt,P.Null=Al,Wt.NAME="NULL";class Bl extends pt(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=M.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,n){const o=M.toUint8Array(t);return Ct(this,o,r,n)?(this.valueHexView=o.subarray(r,r+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,fl.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Bl.NAME="BooleanValueBlock";var Il;let Li=class extends Ee{constructor(t={}){super(t,Bl),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Il=Li,P.Boolean=Il,Li.NAME="BOOLEAN";class Nl extends pt($t){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,n){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=$t.prototype.fromBER.call(this,t,r,n),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==yl)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,n),this.blockLength=n;return o}toBER(t,r){return this.isConstructed?$t.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Nl.NAME="OctetStringValueBlock";var El;let Jt=class up extends Ee{constructor({idBlock:t={},lenBlock:r={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Nl),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+n);try{if(s.byteLength){const a=hr(s,0,s.byteLength);a.offset!==-1&&a.offset===n&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,n)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?He.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof up&&t.push(r.valueBlock.valueHexView);return M.concat(t)}};El=Jt,P.OctetString=El,Jt.NAME=yl;class Ol extends pt($t){constructor({unusedBits:t=0,isConstructed:r=!1,...n}={}){super(n),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,n){if(!n)return r;let o=-1;if(this.isConstructed){if(o=$t.prototype.fromBER.call(this,t,r,n),o===-1)return o;for(const l of this.value){const c=l.constructor.NAME;if(c===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==gl)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=l.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 o}const s=M.toUint8Array(t);if(!Ct(this,s,r,n))return-1;const a=s.subarray(r,r+n);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const l=a.subarray(1);try{if(l.byteLength){const c=hr(l,0,l.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+n}toBER(t,r){if(this.isConstructed)return $t.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return nt;const n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Ol.NAME="BitStringValueBlock";var _l;let Yt=class extends Ee{constructor({idBlock:t={},lenBlock:r={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Ol),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return He.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const n=t.join("");return`${this.constructor.NAME} : ${n.substring(0,n.length-this.valueBlock.unusedBits)}`}}};_l=Yt,P.BitString=_l,Yt.NAME=gl;var Vl;function Pp(e,t){const r=new Uint8Array([0]),n=new Uint8Array(e),o=new Uint8Array(t);let s=n.slice(0);const a=s.length-1,l=o.slice(0),c=l.length-1;let d=0;const y=c<a?a:c;let p=0;for(let E=y;E>=0;E--,p++){switch(!0){case p<l.length:d=s[a-p]+l[c-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=No(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=No(r,s)),s}function Tl(e){if(e>=Jr.length)for(let t=Jr.length;t<=e;t++){const r=new Uint8Array([0]);let n=Jr[t-1].slice(0);for(let o=n.length-1;o>=0;o--){const s=new Uint8Array([(n[o]<<1)+r[0]]);r[0]=s[0]/10,n[o]=s[0]%10}r[0]>0&&(n=No(r,n)),Jr.push(n)}return Jr[e]}function Up(e,t){let r=0;const n=new Uint8Array(e),o=new Uint8Array(t),s=n.slice(0),a=s.length-1,l=o.slice(0),c=l.length-1;let d,y=0;for(let p=c;p>=0;p--,y++)switch(d=s[a-y]-l[c-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-c+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class To extends pt(Me){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}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=fl.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Ip(t))}get valueDec(){return this._valueDec}fromDER(t,r,n,o=0){const s=this.fromBER(t,r,n);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):o!==0&&a.length<o&&(o-a.length>1&&(o=a.length+1),this.valueHexView=a.subarray(o-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(r,1),this.valueHexView=n}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,n){const o=super.fromBER(t,r,n);return o===-1||this.setValueHex(),o}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),n=0,o;const s=this.valueHexView;let a="",l=!1;for(let c=s.byteLength-1;c>=0;c--){o=s[c];for(let d=0;d<8;d++){if((o&1)===1)switch(n){case t:r=Up(Tl(n),r),a="-";break;default:r=Pp(r,Tl(n))}n++,o>>=1}}for(let c=0;c<r.length;c++)r[c]&&(l=!0),l&&(a+=pl.charAt(r[c]));return l===!1&&(a+=pl.charAt(0)),a}}Vl=To,To.NAME="IntegerValueBlock",Object.defineProperty(Vl.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var jl;class ht extends Ee{constructor(t={}){super(t,To),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ri(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Ri();const r=BigInt(t),n=new Pi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const l=new Uint8Array(s.length+(s[0]&128?1:0));l[0]|=128;const d=BigInt(`0x${L.ToHex(l)}`)+r,y=M.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,n.write(y)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new ht({valueHex:n.final()})}convertToDER(){const t=new ht({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ht({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}jl=ht,P.Integer=jl,ht.NAME="INTEGER";var Dl;class Hi extends ht{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Dl=Hi,P.Enumerated=Dl,Hi.NAME="ENUMERATED";class jo extends pt(Me){constructor({valueDec:t=-1,isFirstSid:r=!1,...n}={}){super(n),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,n){if(!n)return r;const o=M.toUint8Array(t);if(!Ct(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=pr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Ri();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const n=new Uint8Array(r.length/7);for(let o=0;o<n.length;o++)n[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=zt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const n=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)n[a]=o[a]|128;n[s]=o[s]}return n}toString(){let t="";if(this.isHexOnly)t=L.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}jo.NAME="sidBlock";class $l extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new jo;if(o=s.fromBER(t,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let n=0;n<this.value.length;n++){const o=this.value[n].toBER(t);if(o.byteLength===0)return this.error=this.value[n].error,nt;r.push(o)}return Eo(r)}fromString(t){this.value=[];let r=0,n=0,o="",s=!1;do if(n=t.indexOf(".",r),n===-1?o=t.substring(r):o=t.substring(r,n),r=n+1,s){const a=this.value[0];let l=0;switch(a.valueDec){case 0:break;case 1:l=40;break;case 2:l=80;break;default:this.value=[];return}const c=parseInt(o,10);if(isNaN(c))return;a.valueDec=c+l,s=!1}else{const a=new jo;if(o>Number.MAX_SAFE_INTEGER){Ri();const l=BigInt(o);a.valueBigInt=l}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(n!==-1)}toString(){let t="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[n].isFirstSid?t=`2.{${o} - 80}`:t+=o):t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}$l.NAME="ObjectIdentifierValueBlock";var Ml;class Fi extends Ee{constructor(t={}){super(t,$l),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ml=Fi,P.ObjectIdentifier=Ml,Fi.NAME="OBJECT IDENTIFIER";class Do extends pt(Gt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,n){if(n===0)return r;const o=M.toUint8Array(t);if(!Ct(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=pr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=zt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const n=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)n[a]=o[a]|128;n[s]=o[s]}return n.buffer}toString(){let t="";return this.isHexOnly?t=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Do.NAME="relativeSidBlock";class Rl extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new Do;if(o=s.fromBER(t,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const n=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(t);if(s.byteLength===0)return this.error=this.value[o].error,nt;n.push(s)}return Eo(n)}fromString(t){this.value=[];let r=0,n=0,o="";do{n=t.indexOf(".",r),n===-1?o=t.substring(r):o=t.substring(r,n),r=n+1;const s=new Do;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let t="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(t=`${t}.`),r&&(o=`{${o}}`),t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Rl.NAME="RelativeObjectIdentifierValueBlock";var Pl;class $o extends Ee{constructor(t={}){super(t,Rl),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Pl=$o,P.RelativeObjectIdentifier=Pl,$o.NAME="RelativeObjectIdentifier";var Ul;class St extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ul=St,P.Sequence=Ul,St.NAME="SEQUENCE";var Ll;let xt=class extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Ll=xt,P.Set=Ll,xt.NAME="SET";class Hl extends pt(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}Hl.NAME="StringValueBlock";class Fl extends Hl{}Fl.NAME="SimpleStringValueBlock";class Je extends _o{constructor({...t}={}){super(t,Fl)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,M.toUint8Array(t))}fromString(t){const r=t.length,n=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);this.valueBlock.value=t}}Je.NAME="SIMPLE STRING";class ql extends Je{fromBuffer(t){this.valueBlock.valueHexView=M.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}ql.NAME="Utf8StringValueBlock";var Kl;class At extends ql{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Kl=At,P.Utf8String=Kl,At.NAME="UTF8String";class zl extends Je{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=M.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}zl.NAME="BmpStringValueBlock";var Gl;class qi extends zl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Gl=qi,P.BmpString=Gl,qi.NAME="BMPString";class Wl extends Je{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),n=new Uint8Array(r);for(let o=0;o<n.length;o+=4)n[o]=n[o+3],n[o+1]=n[o+2],n[o+2]=0,n[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,n=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=zt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const l=4-a.length;for(let c=a.length-1;c>=0;c--)n[o*4+c+l]=a[c]}this.valueBlock.value=t}}Wl.NAME="UniversalStringValueBlock";var Jl;class Ki extends Wl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Jl=Ki,P.UniversalString=Jl,Ki.NAME="UniversalString";var Yl;class zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Yl=zi,P.NumericString=Yl,zi.NAME="NumericString";var Zl;class Gi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Zl=Gi,P.PrintableString=Zl,Gi.NAME="PrintableString";var Ql;class Wi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Ql=Wi,P.TeletexString=Ql,Wi.NAME="TeletexString";var Xl;class Ji extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Xl=Ji,P.VideotexString=Xl,Ji.NAME="VideotexString";var ec;class Yi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}ec=Yi,P.IA5String=ec,Yi.NAME="IA5String";var tc;class Zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}tc=Zi,P.GraphicString=tc,Zi.NAME="GraphicString";var rc;class Qr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}rc=Qr,P.VisibleString=rc,Qr.NAME="VisibleString";var ic;class Qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}ic=Qi,P.GeneralString=ic,Qi.NAME="GeneralString";var nc;class Xi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}nc=Xi,P.CharacterString=nc,Xi.NAME="CharacterString";var oc;class Xr extends Qr{constructor({value:t,valueDate:r,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let o=0;o<t.length;o++)this.valueBlock.valueHexView[o]=t.charCodeAt(o)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,M.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),n=new Uint8Array(r);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(n===null){this.error="Wrong input string for conversion";return}const o=parseInt(n[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=We(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=We(this.month,2),r[2]=We(this.day,2),r[3]=We(this.hour,2),r[4]=We(this.minute,2),r[5]=We(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}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}}}oc=Xr,P.UTCTime=oc,Xr.NAME="UTCTime";var sc;class en extends Xr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,n="",o="",s=0,a,l=0,c=0;if(t[t.length-1]==="Z")n=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");n=t}if(r){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,E=n.indexOf("+"),w="";if(E===-1&&(E=n.indexOf("-"),p=-1),E!==-1){if(w=n.substring(E+1),n=n.substring(0,E),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(w.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(l=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");c=p*h}}}let d=n.indexOf(".");if(d===-1&&(d=n.indexOf(",")),d!==-1){const p=new Number(`0${n.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),o=n.substring(0,d)}else o=n;switch(!0){case o.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(o);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+l;break;case 5:this.minute=parseInt(y[p],10)+c;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(We(this.year,4)),r.push(We(this.month,2)),r.push(We(this.day,2)),r.push(We(this.hour,2)),r.push(We(this.minute,2)),r.push(We(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(We(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}sc=en,P.GeneralizedTime=sc,en.NAME="GeneralizedTime";var ac;class Mo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}ac=Mo,P.DATE=ac,Mo.NAME="DATE";var lc;class Ro extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}lc=Ro,P.TimeOfDay=lc,Ro.NAME="TimeOfDay";var cc;class Po extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}cc=Po,P.DateTime=cc,Po.NAME="DateTime";var uc;class Uo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}uc=Uo,P.Duration=uc,Uo.NAME="Duration";var dc;class Lo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}dc=Lo,P.TIME=dc,Lo.NAME="TIME";class Zt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Ho extends Zt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class tn extends Zt{constructor({value:t=new Zt,local:r=!1,...n}={}){super(n),this.value=t,this.local=r}}class Lp{constructor({data:t=Ui}={}){this.dataView=M.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=M.toUint8Array(t)}fromBER(t,r,n){const o=r+n;return this.dataView=M.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Qt(e,t,r){if(r instanceof Ho){for(let s=0;s<r.value.length;s++)if(Qt(e,t,r.value[s]).verified)return{verified:!0,result:e};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(Oo)&&(s.name=r.name),s}}if(r instanceof Zt)return r.hasOwnProperty(Oo)&&(e[r.name]=t),{verified:!0,result:e};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Op in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(jp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Dp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const n=r.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(_p)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(Vp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(Tp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Ep in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly)return{verified:!1,result:e};if(r.idBlock.isHexOnly){if(!(hl in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let l=0;l<s.length;l++)if(s[l]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},l=r.valueBlock.value.length;if(l>0&&r.valueBlock.value[0]instanceof tn&&(l=t.valueBlock.value.length),l===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let c=0;c<l;c++)if(c-s>=t.valueBlock.value.length){if(r.valueBlock.value[c].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof tn){if(a=Qt(e,t.valueBlock.value[c],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(Oo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};$p in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[c])}}else if(a=Qt(e,t.valueBlock.value[c-s],r.valueBlock.value[c]),a.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(a.verified===!1){const c={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],c.name=r.name)),c}return{verified:!0,result:e}}if(r.primitiveSchema&&hl in t.valueBlock){const s=hr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],a.name=r.name)),a}return Qt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Hp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=hr(M.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Qt(r.result,r.result,t)}const fc=Object.freeze(Object.defineProperty({__proto__:null,Any:Zt,BaseBlock:Ee,BaseStringBlock:_o,BitString:Yt,BmpString:qi,Boolean:Li,CharacterString:Xi,Choice:Ho,Constructed:He,DATE:Mo,DateTime:Po,Duration:Uo,EndOfContent:Vo,Enumerated:Hi,GeneralString:Qi,GeneralizedTime:en,GraphicString:Zi,HexBlock:pt,IA5String:Yi,Integer:ht,Null:Wt,NumericString:zi,ObjectIdentifier:Fi,OctetString:Jt,Primitive:Zr,PrintableString:Gi,RawData:Lp,RelativeObjectIdentifier:$o,Repeated:tn,Sequence:St,Set:xt,TIME:Lo,TeletexString:Wi,TimeOfDay:Ro,UTCTime:Xr,UniversalString:Ki,Utf8String:At,ValueBlock:Me,VideotexString:Ji,ViewWriter:Pi,VisibleString:Qr,compareSchema:Qt,fromBER:yr,verifySchema:Hp},Symbol.toStringTag,{value:"Module"}));var V;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(V||(V={}));var m;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(m||(m={}));class rn{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(M.isBufferSource(t))this.unusedBits=r,this.value=M.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Yt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new Yt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Yt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const n of r)t+=n.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const n=r.length+7>>3;this.unusedBits=(n<<3)-r.length;const o=new Uint8Array(n);r=r.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class le{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):M.isBufferSource(t)?this.buffer=M.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Jt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Jt({valueHex:this.buffer})}toSchema(t){return new Jt({name:t})}}const Fp={fromASN:e=>e instanceof Wt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Wt;const t=yr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},qp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ht({value:+e})},Kp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Hi({value:e})},ye={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ht({valueHex:e})},zp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},Gp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Fi({value:e})},Wp={fromASN:e=>e.valueBlock.value,toASN:e=>new Li({value:e})},nn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Jt({valueHex:e})},Jp={fromASN:e=>new le(e.getValue()),toASN:e=>e.toASN()};function Xe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const pc=Xe(At),Yp=Xe(qi),Zp=Xe(Ki),Qp=Xe(zi),Xp=Xe(Gi),eh=Xe(Wi),th=Xe(Ji),rh=Xe(Yi),ih=Xe(Zi),nh=Xe(Qr),oh=Xe(Qi),sh=Xe(Xi),ah={fromASN:e=>e.toDate(),toASN:e=>new Xr({valueDate:e})},lh={fromASN:e=>e.toDate(),toASN:e=>new en({valueDate:e})},ch={fromASN:()=>null,toASN:()=>new Wt};function Fo(e){switch(e){case m.Any:return Fp;case m.BitString:return zp;case m.BmpString:return Yp;case m.Boolean:return Wp;case m.CharacterString:return sh;case m.Enumerated:return Kp;case m.GeneralString:return oh;case m.GeneralizedTime:return lh;case m.GraphicString:return ih;case m.IA5String:return rh;case m.Integer:return qp;case m.Null:return ch;case m.NumericString:return Qp;case m.ObjectIdentifier:return Gp;case m.OctetString:return nn;case m.PrintableString:return Xp;case m.TeletexString:return eh;case m.UTCTime:return ah;case m.UniversalString:return Zp;case m.Utf8String:return pc;case m.VideotexString:return th;case m.VisibleString:return nh;default:return null}}function Bt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:Bt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function hc(e){var t;if(e){const r=Object.getPrototypeOf(e);return((t=r==null?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array?!0:hc(r)}return!1}function uh(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==n[o])return!1;return!0}class dh{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const n=this.items.get(t);if(!n)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!n.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:V.Sequence,items:{}},n=this.findParentSchema(t);return n&&(Object.assign(r,n),r.items=Object.assign({},r.items,n.items)),r}create(t,r){const n=this.items.get(t)||this.createDefault(t),o=[];for(const s in n.items){const a=n.items[s],l=r?s:"";let c;if(typeof a.type=="number"){const y=m[a.type],p=fc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);c=new p({name:l})}else Bt(a.type)?c=new a.type().toSchema(l):a.optional?this.get(a.type).type===V.Choice?c=new Zt({name:l}):(c=this.create(a.type,!1),c.name=l):c=new Zt({name:l});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){c.name="";const y=a.repeated==="set"?xt:St;c=new y({name:"",value:[new tn({name:l,value:c})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||Bt(a.type)){const y=a.repeated?He:Zr;o.push(new y({name:l,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?c:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new He({name:y?"":l,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new He({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else c.optional=d,o.push(c)}switch(n.type){case V.Sequence:return new St({value:o,name:""});case V.Set:return new xt({value:o,name:""});case V.Choice:return new Ho({value:o,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const et=new dh,j=e=>t=>{let r;et.has(t)?r=et.get(t):(r=et.createDefault(t),et.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let n;et.has(t.constructor)?n=et.get(t.constructor):(n=et.createDefault(t.constructor),et.set(t.constructor,n));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Fo(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}n.items[r]=o};class yc extends Error{constructor(){super(...arguments),this.schemas=[]}}class fh{static parse(t,r){const n=yr(t);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r)}static fromASN(t,r){var n;try{if(Bt(r))return new r().fromASN(t);const o=et.get(r);et.cache(r);let s=o.schema;if(t.constructor===He&&o.type!==V.Choice){s=new He({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const c in o.items)delete t[c]}const a=Qt({},t,s);if(!a.verified)throw new yc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const l=new r;if(hc(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const c=o.itemType;if(typeof c=="number"){const d=Fo(c);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,c))}for(const c in o.items){const d=a.result[c];if(!d)continue;const y=o.items[c],p=y.type;if(typeof p=="number"||Bt(p)){const E=(n=y.converter)!==null&&n!==void 0?n:Bt(p)?new p:null;if(!E)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?St:xt,h=new w;h.valueBlock=d.valueBlock;const g=yr(h.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const b=g.result.valueBlock.value;l[c]=Array.from(b,v=>E.fromASN(v))}else l[c]=Array.from(d,w=>E.fromASN(w));else{let w=d;if(y.implicit){let h;if(Bt(p))h=new p().toSchema("");else{const g=m[p],b=fc[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=yr(h.toBER(!1)).result}l[c]=E.fromASN(w)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");l[c]=Array.from(d,E=>this.fromASN(E,p))}else l[c]=this.fromASN(d,p)}return l}catch(o){throw o instanceof yc&&o.schemas.push(r.name),o}}}class qo{static serialize(t){return t instanceof Ee?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&Bt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,n=et.get(r);et.cache(r);let o=[];if(n.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){const a=Fo(n.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(l=>a.toASN(l))}else o=t.map(a=>this.toAsnItem({type:n.itemType},"[]",r,a))}else for(const a in n.items){const l=n.items[a],c=t[a];if(c===void 0||l.defaultValue===c||typeof l.defaultValue=="object"&&typeof c=="object"&&uh(this.serialize(l.defaultValue),this.serialize(c)))continue;const d=qo.toAsnItem(l,a,r,c);if(typeof l.context=="number")if(l.implicit)if(!l.repeated&&(typeof l.type=="number"||Bt(l.type))){const y={};y.valueHex=d instanceof Wt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Zr({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},...y}))}else o.push(new He({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:d.valueBlock.value}));else o.push(new He({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:[d]}));else l.repeated?o=o.concat(d):o.push(d)}let s;switch(n.type){case V.Sequence:s=new St({value:o});break;case V.Set:s=new xt({value:o});break;case V.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(t,r,n,o){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${m[t.type]} in schema '${n.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,d=>a.toASN(d)),c=t.repeated==="sequence"?St:xt;s=new c({value:l})}else s=a.toASN(o)}else if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(o,c=>this.toASN(c)),l=t.repeated==="sequence"?St:xt;s=new l({value:a})}else s=this.toASN(o);return s}}class ue extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class z{static serialize(t){return qo.serialize(t)}static parse(t,r){return fh.parse(t,r)}static toString(t){const r=M.isBufferSource(t)?M.toArrayBuffer(t):z.serialize(t),n=yr(r);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}}function u(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,r,s):a(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var gc={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",l="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,B=(h.match(c.zoneIndex)||[])[0],C,S;for(B&&(B=B.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(S=g-b,C=":";S--;)C+="0:";return h=h.replace("::",C),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const T=h.split(":"),N=[];for(let I=0;I<T.length;I++)N.push(parseInt(T[I],16));return N}(),{parts:g,zoneId:B}}function y(h,g,b,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let B=0,C;for(;v>0;){if(C=b-v,C<0&&(C=0),h[B]>>C!==g[B]>>C)return!1;v-=b,B+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function E(h,g){for(;h.length<g;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,v;for(b=0;b<g.length;b++)if(v=g[b],!(0<=v&&v<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(g,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let B,C,S;for(B=3;B>=0;B-=1)if(C=this.octets[B],C in v){if(S=v[C],b&&S!==0)return null;S!==8&&(b=!0),g+=S}else return null;return 32-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return w.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),w.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let C=0;for(;C<4;)B.push(parseInt(b[C],10)|parseInt(v[C],10)^255),C++;return new this(B)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.isIPv4=function(h){return this.parser(h)!==null},w.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},w.IPv4.isValidFourPartDecimal=function(h){return!!(w.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},w.IPv4.networkAddressFromCIDR=function(h){let g,b,v,B,C;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<4;)B.push(parseInt(v[b],10)&parseInt(C[b],10)),b++;return new this(B)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.parse=function(h){const g=this.parser(h);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},w.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(g[2]);if(b>=0&&b<=32){const v=[this.parse(g[1]),b];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,v;if(g=h.match(n.fourOctet))return function(){const B=g.slice(1,6),C=[];for(let S=0;S<B.length;S++)b=B[S],C.push(p(b));return C}();if(g=h.match(n.longValue)){if(v=p(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const B=[];let C;for(C=0;C<=24;C+=8)B.push(v>>C&255);return B}().reverse()}else return(g=h.match(n.twoOctet))?function(){const B=g.slice(1,4),C=[];if(v=p(B[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return C.push(p(B[0])),C.push(v>>16&255),C.push(v>>8&255),C.push(v&255),C}():(g=h.match(n.threeOctet))?function(){const B=g.slice(1,5),C=[];if(v=p(B[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return C.push(p(B[0])),C.push(p(B[1])),C.push(v>>8&255),C.push(v&255),C}():null},w.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let v,B;if(g.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(g[v]<<8|g[v+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(B=this.parts[v],!(0<=B&&B<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(g,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let B,C;for(let S=7;S>=0;S-=1)if(B=this.parts[S],B in v){if(C=v[B],b&&C!==0)return null;C!==16&&(b=!0),g+=C}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let B=0;B<v.length;B++)g=v[B],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let B=0;B<this.parts.length;B++)v.push(E(this.parts[B].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),b=g[0],v=g[1];return new w.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let B=0;B<this.parts.length;B++)v.push(this.parts[B].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,B=-1,C;for(;C=g.exec(b);)C[0].length>B&&(v=C.index,B=C[0].length);return B<0?b:`${b.substring(0,v)}::${b.substring(v+B)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let C=0;for(;C<16;)B.push(parseInt(b[C],10)|parseInt(v[C],10)^255),C++;return new this(B)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},w.IPv6.isIPv6=function(h){return this.parser(h)!==null},w.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const g=this.parser(h);return new this(g.parts,g.zoneId),!0}catch{return!1}},w.IPv6.networkAddressFromCIDR=function(h){let g,b,v,B,C;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<16;)B.push(parseInt(v[b],10)&parseInt(C[b],10)),b++;return new this(B)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},w.IPv6.parse=function(h){const g=this.parser(h);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},w.IPv6.parseCIDR=function(h){let g,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return v=[this.parse(b[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,v,B,C,S;if(v=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(c.native.test(h))return d(h,8);if((v=h.match(c.transitional))&&(S=v[6]||"",g=d(v[1].slice(0,-1)+S,6),g.parts)){for(C=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<C.length;b++)if(B=C[b],!(0<=B&&B<=255))return null;return g.parts.push(C[0]<<8|C[1]),g.parts.push(C[2]<<8|C[3]),{parts:g.parts,zoneId:g.zoneId}}return null},w.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<16&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.fromByteArray=function(h){const g=h.length;if(g===4)return new w.IPv4(h);if(g===16)return new w.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},w.isValid=function(h){return w.IPv6.isValid(h)||w.IPv4.isValid(h)},w.parse=function(h){if(w.IPv6.isValid(h))return w.IPv6.parse(h);if(w.IPv4.isValid(h))return w.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},w.parseCIDR=function(h){try{return w.IPv6.parseCIDR(h)}catch{try{return w.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},w.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},w.subnetMatch=function(h,g,b){let v,B,C,S;b==null&&(b="unicast");for(B in g)if(Object.prototype.hasOwnProperty.call(g,B)){for(C=g[B],C[0]&&!(C[0]instanceof Array)&&(C=[C]),v=0;v<C.length;v++)if(S=C[v],h.kind()===S[0].kind()&&h.match.apply(h,S))return B}return b},e.exports?e.exports=w:t.ipaddr=w})(Bo)})(gc);var mc=gc.exports;class bc{static decodeIP(t){if(t.length===64&&parseInt(t,16)===0)return"::/0";if(t.length!==16)return t;const r=parseInt(t.slice(8),16).toString(2).split("").reduce((o,s)=>o+ +s,0);let n=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return n=n.slice(0,-1),`${n}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return mc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=mc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Ko,zo,Go;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:m.TeletexString})],Oe.prototype,"teletexString",void 0),u([f({type:m.PrintableString})],Oe.prototype,"printableString",void 0),u([f({type:m.UniversalString})],Oe.prototype,"universalString",void 0),u([f({type:m.Utf8String})],Oe.prototype,"utf8String",void 0),u([f({type:m.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([j({type:V.Choice})],Oe);let gr=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:m.IA5String})],gr.prototype,"ia5String",void 0),u([f({type:m.Any})],gr.prototype,"anyValue",void 0),gr=u([j({type:V.Choice})],gr);class ei{constructor(t={}){this.type="",this.value=new gr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"type",void 0),u([f({type:gr})],ei.prototype,"value",void 0);let mr=Ko=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};mr=Ko=u([j({type:V.Set,itemType:ei})],mr);let Wo=zo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,zo.prototype)}};Wo=zo=u([j({type:V.Sequence,itemType:mr})],Wo);let ke=Go=class extends Wo{constructor(t){super(t),Object.setPrototypeOf(this,Go.prototype)}};ke=Go=u([j({type:V.Sequence})],ke);const ph={fromASN:e=>bc.toString(nn.fromASN(e)),toASN:e=>nn.toASN(bc.fromString(e))};class ti{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ti.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ti.prototype,"value",void 0);class Jo{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Jo.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Jo.prototype,"partyName",void 0);let oe=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ti,context:0,implicit:!0})],oe.prototype,"otherName",void 0),u([f({type:m.IA5String,context:1,implicit:!0})],oe.prototype,"rfc822Name",void 0),u([f({type:m.IA5String,context:2,implicit:!0})],oe.prototype,"dNSName",void 0),u([f({type:m.Any,context:3,implicit:!0})],oe.prototype,"x400Address",void 0),u([f({type:ke,context:4,implicit:!1})],oe.prototype,"directoryName",void 0),u([f({type:Jo,context:5})],oe.prototype,"ediPartyName",void 0),u([f({type:m.IA5String,context:6,implicit:!0})],oe.prototype,"uniformResourceIdentifier",void 0),u([f({type:m.OctetString,context:7,implicit:!0,converter:ph})],oe.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],oe.prototype,"registeredID",void 0),oe=u([j({type:V.Choice})],oe);const br="1.3.6.1.5.5.7.3",Xt="2.5.29";var Yo;class on{constructor(t={}){this.accessMethod="",this.accessLocation=new oe,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],on.prototype,"accessMethod",void 0),u([f({type:oe})],on.prototype,"accessLocation",void 0);let wc=Yo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};wc=Yo=u([j({type:V.Sequence,itemType:on})],wc);const Zo=`${Xt}.35`;class Qo extends le{}class er{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Qo,context:0,optional:!0,implicit:!0})],er.prototype,"keyIdentifier",void 0),u([f({type:oe,context:1,optional:!0,implicit:!0,repeated:"sequence"})],er.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:ye})],er.prototype,"authorityCertSerialNumber",void 0);const vc=`${Xt}.19`;class sn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],sn.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],sn.prototype,"pathLenConstraint",void 0);var Xo;let Re=Xo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};Re=Xo=u([j({type:V.Sequence,itemType:oe})],Re);var es;let kc=es=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,es.prototype)}};kc=es=u([j({type:V.Sequence})],kc);var ts;const Cc=`${Xt}.32`;let It=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],It.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],It.prototype,"visibleString",void 0),u([f({type:m.BmpString})],It.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],It.prototype,"utf8String",void 0),It=u([j({type:V.Choice})],It);class rs{constructor(t={}){this.organization=new It,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:It})],rs.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],rs.prototype,"noticeNumbers",void 0);class is{constructor(t={}){Object.assign(this,t)}}u([f({type:rs,optional:!0})],is.prototype,"noticeRef",void 0),u([f({type:It,optional:!0})],is.prototype,"explicitText",void 0);let an=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],an.prototype,"cPSuri",void 0),u([f({type:is})],an.prototype,"userNotice",void 0),an=u([j({type:V.Choice})],an);class ns{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ns.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],ns.prototype,"qualifier",void 0);class ln{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ln.prototype,"policyIdentifier",void 0),u([f({type:ns,repeated:"sequence",optional:!0})],ln.prototype,"policyQualifiers",void 0);let cn=ts=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};cn=ts=u([j({type:V.Sequence,itemType:ln})],cn);let un=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],un.prototype,"value",void 0),un=u([j({type:V.Choice})],un);let Sc=class extends un{};Sc=u([j({type:V.Choice})],Sc);var os,ot;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(ot||(ot={}));class xc extends rn{toJSON(){const t=[],r=this.toNumber();return r&ot.aACompromise&&t.push("aACompromise"),r&ot.affiliationChanged&&t.push("affiliationChanged"),r&ot.cACompromise&&t.push("cACompromise"),r&ot.certificateHold&&t.push("certificateHold"),r&ot.cessationOfOperation&&t.push("cessationOfOperation"),r&ot.keyCompromise&&t.push("keyCompromise"),r&ot.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&ot.superseded&&t.push("superseded"),r&ot.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let wr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,context:0,repeated:"sequence",implicit:!0})],wr.prototype,"fullName",void 0),u([f({type:mr,context:1,implicit:!0})],wr.prototype,"nameRelativeToCRLIssuer",void 0),wr=u([j({type:V.Choice})],wr);class ri{constructor(t={}){Object.assign(this,t)}}u([f({type:wr,context:0,optional:!0})],ri.prototype,"distributionPoint",void 0),u([f({type:xc,context:1,optional:!0,implicit:!0})],ri.prototype,"reasons",void 0),u([f({type:oe,context:2,optional:!0,repeated:"sequence",implicit:!0})],ri.prototype,"cRLIssuer",void 0);let ss=os=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};ss=os=u([j({type:V.Sequence,itemType:ri})],ss);var as;let Ac=as=class extends ss{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};Ac=as=u([j({type:V.Sequence,itemType:ri})],Ac);class De{constructor(t={}){this.onlyContainsUserCerts=De.ONLY,this.onlyContainsCACerts=De.ONLY,this.indirectCRL=De.ONLY,this.onlyContainsAttributeCerts=De.ONLY,Object.assign(this,t)}}De.ONLY=!1,u([f({type:wr,context:0,optional:!0})],De.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsCACerts",void 0),u([f({type:xc,context:3,optional:!0,implicit:!0})],De.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:De.ONLY,implicit:!0})],De.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsAttributeCerts",void 0);var ii;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ii||(ii={}));let ls=class{constructor(t=ii.unspecified){this.reason=ii.unspecified,this.reason=t}toJSON(){return ii[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],ls.prototype,"reason",void 0),ls=u([j({type:V.Choice})],ls);var cs;const Bc=`${Xt}.37`;let dn=cs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};dn=cs=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],dn);const hh=`${br}.1`,yh=`${br}.2`,gh=`${br}.3`,mh=`${br}.4`,bh=`${br}.8`,wh=`${br}.9`;let us=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:ye})],us.prototype,"value",void 0),us=u([j({type:V.Choice})],us);let ds=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],ds.prototype,"value",void 0),ds=u([j({type:V.Choice})],ds);var fs;let Ic=fs=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};Ic=fs=u([j({type:V.Sequence})],Ic);const Nc=`${Xt}.15`;var st;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(st||(st={}));class ps extends rn{toJSON(){const t=this.toNumber(),r=[];return t&st.cRLSign&&r.push("crlSign"),t&st.dataEncipherment&&r.push("dataEncipherment"),t&st.decipherOnly&&r.push("decipherOnly"),t&st.digitalSignature&&r.push("digitalSignature"),t&st.encipherOnly&&r.push("encipherOnly"),t&st.keyAgreement&&r.push("keyAgreement"),t&st.keyCertSign&&r.push("keyCertSign"),t&st.keyEncipherment&&r.push("keyEncipherment"),t&st.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var hs;class fn{constructor(t={}){this.base=new oe,this.minimum=0,Object.assign(this,t)}}u([f({type:oe})],fn.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],fn.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],fn.prototype,"maximum",void 0);let pn=hs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};pn=hs=u([j({type:V.Sequence,itemType:fn})],pn);class Ec{constructor(t={}){Object.assign(this,t)}}u([f({type:pn,context:0,optional:!0,implicit:!0})],Ec.prototype,"permittedSubtrees",void 0),u([f({type:pn,context:1,optional:!0,implicit:!0})],Ec.prototype,"excludedSubtrees",void 0);class Oc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:ye})],Oc.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:ye})],Oc.prototype,"inhibitPolicyMapping",void 0);var ys;class gs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],gs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],gs.prototype,"subjectDomainPolicy",void 0);let _c=ys=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};_c=ys=u([j({type:V.Sequence,itemType:gs})],_c);var ms;const Vc=`${Xt}.17`;let bs=ms=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};bs=ms=u([j({type:V.Sequence})],bs);let Nt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Nt.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],Nt.prototype,"values",void 0);var ws;let Tc=ws=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};Tc=ws=u([j({type:V.Sequence,itemType:Nt})],Tc);const jc=`${Xt}.14`;class Mt extends Qo{}class Dc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],Dc.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],Dc.prototype,"notAfter",void 0);var ni;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ni||(ni={}));class $c extends rn{toJSON(){const t=[],r=this.toNumber();return r&ni.pKIXCertificate&&t.push("pKIXCertificate"),r&ni.newExtensions&&t.push("newExtensions"),r&ni.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Mc{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new $c,Object.assign(this,t)}}u([f({type:m.GeneralString})],Mc.prototype,"entrustVers",void 0),u([f({type:$c})],Mc.prototype,"entrustInfoFlags",void 0);var vs;let Rc=vs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,vs.prototype)}};Rc=vs=u([j({type:V.Sequence,itemType:on})],Rc);class F{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof F&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&dl(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],F.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],F.prototype,"parameters",void 0);class Et{constructor(t={}){this.algorithm=new F,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Et.prototype,"algorithm",void 0),u([f({type:m.BitString})],Et.prototype,"subjectPublicKey",void 0);let _e=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:m.UTCTime})],_e.prototype,"utcTime",void 0),u([f({type:m.GeneralizedTime})],_e.prototype,"generalTime",void 0),_e=u([j({type:V.Choice})],_e);class hn{constructor(t){this.notBefore=new _e(new Date),this.notAfter=new _e(new Date),t&&(this.notBefore=new _e(t.notBefore),this.notAfter=new _e(t.notAfter))}}u([f({type:_e})],hn.prototype,"notBefore",void 0),u([f({type:_e})],hn.prototype,"notAfter",void 0);var ks;let at=class dp{constructor(t={}){this.extnID="",this.critical=dp.CRITICAL,this.extnValue=new le,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:le})],at.prototype,"extnValue",void 0);let tr=ks=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};tr=ks=u([j({type:V.Sequence,itemType:at})],tr);var vr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(vr||(vr={}));class tt{constructor(t={}){this.version=vr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new F,this.issuer=new ke,this.validity=new hn,this.subject=new ke,this.subjectPublicKeyInfo=new Et,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:vr.v1})],tt.prototype,"version",void 0),u([f({type:m.Integer,converter:ye})],tt.prototype,"serialNumber",void 0),u([f({type:F})],tt.prototype,"signature",void 0),u([f({type:ke})],tt.prototype,"issuer",void 0),u([f({type:hn})],tt.prototype,"validity",void 0),u([f({type:ke})],tt.prototype,"subject",void 0),u([f({type:Et})],tt.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],tt.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],tt.prototype,"subjectUniqueID",void 0),u([f({type:tr,context:3,optional:!0})],tt.prototype,"extensions",void 0);class kr{constructor(t={}){this.tbsCertificate=new tt,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:tt})],kr.prototype,"tbsCertificate",void 0),u([f({type:F})],kr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],kr.prototype,"signatureValue",void 0);class yn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],yn.prototype,"userCertificate",void 0),u([f({type:_e})],yn.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],yn.prototype,"crlEntryExtensions",void 0);class Ot{constructor(t={}){this.signature=new F,this.issuer=new ke,this.thisUpdate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],Ot.prototype,"version",void 0),u([f({type:F})],Ot.prototype,"signature",void 0),u([f({type:ke})],Ot.prototype,"issuer",void 0),u([f({type:_e})],Ot.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Ot.prototype,"nextUpdate",void 0),u([f({type:yn,repeated:"sequence",optional:!0})],Ot.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],Ot.prototype,"crlExtensions",void 0);let Cs=class{constructor(t={}){this.tbsCertList=new Ot,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Ot})],Cs.prototype,"tbsCertList",void 0),u([f({type:F})],Cs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],Cs.prototype,"signature",void 0);class Cr{constructor(t={}){this.issuer=new ke,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ke})],Cr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:ye})],Cr.prototype,"serialNumber",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Sr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],Sr.prototype,"issuerAndSerialNumber",void 0),Sr=u([j({type:V.Choice})],Sr);var _t;(function(e){e[e.v0=0]="v0",e[e.v1=1]="v1",e[e.v2=2]="v2",e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v5=5]="v5"})(_t||(_t={}));let oi=class extends F{};oi=u([j({type:V.Sequence})],oi);let gn=class extends F{};gn=u([j({type:V.Sequence})],gn);let yt=class extends F{};yt=u([j({type:V.Sequence})],yt);let mn=class extends F{};mn=u([j({type:V.Sequence})],mn);let Pc=class extends F{};Pc=u([j({type:V.Sequence})],Pc);let Ss=class extends F{};Ss=u([j({type:V.Sequence})],Ss);let xr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],xr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],xr.prototype,"attrValues",void 0);var xs;class gt{constructor(t={}){this.version=_t.v0,this.sid=new Sr,this.digestAlgorithm=new oi,this.signatureAlgorithm=new gn,this.signature=new le,Object.assign(this,t)}}u([f({type:m.Integer})],gt.prototype,"version",void 0),u([f({type:Sr})],gt.prototype,"sid",void 0),u([f({type:oi})],gt.prototype,"digestAlgorithm",void 0),u([f({type:xr,repeated:"set",context:0,implicit:!0,optional:!0})],gt.prototype,"signedAttrs",void 0),u([f({type:gn})],gt.prototype,"signatureAlgorithm",void 0),u([f({type:le})],gt.prototype,"signature",void 0),u([f({type:xr,repeated:"set",context:1,implicit:!0,optional:!0})],gt.prototype,"unsignedAttrs",void 0);let bn=xs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};bn=xs=u([j({type:V.Set,itemType:gt})],bn);let Uc=class extends _e{};Uc=u([j({type:V.Choice})],Uc);let Lc=class extends gt{};Lc=u([j({type:V.Sequence})],Lc);class As{constructor(t={}){this.acIssuer=new oe,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:oe})],As.prototype,"acIssuer",void 0),u([f({type:m.Integer})],As.prototype,"acSerial",void 0),u([f({type:Nt,repeated:"sequence"})],As.prototype,"attrs",void 0);var Bs;let wn=Bs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Bs.prototype)}};wn=Bs=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],wn);class vn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],vn.prototype,"pathLenConstraint",void 0),u([f({type:wn,implicit:!0,context:0,optional:!0})],vn.prototype,"permittedAttrs",void 0),u([f({type:wn,implicit:!0,context:1,optional:!0})],vn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],vn.prototype,"permitUnSpecified",void 0);class rr{constructor(t={}){this.issuer=new Re,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Re})],rr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:ye})],rr.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],rr.prototype,"issuerUID",void 0);var Is;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(Is||(Is={}));class ir{constructor(t={}){this.digestedObjectType=Is.publicKey,this.digestAlgorithm=new F,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],ir.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],ir.prototype,"otherObjectTypeID",void 0),u([f({type:F})],ir.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],ir.prototype,"objectDigest",void 0);class kn{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,optional:!0})],kn.prototype,"issuerName",void 0),u([f({type:rr,context:0,implicit:!0,optional:!0})],kn.prototype,"baseCertificateID",void 0),u([f({type:ir,context:1,implicit:!0,optional:!0})],kn.prototype,"objectDigestInfo",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,repeated:"sequence"})],Ar.prototype,"v1Form",void 0),u([f({type:kn,context:0,implicit:!0})],Ar.prototype,"v2Form",void 0),Ar=u([j({type:V.Choice})],Ar);class Cn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],Cn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],Cn.prototype,"notAfterTime",void 0);class si{constructor(t={}){Object.assign(this,t)}}u([f({type:rr,implicit:!0,context:0,optional:!0})],si.prototype,"baseCertificateID",void 0),u([f({type:Re,implicit:!0,context:1,optional:!0})],si.prototype,"entityName",void 0),u([f({type:ir,implicit:!0,context:2,optional:!0})],si.prototype,"objectDigestInfo",void 0);var Ns;(function(e){e[e.v2=1]="v2"})(Ns||(Ns={}));class lt{constructor(t={}){this.version=Ns.v2,this.holder=new si,this.issuer=new Ar,this.signature=new F,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Cn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],lt.prototype,"version",void 0),u([f({type:si})],lt.prototype,"holder",void 0),u([f({type:Ar})],lt.prototype,"issuer",void 0),u([f({type:F})],lt.prototype,"signature",void 0),u([f({type:m.Integer,converter:ye})],lt.prototype,"serialNumber",void 0),u([f({type:Cn})],lt.prototype,"attrCertValidityPeriod",void 0),u([f({type:Nt,repeated:"sequence"})],lt.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],lt.prototype,"issuerUniqueID",void 0),u([f({type:tr,optional:!0})],lt.prototype,"extensions",void 0);class Sn{constructor(t={}){this.acinfo=new lt,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:lt})],Sn.prototype,"acinfo",void 0),u([f({type:F})],Sn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],Sn.prototype,"signatureValue",void 0);var xn;(function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"})(xn||(xn={}));class Es extends rn{}class Os{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Os.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Os.prototype,"value",void 0);class _s{constructor(t={}){this.policyId="",this.classList=new Es(xn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],_s.prototype,"policyId",void 0),u([f({type:Es,defaultValue:new Es(xn.unclassified)})],_s.prototype,"classList",void 0),u([f({type:Os,repeated:"set"})],_s.prototype,"securityCategories",void 0);class An{constructor(t={}){Object.assign(this,t)}}u([f({type:le})],An.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],An.prototype,"oid",void 0),u([f({type:m.Utf8String})],An.prototype,"string",void 0);class Hc{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],Hc.prototype,"policyAuthority",void 0),u([f({type:An,repeated:"sequence"})],Hc.prototype,"values",void 0);var Vs;class Bn{constructor(t={}){this.targetCertificate=new rr,Object.assign(this,t)}}u([f({type:rr})],Bn.prototype,"targetCertificate",void 0),u([f({type:oe,optional:!0})],Bn.prototype,"targetName",void 0),u([f({type:ir,optional:!0})],Bn.prototype,"certDigestInfo",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,context:0,implicit:!0})],Br.prototype,"targetName",void 0),u([f({type:oe,context:1,implicit:!0})],Br.prototype,"targetGroup",void 0),u([f({type:Bn,context:2,implicit:!0})],Br.prototype,"targetCert",void 0),Br=u([j({type:V.Choice})],Br);let Ts=Vs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Vs.prototype)}};Ts=Vs=u([j({type:V.Sequence,itemType:Br})],Ts);var js;let Fc=js=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};Fc=js=u([j({type:V.Sequence,itemType:Ts})],Fc);class qc{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],qc.prototype,"roleAuthority",void 0),u([f({type:oe,implicit:!0,context:1})],qc.prototype,"roleName",void 0);class Ds{constructor(t={}){this.service=new oe,this.ident=new oe,Object.assign(this,t)}}u([f({type:oe})],Ds.prototype,"service",void 0),u([f({type:oe})],Ds.prototype,"ident",void 0),u([f({type:le,optional:!0})],Ds.prototype,"authInfo",void 0);var $s;class Ms{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ms.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Ms.prototype,"otherCert",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:kr})],Ir.prototype,"certificate",void 0),u([f({type:Sn,context:2,implicit:!0})],Ir.prototype,"v2AttrCert",void 0),u([f({type:Ms,context:3,implicit:!0})],Ir.prototype,"other",void 0),Ir=u([j({type:V.Choice})],Ir);let In=$s=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};In=$s=u([j({type:V.Set,itemType:Ir})],In);class Nr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Nr.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Nr.prototype,"content",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:le})],ai.prototype,"single",void 0),u([f({type:m.Any})],ai.prototype,"any",void 0),ai=u([j({type:V.Choice})],ai);class Nn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Nn.prototype,"eContentType",void 0),u([f({type:ai,context:0,optional:!0})],Nn.prototype,"eContent",void 0);let li=class{constructor(t={}){Object.assign(this,t)}};u([f({type:le,context:0,implicit:!0,optional:!0})],li.prototype,"value",void 0),u([f({type:le,converter:Jp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],li.prototype,"constructedValue",void 0),li=u([j({type:V.Choice})],li);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new mn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:mn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:li,optional:!0})],ci.prototype,"encryptedContent",void 0);class En{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],En.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],En.prototype,"keyAttr",void 0);var Rs;class On{constructor(t={}){this.subjectKeyIdentifier=new Mt,Object.assign(this,t)}}u([f({type:Mt})],On.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],On.prototype,"date",void 0),u([f({type:En,optional:!0})],On.prototype,"other",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:On,context:0,implicit:!0,optional:!0})],Er.prototype,"rKeyId",void 0),u([f({type:Cr,optional:!0})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([j({type:V.Choice})],Er);class Ps{constructor(t={}){this.rid=new Er,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:Er})],Ps.prototype,"rid",void 0),u([f({type:le})],Ps.prototype,"encryptedKey",void 0);let _n=Rs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};_n=Rs=u([j({type:V.Sequence,itemType:Ps})],_n);class Us{constructor(t={}){this.algorithm=new F,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Us.prototype,"algorithm",void 0),u([f({type:m.BitString})],Us.prototype,"publicKey",void 0);let nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0,optional:!0})],nr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Us,context:1,implicit:!0,optional:!0})],nr.prototype,"originatorKey",void 0),u([f({type:Cr,optional:!0})],nr.prototype,"issuerAndSerialNumber",void 0),nr=u([j({type:V.Choice})],nr);class Or{constructor(t={}){this.version=_t.v3,this.originator=new nr,this.keyEncryptionAlgorithm=new yt,this.recipientEncryptedKeys=new _n,Object.assign(this,t)}}u([f({type:m.Integer})],Or.prototype,"version",void 0),u([f({type:nr,context:0})],Or.prototype,"originator",void 0),u([f({type:le,context:1,optional:!0})],Or.prototype,"ukm",void 0),u([f({type:yt})],Or.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:_n})],Or.prototype,"recipientEncryptedKeys",void 0);let _r=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],_r.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],_r.prototype,"issuerAndSerialNumber",void 0),_r=u([j({type:V.Choice})],_r);class ui{constructor(t={}){this.version=_t.v0,this.rid=new _r,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],ui.prototype,"version",void 0),u([f({type:_r})],ui.prototype,"rid",void 0),u([f({type:yt})],ui.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],ui.prototype,"encryptedKey",void 0);class di{constructor(t={}){this.keyIdentifier=new le,Object.assign(this,t)}}u([f({type:le})],di.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],di.prototype,"date",void 0),u([f({type:En,optional:!0})],di.prototype,"other",void 0);class fi{constructor(t={}){this.version=_t.v4,this.kekid=new di,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:di})],fi.prototype,"kekid",void 0),u([f({type:yt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.version=_t.v0,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],pi.prototype,"version",void 0),u([f({type:Ss,context:0,optional:!0})],pi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:yt})],pi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],pi.prototype,"encryptedKey",void 0);class Ls{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ls.prototype,"oriType",void 0),u([f({type:m.Any})],Ls.prototype,"oriValue",void 0);let Rt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ui,optional:!0})],Rt.prototype,"ktri",void 0),u([f({type:Or,context:1,implicit:!0,optional:!0})],Rt.prototype,"kari",void 0),u([f({type:fi,context:2,implicit:!0,optional:!0})],Rt.prototype,"kekri",void 0),u([f({type:pi,context:3,implicit:!0,optional:!0})],Rt.prototype,"pwri",void 0),u([f({type:Ls,context:4,implicit:!0,optional:!0})],Rt.prototype,"ori",void 0),Rt=u([j({type:V.Choice})],Rt);var Hs;let Vn=Hs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Hs.prototype)}};Vn=Hs=u([j({type:V.Set,itemType:Rt})],Vn);var Fs;class Tn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Tn.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],Tn.prototype,"otherRevInfo",void 0);let hi=class{constructor(t={}){this.other=new Tn,Object.assign(this,t)}};u([f({type:Tn,context:1,implicit:!0})],hi.prototype,"other",void 0),hi=u([j({type:V.Choice})],hi);let qs=Fs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Fs.prototype)}};qs=Fs=u([j({type:V.Set,itemType:hi})],qs);class Ks{constructor(t={}){Object.assign(this,t)}}u([f({type:In,context:0,implicit:!0,optional:!0})],Ks.prototype,"certs",void 0),u([f({type:qs,context:1,implicit:!0,optional:!0})],Ks.prototype,"crls",void 0);var zs;let Gs=zs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Gs=zs=u([j({type:V.Set,itemType:xr})],Gs);class yi{constructor(t={}){this.version=_t.v0,this.recipientInfos=new Vn,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:m.Integer})],yi.prototype,"version",void 0),u([f({type:Ks,context:0,implicit:!0,optional:!0})],yi.prototype,"originatorInfo",void 0),u([f({type:Vn})],yi.prototype,"recipientInfos",void 0),u([f({type:ci})],yi.prototype,"encryptedContentInfo",void 0),u([f({type:Gs,context:1,implicit:!0,optional:!0})],yi.prototype,"unprotectedAttrs",void 0);const vh="1.2.840.113549.1.7.2";var Ws;let jn=Ws=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};jn=Ws=u([j({type:V.Set,itemType:oi})],jn);class Vr{constructor(t={}){this.version=_t.v0,this.digestAlgorithms=new jn,this.encapContentInfo=new Nn,this.signerInfos=new bn,Object.assign(this,t)}}u([f({type:m.Integer})],Vr.prototype,"version",void 0),u([f({type:jn})],Vr.prototype,"digestAlgorithms",void 0),u([f({type:Nn})],Vr.prototype,"encapContentInfo",void 0),u([f({type:In,context:0,implicit:!0,optional:!0})],Vr.prototype,"certificates",void 0),u([f({type:hi,context:1,implicit:!0,optional:!0})],Vr.prototype,"crls",void 0),u([f({type:bn})],Vr.prototype,"signerInfos",void 0);const gi="1.2.840.10045.2.1",Js="1.2.840.10045.4.1",Kc="1.2.840.10045.4.3.1",Ys="1.2.840.10045.4.3.2",Zs="1.2.840.10045.4.3.3",Qs="1.2.840.10045.4.3.4",zc="1.2.840.10045.3.1.7",Gc="1.3.132.0.34",Wc="1.3.132.0.35";function mi(e){return new F({algorithm:e})}const kh=mi(Js);mi(Kc);const Ch=mi(Ys),Sh=mi(Zs),xh=mi(Qs);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Tr.prototype,"namedCurve",void 0),Tr=u([j({type:V.Choice})],Tr);class Dn{constructor(t={}){this.version=1,this.privateKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],Dn.prototype,"version",void 0),u([f({type:le})],Dn.prototype,"privateKey",void 0),u([f({type:Tr,context:0,optional:!0})],Dn.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],Dn.prototype,"publicKey",void 0);class $n{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],$n.prototype,"r",void 0),u([f({type:m.Integer,converter:ye})],$n.prototype,"s",void 0);const Fe="1.2.840.113549.1.1",jr=`${Fe}.1`,Ah=`${Fe}.7`,Bh=`${Fe}.9`,Ih=`${Fe}.10`,Nh=`${Fe}.2`,Eh=`${Fe}.4`,Mn=`${Fe}.5`,Oh=`${Fe}.14`,Xs=`${Fe}.11`,Rn=`${Fe}.12`,Pn=`${Fe}.13`,Jc=`${Fe}.15`,Yc=`${Fe}.16`,Zc="1.3.14.3.2.26",Qc="2.16.840.1.101.3.4.2.4",Xc="2.16.840.1.101.3.4.2.1",eu="2.16.840.1.101.3.4.2.2",tu="2.16.840.1.101.3.4.2.3",_h="2.16.840.1.101.3.4.2.5",Vh="2.16.840.1.101.3.4.2.6",Th="1.2.840.113549.2.2",jh="1.2.840.113549.2.5",ea=`${Fe}.8`;function Ce(e){return new F({algorithm:e,parameters:null})}Ce(Th),Ce(jh);const or=Ce(Zc);Ce(Qc),Ce(Xc),Ce(eu),Ce(tu),Ce(_h),Ce(Vh);const ru=new F({algorithm:ea,parameters:z.serialize(or)}),iu=new F({algorithm:Bh,parameters:z.serialize(nn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ce(jr),Ce(Nh),Ce(Eh),Ce(Mn),Ce(Jc),Ce(Yc),Ce(Rn),Ce(Pn),Ce(Jc),Ce(Yc);class Un{constructor(t={}){this.hashAlgorithm=new F(or),this.maskGenAlgorithm=new F({algorithm:ea,parameters:z.serialize(or)}),this.pSourceAlgorithm=new F(iu),Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:or})],Un.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:ru})],Un.prototype,"maskGenAlgorithm",void 0),u([f({type:F,context:2,defaultValue:iu})],Un.prototype,"pSourceAlgorithm",void 0),new F({algorithm:Ah,parameters:z.serialize(new Un)});class bi{constructor(t={}){this.hashAlgorithm=new F(or),this.maskGenAlgorithm=new F({algorithm:ea,parameters:z.serialize(or)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:or})],bi.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:ru})],bi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],bi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],bi.prototype,"trailerField",void 0),new F({algorithm:Ih,parameters:z.serialize(new bi)});class Ln{constructor(t={}){this.digestAlgorithm=new F,this.digest=new le,Object.assign(this,t)}}u([f({type:F})],Ln.prototype,"digestAlgorithm",void 0),u([f({type:le})],Ln.prototype,"digest",void 0);var ta;class Hn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],Hn.prototype,"prime",void 0),u([f({type:m.Integer,converter:ye})],Hn.prototype,"exponent",void 0),u([f({type:m.Integer,converter:ye})],Hn.prototype,"coefficient",void 0);let ra=ta=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};ra=ta=u([j({type:V.Sequence,itemType:Hn})],ra);class mt{constructor(t={}){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,t)}}u([f({type:m.Integer})],mt.prototype,"version",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"coefficient",void 0),u([f({type:ra,optional:!0})],mt.prototype,"otherPrimeInfos",void 0);class ia{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],ia.prototype,"modulus",void 0),u([f({type:m.Integer,converter:ye})],ia.prototype,"publicExponent",void 0);var na;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(na||(na={}));const qe=na;/*! *****************************************************************************
|
|
75
|
+
`)}`:`${r} :`}}Cl=He,P.Constructed=Cl,He.NAME="CONSTRUCTED";class Sl extends Me{fromBER(t,r,n){return r}toBER(t){return nt}}Sl.override="EndOfContentValueBlock";var xl;class Vo extends Ee{constructor(t={}){super(t,Sl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}xl=Vo,P.EndOfContent=xl,Vo.NAME=Yr;var Al;class Wt extends Ee{constructor(t={}){super(t,Me),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,r+n>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+n}toBER(t,r){const n=new ArrayBuffer(2);if(!t){const o=new Uint8Array(n);o[0]=5,o[1]=0}return r&&r.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}}Al=Wt,P.Null=Al,Wt.NAME="NULL";class Bl extends pt(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=M.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,n){const o=M.toUint8Array(t);return Ct(this,o,r,n)?(this.valueHexView=o.subarray(r,r+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,fl.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Bl.NAME="BooleanValueBlock";var Il;let Li=class extends Ee{constructor(t={}){super(t,Bl),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Il=Li,P.Boolean=Il,Li.NAME="BOOLEAN";class Nl extends pt($t){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,n){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=$t.prototype.fromBER.call(this,t,r,n),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==yl)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,n),this.blockLength=n;return o}toBER(t,r){return this.isConstructed?$t.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Nl.NAME="OctetStringValueBlock";var El;let Jt=class up extends Ee{constructor({idBlock:t={},lenBlock:r={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Nl),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+n);try{if(s.byteLength){const a=hr(s,0,s.byteLength);a.offset!==-1&&a.offset===n&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,n)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?He.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof up&&t.push(r.valueBlock.valueHexView);return M.concat(t)}};El=Jt,P.OctetString=El,Jt.NAME=yl;class Ol extends pt($t){constructor({unusedBits:t=0,isConstructed:r=!1,...n}={}){super(n),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,n){if(!n)return r;let o=-1;if(this.isConstructed){if(o=$t.prototype.fromBER.call(this,t,r,n),o===-1)return o;for(const l of this.value){const c=l.constructor.NAME;if(c===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==gl)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=l.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 o}const s=M.toUint8Array(t);if(!Ct(this,s,r,n))return-1;const a=s.subarray(r,r+n);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const l=a.subarray(1);try{if(l.byteLength){const c=hr(l,0,l.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+n}toBER(t,r){if(this.isConstructed)return $t.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return nt;const n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Ol.NAME="BitStringValueBlock";var _l;let Yt=class extends Ee{constructor({idBlock:t={},lenBlock:r={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Ol),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return He.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const n=t.join("");return`${this.constructor.NAME} : ${n.substring(0,n.length-this.valueBlock.unusedBits)}`}}};_l=Yt,P.BitString=_l,Yt.NAME=gl;var Vl;function Pp(e,t){const r=new Uint8Array([0]),n=new Uint8Array(e),o=new Uint8Array(t);let s=n.slice(0);const a=s.length-1,l=o.slice(0),c=l.length-1;let d=0;const y=c<a?a:c;let p=0;for(let E=y;E>=0;E--,p++){switch(!0){case p<l.length:d=s[a-p]+l[c-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=No(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=No(r,s)),s}function Tl(e){if(e>=Jr.length)for(let t=Jr.length;t<=e;t++){const r=new Uint8Array([0]);let n=Jr[t-1].slice(0);for(let o=n.length-1;o>=0;o--){const s=new Uint8Array([(n[o]<<1)+r[0]]);r[0]=s[0]/10,n[o]=s[0]%10}r[0]>0&&(n=No(r,n)),Jr.push(n)}return Jr[e]}function Up(e,t){let r=0;const n=new Uint8Array(e),o=new Uint8Array(t),s=n.slice(0),a=s.length-1,l=o.slice(0),c=l.length-1;let d,y=0;for(let p=c;p>=0;p--,y++)switch(d=s[a-y]-l[c-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-c+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class To extends pt(Me){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}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=fl.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Ip(t))}get valueDec(){return this._valueDec}fromDER(t,r,n,o=0){const s=this.fromBER(t,r,n);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):o!==0&&a.length<o&&(o-a.length>1&&(o=a.length+1),this.valueHexView=a.subarray(o-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(r,1),this.valueHexView=n}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,n){const o=super.fromBER(t,r,n);return o===-1||this.setValueHex(),o}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),n=0,o;const s=this.valueHexView;let a="",l=!1;for(let c=s.byteLength-1;c>=0;c--){o=s[c];for(let d=0;d<8;d++){if((o&1)===1)switch(n){case t:r=Up(Tl(n),r),a="-";break;default:r=Pp(r,Tl(n))}n++,o>>=1}}for(let c=0;c<r.length;c++)r[c]&&(l=!0),l&&(a+=pl.charAt(r[c]));return l===!1&&(a+=pl.charAt(0)),a}}Vl=To,To.NAME="IntegerValueBlock",Object.defineProperty(Vl.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var jl;class ht extends Ee{constructor(t={}){super(t,To),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ri(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Ri();const r=BigInt(t),n=new Pi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const l=new Uint8Array(s.length+(s[0]&128?1:0));l[0]|=128;const d=BigInt(`0x${L.ToHex(l)}`)+r,y=M.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,n.write(y)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new ht({valueHex:n.final()})}convertToDER(){const t=new ht({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ht({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}jl=ht,P.Integer=jl,ht.NAME="INTEGER";var Dl;class Hi extends ht{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Dl=Hi,P.Enumerated=Dl,Hi.NAME="ENUMERATED";class jo extends pt(Me){constructor({valueDec:t=-1,isFirstSid:r=!1,...n}={}){super(n),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,n){if(!n)return r;const o=M.toUint8Array(t);if(!Ct(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=pr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Ri();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const n=new Uint8Array(r.length/7);for(let o=0;o<n.length;o++)n[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=zt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const n=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)n[a]=o[a]|128;n[s]=o[s]}return n}toString(){let t="";if(this.isHexOnly)t=L.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}jo.NAME="sidBlock";class $l extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new jo;if(o=s.fromBER(t,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let n=0;n<this.value.length;n++){const o=this.value[n].toBER(t);if(o.byteLength===0)return this.error=this.value[n].error,nt;r.push(o)}return Eo(r)}fromString(t){this.value=[];let r=0,n=0,o="",s=!1;do if(n=t.indexOf(".",r),n===-1?o=t.substring(r):o=t.substring(r,n),r=n+1,s){const a=this.value[0];let l=0;switch(a.valueDec){case 0:break;case 1:l=40;break;case 2:l=80;break;default:this.value=[];return}const c=parseInt(o,10);if(isNaN(c))return;a.valueDec=c+l,s=!1}else{const a=new jo;if(o>Number.MAX_SAFE_INTEGER){Ri();const l=BigInt(o);a.valueBigInt=l}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(n!==-1)}toString(){let t="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[n].isFirstSid?t=`2.{${o} - 80}`:t+=o):t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}$l.NAME="ObjectIdentifierValueBlock";var Ml;class Fi extends Ee{constructor(t={}){super(t,$l),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ml=Fi,P.ObjectIdentifier=Ml,Fi.NAME="OBJECT IDENTIFIER";class Do extends pt(Gt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,n){if(n===0)return r;const o=M.toUint8Array(t);if(!Ct(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=pr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=zt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const n=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)n[a]=o[a]|128;n[s]=o[s]}return n.buffer}toString(){let t="";return this.isHexOnly?t=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Do.NAME="relativeSidBlock";class Rl extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new Do;if(o=s.fromBER(t,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const n=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(t);if(s.byteLength===0)return this.error=this.value[o].error,nt;n.push(s)}return Eo(n)}fromString(t){this.value=[];let r=0,n=0,o="";do{n=t.indexOf(".",r),n===-1?o=t.substring(r):o=t.substring(r,n),r=n+1;const s=new Do;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let t="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(t=`${t}.`),r&&(o=`{${o}}`),t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Rl.NAME="RelativeObjectIdentifierValueBlock";var Pl;class $o extends Ee{constructor(t={}){super(t,Rl),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Pl=$o,P.RelativeObjectIdentifier=Pl,$o.NAME="RelativeObjectIdentifier";var Ul;class St extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ul=St,P.Sequence=Ul,St.NAME="SEQUENCE";var Ll;let xt=class extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Ll=xt,P.Set=Ll,xt.NAME="SET";class Hl extends pt(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}Hl.NAME="StringValueBlock";class Fl extends Hl{}Fl.NAME="SimpleStringValueBlock";class Je extends _o{constructor({...t}={}){super(t,Fl)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,M.toUint8Array(t))}fromString(t){const r=t.length,n=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);this.valueBlock.value=t}}Je.NAME="SIMPLE STRING";class ql extends Je{fromBuffer(t){this.valueBlock.valueHexView=M.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}ql.NAME="Utf8StringValueBlock";var Kl;class At extends ql{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Kl=At,P.Utf8String=Kl,At.NAME="UTF8String";class zl extends Je{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=M.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}zl.NAME="BmpStringValueBlock";var Gl;class qi extends zl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Gl=qi,P.BmpString=Gl,qi.NAME="BMPString";class Wl extends Je{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),n=new Uint8Array(r);for(let o=0;o<n.length;o+=4)n[o]=n[o+3],n[o+1]=n[o+2],n[o+2]=0,n[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,n=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=zt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const l=4-a.length;for(let c=a.length-1;c>=0;c--)n[o*4+c+l]=a[c]}this.valueBlock.value=t}}Wl.NAME="UniversalStringValueBlock";var Jl;class Ki extends Wl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Jl=Ki,P.UniversalString=Jl,Ki.NAME="UniversalString";var Yl;class zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Yl=zi,P.NumericString=Yl,zi.NAME="NumericString";var Zl;class Gi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Zl=Gi,P.PrintableString=Zl,Gi.NAME="PrintableString";var Ql;class Wi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Ql=Wi,P.TeletexString=Ql,Wi.NAME="TeletexString";var Xl;class Ji extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Xl=Ji,P.VideotexString=Xl,Ji.NAME="VideotexString";var ec;class Yi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}ec=Yi,P.IA5String=ec,Yi.NAME="IA5String";var tc;class Zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}tc=Zi,P.GraphicString=tc,Zi.NAME="GraphicString";var rc;class Qr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}rc=Qr,P.VisibleString=rc,Qr.NAME="VisibleString";var ic;class Qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}ic=Qi,P.GeneralString=ic,Qi.NAME="GeneralString";var nc;class Xi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}nc=Xi,P.CharacterString=nc,Xi.NAME="CharacterString";var oc;class Xr extends Qr{constructor({value:t,valueDate:r,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let o=0;o<t.length;o++)this.valueBlock.valueHexView[o]=t.charCodeAt(o)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,M.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),n=new Uint8Array(r);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(n===null){this.error="Wrong input string for conversion";return}const o=parseInt(n[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=We(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=We(this.month,2),r[2]=We(this.day,2),r[3]=We(this.hour,2),r[4]=We(this.minute,2),r[5]=We(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}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}}}oc=Xr,P.UTCTime=oc,Xr.NAME="UTCTime";var sc;class en extends Xr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,n="",o="",s=0,a,l=0,c=0;if(t[t.length-1]==="Z")n=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");n=t}if(r){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,E=n.indexOf("+"),w="";if(E===-1&&(E=n.indexOf("-"),p=-1),E!==-1){if(w=n.substring(E+1),n=n.substring(0,E),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(w.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(l=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");c=p*h}}}let d=n.indexOf(".");if(d===-1&&(d=n.indexOf(",")),d!==-1){const p=new Number(`0${n.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),o=n.substring(0,d)}else o=n;switch(!0){case o.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(o);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+l;break;case 5:this.minute=parseInt(y[p],10)+c;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(We(this.year,4)),r.push(We(this.month,2)),r.push(We(this.day,2)),r.push(We(this.hour,2)),r.push(We(this.minute,2)),r.push(We(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(We(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}sc=en,P.GeneralizedTime=sc,en.NAME="GeneralizedTime";var ac;class Mo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}ac=Mo,P.DATE=ac,Mo.NAME="DATE";var lc;class Ro extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}lc=Ro,P.TimeOfDay=lc,Ro.NAME="TimeOfDay";var cc;class Po extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}cc=Po,P.DateTime=cc,Po.NAME="DateTime";var uc;class Uo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}uc=Uo,P.Duration=uc,Uo.NAME="Duration";var dc;class Lo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}dc=Lo,P.TIME=dc,Lo.NAME="TIME";class Zt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Ho extends Zt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class tn extends Zt{constructor({value:t=new Zt,local:r=!1,...n}={}){super(n),this.value=t,this.local=r}}class Lp{constructor({data:t=Ui}={}){this.dataView=M.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=M.toUint8Array(t)}fromBER(t,r,n){const o=r+n;return this.dataView=M.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Qt(e,t,r){if(r instanceof Ho){for(let s=0;s<r.value.length;s++)if(Qt(e,t,r.value[s]).verified)return{verified:!0,result:e};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(Oo)&&(s.name=r.name),s}}if(r instanceof Zt)return r.hasOwnProperty(Oo)&&(e[r.name]=t),{verified:!0,result:e};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Op in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(jp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Dp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const n=r.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(_p)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(Vp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(Tp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Ep in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly)return{verified:!1,result:e};if(r.idBlock.isHexOnly){if(!(hl in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let l=0;l<s.length;l++)if(s[l]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},l=r.valueBlock.value.length;if(l>0&&r.valueBlock.value[0]instanceof tn&&(l=t.valueBlock.value.length),l===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let c=0;c<l;c++)if(c-s>=t.valueBlock.value.length){if(r.valueBlock.value[c].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof tn){if(a=Qt(e,t.valueBlock.value[c],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(Oo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};$p in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[c])}}else if(a=Qt(e,t.valueBlock.value[c-s],r.valueBlock.value[c]),a.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(a.verified===!1){const c={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],c.name=r.name)),c}return{verified:!0,result:e}}if(r.primitiveSchema&&hl in t.valueBlock){const s=hr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],a.name=r.name)),a}return Qt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Hp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=hr(M.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Qt(r.result,r.result,t)}const fc=Object.freeze(Object.defineProperty({__proto__:null,Any:Zt,BaseBlock:Ee,BaseStringBlock:_o,BitString:Yt,BmpString:qi,Boolean:Li,CharacterString:Xi,Choice:Ho,Constructed:He,DATE:Mo,DateTime:Po,Duration:Uo,EndOfContent:Vo,Enumerated:Hi,GeneralString:Qi,GeneralizedTime:en,GraphicString:Zi,HexBlock:pt,IA5String:Yi,Integer:ht,Null:Wt,NumericString:zi,ObjectIdentifier:Fi,OctetString:Jt,Primitive:Zr,PrintableString:Gi,RawData:Lp,RelativeObjectIdentifier:$o,Repeated:tn,Sequence:St,Set:xt,TIME:Lo,TeletexString:Wi,TimeOfDay:Ro,UTCTime:Xr,UniversalString:Ki,Utf8String:At,ValueBlock:Me,VideotexString:Ji,ViewWriter:Pi,VisibleString:Qr,compareSchema:Qt,fromBER:yr,verifySchema:Hp},Symbol.toStringTag,{value:"Module"}));var V;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(V||(V={}));var m;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(m||(m={}));class rn{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(M.isBufferSource(t))this.unusedBits=r,this.value=M.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Yt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new Yt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Yt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const n of r)t+=n.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const n=r.length+7>>3;this.unusedBits=(n<<3)-r.length;const o=new Uint8Array(n);r=r.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class le{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):M.isBufferSource(t)?this.buffer=M.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Jt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Jt({valueHex:this.buffer})}toSchema(t){return new Jt({name:t})}}const Fp={fromASN:e=>e instanceof Wt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Wt;const t=yr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},qp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ht({value:+e})},Kp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Hi({value:e})},ye={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ht({valueHex:e})},zp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},Gp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Fi({value:e})},Wp={fromASN:e=>e.valueBlock.value,toASN:e=>new Li({value:e})},nn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Jt({valueHex:e})},Jp={fromASN:e=>new le(e.getValue()),toASN:e=>e.toASN()};function Xe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const pc=Xe(At),Yp=Xe(qi),Zp=Xe(Ki),Qp=Xe(zi),Xp=Xe(Gi),eh=Xe(Wi),th=Xe(Ji),rh=Xe(Yi),ih=Xe(Zi),nh=Xe(Qr),oh=Xe(Qi),sh=Xe(Xi),ah={fromASN:e=>e.toDate(),toASN:e=>new Xr({valueDate:e})},lh={fromASN:e=>e.toDate(),toASN:e=>new en({valueDate:e})},ch={fromASN:()=>null,toASN:()=>new Wt};function Fo(e){switch(e){case m.Any:return Fp;case m.BitString:return zp;case m.BmpString:return Yp;case m.Boolean:return Wp;case m.CharacterString:return sh;case m.Enumerated:return Kp;case m.GeneralString:return oh;case m.GeneralizedTime:return lh;case m.GraphicString:return ih;case m.IA5String:return rh;case m.Integer:return qp;case m.Null:return ch;case m.NumericString:return Qp;case m.ObjectIdentifier:return Gp;case m.OctetString:return nn;case m.PrintableString:return Xp;case m.TeletexString:return eh;case m.UTCTime:return ah;case m.UniversalString:return Zp;case m.Utf8String:return pc;case m.VideotexString:return th;case m.VisibleString:return nh;default:return null}}function Bt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:Bt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function hc(e){var t;if(e){const r=Object.getPrototypeOf(e);return((t=r==null?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array?!0:hc(r)}return!1}function uh(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==n[o])return!1;return!0}class dh{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const n=this.items.get(t);if(!n)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!n.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:V.Sequence,items:{}},n=this.findParentSchema(t);return n&&(Object.assign(r,n),r.items=Object.assign({},r.items,n.items)),r}create(t,r){const n=this.items.get(t)||this.createDefault(t),o=[];for(const s in n.items){const a=n.items[s],l=r?s:"";let c;if(typeof a.type=="number"){const y=m[a.type],p=fc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);c=new p({name:l})}else Bt(a.type)?c=new a.type().toSchema(l):a.optional?this.get(a.type).type===V.Choice?c=new Zt({name:l}):(c=this.create(a.type,!1),c.name=l):c=new Zt({name:l});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){c.name="";const y=a.repeated==="set"?xt:St;c=new y({name:"",value:[new tn({name:l,value:c})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||Bt(a.type)){const y=a.repeated?He:Zr;o.push(new y({name:l,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?c:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new He({name:y?"":l,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new He({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else c.optional=d,o.push(c)}switch(n.type){case V.Sequence:return new St({value:o,name:""});case V.Set:return new xt({value:o,name:""});case V.Choice:return new Ho({value:o,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const et=new dh,j=e=>t=>{let r;et.has(t)?r=et.get(t):(r=et.createDefault(t),et.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let n;et.has(t.constructor)?n=et.get(t.constructor):(n=et.createDefault(t.constructor),et.set(t.constructor,n));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Fo(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}n.items[r]=o};class yc extends Error{constructor(){super(...arguments),this.schemas=[]}}class fh{static parse(t,r){const n=yr(t);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r)}static fromASN(t,r){var n;try{if(Bt(r))return new r().fromASN(t);const o=et.get(r);et.cache(r);let s=o.schema;if(t.constructor===He&&o.type!==V.Choice){s=new He({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const c in o.items)delete t[c]}const a=Qt({},t,s);if(!a.verified)throw new yc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const l=new r;if(hc(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const c=o.itemType;if(typeof c=="number"){const d=Fo(c);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,c))}for(const c in o.items){const d=a.result[c];if(!d)continue;const y=o.items[c],p=y.type;if(typeof p=="number"||Bt(p)){const E=(n=y.converter)!==null&&n!==void 0?n:Bt(p)?new p:null;if(!E)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?St:xt,h=new w;h.valueBlock=d.valueBlock;const g=yr(h.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const b=g.result.valueBlock.value;l[c]=Array.from(b,v=>E.fromASN(v))}else l[c]=Array.from(d,w=>E.fromASN(w));else{let w=d;if(y.implicit){let h;if(Bt(p))h=new p().toSchema("");else{const g=m[p],b=fc[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=yr(h.toBER(!1)).result}l[c]=E.fromASN(w)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");l[c]=Array.from(d,E=>this.fromASN(E,p))}else l[c]=this.fromASN(d,p)}return l}catch(o){throw o instanceof yc&&o.schemas.push(r.name),o}}}class qo{static serialize(t){return t instanceof Ee?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&Bt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,n=et.get(r);et.cache(r);let o=[];if(n.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){const a=Fo(n.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(l=>a.toASN(l))}else o=t.map(a=>this.toAsnItem({type:n.itemType},"[]",r,a))}else for(const a in n.items){const l=n.items[a],c=t[a];if(c===void 0||l.defaultValue===c||typeof l.defaultValue=="object"&&typeof c=="object"&&uh(this.serialize(l.defaultValue),this.serialize(c)))continue;const d=qo.toAsnItem(l,a,r,c);if(typeof l.context=="number")if(l.implicit)if(!l.repeated&&(typeof l.type=="number"||Bt(l.type))){const y={};y.valueHex=d instanceof Wt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Zr({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},...y}))}else o.push(new He({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:d.valueBlock.value}));else o.push(new He({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:[d]}));else l.repeated?o=o.concat(d):o.push(d)}let s;switch(n.type){case V.Sequence:s=new St({value:o});break;case V.Set:s=new xt({value:o});break;case V.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(t,r,n,o){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${m[t.type]} in schema '${n.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,d=>a.toASN(d)),c=t.repeated==="sequence"?St:xt;s=new c({value:l})}else s=a.toASN(o)}else if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(o,c=>this.toASN(c)),l=t.repeated==="sequence"?St:xt;s=new l({value:a})}else s=this.toASN(o);return s}}class ue extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class z{static serialize(t){return qo.serialize(t)}static parse(t,r){return fh.parse(t,r)}static toString(t){const r=M.isBufferSource(t)?M.toArrayBuffer(t):z.serialize(t),n=yr(r);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}}function u(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,r,s):a(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var gc={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",l="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,B=(h.match(c.zoneIndex)||[])[0],S,C;for(B&&(B=B.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(C=g-b,S=":";C--;)S+="0:";return h=h.replace("::",S),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const T=h.split(":"),N=[];for(let I=0;I<T.length;I++)N.push(parseInt(T[I],16));return N}(),{parts:g,zoneId:B}}function y(h,g,b,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let B=0,S;for(;v>0;){if(S=b-v,S<0&&(S=0),h[B]>>S!==g[B]>>S)return!1;v-=b,B+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function E(h,g){for(;h.length<g;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,v;for(b=0;b<g.length;b++)if(v=g[b],!(0<=v&&v<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(g,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let B,S,C;for(B=3;B>=0;B-=1)if(S=this.octets[B],S in v){if(C=v[S],b&&C!==0)return null;C!==8&&(b=!0),g+=C}else return null;return 32-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return w.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),w.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let S=0;for(;S<4;)B.push(parseInt(b[S],10)|parseInt(v[S],10)^255),S++;return new this(B)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.isIPv4=function(h){return this.parser(h)!==null},w.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},w.IPv4.isValidFourPartDecimal=function(h){return!!(w.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},w.IPv4.networkAddressFromCIDR=function(h){let g,b,v,B,S;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),S=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<4;)B.push(parseInt(v[b],10)&parseInt(S[b],10)),b++;return new this(B)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.parse=function(h){const g=this.parser(h);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},w.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(g[2]);if(b>=0&&b<=32){const v=[this.parse(g[1]),b];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,v;if(g=h.match(n.fourOctet))return function(){const B=g.slice(1,6),S=[];for(let C=0;C<B.length;C++)b=B[C],S.push(p(b));return S}();if(g=h.match(n.longValue)){if(v=p(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const B=[];let S;for(S=0;S<=24;S+=8)B.push(v>>S&255);return B}().reverse()}else return(g=h.match(n.twoOctet))?function(){const B=g.slice(1,4),S=[];if(v=p(B[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return S.push(p(B[0])),S.push(v>>16&255),S.push(v>>8&255),S.push(v&255),S}():(g=h.match(n.threeOctet))?function(){const B=g.slice(1,5),S=[];if(v=p(B[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return S.push(p(B[0])),S.push(p(B[1])),S.push(v>>8&255),S.push(v&255),S}():null},w.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let v,B;if(g.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(g[v]<<8|g[v+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(B=this.parts[v],!(0<=B&&B<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(g,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let B,S;for(let C=7;C>=0;C-=1)if(B=this.parts[C],B in v){if(S=v[B],b&&S!==0)return null;S!==16&&(b=!0),g+=S}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let B=0;B<v.length;B++)g=v[B],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let B=0;B<this.parts.length;B++)v.push(E(this.parts[B].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),b=g[0],v=g[1];return new w.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let B=0;B<this.parts.length;B++)v.push(this.parts[B].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,B=-1,S;for(;S=g.exec(b);)S[0].length>B&&(v=S.index,B=S[0].length);return B<0?b:`${b.substring(0,v)}::${b.substring(v+B)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let S=0;for(;S<16;)B.push(parseInt(b[S],10)|parseInt(v[S],10)^255),S++;return new this(B)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},w.IPv6.isIPv6=function(h){return this.parser(h)!==null},w.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const g=this.parser(h);return new this(g.parts,g.zoneId),!0}catch{return!1}},w.IPv6.networkAddressFromCIDR=function(h){let g,b,v,B,S;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),S=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<16;)B.push(parseInt(v[b],10)&parseInt(S[b],10)),b++;return new this(B)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},w.IPv6.parse=function(h){const g=this.parser(h);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},w.IPv6.parseCIDR=function(h){let g,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return v=[this.parse(b[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,v,B,S,C;if(v=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(c.native.test(h))return d(h,8);if((v=h.match(c.transitional))&&(C=v[6]||"",g=d(v[1].slice(0,-1)+C,6),g.parts)){for(S=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<S.length;b++)if(B=S[b],!(0<=B&&B<=255))return null;return g.parts.push(S[0]<<8|S[1]),g.parts.push(S[2]<<8|S[3]),{parts:g.parts,zoneId:g.zoneId}}return null},w.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<16&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.fromByteArray=function(h){const g=h.length;if(g===4)return new w.IPv4(h);if(g===16)return new w.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},w.isValid=function(h){return w.IPv6.isValid(h)||w.IPv4.isValid(h)},w.parse=function(h){if(w.IPv6.isValid(h))return w.IPv6.parse(h);if(w.IPv4.isValid(h))return w.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},w.parseCIDR=function(h){try{return w.IPv6.parseCIDR(h)}catch{try{return w.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},w.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},w.subnetMatch=function(h,g,b){let v,B,S,C;b==null&&(b="unicast");for(B in g)if(Object.prototype.hasOwnProperty.call(g,B)){for(S=g[B],S[0]&&!(S[0]instanceof Array)&&(S=[S]),v=0;v<S.length;v++)if(C=S[v],h.kind()===C[0].kind()&&h.match.apply(h,C))return B}return b},e.exports?e.exports=w:t.ipaddr=w})(Bo)})(gc);var mc=gc.exports;class bc{static decodeIP(t){if(t.length===64&&parseInt(t,16)===0)return"::/0";if(t.length!==16)return t;const r=parseInt(t.slice(8),16).toString(2).split("").reduce((o,s)=>o+ +s,0);let n=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return n=n.slice(0,-1),`${n}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return mc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=mc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Ko,zo,Go;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:m.TeletexString})],Oe.prototype,"teletexString",void 0),u([f({type:m.PrintableString})],Oe.prototype,"printableString",void 0),u([f({type:m.UniversalString})],Oe.prototype,"universalString",void 0),u([f({type:m.Utf8String})],Oe.prototype,"utf8String",void 0),u([f({type:m.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([j({type:V.Choice})],Oe);let gr=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:m.IA5String})],gr.prototype,"ia5String",void 0),u([f({type:m.Any})],gr.prototype,"anyValue",void 0),gr=u([j({type:V.Choice})],gr);class ei{constructor(t={}){this.type="",this.value=new gr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"type",void 0),u([f({type:gr})],ei.prototype,"value",void 0);let mr=Ko=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};mr=Ko=u([j({type:V.Set,itemType:ei})],mr);let Wo=zo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,zo.prototype)}};Wo=zo=u([j({type:V.Sequence,itemType:mr})],Wo);let ke=Go=class extends Wo{constructor(t){super(t),Object.setPrototypeOf(this,Go.prototype)}};ke=Go=u([j({type:V.Sequence})],ke);const ph={fromASN:e=>bc.toString(nn.fromASN(e)),toASN:e=>nn.toASN(bc.fromString(e))};class ti{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ti.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ti.prototype,"value",void 0);class Jo{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Jo.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Jo.prototype,"partyName",void 0);let oe=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ti,context:0,implicit:!0})],oe.prototype,"otherName",void 0),u([f({type:m.IA5String,context:1,implicit:!0})],oe.prototype,"rfc822Name",void 0),u([f({type:m.IA5String,context:2,implicit:!0})],oe.prototype,"dNSName",void 0),u([f({type:m.Any,context:3,implicit:!0})],oe.prototype,"x400Address",void 0),u([f({type:ke,context:4,implicit:!1})],oe.prototype,"directoryName",void 0),u([f({type:Jo,context:5})],oe.prototype,"ediPartyName",void 0),u([f({type:m.IA5String,context:6,implicit:!0})],oe.prototype,"uniformResourceIdentifier",void 0),u([f({type:m.OctetString,context:7,implicit:!0,converter:ph})],oe.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],oe.prototype,"registeredID",void 0),oe=u([j({type:V.Choice})],oe);const br="1.3.6.1.5.5.7.3",Xt="2.5.29";var Yo;class on{constructor(t={}){this.accessMethod="",this.accessLocation=new oe,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],on.prototype,"accessMethod",void 0),u([f({type:oe})],on.prototype,"accessLocation",void 0);let wc=Yo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};wc=Yo=u([j({type:V.Sequence,itemType:on})],wc);const Zo=`${Xt}.35`;class Qo extends le{}class er{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Qo,context:0,optional:!0,implicit:!0})],er.prototype,"keyIdentifier",void 0),u([f({type:oe,context:1,optional:!0,implicit:!0,repeated:"sequence"})],er.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:ye})],er.prototype,"authorityCertSerialNumber",void 0);const vc=`${Xt}.19`;class sn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],sn.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],sn.prototype,"pathLenConstraint",void 0);var Xo;let Re=Xo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};Re=Xo=u([j({type:V.Sequence,itemType:oe})],Re);var es;let kc=es=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,es.prototype)}};kc=es=u([j({type:V.Sequence})],kc);var ts;const Cc=`${Xt}.32`;let It=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],It.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],It.prototype,"visibleString",void 0),u([f({type:m.BmpString})],It.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],It.prototype,"utf8String",void 0),It=u([j({type:V.Choice})],It);class rs{constructor(t={}){this.organization=new It,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:It})],rs.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],rs.prototype,"noticeNumbers",void 0);class is{constructor(t={}){Object.assign(this,t)}}u([f({type:rs,optional:!0})],is.prototype,"noticeRef",void 0),u([f({type:It,optional:!0})],is.prototype,"explicitText",void 0);let an=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],an.prototype,"cPSuri",void 0),u([f({type:is})],an.prototype,"userNotice",void 0),an=u([j({type:V.Choice})],an);class ns{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ns.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],ns.prototype,"qualifier",void 0);class ln{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ln.prototype,"policyIdentifier",void 0),u([f({type:ns,repeated:"sequence",optional:!0})],ln.prototype,"policyQualifiers",void 0);let cn=ts=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};cn=ts=u([j({type:V.Sequence,itemType:ln})],cn);let un=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],un.prototype,"value",void 0),un=u([j({type:V.Choice})],un);let Sc=class extends un{};Sc=u([j({type:V.Choice})],Sc);var os,ot;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(ot||(ot={}));class xc extends rn{toJSON(){const t=[],r=this.toNumber();return r&ot.aACompromise&&t.push("aACompromise"),r&ot.affiliationChanged&&t.push("affiliationChanged"),r&ot.cACompromise&&t.push("cACompromise"),r&ot.certificateHold&&t.push("certificateHold"),r&ot.cessationOfOperation&&t.push("cessationOfOperation"),r&ot.keyCompromise&&t.push("keyCompromise"),r&ot.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&ot.superseded&&t.push("superseded"),r&ot.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let wr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,context:0,repeated:"sequence",implicit:!0})],wr.prototype,"fullName",void 0),u([f({type:mr,context:1,implicit:!0})],wr.prototype,"nameRelativeToCRLIssuer",void 0),wr=u([j({type:V.Choice})],wr);class ri{constructor(t={}){Object.assign(this,t)}}u([f({type:wr,context:0,optional:!0})],ri.prototype,"distributionPoint",void 0),u([f({type:xc,context:1,optional:!0,implicit:!0})],ri.prototype,"reasons",void 0),u([f({type:oe,context:2,optional:!0,repeated:"sequence",implicit:!0})],ri.prototype,"cRLIssuer",void 0);let ss=os=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};ss=os=u([j({type:V.Sequence,itemType:ri})],ss);var as;let Ac=as=class extends ss{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};Ac=as=u([j({type:V.Sequence,itemType:ri})],Ac);class De{constructor(t={}){this.onlyContainsUserCerts=De.ONLY,this.onlyContainsCACerts=De.ONLY,this.indirectCRL=De.ONLY,this.onlyContainsAttributeCerts=De.ONLY,Object.assign(this,t)}}De.ONLY=!1,u([f({type:wr,context:0,optional:!0})],De.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsCACerts",void 0),u([f({type:xc,context:3,optional:!0,implicit:!0})],De.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:De.ONLY,implicit:!0})],De.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsAttributeCerts",void 0);var ii;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ii||(ii={}));let ls=class{constructor(t=ii.unspecified){this.reason=ii.unspecified,this.reason=t}toJSON(){return ii[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],ls.prototype,"reason",void 0),ls=u([j({type:V.Choice})],ls);var cs;const Bc=`${Xt}.37`;let dn=cs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};dn=cs=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],dn);const hh=`${br}.1`,yh=`${br}.2`,gh=`${br}.3`,mh=`${br}.4`,bh=`${br}.8`,wh=`${br}.9`;let us=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:ye})],us.prototype,"value",void 0),us=u([j({type:V.Choice})],us);let ds=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],ds.prototype,"value",void 0),ds=u([j({type:V.Choice})],ds);var fs;let Ic=fs=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};Ic=fs=u([j({type:V.Sequence})],Ic);const Nc=`${Xt}.15`;var st;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(st||(st={}));class ps extends rn{toJSON(){const t=this.toNumber(),r=[];return t&st.cRLSign&&r.push("crlSign"),t&st.dataEncipherment&&r.push("dataEncipherment"),t&st.decipherOnly&&r.push("decipherOnly"),t&st.digitalSignature&&r.push("digitalSignature"),t&st.encipherOnly&&r.push("encipherOnly"),t&st.keyAgreement&&r.push("keyAgreement"),t&st.keyCertSign&&r.push("keyCertSign"),t&st.keyEncipherment&&r.push("keyEncipherment"),t&st.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var hs;class fn{constructor(t={}){this.base=new oe,this.minimum=0,Object.assign(this,t)}}u([f({type:oe})],fn.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],fn.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],fn.prototype,"maximum",void 0);let pn=hs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};pn=hs=u([j({type:V.Sequence,itemType:fn})],pn);class Ec{constructor(t={}){Object.assign(this,t)}}u([f({type:pn,context:0,optional:!0,implicit:!0})],Ec.prototype,"permittedSubtrees",void 0),u([f({type:pn,context:1,optional:!0,implicit:!0})],Ec.prototype,"excludedSubtrees",void 0);class Oc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:ye})],Oc.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:ye})],Oc.prototype,"inhibitPolicyMapping",void 0);var ys;class gs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],gs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],gs.prototype,"subjectDomainPolicy",void 0);let _c=ys=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};_c=ys=u([j({type:V.Sequence,itemType:gs})],_c);var ms;const Vc=`${Xt}.17`;let bs=ms=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};bs=ms=u([j({type:V.Sequence})],bs);let Nt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Nt.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],Nt.prototype,"values",void 0);var ws;let Tc=ws=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};Tc=ws=u([j({type:V.Sequence,itemType:Nt})],Tc);const jc=`${Xt}.14`;class Mt extends Qo{}class Dc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],Dc.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],Dc.prototype,"notAfter",void 0);var ni;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ni||(ni={}));class $c extends rn{toJSON(){const t=[],r=this.toNumber();return r&ni.pKIXCertificate&&t.push("pKIXCertificate"),r&ni.newExtensions&&t.push("newExtensions"),r&ni.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Mc{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new $c,Object.assign(this,t)}}u([f({type:m.GeneralString})],Mc.prototype,"entrustVers",void 0),u([f({type:$c})],Mc.prototype,"entrustInfoFlags",void 0);var vs;let Rc=vs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,vs.prototype)}};Rc=vs=u([j({type:V.Sequence,itemType:on})],Rc);class F{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof F&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&dl(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],F.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],F.prototype,"parameters",void 0);class Et{constructor(t={}){this.algorithm=new F,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Et.prototype,"algorithm",void 0),u([f({type:m.BitString})],Et.prototype,"subjectPublicKey",void 0);let _e=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:m.UTCTime})],_e.prototype,"utcTime",void 0),u([f({type:m.GeneralizedTime})],_e.prototype,"generalTime",void 0),_e=u([j({type:V.Choice})],_e);class hn{constructor(t){this.notBefore=new _e(new Date),this.notAfter=new _e(new Date),t&&(this.notBefore=new _e(t.notBefore),this.notAfter=new _e(t.notAfter))}}u([f({type:_e})],hn.prototype,"notBefore",void 0),u([f({type:_e})],hn.prototype,"notAfter",void 0);var ks;let at=class dp{constructor(t={}){this.extnID="",this.critical=dp.CRITICAL,this.extnValue=new le,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:le})],at.prototype,"extnValue",void 0);let tr=ks=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};tr=ks=u([j({type:V.Sequence,itemType:at})],tr);var vr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(vr||(vr={}));class tt{constructor(t={}){this.version=vr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new F,this.issuer=new ke,this.validity=new hn,this.subject=new ke,this.subjectPublicKeyInfo=new Et,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:vr.v1})],tt.prototype,"version",void 0),u([f({type:m.Integer,converter:ye})],tt.prototype,"serialNumber",void 0),u([f({type:F})],tt.prototype,"signature",void 0),u([f({type:ke})],tt.prototype,"issuer",void 0),u([f({type:hn})],tt.prototype,"validity",void 0),u([f({type:ke})],tt.prototype,"subject",void 0),u([f({type:Et})],tt.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],tt.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],tt.prototype,"subjectUniqueID",void 0),u([f({type:tr,context:3,optional:!0})],tt.prototype,"extensions",void 0);class kr{constructor(t={}){this.tbsCertificate=new tt,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:tt})],kr.prototype,"tbsCertificate",void 0),u([f({type:F})],kr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],kr.prototype,"signatureValue",void 0);class yn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],yn.prototype,"userCertificate",void 0),u([f({type:_e})],yn.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],yn.prototype,"crlEntryExtensions",void 0);class Ot{constructor(t={}){this.signature=new F,this.issuer=new ke,this.thisUpdate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],Ot.prototype,"version",void 0),u([f({type:F})],Ot.prototype,"signature",void 0),u([f({type:ke})],Ot.prototype,"issuer",void 0),u([f({type:_e})],Ot.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Ot.prototype,"nextUpdate",void 0),u([f({type:yn,repeated:"sequence",optional:!0})],Ot.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],Ot.prototype,"crlExtensions",void 0);let Cs=class{constructor(t={}){this.tbsCertList=new Ot,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Ot})],Cs.prototype,"tbsCertList",void 0),u([f({type:F})],Cs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],Cs.prototype,"signature",void 0);class Cr{constructor(t={}){this.issuer=new ke,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ke})],Cr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:ye})],Cr.prototype,"serialNumber",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Sr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],Sr.prototype,"issuerAndSerialNumber",void 0),Sr=u([j({type:V.Choice})],Sr);var _t;(function(e){e[e.v0=0]="v0",e[e.v1=1]="v1",e[e.v2=2]="v2",e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v5=5]="v5"})(_t||(_t={}));let oi=class extends F{};oi=u([j({type:V.Sequence})],oi);let gn=class extends F{};gn=u([j({type:V.Sequence})],gn);let yt=class extends F{};yt=u([j({type:V.Sequence})],yt);let mn=class extends F{};mn=u([j({type:V.Sequence})],mn);let Pc=class extends F{};Pc=u([j({type:V.Sequence})],Pc);let Ss=class extends F{};Ss=u([j({type:V.Sequence})],Ss);let xr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],xr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],xr.prototype,"attrValues",void 0);var xs;class gt{constructor(t={}){this.version=_t.v0,this.sid=new Sr,this.digestAlgorithm=new oi,this.signatureAlgorithm=new gn,this.signature=new le,Object.assign(this,t)}}u([f({type:m.Integer})],gt.prototype,"version",void 0),u([f({type:Sr})],gt.prototype,"sid",void 0),u([f({type:oi})],gt.prototype,"digestAlgorithm",void 0),u([f({type:xr,repeated:"set",context:0,implicit:!0,optional:!0})],gt.prototype,"signedAttrs",void 0),u([f({type:gn})],gt.prototype,"signatureAlgorithm",void 0),u([f({type:le})],gt.prototype,"signature",void 0),u([f({type:xr,repeated:"set",context:1,implicit:!0,optional:!0})],gt.prototype,"unsignedAttrs",void 0);let bn=xs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};bn=xs=u([j({type:V.Set,itemType:gt})],bn);let Uc=class extends _e{};Uc=u([j({type:V.Choice})],Uc);let Lc=class extends gt{};Lc=u([j({type:V.Sequence})],Lc);class As{constructor(t={}){this.acIssuer=new oe,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:oe})],As.prototype,"acIssuer",void 0),u([f({type:m.Integer})],As.prototype,"acSerial",void 0),u([f({type:Nt,repeated:"sequence"})],As.prototype,"attrs",void 0);var Bs;let wn=Bs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Bs.prototype)}};wn=Bs=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],wn);class vn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],vn.prototype,"pathLenConstraint",void 0),u([f({type:wn,implicit:!0,context:0,optional:!0})],vn.prototype,"permittedAttrs",void 0),u([f({type:wn,implicit:!0,context:1,optional:!0})],vn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],vn.prototype,"permitUnSpecified",void 0);class rr{constructor(t={}){this.issuer=new Re,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Re})],rr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:ye})],rr.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],rr.prototype,"issuerUID",void 0);var Is;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(Is||(Is={}));class ir{constructor(t={}){this.digestedObjectType=Is.publicKey,this.digestAlgorithm=new F,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],ir.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],ir.prototype,"otherObjectTypeID",void 0),u([f({type:F})],ir.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],ir.prototype,"objectDigest",void 0);class kn{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,optional:!0})],kn.prototype,"issuerName",void 0),u([f({type:rr,context:0,implicit:!0,optional:!0})],kn.prototype,"baseCertificateID",void 0),u([f({type:ir,context:1,implicit:!0,optional:!0})],kn.prototype,"objectDigestInfo",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,repeated:"sequence"})],Ar.prototype,"v1Form",void 0),u([f({type:kn,context:0,implicit:!0})],Ar.prototype,"v2Form",void 0),Ar=u([j({type:V.Choice})],Ar);class Cn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],Cn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],Cn.prototype,"notAfterTime",void 0);class si{constructor(t={}){Object.assign(this,t)}}u([f({type:rr,implicit:!0,context:0,optional:!0})],si.prototype,"baseCertificateID",void 0),u([f({type:Re,implicit:!0,context:1,optional:!0})],si.prototype,"entityName",void 0),u([f({type:ir,implicit:!0,context:2,optional:!0})],si.prototype,"objectDigestInfo",void 0);var Ns;(function(e){e[e.v2=1]="v2"})(Ns||(Ns={}));class lt{constructor(t={}){this.version=Ns.v2,this.holder=new si,this.issuer=new Ar,this.signature=new F,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Cn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],lt.prototype,"version",void 0),u([f({type:si})],lt.prototype,"holder",void 0),u([f({type:Ar})],lt.prototype,"issuer",void 0),u([f({type:F})],lt.prototype,"signature",void 0),u([f({type:m.Integer,converter:ye})],lt.prototype,"serialNumber",void 0),u([f({type:Cn})],lt.prototype,"attrCertValidityPeriod",void 0),u([f({type:Nt,repeated:"sequence"})],lt.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],lt.prototype,"issuerUniqueID",void 0),u([f({type:tr,optional:!0})],lt.prototype,"extensions",void 0);class Sn{constructor(t={}){this.acinfo=new lt,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:lt})],Sn.prototype,"acinfo",void 0),u([f({type:F})],Sn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],Sn.prototype,"signatureValue",void 0);var xn;(function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"})(xn||(xn={}));class Es extends rn{}class Os{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Os.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Os.prototype,"value",void 0);class _s{constructor(t={}){this.policyId="",this.classList=new Es(xn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],_s.prototype,"policyId",void 0),u([f({type:Es,defaultValue:new Es(xn.unclassified)})],_s.prototype,"classList",void 0),u([f({type:Os,repeated:"set"})],_s.prototype,"securityCategories",void 0);class An{constructor(t={}){Object.assign(this,t)}}u([f({type:le})],An.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],An.prototype,"oid",void 0),u([f({type:m.Utf8String})],An.prototype,"string",void 0);class Hc{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],Hc.prototype,"policyAuthority",void 0),u([f({type:An,repeated:"sequence"})],Hc.prototype,"values",void 0);var Vs;class Bn{constructor(t={}){this.targetCertificate=new rr,Object.assign(this,t)}}u([f({type:rr})],Bn.prototype,"targetCertificate",void 0),u([f({type:oe,optional:!0})],Bn.prototype,"targetName",void 0),u([f({type:ir,optional:!0})],Bn.prototype,"certDigestInfo",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oe,context:0,implicit:!0})],Br.prototype,"targetName",void 0),u([f({type:oe,context:1,implicit:!0})],Br.prototype,"targetGroup",void 0),u([f({type:Bn,context:2,implicit:!0})],Br.prototype,"targetCert",void 0),Br=u([j({type:V.Choice})],Br);let Ts=Vs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Vs.prototype)}};Ts=Vs=u([j({type:V.Sequence,itemType:Br})],Ts);var js;let Fc=js=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};Fc=js=u([j({type:V.Sequence,itemType:Ts})],Fc);class qc{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],qc.prototype,"roleAuthority",void 0),u([f({type:oe,implicit:!0,context:1})],qc.prototype,"roleName",void 0);class Ds{constructor(t={}){this.service=new oe,this.ident=new oe,Object.assign(this,t)}}u([f({type:oe})],Ds.prototype,"service",void 0),u([f({type:oe})],Ds.prototype,"ident",void 0),u([f({type:le,optional:!0})],Ds.prototype,"authInfo",void 0);var $s;class Ms{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ms.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Ms.prototype,"otherCert",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:kr})],Ir.prototype,"certificate",void 0),u([f({type:Sn,context:2,implicit:!0})],Ir.prototype,"v2AttrCert",void 0),u([f({type:Ms,context:3,implicit:!0})],Ir.prototype,"other",void 0),Ir=u([j({type:V.Choice})],Ir);let In=$s=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};In=$s=u([j({type:V.Set,itemType:Ir})],In);class Nr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Nr.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Nr.prototype,"content",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:le})],ai.prototype,"single",void 0),u([f({type:m.Any})],ai.prototype,"any",void 0),ai=u([j({type:V.Choice})],ai);class Nn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Nn.prototype,"eContentType",void 0),u([f({type:ai,context:0,optional:!0})],Nn.prototype,"eContent",void 0);let li=class{constructor(t={}){Object.assign(this,t)}};u([f({type:le,context:0,implicit:!0,optional:!0})],li.prototype,"value",void 0),u([f({type:le,converter:Jp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],li.prototype,"constructedValue",void 0),li=u([j({type:V.Choice})],li);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new mn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:mn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:li,optional:!0})],ci.prototype,"encryptedContent",void 0);class En{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],En.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],En.prototype,"keyAttr",void 0);var Rs;class On{constructor(t={}){this.subjectKeyIdentifier=new Mt,Object.assign(this,t)}}u([f({type:Mt})],On.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],On.prototype,"date",void 0),u([f({type:En,optional:!0})],On.prototype,"other",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:On,context:0,implicit:!0,optional:!0})],Er.prototype,"rKeyId",void 0),u([f({type:Cr,optional:!0})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([j({type:V.Choice})],Er);class Ps{constructor(t={}){this.rid=new Er,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:Er})],Ps.prototype,"rid",void 0),u([f({type:le})],Ps.prototype,"encryptedKey",void 0);let _n=Rs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};_n=Rs=u([j({type:V.Sequence,itemType:Ps})],_n);class Us{constructor(t={}){this.algorithm=new F,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Us.prototype,"algorithm",void 0),u([f({type:m.BitString})],Us.prototype,"publicKey",void 0);let nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0,optional:!0})],nr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Us,context:1,implicit:!0,optional:!0})],nr.prototype,"originatorKey",void 0),u([f({type:Cr,optional:!0})],nr.prototype,"issuerAndSerialNumber",void 0),nr=u([j({type:V.Choice})],nr);class Or{constructor(t={}){this.version=_t.v3,this.originator=new nr,this.keyEncryptionAlgorithm=new yt,this.recipientEncryptedKeys=new _n,Object.assign(this,t)}}u([f({type:m.Integer})],Or.prototype,"version",void 0),u([f({type:nr,context:0})],Or.prototype,"originator",void 0),u([f({type:le,context:1,optional:!0})],Or.prototype,"ukm",void 0),u([f({type:yt})],Or.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:_n})],Or.prototype,"recipientEncryptedKeys",void 0);let _r=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],_r.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],_r.prototype,"issuerAndSerialNumber",void 0),_r=u([j({type:V.Choice})],_r);class ui{constructor(t={}){this.version=_t.v0,this.rid=new _r,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],ui.prototype,"version",void 0),u([f({type:_r})],ui.prototype,"rid",void 0),u([f({type:yt})],ui.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],ui.prototype,"encryptedKey",void 0);class di{constructor(t={}){this.keyIdentifier=new le,Object.assign(this,t)}}u([f({type:le})],di.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],di.prototype,"date",void 0),u([f({type:En,optional:!0})],di.prototype,"other",void 0);class fi{constructor(t={}){this.version=_t.v4,this.kekid=new di,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:di})],fi.prototype,"kekid",void 0),u([f({type:yt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.version=_t.v0,this.keyEncryptionAlgorithm=new yt,this.encryptedKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],pi.prototype,"version",void 0),u([f({type:Ss,context:0,optional:!0})],pi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:yt})],pi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:le})],pi.prototype,"encryptedKey",void 0);class Ls{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ls.prototype,"oriType",void 0),u([f({type:m.Any})],Ls.prototype,"oriValue",void 0);let Rt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ui,optional:!0})],Rt.prototype,"ktri",void 0),u([f({type:Or,context:1,implicit:!0,optional:!0})],Rt.prototype,"kari",void 0),u([f({type:fi,context:2,implicit:!0,optional:!0})],Rt.prototype,"kekri",void 0),u([f({type:pi,context:3,implicit:!0,optional:!0})],Rt.prototype,"pwri",void 0),u([f({type:Ls,context:4,implicit:!0,optional:!0})],Rt.prototype,"ori",void 0),Rt=u([j({type:V.Choice})],Rt);var Hs;let Vn=Hs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Hs.prototype)}};Vn=Hs=u([j({type:V.Set,itemType:Rt})],Vn);var Fs;class Tn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Tn.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],Tn.prototype,"otherRevInfo",void 0);let hi=class{constructor(t={}){this.other=new Tn,Object.assign(this,t)}};u([f({type:Tn,context:1,implicit:!0})],hi.prototype,"other",void 0),hi=u([j({type:V.Choice})],hi);let qs=Fs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Fs.prototype)}};qs=Fs=u([j({type:V.Set,itemType:hi})],qs);class Ks{constructor(t={}){Object.assign(this,t)}}u([f({type:In,context:0,implicit:!0,optional:!0})],Ks.prototype,"certs",void 0),u([f({type:qs,context:1,implicit:!0,optional:!0})],Ks.prototype,"crls",void 0);var zs;let Gs=zs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Gs=zs=u([j({type:V.Set,itemType:xr})],Gs);class yi{constructor(t={}){this.version=_t.v0,this.recipientInfos=new Vn,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:m.Integer})],yi.prototype,"version",void 0),u([f({type:Ks,context:0,implicit:!0,optional:!0})],yi.prototype,"originatorInfo",void 0),u([f({type:Vn})],yi.prototype,"recipientInfos",void 0),u([f({type:ci})],yi.prototype,"encryptedContentInfo",void 0),u([f({type:Gs,context:1,implicit:!0,optional:!0})],yi.prototype,"unprotectedAttrs",void 0);const vh="1.2.840.113549.1.7.2";var Ws;let jn=Ws=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};jn=Ws=u([j({type:V.Set,itemType:oi})],jn);class Vr{constructor(t={}){this.version=_t.v0,this.digestAlgorithms=new jn,this.encapContentInfo=new Nn,this.signerInfos=new bn,Object.assign(this,t)}}u([f({type:m.Integer})],Vr.prototype,"version",void 0),u([f({type:jn})],Vr.prototype,"digestAlgorithms",void 0),u([f({type:Nn})],Vr.prototype,"encapContentInfo",void 0),u([f({type:In,context:0,implicit:!0,optional:!0})],Vr.prototype,"certificates",void 0),u([f({type:hi,context:1,implicit:!0,optional:!0})],Vr.prototype,"crls",void 0),u([f({type:bn})],Vr.prototype,"signerInfos",void 0);const gi="1.2.840.10045.2.1",Js="1.2.840.10045.4.1",Kc="1.2.840.10045.4.3.1",Ys="1.2.840.10045.4.3.2",Zs="1.2.840.10045.4.3.3",Qs="1.2.840.10045.4.3.4",zc="1.2.840.10045.3.1.7",Gc="1.3.132.0.34",Wc="1.3.132.0.35";function mi(e){return new F({algorithm:e})}const kh=mi(Js);mi(Kc);const Ch=mi(Ys),Sh=mi(Zs),xh=mi(Qs);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Tr.prototype,"namedCurve",void 0),Tr=u([j({type:V.Choice})],Tr);class Dn{constructor(t={}){this.version=1,this.privateKey=new le,Object.assign(this,t)}}u([f({type:m.Integer})],Dn.prototype,"version",void 0),u([f({type:le})],Dn.prototype,"privateKey",void 0),u([f({type:Tr,context:0,optional:!0})],Dn.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],Dn.prototype,"publicKey",void 0);class $n{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],$n.prototype,"r",void 0),u([f({type:m.Integer,converter:ye})],$n.prototype,"s",void 0);const Fe="1.2.840.113549.1.1",jr=`${Fe}.1`,Ah=`${Fe}.7`,Bh=`${Fe}.9`,Ih=`${Fe}.10`,Nh=`${Fe}.2`,Eh=`${Fe}.4`,Mn=`${Fe}.5`,Oh=`${Fe}.14`,Xs=`${Fe}.11`,Rn=`${Fe}.12`,Pn=`${Fe}.13`,Jc=`${Fe}.15`,Yc=`${Fe}.16`,Zc="1.3.14.3.2.26",Qc="2.16.840.1.101.3.4.2.4",Xc="2.16.840.1.101.3.4.2.1",eu="2.16.840.1.101.3.4.2.2",tu="2.16.840.1.101.3.4.2.3",_h="2.16.840.1.101.3.4.2.5",Vh="2.16.840.1.101.3.4.2.6",Th="1.2.840.113549.2.2",jh="1.2.840.113549.2.5",ea=`${Fe}.8`;function Ce(e){return new F({algorithm:e,parameters:null})}Ce(Th),Ce(jh);const or=Ce(Zc);Ce(Qc),Ce(Xc),Ce(eu),Ce(tu),Ce(_h),Ce(Vh);const ru=new F({algorithm:ea,parameters:z.serialize(or)}),iu=new F({algorithm:Bh,parameters:z.serialize(nn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ce(jr),Ce(Nh),Ce(Eh),Ce(Mn),Ce(Jc),Ce(Yc),Ce(Rn),Ce(Pn),Ce(Jc),Ce(Yc);class Un{constructor(t={}){this.hashAlgorithm=new F(or),this.maskGenAlgorithm=new F({algorithm:ea,parameters:z.serialize(or)}),this.pSourceAlgorithm=new F(iu),Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:or})],Un.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:ru})],Un.prototype,"maskGenAlgorithm",void 0),u([f({type:F,context:2,defaultValue:iu})],Un.prototype,"pSourceAlgorithm",void 0),new F({algorithm:Ah,parameters:z.serialize(new Un)});class bi{constructor(t={}){this.hashAlgorithm=new F(or),this.maskGenAlgorithm=new F({algorithm:ea,parameters:z.serialize(or)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:or})],bi.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:ru})],bi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],bi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],bi.prototype,"trailerField",void 0),new F({algorithm:Ih,parameters:z.serialize(new bi)});class Ln{constructor(t={}){this.digestAlgorithm=new F,this.digest=new le,Object.assign(this,t)}}u([f({type:F})],Ln.prototype,"digestAlgorithm",void 0),u([f({type:le})],Ln.prototype,"digest",void 0);var ta;class Hn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],Hn.prototype,"prime",void 0),u([f({type:m.Integer,converter:ye})],Hn.prototype,"exponent",void 0),u([f({type:m.Integer,converter:ye})],Hn.prototype,"coefficient",void 0);let ra=ta=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};ra=ta=u([j({type:V.Sequence,itemType:Hn})],ra);class mt{constructor(t={}){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,t)}}u([f({type:m.Integer})],mt.prototype,"version",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:ye})],mt.prototype,"coefficient",void 0),u([f({type:ra,optional:!0})],mt.prototype,"otherPrimeInfos",void 0);class ia{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:ye})],ia.prototype,"modulus",void 0),u([f({type:m.Integer,converter:ye})],ia.prototype,"publicExponent",void 0);var na;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(na||(na={}));const qe=na;/*! *****************************************************************************
|
|
76
76
|
Copyright (c) Microsoft Corporation.
|
|
77
77
|
|
|
78
78
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -114,7 +114,7 @@ ${t.join(`
|
|
|
114
114
|
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const n=[];let o=this.pad(r++),s="";const a=t[de.VALUE];a&&(s=` ${a}`),n.push(`${o}${t[de.NAME]}:${s}`),o=this.pad(r);for(const l in t){if(typeof l=="symbol")continue;const c=t[l],d=l?`${l}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")n.push(`${o}${d}${c}`);else if(c instanceof Date)n.push(`${o}${d}${c.toUTCString()}`);else if(Array.isArray(c))for(const y of c)y[de.NAME]=l,n.push(...this.serializeObj(y,r));else if(c instanceof de)c[de.NAME]=l,n.push(...this.serializeObj(c,r));else if(M.isBufferSource(c))l?(n.push(`${o}${d}`),n.push(...this.serializeBufferSource(c,r+1))):n.push(...this.serializeBufferSource(c,r));else if("toTextObject"in c){const y=c.toTextObject();y[de.NAME]=l,n.push(...this.serializeObj(y,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return n}static serializeBufferSource(t,r=0){const n=this.pad(r),o=M.toUint8Array(t),s=[];for(let a=0;a<o.length;){const l=[];for(let c=0;c<16&&a<o.length;c++){c===8&&l.push("");const d=o[a++].toString(16).padStart(2,"0");l.push(d)}s.push(`${n}${l.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}ar.oidSerializer=Pt,ar.algorithmSerializer=Qh;class Ut{constructor(...t){if(t.length===1){const r=t[0];this.rawData=z.serialize(r),this.onInit(r)}else{const r=z.parse(t[0],t[1]);this.rawData=M.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Ut?dl(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return z.toString(this.rawData);case"text":return ar.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const t=this.toTextObjectEmpty();return t[""]=this.rawData,t}toTextObjectEmpty(t){return new de(this.getTextName(),{},t)}}Ut.NAME="ASN";class bt extends Ut{constructor(...t){let r;M.isBufferSource(t[0])?r=M.toArrayBuffer(t[0]):r=z.serialize(new at({extnID:t[0],critical:t[1],extnValue:new le(M.toArrayBuffer(t[2]))})),super(r,at)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[de.NAME]===bt.NAME&&(t[de.NAME]=Pt.toString(this.type)),t}}var ud;class lr{static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&t.extractable!==void 0}constructor(){this.items=new Map,this[ud]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(lr.DEFAULT,crypto)}clear(){this.items.clear()}delete(t){return this.items.delete(t)}forEach(t,r){return this.items.forEach(t,r)}has(t){return this.items.has(t)}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(t=lr.DEFAULT){const r=this.items.get(t.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${t}'`);return r}set(t,r){if(typeof t=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(t.toLowerCase(),r)}else this.items.set(lr.DEFAULT,t);return this}}ud=Symbol.toStringTag,lr.DEFAULT="default";const Ye=new lr,Xh=/^[0-2](?:\.[1-9][0-9]*)+$/;function ey(e){return new RegExp(Xh).test(e)}class dd{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return ey(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const ze=new dd;ze.register("CN","2.5.4.3"),ze.register("L","2.5.4.7"),ze.register("ST","2.5.4.8"),ze.register("O","2.5.4.10"),ze.register("OU","2.5.4.11"),ze.register("C","2.5.4.6"),ze.register("DC","0.9.2342.19200300.100.1.25"),ze.register("E","1.2.840.113549.1.9.1"),ze.register("G","2.5.4.42"),ze.register("I","2.5.4.43"),ze.register("SN","2.5.4.4"),ze.register("T","2.5.4.12");function ty(e,t){return`\\${L.ToHex(L.FromUtf8String(t)).toUpperCase()}`}function ry(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,ty)}class Lt{static isASCII(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return!1;return!0}static isPrintableString(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(t)}constructor(t,r={}){this.extraNames=new dd,this.asn=new ke;for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)){const o=r[n];this.extraNames.register(n,o)}typeof t=="string"?this.asn=this.fromString(t):t instanceof ke?this.asn=t:M.isBufferSource(t)?this.asn=z.parse(t,ke):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||ze.findId(t),n=[];for(const o of this.asn)for(const s of o)s.type===r&&n.push(s.value.toString());return n}getName(t){return this.extraNames.get(t)||ze.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const n=this.getName(r.type)||r.type,o=r.value.anyValue?`#${L.ToHex(r.value.anyValue)}`:ry(r.value.toString());return`${n}=${o}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const n of this.asn){const o={};for(const s of n){const a=this.getName(s.type)||s.type;(t=o[a])!==null&&t!==void 0||(o[a]=[]),o[a].push(s.value.anyValue?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new ke,n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=n.exec(`${t},`);){let[,a,l]=o;const c=l[l.length-1];(c===","||c==="+")&&(l=l.slice(0,l.length-1),o[3]=c);const d=o[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const y=new ei({type:a});if(l.charAt(0)==="#")y.value.anyValue=L.FromHex(l.slice(1));else{const p=/"(.*?[^\\])?"/.exec(l);p&&(l=p[1]),l=l.replace(/\\0a/ig,`
|
|
115
115
|
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=l:Lt.isPrintableString(l)?y.value.printableString=l:y.value.utf8String=l}s==="+"?r[r.length-1].push(y):r.push(new mr([y])),s=d}return r}fromJSON(t){const r=new ke;for(const n of t){const o=new mr;for(const s in n){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const l=n[s];for(const c of l){const d=new ei({type:a});if(typeof c=="object")for(const y in c)switch(y){case"ia5String":d.value.ia5String=c[y];break;case"utf8String":d.value.utf8String=c[y];break;case"universalString":d.value.universalString=c[y];break;case"bmpString":d.value.bmpString=c[y];break;case"printableString":d.value.printableString=c[y];break}else c[0]==="#"?d.value.anyValue=L.FromHex(c.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=c:d.value.printableString=c;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return z.serialize(this.asn)}async getThumbprint(...t){var r;let n,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,n=t[1]||Ye.get()):n=t[0]||Ye.get(),await n.subtle.digest(o,this.toArrayBuffer())}}const fd="Cannot initialize GeneralName from ASN.1 data.",pd=`${fd} Unsupported string format in use.`,iy=`${fd} Value doesn't match to GUID regular expression.`,hd=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,yd="1.3.6.1.4.1.311.25.1",gd="1.3.6.1.4.1.311.20.2.3",Na="dns",Ea="dn",Oa="email",_a="ip",Va="url",Ta="guid",ja="upn",no="id";class md extends Ut{constructor(...t){let r;if(t.length===2)switch(t[0]){case Ea:{const n=new Lt(t[1]).toArrayBuffer(),o=z.parse(n,ke);r=new oe({directoryName:o});break}case Na:r=new oe({dNSName:t[1]});break;case Oa:r=new oe({rfc822Name:t[1]});break;case Ta:{const n=new RegExp(hd,"i").exec(t[1]);if(!n)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=n.slice(1).map((s,a)=>a<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");r=new oe({otherName:new ti({typeId:yd,value:z.serialize(new le(L.FromHex(o)))})});break}case _a:r=new oe({iPAddress:t[1]});break;case no:r=new oe({registeredID:t[1]});break;case ja:{r=new oe({otherName:new ti({typeId:gd,value:z.serialize(pc.toASN(t[1]))})});break}case Va:r=new oe({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else M.isBufferSource(t[0])?r=z.parse(t[0],oe):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=Na,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=Oa,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=_a,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=Va,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=no,this.value=t.registeredID;else if(t.directoryName!=null)this.type=Ea,this.value=new Lt(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===yd){this.type=Ta;const r=z.parse(t.otherName.value,le),n=new RegExp(hd,"i").exec(L.ToHex(r));if(!n)throw new Error(iy);this.value=n.slice(1).map((o,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===gd)this.type=ja,this.value=z.parse(t.otherName.value,Oe).toString();else throw new Error(pd);else throw new Error(pd)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case Ea:case Na:case Ta:case _a:case no:case ja:case Va:t=this.type.toUpperCase();break;case Oa:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===no&&(r=Pt.toString(r)),new de(t,void 0,r)}}class Si extends Ut{constructor(t){let r;if(t instanceof Re)r=t;else if(Array.isArray(t)){const n=[];for(const o of t)if(o instanceof oe)n.push(o);else{const s=z.parse(new md(o.type,o.value).rawData,oe);n.push(s)}r=new Re(n)}else if(M.isBufferSource(t))r=z.parse(t,Re);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const n of t){let o=null;try{o=new md(n)}catch{continue}r.push(o)}this.items=r}toJSON(){return this.items.map(t=>t.toJSON())}toTextObject(){const t=super.toTextObjectEmpty();for(const r of this.items){const n=r.toTextObject();let o=t[n[de.NAME]];Array.isArray(o)||(o=[],t[n[de.NAME]]=o),o.push(n)}return t}}Si.NAME="GeneralNames";const xi="-{5}",Ai="\\n",ny=`[^${Ai}]+`,oy=`${xi}BEGIN (${ny}(?=${xi}))${xi}`,sy=`${xi}END \\1${xi}`,Mr="\\n",ay=`[^:${Ai}]+`,ly=`(?:[^${Ai}]+${Mr}(?: +[^${Ai}]+${Mr})*)`,cy=`(?:[a-zA-Z0-9=+/]+${Mr})+`,bd=`${oy}${Mr}(?:((?:${ay}: ${ly})+))?${Mr}?(${cy})${sy}`;class Ze{static isPem(t){return typeof t=="string"&&new RegExp(bd,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(bd,"g"),n=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${Ai}]+`,"g"),""),a={type:o[1],headers:[],rawData:L.FromBase64(s)},l=o[2];if(l){const c=l.split(new RegExp(Mr,"g"));let d=null;for(const y of c){const[p,E]=y.split(/:(.*)/);if(E===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=p.trim()}else d&&a.headers.push(d),d={key:p,value:E.trim()}}d&&a.headers.push(d)}n.push(a)}return n}static decode(t){return this.decodeWithHeaders(t).map(n=>n.rawData)}static decodeFirst(t){const r=this.decode(t);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(t,r){if(Array.isArray(t)){const n=new Array;return r?t.forEach(o=>{if(!M.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");n.push(this.encodeStruct({type:r,rawData:M.toArrayBuffer(o)}))}):t.forEach(o=>{if(!("type"in o))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");n.push(this.encodeStruct(o))}),n.join(`
|
|
116
116
|
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:M.toArrayBuffer(t)})}}static encodeStruct(t){var r;const n=t.type.toLocaleUpperCase(),o=[];if(o.push(`-----BEGIN ${n}-----`),!((r=t.headers)===null||r===void 0)&&r.length){for(const d of t.headers)o.push(`${d.key}: ${d.value}`);o.push("")}const s=L.ToBase64(t.rawData);let a,l=0;const c=Array();for(;l<s.length&&(s.length-l<64?a=s.substring(l):(a=s.substring(l,l+64),l+=64),a.length!==0);)if(c.push(a),a.length<64)break;return o.push(...c),o.push(`-----END ${n}-----`),o.join(`
|
|
117
|
-
`)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class Vt extends Ut{static isAsnEncoded(t){return M.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Ze.isPem(r)?Ze.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):M.toArrayBuffer(t)}}constructor(...t){Vt.isAsnEncoded(t[0])?super(Vt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class cr extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Et):super(t),this.tag=Ze.PublicKeyTag}async export(...t){let r,n=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,n=t[1]||n,r=t[2]||Ye.get()):r=t[0]||Ye.get(),r.subtle.importKey("spki",this.rawData,o,!0,n)}onInit(t){const r=rt.resolve(ro),n=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case jr:{const o=z.parse(t.subjectPublicKey,ia),s=M.toUint8Array(o.modulus);n.publicExponent=M.toUint8Array(o.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let n,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,n=t[1]||Ye.get()):n=t[0]||Ye.get(),await n.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ye.get());const r=z.parse(this.rawData,Et);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,Et);switch(t.Algorithm=ar.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case gi:t["EC Point"]=r.subjectPublicKey;break;case jr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class wt{static register(t,r){this.items.set(t,r)}static create(t){const r=new bt(t),n=this.items.get(r.type);return n?new n(t):r}}wt.items=new Map;const oo="crypto.signatureFormatter";class uy{toAsnSignature(t,r){return M.toArrayBuffer(r)}toWebSignature(t,r){return M.toArrayBuffer(r)}}class so extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,kr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=z.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Lt(r.subject),this.subject=new Lt(r.subject).toString(),this.issuerName=new Lt(r.issuer),this.issuer=this.issuerName.toString();const n=rt.resolve(ro);this.signatureAlgorithm=n.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const o=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>wt.create(z.serialize(a)))),this.publicKey=new cr(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Ye.get()){let n,o;const s=t.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(n,["verify"],r);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(n,["verify"],r);else if(s instanceof cr)n={...s.algorithm,...this.signatureAlgorithm},o=await s.export(n,["verify"],r);else if(M.isBufferSource(s)){const d=new cr(s);n={...d.algorithm,...this.signatureAlgorithm},o=await d.export(n,["verify"],r)}else n={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=rt.resolveAll(oo).reverse();let l=null;for(const d of a)if(l=d.toWebSignature(n,this.signature),l)break;if(!l)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const c=await r.subtle.verify(this.signatureAlgorithm,o,l,this.tbs);if(t.signatureOnly)return c;{const y=(t.date||new Date).getTime();return c&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,n="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(n=t[0]||n,r=t[1])),r??(r=Ye.get()),await r.subtle.digest(n,this.rawData)}async isSelfSigned(t=Ye.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,kr),n=r.tbsCertificate,o=new de("",{Version:`${vr[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":ar.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new de("",{"Not Before":n.validity.notBefore.getTime(),"Not After":n.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(n.issuerUniqueID&&(o["Issuer Unique ID"]=n.issuerUniqueID),n.subjectUniqueID&&(o["Subject Unique ID"]=n.subjectUniqueID),this.extensions.length){const s=new de("");for(const a of this.extensions){const l=a.toTextObject();s[l[de.NAME]]=l}o.Extensions=s}return t.Data=o,t.Signature=new de("",{Algorithm:ar.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}so.NAME="Certificate";class Bi extends bt{static async create(t,r=!1,n=Ye.get()){if(t instanceof so||lr.isCryptoKey(t)){const o=t instanceof so?await t.publicKey.export(n):t,s=await n.subtle.exportKey("spki",o),l=await new cr(s).getKeyIdentifier(n);return new Bi(L.ToHex(l),r)}else return new Bi(t,r)}constructor(...t){if(M.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new er({keyIdentifier:new Qo(L.FromHex(t[0]))});super(Zo,t[1],z.serialize(r))}else{const r=t[0],n=r.name instanceof Si?z.parse(r.name.rawData,Re):r.name,o=new er({authorityCertIssuer:n,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Zo,t[1],z.serialize(o))}}onInit(t){super.onInit(t);const r=z.parse(t.extnValue,er);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,er);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Si(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Bi.NAME="Authority Key Identifier";class wd extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,sn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new sn({cA:t[0],pathLenConstraint:t[1]});super(vc,t[2],z.serialize(r)),this.ca=t[0],this.pathLength=t[1]}}toTextObject(){const t=this.toTextObjectWithoutValue();return this.ca&&(t.CA=this.ca),this.pathLength!==void 0&&(t["Path Length"]=this.pathLength),t}}wd.NAME="Basic Constraints";var vd;(function(e){e.serverAuth="1.3.6.1.5.5.7.3.1",e.clientAuth="1.3.6.1.5.5.7.3.2",e.codeSigning="1.3.6.1.5.5.7.3.3",e.emailProtection="1.3.6.1.5.5.7.3.4",e.timeStamping="1.3.6.1.5.5.7.3.8",e.ocspSigning="1.3.6.1.5.5.7.3.9"})(vd||(vd={}));class kd extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,dn);this.usages=r.map(n=>n)}else{const r=new dn(t[0]);super(Bc,t[1],z.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}kd.NAME="Extended Key Usages";var Da;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(Da||(Da={}));class $a extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,ps);this.usages=r.toNumber()}else{const r=new ps(t[0]);super(Nc,t[1],z.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,ps);return t[""]=r.toJSON().join(", "),t}}$a.NAME="Key Usages";class ao extends bt{static async create(t,r=!1,n=Ye.get()){let o;t instanceof cr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:M.isBufferSource(t)?o=t:o=await n.subtle.exportKey("spki",t);const a=await new cr(o).getKeyIdentifier(n);return new ao(L.ToHex(a),r)}constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,Mt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],n=new Mt(r);super(jc,t[1],z.serialize(n)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,Mt);return t[""]=r,t}}ao.NAME="Subject Key Identifier";class Ma extends bt{constructor(...t){M.isBufferSource(t[0])?super(t[0]):super(Vc,t[1],new Si(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=z.parse(t.extnValue,bs);this.names=new Si(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const n in r)t[n]=r[n];return t}}Ma.NAME="Subject Alternative Name";class Cd extends bt{constructor(...t){var r;if(M.isBufferSource(t[0])){super(t[0]);const n=z.parse(this.value,cn);this.policies=n.map(o=>o.policyIdentifier)}else{const n=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new cn(n.map(a=>new ln({policyIdentifier:a})));super(Cc,o,z.serialize(s)),this.policies=n}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new de("",{},Pt.toString(r))),t}}Cd.NAME="Certificate Policies",wt.register(Cc,Cd);class Rr extends Ut{constructor(...t){let r;if(M.isBufferSource(t[0]))r=M.toArrayBuffer(t[0]);else{const n=t[0],o=Array.isArray(t[1])?t[1].map(s=>M.toArrayBuffer(s)):[];r=z.serialize(new Nt({type:n,values:o}))}super(r,Nt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new de("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[de.NAME]===Rr.NAME&&(t[de.NAME]=Pt.toString(this.type)),t}}Rr.NAME="Attribute";class Sd extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=new Xn({printableString:t[0]});super(vu,[z.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=z.parse(this.values[0],Xn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[de.VALUE]=this.password,t}}Sd.NAME="Challenge Password";class Ra extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=t[0],o=new tr;for(const s of n)o.push(z.parse(s.rawData,at));super(wa,[z.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=z.parse(this.values[0],tr);this.items=r.map(n=>wt.create(z.serialize(n)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(n=>n.toTextObject());for(const n of r)t[n[de.NAME]]=n;return t}}Ra.NAME="Extensions";class lo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Rr(t),n=this.items.get(r.type);return n?new n(t):r}}lo.items=new Map;let Pa=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new F({algorithm:Mn,parameters:null});case"sha-256":return new F({algorithm:Xs,parameters:null});case"sha-384":return new F({algorithm:Rn,parameters:null});case"sha-512":return new F({algorithm:Pn,parameters:null})}}else return new F({algorithm:jr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case jr:return{name:"RSASSA-PKCS1-v1_5"};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Xs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Rn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Pn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Pa=u([ca()],Pa),rt.registerSingleton(to,Pa);class it{addPadding(t,r){const n=M.toUint8Array(r),o=new Uint8Array(t);return o.set(n,t-n.length),o}removePadding(t,r=!1){let n=M.toUint8Array(t);for(let o=0;o<n.length;o++)if(n[o]){n=n.slice(o);break}if(r&&n[0]>127){const o=new Uint8Array(n.length+1);return o.set(n,1),o.buffer}return n.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const n=t.namedCurve,o=it.namedCurveSize.get(n)||it.defaultNamedCurveSize,s=new $n,a=M.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),z.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const n=z.parse(r,$n),o=t.namedCurve,s=it.namedCurveSize.get(o)||it.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(n.r)),l=this.addPadding(s,this.removePadding(n.s));return Bp(a,l)}return null}}it.namedCurveSize=new Map,it.defaultNamedCurveSize=32;const xd="1.3.101.110",Ad="1.3.101.111",Bd="1.3.101.112",Id="1.3.101.113";let Ua=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Bd;break;case"ed448":r=Id;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=xd;break;case"x448":r=Ad;break}}return r?new F({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Bd:return{name:"EdDSA",namedCurve:"Ed25519"};case Id:return{name:"EdDSA",namedCurve:"Ed448"};case xd:return{name:"ECDH-ES",namedCurve:"X25519"};case Ad:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ua=u([ca()],Ua),rt.registerSingleton(to,Ua);class dy extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,ki):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=z.serialize(t.certificationRequestInfo),this.publicKey=new cr(t.certificationRequestInfo.subjectPKInfo);const r=rt.resolve(ro);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>lo.create(z.serialize(o)));const n=this.getAttribute(wa);this.extensions=[],n instanceof Ra&&(this.extensions=n.items),this.subjectName=new Lt(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Ye.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(r,["verify"],t),o=rt.resolveAll(oo).reverse();let s=null;for(const l of o)if(s=l.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,n,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,ki),n=r.certificationRequestInfo,o=new de("",{Version:`${vr[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new de("");for(const a of this.attributes){const l=a.toTextObject();s[l[de.NAME]]=l}o.Attributes=s}return t.Data=o,t.Signature=new de("",{Algorithm:ar.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}dy.NAME="PKCS#10 Certificate Request";var Nd;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(Nd||(Nd={})),wt.register(vc,wd),wt.register(Bc,kd),wt.register(Nc,$a),wt.register(jc,ao),wt.register(Zo,Bi),wt.register(Vc,Ma),lo.register(vu,Sd),lo.register(wa,Ra),rt.registerSingleton(oo,uy),rt.registerSingleton(oo,it),it.namedCurveSize.set("P-256",32),it.namedCurveSize.set("K-256",32),it.namedCurveSize.set("P-384",48),it.namedCurveSize.set("P-521",66);function Ed(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new so(t),n={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ma){const s=o.names.toJSON(),l=Object.entries(s).map(c=>({type:c[1].type,value:c[1].value})).reduce((c,d)=>{const y=d.type,p=c[y]??[];return{...c,[y]:[...p,d.value]}},{});for(const c in l)n.subjectAltName=`${c}=${l[c].join(", ")}`}else if(o instanceof $a){const s=Object.values(Da),a=Array(s.length/2).fill(null).reduce((l,c,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];l.push(p)}return l},[]);n.keyUsage=a}return n}}}function fy(){const e=Ed(),t=i.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(o);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 py={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function hy(){const e=$i.createI18n("en-us",py);return{i18n:e,i18nT:$i.i18nTComponent(e)}}const ct={useCertificate:fy,useI18n:hy,useX509:Ed},co="/v2/control-planes/{controlPlaneId}/core-entities",uo="/{workspace}",Ii={list:{konnect:`${co}/certificates`,kongManager:`${uo}/certificates`},form:{konnect:{create:`${co}/certificates`,edit:`${co}/certificates/{id}`,validate:`${co}/v1/schemas/json/certificate/validate`},kongManager:{create:`${uo}/certificates`,edit:`${uo}/certificates/{id}`,validate:`${uo}/schemas/certificates/validate`}}};var La=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e.Secret="secret",e))(La||{}),Ht=(e=>(e.Edit="edit",e.Create="create",e))(Ht||{}),Ft=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ft||{}),ce=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ce||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function yy(){return{getAxiosInstance:(e={})=>{try{const t=i.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):al.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),al.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function gy(){return{debounce:(e,t)=>{let r;return(...n)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...n)},t)}}}}const Ha="khcp-user-table-preferences",my={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function by(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},t=()=>{const r=e(localStorage.getItem(Ha));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,n)=>{try{const o=t();o.set(r,n),localStorage.setItem(Ha,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const n=t();return(n==null?void 0:n.get(r))||void 0||my},deleteAllTablePreferences:()=>{localStorage.removeItem(Ha)}}}function Fa(e={}){const{getAxiosInstance:t}=yy();return{axiosInstance:t(e)}}const wy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},vy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ky={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Cy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Sy={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},xy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Ay={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},By={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Iy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Ny={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ey={global:wy,deleteModal:vy,baseForm:ky,baseTable:Cy,baseConfigCard:Sy,filter:xy,debouncedFilter:Ay,errors:By,validationErrors:Iy,toggleModal:Ny};function fo(){const e=$i.createI18n("en-us",Ey);return{i18n:e,i18nT:$i.i18nTComponent(e)}}function Od(){const e=(r,n)=>(n==null?void 0:n[r])??void 0,t=(r,n)=>{if(r.length!==n.length)return!1;const o=new Set([...r,...n]);for(const s of o){const a=r.filter(c=>c===s).length,l=n.filter(c=>c===s).length;if(a!==l)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,n,o)=>{if(o){if(Object.keys(r).length===Object.keys(n).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(n[s])){if(t(r[s],n[s]))continue;return!1}else{if(r[s]===n[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(n)}catch{return!1}},sortAlpha:r=>(n,o)=>{let s=n[r]===void 0||n[r]===null?"":n[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(n[r])&&(s=n[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function Oy(e,t,r,n={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=Fa(e.axiosRequestConfig),{i18n:{t:s}}=fo(),{debounce:a}=gy(),l=a(async C=>{await B(C)},200),c=i.ref(!1),d=i.ref(""),y=i.ref(""),p=i.ref([]),E=i.ref([]),w=i.ref(void 0),h=i.computed(()=>{const C=`${e.apiBaseUrl}${i.unref(t)}`;return e.app==="konnect"?C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):C}),{isValidUuid:g}=Od(),b=async()=>{try{c.value=!0;const{data:C}=await o.get(`${h.value}?size=${r}`);C!=null&&C.next||(w.value=n.fetchedItemsKey in C?C[n.fetchedItemsKey]:[]),E.value=n.fetchedItemsKey in C?C[n.fetchedItemsKey]:[],p.value=E.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},v=i.ref(""),B=async C=>{var S,T,N;if(v.value!==C){if(C===""){p.value=E.value;return}else v.value=C||"";if(w.value===void 0)try{if(c.value=!0,d.value="",y.value="",e.app==="konnect"){let I=h.value+"";C&&(I+=`/${C}`);const{data:x}=await o.get(`${I}?size=${r}`);n.fetchedItemsKey in x?p.value=x[n.fetchedItemsKey]:x!=null&&x[n.exactMatchKey??"id"]?p.value=[x]:p.value=[]}else if(C){const I=[];g(C)&&n.searchKeys.includes("id")?I.push((async()=>{const{data:G}=await o.get(`${h.value}/${C}`);return[G[n.fetchedItemsKey]??G]})()):I.push(...n.searchKeys.filter(G=>G!=="id").map(async G=>{const{data:R}=await o.get(`${h.value}?${G}=${C}`);return R[n.fetchedItemsKey]}));const x=await Promise.all(I),O=new Set;p.value=[],(S=x==null?void 0:x.forEach)==null||S.call(x,G=>{var R;(R=G==null?void 0:G.forEach)==null||R.call(G,J=>{O.has(J.id)||(O.add(J.id),p.value.push(J))})})}else p.value=E.value}catch(I){((T=I==null?void 0:I.response)==null?void 0:T.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,y.value="",C?(p.value=(N=w.value)==null?void 0:N.filter(I=>{var x;let O=!1;for(const G of n.searchKeys){const R=typeof I[G]=="string"?(x=I[G])==null?void 0:x.toLowerCase():I[G];R!=null&&R.includes(C.toLowerCase())&&(O=!0)}return O}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,c.value=!1}};return{loading:c,error:d,validationError:y,results:p,allRecords:w,loadItems:b,debouncedQueryChange:l}}function _y(e,t){const r=i.unref(t),n=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return n.value.search="",o=>`${n.value.href}/${o}`}function Vy(){const{i18n:{t:e}}=fo();return{getMessageFromError:t=>{var r,n,o,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((n=t==null?void 0:t.response)!=null&&n.data){if(t.response.data.detail)return t.response.data.detail;if((o=t.response.data.details)!=null&&o.length)return t.response.data.details.map(a=>{let l=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(l=a.messages.join(", ")),a.field?`${a.field} - ${l}`:l}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Ty(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const n=e.join("/"),o=`${r}${n}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${r}${n}`;throw new Error("Invalid url")}catch(n){return console.warn("Failed to build valid URL:",n),""}}function _d(e,t){const r=i.ref(i.unref(e)),n=i.ref(i.unref(t)),o=i.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=i.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return a=>{const{page:l,pageSize:c,offset:d,sortColumnKey:y,sortColumnOrder:p,query:E}=a;try{let w=new URL(s.value.href);return o.value&&E?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${E}/`):new URL(`${w.href}?filter[name][contains]=${E}`)):(o.value||new URLSearchParams(E).forEach((h,g)=>{w.searchParams.append(g,h)}),y&&w.searchParams.append("sort_by",y),p==="desc"&&w.searchParams.append("sort_desc","1"),w.searchParams.append("size",String(c))),d&&l!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),n.value}}}function jy(e,t,r="data"){const n=i.unref(t),{axiosInstance:o}=Fa(e.axiosRequestConfig),s=_d(e,n),a=i.ref({status:Ft.Idle});return{fetcher:async l=>{var c;try{a.value={status:Ft.Loading};let d=s(l);d.includes("filter[name]")&&(d=`${d}&page[size]=${l.pageSize}&page[number]=${l.page}`);const y=await o.get(d);if(y.status>=400)throw y;const p=y.data,E=r&&r.replace(/[^\w-_]/gi,"");let w;p[E]&&Array.isArray(p[E])?w=p[E]:Array.isArray(p)?w=p:w=Object.keys(p).length?[p]:[];const h={data:w,total:w.length,...p.offset?{pagination:{offset:p.offset}}:null};return a.value={status:Ft.Idle,response:h},h}catch(d){const y={data:[],total:0};return l.query&&(((c=d.response)==null?void 0:c.status)===404||d.status===404)?(a.value={status:Ft.NoResults,response:y,error:d.response?d:{response:d}},y):(a.value={status:Ft.Error,response:y,error:d.response?d:{response:d}},y)}},fetcherState:a}}function Dy(){const e=(r,n="_")=>r?r.split(n).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,n=>n.toUpperCase()):"",convertKeyToTitle:e}}const Vd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Td=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Vd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},jd=e=>e==="*"||e==="x"||e==="X",Dd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},$y=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],My=(e,t)=>{if(jd(e)||jd(t))return 0;const[r,n]=$y(Dd(e),Dd(t));return r>n?1:r<n?-1:0},$d=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=My(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0},Ry=(e,t)=>{const r=Td(e),n=Td(t),o=r.pop(),s=n.pop(),a=$d(r,n);return a!==0?a:o&&s?$d(o.split("."),s.split(".")):o||s?o?-1:1:0},Md=(e,t,r)=>{Py(r);const n=Ry(e,t);return Rd[r].includes(n)},Rd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Pd=Object.keys(Rd),Py=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Pd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Pd.join("|")}`)},Uy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Vd.test(e);function Ly(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:n,version:o}=t;if(!Uy(o))return console.error("Invalid version"),!1;const s=r[n];if(!s)return!1;const[a,l]=s;return!(a&&Md(o,a,"<")||l&&Md(o,l,">"))}function Hy(e){const t=i.ref(0),r=i.ref(0),n=i.ref(!1);return i.watch(e,o=>{o&&!n.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,n.value=!0)}),{isTruncated:i.computed(()=>t.value<r.value)}}function Fy(){const{i18n:{t:e}}=fo();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Ie={useAxios:Fa,useDebouncedFilter:Oy,useDeleteUrlBuilder:_y,useErrors:Vy,useExternalLinkCreator:Ty,useFetcher:jy,useFetchUrlBuilder:_d,useHelpers:Od,useStringHelpers:Dy,useI18n:fo,useGatewayFeatureSupported:Ly,useTruncationDetector:Hy,useValidators:Fy},qy={key:0,class:"config-card-fieldset-title"},Ky=i.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Ie.useI18n(),{convertKeyToTitle:n}=Ie.useStringHelpers(),o=i.computed(()=>t.item.key??"json-array-item"),s=i.computed(()=>t.item.value??t.item),a=i.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete c.name,c}),l=i.computed(()=>{var c;return t.isArrayItem?(c=s.value)!=null&&c.name?n(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(c,d)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:i.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:i.withCtx(()=>[e.isArrayItem?(i.openBlock(),i.createElementBlock("legend",qy,[i.createElementVNode("b",null,i.toDisplayString(l.value),1)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(a.value),(y,p)=>(i.openBlock(),i.createBlock(po,{key:`${o.value}-property-${p}`,item:{key:y,label:i.unref(n)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ut=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},Ud=ut(Ky,[["__scopeId","data-v-68ca83ec"]]),zy=i.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ie.useI18n();return(r,n)=>{const o=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:n[0]||(n[0]=s=>r.$emit("navigation-click",e.item))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.value||i.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Gy=ut(zy,[["__scopeId","data-v-c96811e5"]]),Wy=i.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ie.useI18n();return(r,n)=>{const o=i.resolveComponent("KBadge");return i.openBlock(),i.createBlock(o,{appearance:e.status?"success":"neutral"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.status?i.unref(t)("baseConfigCard.statusBadge.enabledLabel"):i.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Jy="#0044f4",Yy="#e0e4ea",Zy="#afb7c5",Qy="1px",Xy="20px",eg={class:"config-card-details-row"},tg=["data-testid"],rg=["data-testid"],ig=["data-testid"],ng=["data-testid"],og={key:1},sg=["data-testid"],ag=["data-testid"],lg=["data-testid"],cg=["data-testid"],ug={name:"ConfigCardItem",components:{JsonCardItem:Ud,StatusBadge:Wy,InternalLinkItem:Gy}},dg=i.defineComponent({...ug,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){i.useCssVars(h=>({"2f5b0492":y.value?"none":`solid ${i.unref(Qy)} ${i.unref(Yy)}`,"5d59c22c":d.value&&l.value?"block":"flex",aa41a894:d.value&&l.value?"100%":r.slim?"50%":"25%",aa3d1cde:d.value&&l.value?"100%":r.slim?"50%":"75%"}));const r=e,n=t,o=i.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Ie.useI18n(),l=i.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=i.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=i.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=i.computed(()=>r.item.type===ce.JsonArray),p=i.computed(()=>{switch(r.item.type){case ce.ID:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case ce.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ce.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ce.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:r.item.value}};case ce.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{n("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),E=i.ref(),{isTruncated:w}=Ie.useTruncationDetector(E);return(h,g)=>{const b=i.resolveComponent("KLabel"),v=i.resolveComponent("KBadge"),B=i.resolveComponent("KCopy"),C=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("div",eg,[i.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[i.renderSlot(h.$slots,"label",{item:e.item},()=>[i.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:i.withCtx(()=>[i.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[i.renderSlot(h.$slots,"label-tooltip",{},()=>[i.createTextVNode(i.toDisplayString(e.item.tooltip),1)],!0)],8,rg)]),key:"0"}:void 0]),1024)],!0)],8,tg),i.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[i.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[l.value?(i.openBlock(),i.createElementBlock("div",og,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(p.value.tag),i.normalizeProps(i.guardReactiveProps(p.value.attrs)),{default:i.withCtx(()=>[p.value.additionalComponent==="KBadge"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(S,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-tag-${T}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${T}`,tooltip:S,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,sg)):i.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(S,T)=>(i.openBlock(),i.createBlock(B,i.mergeProps({ref_for:!0},p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${T}`,"data-testid":`${e.item.key}-copy-uuid-${T}`,text:S}),null,16,["data-testid","text"]))),128))],8,ag)):p.value.additionalComponent==="KMethodBadge"?(i.openBlock(),i.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(S,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-method-${T}`,appearance:Object.values(i.unref(fp.BadgeMethodAppearances)).includes(S.toLowerCase())?S.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${T}`},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,lg)):i.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(i.openBlock(),i.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(S,T)=>(i.openBlock(),i.createBlock(Ud,{key:`json-array-item-${T}`,index:T,"is-array-item":"",item:S},null,8,["index","item"]))),128))],8,cg)):(i.openBlock(),i.createBlock(C,{key:4,text:i.unref(w)?e.item.value:""},{default:i.withCtx(()=>[i.createElementVNode("span",{ref_key:"textContent",ref:E,class:i.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},i.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,ng))],!0)],8,ig)])}}}),po=ut(dg,[["__scopeId","data-v-711ebcf2"]]),fg={class:"json-config"},pg={key:0,class:"json-endpoint"},Ld=i.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){i.useCssVars(o=>({"7a485cf8":`${n.value}ch`}));const t=e,r=i.computed(()=>t.jsonRecord),n=i.computed(()=>{var o;if(!t.fetcherUrl)return 0;const s=(o=t.fetcherUrl)==null?void 0:o.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(o,s)=>{const a=i.resolveComponent("KBadge"),l=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",fg,[t.fetcherUrl?(i.openBlock(),i.createElementBlock("div",pg,[i.createVNode(a,{appearance:t.requestMethod},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),i.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):i.createCommentVNode("",!0),t.jsonRecord?(i.openBlock(),i.createBlock(l,{key:1,id:"json-codeblock",class:i.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):i.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Hd(e){return typeof e>"u"||e===null}function hg(e){return typeof e=="object"&&e!==null}function yg(e){return Array.isArray(e)?e:Hd(e)?[]:[e]}function gg(e,t){var r,n,o,s;if(t)for(s=Object.keys(t),r=0,n=s.length;r<n;r+=1)o=s[r],e[o]=t[o];return e}function mg(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function bg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var wg=Hd,vg=hg,kg=yg,Cg=mg,Sg=bg,xg=gg,Se={isNothing:wg,isObject:vg,toArray:kg,repeat:Cg,isNegativeZero:Sg,extend:xg};function Fd(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
117
|
+
`)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class Vt extends Ut{static isAsnEncoded(t){return M.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Ze.isPem(r)?Ze.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):M.toArrayBuffer(t)}}constructor(...t){Vt.isAsnEncoded(t[0])?super(Vt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class cr extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Et):super(t),this.tag=Ze.PublicKeyTag}async export(...t){let r,n=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,n=t[1]||n,r=t[2]||Ye.get()):r=t[0]||Ye.get(),r.subtle.importKey("spki",this.rawData,o,!0,n)}onInit(t){const r=rt.resolve(ro),n=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case jr:{const o=z.parse(t.subjectPublicKey,ia),s=M.toUint8Array(o.modulus);n.publicExponent=M.toUint8Array(o.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let n,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,n=t[1]||Ye.get()):n=t[0]||Ye.get(),await n.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ye.get());const r=z.parse(this.rawData,Et);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,Et);switch(t.Algorithm=ar.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case gi:t["EC Point"]=r.subjectPublicKey;break;case jr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class wt{static register(t,r){this.items.set(t,r)}static create(t){const r=new bt(t),n=this.items.get(r.type);return n?new n(t):r}}wt.items=new Map;const oo="crypto.signatureFormatter";class uy{toAsnSignature(t,r){return M.toArrayBuffer(r)}toWebSignature(t,r){return M.toArrayBuffer(r)}}class so extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,kr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=z.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Lt(r.subject),this.subject=new Lt(r.subject).toString(),this.issuerName=new Lt(r.issuer),this.issuer=this.issuerName.toString();const n=rt.resolve(ro);this.signatureAlgorithm=n.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const o=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>wt.create(z.serialize(a)))),this.publicKey=new cr(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Ye.get()){let n,o;const s=t.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(n,["verify"],r);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(n,["verify"],r);else if(s instanceof cr)n={...s.algorithm,...this.signatureAlgorithm},o=await s.export(n,["verify"],r);else if(M.isBufferSource(s)){const d=new cr(s);n={...d.algorithm,...this.signatureAlgorithm},o=await d.export(n,["verify"],r)}else n={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=rt.resolveAll(oo).reverse();let l=null;for(const d of a)if(l=d.toWebSignature(n,this.signature),l)break;if(!l)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const c=await r.subtle.verify(this.signatureAlgorithm,o,l,this.tbs);if(t.signatureOnly)return c;{const y=(t.date||new Date).getTime();return c&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,n="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(n=t[0]||n,r=t[1])),r??(r=Ye.get()),await r.subtle.digest(n,this.rawData)}async isSelfSigned(t=Ye.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,kr),n=r.tbsCertificate,o=new de("",{Version:`${vr[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":ar.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new de("",{"Not Before":n.validity.notBefore.getTime(),"Not After":n.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(n.issuerUniqueID&&(o["Issuer Unique ID"]=n.issuerUniqueID),n.subjectUniqueID&&(o["Subject Unique ID"]=n.subjectUniqueID),this.extensions.length){const s=new de("");for(const a of this.extensions){const l=a.toTextObject();s[l[de.NAME]]=l}o.Extensions=s}return t.Data=o,t.Signature=new de("",{Algorithm:ar.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}so.NAME="Certificate";class Bi extends bt{static async create(t,r=!1,n=Ye.get()){if(t instanceof so||lr.isCryptoKey(t)){const o=t instanceof so?await t.publicKey.export(n):t,s=await n.subtle.exportKey("spki",o),l=await new cr(s).getKeyIdentifier(n);return new Bi(L.ToHex(l),r)}else return new Bi(t,r)}constructor(...t){if(M.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new er({keyIdentifier:new Qo(L.FromHex(t[0]))});super(Zo,t[1],z.serialize(r))}else{const r=t[0],n=r.name instanceof Si?z.parse(r.name.rawData,Re):r.name,o=new er({authorityCertIssuer:n,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Zo,t[1],z.serialize(o))}}onInit(t){super.onInit(t);const r=z.parse(t.extnValue,er);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,er);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Si(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Bi.NAME="Authority Key Identifier";class wd extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,sn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new sn({cA:t[0],pathLenConstraint:t[1]});super(vc,t[2],z.serialize(r)),this.ca=t[0],this.pathLength=t[1]}}toTextObject(){const t=this.toTextObjectWithoutValue();return this.ca&&(t.CA=this.ca),this.pathLength!==void 0&&(t["Path Length"]=this.pathLength),t}}wd.NAME="Basic Constraints";var vd;(function(e){e.serverAuth="1.3.6.1.5.5.7.3.1",e.clientAuth="1.3.6.1.5.5.7.3.2",e.codeSigning="1.3.6.1.5.5.7.3.3",e.emailProtection="1.3.6.1.5.5.7.3.4",e.timeStamping="1.3.6.1.5.5.7.3.8",e.ocspSigning="1.3.6.1.5.5.7.3.9"})(vd||(vd={}));class kd extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,dn);this.usages=r.map(n=>n)}else{const r=new dn(t[0]);super(Bc,t[1],z.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}kd.NAME="Extended Key Usages";var Da;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(Da||(Da={}));class $a extends bt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,ps);this.usages=r.toNumber()}else{const r=new ps(t[0]);super(Nc,t[1],z.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,ps);return t[""]=r.toJSON().join(", "),t}}$a.NAME="Key Usages";class ao extends bt{static async create(t,r=!1,n=Ye.get()){let o;t instanceof cr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:M.isBufferSource(t)?o=t:o=await n.subtle.exportKey("spki",t);const a=await new cr(o).getKeyIdentifier(n);return new ao(L.ToHex(a),r)}constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=z.parse(this.value,Mt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],n=new Mt(r);super(jc,t[1],z.serialize(n)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=z.parse(this.value,Mt);return t[""]=r,t}}ao.NAME="Subject Key Identifier";class Ma extends bt{constructor(...t){M.isBufferSource(t[0])?super(t[0]):super(Vc,t[1],new Si(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=z.parse(t.extnValue,bs);this.names=new Si(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const n in r)t[n]=r[n];return t}}Ma.NAME="Subject Alternative Name";class Cd extends bt{constructor(...t){var r;if(M.isBufferSource(t[0])){super(t[0]);const n=z.parse(this.value,cn);this.policies=n.map(o=>o.policyIdentifier)}else{const n=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new cn(n.map(a=>new ln({policyIdentifier:a})));super(Cc,o,z.serialize(s)),this.policies=n}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new de("",{},Pt.toString(r))),t}}Cd.NAME="Certificate Policies",wt.register(Cc,Cd);class Rr extends Ut{constructor(...t){let r;if(M.isBufferSource(t[0]))r=M.toArrayBuffer(t[0]);else{const n=t[0],o=Array.isArray(t[1])?t[1].map(s=>M.toArrayBuffer(s)):[];r=z.serialize(new Nt({type:n,values:o}))}super(r,Nt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new de("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[de.NAME]===Rr.NAME&&(t[de.NAME]=Pt.toString(this.type)),t}}Rr.NAME="Attribute";class Sd extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=new Xn({printableString:t[0]});super(vu,[z.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=z.parse(this.values[0],Xn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[de.VALUE]=this.password,t}}Sd.NAME="Challenge Password";class Ra extends Rr{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=t[0],o=new tr;for(const s of n)o.push(z.parse(s.rawData,at));super(wa,[z.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=z.parse(this.values[0],tr);this.items=r.map(n=>wt.create(z.serialize(n)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(n=>n.toTextObject());for(const n of r)t[n[de.NAME]]=n;return t}}Ra.NAME="Extensions";class lo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Rr(t),n=this.items.get(r.type);return n?new n(t):r}}lo.items=new Map;let Pa=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new F({algorithm:Mn,parameters:null});case"sha-256":return new F({algorithm:Xs,parameters:null});case"sha-384":return new F({algorithm:Rn,parameters:null});case"sha-512":return new F({algorithm:Pn,parameters:null})}}else return new F({algorithm:jr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case jr:return{name:"RSASSA-PKCS1-v1_5"};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Xs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Rn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Pn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Pa=u([ca()],Pa),rt.registerSingleton(to,Pa);class it{addPadding(t,r){const n=M.toUint8Array(r),o=new Uint8Array(t);return o.set(n,t-n.length),o}removePadding(t,r=!1){let n=M.toUint8Array(t);for(let o=0;o<n.length;o++)if(n[o]){n=n.slice(o);break}if(r&&n[0]>127){const o=new Uint8Array(n.length+1);return o.set(n,1),o.buffer}return n.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const n=t.namedCurve,o=it.namedCurveSize.get(n)||it.defaultNamedCurveSize,s=new $n,a=M.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),z.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const n=z.parse(r,$n),o=t.namedCurve,s=it.namedCurveSize.get(o)||it.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(n.r)),l=this.addPadding(s,this.removePadding(n.s));return Bp(a,l)}return null}}it.namedCurveSize=new Map,it.defaultNamedCurveSize=32;const xd="1.3.101.110",Ad="1.3.101.111",Bd="1.3.101.112",Id="1.3.101.113";let Ua=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Bd;break;case"ed448":r=Id;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=xd;break;case"x448":r=Ad;break}}return r?new F({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Bd:return{name:"EdDSA",namedCurve:"Ed25519"};case Id:return{name:"EdDSA",namedCurve:"Ed448"};case xd:return{name:"ECDH-ES",namedCurve:"X25519"};case Ad:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ua=u([ca()],Ua),rt.registerSingleton(to,Ua);class dy extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,ki):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=z.serialize(t.certificationRequestInfo),this.publicKey=new cr(t.certificationRequestInfo.subjectPKInfo);const r=rt.resolve(ro);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>lo.create(z.serialize(o)));const n=this.getAttribute(wa);this.extensions=[],n instanceof Ra&&(this.extensions=n.items),this.subjectName=new Lt(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Ye.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(r,["verify"],t),o=rt.resolveAll(oo).reverse();let s=null;for(const l of o)if(s=l.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,n,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=z.parse(this.rawData,ki),n=r.certificationRequestInfo,o=new de("",{Version:`${vr[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new de("");for(const a of this.attributes){const l=a.toTextObject();s[l[de.NAME]]=l}o.Attributes=s}return t.Data=o,t.Signature=new de("",{Algorithm:ar.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}dy.NAME="PKCS#10 Certificate Request";var Nd;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(Nd||(Nd={})),wt.register(vc,wd),wt.register(Bc,kd),wt.register(Nc,$a),wt.register(jc,ao),wt.register(Zo,Bi),wt.register(Vc,Ma),lo.register(vu,Sd),lo.register(wa,Ra),rt.registerSingleton(oo,uy),rt.registerSingleton(oo,it),it.namedCurveSize.set("P-256",32),it.namedCurveSize.set("K-256",32),it.namedCurveSize.set("P-384",48),it.namedCurveSize.set("P-521",66);function Ed(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new so(t),n={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ma){const s=o.names.toJSON(),l=Object.entries(s).map(c=>({type:c[1].type,value:c[1].value})).reduce((c,d)=>{const y=d.type,p=c[y]??[];return{...c,[y]:[...p,d.value]}},{});for(const c in l)n.subjectAltName=`${c}=${l[c].join(", ")}`}else if(o instanceof $a){const s=Object.values(Da),a=Array(s.length/2).fill(null).reduce((l,c,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];l.push(p)}return l},[]);n.keyUsage=a}return n}}}function fy(){const e=Ed(),t=i.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(o);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 py={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function hy(){const e=$i.createI18n("en-us",py);return{i18n:e,i18nT:$i.i18nTComponent(e)}}const ct={useCertificate:fy,useI18n:hy,useX509:Ed},co="/v2/control-planes/{controlPlaneId}/core-entities",uo="/{workspace}",Ii={list:{konnect:`${co}/certificates`,kongManager:`${uo}/certificates`},form:{konnect:{create:`${co}/certificates`,edit:`${co}/certificates/{id}`,validate:`${co}/v1/schemas/json/certificate/validate`},kongManager:{create:`${uo}/certificates`,edit:`${uo}/certificates/{id}`,validate:`${uo}/schemas/certificates/validate`}}};var La=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e.Secret="secret",e))(La||{}),Ht=(e=>(e.Edit="edit",e.Create="create",e))(Ht||{}),Ft=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ft||{}),ce=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ce||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function yy(){return{getAxiosInstance:(e={})=>{try{const t=i.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):al.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),al.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function gy(){return{debounce:(e,t)=>{let r;return(...n)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...n)},t)}}}}const Ha="khcp-user-table-preferences",my={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function by(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},t=()=>{const r=e(localStorage.getItem(Ha));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,n)=>{try{const o=t();o.set(r,n),localStorage.setItem(Ha,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const n=t();return(n==null?void 0:n.get(r))||void 0||my},deleteAllTablePreferences:()=>{localStorage.removeItem(Ha)}}}function Fa(e={}){const{getAxiosInstance:t}=yy();return{axiosInstance:t(e)}}const wy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},vy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ky={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},Cy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Sy={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},xy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Ay={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},By={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Iy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Ny={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ey={global:wy,deleteModal:vy,baseForm:ky,baseTable:Cy,baseConfigCard:Sy,filter:xy,debouncedFilter:Ay,errors:By,validationErrors:Iy,toggleModal:Ny};function fo(){const e=$i.createI18n("en-us",Ey);return{i18n:e,i18nT:$i.i18nTComponent(e)}}function Od(){const e=(r,n)=>(n==null?void 0:n[r])??void 0,t=(r,n)=>{if(r.length!==n.length)return!1;const o=new Set([...r,...n]);for(const s of o){const a=r.filter(c=>c===s).length,l=n.filter(c=>c===s).length;if(a!==l)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,n,o)=>{if(o){if(Object.keys(r).length===Object.keys(n).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(n[s])){if(t(r[s],n[s]))continue;return!1}else{if(r[s]===n[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(n)}catch{return!1}},sortAlpha:r=>(n,o)=>{let s=n[r]===void 0||n[r]===null?"":n[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(n[r])&&(s=n[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function Oy(e,t,r,n={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=Fa(e.axiosRequestConfig),{i18n:{t:s}}=fo(),{debounce:a}=gy(),l=a(async S=>{await B(S)},200),c=i.ref(!1),d=i.ref(""),y=i.ref(""),p=i.ref([]),E=i.ref([]),w=i.ref(void 0),h=i.computed(()=>{const S=`${e.apiBaseUrl}${i.unref(t)}`;return e.app==="konnect"?S.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?S.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):S}),{isValidUuid:g}=Od(),b=async()=>{try{c.value=!0;const{data:S}=await o.get(`${h.value}?size=${r}`);S!=null&&S.next||(w.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[]),E.value=n.fetchedItemsKey in S?S[n.fetchedItemsKey]:[],p.value=E.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},v=i.ref(""),B=async S=>{var C,T,N;if(v.value!==S){if(v.value=S??"",!S){p.value=E.value;return}if(w.value===void 0)try{if(c.value=!0,d.value="",y.value="",e.app==="konnect"){const I=`${h.value}/${S}`,{data:x}=await o.get(`${I}?size=${r}`);n.fetchedItemsKey in x?p.value=x[n.fetchedItemsKey]:x!=null&&x[n.exactMatchKey??"id"]?p.value=[x]:p.value=[]}else{const I=[];g(S)&&n.searchKeys.includes("id")?I.push((async()=>{const{data:G}=await o.get(`${h.value}/${S}`);return[G[n.fetchedItemsKey]??G]})()):I.push(...n.searchKeys.filter(G=>G!=="id").map(async G=>{const{data:R}=await o.get(`${h.value}?${G}=${S}`);return R[n.fetchedItemsKey]}));const x=await Promise.all(I),O=new Set;p.value=[],(C=x==null?void 0:x.forEach)==null||C.call(x,G=>{var R;(R=G==null?void 0:G.forEach)==null||R.call(G,J=>{O.has(J.id)||(O.add(J.id),p.value.push(J))})})}}catch(I){((T=I==null?void 0:I.response)==null?void 0:T.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,y.value="",p.value=(N=w.value)==null?void 0:N.filter(I=>{var x;let O=!1;for(const G of n.searchKeys){const R=typeof I[G]=="string"?(x=I[G])==null?void 0:x.toLowerCase():I[G];R!=null&&R.includes(S.toLowerCase())&&(O=!0)}return O}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:d,validationError:y,results:p,allRecords:w,loadItems:b,debouncedQueryChange:l}}function _y(e,t){const r=i.unref(t),n=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return n.value.search="",o=>`${n.value.href}/${o}`}function Vy(){const{i18n:{t:e}}=fo();return{getMessageFromError:t=>{var r,n,o,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((n=t==null?void 0:t.response)!=null&&n.data){if(t.response.data.detail)return t.response.data.detail;if((o=t.response.data.details)!=null&&o.length)return t.response.data.details.map(a=>{let l=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(l=a.messages.join(", ")),a.field?`${a.field} - ${l}`:l}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Ty(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const n=e.join("/"),o=`${r}${n}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${r}${n}`;throw new Error("Invalid url")}catch(n){return console.warn("Failed to build valid URL:",n),""}}function _d(e,t){const r=i.ref(i.unref(e)),n=i.ref(i.unref(t)),o=i.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=i.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return a=>{const{page:l,pageSize:c,offset:d,sortColumnKey:y,sortColumnOrder:p,query:E}=a;try{let w=new URL(s.value.href);return o.value&&E?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${E}/`):new URL(`${w.href}?filter[name][contains]=${E}`)):(o.value||new URLSearchParams(E).forEach((h,g)=>{w.searchParams.append(g,h)}),y&&w.searchParams.append("sort_by",y),p==="desc"&&w.searchParams.append("sort_desc","1"),w.searchParams.append("size",String(c))),d&&l!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),n.value}}}function jy(e,t,r="data"){const n=i.unref(t),{axiosInstance:o}=Fa(e.axiosRequestConfig),s=_d(e,n),a=i.ref({status:Ft.Idle});return{fetcher:async l=>{var c;try{a.value={status:Ft.Loading};let d=s(l);d.includes("filter[name]")&&(d=`${d}&page[size]=${l.pageSize}&page[number]=${l.page}`);const y=await o.get(d);if(y.status>=400)throw y;const p=y.data,E=r&&r.replace(/[^\w-_]/gi,"");let w;p[E]&&Array.isArray(p[E])?w=p[E]:Array.isArray(p)?w=p:w=Object.keys(p).length?[p]:[];const h={data:w,total:w.length,...p.offset?{pagination:{offset:p.offset}}:null};return a.value={status:Ft.Idle,response:h},h}catch(d){const y={data:[],total:0};return l.query&&(((c=d.response)==null?void 0:c.status)===404||d.status===404)?(a.value={status:Ft.NoResults,response:y,error:d.response?d:{response:d}},y):(a.value={status:Ft.Error,response:y,error:d.response?d:{response:d}},y)}},fetcherState:a}}function Dy(){const e=(r,n="_")=>r?r.split(n).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,n=>n.toUpperCase()):"",convertKeyToTitle:e}}const Vd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Td=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Vd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},jd=e=>e==="*"||e==="x"||e==="X",Dd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},$y=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],My=(e,t)=>{if(jd(e)||jd(t))return 0;const[r,n]=$y(Dd(e),Dd(t));return r>n?1:r<n?-1:0},$d=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=My(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0},Ry=(e,t)=>{const r=Td(e),n=Td(t),o=r.pop(),s=n.pop(),a=$d(r,n);return a!==0?a:o&&s?$d(o.split("."),s.split(".")):o||s?o?-1:1:0},Md=(e,t,r)=>{Py(r);const n=Ry(e,t);return Rd[r].includes(n)},Rd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Pd=Object.keys(Rd),Py=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Pd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Pd.join("|")}`)},Uy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Vd.test(e);function Ly(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:n,version:o}=t;if(!Uy(o))return console.error("Invalid version"),!1;const s=r[n];if(!s)return!1;const[a,l]=s;return!(a&&Md(o,a,"<")||l&&Md(o,l,">"))}function Hy(e){const t=i.ref(0),r=i.ref(0),n=i.ref(!1);return i.watch(e,o=>{o&&!n.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,n.value=!0)}),{isTruncated:i.computed(()=>t.value<r.value)}}function Fy(){const{i18n:{t:e}}=fo();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Ie={useAxios:Fa,useDebouncedFilter:Oy,useDeleteUrlBuilder:_y,useErrors:Vy,useExternalLinkCreator:Ty,useFetcher:jy,useFetchUrlBuilder:_d,useHelpers:Od,useStringHelpers:Dy,useI18n:fo,useGatewayFeatureSupported:Ly,useTruncationDetector:Hy,useValidators:Fy},qy={key:0,class:"config-card-fieldset-title"},Ky=i.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Ie.useI18n(),{convertKeyToTitle:n}=Ie.useStringHelpers(),o=i.computed(()=>t.item.key??"json-array-item"),s=i.computed(()=>t.item.value??t.item),a=i.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete c.name,c}),l=i.computed(()=>{var c;return t.isArrayItem?(c=s.value)!=null&&c.name?n(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(c,d)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:i.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:i.withCtx(()=>[e.isArrayItem?(i.openBlock(),i.createElementBlock("legend",qy,[i.createElementVNode("b",null,i.toDisplayString(l.value),1)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(a.value),(y,p)=>(i.openBlock(),i.createBlock(po,{key:`${o.value}-property-${p}`,item:{key:y,label:i.unref(n)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ut=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},Ud=ut(Ky,[["__scopeId","data-v-68ca83ec"]]),zy=i.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ie.useI18n();return(r,n)=>{const o=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:n[0]||(n[0]=s=>r.$emit("navigation-click",e.item))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.value||i.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Gy=ut(zy,[["__scopeId","data-v-c96811e5"]]),Wy=i.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ie.useI18n();return(r,n)=>{const o=i.resolveComponent("KBadge");return i.openBlock(),i.createBlock(o,{appearance:e.status?"success":"neutral"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.status?i.unref(t)("baseConfigCard.statusBadge.enabledLabel"):i.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Jy="#0044f4",Yy="#e0e4ea",Zy="#afb7c5",Qy="1px",Xy="20px",eg={class:"config-card-details-row"},tg=["data-testid"],rg=["data-testid"],ig=["data-testid"],ng=["data-testid"],og={key:1},sg=["data-testid"],ag=["data-testid"],lg=["data-testid"],cg=["data-testid"],ug={name:"ConfigCardItem",components:{JsonCardItem:Ud,StatusBadge:Wy,InternalLinkItem:Gy}},dg=i.defineComponent({...ug,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){i.useCssVars(h=>({"2f5b0492":y.value?"none":`solid ${i.unref(Qy)} ${i.unref(Yy)}`,"5d59c22c":d.value&&l.value?"block":"flex",aa41a894:d.value&&l.value?"100%":r.slim?"50%":"25%",aa3d1cde:d.value&&l.value?"100%":r.slim?"50%":"75%"}));const r=e,n=t,o=i.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Ie.useI18n(),l=i.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=i.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=i.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=i.computed(()=>r.item.type===ce.JsonArray),p=i.computed(()=>{switch(r.item.type){case ce.ID:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case ce.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ce.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ce.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:r.item.value}};case ce.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{n("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),E=i.ref(),{isTruncated:w}=Ie.useTruncationDetector(E);return(h,g)=>{const b=i.resolveComponent("KLabel"),v=i.resolveComponent("KBadge"),B=i.resolveComponent("KCopy"),S=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("div",eg,[i.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[i.renderSlot(h.$slots,"label",{item:e.item},()=>[i.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:i.withCtx(()=>[i.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[i.renderSlot(h.$slots,"label-tooltip",{},()=>[i.createTextVNode(i.toDisplayString(e.item.tooltip),1)],!0)],8,rg)]),key:"0"}:void 0]),1024)],!0)],8,tg),i.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[i.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[l.value?(i.openBlock(),i.createElementBlock("div",og,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(p.value.tag),i.normalizeProps(i.guardReactiveProps(p.value.attrs)),{default:i.withCtx(()=>[p.value.additionalComponent==="KBadge"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(C,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-tag-${T}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${T}`,tooltip:C,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,sg)):i.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(C,T)=>(i.openBlock(),i.createBlock(B,i.mergeProps({ref_for:!0},p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${T}`,"data-testid":`${e.item.key}-copy-uuid-${T}`,text:C}),null,16,["data-testid","text"]))),128))],8,ag)):p.value.additionalComponent==="KMethodBadge"?(i.openBlock(),i.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(C,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-method-${T}`,appearance:Object.values(i.unref(fp.BadgeMethodAppearances)).includes(C.toLowerCase())?C.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${T}`},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,lg)):i.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(i.openBlock(),i.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(C,T)=>(i.openBlock(),i.createBlock(Ud,{key:`json-array-item-${T}`,index:T,"is-array-item":"",item:C},null,8,["index","item"]))),128))],8,cg)):(i.openBlock(),i.createBlock(S,{key:4,text:i.unref(w)?e.item.value:""},{default:i.withCtx(()=>[i.createElementVNode("span",{ref_key:"textContent",ref:E,class:i.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},i.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,ng))],!0)],8,ig)])}}}),po=ut(dg,[["__scopeId","data-v-711ebcf2"]]),fg={class:"json-config"},pg={key:0,class:"json-endpoint"},Ld=i.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){i.useCssVars(o=>({"7a485cf8":`${n.value}ch`}));const t=e,r=i.computed(()=>t.jsonRecord),n=i.computed(()=>{var o;if(!t.fetcherUrl)return 0;const s=(o=t.fetcherUrl)==null?void 0:o.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(o,s)=>{const a=i.resolveComponent("KBadge"),l=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",fg,[t.fetcherUrl?(i.openBlock(),i.createElementBlock("div",pg,[i.createVNode(a,{appearance:t.requestMethod},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),i.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):i.createCommentVNode("",!0),t.jsonRecord?(i.openBlock(),i.createBlock(l,{key:1,id:"json-codeblock",class:i.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):i.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Hd(e){return typeof e>"u"||e===null}function hg(e){return typeof e=="object"&&e!==null}function yg(e){return Array.isArray(e)?e:Hd(e)?[]:[e]}function gg(e,t){var r,n,o,s;if(t)for(s=Object.keys(t),r=0,n=s.length;r<n;r+=1)o=s[r],e[o]=t[o];return e}function mg(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function bg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var wg=Hd,vg=hg,kg=yg,Cg=mg,Sg=bg,xg=gg,Se={isNothing:wg,isObject:vg,toArray:kg,repeat:Cg,isNegativeZero:Sg,extend:xg};function Fd(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
118
118
|
|
|
119
119
|
`+e.mark.snippet),n+" "+r):n}function Ni(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Fd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ni.prototype=Object.create(Error.prototype),Ni.prototype.constructor=Ni,Ni.prototype.toString=function(e){return this.name+": "+Fd(this,e)};var Pe=Ni;function qa(e,t,r,n,o){var s="",a="",l=Math.floor(o/2)-1;return n-t>l&&(s=" ... ",t=n-l+s.length),r-n>l&&(a=" ...",r=n+l-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:n-t+s.length}}function Ka(e,t){return Se.repeat(" ",t-e.length)+e}function Ag(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),n.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var l="",c,d,y=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+y+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)d=qa(e.buffer,n[a-c],o[a-c],e.position-(n[a]-n[a-c]),p),l=Se.repeat(" ",t.indent)+Ka((e.line-c+1).toString(),y)+" | "+d.str+`
|
|
120
120
|
`+l;for(d=qa(e.buffer,n[a],o[a],e.position,p),l+=Se.repeat(" ",t.indent)+Ka((e.line+1).toString(),y)+" | "+d.str+`
|
|
@@ -145,4 +145,4 @@ ${t.join(`
|
|
|
145
145
|
`+e.slice(o,s),o=s+1),a=l;return c+=`
|
|
146
146
|
`,e.length-o>t&&a>o?c+=e.slice(o,a)+`
|
|
147
147
|
`+e.slice(a+1):c+=e.slice(o),c.slice(1)}function d0(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=Vi(e,o),n=$e[r],!n&&_i(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||r0(r);return t}function f0(e,t,r){var n="",o=e.tag,s,a,l;for(s=0,a=r.length;s<a;s+=1)l=r[s],e.replacer&&(l=e.replacer.call(r,String(s),l)),(Tt(e,t,l,!1,!1)||typeof l>"u"&&Tt(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function Ff(e,t,r,n){var o="",s=e.tag,a,l,c;for(a=0,l=r.length;a<l;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(Tt(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Tt(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=el(e,t)),e.dump&&Ei===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function p0(e,t,r){var n="",o=e.tag,s=Object.keys(r),a,l,c,d,y;for(a=0,l=s.length;a<l;a+=1)y="",n!==""&&(y+=", "),e.condenseFlow&&(y+='"'),c=s[a],d=r[c],e.replacer&&(d=e.replacer.call(r,c,d)),Tt(e,t,c,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Tt(e,t,d,!1,!1)&&(y+=e.dump,n+=y));e.tag=o,e.dump="{"+n+"}"}function h0(e,t,r,n){var o="",s=e.tag,a=Object.keys(r),l,c,d,y,p,E;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Pe("sortKeys must be a boolean or a function");for(l=0,c=a.length;l<c;l+=1)E="",(!n||o!=="")&&(E+=el(e,t)),d=a[l],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),Tt(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Ei===e.dump.charCodeAt(0)?E+="?":E+="? "),E+=e.dump,p&&(E+=el(e,t)),Tt(e,t+1,y,!0,p)&&(e.dump&&Ei===e.dump.charCodeAt(0)?E+=":":E+=": ",E+=e.dump,o+=E));e.tag=s,e.dump=o||"{}"}function qf(e,t,r){var n,o,s,a,l,c;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(l=o[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof t=="object"&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(r?l.multi&&l.representName?e.tag=l.representName(t):e.tag=l.tag:e.tag="?",l.represent){if(c=e.styleMap[l.tag]||l.defaultStyle,Bf.call(l.represent)==="[object Function]")n=l.represent(t,c);else if(If.call(l.represent,c))n=l.represent[c](t,c);else throw new Pe("!<"+l.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function Tt(e,t,r,n,o,s,a){e.tag=null,e.dump=r,qf(e,r,!1)||qf(e,r,!0);var l=Bf.call(e.dump),c=n,d;n&&(n=e.flowLevel<0||e.flowLevel>t);var y=l==="[object Object]"||l==="[object Array]",p,E;if(y&&(p=e.duplicates.indexOf(r),E=p!==-1),(e.tag!==null&&e.tag!=="?"||E||e.indent!==2&&t>0)&&(o=!1),E&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&E&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),l==="[object Object]")n&&Object.keys(e.dump).length!==0?(h0(e,t,e.dump,o),E&&(e.dump="&ref_"+p+e.dump)):(p0(e,t,e.dump),E&&(e.dump="&ref_"+p+" "+e.dump));else if(l==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Ff(e,t-1,e.dump,o):Ff(e,t,e.dump,o),E&&(e.dump="&ref_"+p+e.dump)):(f0(e,t,e.dump),E&&(e.dump="&ref_"+p+" "+e.dump));else if(l==="[object String]")e.tag!=="?"&&c0(e,e.dump,t,s,c);else{if(l==="[object Undefined]"||e.skipInvalid)return!1;throw new Pe("unacceptable kind of an object to dump "+l)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function y0(e,t){var r=[],n=[],o,s;for(rl(e,r,n),o=0,s=n.length;o<s;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(s)}function rl(e,t,r){var n,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)rl(e[o],t,r);else for(n=Object.keys(e),o=0,s=n.length;o<s;o+=1)rl(e[n[o]],t,r)}function g0(e,t){t=t||{};var r=new n0(t);r.noRefs||y0(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Tt(r,0,n,!0,!0)?r.dump+`
|
|
148
|
-
`:""}var m0=g0,b0={dump:m0};function il(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var w0=Ve,v0=Kd,k0=Jd,C0=ef,S0=tf,x0=Wa,A0=Af.load,B0=Af.loadAll,I0=b0.dump,N0=Pe,E0={binary:af,float:Xd,map:Wd,null:Yd,pairs:cf,set:uf,timestamp:of,bool:Zd,int:Qd,merge:sf,omap:lf,seq:Gd,str:zd},O0=il("safeLoad","load"),_0=il("safeLoadAll","loadAll"),V0=il("safeDump","dump"),T0={Type:w0,Schema:v0,FAILSAFE_SCHEMA:k0,JSON_SCHEMA:C0,CORE_SCHEMA:S0,DEFAULT_SCHEMA:x0,load:A0,loadAll:B0,dump:I0,YAMLException:N0,types:E0,safeLoad:O0,safeLoadAll:_0,safeDump:V0};const j0={class:"yaml-config"},Kf=i.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=i.computed(()=>{const n=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,o])=>o!==null&&o!==""&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(n).length===0&&n.constructor===Object?"":T0.dump(n).trim()});return(n,o)=>{const s=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",j0,[t.yamlRecord?(i.openBlock(),i.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):i.createCommentVNode("",!0)])}}}),D0={key:0,class:"config-card-display-form"},$0=["data-testid"],M0={key:0,class:"config-card-prop-section-title"},R0=i.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=i.useSlots(),{i18n:{t:n}}=Ie.useI18n(),o=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=i.computed(()=>{if(!t.record)return t.record;const a=JSON.parse(JSON.stringify(t.record));return delete a.created_at,delete a.updated_at,a});return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[e.format==="structured"?(i.openBlock(),i.createElementBlock("div",D0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propListTypes,c=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${c}-props`,class:i.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(i.openBlock(),i.createElementBlock("div",M0,i.toDisplayString(c==="advanced"?i.unref(n)("baseConfigCard.sections.advanced"):i.unref(n)("baseConfigCard.sections.plugin")),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propertyCollections[c],d=>(i.openBlock(),i.createBlock(po,{key:d.key,item:d},i.createSlots({label:i.withCtx(()=>[i.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:i.withCtx(({rowValue:y})=>[i.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[o(d)?{name:"label-tooltip",fn:i.withCtx(()=>[i.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,$0))),128))])):i.createCommentVNode("",!0),e.format==="json"&&t.record?(i.openBlock(),i.createBlock(Ld,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):i.createCommentVNode("",!0),e.format==="yaml"&&t.record?(i.openBlock(),i.createBlock(Kf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):i.createCommentVNode("",!0)],64))}}),P0=ut(R0,[["__scopeId","data-v-2052238b"]]),kt="24px",Ti=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},U0=e=>(i.pushScopeId("data-v-c1f7c39c"),e=e(),i.popScopeId(),e),L0=["aria-hidden"],H0={key:0,"data-testid":"kui-icon-svg-title"},F0=U0(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),q0=i.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",H0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),F0],8,L0))]),_:1},8,["aria-hidden","style"]))}}),K0=Ti(q0,[["__scopeId","data-v-c1f7c39c"]]),z0=e=>(i.pushScopeId("data-v-fbe6ddff"),e=e(),i.popScopeId(),e),G0=["aria-hidden"],W0={key:0,"data-testid":"kui-icon-svg-title"},J0=z0(()=>i.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),Y0=i.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",W0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),J0],8,G0))]),_:1},8,["aria-hidden","style"]))}}),Z0=Ti(Y0,[["__scopeId","data-v-fbe6ddff"]]),Q0=e=>(i.pushScopeId("data-v-745761f6"),e=e(),i.popScopeId(),e),X0=["aria-hidden"],e1={key:0,"data-testid":"kui-icon-svg-title"},t1=Q0(()=>i.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),r1=i.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",e1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),t1],8,X0))]),_:1},8,["aria-hidden","style"]))}}),i1=Ti(r1,[["__scopeId","data-v-745761f6"]]),n1=e=>(i.pushScopeId("data-v-863d10eb"),e=e(),i.popScopeId(),e),o1=["aria-hidden"],s1={key:0,"data-testid":"kui-icon-svg-title"},a1=n1(()=>i.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),l1=i.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",s1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),a1],8,o1))]),_:1},8,["aria-hidden","style"]))}}),c1=Ti(l1,[["__scopeId","data-v-863d10eb"]]),u1=e=>(i.pushScopeId("data-v-d9894a05"),e=e(),i.popScopeId(),e),d1=["aria-hidden"],f1={key:0,"data-testid":"kui-icon-svg-title"},p1=u1(()=>i.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),h1=i.defineComponent({__name:"MoreIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon more-icon","data-testid":"kui-icon-wrapper-more-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-more-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",f1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),p1],8,d1))]),_:1},8,["aria-hidden","style"]))}}),y1=Ti(h1,[["__scopeId","data-v-d9894a05"]]),g1={class:"config-card-title","data-testid":"config-card-title"},m1={class:"config-card-actions"},b1=["href"],w1={class:"config-card-details-section"},v1=i.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const n=t,o=e,{i18n:{t:s}}=Ie.useI18n(),{getMessageFromError:a}=Ie.useErrors(),{convertKeyToTitle:l}=Ie.useStringHelpers(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=i.ref("structured"),p=N=>{y.value=N==null?void 0:N.value},E={id:{type:ce.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:pe.Basic},name:{order:1,section:pe.Basic},enabled:{type:ce.BadgeStatus,order:2,section:pe.Basic},updated_at:{type:ce.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:ce.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:ce.BadgeTag,order:-1,section:pe.Basic}},w=i.ref(!1),h=i.ref(!1),g=i.ref(""),b=i.ref({}),v=i.computed(()=>{var N,I,x;if(!b.value)return[];const O=[],G=Object.keys(b.value).length;for(const R in b.value){const J=(I=(N=o.configSchema)==null?void 0:N[R])==null?void 0:I.order,ee=(x=E[R])==null?void 0:x.order;let ne=G;(ee||ee===0)&&(ne=ee===-1?G+1:ee),J&&(ne=J===-1?G+1:J),O.push([R,ne])}return O.sort(function(R,J){return R[1]-J[1]}),O.map(R=>{var J,ee;const ne=R[0],me=(J=b.value)==null?void 0:J[ne],ie=((ee=o.configSchema)==null?void 0:ee[ne])||{},Ne=E[ne];return{key:ne,value:me,hidden:ie.hidden||!1,type:ie.type??((Ne==null?void 0:Ne.type)||ce.Text),label:ie.label??((Ne==null?void 0:Ne.label)||l(ne)),tooltip:ie.tooltip??((Ne==null?void 0:Ne.tooltip)||void 0),section:ie.section??((Ne==null?void 0:Ne.section)||pe.Advanced)}}).filter(R=>!R.hidden&&R.key!==o.pluginConfigKey)}),B=i.computed(()=>{var N,I;if(!b.value||!o.pluginConfigKey)return[];const x=b.value[o.pluginConfigKey]||{},O=Object.keys(x).length,G=[];for(const R in x){const J=(I=(N=o.pluginConfigSchema)==null?void 0:N[R])==null?void 0:I.order,ee=x[R];let ne=ee!=null&&ee!==""?O-1:O;J&&(ne=J===-1?O+1:J),G.push([R,ne])}return G.sort(function(R,J){return R[1]-J[1]}),G.map(R=>{var J;const ee=R[0],ne=x[ee],me=((J=o.pluginConfigSchema)==null?void 0:J[ee])||{};return{key:ee,value:ne,hidden:me.hidden||!1,type:me.type??ce.Text,label:me.label??l(ee),tooltip:me.tooltip??void 0,section:pe.Plugin}}).filter(R=>!R.hidden)}),C=i.computed(()=>{var N,I,x,O;return{basic:(N=v.value)==null?void 0:N.filter(G=>G.section===pe.Basic),advanced:(I=v.value)==null?void 0:I.filter(G=>G.section===pe.Advanced),plugin:(O=B.value)==null?void 0:O.concat((x=v.value)==null?void 0:x.filter(G=>G.section===pe.Plugin))}}),S=i.computed(()=>{const N=[];return C.value.basic.length&&N.push("basic"),C.value.advanced.length&&N.push("advanced"),C.value.plugin.length&&N.push("plugin"),N}),T=i.computed(()=>{var N,I;let x=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):o.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(I=o.config)!=null&&I.workspace?`/${o.config.workspace}`:"")),x=x.replace(/{id}/gi,o.config.entityId),x});return i.watch(w,N=>{n("loading",N)},{immediate:!0}),i.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:N}=await c.get(T.value);if(o.dataKey)if(typeof N[o.dataKey]<"u")b.value={...N[o.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:o.dataKey}));else b.value={...N};Object.keys(o.configSchema).filter(I=>o.configSchema[I].forceShow).forEach(I=>{b.value&&typeof b.value[I]>"u"&&(b.value[I]=null)}),n("fetch:success",N)}catch(N){const I=a(N);g.value=I.startsWith("code")?s("baseConfigCard.errors.load"):I,h.value=!0,n("fetch:error",N)}finally{w.value=!1}}),(N,I)=>{const x=i.resolveComponent("KLabel"),O=i.resolveComponent("KSelect"),G=i.resolveComponent("KButton"),R=i.resolveComponent("KSkeleton"),J=i.resolveComponent("KEmptyState"),ee=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(ee,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},i.createSlots({actions:i.withCtx(()=>[i.createElementVNode("div",m1,[i.renderSlot(N.$slots,"actions",{},void 0,!0),i.createVNode(x,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.label),1)]),_:1}),i.createVNode(O,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(i.openBlock(),i.createBlock(G,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:i.withCtx(()=>[i.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[i.createVNode(i.unref(Z0),{size:i.unref(Xy)},null,8,["size"])],8,b1)]),_:1})):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[w.value?(i.openBlock(),i.createBlock(R,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(i.openBlock(),i.createBlock(J,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(g.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",w1,[i.createVNode(P0,{config:e.config,"fetcher-url":T.value,format:y.value,"prop-list-types":S.value,"property-collections":C.value,record:b.value},i.createSlots({_:2},[i.renderList(Object.keys(N.$slots),ne=>({name:ne,fn:i.withCtx(({row:me,rowValue:ie})=>[i.renderSlot(N.$slots,ne,{row:me,rowValue:ie},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("span",g1,[i.renderSlot(N.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),zf=ut(v1,[["__scopeId","data-v-f40a683b"]]),k1=["novalidate"],C1={class:"form-actions","data-testid":"form-actions"},S1=i.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const n=t,o=e,s=Wr.useRouter(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:l}=Ie.useErrors(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=i.ref(!1),y=i.ref(!1),p=i.ref(""),E=i.computed(()=>o.canSubmit===!1||o.isReadonly),w=i.ref(!1),h=i.computed(()=>{var S,T;let N=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((S=o.config)==null?void 0:S.controlPlaneId)||""):o.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(T=o.config)!=null&&T.workspace?`/${o.config.workspace}`:"")),o.editId?(N=N.replace(/{id}/gi,o.editId),N):(N=N.replace(/\/{id}/gi,""),N)}),g=()=>{w.value=!w.value},b=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):v()},v=()=>{n("cancel")},B=()=>{E.value||n("submit")},C=i.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return i.watch(()=>d.value,S=>{n("loading",S)},{immediate:!0}),i.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:S}=await c.get(h.value);n("fetch:success",S)}catch(S){const T=l(S);p.value=T.startsWith("code")?a("baseForm.errors.edit"):T,y.value=!0,n("fetch:error",S)}finally{d.value=!1}}),(S,T)=>{const N=i.resolveComponent("KSkeleton"),I=i.resolveComponent("KEmptyState"),x=i.resolveComponent("KAlert"),O=i.resolveComponent("KButton"),G=i.resolveComponent("KTabs"),R=i.resolveComponent("KSlideout");return i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(N,{key:0,type:"form"})):y.value?(i.openBlock(),i.createBlock(I,{key:1,"action-button-text":i.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(i.openBlock(),i.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:o.noValidate,onReset:i.withModifiers(v,["prevent"]),onSubmit:i.withModifiers(B,["prevent"])},[i.renderSlot(S.$slots,"default",{},void 0,!0),e.errorMessage?(i.openBlock(),i.createBlock(x,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):i.createCommentVNode("",!0),i.createElementVNode("div",C1,[i.renderSlot(S.$slots,"form-actions",{},()=>[i.createVNode(O,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:T[0]||(T[0]=J=>g())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),i.createVNode(O,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),i.createVNode(O,{appearance:"primary","data-testid":"form-submit",disabled:E.value,type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,k1)),i.createVNode(R,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:i.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:T[1]||(T[1]=J=>g())},{default:i.withCtx(()=>[i.createElementVNode("div",null,i.toDisplayString(i.unref(a)("baseForm.configuration.message")),1),i.createVNode(G,{"data-testid":"form-view-configuration-slideout-tabs",tabs:C.value},{json:i.withCtx(()=>[i.createVNode(Ld,{config:e.config,"fetcher-url":h.value,"json-record":o.formFields,"request-method":o.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:i.withCtx(()=>[i.createVNode(Kf,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Gf=ut(S1,[["__scopeId","data-v-fd05df8e"]]),x1=["data-truncate"],A1=i.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const t=e,r=i.computed(()=>{var b;return((b=t.rowEl)==null?void 0:b.querySelector(`[data-testid="${t.keyName}"]`))||null}),n=i.computed(()=>{var b;return((b=r.value)==null?void 0:b.querySelector('[data-truncate="true"]'))||null}),o=i.computed(()=>{var b,v;const B=(b=t.rowEl)==null?void 0:b.querySelectorAll("td");return B?((v=B[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!0}),s=i.computed(()=>o.value||t.tooltip);let a;const l=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{var b,v,B;let C=((b=r.value)==null?void 0:b.clientWidth)||0;if(r.value&&"getComputedStyle"in window){const S=window.getComputedStyle(r.value);C-=(parseFloat(S.paddingLeft)||0)+(parseFloat(S.paddingRight)||0)}y.value=((v=n.value)==null?void 0:v.getBoundingClientRect().width)||0,p.value=C,E.value=((B=d.value)==null?void 0:B.innerText)||""},d=i.ref({}),y=i.ref(0),p=i.ref(0),E=i.ref(""),w=i.computed(()=>[n.value,r.value]),h=i.watch(w,b=>{if(s.value&&(l(),"ResizeObserver"in window&&window)){a=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of b)v&&a.observe(v)}},{immediate:!0,flush:"post",deep:!0}),g=i.computed(()=>s.value?y.value>p.value:!1);return i.onMounted(()=>{c()}),i.onUnmounted(()=>{h()}),(b,v)=>{const B=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:d,class:"content-wrapper"},[s.value?(i.openBlock(),i.createElementBlock("span",{key:0,"data-truncate":s.value||void 0},[i.createVNode(B,{"max-width":"300",placement:"bottom-start",text:g.value?E.value:""},{default:i.withCtx(()=>[i.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,x1)):i.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),B1=ut(A1,[["__scopeId","data-v-b252463e"]]),I1={class:"toolbar-container"},N1={key:0,class:"toolbar-button-container"},E1=["data-testid"],O1=i.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},sortHandlerFunction:{type:Function,default:()=>({})},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,n=t,{i18n:{t:o}}=Ie.useI18n(),s=i.computed(()=>{var N,I;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(N=r.errorMessage)==null?void 0:N.title,message:(I=r.errorMessage)==null?void 0:I.message}}),a=i.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),l=N=>N.hasData||!!r.query,c=i.computed(()=>{const N=[];return Object.keys(r.tableHeaders).forEach(I=>{const x=r.tableHeaders[I];N.push({label:x.label??I,key:I,sortable:x.sortable??!1,hidable:x.hidable??!0})}),r.enableEntityActions&&N.push({key:"actions",hideLabel:!0}),N}),d=N=>({"data-rowid":N.id,"data-testid":N.name,...r.rowAttributes(N)}),y=i.ref({}),p=N=>{var I;return(I=y.value)==null?void 0:I.$el.querySelector(`[data-rowid="${N.id}"]`)},E=N=>{const I={"data-testid":N.headerKey,...r.cellAttributes(N)};return N.colIndex===0&&(I.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),I},w=()=>{n("empty-state-cta-clicked"),h()},h=()=>{n("clear-search-input")},g=i.computed(()=>r.disableRowClick?void 0:(N,I)=>{n("click:row",I)}),b=N=>{n("sort",N)},{setTablePreferences:v,getTablePreferences:B}=by(),C=i.ref(B(a.value)),S=i.computed(()=>{const N=B(a.value);return{...r.initialFetcherParams,...N}}),T=N=>{C.value=N,c.value.forEach(I=>{!("hidable"in I)||!C.value.columnVisibility||I.hidable===!1&&(C.value.columnVisibility[I.key]=!0)}),a.value&&v(a.value,N)};return(N,I)=>{const x=i.resolveComponent("KButton"),O=i.resolveComponent("KDropdown"),G=i.resolveComponent("KTable"),R=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(R,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:i.withCtx(()=>[i.createVNode(G,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":E,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,error:s.value.hasError,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":S.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":d,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":C.value,onEmptyStateActionClick:w,"onRow:click":g.value,onSort:I[0]||(I[0]=J=>b(J)),"onUpdate:tablePreferences":T},i.createSlots({toolbar:i.withCtx(({state:J})=>[i.withDirectives(i.createElementVNode("div",I1,[i.renderSlot(N.$slots,"toolbar-filter",{},void 0,!0),N.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",N1,[i.renderSlot(N.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,l(J)]])]),actions:i.withCtx(({row:J,rowKey:ee,rowValue:ne})=>[i.createElementVNode("div",{class:"actions-container","data-testid":J.name},[i.createVNode(O,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(N.$slots,"actions",{row:J,rowKey:ee,rowValue:ne},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(x,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:i.withCtx(()=>[i.createVNode(i.unref(y1))]),_:1})]),_:2},1032,["width"])],8,E1)]),_:2},[i.renderList(e.tableHeaders,(J,ee)=>({name:ee,fn:i.withCtx(({row:ne,rowKey:me,rowValue:ie})=>[i.createVNode(B1,{"key-name":String(ee),"row-el":p(ne),tooltip:J.tooltip},{default:i.withCtx(()=>[i.renderSlot(N.$slots,ee,{row:ne,rowKey:me,rowValue:ie},()=>[i.createTextVNode(i.toDisplayString(ie),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:i.withCtx(()=>[i.createVNode(i.unref(K0))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Wf=ut(O1,[["__scopeId","data-v-71b4425a"]]),_1={key:0,class:"kong-ui-entity-delete-error"},V1={key:1,class:"description"},T1=i.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:t}){const{i18nT:r}=Ie.useI18n(),n=e,o=t,s=i.computed(()=>n.needConfirm?n.entityName:""),a=()=>{o("cancel")},l=()=>{o("proceed")};return(c,d)=>{const y=i.resolveComponent("KAlert"),p=i.resolveComponent("KPrompt");return i.openBlock(),i.createBlock(p,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:l},{default:i.withCtx(()=>[e.error?(i.openBlock(),i.createElementBlock("div",_1,[i.createVNode(y,{appearance:"danger"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.error),1)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(i.unref(r),{class:"message",keypath:n.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},i.createSlots({entityType:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.entityType),1)]),_:2},[n.entityName?{name:"entityName",fn:i.withCtx(()=>[i.createElementVNode("strong",null,i.toDisplayString(n.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),n.description||c.$slots.description?(i.openBlock(),i.createElementBlock("div",V1,[i.renderSlot(c.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(n.description),1)],!0)])):i.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Jf=ut(T1,[["__scopeId","data-v-4361d622"]]),j1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},D1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},$1=["fill"],M1={mask:"url(#mask0_180_20349)"},R1=["fill"],Yf=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Jy})`}},setup(e){return(t,r)=>(i.openBlock(),i.createElementBlock("svg",j1,[i.createElementVNode("mask",D1,[i.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,$1)]),i.createElementVNode("g",M1,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,R1)])]))}}),P1={key:1,class:"kong-ui-entity-filter"},U1={class:"kong-ui-entity-filter-menu"},L1=["data-testid"],H1=["onClick","onKeydown"],F1={class:"menu-item-indicator"},q1={class:"menu-item-body"},K1=["for"],z1={class:"menu-item-buttons"},G1={class:"filter-clear-button-container"},W1=i.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{i18n:{t:r}}=Ie.useI18n(),n=e,o=t,s=i.ref(!1),a=i.ref({}),l=i.ref(new Set),c=i.computed(()=>{const S=[];return new URLSearchParams(n.modelValue).forEach((T,N)=>{T!==""&&S.push(N)}),S}),d=i.computed(()=>{const S=n.config.fields;return Object.keys(S).filter(T=>{var N;return(N=S==null?void 0:S[T])==null?void 0:N.searchable}).map(T=>({label:S[T].label||T,value:T,expanded:!1}))});i.watch(()=>n.modelValue,S=>{a.value={},new URLSearchParams(S).forEach((T,N)=>{a.value[N]=T})});const y=()=>{s.value=!s.value},p=S=>{l.value.has(S)?l.value.delete(S):l.value.add(S)},E=S=>{o("update:modelValue",S)},w=()=>{E("")},h=S=>`filter-${S}`,g=S=>{var T,N;return(((N=(T=n.config.schema)==null?void 0:T[S])==null?void 0:N.values)??[]).map(I=>({value:I,label:I}))},b=S=>{var T,N;return((N=(T=n.config.schema)==null?void 0:T[S])==null?void 0:N.type)??"text"},v=S=>{a.value={...a.value,[S]:""},C()},B=()=>{a.value={},C(!0)},C=(S=!1)=>{const T=Object.keys(a.value).reduce((N,I)=>(a.value[I]&&(N[I]=`${a.value[I]}`),N),{});S&&(s.value=!1),o("update:modelValue",new URLSearchParams(T).toString())};return(S,T)=>{const N=i.resolveComponent("KInput"),I=i.resolveComponent("KButton"),x=i.resolveComponent("KSelect");return e.config.isExactMatch?(i.openBlock(),i.createBlock(N,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":E},{before:i.withCtx(()=>[i.createVNode(Yf)]),after:i.withCtx(()=>[i.withDirectives(i.createVNode(i.unref(c1),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[i.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",P1,[i.createVNode(I,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:i.withCtx(()=>[i.createVNode(Yf),i.createTextVNode(" "+i.toDisplayString(i.unref(r)("filter.filterButtonText"))+" "+i.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),i.withDirectives(i.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:y},null,512),[[i.vShow,s.value]]),i.withDirectives(i.createElementVNode("div",U1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,O=>{var G,R;return i.openBlock(),i.createElementBlock("div",{key:O.value,class:"kong-ui-entity-filter-menu-item","data-testid":O.value},[i.createElementVNode("span",{class:i.normalizeClass(["menu-item-title",{expanded:l.value.has(O.value)}]),role:"button",tabindex:"0",onClick:J=>p(O.value),onKeydown:i.withKeys(J=>p(O.value),["enter"])},[i.createTextVNode(i.toDisplayString(O.label)+" ",1),i.withDirectives(i.createElementVNode("span",F1,null,512),[[i.vShow,c.value.includes(O.value)]]),i.createVNode(i.unref(i1),{class:i.normalizeClass(["menu-item-expand-icon",{expanded:l.value.has(O.value)}]),color:i.unref(Zy)},null,8,["class","color"])],42,H1),i.withDirectives(i.createElementVNode("div",q1,[i.createElementVNode("label",{class:"menu-item-label",for:h(O.value)},i.toDisplayString(i.unref(r)("filter.fieldLabel")),9,K1),((R=(G=e.config.schema)==null?void 0:G[O.value])==null?void 0:R.type)==="select"?(i.openBlock(),i.createBlock(x,{key:0,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,items:g(O.value),placeholder:i.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(N,{key:1,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,autocomplete:"off",placeholder:i.unref(r)("filter.inputPlaceholder"),type:b(O.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[i.vShow,l.value.has(O.value)]]),i.withDirectives(i.createElementVNode("div",z1,[i.createVNode(I,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:T[0]||(T[0]=J=>C(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.applyButtonText")),1)]),_:1}),i.createVNode(I,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:J=>v(O.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[i.vShow,l.value.has(O.value)]])],8,L1)}),128)),i.createElementVNode("div",G1,[i.createVNode(I,{appearance:"tertiary",size:"small",onClick:B},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[i.vShow,s.value]])]))}}}),Zf=ut(W1,[["__scopeId","data-v-94990087"]]),jt=i.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=i.ref(void 0),n=i.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return i.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>n.value?i.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):i.createCommentVNode("",!0)}});let vo;const J1=new Uint8Array(16);function Y1(){if(!vo&&(vo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vo(J1)}const Te=[];for(let e=0;e<256;++e)Te.push((e+256).toString(16).slice(1));function Z1(e,t=0){return Te[e[t+0]]+Te[e[t+1]]+Te[e[t+2]]+Te[e[t+3]]+"-"+Te[e[t+4]]+Te[e[t+5]]+"-"+Te[e[t+6]]+Te[e[t+7]]+"-"+Te[e[t+8]]+Te[e[t+9]]+"-"+Te[e[t+10]]+Te[e[t+11]]+Te[e[t+12]]+Te[e[t+13]]+Te[e[t+14]]+Te[e[t+15]]}const Q1=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Qf={randomUUID:Q1};function X1(e,t,r){if(Qf.randomUUID&&!t&&!e)return Qf.randomUUID();e=e||{};const n=e.random||(e.rng||Y1)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Z1(n)}const eb=["aria-labelledby"],tb={class:"form-section-wrapper"},rb={key:1,class:"form-section-description"},ib={key:2,class:"form-section-footer"},nb={class:"form-section-content"},ob=i.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(e){const t=i.useSlots(),r=X1();return(n,o)=>(i.openBlock(),i.createElementBlock("div",{"aria-labelledby":e.title?i.unref(r):void 0,class:i.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[i.createElementVNode("div",tb,[e.hideInfoHeader?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.titleTag),{key:0,id:i.unref(r),class:"form-section-title"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.title),1)]),_:1},8,["id"])):i.createCommentVNode("",!0),e.description||i.unref(t).description?(i.openBlock(),i.createElementBlock("div",rb,[i.renderSlot(n.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(e.description),1)],!0)])):i.createCommentVNode("",!0),i.unref(t).footer?(i.openBlock(),i.createElementBlock("div",ib,[i.renderSlot(n.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",nb,[i.renderSlot(n.$slots,"default",{},void 0,!0)])])],10,eb))}}),ko=ut(ob,[["__scopeId","data-v-b1f74200"]]),{useAxios:Co,useDeleteUrlBuilder:Xf,useErrors:ep,useExternalLinkCreator:ew,useFetchUrlBuilder:tw,useFetcher:tp,useDebouncedFilter:rw,useStringHelpers:rp,useHelpers:ip,useGatewayFeatureSupported:iw,useTruncationDetector:nw,useValidators:ow}=Ie,sb={class:"kong-ui-entities-certificates-list"},ab={key:0},lb={key:1},cb={key:0},ub={key:1},db={key:0},fb={key:1},pb={key:1},hb={key:1},yb=i.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var te;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ct.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=Co((te=n.config)==null?void 0:te.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),E={subject:{label:o("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},w=i.computed(()=>{var q,fe;let U=`${n.config.apiBaseUrl}${Ii.list[n.config.app]}`;return n.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((q=n.config)==null?void 0:q.controlPlaneId)||""):n.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(fe=n.config)!=null&&fe.workspace?`/${n.config.workspace}`:"")),U}),h=i.ref(""),g=i.computed(()=>{const U=n.config.app==="konnect"||n.config.isExactMatch;return U?{isExactMatch:U,placeholder:o("certificates.search.placeholder")}:{isExactMatch:U,schema:n.config.filterSchema}}),{fetcher:b,fetcherState:v}=tp(n.config,w.value),B=()=>{h.value=""},C=()=>{d.value++},S=i.ref(null),T=(U,q)=>{const fe=U.id;if(!q(fe)){r("copy:error",{entity:U,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:o("certificates.copy.success",{val:fe})})},N=(U,q)=>{const fe=JSON.stringify(U);if(!q(fe)){r("copy:error",{entity:U,message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,message:o("certificates.copy.success_brief")})},I=async U=>{var fe;await((fe=n.canRetrieve)==null?void 0:fe.call(n,U))&&l.push(n.config.getViewRoute(U.id))},x=U=>({label:o("certificates.actions.view"),to:n.config.getViewRoute(U)}),O=U=>({label:o("certificates.actions.edit"),to:n.config.getEditRoute(U)}),G=U=>{if(n.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:n.config.getCreateSniRoute(U)}},R=i.ref(void 0),J=i.ref(!1),ee=i.ref(!1),ne=i.ref(""),me=Xf(n.config,w.value),{certificateDataCache:ie,getCertificateData:Ne}=ct.useCertificate(),qr=U=>{R.value=U,J.value=!0},Kr=()=>{J.value=!1},fr=async()=>{var U,q,fe;if((U=R.value)!=null&&U.id){ee.value=!0;try{await c.delete(me(R.value.id)),ee.value=!1,J.value=!1,d.value++,r("delete:success",R.value)}catch(Ue){ne.value=((fe=(q=Ue.response)==null?void 0:q.data)==null?void 0:fe.message)||Ue.message||o("certificates.errors.delete"),r("error",Ue)}finally{ee.value=!1}}},Dt=i.ref(!1);i.watch(v,U=>{var q,fe,Ue,Qe;if(Array.isArray((q=U==null?void 0:U.response)==null?void 0:q.data)&&(Dt.value=U.response.data.length>0),U.status===Ft.Error){S.value={title:o("certificates.errors.general")},(Qe=(Ue=(fe=U.error)==null?void 0:fe.response)==null?void 0:Ue.data)!=null&&Qe.message&&(S.value.message=U.error.response.data.message),r("error",U.error);return}ie.value={},S.value=null});const X=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(X.value.title=o("certificates.list.empty_state.title"),X.value.ctaText=o("certificates.actions.create"))}),(U,q)=>{const fe=i.resolveComponent("KButton"),Ue=i.resolveComponent("KCopy"),Qe=i.resolveComponent("KBadge"),zr=i.resolveComponent("KTruncate"),re=i.resolveComponent("KDropdownItem"),xe=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",sb,[i.createVNode(i.unref(Wf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":S.value,fetcher:i.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":i.unref(E),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":q[2]||(q[2]=Z=>I(Z)),onSort:C},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(Zf),{modelValue:h.value,"onUpdate:modelValue":q[0]||(q[0]=Z=>h.value=Z),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref(jt),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(fe,{appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[i.vShow,Dt.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",ab,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.subject?Z.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",lb,i.toDisplayString(i.unref(Ne)(Z).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",cb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.expiry?i.unref(s)(Z.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",ub,i.toDisplayString(i.unref(Ne)(Z).schemaExpiry?i.unref(s)(i.unref(Ne)(Z).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",db,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.dns_names?`dns=${Z.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",fb,i.toDisplayString(i.unref(Ne)(Z).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:Z})=>[Z!=null&&Z.cert?(i.openBlock(),i.createBlock(Ue,{key:0,"data-testid":"copy-certificate-cert",text:Z.cert,truncate:""},null,8,["text"])):(i.openBlock(),i.createElementBlock("span",pb,"-"))]),tags:i.withCtx(({row:Z})=>{var Ae;return[((Ae=Z==null?void 0:Z.tags)==null?void 0:Ae.length)>0?(i.openBlock(),i.createBlock(zr,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Z==null?void 0:Z.tags,Gr=>(i.openBlock(),i.createBlock(Qe,{key:Gr,onClick:q[1]||(q[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Gr),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",hb,"-"))]}),actions:i.withCtx(({row:Z})=>[i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-id",onClick:Gr=>T(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-json",onClick:Gr=>N(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(jt),{"auth-function":()=>e.canRetrieve(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-view","has-divider":"",item:x(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canEdit(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-edit",item:O(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(i.openBlock(),i.createBlock(i.unref(jt),{key:0,"auth-function":()=>e.canCreateSni()},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-add-sni",item:G(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref(jt),{"auth-function":()=>e.canDelete(Z)},{default:i.withCtx(()=>[i.createVNode(re,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ae=>qr(Z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),i.createVNode(i.unref(Jf),{"action-pending":ee.value,"entity-type":i.unref(La).Certificate,error:ne.value,title:i.unref(o)("certificates.delete.title"),visible:J.value,onCancel:Kr,onProceed:fr},{description:i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(o)("certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),dr=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},gb=dr(yb,[["__scopeId","data-v-8059a087"]]),mb="#d60027",bb={class:"sni-field-container"},wb={key:1,class:"sni-field-controls-container"},vb={key:0},kb=dr(i.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(e,{emit:t}){const r=e,n=t,{i18nT:o,i18n:{t:s}}=ct.useI18n(),a=i.ref([]);return i.watch(r.modelValue,l=>{a.value=[...l]},{immediate:!0,deep:!0}),i.watch(a,l=>{n("update:modelValue",l)},{deep:!0}),(l,c)=>{const d=i.resolveComponent("KLabel"),y=i.resolveComponent("KInput"),p=i.resolveComponent("KButton"),E=i.resolveComponent("router-link");return i.openBlock(),i.createElementBlock("div",bb,[i.createVNode(d,{info:i.unref(s)("certificates.form.fields.snis.tooltip")},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(w,h)=>(i.openBlock(),i.createElementBlock("div",{key:h,class:"sni-field-input"},[!e.isEditing||a.value[h]?(i.openBlock(),i.createBlock(y,{key:0,modelValue:a.value[h],"onUpdate:modelValue":g=>a.value[h]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${h+1}`,disabled:e.isEditing,placeholder:i.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):i.createCommentVNode("",!0),e.isEditing?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",wb,[i.createVNode(p,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>l.$emit("remove",h)},{default:i.withCtx(()=>[i.createVNode(i.unref(kp),{color:i.unref(mb)},null,8,["color"])]),_:2},1032,["onClick"]),i.createVNode(p,{appearance:"tertiary","data-testid":"add-sni",disabled:h!==a.value.length-1,icon:"",onClick:c[0]||(c[0]=g=>l.$emit("add"))},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao))]),_:2},1032,["disabled"])]))]))),128)),a.value.length===0?(i.openBlock(),i.createElementBlock("div",vb,[i.createVNode(p,{onClick:c[1]||(c[1]=w=>l.$emit("add"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):i.createCommentVNode("",!0),e.isEditing?(i.openBlock(),i.createBlock(i.unref(o),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:i.withCtx(()=>[i.createVNode(E,{to:e.sniListRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),Cb={class:"kong-ui-entities-certificates-form"},Sb=dr(i.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading"],setup(e,{emit:t}){var N;const r=t,n=e,o=Wr.useRouter(),{i18nT:s,i18n:{t:a}}=ct.useI18n(),{getMessageFromError:l}=ep(),{axiosInstance:c}=Co((N=n.config)==null?void 0:N.axiosRequestConfig),d=i.computed(()=>Ii.form[n.config.app].edit),y=i.computed(()=>n.certificateId?Ht.Edit:Ht.Create),p=i.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),E=i.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),w=i.computed(()=>(y.value===Ht.Create||JSON.stringify(p.fields)!==JSON.stringify(E))&&!!p.fields.cert&&!!p.fields.key),h=I=>{var x,O;p.fields.cert=(I==null?void 0:I.cert)||"",p.fields.key=(I==null?void 0:I.key)||"",p.fields.certAlt=(I==null?void 0:I.cert_alt)||"",p.fields.keyAlt=(I==null?void 0:I.key_alt)||"",p.fields.snis=(x=I==null?void 0:I.snis)!=null&&x.length?I.snis:[""],p.fields.tags=((O=I==null?void 0:I.tags)==null?void 0:O.join(", "))||"",Object.assign(E,p.fields)},g=()=>{o.push(n.config.cancelRoute)},b=()=>{p.fields.snis.push("")},v=I=>{p.fields.snis.splice(I,1)},B=i.computed(()=>{var x,O;let I=`${n.config.apiBaseUrl}${Ii.form[n.config.app].validate}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((x=n.config)==null?void 0:x.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.certificateId),I}),C=i.computed(()=>{var x,O;let I=`${n.config.apiBaseUrl}${Ii.form[n.config.app][y.value]}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((x=n.config)==null?void 0:x.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.certificateId),I}),S=i.computed(()=>{var I,x;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,...n.showSnisField?{snis:p.fields.snis.filter(Boolean)}:{},tags:(x=(I=p.fields.tags.split(","))==null?void 0:I.map(O=>String(O||"").trim()))==null?void 0:x.filter(O=>O!=="")}}),T=async()=>{var I,x,O,G,R,J,ee,ne,me;try{p.isReadonly=!0;let ie;await c.post(B.value,S.value),y.value==="create"?ie=await c.post(C.value,S.value):y.value==="edit"&&(ie=((I=n.config)==null?void 0:I.app)==="konnect"?await c.put(C.value,S.value):await c.patch(C.value,S.value)),p.fields.cert=((x=ie==null?void 0:ie.data)==null?void 0:x.cert)||"",p.fields.key=((O=ie==null?void 0:ie.data)==null?void 0:O.key)||"",p.fields.certAlt=((G=ie==null?void 0:ie.data)==null?void 0:G.cert_alt)||"",p.fields.keyAlt=((R=ie==null?void 0:ie.data)==null?void 0:R.key_alt)||"",p.fields.snis=(ee=(J=ie==null?void 0:ie.data)==null?void 0:J.snis)!=null&&ee.length?ie.data.snis:[""],p.fields.tags=((me=(ne=ie==null?void 0:ie.data)==null?void 0:ne.tags)==null?void 0:me.join(", "))||"",Object.assign(E,p.fields),r("update",ie==null?void 0:ie.data)}catch(ie){p.errorMessage=l(ie),r("error",ie)}finally{p.isReadonly=!1}};return(I,x)=>{const O=i.resolveComponent("KTextArea"),G=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Cb,[i.createVNode(i.unref(Gf),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":S.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":x[7]||(x[7]=R=>I.$emit("error",R)),"onFetch:success":h,onLoading:x[8]||(x[8]=R=>I.$emit("loading",R)),onSubmit:T},{default:i.withCtx(()=>[i.createVNode(i.unref(ko),{description:i.unref(a)("certificates.form.sections.ssl.description"),title:i.unref(a)("certificates.form.sections.ssl.title")},{default:i.withCtx(()=>[i.createVNode(O,{modelValue:p.fields.cert,"onUpdate:modelValue":x[0]||(x[0]=R=>p.fields.cert=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:i.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:p.fields.key,"onUpdate:modelValue":x[1]||(x[1]=R=>p.fields.key=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:i.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:p.fields.certAlt,"onUpdate:modelValue":x[2]||(x[2]=R=>p.fields.certAlt=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:i.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":x[3]||(x[3]=R=>p.fields.keyAlt=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:i.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),e.showSnisField&&e.config.sniListRoute?(i.openBlock(),i.createBlock(kb,{key:0,modelValue:p.fields.snis,"onUpdate:modelValue":x[4]||(x[4]=R=>p.fields.snis=R),"is-editing":y.value===i.unref(Ht).Edit,"sni-list-route":e.config.sniListRoute,onAdd:b,onRemove:x[5]||(x[5]=R=>v(R))},null,8,["modelValue","is-editing","sni-list-route"])):i.createCommentVNode("",!0)]),_:1},8,["description","title"]),i.createVNode(i.unref(ko),{description:i.unref(a)("certificates.form.sections.general.description"),title:i.unref(a)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(G,{modelValue:p.fields.tags,"onUpdate:modelValue":x[6]||(x[6]=R=>p.fields.tags=R),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:i.unref(a)("certificates.form.fields.tags.help"),label:i.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:i.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-59428be8"]]),So="/v2/control-planes/{controlPlaneId}/core-entities",xo="/{workspace}",ji={list:{konnect:`${So}/ca_certificates`,kongManager:`${xo}/ca_certificates`},form:{konnect:{create:`${So}/ca_certificates`,edit:`${So}/ca_certificates/{id}`,validate:`${So}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${xo}/ca_certificates`,edit:`${xo}/ca_certificates/{id}`,validate:`${xo}/schemas/ca_certificates/validate`}}},xb={class:"kong-ui-ca-certificate-entity-config-card"},Ab={key:0},Bb=dr(i.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],n=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=ct.useI18n(),{convertKeyToTitle:l}=rp(),{getPropValue:c}=ip(),{getCertificateData:d}=ct.useCertificate(),y=i.computed(()=>ji.form[o.config.app].edit),p=i.ref(),E=i.computed(()=>{if(p.value)return d(p.value)}),w=i.computed(()=>{var C;return((C=E.value)==null?void 0:C.schemaIssuer)||""}),h=i.computed(()=>{var C,S;return(C=E.value)!=null&&C.schemaExpiry?a((S=E.value)==null?void 0:S.schemaExpiry):""}),g=i.computed(()=>{var C;return((C=E.value)==null?void 0:C.schemaKeyUsages)||[]}),b=(C,S)=>{const T=c("rowValue",S);if(C==="expiry")return h.value;if(C==="key_usages")return g.value;if(T)return T[C]},v=C=>{p.value=C,n("fetch:success",C)},B=i.ref({id:{},updated_at:{},created_at:{},cert:{section:pe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:pe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:pe.Basic,type:ce.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:pe.Basic,order:1.7,forceShow:!0},issuer:{section:pe.Basic,order:1.5,forceShow:!0},key_usages:{section:pe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(C,S)=>{const T=i.resolveComponent("KCodeBlock"),N=i.resolveComponent("KLabel"),I=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",xb,[i.createVNode(i.unref(zf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":S[0]||(S[0]=x=>C.$emit("fetch:error",x)),"onFetch:success":v,onLoading:S[1]||(S[1]=x=>C.$emit("loading",x))},{cert:i.withCtx(x=>[i.unref(c)("rowValue",x)?(i.openBlock(),i.createBlock(T,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",x),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),"metadata-label":i.withCtx(()=>[i.createVNode(N,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(x=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",x)).filter(O=>!r.includes(O)),O=>(i.openBlock(),i.createBlock(i.unref(po),{key:O,"data-testid":`ca-cert-metadata-${O}`,item:{key:O,label:i.unref(l)(O),value:b(O,x),type:O==="key_usages"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(w.value||"–"),1)]),key_usages:i.withCtx(()=>[g.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ab,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(g.value,(x,O)=>(i.openBlock(),i.createBlock(I,{key:`key_usages-badge-tag-${O}`,class:"config-badge","data-testid":`key_usages-badge-tag-${O}`,tooltip:x,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-b34eea10"]]),Ib={class:"kong-ui-entities-ca-certificates-list"},Nb={key:0},Eb={key:1},Ob={key:0},_b={key:1},Vb={key:1},Tb=dr(i.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var X;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ct.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=Co((X=n.config)==null?void 0:X.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),E={issuer:{label:o("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},w=i.computed(()=>{var U,q;let te=`${n.config.apiBaseUrl}${ji.list[n.config.app]}`;return n.config.app==="konnect"?te=te.replace(/{controlPlaneId}/gi,((U=n.config)==null?void 0:U.controlPlaneId)||""):n.config.app==="kongManager"&&(te=te.replace(/\/{workspace}/gi,(q=n.config)!=null&&q.workspace?`/${n.config.workspace}`:"")),te}),h=i.ref(""),g=i.computed(()=>{const te=n.config.app==="konnect"||n.config.isExactMatch;return te?{isExactMatch:te,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:te,schema:n.config.filterSchema}}),{fetcher:b,fetcherState:v}=tp(n.config,w.value),B=()=>{h.value=""},C=()=>{d.value++},S=i.ref(null),T=(te,U)=>{const q=te.id;if(!U(q)){r("copy:error",{entity:te,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,field:"id",message:o("ca-certificates.copy.success",{val:q})})},N=(te,U)=>{const q=JSON.stringify(te);if(!U(q)){r("copy:error",{entity:te,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,message:o("ca-certificates.copy.success_brief")})},I=async te=>{var q;await((q=n.canRetrieve)==null?void 0:q.call(n,te))&&l.push(n.config.getViewRoute(te.id))},x=te=>({label:o("ca-certificates.actions.view"),to:n.config.getViewRoute(te)}),O=te=>({label:o("ca-certificates.actions.edit"),to:n.config.getEditRoute(te)}),G=i.ref(void 0),R=i.ref(!1),J=i.ref(!1),ee=i.ref(""),ne=Xf(n.config,w.value),{certificateDataCache:me,getCertificateData:ie}=ct.useCertificate(),Ne=te=>{G.value=te,R.value=!0},qr=()=>{R.value=!1},Kr=async()=>{var te,U,q;if((te=G.value)!=null&&te.id){J.value=!0;try{await c.delete(ne(G.value.id)),J.value=!1,R.value=!1,d.value++,r("delete:success",G.value)}catch(fe){ee.value=((q=(U=fe.response)==null?void 0:U.data)==null?void 0:q.message)||fe.message||o("ca-certificates.errors.delete"),r("error",fe)}finally{J.value=!1}}},fr=i.ref(!1);i.watch(v,te=>{var U,q,fe,Ue;if(Array.isArray((U=te==null?void 0:te.response)==null?void 0:U.data)&&(fr.value=te.response.data.length>0),te.status===Ft.Error){S.value={title:o("ca-certificates.errors.general")},(Ue=(fe=(q=te.error)==null?void 0:q.response)==null?void 0:fe.data)!=null&&Ue.message&&(S.value.message=te.error.response.data.message),r("error",te.error);return}me.value={},S.value=null});const Dt=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("ca-certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("ca-certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(Dt.value.title=o("ca-certificates.list.empty_state.title"),Dt.value.ctaText=o("ca-certificates.actions.create"))}),(te,U)=>{const q=i.resolveComponent("KButton"),fe=i.resolveComponent("KBadge"),Ue=i.resolveComponent("KTruncate"),Qe=i.resolveComponent("KDropdownItem"),zr=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",Ib,[i.createVNode(i.unref(Wf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Dt.value,"enable-entity-actions":"","error-message":S.value,fetcher:i.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":i.unref(E),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":U[2]||(U[2]=re=>I(re)),onSort:C},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(Zf),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=re=>h.value=re),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref(jt),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[i.vShow,fr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Nb,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.issuer?re.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",Eb,i.toDisplayString(i.unref(ie)(re).schemaIssuer||"-"),1))]}),expiry:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Ob,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.expiry?i.unref(s)(re.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",_b,i.toDisplayString(i.unref(ie)(re).schemaExpiry?i.unref(s)(i.unref(ie)(re).schemaExpiry):"-"),1))]}),tags:i.withCtx(({row:re})=>{var xe;return[((xe=re==null?void 0:re.tags)==null?void 0:xe.length)>0?(i.openBlock(),i.createBlock(Ue,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(re==null?void 0:re.tags,Z=>(i.openBlock(),i.createBlock(fe,{key:Z,onClick:U[1]||(U[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Z),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Vb,"-"))]}),actions:i.withCtx(({row:re})=>[i.createVNode(zr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Qe,{"data-testid":"action-entity-copy-id",onClick:Z=>T(re,xe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(zr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Qe,{"data-testid":"action-entity-copy-json",onClick:Z=>N(re,xe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(jt),{"auth-function":()=>e.canRetrieve(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{"data-testid":"action-entity-view","has-divider":"",item:x(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canEdit(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{"data-testid":"action-entity-edit",item:O(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canDelete(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Ne(re)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),i.createVNode(i.unref(Jf),{"action-pending":J.value,"entity-type":i.unref(La).CACertificate,error:ee.value,title:i.unref(o)("ca-certificates.delete.title"),visible:R.value,onCancel:qr,onProceed:Kr},{description:i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-8620b081"]]),jb={class:"kong-ui-entities-ca-certificates-form"},Db=dr(i.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var C;const r=t,n=e,o=Wr.useRouter(),{i18n:{t:s}}=ct.useI18n(),{getMessageFromError:a}=ep(),{axiosInstance:l}=Co((C=n.config)==null?void 0:C.axiosRequestConfig),c=i.computed(()=>ji.form[n.config.app].edit),d=i.computed(()=>n.certificateId?Ht.Edit:Ht.Create),y=i.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=i.reactive({cert:"",certDigest:"",tags:""}),E=i.computed(()=>(d.value===Ht.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=S=>{var T;y.fields.cert=(S==null?void 0:S.cert)||"",y.fields.certDigest=(S==null?void 0:S.cert_digest)||"",y.fields.tags=((T=S==null?void 0:S.tags)==null?void 0:T.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(n.config.cancelRoute)},g=i.computed(()=>{var T,N;let S=`${n.config.apiBaseUrl}${ji.form[n.config.app].validate}`;return n.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),S=S.replace(/{id}/gi,n.certificateId),S}),b=i.computed(()=>{var T,N;let S=`${n.config.apiBaseUrl}${ji.form[n.config.app][d.value]}`;return n.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),S=S.replace(/{id}/gi,n.certificateId),S}),v=i.computed(()=>{var S,T;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(T=(S=y.fields.tags.split(","))==null?void 0:S.map(N=>String(N||"").trim()))==null?void 0:T.filter(N=>N!=="")}}),B=async()=>{var S,T,N,I,x;try{y.isReadonly=!0;let O;await l.post(g.value,v.value),d.value==="create"?O=await l.post(b.value,v.value):d.value==="edit"&&(O=((S=n.config)==null?void 0:S.app)==="konnect"?await l.put(b.value,v.value):await l.patch(b.value,v.value)),y.fields.cert=((T=O==null?void 0:O.data)==null?void 0:T.cert)||"",y.fields.certDigest=((N=O==null?void 0:O.data)==null?void 0:N.cert_digest)||"",y.fields.tags=((x=(I=O==null?void 0:O.data)==null?void 0:I.tags)==null?void 0:x.join(", "))||"",Object.assign(p,y.fields),r("update",O==null?void 0:O.data)}catch(O){y.errorMessage=a(O),r("error",O)}finally{y.isReadonly=!1}};return(S,T)=>{const N=i.resolveComponent("KTextArea"),I=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",jb,[i.createVNode(i.unref(Gf),{"can-submit":E.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":c.value,"form-fields":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":T[3]||(T[3]=x=>S.$emit("error",x)),"onFetch:success":w,onLoading:T[4]||(T[4]=x=>S.$emit("loading",x)),onSubmit:B},{default:i.withCtx(()=>[i.createVNode(i.unref(ko),{description:i.unref(s)("ca-certificates.form.sections.cert.description"),title:i.unref(s)("ca-certificates.form.sections.cert.title")},{default:i.withCtx(()=>[i.createVNode(N,{modelValue:y.fields.cert,"onUpdate:modelValue":T[0]||(T[0]=x=>y.fields.cert=x),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:i.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:i.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),i.createVNode(I,{modelValue:y.fields.certDigest,"onUpdate:modelValue":T[1]||(T[1]=x=>y.fields.certDigest=x),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:i.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(ko),{description:i.unref(s)("ca-certificates.form.sections.general.description"),title:i.unref(s)("ca-certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(I,{modelValue:y.fields.tags,"onUpdate:modelValue":T[2]||(T[2]=x=>y.fields.tags=x),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:i.unref(s)("ca-certificates.form.fields.tags.help"),label:i.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:i.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-54396784"]]),$b={class:"kong-ui-certificate-entity-config-card"},Mb={key:0},Rb=dr(i.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ct.useI18n(),{convertKeyToTitle:l}=rp(),{getPropValue:c}=ip(),{getCertificateData:d}=ct.useCertificate(),y=i.computed(()=>Ii.form[n.config.app].edit),p=i.ref(),E=i.ref({id:{},cert:{section:pe.Basic},key:{section:pe.Basic,type:ce.Redacted},metadata:{section:pe.Basic,type:ce.Json},snis:{section:pe.Basic,type:ce.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...n.config.app==="kongManager"&&{expiry:{section:pe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:pe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:pe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:pe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:pe.Advanced},key_alt:{section:pe.Advanced,type:ce.Redacted}}),w=x=>{p.value=x,r("fetch:success",x)},h=(x,O)=>{const G=c("rowValue",O);if(x==="expiry")return b.value;if(x==="key_usages")return S.value;if(x==="san_names")return B.value;if(G)return G[x]},g=i.computed(()=>{if(p.value)return d(p.value)}),b=i.computed(()=>{var x,O;return(x=g.value)!=null&&x.schemaExpiry?s((O=g.value)==null?void 0:O.schemaExpiry):""}),v=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaIssuer)||""}),B=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaSanNames)||""}),C=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaSubject)||""}),S=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaKeyUsages)||[]}),T=i.computed(()=>{var x,O;return((O=(x=p==null?void 0:p.value)==null?void 0:x.snis)==null?void 0:O.length)>0}),N=i.computed(()=>{var x;return!!((x=p==null?void 0:p.value)!=null&&x.cert_alt)}),I=x=>{var O,G;return x==="san_names"?o("certificates.list.table_headers.san"):((G=(O=E.value)==null?void 0:O[x])==null?void 0:G.label)||l(x)};return(x,O)=>{const G=i.resolveComponent("KCodeBlock"),R=i.resolveComponent("KLabel"),J=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",$b,[i.createVNode(i.unref(zf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":E.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":O[0]||(O[0]=ee=>x.$emit("fetch:error",ee)),"onFetch:success":w,onLoading:O[1]||(O[1]=ee=>x.$emit("loading",ee))},i.createSlots({"cert-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:i.withCtx(ee=>[i.unref(c)("rowValue",ee)?(i.openBlock(),i.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",ee),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),"key-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":i.withCtx(()=>[i.createVNode(R,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(ee=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",ee)),ne=>(i.openBlock(),i.createBlock(i.unref(po),{key:ne,item:{key:ne,value:h(ne,ee),label:I(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(v.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(B.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C.value||"–"),1)]),"cert_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:i.withCtx(()=>[S.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Mb,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(S.value,(ee,ne)=>(i.openBlock(),i.createBlock(J,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:ee,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(ee),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[T.value?void 0:{name:"snis",fn:i.withCtx(()=>[i.createTextVNode(" – ")]),key:"0"},N.value?{name:"cert_alt",fn:i.withCtx(ee=>[i.createTextVNode(" > "),i.unref(c)("rowValue",ee)?(i.openBlock(),i.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:i.unref(c)("rowValue",ee),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-d40682b9"]]);je.CACertificateConfigCard=Bb,je.CACertificateForm=Db,je.CACertificateList=Tb,je.CertificateConfigCard=Rb,je.CertificateForm=Sb,je.CertificateList=gb,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|
|
148
|
+
`:""}var m0=g0,b0={dump:m0};function il(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var w0=Ve,v0=Kd,k0=Jd,C0=ef,S0=tf,x0=Wa,A0=Af.load,B0=Af.loadAll,I0=b0.dump,N0=Pe,E0={binary:af,float:Xd,map:Wd,null:Yd,pairs:cf,set:uf,timestamp:of,bool:Zd,int:Qd,merge:sf,omap:lf,seq:Gd,str:zd},O0=il("safeLoad","load"),_0=il("safeLoadAll","loadAll"),V0=il("safeDump","dump"),T0={Type:w0,Schema:v0,FAILSAFE_SCHEMA:k0,JSON_SCHEMA:C0,CORE_SCHEMA:S0,DEFAULT_SCHEMA:x0,load:A0,loadAll:B0,dump:I0,YAMLException:N0,types:E0,safeLoad:O0,safeLoadAll:_0,safeDump:V0};const j0={class:"yaml-config"},Kf=i.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=i.computed(()=>{const n=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,o])=>o!==null&&o!==""&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(n).length===0&&n.constructor===Object?"":T0.dump(n).trim()});return(n,o)=>{const s=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",j0,[t.yamlRecord?(i.openBlock(),i.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):i.createCommentVNode("",!0)])}}}),D0={key:0,class:"config-card-display-form"},$0=["data-testid"],M0={key:0,class:"config-card-prop-section-title"},R0=i.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=i.useSlots(),{i18n:{t:n}}=Ie.useI18n(),o=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=i.computed(()=>{if(!t.record)return t.record;const a=JSON.parse(JSON.stringify(t.record));return delete a.created_at,delete a.updated_at,a});return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[e.format==="structured"?(i.openBlock(),i.createElementBlock("div",D0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propListTypes,c=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${c}-props`,class:i.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(i.openBlock(),i.createElementBlock("div",M0,i.toDisplayString(c==="advanced"?i.unref(n)("baseConfigCard.sections.advanced"):i.unref(n)("baseConfigCard.sections.plugin")),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propertyCollections[c],d=>(i.openBlock(),i.createBlock(po,{key:d.key,item:d},i.createSlots({label:i.withCtx(()=>[i.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:i.withCtx(({rowValue:y})=>[i.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[o(d)?{name:"label-tooltip",fn:i.withCtx(()=>[i.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,$0))),128))])):i.createCommentVNode("",!0),e.format==="json"&&t.record?(i.openBlock(),i.createBlock(Ld,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):i.createCommentVNode("",!0),e.format==="yaml"&&t.record?(i.openBlock(),i.createBlock(Kf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):i.createCommentVNode("",!0)],64))}}),P0=ut(R0,[["__scopeId","data-v-2052238b"]]),kt="24px",Ti=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},U0=e=>(i.pushScopeId("data-v-c1f7c39c"),e=e(),i.popScopeId(),e),L0=["aria-hidden"],H0={key:0,"data-testid":"kui-icon-svg-title"},F0=U0(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),q0=i.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",H0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),F0],8,L0))]),_:1},8,["aria-hidden","style"]))}}),K0=Ti(q0,[["__scopeId","data-v-c1f7c39c"]]),z0=e=>(i.pushScopeId("data-v-fbe6ddff"),e=e(),i.popScopeId(),e),G0=["aria-hidden"],W0={key:0,"data-testid":"kui-icon-svg-title"},J0=z0(()=>i.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),Y0=i.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",W0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),J0],8,G0))]),_:1},8,["aria-hidden","style"]))}}),Z0=Ti(Y0,[["__scopeId","data-v-fbe6ddff"]]),Q0=e=>(i.pushScopeId("data-v-745761f6"),e=e(),i.popScopeId(),e),X0=["aria-hidden"],e1={key:0,"data-testid":"kui-icon-svg-title"},t1=Q0(()=>i.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),r1=i.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",e1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),t1],8,X0))]),_:1},8,["aria-hidden","style"]))}}),i1=Ti(r1,[["__scopeId","data-v-745761f6"]]),n1=e=>(i.pushScopeId("data-v-863d10eb"),e=e(),i.popScopeId(),e),o1=["aria-hidden"],s1={key:0,"data-testid":"kui-icon-svg-title"},a1=n1(()=>i.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),l1=i.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",s1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),a1],8,o1))]),_:1},8,["aria-hidden","style"]))}}),c1=Ti(l1,[["__scopeId","data-v-863d10eb"]]),u1=e=>(i.pushScopeId("data-v-d9894a05"),e=e(),i.popScopeId(),e),d1=["aria-hidden"],f1={key:0,"data-testid":"kui-icon-svg-title"},p1=u1(()=>i.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),h1=i.defineComponent({__name:"MoreIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kt}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon more-icon","data-testid":"kui-icon-wrapper-more-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-more-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",f1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),p1],8,d1))]),_:1},8,["aria-hidden","style"]))}}),y1=Ti(h1,[["__scopeId","data-v-d9894a05"]]),g1={class:"config-card-title","data-testid":"config-card-title"},m1={class:"config-card-actions"},b1=["href"],w1={class:"config-card-details-section"},v1=i.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const n=t,o=e,{i18n:{t:s}}=Ie.useI18n(),{getMessageFromError:a}=Ie.useErrors(),{convertKeyToTitle:l}=Ie.useStringHelpers(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=i.ref("structured"),p=N=>{y.value=N==null?void 0:N.value},E={id:{type:ce.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:pe.Basic},name:{order:1,section:pe.Basic},enabled:{type:ce.BadgeStatus,order:2,section:pe.Basic},updated_at:{type:ce.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:ce.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:ce.BadgeTag,order:-1,section:pe.Basic}},w=i.ref(!1),h=i.ref(!1),g=i.ref(""),b=i.ref({}),v=i.computed(()=>{var N,I,x;if(!b.value)return[];const O=[],G=Object.keys(b.value).length;for(const R in b.value){const J=(I=(N=o.configSchema)==null?void 0:N[R])==null?void 0:I.order,ee=(x=E[R])==null?void 0:x.order;let ne=G;(ee||ee===0)&&(ne=ee===-1?G+1:ee),J&&(ne=J===-1?G+1:J),O.push([R,ne])}return O.sort(function(R,J){return R[1]-J[1]}),O.map(R=>{var J,ee;const ne=R[0],me=(J=b.value)==null?void 0:J[ne],ie=((ee=o.configSchema)==null?void 0:ee[ne])||{},Ne=E[ne];return{key:ne,value:me,hidden:ie.hidden||!1,type:ie.type??((Ne==null?void 0:Ne.type)||ce.Text),label:ie.label??((Ne==null?void 0:Ne.label)||l(ne)),tooltip:ie.tooltip??((Ne==null?void 0:Ne.tooltip)||void 0),section:ie.section??((Ne==null?void 0:Ne.section)||pe.Advanced)}}).filter(R=>!R.hidden&&R.key!==o.pluginConfigKey)}),B=i.computed(()=>{var N,I;if(!b.value||!o.pluginConfigKey)return[];const x=b.value[o.pluginConfigKey]||{},O=Object.keys(x).length,G=[];for(const R in x){const J=(I=(N=o.pluginConfigSchema)==null?void 0:N[R])==null?void 0:I.order,ee=x[R];let ne=ee!=null&&ee!==""?O-1:O;J&&(ne=J===-1?O+1:J),G.push([R,ne])}return G.sort(function(R,J){return R[1]-J[1]}),G.map(R=>{var J;const ee=R[0],ne=x[ee],me=((J=o.pluginConfigSchema)==null?void 0:J[ee])||{};return{key:ee,value:ne,hidden:me.hidden||!1,type:me.type??ce.Text,label:me.label??l(ee),tooltip:me.tooltip??void 0,section:pe.Plugin}}).filter(R=>!R.hidden)}),S=i.computed(()=>{var N,I,x,O;return{basic:(N=v.value)==null?void 0:N.filter(G=>G.section===pe.Basic),advanced:(I=v.value)==null?void 0:I.filter(G=>G.section===pe.Advanced),plugin:(O=B.value)==null?void 0:O.concat((x=v.value)==null?void 0:x.filter(G=>G.section===pe.Plugin))}}),C=i.computed(()=>{const N=[];return S.value.basic.length&&N.push("basic"),S.value.advanced.length&&N.push("advanced"),S.value.plugin.length&&N.push("plugin"),N}),T=i.computed(()=>{var N,I;let x=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):o.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(I=o.config)!=null&&I.workspace?`/${o.config.workspace}`:"")),x=x.replace(/{id}/gi,o.config.entityId),x});return i.watch(w,N=>{n("loading",N)},{immediate:!0}),i.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:N}=await c.get(T.value);if(o.dataKey)if(typeof N[o.dataKey]<"u")b.value={...N[o.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:o.dataKey}));else b.value={...N};Object.keys(o.configSchema).filter(I=>o.configSchema[I].forceShow).forEach(I=>{b.value&&typeof b.value[I]>"u"&&(b.value[I]=null)}),n("fetch:success",N)}catch(N){const I=a(N);g.value=I.startsWith("code")?s("baseConfigCard.errors.load"):I,h.value=!0,n("fetch:error",N)}finally{w.value=!1}}),(N,I)=>{const x=i.resolveComponent("KLabel"),O=i.resolveComponent("KSelect"),G=i.resolveComponent("KButton"),R=i.resolveComponent("KSkeleton"),J=i.resolveComponent("KEmptyState"),ee=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(ee,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},i.createSlots({actions:i.withCtx(()=>[i.createElementVNode("div",m1,[i.renderSlot(N.$slots,"actions",{},void 0,!0),i.createVNode(x,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.label),1)]),_:1}),i.createVNode(O,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(i.openBlock(),i.createBlock(G,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:i.withCtx(()=>[i.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[i.createVNode(i.unref(Z0),{size:i.unref(Xy)},null,8,["size"])],8,b1)]),_:1})):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[w.value?(i.openBlock(),i.createBlock(R,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(i.openBlock(),i.createBlock(J,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(g.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",w1,[i.createVNode(P0,{config:e.config,"fetcher-url":T.value,format:y.value,"prop-list-types":C.value,"property-collections":S.value,record:b.value},i.createSlots({_:2},[i.renderList(Object.keys(N.$slots),ne=>({name:ne,fn:i.withCtx(({row:me,rowValue:ie})=>[i.renderSlot(N.$slots,ne,{row:me,rowValue:ie},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("span",g1,[i.renderSlot(N.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),zf=ut(v1,[["__scopeId","data-v-f40a683b"]]),k1=["novalidate"],C1={class:"form-actions","data-testid":"form-actions"},S1=i.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const n=t,o=e,s=Wr.useRouter(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:l}=Ie.useErrors(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=i.ref(!1),y=i.ref(!1),p=i.ref(""),E=i.computed(()=>o.canSubmit===!1||o.isReadonly),w=i.ref(!1),h=i.computed(()=>{var C,T;let N=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((C=o.config)==null?void 0:C.controlPlaneId)||""):o.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(T=o.config)!=null&&T.workspace?`/${o.config.workspace}`:"")),o.editId?(N=N.replace(/{id}/gi,o.editId),N):(N=N.replace(/\/{id}/gi,""),N)}),g=()=>{w.value=!w.value},b=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):v()},v=()=>{n("cancel")},B=()=>{E.value||n("submit")},S=i.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return i.watch(()=>d.value,C=>{n("loading",C)},{immediate:!0}),i.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:C}=await c.get(h.value);n("fetch:success",C)}catch(C){const T=l(C);p.value=T.startsWith("code")?a("baseForm.errors.edit"):T,y.value=!0,n("fetch:error",C)}finally{d.value=!1}}),(C,T)=>{const N=i.resolveComponent("KSkeleton"),I=i.resolveComponent("KEmptyState"),x=i.resolveComponent("KAlert"),O=i.resolveComponent("KButton"),G=i.resolveComponent("KTabs"),R=i.resolveComponent("KSlideout");return i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(N,{key:0,type:"form"})):y.value?(i.openBlock(),i.createBlock(I,{key:1,"action-button-text":i.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(i.openBlock(),i.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:o.noValidate,onReset:i.withModifiers(v,["prevent"]),onSubmit:i.withModifiers(B,["prevent"])},[i.renderSlot(C.$slots,"default",{},void 0,!0),e.errorMessage?(i.openBlock(),i.createBlock(x,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):i.createCommentVNode("",!0),i.createElementVNode("div",C1,[i.renderSlot(C.$slots,"form-actions",{},()=>[i.createVNode(O,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:T[0]||(T[0]=J=>g())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),i.createVNode(O,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),i.createVNode(O,{appearance:"primary","data-testid":"form-submit",disabled:E.value,type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,k1)),i.createVNode(R,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:i.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:T[1]||(T[1]=J=>g())},{default:i.withCtx(()=>[i.createElementVNode("div",null,i.toDisplayString(i.unref(a)("baseForm.configuration.message")),1),i.createVNode(G,{"data-testid":"form-view-configuration-slideout-tabs",tabs:S.value},{json:i.withCtx(()=>[i.createVNode(Ld,{config:e.config,"fetcher-url":h.value,"json-record":o.formFields,"request-method":o.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:i.withCtx(()=>[i.createVNode(Kf,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Gf=ut(S1,[["__scopeId","data-v-fd05df8e"]]),x1=["data-truncate"],A1=i.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const t=e,r=i.computed(()=>{var b;return((b=t.rowEl)==null?void 0:b.querySelector(`[data-testid="${t.keyName}"]`))||null}),n=i.computed(()=>{var b;return((b=r.value)==null?void 0:b.querySelector('[data-truncate="true"]'))||null}),o=i.computed(()=>{var b,v;const B=(b=t.rowEl)==null?void 0:b.querySelectorAll("td");return B?((v=B[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!0}),s=i.computed(()=>o.value||t.tooltip);let a;const l=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{var b,v,B;let S=((b=r.value)==null?void 0:b.clientWidth)||0;if(r.value&&"getComputedStyle"in window){const C=window.getComputedStyle(r.value);S-=(parseFloat(C.paddingLeft)||0)+(parseFloat(C.paddingRight)||0)}y.value=((v=n.value)==null?void 0:v.getBoundingClientRect().width)||0,p.value=S,E.value=((B=d.value)==null?void 0:B.innerText)||""},d=i.ref({}),y=i.ref(0),p=i.ref(0),E=i.ref(""),w=i.computed(()=>[n.value,r.value]),h=i.watch(w,b=>{if(s.value&&(l(),"ResizeObserver"in window&&window)){a=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of b)v&&a.observe(v)}},{immediate:!0,flush:"post",deep:!0}),g=i.computed(()=>s.value?y.value>p.value:!1);return i.onMounted(()=>{c()}),i.onUnmounted(()=>{h()}),(b,v)=>{const B=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:d,class:"content-wrapper"},[s.value?(i.openBlock(),i.createElementBlock("span",{key:0,"data-truncate":s.value||void 0},[i.createVNode(B,{"max-width":"300",placement:"bottom-start",text:g.value?E.value:""},{default:i.withCtx(()=>[i.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,x1)):i.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),B1=ut(A1,[["__scopeId","data-v-b252463e"]]),I1={class:"toolbar-container"},N1={key:0,class:"toolbar-button-container"},E1=["data-testid"],O1=i.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},sortHandlerFunction:{type:Function,default:()=>({})},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,n=t,{i18n:{t:o}}=Ie.useI18n(),s=i.computed(()=>{var N,I;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(N=r.errorMessage)==null?void 0:N.title,message:(I=r.errorMessage)==null?void 0:I.message}}),a=i.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),l=N=>N.hasData||!!r.query,c=i.computed(()=>{const N=[];return Object.keys(r.tableHeaders).forEach(I=>{const x=r.tableHeaders[I];N.push({label:x.label??I,key:I,sortable:x.sortable??!1,hidable:x.hidable??!0})}),r.enableEntityActions&&N.push({key:"actions",hideLabel:!0}),N}),d=N=>({"data-rowid":N.id,"data-testid":N.name,...r.rowAttributes(N)}),y=i.ref({}),p=N=>{var I;return(I=y.value)==null?void 0:I.$el.querySelector(`[data-rowid="${N.id}"]`)},E=N=>{const I={"data-testid":N.headerKey,...r.cellAttributes(N)};return N.colIndex===0&&(I.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),I},w=()=>{n("empty-state-cta-clicked"),h()},h=()=>{n("clear-search-input")},g=i.computed(()=>r.disableRowClick?void 0:(N,I)=>{n("click:row",I)}),b=N=>{n("sort",N)},{setTablePreferences:v,getTablePreferences:B}=by(),S=i.ref(B(a.value)),C=i.computed(()=>{const N=B(a.value);return{...r.initialFetcherParams,...N}}),T=N=>{S.value=N,c.value.forEach(I=>{!("hidable"in I)||!S.value.columnVisibility||I.hidable===!1&&(S.value.columnVisibility[I.key]=!0)}),a.value&&v(a.value,N)};return(N,I)=>{const x=i.resolveComponent("KButton"),O=i.resolveComponent("KDropdown"),G=i.resolveComponent("KTable"),R=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(R,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:i.withCtx(()=>[i.createVNode(G,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":E,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,error:s.value.hasError,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":C.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":d,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":S.value,onEmptyStateActionClick:w,"onRow:click":g.value,onSort:I[0]||(I[0]=J=>b(J)),"onUpdate:tablePreferences":T},i.createSlots({toolbar:i.withCtx(({state:J})=>[i.withDirectives(i.createElementVNode("div",I1,[i.renderSlot(N.$slots,"toolbar-filter",{},void 0,!0),N.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",N1,[i.renderSlot(N.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,l(J)]])]),actions:i.withCtx(({row:J,rowKey:ee,rowValue:ne})=>[i.createElementVNode("div",{class:"actions-container","data-testid":J.name},[i.createVNode(O,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(N.$slots,"actions",{row:J,rowKey:ee,rowValue:ne},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(x,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:i.withCtx(()=>[i.createVNode(i.unref(y1))]),_:1})]),_:2},1032,["width"])],8,E1)]),_:2},[i.renderList(e.tableHeaders,(J,ee)=>({name:ee,fn:i.withCtx(({row:ne,rowKey:me,rowValue:ie})=>[i.createVNode(B1,{"key-name":String(ee),"row-el":p(ne),tooltip:J.tooltip},{default:i.withCtx(()=>[i.renderSlot(N.$slots,ee,{row:ne,rowKey:me,rowValue:ie},()=>[i.createTextVNode(i.toDisplayString(ie),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:i.withCtx(()=>[i.createVNode(i.unref(K0))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Wf=ut(O1,[["__scopeId","data-v-71b4425a"]]),_1={key:0,class:"kong-ui-entity-delete-error"},V1={key:1,class:"description"},T1=i.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:t}){const{i18nT:r}=Ie.useI18n(),n=e,o=t,s=i.computed(()=>n.needConfirm?n.entityName:""),a=()=>{o("cancel")},l=()=>{o("proceed")};return(c,d)=>{const y=i.resolveComponent("KAlert"),p=i.resolveComponent("KPrompt");return i.openBlock(),i.createBlock(p,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:l},{default:i.withCtx(()=>[e.error?(i.openBlock(),i.createElementBlock("div",_1,[i.createVNode(y,{appearance:"danger"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.error),1)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(i.unref(r),{class:"message",keypath:n.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},i.createSlots({entityType:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.entityType),1)]),_:2},[n.entityName?{name:"entityName",fn:i.withCtx(()=>[i.createElementVNode("strong",null,i.toDisplayString(n.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),n.description||c.$slots.description?(i.openBlock(),i.createElementBlock("div",V1,[i.renderSlot(c.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(n.description),1)],!0)])):i.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Jf=ut(T1,[["__scopeId","data-v-4361d622"]]),j1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},D1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},$1=["fill"],M1={mask:"url(#mask0_180_20349)"},R1=["fill"],Yf=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Jy})`}},setup(e){return(t,r)=>(i.openBlock(),i.createElementBlock("svg",j1,[i.createElementVNode("mask",D1,[i.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,$1)]),i.createElementVNode("g",M1,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,R1)])]))}}),P1={key:1,class:"kong-ui-entity-filter"},U1={class:"kong-ui-entity-filter-menu"},L1=["data-testid"],H1=["onClick","onKeydown"],F1={class:"menu-item-indicator"},q1={class:"menu-item-body"},K1=["for"],z1={class:"menu-item-buttons"},G1={class:"filter-clear-button-container"},W1=i.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{i18n:{t:r}}=Ie.useI18n(),n=e,o=t,s=i.ref(!1),a=i.ref({}),l=i.ref(new Set),c=i.computed(()=>{const C=[];return new URLSearchParams(n.modelValue).forEach((T,N)=>{T!==""&&C.push(N)}),C}),d=i.computed(()=>{const C=n.config.fields;return Object.keys(C).filter(T=>{var N;return(N=C==null?void 0:C[T])==null?void 0:N.searchable}).map(T=>({label:C[T].label||T,value:T,expanded:!1}))});i.watch(()=>n.modelValue,C=>{a.value={},new URLSearchParams(C).forEach((T,N)=>{a.value[N]=T})});const y=()=>{s.value=!s.value},p=C=>{l.value.has(C)?l.value.delete(C):l.value.add(C)},E=C=>{o("update:modelValue",C)},w=()=>{E("")},h=C=>`filter-${C}`,g=C=>{var T,N;return(((N=(T=n.config.schema)==null?void 0:T[C])==null?void 0:N.values)??[]).map(I=>({value:I,label:I}))},b=C=>{var T,N;return((N=(T=n.config.schema)==null?void 0:T[C])==null?void 0:N.type)??"text"},v=C=>{a.value={...a.value,[C]:""},S()},B=()=>{a.value={},S(!0)},S=(C=!1)=>{const T=Object.keys(a.value).reduce((N,I)=>(a.value[I]&&(N[I]=`${a.value[I]}`),N),{});C&&(s.value=!1),o("update:modelValue",new URLSearchParams(T).toString())};return(C,T)=>{const N=i.resolveComponent("KInput"),I=i.resolveComponent("KButton"),x=i.resolveComponent("KSelect");return e.config.isExactMatch?(i.openBlock(),i.createBlock(N,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":E},{before:i.withCtx(()=>[i.createVNode(Yf)]),after:i.withCtx(()=>[i.withDirectives(i.createVNode(i.unref(c1),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[i.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",P1,[i.createVNode(I,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:i.withCtx(()=>[i.createVNode(Yf),i.createTextVNode(" "+i.toDisplayString(i.unref(r)("filter.filterButtonText"))+" "+i.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),i.withDirectives(i.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:y},null,512),[[i.vShow,s.value]]),i.withDirectives(i.createElementVNode("div",U1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,O=>{var G,R;return i.openBlock(),i.createElementBlock("div",{key:O.value,class:"kong-ui-entity-filter-menu-item","data-testid":O.value},[i.createElementVNode("span",{class:i.normalizeClass(["menu-item-title",{expanded:l.value.has(O.value)}]),role:"button",tabindex:"0",onClick:J=>p(O.value),onKeydown:i.withKeys(J=>p(O.value),["enter"])},[i.createTextVNode(i.toDisplayString(O.label)+" ",1),i.withDirectives(i.createElementVNode("span",F1,null,512),[[i.vShow,c.value.includes(O.value)]]),i.createVNode(i.unref(i1),{class:i.normalizeClass(["menu-item-expand-icon",{expanded:l.value.has(O.value)}]),color:i.unref(Zy)},null,8,["class","color"])],42,H1),i.withDirectives(i.createElementVNode("div",q1,[i.createElementVNode("label",{class:"menu-item-label",for:h(O.value)},i.toDisplayString(i.unref(r)("filter.fieldLabel")),9,K1),((R=(G=e.config.schema)==null?void 0:G[O.value])==null?void 0:R.type)==="select"?(i.openBlock(),i.createBlock(x,{key:0,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,items:g(O.value),placeholder:i.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(N,{key:1,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,autocomplete:"off",placeholder:i.unref(r)("filter.inputPlaceholder"),type:b(O.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[i.vShow,l.value.has(O.value)]]),i.withDirectives(i.createElementVNode("div",z1,[i.createVNode(I,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:T[0]||(T[0]=J=>S(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.applyButtonText")),1)]),_:1}),i.createVNode(I,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:J=>v(O.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[i.vShow,l.value.has(O.value)]])],8,L1)}),128)),i.createElementVNode("div",G1,[i.createVNode(I,{appearance:"tertiary",size:"small",onClick:B},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[i.vShow,s.value]])]))}}}),Zf=ut(W1,[["__scopeId","data-v-94990087"]]),jt=i.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=i.ref(void 0),n=i.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return i.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>n.value?i.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):i.createCommentVNode("",!0)}});let vo;const J1=new Uint8Array(16);function Y1(){if(!vo&&(vo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vo(J1)}const Te=[];for(let e=0;e<256;++e)Te.push((e+256).toString(16).slice(1));function Z1(e,t=0){return Te[e[t+0]]+Te[e[t+1]]+Te[e[t+2]]+Te[e[t+3]]+"-"+Te[e[t+4]]+Te[e[t+5]]+"-"+Te[e[t+6]]+Te[e[t+7]]+"-"+Te[e[t+8]]+Te[e[t+9]]+"-"+Te[e[t+10]]+Te[e[t+11]]+Te[e[t+12]]+Te[e[t+13]]+Te[e[t+14]]+Te[e[t+15]]}const Q1=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Qf={randomUUID:Q1};function X1(e,t,r){if(Qf.randomUUID&&!t&&!e)return Qf.randomUUID();e=e||{};const n=e.random||(e.rng||Y1)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return Z1(n)}const eb=["aria-labelledby"],tb={class:"form-section-wrapper"},rb={key:1,class:"form-section-description"},ib={key:2,class:"form-section-footer"},nb={class:"form-section-content"},ob=i.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(e){const t=i.useSlots(),r=X1();return(n,o)=>(i.openBlock(),i.createElementBlock("div",{"aria-labelledby":e.title?i.unref(r):void 0,class:i.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[i.createElementVNode("div",tb,[e.hideInfoHeader?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.titleTag),{key:0,id:i.unref(r),class:"form-section-title"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.title),1)]),_:1},8,["id"])):i.createCommentVNode("",!0),e.description||i.unref(t).description?(i.openBlock(),i.createElementBlock("div",rb,[i.renderSlot(n.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(e.description),1)],!0)])):i.createCommentVNode("",!0),i.unref(t).footer?(i.openBlock(),i.createElementBlock("div",ib,[i.renderSlot(n.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",nb,[i.renderSlot(n.$slots,"default",{},void 0,!0)])])],10,eb))}}),ko=ut(ob,[["__scopeId","data-v-b1f74200"]]),{useAxios:Co,useDeleteUrlBuilder:Xf,useErrors:ep,useExternalLinkCreator:ew,useFetchUrlBuilder:tw,useFetcher:tp,useDebouncedFilter:rw,useStringHelpers:rp,useHelpers:ip,useGatewayFeatureSupported:iw,useTruncationDetector:nw,useValidators:ow}=Ie,sb={class:"kong-ui-entities-certificates-list"},ab={key:0},lb={key:1},cb={key:0},ub={key:1},db={key:0},fb={key:1},pb={key:1},hb={key:1},yb=i.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var te;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ct.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=Co((te=n.config)==null?void 0:te.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),E={subject:{label:o("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},w=i.computed(()=>{var q,fe;let U=`${n.config.apiBaseUrl}${Ii.list[n.config.app]}`;return n.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((q=n.config)==null?void 0:q.controlPlaneId)||""):n.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(fe=n.config)!=null&&fe.workspace?`/${n.config.workspace}`:"")),U}),h=i.ref(""),g=i.computed(()=>{const U=n.config.app==="konnect"||n.config.isExactMatch;return U?{isExactMatch:U,placeholder:o("certificates.search.placeholder")}:{isExactMatch:U,schema:n.config.filterSchema}}),{fetcher:b,fetcherState:v}=tp(n.config,w.value),B=()=>{h.value=""},S=()=>{d.value++},C=i.ref(null),T=(U,q)=>{const fe=U.id;if(!q(fe)){r("copy:error",{entity:U,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:o("certificates.copy.success",{val:fe})})},N=(U,q)=>{const fe=JSON.stringify(U);if(!q(fe)){r("copy:error",{entity:U,message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,message:o("certificates.copy.success_brief")})},I=async U=>{var fe;await((fe=n.canRetrieve)==null?void 0:fe.call(n,U))&&l.push(n.config.getViewRoute(U.id))},x=U=>({label:o("certificates.actions.view"),to:n.config.getViewRoute(U)}),O=U=>({label:o("certificates.actions.edit"),to:n.config.getEditRoute(U)}),G=U=>{if(n.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:n.config.getCreateSniRoute(U)}},R=i.ref(void 0),J=i.ref(!1),ee=i.ref(!1),ne=i.ref(""),me=Xf(n.config,w.value),{certificateDataCache:ie,getCertificateData:Ne}=ct.useCertificate(),qr=U=>{R.value=U,J.value=!0},Kr=()=>{J.value=!1},fr=async()=>{var U,q,fe;if((U=R.value)!=null&&U.id){ee.value=!0;try{await c.delete(me(R.value.id)),ee.value=!1,J.value=!1,d.value++,r("delete:success",R.value)}catch(Ue){ne.value=((fe=(q=Ue.response)==null?void 0:q.data)==null?void 0:fe.message)||Ue.message||o("certificates.errors.delete"),r("error",Ue)}finally{ee.value=!1}}},Dt=i.ref(!1);i.watch(v,U=>{var q,fe,Ue,Qe;if(Array.isArray((q=U==null?void 0:U.response)==null?void 0:q.data)&&(Dt.value=U.response.data.length>0),U.status===Ft.Error){C.value={title:o("certificates.errors.general")},(Qe=(Ue=(fe=U.error)==null?void 0:fe.response)==null?void 0:Ue.data)!=null&&Qe.message&&(C.value.message=U.error.response.data.message),r("error",U.error);return}ie.value={},C.value=null});const X=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(X.value.title=o("certificates.list.empty_state.title"),X.value.ctaText=o("certificates.actions.create"))}),(U,q)=>{const fe=i.resolveComponent("KButton"),Ue=i.resolveComponent("KCopy"),Qe=i.resolveComponent("KBadge"),zr=i.resolveComponent("KTruncate"),re=i.resolveComponent("KDropdownItem"),xe=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",sb,[i.createVNode(i.unref(Wf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":C.value,fetcher:i.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":i.unref(E),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":q[2]||(q[2]=Z=>I(Z)),onSort:S},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(Zf),{modelValue:h.value,"onUpdate:modelValue":q[0]||(q[0]=Z=>h.value=Z),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref(jt),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(fe,{appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[i.vShow,Dt.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",ab,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.subject?Z.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",lb,i.toDisplayString(i.unref(Ne)(Z).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",cb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.expiry?i.unref(s)(Z.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",ub,i.toDisplayString(i.unref(Ne)(Z).schemaExpiry?i.unref(s)(i.unref(Ne)(Z).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",db,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.dns_names?`dns=${Z.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",fb,i.toDisplayString(i.unref(Ne)(Z).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:Z})=>[Z!=null&&Z.cert?(i.openBlock(),i.createBlock(Ue,{key:0,"data-testid":"copy-certificate-cert",text:Z.cert,truncate:""},null,8,["text"])):(i.openBlock(),i.createElementBlock("span",pb,"-"))]),tags:i.withCtx(({row:Z})=>{var Ae;return[((Ae=Z==null?void 0:Z.tags)==null?void 0:Ae.length)>0?(i.openBlock(),i.createBlock(zr,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Z==null?void 0:Z.tags,Gr=>(i.openBlock(),i.createBlock(Qe,{key:Gr,onClick:q[1]||(q[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Gr),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",hb,"-"))]}),actions:i.withCtx(({row:Z})=>[i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-id",onClick:Gr=>T(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-json",onClick:Gr=>N(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(jt),{"auth-function":()=>e.canRetrieve(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-view","has-divider":"",item:x(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canEdit(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-edit",item:O(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(i.openBlock(),i.createBlock(i.unref(jt),{key:0,"auth-function":()=>e.canCreateSni()},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-add-sni",item:G(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref(jt),{"auth-function":()=>e.canDelete(Z)},{default:i.withCtx(()=>[i.createVNode(re,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ae=>qr(Z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),i.createVNode(i.unref(Jf),{"action-pending":ee.value,"entity-type":i.unref(La).Certificate,error:ne.value,title:i.unref(o)("certificates.delete.title"),visible:J.value,onCancel:Kr,onProceed:fr},{description:i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(o)("certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),dr=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},gb=dr(yb,[["__scopeId","data-v-8059a087"]]),mb="#d60027",bb={class:"sni-field-container"},wb={key:1,class:"sni-field-controls-container"},vb={key:0},kb=dr(i.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(e,{emit:t}){const r=e,n=t,{i18nT:o,i18n:{t:s}}=ct.useI18n(),a=i.ref([]);return i.watch(r.modelValue,l=>{a.value=[...l]},{immediate:!0,deep:!0}),i.watch(a,l=>{n("update:modelValue",l)},{deep:!0}),(l,c)=>{const d=i.resolveComponent("KLabel"),y=i.resolveComponent("KInput"),p=i.resolveComponent("KButton"),E=i.resolveComponent("router-link");return i.openBlock(),i.createElementBlock("div",bb,[i.createVNode(d,{info:i.unref(s)("certificates.form.fields.snis.tooltip")},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(w,h)=>(i.openBlock(),i.createElementBlock("div",{key:h,class:"sni-field-input"},[!e.isEditing||a.value[h]?(i.openBlock(),i.createBlock(y,{key:0,modelValue:a.value[h],"onUpdate:modelValue":g=>a.value[h]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${h+1}`,disabled:e.isEditing,placeholder:i.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):i.createCommentVNode("",!0),e.isEditing?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",wb,[i.createVNode(p,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>l.$emit("remove",h)},{default:i.withCtx(()=>[i.createVNode(i.unref(kp),{color:i.unref(mb)},null,8,["color"])]),_:2},1032,["onClick"]),i.createVNode(p,{appearance:"tertiary","data-testid":"add-sni",disabled:h!==a.value.length-1,icon:"",onClick:c[0]||(c[0]=g=>l.$emit("add"))},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao))]),_:2},1032,["disabled"])]))]))),128)),a.value.length===0?(i.openBlock(),i.createElementBlock("div",vb,[i.createVNode(p,{onClick:c[1]||(c[1]=w=>l.$emit("add"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):i.createCommentVNode("",!0),e.isEditing?(i.openBlock(),i.createBlock(i.unref(o),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:i.withCtx(()=>[i.createVNode(E,{to:e.sniListRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),Cb={class:"kong-ui-entities-certificates-form"},Sb=dr(i.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading"],setup(e,{emit:t}){var N;const r=t,n=e,o=Wr.useRouter(),{i18nT:s,i18n:{t:a}}=ct.useI18n(),{getMessageFromError:l}=ep(),{axiosInstance:c}=Co((N=n.config)==null?void 0:N.axiosRequestConfig),d=i.computed(()=>Ii.form[n.config.app].edit),y=i.computed(()=>n.certificateId?Ht.Edit:Ht.Create),p=i.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),E=i.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),w=i.computed(()=>(y.value===Ht.Create||JSON.stringify(p.fields)!==JSON.stringify(E))&&!!p.fields.cert&&!!p.fields.key),h=I=>{var x,O;p.fields.cert=(I==null?void 0:I.cert)||"",p.fields.key=(I==null?void 0:I.key)||"",p.fields.certAlt=(I==null?void 0:I.cert_alt)||"",p.fields.keyAlt=(I==null?void 0:I.key_alt)||"",p.fields.snis=(x=I==null?void 0:I.snis)!=null&&x.length?I.snis:[""],p.fields.tags=((O=I==null?void 0:I.tags)==null?void 0:O.join(", "))||"",Object.assign(E,p.fields)},g=()=>{o.push(n.config.cancelRoute)},b=()=>{p.fields.snis.push("")},v=I=>{p.fields.snis.splice(I,1)},B=i.computed(()=>{var x,O;let I=`${n.config.apiBaseUrl}${Ii.form[n.config.app].validate}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((x=n.config)==null?void 0:x.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.certificateId),I}),S=i.computed(()=>{var x,O;let I=`${n.config.apiBaseUrl}${Ii.form[n.config.app][y.value]}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((x=n.config)==null?void 0:x.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.certificateId),I}),C=i.computed(()=>{var I,x;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,...n.showSnisField?{snis:p.fields.snis.filter(Boolean)}:{},tags:(x=(I=p.fields.tags.split(","))==null?void 0:I.map(O=>String(O||"").trim()))==null?void 0:x.filter(O=>O!=="")}}),T=async()=>{var I,x,O,G,R,J,ee,ne,me;try{p.isReadonly=!0;let ie;await c.post(B.value,C.value),y.value==="create"?ie=await c.post(S.value,C.value):y.value==="edit"&&(ie=((I=n.config)==null?void 0:I.app)==="konnect"?await c.put(S.value,C.value):await c.patch(S.value,C.value)),p.fields.cert=((x=ie==null?void 0:ie.data)==null?void 0:x.cert)||"",p.fields.key=((O=ie==null?void 0:ie.data)==null?void 0:O.key)||"",p.fields.certAlt=((G=ie==null?void 0:ie.data)==null?void 0:G.cert_alt)||"",p.fields.keyAlt=((R=ie==null?void 0:ie.data)==null?void 0:R.key_alt)||"",p.fields.snis=(ee=(J=ie==null?void 0:ie.data)==null?void 0:J.snis)!=null&&ee.length?ie.data.snis:[""],p.fields.tags=((me=(ne=ie==null?void 0:ie.data)==null?void 0:ne.tags)==null?void 0:me.join(", "))||"",Object.assign(E,p.fields),r("update",ie==null?void 0:ie.data)}catch(ie){p.errorMessage=l(ie),r("error",ie)}finally{p.isReadonly=!1}};return(I,x)=>{const O=i.resolveComponent("KTextArea"),G=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Cb,[i.createVNode(i.unref(Gf),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":C.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":x[7]||(x[7]=R=>I.$emit("error",R)),"onFetch:success":h,onLoading:x[8]||(x[8]=R=>I.$emit("loading",R)),onSubmit:T},{default:i.withCtx(()=>[i.createVNode(i.unref(ko),{description:i.unref(a)("certificates.form.sections.ssl.description"),title:i.unref(a)("certificates.form.sections.ssl.title")},{default:i.withCtx(()=>[i.createVNode(O,{modelValue:p.fields.cert,"onUpdate:modelValue":x[0]||(x[0]=R=>p.fields.cert=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:i.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:p.fields.key,"onUpdate:modelValue":x[1]||(x[1]=R=>p.fields.key=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:i.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:p.fields.certAlt,"onUpdate:modelValue":x[2]||(x[2]=R=>p.fields.certAlt=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:i.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":x[3]||(x[3]=R=>p.fields.keyAlt=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:i.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),e.showSnisField&&e.config.sniListRoute?(i.openBlock(),i.createBlock(kb,{key:0,modelValue:p.fields.snis,"onUpdate:modelValue":x[4]||(x[4]=R=>p.fields.snis=R),"is-editing":y.value===i.unref(Ht).Edit,"sni-list-route":e.config.sniListRoute,onAdd:b,onRemove:x[5]||(x[5]=R=>v(R))},null,8,["modelValue","is-editing","sni-list-route"])):i.createCommentVNode("",!0)]),_:1},8,["description","title"]),i.createVNode(i.unref(ko),{description:i.unref(a)("certificates.form.sections.general.description"),title:i.unref(a)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(G,{modelValue:p.fields.tags,"onUpdate:modelValue":x[6]||(x[6]=R=>p.fields.tags=R),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:i.unref(a)("certificates.form.fields.tags.help"),label:i.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:i.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-59428be8"]]),So="/v2/control-planes/{controlPlaneId}/core-entities",xo="/{workspace}",ji={list:{konnect:`${So}/ca_certificates`,kongManager:`${xo}/ca_certificates`},form:{konnect:{create:`${So}/ca_certificates`,edit:`${So}/ca_certificates/{id}`,validate:`${So}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${xo}/ca_certificates`,edit:`${xo}/ca_certificates/{id}`,validate:`${xo}/schemas/ca_certificates/validate`}}},xb={class:"kong-ui-ca-certificate-entity-config-card"},Ab={key:0},Bb=dr(i.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],n=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=ct.useI18n(),{convertKeyToTitle:l}=rp(),{getPropValue:c}=ip(),{getCertificateData:d}=ct.useCertificate(),y=i.computed(()=>ji.form[o.config.app].edit),p=i.ref(),E=i.computed(()=>{if(p.value)return d(p.value)}),w=i.computed(()=>{var S;return((S=E.value)==null?void 0:S.schemaIssuer)||""}),h=i.computed(()=>{var S,C;return(S=E.value)!=null&&S.schemaExpiry?a((C=E.value)==null?void 0:C.schemaExpiry):""}),g=i.computed(()=>{var S;return((S=E.value)==null?void 0:S.schemaKeyUsages)||[]}),b=(S,C)=>{const T=c("rowValue",C);if(S==="expiry")return h.value;if(S==="key_usages")return g.value;if(T)return T[S]},v=S=>{p.value=S,n("fetch:success",S)},B=i.ref({id:{},updated_at:{},created_at:{},cert:{section:pe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:pe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:pe.Basic,type:ce.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:pe.Basic,order:1.7,forceShow:!0},issuer:{section:pe.Basic,order:1.5,forceShow:!0},key_usages:{section:pe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(S,C)=>{const T=i.resolveComponent("KCodeBlock"),N=i.resolveComponent("KLabel"),I=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",xb,[i.createVNode(i.unref(zf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":C[0]||(C[0]=x=>S.$emit("fetch:error",x)),"onFetch:success":v,onLoading:C[1]||(C[1]=x=>S.$emit("loading",x))},{cert:i.withCtx(x=>[i.unref(c)("rowValue",x)?(i.openBlock(),i.createBlock(T,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",x),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),"metadata-label":i.withCtx(()=>[i.createVNode(N,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(x=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",x)).filter(O=>!r.includes(O)),O=>(i.openBlock(),i.createBlock(i.unref(po),{key:O,"data-testid":`ca-cert-metadata-${O}`,item:{key:O,label:i.unref(l)(O),value:b(O,x),type:O==="key_usages"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(w.value||"–"),1)]),key_usages:i.withCtx(()=>[g.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ab,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(g.value,(x,O)=>(i.openBlock(),i.createBlock(I,{key:`key_usages-badge-tag-${O}`,class:"config-badge","data-testid":`key_usages-badge-tag-${O}`,tooltip:x,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-b34eea10"]]),Ib={class:"kong-ui-entities-ca-certificates-list"},Nb={key:0},Eb={key:1},Ob={key:0},_b={key:1},Vb={key:1},Tb=dr(i.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var X;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ct.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=Co((X=n.config)==null?void 0:X.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),E={issuer:{label:o("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},w=i.computed(()=>{var U,q;let te=`${n.config.apiBaseUrl}${ji.list[n.config.app]}`;return n.config.app==="konnect"?te=te.replace(/{controlPlaneId}/gi,((U=n.config)==null?void 0:U.controlPlaneId)||""):n.config.app==="kongManager"&&(te=te.replace(/\/{workspace}/gi,(q=n.config)!=null&&q.workspace?`/${n.config.workspace}`:"")),te}),h=i.ref(""),g=i.computed(()=>{const te=n.config.app==="konnect"||n.config.isExactMatch;return te?{isExactMatch:te,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:te,schema:n.config.filterSchema}}),{fetcher:b,fetcherState:v}=tp(n.config,w.value),B=()=>{h.value=""},S=()=>{d.value++},C=i.ref(null),T=(te,U)=>{const q=te.id;if(!U(q)){r("copy:error",{entity:te,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,field:"id",message:o("ca-certificates.copy.success",{val:q})})},N=(te,U)=>{const q=JSON.stringify(te);if(!U(q)){r("copy:error",{entity:te,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,message:o("ca-certificates.copy.success_brief")})},I=async te=>{var q;await((q=n.canRetrieve)==null?void 0:q.call(n,te))&&l.push(n.config.getViewRoute(te.id))},x=te=>({label:o("ca-certificates.actions.view"),to:n.config.getViewRoute(te)}),O=te=>({label:o("ca-certificates.actions.edit"),to:n.config.getEditRoute(te)}),G=i.ref(void 0),R=i.ref(!1),J=i.ref(!1),ee=i.ref(""),ne=Xf(n.config,w.value),{certificateDataCache:me,getCertificateData:ie}=ct.useCertificate(),Ne=te=>{G.value=te,R.value=!0},qr=()=>{R.value=!1},Kr=async()=>{var te,U,q;if((te=G.value)!=null&&te.id){J.value=!0;try{await c.delete(ne(G.value.id)),J.value=!1,R.value=!1,d.value++,r("delete:success",G.value)}catch(fe){ee.value=((q=(U=fe.response)==null?void 0:U.data)==null?void 0:q.message)||fe.message||o("ca-certificates.errors.delete"),r("error",fe)}finally{J.value=!1}}},fr=i.ref(!1);i.watch(v,te=>{var U,q,fe,Ue;if(Array.isArray((U=te==null?void 0:te.response)==null?void 0:U.data)&&(fr.value=te.response.data.length>0),te.status===Ft.Error){C.value={title:o("ca-certificates.errors.general")},(Ue=(fe=(q=te.error)==null?void 0:q.response)==null?void 0:fe.data)!=null&&Ue.message&&(C.value.message=te.error.response.data.message),r("error",te.error);return}me.value={},C.value=null});const Dt=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("ca-certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("ca-certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(Dt.value.title=o("ca-certificates.list.empty_state.title"),Dt.value.ctaText=o("ca-certificates.actions.create"))}),(te,U)=>{const q=i.resolveComponent("KButton"),fe=i.resolveComponent("KBadge"),Ue=i.resolveComponent("KTruncate"),Qe=i.resolveComponent("KDropdownItem"),zr=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",Ib,[i.createVNode(i.unref(Wf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Dt.value,"enable-entity-actions":"","error-message":C.value,fetcher:i.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":i.unref(E),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":U[2]||(U[2]=re=>I(re)),onSort:S},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(Zf),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=re=>h.value=re),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref(jt),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Ao)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[i.vShow,fr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Nb,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.issuer?re.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",Eb,i.toDisplayString(i.unref(ie)(re).schemaIssuer||"-"),1))]}),expiry:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Ob,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.expiry?i.unref(s)(re.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",_b,i.toDisplayString(i.unref(ie)(re).schemaExpiry?i.unref(s)(i.unref(ie)(re).schemaExpiry):"-"),1))]}),tags:i.withCtx(({row:re})=>{var xe;return[((xe=re==null?void 0:re.tags)==null?void 0:xe.length)>0?(i.openBlock(),i.createBlock(Ue,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(re==null?void 0:re.tags,Z=>(i.openBlock(),i.createBlock(fe,{key:Z,onClick:U[1]||(U[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Z),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Vb,"-"))]}),actions:i.withCtx(({row:re})=>[i.createVNode(zr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Qe,{"data-testid":"action-entity-copy-id",onClick:Z=>T(re,xe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(zr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Qe,{"data-testid":"action-entity-copy-json",onClick:Z=>N(re,xe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(jt),{"auth-function":()=>e.canRetrieve(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{"data-testid":"action-entity-view","has-divider":"",item:x(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canEdit(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{"data-testid":"action-entity-edit",item:O(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(jt),{"auth-function":()=>e.canDelete(re)},{default:i.withCtx(()=>[i.createVNode(Qe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Ne(re)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),i.createVNode(i.unref(Jf),{"action-pending":J.value,"entity-type":i.unref(La).CACertificate,error:ee.value,title:i.unref(o)("ca-certificates.delete.title"),visible:R.value,onCancel:qr,onProceed:Kr},{description:i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-8620b081"]]),jb={class:"kong-ui-entities-ca-certificates-form"},Db=dr(i.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var S;const r=t,n=e,o=Wr.useRouter(),{i18n:{t:s}}=ct.useI18n(),{getMessageFromError:a}=ep(),{axiosInstance:l}=Co((S=n.config)==null?void 0:S.axiosRequestConfig),c=i.computed(()=>ji.form[n.config.app].edit),d=i.computed(()=>n.certificateId?Ht.Edit:Ht.Create),y=i.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=i.reactive({cert:"",certDigest:"",tags:""}),E=i.computed(()=>(d.value===Ht.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=C=>{var T;y.fields.cert=(C==null?void 0:C.cert)||"",y.fields.certDigest=(C==null?void 0:C.cert_digest)||"",y.fields.tags=((T=C==null?void 0:C.tags)==null?void 0:T.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(n.config.cancelRoute)},g=i.computed(()=>{var T,N;let C=`${n.config.apiBaseUrl}${ji.form[n.config.app].validate}`;return n.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),C=C.replace(/{id}/gi,n.certificateId),C}),b=i.computed(()=>{var T,N;let C=`${n.config.apiBaseUrl}${ji.form[n.config.app][d.value]}`;return n.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),C=C.replace(/{id}/gi,n.certificateId),C}),v=i.computed(()=>{var C,T;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(T=(C=y.fields.tags.split(","))==null?void 0:C.map(N=>String(N||"").trim()))==null?void 0:T.filter(N=>N!=="")}}),B=async()=>{var C,T,N,I,x;try{y.isReadonly=!0;let O;await l.post(g.value,v.value),d.value==="create"?O=await l.post(b.value,v.value):d.value==="edit"&&(O=((C=n.config)==null?void 0:C.app)==="konnect"?await l.put(b.value,v.value):await l.patch(b.value,v.value)),y.fields.cert=((T=O==null?void 0:O.data)==null?void 0:T.cert)||"",y.fields.certDigest=((N=O==null?void 0:O.data)==null?void 0:N.cert_digest)||"",y.fields.tags=((x=(I=O==null?void 0:O.data)==null?void 0:I.tags)==null?void 0:x.join(", "))||"",Object.assign(p,y.fields),r("update",O==null?void 0:O.data)}catch(O){y.errorMessage=a(O),r("error",O)}finally{y.isReadonly=!1}};return(C,T)=>{const N=i.resolveComponent("KTextArea"),I=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",jb,[i.createVNode(i.unref(Gf),{"can-submit":E.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":c.value,"form-fields":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":T[3]||(T[3]=x=>C.$emit("error",x)),"onFetch:success":w,onLoading:T[4]||(T[4]=x=>C.$emit("loading",x)),onSubmit:B},{default:i.withCtx(()=>[i.createVNode(i.unref(ko),{description:i.unref(s)("ca-certificates.form.sections.cert.description"),title:i.unref(s)("ca-certificates.form.sections.cert.title")},{default:i.withCtx(()=>[i.createVNode(N,{modelValue:y.fields.cert,"onUpdate:modelValue":T[0]||(T[0]=x=>y.fields.cert=x),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:i.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:i.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),i.createVNode(I,{modelValue:y.fields.certDigest,"onUpdate:modelValue":T[1]||(T[1]=x=>y.fields.certDigest=x),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:i.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(ko),{description:i.unref(s)("ca-certificates.form.sections.general.description"),title:i.unref(s)("ca-certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(I,{modelValue:y.fields.tags,"onUpdate:modelValue":T[2]||(T[2]=x=>y.fields.tags=x),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:i.unref(s)("ca-certificates.form.fields.tags.help"),label:i.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:i.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-54396784"]]),$b={class:"kong-ui-certificate-entity-config-card"},Mb={key:0},Rb=dr(i.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ct.useI18n(),{convertKeyToTitle:l}=rp(),{getPropValue:c}=ip(),{getCertificateData:d}=ct.useCertificate(),y=i.computed(()=>Ii.form[n.config.app].edit),p=i.ref(),E=i.ref({id:{},cert:{section:pe.Basic},key:{section:pe.Basic,type:ce.Redacted},metadata:{section:pe.Basic,type:ce.Json},snis:{section:pe.Basic,type:ce.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...n.config.app==="kongManager"&&{expiry:{section:pe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:pe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:pe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:pe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:pe.Advanced},key_alt:{section:pe.Advanced,type:ce.Redacted}}),w=x=>{p.value=x,r("fetch:success",x)},h=(x,O)=>{const G=c("rowValue",O);if(x==="expiry")return b.value;if(x==="key_usages")return C.value;if(x==="san_names")return B.value;if(G)return G[x]},g=i.computed(()=>{if(p.value)return d(p.value)}),b=i.computed(()=>{var x,O;return(x=g.value)!=null&&x.schemaExpiry?s((O=g.value)==null?void 0:O.schemaExpiry):""}),v=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaIssuer)||""}),B=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaSanNames)||""}),S=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaSubject)||""}),C=i.computed(()=>{var x;return((x=g.value)==null?void 0:x.schemaKeyUsages)||[]}),T=i.computed(()=>{var x,O;return((O=(x=p==null?void 0:p.value)==null?void 0:x.snis)==null?void 0:O.length)>0}),N=i.computed(()=>{var x;return!!((x=p==null?void 0:p.value)!=null&&x.cert_alt)}),I=x=>{var O,G;return x==="san_names"?o("certificates.list.table_headers.san"):((G=(O=E.value)==null?void 0:O[x])==null?void 0:G.label)||l(x)};return(x,O)=>{const G=i.resolveComponent("KCodeBlock"),R=i.resolveComponent("KLabel"),J=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",$b,[i.createVNode(i.unref(zf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":E.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":O[0]||(O[0]=ee=>x.$emit("fetch:error",ee)),"onFetch:success":w,onLoading:O[1]||(O[1]=ee=>x.$emit("loading",ee))},i.createSlots({"cert-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:i.withCtx(ee=>[i.unref(c)("rowValue",ee)?(i.openBlock(),i.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",ee),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),"key-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":i.withCtx(()=>[i.createVNode(R,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(ee=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",ee)),ne=>(i.openBlock(),i.createBlock(i.unref(po),{key:ne,item:{key:ne,value:h(ne,ee),label:I(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(v.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(B.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S.value||"–"),1)]),"cert_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:i.withCtx(()=>[C.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Mb,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(C.value,(ee,ne)=>(i.openBlock(),i.createBlock(J,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:ee,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(ee),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[T.value?void 0:{name:"snis",fn:i.withCtx(()=>[i.createTextVNode(" – ")]),key:"0"},N.value?{name:"cert_alt",fn:i.withCtx(ee=>[i.createTextVNode(" > "),i.unref(c)("rowValue",ee)?(i.openBlock(),i.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:i.unref(c)("rowValue",ee),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-d40682b9"]]);je.CACertificateConfigCard=Bb,je.CACertificateForm=Db,je.CACertificateList=Tb,je.CertificateConfigCard=Rb,je.CertificateForm=Sb,je.CertificateList=gb,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|