@kong-ui-public/entities-certificates 1.3.28 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities-certificates.es.js +3610 -3400
- package/dist/entities-certificates.umd.js +27 -27
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(_e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],n):(_e=typeof globalThis<"u"?globalThis:_e||self,n(_e["kong-ui-public-entities-certificates"]={},_e.Vue,_e.VueRouter,_e["kong-ui-public-i18n"],_e.axios,_e.Kongponents))})(this,function(_e,n,Lr,ar,
|
|
1
|
+
(function(_e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],n):(_e=typeof globalThis<"u"?globalThis:_e||self,n(_e["kong-ui-public-entities-certificates"]={},_e.Vue,_e.VueRouter,_e["kong-ui-public-i18n"],_e.axios,_e.Kongponents))})(this,function(_e,n,Lr,ar,Kf,Fa){"use strict";var ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
|
|
2
2
|
Copyright (C) Microsoft. All rights reserved.
|
|
3
3
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
4
|
this file except in compliance with the License. You may obtain a copy of the
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
13
|
and limitations under the License.
|
|
14
|
-
***************************************************************************** */var Ka;(function(e){(function(t){var r=typeof ao=="object"?ao:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),i=o(e);typeof r.Reflect>"u"?r.Reflect=e:i=o(r.Reflect,i),t(i);function o(s,a){return function(c,l){typeof s[c]!="function"&&Object.defineProperty(s,c,{configurable:!0,writable:!0,value:l}),a&&a(c,l)}}})(function(t){var r=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",o=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",s=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,l=!a&&!c,d={create:a?function(){return Ha(Object.create(null))}:c?function(){return Ha({__proto__:null})}:function(){return Ha({})},has:l?function(S,B){return r.call(S,B)}:function(S,B){return B in S},get:l?function(S,B){return r.call(S,B)?S[B]:void 0}:function(S,B){return S[B]}},p=Object.getPrototypeOf(Function),y=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",x=!y&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:F1(),C=!y&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:K1(),h=!y&&typeof WeakMap=="function"?WeakMap:q1(),m=new h;function b(S,B,_,T){if(F(_)){if(!W(S))throw new TypeError;if(!sr(B))throw new TypeError;return R(S,B)}else{if(!W(S))throw new TypeError;if(!Y(B))throw new TypeError;if(!Y(T)&&!F(T)&&!de(T))throw new TypeError;return de(T)&&(T=void 0),_=he(_),H(S,B,_,T)}}t("decorate",b);function v(S,B){function _(T,z){if(!Y(T))throw new TypeError;if(!F(z)&&!R1(z))throw new TypeError;ue(S,B,T,z)}return _}t("metadata",v);function w(S,B,_,T){if(!Y(_))throw new TypeError;return F(T)||(T=he(T)),ue(S,B,_,T)}t("defineMetadata",w);function g(S,B,_){if(!Y(B))throw new TypeError;return F(_)||(_=he(_)),j(S,B,_)}t("hasMetadata",g);function A(S,B,_){if(!Y(B))throw new TypeError;return F(_)||(_=he(_)),re(S,B,_)}t("hasOwnMetadata",A);function J(S,B,_){if(!Y(B))throw new TypeError;return F(_)||(_=he(_)),fe(S,B,_)}t("getMetadata",J);function X(S,B,_){if(!Y(B))throw new TypeError;return F(_)||(_=he(_)),be(S,B,_)}t("getOwnMetadata",X);function I(S,B){if(!Y(S))throw new TypeError;return F(B)||(B=he(B)),pe(S,B)}t("getMetadataKeys",I);function E(S,B){if(!Y(S))throw new TypeError;return F(B)||(B=he(B)),we(S,B)}t("getOwnMetadataKeys",E);function $(S,B,_){if(!Y(B))throw new TypeError;F(_)||(_=he(_));var T=D(B,_,!1);if(F(T)||!T.delete(S))return!1;if(T.size>0)return!0;var z=m.get(B);return z.delete(_),z.size>0||m.delete(B),!0}t("deleteMetadata",$);function R(S,B){for(var _=S.length-1;_>=0;--_){var T=S[_],z=T(B);if(!F(z)&&!de(z)){if(!sr(z))throw new TypeError;B=z}}return B}function H(S,B,_,T){for(var z=S.length-1;z>=0;--z){var Ne=S[z],ee=Ne(B,_,T);if(!F(ee)&&!de(ee)){if(!Y(ee))throw new TypeError;T=ee}}return T}function D(S,B,_){var T=m.get(S);if(F(T)){if(!_)return;T=new x,m.set(S,T)}var z=T.get(B);if(F(z)){if(!_)return;z=new x,T.set(B,z)}return z}function j(S,B,_){var T=re(S,B,_);if(T)return!0;var z=La(B);return de(z)?!1:j(S,z,_)}function re(S,B,_){var T=D(B,_,!1);return F(T)?!1:Ur(T.has(S))}function fe(S,B,_){var T=re(S,B,_);if(T)return be(S,B,_);var z=La(B);if(!de(z))return fe(S,z,_)}function be(S,B,_){var T=D(B,_,!1);if(!F(T))return T.get(S)}function ue(S,B,_,T){var z=D(_,T,!0);z.set(S,B)}function pe(S,B){var _=we(S,B),T=La(S);if(T===null)return _;var z=pe(T,B);if(z.length<=0)return _;if(_.length<=0)return z;for(var Ne=new C,ee=[],te=0,G=_;te<G.length;te++){var oe=G[te],se=Ne.has(oe);se||(Ne.add(oe),ee.push(oe))}for(var Rt=0,Rf=z;Rt<Rf.length;Rt++){var oe=Rf[Rt],se=Ne.has(oe);se||(Ne.add(oe),ee.push(oe))}return ee}function we(S,B){var _=[],T=D(S,B,!1);if(F(T))return _;for(var z=T.keys(),Ne=M1(z),ee=0;;){var te=L1(Ne);if(!te)return _.length=ee,_;var G=U1(te);try{_[ee]=G}catch(oe){try{H1(Ne)}finally{throw oe}}ee++}}function or(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function F(S){return S===void 0}function de(S){return S===null}function q(S){return typeof S=="symbol"}function Y(S){return typeof S=="object"?S!==null:typeof S=="function"}function xe(S,B){switch(or(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var _=B===3?"string":B===5?"number":"default",T=$f(S,o);if(T!==void 0){var z=T.call(S,_);if(Y(z))throw new TypeError;return z}return Ge(S,_==="default"?"number":_)}function Ge(S,B){if(B==="string"){var _=S.toString;if(ye(_)){var T=_.call(S);if(!Y(T))return T}var z=S.valueOf;if(ye(z)){var T=z.call(S);if(!Y(T))return T}}else{var z=S.valueOf;if(ye(z)){var T=z.call(S);if(!Y(T))return T}var Ne=S.toString;if(ye(Ne)){var T=Ne.call(S);if(!Y(T))return T}}throw new TypeError}function Ur(S){return!!S}function Q(S){return""+S}function he(S){var B=xe(S,3);return q(B)?B:Q(B)}function W(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function ye(S){return typeof S=="function"}function sr(S){return typeof S=="function"}function R1(S){switch(or(S)){case 3:return!0;case 4:return!0;default:return!1}}function $f(S,B){var _=S[B];if(_!=null){if(!ye(_))throw new TypeError;return _}}function M1(S){var B=$f(S,s);if(!ye(B))throw new TypeError;var _=B.call(S);if(!Y(_))throw new TypeError;return _}function U1(S){return S.value}function L1(S){var B=S.next();return B.done?!1:B}function H1(S){var B=S.return;B&&B.call(S)}function La(S){var B=Object.getPrototypeOf(S);if(typeof S!="function"||S===p||B!==p)return B;var _=S.prototype,T=_&&Object.getPrototypeOf(_);if(T==null||T===Object.prototype)return B;var z=T.constructor;return typeof z!="function"||z===S?B:z}function F1(){var S={},B=[],_=function(){function ee(te,G,oe){this._index=0,this._keys=te,this._values=G,this._selector=oe}return ee.prototype["@@iterator"]=function(){return this},ee.prototype[s]=function(){return this},ee.prototype.next=function(){var te=this._index;if(te>=0&&te<this._keys.length){var G=this._selector(this._keys[te],this._values[te]);return te+1>=this._keys.length?(this._index=-1,this._keys=B,this._values=B):this._index++,{value:G,done:!1}}return{value:void 0,done:!0}},ee.prototype.throw=function(te){throw this._index>=0&&(this._index=-1,this._keys=B,this._values=B),te},ee.prototype.return=function(te){return this._index>=0&&(this._index=-1,this._keys=B,this._values=B),{value:te,done:!0}},ee}();return function(){function ee(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(ee.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ee.prototype.has=function(te){return this._find(te,!1)>=0},ee.prototype.get=function(te){var G=this._find(te,!1);return G>=0?this._values[G]:void 0},ee.prototype.set=function(te,G){var oe=this._find(te,!0);return this._values[oe]=G,this},ee.prototype.delete=function(te){var G=this._find(te,!1);if(G>=0){for(var oe=this._keys.length,se=G+1;se<oe;se++)this._keys[se-1]=this._keys[se],this._values[se-1]=this._values[se];return this._keys.length--,this._values.length--,te===this._cacheKey&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},ee.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},ee.prototype.keys=function(){return new _(this._keys,this._values,T)},ee.prototype.values=function(){return new _(this._keys,this._values,z)},ee.prototype.entries=function(){return new _(this._keys,this._values,Ne)},ee.prototype["@@iterator"]=function(){return this.entries()},ee.prototype[s]=function(){return this.entries()},ee.prototype._find=function(te,G){return this._cacheKey!==te&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=te)),this._cacheIndex<0&&G&&(this._cacheIndex=this._keys.length,this._keys.push(te),this._values.push(void 0)),this._cacheIndex},ee}();function T(ee,te){return ee}function z(ee,te){return te}function Ne(ee,te){return[ee,te]}}function K1(){return function(){function S(){this._map=new x}return Object.defineProperty(S.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),S.prototype.has=function(B){return this._map.has(B)},S.prototype.add=function(B){return this._map.set(B,B),this},S.prototype.delete=function(B){return this._map.delete(B)},S.prototype.clear=function(){this._map.clear()},S.prototype.keys=function(){return this._map.keys()},S.prototype.values=function(){return this._map.values()},S.prototype.entries=function(){return this._map.entries()},S.prototype["@@iterator"]=function(){return this.keys()},S.prototype[s]=function(){return this.keys()},S}()}function q1(){var S=16,B=d.create(),_=T();return function(){function G(){this._key=T()}return G.prototype.has=function(oe){var se=z(oe,!1);return se!==void 0?d.has(se,this._key):!1},G.prototype.get=function(oe){var se=z(oe,!1);return se!==void 0?d.get(se,this._key):void 0},G.prototype.set=function(oe,se){var Rt=z(oe,!0);return Rt[this._key]=se,this},G.prototype.delete=function(oe){var se=z(oe,!1);return se!==void 0?delete se[this._key]:!1},G.prototype.clear=function(){this._key=T()},G}();function T(){var G;do G="@@WeakMap@@"+te();while(d.has(B,G));return B[G]=!0,G}function z(G,oe){if(!r.call(G,_)){if(!oe)return;Object.defineProperty(G,_,{value:d.create()})}return G[_]}function Ne(G,oe){for(var se=0;se<oe;++se)G[se]=Math.random()*255|0;return G}function ee(G){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(G)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(G)):Ne(new Uint8Array(G),G):Ne(new Array(G),G)}function te(){var G=ee(S);G[6]=G[6]&79|64,G[8]=G[8]&191|128;for(var oe="",se=0;se<S;++se){var Rt=G[se];(se===4||se===6||se===8)&&(oe+="-"),Rt<16&&(oe+="0"),oe+=Rt.toString(16).toLowerCase()}return oe}}function Ha(S){return S.__=void 0,delete S.__,S}})})(Ka||(Ka={}));/*!
|
|
14
|
+
***************************************************************************** */var Ka;(function(e){(function(t){var r=typeof ao=="object"?ao:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),i=o(e);typeof r.Reflect>"u"?r.Reflect=e:i=o(r.Reflect,i),t(i);function o(s,a){return function(c,l){typeof s[c]!="function"&&Object.defineProperty(s,c,{configurable:!0,writable:!0,value:l}),a&&a(c,l)}}})(function(t){var r=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",o=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",s=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,l=!a&&!c,d={create:a?function(){return Ha(Object.create(null))}:c?function(){return Ha({__proto__:null})}:function(){return Ha({})},has:l?function(S,B){return r.call(S,B)}:function(S,B){return B in S},get:l?function(S,B){return r.call(S,B)?S[B]:void 0}:function(S,B){return S[B]}},p=Object.getPrototypeOf(Function),y=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",x=!y&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:cb(),C=!y&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:lb(),h=!y&&typeof WeakMap=="function"?WeakMap:ub(),g=new h;function b(S,B,_,T){if(F(_)){if(!G(S))throw new TypeError;if(!sr(B))throw new TypeError;return M(S,B)}else{if(!G(S))throw new TypeError;if(!Y(B))throw new TypeError;if(!Y(T)&&!F(T)&&!de(T))throw new TypeError;return de(T)&&(T=void 0),_=he(_),H(S,B,_,T)}}t("decorate",b);function v(S,B){function _(T,z){if(!Y(T))throw new TypeError;if(!F(z)&&!ib(z))throw new TypeError;ue(S,B,T,z)}return _}t("metadata",v);function w(S,B,_,T){if(!Y(_))throw new TypeError;return F(T)||(T=he(T)),ue(S,B,_,T)}t("defineMetadata",w);function m(S,B,_){if(!Y(B))throw new TypeError;return F(_)||(_=he(_)),j(S,B,_)}t("hasMetadata",m);function A(S,B,_){if(!Y(B))throw new TypeError;return F(_)||(_=he(_)),re(S,B,_)}t("hasOwnMetadata",A);function J(S,B,_){if(!Y(B))throw new TypeError;return F(_)||(_=he(_)),fe(S,B,_)}t("getMetadata",J);function X(S,B,_){if(!Y(B))throw new TypeError;return F(_)||(_=he(_)),be(S,B,_)}t("getOwnMetadata",X);function I(S,B){if(!Y(S))throw new TypeError;return F(B)||(B=he(B)),pe(S,B)}t("getMetadataKeys",I);function E(S,B){if(!Y(S))throw new TypeError;return F(B)||(B=he(B)),we(S,B)}t("getOwnMetadataKeys",E);function $(S,B,_){if(!Y(B))throw new TypeError;F(_)||(_=he(_));var T=D(B,_,!1);if(F(T)||!T.delete(S))return!1;if(T.size>0)return!0;var z=g.get(B);return z.delete(_),z.size>0||g.delete(B),!0}t("deleteMetadata",$);function M(S,B){for(var _=S.length-1;_>=0;--_){var T=S[_],z=T(B);if(!F(z)&&!de(z)){if(!sr(z))throw new TypeError;B=z}}return B}function H(S,B,_,T){for(var z=S.length-1;z>=0;--z){var Ne=S[z],ee=Ne(B,_,T);if(!F(ee)&&!de(ee)){if(!Y(ee))throw new TypeError;T=ee}}return T}function D(S,B,_){var T=g.get(S);if(F(T)){if(!_)return;T=new x,g.set(S,T)}var z=T.get(B);if(F(z)){if(!_)return;z=new x,T.set(B,z)}return z}function j(S,B,_){var T=re(S,B,_);if(T)return!0;var z=La(B);return de(z)?!1:j(S,z,_)}function re(S,B,_){var T=D(B,_,!1);return F(T)?!1:Ur(T.has(S))}function fe(S,B,_){var T=re(S,B,_);if(T)return be(S,B,_);var z=La(B);if(!de(z))return fe(S,z,_)}function be(S,B,_){var T=D(B,_,!1);if(!F(T))return T.get(S)}function ue(S,B,_,T){var z=D(_,T,!0);z.set(S,B)}function pe(S,B){var _=we(S,B),T=La(S);if(T===null)return _;var z=pe(T,B);if(z.length<=0)return _;if(_.length<=0)return z;for(var Ne=new C,ee=[],te=0,W=_;te<W.length;te++){var oe=W[te],se=Ne.has(oe);se||(Ne.add(oe),ee.push(oe))}for(var Mt=0,Lf=z;Mt<Lf.length;Mt++){var oe=Lf[Mt],se=Ne.has(oe);se||(Ne.add(oe),ee.push(oe))}return ee}function we(S,B){var _=[],T=D(S,B,!1);if(F(T))return _;for(var z=T.keys(),Ne=nb(z),ee=0;;){var te=sb(Ne);if(!te)return _.length=ee,_;var W=ob(te);try{_[ee]=W}catch(oe){try{ab(Ne)}finally{throw oe}}ee++}}function or(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function F(S){return S===void 0}function de(S){return S===null}function q(S){return typeof S=="symbol"}function Y(S){return typeof S=="object"?S!==null:typeof S=="function"}function xe(S,B){switch(or(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var _=B===3?"string":B===5?"number":"default",T=Uf(S,o);if(T!==void 0){var z=T.call(S,_);if(Y(z))throw new TypeError;return z}return We(S,_==="default"?"number":_)}function We(S,B){if(B==="string"){var _=S.toString;if(ye(_)){var T=_.call(S);if(!Y(T))return T}var z=S.valueOf;if(ye(z)){var T=z.call(S);if(!Y(T))return T}}else{var z=S.valueOf;if(ye(z)){var T=z.call(S);if(!Y(T))return T}var Ne=S.toString;if(ye(Ne)){var T=Ne.call(S);if(!Y(T))return T}}throw new TypeError}function Ur(S){return!!S}function Q(S){return""+S}function he(S){var B=xe(S,3);return q(B)?B:Q(B)}function G(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function ye(S){return typeof S=="function"}function sr(S){return typeof S=="function"}function ib(S){switch(or(S)){case 3:return!0;case 4:return!0;default:return!1}}function Uf(S,B){var _=S[B];if(_!=null){if(!ye(_))throw new TypeError;return _}}function nb(S){var B=Uf(S,s);if(!ye(B))throw new TypeError;var _=B.call(S);if(!Y(_))throw new TypeError;return _}function ob(S){return S.value}function sb(S){var B=S.next();return B.done?!1:B}function ab(S){var B=S.return;B&&B.call(S)}function La(S){var B=Object.getPrototypeOf(S);if(typeof S!="function"||S===p||B!==p)return B;var _=S.prototype,T=_&&Object.getPrototypeOf(_);if(T==null||T===Object.prototype)return B;var z=T.constructor;return typeof z!="function"||z===S?B:z}function cb(){var S={},B=[],_=function(){function ee(te,W,oe){this._index=0,this._keys=te,this._values=W,this._selector=oe}return ee.prototype["@@iterator"]=function(){return this},ee.prototype[s]=function(){return this},ee.prototype.next=function(){var te=this._index;if(te>=0&&te<this._keys.length){var W=this._selector(this._keys[te],this._values[te]);return te+1>=this._keys.length?(this._index=-1,this._keys=B,this._values=B):this._index++,{value:W,done:!1}}return{value:void 0,done:!0}},ee.prototype.throw=function(te){throw this._index>=0&&(this._index=-1,this._keys=B,this._values=B),te},ee.prototype.return=function(te){return this._index>=0&&(this._index=-1,this._keys=B,this._values=B),{value:te,done:!0}},ee}();return function(){function ee(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(ee.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ee.prototype.has=function(te){return this._find(te,!1)>=0},ee.prototype.get=function(te){var W=this._find(te,!1);return W>=0?this._values[W]:void 0},ee.prototype.set=function(te,W){var oe=this._find(te,!0);return this._values[oe]=W,this},ee.prototype.delete=function(te){var W=this._find(te,!1);if(W>=0){for(var oe=this._keys.length,se=W+1;se<oe;se++)this._keys[se-1]=this._keys[se],this._values[se-1]=this._values[se];return this._keys.length--,this._values.length--,te===this._cacheKey&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},ee.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},ee.prototype.keys=function(){return new _(this._keys,this._values,T)},ee.prototype.values=function(){return new _(this._keys,this._values,z)},ee.prototype.entries=function(){return new _(this._keys,this._values,Ne)},ee.prototype["@@iterator"]=function(){return this.entries()},ee.prototype[s]=function(){return this.entries()},ee.prototype._find=function(te,W){return this._cacheKey!==te&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=te)),this._cacheIndex<0&&W&&(this._cacheIndex=this._keys.length,this._keys.push(te),this._values.push(void 0)),this._cacheIndex},ee}();function T(ee,te){return ee}function z(ee,te){return te}function Ne(ee,te){return[ee,te]}}function lb(){return function(){function S(){this._map=new x}return Object.defineProperty(S.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),S.prototype.has=function(B){return this._map.has(B)},S.prototype.add=function(B){return this._map.set(B,B),this},S.prototype.delete=function(B){return this._map.delete(B)},S.prototype.clear=function(){this._map.clear()},S.prototype.keys=function(){return this._map.keys()},S.prototype.values=function(){return this._map.values()},S.prototype.entries=function(){return this._map.entries()},S.prototype["@@iterator"]=function(){return this.keys()},S.prototype[s]=function(){return this.keys()},S}()}function ub(){var S=16,B=d.create(),_=T();return function(){function W(){this._key=T()}return W.prototype.has=function(oe){var se=z(oe,!1);return se!==void 0?d.has(se,this._key):!1},W.prototype.get=function(oe){var se=z(oe,!1);return se!==void 0?d.get(se,this._key):void 0},W.prototype.set=function(oe,se){var Mt=z(oe,!0);return Mt[this._key]=se,this},W.prototype.delete=function(oe){var se=z(oe,!1);return se!==void 0?delete se[this._key]:!1},W.prototype.clear=function(){this._key=T()},W}();function T(){var W;do W="@@WeakMap@@"+te();while(d.has(B,W));return B[W]=!0,W}function z(W,oe){if(!r.call(W,_)){if(!oe)return;Object.defineProperty(W,_,{value:d.create()})}return W[_]}function Ne(W,oe){for(var se=0;se<oe;++se)W[se]=Math.random()*255|0;return W}function ee(W){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(W)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(W)):Ne(new Uint8Array(W),W):Ne(new Array(W),W)}function te(){var W=ee(S);W[6]=W[6]&79|64,W[8]=W[8]&191|128;for(var oe="",se=0;se<S;++se){var Mt=W[se];(se===4||se===6||se===8)&&(oe+="-"),Mt<16&&(oe+="0"),oe+=Mt.toString(16).toLowerCase()}return oe}}function Ha(S){return S.__=void 0,delete S.__,S}})})(Ka||(Ka={}));/*!
|
|
15
15
|
* MIT License
|
|
16
16
|
*
|
|
17
17
|
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
35
|
* SOFTWARE.
|
|
36
36
|
*
|
|
37
|
-
*/const
|
|
37
|
+
*/const qf="[object ArrayBuffer]";class V{static isArrayBuffer(t){return Object.prototype.toString.call(t)===qf}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength||t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t.buffer).slice(t.byteOffset,t.byteOffset+t.byteLength).buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const i=V.toUint8Array(t),o=V.toUint8Array(r);if(i.length!==o.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==o[s])return!1;return!0}static concat(...t){let r;Array.isArray(t[0])&&!(t[1]instanceof Function)||Array.isArray(t[0])&&t[1]instanceof Function?r=t[0]:t[t.length-1]instanceof Function?r=t.slice(0,t.length-1):r=t;let i=0;for(const a of r)i+=a.byteLength;const o=new Uint8Array(i);let s=0;for(const a of r){const c=this.toUint8Array(a);o.set(c,s),s+=c.length}return t[t.length-1]instanceof Function?this.toView(o,t[t.length-1]):o.buffer}}const co="string",zf=/^[0-9a-f]+$/i,Gf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Wf=/^[a-zA-Z0-9-_]+$/;class qa{static fromString(t){const r=unescape(encodeURIComponent(t)),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i.buffer}static toString(t){const r=V.toUint8Array(t);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class st{static toString(t,r=!1){const i=V.toArrayBuffer(t),o=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const c=o.getUint16(a,r);s+=String.fromCharCode(c)}return s}static fromString(t,r=!1){const i=new ArrayBuffer(t.length*2),o=new DataView(i);for(let s=0;s<t.length;s++)o.setUint16(s*2,t.charCodeAt(s),r);return i}}class R{static isHex(t){return typeof t===co&&zf.test(t)}static isBase64(t){return typeof t===co&&Gf.test(t)}static isBase64Url(t){return typeof t===co&&Wf.test(t)}static ToString(t,r="utf8"){const i=V.toUint8Array(t);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return st.toString(i,!0);case"utf16":case"utf16be":return st.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(t,r="utf8"){if(!t)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(t);case"binary":return this.FromBinary(t);case"hex":return this.FromHex(t);case"base64":return this.FromBase64(t);case"base64url":return this.FromBase64Url(t);case"utf16le":return st.fromString(t,!0);case"utf16":case"utf16be":return st.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=V.toUint8Array(t);if(typeof btoa<"u"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=R.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return qa.fromString(t);case"utf16":case"utf16be":return st.fromString(t);case"utf16le":case"usc2":return st.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=R.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return qa.toString(t);case"utf16":case"utf16be":return st.toString(t);case"utf16le":case"usc2":return st.toString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(t){const r=t.length,i=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);return i.buffer}static ToBinary(t){const r=V.toUint8Array(t);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(t){const r=V.toUint8Array(t);let i="";const o=r.length;for(let s=0;s<o;s++){const a=r[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const s=r.slice(o,o+2);i[o/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(t,r=!1){return st.toString(t,r)}static FromUtf16String(t,r=!1){return st.fromString(t,r)}static Base64Padding(t){const r=4-t.length%4;if(r<4)for(let i=0;i<r;i++)t+="=";return t}static formatString(t){return(t==null?void 0:t.replace(/[\n\r\t ]/g,""))||""}}R.DEFAULT_UTF8_ENCODING="utf8";function Jf(...e){const t=e.map(o=>o.byteLength).reduce((o,s)=>o+s),r=new Uint8Array(t);let i=0;return e.map(o=>new Uint8Array(o)).forEach(o=>{for(const s of o)r[i++]=s}),r.buffer}function za(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}/*!
|
|
38
38
|
Copyright (c) Peculiar Ventures, LLC
|
|
39
|
-
*/function cr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function
|
|
39
|
+
*/function cr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function Rt(e,t,r=-1){const i=r;let o=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(i<0)l=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);l=new ArrayBuffer(i),s=i}const d=new Uint8Array(l);for(let p=c-1;p>=0;p--){const y=Math.pow(2,p*t);d[s-p-1]=Math.floor(o/y),o-=d[s-p-1]*y}return l}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function lo(...e){let t=0,r=0;for(const s of e)t+=s.length;const i=new ArrayBuffer(t),o=new Uint8Array(i);for(const s of e)o.set(s,r),r+=s.length;return o}function Ga(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=e[0]===255&&e[1]&128,l=e[0]===0&&(e[1]&128)===0;(c||l)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let c=0;c<this.valueHex.byteLength;c++)r[c]=0;r[0]=e[0]&128;const i=cr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=e[c];return s[0]&=127,cr(s,8)-i}function Yf(e){const t=e<0?e*-1:e;let r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){const a=r-t,c=Rt(a,8,i),l=new Uint8Array(c);return l[0]|=128,c}let o=Rt(t,8,i),s=new Uint8Array(o);if(s[0]&128){const a=o.slice(0),c=new Uint8Array(a);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let l=0;l<a.byteLength;l++)s[l+1]=c[l];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function Zf(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function Ke(e,t){const r=e.toString(10);if(t<r.length)return"";const i=t-r.length,o=new Array(i);for(let a=0;a<i;a++)o[a]="0";return o.join("").concat(r)}/*!
|
|
40
40
|
* Copyright (c) 2014, GMO GlobalSign
|
|
41
41
|
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
42
42
|
* All rights reserved.
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
69
69
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
70
70
|
*
|
|
71
|
-
*/function Ei(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function uo(e){let t=0,r=0;for(let o=0;o<e.length;o++){const s=e[o];t+=s.byteLength}const i=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function yt(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class Ni{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return uo(this.items)}}const Hr=[new Uint8Array([1])],Ga="0123456789",fo="name",Ja="valueHexView",Jf="isHexOnly",Yf="idBlock",Zf="tagClass",Xf="tagNumber",Qf="isConstructed",ep="fromBER",tp="toBER",rp="local",$e="",et=new ArrayBuffer(0),_i=new Uint8Array(0),Fr="EndOfContent",Ya="OCTET STRING",Za="BIT STRING";function at(e){var t;return t=class extends e{constructor(...i){var o;super(...i);const s=i[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?V.toUint8Array(s.valueHex):_i}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,o,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!yt(this,a,o,s))return-1;const c=o+s;return this.valueHexView=a.subarray(o,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),o)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",et)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:M.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Ut{constructor({blockLength:t=0,error:r=$e,warnings:i=[],valueBeforeDecode:o=_i}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=V.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:M.ToHex(this.valueBeforeDecodeView)}}}Ut.NAME="baseBlock";class je extends Ut{fromBER(t,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}je.NAME="valueBlock";class Xa extends at(Ut){constructor({idBlock:t={}}={}){var r,i,o,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?V.toUint8Array(t.valueHex):_i,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=t.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",et}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,o[0]=r}return o.buffer}if(!this.isHexOnly){const o=Mt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)i[s+1]=o[s]|128;i[this.valueHexView.byteLength]=o[o.length-1]}return i.buffer}fromBER(t,r,i){const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),p=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===p){p+=255;const x=new Uint8Array(p);for(let C=0;C<d.length;C++)x[C]=d[C];d=this.valueHexView=new Uint8Array(p)}}this.blockLength=l+1,d[l-1]=s[l]&127;const y=new Uint8Array(l);for(let x=0;x<l;x++)y[x]=d[x];d=this.valueHexView=new Uint8Array(l),d.set(y),this.blockLength<=9?this.tagNumber=cr(d,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}Xa.NAME="identificationBlock";class Qa extends Ut{constructor({lenBlock:t={}}={}){var r,i,o;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(o=t.length)!==null&&o!==void 0?o:0}fromBER(t,r,i){const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=r+1,l=o.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=cr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const o=Mt(this.length,8);if(o.byteLength>127)return this.error="Too big length",et;if(r=new ArrayBuffer(o.byteLength+1),t)return r;const s=new Uint8Array(o);i=new Uint8Array(r),i[0]=o.byteLength|128;for(let a=0;a<o.byteLength;a++)i[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}Qa.NAME="lengthBlock";const P={};class Be extends Ut{constructor({name:t=$e,optional:r=!1,primitiveSchema:i,...o}={},s){super(o),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new Xa(o),this.lenBlock=new Qa(o),this.valueBlock=s?new s(o):new je(o)}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}toBER(t,r){const i=r||new Ni;r||ec(this);const o=this.idBlock.toBER(t);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?et:i.final()}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(t.primitiveSchema=this.primitiveSchema.toJSON()),t}toString(t="ascii"){return t==="ascii"?this.onAsciiEncoding():M.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${M.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),i=t.toBER();return Gf(r,i)}}Be.NAME="BaseBlock";function ec(e){if(e instanceof P.Constructed)for(const t of e.valueBlock.value)ec(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class po extends Be{constructor({value:t=$e,...r}={},i){super(r,i),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}po.NAME="BaseStringBlock";class tc extends at(je){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}tc.NAME="PrimitiveValueBlock";var rc;class Kr extends Be{constructor(t={}){super(t,tc),this.idBlock.isConstructed=!1}}rc=Kr,P.Primitive=rc,Kr.NAME="PRIMITIVE";function ip(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function lr(e,t=0,r=e.length){const i=t;let o=new Be({},je);const s=new Ut;if(!yt(s,e,t,r))return o.error=s.error,{offset:-1,result:o};if(!e.subarray(t,t+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let c=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),c===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=c,r-=o.idBlock.blockLength,c=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),c===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=c,r-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let l=Be;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};l=P.EndOfContent;break;case 1:l=P.Boolean;break;case 2:l=P.Integer;break;case 3:l=P.BitString;break;case 4:l=P.OctetString;break;case 5:l=P.Null;break;case 6:l=P.ObjectIdentifier;break;case 10:l=P.Enumerated;break;case 12:l=P.Utf8String;break;case 13:l=P.RelativeObjectIdentifier;break;case 14:l=P.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=P.Sequence;break;case 17:l=P.Set;break;case 18:l=P.NumericString;break;case 19:l=P.PrintableString;break;case 20:l=P.TeletexString;break;case 21:l=P.VideotexString;break;case 22:l=P.IA5String;break;case 23:l=P.UTCTime;break;case 24:l=P.GeneralizedTime;break;case 25:l=P.GraphicString;break;case 26:l=P.VisibleString;break;case 27:l=P.GeneralString;break;case 28:l=P.UniversalString;break;case 29:l=P.CharacterString;break;case 30:l=P.BmpString;break;case 31:l=P.DATE;break;case 32:l=P.TimeOfDay;break;case 33:l=P.DateTime;break;case 34:l=P.Duration;break;default:{const d=o.idBlock.isConstructed?new P.Constructed:new P.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:l=o.idBlock.isConstructed?P.Constructed:P.Primitive}return o=ip(o,l),c=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(i,i+o.blockLength),{offset:c,result:o}}function ur(e){if(!e.byteLength){const t=new Be({},je);return t.error="Input buffer has zero length",{offset:-1,result:t}}return lr(V.toUint8Array(e).slice(),0,e.byteLength)}function np(e,t){return e?1:t}class Nt extends je{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;np(this.isIndefiniteForm,i)>0;){const a=lr(o,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Fr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Fr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Ni;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?et:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Nt.NAME="ConstructedValueBlock";var ic;class Re extends Be{constructor(t={}){super(t,Nt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){const t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
71
|
+
*/function Ei(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function uo(e){let t=0,r=0;for(let o=0;o<e.length;o++){const s=e[o];t+=s.byteLength}const i=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function yt(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class Ni{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return uo(this.items)}}const Hr=[new Uint8Array([1])],Wa="0123456789",fo="name",Ja="valueHexView",Xf="isHexOnly",Qf="idBlock",ep="tagClass",tp="tagNumber",rp="isConstructed",ip="fromBER",np="toBER",op="local",$e="",et=new ArrayBuffer(0),_i=new Uint8Array(0),Fr="EndOfContent",Ya="OCTET STRING",Za="BIT STRING";function at(e){var t;return t=class extends e{constructor(...i){var o;super(...i);const s=i[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?V.toUint8Array(s.valueHex):_i}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,o,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!yt(this,a,o,s))return-1;const c=o+s;return this.valueHexView=a.subarray(o,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),o)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",et)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:R.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Ut{constructor({blockLength:t=0,error:r=$e,warnings:i=[],valueBeforeDecode:o=_i}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=V.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:R.ToHex(this.valueBeforeDecodeView)}}}Ut.NAME="baseBlock";class je extends Ut{fromBER(t,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}je.NAME="valueBlock";class Xa extends at(Ut){constructor({idBlock:t={}}={}){var r,i,o,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?V.toUint8Array(t.valueHex):_i,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=t.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",et}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,o[0]=r}return o.buffer}if(!this.isHexOnly){const o=Rt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)i[s+1]=o[s]|128;i[this.valueHexView.byteLength]=o[o.length-1]}return i.buffer}fromBER(t,r,i){const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),p=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===p){p+=255;const x=new Uint8Array(p);for(let C=0;C<d.length;C++)x[C]=d[C];d=this.valueHexView=new Uint8Array(p)}}this.blockLength=l+1,d[l-1]=s[l]&127;const y=new Uint8Array(l);for(let x=0;x<l;x++)y[x]=d[x];d=this.valueHexView=new Uint8Array(l),d.set(y),this.blockLength<=9?this.tagNumber=cr(d,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}Xa.NAME="identificationBlock";class Qa extends Ut{constructor({lenBlock:t={}}={}){var r,i,o;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(o=t.length)!==null&&o!==void 0?o:0}fromBER(t,r,i){const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=r+1,l=o.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=cr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const o=Rt(this.length,8);if(o.byteLength>127)return this.error="Too big length",et;if(r=new ArrayBuffer(o.byteLength+1),t)return r;const s=new Uint8Array(o);i=new Uint8Array(r),i[0]=o.byteLength|128;for(let a=0;a<o.byteLength;a++)i[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}Qa.NAME="lengthBlock";const P={};class Be extends Ut{constructor({name:t=$e,optional:r=!1,primitiveSchema:i,...o}={},s){super(o),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new Xa(o),this.lenBlock=new Qa(o),this.valueBlock=s?new s(o):new je(o)}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}toBER(t,r){const i=r||new Ni;r||ec(this);const o=this.idBlock.toBER(t);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?et:i.final()}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(t.primitiveSchema=this.primitiveSchema.toJSON()),t}toString(t="ascii"){return t==="ascii"?this.onAsciiEncoding():R.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${R.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),i=t.toBER();return Zf(r,i)}}Be.NAME="BaseBlock";function ec(e){if(e instanceof P.Constructed)for(const t of e.valueBlock.value)ec(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class po extends Be{constructor({value:t=$e,...r}={},i){super(r,i),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}po.NAME="BaseStringBlock";class tc extends at(je){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}tc.NAME="PrimitiveValueBlock";var rc;class Kr extends Be{constructor(t={}){super(t,tc),this.idBlock.isConstructed=!1}}rc=Kr,P.Primitive=rc,Kr.NAME="PRIMITIVE";function sp(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function lr(e,t=0,r=e.length){const i=t;let o=new Be({},je);const s=new Ut;if(!yt(s,e,t,r))return o.error=s.error,{offset:-1,result:o};if(!e.subarray(t,t+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let c=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),c===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=c,r-=o.idBlock.blockLength,c=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),c===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=c,r-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let l=Be;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};l=P.EndOfContent;break;case 1:l=P.Boolean;break;case 2:l=P.Integer;break;case 3:l=P.BitString;break;case 4:l=P.OctetString;break;case 5:l=P.Null;break;case 6:l=P.ObjectIdentifier;break;case 10:l=P.Enumerated;break;case 12:l=P.Utf8String;break;case 13:l=P.RelativeObjectIdentifier;break;case 14:l=P.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=P.Sequence;break;case 17:l=P.Set;break;case 18:l=P.NumericString;break;case 19:l=P.PrintableString;break;case 20:l=P.TeletexString;break;case 21:l=P.VideotexString;break;case 22:l=P.IA5String;break;case 23:l=P.UTCTime;break;case 24:l=P.GeneralizedTime;break;case 25:l=P.GraphicString;break;case 26:l=P.VisibleString;break;case 27:l=P.GeneralString;break;case 28:l=P.UniversalString;break;case 29:l=P.CharacterString;break;case 30:l=P.BmpString;break;case 31:l=P.DATE;break;case 32:l=P.TimeOfDay;break;case 33:l=P.DateTime;break;case 34:l=P.Duration;break;default:{const d=o.idBlock.isConstructed?new P.Constructed:new P.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:l=o.idBlock.isConstructed?P.Constructed:P.Primitive}return o=sp(o,l),c=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(i,i+o.blockLength),{offset:c,result:o}}function ur(e){if(!e.byteLength){const t=new Be({},je);return t.error="Input buffer has zero length",{offset:-1,result:t}}return lr(V.toUint8Array(e).slice(),0,e.byteLength)}function ap(e,t){return e?1:t}class Nt extends je{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;ap(this.isIndefiniteForm,i)>0;){const a=lr(o,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Fr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Fr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Ni;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?et:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Nt.NAME="ConstructedValueBlock";var ic;class Me extends Be{constructor(t={}){super(t,Nt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),o)}onAsciiEncoding(){const t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
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} :`}}ic=Re,P.Constructed=ic,Re.NAME="CONSTRUCTED";class nc extends je{fromBER(t,r,i){return r}toBER(t){return et}}nc.override="EndOfContentValueBlock";var oc;class ho extends Be{constructor(t={}){super(t,nc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}oc=ho,P.EndOfContent=oc,ho.NAME=Fr;var sc;class Lt extends Be{constructor(t={}){super(t,je),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}sc=Lt,P.Null=sc,Lt.NAME="NULL";class ac extends at(je){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=V.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,i){const o=V.toUint8Array(t);return yt(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Wa.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}ac.NAME="BooleanValueBlock";var cc;let Oi=class extends Be{constructor(t={}){super(t,ac),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}`}};cc=Oi,P.Boolean=cc,Oi.NAME="BOOLEAN";class lc extends at(Nt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=Nt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Fr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Ya)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,i),this.blockLength=i;return o}toBER(t,r){return this.isConstructed?Nt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}lc.NAME="OctetStringValueBlock";var uc;let Ht=class Mf extends Be{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},lc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=lr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Re.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${M.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 Mf&&t.push(r.valueBlock.valueHexView);return V.concat(t)}};uc=Ht,P.OctetString=uc,Ht.NAME=Ya;class dc extends at(Nt){constructor({unusedBits:t=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,i){if(!i)return r;let o=-1;if(this.isConstructed){if(o=Nt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const c of this.value){const l=c.constructor.NAME;if(l===Fr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==Za)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.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=V.toUint8Array(t);if(!yt(this,s,r,i))return-1;const a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const c=a.subarray(1);try{if(c.byteLength){const l=lr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return Nt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return et;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}dc.NAME="BitStringValueBlock";var fc;let Ft=class extends Be{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},dc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Re.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};fc=Ft,P.BitString=fc,Ft.NAME=Za;var pc;function op(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),o=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=o.slice(0),l=c.length-1;let d=0;const p=l<a?a:l;let y=0;for(let x=p;x>=0;x--,y++){switch(!0){case y<c.length:d=s[a-y]+c[l-y]+r[0];break;default:d=s[a-y]+r[0]}switch(r[0]=d/10,!0){case y>=s.length:s=lo(new Uint8Array([d%10]),s);break;default:s[a-y]=d%10}}return r[0]>0&&(s=lo(r,s)),s}function hc(e){if(e>=Hr.length)for(let t=Hr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Hr[t-1].slice(0);for(let o=i.length-1;o>=0;o--){const s=new Uint8Array([(i[o]<<1)+r[0]]);r[0]=s[0]/10,i[o]=s[0]%10}r[0]>0&&(i=lo(r,i)),Hr.push(i)}return Hr[e]}function sp(e,t){let r=0;const i=new Uint8Array(e),o=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=o.slice(0),l=c.length-1;let d,p=0;for(let y=l;y>=0;y--,p++)switch(d=s[a-p]-c[l-p]-r,!0){case d<0:r=1,s[a-p]=d+10;break;default:r=0,s[a-p]=d}if(r>0)for(let y=a-l+1;y>=0;y--,p++)if(d=s[a-p]-r,d<0)r=1,s[a-p]=d+10;else{r=0,s[a-p]=d;break}return s.slice()}class yo extends at(je){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=Wa.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Wf(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,o=0){const s=this.fromBER(t,r,i);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 i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,i){const o=super.fromBER(t,r,i);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),i=0,o;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){o=s[l];for(let d=0;d<8;d++){if((o&1)===1)switch(i){case t:r=sp(hc(i),r),a="-";break;default:r=op(r,hc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=Ga.charAt(r[l]));return c===!1&&(a+=Ga.charAt(0)),a}}pc=yo,yo.NAME="IntegerValueBlock",Object.defineProperty(pc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var yc;class ct extends Be{constructor(t={}){super(t,yo),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ei(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Ei();const r=BigInt(t),i=new Ni,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(M.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${M.ToHex(c)}`)+r,p=V.toUint8Array(M.FromHex(d.toString(16)));p[0]|=128,i.write(p)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new ct({valueHex:i.final()})}convertToDER(){const t=new ct({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ct({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}yc=ct,P.Integer=yc,ct.NAME="INTEGER";var mc;class Ti extends ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}mc=Ti,P.Enumerated=mc,Ti.NAME="ENUMERATED";class mo extends at(je){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];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=cr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Ei();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let o=0;o<i.length;o++)i[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<i.length?128:0);this.fromBER(i.buffer,0,i.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=Mt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",et;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i}toString(){let t="";if(this.isHexOnly)t=M.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}}}mo.NAME="sidBlock";class gc extends je{constructor({value:t=$e,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new mo;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(t);if(o.byteLength===0)return this.error=this.value[i].error,et;r.push(o)}return uo(r)}fromString(t){this.value=[];let r=0,i=0,o="",s=!1;do if(i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(o,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new mo;if(o>Number.MAX_SAFE_INTEGER){Ei();const c=BigInt(o);a.valueBigInt=c}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[i].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}}gc.NAME="ObjectIdentifierValueBlock";var bc;class Vi extends Be{constructor(t={}){super(t,gc),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()}}}bc=Vi,P.ObjectIdentifier=bc,Vi.NAME="OBJECT IDENTIFIER";class go extends at(Ut){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];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=cr(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=Mt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",et;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i.buffer}toString(){let t="";return this.isHexOnly?t=M.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}go.NAME="relativeSidBlock";class wc extends je{constructor({value:t=$e,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new go;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const i=[];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,et;i.push(s)}return uo(i)}fromString(t){this.value=[];let r=0,i=0,o="";do{i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1;const s=new go;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==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}}wc.NAME="RelativeObjectIdentifierValueBlock";var vc;class bo extends Be{constructor(t={}){super(t,wc),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()}}}vc=bo,P.RelativeObjectIdentifier=vc,bo.NAME="RelativeObjectIdentifier";var kc;class mt extends Re{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}kc=mt,P.Sequence=kc,mt.NAME="SEQUENCE";var Cc;let gt=class extends Re{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Cc=gt,P.Set=Cc,gt.NAME="SET";class Sc extends at(je){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=$e}toJSON(){return{...super.toJSON(),value:this.value}}}Sc.NAME="StringValueBlock";class xc extends Sc{}xc.NAME="SimpleStringValueBlock";class qe extends po{constructor({...t}={}){super(t,xc)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,V.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);this.valueBlock.value=t}}qe.NAME="SIMPLE STRING";class Ac extends qe{fromBuffer(t){this.valueBlock.valueHexView=V.toUint8Array(t);try{this.valueBlock.value=M.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=M.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(M.FromUtf8String(t)),this.valueBlock.value=t}}Ac.NAME="Utf8StringValueBlock";var Bc;class bt extends Ac{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Bc=bt,P.Utf8String=Bc,bt.NAME="UTF8String";class Ic extends qe{fromBuffer(t){this.valueBlock.value=M.ToUtf16String(t),this.valueBlock.valueHexView=V.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(M.FromUtf16String(t))}}Ic.NAME="BmpStringValueBlock";var Ec;class ji extends Ic{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Ec=ji,P.BmpString=Ec,ji.NAME="BMPString";class Nc extends qe{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);for(let o=0;o<i.length;o+=4)i[o]=i[o+3],i[o+1]=i[o+2],i[o+2]=0,i[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=Mt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[o*4+l+c]=a[l]}this.valueBlock.value=t}}Nc.NAME="UniversalStringValueBlock";var _c;class Di extends Nc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}_c=Di,P.UniversalString=_c,Di.NAME="UniversalString";var Oc;class Pi extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Oc=Pi,P.NumericString=Oc,Pi.NAME="NumericString";var Tc;class $i extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Tc=$i,P.PrintableString=Tc,$i.NAME="PrintableString";var Vc;class Ri extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Vc=Ri,P.TeletexString=Vc,Ri.NAME="TeletexString";var jc;class Mi extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}jc=Mi,P.VideotexString=jc,Mi.NAME="VideotexString";var Dc;class Ui extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Dc=Ui,P.IA5String=Dc,Ui.NAME="IA5String";var Pc;class Li extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Pc=Li,P.GraphicString=Pc,Li.NAME="GraphicString";var $c;class qr extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}$c=qr,P.VisibleString=$c,qr.NAME="VisibleString";var Rc;class Hi extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Rc=Hi,P.GeneralString=Rc,Hi.NAME="GeneralString";var Mc;class Fi extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Mc=Fi,P.CharacterString=Mc,Fi.NAME="CharacterString";var Uc;class zr extends qr{constructor({value:t,valueDate:r,...i}={}){if(super(i),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,V.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o<t.length;o++)i[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 i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const o=parseInt(i[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=Ke(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Ke(this.month,2),r[2]=Ke(this.day,2),r[3]=Ke(this.hour,2),r[4]=Ke(this.minute,2),r[5]=Ke(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}}}Uc=zr,P.UTCTime=Uc,zr.NAME="UTCTime";var Lc;class Ki extends zr{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,i="",o="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const y=new Number(t[t.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let y=1,x=i.indexOf("+"),C="";if(x===-1&&(x=i.indexOf("-"),y=-1),x!==-1){if(C=i.substring(x+1),i=i.substring(0,x),C.length!==2&&C.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(C.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=y*h,C.length===4){if(h=parseInt(C.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=y*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const y=new Number(`0${i.substring(d)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),o=i.substring(0,d)}else o=i;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 y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}const p=a.exec(o);if(p===null)throw new Error("Wrong input string for conversion");for(let y=1;y<p.length;y++)switch(y){case 1:this.year=parseInt(p[y],10);break;case 2:this.month=parseInt(p[y],10);break;case 3:this.day=parseInt(p[y],10);break;case 4:this.hour=parseInt(p[y],10)+c;break;case 5:this.minute=parseInt(p[y],10)+l;break;case 6:this.second=parseInt(p[y],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Ke(this.year,4)),r.push(Ke(this.month,2)),r.push(Ke(this.day,2)),r.push(Ke(this.hour,2)),r.push(Ke(this.minute,2)),r.push(Ke(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Ke(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Lc=Ki,P.GeneralizedTime=Lc,Ki.NAME="GeneralizedTime";var Hc;class wo extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Hc=wo,P.DATE=Hc,wo.NAME="DATE";var Fc;class vo extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Fc=vo,P.TimeOfDay=Fc,vo.NAME="TimeOfDay";var Kc;class ko extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Kc=ko,P.DateTime=Kc,ko.NAME="DateTime";var qc;class Co extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}qc=Co,P.Duration=qc,Co.NAME="Duration";var zc;class So extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}zc=So,P.TIME=zc,So.NAME="TIME";class Kt{constructor({name:t=$e,optional:r=!1}={}){this.name=t,this.optional=r}}class xo extends Kt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class qi extends Kt{constructor({value:t=new Kt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class ap{constructor({data:t=_i}={}){this.dataView=V.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=V.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=V.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function qt(e,t,r){if(r instanceof xo){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(fo)&&(s.name=r.name),s}}if(r instanceof Kt)return r.hasOwnProperty(fo)&&(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(!(Yf in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ep in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(tp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(Zf)===!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(Xf)===!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(Qf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Jf 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(!(Ja 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 c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,$e),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof qi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,$e),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].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,$e),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof qi){if(a=qt(e,t.valueBlock.value[l],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,$e),r.name&&delete e[r.name]),a;if(fo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};rp 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[l])}}else if(a=qt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,$e),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,$e),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&Ja in t.valueBlock){const s=lr(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,$e),r.name&&(delete e[r.name],a.name=r.name)),a}return qt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function cp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=lr(V.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:qt(r.result,r.result,t)}const Wc=Object.freeze(Object.defineProperty({__proto__:null,Any:Kt,BaseBlock:Be,BaseStringBlock:po,BitString:Ft,BmpString:ji,Boolean:Oi,CharacterString:Fi,Choice:xo,Constructed:Re,DATE:wo,DateTime:ko,Duration:Co,EndOfContent:ho,Enumerated:Ti,GeneralString:Hi,GeneralizedTime:Ki,GraphicString:Li,HexBlock:at,IA5String:Ui,Integer:ct,Null:Lt,NumericString:Pi,ObjectIdentifier:Vi,OctetString:Ht,Primitive:Kr,PrintableString:$i,RawData:ap,RelativeObjectIdentifier:bo,Repeated:qi,Sequence:mt,Set:gt,TIME:So,TeletexString:Ri,TimeOfDay:vo,UTCTime:zr,UniversalString:Di,Utf8String:bt,ValueBlock:je,VideotexString:Mi,ViewWriter:Ni,VisibleString:qr,compareSchema:qt,fromBER:ur,verifySchema:cp},Symbol.toStringTag,{value:"Module"}));var N;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(N||(N={}));var k;(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"})(k||(k={}));class zi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(V.isBufferSource(t))this.unusedBits=r,this.value=V.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Ft))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 Ft({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Ft({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.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 i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class ie{constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):V.isBufferSource(t)?this.buffer=V.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}fromASN(t){if(!(t instanceof Ht))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Ht({valueHex:this.buffer})}toSchema(t){return new Ht({name:t})}}const lp={fromASN:e=>e instanceof Lt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Lt;const t=ur(e);if(t.result.error)throw new Error(t.result.error);return t.result}},up={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ct({value:+e})},dp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ti({value:e})},me={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ct({valueHex:e})},fp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Ft({valueHex:e})},pp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Vi({value:e})},hp={fromASN:e=>e.valueBlock.value,toASN:e=>new Oi({value:e})},Wi={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Ht({valueHex:e})},yp={fromASN:e=>new ie(e.getValue()),toASN:e=>e.toASN()};function Je(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const Gc=Je(bt),mp=Je(ji),gp=Je(Di),bp=Je(Pi),wp=Je($i),vp=Je(Ri),kp=Je(Mi),Cp=Je(Ui),Sp=Je(Li),xp=Je(qr),Ap=Je(Hi),Bp=Je(Fi),Ip={fromASN:e=>e.toDate(),toASN:e=>new zr({valueDate:e})},Ep={fromASN:e=>e.toDate(),toASN:e=>new Ki({valueDate:e})},Np={fromASN:()=>null,toASN:()=>new Lt};function Ao(e){switch(e){case k.Any:return lp;case k.BitString:return fp;case k.BmpString:return mp;case k.Boolean:return hp;case k.CharacterString:return Bp;case k.Enumerated:return dp;case k.GeneralString:return Ap;case k.GeneralizedTime:return Ep;case k.GraphicString:return Sp;case k.IA5String:return Cp;case k.Integer:return up;case k.Null:return Np;case k.NumericString:return bp;case k.ObjectIdentifier:return pp;case k.OctetString:return Wi;case k.PrintableString:return wp;case k.TeletexString:return vp;case k.UTCTime:return Ip;case k.UniversalString:return gp;case k.Utf8String:return Gc;case k.VideotexString:return kp;case k.VisibleString:return xp;default:return null}}function wt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:wt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function Jc(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:Jc(r)}return!1}function _p(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}class Op{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const i=this.items.get(t);if(!i)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:N.Sequence,items:{}},i=this.findParentSchema(t);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(t,r){const i=this.items.get(t)||this.createDefault(t),o=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const p=k[a.type],y=Wc[p];if(!y)throw new Error(`Cannot get ASN1 class by name '${p}'`);l=new y({name:c})}else wt(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===N.Choice?l=new Kt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Kt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const p=a.repeated==="set"?gt:mt;l=new p({name:"",value:[new qi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||wt(a.type)){const p=a.repeated?Re:Kr;o.push(new p({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const p=!!a.repeated;let y=p?l:this.get(a.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,o.push(new Re({name:p?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:y}))}else o.push(new Re({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,o.push(l)}switch(i.type){case N.Sequence:return new mt({value:o,name:""});case N.Set:return new gt({value:o,name:""});case N.Choice:return new xo({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 Ye=new Op,O=e=>t=>{let r;Ye.has(t)?r=Ye.get(t):(r=Ye.createDefault(t),Ye.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;Ye.has(t.constructor)?i=Ye.get(t.constructor):(i=Ye.createDefault(t.constructor),Ye.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Ao(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}i.items[r]=o};class Yc extends Error{constructor(){super(...arguments),this.schemas=[]}}class Tp{static parse(t,r){const i=ur(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(wt(r))return new r().fromASN(t);const o=Ye.get(r);Ye.cache(r);let s=o.schema;if(t.constructor===Re&&o.type!==N.Choice){s=new Re({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=qt({},t,s);if(!a.verified)throw new Yc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(Jc(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 l=o.itemType;if(typeof l=="number"){const d=Ao(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,p=>d.fromASN(p))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const p=o.items[l],y=p.type;if(typeof y=="number"||wt(y)){const x=(i=p.converter)!==null&&i!==void 0?i:wt(y)?new y:null;if(!x)throw new Error("Converter is empty");if(p.repeated)if(p.implicit){const C=p.repeated==="sequence"?mt:gt,h=new C;h.valueBlock=d.valueBlock;const m=ur(h.toBER(!1));if(m.offset===-1)throw new Error(`Cannot parse the child item. ${m.result.error}`);if(!("value"in m.result.valueBlock&&Array.isArray(m.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const b=m.result.valueBlock.value;c[l]=Array.from(b,v=>x.fromASN(v))}else c[l]=Array.from(d,C=>x.fromASN(C));else{let C=d;if(p.implicit){let h;if(wt(y))h=new y().toSchema("");else{const m=k[y],b=Wc[m];if(!b)throw new Error(`Cannot get '${m}' class from asn1js module`);h=new b}h.valueBlock=C.valueBlock,C=ur(h.toBER(!1)).result}c[l]=x.fromASN(C)}}else if(p.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.");c[l]=Array.from(d,x=>this.fromASN(x,y))}else c[l]=this.fromASN(d,y)}return c}catch(o){throw o instanceof Yc&&o.schemas.push(r.name),o}}}class Bo{static serialize(t){return t instanceof Be?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&wt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=Ye.get(r);Ye.cache(r);let o=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=Ao(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(c=>a.toASN(c))}else o=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&_p(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Bo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||wt(c.type))){const p={};p.valueHex=d instanceof Lt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Kr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...p}))}else o.push(new Re({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new Re({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case N.Sequence:s=new mt({value:o});break;case N.Set:s=new gt({value:o});break;case N.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,i,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 ${k[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,d=>a.toASN(d)),l=t.repeated==="sequence"?mt:gt;s=new l({value:c})}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,l=>this.toASN(l)),c=t.repeated==="sequence"?mt:gt;s=new c({value:a})}else s=this.toASN(o);return s}}class ae extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class L{static serialize(t){return Bo.serialize(t)}static parse(t,r){return Tp.parse(t,r)}static toString(t){const r=V.isBufferSource(t)?V.toArrayBuffer(t):L.serialize(t),i=ur(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(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 Zc={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={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,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,m){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,w=(h.match(l.zoneIndex)||[])[0],g,A;for(w&&(w=w.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>m)return null;for(A=m-b,g=":";A--;)g+="0:";return h=h.replace("::",g),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),m=function(){const J=h.split(":"),X=[];for(let I=0;I<J.length;I++)X.push(parseInt(J[I],16));return X}(),{parts:m,zoneId:w}}function p(h,m,b,v){if(h.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let w=0,g;for(;v>0;){if(g=b-v,g<0&&(g=0),h[w]>>g!==m[w]>>g)return!1;v-=b,w+=1}return!0}function y(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 x(h,m){for(;h.length<m;)h=`0${h}`;return h}const C={};C.IPv4=function(){function h(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,v;for(b=0;b<m.length;b++)if(v=m[b],!(0<=v&&v<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}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(m,b){let v;if(b===void 0&&(v=m,m=v[0],b=v[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,m.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let w,g,A;for(w=3;w>=0;w-=1)if(g=this.octets[w],g in v){if(A=v[g],b&&A!==0)return null;A!==8&&(b=!0),m+=A}else return null;return 32-m},h.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return C.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),C.IPv4.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),b=m[0].toByteArray(),v=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),w=[];let g=0;for(;g<4;)w.push(parseInt(b[g],10)|parseInt(v[g],10)^255),g++;return new this(w)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.isIPv4=function(h){return this.parser(h)!==null},C.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},C.IPv4.isValidFourPartDecimal=function(h){return!!(C.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},C.IPv4.networkAddressFromCIDR=function(h){let m,b,v,w,g;try{for(m=this.parseCIDR(h),v=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),w=[],b=0;b<4;)w.push(parseInt(v[b],10)&parseInt(g[b],10)),b++;return new this(w)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.parse=function(h){const m=this.parser(h);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},C.IPv4.parseCIDR=function(h){let m;if(m=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(m[2]);if(b>=0&&b<=32){const v=[this.parse(m[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")},C.IPv4.parser=function(h){let m,b,v;if(m=h.match(i.fourOctet))return function(){const w=m.slice(1,6),g=[];for(let A=0;A<w.length;A++)b=w[A],g.push(y(b));return g}();if(m=h.match(i.longValue)){if(v=y(m[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const w=[];let g;for(g=0;g<=24;g+=8)w.push(v>>g&255);return w}().reverse()}else return(m=h.match(i.twoOctet))?function(){const w=m.slice(1,4),g=[];if(v=y(w[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return g.push(y(w[0])),g.push(v>>16&255),g.push(v>>8&255),g.push(v&255),g}():(m=h.match(i.threeOctet))?function(){const w=m.slice(1,5),g=[];if(v=y(w[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return g.push(y(w[0])),g.push(y(w[1])),g.push(v>>8&255),g.push(v&255),g}():null},C.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const m=[0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)m[b]=255,b++;return v<4&&(m[v]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},C.IPv6=function(){function h(m,b){let v,w;if(m.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(m[v]<<8|m[v+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(w=this.parts[v],!(0<=w&&w<=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(m,b){let v;if(b===void 0&&(v=m,m=v[0],b=v[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,m.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let m=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 w,g;for(let A=7;A>=0;A-=1)if(w=this.parts[A],w in v){if(g=v[w],b&&g!==0)return null;g!==16&&(b=!0),m+=g}else return null;return 128-m},h.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let m;const b=[],v=this.parts;for(let w=0;w<v.length;w++)m=v[w],b.push(m>>8),b.push(m&255);return b},h.prototype.toFixedLengthString=function(){const m=(function(){const v=[];for(let w=0;w<this.parts.length;w++)v.push(x(this.parts[w].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),m+b},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const m=this.parts.slice(-2),b=m[0],v=m[1];return new C.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const m=(function(){const v=[];for(let w=0;w<this.parts.length;w++)v.push(this.parts[w].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),m+b},h.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,w=-1,g;for(;g=m.exec(b);)g[0].length>w&&(v=g.index,w=g[0].length);return w<0?b:`${b.substring(0,v)}::${b.substring(v+w)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),C.IPv6.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),b=m[0].toByteArray(),v=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),w=[];let g=0;for(;g<16;)w.push(parseInt(b[g],10)|parseInt(v[g],10)^255),g++;return new this(w)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},C.IPv6.isIPv6=function(h){return this.parser(h)!==null},C.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const m=this.parser(h);return new this(m.parts,m.zoneId),!0}catch{return!1}},C.IPv6.networkAddressFromCIDR=function(h){let m,b,v,w,g;try{for(m=this.parseCIDR(h),v=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),w=[],b=0;b<16;)w.push(parseInt(v[b],10)&parseInt(g[b],10)),b++;return new this(w)}catch(A){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${A})`)}},C.IPv6.parse=function(h){const m=this.parser(h);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},C.IPv6.parseCIDR=function(h){let m,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(m=parseInt(b[2]),m>=0&&m<=128))return v=[this.parse(b[1]),m],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},C.IPv6.parser=function(h){let m,b,v,w,g,A;if(v=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(l.native.test(h))return d(h,8);if((v=h.match(l.transitional))&&(A=v[6]||"",m=d(v[1].slice(0,-1)+A,6),m.parts)){for(g=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<g.length;b++)if(w=g[b],!(0<=w&&w<=255))return null;return m.parts.push(g[0]<<8|g[1]),m.parts.push(g[2]<<8|g[3]),{parts:m.parts,zoneId:m.zoneId}}return null},C.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const m=[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;)m[b]=255,b++;return v<16&&(m[v]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},C.fromByteArray=function(h){const m=h.length;if(m===4)return new C.IPv4(h);if(m===16)return new C.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},C.isValid=function(h){return C.IPv6.isValid(h)||C.IPv4.isValid(h)},C.parse=function(h){if(C.IPv6.isValid(h))return C.IPv6.parse(h);if(C.IPv4.isValid(h))return C.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},C.parseCIDR=function(h){try{return C.IPv6.parseCIDR(h)}catch{try{return C.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},C.process=function(h){const m=this.parse(h);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},C.subnetMatch=function(h,m,b){let v,w,g,A;b==null&&(b="unicast");for(w in m)if(Object.prototype.hasOwnProperty.call(m,w)){for(g=m[w],g[0]&&!(g[0]instanceof Array)&&(g=[g]),v=0;v<g.length;v++)if(A=g[v],h.kind()===A[0].kind()&&h.match.apply(h,A))return w}return b},e.exports?e.exports=C:t.ipaddr=C})(ao)})(Zc);var Xc=Zc.exports;class Qc{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 i=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return Xc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(M.ToHex(t))}static fromString(t){const r=Xc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Io,Eo,No;let Ie=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:k.TeletexString})],Ie.prototype,"teletexString",void 0),u([f({type:k.PrintableString})],Ie.prototype,"printableString",void 0),u([f({type:k.UniversalString})],Ie.prototype,"universalString",void 0),u([f({type:k.Utf8String})],Ie.prototype,"utf8String",void 0),u([f({type:k.BmpString})],Ie.prototype,"bmpString",void 0),Ie=u([O({type:N.Choice})],Ie);let dr=class extends Ie{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?M.ToHex(this.anyValue):super.toString())}};u([f({type:k.IA5String})],dr.prototype,"ia5String",void 0),u([f({type:k.Any})],dr.prototype,"anyValue",void 0),dr=u([O({type:N.Choice})],dr);class Wr{constructor(t={}){this.type="",this.value=new dr,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Wr.prototype,"type",void 0),u([f({type:dr})],Wr.prototype,"value",void 0);let fr=Io=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Io.prototype)}};fr=Io=u([O({type:N.Set,itemType:Wr})],fr);let _o=Eo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Eo.prototype)}};_o=Eo=u([O({type:N.Sequence,itemType:fr})],_o);let ke=No=class extends _o{constructor(t){super(t),Object.setPrototypeOf(this,No.prototype)}};ke=No=u([O({type:N.Sequence})],ke);const Vp={fromASN:e=>Qc.toString(Wi.fromASN(e)),toASN:e=>Wi.toASN(Qc.fromString(e))};class Gr{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Gr.prototype,"typeId",void 0),u([f({type:k.Any,context:0})],Gr.prototype,"value",void 0);class Oo{constructor(t={}){this.partyName=new Ie,Object.assign(this,t)}}u([f({type:Ie,optional:!0,context:0,implicit:!0})],Oo.prototype,"nameAssigner",void 0),u([f({type:Ie,context:1,implicit:!0})],Oo.prototype,"partyName",void 0);let Z=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Gr,context:0,implicit:!0})],Z.prototype,"otherName",void 0),u([f({type:k.IA5String,context:1,implicit:!0})],Z.prototype,"rfc822Name",void 0),u([f({type:k.IA5String,context:2,implicit:!0})],Z.prototype,"dNSName",void 0),u([f({type:k.Any,context:3,implicit:!0})],Z.prototype,"x400Address",void 0),u([f({type:ke,context:4,implicit:!1})],Z.prototype,"directoryName",void 0),u([f({type:Oo,context:5})],Z.prototype,"ediPartyName",void 0),u([f({type:k.IA5String,context:6,implicit:!0})],Z.prototype,"uniformResourceIdentifier",void 0),u([f({type:k.OctetString,context:7,implicit:!0,converter:Vp})],Z.prototype,"iPAddress",void 0),u([f({type:k.ObjectIdentifier,context:8,implicit:!0})],Z.prototype,"registeredID",void 0),Z=u([O({type:N.Choice})],Z);const pr="1.3.6.1.5.5.7.3",zt="2.5.29";var To;class Gi{constructor(t={}){this.accessMethod="",this.accessLocation=new Z,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Gi.prototype,"accessMethod",void 0),u([f({type:Z})],Gi.prototype,"accessLocation",void 0);let el=To=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,To.prototype)}};el=To=u([O({type:N.Sequence,itemType:Gi})],el);const Vo=`${zt}.35`;class jo extends ie{}class Wt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:jo,context:0,optional:!0,implicit:!0})],Wt.prototype,"keyIdentifier",void 0),u([f({type:Z,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Wt.prototype,"authorityCertIssuer",void 0),u([f({type:k.Integer,context:2,optional:!0,implicit:!0,converter:me})],Wt.prototype,"authorityCertSerialNumber",void 0);const tl=`${zt}.19`;class Ji{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:k.Boolean,defaultValue:!1})],Ji.prototype,"cA",void 0),u([f({type:k.Integer,optional:!0})],Ji.prototype,"pathLenConstraint",void 0);var Do;let De=Do=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};De=Do=u([O({type:N.Sequence,itemType:Z})],De);var Po;let rl=Po=class extends De{constructor(t){super(t),Object.setPrototypeOf(this,Po.prototype)}};rl=Po=u([O({type:N.Sequence})],rl);var $o;const il=`${zt}.32`;let vt=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:k.IA5String})],vt.prototype,"ia5String",void 0),u([f({type:k.VisibleString})],vt.prototype,"visibleString",void 0),u([f({type:k.BmpString})],vt.prototype,"bmpString",void 0),u([f({type:k.Utf8String})],vt.prototype,"utf8String",void 0),vt=u([O({type:N.Choice})],vt);class Ro{constructor(t={}){this.organization=new vt,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:vt})],Ro.prototype,"organization",void 0),u([f({type:k.Integer,repeated:"sequence"})],Ro.prototype,"noticeNumbers",void 0);class Mo{constructor(t={}){Object.assign(this,t)}}u([f({type:Ro,optional:!0})],Mo.prototype,"noticeRef",void 0),u([f({type:vt,optional:!0})],Mo.prototype,"explicitText",void 0);let Yi=class{constructor(t={}){Object.assign(this,t)}};u([f({type:k.IA5String})],Yi.prototype,"cPSuri",void 0),u([f({type:Mo})],Yi.prototype,"userNotice",void 0),Yi=u([O({type:N.Choice})],Yi);class Uo{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Uo.prototype,"policyQualifierId",void 0),u([f({type:k.Any})],Uo.prototype,"qualifier",void 0);class Zi{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Zi.prototype,"policyIdentifier",void 0),u([f({type:Uo,repeated:"sequence",optional:!0})],Zi.prototype,"policyQualifiers",void 0);let Xi=$o=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};Xi=$o=u([O({type:N.Sequence,itemType:Zi})],Xi);let Qi=class{constructor(t=0){this.value=t}};u([f({type:k.Integer})],Qi.prototype,"value",void 0),Qi=u([O({type:N.Choice})],Qi);let nl=class extends Qi{};nl=u([O({type:N.Choice})],nl);var Lo,tt;(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"})(tt||(tt={}));class ol extends zi{toJSON(){const t=[],r=this.toNumber();return r&tt.aACompromise&&t.push("aACompromise"),r&tt.affiliationChanged&&t.push("affiliationChanged"),r&tt.cACompromise&&t.push("cACompromise"),r&tt.certificateHold&&t.push("certificateHold"),r&tt.cessationOfOperation&&t.push("cessationOfOperation"),r&tt.keyCompromise&&t.push("keyCompromise"),r&tt.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&tt.superseded&&t.push("superseded"),r&tt.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let hr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Z,context:0,repeated:"sequence",implicit:!0})],hr.prototype,"fullName",void 0),u([f({type:fr,context:1,implicit:!0})],hr.prototype,"nameRelativeToCRLIssuer",void 0),hr=u([O({type:N.Choice})],hr);class Jr{constructor(t={}){Object.assign(this,t)}}u([f({type:hr,context:0,optional:!0})],Jr.prototype,"distributionPoint",void 0),u([f({type:ol,context:1,optional:!0,implicit:!0})],Jr.prototype,"reasons",void 0),u([f({type:Z,context:2,optional:!0,repeated:"sequence",implicit:!0})],Jr.prototype,"cRLIssuer",void 0);let Ho=Lo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Lo.prototype)}};Ho=Lo=u([O({type:N.Sequence,itemType:Jr})],Ho);var Fo;let sl=Fo=class extends Ho{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};sl=Fo=u([O({type:N.Sequence,itemType:Jr})],sl);class Oe{constructor(t={}){this.onlyContainsUserCerts=Oe.ONLY,this.onlyContainsCACerts=Oe.ONLY,this.indirectCRL=Oe.ONLY,this.onlyContainsAttributeCerts=Oe.ONLY,Object.assign(this,t)}}Oe.ONLY=!1,u([f({type:hr,context:0,optional:!0})],Oe.prototype,"distributionPoint",void 0),u([f({type:k.Boolean,context:1,defaultValue:Oe.ONLY,implicit:!0})],Oe.prototype,"onlyContainsUserCerts",void 0),u([f({type:k.Boolean,context:2,defaultValue:Oe.ONLY,implicit:!0})],Oe.prototype,"onlyContainsCACerts",void 0),u([f({type:ol,context:3,optional:!0,implicit:!0})],Oe.prototype,"onlySomeReasons",void 0),u([f({type:k.Boolean,context:4,defaultValue:Oe.ONLY,implicit:!0})],Oe.prototype,"indirectCRL",void 0),u([f({type:k.Boolean,context:5,defaultValue:Oe.ONLY,implicit:!0})],Oe.prototype,"onlyContainsAttributeCerts",void 0);var Yr;(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"})(Yr||(Yr={}));let Ko=class{constructor(t=Yr.unspecified){this.reason=Yr.unspecified,this.reason=t}toJSON(){return Yr[this.reason]}toString(){return this.toJSON()}};u([f({type:k.Enumerated})],Ko.prototype,"reason",void 0),Ko=u([O({type:N.Choice})],Ko);var qo;const al=`${zt}.37`;let en=qo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};en=qo=u([O({type:N.Sequence,itemType:k.ObjectIdentifier})],en);const jp=`${pr}.1`,Dp=`${pr}.2`,Pp=`${pr}.3`,$p=`${pr}.4`,Rp=`${pr}.8`,Mp=`${pr}.9`;let zo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:k.Integer,converter:me})],zo.prototype,"value",void 0),zo=u([O({type:N.Choice})],zo);let Wo=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:k.GeneralizedTime})],Wo.prototype,"value",void 0),Wo=u([O({type:N.Choice})],Wo);var Go;let cl=Go=class extends De{constructor(t){super(t),Object.setPrototypeOf(this,Go.prototype)}};cl=Go=u([O({type:N.Sequence})],cl);const ll=`${zt}.15`;var rt;(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"})(rt||(rt={}));class Jo extends zi{toJSON(){const t=this.toNumber(),r=[];return t&rt.cRLSign&&r.push("crlSign"),t&rt.dataEncipherment&&r.push("dataEncipherment"),t&rt.decipherOnly&&r.push("decipherOnly"),t&rt.digitalSignature&&r.push("digitalSignature"),t&rt.encipherOnly&&r.push("encipherOnly"),t&rt.keyAgreement&&r.push("keyAgreement"),t&rt.keyCertSign&&r.push("keyCertSign"),t&rt.keyEncipherment&&r.push("keyEncipherment"),t&rt.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var Yo;class tn{constructor(t={}){this.base=new Z,this.minimum=0,Object.assign(this,t)}}u([f({type:Z})],tn.prototype,"base",void 0),u([f({type:k.Integer,context:0,defaultValue:0,implicit:!0})],tn.prototype,"minimum",void 0),u([f({type:k.Integer,context:1,optional:!0,implicit:!0})],tn.prototype,"maximum",void 0);let rn=Yo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};rn=Yo=u([O({type:N.Sequence,itemType:tn})],rn);class ul{constructor(t={}){Object.assign(this,t)}}u([f({type:rn,context:0,optional:!0,implicit:!0})],ul.prototype,"permittedSubtrees",void 0),u([f({type:rn,context:1,optional:!0,implicit:!0})],ul.prototype,"excludedSubtrees",void 0);class dl{constructor(t={}){Object.assign(this,t)}}u([f({type:k.Integer,context:0,implicit:!0,optional:!0,converter:me})],dl.prototype,"requireExplicitPolicy",void 0),u([f({type:k.Integer,context:1,implicit:!0,optional:!0,converter:me})],dl.prototype,"inhibitPolicyMapping",void 0);var Zo;class Xo{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Xo.prototype,"issuerDomainPolicy",void 0),u([f({type:k.ObjectIdentifier})],Xo.prototype,"subjectDomainPolicy",void 0);let fl=Zo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};fl=Zo=u([O({type:N.Sequence,itemType:Xo})],fl);var Qo;const pl=`${zt}.17`;let es=Qo=class extends De{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};es=Qo=u([O({type:N.Sequence})],es);let kt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],kt.prototype,"type",void 0),u([f({type:k.Any,repeated:"set"})],kt.prototype,"values",void 0);var ts;let hl=ts=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};hl=ts=u([O({type:N.Sequence,itemType:kt})],hl);const yl=`${zt}.14`;class _t extends jo{}class ml{constructor(t={}){Object.assign(this,t)}}u([f({type:k.GeneralizedTime,context:0,implicit:!0,optional:!0})],ml.prototype,"notBefore",void 0),u([f({type:k.GeneralizedTime,context:1,implicit:!0,optional:!0})],ml.prototype,"notAfter",void 0);var Zr;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(Zr||(Zr={}));class gl extends zi{toJSON(){const t=[],r=this.toNumber();return r&Zr.pKIXCertificate&&t.push("pKIXCertificate"),r&Zr.newExtensions&&t.push("newExtensions"),r&Zr.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class bl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new gl,Object.assign(this,t)}}u([f({type:k.GeneralString})],bl.prototype,"entrustVers",void 0),u([f({type:gl})],bl.prototype,"entrustInfoFlags",void 0);var rs;let wl=rs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,rs.prototype)}};wl=rs=u([O({type:N.Sequence,itemType:Gi})],wl);class U{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof U&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&za(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:k.ObjectIdentifier})],U.prototype,"algorithm",void 0),u([f({type:k.Any,optional:!0})],U.prototype,"parameters",void 0);class Ct{constructor(t={}){this.algorithm=new U,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:U})],Ct.prototype,"algorithm",void 0),u([f({type:k.BitString})],Ct.prototype,"subjectPublicKey",void 0);let Te=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:k.UTCTime})],Te.prototype,"utcTime",void 0),u([f({type:k.GeneralizedTime})],Te.prototype,"generalTime",void 0),Te=u([O({type:N.Choice})],Te);class nn{constructor(t){this.notBefore=new Te(new Date),this.notAfter=new Te(new Date),t&&(this.notBefore=new Te(t.notBefore),this.notAfter=new Te(t.notAfter))}}u([f({type:Te})],nn.prototype,"notBefore",void 0),u([f({type:Te})],nn.prototype,"notAfter",void 0);var is;let it=class Uf{constructor(t={}){this.extnID="",this.critical=Uf.CRITICAL,this.extnValue=new ie,Object.assign(this,t)}};it.CRITICAL=!1,u([f({type:k.ObjectIdentifier})],it.prototype,"extnID",void 0),u([f({type:k.Boolean,defaultValue:it.CRITICAL})],it.prototype,"critical",void 0),u([f({type:ie})],it.prototype,"extnValue",void 0);let Gt=is=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};Gt=is=u([O({type:N.Sequence,itemType:it})],Gt);var yr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(yr||(yr={}));class Ze{constructor(t={}){this.version=yr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new U,this.issuer=new ke,this.validity=new nn,this.subject=new ke,this.subjectPublicKeyInfo=new Ct,Object.assign(this,t)}}u([f({type:k.Integer,context:0,defaultValue:yr.v1})],Ze.prototype,"version",void 0),u([f({type:k.Integer,converter:me})],Ze.prototype,"serialNumber",void 0),u([f({type:U})],Ze.prototype,"signature",void 0),u([f({type:ke})],Ze.prototype,"issuer",void 0),u([f({type:nn})],Ze.prototype,"validity",void 0),u([f({type:ke})],Ze.prototype,"subject",void 0),u([f({type:Ct})],Ze.prototype,"subjectPublicKeyInfo",void 0),u([f({type:k.BitString,context:1,implicit:!0,optional:!0})],Ze.prototype,"issuerUniqueID",void 0),u([f({type:k.BitString,context:2,implicit:!0,optional:!0})],Ze.prototype,"subjectUniqueID",void 0),u([f({type:Gt,context:3,optional:!0})],Ze.prototype,"extensions",void 0);class mr{constructor(t={}){this.tbsCertificate=new Ze,this.signatureAlgorithm=new U,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Ze})],mr.prototype,"tbsCertificate",void 0),u([f({type:U})],mr.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],mr.prototype,"signatureValue",void 0);class on{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Te,Object.assign(this,t)}}u([f({type:k.Integer,converter:me})],on.prototype,"userCertificate",void 0),u([f({type:Te})],on.prototype,"revocationDate",void 0),u([f({type:it,optional:!0,repeated:"sequence"})],on.prototype,"crlEntryExtensions",void 0);class St{constructor(t={}){this.signature=new U,this.issuer=new ke,this.thisUpdate=new Te,Object.assign(this,t)}}u([f({type:k.Integer,optional:!0})],St.prototype,"version",void 0),u([f({type:U})],St.prototype,"signature",void 0),u([f({type:ke})],St.prototype,"issuer",void 0),u([f({type:Te})],St.prototype,"thisUpdate",void 0),u([f({type:Te,optional:!0})],St.prototype,"nextUpdate",void 0),u([f({type:on,repeated:"sequence",optional:!0})],St.prototype,"revokedCertificates",void 0),u([f({type:it,optional:!0,context:0,repeated:"sequence"})],St.prototype,"crlExtensions",void 0);let ns=class{constructor(t={}){this.tbsCertList=new St,this.signatureAlgorithm=new U,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:St})],ns.prototype,"tbsCertList",void 0),u([f({type:U})],ns.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],ns.prototype,"signature",void 0);let gr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],gr.prototype,"attrType",void 0),u([f({type:k.Any,repeated:"set"})],gr.prototype,"attrValues",void 0);class os{constructor(t={}){this.acIssuer=new Z,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:Z})],os.prototype,"acIssuer",void 0),u([f({type:k.Integer})],os.prototype,"acSerial",void 0),u([f({type:kt,repeated:"sequence"})],os.prototype,"attrs",void 0);var ss;let sn=ss=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};sn=ss=u([O({type:N.Sequence,itemType:k.ObjectIdentifier})],sn);class an{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:k.Integer,optional:!0})],an.prototype,"pathLenConstraint",void 0),u([f({type:sn,implicit:!0,context:0,optional:!0})],an.prototype,"permittedAttrs",void 0),u([f({type:sn,implicit:!0,context:1,optional:!0})],an.prototype,"excludedAttrs",void 0),u([f({type:k.Boolean,defaultValue:!0})],an.prototype,"permitUnSpecified",void 0);class Jt{constructor(t={}){this.issuer=new De,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:De})],Jt.prototype,"issuer",void 0),u([f({type:k.Integer,converter:me})],Jt.prototype,"serial",void 0),u([f({type:k.BitString,optional:!0})],Jt.prototype,"issuerUID",void 0);var as;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(as||(as={}));class Yt{constructor(t={}){this.digestedObjectType=as.publicKey,this.digestAlgorithm=new U,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Enumerated})],Yt.prototype,"digestedObjectType",void 0),u([f({type:k.ObjectIdentifier,optional:!0})],Yt.prototype,"otherObjectTypeID",void 0),u([f({type:U})],Yt.prototype,"digestAlgorithm",void 0),u([f({type:k.BitString})],Yt.prototype,"objectDigest",void 0);class cn{constructor(t={}){Object.assign(this,t)}}u([f({type:De,optional:!0})],cn.prototype,"issuerName",void 0),u([f({type:Jt,context:0,implicit:!0,optional:!0})],cn.prototype,"baseCertificateID",void 0),u([f({type:Yt,context:1,implicit:!0,optional:!0})],cn.prototype,"objectDigestInfo",void 0);let br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Z,repeated:"sequence"})],br.prototype,"v1Form",void 0),u([f({type:cn,context:0,implicit:!0})],br.prototype,"v2Form",void 0),br=u([O({type:N.Choice})],br);class ln{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:k.GeneralizedTime})],ln.prototype,"notBeforeTime",void 0),u([f({type:k.GeneralizedTime})],ln.prototype,"notAfterTime",void 0);class Xr{constructor(t={}){Object.assign(this,t)}}u([f({type:Jt,implicit:!0,context:0,optional:!0})],Xr.prototype,"baseCertificateID",void 0),u([f({type:De,implicit:!0,context:1,optional:!0})],Xr.prototype,"entityName",void 0),u([f({type:Yt,implicit:!0,context:2,optional:!0})],Xr.prototype,"objectDigestInfo",void 0);var cs;(function(e){e[e.v2=1]="v2"})(cs||(cs={}));class nt{constructor(t={}){this.version=cs.v2,this.holder=new Xr,this.issuer=new br,this.signature=new U,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new ln,this.attributes=[],Object.assign(this,t)}}u([f({type:k.Integer})],nt.prototype,"version",void 0),u([f({type:Xr})],nt.prototype,"holder",void 0),u([f({type:br})],nt.prototype,"issuer",void 0),u([f({type:U})],nt.prototype,"signature",void 0),u([f({type:k.Integer,converter:me})],nt.prototype,"serialNumber",void 0),u([f({type:ln})],nt.prototype,"attrCertValidityPeriod",void 0),u([f({type:kt,repeated:"sequence"})],nt.prototype,"attributes",void 0),u([f({type:k.BitString,optional:!0})],nt.prototype,"issuerUniqueID",void 0),u([f({type:Gt,optional:!0})],nt.prototype,"extensions",void 0);class un{constructor(t={}){this.acinfo=new nt,this.signatureAlgorithm=new U,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:nt})],un.prototype,"acinfo",void 0),u([f({type:U})],un.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],un.prototype,"signatureValue",void 0);var dn;(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"})(dn||(dn={}));class ls extends zi{}class us{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier,implicit:!0,context:0})],us.prototype,"type",void 0),u([f({type:k.Any,implicit:!0,context:1})],us.prototype,"value",void 0);class ds{constructor(t={}){this.policyId="",this.classList=new ls(dn.unclassified),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ds.prototype,"policyId",void 0),u([f({type:ls,defaultValue:new ls(dn.unclassified)})],ds.prototype,"classList",void 0),u([f({type:us,repeated:"set"})],ds.prototype,"securityCategories",void 0);class fn{constructor(t={}){Object.assign(this,t)}}u([f({type:ie})],fn.prototype,"cotets",void 0),u([f({type:k.ObjectIdentifier})],fn.prototype,"oid",void 0),u([f({type:k.Utf8String})],fn.prototype,"string",void 0);class vl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:De,implicit:!0,context:0,optional:!0})],vl.prototype,"policyAuthority",void 0),u([f({type:fn,repeated:"sequence"})],vl.prototype,"values",void 0);var fs;class pn{constructor(t={}){this.targetCertificate=new Jt,Object.assign(this,t)}}u([f({type:Jt})],pn.prototype,"targetCertificate",void 0),u([f({type:Z,optional:!0})],pn.prototype,"targetName",void 0),u([f({type:Yt,optional:!0})],pn.prototype,"certDigestInfo",void 0);let wr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Z,context:0,implicit:!0})],wr.prototype,"targetName",void 0),u([f({type:Z,context:1,implicit:!0})],wr.prototype,"targetGroup",void 0),u([f({type:pn,context:2,implicit:!0})],wr.prototype,"targetCert",void 0),wr=u([O({type:N.Choice})],wr);let ps=fs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};ps=fs=u([O({type:N.Sequence,itemType:wr})],ps);var hs;let kl=hs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};kl=hs=u([O({type:N.Sequence,itemType:ps})],kl);class Cl{constructor(t={}){Object.assign(this,t)}}u([f({type:De,implicit:!0,context:0,optional:!0})],Cl.prototype,"roleAuthority",void 0),u([f({type:Z,implicit:!0,context:1})],Cl.prototype,"roleName",void 0);class ys{constructor(t={}){this.service=new Z,this.ident=new Z,Object.assign(this,t)}}u([f({type:Z})],ys.prototype,"service",void 0),u([f({type:Z})],ys.prototype,"ident",void 0),u([f({type:ie,optional:!0})],ys.prototype,"authInfo",void 0);var ms;class gs{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],gs.prototype,"otherCertFormat",void 0),u([f({type:k.Any})],gs.prototype,"otherCert",void 0);let vr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:mr})],vr.prototype,"certificate",void 0),u([f({type:un,context:2,implicit:!0})],vr.prototype,"v2AttrCert",void 0),u([f({type:gs,context:3,implicit:!0})],vr.prototype,"other",void 0),vr=u([O({type:N.Choice})],vr);let hn=ms=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};hn=ms=u([O({type:N.Set,itemType:vr})],hn);class kr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],kr.prototype,"contentType",void 0),u([f({type:k.Any,context:0})],kr.prototype,"content",void 0);let Qr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie})],Qr.prototype,"single",void 0),u([f({type:k.Any})],Qr.prototype,"any",void 0),Qr=u([O({type:N.Choice})],Qr);class yn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],yn.prototype,"eContentType",void 0),u([f({type:Qr,context:0,optional:!0})],yn.prototype,"eContent",void 0);var xt;(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"})(xt||(xt={}));let ei=class extends U{};ei=u([O({type:N.Sequence})],ei);let mn=class extends U{};mn=u([O({type:N.Sequence})],mn);let lt=class extends U{};lt=u([O({type:N.Sequence})],lt);let gn=class extends U{};gn=u([O({type:N.Sequence})],gn);let Sl=class extends U{};Sl=u([O({type:N.Sequence})],Sl);let bs=class extends U{};bs=u([O({type:N.Sequence})],bs);let ti=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0,optional:!0})],ti.prototype,"value",void 0),u([f({type:ie,converter:yp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ti.prototype,"constructedValue",void 0),ti=u([O({type:N.Choice})],ti);class ri{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new gn,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ri.prototype,"contentType",void 0),u([f({type:gn})],ri.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ti,optional:!0})],ri.prototype,"encryptedContent",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:k.Integer,converter:me})],Cr.prototype,"serialNumber",void 0);class bn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],bn.prototype,"keyAttrId",void 0),u([f({type:k.Any,optional:!0})],bn.prototype,"keyAttr",void 0);var ws;class wn{constructor(t={}){this.subjectKeyIdentifier=new _t,Object.assign(this,t)}}u([f({type:_t})],wn.prototype,"subjectKeyIdentifier",void 0),u([f({type:k.GeneralizedTime,optional:!0})],wn.prototype,"date",void 0),u([f({type:bn,optional:!0})],wn.prototype,"other",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:wn,context:0,implicit:!0,optional:!0})],Sr.prototype,"rKeyId",void 0),u([f({type:Cr,optional:!0})],Sr.prototype,"issuerAndSerialNumber",void 0),Sr=u([O({type:N.Choice})],Sr);class vs{constructor(t={}){this.rid=new Sr,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:Sr})],vs.prototype,"rid",void 0),u([f({type:ie})],vs.prototype,"encryptedKey",void 0);let vn=ws=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};vn=ws=u([O({type:N.Sequence,itemType:vs})],vn);class ks{constructor(t={}){this.algorithm=new U,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:U})],ks.prototype,"algorithm",void 0),u([f({type:k.BitString})],ks.prototype,"publicKey",void 0);let Zt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:_t,context:0,implicit:!0,optional:!0})],Zt.prototype,"subjectKeyIdentifier",void 0),u([f({type:ks,context:1,implicit:!0,optional:!0})],Zt.prototype,"originatorKey",void 0),u([f({type:Cr,optional:!0})],Zt.prototype,"issuerAndSerialNumber",void 0),Zt=u([O({type:N.Choice})],Zt);class xr{constructor(t={}){this.version=xt.v3,this.originator=new Zt,this.keyEncryptionAlgorithm=new lt,this.recipientEncryptedKeys=new vn,Object.assign(this,t)}}u([f({type:k.Integer})],xr.prototype,"version",void 0),u([f({type:Zt,context:0})],xr.prototype,"originator",void 0),u([f({type:ie,context:1,optional:!0})],xr.prototype,"ukm",void 0),u([f({type:lt})],xr.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:vn})],xr.prototype,"recipientEncryptedKeys",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:_t,context:0,implicit:!0})],Ar.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],Ar.prototype,"issuerAndSerialNumber",void 0),Ar=u([O({type:N.Choice})],Ar);class ii{constructor(t={}){this.version=xt.v0,this.rid=new Ar,this.keyEncryptionAlgorithm=new lt,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],ii.prototype,"version",void 0),u([f({type:Ar})],ii.prototype,"rid",void 0),u([f({type:lt})],ii.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],ii.prototype,"encryptedKey",void 0);class ni{constructor(t={}){this.keyIdentifier=new ie,Object.assign(this,t)}}u([f({type:ie})],ni.prototype,"keyIdentifier",void 0),u([f({type:k.GeneralizedTime,optional:!0})],ni.prototype,"date",void 0),u([f({type:bn,optional:!0})],ni.prototype,"other",void 0);class oi{constructor(t={}){this.version=xt.v4,this.kekid=new ni,this.keyEncryptionAlgorithm=new lt,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],oi.prototype,"version",void 0),u([f({type:ni})],oi.prototype,"kekid",void 0),u([f({type:lt})],oi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],oi.prototype,"encryptedKey",void 0);class si{constructor(t={}){this.version=xt.v0,this.keyEncryptionAlgorithm=new lt,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],si.prototype,"version",void 0),u([f({type:bs,context:0,optional:!0})],si.prototype,"keyDerivationAlgorithm",void 0),u([f({type:lt})],si.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],si.prototype,"encryptedKey",void 0);class Cs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Cs.prototype,"oriType",void 0),u([f({type:k.Any})],Cs.prototype,"oriValue",void 0);let Ot=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ii,optional:!0})],Ot.prototype,"ktri",void 0),u([f({type:xr,context:1,implicit:!0,optional:!0})],Ot.prototype,"kari",void 0),u([f({type:oi,context:2,implicit:!0,optional:!0})],Ot.prototype,"kekri",void 0),u([f({type:si,context:3,implicit:!0,optional:!0})],Ot.prototype,"pwri",void 0),u([f({type:Cs,context:4,implicit:!0,optional:!0})],Ot.prototype,"ori",void 0),Ot=u([O({type:N.Choice})],Ot);var Ss;let kn=Ss=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};kn=Ss=u([O({type:N.Set,itemType:Ot})],kn);var xs;class Cn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Cn.prototype,"otherRevInfoFormat",void 0),u([f({type:k.Any})],Cn.prototype,"otherRevInfo",void 0);let ai=class{constructor(t={}){this.other=new Cn,Object.assign(this,t)}};u([f({type:Cn,context:1,implicit:!0})],ai.prototype,"other",void 0),ai=u([O({type:N.Choice})],ai);let As=xs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};As=xs=u([O({type:N.Set,itemType:ai})],As);class Bs{constructor(t={}){Object.assign(this,t)}}u([f({type:hn,context:0,implicit:!0,optional:!0})],Bs.prototype,"certs",void 0),u([f({type:As,context:1,implicit:!0,optional:!0})],Bs.prototype,"crls",void 0);var Is;let Es=Is=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};Es=Is=u([O({type:N.Set,itemType:gr})],Es);class ci{constructor(t={}){this.version=xt.v0,this.recipientInfos=new kn,this.encryptedContentInfo=new ri,Object.assign(this,t)}}u([f({type:k.Integer})],ci.prototype,"version",void 0),u([f({type:Bs,context:0,implicit:!0,optional:!0})],ci.prototype,"originatorInfo",void 0),u([f({type:kn})],ci.prototype,"recipientInfos",void 0),u([f({type:ri})],ci.prototype,"encryptedContentInfo",void 0),u([f({type:Es,context:1,implicit:!0,optional:!0})],ci.prototype,"unprotectedAttrs",void 0);const Up="1.2.840.113549.1.7.2";let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:_t,context:0,implicit:!0})],Br.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],Br.prototype,"issuerAndSerialNumber",void 0),Br=u([O({type:N.Choice})],Br);var Ns;class At{constructor(t={}){this.version=xt.v0,this.sid=new Br,this.digestAlgorithm=new ei,this.signatureAlgorithm=new mn,this.signature=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],At.prototype,"version",void 0),u([f({type:Br})],At.prototype,"sid",void 0),u([f({type:ei})],At.prototype,"digestAlgorithm",void 0),u([f({type:gr,repeated:"set",context:0,implicit:!0,optional:!0})],At.prototype,"signedAttrs",void 0),u([f({type:mn})],At.prototype,"signatureAlgorithm",void 0),u([f({type:ie})],At.prototype,"signature",void 0),u([f({type:gr,repeated:"set",context:1,implicit:!0,optional:!0})],At.prototype,"unsignedAttrs",void 0);let Sn=Ns=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};Sn=Ns=u([O({type:N.Set,itemType:At})],Sn);var _s;let xn=_s=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};xn=_s=u([O({type:N.Set,itemType:ei})],xn);class Ir{constructor(t={}){this.version=xt.v0,this.digestAlgorithms=new xn,this.encapContentInfo=new yn,this.signerInfos=new Sn,Object.assign(this,t)}}u([f({type:k.Integer})],Ir.prototype,"version",void 0),u([f({type:xn})],Ir.prototype,"digestAlgorithms",void 0),u([f({type:yn})],Ir.prototype,"encapContentInfo",void 0),u([f({type:hn,context:0,implicit:!0,optional:!0})],Ir.prototype,"certificates",void 0),u([f({type:ai,context:1,implicit:!0,optional:!0})],Ir.prototype,"crls",void 0),u([f({type:Sn})],Ir.prototype,"signerInfos",void 0);const li="1.2.840.10045.2.1",Os="1.2.840.10045.4.1",xl="1.2.840.10045.4.3.1",Ts="1.2.840.10045.4.3.2",Vs="1.2.840.10045.4.3.3",js="1.2.840.10045.4.3.4",Al="1.2.840.10045.3.1.7",Bl="1.3.132.0.34",Il="1.3.132.0.35";function ui(e){return new U({algorithm:e})}const Lp=ui(Os);ui(xl);const Hp=ui(Ts),Fp=ui(Vs),Kp=ui(js);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],Er.prototype,"namedCurve",void 0),Er=u([O({type:N.Choice})],Er);class An{constructor(t={}){this.version=1,this.privateKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],An.prototype,"version",void 0),u([f({type:ie})],An.prototype,"privateKey",void 0),u([f({type:Er,context:0,optional:!0})],An.prototype,"parameters",void 0),u([f({type:k.BitString,context:1,optional:!0})],An.prototype,"publicKey",void 0);class Bn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:me})],Bn.prototype,"r",void 0),u([f({type:k.Integer,converter:me})],Bn.prototype,"s",void 0);const Me="1.2.840.113549.1.1",Nr=`${Me}.1`,qp=`${Me}.7`,zp=`${Me}.9`,Wp=`${Me}.10`,Gp=`${Me}.2`,Jp=`${Me}.4`,In=`${Me}.5`,Yp=`${Me}.14`,Ds=`${Me}.11`,En=`${Me}.12`,Nn=`${Me}.13`,El=`${Me}.15`,Nl=`${Me}.16`,_l="1.3.14.3.2.26",Ol="2.16.840.1.101.3.4.2.4",Tl="2.16.840.1.101.3.4.2.1",Vl="2.16.840.1.101.3.4.2.2",jl="2.16.840.1.101.3.4.2.3",Zp="2.16.840.1.101.3.4.2.5",Xp="2.16.840.1.101.3.4.2.6",Qp="1.2.840.113549.2.2",eh="1.2.840.113549.2.5",Ps=`${Me}.8`;function Ce(e){return new U({algorithm:e,parameters:null})}Ce(Qp),Ce(eh);const Xt=Ce(_l);Ce(Ol),Ce(Tl),Ce(Vl),Ce(jl),Ce(Zp),Ce(Xp);const Dl=new U({algorithm:Ps,parameters:L.serialize(Xt)}),Pl=new U({algorithm:zp,parameters:L.serialize(Wi.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(Nr),Ce(Gp),Ce(Jp),Ce(In),Ce(El),Ce(Nl),Ce(En),Ce(Nn),Ce(El),Ce(Nl);class _n{constructor(t={}){this.hashAlgorithm=new U(Xt),this.maskGenAlgorithm=new U({algorithm:Ps,parameters:L.serialize(Xt)}),this.pSourceAlgorithm=new U(Pl),Object.assign(this,t)}}u([f({type:U,context:0,defaultValue:Xt})],_n.prototype,"hashAlgorithm",void 0),u([f({type:U,context:1,defaultValue:Dl})],_n.prototype,"maskGenAlgorithm",void 0),u([f({type:U,context:2,defaultValue:Pl})],_n.prototype,"pSourceAlgorithm",void 0),new U({algorithm:qp,parameters:L.serialize(new _n)});class di{constructor(t={}){this.hashAlgorithm=new U(Xt),this.maskGenAlgorithm=new U({algorithm:Ps,parameters:L.serialize(Xt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:U,context:0,defaultValue:Xt})],di.prototype,"hashAlgorithm",void 0),u([f({type:U,context:1,defaultValue:Dl})],di.prototype,"maskGenAlgorithm",void 0),u([f({type:k.Integer,context:2,defaultValue:20})],di.prototype,"saltLength",void 0),u([f({type:k.Integer,context:3,defaultValue:1})],di.prototype,"trailerField",void 0),new U({algorithm:Wp,parameters:L.serialize(new di)});class On{constructor(t={}){this.digestAlgorithm=new U,this.digest=new ie,Object.assign(this,t)}}u([f({type:U})],On.prototype,"digestAlgorithm",void 0),u([f({type:ie})],On.prototype,"digest",void 0);var $s;class Tn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:me})],Tn.prototype,"prime",void 0),u([f({type:k.Integer,converter:me})],Tn.prototype,"exponent",void 0),u([f({type:k.Integer,converter:me})],Tn.prototype,"coefficient",void 0);let Rs=$s=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};Rs=$s=u([O({type:N.Sequence,itemType:Tn})],Rs);class ut{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:k.Integer})],ut.prototype,"version",void 0),u([f({type:k.Integer,converter:me})],ut.prototype,"modulus",void 0),u([f({type:k.Integer,converter:me})],ut.prototype,"publicExponent",void 0),u([f({type:k.Integer,converter:me})],ut.prototype,"privateExponent",void 0),u([f({type:k.Integer,converter:me})],ut.prototype,"prime1",void 0),u([f({type:k.Integer,converter:me})],ut.prototype,"prime2",void 0),u([f({type:k.Integer,converter:me})],ut.prototype,"exponent1",void 0),u([f({type:k.Integer,converter:me})],ut.prototype,"exponent2",void 0),u([f({type:k.Integer,converter:me})],ut.prototype,"coefficient",void 0),u([f({type:Rs,optional:!0})],ut.prototype,"otherPrimeInfos",void 0);class Ms{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:me})],Ms.prototype,"modulus",void 0),u([f({type:k.Integer,converter:me})],Ms.prototype,"publicExponent",void 0);var Us;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Us||(Us={}));const Ue=Us;/*! *****************************************************************************
|
|
75
|
+
`)}`:`${r} :`}}ic=Me,P.Constructed=ic,Me.NAME="CONSTRUCTED";class nc extends je{fromBER(t,r,i){return r}toBER(t){return et}}nc.override="EndOfContentValueBlock";var oc;class ho extends Be{constructor(t={}){super(t,nc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}oc=ho,P.EndOfContent=oc,ho.NAME=Fr;var sc;class Lt extends Be{constructor(t={}){super(t,je),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}sc=Lt,P.Null=sc,Lt.NAME="NULL";class ac extends at(je){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=V.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,i){const o=V.toUint8Array(t);return yt(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Ga.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}ac.NAME="BooleanValueBlock";var cc;let Oi=class extends Be{constructor(t={}){super(t,ac),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}`}};cc=Oi,P.Boolean=cc,Oi.NAME="BOOLEAN";class lc extends at(Nt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=Nt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Fr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Ya)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,i),this.blockLength=i;return o}toBER(t,r){return this.isConstructed?Nt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}lc.NAME="OctetStringValueBlock";var uc;let Ht=class Hf extends Be{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},lc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=lr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Me.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${R.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 Hf&&t.push(r.valueBlock.valueHexView);return V.concat(t)}};uc=Ht,P.OctetString=uc,Ht.NAME=Ya;class dc extends at(Nt){constructor({unusedBits:t=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,i){if(!i)return r;let o=-1;if(this.isConstructed){if(o=Nt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const c of this.value){const l=c.constructor.NAME;if(l===Fr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==Za)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.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=V.toUint8Array(t);if(!yt(this,s,r,i))return-1;const a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const c=a.subarray(1);try{if(c.byteLength){const l=lr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return Nt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return et;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}dc.NAME="BitStringValueBlock";var fc;let Ft=class extends Be{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},dc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Me.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};fc=Ft,P.BitString=fc,Ft.NAME=Za;var pc;function cp(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),o=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=o.slice(0),l=c.length-1;let d=0;const p=l<a?a:l;let y=0;for(let x=p;x>=0;x--,y++){switch(!0){case y<c.length:d=s[a-y]+c[l-y]+r[0];break;default:d=s[a-y]+r[0]}switch(r[0]=d/10,!0){case y>=s.length:s=lo(new Uint8Array([d%10]),s);break;default:s[a-y]=d%10}}return r[0]>0&&(s=lo(r,s)),s}function hc(e){if(e>=Hr.length)for(let t=Hr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Hr[t-1].slice(0);for(let o=i.length-1;o>=0;o--){const s=new Uint8Array([(i[o]<<1)+r[0]]);r[0]=s[0]/10,i[o]=s[0]%10}r[0]>0&&(i=lo(r,i)),Hr.push(i)}return Hr[e]}function lp(e,t){let r=0;const i=new Uint8Array(e),o=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=o.slice(0),l=c.length-1;let d,p=0;for(let y=l;y>=0;y--,p++)switch(d=s[a-p]-c[l-p]-r,!0){case d<0:r=1,s[a-p]=d+10;break;default:r=0,s[a-p]=d}if(r>0)for(let y=a-l+1;y>=0;y--,p++)if(d=s[a-p]-r,d<0)r=1,s[a-p]=d+10;else{r=0,s[a-p]=d;break}return s.slice()}class yo extends at(je){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=Ga.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Yf(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,o=0){const s=this.fromBER(t,r,i);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 i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,i){const o=super.fromBER(t,r,i);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),i=0,o;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){o=s[l];for(let d=0;d<8;d++){if((o&1)===1)switch(i){case t:r=lp(hc(i),r),a="-";break;default:r=cp(r,hc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=Wa.charAt(r[l]));return c===!1&&(a+=Wa.charAt(0)),a}}pc=yo,yo.NAME="IntegerValueBlock",Object.defineProperty(pc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var yc;class ct extends Be{constructor(t={}){super(t,yo),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ei(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Ei();const r=BigInt(t),i=new Ni,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(R.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${R.ToHex(c)}`)+r,p=V.toUint8Array(R.FromHex(d.toString(16)));p[0]|=128,i.write(p)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new ct({valueHex:i.final()})}convertToDER(){const t=new ct({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ct({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}yc=ct,P.Integer=yc,ct.NAME="INTEGER";var gc;class Ti extends ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}gc=Ti,P.Enumerated=gc,Ti.NAME="ENUMERATED";class go extends at(je){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];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=cr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Ei();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let o=0;o<i.length;o++)i[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<i.length?128:0);this.fromBER(i.buffer,0,i.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=Rt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",et;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i}toString(){let t="";if(this.isHexOnly)t=R.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}}}go.NAME="sidBlock";class mc extends je{constructor({value:t=$e,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new go;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(t);if(o.byteLength===0)return this.error=this.value[i].error,et;r.push(o)}return uo(r)}fromString(t){this.value=[];let r=0,i=0,o="",s=!1;do if(i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(o,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new go;if(o>Number.MAX_SAFE_INTEGER){Ei();const c=BigInt(o);a.valueBigInt=c}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[i].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}}mc.NAME="ObjectIdentifierValueBlock";var bc;class Vi extends Be{constructor(t={}){super(t,mc),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()}}}bc=Vi,P.ObjectIdentifier=bc,Vi.NAME="OBJECT IDENTIFIER";class mo extends at(Ut){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=V.toUint8Array(t);if(!yt(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];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=cr(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=Rt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",et;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i.buffer}toString(){let t="";return this.isHexOnly?t=R.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}mo.NAME="relativeSidBlock";class wc extends je{constructor({value:t=$e,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new mo;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const i=[];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,et;i.push(s)}return uo(i)}fromString(t){this.value=[];let r=0,i=0,o="";do{i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1;const s=new mo;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==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}}wc.NAME="RelativeObjectIdentifierValueBlock";var vc;class bo extends Be{constructor(t={}){super(t,wc),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()}}}vc=bo,P.RelativeObjectIdentifier=vc,bo.NAME="RelativeObjectIdentifier";var kc;class gt extends Me{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}kc=gt,P.Sequence=kc,gt.NAME="SEQUENCE";var Cc;let mt=class extends Me{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Cc=mt,P.Set=Cc,mt.NAME="SET";class Sc extends at(je){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=$e}toJSON(){return{...super.toJSON(),value:this.value}}}Sc.NAME="StringValueBlock";class xc extends Sc{}xc.NAME="SimpleStringValueBlock";class qe extends po{constructor({...t}={}){super(t,xc)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,V.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);this.valueBlock.value=t}}qe.NAME="SIMPLE STRING";class Ac extends qe{fromBuffer(t){this.valueBlock.valueHexView=V.toUint8Array(t);try{this.valueBlock.value=R.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=R.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(R.FromUtf8String(t)),this.valueBlock.value=t}}Ac.NAME="Utf8StringValueBlock";var Bc;class bt extends Ac{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Bc=bt,P.Utf8String=Bc,bt.NAME="UTF8String";class Ic extends qe{fromBuffer(t){this.valueBlock.value=R.ToUtf16String(t),this.valueBlock.valueHexView=V.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(R.FromUtf16String(t))}}Ic.NAME="BmpStringValueBlock";var Ec;class ji extends Ic{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Ec=ji,P.BmpString=Ec,ji.NAME="BMPString";class Nc extends qe{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);for(let o=0;o<i.length;o+=4)i[o]=i[o+3],i[o+1]=i[o+2],i[o+2]=0,i[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=Rt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[o*4+l+c]=a[l]}this.valueBlock.value=t}}Nc.NAME="UniversalStringValueBlock";var _c;class Di extends Nc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}_c=Di,P.UniversalString=_c,Di.NAME="UniversalString";var Oc;class Pi extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Oc=Pi,P.NumericString=Oc,Pi.NAME="NumericString";var Tc;class $i extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Tc=$i,P.PrintableString=Tc,$i.NAME="PrintableString";var Vc;class Mi extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Vc=Mi,P.TeletexString=Vc,Mi.NAME="TeletexString";var jc;class Ri extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}jc=Ri,P.VideotexString=jc,Ri.NAME="VideotexString";var Dc;class Ui extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Dc=Ui,P.IA5String=Dc,Ui.NAME="IA5String";var Pc;class Li extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Pc=Li,P.GraphicString=Pc,Li.NAME="GraphicString";var $c;class qr extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}$c=qr,P.VisibleString=$c,qr.NAME="VisibleString";var Mc;class Hi extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Mc=Hi,P.GeneralString=Mc,Hi.NAME="GeneralString";var Rc;class Fi extends qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Rc=Fi,P.CharacterString=Rc,Fi.NAME="CharacterString";var Uc;class zr extends qr{constructor({value:t,valueDate:r,...i}={}){if(super(i),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,V.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o<t.length;o++)i[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 i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const o=parseInt(i[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=Ke(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Ke(this.month,2),r[2]=Ke(this.day,2),r[3]=Ke(this.hour,2),r[4]=Ke(this.minute,2),r[5]=Ke(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}}}Uc=zr,P.UTCTime=Uc,zr.NAME="UTCTime";var Lc;class Ki extends zr{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,i="",o="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const y=new Number(t[t.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let y=1,x=i.indexOf("+"),C="";if(x===-1&&(x=i.indexOf("-"),y=-1),x!==-1){if(C=i.substring(x+1),i=i.substring(0,x),C.length!==2&&C.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(C.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=y*h,C.length===4){if(h=parseInt(C.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=y*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const y=new Number(`0${i.substring(d)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),o=i.substring(0,d)}else o=i;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 y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}const p=a.exec(o);if(p===null)throw new Error("Wrong input string for conversion");for(let y=1;y<p.length;y++)switch(y){case 1:this.year=parseInt(p[y],10);break;case 2:this.month=parseInt(p[y],10);break;case 3:this.day=parseInt(p[y],10);break;case 4:this.hour=parseInt(p[y],10)+c;break;case 5:this.minute=parseInt(p[y],10)+l;break;case 6:this.second=parseInt(p[y],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Ke(this.year,4)),r.push(Ke(this.month,2)),r.push(Ke(this.day,2)),r.push(Ke(this.hour,2)),r.push(Ke(this.minute,2)),r.push(Ke(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Ke(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Lc=Ki,P.GeneralizedTime=Lc,Ki.NAME="GeneralizedTime";var Hc;class wo extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Hc=wo,P.DATE=Hc,wo.NAME="DATE";var Fc;class vo extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Fc=vo,P.TimeOfDay=Fc,vo.NAME="TimeOfDay";var Kc;class ko extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Kc=ko,P.DateTime=Kc,ko.NAME="DateTime";var qc;class Co extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}qc=Co,P.Duration=qc,Co.NAME="Duration";var zc;class So extends bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}zc=So,P.TIME=zc,So.NAME="TIME";class Kt{constructor({name:t=$e,optional:r=!1}={}){this.name=t,this.optional=r}}class xo extends Kt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class qi extends Kt{constructor({value:t=new Kt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class up{constructor({data:t=_i}={}){this.dataView=V.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=V.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=V.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function qt(e,t,r){if(r instanceof xo){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(fo)&&(s.name=r.name),s}}if(r instanceof Kt)return r.hasOwnProperty(fo)&&(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(!(Qf in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ip in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(np in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(ep)===!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(tp)===!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(rp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Xf 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(!(Ja 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 c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,$e),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof qi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,$e),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].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,$e),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof qi){if(a=qt(e,t.valueBlock.value[l],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,$e),r.name&&delete e[r.name]),a;if(fo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};op 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[l])}}else if(a=qt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,$e),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,$e),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&Ja in t.valueBlock){const s=lr(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,$e),r.name&&(delete e[r.name],a.name=r.name)),a}return qt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function dp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=lr(V.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:qt(r.result,r.result,t)}const Gc=Object.freeze(Object.defineProperty({__proto__:null,Any:Kt,BaseBlock:Be,BaseStringBlock:po,BitString:Ft,BmpString:ji,Boolean:Oi,CharacterString:Fi,Choice:xo,Constructed:Me,DATE:wo,DateTime:ko,Duration:Co,EndOfContent:ho,Enumerated:Ti,GeneralString:Hi,GeneralizedTime:Ki,GraphicString:Li,HexBlock:at,IA5String:Ui,Integer:ct,Null:Lt,NumericString:Pi,ObjectIdentifier:Vi,OctetString:Ht,Primitive:Kr,PrintableString:$i,RawData:up,RelativeObjectIdentifier:bo,Repeated:qi,Sequence:gt,Set:mt,TIME:So,TeletexString:Mi,TimeOfDay:vo,UTCTime:zr,UniversalString:Di,Utf8String:bt,ValueBlock:je,VideotexString:Ri,ViewWriter:Ni,VisibleString:qr,compareSchema:qt,fromBER:ur,verifySchema:dp},Symbol.toStringTag,{value:"Module"}));var N;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(N||(N={}));var k;(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"})(k||(k={}));class zi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(V.isBufferSource(t))this.unusedBits=r,this.value=V.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Ft))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 Ft({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Ft({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.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 i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class ie{constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):V.isBufferSource(t)?this.buffer=V.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}fromASN(t){if(!(t instanceof Ht))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Ht({valueHex:this.buffer})}toSchema(t){return new Ht({name:t})}}const fp={fromASN:e=>e instanceof Lt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Lt;const t=ur(e);if(t.result.error)throw new Error(t.result.error);return t.result}},pp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ct({value:+e})},hp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ti({value:e})},ge={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ct({valueHex:e})},yp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Ft({valueHex:e})},gp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Vi({value:e})},mp={fromASN:e=>e.valueBlock.value,toASN:e=>new Oi({value:e})},Gi={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Ht({valueHex:e})},bp={fromASN:e=>new ie(e.getValue()),toASN:e=>e.toASN()};function Je(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const Wc=Je(bt),wp=Je(ji),vp=Je(Di),kp=Je(Pi),Cp=Je($i),Sp=Je(Mi),xp=Je(Ri),Ap=Je(Ui),Bp=Je(Li),Ip=Je(qr),Ep=Je(Hi),Np=Je(Fi),_p={fromASN:e=>e.toDate(),toASN:e=>new zr({valueDate:e})},Op={fromASN:e=>e.toDate(),toASN:e=>new Ki({valueDate:e})},Tp={fromASN:()=>null,toASN:()=>new Lt};function Ao(e){switch(e){case k.Any:return fp;case k.BitString:return yp;case k.BmpString:return wp;case k.Boolean:return mp;case k.CharacterString:return Np;case k.Enumerated:return hp;case k.GeneralString:return Ep;case k.GeneralizedTime:return Op;case k.GraphicString:return Bp;case k.IA5String:return Ap;case k.Integer:return pp;case k.Null:return Tp;case k.NumericString:return kp;case k.ObjectIdentifier:return gp;case k.OctetString:return Gi;case k.PrintableString:return Cp;case k.TeletexString:return Sp;case k.UTCTime:return _p;case k.UniversalString:return vp;case k.Utf8String:return Wc;case k.VideotexString:return xp;case k.VisibleString:return Ip;default:return null}}function wt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:wt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function Jc(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:Jc(r)}return!1}function Vp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}class jp{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const i=this.items.get(t);if(!i)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:N.Sequence,items:{}},i=this.findParentSchema(t);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(t,r){const i=this.items.get(t)||this.createDefault(t),o=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const p=k[a.type],y=Gc[p];if(!y)throw new Error(`Cannot get ASN1 class by name '${p}'`);l=new y({name:c})}else wt(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===N.Choice?l=new Kt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Kt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const p=a.repeated==="set"?mt:gt;l=new p({name:"",value:[new qi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||wt(a.type)){const p=a.repeated?Me:Kr;o.push(new p({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const p=!!a.repeated;let y=p?l:this.get(a.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,o.push(new Me({name:p?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:y}))}else o.push(new Me({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,o.push(l)}switch(i.type){case N.Sequence:return new gt({value:o,name:""});case N.Set:return new mt({value:o,name:""});case N.Choice:return new xo({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 Ye=new jp,O=e=>t=>{let r;Ye.has(t)?r=Ye.get(t):(r=Ye.createDefault(t),Ye.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;Ye.has(t.constructor)?i=Ye.get(t.constructor):(i=Ye.createDefault(t.constructor),Ye.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Ao(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}i.items[r]=o};class Yc extends Error{constructor(){super(...arguments),this.schemas=[]}}class Dp{static parse(t,r){const i=ur(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(wt(r))return new r().fromASN(t);const o=Ye.get(r);Ye.cache(r);let s=o.schema;if(t.constructor===Me&&o.type!==N.Choice){s=new Me({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=qt({},t,s);if(!a.verified)throw new Yc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(Jc(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 l=o.itemType;if(typeof l=="number"){const d=Ao(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,p=>d.fromASN(p))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const p=o.items[l],y=p.type;if(typeof y=="number"||wt(y)){const x=(i=p.converter)!==null&&i!==void 0?i:wt(y)?new y:null;if(!x)throw new Error("Converter is empty");if(p.repeated)if(p.implicit){const C=p.repeated==="sequence"?gt:mt,h=new C;h.valueBlock=d.valueBlock;const g=ur(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;c[l]=Array.from(b,v=>x.fromASN(v))}else c[l]=Array.from(d,C=>x.fromASN(C));else{let C=d;if(p.implicit){let h;if(wt(y))h=new y().toSchema("");else{const g=k[y],b=Gc[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=C.valueBlock,C=ur(h.toBER(!1)).result}c[l]=x.fromASN(C)}}else if(p.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.");c[l]=Array.from(d,x=>this.fromASN(x,y))}else c[l]=this.fromASN(d,y)}return c}catch(o){throw o instanceof Yc&&o.schemas.push(r.name),o}}}class Bo{static serialize(t){return t instanceof Be?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&wt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=Ye.get(r);Ye.cache(r);let o=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=Ao(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(c=>a.toASN(c))}else o=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&Vp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Bo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||wt(c.type))){const p={};p.valueHex=d instanceof Lt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Kr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...p}))}else o.push(new Me({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new Me({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case N.Sequence:s=new gt({value:o});break;case N.Set:s=new mt({value:o});break;case N.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,i,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 ${k[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,d=>a.toASN(d)),l=t.repeated==="sequence"?gt:mt;s=new l({value:c})}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,l=>this.toASN(l)),c=t.repeated==="sequence"?gt:mt;s=new c({value:a})}else s=this.toASN(o);return s}}class ae extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class L{static serialize(t){return Bo.serialize(t)}static parse(t,r){return Dp.parse(t,r)}static toString(t){const r=V.isBufferSource(t)?V.toArrayBuffer(t):L.serialize(t),i=ur(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(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 Zc={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={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,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,w=(h.match(l.zoneIndex)||[])[0],m,A;for(w&&(w=w.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(A=g-b,m=":";A--;)m+="0:";return h=h.replace("::",m),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const J=h.split(":"),X=[];for(let I=0;I<J.length;I++)X.push(parseInt(J[I],16));return X}(),{parts:g,zoneId:w}}function p(h,g,b,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let w=0,m;for(;v>0;){if(m=b-v,m<0&&(m=0),h[w]>>m!==g[w]>>m)return!1;v-=b,w+=1}return!0}function y(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 x(h,g){for(;h.length<g;)h=`0${h}`;return h}const C={};C.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 p(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 w,m,A;for(w=3;w>=0;w-=1)if(m=this.octets[w],m in v){if(A=v[m],b&&A!==0)return null;A!==8&&(b=!0),g+=A}else return null;return 32-g},h.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return C.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),C.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),w=[];let m=0;for(;m<4;)w.push(parseInt(b[m],10)|parseInt(v[m],10)^255),m++;return new this(w)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.isIPv4=function(h){return this.parser(h)!==null},C.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},C.IPv4.isValidFourPartDecimal=function(h){return!!(C.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},C.IPv4.networkAddressFromCIDR=function(h){let g,b,v,w,m;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),w=[],b=0;b<4;)w.push(parseInt(v[b],10)&parseInt(m[b],10)),b++;return new this(w)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.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)},C.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")},C.IPv4.parser=function(h){let g,b,v;if(g=h.match(i.fourOctet))return function(){const w=g.slice(1,6),m=[];for(let A=0;A<w.length;A++)b=w[A],m.push(y(b));return m}();if(g=h.match(i.longValue)){if(v=y(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const w=[];let m;for(m=0;m<=24;m+=8)w.push(v>>m&255);return w}().reverse()}else return(g=h.match(i.twoOctet))?function(){const w=g.slice(1,4),m=[];if(v=y(w[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return m.push(y(w[0])),m.push(v>>16&255),m.push(v>>8&255),m.push(v&255),m}():(g=h.match(i.threeOctet))?function(){const w=g.slice(1,5),m=[];if(v=y(w[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return m.push(y(w[0])),m.push(y(w[1])),m.push(v>>8&255),m.push(v&255),m}():null},C.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)},C.IPv6=function(){function h(g,b){let v,w;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(w=this.parts[v],!(0<=w&&w<=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 p(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 w,m;for(let A=7;A>=0;A-=1)if(w=this.parts[A],w in v){if(m=v[w],b&&m!==0)return null;m!==16&&(b=!0),g+=m}else return null;return 128-g},h.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let w=0;w<v.length;w++)g=v[w],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let w=0;w<this.parts.length;w++)v.push(x(this.parts[w].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 C.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let w=0;w<this.parts.length;w++)v.push(this.parts[w].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,w=-1,m;for(;m=g.exec(b);)m[0].length>w&&(v=m.index,w=m[0].length);return w<0?b:`${b.substring(0,v)}::${b.substring(v+w)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),C.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),w=[];let m=0;for(;m<16;)w.push(parseInt(b[m],10)|parseInt(v[m],10)^255),m++;return new this(w)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},C.IPv6.isIPv6=function(h){return this.parser(h)!==null},C.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}},C.IPv6.networkAddressFromCIDR=function(h){let g,b,v,w,m;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),w=[],b=0;b<16;)w.push(parseInt(v[b],10)&parseInt(m[b],10)),b++;return new this(w)}catch(A){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${A})`)}},C.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)},C.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")},C.IPv6.parser=function(h){let g,b,v,w,m,A;if(v=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(l.native.test(h))return d(h,8);if((v=h.match(l.transitional))&&(A=v[6]||"",g=d(v[1].slice(0,-1)+A,6),g.parts)){for(m=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<m.length;b++)if(w=m[b],!(0<=w&&w<=255))return null;return g.parts.push(m[0]<<8|m[1]),g.parts.push(m[2]<<8|m[3]),{parts:g.parts,zoneId:g.zoneId}}return null},C.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)},C.fromByteArray=function(h){const g=h.length;if(g===4)return new C.IPv4(h);if(g===16)return new C.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},C.isValid=function(h){return C.IPv6.isValid(h)||C.IPv4.isValid(h)},C.parse=function(h){if(C.IPv6.isValid(h))return C.IPv6.parse(h);if(C.IPv4.isValid(h))return C.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},C.parseCIDR=function(h){try{return C.IPv6.parseCIDR(h)}catch{try{return C.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},C.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},C.subnetMatch=function(h,g,b){let v,w,m,A;b==null&&(b="unicast");for(w in g)if(Object.prototype.hasOwnProperty.call(g,w)){for(m=g[w],m[0]&&!(m[0]instanceof Array)&&(m=[m]),v=0;v<m.length;v++)if(A=m[v],h.kind()===A[0].kind()&&h.match.apply(h,A))return w}return b},e.exports?e.exports=C:t.ipaddr=C})(ao)})(Zc);var Xc=Zc.exports;class Qc{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 i=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return Xc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(R.ToHex(t))}static fromString(t){const r=Xc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Io,Eo,No;let Ie=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:k.TeletexString})],Ie.prototype,"teletexString",void 0),u([f({type:k.PrintableString})],Ie.prototype,"printableString",void 0),u([f({type:k.UniversalString})],Ie.prototype,"universalString",void 0),u([f({type:k.Utf8String})],Ie.prototype,"utf8String",void 0),u([f({type:k.BmpString})],Ie.prototype,"bmpString",void 0),Ie=u([O({type:N.Choice})],Ie);let dr=class extends Ie{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?R.ToHex(this.anyValue):super.toString())}};u([f({type:k.IA5String})],dr.prototype,"ia5String",void 0),u([f({type:k.Any})],dr.prototype,"anyValue",void 0),dr=u([O({type:N.Choice})],dr);class Gr{constructor(t={}){this.type="",this.value=new dr,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Gr.prototype,"type",void 0),u([f({type:dr})],Gr.prototype,"value",void 0);let fr=Io=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Io.prototype)}};fr=Io=u([O({type:N.Set,itemType:Gr})],fr);let _o=Eo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Eo.prototype)}};_o=Eo=u([O({type:N.Sequence,itemType:fr})],_o);let ke=No=class extends _o{constructor(t){super(t),Object.setPrototypeOf(this,No.prototype)}};ke=No=u([O({type:N.Sequence})],ke);const Pp={fromASN:e=>Qc.toString(Gi.fromASN(e)),toASN:e=>Gi.toASN(Qc.fromString(e))};class Wr{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Wr.prototype,"typeId",void 0),u([f({type:k.Any,context:0})],Wr.prototype,"value",void 0);class Oo{constructor(t={}){this.partyName=new Ie,Object.assign(this,t)}}u([f({type:Ie,optional:!0,context:0,implicit:!0})],Oo.prototype,"nameAssigner",void 0),u([f({type:Ie,context:1,implicit:!0})],Oo.prototype,"partyName",void 0);let Z=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Wr,context:0,implicit:!0})],Z.prototype,"otherName",void 0),u([f({type:k.IA5String,context:1,implicit:!0})],Z.prototype,"rfc822Name",void 0),u([f({type:k.IA5String,context:2,implicit:!0})],Z.prototype,"dNSName",void 0),u([f({type:k.Any,context:3,implicit:!0})],Z.prototype,"x400Address",void 0),u([f({type:ke,context:4,implicit:!1})],Z.prototype,"directoryName",void 0),u([f({type:Oo,context:5})],Z.prototype,"ediPartyName",void 0),u([f({type:k.IA5String,context:6,implicit:!0})],Z.prototype,"uniformResourceIdentifier",void 0),u([f({type:k.OctetString,context:7,implicit:!0,converter:Pp})],Z.prototype,"iPAddress",void 0),u([f({type:k.ObjectIdentifier,context:8,implicit:!0})],Z.prototype,"registeredID",void 0),Z=u([O({type:N.Choice})],Z);const pr="1.3.6.1.5.5.7.3",zt="2.5.29";var To;class Wi{constructor(t={}){this.accessMethod="",this.accessLocation=new Z,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Wi.prototype,"accessMethod",void 0),u([f({type:Z})],Wi.prototype,"accessLocation",void 0);let el=To=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,To.prototype)}};el=To=u([O({type:N.Sequence,itemType:Wi})],el);const Vo=`${zt}.35`;class jo extends ie{}class Gt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:jo,context:0,optional:!0,implicit:!0})],Gt.prototype,"keyIdentifier",void 0),u([f({type:Z,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Gt.prototype,"authorityCertIssuer",void 0),u([f({type:k.Integer,context:2,optional:!0,implicit:!0,converter:ge})],Gt.prototype,"authorityCertSerialNumber",void 0);const tl=`${zt}.19`;class Ji{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:k.Boolean,defaultValue:!1})],Ji.prototype,"cA",void 0),u([f({type:k.Integer,optional:!0})],Ji.prototype,"pathLenConstraint",void 0);var Do;let De=Do=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};De=Do=u([O({type:N.Sequence,itemType:Z})],De);var Po;let rl=Po=class extends De{constructor(t){super(t),Object.setPrototypeOf(this,Po.prototype)}};rl=Po=u([O({type:N.Sequence})],rl);var $o;const il=`${zt}.32`;let vt=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:k.IA5String})],vt.prototype,"ia5String",void 0),u([f({type:k.VisibleString})],vt.prototype,"visibleString",void 0),u([f({type:k.BmpString})],vt.prototype,"bmpString",void 0),u([f({type:k.Utf8String})],vt.prototype,"utf8String",void 0),vt=u([O({type:N.Choice})],vt);class Mo{constructor(t={}){this.organization=new vt,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:vt})],Mo.prototype,"organization",void 0),u([f({type:k.Integer,repeated:"sequence"})],Mo.prototype,"noticeNumbers",void 0);class Ro{constructor(t={}){Object.assign(this,t)}}u([f({type:Mo,optional:!0})],Ro.prototype,"noticeRef",void 0),u([f({type:vt,optional:!0})],Ro.prototype,"explicitText",void 0);let Yi=class{constructor(t={}){Object.assign(this,t)}};u([f({type:k.IA5String})],Yi.prototype,"cPSuri",void 0),u([f({type:Ro})],Yi.prototype,"userNotice",void 0),Yi=u([O({type:N.Choice})],Yi);class Uo{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Uo.prototype,"policyQualifierId",void 0),u([f({type:k.Any})],Uo.prototype,"qualifier",void 0);class Zi{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Zi.prototype,"policyIdentifier",void 0),u([f({type:Uo,repeated:"sequence",optional:!0})],Zi.prototype,"policyQualifiers",void 0);let Xi=$o=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};Xi=$o=u([O({type:N.Sequence,itemType:Zi})],Xi);let Qi=class{constructor(t=0){this.value=t}};u([f({type:k.Integer})],Qi.prototype,"value",void 0),Qi=u([O({type:N.Choice})],Qi);let nl=class extends Qi{};nl=u([O({type:N.Choice})],nl);var Lo,tt;(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"})(tt||(tt={}));class ol extends zi{toJSON(){const t=[],r=this.toNumber();return r&tt.aACompromise&&t.push("aACompromise"),r&tt.affiliationChanged&&t.push("affiliationChanged"),r&tt.cACompromise&&t.push("cACompromise"),r&tt.certificateHold&&t.push("certificateHold"),r&tt.cessationOfOperation&&t.push("cessationOfOperation"),r&tt.keyCompromise&&t.push("keyCompromise"),r&tt.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&tt.superseded&&t.push("superseded"),r&tt.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let hr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Z,context:0,repeated:"sequence",implicit:!0})],hr.prototype,"fullName",void 0),u([f({type:fr,context:1,implicit:!0})],hr.prototype,"nameRelativeToCRLIssuer",void 0),hr=u([O({type:N.Choice})],hr);class Jr{constructor(t={}){Object.assign(this,t)}}u([f({type:hr,context:0,optional:!0})],Jr.prototype,"distributionPoint",void 0),u([f({type:ol,context:1,optional:!0,implicit:!0})],Jr.prototype,"reasons",void 0),u([f({type:Z,context:2,optional:!0,repeated:"sequence",implicit:!0})],Jr.prototype,"cRLIssuer",void 0);let Ho=Lo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Lo.prototype)}};Ho=Lo=u([O({type:N.Sequence,itemType:Jr})],Ho);var Fo;let sl=Fo=class extends Ho{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};sl=Fo=u([O({type:N.Sequence,itemType:Jr})],sl);class Oe{constructor(t={}){this.onlyContainsUserCerts=Oe.ONLY,this.onlyContainsCACerts=Oe.ONLY,this.indirectCRL=Oe.ONLY,this.onlyContainsAttributeCerts=Oe.ONLY,Object.assign(this,t)}}Oe.ONLY=!1,u([f({type:hr,context:0,optional:!0})],Oe.prototype,"distributionPoint",void 0),u([f({type:k.Boolean,context:1,defaultValue:Oe.ONLY,implicit:!0})],Oe.prototype,"onlyContainsUserCerts",void 0),u([f({type:k.Boolean,context:2,defaultValue:Oe.ONLY,implicit:!0})],Oe.prototype,"onlyContainsCACerts",void 0),u([f({type:ol,context:3,optional:!0,implicit:!0})],Oe.prototype,"onlySomeReasons",void 0),u([f({type:k.Boolean,context:4,defaultValue:Oe.ONLY,implicit:!0})],Oe.prototype,"indirectCRL",void 0),u([f({type:k.Boolean,context:5,defaultValue:Oe.ONLY,implicit:!0})],Oe.prototype,"onlyContainsAttributeCerts",void 0);var Yr;(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"})(Yr||(Yr={}));let Ko=class{constructor(t=Yr.unspecified){this.reason=Yr.unspecified,this.reason=t}toJSON(){return Yr[this.reason]}toString(){return this.toJSON()}};u([f({type:k.Enumerated})],Ko.prototype,"reason",void 0),Ko=u([O({type:N.Choice})],Ko);var qo;const al=`${zt}.37`;let en=qo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};en=qo=u([O({type:N.Sequence,itemType:k.ObjectIdentifier})],en);const $p=`${pr}.1`,Mp=`${pr}.2`,Rp=`${pr}.3`,Up=`${pr}.4`,Lp=`${pr}.8`,Hp=`${pr}.9`;let zo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:k.Integer,converter:ge})],zo.prototype,"value",void 0),zo=u([O({type:N.Choice})],zo);let Go=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:k.GeneralizedTime})],Go.prototype,"value",void 0),Go=u([O({type:N.Choice})],Go);var Wo;let cl=Wo=class extends De{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};cl=Wo=u([O({type:N.Sequence})],cl);const ll=`${zt}.15`;var rt;(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"})(rt||(rt={}));class Jo extends zi{toJSON(){const t=this.toNumber(),r=[];return t&rt.cRLSign&&r.push("crlSign"),t&rt.dataEncipherment&&r.push("dataEncipherment"),t&rt.decipherOnly&&r.push("decipherOnly"),t&rt.digitalSignature&&r.push("digitalSignature"),t&rt.encipherOnly&&r.push("encipherOnly"),t&rt.keyAgreement&&r.push("keyAgreement"),t&rt.keyCertSign&&r.push("keyCertSign"),t&rt.keyEncipherment&&r.push("keyEncipherment"),t&rt.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var Yo;class tn{constructor(t={}){this.base=new Z,this.minimum=0,Object.assign(this,t)}}u([f({type:Z})],tn.prototype,"base",void 0),u([f({type:k.Integer,context:0,defaultValue:0,implicit:!0})],tn.prototype,"minimum",void 0),u([f({type:k.Integer,context:1,optional:!0,implicit:!0})],tn.prototype,"maximum",void 0);let rn=Yo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};rn=Yo=u([O({type:N.Sequence,itemType:tn})],rn);class ul{constructor(t={}){Object.assign(this,t)}}u([f({type:rn,context:0,optional:!0,implicit:!0})],ul.prototype,"permittedSubtrees",void 0),u([f({type:rn,context:1,optional:!0,implicit:!0})],ul.prototype,"excludedSubtrees",void 0);class dl{constructor(t={}){Object.assign(this,t)}}u([f({type:k.Integer,context:0,implicit:!0,optional:!0,converter:ge})],dl.prototype,"requireExplicitPolicy",void 0),u([f({type:k.Integer,context:1,implicit:!0,optional:!0,converter:ge})],dl.prototype,"inhibitPolicyMapping",void 0);var Zo;class Xo{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Xo.prototype,"issuerDomainPolicy",void 0),u([f({type:k.ObjectIdentifier})],Xo.prototype,"subjectDomainPolicy",void 0);let fl=Zo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};fl=Zo=u([O({type:N.Sequence,itemType:Xo})],fl);var Qo;const pl=`${zt}.17`;let es=Qo=class extends De{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};es=Qo=u([O({type:N.Sequence})],es);let kt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],kt.prototype,"type",void 0),u([f({type:k.Any,repeated:"set"})],kt.prototype,"values",void 0);var ts;let hl=ts=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};hl=ts=u([O({type:N.Sequence,itemType:kt})],hl);const yl=`${zt}.14`;class _t extends jo{}class gl{constructor(t={}){Object.assign(this,t)}}u([f({type:k.GeneralizedTime,context:0,implicit:!0,optional:!0})],gl.prototype,"notBefore",void 0),u([f({type:k.GeneralizedTime,context:1,implicit:!0,optional:!0})],gl.prototype,"notAfter",void 0);var Zr;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(Zr||(Zr={}));class ml extends zi{toJSON(){const t=[],r=this.toNumber();return r&Zr.pKIXCertificate&&t.push("pKIXCertificate"),r&Zr.newExtensions&&t.push("newExtensions"),r&Zr.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class bl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new ml,Object.assign(this,t)}}u([f({type:k.GeneralString})],bl.prototype,"entrustVers",void 0),u([f({type:ml})],bl.prototype,"entrustInfoFlags",void 0);var rs;let wl=rs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,rs.prototype)}};wl=rs=u([O({type:N.Sequence,itemType:Wi})],wl);class U{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof U&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&za(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:k.ObjectIdentifier})],U.prototype,"algorithm",void 0),u([f({type:k.Any,optional:!0})],U.prototype,"parameters",void 0);class Ct{constructor(t={}){this.algorithm=new U,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:U})],Ct.prototype,"algorithm",void 0),u([f({type:k.BitString})],Ct.prototype,"subjectPublicKey",void 0);let Te=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:k.UTCTime})],Te.prototype,"utcTime",void 0),u([f({type:k.GeneralizedTime})],Te.prototype,"generalTime",void 0),Te=u([O({type:N.Choice})],Te);class nn{constructor(t){this.notBefore=new Te(new Date),this.notAfter=new Te(new Date),t&&(this.notBefore=new Te(t.notBefore),this.notAfter=new Te(t.notAfter))}}u([f({type:Te})],nn.prototype,"notBefore",void 0),u([f({type:Te})],nn.prototype,"notAfter",void 0);var is;let it=class Ff{constructor(t={}){this.extnID="",this.critical=Ff.CRITICAL,this.extnValue=new ie,Object.assign(this,t)}};it.CRITICAL=!1,u([f({type:k.ObjectIdentifier})],it.prototype,"extnID",void 0),u([f({type:k.Boolean,defaultValue:it.CRITICAL})],it.prototype,"critical",void 0),u([f({type:ie})],it.prototype,"extnValue",void 0);let Wt=is=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};Wt=is=u([O({type:N.Sequence,itemType:it})],Wt);var yr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(yr||(yr={}));class Ze{constructor(t={}){this.version=yr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new U,this.issuer=new ke,this.validity=new nn,this.subject=new ke,this.subjectPublicKeyInfo=new Ct,Object.assign(this,t)}}u([f({type:k.Integer,context:0,defaultValue:yr.v1})],Ze.prototype,"version",void 0),u([f({type:k.Integer,converter:ge})],Ze.prototype,"serialNumber",void 0),u([f({type:U})],Ze.prototype,"signature",void 0),u([f({type:ke})],Ze.prototype,"issuer",void 0),u([f({type:nn})],Ze.prototype,"validity",void 0),u([f({type:ke})],Ze.prototype,"subject",void 0),u([f({type:Ct})],Ze.prototype,"subjectPublicKeyInfo",void 0),u([f({type:k.BitString,context:1,implicit:!0,optional:!0})],Ze.prototype,"issuerUniqueID",void 0),u([f({type:k.BitString,context:2,implicit:!0,optional:!0})],Ze.prototype,"subjectUniqueID",void 0),u([f({type:Wt,context:3,optional:!0})],Ze.prototype,"extensions",void 0);class gr{constructor(t={}){this.tbsCertificate=new Ze,this.signatureAlgorithm=new U,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Ze})],gr.prototype,"tbsCertificate",void 0),u([f({type:U})],gr.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],gr.prototype,"signatureValue",void 0);class on{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Te,Object.assign(this,t)}}u([f({type:k.Integer,converter:ge})],on.prototype,"userCertificate",void 0),u([f({type:Te})],on.prototype,"revocationDate",void 0),u([f({type:it,optional:!0,repeated:"sequence"})],on.prototype,"crlEntryExtensions",void 0);class St{constructor(t={}){this.signature=new U,this.issuer=new ke,this.thisUpdate=new Te,Object.assign(this,t)}}u([f({type:k.Integer,optional:!0})],St.prototype,"version",void 0),u([f({type:U})],St.prototype,"signature",void 0),u([f({type:ke})],St.prototype,"issuer",void 0),u([f({type:Te})],St.prototype,"thisUpdate",void 0),u([f({type:Te,optional:!0})],St.prototype,"nextUpdate",void 0),u([f({type:on,repeated:"sequence",optional:!0})],St.prototype,"revokedCertificates",void 0),u([f({type:it,optional:!0,context:0,repeated:"sequence"})],St.prototype,"crlExtensions",void 0);let ns=class{constructor(t={}){this.tbsCertList=new St,this.signatureAlgorithm=new U,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:St})],ns.prototype,"tbsCertList",void 0),u([f({type:U})],ns.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],ns.prototype,"signature",void 0);let mr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],mr.prototype,"attrType",void 0),u([f({type:k.Any,repeated:"set"})],mr.prototype,"attrValues",void 0);class os{constructor(t={}){this.acIssuer=new Z,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:Z})],os.prototype,"acIssuer",void 0),u([f({type:k.Integer})],os.prototype,"acSerial",void 0),u([f({type:kt,repeated:"sequence"})],os.prototype,"attrs",void 0);var ss;let sn=ss=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};sn=ss=u([O({type:N.Sequence,itemType:k.ObjectIdentifier})],sn);class an{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:k.Integer,optional:!0})],an.prototype,"pathLenConstraint",void 0),u([f({type:sn,implicit:!0,context:0,optional:!0})],an.prototype,"permittedAttrs",void 0),u([f({type:sn,implicit:!0,context:1,optional:!0})],an.prototype,"excludedAttrs",void 0),u([f({type:k.Boolean,defaultValue:!0})],an.prototype,"permitUnSpecified",void 0);class Jt{constructor(t={}){this.issuer=new De,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:De})],Jt.prototype,"issuer",void 0),u([f({type:k.Integer,converter:ge})],Jt.prototype,"serial",void 0),u([f({type:k.BitString,optional:!0})],Jt.prototype,"issuerUID",void 0);var as;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(as||(as={}));class Yt{constructor(t={}){this.digestedObjectType=as.publicKey,this.digestAlgorithm=new U,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Enumerated})],Yt.prototype,"digestedObjectType",void 0),u([f({type:k.ObjectIdentifier,optional:!0})],Yt.prototype,"otherObjectTypeID",void 0),u([f({type:U})],Yt.prototype,"digestAlgorithm",void 0),u([f({type:k.BitString})],Yt.prototype,"objectDigest",void 0);class cn{constructor(t={}){Object.assign(this,t)}}u([f({type:De,optional:!0})],cn.prototype,"issuerName",void 0),u([f({type:Jt,context:0,implicit:!0,optional:!0})],cn.prototype,"baseCertificateID",void 0),u([f({type:Yt,context:1,implicit:!0,optional:!0})],cn.prototype,"objectDigestInfo",void 0);let br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Z,repeated:"sequence"})],br.prototype,"v1Form",void 0),u([f({type:cn,context:0,implicit:!0})],br.prototype,"v2Form",void 0),br=u([O({type:N.Choice})],br);class ln{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:k.GeneralizedTime})],ln.prototype,"notBeforeTime",void 0),u([f({type:k.GeneralizedTime})],ln.prototype,"notAfterTime",void 0);class Xr{constructor(t={}){Object.assign(this,t)}}u([f({type:Jt,implicit:!0,context:0,optional:!0})],Xr.prototype,"baseCertificateID",void 0),u([f({type:De,implicit:!0,context:1,optional:!0})],Xr.prototype,"entityName",void 0),u([f({type:Yt,implicit:!0,context:2,optional:!0})],Xr.prototype,"objectDigestInfo",void 0);var cs;(function(e){e[e.v2=1]="v2"})(cs||(cs={}));class nt{constructor(t={}){this.version=cs.v2,this.holder=new Xr,this.issuer=new br,this.signature=new U,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new ln,this.attributes=[],Object.assign(this,t)}}u([f({type:k.Integer})],nt.prototype,"version",void 0),u([f({type:Xr})],nt.prototype,"holder",void 0),u([f({type:br})],nt.prototype,"issuer",void 0),u([f({type:U})],nt.prototype,"signature",void 0),u([f({type:k.Integer,converter:ge})],nt.prototype,"serialNumber",void 0),u([f({type:ln})],nt.prototype,"attrCertValidityPeriod",void 0),u([f({type:kt,repeated:"sequence"})],nt.prototype,"attributes",void 0),u([f({type:k.BitString,optional:!0})],nt.prototype,"issuerUniqueID",void 0),u([f({type:Wt,optional:!0})],nt.prototype,"extensions",void 0);class un{constructor(t={}){this.acinfo=new nt,this.signatureAlgorithm=new U,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:nt})],un.prototype,"acinfo",void 0),u([f({type:U})],un.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],un.prototype,"signatureValue",void 0);var dn;(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"})(dn||(dn={}));class ls extends zi{}class us{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier,implicit:!0,context:0})],us.prototype,"type",void 0),u([f({type:k.Any,implicit:!0,context:1})],us.prototype,"value",void 0);class ds{constructor(t={}){this.policyId="",this.classList=new ls(dn.unclassified),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ds.prototype,"policyId",void 0),u([f({type:ls,defaultValue:new ls(dn.unclassified)})],ds.prototype,"classList",void 0),u([f({type:us,repeated:"set"})],ds.prototype,"securityCategories",void 0);class fn{constructor(t={}){Object.assign(this,t)}}u([f({type:ie})],fn.prototype,"cotets",void 0),u([f({type:k.ObjectIdentifier})],fn.prototype,"oid",void 0),u([f({type:k.Utf8String})],fn.prototype,"string",void 0);class vl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:De,implicit:!0,context:0,optional:!0})],vl.prototype,"policyAuthority",void 0),u([f({type:fn,repeated:"sequence"})],vl.prototype,"values",void 0);var fs;class pn{constructor(t={}){this.targetCertificate=new Jt,Object.assign(this,t)}}u([f({type:Jt})],pn.prototype,"targetCertificate",void 0),u([f({type:Z,optional:!0})],pn.prototype,"targetName",void 0),u([f({type:Yt,optional:!0})],pn.prototype,"certDigestInfo",void 0);let wr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Z,context:0,implicit:!0})],wr.prototype,"targetName",void 0),u([f({type:Z,context:1,implicit:!0})],wr.prototype,"targetGroup",void 0),u([f({type:pn,context:2,implicit:!0})],wr.prototype,"targetCert",void 0),wr=u([O({type:N.Choice})],wr);let ps=fs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};ps=fs=u([O({type:N.Sequence,itemType:wr})],ps);var hs;let kl=hs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};kl=hs=u([O({type:N.Sequence,itemType:ps})],kl);class Cl{constructor(t={}){Object.assign(this,t)}}u([f({type:De,implicit:!0,context:0,optional:!0})],Cl.prototype,"roleAuthority",void 0),u([f({type:Z,implicit:!0,context:1})],Cl.prototype,"roleName",void 0);class ys{constructor(t={}){this.service=new Z,this.ident=new Z,Object.assign(this,t)}}u([f({type:Z})],ys.prototype,"service",void 0),u([f({type:Z})],ys.prototype,"ident",void 0),u([f({type:ie,optional:!0})],ys.prototype,"authInfo",void 0);var gs;class ms{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ms.prototype,"otherCertFormat",void 0),u([f({type:k.Any})],ms.prototype,"otherCert",void 0);let vr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:gr})],vr.prototype,"certificate",void 0),u([f({type:un,context:2,implicit:!0})],vr.prototype,"v2AttrCert",void 0),u([f({type:ms,context:3,implicit:!0})],vr.prototype,"other",void 0),vr=u([O({type:N.Choice})],vr);let hn=gs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,gs.prototype)}};hn=gs=u([O({type:N.Set,itemType:vr})],hn);class kr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],kr.prototype,"contentType",void 0),u([f({type:k.Any,context:0})],kr.prototype,"content",void 0);let Qr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie})],Qr.prototype,"single",void 0),u([f({type:k.Any})],Qr.prototype,"any",void 0),Qr=u([O({type:N.Choice})],Qr);class yn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],yn.prototype,"eContentType",void 0),u([f({type:Qr,context:0,optional:!0})],yn.prototype,"eContent",void 0);var xt;(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"})(xt||(xt={}));let ei=class extends U{};ei=u([O({type:N.Sequence})],ei);let gn=class extends U{};gn=u([O({type:N.Sequence})],gn);let lt=class extends U{};lt=u([O({type:N.Sequence})],lt);let mn=class extends U{};mn=u([O({type:N.Sequence})],mn);let Sl=class extends U{};Sl=u([O({type:N.Sequence})],Sl);let bs=class extends U{};bs=u([O({type:N.Sequence})],bs);let ti=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0,optional:!0})],ti.prototype,"value",void 0),u([f({type:ie,converter:bp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ti.prototype,"constructedValue",void 0),ti=u([O({type:N.Choice})],ti);class ri{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new mn,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ri.prototype,"contentType",void 0),u([f({type:mn})],ri.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ti,optional:!0})],ri.prototype,"encryptedContent",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:k.Integer,converter:ge})],Cr.prototype,"serialNumber",void 0);class bn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],bn.prototype,"keyAttrId",void 0),u([f({type:k.Any,optional:!0})],bn.prototype,"keyAttr",void 0);var ws;class wn{constructor(t={}){this.subjectKeyIdentifier=new _t,Object.assign(this,t)}}u([f({type:_t})],wn.prototype,"subjectKeyIdentifier",void 0),u([f({type:k.GeneralizedTime,optional:!0})],wn.prototype,"date",void 0),u([f({type:bn,optional:!0})],wn.prototype,"other",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:wn,context:0,implicit:!0,optional:!0})],Sr.prototype,"rKeyId",void 0),u([f({type:Cr,optional:!0})],Sr.prototype,"issuerAndSerialNumber",void 0),Sr=u([O({type:N.Choice})],Sr);class vs{constructor(t={}){this.rid=new Sr,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:Sr})],vs.prototype,"rid",void 0),u([f({type:ie})],vs.prototype,"encryptedKey",void 0);let vn=ws=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};vn=ws=u([O({type:N.Sequence,itemType:vs})],vn);class ks{constructor(t={}){this.algorithm=new U,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:U})],ks.prototype,"algorithm",void 0),u([f({type:k.BitString})],ks.prototype,"publicKey",void 0);let Zt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:_t,context:0,implicit:!0,optional:!0})],Zt.prototype,"subjectKeyIdentifier",void 0),u([f({type:ks,context:1,implicit:!0,optional:!0})],Zt.prototype,"originatorKey",void 0),u([f({type:Cr,optional:!0})],Zt.prototype,"issuerAndSerialNumber",void 0),Zt=u([O({type:N.Choice})],Zt);class xr{constructor(t={}){this.version=xt.v3,this.originator=new Zt,this.keyEncryptionAlgorithm=new lt,this.recipientEncryptedKeys=new vn,Object.assign(this,t)}}u([f({type:k.Integer})],xr.prototype,"version",void 0),u([f({type:Zt,context:0})],xr.prototype,"originator",void 0),u([f({type:ie,context:1,optional:!0})],xr.prototype,"ukm",void 0),u([f({type:lt})],xr.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:vn})],xr.prototype,"recipientEncryptedKeys",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:_t,context:0,implicit:!0})],Ar.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],Ar.prototype,"issuerAndSerialNumber",void 0),Ar=u([O({type:N.Choice})],Ar);class ii{constructor(t={}){this.version=xt.v0,this.rid=new Ar,this.keyEncryptionAlgorithm=new lt,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],ii.prototype,"version",void 0),u([f({type:Ar})],ii.prototype,"rid",void 0),u([f({type:lt})],ii.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],ii.prototype,"encryptedKey",void 0);class ni{constructor(t={}){this.keyIdentifier=new ie,Object.assign(this,t)}}u([f({type:ie})],ni.prototype,"keyIdentifier",void 0),u([f({type:k.GeneralizedTime,optional:!0})],ni.prototype,"date",void 0),u([f({type:bn,optional:!0})],ni.prototype,"other",void 0);class oi{constructor(t={}){this.version=xt.v4,this.kekid=new ni,this.keyEncryptionAlgorithm=new lt,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],oi.prototype,"version",void 0),u([f({type:ni})],oi.prototype,"kekid",void 0),u([f({type:lt})],oi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],oi.prototype,"encryptedKey",void 0);class si{constructor(t={}){this.version=xt.v0,this.keyEncryptionAlgorithm=new lt,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],si.prototype,"version",void 0),u([f({type:bs,context:0,optional:!0})],si.prototype,"keyDerivationAlgorithm",void 0),u([f({type:lt})],si.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],si.prototype,"encryptedKey",void 0);class Cs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Cs.prototype,"oriType",void 0),u([f({type:k.Any})],Cs.prototype,"oriValue",void 0);let Ot=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ii,optional:!0})],Ot.prototype,"ktri",void 0),u([f({type:xr,context:1,implicit:!0,optional:!0})],Ot.prototype,"kari",void 0),u([f({type:oi,context:2,implicit:!0,optional:!0})],Ot.prototype,"kekri",void 0),u([f({type:si,context:3,implicit:!0,optional:!0})],Ot.prototype,"pwri",void 0),u([f({type:Cs,context:4,implicit:!0,optional:!0})],Ot.prototype,"ori",void 0),Ot=u([O({type:N.Choice})],Ot);var Ss;let kn=Ss=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};kn=Ss=u([O({type:N.Set,itemType:Ot})],kn);var xs;class Cn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Cn.prototype,"otherRevInfoFormat",void 0),u([f({type:k.Any})],Cn.prototype,"otherRevInfo",void 0);let ai=class{constructor(t={}){this.other=new Cn,Object.assign(this,t)}};u([f({type:Cn,context:1,implicit:!0})],ai.prototype,"other",void 0),ai=u([O({type:N.Choice})],ai);let As=xs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};As=xs=u([O({type:N.Set,itemType:ai})],As);class Bs{constructor(t={}){Object.assign(this,t)}}u([f({type:hn,context:0,implicit:!0,optional:!0})],Bs.prototype,"certs",void 0),u([f({type:As,context:1,implicit:!0,optional:!0})],Bs.prototype,"crls",void 0);var Is;let Es=Is=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};Es=Is=u([O({type:N.Set,itemType:mr})],Es);class ci{constructor(t={}){this.version=xt.v0,this.recipientInfos=new kn,this.encryptedContentInfo=new ri,Object.assign(this,t)}}u([f({type:k.Integer})],ci.prototype,"version",void 0),u([f({type:Bs,context:0,implicit:!0,optional:!0})],ci.prototype,"originatorInfo",void 0),u([f({type:kn})],ci.prototype,"recipientInfos",void 0),u([f({type:ri})],ci.prototype,"encryptedContentInfo",void 0),u([f({type:Es,context:1,implicit:!0,optional:!0})],ci.prototype,"unprotectedAttrs",void 0);const Fp="1.2.840.113549.1.7.2";let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:_t,context:0,implicit:!0})],Br.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cr})],Br.prototype,"issuerAndSerialNumber",void 0),Br=u([O({type:N.Choice})],Br);var Ns;class At{constructor(t={}){this.version=xt.v0,this.sid=new Br,this.digestAlgorithm=new ei,this.signatureAlgorithm=new gn,this.signature=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],At.prototype,"version",void 0),u([f({type:Br})],At.prototype,"sid",void 0),u([f({type:ei})],At.prototype,"digestAlgorithm",void 0),u([f({type:mr,repeated:"set",context:0,implicit:!0,optional:!0})],At.prototype,"signedAttrs",void 0),u([f({type:gn})],At.prototype,"signatureAlgorithm",void 0),u([f({type:ie})],At.prototype,"signature",void 0),u([f({type:mr,repeated:"set",context:1,implicit:!0,optional:!0})],At.prototype,"unsignedAttrs",void 0);let Sn=Ns=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};Sn=Ns=u([O({type:N.Set,itemType:At})],Sn);var _s;let xn=_s=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};xn=_s=u([O({type:N.Set,itemType:ei})],xn);class Ir{constructor(t={}){this.version=xt.v0,this.digestAlgorithms=new xn,this.encapContentInfo=new yn,this.signerInfos=new Sn,Object.assign(this,t)}}u([f({type:k.Integer})],Ir.prototype,"version",void 0),u([f({type:xn})],Ir.prototype,"digestAlgorithms",void 0),u([f({type:yn})],Ir.prototype,"encapContentInfo",void 0),u([f({type:hn,context:0,implicit:!0,optional:!0})],Ir.prototype,"certificates",void 0),u([f({type:ai,context:1,implicit:!0,optional:!0})],Ir.prototype,"crls",void 0),u([f({type:Sn})],Ir.prototype,"signerInfos",void 0);const li="1.2.840.10045.2.1",Os="1.2.840.10045.4.1",xl="1.2.840.10045.4.3.1",Ts="1.2.840.10045.4.3.2",Vs="1.2.840.10045.4.3.3",js="1.2.840.10045.4.3.4",Al="1.2.840.10045.3.1.7",Bl="1.3.132.0.34",Il="1.3.132.0.35";function ui(e){return new U({algorithm:e})}const Kp=ui(Os);ui(xl);const qp=ui(Ts),zp=ui(Vs),Gp=ui(js);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],Er.prototype,"namedCurve",void 0),Er=u([O({type:N.Choice})],Er);class An{constructor(t={}){this.version=1,this.privateKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],An.prototype,"version",void 0),u([f({type:ie})],An.prototype,"privateKey",void 0),u([f({type:Er,context:0,optional:!0})],An.prototype,"parameters",void 0),u([f({type:k.BitString,context:1,optional:!0})],An.prototype,"publicKey",void 0);class Bn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:ge})],Bn.prototype,"r",void 0),u([f({type:k.Integer,converter:ge})],Bn.prototype,"s",void 0);const Re="1.2.840.113549.1.1",Nr=`${Re}.1`,Wp=`${Re}.7`,Jp=`${Re}.9`,Yp=`${Re}.10`,Zp=`${Re}.2`,Xp=`${Re}.4`,In=`${Re}.5`,Qp=`${Re}.14`,Ds=`${Re}.11`,En=`${Re}.12`,Nn=`${Re}.13`,El=`${Re}.15`,Nl=`${Re}.16`,_l="1.3.14.3.2.26",Ol="2.16.840.1.101.3.4.2.4",Tl="2.16.840.1.101.3.4.2.1",Vl="2.16.840.1.101.3.4.2.2",jl="2.16.840.1.101.3.4.2.3",eh="2.16.840.1.101.3.4.2.5",th="2.16.840.1.101.3.4.2.6",rh="1.2.840.113549.2.2",ih="1.2.840.113549.2.5",Ps=`${Re}.8`;function Ce(e){return new U({algorithm:e,parameters:null})}Ce(rh),Ce(ih);const Xt=Ce(_l);Ce(Ol),Ce(Tl),Ce(Vl),Ce(jl),Ce(eh),Ce(th);const Dl=new U({algorithm:Ps,parameters:L.serialize(Xt)}),Pl=new U({algorithm:Jp,parameters:L.serialize(Gi.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(Nr),Ce(Zp),Ce(Xp),Ce(In),Ce(El),Ce(Nl),Ce(En),Ce(Nn),Ce(El),Ce(Nl);class _n{constructor(t={}){this.hashAlgorithm=new U(Xt),this.maskGenAlgorithm=new U({algorithm:Ps,parameters:L.serialize(Xt)}),this.pSourceAlgorithm=new U(Pl),Object.assign(this,t)}}u([f({type:U,context:0,defaultValue:Xt})],_n.prototype,"hashAlgorithm",void 0),u([f({type:U,context:1,defaultValue:Dl})],_n.prototype,"maskGenAlgorithm",void 0),u([f({type:U,context:2,defaultValue:Pl})],_n.prototype,"pSourceAlgorithm",void 0),new U({algorithm:Wp,parameters:L.serialize(new _n)});class di{constructor(t={}){this.hashAlgorithm=new U(Xt),this.maskGenAlgorithm=new U({algorithm:Ps,parameters:L.serialize(Xt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:U,context:0,defaultValue:Xt})],di.prototype,"hashAlgorithm",void 0),u([f({type:U,context:1,defaultValue:Dl})],di.prototype,"maskGenAlgorithm",void 0),u([f({type:k.Integer,context:2,defaultValue:20})],di.prototype,"saltLength",void 0),u([f({type:k.Integer,context:3,defaultValue:1})],di.prototype,"trailerField",void 0),new U({algorithm:Yp,parameters:L.serialize(new di)});class On{constructor(t={}){this.digestAlgorithm=new U,this.digest=new ie,Object.assign(this,t)}}u([f({type:U})],On.prototype,"digestAlgorithm",void 0),u([f({type:ie})],On.prototype,"digest",void 0);var $s;class Tn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:ge})],Tn.prototype,"prime",void 0),u([f({type:k.Integer,converter:ge})],Tn.prototype,"exponent",void 0),u([f({type:k.Integer,converter:ge})],Tn.prototype,"coefficient",void 0);let Ms=$s=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};Ms=$s=u([O({type:N.Sequence,itemType:Tn})],Ms);class ut{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:k.Integer})],ut.prototype,"version",void 0),u([f({type:k.Integer,converter:ge})],ut.prototype,"modulus",void 0),u([f({type:k.Integer,converter:ge})],ut.prototype,"publicExponent",void 0),u([f({type:k.Integer,converter:ge})],ut.prototype,"privateExponent",void 0),u([f({type:k.Integer,converter:ge})],ut.prototype,"prime1",void 0),u([f({type:k.Integer,converter:ge})],ut.prototype,"prime2",void 0),u([f({type:k.Integer,converter:ge})],ut.prototype,"exponent1",void 0),u([f({type:k.Integer,converter:ge})],ut.prototype,"exponent2",void 0),u([f({type:k.Integer,converter:ge})],ut.prototype,"coefficient",void 0),u([f({type:Ms,optional:!0})],ut.prototype,"otherPrimeInfos",void 0);class Rs{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:ge})],Rs.prototype,"modulus",void 0),u([f({type:k.Integer,converter:ge})],Rs.prototype,"publicExponent",void 0);var Us;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Us||(Us={}));const Ue=Us;/*! *****************************************************************************
|
|
76
76
|
Copyright (c) Microsoft Corporation.
|
|
77
77
|
|
|
78
78
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -85,9 +85,9 @@ ${t.join(`
|
|
|
85
85
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
86
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
87
|
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
-
***************************************************************************** */var Ls=function(e,t){return Ls=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},Ls(e,t)};function Hs(e,t){Ls(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function
|
|
88
|
+
***************************************************************************** */var Ls=function(e,t){return Ls=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},Ls(e,t)};function Hs(e,t){Ls(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function nh(e,t,r,i){function o(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function c(p){try{d(i.next(p))}catch(y){a(y)}}function l(p){try{d(i.throw(p))}catch(y){a(y)}}function d(p){p.done?s(p.value):o(p.value).then(c,l)}d((i=i.apply(e,t||[])).next())})}function oh(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,o,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(d){return function(p){return l([d,p])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(p){d=[6,p],o=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Vn(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function jn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(c){a={error:c}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function Qt(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(jn(arguments[t]));return e}var sh="injectionTokens";function ah(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(sh,e)||{};return Object.keys(r).forEach(function(i){t[+i]=r[i]}),t}function $l(e){return!!e.useClass}function Fs(e){return!!e.useFactory}var Ml=function(){function e(t){this.wrap=t,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return e.prototype.createProxy=function(t){var r=this,i={},o=!1,s,a=function(){return o||(s=t(r.wrap()),o=!0),s};return new Proxy(i,this.createHandler(a))},e.prototype.createHandler=function(t){var r={},i=function(o){r[o]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=t();var c=Reflect[o];return c.apply(void 0,Qt(s))}};return this.reflectMethods.forEach(i),r},e}();function _r(e){return typeof e=="string"||typeof e=="symbol"}function ch(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function Rl(e){return typeof e=="object"&&"token"in e&&"transform"in e}function lh(e){return typeof e=="function"||e instanceof Ml}function Dn(e){return!!e.useToken}function Pn(e){return e.useValue!=null}function uh(e){return $l(e)||Pn(e)||Dn(e)||Fs(e)}var Ks=function(){function e(){this._registryMap=new Map}return e.prototype.entries=function(){return this._registryMap.entries()},e.prototype.getAll=function(t){return this.ensure(t),this._registryMap.get(t)},e.prototype.get=function(t){this.ensure(t);var r=this._registryMap.get(t);return r[r.length-1]||null},e.prototype.set=function(t,r){this.ensure(t),this._registryMap.get(t).push(r)},e.prototype.setAll=function(t,r){this._registryMap.set(t,r)},e.prototype.has=function(t){return this.ensure(t),this._registryMap.get(t).length>0},e.prototype.clear=function(){this._registryMap.clear()},e.prototype.ensure=function(t){this._registryMap.has(t)||this._registryMap.set(t,[])},e}(),dh=function(e){Hs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Ks),Ul=function(){function e(){this.scopedResolutions=new Map}return e}();function fh(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function ph(e,t,r){return r===void 0&&(r=" "),Qt([e],t.message.split(`
|
|
89
89
|
`).map(function(i){return r+i})).join(`
|
|
90
|
-
`)}function dh(e,t,r){var i=jn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=lh(s,t);return uh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function fh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var ph=function(e){Hs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Ks),hh=function(e){Hs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Ks),yh=function(){function e(){this.preResolution=new ph,this.postResolution=new hh}return e}(),Ll=new Map,mh=function(){function e(t){this.parent=t,this._registry=new ch,this.interceptors=new yh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:Ue.Transient}),this.ensureNotDisposed();var o;if(ah(r)?o=r:o={useClass:r},Dn(o))for(var s=[t],a=o;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+Qt(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Dn(l.provider)?a=l.provider:a=null}if((i.lifecycle===Ue.Singleton||i.lifecycle==Ue.ContainerScoped||i.lifecycle==Ue.ResolutionScoped)&&(Pn(o)||Fs(o)))throw new Error('Cannot use lifecycle "'+Ue[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),_r(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),_r(t)){if(_r(r))return this.register(t,{useToken:r},{lifecycle:Ue.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:Ue.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!_r(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:Ue.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Ul),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&_r(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var o=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}if(sh(t)){var o=this.construct(t,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(t,r){var i,o;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Vn(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var o,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Vn(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(p){o={error:p}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===Ue.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===Ue.Singleton,o=t.options.lifecycle===Ue.ContainerScoped,s=i||o,a;return Pn(t.provider)?a=t.provider.useValue:Dn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):$l(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Fs(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===Ue.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Ul),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&_r(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Vn(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=jn(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Pn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var o=Vn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=jn(s.value,2),c=a[0],l=a[1];l.some(function(d){var p=d.options;return p.lifecycle===Ue.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===Ue.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:i})},e.prototype.afterResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:i})},e.prototype.dispose=function(){return th(this,void 0,void 0,function(){var t;return rh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var o=i.dispose();o&&t.push(o)}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},e.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},e.prototype.construct=function(t,r){var i=this;if(t instanceof Rl)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=Ll.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,Qt([void 0],a)))}();return fh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var i=this;return function(o,s){var a,c,l;try{return oh(o)?Ml(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,Qt([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,Qt([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Ml(o)?(l=i.resolve(o.transform,t)).transform.apply(l,Qt([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(dh(r,s,d))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},e}(),Xe=new mh;function qs(){return function(e){Ll.set(e,nh(e))}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var zs;class $n{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:k.ObjectIdentifier})],$n.prototype,"attrId",void 0),u([f({type:k.Any,repeated:"set"})],$n.prototype,"attrValues",void 0);let Hl=zs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Hl=zs=u([O({type:N.Sequence,itemType:$n})],Hl);var Ws;let Fl=Ws=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};Fl=Ws=u([O({type:N.Sequence,itemType:kr})],Fl);class Kl{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Kl.prototype,"certId",void 0),u([f({type:k.Any,context:0})],Kl.prototype,"certValue",void 0);class ql{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ql.prototype,"crlId",void 0),u([f({type:k.Any,context:0})],ql.prototype,"crltValue",void 0);class zl extends ie{}let Rn=class{constructor(t={}){this.encryptionAlgorithm=new U,this.encryptedData=new zl,Object.assign(this,t)}};u([f({type:U})],Rn.prototype,"encryptionAlgorithm",void 0),u([f({type:zl})],Rn.prototype,"encryptedData",void 0);var Gs,Js;(function(e){e[e.v1=0]="v1"})(Js||(Js={}));class Wl extends ie{}let Ys=Gs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Gs.prototype)}};Ys=Gs=u([O({type:N.Sequence,itemType:kt})],Ys);class fi{constructor(t={}){this.version=Js.v1,this.privateKeyAlgorithm=new U,this.privateKey=new Wl,Object.assign(this,t)}}u([f({type:k.Integer})],fi.prototype,"version",void 0),u([f({type:U})],fi.prototype,"privateKeyAlgorithm",void 0),u([f({type:Wl})],fi.prototype,"privateKey",void 0),u([f({type:Ys,implicit:!0,context:0,optional:!0})],fi.prototype,"attributes",void 0);let Gl=class extends fi{};Gl=u([O({type:N.Sequence})],Gl);let Jl=class extends Rn{};Jl=u([O({type:N.Sequence})],Jl);class Yl{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Yl.prototype,"secretTypeId",void 0),u([f({type:k.Any,context:0})],Yl.prototype,"secretValue",void 0);class pi{constructor(t={}){this.mac=new On,this.macSalt=new ie,this.iterations=1,Object.assign(this,t)}}u([f({type:On})],pi.prototype,"mac",void 0),u([f({type:ie})],pi.prototype,"macSalt",void 0),u([f({type:k.Integer,defaultValue:1})],pi.prototype,"iterations",void 0);class Mn{constructor(t={}){this.version=3,this.authSafe=new kr,this.macData=new pi,Object.assign(this,t)}}u([f({type:k.Integer})],Mn.prototype,"version",void 0),u([f({type:kr})],Mn.prototype,"authSafe",void 0),u([f({type:pi,optional:!0})],Mn.prototype,"macData",void 0);var Zs;class Un{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Un.prototype,"bagId",void 0),u([f({type:k.Any,context:0})],Un.prototype,"bagValue",void 0),u([f({type:$n,repeated:"set",optional:!0})],Un.prototype,"bagAttributes",void 0);let Zl=Zs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Zs.prototype)}};Zl=Zs=u([O({type:N.Sequence,itemType:Un})],Zl);var Xs,Qs,ea;const Xl="1.2.840.113549.1.9",Ql=`${Xl}.7`,ta=`${Xl}.14`;let Ln=class extends Ie{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:k.IA5String})],Ln.prototype,"ia5String",void 0),Ln=u([O({type:N.Choice})],Ln);let eu=class extends kr{};eu=u([O({type:N.Sequence})],eu);let tu=class extends Mn{};tu=u([O({type:N.Sequence})],tu);let ru=class extends Rn{};ru=u([O({type:N.Sequence})],ru);let ra=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.IA5String})],ra.prototype,"value",void 0),ra=u([O({type:N.Choice})],ra);let iu=class extends Ln{};iu=u([O({type:N.Choice})],iu);let nu=class extends Ie{};nu=u([O({type:N.Choice})],nu);let ia=class{constructor(t=new Date){this.value=t}};u([f({type:k.GeneralizedTime})],ia.prototype,"value",void 0),ia=u([O({type:N.Choice})],ia);let ou=class extends Ie{};ou=u([O({type:N.Choice})],ou);let na=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:k.PrintableString})],na.prototype,"value",void 0),na=u([O({type:N.Choice})],na);let Hn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.PrintableString})],Hn.prototype,"value",void 0),Hn=u([O({type:N.Choice})],Hn);let su=class extends Hn{};su=u([O({type:N.Choice})],su);let au=class extends Ie{};au=u([O({type:N.Choice})],au);let oa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.ObjectIdentifier})],oa.prototype,"value",void 0),oa=u([O({type:N.Choice})],oa);let cu=class extends Te{};cu=u([O({type:N.Choice})],cu);let sa=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:k.Integer})],sa.prototype,"value",void 0),sa=u([O({type:N.Choice})],sa);let lu=class extends At{};lu=u([O({type:N.Sequence})],lu);let Fn=class extends Ie{};Fn=u([O({type:N.Choice})],Fn);let uu=Xs=class extends Gt{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};uu=Xs=u([O({type:N.Sequence})],uu);let du=Qs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Qs.prototype)}};du=Qs=u([O({type:N.Set,itemType:gr})],du);let aa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.BmpString})],aa.prototype,"value",void 0),aa=u([O({type:N.Choice})],aa);let ca=class extends U{};ca=u([O({type:N.Sequence})],ca);let fu=ea=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};fu=ea=u([O({type:N.Sequence,itemType:ca})],fu);var la;let Kn=la=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,la.prototype)}};Kn=la=u([O({type:N.Sequence,itemType:kt})],Kn);class Or{constructor(t={}){this.version=0,this.subject=new ke,this.subjectPKInfo=new Ct,this.attributes=new Kn,Object.assign(this,t)}}u([f({type:k.Integer})],Or.prototype,"version",void 0),u([f({type:ke})],Or.prototype,"subject",void 0),u([f({type:Ct})],Or.prototype,"subjectPKInfo",void 0),u([f({type:Kn,implicit:!0,context:0})],Or.prototype,"attributes",void 0);class hi{constructor(t={}){this.certificationRequestInfo=new Or,this.signatureAlgorithm=new U,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Or})],hi.prototype,"certificationRequestInfo",void 0),u([f({type:U})],hi.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],hi.prototype,"signature",void 0);/*!
|
|
90
|
+
`)}function hh(e,t,r){var i=jn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=fh(s,t);return ph("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function yh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var gh=function(e){Hs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Ks),mh=function(e){Hs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Ks),bh=function(){function e(){this.preResolution=new gh,this.postResolution=new mh}return e}(),Ll=new Map,wh=function(){function e(t){this.parent=t,this._registry=new dh,this.interceptors=new bh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:Ue.Transient}),this.ensureNotDisposed();var o;if(uh(r)?o=r:o={useClass:r},Dn(o))for(var s=[t],a=o;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+Qt(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Dn(l.provider)?a=l.provider:a=null}if((i.lifecycle===Ue.Singleton||i.lifecycle==Ue.ContainerScoped||i.lifecycle==Ue.ResolutionScoped)&&(Pn(o)||Fs(o)))throw new Error('Cannot use lifecycle "'+Ue[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),_r(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),_r(t)){if(_r(r))return this.register(t,{useToken:r},{lifecycle:Ue.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:Ue.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!_r(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:Ue.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Ul),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&_r(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var o=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}if(lh(t)){var o=this.construct(t,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(t,r){var i,o;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Vn(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var o,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Vn(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(p){o={error:p}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===Ue.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===Ue.Singleton,o=t.options.lifecycle===Ue.ContainerScoped,s=i||o,a;return Pn(t.provider)?a=t.provider.useValue:Dn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):$l(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Fs(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===Ue.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Ul),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&_r(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Vn(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=jn(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Pn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var o=Vn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=jn(s.value,2),c=a[0],l=a[1];l.some(function(d){var p=d.options;return p.lifecycle===Ue.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===Ue.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:i})},e.prototype.afterResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:i})},e.prototype.dispose=function(){return nh(this,void 0,void 0,function(){var t;return oh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var o=i.dispose();o&&t.push(o)}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},e.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},e.prototype.construct=function(t,r){var i=this;if(t instanceof Ml)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=Ll.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,Qt([void 0],a)))}();return yh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var i=this;return function(o,s){var a,c,l;try{return ch(o)?Rl(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,Qt([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,Qt([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Rl(o)?(l=i.resolve(o.transform,t)).transform.apply(l,Qt([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(hh(r,s,d))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},e}(),Xe=new wh;function qs(){return function(e){Ll.set(e,ah(e))}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var zs;class $n{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:k.ObjectIdentifier})],$n.prototype,"attrId",void 0),u([f({type:k.Any,repeated:"set"})],$n.prototype,"attrValues",void 0);let Hl=zs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Hl=zs=u([O({type:N.Sequence,itemType:$n})],Hl);var Gs;let Fl=Gs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Gs.prototype)}};Fl=Gs=u([O({type:N.Sequence,itemType:kr})],Fl);class Kl{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Kl.prototype,"certId",void 0),u([f({type:k.Any,context:0})],Kl.prototype,"certValue",void 0);class ql{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ql.prototype,"crlId",void 0),u([f({type:k.Any,context:0})],ql.prototype,"crltValue",void 0);class zl extends ie{}let Mn=class{constructor(t={}){this.encryptionAlgorithm=new U,this.encryptedData=new zl,Object.assign(this,t)}};u([f({type:U})],Mn.prototype,"encryptionAlgorithm",void 0),u([f({type:zl})],Mn.prototype,"encryptedData",void 0);var Ws,Js;(function(e){e[e.v1=0]="v1"})(Js||(Js={}));class Gl extends ie{}let Ys=Ws=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};Ys=Ws=u([O({type:N.Sequence,itemType:kt})],Ys);class fi{constructor(t={}){this.version=Js.v1,this.privateKeyAlgorithm=new U,this.privateKey=new Gl,Object.assign(this,t)}}u([f({type:k.Integer})],fi.prototype,"version",void 0),u([f({type:U})],fi.prototype,"privateKeyAlgorithm",void 0),u([f({type:Gl})],fi.prototype,"privateKey",void 0),u([f({type:Ys,implicit:!0,context:0,optional:!0})],fi.prototype,"attributes",void 0);let Wl=class extends fi{};Wl=u([O({type:N.Sequence})],Wl);let Jl=class extends Mn{};Jl=u([O({type:N.Sequence})],Jl);class Yl{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Yl.prototype,"secretTypeId",void 0),u([f({type:k.Any,context:0})],Yl.prototype,"secretValue",void 0);class pi{constructor(t={}){this.mac=new On,this.macSalt=new ie,this.iterations=1,Object.assign(this,t)}}u([f({type:On})],pi.prototype,"mac",void 0),u([f({type:ie})],pi.prototype,"macSalt",void 0),u([f({type:k.Integer,defaultValue:1})],pi.prototype,"iterations",void 0);class Rn{constructor(t={}){this.version=3,this.authSafe=new kr,this.macData=new pi,Object.assign(this,t)}}u([f({type:k.Integer})],Rn.prototype,"version",void 0),u([f({type:kr})],Rn.prototype,"authSafe",void 0),u([f({type:pi,optional:!0})],Rn.prototype,"macData",void 0);var Zs;class Un{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Un.prototype,"bagId",void 0),u([f({type:k.Any,context:0})],Un.prototype,"bagValue",void 0),u([f({type:$n,repeated:"set",optional:!0})],Un.prototype,"bagAttributes",void 0);let Zl=Zs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Zs.prototype)}};Zl=Zs=u([O({type:N.Sequence,itemType:Un})],Zl);var Xs,Qs,ea;const Xl="1.2.840.113549.1.9",Ql=`${Xl}.7`,ta=`${Xl}.14`;let Ln=class extends Ie{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:k.IA5String})],Ln.prototype,"ia5String",void 0),Ln=u([O({type:N.Choice})],Ln);let eu=class extends kr{};eu=u([O({type:N.Sequence})],eu);let tu=class extends Rn{};tu=u([O({type:N.Sequence})],tu);let ru=class extends Mn{};ru=u([O({type:N.Sequence})],ru);let ra=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.IA5String})],ra.prototype,"value",void 0),ra=u([O({type:N.Choice})],ra);let iu=class extends Ln{};iu=u([O({type:N.Choice})],iu);let nu=class extends Ie{};nu=u([O({type:N.Choice})],nu);let ia=class{constructor(t=new Date){this.value=t}};u([f({type:k.GeneralizedTime})],ia.prototype,"value",void 0),ia=u([O({type:N.Choice})],ia);let ou=class extends Ie{};ou=u([O({type:N.Choice})],ou);let na=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:k.PrintableString})],na.prototype,"value",void 0),na=u([O({type:N.Choice})],na);let Hn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.PrintableString})],Hn.prototype,"value",void 0),Hn=u([O({type:N.Choice})],Hn);let su=class extends Hn{};su=u([O({type:N.Choice})],su);let au=class extends Ie{};au=u([O({type:N.Choice})],au);let oa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.ObjectIdentifier})],oa.prototype,"value",void 0),oa=u([O({type:N.Choice})],oa);let cu=class extends Te{};cu=u([O({type:N.Choice})],cu);let sa=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:k.Integer})],sa.prototype,"value",void 0),sa=u([O({type:N.Choice})],sa);let lu=class extends At{};lu=u([O({type:N.Sequence})],lu);let Fn=class extends Ie{};Fn=u([O({type:N.Choice})],Fn);let uu=Xs=class extends Wt{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};uu=Xs=u([O({type:N.Sequence})],uu);let du=Qs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Qs.prototype)}};du=Qs=u([O({type:N.Set,itemType:mr})],du);let aa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.BmpString})],aa.prototype,"value",void 0),aa=u([O({type:N.Choice})],aa);let ca=class extends U{};ca=u([O({type:N.Sequence})],ca);let fu=ea=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};fu=ea=u([O({type:N.Sequence,itemType:ca})],fu);var la;let Kn=la=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,la.prototype)}};Kn=la=u([O({type:N.Sequence,itemType:kt})],Kn);class Or{constructor(t={}){this.version=0,this.subject=new ke,this.subjectPKInfo=new Ct,this.attributes=new Kn,Object.assign(this,t)}}u([f({type:k.Integer})],Or.prototype,"version",void 0),u([f({type:ke})],Or.prototype,"subject",void 0),u([f({type:Ct})],Or.prototype,"subjectPKInfo",void 0),u([f({type:Kn,implicit:!0,context:0})],Or.prototype,"attributes",void 0);class hi{constructor(t={}){this.certificationRequestInfo=new Or,this.signatureAlgorithm=new U,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Or})],hi.prototype,"certificationRequestInfo",void 0),u([f({type:U})],hi.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],hi.prototype,"signature",void 0);/*!
|
|
91
91
|
* MIT License
|
|
92
92
|
*
|
|
93
93
|
* Copyright (c) Peculiar Ventures. All rights reserved.
|
|
@@ -110,39 +110,39 @@ ${t.join(`
|
|
|
110
110
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
111
111
|
* SOFTWARE.
|
|
112
112
|
*
|
|
113
|
-
*/const qn="crypto.algorithm";class
|
|
114
|
-
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[ce.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ce.NAME]}:${s}`),o=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${o}${d}${l}`);else if(l instanceof Date)i.push(`${o}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const p of l)p[ce.NAME]=c,i.push(...this.serializeObj(p,r));else if(l instanceof ce)l[ce.NAME]=c,i.push(...this.serializeObj(l,r));else if(V.isBufferSource(l))c?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const p=l.toTextObject();p[ce.NAME]=c,i.push(...this.serializeObj(p,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(t,r=0){const i=this.pad(r),o=V.toUint8Array(t),s=[];for(let a=0;a<o.length;){const c=[];for(let l=0;l<16&&a<o.length;l++){l===8&&c.push("");const d=o[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${i}${c.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}er.oidSerializer=Tt,er.algorithmSerializer=
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?p.value.ia5String=c:jt.isASCII(c)?p.value.printableString=c:p.value.utf8String=c}s==="+"?r[r.length-1].push(p):r.push(new fr([p])),s=d}return r}fromJSON(t){const r=new ke;for(const i of t){const o=new fr;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new
|
|
116
|
-
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:V.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),o=[];if(o.push(`-----BEGIN ${i}-----`),!((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=
|
|
117
|
-
`)}}We.CertificateTag="CERTIFICATE",We.CrlTag="CRL",We.CertificateRequestTag="CERTIFICATE REQUEST",We.PublicKeyTag="PUBLIC KEY",We.PrivateKeyTag="PRIVATE KEY";class Bt extends Vt{static isAsnEncoded(t){return V.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(We.isPem(t))return We.decode(t)[0];if(M.isHex(t))return M.FromHex(t);if(M.isBase64(t))return M.FromBase64(t);if(M.isBase64Url(t))return M.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=M.ToBinary(t);return We.isPem(r)?We.decode(r)[0]:M.isHex(r)?M.FromHex(r):M.isBase64(r)?M.FromBase64(r):M.isBase64Url(r)?M.FromBase64Url(r):V.toArrayBuffer(t)}}constructor(...t){Bt.isAsnEncoded(t[0])?super(Bt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return We.encode(this.rawData,this.tag);default:return super.toString(t)}}}class rr extends Bt{constructor(t){Bt.isAsnEncoded(t)?super(t,Ct):super(t),this.tag=We.PublicKeyTag}async export(...t){let r,i=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,i=t[1]||i,r=t[2]||ze.get()):r=t[0]||ze.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=Xe.resolve(zn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Nr:{const o=L.parse(t.subjectPublicKey,Ms),s=V.toUint8Array(o.modulus);i.publicExponent=V.toUint8Array(o.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||ze.get()):i=t[0]||ze.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=ze.get());const r=L.parse(this.rawData,Ct);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=L.parse(this.rawData,Ct);switch(t.Algorithm=er.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case li:t["EC Point"]=r.subjectPublicKey;break;case Nr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class ft{static register(t,r){this.items.set(t,r)}static create(t){const r=new dt(t),i=this.items.get(r.type);return i?new i(t):r}}ft.items=new Map;const Jn="crypto.signatureFormatter";class _h{toAsnSignature(t,r){return V.toArrayBuffer(r)}toWebSignature(t,r){return V.toArrayBuffer(r)}}class Yn extends Bt{constructor(t){Bt.isAsnEncoded(t)?super(t,mr):super(t),this.tag=We.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=L.serialize(r),this.serialNumber=M.ToHex(r.serialNumber),this.subjectName=new jt(r.subject),this.subject=new jt(r.subject).toString(),this.issuerName=new jt(r.issuer),this.issuer=this.issuerName.toString();const i=Xe.resolve(zn);this.signatureAlgorithm=i.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=>ft.create(L.serialize(a)))),this.publicKey=new rr(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=ze.get()){let i,o;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(i,["verify"],r);else if(s instanceof rr)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(V.isBufferSource(s)){const d=new rr(s);i={...d.algorithm,...this.signatureAlgorithm},o=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=Xe.resolveAll(Jn).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,o,c,this.tbs);if(t.signatureOnly)return l;{const p=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<p&&p<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=ze.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=ze.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=L.parse(this.rawData,mr),i=r.tbsCertificate,o=new ce("",{Version:`${yr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":er.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ce("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(o["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(o["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ce("");for(const a of this.extensions){const c=a.toTextObject();s[c[ce.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ce("",{Algorithm:er.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}Yn.NAME="Certificate";class wi extends dt{static async create(t,r=!1,i=ze.get()){if(t instanceof Yn||tr.isCryptoKey(t)){const o=t instanceof Yn?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new rr(s).getKeyIdentifier(i);return new wi(M.ToHex(c),r)}else return new wi(t,r)}constructor(...t){if(V.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Wt({keyIdentifier:new jo(M.FromHex(t[0]))});super(Vo,t[1],L.serialize(r))}else{const r=t[0],i=r.name instanceof mi?L.parse(r.name.rawData,De):r.name,o=new Wt({authorityCertIssuer:i,authorityCertSerialNumber:M.FromHex(r.serialNumber)});super(Vo,t[1],L.serialize(o))}}onInit(t){super.onInit(t);const r=L.parse(t.extnValue,Wt);r.keyIdentifier&&(this.keyId=M.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:M.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=L.parse(this.value,Wt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new mi(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}wi.NAME="Authority Key Identifier";class Xu extends dt{constructor(...t){if(V.isBufferSource(t[0])){super(t[0]);const r=L.parse(this.value,Ji);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new Ji({cA:t[0],pathLenConstraint:t[1]});super(tl,t[2],L.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}}Xu.NAME="Basic Constraints";var Qu;(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"})(Qu||(Qu={}));class ed extends dt{constructor(...t){if(V.isBufferSource(t[0])){super(t[0]);const r=L.parse(this.value,en);this.usages=r.map(i=>i)}else{const r=new en(t[0]);super(al,t[1],L.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Tt.toString(r)).join(", "),t}}ed.NAME="Extended Key Usages";var ga;(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"})(ga||(ga={}));class ba extends dt{constructor(...t){if(V.isBufferSource(t[0])){super(t[0]);const r=L.parse(this.value,Jo);this.usages=r.toNumber()}else{const r=new Jo(t[0]);super(ll,t[1],L.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=L.parse(this.value,Jo);return t[""]=r.toJSON().join(", "),t}}ba.NAME="Key Usages";class Zn extends dt{static async create(t,r=!1,i=ze.get()){let o;t instanceof rr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:V.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new rr(o).getKeyIdentifier(i);return new Zn(M.ToHex(a),r)}constructor(...t){if(V.isBufferSource(t[0])){super(t[0]);const r=L.parse(this.value,_t);this.keyId=M.ToHex(r)}else{const r=typeof t[0]=="string"?M.FromHex(t[0]):t[0],i=new _t(r);super(yl,t[1],L.serialize(i)),this.keyId=M.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=L.parse(this.value,_t);return t[""]=r,t}}Zn.NAME="Subject Key Identifier";class wa extends dt{constructor(...t){V.isBufferSource(t[0])?super(t[0]):super(pl,t[1],new mi(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=L.parse(t.extnValue,es);this.names=new mi(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}wa.NAME="Subject Alternative Name";class td extends dt{constructor(...t){var r;if(V.isBufferSource(t[0])){super(t[0]);const i=L.parse(this.value,Xi);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new Xi(i.map(a=>new Zi({policyIdentifier:a})));super(il,o,L.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ce("",{},Tt.toString(r))),t}}td.NAME="Certificate Policies",ft.register(il,td);class Vr extends Vt{constructor(...t){let r;if(V.isBufferSource(t[0]))r=V.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>V.toArrayBuffer(s)):[];r=L.serialize(new kt({type:i,values:o}))}super(r,kt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ce("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ce.NAME]===Vr.NAME&&(t[ce.NAME]=Tt.toString(this.type)),t}}Vr.NAME="Attribute";class rd extends Vr{constructor(...t){var r;if(V.isBufferSource(t[0]))super(t[0]);else{const i=new Fn({printableString:t[0]});super(Ql,[L.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=L.parse(this.values[0],Fn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ce.VALUE]=this.password,t}}rd.NAME="Challenge Password";class va extends Vr{constructor(...t){var r;if(V.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new Gt;for(const s of i)o.push(L.parse(s.rawData,it));super(ta,[L.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=L.parse(this.values[0],Gt);this.items=r.map(i=>ft.create(L.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ce.NAME]]=i;return t}}va.NAME="Extensions";class Xn{static register(t,r){this.items.set(t,r)}static create(t){const r=new Vr(t),i=this.items.get(r.type);return i?new i(t):r}}Xn.items=new Map;let ka=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 U({algorithm:In,parameters:null});case"sha-256":return new U({algorithm:Ds,parameters:null});case"sha-384":return new U({algorithm:En,parameters:null});case"sha-512":return new U({algorithm:Nn,parameters:null})}}else return new U({algorithm:Nr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Nr:return{name:"RSASSA-PKCS1-v1_5"};case In:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Ds:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case En:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Nn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};ka=u([qs()],ka),Xe.registerSingleton(qn,ka);class Qe{addPadding(t,r){const i=V.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=V.toUint8Array(t);for(let o=0;o<i.length;o++)if(i[o]){i=i.slice(o);break}if(r&&i[0]>127){const o=new Uint8Array(i.length+1);return o.set(i,1),o.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,o=Qe.namedCurveSize.get(i)||Qe.defaultNamedCurveSize,s=new Bn,a=V.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),L.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=L.parse(r,Bn),o=t.namedCurve,s=Qe.namedCurveSize.get(o)||Qe.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return zf(a,c)}return null}}Qe.namedCurveSize=new Map,Qe.defaultNamedCurveSize=32;const id="1.3.101.110",nd="1.3.101.111",od="1.3.101.112",sd="1.3.101.113";let Ca=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=od;break;case"ed448":r=sd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=id;break;case"x448":r=nd;break}}return r?new U({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case od:return{name:"EdDSA",namedCurve:"Ed25519"};case sd:return{name:"EdDSA",namedCurve:"Ed448"};case id:return{name:"ECDH-ES",namedCurve:"X25519"};case nd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ca=u([qs()],Ca),Xe.registerSingleton(qn,Ca);class Oh extends Bt{constructor(t){Bt.isAsnEncoded(t)?super(t,hi):super(t),this.tag=We.CertificateRequestTag}onInit(t){this.tbs=L.serialize(t.certificationRequestInfo),this.publicKey=new rr(t.certificationRequestInfo.subjectPKInfo);const r=Xe.resolve(zn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>Xn.create(L.serialize(o)));const i=this.getAttribute(ta);this.extensions=[],i instanceof va&&(this.extensions=i.items),this.subjectName=new jt(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=ze.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=Xe.resolveAll(Jn).reverse();let s=null;for(const c of o)if(s=c.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,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=L.parse(this.rawData,hi),i=r.certificationRequestInfo,o=new ce("",{Version:`${yr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ce("");for(const a of this.attributes){const c=a.toTextObject();s[c[ce.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ce("",{Algorithm:er.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Oh.NAME="PKCS#10 Certificate Request";var ad;(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"})(ad||(ad={})),ft.register(tl,Xu),ft.register(al,ed),ft.register(ll,ba),ft.register(yl,Zn),ft.register(Vo,wi),ft.register(pl,wa),Xn.register(Ql,rd),Xn.register(ta,va),Xe.registerSingleton(Jn,_h),Xe.registerSingleton(Jn,Qe),Qe.namedCurveSize.set("P-256",32),Qe.namedCurveSize.set("K-256",32),Qe.namedCurveSize.set("P-384",48),Qe.namedCurveSize.set("P-521",66);function cd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new Yn(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof wa){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const p=d.type,y=l[p]??[];return{...l,[p]:[...y,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof ba){const s=Object.values(ga),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const p=s[s.length/2+d];if(o.usages&p){const y=s[d];c.push(y)}return c},[]);i.keyUsage=a}return i}}}function Th(){const e=cd(),t=n.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 Vh={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"},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 jh(){const e=ar.createI18n("en-us",Vh);return{i18n:e,i18nT:ar.i18nTComponent(e)}}const pt={useCertificate:Th,useI18n:jh,useX509:cd},vi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}},Dh={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ph="Copy to clipboard",$h={message:Dh,iconTitle:Ph},Rh="kong-ui-copy-uuid-notify",Mh={class:"kong-ui-copy-uuid"},Uh=["onClick"],ld=15,Lh=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const r=e,{t:i}=ar.createI18n("en-us",$h),o=r.notify||n.inject(Rh,()=>{}),s=n.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),a=n.computed(()=>!!(r.tooltip&&r.successTooltip)),c=n.ref(r.tooltip),l=n.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=n.computed(()=>{var x;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(x=r.uuid)==null?void 0:x.substring(0,5)}`:r.uuid}),p=x=>{c.value=x,setTimeout(()=>{c.value=r.tooltip},1800)},y=x=>{var C,h;if(!x(r.uuid)){typeof o=="function"&&o({type:"error",message:i("message.fail")}),a.value?p(i("message.fail")):t("error",r.uuid);return}const m=((C=r.uuid)==null?void 0:C.length)>ld,b=r.format==="hidden"||r.format==="redacted"?i("message.success.prefix"):`"${((h=r.uuid)==null?void 0:h.substring(0,ld))+(m?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${b}${i("message.success.content")}`}),a.value?p(r.successTooltip):t("success",r.uuid)};return(x,C)=>{const h=n.resolveComponent("KIcon"),m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Mh,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(d.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(l.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:b})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(v=>y(b),["stop"])},[n.createVNode(h,{class:"uuid-icon",color:e.iconColor,"hide-title":!!e.tooltip||void 0,icon:"copy",size:"16",title:n.unref(i)("iconTitle")},null,8,["color","hide-title","title"])],8,Uh)]),_:1})]),_:1},16))])}}}),Hh=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Fh=Hh(Lh,[["__scopeId","data-v-a2ebe0bb"]]);var Sa=(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))(Sa||{}),ir=(e=>(e.Edit="edit",e.Create="create",e))(ir||{}),Dt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Dt||{}),ne=(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.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ne||{}),le=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(le||{});function xa(e={}){return{axiosInstance:Lf.create({withCredentials:!0,timeout:3e4,...e})}}function Kh(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Aa="khcp-user-table-preferences",qh={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function zh(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Aa));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=t();o.set(r,i),localStorage.setItem(Aa,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||qh},deleteAllTablePreferences:()=>{localStorage.removeItem(Aa)}}}const Wh={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Gh={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Jh={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Yh={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Zh={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"}},Xh={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Qh={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ey={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},ty={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"}},ry={global:Wh,deleteModal:Gh,baseForm:Jh,baseTable:Yh,baseConfigCard:Zh,filter:Xh,debouncedFilter:Qh,errors:ey,toggleModal:ty};function Ba(){const e=ar.createI18n("en-us",ry);return{i18n:e,i18nT:ar.i18nTComponent(e)}}function ud(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const s of o){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(s=i[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 iy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=xa({headers:e.requestHeaders}),{i18n:{t:s}}=Ba(),{debounce:a}=Kh(),c=a(async A=>{await g(A)},200),l=n.ref(!1),d=n.ref(""),p=n.ref(""),y=n.ref([]),x=n.ref([]),C=n.ref(void 0),h=n.unref(t);let m=`${e.apiBaseUrl}${h}`;e.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:b}=ud(),v=async()=>{try{l.value=!0;const{data:A}=await o.get(`${m}?size=${r}`);A!=null&&A.next||(C.value=i.fetchedItemsKey in A?A[i.fetchedItemsKey]:[]),x.value=i.fetchedItemsKey in A?A[i.fetchedItemsKey]:[],y.value=x.value}catch{y.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},w=n.ref(""),g=async A=>{var J,X,I;if(w.value!==A)if(w.value=A||"",C.value===void 0)try{if(l.value=!0,d.value="",p.value="",e.app==="konnect"){let E=m+"";A&&(E+=`/${A}`);const{data:$}=await o.get(`${E}?size=${r}`);i.fetchedItemsKey in $?y.value=$[i.fetchedItemsKey]:$!=null&&$.id?y.value=[$]:y.value=[]}else if(A){const E=[];b(A)&&i.searchKeys.includes("id")?E.push((async()=>{const{data:H}=await o.get(`${m}/${A}`);return[H[i.fetchedItemsKey]??H]})()):E.push(...i.searchKeys.filter(H=>H!=="id").map(async H=>{const{data:D}=await o.get(`${m}?${H}=${A}`);return D[i.fetchedItemsKey]}));const $=await Promise.all(E),R=new Set;y.value=[],(J=$==null?void 0:$.forEach)==null||J.call($,H=>{var D;(D=H==null?void 0:H.forEach)==null||D.call(H,j=>{R.has(j.id)||(R.add(j.id),y.value.push(j))})})}else y.value=x.value}catch(E){((X=E==null?void 0:E.response)==null?void 0:X.status)===404?p.value=s("debouncedFilter.errors.invalid"):(y.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,p.value="",A?(y.value=(I=C.value)==null?void 0:I.filter(E=>{var $;let R=!1;for(const H of i.searchKeys){const D=typeof E[H]=="string"?($=E[H])==null?void 0:$.toLowerCase():E[H];D!=null&&D.includes(A.toLowerCase())&&(R=!0)}return R}),(!y.value||!y.value.length)&&(p.value=s("debouncedFilter.errors.invalid"))):y.value=C.value,l.value=!1};return{loading:l,error:d,validationError:p,results:y,allRecords:C,loadItems:v,debouncedQueryChange:c}}function ny(e,t){const r=n.unref(t),i=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function oy(){const{i18n:{t:e}}=Ba();return{getMessageFromError:t=>{var r,i,o;if(!t)return e("errors.unexpected");if((r=t==null?void 0:t.response)!=null&&r.data){if(t.response.data.detail)return t.response.data.detail;if((i=t.response.data.details)!=null&&i.length)return t.response.data.details.map(s=>{let a=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(a=s.messages.join(", ")),s.field?`${s.field} - ${a}`:a}).join("; ");if(t.response.data.message){const{message:s}=t.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(s=>`${s} ${t.response.data[s]}`).join(", ")}return t.message||e("errors.unexpected")}}}function sy(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),o=`${r}${i}`,s=e.some(a=>a.trim()==="");if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(o)&&!s&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function dd(e,t){const r=n.ref(n.unref(e)),i=n.ref(n.unref(t)),o=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:p,sortColumnOrder:y,query:x}=a;try{let C=new URL(s.value.href);return o.value&&x?(C.search="",C=new URL(`${C.href}/${x}/`)):(o.value||new URLSearchParams(x).forEach((h,m)=>{C.searchParams.append(m,h)}),p&&C.searchParams.append("sort_by",p),y==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(l))),d&&c!==1&&C.searchParams.append("offset",String(d)),C.href}catch(C){return console.error("RouteList(fetcher)",C),i.value}}}function ay(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=xa({headers:e.requestHeaders}),s=dd(e,i),a=n.ref({status:Dt.Idle});return{fetcher:async c=>{try{a.value={status:Dt.Loading};const l=s(c),{data:d}=await o.get(l),p=r&&r.replace(/[^\w-_]/gi,"");let y;d[p]&&Array.isArray(d[p])?y=d[p]:y=Object.keys(d).length?[d]:[];const x={data:y,total:y.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Dt.Idle,response:x},x}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Dt.NoResults,response:d,error:l},d):(a.value={status:Dt.Error,response:d,error:l},d)}},fetcherState:a}}function cy(){const e=(r,i="_")=>r?r.split(i).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,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const fd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,pd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(fd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},hd=e=>e==="*"||e==="x"||e==="X",yd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},ly=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],uy=(e,t)=>{if(hd(e)||hd(t))return 0;const[r,i]=ly(yd(e),yd(t));return r>i?1:r<i?-1:0},md=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=uy(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},dy=(e,t)=>{const r=pd(e),i=pd(t),o=r.pop(),s=i.pop(),a=md(r,i);return a!==0?a:o&&s?md(o.split("."),s.split(".")):o||s?o?-1:1:0},gd=(e,t,r)=>{fy(r);const i=dy(e,t);return bd[r].includes(i)},bd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},wd=Object.keys(bd),fy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(wd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${wd.join("|")}`)},py=e=>typeof e=="string"&&/^[v\d]/.test(e)&&fd.test(e);function hy(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!py(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&gd(o,a,"<")||c&&gd(o,c,">"))}function yy(e){const t=n.ref(0),r=n.ref(0),i=n.ref(!1);return n.watch(e,o=>{o&&!i.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const my=new Fa.ToastManager;function gy(){return{notify:async e=>{const t={appearance:"success",message:"Success",timeoutMilliseconds:3e3};my.open({...t,...e})}}}const Ae={useAxios:xa,useDebouncedFilter:iy,useDeleteUrlBuilder:ny,useErrors:oy,useExternalLinkCreator:sy,useFetcher:ay,useFetchUrlBuilder:dd,useHelpers:ud,useStringHelpers:cy,useI18n:Ba,useGatewayFeatureSupported:hy,useTruncationDetector:yy,useToaster:gy},by={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},wy="Copy to clipboard",vy={message:by,iconTitle:wy},ky="kong-ui-copy-uuid-notify",Cy={class:"kong-ui-copy-uuid"},Sy=["onClick"],vd=15,xy=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const r=e,{t:i}=ar.createI18n("en-us",vy),o=r.notify||n.inject(ky,()=>{}),s=n.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),a=n.computed(()=>!!(r.tooltip&&r.successTooltip)),c=n.ref(r.tooltip),l=n.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=n.computed(()=>{var x;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(x=r.uuid)==null?void 0:x.substring(0,5)}`:r.uuid}),p=x=>{c.value=x,setTimeout(()=>{c.value=r.tooltip},1800)},y=x=>{var C,h;if(!x(r.uuid)){typeof o=="function"&&o({type:"error",message:i("message.fail")}),a.value?p(i("message.fail")):t("error",r.uuid);return}const m=((C=r.uuid)==null?void 0:C.length)>vd,b=r.format==="hidden"||r.format==="redacted"?i("message.success.prefix"):`"${((h=r.uuid)==null?void 0:h.substring(0,vd))+(m?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${b}${i("message.success.content")}`}),a.value?p(r.successTooltip):t("success",r.uuid)};return(x,C)=>{const h=n.resolveComponent("KIcon"),m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Cy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(d.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(l.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:b})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(v=>y(b),["stop"])},[n.createVNode(h,{class:"uuid-icon",color:e.iconColor,"hide-title":!!e.tooltip||void 0,icon:"copy",size:"16",title:n.unref(i)("iconTitle")},null,8,["color","hide-title","title"])],8,Sy)]),_:1})]),_:1},16))])}}}),Ay=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},kd=Ay(xy,[["__scopeId","data-v-a2ebe0bb"]]),By={key:0,class:"config-card-fieldset-title"},Iy=n.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}}=Ae.useI18n(),{convertKeyToTitle:i}=Ae.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=n.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:n.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:n.withCtx(()=>[e.isArrayItem?(n.openBlock(),n.createElementBlock("legend",By,[n.createElementVNode("b",null,n.toDisplayString(c.value),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(a.value),(p,y)=>(n.openBlock(),n.createBlock(ki,{key:`${o.value}-property-${y}`,item:{key:p,label:n.unref(i)(p),value:a.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ot=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Cd=ot(Iy,[["__scopeId","data-v-68ca83ec"]]),Ey=ot(n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ae.useI18n();return(r,i)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(o,{appearance:"btn-link",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.value||n.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-7410504d"]]),Ny=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ae.useI18n();return(r,i)=>{const o=n.resolveComponent("KBadge");return n.openBlock(),n.createBlock(o,{appearance:e.status?"success":"neutral"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.status?n.unref(t)("baseConfigCard.statusBadge.enabledLabel"):n.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),_y="#0044f4",Oy="#e0e4ea",Ty="#3a3f51",Vy="1px",jy="20px",Dy={class:"config-card-details-row"},Py=["data-testid"],$y=["data-testid"],Ry=["data-testid"],My=["data-testid"],Uy={key:1},Ly=["data-testid"],Hy=["data-testid"],Fy=["data-testid"],Ky=["data-testid"],qy={name:"ConfigCardItem",components:{CopyUuid:kd,JsonCardItem:Cd,StatusBadge:Ny,InternalLinkItem:Ey}},zy=n.defineComponent({...qy,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}){const r=e;n.useCssVars(C=>({"1df60db4":d.value?"none":`solid ${n.unref(Vy)} ${n.unref(Oy)}`,"21d1d34e":l.value&&a.value?"block":"flex","4d3dc7e7":l.value&&a.value?"100%":r.slim?"50%":"25%","4d400dc2":l.value&&a.value?"100%":r.slim?"50%":"75%"}));const i=n.useSlots(),{i18n:{t:o,formatUnixTimeStamp:s}}=Ae.useI18n(),a=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=n.computed(()=>!!(r.item.tooltip||i["label-tooltip"])),l=n.computed(()=>r.item.type===ne.Json||r.item.type===ne.JsonArray),d=n.computed(()=>r.item.type===ne.JsonArray),p=n.computed(()=>{switch(r.item.type){case ne.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case ne.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case ne.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case ne.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case ne.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:s(r.item.value)};case ne.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ne.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ne.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ne.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:C=>{t("navigation-click",C)}}};case ne.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ne.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ne.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}}}),y=n.ref(),{isTruncated:x}=Ae.useTruncationDetector(y);return(C,h)=>{const m=n.resolveComponent("KLabel"),b=n.resolveComponent("KBadge"),v=n.resolveComponent("KMethodBadge"),w=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",Dy,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(C.$slots,"label",{item:e.item},()=>[n.createVNode(m,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(C.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,$y)]),key:"0"}:void 0]),1024)],!0)],8,Py),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(C.$slots,e.item.key,{rowValue:e.item.value},()=>[a.value?(n.openBlock(),n.createElementBlock("div",Uy,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value.tag),n.normalizeProps(n.guardReactiveProps(p.value.attrs)),{default:n.withCtx(()=>[p.value.additionalComponent==="KBadge"?(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(g,A)=>(n.openBlock(),n.createBlock(b,{key:`${e.item.key}-badge-tag-${A}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${A}`,"truncation-tooltip":g},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,Ly)):n.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(g,A)=>(n.openBlock(),n.createBlock(n.unref(kd),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${A}`,"data-testid":`${e.item.key}-copy-uuid-${A}`,uuid:g}),null,16,["data-testid","uuid"]))),128))],8,Hy)):p.value.additionalComponent==="KMethodBadge"?(n.openBlock(),n.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(g,A)=>(n.openBlock(),n.createBlock(v,{key:`${e.item.key}-badge-method-${A}`,class:"config-badge","data-testid":`${e.item.key}-badge-method-${A}`,"is-rounded":"",label:g,method:n.unref(Fa.MethodsArray).includes(g.toLowerCase())?g.toLowerCase():"custom"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,Fy)):n.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(n.openBlock(),n.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(g,A)=>(n.openBlock(),n.createBlock(Cd,{key:`json-array-item-${A}`,index:A,"is-array-item":"",item:g},null,8,["index","item"]))),128))],8,Ky)):(n.openBlock(),n.createBlock(w,{key:4,label:n.unref(x)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:y,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,My))],!0)],8,Ry)])}}}),ki=ot(zy,[["__scopeId","data-v-307ab96d"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Sd(e){return typeof e>"u"||e===null}function Wy(e){return typeof e=="object"&&e!==null}function Gy(e){return Array.isArray(e)?e:Sd(e)?[]:[e]}function Jy(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}function Yy(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function Zy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Xy=Sd,Qy=Wy,em=Gy,tm=Yy,rm=Zy,im=Jy,Se={isNothing:Xy,isObject:Qy,toArray:em,repeat:tm,isNegativeZero:rm,extend:im};function xd(e,t){var r="",i=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+=`
|
|
113
|
+
*/const qn="crypto.algorithm";class vh{getAlgorithms(){return Xe.resolveAll(qn)}toAsnAlgorithm(t){({...t});for(const r of this.getAlgorithms()){const i=r.toAsnAlgorithm(t);if(i)return i}if(/^[0-9.]+$/.test(t.name)){const r=new U({algorithm:t.name});if("parameters"in t){const i=t;r.parameters=i.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const i of this.getAlgorithms()){const o=i.toWebAlgorithm(t);if(o)return o}return{name:t.algorithm,parameters:t.parameters}}}const zn="crypto.algorithmProvider";Xe.registerSingleton(zn,vh);var Gn;const Le="1.3.36.3.3.2.8.1.1",pu=`${Le}.1`,hu=`${Le}.2`,yu=`${Le}.3`,gu=`${Le}.4`,mu=`${Le}.5`,bu=`${Le}.6`,wu=`${Le}.7`,vu=`${Le}.8`,ku=`${Le}.9`,Cu=`${Le}.10`,Su=`${Le}.11`,xu=`${Le}.12`,Au=`${Le}.13`,Bu=`${Le}.14`,Iu="brainpoolP160r1",Eu="brainpoolP160t1",Nu="brainpoolP192r1",_u="brainpoolP192t1",Ou="brainpoolP224r1",Tu="brainpoolP224t1",Vu="brainpoolP256r1",ju="brainpoolP256t1",Du="brainpoolP320r1",Pu="brainpoolP320t1",$u="brainpoolP384r1",Mu="brainpoolP384t1",Ru="brainpoolP512r1",Uu="brainpoolP512t1",me="ECDSA";let yi=Gn=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case me.toLowerCase():if("hash"in t)switch((typeof t.hash=="string"?t.hash:t.hash.name).toLowerCase()){case"sha-1":return Kp;case"sha-256":return qp;case"sha-384":return zp;case"sha-512":return Gp}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Al;break;case"K-256":r=Gn.SECP256K1;break;case"P-384":r=Bl;break;case"P-521":r=Il;break;case Iu:r=pu;break;case Eu:r=hu;break;case Nu:r=yu;break;case _u:r=gu;break;case Ou:r=mu;break;case Tu:r=bu;break;case Vu:r=wu;break;case ju:r=vu;break;case Du:r=ku;break;case Pu:r=Cu;break;case $u:r=Su;break;case Mu:r=xu;break;case Ru:r=Au;break;case Uu:r=Bu;break}if(r)return new U({algorithm:li,parameters:L.serialize(new Er({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Os:return{name:me,hash:{name:"SHA-1"}};case Ts:return{name:me,hash:{name:"SHA-256"}};case Vs:return{name:me,hash:{name:"SHA-384"}};case js:return{name:me,hash:{name:"SHA-512"}};case li:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(L.parse(t.parameters,Er).namedCurve){case Al:return{name:me,namedCurve:"P-256"};case Gn.SECP256K1:return{name:me,namedCurve:"K-256"};case Bl:return{name:me,namedCurve:"P-384"};case Il:return{name:me,namedCurve:"P-521"};case pu:return{name:me,namedCurve:Iu};case hu:return{name:me,namedCurve:Eu};case yu:return{name:me,namedCurve:Nu};case gu:return{name:me,namedCurve:_u};case mu:return{name:me,namedCurve:Ou};case bu:return{name:me,namedCurve:Tu};case wu:return{name:me,namedCurve:Vu};case vu:return{name:me,namedCurve:ju};case ku:return{name:me,namedCurve:Du};case Cu:return{name:me,namedCurve:Pu};case Su:return{name:me,namedCurve:$u};case xu:return{name:me,namedCurve:Mu};case Au:return{name:me,namedCurve:Ru};case Bu:return{name:me,namedCurve:Uu}}}}return null}};yi.SECP256K1="1.3.132.0.10",yi=Gn=u([qs()],yi),Xe.registerSingleton(qn,yi);const Lu=Symbol("name"),Hu=Symbol("value");class ce{constructor(t,r={},i=""){this[Lu]=t,this[Hu]=i;for(const o in r)this[o]=r[o]}}ce.NAME=Lu,ce.VALUE=Hu;class kh{static toTextObject(t){const r=new ce("Algorithm Identifier",{},Tt.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case li:{const i=new yi().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class Tt{static toString(t){const r=this.items[t];return r||t}}Tt.items={[_l]:"sha1",[Ol]:"sha224",[Tl]:"sha256",[Vl]:"sha384",[jl]:"sha512",[Nr]:"rsaEncryption",[In]:"sha1WithRSAEncryption",[Qp]:"sha224WithRSAEncryption",[Ds]:"sha256WithRSAEncryption",[En]:"sha384WithRSAEncryption",[Nn]:"sha512WithRSAEncryption",[li]:"ecPublicKey",[Os]:"ecdsaWithSHA1",[xl]:"ecdsaWithSHA224",[Ts]:"ecdsaWithSHA256",[Vs]:"ecdsaWithSHA384",[js]:"ecdsaWithSHA512",[$p]:"TLS WWW server authentication",[Mp]:"TLS WWW client authentication",[Rp]:"Code Signing",[Up]:"E-mail Protection",[Lp]:"Time Stamping",[Hp]:"OCSP Signing",[Fp]:"Signed Data"};class er{static serialize(t){return this.serializeObj(t).join(`
|
|
114
|
+
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[ce.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ce.NAME]}:${s}`),o=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${o}${d}${l}`);else if(l instanceof Date)i.push(`${o}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const p of l)p[ce.NAME]=c,i.push(...this.serializeObj(p,r));else if(l instanceof ce)l[ce.NAME]=c,i.push(...this.serializeObj(l,r));else if(V.isBufferSource(l))c?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const p=l.toTextObject();p[ce.NAME]=c,i.push(...this.serializeObj(p,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(t,r=0){const i=this.pad(r),o=V.toUint8Array(t),s=[];for(let a=0;a<o.length;){const c=[];for(let l=0;l<16&&a<o.length;l++){l===8&&c.push("");const d=o[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${i}${c.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}er.oidSerializer=Tt,er.algorithmSerializer=kh;class Vt{constructor(...t){if(t.length===1){const r=t[0];this.rawData=L.serialize(r),this.onInit(r)}else{const r=L.parse(t[0],t[1]);this.rawData=V.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Vt?za(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return L.toString(this.rawData);case"text":return er.serialize(this.toTextObject());case"hex":return R.ToHex(this.rawData);case"base64":return R.ToBase64(this.rawData);case"base64url":return R.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 ce(this.getTextName(),{},t)}}Vt.NAME="ASN";class dt extends Vt{constructor(...t){let r;V.isBufferSource(t[0])?r=V.toArrayBuffer(t[0]):r=L.serialize(new it({extnID:t[0],critical:t[1],extnValue:new ie(V.toArrayBuffer(t[2]))})),super(r,it)}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[ce.NAME]===dt.NAME&&(t[ce.NAME]=Tt.toString(this.type)),t}}var Fu;class tr{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[Fu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(tr.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=tr.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(tr.DEFAULT,t);return this}}Fu=Symbol.toStringTag,tr.DEFAULT="default";const ze=new tr,Ch=/^[0-2](?:\.[1-9][0-9]*)+$/;function Sh(e){return new RegExp(Ch).test(e)}class Ku{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Sh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const He=new Ku;He.register("CN","2.5.4.3"),He.register("L","2.5.4.7"),He.register("ST","2.5.4.8"),He.register("O","2.5.4.10"),He.register("OU","2.5.4.11"),He.register("C","2.5.4.6"),He.register("DC","0.9.2342.19200300.100.1.25"),He.register("E","1.2.840.113549.1.9.1"),He.register("G","2.5.4.42"),He.register("I","2.5.4.43"),He.register("SN","2.5.4.4"),He.register("T","2.5.4.12");function xh(e,t){return`\\${R.ToHex(R.FromUtf8String(t)).toUpperCase()}`}function Ah(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,xh)}class jt{static isASCII(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return!1;return!0}constructor(t,r={}){this.extraNames=new Ku,this.asn=new ke;for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)){const o=r[i];this.extraNames.register(i,o)}typeof t=="string"?this.asn=this.fromString(t):t instanceof ke?this.asn=t:V.isBufferSource(t)?this.asn=L.parse(t,ke):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||He.findId(t),i=[];for(const o of this.asn)for(const s of o)s.type===r&&i.push(s.value.toString());return i}getName(t){return this.extraNames.get(t)||He.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,o=r.value.anyValue?`#${R.ToHex(r.value.anyValue)}`:Ah(r.value.toString());return`${i}=${o}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const i of this.asn){const o={};for(const s of i){const a=this.getName(s.type)||s.type;(t=o[a])!==null&&t!==void 0||(o[a]=[]),o[a].push(s.value.anyValue?`#${R.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new ke,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=i.exec(`${t},`);){let[,a,c]=o;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),o[3]=l);const d=o[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const p=new Gr({type:a});if(c.charAt(0)==="#")p.value.anyValue=R.FromHex(c.slice(1));else{const y=/"(.*?[^\\])?"/.exec(c);y&&(c=y[1]),c=c.replace(/\\0a/ig,`
|
|
115
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?p.value.ia5String=c:jt.isASCII(c)?p.value.printableString=c:p.value.utf8String=c}s==="+"?r[r.length-1].push(p):r.push(new fr([p])),s=d}return r}fromJSON(t){const r=new ke;for(const i of t){const o=new fr;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Gr({type:a});if(typeof l=="object")for(const p in l)switch(p){case"ia5String":d.value.ia5String=l[p];break;case"utf8String":d.value.utf8String=l[p];break;case"universalString":d.value.universalString=l[p];break;case"bmpString":d.value.bmpString=l[p];break;case"printableString":d.value.printableString=l[p];break}else l[0]==="#"?d.value.anyValue=R.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return L.serialize(this.asn)}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||ze.get()):i=t[0]||ze.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const qu="Cannot initialize GeneralName from ASN.1 data.",zu=`${qu} Unsupported string format in use.`,Bh=`${qu} Value doesn't match to GUID regular expression.`,Gu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Wu="1.3.6.1.4.1.311.25.1",Ju="1.3.6.1.4.1.311.20.2.3",ua="dns",da="dn",fa="email",pa="ip",ha="url",ya="guid",ga="upn",Wn="id";class Yu extends Vt{constructor(...t){let r;if(t.length===2)switch(t[0]){case da:{const i=new jt(t[1]).toArrayBuffer(),o=L.parse(i,ke);r=new Z({directoryName:o});break}case ua:r=new Z({dNSName:t[1]});break;case fa:r=new Z({rfc822Name:t[1]});break;case ya:{const i=new RegExp(Gu,"i").exec(t[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=i.slice(1).map((s,a)=>a<3?R.ToHex(new Uint8Array(R.FromHex(s)).reverse()):s).join("");r=new Z({otherName:new Wr({typeId:Wu,value:L.serialize(new ie(R.FromHex(o)))})});break}case pa:r=new Z({iPAddress:t[1]});break;case Wn:r=new Z({registeredID:t[1]});break;case ga:{r=new Z({otherName:new Wr({typeId:Ju,value:L.serialize(Wc.toASN(t[1]))})});break}case ha:r=new Z({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else V.isBufferSource(t[0])?r=L.parse(t[0],Z):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=ua,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=fa,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=pa,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=ha,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=Wn,this.value=t.registeredID;else if(t.directoryName!=null)this.type=da,this.value=new jt(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===Wu){this.type=ya;const r=L.parse(t.otherName.value,ie),i=new RegExp(Gu,"i").exec(R.ToHex(r));if(!i)throw new Error(Bh);this.value=i.slice(1).map((o,s)=>s<3?R.ToHex(new Uint8Array(R.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===Ju)this.type=ga,this.value=L.parse(t.otherName.value,Ie).toString();else throw new Error(zu);else throw new Error(zu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case da:case ua:case ya:case pa:case Wn:case ga:case ha:t=this.type.toUpperCase();break;case fa:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===Wn&&(r=Tt.toString(r)),new ce(t,void 0,r)}}class gi extends Vt{constructor(t){let r;if(t instanceof De)r=t;else if(Array.isArray(t)){const i=[];for(const o of t)if(o instanceof Z)i.push(o);else{const s=L.parse(new Yu(o.type,o.value).rawData,Z);i.push(s)}r=new De(i)}else if(V.isBufferSource(t))r=L.parse(t,De);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let o=null;try{o=new Yu(i)}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 i=r.toTextObject();let o=t[i[ce.NAME]];Array.isArray(o)||(o=[],t[i[ce.NAME]]=o),o.push(i)}return t}}gi.NAME="GeneralNames";const mi="-{5}",bi="\\n",Ih=`[^${bi}]+`,Eh=`${mi}BEGIN (${Ih}(?=${mi}))${mi}`,Nh=`${mi}END \\1${mi}`,Tr="\\n",_h=`[^:${bi}]+`,Oh=`(?:[^${bi}]+${Tr}(?: +[^${bi}]+${Tr})*)`,Th=`(?:[a-zA-Z0-9=+/]+${Tr})+`,Zu=`${Eh}${Tr}(?:((?:${_h}: ${Oh})+))?${Tr}?(${Th})${Nh}`;class Ge{static isPem(t){return typeof t=="string"&&new RegExp(Zu,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(Zu,"g"),i=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${bi}]+`,"g"),""),a={type:o[1],headers:[],rawData:R.FromBase64(s)},c=o[2];if(c){const l=c.split(new RegExp(Tr,"g"));let d=null;for(const p of l){const[y,x]=p.split(/:(.*)/);if(x===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=y.trim()}else d&&a.headers.push(d),d={key:y,value:x.trim()}}d&&a.headers.push(d)}i.push(a)}return i}static decode(t){return this.decodeWithHeaders(t).map(i=>i.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 i=new Array;return r?t.forEach(o=>{if(!V.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:V.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");i.push(this.encodeStruct(o))}),i.join(`
|
|
116
|
+
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:V.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),o=[];if(o.push(`-----BEGIN ${i}-----`),!((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=R.ToBase64(t.rawData);let a,c=0;const l=Array();for(;c<s.length&&(s.length-c<64?a=s.substring(c):(a=s.substring(c,c+64),c+=64),a.length!==0);)if(l.push(a),a.length<64)break;return o.push(...l),o.push(`-----END ${i}-----`),o.join(`
|
|
117
|
+
`)}}Ge.CertificateTag="CERTIFICATE",Ge.CrlTag="CRL",Ge.CertificateRequestTag="CERTIFICATE REQUEST",Ge.PublicKeyTag="PUBLIC KEY",Ge.PrivateKeyTag="PRIVATE KEY";class Bt extends Vt{static isAsnEncoded(t){return V.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ge.isPem(t))return Ge.decode(t)[0];if(R.isHex(t))return R.FromHex(t);if(R.isBase64(t))return R.FromBase64(t);if(R.isBase64Url(t))return R.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=R.ToBinary(t);return Ge.isPem(r)?Ge.decode(r)[0]:R.isHex(r)?R.FromHex(r):R.isBase64(r)?R.FromBase64(r):R.isBase64Url(r)?R.FromBase64Url(r):V.toArrayBuffer(t)}}constructor(...t){Bt.isAsnEncoded(t[0])?super(Bt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ge.encode(this.rawData,this.tag);default:return super.toString(t)}}}class rr extends Bt{constructor(t){Bt.isAsnEncoded(t)?super(t,Ct):super(t),this.tag=Ge.PublicKeyTag}async export(...t){let r,i=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,i=t[1]||i,r=t[2]||ze.get()):r=t[0]||ze.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=Xe.resolve(zn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Nr:{const o=L.parse(t.subjectPublicKey,Rs),s=V.toUint8Array(o.modulus);i.publicExponent=V.toUint8Array(o.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||ze.get()):i=t[0]||ze.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=ze.get());const r=L.parse(this.rawData,Ct);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=L.parse(this.rawData,Ct);switch(t.Algorithm=er.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case li:t["EC Point"]=r.subjectPublicKey;break;case Nr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class ft{static register(t,r){this.items.set(t,r)}static create(t){const r=new dt(t),i=this.items.get(r.type);return i?new i(t):r}}ft.items=new Map;const Jn="crypto.signatureFormatter";class Vh{toAsnSignature(t,r){return V.toArrayBuffer(r)}toWebSignature(t,r){return V.toArrayBuffer(r)}}class Yn extends Bt{constructor(t){Bt.isAsnEncoded(t)?super(t,gr):super(t),this.tag=Ge.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=L.serialize(r),this.serialNumber=R.ToHex(r.serialNumber),this.subjectName=new jt(r.subject),this.subject=new jt(r.subject).toString(),this.issuerName=new jt(r.issuer),this.issuer=this.issuerName.toString();const i=Xe.resolve(zn);this.signatureAlgorithm=i.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=>ft.create(L.serialize(a)))),this.publicKey=new rr(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=ze.get()){let i,o;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(i,["verify"],r);else if(s instanceof rr)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(V.isBufferSource(s)){const d=new rr(s);i={...d.algorithm,...this.signatureAlgorithm},o=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=Xe.resolveAll(Jn).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,o,c,this.tbs);if(t.signatureOnly)return l;{const p=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<p&&p<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=ze.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=ze.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=L.parse(this.rawData,gr),i=r.tbsCertificate,o=new ce("",{Version:`${yr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":er.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ce("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(o["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(o["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ce("");for(const a of this.extensions){const c=a.toTextObject();s[c[ce.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ce("",{Algorithm:er.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}Yn.NAME="Certificate";class wi extends dt{static async create(t,r=!1,i=ze.get()){if(t instanceof Yn||tr.isCryptoKey(t)){const o=t instanceof Yn?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new rr(s).getKeyIdentifier(i);return new wi(R.ToHex(c),r)}else return new wi(t,r)}constructor(...t){if(V.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Gt({keyIdentifier:new jo(R.FromHex(t[0]))});super(Vo,t[1],L.serialize(r))}else{const r=t[0],i=r.name instanceof gi?L.parse(r.name.rawData,De):r.name,o=new Gt({authorityCertIssuer:i,authorityCertSerialNumber:R.FromHex(r.serialNumber)});super(Vo,t[1],L.serialize(o))}}onInit(t){super.onInit(t);const r=L.parse(t.extnValue,Gt);r.keyIdentifier&&(this.keyId=R.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:R.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=L.parse(this.value,Gt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new gi(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}wi.NAME="Authority Key Identifier";class Xu extends dt{constructor(...t){if(V.isBufferSource(t[0])){super(t[0]);const r=L.parse(this.value,Ji);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new Ji({cA:t[0],pathLenConstraint:t[1]});super(tl,t[2],L.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}}Xu.NAME="Basic Constraints";var Qu;(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"})(Qu||(Qu={}));class ed extends dt{constructor(...t){if(V.isBufferSource(t[0])){super(t[0]);const r=L.parse(this.value,en);this.usages=r.map(i=>i)}else{const r=new en(t[0]);super(al,t[1],L.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Tt.toString(r)).join(", "),t}}ed.NAME="Extended Key Usages";var ma;(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"})(ma||(ma={}));class ba extends dt{constructor(...t){if(V.isBufferSource(t[0])){super(t[0]);const r=L.parse(this.value,Jo);this.usages=r.toNumber()}else{const r=new Jo(t[0]);super(ll,t[1],L.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=L.parse(this.value,Jo);return t[""]=r.toJSON().join(", "),t}}ba.NAME="Key Usages";class Zn extends dt{static async create(t,r=!1,i=ze.get()){let o;t instanceof rr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:V.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new rr(o).getKeyIdentifier(i);return new Zn(R.ToHex(a),r)}constructor(...t){if(V.isBufferSource(t[0])){super(t[0]);const r=L.parse(this.value,_t);this.keyId=R.ToHex(r)}else{const r=typeof t[0]=="string"?R.FromHex(t[0]):t[0],i=new _t(r);super(yl,t[1],L.serialize(i)),this.keyId=R.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=L.parse(this.value,_t);return t[""]=r,t}}Zn.NAME="Subject Key Identifier";class wa extends dt{constructor(...t){V.isBufferSource(t[0])?super(t[0]):super(pl,t[1],new gi(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=L.parse(t.extnValue,es);this.names=new gi(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}wa.NAME="Subject Alternative Name";class td extends dt{constructor(...t){var r;if(V.isBufferSource(t[0])){super(t[0]);const i=L.parse(this.value,Xi);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new Xi(i.map(a=>new Zi({policyIdentifier:a})));super(il,o,L.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ce("",{},Tt.toString(r))),t}}td.NAME="Certificate Policies",ft.register(il,td);class Vr extends Vt{constructor(...t){let r;if(V.isBufferSource(t[0]))r=V.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>V.toArrayBuffer(s)):[];r=L.serialize(new kt({type:i,values:o}))}super(r,kt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ce("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ce.NAME]===Vr.NAME&&(t[ce.NAME]=Tt.toString(this.type)),t}}Vr.NAME="Attribute";class rd extends Vr{constructor(...t){var r;if(V.isBufferSource(t[0]))super(t[0]);else{const i=new Fn({printableString:t[0]});super(Ql,[L.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=L.parse(this.values[0],Fn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ce.VALUE]=this.password,t}}rd.NAME="Challenge Password";class va extends Vr{constructor(...t){var r;if(V.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new Wt;for(const s of i)o.push(L.parse(s.rawData,it));super(ta,[L.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=L.parse(this.values[0],Wt);this.items=r.map(i=>ft.create(L.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ce.NAME]]=i;return t}}va.NAME="Extensions";class Xn{static register(t,r){this.items.set(t,r)}static create(t){const r=new Vr(t),i=this.items.get(r.type);return i?new i(t):r}}Xn.items=new Map;let ka=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 U({algorithm:In,parameters:null});case"sha-256":return new U({algorithm:Ds,parameters:null});case"sha-384":return new U({algorithm:En,parameters:null});case"sha-512":return new U({algorithm:Nn,parameters:null})}}else return new U({algorithm:Nr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Nr:return{name:"RSASSA-PKCS1-v1_5"};case In:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Ds:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case En:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Nn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};ka=u([qs()],ka),Xe.registerSingleton(qn,ka);class Qe{addPadding(t,r){const i=V.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=V.toUint8Array(t);for(let o=0;o<i.length;o++)if(i[o]){i=i.slice(o);break}if(r&&i[0]>127){const o=new Uint8Array(i.length+1);return o.set(i,1),o.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,o=Qe.namedCurveSize.get(i)||Qe.defaultNamedCurveSize,s=new Bn,a=V.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),L.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=L.parse(r,Bn),o=t.namedCurve,s=Qe.namedCurveSize.get(o)||Qe.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return Jf(a,c)}return null}}Qe.namedCurveSize=new Map,Qe.defaultNamedCurveSize=32;const id="1.3.101.110",nd="1.3.101.111",od="1.3.101.112",sd="1.3.101.113";let Ca=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=od;break;case"ed448":r=sd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=id;break;case"x448":r=nd;break}}return r?new U({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case od:return{name:"EdDSA",namedCurve:"Ed25519"};case sd:return{name:"EdDSA",namedCurve:"Ed448"};case id:return{name:"ECDH-ES",namedCurve:"X25519"};case nd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ca=u([qs()],Ca),Xe.registerSingleton(qn,Ca);class jh extends Bt{constructor(t){Bt.isAsnEncoded(t)?super(t,hi):super(t),this.tag=Ge.CertificateRequestTag}onInit(t){this.tbs=L.serialize(t.certificationRequestInfo),this.publicKey=new rr(t.certificationRequestInfo.subjectPKInfo);const r=Xe.resolve(zn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>Xn.create(L.serialize(o)));const i=this.getAttribute(ta);this.extensions=[],i instanceof va&&(this.extensions=i.items),this.subjectName=new jt(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=ze.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=Xe.resolveAll(Jn).reverse();let s=null;for(const c of o)if(s=c.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,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=L.parse(this.rawData,hi),i=r.certificationRequestInfo,o=new ce("",{Version:`${yr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ce("");for(const a of this.attributes){const c=a.toTextObject();s[c[ce.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ce("",{Algorithm:er.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}jh.NAME="PKCS#10 Certificate Request";var ad;(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"})(ad||(ad={})),ft.register(tl,Xu),ft.register(al,ed),ft.register(ll,ba),ft.register(yl,Zn),ft.register(Vo,wi),ft.register(pl,wa),Xn.register(Ql,rd),Xn.register(ta,va),Xe.registerSingleton(Jn,Vh),Xe.registerSingleton(Jn,Qe),Qe.namedCurveSize.set("P-256",32),Qe.namedCurveSize.set("K-256",32),Qe.namedCurveSize.set("P-384",48),Qe.namedCurveSize.set("P-521",66);function cd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new Yn(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof wa){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const p=d.type,y=l[p]??[];return{...l,[p]:[...y,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof ba){const s=Object.values(ma),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const p=s[s.length/2+d];if(o.usages&p){const y=s[d];c.push(y)}return c},[]);i.keyUsage=a}return i}}}function Dh(){const e=cd(),t=n.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 Ph={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"},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 $h(){const e=ar.createI18n("en-us",Ph);return{i18n:e,i18nT:ar.i18nTComponent(e)}}const pt={useCertificate:Dh,useI18n:$h,useX509:cd},vi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}},Mh={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Rh="Copy to clipboard",Uh={message:Mh,iconTitle:Rh},Lh="kong-ui-copy-uuid-notify",ld="24px",Hh=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Fh=e=>(n.pushScopeId("data-v-9971cc79"),e=e(),n.popScopeId(),e),Kh=["aria-hidden"],qh={key:0,"data-testid":"kui-icon-svg-title"},zh=Fh(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Gh=n.defineComponent({__name:"CopyIcon",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:ld,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=n.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 ld}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",qh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),zh],8,Kh))]),_:1},8,["aria-hidden","style"]))}}),Wh=Hh(Gh,[["__scopeId","data-v-9971cc79"]]),Jh="16px",Yh={class:"kong-ui-copy-uuid"},Zh=["onClick"],ud=15,Xh=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const r=e,{t:i}=ar.createI18n("en-us",Uh),o=r.notify||n.inject(Lh,()=>{}),s=n.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),a=n.computed(()=>!!(r.tooltip&&r.successTooltip)),c=n.ref(r.tooltip),l=n.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=n.computed(()=>{var x;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(x=r.uuid)==null?void 0:x.substring(0,5)}`:r.uuid}),p=x=>{c.value=x,setTimeout(()=>{c.value=r.tooltip},1800)},y=x=>{var C,h;if(!x(r.uuid)){typeof o=="function"&&o({type:"error",message:i("message.fail")}),a.value?p(i("message.fail")):t("error",r.uuid);return}const g=((C=r.uuid)==null?void 0:C.length)>ud,b=r.format==="hidden"||r.format==="redacted"?i("message.success.prefix"):`"${((h=r.uuid)==null?void 0:h.substring(0,ud))+(g?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${b}${i("message.success.content")}`}),a.value?p(r.successTooltip):t("success",r.uuid)};return(x,C)=>{const h=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Yh,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(d.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(l.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(h,null,{default:n.withCtx(({copyToClipboard:g})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(b=>y(g),["stop"])},[n.createVNode(n.unref(Wh),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Jh),title:n.unref(i)("iconTitle")},null,8,["color","decorative","size","title"])],8,Zh)]),_:1})]),_:1},16))])}}}),Qh=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},ey=Qh(Xh,[["__scopeId","data-v-0c07874b"]]);var Sa=(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))(Sa||{}),ir=(e=>(e.Edit="edit",e.Create="create",e))(ir||{}),Dt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Dt||{}),ne=(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.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ne||{}),le=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(le||{});function xa(e={}){return{axiosInstance:Kf.create({withCredentials:!0,timeout:3e4,...e})}}function ty(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Aa="khcp-user-table-preferences",ry={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function iy(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Aa));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=t();o.set(r,i),localStorage.setItem(Aa,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||ry},deleteAllTablePreferences:()=>{localStorage.removeItem(Aa)}}}const ny={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},oy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},sy={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},ay={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},cy={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"}},ly={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},uy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},dy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},fy={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"}},py={global:ny,deleteModal:oy,baseForm:sy,baseTable:ay,baseConfigCard:cy,filter:ly,debouncedFilter:uy,errors:dy,toggleModal:fy};function Ba(){const e=ar.createI18n("en-us",py);return{i18n:e,i18nT:ar.i18nTComponent(e)}}function dd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const s of o){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(s=i[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 hy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=xa({headers:e.requestHeaders}),{i18n:{t:s}}=Ba(),{debounce:a}=ty(),c=a(async A=>{await m(A)},200),l=n.ref(!1),d=n.ref(""),p=n.ref(""),y=n.ref([]),x=n.ref([]),C=n.ref(void 0),h=n.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:b}=dd(),v=async()=>{try{l.value=!0;const{data:A}=await o.get(`${g}?size=${r}`);A!=null&&A.next||(C.value=i.fetchedItemsKey in A?A[i.fetchedItemsKey]:[]),x.value=i.fetchedItemsKey in A?A[i.fetchedItemsKey]:[],y.value=x.value}catch{y.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},w=n.ref(""),m=async A=>{var J,X,I;if(w.value!==A)if(w.value=A||"",C.value===void 0)try{if(l.value=!0,d.value="",p.value="",e.app==="konnect"){let E=g+"";A&&(E+=`/${A}`);const{data:$}=await o.get(`${E}?size=${r}`);i.fetchedItemsKey in $?y.value=$[i.fetchedItemsKey]:$!=null&&$.id?y.value=[$]:y.value=[]}else if(A){const E=[];b(A)&&i.searchKeys.includes("id")?E.push((async()=>{const{data:H}=await o.get(`${g}/${A}`);return[H[i.fetchedItemsKey]??H]})()):E.push(...i.searchKeys.filter(H=>H!=="id").map(async H=>{const{data:D}=await o.get(`${g}?${H}=${A}`);return D[i.fetchedItemsKey]}));const $=await Promise.all(E),M=new Set;y.value=[],(J=$==null?void 0:$.forEach)==null||J.call($,H=>{var D;(D=H==null?void 0:H.forEach)==null||D.call(H,j=>{M.has(j.id)||(M.add(j.id),y.value.push(j))})})}else y.value=x.value}catch(E){((X=E==null?void 0:E.response)==null?void 0:X.status)===404?p.value=s("debouncedFilter.errors.invalid"):(y.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,p.value="",A?(y.value=(I=C.value)==null?void 0:I.filter(E=>{var $;let M=!1;for(const H of i.searchKeys){const D=typeof E[H]=="string"?($=E[H])==null?void 0:$.toLowerCase():E[H];D!=null&&D.includes(A.toLowerCase())&&(M=!0)}return M}),(!y.value||!y.value.length)&&(p.value=s("debouncedFilter.errors.invalid"))):y.value=C.value,l.value=!1};return{loading:l,error:d,validationError:p,results:y,allRecords:C,loadItems:v,debouncedQueryChange:c}}function yy(e,t){const r=n.unref(t),i=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function gy(){const{i18n:{t:e}}=Ba();return{getMessageFromError:t=>{var r,i,o;if(!t)return e("errors.unexpected");if((r=t==null?void 0:t.response)!=null&&r.data){if(t.response.data.detail)return t.response.data.detail;if((i=t.response.data.details)!=null&&i.length)return t.response.data.details.map(s=>{let a=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(a=s.messages.join(", ")),s.field?`${s.field} - ${a}`:a}).join("; ");if(t.response.data.message){const{message:s}=t.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(s=>`${s} ${t.response.data[s]}`).join(", ")}return t.message||e("errors.unexpected")}}}function my(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),o=`${r}${i}`,s=e.some(a=>a.trim()==="");if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(o)&&!s&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function fd(e,t){const r=n.ref(n.unref(e)),i=n.ref(n.unref(t)),o=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:p,sortColumnOrder:y,query:x}=a;try{let C=new URL(s.value.href);return o.value&&x?(C.search="",C=new URL(`${C.href}/${x}/`)):(o.value||new URLSearchParams(x).forEach((h,g)=>{C.searchParams.append(g,h)}),p&&C.searchParams.append("sort_by",p),y==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(l))),d&&c!==1&&C.searchParams.append("offset",String(d)),C.href}catch(C){return console.error("RouteList(fetcher)",C),i.value}}}function by(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=xa({headers:e.requestHeaders}),s=fd(e,i),a=n.ref({status:Dt.Idle});return{fetcher:async c=>{try{a.value={status:Dt.Loading};const l=s(c),{data:d}=await o.get(l),p=r&&r.replace(/[^\w-_]/gi,"");let y;d[p]&&Array.isArray(d[p])?y=d[p]:y=Object.keys(d).length?[d]:[];const x={data:y,total:y.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Dt.Idle,response:x},x}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Dt.NoResults,response:d,error:l},d):(a.value={status:Dt.Error,response:d,error:l},d)}},fetcherState:a}}function wy(){const e=(r,i="_")=>r?r.split(i).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,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const pd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,hd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(pd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},yd=e=>e==="*"||e==="x"||e==="X",gd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},vy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],ky=(e,t)=>{if(yd(e)||yd(t))return 0;const[r,i]=vy(gd(e),gd(t));return r>i?1:r<i?-1:0},md=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=ky(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Cy=(e,t)=>{const r=hd(e),i=hd(t),o=r.pop(),s=i.pop(),a=md(r,i);return a!==0?a:o&&s?md(o.split("."),s.split(".")):o||s?o?-1:1:0},bd=(e,t,r)=>{Sy(r);const i=Cy(e,t);return wd[r].includes(i)},wd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},vd=Object.keys(wd),Sy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(vd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${vd.join("|")}`)},xy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&pd.test(e);function Ay(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!xy(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&bd(o,a,"<")||c&&bd(o,c,">"))}function By(e){const t=n.ref(0),r=n.ref(0),i=n.ref(!1);return n.watch(e,o=>{o&&!i.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const Iy=new Fa.ToastManager;function Ey(){return{notify:async e=>{const t={appearance:"success",message:"Success",timeoutMilliseconds:3e3};Iy.open({...t,...e})}}}const Ae={useAxios:xa,useDebouncedFilter:hy,useDeleteUrlBuilder:yy,useErrors:gy,useExternalLinkCreator:my,useFetcher:by,useFetchUrlBuilder:fd,useHelpers:dd,useStringHelpers:wy,useI18n:Ba,useGatewayFeatureSupported:Ay,useTruncationDetector:By,useToaster:Ey},Ny={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},_y="Copy to clipboard",Oy={message:Ny,iconTitle:_y},Ty="kong-ui-copy-uuid-notify",kd="24px",Vy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},jy=e=>(n.pushScopeId("data-v-9971cc79"),e=e(),n.popScopeId(),e),Dy=["aria-hidden"],Py={key:0,"data-testid":"kui-icon-svg-title"},$y=jy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),My=n.defineComponent({__name:"CopyIcon",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:kd,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=n.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 kd}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Py,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),$y],8,Dy))]),_:1},8,["aria-hidden","style"]))}}),Ry=Vy(My,[["__scopeId","data-v-9971cc79"]]),Uy="16px",Ly={class:"kong-ui-copy-uuid"},Hy=["onClick"],Cd=15,Fy=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const r=e,{t:i}=ar.createI18n("en-us",Oy),o=r.notify||n.inject(Ty,()=>{}),s=n.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),a=n.computed(()=>!!(r.tooltip&&r.successTooltip)),c=n.ref(r.tooltip),l=n.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=n.computed(()=>{var x;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(x=r.uuid)==null?void 0:x.substring(0,5)}`:r.uuid}),p=x=>{c.value=x,setTimeout(()=>{c.value=r.tooltip},1800)},y=x=>{var C,h;if(!x(r.uuid)){typeof o=="function"&&o({type:"error",message:i("message.fail")}),a.value?p(i("message.fail")):t("error",r.uuid);return}const g=((C=r.uuid)==null?void 0:C.length)>Cd,b=r.format==="hidden"||r.format==="redacted"?i("message.success.prefix"):`"${((h=r.uuid)==null?void 0:h.substring(0,Cd))+(g?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${b}${i("message.success.content")}`}),a.value?p(r.successTooltip):t("success",r.uuid)};return(x,C)=>{const h=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Ly,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(d.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(l.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(h,null,{default:n.withCtx(({copyToClipboard:g})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(b=>y(g),["stop"])},[n.createVNode(n.unref(Ry),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Uy),title:n.unref(i)("iconTitle")},null,8,["color","decorative","size","title"])],8,Hy)]),_:1})]),_:1},16))])}}}),Ky=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Sd=Ky(Fy,[["__scopeId","data-v-0c07874b"]]),qy={key:0,class:"config-card-fieldset-title"},zy=n.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}}=Ae.useI18n(),{convertKeyToTitle:i}=Ae.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=n.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:n.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:n.withCtx(()=>[e.isArrayItem?(n.openBlock(),n.createElementBlock("legend",qy,[n.createElementVNode("b",null,n.toDisplayString(c.value),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(a.value),(p,y)=>(n.openBlock(),n.createBlock(ki,{key:`${o.value}-property-${y}`,item:{key:p,label:n.unref(i)(p),value:a.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ot=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},xd=ot(zy,[["__scopeId","data-v-68ca83ec"]]),Gy=ot(n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ae.useI18n();return(r,i)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.value||n.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-c96811e5"]]),Wy=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ae.useI18n();return(r,i)=>{const o=n.resolveComponent("KBadge");return n.openBlock(),n.createBlock(o,{appearance:e.status?"success":"neutral"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.status?n.unref(t)("baseConfigCard.statusBadge.enabledLabel"):n.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Jy="#0044f4",Yy="#e0e4ea",Zy="#3a3f51",Xy="1px",Qy="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"],cg=["data-testid"],lg=["data-testid"],ug={name:"ConfigCardItem",components:{CopyUuid:Sd,JsonCardItem:xd,StatusBadge:Wy,InternalLinkItem:Gy}},dg=n.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}){const r=e;n.useCssVars(C=>({"1df60db4":d.value?"none":`solid ${n.unref(Xy)} ${n.unref(Yy)}`,"21d1d34e":l.value&&a.value?"block":"flex","4d3dc7e7":l.value&&a.value?"100%":r.slim?"50%":"25%","4d400dc2":l.value&&a.value?"100%":r.slim?"50%":"75%"}));const i=n.useSlots(),{i18n:{t:o,formatUnixTimeStamp:s}}=Ae.useI18n(),a=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=n.computed(()=>!!(r.item.tooltip||i["label-tooltip"])),l=n.computed(()=>r.item.type===ne.Json||r.item.type===ne.JsonArray),d=n.computed(()=>r.item.type===ne.JsonArray),p=n.computed(()=>{switch(r.item.type){case ne.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case ne.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case ne.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case ne.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case ne.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:s(r.item.value)};case ne.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ne.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ne.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ne.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:C=>{t("navigation-click",C)}}};case ne.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ne.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ne.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}}}),y=n.ref(),{isTruncated:x}=Ae.useTruncationDetector(y);return(C,h)=>{const g=n.resolveComponent("KLabel"),b=n.resolveComponent("KBadge"),v=n.resolveComponent("KMethodBadge"),w=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",eg,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(C.$slots,"label",{item:e.item},()=>[n.createVNode(g,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(C.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,rg)]),key:"0"}:void 0]),1024)],!0)],8,tg),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(C.$slots,e.item.key,{rowValue:e.item.value},()=>[a.value?(n.openBlock(),n.createElementBlock("div",og,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value.tag),n.normalizeProps(n.guardReactiveProps(p.value.attrs)),{default:n.withCtx(()=>[p.value.additionalComponent==="KBadge"?(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(m,A)=>(n.openBlock(),n.createBlock(b,{key:`${e.item.key}-badge-tag-${A}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${A}`,"truncation-tooltip":m},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(m),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,sg)):n.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(m,A)=>(n.openBlock(),n.createBlock(n.unref(Sd),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${A}`,"data-testid":`${e.item.key}-copy-uuid-${A}`,uuid:m}),null,16,["data-testid","uuid"]))),128))],8,ag)):p.value.additionalComponent==="KMethodBadge"?(n.openBlock(),n.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(m,A)=>(n.openBlock(),n.createBlock(v,{key:`${e.item.key}-badge-method-${A}`,class:"config-badge","data-testid":`${e.item.key}-badge-method-${A}`,"is-rounded":"",label:m,method:n.unref(Fa.MethodsArray).includes(m.toLowerCase())?m.toLowerCase():"custom"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(m),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,cg)):n.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(n.openBlock(),n.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(m,A)=>(n.openBlock(),n.createBlock(xd,{key:`json-array-item-${A}`,index:A,"is-array-item":"",item:m},null,8,["index","item"]))),128))],8,lg)):(n.openBlock(),n.createBlock(w,{key:4,label:n.unref(x)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:y,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,ng))],!0)],8,ig)])}}}),ki=ot(dg,[["__scopeId","data-v-307ab96d"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ad(e){return typeof e>"u"||e===null}function fg(e){return typeof e=="object"&&e!==null}function pg(e){return Array.isArray(e)?e:Ad(e)?[]:[e]}function hg(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}function yg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function gg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var mg=Ad,bg=fg,wg=pg,vg=yg,kg=gg,Cg=hg,Se={isNothing:mg,isObject:bg,toArray:wg,repeat:vg,isNegativeZero:kg,extend:Cg};function Bd(e,t){var r="",i=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
|
-
`+e.mark.snippet),i+" "+r):i}function Ci(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=
|
|
119
|
+
`+e.mark.snippet),i+" "+r):i}function Ci(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Bd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ci.prototype=Object.create(Error.prototype),Ci.prototype.constructor=Ci,Ci.prototype.toString=function(e){return this.name+": "+Bd(this,e)};var Pe=Ci;function Ia(e,t,r,i,o){var s="",a="",c=Math.floor(o/2)-1;return i-t>c&&(s=" ... ",t=i-c+s.length),r-i>c&&(a=" ...",r=i+c-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Ea(e,t){return Se.repeat(" ",t-e.length)+e}function Sg(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,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var c="",l,d,p=Math.min(e.line+t.linesAfter,o.length).toString().length,y=t.maxLength-(t.indent+p+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=Ia(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),y),c=Se.repeat(" ",t.indent)+Ea((e.line-l+1).toString(),p)+" | "+d.str+`
|
|
120
120
|
`+c;for(d=Ia(e.buffer,i[a],o[a],e.position,y),c+=Se.repeat(" ",t.indent)+Ea((e.line+1).toString(),p)+" | "+d.str+`
|
|
121
121
|
`,c+=Se.repeat("-",t.indent+p+3+d.pos)+`^
|
|
122
122
|
`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)d=Ia(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),y),c+=Se.repeat(" ",t.indent)+Ea((e.line+l+1).toString(),p)+" | "+d.str+`
|
|
123
|
-
`;return c.replace(/\n$/,"")}var
|
|
124
|
-
\r`;function
|
|
125
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function
|
|
126
|
-
`,t-1))}function
|
|
123
|
+
`;return c.replace(/\n$/,"")}var xg=Sg,Ag=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Bg=["scalar","sequence","mapping"];function Ig(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function Eg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Ag.indexOf(r)===-1)throw new Pe('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Ig(t.styleAliases||null),Bg.indexOf(this.kind)===-1)throw new Pe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ee=Eg;function Id(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}function Ng(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}function Na(e){return this.extend(e)}Na.prototype.extend=function(e){var t=[],r=[];if(e instanceof Ee)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new Pe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof Ee))throw new Pe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Pe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Pe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof Ee))throw new Pe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Na.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Id(i,"implicit"),i.compiledExplicit=Id(i,"explicit"),i.compiledTypeMap=Ng(i.compiledImplicit,i.compiledExplicit),i};var Ed=Na,Nd=new Ee("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),_d=new Ee("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Od=new Ee("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Td=new Ed({explicit:[Nd,_d,Od]});function _g(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Og(){return null}function Tg(e){return e===null}var Vd=new Ee("tag:yaml.org,2002:null",{kind:"scalar",resolve:_g,construct:Og,predicate:Tg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Vg(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function jg(e){return e==="true"||e==="True"||e==="TRUE"}function Dg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var jd=new Ee("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Vg,construct:jg,predicate:Dg,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Pg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function $g(e){return 48<=e&&e<=55}function Mg(e){return 48<=e&&e<=57}function Rg(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Pg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!$g(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Mg(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function Ug(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function Lg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Se.isNegativeZero(e)}var Dd=new Ee("tag:yaml.org,2002:int",{kind:"scalar",resolve:Rg,construct:Ug,predicate:Lg,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Hg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Fg(e){return!(e===null||!Hg.test(e)||e[e.length-1]==="_")}function Kg(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var qg=/^[-+]?[0-9]+e/;function zg(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Se.isNegativeZero(e))return"-0.0";return r=e.toString(10),qg.test(r)?r.replace("e",".e"):r}function Gg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Se.isNegativeZero(e))}var Pd=new Ee("tag:yaml.org,2002:float",{kind:"scalar",resolve:Fg,construct:Kg,predicate:Gg,represent:zg,defaultStyle:"lowercase"}),$d=Td.extend({implicit:[Vd,jd,Dd,Pd]}),Md=$d,Rd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ud=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Wg(e){return e===null?!1:Rd.exec(e)!==null||Ud.exec(e)!==null}function Jg(e){var t,r,i,o,s,a,c,l=0,d=null,p,y,x;if(t=Rd.exec(e),t===null&&(t=Ud.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(p=+t[10],y=+(t[11]||0),d=(p*60+y)*6e4,t[9]==="-"&&(d=-d)),x=new Date(Date.UTC(r,i,o,s,a,c,l)),d&&x.setTime(x.getTime()-d),x}function Yg(e){return e.toISOString()}var Ld=new Ee("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Wg,construct:Jg,instanceOf:Date,represent:Yg});function Zg(e){return e==="<<"||e===null}var Hd=new Ee("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Zg}),_a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
124
|
+
\r`;function Xg(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=_a;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function Qg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=_a,a=0,c=[];for(t=0;t<o;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):r===18?(c.push(a>>10&255),c.push(a>>2&255)):r===12&&c.push(a>>4&255),new Uint8Array(c)}function em(e){var t="",r=0,i,o,s=e.length,a=_a;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function tm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Fd=new Ee("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Xg,construct:Qg,predicate:tm,represent:em}),rm=Object.prototype.hasOwnProperty,im=Object.prototype.toString;function nm(e){if(e===null)return!0;var t=[],r,i,o,s,a,c=e;for(r=0,i=c.length;r<i;r+=1){if(o=c[r],a=!1,im.call(o)!=="[object Object]")return!1;for(s in o)if(rm.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function om(e){return e!==null?e:[]}var Kd=new Ee("tag:yaml.org,2002:omap",{kind:"sequence",resolve:nm,construct:om}),sm=Object.prototype.toString;function am(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],sm.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function cm(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}var qd=new Ee("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:am,construct:cm}),lm=Object.prototype.hasOwnProperty;function um(e){if(e===null)return!0;var t,r=e;for(t in r)if(lm.call(r,t)&&r[t]!==null)return!1;return!0}function dm(e){return e!==null?e:{}}var zd=new Ee("tag:yaml.org,2002:set",{kind:"mapping",resolve:um,construct:dm}),Oa=Md.extend({implicit:[Ld,Hd],explicit:[Fd,Kd,qd,zd]}),Pt=Object.prototype.hasOwnProperty,Qn=1,Gd=2,Wd=3,eo=4,Ta=1,fm=2,Jd=3,pm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,hm=/[\x85\u2028\u2029]/,ym=/[,\[\]\{\}]/,Yd=/^(?:!|!!|![a-z\-]+!)$/i,Zd=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Xd(e){return Object.prototype.toString.call(e)}function ht(e){return e===10||e===13}function nr(e){return e===9||e===32}function Fe(e){return e===9||e===32||e===10||e===13}function jr(e){return e===44||e===91||e===93||e===123||e===125}function gm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function mm(e){return e===120?2:e===117?4:e===85?8:0}function bm(e){return 48<=e&&e<=57?e-48:-1}function Qd(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
125
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function wm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ef=new Array(256),tf=new Array(256),Dr=0;Dr<256;Dr++)ef[Dr]=Qd(Dr)?1:0,tf[Dr]=Qd(Dr);function vm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Oa,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function rf(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=xg(r),new Pe(t,r)}function K(e,t){throw rf(e,t)}function to(e,t){e.onWarning&&e.onWarning.call(null,rf(e,t))}var nf={YAML:function(e,t,r){var i,o,s;e.version!==null&&K(e,"duplication of %YAML directive"),r.length!==1&&K(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&K(e,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&K(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&to(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,o;r.length!==2&&K(e,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],Yd.test(i)||K(e,"ill-formed tag handle (first argument) of the TAG directive"),Pt.call(e.tagMap,i)&&K(e,'there is a previously declared suffix for "'+i+'" tag handle'),Zd.test(o)||K(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{K(e,"tag prefix is malformed: "+o)}e.tagMap[i]=o}};function $t(e,t,r,i){var o,s,a,c;if(t<r){if(c=e.input.slice(t,r),i)for(o=0,s=c.length;o<s;o+=1)a=c.charCodeAt(o),a===9||32<=a&&a<=1114111||K(e,"expected valid JSON character");else pm.test(c)&&K(e,"the stream contains non-printable characters");e.result+=c}}function of(e,t,r,i){var o,s,a,c;for(Se.isObject(r)||K(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,c=o.length;a<c;a+=1)s=o[a],Pt.call(t,s)||(t[s]=r[s],i[s]=!0)}function Pr(e,t,r,i,o,s,a,c,l){var d,p;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),d=0,p=o.length;d<p;d+=1)Array.isArray(o[d])&&K(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Xd(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&Xd(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,p=s.length;d<p;d+=1)of(e,t,s[d],r);else of(e,t,s,r);else!e.json&&!Pt.call(r,o)&&Pt.call(t,o)&&(e.line=a||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,K(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[o]=s,delete r[o];return t}function Va(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):K(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ve(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;nr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(ht(o))for(Va(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&to(e,"deficient indentation"),i}function ro(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Fe(r)))}function ja(e,t){t===1?e.result+=" ":t>1&&(e.result+=Se.repeat(`
|
|
126
|
+
`,t-1))}function km(e,t,r){var i,o,s,a,c,l,d,p,y=e.kind,x=e.result,C;if(C=e.input.charCodeAt(e.position),Fe(C)||jr(C)||C===35||C===38||C===42||C===33||C===124||C===62||C===39||C===34||C===37||C===64||C===96||(C===63||C===45)&&(o=e.input.charCodeAt(e.position+1),Fe(o)||r&&jr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;C!==0;){if(C===58){if(o=e.input.charCodeAt(e.position+1),Fe(o)||r&&jr(o))break}else if(C===35){if(i=e.input.charCodeAt(e.position-1),Fe(i))break}else{if(e.position===e.lineStart&&ro(e)||r&&jr(C))break;if(ht(C))if(l=e.line,d=e.lineStart,p=e.lineIndent,ve(e,!1,-1),e.lineIndent>=t){c=!0,C=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=p;break}}c&&($t(e,s,a,!1),ja(e,e.line-l),s=a=e.position,c=!1),nr(C)||(a=e.position+1),C=e.input.charCodeAt(++e.position)}return $t(e,s,a,!1),e.result?!0:(e.kind=y,e.result=x,!1)}function Cm(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if($t(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else ht(r)?($t(e,i,o,!0),ja(e,ve(e,!1,t)),i=o=e.position):e.position===e.lineStart&&ro(e)?K(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);K(e,"unexpected end of the stream within a single quoted scalar")}function Sm(e,t){var r,i,o,s,a,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return $t(e,r,e.position,!0),e.position++,!0;if(c===92){if($t(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),ht(c))ve(e,!1,t);else if(c<256&&ef[c])e.result+=tf[c],e.position++;else if((a=mm(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=gm(c))>=0?s=(s<<4)+a:K(e,"expected hexadecimal character");e.result+=wm(s),e.position++}else K(e,"unknown escape sequence");r=i=e.position}else ht(c)?($t(e,r,i,!0),ja(e,ve(e,!1,t)),r=i=e.position):e.position===e.lineStart&&ro(e)?K(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}K(e,"unexpected end of the stream within a double quoted scalar")}function xm(e,t){var r=!0,i,o,s,a=e.tag,c,l=e.anchor,d,p,y,x,C,h=Object.create(null),g,b,v,w;if(w=e.input.charCodeAt(e.position),w===91)p=93,C=!1,c=[];else if(w===123)p=125,C=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),w=e.input.charCodeAt(++e.position);w!==0;){if(ve(e,!0,t),w=e.input.charCodeAt(e.position),w===p)return e.position++,e.tag=a,e.anchor=l,e.kind=C?"mapping":"sequence",e.result=c,!0;r?w===44&&K(e,"expected the node content, but found ','"):K(e,"missed comma between flow collection entries"),b=g=v=null,y=x=!1,w===63&&(d=e.input.charCodeAt(e.position+1),Fe(d)&&(y=x=!0,e.position++,ve(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,$r(e,t,Qn,!1,!0),b=e.tag,g=e.result,ve(e,!0,t),w=e.input.charCodeAt(e.position),(x||e.line===i)&&w===58&&(y=!0,w=e.input.charCodeAt(++e.position),ve(e,!0,t),$r(e,t,Qn,!1,!0),v=e.result),C?Pr(e,c,h,b,g,v,i,o,s):y?c.push(Pr(e,null,h,b,g,v,i,o,s)):c.push(g),ve(e,!0,t),w=e.input.charCodeAt(e.position),w===44?(r=!0,w=e.input.charCodeAt(++e.position)):r=!1}K(e,"unexpected end of the stream within a flow collection")}function Am(e,t){var r,i,o=Ta,s=!1,a=!1,c=t,l=0,d=!1,p,y;if(y=e.input.charCodeAt(e.position),y===124)i=!1;else if(y===62)i=!0;else return!1;for(e.kind="scalar",e.result="";y!==0;)if(y=e.input.charCodeAt(++e.position),y===43||y===45)Ta===o?o=y===43?Jd:fm:K(e,"repeat of a chomping mode identifier");else if((p=bm(y))>=0)p===0?K(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?K(e,"repeat of an indentation width identifier"):(c=t+p-1,a=!0);else break;if(nr(y)){do y=e.input.charCodeAt(++e.position);while(nr(y));if(y===35)do y=e.input.charCodeAt(++e.position);while(!ht(y)&&y!==0)}for(;y!==0;){for(Va(e),e.lineIndent=0,y=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&y===32;)e.lineIndent++,y=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),ht(y)){l++;continue}if(e.lineIndent<c){o===Jd?e.result+=Se.repeat(`
|
|
127
127
|
`,s?1+l:l):o===Ta&&s&&(e.result+=`
|
|
128
128
|
`);break}for(i?nr(y)?(d=!0,e.result+=Se.repeat(`
|
|
129
129
|
`,s?1+l:l)):d?(d=!1,e.result+=Se.repeat(`
|
|
130
130
|
`,l+1)):l===0?s&&(e.result+=" "):e.result+=Se.repeat(`
|
|
131
131
|
`,l):e.result+=Se.repeat(`
|
|
132
|
-
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!ht(y)&&y!==0;)y=e.input.charCodeAt(++e.position);$t(e,r,e.position,!1)}return!0}function
|
|
133
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
132
|
+
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!ht(y)&&y!==0;)y=e.input.charCodeAt(++e.position);$t(e,r,e.position,!1)}return!0}function sf(e,t){var r,i=e.tag,o=e.anchor,s=[],a,c=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,K(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Fe(a))));){if(c=!0,e.position++,ve(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,$r(e,t,Wd,!1,!0),s.push(e.result),ve(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)K(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function Bm(e,t,r){var i,o,s,a,c,l,d=e.tag,p=e.anchor,y={},x=Object.create(null),C=null,h=null,g=null,b=!1,v=!1,w;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=y),w=e.input.charCodeAt(e.position);w!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,K(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(w===63||w===58)&&Fe(i))w===63?(b&&(Pr(e,y,x,C,h,null,a,c,l),C=h=g=null),v=!0,b=!0,o=!0):b?(b=!1,o=!0):K(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,w=i;else{if(a=e.line,c=e.lineStart,l=e.position,!$r(e,r,Gd,!1,!0))break;if(e.line===s){for(w=e.input.charCodeAt(e.position);nr(w);)w=e.input.charCodeAt(++e.position);if(w===58)w=e.input.charCodeAt(++e.position),Fe(w)||K(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Pr(e,y,x,C,h,null,a,c,l),C=h=g=null),v=!0,b=!1,o=!1,C=e.tag,h=e.result;else if(v)K(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=p,!0}else if(v)K(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=p,!0}if((e.line===s||e.lineIndent>t)&&(b&&(a=e.line,c=e.lineStart,l=e.position),$r(e,t,eo,!0,o)&&(b?h=e.result:g=e.result),b||(Pr(e,y,x,C,h,g,a,c,l),C=h=g=null),ve(e,!0,-1),w=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&w!==0)K(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&Pr(e,y,x,C,h,null,a,c,l),v&&(e.tag=d,e.anchor=p,e.kind="mapping",e.result=y),v}function Im(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&K(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):K(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Fe(a);)a===33&&(i?K(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Yd.test(o)||K(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),ym.test(s)&&K(e,"tag suffix cannot contain flow indicator characters")}s&&!Zd.test(s)&&K(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{K(e,"tag name is malformed: "+s)}return r?e.tag=s:Pt.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:K(e,'undeclared tag handle "'+o+'"'),!0}function Em(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&K(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Fe(r)&&!jr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&K(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Nm(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Fe(i)&&!jr(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&K(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Pt.call(e.anchorMap,r)||K(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ve(e,!0,-1),!0}function $r(e,t,r,i,o){var s,a,c,l=1,d=!1,p=!1,y,x,C,h,g,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=c=eo===r||Wd===r,i&&ve(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Im(e)||Em(e);)ve(e,!0,-1)?(d=!0,c=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):c=!1;if(c&&(c=d||o),(l===1||eo===r)&&(Qn===r||Gd===r?g=t:g=t+1,b=e.position-e.lineStart,l===1?c&&(sf(e,b)||Bm(e,b,g))||xm(e,g)?p=!0:(a&&Am(e,g)||Cm(e,g)||Sm(e,g)?p=!0:Nm(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&K(e,"alias node should not have any properties")):km(e,g,Qn===r)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(p=c&&sf(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&K(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),y=0,x=e.implicitTypes.length;y<x;y+=1)if(h=e.implicitTypes[y],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Pt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,C=e.typeMap.multi[e.kind||"fallback"],y=0,x=C.length;y<x;y+=1)if(e.tag.slice(0,C[y].tag.length)===C[y].tag){h=C[y];break}h||K(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&K(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):K(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function _m(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(ve(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Fe(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&K(e,"directive name must not be less than one character in length");a!==0;){for(;nr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!ht(a));break}if(ht(a))break;for(r=e.position;a!==0&&!Fe(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Va(e),Pt.call(nf,i)?nf[i](e,i,o):to(e,'unknown document directive "'+i+'"')}if(ve(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ve(e,!0,-1)):s&&K(e,"directives end mark is expected"),$r(e,e.lineIndent-1,eo,!1,!0),ve(e,!0,-1),e.checkLineBreaks&&hm.test(e.input.slice(t,e.position))&&to(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ro(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ve(e,!0,-1));return}if(e.position<e.length-1)K(e,"end of the stream or a document separator is expected");else return}function af(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
133
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new vm(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,K(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)_m(r);return r.documents}function Om(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=af(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Tm(e,t){var r=af(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Pe("expected a single document in the stream, but found more")}}var Vm=Om,jm=Tm,cf={loadAll:Vm,load:jm},lf=Object.prototype.toString,uf=Object.prototype.hasOwnProperty,Da=65279,Dm=9,Si=10,Pm=13,$m=32,Mm=33,Rm=34,Pa=35,Um=37,Lm=38,Hm=39,Fm=42,df=44,Km=45,io=58,qm=61,zm=62,Gm=63,Wm=64,ff=91,pf=93,Jm=96,hf=123,Ym=124,yf=125,Ve={};Ve[0]="\\0",Ve[7]="\\a",Ve[8]="\\b",Ve[9]="\\t",Ve[10]="\\n",Ve[11]="\\v",Ve[12]="\\f",Ve[13]="\\r",Ve[27]="\\e",Ve[34]='\\"',Ve[92]="\\\\",Ve[133]="\\N",Ve[160]="\\_",Ve[8232]="\\L",Ve[8233]="\\P";var Zm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Xm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Qm(e,t){var r,i,o,s,a,c,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],c=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&uf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function e0(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new Pe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Se.repeat("0",i-t.length)+t}var t0=1,xi=2;function r0(e){this.schema=e.schema||Oa,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Se.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Qm(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?xi:t0,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function gf(e,t){for(var r=Se.repeat(" ",t),i=0,o=-1,s="",a,c=e.length;i<c;)o=e.indexOf(`
|
|
134
134
|
`,i),o===-1?(a=e.slice(i),i=c):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
|
|
135
135
|
`&&(s+=r),s+=a;return s}function $a(e,t){return`
|
|
136
|
-
`+Se.repeat(" ",e.indent*t)}function
|
|
136
|
+
`+Se.repeat(" ",e.indent*t)}function i0(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function no(e){return e===$m||e===Dm}function Ai(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Da||65536<=e&&e<=1114111}function mf(e){return Ai(e)&&e!==Da&&e!==Pm&&e!==Si}function bf(e,t,r){var i=mf(e),o=i&&!no(e);return(r?i:i&&e!==df&&e!==ff&&e!==pf&&e!==hf&&e!==yf)&&e!==Pa&&!(t===io&&!o)||mf(t)&&!no(t)&&e===Pa||t===io&&o}function n0(e){return Ai(e)&&e!==Da&&!no(e)&&e!==Km&&e!==Gm&&e!==io&&e!==df&&e!==ff&&e!==pf&&e!==hf&&e!==yf&&e!==Pa&&e!==Lm&&e!==Fm&&e!==Mm&&e!==Ym&&e!==qm&&e!==zm&&e!==Hm&&e!==Rm&&e!==Um&&e!==Wm&&e!==Jm}function o0(e){return!no(e)&&e!==io}function Bi(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function wf(e){var t=/^\n* /;return t.test(e)}var vf=1,Ma=2,kf=3,Cf=4,Mr=5;function s0(e,t,r,i,o,s,a,c){var l,d=0,p=null,y=!1,x=!1,C=i!==-1,h=-1,g=n0(Bi(e,0))&&o0(Bi(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Bi(e,l),!Ai(d))return Mr;g=g&&bf(d,p,c),p=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Bi(e,l),d===Si)y=!0,C&&(x=x||l-h-1>i&&e[h+1]!==" ",h=l);else if(!Ai(d))return Mr;g=g&&bf(d,p,c),p=d}x=x||C&&l-h-1>i&&e[h+1]!==" "}return!y&&!x?g&&!a&&!o(e)?vf:s===xi?Mr:Ma:r>9&&wf(e)?Mr:a?s===xi?Mr:Ma:x?Cf:kf}function a0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===xi?'""':"''";if(!e.noCompatMode&&(Zm.indexOf(t)!==-1||Xm.test(t)))return e.quotingType===xi?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=i||e.flowLevel>-1&&r>=e.flowLevel;function l(d){return i0(e,d)}switch(s0(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case vf:return t;case Ma:return"'"+t.replace(/'/g,"''")+"'";case kf:return"|"+Sf(t,e.indent)+xf(gf(t,s));case Cf:return">"+Sf(t,e.indent)+xf(gf(c0(t,a),s));case Mr:return'"'+l0(t)+'"';default:throw new Pe("impossible error: invalid scalar style")}}()}function Sf(e,t){var r=wf(e)?String(t):"",i=e[e.length-1]===`
|
|
137
137
|
`,o=i&&(e[e.length-2]===`
|
|
138
138
|
`||e===`
|
|
139
139
|
`),s=o?"+":i?"":"-";return r+s+`
|
|
140
|
-
`}function
|
|
141
|
-
`?e.slice(0,-1):e}function
|
|
142
|
-
`);return d=d!==-1?d:e.length,r.lastIndex=d,
|
|
140
|
+
`}function xf(e){return e[e.length-1]===`
|
|
141
|
+
`?e.slice(0,-1):e}function c0(e,t){for(var r=/(\n+)([^\n]*)/g,i=function(){var d=e.indexOf(`
|
|
142
|
+
`);return d=d!==-1?d:e.length,r.lastIndex=d,Af(e.slice(0,d),t)}(),o=e[0]===`
|
|
143
143
|
`||e[0]===" ",s,a;a=r.exec(e);){var c=a[1],l=a[2];s=l[0]===" ",i+=c+(!o&&!s&&l!==""?`
|
|
144
|
-
`:"")+
|
|
144
|
+
`:"")+Af(l,t),o=s}return i}function Af(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,c=0,l="";i=r.exec(e);)c=i.index,c-o>t&&(s=a>o?a:c,l+=`
|
|
145
145
|
`+e.slice(o,s),o=s+1),a=c;return l+=`
|
|
146
146
|
`,e.length-o>t&&a>o?l+=e.slice(o,a)+`
|
|
147
|
-
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}function
|
|
148
|
-
`:""}var Yg=Jg,Zg={dump:Yg};function Ua(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 Xg=Ee,Qg=Bd,e0=_d,t0=Dd,r0=Pd,i0=Oa,n0=sf.load,o0=sf.loadAll,s0=Zg.dump,a0=Pe,c0={binary:Ld,float:jd,map:Nd,null:Od,pairs:Fd,set:Kd,timestamp:Md,bool:Td,int:Vd,merge:Ud,omap:Hd,seq:Ed,str:Id},l0=Ua("safeLoad","load"),u0=Ua("safeLoadAll","loadAll"),d0=Ua("safeDump","dump"),f0={Type:Xg,Schema:Qg,FAILSAFE_SCHEMA:e0,JSON_SCHEMA:t0,CORE_SCHEMA:r0,DEFAULT_SCHEMA:i0,load:n0,loadAll:o0,dump:s0,YAMLException:a0,types:c0,safeLoad:l0,safeLoadAll:u0,safeDump:d0};const p0={key:0,class:"config-card-display-form"},h0=["data-testid"],y0={key:0,class:"config-card-prop-section-title"},m0={key:1,class:"config-card-display-json"},g0={key:2,class:"config-card-display-yaml"},b0=ot(n.defineComponent({__name:"ConfigCardDisplay",props:{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:()=>null}},setup(e){const t=e,r=n.useSlots(),{i18n:{t:i}}=Ae.useI18n(),o=c=>!!(c.tooltip||r[`${c.key}-label-tooltip`]),s=n.ref(""),a=n.ref("");return n.watch(()=>t.format,c=>{c==="json"?s.value=JSON.stringify(t.record,null,2):c==="yaml"&&(a.value=f0.dump(t.record))},{immediate:!0}),(c,l)=>{const d=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",p0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,p=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${p}-props`,class:n.normalizeClass(`config-card-details-${p}-props`),"data-testid":`config-card-details-${p}-props`},[p!=="basic"?(n.openBlock(),n.createElementBlock("div",y0,n.toDisplayString(p==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[p],y=>(n.openBlock(),n.createBlock(ki,{key:y.key,item:y},n.createSlots({label:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label`,{row:y},void 0,!0)]),[y.key]:n.withCtx(({rowValue:x})=>[n.renderSlot(c.$slots,y.key,{row:y,rowValue:x},void 0,!0)]),_:2},[o(y)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label-tooltip`,{row:y},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,h0))),128))])):n.createCommentVNode("",!0),e.format==="json"?(n.openBlock(),n.createElementBlock("div",m0,[n.createVNode(d,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),e.format==="yaml"?(n.openBlock(),n.createElementBlock("div",g0,[n.createVNode(d,{id:"config-card-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-6c45e9e4"]]),Bf="24px",w0=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},v0=e=>(n.pushScopeId("data-v-dd88a2bb"),e=e(),n.popScopeId(),e),k0=["aria-hidden"],C0={key:0,"data-testid":"kui-icon-svg-title"},S0=v0(()=>n.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)),x0=n.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:Bf,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=n.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 Bf}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.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?(n.openBlock(),n.createElementBlock("title",C0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),S0],8,k0))]),_:1},8,["aria-hidden","style"]))}}),A0=w0(x0,[["__scopeId","data-v-dd88a2bb"]]),B0={"data-testid":"config-card-title"},I0={class:"config-card-actions"},E0=["href"],N0={key:2,class:"config-card-details-section"},_0={key:3,class:"config-card-details-section"},O0=["data-testid"],T0={key:0,class:"config-card-prop-section-title"},If=ot(n.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}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:t}){var r;const i=e,o=n.useSlots(),{i18n:{t:s}}=Ae.useI18n(),{getMessageFromError:a}=Ae.useErrors(),{convertKeyToTitle:c}=Ae.useStringHelpers(),{axiosInstance:l}=Ae.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),y=E=>{p.value=E==null?void 0:E.value},x={id:{type:ne.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:le.Basic},name:{order:1,section:le.Basic},enabled:{type:ne.BadgeStatus,order:2,section:le.Basic},updated_at:{type:ne.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:le.Basic},created_at:{type:ne.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:le.Basic},tags:{type:ne.BadgeTag,order:-1,section:le.Basic}},C=n.ref(!1),h=n.ref(!1),m=n.ref(""),b=n.ref(),v=n.computed(()=>{var E,$,R;if(!b.value)return[];const H=[],D=Object.keys(b.value).length;for(const j in b.value){const re=($=(E=i.configSchema)==null?void 0:E[j])==null?void 0:$.order,fe=(R=x[j])==null?void 0:R.order;let be=D;(fe||fe===0)&&(be=fe===-1?D+1:fe),re&&(be=re===-1?D+1:re),H.push([j,be])}return H.sort(function(j,re){return j[1]-re[1]}),H.map(j=>{var re,fe;const be=j[0],ue=(re=b.value)==null?void 0:re[be],pe=((fe=i.configSchema)==null?void 0:fe[be])||{},we=x[be];return{key:be,value:ue,hidden:pe.hidden||!1,type:pe.type??((we==null?void 0:we.type)||ne.Text),label:pe.label??((we==null?void 0:we.label)||c(be)),tooltip:pe.tooltip??((we==null?void 0:we.tooltip)||void 0),section:pe.section??((we==null?void 0:we.section)||le.Advanced)}}).filter(j=>!j.hidden&&j.key!==i.pluginConfigKey)}),w=n.computed(()=>{var E,$;if(!b.value||!i.pluginConfigKey)return[];const R=b.value[i.pluginConfigKey]||{},H=Object.keys(R).length,D=[];for(const j in R){const re=($=(E=i.pluginConfigSchema)==null?void 0:E[j])==null?void 0:$.order,fe=R[j];let be=fe!=null&&fe!==""?H-1:H;re&&(be=re===-1?H+1:re),D.push([j,be])}return D.sort(function(j,re){return j[1]-re[1]}),D.map(j=>{var re;const fe=j[0],be=R[fe],ue=((re=i.pluginConfigSchema)==null?void 0:re[fe])||{};return{key:fe,value:be,hidden:ue.hidden||!1,type:ue.type??ne.Text,label:ue.label??c(fe),tooltip:ue.tooltip??void 0,section:le.Plugin}}).filter(j=>!j.hidden)}),g=n.computed(()=>{var E,$,R,H;return{basic:(E=v.value)==null?void 0:E.filter(D=>D.section===le.Basic),advanced:($=v.value)==null?void 0:$.filter(D=>D.section===le.Advanced),plugin:(H=w.value)==null?void 0:H.concat((R=v.value)==null?void 0:R.filter(D=>D.section===le.Plugin))}}),A=n.computed(()=>{const E=[];return g.value.basic.length&&E.push("basic"),g.value.advanced.length&&E.push("advanced"),g.value.plugin.length&&E.push("plugin"),E}),J=E=>!!(E.tooltip||o[`${E.key}-label-tooltip`]),X=n.computed(()=>{var E,$;let R=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?R=R.replace(/{controlPlaneId}/gi,((E=i.config)==null?void 0:E.controlPlaneId)||""):i.config.app==="kongManager"&&(R=R.replace(/\/{workspace}/gi,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),R=R.replace(/{id}/gi,i.config.entityId),R}),I=E=>{b.value&&E(JSON.stringify(b.value))?t("copy:success",b.value):t("copy:error")};return n.watch(C,E=>{t("loading",E)},{immediate:!0}),n.onBeforeMount(async()=>{h.value=!1,C.value=!0;try{const{data:E}=await l.get(X.value);if(i.dataKey)if(typeof E[i.dataKey]<"u")b.value={...E[i.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:i.dataKey}));else b.value={...E};Object.keys(i.configSchema).filter($=>i.configSchema[$].forceShow).forEach($=>{b.value&&typeof b.value[$]>"u"&&(b.value[$]=null)}),t("fetch:success",E)}catch(E){const $=a(E);m.value=$.startsWith("code")?s("baseConfigCard.errors.load"):$,h.value=!0,t("fetch:error",E)}finally{C.value=!1}}),(E,$)=>{const R=n.resolveComponent("KLabel"),H=n.resolveComponent("KSelect"),D=n.resolveComponent("KButton"),j=n.resolveComponent("KClipboardProvider"),re=n.resolveComponent("KSkeleton"),fe=n.resolveComponent("KEmptyState"),be=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(be,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",I0,[n.renderSlot(E.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(R,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(H,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:y})):n.createCommentVNode("",!0),i.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(D,{key:2,appearance:"btn-link",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(A0),{size:n.unref(jy)},null,8,["size"])],8,E0)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(j,{key:3},{default:n.withCtx(({copyToClipboard:ue})=>[!C.value&&!h.value?(n.openBlock(),n.createBlock(D,{key:0,appearance:"btn-link","data-testid":"json-copy-button",onClick:pe=>I(ue)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),body:n.withCtx(()=>[C.value?(n.openBlock(),n.createBlock(re,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(n.openBlock(),n.createBlock(fe,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(m.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",N0,[n.createVNode(b0,{format:p.value,"prop-list-types":A.value,"property-collections":g.value,record:b.value},n.createSlots({_:2},[n.renderList(Object.keys(E.$slots),ue=>({name:ue,fn:n.withCtx(({row:pe,rowValue:we})=>[n.renderSlot(E.$slots,ue,{row:pe,rowValue:we},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",_0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(A.value,ue=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${ue}-props`,class:n.normalizeClass(`config-card-details-${ue}-props`),"data-testid":`config-card-details-${ue}-props`},[ue!=="basic"?(n.openBlock(),n.createElementBlock("div",T0,n.toDisplayString(ue==="advanced"?n.unref(s)("baseConfigCard.sections.advanced"):n.unref(s)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value[ue],pe=>(n.openBlock(),n.createBlock(ki,{key:pe.key,item:pe},n.createSlots({label:n.withCtx(()=>[n.renderSlot(E.$slots,`${pe.key}-label`,{row:pe},void 0,!0)]),[pe.key]:n.withCtx(({rowValue:we})=>[n.renderSlot(E.$slots,pe.key,{row:pe,rowValue:we},void 0,!0)]),_:2},[J(pe)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(E.$slots,`${pe.key}-label-tooltip`,{row:pe},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,O0))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",B0,[n.renderSlot(E.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-64349aa2"]]),V0=["onReset","onSubmit"],j0={class:"form-actions","data-testid":"form-actions"},Ef=ot(n.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:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=e,o=Lr.useRouter(),{i18n:{t:s}}=Ae.useI18n(),{getMessageFromError:a}=Ae.useErrors(),{axiosInstance:c}=Ae.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),l=n.ref(!1),d=n.ref(!1),p=n.ref(""),y=n.computed(()=>i.canSubmit===!1||i.isReadonly),x=n.computed(()=>{var b,v;if(!i.editId)return"";let w=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((b=i.config)==null?void 0:b.controlPlaneId)||""):i.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(v=i.config)!=null&&v.workspace?`/${i.config.workspace}`:"")),w=w.replace(/{id}/gi,i.editId),w}),C=()=>{i.config.cancelRoute?o.push(i.config.cancelRoute):h()},h=()=>{t("cancel")},m=()=>{y.value||t("submit")};return n.watch(()=>l.value,b=>{t("loading",b)},{immediate:!0}),n.onBeforeMount(async()=>{if(i.editId)try{d.value=!1,l.value=!0;const{data:b}=await c.get(x.value);t("fetch:success",b)}catch(b){const v=a(b);p.value=v.startsWith("code")?s("baseForm.errors.edit"):v,d.value=!0,t("fetch:error",b)}finally{l.value=!1}}),(b,v)=>{const w=n.resolveComponent("KSkeleton"),g=n.resolveComponent("KEmptyState"),A=n.resolveComponent("KAlert"),J=n.resolveComponent("KButton"),X=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(X,{class:"kong-ui-entity-base-form"},{body:n.withCtx(()=>[l.value?(n.openBlock(),n.createBlock(w,{key:0,type:"form"})):d.value?(n.openBlock(),n.createBlock(g,{key:1,"cta-text":n.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":C,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(h,["prevent"]),onSubmit:n.withModifiers(m,["prevent"])},[n.renderSlot(b.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(A,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",j0,[n.renderSlot(b.$slots,"form-actions",{},()=>[n.createVNode(J,{appearance:"outline","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(J,{appearance:"primary","data-testid":"form-submit",disabled:y.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,V0))]),_:3})}}}),[["__scopeId","data-v-44a90aae"]]),D0={key:0,"data-testid":"first-col"},P0=ot(n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=n.computed(()=>{var m;return((m=t.rowEl)==null?void 0:m.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var m;return((m=r.value)==null?void 0:m.querySelector('[data-testid="first-col"]'))||null}),o=n.computed(()=>{var m,b;const v=(m=t.rowEl)==null?void 0:m.querySelectorAll("td");return v?((b=v[0])==null?void 0:b.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var m,b,v;d.value=((m=i.value)==null?void 0:m.getBoundingClientRect().width)||0,p.value=((b=r.value)==null?void 0:b.clientWidth)||0,y.value=((v=l.value)==null?void 0:v.innerText)||""},l=n.ref({}),d=n.ref(0),p=n.ref(0),y=n.ref(""),x=n.computed(()=>[i.value,r.value]),C=n.watch(x,m=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(b=>{window.requestAnimationFrame(()=>{!Array.isArray(b)||!b.length||c()})});for(const b of m)b&&s.observe(b)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>p.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{C()}),(m,b)=>{const v=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",D0,[n.createVNode(v,{label:h.value?y.value:"","max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(m.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):n.renderSlot(m.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-e42a20c9"]]),$0={class:"toolbar-container"},R0={key:0,class:"toolbar-button-container"},M0=["data-testid"],Nf=ot(n.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},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},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:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,{i18n:{t:i}}=Ae.useI18n(),o=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),s=g=>g.hasData||!!r.query,a=n.computed(()=>{const g=[];return Object.keys(r.tableHeaders).forEach(A=>{const J=r.tableHeaders[A];g.push({label:J.label??A,key:A,sortable:J.sortable??!1})}),r.enableEntityActions&&g.push({key:"actions",hideLabel:!0}),g}),c=g=>({"data-rowid":g.id,"data-testid":g.name,...r.rowAttributes(g)}),l=n.ref({}),d=g=>{var A;return(A=l.value)==null?void 0:A.$el.querySelector(`[data-rowid="${g.id}"]`)},p=g=>{const A={"data-testid":g.headerKey,...r.cellAttributes(g)};return g.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},y=()=>{t("empty-state-cta-clicked"),x()},x=()=>{t("clear-search-input")},C=n.computed(()=>r.disableRowClick?void 0:(g,A)=>{t("click:row",A)}),h=g=>{t("sort",g)},{setTablePreferences:m,getTablePreferences:b}=zh(),v=n.computed(()=>{const g=b(r.preferencesStorageKey);return{...r.initialFetcherParams,...g}}),w=g=>{r.preferencesStorageKey&&m(r.preferencesStorageKey,g)};return(g,A)=>{const J=n.resolveComponent("KIcon"),X=n.resolveComponent("KButton"),I=n.resolveComponent("KDropdownMenu"),E=n.resolveComponent("KTable"),$=n.resolveComponent("KCard");return n.openBlock(),n.createBlock($,{class:"kong-ui-entity-base-table",title:e.title},{body:n.withCtx(()=>[n.createVNode(E,{ref_key:"tableRefs",ref:l,"cache-identifier":o.value,"cell-attrs":p,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-title":e.errorMessage,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":!!e.errorMessage,headers:a.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":c,"search-input":e.query,onKtableEmptyStateCtaClicked:y,"onRow:click":C.value,onSort:A[0]||(A[0]=R=>h(R)),"onUpdate:tablePreferences":w},n.createSlots({toolbar:n.withCtx(({state:R})=>[n.withDirectives(n.createElementVNode("div",$0,[n.renderSlot(g.$slots,"toolbar-filter",{},void 0,!0),g.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",R0,[n.renderSlot(g.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,s(R)]])]),actions:n.withCtx(({row:R,rowKey:H,rowValue:D})=>[n.createElementVNode("div",{class:"actions-container","data-testid":R.name},[n.createVNode(I,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(g.$slots,"actions",{row:R,rowKey:H,rowValue:D},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(X,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(J,{color:n.unref(Ty),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,M0)]),_:2},[n.renderList(e.tableHeaders,(R,H)=>({name:H,fn:n.withCtx(({row:D,rowKey:j,rowValue:re})=>[n.createVNode(P0,{"key-name":String(H),"row-el":d(D)},{default:n.withCtx(()=>[n.renderSlot(g.$slots,H,{row:D,rowKey:j,rowValue:re},()=>[n.createTextVNode(n.toDisplayString(re),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-6bf92df6"]]),U0={key:0,class:"kong-ui-entity-delete-error"},L0={key:1,class:"description"},_f=ot(n.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 r=e,{i18nT:i}=Ae.useI18n(),o=n.computed(()=>r.needConfirm?r.entityName:""),s=()=>{t("cancel")},a=()=>{t("proceed")};return(c,l)=>{const d=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:s,onProceed:a},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",U0,[n.createVNode(d,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(i),{class:"message",keypath:r.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.entityType),1)]),_:2},[r.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(r.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),r.description||c.$slots.description?(n.openBlock(),n.createElementBlock("div",L0,[n.renderSlot(c.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(r.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),H0={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},F0={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},K0=["fill"],q0={mask:"url(#mask0_180_20349)"},z0=["fill"],W0=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${_y})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",H0,[n.createElementVNode("mask",F0,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,K0)]),n.createElementVNode("g",q0,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,z0)])]))}}),G0={key:1,class:"kong-ui-entity-filter"},J0={class:"menu-item-title"},Y0={class:"menu-item-indicator"},Z0={class:"menu-item-body"},X0=["for"],Q0={class:"menu-item-buttons"},Of=ot(n.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 r=e,{i18n:{t:i}}=Ae.useI18n(),o=n.ref(!1),s=n.ref({}),a=n.computed(()=>{const b=[];return new URLSearchParams(r.modelValue).forEach((v,w)=>{v!==""&&b.push(w)}),b}),c=n.computed(()=>{const b=r.config.fields;return Object.keys(b).filter(v=>b[v].searchable).map(v=>({label:b[v].label||v,value:v}))});n.watch(()=>r.modelValue,b=>{s.value={},new URLSearchParams(b).forEach((v,w)=>{s.value[w]=v})});const l=()=>{o.value=!o.value},d=b=>{t("update:modelValue",b)},p=b=>`filter-${b}`,y=b=>{var v,w;return(((w=(v=r.config.schema)==null?void 0:v[b])==null?void 0:w.values)??[]).map(g=>({value:g,label:g}))},x=b=>{var v,w;return((w=(v=r.config.schema)==null?void 0:v[b])==null?void 0:w.type)??"text"},C=b=>{s.value={...s.value,[b]:""},m()},h=()=>{s.value={},m(!0)},m=(b=!1)=>{const v=Object.keys(s.value).reduce((w,g)=>(s.value[g]&&(w[g]=`${s.value[g]}`),w),{});b&&(o.value=!1),t("update:modelValue",new URLSearchParams(v).toString())};return(b,v)=>{const w=n.resolveComponent("KInput"),g=n.resolveComponent("KButton"),A=n.resolveComponent("KSelect"),J=n.resolveComponent("KMenuItem"),X=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(w,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{icon:n.withCtx(()=>[n.createVNode(W0)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",G0,[n.createVNode(g,{appearance:"btn-link","data-testid":"filter-button",icon:"filter",onClick:l},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.filterButtonText"))+" "+n.toDisplayString(a.value.length>0?`(${a.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:l},null,512),[[n.vShow,o.value]]),n.withDirectives(n.createVNode(X,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(I,E)=>(n.openBlock(),n.createBlock(J,{key:I.value,"data-testid":I.value,expandable:"","last-menu-item":E===c.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",J0,[n.createTextVNode(n.toDisplayString(I.label)+" ",1),n.withDirectives(n.createElementVNode("span",Y0,null,512),[[n.vShow,a.value.includes(I.value)]])])]),itemBody:n.withCtx(()=>{var $,R;return[n.createElementVNode("div",Z0,[n.createElementVNode("label",{class:"menu-item-label",for:p(I.value)},n.toDisplayString(n.unref(i)("filter.fieldLabel")),9,X0),((R=($=e.config.schema)==null?void 0:$[I.value])==null?void 0:R.type)==="select"?(n.openBlock(),n.createBlock(A,{key:0,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":H=>s.value[I.value]=H,appearance:"select",items:y(I.value),placeholder:n.unref(i)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(w,{key:1,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":H=>s.value[I.value]=H,autocomplete:"off",placeholder:n.unref(i)("filter.inputPlaceholder"),size:"small",type:x(I.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",Q0,[n.createVNode(g,{appearance:"btn-link","data-testid":"apply-filter",size:"small",onClick:v[0]||(v[0]=H=>m(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.applyButtonText")),1)]),_:1}),n.createVNode(g,{appearance:"btn-link","data-testid":"clear-filter",size:"small",onClick:H=>C(I.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createVNode(g,{onClick:h},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearAllButtonText")),1)]),_:1})]),_:1},512),[[n.vShow,o.value]])]))}}}),[["__scopeId","data-v-745f38c0"]]),Et=n.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=n.ref(void 0),i=n.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return n.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>i.value?n.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):n.createCommentVNode("",!0)}}),e1={class:"form-section-wrapper"},t1={key:0,class:"form-section-title"},r1={key:1,class:"form-section-description"},i1={key:2,class:"form-section-footer"},n1={class:"form-section-content"},oo=ot(n.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}},setup(e){const t=n.useSlots();return(r,i)=>(n.openBlock(),n.createElementBlock("fieldset",{class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[n.createElementVNode("div",e1,[e.hideInfoHeader?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(n.openBlock(),n.createElementBlock("h4",t1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",r1,[n.renderSlot(r.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",i1,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",n1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:so,useDeleteUrlBuilder:Tf,useErrors:Vf,useExternalLinkCreator:ob,useFetchUrlBuilder:sb,useFetcher:jf,useDebouncedFilter:ab,useStringHelpers:Df,useHelpers:Pf,useGatewayFeatureSupported:cb,useTruncationDetector:lb}=Ae,ub="",db="",o1={class:"kong-ui-entities-certificates-list"},s1={key:0},a1={key:1},c1={key:0},l1={key:1},u1={key:0},d1={key:1},f1={key:1},p1={key:1},h1=n.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}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var de;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),a=Lr.useRouter(),{axiosInstance:c}=so({headers:(de=r.config)==null?void 0:de.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={subject:{label:i("certificates.list.table_headers.subject")},expiry:{label:i("certificates.list.table_headers.expiry")},san:{label:i("certificates.list.table_headers.san")},cert:{label:i("certificates.list.table_headers.cert")},tags:{label:i("certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var Y,xe;let q=`${r.config.apiBaseUrl}${vi.list[r.config.app]}`;return r.config.app==="konnect"?q=q.replace(/{controlPlaneId}/gi,((Y=r.config)==null?void 0:Y.controlPlaneId)||""):r.config.app==="kongManager"&&(q=q.replace(/\/{workspace}/gi,(xe=r.config)!=null&&xe.workspace?`/${r.config.workspace}`:"")),q}),C=n.ref(""),h=n.computed(()=>{const q=r.config.app==="konnect"||r.config.isExactMatch;return q?{isExactMatch:q,placeholder:i("certificates.search.placeholder")}:{isExactMatch:q,schema:r.config.filterSchema}}),{fetcher:m,fetcherState:b}=jf(r.config,x.value),v=()=>{C.value=""},w=()=>{l.value++},g=n.ref(""),A=(q,Y)=>{const xe=q.id;if(!Y(xe)){t("copy:error",{entity:q,field:"id",message:i("certificates.errors.copy")});return}t("copy:success",{entity:q,field:"id",message:i("certificates.copy.success",{val:xe})})},J=(q,Y)=>{const xe=JSON.stringify(q);if(!Y(xe)){t("copy:error",{entity:q,message:i("certificates.errors.copy")});return}t("copy:success",{entity:q,message:i("certificates.copy.success_brief")})},X=(q,Y)=>{q.type==="error"?t("copy:error",{entity:Y,field:"cert",message:i("certificates.errors.copy")}):t("copy:success",{entity:Y,field:"cert",message:i("certificates.copy.success_brief")})},I=async q=>{var xe;await((xe=r.canRetrieve)==null?void 0:xe.call(r,q))&&a.push(r.config.getViewRoute(q.id))},E=q=>({label:i("certificates.actions.view"),to:r.config.getViewRoute(q)}),$=q=>({label:i("certificates.actions.edit"),to:r.config.getEditRoute(q)}),R=q=>{if(r.config.getCreateSniRoute)return{label:i("certificates.actions.addSni"),to:r.config.getCreateSniRoute(q)}},H=n.ref(void 0),D=n.ref(!1),j=n.ref(!1),re=n.ref(""),fe=Tf(r.config,x.value),{certificateDataCache:be,getCertificateData:ue}=pt.useCertificate(),pe=q=>{H.value=q,D.value=!0},we=()=>{D.value=!1},or=async()=>{var q,Y,xe;if((q=H.value)!=null&&q.id){j.value=!0;try{await c.delete(fe(H.value.id)),j.value=!1,D.value=!1,l.value++,t("delete:success",H.value)}catch(Ge){re.value=((xe=(Y=Ge.response)==null?void 0:Y.data)==null?void 0:xe.message)||Ge.message||i("certificates.errors.delete"),t("error",Ge)}finally{j.value=!1}}};n.watch(b,q=>{if(q.status===Dt.Error){g.value=i("certificates.errors.general"),t("error",q.error);return}be.value={},g.value=""});const F=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("certificates.list.empty_state.description"),title:i("certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(F.value.title=i("certificates.list.empty_state.title"),F.value.ctaText=i("certificates.actions.create"))}),(q,Y)=>{const xe=n.resolveComponent("KButton"),Ge=n.resolveComponent("KBadge"),Ur=n.resolveComponent("KTruncate"),Q=n.resolveComponent("KDropdownItem"),he=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",o1,[n.createVNode(n.unref(Nf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":F.value,"enable-entity-actions":"","error-message":g.value,fetcher:n.unref(m),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:C.value,"table-headers":n.unref(y),onClearSearchInput:v,"onClick:row":Y[2]||(Y[2]=W=>I(W)),onSort:w},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Of),{modelValue:C.value,"onUpdate:modelValue":Y[0]||(Y[0]=W=>C.value=W),config:h.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[n.createVNode(n.unref(Et),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.createVNode(xe,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),subject:n.withCtx(({row:W})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",s1,n.toDisplayString((ye=W==null?void 0:W.metadata)!=null&&ye.subject?W.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",a1,n.toDisplayString(n.unref(ue)(W).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:W})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",c1,n.toDisplayString((ye=W==null?void 0:W.metadata)!=null&&ye.expiry?n.unref(o)(W.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",l1,n.toDisplayString(n.unref(ue)(W).schemaExpiry?n.unref(o)(n.unref(ue)(W).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:W})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",u1,n.toDisplayString((ye=W==null?void 0:W.metadata)!=null&&ye.dns_names?`dns=${W.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",d1,n.toDisplayString(n.unref(ue)(W).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:W})=>[W!=null&&W.cert?(n.openBlock(),n.createBlock(n.unref(Fh),{key:0,"data-testid":"copy-certificate-cert",notify:ye=>X(ye,W),truncated:!0,uuid:W.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",f1,"-"))]),tags:n.withCtx(({row:W})=>{var ye;return[((ye=W==null?void 0:W.tags)==null?void 0:ye.length)>0?(n.openBlock(),n.createBlock(Ur,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W==null?void 0:W.tags,sr=>(n.openBlock(),n.createBlock(Ge,{key:sr,onClick:Y[1]||(Y[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(sr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",p1,"-"))]}),actions:n.withCtx(({row:W})=>[n.createVNode(he,null,{default:n.withCtx(({copyToClipboard:ye})=>[n.createVNode(Q,{"data-testid":"action-entity-copy-id",onClick:sr=>A(W,ye)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(he,null,{default:n.withCtx(({copyToClipboard:ye})=>[n.createVNode(Q,{"data-testid":"action-entity-copy-json",onClick:sr=>J(W,ye)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Et),{"auth-function":()=>e.canRetrieve(W)},{default:n.withCtx(()=>[n.createVNode(Q,{"data-testid":"action-entity-view","has-divider":"",item:E(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canEdit(W)},{default:n.withCtx(()=>[n.createVNode(Q,{"data-testid":"action-entity-edit",item:$(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Et),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(Q,{"data-testid":"action-entity-add-sni",item:R(W.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Et),{"auth-function":()=>e.canDelete(W)},{default:n.withCtx(()=>[n.createVNode(Q,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:ye=>pe(W)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("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"]),n.createVNode(n.unref(_f),{"action-pending":j.value,"entity-type":n.unref(Sa).Certificate,error:re.value,title:n.unref(i)("certificates.delete.title"),visible:D.value,onCancel:we,onProceed:or},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),fb="",Mr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},y1=Mr(h1,[["__scopeId","data-v-7079e57f"]]),m1={class:"kong-ui-entities-certificates-form"},g1=n.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:""}},emits:["update","error","loading"],setup(e,{emit:t}){var w;const r=e,i=Lr.useRouter(),{i18nT:o,i18n:{t:s}}=pt.useI18n(),{getMessageFromError:a}=Vf(),{axiosInstance:c}=so({headers:(w=r.config)==null?void 0:w.requestHeaders}),l=n.computed(()=>vi.form[r.config.app].edit),d=n.computed(()=>r.certificateId?ir.Edit:ir.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),y=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),x=n.computed(()=>(d.value===ir.Create||JSON.stringify(p.fields)!==JSON.stringify(y))&&!!p.fields.cert&&!!p.fields.key),C=g=>{var A;p.fields.cert=(g==null?void 0:g.cert)||"",p.fields.key=(g==null?void 0:g.key)||"",p.fields.certAlt=(g==null?void 0:g.cert_alt)||"",p.fields.keyAlt=(g==null?void 0:g.key_alt)||"",p.fields.tags=((A=g==null?void 0:g.tags)==null?void 0:A.join(", "))||"",Object.assign(y,p.fields)},h=()=>{i.push(r.config.cancelRoute)},m=n.computed(()=>{var A,J;let g=`${r.config.apiBaseUrl}${vi.form[r.config.app].validate}`;return r.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((A=r.config)==null?void 0:A.controlPlaneId)||""):r.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(J=r.config)!=null&&J.workspace?`/${r.config.workspace}`:"")),g=g.replace(/{id}/gi,r.certificateId),g}),b=n.computed(()=>{var A,J;let g=`${r.config.apiBaseUrl}${vi.form[r.config.app][d.value]}`;return r.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((A=r.config)==null?void 0:A.controlPlaneId)||""):r.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(J=r.config)!=null&&J.workspace?`/${r.config.workspace}`:"")),g=g.replace(/{id}/gi,r.certificateId),g}),v=async()=>{var g,A,J,X,I,E,$,R,H;try{p.isReadonly=!0;const D={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(A=(g=p.fields.tags.split(","))==null?void 0:g.map(re=>String(re||"").trim()))==null?void 0:A.filter(re=>re!=="")};let j;await c.post(m.value,D),d.value==="create"?j=await c.post(b.value,D):d.value==="edit"&&(j=((J=r.config)==null?void 0:J.app)==="konnect"?await c.put(b.value,D):await c.patch(b.value,D)),p.fields.cert=((X=j==null?void 0:j.data)==null?void 0:X.cert)||"",p.fields.key=((I=j==null?void 0:j.data)==null?void 0:I.key)||"",p.fields.certAlt=((E=j==null?void 0:j.data)==null?void 0:E.cert_alt)||"",p.fields.keyAlt=(($=j==null?void 0:j.data)==null?void 0:$.key_alt)||"",p.fields.tags=((H=(R=j==null?void 0:j.data)==null?void 0:R.tags)==null?void 0:H.join(", "))||"",Object.assign(y,p.fields),t("update",j==null?void 0:j.data)}catch(D){p.errorMessage=a(D),t("error",D)}finally{p.isReadonly=!1}};return(g,A)=>{const J=n.resolveComponent("KTextArea"),X=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",m1,[n.createVNode(n.unref(Ef),{"can-submit":x.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":l.value,"is-readonly":p.isReadonly,onCancel:h,"onFetch:error":A[5]||(A[5]=I=>g.$emit("error",I)),"onFetch:success":C,onLoading:A[6]||(A[6]=I=>g.$emit("loading",I)),onSubmit:v},{default:n.withCtx(()=>[n.createVNode(n.unref(oo),{description:n.unref(s)("certificates.form.sections.ssl.description"),title:n.unref(s)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(J,{modelValue:p.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=I=>p.fields.cert=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(J,{modelValue:p.fields.key,"onUpdate:modelValue":A[1]||(A[1]=I=>p.fields.key=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(J,{modelValue:p.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=I=>p.fields.certAlt=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(J,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=I=>p.fields.keyAlt=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key-alt","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(oo),{description:n.unref(s)("certificates.form.sections.general.description"),title:n.unref(s)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(X,{modelValue:p.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=I=>p.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(s)("certificates.form.fields.tags.help"),label:n.unref(s)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("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","is-readonly"])])}}}),pb="",b1=Mr(g1,[["__scopeId","data-v-ba62e0cc"]]),Ii={list:{konnect:"/api/runtime_groups/{controlPlaneId}/ca_certificates",kongManager:"/{workspace}/ca_certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/ca_certificates",edit:"/api/runtime_groups/{controlPlaneId}/ca_certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/ca-certificate/validate"},kongManager:{create:"/{workspace}/ca_certificates",edit:"/{workspace}/ca_certificates/{id}",validate:"/{workspace}/schemas/ca_certificates/validate"}}},w1={class:"kong-ui-ca-certificate-entity-config-card"},v1={key:0},k1=n.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","copy:success"],setup(e,{emit:t}){const r=e,i=["dns_names","san_names","subject"],{i18n:{t:o,formatUnixTimeStamp:s}}=pt.useI18n(),{convertKeyToTitle:a}=Df(),{getPropValue:c}=Pf(),{getCertificateData:l}=pt.useCertificate(),d=n.computed(()=>Ii.form[r.config.app].edit),p=n.ref(),y=n.computed(()=>{if(p.value)return l(p.value)}),x=n.computed(()=>{var w;return((w=y.value)==null?void 0:w.schemaIssuer)||""}),C=n.computed(()=>{var w,g;return(w=y.value)!=null&&w.schemaExpiry?s((g=y.value)==null?void 0:g.schemaExpiry):""}),h=n.computed(()=>{var w;return((w=y.value)==null?void 0:w.schemaKeyUsages)||[]}),m=(w,g)=>{const A=c("rowValue",g);if(w==="expiry")return C.value;if(w==="key_usages")return h.value;if(A)return A[w]},b=w=>{p.value=w,t("fetch:success",w)},v=n.ref({id:{},updated_at:{},created_at:{},cert:{section:le.Basic,label:o("ca-certificates.form.fields.cert.label"),tooltip:o("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:le.Basic,label:o("ca-certificates.form.fields.cert_digest.label"),tooltip:o("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:le.Basic,type:ne.Json,order:7},...r.config.app==="kongManager"&&{expiry:{label:o("certificates.list.table_headers.expiry"),section:le.Basic,order:1.7,forceShow:!0},issuer:{section:le.Basic,order:1.5,forceShow:!0},key_usages:{section:le.Basic,forceShow:!0}},tags:{tooltip:o("ca-certificates.form.fields.tags.tooltip")}});return(w,g)=>{const A=n.resolveComponent("KCodeBlock"),J=n.resolveComponent("KLabel"),X=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",w1,[n.createVNode(n.unref(If),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":v.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":g[0]||(g[0]=I=>w.$emit("copy:success",I)),"onFetch:error":g[1]||(g[1]=I=>w.$emit("fetch:error",I)),"onFetch:success":b,onLoading:g[2]||(g[2]=I=>w.$emit("loading",I))},{cert:n.withCtx(I=>[n.unref(c)("rowValue",I)?(n.openBlock(),n.createBlock(A,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",I),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(J,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(I=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",I)).filter(E=>!i.includes(E)),E=>(n.openBlock(),n.createBlock(n.unref(ki),{key:E,"data-testid":`ca-cert-metadata-${E}`,item:{key:E,label:n.unref(a)(E),value:m(E,I),type:E==="key_usages"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),key_usages:n.withCtx(()=>[h.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",v1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,(I,E)=>(n.openBlock(),n.createBlock(X,{key:`key_usages-badge-tag-${E}`,class:"config-badge","data-testid":`key_usages-badge-tag-${E}`,"truncation-tooltip":I},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(I),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),hb="",C1=Mr(k1,[["__scopeId","data-v-5110105b"]]),S1={class:"kong-ui-entities-ca-certificates-list"},x1={key:0},A1={key:1},B1={key:0},I1={key:1},E1={key:1},N1=n.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}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var or;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),a=Lr.useRouter(),{axiosInstance:c}=so({headers:(or=r.config)==null?void 0:or.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={issuer:{label:i("ca-certificates.list.table_headers.issuer")},expiry:{label:i("ca-certificates.list.table_headers.expiry")},tags:{label:i("ca-certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var de,q;let F=`${r.config.apiBaseUrl}${Ii.list[r.config.app]}`;return r.config.app==="konnect"?F=F.replace(/{controlPlaneId}/gi,((de=r.config)==null?void 0:de.controlPlaneId)||""):r.config.app==="kongManager"&&(F=F.replace(/\/{workspace}/gi,(q=r.config)!=null&&q.workspace?`/${r.config.workspace}`:"")),F}),C=n.ref(""),h=n.computed(()=>{const F=r.config.app==="konnect"||r.config.isExactMatch;return F?{isExactMatch:F,placeholder:i("ca-certificates.search.placeholder")}:{isExactMatch:F,schema:r.config.filterSchema}}),{fetcher:m,fetcherState:b}=jf(r.config,x.value),v=()=>{C.value=""},w=()=>{l.value++},g=n.ref(""),A=(F,de)=>{const q=F.id;if(!de(q)){t("copy:error",{entity:F,field:"id",message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:F,field:"id",message:i("ca-certificates.copy.success",{val:q})})},J=(F,de)=>{const q=JSON.stringify(F);if(!de(q)){t("copy:error",{entity:F,message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:F,message:i("ca-certificates.copy.success_brief")})},X=async F=>{var q;await((q=r.canRetrieve)==null?void 0:q.call(r,F))&&a.push(r.config.getViewRoute(F.id))},I=F=>({label:i("ca-certificates.actions.view"),to:r.config.getViewRoute(F)}),E=F=>({label:i("ca-certificates.actions.edit"),to:r.config.getEditRoute(F)}),$=n.ref(void 0),R=n.ref(!1),H=n.ref(!1),D=n.ref(""),j=Tf(r.config,x.value),{certificateDataCache:re,getCertificateData:fe}=pt.useCertificate(),be=F=>{$.value=F,R.value=!0},ue=()=>{R.value=!1},pe=async()=>{var F,de,q;if((F=$.value)!=null&&F.id){H.value=!0;try{await c.delete(j($.value.id)),H.value=!1,R.value=!1,l.value++,t("delete:success",$.value)}catch(Y){D.value=((q=(de=Y.response)==null?void 0:de.data)==null?void 0:q.message)||Y.message||i("ca-certificates.errors.delete"),t("error",Y)}finally{H.value=!1}}};n.watch(b,F=>{if(F.status===Dt.Error){g.value=i("ca-certificates.errors.general"),t("error",F.error);return}re.value={},g.value=""});const we=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("ca-certificates.list.empty_state.description"),title:i("ca-certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(we.value.title=i("ca-certificates.list.empty_state.title"),we.value.ctaText=i("ca-certificates.actions.create"))}),(F,de)=>{const q=n.resolveComponent("KButton"),Y=n.resolveComponent("KBadge"),xe=n.resolveComponent("KTruncate"),Ge=n.resolveComponent("KDropdownItem"),Ur=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",S1,[n.createVNode(n.unref(Nf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":we.value,"enable-entity-actions":"","error-message":g.value,fetcher:n.unref(m),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:C.value,"table-headers":n.unref(y),onClearSearchInput:v,"onClick:row":de[2]||(de[2]=Q=>X(Q)),onSort:w},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Of),{modelValue:C.value,"onUpdate:modelValue":de[0]||(de[0]=Q=>C.value=Q),config:h.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[n.createVNode(n.unref(Et),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),issuer:n.withCtx(({row:Q})=>{var he;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",x1,n.toDisplayString((he=Q==null?void 0:Q.metadata)!=null&&he.issuer?Q.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",A1,n.toDisplayString(n.unref(fe)(Q).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:Q})=>{var he;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",B1,n.toDisplayString((he=Q==null?void 0:Q.metadata)!=null&&he.expiry?n.unref(o)(Q.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",I1,n.toDisplayString(n.unref(fe)(Q).schemaExpiry?n.unref(o)(n.unref(fe)(Q).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:Q})=>{var he;return[((he=Q==null?void 0:Q.tags)==null?void 0:he.length)>0?(n.openBlock(),n.createBlock(xe,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Q==null?void 0:Q.tags,W=>(n.openBlock(),n.createBlock(Y,{key:W,onClick:de[1]||(de[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(W),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",E1,"-"))]}),actions:n.withCtx(({row:Q})=>[n.createVNode(Ur,null,{default:n.withCtx(({copyToClipboard:he})=>[n.createVNode(Ge,{"data-testid":"action-entity-copy-id",onClick:W=>A(Q,he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Ur,null,{default:n.withCtx(({copyToClipboard:he})=>[n.createVNode(Ge,{"data-testid":"action-entity-copy-json",onClick:W=>J(Q,he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Et),{"auth-function":()=>e.canRetrieve(Q)},{default:n.withCtx(()=>[n.createVNode(Ge,{"data-testid":"action-entity-view","has-divider":"",item:I(Q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canEdit(Q)},{default:n.withCtx(()=>[n.createVNode(Ge,{"data-testid":"action-entity-edit",item:E(Q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canDelete(Q)},{default:n.withCtx(()=>[n.createVNode(Ge,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:he=>be(Q)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("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"]),n.createVNode(n.unref(_f),{"action-pending":H.value,"entity-type":n.unref(Sa).CACertificate,error:D.value,title:n.unref(i)("ca-certificates.delete.title"),visible:R.value,onCancel:ue,onProceed:pe},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),yb="",_1=Mr(N1,[["__scopeId","data-v-d539b808"]]),O1={class:"kong-ui-entities-ca-certificates-form"},T1=n.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 v;const r=e,i=Lr.useRouter(),{i18n:{t:o}}=pt.useI18n(),{getMessageFromError:s}=Vf(),{axiosInstance:a}=so({headers:(v=r.config)==null?void 0:v.requestHeaders}),c=n.computed(()=>Ii.form[r.config.app].edit),l=n.computed(()=>r.certificateId?ir.Edit:ir.Create),d=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),y=n.computed(()=>(l.value===ir.Create||JSON.stringify(d.fields)!==JSON.stringify(p))&&!!d.fields.cert),x=w=>{var g;d.fields.cert=(w==null?void 0:w.cert)||"",d.fields.certDigest=(w==null?void 0:w.cert_digest)||"",d.fields.tags=((g=w==null?void 0:w.tags)==null?void 0:g.join(", "))||"",Object.assign(p,d.fields)},C=()=>{i.push(r.config.cancelRoute)},h=n.computed(()=>{var g,A;let w=`${r.config.apiBaseUrl}${Ii.form[r.config.app].validate}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((g=r.config)==null?void 0:g.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(A=r.config)!=null&&A.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.certificateId),w}),m=n.computed(()=>{var g,A;let w=`${r.config.apiBaseUrl}${Ii.form[r.config.app][l.value]}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((g=r.config)==null?void 0:g.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(A=r.config)!=null&&A.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.certificateId),w}),b=async()=>{var w,g,A,J,X,I,E;try{d.isReadonly=!0;const $={cert:d.fields.cert,cert_digest:d.fields.certDigest||null,tags:(g=(w=d.fields.tags.split(","))==null?void 0:w.map(H=>String(H||"").trim()))==null?void 0:g.filter(H=>H!=="")};let R;await a.post(h.value,$),l.value==="create"?R=await a.post(m.value,$):l.value==="edit"&&(R=((A=r.config)==null?void 0:A.app)==="konnect"?await a.put(m.value,$):await a.patch(m.value,$)),d.fields.cert=((J=R==null?void 0:R.data)==null?void 0:J.cert)||"",d.fields.certDigest=((X=R==null?void 0:R.data)==null?void 0:X.cert_digest)||"",d.fields.tags=((E=(I=R==null?void 0:R.data)==null?void 0:I.tags)==null?void 0:E.join(", "))||"",Object.assign(p,d.fields),t("update",R==null?void 0:R.data)}catch($){d.errorMessage=s($),t("error",$)}finally{d.isReadonly=!1}};return(w,g)=>{const A=n.resolveComponent("KTextArea"),J=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",O1,[n.createVNode(n.unref(Ef),{"can-submit":y.value,config:e.config,"edit-id":e.certificateId,"error-message":d.errorMessage,"fetch-url":c.value,"is-readonly":d.isReadonly,onCancel:C,"onFetch:error":g[3]||(g[3]=X=>w.$emit("error",X)),"onFetch:success":x,onLoading:g[4]||(g[4]=X=>w.$emit("loading",X)),onSubmit:b},{default:n.withCtx(()=>[n.createVNode(n.unref(oo),{description:n.unref(o)("ca-certificates.form.sections.cert.description"),title:n.unref(o)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(A,{modelValue:d.fields.cert,"onUpdate:modelValue":g[0]||(g[0]=X=>d.fields.cert=X),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert","disable-character-limit":"",label:n.unref(o)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.cert.tooltip")},readonly:d.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(J,{modelValue:d.fields.certDigest,"onUpdate:modelValue":g[1]||(g[1]=X=>d.fields.certDigest=X),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(o)("ca-certificates.form.fields.cert_digest.label"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(oo),{description:n.unref(o)("ca-certificates.form.sections.general.description"),title:n.unref(o)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(J,{modelValue:d.fields.tags,"onUpdate:modelValue":g[2]||(g[2]=X=>d.fields.tags=X),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(o)("ca-certificates.form.fields.tags.help"),label:n.unref(o)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(o)("ca-certificates.form.fields.tags.placeholder"),readonly:d.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","is-readonly"])])}}}),mb="",V1=Mr(T1,[["__scopeId","data-v-a1cf8ed1"]]),j1={class:"kong-ui-certificate-entity-config-card"},D1={key:0},P1=n.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","copy:success"],setup(e,{emit:t}){const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),{convertKeyToTitle:a}=Df(),{getPropValue:c}=Pf(),{getCertificateData:l}=pt.useCertificate(),d=n.computed(()=>vi.form[r.config.app].edit),p=n.ref(),y=n.ref({id:{},cert:{section:le.Basic},key:{section:le.Basic,type:ne.Redacted},metadata:{section:le.Basic,type:ne.Json},snis:{section:le.Basic,type:ne.BadgeTag,label:i("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:i("certificates.form.fields.tags.tooltip")},...r.config.app==="kongManager"&&{expiry:{section:le.Basic,label:i("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:le.Basic,label:i("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:le.Basic,label:i("certificates.list.table_headers.san"),forceShow:!0},subject:{section:le.Basic,label:i("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:le.Advanced},key_alt:{section:le.Advanced,type:ne.Redacted}}),x=I=>{p.value=I,t("fetch:success",I)},C=(I,E)=>{const $=c("rowValue",E);if(I==="expiry")return m.value;if(I==="key_usages")return g.value;if(I==="san_names")return v.value;if($)return $[I]},h=n.computed(()=>{if(p.value)return l(p.value)}),m=n.computed(()=>{var I,E;return(I=h.value)!=null&&I.schemaExpiry?o((E=h.value)==null?void 0:E.schemaExpiry):""}),b=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaIssuer)||""}),v=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSanNames)||""}),w=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSubject)||""}),g=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaKeyUsages)||[]}),A=n.computed(()=>{var I,E;return((E=(I=p==null?void 0:p.value)==null?void 0:I.snis)==null?void 0:E.length)>0}),J=n.computed(()=>{var I;return!!((I=p==null?void 0:p.value)!=null&&I.cert_alt)}),X=I=>{var E,$;return I==="san_names"?i("certificates.list.table_headers.san"):(($=(E=y.value)==null?void 0:E[I])==null?void 0:$.label)||a(I)};return(I,E)=>{const $=n.resolveComponent("KCodeBlock"),R=n.resolveComponent("KLabel"),H=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",j1,[n.createVNode(n.unref(If),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":y.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":E[0]||(E[0]=D=>I.$emit("copy:success",D)),"onFetch:error":E[1]||(E[1]=D=>I.$emit("fetch:error",D)),"onFetch:success":x,onLoading:E[2]||(E[2]=D=>I.$emit("loading",D))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(D=>[n.unref(c)("rowValue",D)?(n.openBlock(),n.createBlock($,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",D),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(R,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(D=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",D)),j=>(n.openBlock(),n.createBlock(n.unref(ki),{key:j,item:{key:j,value:C(j,D),label:X(j),type:j==="key_usages"||j==="snis"||j==="dns_names"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(m.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[g.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",D1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(D,j)=>(n.openBlock(),n.createBlock(H,{key:`key_usages-badge-tag-${j}`,class:"config-badge","data-testid":`key_usages-badge-tag-${j}`,"truncation-tooltip":D},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(D),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:2},[A.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},J.value?{name:"cert_alt",fn:n.withCtx(D=>[n.createTextVNode(" > "),n.unref(c)("rowValue",D)?(n.openBlock(),n.createBlock($,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(c)("rowValue",D),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),gb="",$1=Mr(P1,[["__scopeId","data-v-69ded264"]]);_e.CACertificateConfigCard=C1,_e.CACertificateForm=V1,_e.CACertificateList=_1,_e.CertificateConfigCard=$1,_e.CertificateForm=b1,_e.CertificateList=y1,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
|
|
147
|
+
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}function l0(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=Bi(e,o),i=Ve[r],!i&&Ai(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||e0(r);return t}function u0(e,t,r){var i="",o=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(It(e,t,c,!1,!1)||typeof c>"u"&&It(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}function Bf(e,t,r,i){var o="",s=e.tag,a,c,l;for(a=0,c=r.length;a<c;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(It(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&It(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=$a(e,t)),e.dump&&Si===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function d0(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,c,l,d,p;for(a=0,c=s.length;a<c;a+=1)p="",i!==""&&(p+=", "),e.condenseFlow&&(p+='"'),l=s[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),It(e,t,l,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),It(e,t,d,!1,!1)&&(p+=e.dump,i+=p));e.tag=o,e.dump="{"+i+"}"}function f0(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),c,l,d,p,y,x;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(c=0,l=a.length;c<l;c+=1)x="",(!i||o!=="")&&(x+=$a(e,t)),d=a[c],p=r[d],e.replacer&&(p=e.replacer.call(r,d,p)),It(e,t+1,d,!0,!0,!0)&&(y=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,y&&(e.dump&&Si===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,y&&(x+=$a(e,t)),It(e,t+1,p,!0,y)&&(e.dump&&Si===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,o+=x));e.tag=s,e.dump=o||"{}"}function If(e,t,r){var i,o,s,a,c,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(c=o[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(r?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(l=e.styleMap[c.tag]||c.defaultStyle,lf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(uf.call(c.represent,l))i=c.represent[l](t,l);else throw new Pe("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function It(e,t,r,i,o,s,a){e.tag=null,e.dump=r,If(e,r,!1)||If(e,r,!0);var c=lf.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var p=c==="[object Object]"||c==="[object Array]",y,x;if(p&&(y=e.duplicates.indexOf(r),x=y!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(o=!1),x&&e.usedDuplicates[y])e.dump="*ref_"+y;else{if(p&&x&&!e.usedDuplicates[y]&&(e.usedDuplicates[y]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(f0(e,t,e.dump,o),x&&(e.dump="&ref_"+y+e.dump)):(d0(e,t,e.dump),x&&(e.dump="&ref_"+y+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Bf(e,t-1,e.dump,o):Bf(e,t,e.dump,o),x&&(e.dump="&ref_"+y+e.dump)):(u0(e,t,e.dump),x&&(e.dump="&ref_"+y+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&a0(e,e.dump,t,s,l);else{if(c==="[object Undefined]"||e.skipInvalid)return!1;throw new Pe("unacceptable kind of an object to dump "+c)}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 p0(e,t){var r=[],i=[],o,s;for(Ra(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}function Ra(e,t,r){var i,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)Ra(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)Ra(e[i[o]],t,r)}function h0(e,t){t=t||{};var r=new r0(t);r.noRefs||p0(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),It(r,0,i,!0,!0)?r.dump+`
|
|
148
|
+
`:""}var y0=h0,g0={dump:y0};function Ua(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 m0=Ee,b0=Ed,w0=Td,v0=$d,k0=Md,C0=Oa,S0=cf.load,x0=cf.loadAll,A0=g0.dump,B0=Pe,I0={binary:Fd,float:Pd,map:Od,null:Vd,pairs:qd,set:zd,timestamp:Ld,bool:jd,int:Dd,merge:Hd,omap:Kd,seq:_d,str:Nd},E0=Ua("safeLoad","load"),N0=Ua("safeLoadAll","loadAll"),_0=Ua("safeDump","dump"),O0={Type:m0,Schema:b0,FAILSAFE_SCHEMA:w0,JSON_SCHEMA:v0,CORE_SCHEMA:k0,DEFAULT_SCHEMA:C0,load:S0,loadAll:x0,dump:A0,YAMLException:B0,types:I0,safeLoad:E0,safeLoadAll:N0,safeDump:_0};const T0={key:0,class:"config-card-display-form"},V0=["data-testid"],j0={key:0,class:"config-card-prop-section-title"},D0={key:1,class:"config-card-display-json"},P0={key:2,class:"config-card-display-yaml"},$0=ot(n.defineComponent({__name:"ConfigCardDisplay",props:{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:()=>null}},setup(e){const t=e,r=n.useSlots(),{i18n:{t:i}}=Ae.useI18n(),o=c=>!!(c.tooltip||r[`${c.key}-label-tooltip`]),s=n.ref(""),a=n.ref("");return n.watch(()=>t.format,c=>{c==="json"?s.value=JSON.stringify(t.record,null,2):c==="yaml"&&(a.value=O0.dump(t.record))},{immediate:!0}),(c,l)=>{const d=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",T0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,p=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${p}-props`,class:n.normalizeClass(`config-card-details-${p}-props`),"data-testid":`config-card-details-${p}-props`},[p!=="basic"?(n.openBlock(),n.createElementBlock("div",j0,n.toDisplayString(p==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[p],y=>(n.openBlock(),n.createBlock(ki,{key:y.key,item:y},n.createSlots({label:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label`,{row:y},void 0,!0)]),[y.key]:n.withCtx(({rowValue:x})=>[n.renderSlot(c.$slots,y.key,{row:y,rowValue:x},void 0,!0)]),_:2},[o(y)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label-tooltip`,{row:y},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,V0))),128))])):n.createCommentVNode("",!0),e.format==="json"?(n.openBlock(),n.createElementBlock("div",D0,[n.createVNode(d,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),e.format==="yaml"?(n.openBlock(),n.createElementBlock("div",P0,[n.createVNode(d,{id:"config-card-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-6c45e9e4"]]),Ef="24px",M0=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},R0=e=>(n.pushScopeId("data-v-dd88a2bb"),e=e(),n.popScopeId(),e),U0=["aria-hidden"],L0={key:0,"data-testid":"kui-icon-svg-title"},H0=R0(()=>n.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)),F0=n.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:Ef,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=n.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 Ef}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.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?(n.openBlock(),n.createElementBlock("title",L0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),H0],8,U0))]),_:1},8,["aria-hidden","style"]))}}),K0=M0(F0,[["__scopeId","data-v-dd88a2bb"]]),q0={"data-testid":"config-card-title"},z0={class:"config-card-actions"},G0=["href"],W0={key:2,class:"config-card-details-section"},J0={key:3,class:"config-card-details-section"},Y0=["data-testid"],Z0={key:0,class:"config-card-prop-section-title"},Nf=ot(n.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}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:t}){var r;const i=e,o=n.useSlots(),{i18n:{t:s}}=Ae.useI18n(),{getMessageFromError:a}=Ae.useErrors(),{convertKeyToTitle:c}=Ae.useStringHelpers(),{axiosInstance:l}=Ae.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),y=E=>{p.value=E==null?void 0:E.value},x={id:{type:ne.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:le.Basic},name:{order:1,section:le.Basic},enabled:{type:ne.BadgeStatus,order:2,section:le.Basic},updated_at:{type:ne.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:le.Basic},created_at:{type:ne.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:le.Basic},tags:{type:ne.BadgeTag,order:-1,section:le.Basic}},C=n.ref(!1),h=n.ref(!1),g=n.ref(""),b=n.ref(),v=n.computed(()=>{var E,$,M;if(!b.value)return[];const H=[],D=Object.keys(b.value).length;for(const j in b.value){const re=($=(E=i.configSchema)==null?void 0:E[j])==null?void 0:$.order,fe=(M=x[j])==null?void 0:M.order;let be=D;(fe||fe===0)&&(be=fe===-1?D+1:fe),re&&(be=re===-1?D+1:re),H.push([j,be])}return H.sort(function(j,re){return j[1]-re[1]}),H.map(j=>{var re,fe;const be=j[0],ue=(re=b.value)==null?void 0:re[be],pe=((fe=i.configSchema)==null?void 0:fe[be])||{},we=x[be];return{key:be,value:ue,hidden:pe.hidden||!1,type:pe.type??((we==null?void 0:we.type)||ne.Text),label:pe.label??((we==null?void 0:we.label)||c(be)),tooltip:pe.tooltip??((we==null?void 0:we.tooltip)||void 0),section:pe.section??((we==null?void 0:we.section)||le.Advanced)}}).filter(j=>!j.hidden&&j.key!==i.pluginConfigKey)}),w=n.computed(()=>{var E,$;if(!b.value||!i.pluginConfigKey)return[];const M=b.value[i.pluginConfigKey]||{},H=Object.keys(M).length,D=[];for(const j in M){const re=($=(E=i.pluginConfigSchema)==null?void 0:E[j])==null?void 0:$.order,fe=M[j];let be=fe!=null&&fe!==""?H-1:H;re&&(be=re===-1?H+1:re),D.push([j,be])}return D.sort(function(j,re){return j[1]-re[1]}),D.map(j=>{var re;const fe=j[0],be=M[fe],ue=((re=i.pluginConfigSchema)==null?void 0:re[fe])||{};return{key:fe,value:be,hidden:ue.hidden||!1,type:ue.type??ne.Text,label:ue.label??c(fe),tooltip:ue.tooltip??void 0,section:le.Plugin}}).filter(j=>!j.hidden)}),m=n.computed(()=>{var E,$,M,H;return{basic:(E=v.value)==null?void 0:E.filter(D=>D.section===le.Basic),advanced:($=v.value)==null?void 0:$.filter(D=>D.section===le.Advanced),plugin:(H=w.value)==null?void 0:H.concat((M=v.value)==null?void 0:M.filter(D=>D.section===le.Plugin))}}),A=n.computed(()=>{const E=[];return m.value.basic.length&&E.push("basic"),m.value.advanced.length&&E.push("advanced"),m.value.plugin.length&&E.push("plugin"),E}),J=E=>!!(E.tooltip||o[`${E.key}-label-tooltip`]),X=n.computed(()=>{var E,$;let M=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?M=M.replace(/{controlPlaneId}/gi,((E=i.config)==null?void 0:E.controlPlaneId)||""):i.config.app==="kongManager"&&(M=M.replace(/\/{workspace}/gi,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),M=M.replace(/{id}/gi,i.config.entityId),M}),I=E=>{b.value&&E(JSON.stringify(b.value))?t("copy:success",b.value):t("copy:error")};return n.watch(C,E=>{t("loading",E)},{immediate:!0}),n.onBeforeMount(async()=>{h.value=!1,C.value=!0;try{const{data:E}=await l.get(X.value);if(i.dataKey)if(typeof E[i.dataKey]<"u")b.value={...E[i.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:i.dataKey}));else b.value={...E};Object.keys(i.configSchema).filter($=>i.configSchema[$].forceShow).forEach($=>{b.value&&typeof b.value[$]>"u"&&(b.value[$]=null)}),t("fetch:success",E)}catch(E){const $=a(E);g.value=$.startsWith("code")?s("baseConfigCard.errors.load"):$,h.value=!0,t("fetch:error",E)}finally{C.value=!1}}),(E,$)=>{const M=n.resolveComponent("KLabel"),H=n.resolveComponent("KSelect"),D=n.resolveComponent("KButton"),j=n.resolveComponent("KClipboardProvider"),re=n.resolveComponent("KSkeleton"),fe=n.resolveComponent("KEmptyState"),be=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(be,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",z0,[n.renderSlot(E.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(M,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(H,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:y})):n.createCommentVNode("",!0),i.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(D,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(K0),{size:n.unref(Qy)},null,8,["size"])],8,G0)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(j,{key:3},{default:n.withCtx(({copyToClipboard:ue})=>[!C.value&&!h.value?(n.openBlock(),n.createBlock(D,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:pe=>I(ue)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),body:n.withCtx(()=>[C.value?(n.openBlock(),n.createBlock(re,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(n.openBlock(),n.createBlock(fe,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(g.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",W0,[n.createVNode($0,{format:p.value,"prop-list-types":A.value,"property-collections":m.value,record:b.value},n.createSlots({_:2},[n.renderList(Object.keys(E.$slots),ue=>({name:ue,fn:n.withCtx(({row:pe,rowValue:we})=>[n.renderSlot(E.$slots,ue,{row:pe,rowValue:we},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",J0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(A.value,ue=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${ue}-props`,class:n.normalizeClass(`config-card-details-${ue}-props`),"data-testid":`config-card-details-${ue}-props`},[ue!=="basic"?(n.openBlock(),n.createElementBlock("div",Z0,n.toDisplayString(ue==="advanced"?n.unref(s)("baseConfigCard.sections.advanced"):n.unref(s)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value[ue],pe=>(n.openBlock(),n.createBlock(ki,{key:pe.key,item:pe},n.createSlots({label:n.withCtx(()=>[n.renderSlot(E.$slots,`${pe.key}-label`,{row:pe},void 0,!0)]),[pe.key]:n.withCtx(({rowValue:we})=>[n.renderSlot(E.$slots,pe.key,{row:pe,rowValue:we},void 0,!0)]),_:2},[J(pe)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(E.$slots,`${pe.key}-label-tooltip`,{row:pe},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Y0))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",q0,[n.renderSlot(E.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-24515123"]]),X0=["onReset","onSubmit"],Q0={class:"form-actions","data-testid":"form-actions"},_f=ot(n.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:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=e,o=Lr.useRouter(),{i18n:{t:s}}=Ae.useI18n(),{getMessageFromError:a}=Ae.useErrors(),{axiosInstance:c}=Ae.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),l=n.ref(!1),d=n.ref(!1),p=n.ref(""),y=n.computed(()=>i.canSubmit===!1||i.isReadonly),x=n.computed(()=>{var b,v;if(!i.editId)return"";let w=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((b=i.config)==null?void 0:b.controlPlaneId)||""):i.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(v=i.config)!=null&&v.workspace?`/${i.config.workspace}`:"")),w=w.replace(/{id}/gi,i.editId),w}),C=()=>{i.config.cancelRoute?o.push(i.config.cancelRoute):h()},h=()=>{t("cancel")},g=()=>{y.value||t("submit")};return n.watch(()=>l.value,b=>{t("loading",b)},{immediate:!0}),n.onBeforeMount(async()=>{if(i.editId)try{d.value=!1,l.value=!0;const{data:b}=await c.get(x.value);t("fetch:success",b)}catch(b){const v=a(b);p.value=v.startsWith("code")?s("baseForm.errors.edit"):v,d.value=!0,t("fetch:error",b)}finally{l.value=!1}}),(b,v)=>{const w=n.resolveComponent("KSkeleton"),m=n.resolveComponent("KEmptyState"),A=n.resolveComponent("KAlert"),J=n.resolveComponent("KButton"),X=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(X,{class:"kong-ui-entity-base-form"},{body:n.withCtx(()=>[l.value?(n.openBlock(),n.createBlock(w,{key:0,type:"form"})):d.value?(n.openBlock(),n.createBlock(m,{key:1,"cta-text":n.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":C,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(h,["prevent"]),onSubmit:n.withModifiers(g,["prevent"])},[n.renderSlot(b.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(A,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",Q0,[n.renderSlot(b.$slots,"form-actions",{},()=>[n.createVNode(J,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(J,{appearance:"primary","data-testid":"form-submit",disabled:y.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,X0))]),_:3})}}}),[["__scopeId","data-v-81612aef"]]),e1={key:0,"data-testid":"first-col"},t1=ot(n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=n.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[data-testid="first-col"]'))||null}),o=n.computed(()=>{var g,b;const v=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return v?((b=v[0])==null?void 0:b.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,b,v;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,p.value=((b=r.value)==null?void 0:b.clientWidth)||0,y.value=((v=l.value)==null?void 0:v.innerText)||""},l=n.ref({}),d=n.ref(0),p=n.ref(0),y=n.ref(""),x=n.computed(()=>[i.value,r.value]),C=n.watch(x,g=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(b=>{window.requestAnimationFrame(()=>{!Array.isArray(b)||!b.length||c()})});for(const b of g)b&&s.observe(b)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>p.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{C()}),(g,b)=>{const v=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",e1,[n.createVNode(v,{label:h.value?y.value:"","max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):n.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-e42a20c9"]]),r1={class:"toolbar-container"},i1={key:0,class:"toolbar-button-container"},n1=["data-testid"],Of=ot(n.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},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},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:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,{i18n:{t:i}}=Ae.useI18n(),o=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),s=m=>m.hasData||!!r.query,a=n.computed(()=>{const m=[];return Object.keys(r.tableHeaders).forEach(A=>{const J=r.tableHeaders[A];m.push({label:J.label??A,key:A,sortable:J.sortable??!1})}),r.enableEntityActions&&m.push({key:"actions",hideLabel:!0}),m}),c=m=>({"data-rowid":m.id,"data-testid":m.name,...r.rowAttributes(m)}),l=n.ref({}),d=m=>{var A;return(A=l.value)==null?void 0:A.$el.querySelector(`[data-rowid="${m.id}"]`)},p=m=>{const A={"data-testid":m.headerKey,...r.cellAttributes(m)};return m.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},y=()=>{t("empty-state-cta-clicked"),x()},x=()=>{t("clear-search-input")},C=n.computed(()=>r.disableRowClick?void 0:(m,A)=>{t("click:row",A)}),h=m=>{t("sort",m)},{setTablePreferences:g,getTablePreferences:b}=iy(),v=n.computed(()=>{const m=b(r.preferencesStorageKey);return{...r.initialFetcherParams,...m}}),w=m=>{r.preferencesStorageKey&&g(r.preferencesStorageKey,m)};return(m,A)=>{const J=n.resolveComponent("KIcon"),X=n.resolveComponent("KButton"),I=n.resolveComponent("KDropdown"),E=n.resolveComponent("KTable"),$=n.resolveComponent("KCard");return n.openBlock(),n.createBlock($,{class:"kong-ui-entity-base-table",title:e.title},{body:n.withCtx(()=>[n.createVNode(E,{ref_key:"tableRefs",ref:l,"cache-identifier":o.value,"cell-attrs":p,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-title":e.errorMessage,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":!!e.errorMessage,headers:a.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":c,"search-input":e.query,onKtableEmptyStateCtaClicked:y,"onRow:click":C.value,onSort:A[0]||(A[0]=M=>h(M)),"onUpdate:tablePreferences":w},n.createSlots({toolbar:n.withCtx(({state:M})=>[n.withDirectives(n.createElementVNode("div",r1,[n.renderSlot(m.$slots,"toolbar-filter",{},void 0,!0),m.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",i1,[n.renderSlot(m.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,s(M)]])]),actions:n.withCtx(({row:M,rowKey:H,rowValue:D})=>[n.createElementVNode("div",{class:"actions-container","data-testid":M.name},[n.createVNode(I,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(m.$slots,"actions",{row:M,rowKey:H,rowValue:D},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(X,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(J,{color:n.unref(Zy),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,n1)]),_:2},[n.renderList(e.tableHeaders,(M,H)=>({name:H,fn:n.withCtx(({row:D,rowKey:j,rowValue:re})=>[n.createVNode(t1,{"key-name":String(H),"row-el":d(D)},{default:n.withCtx(()=>[n.renderSlot(m.$slots,H,{row:D,rowKey:j,rowValue:re},()=>[n.createTextVNode(n.toDisplayString(re),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-86d2d2a3"]]),o1={key:0,class:"kong-ui-entity-delete-error"},s1={key:1,class:"description"},Tf=ot(n.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 r=e,{i18nT:i}=Ae.useI18n(),o=n.computed(()=>r.needConfirm?r.entityName:""),s=()=>{t("cancel")},a=()=>{t("proceed")};return(c,l)=>{const d=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:s,onProceed:a},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",o1,[n.createVNode(d,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(i),{class:"message",keypath:r.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.entityType),1)]),_:2},[r.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(r.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),r.description||c.$slots.description?(n.openBlock(),n.createElementBlock("div",s1,[n.renderSlot(c.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(r.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),a1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},c1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},l1=["fill"],u1={mask:"url(#mask0_180_20349)"},d1=["fill"],Vf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Jy})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",a1,[n.createElementVNode("mask",c1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,l1)]),n.createElementVNode("g",u1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,d1)])]))}}),f1={key:1,class:"kong-ui-entity-filter"},p1={class:"menu-item-title"},h1={class:"menu-item-indicator"},y1={class:"menu-item-body"},g1=["for"],m1={class:"menu-item-buttons"},b1={class:"filter-clear-button-container"},jf=ot(n.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 r=e,{i18n:{t:i}}=Ae.useI18n(),o=n.ref(!1),s=n.ref({}),a=n.computed(()=>{const b=[];return new URLSearchParams(r.modelValue).forEach((v,w)=>{v!==""&&b.push(w)}),b}),c=n.computed(()=>{const b=r.config.fields;return Object.keys(b).filter(v=>b[v].searchable).map(v=>({label:b[v].label||v,value:v}))});n.watch(()=>r.modelValue,b=>{s.value={},new URLSearchParams(b).forEach((v,w)=>{s.value[w]=v})});const l=()=>{o.value=!o.value},d=b=>{t("update:modelValue",b)},p=b=>`filter-${b}`,y=b=>{var v,w;return(((w=(v=r.config.schema)==null?void 0:v[b])==null?void 0:w.values)??[]).map(m=>({value:m,label:m}))},x=b=>{var v,w;return((w=(v=r.config.schema)==null?void 0:v[b])==null?void 0:w.type)??"text"},C=b=>{s.value={...s.value,[b]:""},g()},h=()=>{s.value={},g(!0)},g=(b=!1)=>{const v=Object.keys(s.value).reduce((w,m)=>(s.value[m]&&(w[m]=`${s.value[m]}`),w),{});b&&(o.value=!1),t("update:modelValue",new URLSearchParams(v).toString())};return(b,v)=>{const w=n.resolveComponent("KInput"),m=n.resolveComponent("KButton"),A=n.resolveComponent("KSelect"),J=n.resolveComponent("KMenuItem"),X=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(w,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{before:n.withCtx(()=>[n.createVNode(Vf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",f1,[n.createVNode(m,{appearance:"tertiary","data-testid":"filter-button",onClick:l},{default:n.withCtx(()=>[n.createVNode(Vf),n.createTextVNode(" "+n.toDisplayString(n.unref(i)("filter.filterButtonText"))+" "+n.toDisplayString(a.value.length>0?`(${a.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:l},null,512),[[n.vShow,o.value]]),n.withDirectives(n.createVNode(X,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(I,E)=>(n.openBlock(),n.createBlock(J,{key:I.value,"data-testid":I.value,expandable:"","last-menu-item":E===c.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",p1,[n.createTextVNode(n.toDisplayString(I.label)+" ",1),n.withDirectives(n.createElementVNode("span",h1,null,512),[[n.vShow,a.value.includes(I.value)]])])]),itemBody:n.withCtx(()=>{var $,M;return[n.createElementVNode("div",y1,[n.createElementVNode("label",{class:"menu-item-label",for:p(I.value)},n.toDisplayString(n.unref(i)("filter.fieldLabel")),9,g1),((M=($=e.config.schema)==null?void 0:$[I.value])==null?void 0:M.type)==="select"?(n.openBlock(),n.createBlock(A,{key:0,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":H=>s.value[I.value]=H,appearance:"select",items:y(I.value),placeholder:n.unref(i)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(w,{key:1,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":H=>s.value[I.value]=H,autocomplete:"off",placeholder:n.unref(i)("filter.inputPlaceholder"),type:x(I.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",m1,[n.createVNode(m,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:v[0]||(v[0]=H=>g(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.applyButtonText")),1)]),_:1}),n.createVNode(m,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:H=>C(I.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createElementVNode("div",b1,[n.createVNode(m,{size:"small",onClick:h},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[n.vShow,o.value]])]))}}}),[["__scopeId","data-v-4ea260f0"]]),Et=n.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=n.ref(void 0),i=n.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return n.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>i.value?n.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):n.createCommentVNode("",!0)}}),w1={class:"form-section-wrapper"},v1={key:0,class:"form-section-title"},k1={key:1,class:"form-section-description"},C1={key:2,class:"form-section-footer"},S1={class:"form-section-content"},oo=ot(n.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}},setup(e){const t=n.useSlots();return(r,i)=>(n.openBlock(),n.createElementBlock("fieldset",{class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[n.createElementVNode("div",w1,[e.hideInfoHeader?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(n.openBlock(),n.createElementBlock("h4",v1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",k1,[n.renderSlot(r.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",C1,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",S1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:so,useDeleteUrlBuilder:Df,useErrors:Pf,useExternalLinkCreator:xb,useFetchUrlBuilder:Ab,useFetcher:$f,useDebouncedFilter:Bb,useStringHelpers:Mf,useHelpers:Rf,useGatewayFeatureSupported:Ib,useTruncationDetector:Eb}=Ae,Nb="",_b="",x1={class:"kong-ui-entities-certificates-list"},A1={key:0},B1={key:1},I1={key:0},E1={key:1},N1={key:0},_1={key:1},O1={key:1},T1={key:1},V1=n.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}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var de;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),a=Lr.useRouter(),{axiosInstance:c}=so({headers:(de=r.config)==null?void 0:de.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={subject:{label:i("certificates.list.table_headers.subject")},expiry:{label:i("certificates.list.table_headers.expiry")},san:{label:i("certificates.list.table_headers.san")},cert:{label:i("certificates.list.table_headers.cert")},tags:{label:i("certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var Y,xe;let q=`${r.config.apiBaseUrl}${vi.list[r.config.app]}`;return r.config.app==="konnect"?q=q.replace(/{controlPlaneId}/gi,((Y=r.config)==null?void 0:Y.controlPlaneId)||""):r.config.app==="kongManager"&&(q=q.replace(/\/{workspace}/gi,(xe=r.config)!=null&&xe.workspace?`/${r.config.workspace}`:"")),q}),C=n.ref(""),h=n.computed(()=>{const q=r.config.app==="konnect"||r.config.isExactMatch;return q?{isExactMatch:q,placeholder:i("certificates.search.placeholder")}:{isExactMatch:q,schema:r.config.filterSchema}}),{fetcher:g,fetcherState:b}=$f(r.config,x.value),v=()=>{C.value=""},w=()=>{l.value++},m=n.ref(""),A=(q,Y)=>{const xe=q.id;if(!Y(xe)){t("copy:error",{entity:q,field:"id",message:i("certificates.errors.copy")});return}t("copy:success",{entity:q,field:"id",message:i("certificates.copy.success",{val:xe})})},J=(q,Y)=>{const xe=JSON.stringify(q);if(!Y(xe)){t("copy:error",{entity:q,message:i("certificates.errors.copy")});return}t("copy:success",{entity:q,message:i("certificates.copy.success_brief")})},X=(q,Y)=>{q.type==="error"?t("copy:error",{entity:Y,field:"cert",message:i("certificates.errors.copy")}):t("copy:success",{entity:Y,field:"cert",message:i("certificates.copy.success_brief")})},I=async q=>{var xe;await((xe=r.canRetrieve)==null?void 0:xe.call(r,q))&&a.push(r.config.getViewRoute(q.id))},E=q=>({label:i("certificates.actions.view"),to:r.config.getViewRoute(q)}),$=q=>({label:i("certificates.actions.edit"),to:r.config.getEditRoute(q)}),M=q=>{if(r.config.getCreateSniRoute)return{label:i("certificates.actions.addSni"),to:r.config.getCreateSniRoute(q)}},H=n.ref(void 0),D=n.ref(!1),j=n.ref(!1),re=n.ref(""),fe=Df(r.config,x.value),{certificateDataCache:be,getCertificateData:ue}=pt.useCertificate(),pe=q=>{H.value=q,D.value=!0},we=()=>{D.value=!1},or=async()=>{var q,Y,xe;if((q=H.value)!=null&&q.id){j.value=!0;try{await c.delete(fe(H.value.id)),j.value=!1,D.value=!1,l.value++,t("delete:success",H.value)}catch(We){re.value=((xe=(Y=We.response)==null?void 0:Y.data)==null?void 0:xe.message)||We.message||i("certificates.errors.delete"),t("error",We)}finally{j.value=!1}}};n.watch(b,q=>{if(q.status===Dt.Error){m.value=i("certificates.errors.general"),t("error",q.error);return}be.value={},m.value=""});const F=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("certificates.list.empty_state.description"),title:i("certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(F.value.title=i("certificates.list.empty_state.title"),F.value.ctaText=i("certificates.actions.create"))}),(q,Y)=>{const xe=n.resolveComponent("KButton"),We=n.resolveComponent("KBadge"),Ur=n.resolveComponent("KTruncate"),Q=n.resolveComponent("KDropdownItem"),he=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",x1,[n.createVNode(n.unref(Of),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":F.value,"enable-entity-actions":"","error-message":m.value,fetcher:n.unref(g),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:C.value,"table-headers":n.unref(y),onClearSearchInput:v,"onClick:row":Y[2]||(Y[2]=G=>I(G)),onSort:w},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(jf),{modelValue:C.value,"onUpdate:modelValue":Y[0]||(Y[0]=G=>C.value=G),config:h.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[n.createVNode(n.unref(Et),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.createVNode(xe,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),subject:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",A1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.subject?G.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",B1,n.toDisplayString(n.unref(ue)(G).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",I1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.expiry?n.unref(o)(G.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",E1,n.toDisplayString(n.unref(ue)(G).schemaExpiry?n.unref(o)(n.unref(ue)(G).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",N1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.dns_names?`dns=${G.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",_1,n.toDisplayString(n.unref(ue)(G).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:G})=>[G!=null&&G.cert?(n.openBlock(),n.createBlock(n.unref(ey),{key:0,"data-testid":"copy-certificate-cert",notify:ye=>X(ye,G),truncated:!0,uuid:G.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",O1,"-"))]),tags:n.withCtx(({row:G})=>{var ye;return[((ye=G==null?void 0:G.tags)==null?void 0:ye.length)>0?(n.openBlock(),n.createBlock(Ur,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(G==null?void 0:G.tags,sr=>(n.openBlock(),n.createBlock(We,{key:sr,onClick:Y[1]||(Y[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(sr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",T1,"-"))]}),actions:n.withCtx(({row:G})=>[n.createVNode(he,null,{default:n.withCtx(({copyToClipboard:ye})=>[n.createVNode(Q,{"data-testid":"action-entity-copy-id",onClick:sr=>A(G,ye)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(he,null,{default:n.withCtx(({copyToClipboard:ye})=>[n.createVNode(Q,{"data-testid":"action-entity-copy-json",onClick:sr=>J(G,ye)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Et),{"auth-function":()=>e.canRetrieve(G)},{default:n.withCtx(()=>[n.createVNode(Q,{"data-testid":"action-entity-view","has-divider":"",item:E(G.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canEdit(G)},{default:n.withCtx(()=>[n.createVNode(Q,{"data-testid":"action-entity-edit",item:$(G.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Et),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(Q,{"data-testid":"action-entity-add-sni",item:M(G.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Et),{"auth-function":()=>e.canDelete(G)},{default:n.withCtx(()=>[n.createVNode(Q,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ye=>pe(G)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("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"]),n.createVNode(n.unref(Tf),{"action-pending":j.value,"entity-type":n.unref(Sa).Certificate,error:re.value,title:n.unref(i)("certificates.delete.title"),visible:D.value,onCancel:we,onProceed:or},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Ob="",Rr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},j1=Rr(V1,[["__scopeId","data-v-11599e03"]]),D1={class:"kong-ui-entities-certificates-form"},P1=n.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:""}},emits:["update","error","loading"],setup(e,{emit:t}){var w;const r=e,i=Lr.useRouter(),{i18nT:o,i18n:{t:s}}=pt.useI18n(),{getMessageFromError:a}=Pf(),{axiosInstance:c}=so({headers:(w=r.config)==null?void 0:w.requestHeaders}),l=n.computed(()=>vi.form[r.config.app].edit),d=n.computed(()=>r.certificateId?ir.Edit:ir.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),y=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),x=n.computed(()=>(d.value===ir.Create||JSON.stringify(p.fields)!==JSON.stringify(y))&&!!p.fields.cert&&!!p.fields.key),C=m=>{var A;p.fields.cert=(m==null?void 0:m.cert)||"",p.fields.key=(m==null?void 0:m.key)||"",p.fields.certAlt=(m==null?void 0:m.cert_alt)||"",p.fields.keyAlt=(m==null?void 0:m.key_alt)||"",p.fields.tags=((A=m==null?void 0:m.tags)==null?void 0:A.join(", "))||"",Object.assign(y,p.fields)},h=()=>{i.push(r.config.cancelRoute)},g=n.computed(()=>{var A,J;let m=`${r.config.apiBaseUrl}${vi.form[r.config.app].validate}`;return r.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((A=r.config)==null?void 0:A.controlPlaneId)||""):r.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(J=r.config)!=null&&J.workspace?`/${r.config.workspace}`:"")),m=m.replace(/{id}/gi,r.certificateId),m}),b=n.computed(()=>{var A,J;let m=`${r.config.apiBaseUrl}${vi.form[r.config.app][d.value]}`;return r.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((A=r.config)==null?void 0:A.controlPlaneId)||""):r.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(J=r.config)!=null&&J.workspace?`/${r.config.workspace}`:"")),m=m.replace(/{id}/gi,r.certificateId),m}),v=async()=>{var m,A,J,X,I,E,$,M,H;try{p.isReadonly=!0;const D={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(A=(m=p.fields.tags.split(","))==null?void 0:m.map(re=>String(re||"").trim()))==null?void 0:A.filter(re=>re!=="")};let j;await c.post(g.value,D),d.value==="create"?j=await c.post(b.value,D):d.value==="edit"&&(j=((J=r.config)==null?void 0:J.app)==="konnect"?await c.put(b.value,D):await c.patch(b.value,D)),p.fields.cert=((X=j==null?void 0:j.data)==null?void 0:X.cert)||"",p.fields.key=((I=j==null?void 0:j.data)==null?void 0:I.key)||"",p.fields.certAlt=((E=j==null?void 0:j.data)==null?void 0:E.cert_alt)||"",p.fields.keyAlt=(($=j==null?void 0:j.data)==null?void 0:$.key_alt)||"",p.fields.tags=((H=(M=j==null?void 0:j.data)==null?void 0:M.tags)==null?void 0:H.join(", "))||"",Object.assign(y,p.fields),t("update",j==null?void 0:j.data)}catch(D){p.errorMessage=a(D),t("error",D)}finally{p.isReadonly=!1}};return(m,A)=>{const J=n.resolveComponent("KTextArea"),X=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",D1,[n.createVNode(n.unref(_f),{"can-submit":x.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":l.value,"is-readonly":p.isReadonly,onCancel:h,"onFetch:error":A[5]||(A[5]=I=>m.$emit("error",I)),"onFetch:success":C,onLoading:A[6]||(A[6]=I=>m.$emit("loading",I)),onSubmit:v},{default:n.withCtx(()=>[n.createVNode(n.unref(oo),{description:n.unref(s)("certificates.form.sections.ssl.description"),title:n.unref(s)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(J,{modelValue:p.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=I=>p.fields.cert=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:n.unref(s)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(J,{modelValue:p.fields.key,"onUpdate:modelValue":A[1]||(A[1]=I=>p.fields.key=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:n.unref(s)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(J,{modelValue:p.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=I=>p.fields.certAlt=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:n.unref(s)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(J,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=I=>p.fields.keyAlt=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:n.unref(s)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(oo),{description:n.unref(s)("certificates.form.sections.general.description"),title:n.unref(s)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(X,{modelValue:p.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=I=>p.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(s)("certificates.form.fields.tags.help"),label:n.unref(s)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("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","is-readonly"])])}}}),Tb="",$1=Rr(P1,[["__scopeId","data-v-f66bc18c"]]),Ii={list:{konnect:"/api/runtime_groups/{controlPlaneId}/ca_certificates",kongManager:"/{workspace}/ca_certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/ca_certificates",edit:"/api/runtime_groups/{controlPlaneId}/ca_certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/ca-certificate/validate"},kongManager:{create:"/{workspace}/ca_certificates",edit:"/{workspace}/ca_certificates/{id}",validate:"/{workspace}/schemas/ca_certificates/validate"}}},M1={class:"kong-ui-ca-certificate-entity-config-card"},R1={key:0},U1=n.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","copy:success"],setup(e,{emit:t}){const r=e,i=["dns_names","san_names","subject"],{i18n:{t:o,formatUnixTimeStamp:s}}=pt.useI18n(),{convertKeyToTitle:a}=Mf(),{getPropValue:c}=Rf(),{getCertificateData:l}=pt.useCertificate(),d=n.computed(()=>Ii.form[r.config.app].edit),p=n.ref(),y=n.computed(()=>{if(p.value)return l(p.value)}),x=n.computed(()=>{var w;return((w=y.value)==null?void 0:w.schemaIssuer)||""}),C=n.computed(()=>{var w,m;return(w=y.value)!=null&&w.schemaExpiry?s((m=y.value)==null?void 0:m.schemaExpiry):""}),h=n.computed(()=>{var w;return((w=y.value)==null?void 0:w.schemaKeyUsages)||[]}),g=(w,m)=>{const A=c("rowValue",m);if(w==="expiry")return C.value;if(w==="key_usages")return h.value;if(A)return A[w]},b=w=>{p.value=w,t("fetch:success",w)},v=n.ref({id:{},updated_at:{},created_at:{},cert:{section:le.Basic,label:o("ca-certificates.form.fields.cert.label"),tooltip:o("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:le.Basic,label:o("ca-certificates.form.fields.cert_digest.label"),tooltip:o("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:le.Basic,type:ne.Json,order:7},...r.config.app==="kongManager"&&{expiry:{label:o("certificates.list.table_headers.expiry"),section:le.Basic,order:1.7,forceShow:!0},issuer:{section:le.Basic,order:1.5,forceShow:!0},key_usages:{section:le.Basic,forceShow:!0}},tags:{tooltip:o("ca-certificates.form.fields.tags.tooltip")}});return(w,m)=>{const A=n.resolveComponent("KCodeBlock"),J=n.resolveComponent("KLabel"),X=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",M1,[n.createVNode(n.unref(Nf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":v.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":m[0]||(m[0]=I=>w.$emit("copy:success",I)),"onFetch:error":m[1]||(m[1]=I=>w.$emit("fetch:error",I)),"onFetch:success":b,onLoading:m[2]||(m[2]=I=>w.$emit("loading",I))},{cert:n.withCtx(I=>[n.unref(c)("rowValue",I)?(n.openBlock(),n.createBlock(A,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",I),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(J,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(I=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",I)).filter(E=>!i.includes(E)),E=>(n.openBlock(),n.createBlock(n.unref(ki),{key:E,"data-testid":`ca-cert-metadata-${E}`,item:{key:E,label:n.unref(a)(E),value:g(E,I),type:E==="key_usages"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),key_usages:n.withCtx(()=>[h.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",R1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,(I,E)=>(n.openBlock(),n.createBlock(X,{key:`key_usages-badge-tag-${E}`,class:"config-badge","data-testid":`key_usages-badge-tag-${E}`,"truncation-tooltip":I},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(I),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),Vb="",L1=Rr(U1,[["__scopeId","data-v-5110105b"]]),H1={class:"kong-ui-entities-ca-certificates-list"},F1={key:0},K1={key:1},q1={key:0},z1={key:1},G1={key:1},W1=n.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}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var or;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),a=Lr.useRouter(),{axiosInstance:c}=so({headers:(or=r.config)==null?void 0:or.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={issuer:{label:i("ca-certificates.list.table_headers.issuer")},expiry:{label:i("ca-certificates.list.table_headers.expiry")},tags:{label:i("ca-certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var de,q;let F=`${r.config.apiBaseUrl}${Ii.list[r.config.app]}`;return r.config.app==="konnect"?F=F.replace(/{controlPlaneId}/gi,((de=r.config)==null?void 0:de.controlPlaneId)||""):r.config.app==="kongManager"&&(F=F.replace(/\/{workspace}/gi,(q=r.config)!=null&&q.workspace?`/${r.config.workspace}`:"")),F}),C=n.ref(""),h=n.computed(()=>{const F=r.config.app==="konnect"||r.config.isExactMatch;return F?{isExactMatch:F,placeholder:i("ca-certificates.search.placeholder")}:{isExactMatch:F,schema:r.config.filterSchema}}),{fetcher:g,fetcherState:b}=$f(r.config,x.value),v=()=>{C.value=""},w=()=>{l.value++},m=n.ref(""),A=(F,de)=>{const q=F.id;if(!de(q)){t("copy:error",{entity:F,field:"id",message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:F,field:"id",message:i("ca-certificates.copy.success",{val:q})})},J=(F,de)=>{const q=JSON.stringify(F);if(!de(q)){t("copy:error",{entity:F,message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:F,message:i("ca-certificates.copy.success_brief")})},X=async F=>{var q;await((q=r.canRetrieve)==null?void 0:q.call(r,F))&&a.push(r.config.getViewRoute(F.id))},I=F=>({label:i("ca-certificates.actions.view"),to:r.config.getViewRoute(F)}),E=F=>({label:i("ca-certificates.actions.edit"),to:r.config.getEditRoute(F)}),$=n.ref(void 0),M=n.ref(!1),H=n.ref(!1),D=n.ref(""),j=Df(r.config,x.value),{certificateDataCache:re,getCertificateData:fe}=pt.useCertificate(),be=F=>{$.value=F,M.value=!0},ue=()=>{M.value=!1},pe=async()=>{var F,de,q;if((F=$.value)!=null&&F.id){H.value=!0;try{await c.delete(j($.value.id)),H.value=!1,M.value=!1,l.value++,t("delete:success",$.value)}catch(Y){D.value=((q=(de=Y.response)==null?void 0:de.data)==null?void 0:q.message)||Y.message||i("ca-certificates.errors.delete"),t("error",Y)}finally{H.value=!1}}};n.watch(b,F=>{if(F.status===Dt.Error){m.value=i("ca-certificates.errors.general"),t("error",F.error);return}re.value={},m.value=""});const we=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("ca-certificates.list.empty_state.description"),title:i("ca-certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(we.value.title=i("ca-certificates.list.empty_state.title"),we.value.ctaText=i("ca-certificates.actions.create"))}),(F,de)=>{const q=n.resolveComponent("KButton"),Y=n.resolveComponent("KBadge"),xe=n.resolveComponent("KTruncate"),We=n.resolveComponent("KDropdownItem"),Ur=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",H1,[n.createVNode(n.unref(Of),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":we.value,"enable-entity-actions":"","error-message":m.value,fetcher:n.unref(g),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:C.value,"table-headers":n.unref(y),onClearSearchInput:v,"onClick:row":de[2]||(de[2]=Q=>X(Q)),onSort:w},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(jf),{modelValue:C.value,"onUpdate:modelValue":de[0]||(de[0]=Q=>C.value=Q),config:h.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[n.createVNode(n.unref(Et),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),issuer:n.withCtx(({row:Q})=>{var he;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",F1,n.toDisplayString((he=Q==null?void 0:Q.metadata)!=null&&he.issuer?Q.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",K1,n.toDisplayString(n.unref(fe)(Q).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:Q})=>{var he;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",q1,n.toDisplayString((he=Q==null?void 0:Q.metadata)!=null&&he.expiry?n.unref(o)(Q.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",z1,n.toDisplayString(n.unref(fe)(Q).schemaExpiry?n.unref(o)(n.unref(fe)(Q).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:Q})=>{var he;return[((he=Q==null?void 0:Q.tags)==null?void 0:he.length)>0?(n.openBlock(),n.createBlock(xe,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Q==null?void 0:Q.tags,G=>(n.openBlock(),n.createBlock(Y,{key:G,onClick:de[1]||(de[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(G),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",G1,"-"))]}),actions:n.withCtx(({row:Q})=>[n.createVNode(Ur,null,{default:n.withCtx(({copyToClipboard:he})=>[n.createVNode(We,{"data-testid":"action-entity-copy-id",onClick:G=>A(Q,he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Ur,null,{default:n.withCtx(({copyToClipboard:he})=>[n.createVNode(We,{"data-testid":"action-entity-copy-json",onClick:G=>J(Q,he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Et),{"auth-function":()=>e.canRetrieve(Q)},{default:n.withCtx(()=>[n.createVNode(We,{"data-testid":"action-entity-view","has-divider":"",item:I(Q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canEdit(Q)},{default:n.withCtx(()=>[n.createVNode(We,{"data-testid":"action-entity-edit",item:E(Q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canDelete(Q)},{default:n.withCtx(()=>[n.createVNode(We,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:he=>be(Q)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("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"]),n.createVNode(n.unref(Tf),{"action-pending":H.value,"entity-type":n.unref(Sa).CACertificate,error:D.value,title:n.unref(i)("ca-certificates.delete.title"),visible:M.value,onCancel:ue,onProceed:pe},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),jb="",J1=Rr(W1,[["__scopeId","data-v-cc3ed8e3"]]),Y1={class:"kong-ui-entities-ca-certificates-form"},Z1=n.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 v;const r=e,i=Lr.useRouter(),{i18n:{t:o}}=pt.useI18n(),{getMessageFromError:s}=Pf(),{axiosInstance:a}=so({headers:(v=r.config)==null?void 0:v.requestHeaders}),c=n.computed(()=>Ii.form[r.config.app].edit),l=n.computed(()=>r.certificateId?ir.Edit:ir.Create),d=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),y=n.computed(()=>(l.value===ir.Create||JSON.stringify(d.fields)!==JSON.stringify(p))&&!!d.fields.cert),x=w=>{var m;d.fields.cert=(w==null?void 0:w.cert)||"",d.fields.certDigest=(w==null?void 0:w.cert_digest)||"",d.fields.tags=((m=w==null?void 0:w.tags)==null?void 0:m.join(", "))||"",Object.assign(p,d.fields)},C=()=>{i.push(r.config.cancelRoute)},h=n.computed(()=>{var m,A;let w=`${r.config.apiBaseUrl}${Ii.form[r.config.app].validate}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(A=r.config)!=null&&A.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.certificateId),w}),g=n.computed(()=>{var m,A;let w=`${r.config.apiBaseUrl}${Ii.form[r.config.app][l.value]}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(A=r.config)!=null&&A.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.certificateId),w}),b=async()=>{var w,m,A,J,X,I,E;try{d.isReadonly=!0;const $={cert:d.fields.cert,cert_digest:d.fields.certDigest||null,tags:(m=(w=d.fields.tags.split(","))==null?void 0:w.map(H=>String(H||"").trim()))==null?void 0:m.filter(H=>H!=="")};let M;await a.post(h.value,$),l.value==="create"?M=await a.post(g.value,$):l.value==="edit"&&(M=((A=r.config)==null?void 0:A.app)==="konnect"?await a.put(g.value,$):await a.patch(g.value,$)),d.fields.cert=((J=M==null?void 0:M.data)==null?void 0:J.cert)||"",d.fields.certDigest=((X=M==null?void 0:M.data)==null?void 0:X.cert_digest)||"",d.fields.tags=((E=(I=M==null?void 0:M.data)==null?void 0:I.tags)==null?void 0:E.join(", "))||"",Object.assign(p,d.fields),t("update",M==null?void 0:M.data)}catch($){d.errorMessage=s($),t("error",$)}finally{d.isReadonly=!1}};return(w,m)=>{const A=n.resolveComponent("KTextArea"),J=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",Y1,[n.createVNode(n.unref(_f),{"can-submit":y.value,config:e.config,"edit-id":e.certificateId,"error-message":d.errorMessage,"fetch-url":c.value,"is-readonly":d.isReadonly,onCancel:C,"onFetch:error":m[3]||(m[3]=X=>w.$emit("error",X)),"onFetch:success":x,onLoading:m[4]||(m[4]=X=>w.$emit("loading",X)),onSubmit:b},{default:n.withCtx(()=>[n.createVNode(n.unref(oo),{description:n.unref(o)("ca-certificates.form.sections.cert.description"),title:n.unref(o)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(A,{modelValue:d.fields.cert,"onUpdate:modelValue":m[0]||(m[0]=X=>d.fields.cert=X),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:n.unref(o)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.cert.tooltip")},readonly:d.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(J,{modelValue:d.fields.certDigest,"onUpdate:modelValue":m[1]||(m[1]=X=>d.fields.certDigest=X),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(o)("ca-certificates.form.fields.cert_digest.label"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(oo),{description:n.unref(o)("ca-certificates.form.sections.general.description"),title:n.unref(o)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(J,{modelValue:d.fields.tags,"onUpdate:modelValue":m[2]||(m[2]=X=>d.fields.tags=X),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(o)("ca-certificates.form.fields.tags.help"),label:n.unref(o)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(o)("ca-certificates.form.fields.tags.placeholder"),readonly:d.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","is-readonly"])])}}}),Db="",X1=Rr(Z1,[["__scopeId","data-v-bad536b1"]]),Q1={class:"kong-ui-certificate-entity-config-card"},eb={key:0},tb=n.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","copy:success"],setup(e,{emit:t}){const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),{convertKeyToTitle:a}=Mf(),{getPropValue:c}=Rf(),{getCertificateData:l}=pt.useCertificate(),d=n.computed(()=>vi.form[r.config.app].edit),p=n.ref(),y=n.ref({id:{},cert:{section:le.Basic},key:{section:le.Basic,type:ne.Redacted},metadata:{section:le.Basic,type:ne.Json},snis:{section:le.Basic,type:ne.BadgeTag,label:i("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:i("certificates.form.fields.tags.tooltip")},...r.config.app==="kongManager"&&{expiry:{section:le.Basic,label:i("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:le.Basic,label:i("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:le.Basic,label:i("certificates.list.table_headers.san"),forceShow:!0},subject:{section:le.Basic,label:i("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:le.Advanced},key_alt:{section:le.Advanced,type:ne.Redacted}}),x=I=>{p.value=I,t("fetch:success",I)},C=(I,E)=>{const $=c("rowValue",E);if(I==="expiry")return g.value;if(I==="key_usages")return m.value;if(I==="san_names")return v.value;if($)return $[I]},h=n.computed(()=>{if(p.value)return l(p.value)}),g=n.computed(()=>{var I,E;return(I=h.value)!=null&&I.schemaExpiry?o((E=h.value)==null?void 0:E.schemaExpiry):""}),b=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaIssuer)||""}),v=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSanNames)||""}),w=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSubject)||""}),m=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaKeyUsages)||[]}),A=n.computed(()=>{var I,E;return((E=(I=p==null?void 0:p.value)==null?void 0:I.snis)==null?void 0:E.length)>0}),J=n.computed(()=>{var I;return!!((I=p==null?void 0:p.value)!=null&&I.cert_alt)}),X=I=>{var E,$;return I==="san_names"?i("certificates.list.table_headers.san"):(($=(E=y.value)==null?void 0:E[I])==null?void 0:$.label)||a(I)};return(I,E)=>{const $=n.resolveComponent("KCodeBlock"),M=n.resolveComponent("KLabel"),H=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",Q1,[n.createVNode(n.unref(Nf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":y.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":E[0]||(E[0]=D=>I.$emit("copy:success",D)),"onFetch:error":E[1]||(E[1]=D=>I.$emit("fetch:error",D)),"onFetch:success":x,onLoading:E[2]||(E[2]=D=>I.$emit("loading",D))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(D=>[n.unref(c)("rowValue",D)?(n.openBlock(),n.createBlock($,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",D),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(M,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(D=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",D)),j=>(n.openBlock(),n.createBlock(n.unref(ki),{key:j,item:{key:j,value:C(j,D),label:X(j),type:j==="key_usages"||j==="snis"||j==="dns_names"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",eb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(D,j)=>(n.openBlock(),n.createBlock(H,{key:`key_usages-badge-tag-${j}`,class:"config-badge","data-testid":`key_usages-badge-tag-${j}`,"truncation-tooltip":D},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(D),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:2},[A.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},J.value?{name:"cert_alt",fn:n.withCtx(D=>[n.createTextVNode(" > "),n.unref(c)("rowValue",D)?(n.openBlock(),n.createBlock($,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(c)("rowValue",D),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),Pb="",rb=Rr(tb,[["__scopeId","data-v-69ded264"]]);_e.CACertificateConfigCard=L1,_e.CACertificateForm=X1,_e.CACertificateList=J1,_e.CertificateConfigCard=rb,_e.CertificateForm=$1,_e.CertificateList=j1,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
|