@kong-ui-public/entities-certificates 2.1.12 → 2.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(Ve,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):(Ve=typeof globalThis<"u"?globalThis:Ve||self,n(Ve["kong-ui-public-entities-certificates"]={},Ve.Vue,Ve.VueRouter,Ve["kong-ui-public-i18n"],Ve.axios,Ve.Kongponents))})(this,function(Ve,n,Fr,ur,Kf,qf){"use strict";var lo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
1
+ (function(Ve,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):(Ve=typeof globalThis<"u"?globalThis:Ve||self,n(Ve["kong-ui-public-entities-certificates"]={},Ve.Vue,Ve.VueRouter,Ve["kong-ui-public-i18n"],Ve.axios,Ve.Kongponents))})(this,function(Ve,n,Fr,ur,qf,Kf){"use strict";var lo=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 qa;(function(e){(function(t){var r=typeof lo=="object"?lo: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 Ka(Object.create(null))}:c?function(){return Ka({__proto__:null})}:function(){return Ka({})},has:l?function(x,B){return r.call(x,B)}:function(x,B){return B in x},get:l?function(x,B){return r.call(x,B)?x[B]:void 0}:function(x,B){return x[B]}},y=Object.getPrototypeOf(Function),p=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",A=!p&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:lb(),v=!p&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:ub(),h=!p&&typeof WeakMap=="function"?WeakMap:db(),m=new h;function k(x,B,_,V){if(ye(_)){if(!X(x))throw new TypeError;if(!W(B))throw new TypeError;return K(x,B)}else{if(!X(x))throw new TypeError;if(!Q(B))throw new TypeError;if(!Q(V)&&!ye(V)&&!it(V))throw new TypeError;return it(V)&&(V=void 0),_=_e(_),P(x,B,_,V)}}t("decorate",k);function g(x,B){function _(V,G){if(!Q(V))throw new TypeError;if(!ye(G)&&!Se(G))throw new TypeError;we(x,B,V,G)}return _}t("metadata",g);function S(x,B,_,V){if(!Q(_))throw new TypeError;return ye(V)||(V=_e(V)),we(x,B,_,V)}t("defineMetadata",S);function w(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),U(x,B,_)}t("hasMetadata",w);function C(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),D(x,B,_)}t("hasOwnMetadata",C);function O(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),oe(x,B,_)}t("getMetadata",O);function F(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),de(x,B,_)}t("getOwnMetadata",F);function Z(x,B){if(!Q(x))throw new TypeError;return ye(B)||(B=_e(B)),pe(x,B)}t("getMetadataKeys",Z);function I(x,B){if(!Q(x))throw new TypeError;return ye(B)||(B=_e(B)),he(x,B)}t("getOwnMetadataKeys",I);function E(x,B,_){if(!Q(B))throw new TypeError;ye(_)||(_=_e(_));var V=q(B,_,!1);if(ye(V)||!V.delete(x))return!1;if(V.size>0)return!0;var G=m.get(B);return G.delete(_),G.size>0||m.delete(B),!0}t("deleteMetadata",E);function K(x,B){for(var _=x.length-1;_>=0;--_){var V=x[_],G=V(B);if(!ye(G)&&!it(G)){if(!W(G))throw new TypeError;B=G}}return B}function P(x,B,_,V){for(var G=x.length-1;G>=0;--G){var Te=x[G],te=Te(B,_,V);if(!ye(te)&&!it(te)){if(!Q(te))throw new TypeError;V=te}}return V}function q(x,B,_){var V=m.get(x);if(ye(V)){if(!_)return;V=new A,m.set(x,V)}var G=V.get(B);if(ye(G)){if(!_)return;G=new A,V.set(B,G)}return G}function U(x,B,_){var V=D(x,B,_);if(V)return!0;var G=Fa(B);return it(G)?!1:U(x,G,_)}function D(x,B,_){var V=q(B,_,!1);return ye(V)?!1:me(V.has(x))}function oe(x,B,_){var V=D(x,B,_);if(V)return de(x,B,_);var G=Fa(B);if(!it(G))return oe(x,G,_)}function de(x,B,_){var V=q(B,_,!1);if(!ye(V))return V.get(x)}function we(x,B,_,V){var G=q(_,V,!0);G.set(x,B)}function pe(x,B){var _=he(x,B),V=Fa(x);if(V===null)return _;var G=pe(V,B);if(G.length<=0)return _;if(_.length<=0)return G;for(var Te=new v,te=[],re=0,J=_;re<J.length;re++){var ae=J[re],ce=Te.has(ae);ce||(Te.add(ae),te.push(ae))}for(var Ht=0,Lf=G;Ht<Lf.length;Ht++){var ae=Lf[Ht],ce=Te.has(ae);ce||(Te.add(ae),te.push(ae))}return te}function he(x,B){var _=[],V=q(x,B,!1);if(ye(V))return _;for(var G=V.keys(),Te=ob(G),te=0;;){var re=ab(Te);if(!re)return _.length=te,_;var J=sb(re);try{_[te]=J}catch(ae){try{cb(Te)}finally{throw ae}}te++}}function Ce(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}function ye(x){return x===void 0}function it(x){return x===null}function Y(x){return typeof x=="symbol"}function Q(x){return typeof x=="object"?x!==null:typeof x=="function"}function M(x,B){switch(Ce(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var _=B===3?"string":B===5?"number":"default",V=lr(x,o);if(V!==void 0){var G=V.call(x,_);if(Q(G))throw new TypeError;return G}return ie(x,_==="default"?"number":_)}function ie(x,B){if(B==="string"){var _=x.toString;if(ve(_)){var V=_.call(x);if(!Q(V))return V}var G=x.valueOf;if(ve(G)){var V=G.call(x);if(!Q(V))return V}}else{var G=x.valueOf;if(ve(G)){var V=G.call(x);if(!Q(V))return V}var Te=x.toString;if(ve(Te)){var V=Te.call(x);if(!Q(V))return V}}throw new TypeError}function me(x){return!!x}function $e(x){return""+x}function _e(x){var B=M(x,3);return Y(B)?B:$e(B)}function X(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}function ve(x){return typeof x=="function"}function W(x){return typeof x=="function"}function Se(x){switch(Ce(x)){case 3:return!0;case 4:return!0;default:return!1}}function lr(x,B){var _=x[B];if(_!=null){if(!ve(_))throw new TypeError;return _}}function ob(x){var B=lr(x,s);if(!ve(B))throw new TypeError;var _=B.call(x);if(!Q(_))throw new TypeError;return _}function sb(x){return x.value}function ab(x){var B=x.next();return B.done?!1:B}function cb(x){var B=x.return;B&&B.call(x)}function Fa(x){var B=Object.getPrototypeOf(x);if(typeof x!="function"||x===y||B!==y)return B;var _=x.prototype,V=_&&Object.getPrototypeOf(_);if(V==null||V===Object.prototype)return B;var G=V.constructor;return typeof G!="function"||G===x?B:G}function lb(){var x={},B=[],_=function(){function te(re,J,ae){this._index=0,this._keys=re,this._values=J,this._selector=ae}return te.prototype["@@iterator"]=function(){return this},te.prototype[s]=function(){return this},te.prototype.next=function(){var re=this._index;if(re>=0&&re<this._keys.length){var J=this._selector(this._keys[re],this._values[re]);return re+1>=this._keys.length?(this._index=-1,this._keys=B,this._values=B):this._index++,{value:J,done:!1}}return{value:void 0,done:!0}},te.prototype.throw=function(re){throw this._index>=0&&(this._index=-1,this._keys=B,this._values=B),re},te.prototype.return=function(re){return this._index>=0&&(this._index=-1,this._keys=B,this._values=B),{value:re,done:!0}},te}();return function(){function te(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return Object.defineProperty(te.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),te.prototype.has=function(re){return this._find(re,!1)>=0},te.prototype.get=function(re){var J=this._find(re,!1);return J>=0?this._values[J]:void 0},te.prototype.set=function(re,J){var ae=this._find(re,!0);return this._values[ae]=J,this},te.prototype.delete=function(re){var J=this._find(re,!1);if(J>=0){for(var ae=this._keys.length,ce=J+1;ce<ae;ce++)this._keys[ce-1]=this._keys[ce],this._values[ce-1]=this._values[ce];return this._keys.length--,this._values.length--,re===this._cacheKey&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},te.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},te.prototype.keys=function(){return new _(this._keys,this._values,V)},te.prototype.values=function(){return new _(this._keys,this._values,G)},te.prototype.entries=function(){return new _(this._keys,this._values,Te)},te.prototype["@@iterator"]=function(){return this.entries()},te.prototype[s]=function(){return this.entries()},te.prototype._find=function(re,J){return this._cacheKey!==re&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=re)),this._cacheIndex<0&&J&&(this._cacheIndex=this._keys.length,this._keys.push(re),this._values.push(void 0)),this._cacheIndex},te}();function V(te,re){return te}function G(te,re){return re}function Te(te,re){return[te,re]}}function ub(){return function(){function x(){this._map=new A}return Object.defineProperty(x.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),x.prototype.has=function(B){return this._map.has(B)},x.prototype.add=function(B){return this._map.set(B,B),this},x.prototype.delete=function(B){return this._map.delete(B)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.values()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[s]=function(){return this.keys()},x}()}function db(){var x=16,B=d.create(),_=V();return function(){function J(){this._key=V()}return J.prototype.has=function(ae){var ce=G(ae,!1);return ce!==void 0?d.has(ce,this._key):!1},J.prototype.get=function(ae){var ce=G(ae,!1);return ce!==void 0?d.get(ce,this._key):void 0},J.prototype.set=function(ae,ce){var Ht=G(ae,!0);return Ht[this._key]=ce,this},J.prototype.delete=function(ae){var ce=G(ae,!1);return ce!==void 0?delete ce[this._key]:!1},J.prototype.clear=function(){this._key=V()},J}();function V(){var J;do J="@@WeakMap@@"+re();while(d.has(B,J));return B[J]=!0,J}function G(J,ae){if(!r.call(J,_)){if(!ae)return;Object.defineProperty(J,_,{value:d.create()})}return J[_]}function Te(J,ae){for(var ce=0;ce<ae;++ce)J[ce]=Math.random()*255|0;return J}function te(J){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(J)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(J)):Te(new Uint8Array(J),J):Te(new Array(J),J)}function re(){var J=te(x);J[6]=J[6]&79|64,J[8]=J[8]&191|128;for(var ae="",ce=0;ce<x;++ce){var Ht=J[ce];(ce===4||ce===6||ce===8)&&(ae+="-"),Ht<16&&(ae+="0"),ae+=Ht.toString(16).toLowerCase()}return ae}}function Ka(x){return x.__=void 0,delete x.__,x}})})(qa||(qa={}));/*!
14
+ ***************************************************************************** */var Ka;(function(e){(function(t){var r=typeof lo=="object"?lo: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 qa(Object.create(null))}:c?function(){return qa({__proto__:null})}:function(){return qa({})},has:l?function(x,B){return r.call(x,B)}:function(x,B){return B in x},get:l?function(x,B){return r.call(x,B)?x[B]:void 0}:function(x,B){return x[B]}},y=Object.getPrototypeOf(Function),p=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",A=!p&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ub(),b=!p&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:db(),h=!p&&typeof WeakMap=="function"?WeakMap:fb(),m=new h;function k(x,B,_,V){if(ye(_)){if(!X(x))throw new TypeError;if(!W(B))throw new TypeError;return q(x,B)}else{if(!X(x))throw new TypeError;if(!Q(B))throw new TypeError;if(!Q(V)&&!ye(V)&&!it(V))throw new TypeError;return it(V)&&(V=void 0),_=_e(_),P(x,B,_,V)}}t("decorate",k);function g(x,B){function _(V,G){if(!Q(V))throw new TypeError;if(!ye(G)&&!Se(G))throw new TypeError;we(x,B,V,G)}return _}t("metadata",g);function S(x,B,_,V){if(!Q(_))throw new TypeError;return ye(V)||(V=_e(V)),we(x,B,_,V)}t("defineMetadata",S);function v(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),U(x,B,_)}t("hasMetadata",v);function C(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),D(x,B,_)}t("hasOwnMetadata",C);function O(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),oe(x,B,_)}t("getMetadata",O);function F(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),de(x,B,_)}t("getOwnMetadata",F);function Y(x,B){if(!Q(x))throw new TypeError;return ye(B)||(B=_e(B)),pe(x,B)}t("getMetadataKeys",Y);function I(x,B){if(!Q(x))throw new TypeError;return ye(B)||(B=_e(B)),he(x,B)}t("getOwnMetadataKeys",I);function E(x,B,_){if(!Q(B))throw new TypeError;ye(_)||(_=_e(_));var V=K(B,_,!1);if(ye(V)||!V.delete(x))return!1;if(V.size>0)return!0;var G=m.get(B);return G.delete(_),G.size>0||m.delete(B),!0}t("deleteMetadata",E);function q(x,B){for(var _=x.length-1;_>=0;--_){var V=x[_],G=V(B);if(!ye(G)&&!it(G)){if(!W(G))throw new TypeError;B=G}}return B}function P(x,B,_,V){for(var G=x.length-1;G>=0;--G){var Te=x[G],te=Te(B,_,V);if(!ye(te)&&!it(te)){if(!Q(te))throw new TypeError;V=te}}return V}function K(x,B,_){var V=m.get(x);if(ye(V)){if(!_)return;V=new A,m.set(x,V)}var G=V.get(B);if(ye(G)){if(!_)return;G=new A,V.set(B,G)}return G}function U(x,B,_){var V=D(x,B,_);if(V)return!0;var G=Fa(B);return it(G)?!1:U(x,G,_)}function D(x,B,_){var V=K(B,_,!1);return ye(V)?!1:me(V.has(x))}function oe(x,B,_){var V=D(x,B,_);if(V)return de(x,B,_);var G=Fa(B);if(!it(G))return oe(x,G,_)}function de(x,B,_){var V=K(B,_,!1);if(!ye(V))return V.get(x)}function we(x,B,_,V){var G=K(_,V,!0);G.set(x,B)}function pe(x,B){var _=he(x,B),V=Fa(x);if(V===null)return _;var G=pe(V,B);if(G.length<=0)return _;if(_.length<=0)return G;for(var Te=new b,te=[],re=0,J=_;re<J.length;re++){var ae=J[re],ce=Te.has(ae);ce||(Te.add(ae),te.push(ae))}for(var Ht=0,Lf=G;Ht<Lf.length;Ht++){var ae=Lf[Ht],ce=Te.has(ae);ce||(Te.add(ae),te.push(ae))}return te}function he(x,B){var _=[],V=K(x,B,!1);if(ye(V))return _;for(var G=V.keys(),Te=sb(G),te=0;;){var re=cb(Te);if(!re)return _.length=te,_;var J=ab(re);try{_[te]=J}catch(ae){try{lb(Te)}finally{throw ae}}te++}}function Ce(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}function ye(x){return x===void 0}function it(x){return x===null}function Z(x){return typeof x=="symbol"}function Q(x){return typeof x=="object"?x!==null:typeof x=="function"}function M(x,B){switch(Ce(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var _=B===3?"string":B===5?"number":"default",V=lr(x,o);if(V!==void 0){var G=V.call(x,_);if(Q(G))throw new TypeError;return G}return ie(x,_==="default"?"number":_)}function ie(x,B){if(B==="string"){var _=x.toString;if(ve(_)){var V=_.call(x);if(!Q(V))return V}var G=x.valueOf;if(ve(G)){var V=G.call(x);if(!Q(V))return V}}else{var G=x.valueOf;if(ve(G)){var V=G.call(x);if(!Q(V))return V}var Te=x.toString;if(ve(Te)){var V=Te.call(x);if(!Q(V))return V}}throw new TypeError}function me(x){return!!x}function $e(x){return""+x}function _e(x){var B=M(x,3);return Z(B)?B:$e(B)}function X(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}function ve(x){return typeof x=="function"}function W(x){return typeof x=="function"}function Se(x){switch(Ce(x)){case 3:return!0;case 4:return!0;default:return!1}}function lr(x,B){var _=x[B];if(_!=null){if(!ve(_))throw new TypeError;return _}}function sb(x){var B=lr(x,s);if(!ve(B))throw new TypeError;var _=B.call(x);if(!Q(_))throw new TypeError;return _}function ab(x){return x.value}function cb(x){var B=x.next();return B.done?!1:B}function lb(x){var B=x.return;B&&B.call(x)}function Fa(x){var B=Object.getPrototypeOf(x);if(typeof x!="function"||x===y||B!==y)return B;var _=x.prototype,V=_&&Object.getPrototypeOf(_);if(V==null||V===Object.prototype)return B;var G=V.constructor;return typeof G!="function"||G===x?B:G}function ub(){var x={},B=[],_=function(){function te(re,J,ae){this._index=0,this._keys=re,this._values=J,this._selector=ae}return te.prototype["@@iterator"]=function(){return this},te.prototype[s]=function(){return this},te.prototype.next=function(){var re=this._index;if(re>=0&&re<this._keys.length){var J=this._selector(this._keys[re],this._values[re]);return re+1>=this._keys.length?(this._index=-1,this._keys=B,this._values=B):this._index++,{value:J,done:!1}}return{value:void 0,done:!0}},te.prototype.throw=function(re){throw this._index>=0&&(this._index=-1,this._keys=B,this._values=B),re},te.prototype.return=function(re){return this._index>=0&&(this._index=-1,this._keys=B,this._values=B),{value:re,done:!0}},te}();return function(){function te(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return Object.defineProperty(te.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),te.prototype.has=function(re){return this._find(re,!1)>=0},te.prototype.get=function(re){var J=this._find(re,!1);return J>=0?this._values[J]:void 0},te.prototype.set=function(re,J){var ae=this._find(re,!0);return this._values[ae]=J,this},te.prototype.delete=function(re){var J=this._find(re,!1);if(J>=0){for(var ae=this._keys.length,ce=J+1;ce<ae;ce++)this._keys[ce-1]=this._keys[ce],this._values[ce-1]=this._values[ce];return this._keys.length--,this._values.length--,re===this._cacheKey&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},te.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},te.prototype.keys=function(){return new _(this._keys,this._values,V)},te.prototype.values=function(){return new _(this._keys,this._values,G)},te.prototype.entries=function(){return new _(this._keys,this._values,Te)},te.prototype["@@iterator"]=function(){return this.entries()},te.prototype[s]=function(){return this.entries()},te.prototype._find=function(re,J){return this._cacheKey!==re&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=re)),this._cacheIndex<0&&J&&(this._cacheIndex=this._keys.length,this._keys.push(re),this._values.push(void 0)),this._cacheIndex},te}();function V(te,re){return te}function G(te,re){return re}function Te(te,re){return[te,re]}}function db(){return function(){function x(){this._map=new A}return Object.defineProperty(x.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),x.prototype.has=function(B){return this._map.has(B)},x.prototype.add=function(B){return this._map.set(B,B),this},x.prototype.delete=function(B){return this._map.delete(B)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.values()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[s]=function(){return this.keys()},x}()}function fb(){var x=16,B=d.create(),_=V();return function(){function J(){this._key=V()}return J.prototype.has=function(ae){var ce=G(ae,!1);return ce!==void 0?d.has(ce,this._key):!1},J.prototype.get=function(ae){var ce=G(ae,!1);return ce!==void 0?d.get(ce,this._key):void 0},J.prototype.set=function(ae,ce){var Ht=G(ae,!0);return Ht[this._key]=ce,this},J.prototype.delete=function(ae){var ce=G(ae,!1);return ce!==void 0?delete ce[this._key]:!1},J.prototype.clear=function(){this._key=V()},J}();function V(){var J;do J="@@WeakMap@@"+re();while(d.has(B,J));return B[J]=!0,J}function G(J,ae){if(!r.call(J,_)){if(!ae)return;Object.defineProperty(J,_,{value:d.create()})}return J[_]}function Te(J,ae){for(var ce=0;ce<ae;++ce)J[ce]=Math.random()*255|0;return J}function te(J){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(J)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(J)):Te(new Uint8Array(J),J):Te(new Array(J),J)}function re(){var J=te(x);J[6]=J[6]&79|64,J[8]=J[8]&191|128;for(var ae="",ce=0;ce<x;++ce){var Ht=J[ce];(ce===4||ce===6||ce===8)&&(ae+="-"),Ht<16&&(ae+="0"),ae+=Ht.toString(16).toLowerCase()}return ae}}function qa(x){return x.__=void 0,delete x.__,x}})})(Ka||(Ka={}));/*!
15
15
  * MIT License
16
16
  *
17
17
  * Copyright (c) 2017-2022 Peculiar Ventures, LLC
@@ -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 Oi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function po(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 wt(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 _i{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return po(this.items)}}const Kr=[new Uint8Array([1])],Ja="0123456789",ho="name",Ya="valueHexView",Xf="isHexOnly",ep="idBlock",tp="tagClass",rp="tagNumber",ip="isConstructed",np="fromBER",op="toBER",sp="local",Le="",nt=new ArrayBuffer(0),Ti=new Uint8Array(0),qr="EndOfContent",Za="OCTET STRING",Qa="BIT STRING";function dt(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?j.toUint8Array(s.valueHex):Ti}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(!wt(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",nt)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:R.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Kt{constructor({blockLength:t=0,error:r=Le,warnings:i=[],valueBeforeDecode:o=Ti}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=j.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)}}}Kt.NAME="baseBlock";class Me extends Kt{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'")}}Me.NAME="valueBlock";class Xa extends dt(Kt){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?j.toUint8Array(t.valueHex):Ti,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",nt}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=Ft(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=j.toUint8Array(t);if(!wt(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),y=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===y){y+=255;const A=new Uint8Array(y);for(let v=0;v<d.length;v++)A[v]=d[v];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let A=0;A<l;A++)p[A]=d[A];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=dr(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 ec extends Kt{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=j.toUint8Array(t);if(!wt(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=dr(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=Ft(this.length,8);if(o.byteLength>127)return this.error="Too big length",nt;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}}}ec.NAME="lengthBlock";const $={};class Ee extends Kt{constructor({name:t=Le,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 ec(o),this.valueBlock=s?new s(o):new Me(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 _i;r||tc(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?nt: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 Qf(r,i)}}Ee.NAME="BaseBlock";function tc(e){if(e instanceof $.Constructed)for(const t of e.valueBlock.value)tc(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class yo extends Ee{constructor({value:t=Le,...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}'`}}yo.NAME="BaseStringBlock";class rc extends dt(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}rc.NAME="PrimitiveValueBlock";var ic;class zr extends Ee{constructor(t={}){super(t,rc),this.idBlock.isConstructed=!1}}ic=zr,$.Primitive=ic,zr.NAME="PRIMITIVE";function ap(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 fr(e,t=0,r=e.length){const i=t;let o=new Ee({},Me);const s=new Kt;if(!wt(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=Ee;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=$.EndOfContent;break;case 1:l=$.Boolean;break;case 2:l=$.Integer;break;case 3:l=$.BitString;break;case 4:l=$.OctetString;break;case 5:l=$.Null;break;case 6:l=$.ObjectIdentifier;break;case 10:l=$.Enumerated;break;case 12:l=$.Utf8String;break;case 13:l=$.RelativeObjectIdentifier;break;case 14:l=$.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=$.Sequence;break;case 17:l=$.Set;break;case 18:l=$.NumericString;break;case 19:l=$.PrintableString;break;case 20:l=$.TeletexString;break;case 21:l=$.VideotexString;break;case 22:l=$.IA5String;break;case 23:l=$.UTCTime;break;case 24:l=$.GeneralizedTime;break;case 25:l=$.GraphicString;break;case 26:l=$.VisibleString;break;case 27:l=$.GeneralString;break;case 28:l=$.UniversalString;break;case 29:l=$.CharacterString;break;case 30:l=$.BmpString;break;case 31:l=$.DATE;break;case 32:l=$.TimeOfDay;break;case 33:l=$.DateTime;break;case 34:l=$.Duration;break;default:{const d=o.idBlock.isConstructed?new $.Constructed:new $.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?$.Constructed:$.Primitive}return o=ap(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 pr(e){if(!e.byteLength){const t=new Ee({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return fr(j.toUint8Array(e).slice(),0,e.byteLength)}function cp(e,t){return e?1:t}class Vt extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=j.toUint8Array(t);if(!wt(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(;cp(this.isIndefiniteForm,i)>0;){const a=fr(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===qr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===qr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new _i;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?nt:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Vt.NAME="ConstructedValueBlock";var nc;class He extends Ee{constructor(t={}){super(t,Vt),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 Oi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function po(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 wt(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 _i{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return po(this.items)}}const qr=[new Uint8Array([1])],Ja="0123456789",ho="name",Ya="valueHexView",Xf="isHexOnly",ep="idBlock",tp="tagClass",rp="tagNumber",ip="isConstructed",np="fromBER",op="toBER",sp="local",Le="",nt=new ArrayBuffer(0),Ti=new Uint8Array(0),Kr="EndOfContent",Za="OCTET STRING",Qa="BIT STRING";function dt(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?j.toUint8Array(s.valueHex):Ti}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(!wt(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",nt)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:R.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class qt{constructor({blockLength:t=0,error:r=Le,warnings:i=[],valueBeforeDecode:o=Ti}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=j.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)}}}qt.NAME="baseBlock";class Me extends qt{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'")}}Me.NAME="valueBlock";class Xa extends dt(qt){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?j.toUint8Array(t.valueHex):Ti,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",nt}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=Ft(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=j.toUint8Array(t);if(!wt(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),y=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===y){y+=255;const A=new Uint8Array(y);for(let b=0;b<d.length;b++)A[b]=d[b];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let A=0;A<l;A++)p[A]=d[A];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=dr(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 ec extends qt{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=j.toUint8Array(t);if(!wt(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=dr(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=Ft(this.length,8);if(o.byteLength>127)return this.error="Too big length",nt;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}}}ec.NAME="lengthBlock";const $={};class Ee extends qt{constructor({name:t=Le,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 ec(o),this.valueBlock=s?new s(o):new Me(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 _i;r||tc(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?nt: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 Qf(r,i)}}Ee.NAME="BaseBlock";function tc(e){if(e instanceof $.Constructed)for(const t of e.valueBlock.value)tc(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class yo extends Ee{constructor({value:t=Le,...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}'`}}yo.NAME="BaseStringBlock";class rc extends dt(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}rc.NAME="PrimitiveValueBlock";var ic;class zr extends Ee{constructor(t={}){super(t,rc),this.idBlock.isConstructed=!1}}ic=zr,$.Primitive=ic,zr.NAME="PRIMITIVE";function ap(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 fr(e,t=0,r=e.length){const i=t;let o=new Ee({},Me);const s=new qt;if(!wt(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=Ee;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=$.EndOfContent;break;case 1:l=$.Boolean;break;case 2:l=$.Integer;break;case 3:l=$.BitString;break;case 4:l=$.OctetString;break;case 5:l=$.Null;break;case 6:l=$.ObjectIdentifier;break;case 10:l=$.Enumerated;break;case 12:l=$.Utf8String;break;case 13:l=$.RelativeObjectIdentifier;break;case 14:l=$.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=$.Sequence;break;case 17:l=$.Set;break;case 18:l=$.NumericString;break;case 19:l=$.PrintableString;break;case 20:l=$.TeletexString;break;case 21:l=$.VideotexString;break;case 22:l=$.IA5String;break;case 23:l=$.UTCTime;break;case 24:l=$.GeneralizedTime;break;case 25:l=$.GraphicString;break;case 26:l=$.VisibleString;break;case 27:l=$.GeneralString;break;case 28:l=$.UniversalString;break;case 29:l=$.CharacterString;break;case 30:l=$.BmpString;break;case 31:l=$.DATE;break;case 32:l=$.TimeOfDay;break;case 33:l=$.DateTime;break;case 34:l=$.Duration;break;default:{const d=o.idBlock.isConstructed?new $.Constructed:new $.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?$.Constructed:$.Primitive}return o=ap(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 pr(e){if(!e.byteLength){const t=new Ee({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return fr(j.toUint8Array(e).slice(),0,e.byteLength)}function cp(e,t){return e?1:t}class Vt extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=j.toUint8Array(t);if(!wt(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(;cp(this.isIndefiniteForm,i)>0;){const a=fr(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===Kr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Kr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new _i;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?nt:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Vt.NAME="ConstructedValueBlock";var nc;class He extends Ee{constructor(t={}){super(t,Vt),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} :`}}nc=He,$.Constructed=nc,He.NAME="CONSTRUCTED";class oc extends Me{fromBER(t,r,i){return r}toBER(t){return nt}}oc.override="EndOfContentValueBlock";var sc;class mo extends Ee{constructor(t={}){super(t,oc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}sc=mo,$.EndOfContent=sc,mo.NAME=qr;var ac;class qt extends Ee{constructor(t={}){super(t,Me),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}`}}ac=qt,$.Null=ac,qt.NAME="NULL";class cc extends dt(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=j.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=j.toUint8Array(t);return wt(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}}}cc.NAME="BooleanValueBlock";var lc;let Vi=class extends Ee{constructor(t={}){super(t,cc),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}`}};lc=Vi,$.Boolean=lc,Vi.NAME="BOOLEAN";class uc extends dt(Vt){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=Vt.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===qr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Za)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?Vt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}uc.NAME="OctetStringValueBlock";var dc;let zt=class Hf extends Ee{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},uc),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=fr(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?He.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 j.concat(t)}};dc=zt,$.OctetString=dc,zt.NAME=Za;class fc extends dt(Vt){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=Vt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const c of this.value){const l=c.constructor.NAME;if(l===qr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==Qa)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=j.toUint8Array(t);if(!wt(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=fr(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 Vt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return nt;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}}}fc.NAME="BitStringValueBlock";var pc;let Gt=class extends Ee{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},fc),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 He.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};pc=Gt,$.BitString=pc,Gt.NAME=Qa;var hc;function lp(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 y=l<a?a:l;let p=0;for(let A=y;A>=0;A--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=fo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=fo(r,s)),s}function yc(e){if(e>=Kr.length)for(let t=Kr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Kr[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=fo(r,i)),Kr.push(i)}return Kr[e]}function up(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,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class go extends dt(Me){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=Wa.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Zf(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=up(yc(i),r),a="-";break;default:r=lp(r,yc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=Ja.charAt(r[l]));return c===!1&&(a+=Ja.charAt(0)),a}}hc=go,go.NAME="IntegerValueBlock",Object.defineProperty(hc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var mc;class ft extends Ee{constructor(t={}){super(t,go),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Oi(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Oi();const r=BigInt(t),i=new _i,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,y=j.toUint8Array(R.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new ft({valueHex:i.final()})}convertToDER(){const t=new ft({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ft({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}mc=ft,$.Integer=mc,ft.NAME="INTEGER";var gc;class ji extends ft{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}gc=ji,$.Enumerated=gc,ji.NAME="ENUMERATED";class bo extends dt(Me){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=j.toUint8Array(t);if(!wt(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=dr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Oi();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=Ft(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;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}}}bo.NAME="sidBlock";class bc extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new bo;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,nt;r.push(o)}return po(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 bo;if(o>Number.MAX_SAFE_INTEGER){Oi();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}}bc.NAME="ObjectIdentifierValueBlock";var wc;class Di extends Ee{constructor(t={}){super(t,bc),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()}}}wc=Di,$.ObjectIdentifier=wc,Di.NAME="OBJECT IDENTIFIER";class wo extends dt(Kt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=j.toUint8Array(t);if(!wt(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=dr(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=Ft(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;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}}}wo.NAME="relativeSidBlock";class vc extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new wo;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,nt;i.push(s)}return po(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 wo;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}}vc.NAME="RelativeObjectIdentifierValueBlock";var kc;class vo extends Ee{constructor(t={}){super(t,vc),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()}}}kc=vo,$.RelativeObjectIdentifier=kc,vo.NAME="RelativeObjectIdentifier";var Cc;class vt extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Cc=vt,$.Sequence=Cc,vt.NAME="SEQUENCE";var Sc;let kt=class extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Sc=kt,$.Set=Sc,kt.NAME="SET";class xc extends dt(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}xc.NAME="StringValueBlock";class Ac extends xc{}Ac.NAME="SimpleStringValueBlock";class Je extends yo{constructor({...t}={}){super(t,Ac)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,j.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}}Je.NAME="SIMPLE STRING";class Bc extends Je{fromBuffer(t){this.valueBlock.valueHexView=j.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}}Bc.NAME="Utf8StringValueBlock";var Ic;class Ct extends Bc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Ic=Ct,$.Utf8String=Ic,Ct.NAME="UTF8String";class Ec extends Je{fromBuffer(t){this.valueBlock.value=R.ToUtf16String(t),this.valueBlock.valueHexView=j.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(R.FromUtf16String(t))}}Ec.NAME="BmpStringValueBlock";var Nc;class Pi extends Ec{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Nc=Pi,$.BmpString=Nc,Pi.NAME="BMPString";class Oc extends Je{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=Ft(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}}Oc.NAME="UniversalStringValueBlock";var _c;class $i extends Oc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}_c=$i,$.UniversalString=_c,$i.NAME="UniversalString";var Tc;class Mi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Tc=Mi,$.NumericString=Tc,Mi.NAME="NumericString";var Vc;class Ri extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Vc=Ri,$.PrintableString=Vc,Ri.NAME="PrintableString";var jc;class Ui extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}jc=Ui,$.TeletexString=jc,Ui.NAME="TeletexString";var Dc;class Li extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Dc=Li,$.VideotexString=Dc,Li.NAME="VideotexString";var Pc;class Hi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Pc=Hi,$.IA5String=Pc,Hi.NAME="IA5String";var $c;class Fi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}$c=Fi,$.GraphicString=$c,Fi.NAME="GraphicString";var Mc;class Gr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Mc=Gr,$.VisibleString=Mc,Gr.NAME="VisibleString";var Rc;class Ki extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Rc=Ki,$.GeneralString=Rc,Ki.NAME="GeneralString";var Uc;class qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Uc=qi,$.CharacterString=Uc,qi.NAME="CharacterString";var Lc;class Wr extends Gr{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,j.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]=We(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=We(this.month,2),r[2]=We(this.day,2),r[3]=We(this.hour,2),r[4]=We(this.minute,2),r[5]=We(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}Lc=Wr,$.UTCTime=Lc,Wr.NAME="UTCTime";var Hc;class zi extends Wr{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 p=new Number(t[t.length-1]);if(isNaN(p.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 p=1,A=i.indexOf("+"),v="";if(A===-1&&(A=i.indexOf("-"),p=-1),A!==-1){if(v=i.substring(A+1),i=i.substring(0,A),v.length!==2&&v.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(v.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,v.length===4){if(h=parseInt(v.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.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 p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(o);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(We(this.year,4)),r.push(We(this.month,2)),r.push(We(this.day,2)),r.push(We(this.hour,2)),r.push(We(this.minute,2)),r.push(We(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(We(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Hc=zi,$.GeneralizedTime=Hc,zi.NAME="GeneralizedTime";var Fc;class ko extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Fc=ko,$.DATE=Fc,ko.NAME="DATE";var Kc;class Co extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Kc=Co,$.TimeOfDay=Kc,Co.NAME="TimeOfDay";var qc;class So extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}qc=So,$.DateTime=qc,So.NAME="DateTime";var zc;class xo extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}zc=xo,$.Duration=zc,xo.NAME="Duration";var Gc;class Ao extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Gc=Ao,$.TIME=Gc,Ao.NAME="TIME";class Wt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Bo extends Wt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Gi extends Wt{constructor({value:t=new Wt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class dp{constructor({data:t=Ti}={}){this.dataView=j.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=j.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=j.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Jt(e,t,r){if(r instanceof Bo){for(let s=0;s<r.value.length;s++)if(Jt(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(ho)&&(s.name=r.name),s}}if(r instanceof Wt)return r.hasOwnProperty(ho)&&(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(!(ep in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(np in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(op 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(tp)===!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(rp)===!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(ip)===!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(!(Ya 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,Le),r.name&&(e[r.name]=t)),r instanceof $.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Gi&&(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,Le),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,Le),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Gi){if(a=Jt(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,Le),r.name&&delete e[r.name]),a;if(ho in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};sp 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=Jt(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,Le),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,Le),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&Ya in t.valueBlock){const s=fr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],a.name=r.name)),a}return Jt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function fp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=fr(j.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Jt(r.result,r.result,t)}const Wc=Object.freeze(Object.defineProperty({__proto__:null,Any:Wt,BaseBlock:Ee,BaseStringBlock:yo,BitString:Gt,BmpString:Pi,Boolean:Vi,CharacterString:qi,Choice:Bo,Constructed:He,DATE:ko,DateTime:So,Duration:xo,EndOfContent:mo,Enumerated:ji,GeneralString:Ki,GeneralizedTime:zi,GraphicString:Fi,HexBlock:dt,IA5String:Hi,Integer:ft,Null:qt,NumericString:Mi,ObjectIdentifier:Di,OctetString:zt,Primitive:zr,PrintableString:Ri,RawData:dp,RelativeObjectIdentifier:vo,Repeated:Gi,Sequence:vt,Set:kt,TIME:Ao,TeletexString:Ui,TimeOfDay:Co,UTCTime:Wr,UniversalString:$i,Utf8String:Ct,ValueBlock:Me,VideotexString:Li,ViewWriter:_i,VisibleString:Gr,compareSchema:Jt,fromBER:pr,verifySchema:fp},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 b;(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"})(b||(b={}));class Wi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(j.isBufferSource(t))this.unusedBits=r,this.value=j.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Gt))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 Gt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Gt({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 ne{constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):j.isBufferSource(t)?this.buffer=j.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 zt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new zt({valueHex:this.buffer})}toSchema(t){return new zt({name:t})}}const pp={fromASN:e=>e instanceof qt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new qt;const t=pr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},hp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ft({value:+e})},yp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new ji({value:e})},ge={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ft({valueHex:e})},mp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Gt({valueHex:e})},gp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Di({value:e})},bp={fromASN:e=>e.valueBlock.value,toASN:e=>new Vi({value:e})},Ji={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new zt({valueHex:e})},wp={fromASN:e=>new ne(e.getValue()),toASN:e=>e.toASN()};function Qe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const Jc=Qe(Ct),vp=Qe(Pi),kp=Qe($i),Cp=Qe(Mi),Sp=Qe(Ri),xp=Qe(Ui),Ap=Qe(Li),Bp=Qe(Hi),Ip=Qe(Fi),Ep=Qe(Gr),Np=Qe(Ki),Op=Qe(qi),_p={fromASN:e=>e.toDate(),toASN:e=>new Wr({valueDate:e})},Tp={fromASN:e=>e.toDate(),toASN:e=>new zi({valueDate:e})},Vp={fromASN:()=>null,toASN:()=>new qt};function Io(e){switch(e){case b.Any:return pp;case b.BitString:return mp;case b.BmpString:return vp;case b.Boolean:return bp;case b.CharacterString:return Op;case b.Enumerated:return yp;case b.GeneralString:return Np;case b.GeneralizedTime:return Tp;case b.GraphicString:return Ip;case b.IA5String:return Bp;case b.Integer:return hp;case b.Null:return Vp;case b.NumericString:return Cp;case b.ObjectIdentifier:return gp;case b.OctetString:return Ji;case b.PrintableString:return Sp;case b.TeletexString:return xp;case b.UTCTime:return _p;case b.UniversalString:return kp;case b.Utf8String:return Jc;case b.VideotexString:return Ap;case b.VisibleString:return Ep;default:return null}}function St(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:St(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function Yc(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:Yc(r)}return!1}function jp(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 Dp{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 y=b[a.type],p=Wc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else St(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===N.Choice?l=new Wt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Wt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?kt:vt;l=new y({name:"",value:[new Gi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||St(a.type)){const y=a.repeated?He:zr;o.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new He({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new He({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 vt({value:o,name:""});case N.Set:return new kt({value:o,name:""});case N.Choice:return new Bo({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 Xe=new Dp,T=e=>t=>{let r;Xe.has(t)?r=Xe.get(t):(r=Xe.createDefault(t),Xe.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;Xe.has(t.constructor)?i=Xe.get(t.constructor):(i=Xe.createDefault(t.constructor),Xe.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Io(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 Zc extends Error{constructor(){super(...arguments),this.schemas=[]}}class Pp{static parse(t,r){const i=pr(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(St(r))return new r().fromASN(t);const o=Xe.get(r);Xe.cache(r);let s=o.schema;if(t.constructor===He&&o.type!==N.Choice){s=new He({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=Jt({},t,s);if(!a.verified)throw new Zc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(Yc(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=Io(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const y=o.items[l],p=y.type;if(typeof p=="number"||St(p)){const A=(i=y.converter)!==null&&i!==void 0?i:St(p)?new p:null;if(!A)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const v=y.repeated==="sequence"?vt:kt,h=new v;h.valueBlock=d.valueBlock;const m=pr(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 k=m.result.valueBlock.value;c[l]=Array.from(k,g=>A.fromASN(g))}else c[l]=Array.from(d,v=>A.fromASN(v));else{let v=d;if(y.implicit){let h;if(St(p))h=new p().toSchema("");else{const m=b[p],k=Wc[m];if(!k)throw new Error(`Cannot get '${m}' class from asn1js module`);h=new k}h.valueBlock=v.valueBlock,v=pr(h.toBER(!1)).result}c[l]=A.fromASN(v)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");c[l]=Array.from(d,A=>this.fromASN(A,p))}else c[l]=this.fromASN(d,p)}return c}catch(o){throw o instanceof Zc&&o.schemas.push(r.name),o}}}class Eo{static serialize(t){return t instanceof Ee?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&St(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=Xe.get(r);Xe.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=Io(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"&&jp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Eo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||St(c.type))){const y={};y.valueHex=d instanceof qt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new zr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else o.push(new He({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new He({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 vt({value:o});break;case N.Set:s=new kt({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 ${b[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"?vt:kt;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"?vt:kt;s=new c({value:a})}else s=this.toASN(o);return s}}class le extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class H{static serialize(t){return Eo.serialize(t)}static parse(t,r){return Pp.parse(t,r)}static toString(t){const r=j.isBufferSource(t)?j.toArrayBuffer(t):H.serialize(t),i=pr(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 Qc={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 k=0,g=-1,S=(h.match(l.zoneIndex)||[])[0],w,C;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)k++;if(h.substr(0,2)==="::"&&k--,h.substr(-2,2)==="::"&&k--,k>m)return null;for(C=m-k,w=":";C--;)w+="0:";return h=h.replace("::",w),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),m=function(){const O=h.split(":"),F=[];for(let Z=0;Z<O.length;Z++)F.push(parseInt(O[Z],16));return F}(),{parts:m,zoneId:S}}function y(h,m,k,g){if(h.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,w;for(;g>0;){if(w=k-g,w<0&&(w=0),h[S]>>w!==m[S]>>w)return!1;g-=k,S+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function A(h,m){for(;h.length<m;)h=`0${h}`;return h}const v={};v.IPv4=function(){function h(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let k,g;for(k=0;k<m.length;k++)if(g=m[k],!(0<=g&&g<=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,k){let g;if(k===void 0&&(g=m,m=g[0],k=g[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,m.octets,8,k)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,k=!1;const g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let S,w,C;for(S=3;S>=0;S-=1)if(w=this.octets[S],w in g){if(C=g[w],k&&C!==0)return null;C!==8&&(k=!0),m+=C}else return null;return 32-m},h.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return v.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),v.IPv4.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),k=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[];let w=0;for(;w<4;)S.push(parseInt(k[w],10)|parseInt(g[w],10)^255),w++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.isIPv4=function(h){return this.parser(h)!==null},v.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},v.IPv4.isValidFourPartDecimal=function(h){return!!(v.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},v.IPv4.networkAddressFromCIDR=function(h){let m,k,g,S,w;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),w=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[],k=0;k<4;)S.push(parseInt(g[k],10)&parseInt(w[k],10)),k++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.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)},v.IPv4.parseCIDR=function(h){let m;if(m=h.match(/^(.+)\/(\d+)$/)){const k=parseInt(m[2]);if(k>=0&&k<=32){const g=[this.parse(m[1]),k];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},v.IPv4.parser=function(h){let m,k,g;if(m=h.match(i.fourOctet))return function(){const S=m.slice(1,6),w=[];for(let C=0;C<S.length;C++)k=S[C],w.push(p(k));return w}();if(m=h.match(i.longValue)){if(g=p(m[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){const S=[];let w;for(w=0;w<=24;w+=8)S.push(g>>w&255);return S}().reverse()}else return(m=h.match(i.twoOctet))?function(){const S=m.slice(1,4),w=[];if(g=p(S[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return w.push(p(S[0])),w.push(g>>16&255),w.push(g>>8&255),w.push(g&255),w}():(m=h.match(i.threeOctet))?function(){const S=m.slice(1,5),w=[];if(g=p(S[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return w.push(p(S[0])),w.push(p(S[1])),w.push(g>>8&255),w.push(g&255),w}():null},v.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 k=0;const g=Math.floor(h/8);for(;k<g;)m[k]=255,k++;return g<4&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},v.IPv6=function(){function h(m,k){let g,S;if(m.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(m[g]<<8|m[g+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(S=this.parts[g],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");k&&(this.zoneId=k)}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,k){let g;if(k===void 0&&(g=m,m=g[0],k=g[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,m.parts,16,k)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,k=!1;const g={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 S,w;for(let C=7;C>=0;C-=1)if(S=this.parts[C],S in g){if(w=g[S],k&&w!==0)return null;w!==16&&(k=!0),m+=w}else return null;return 128-m},h.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let m;const k=[],g=this.parts;for(let S=0;S<g.length;S++)m=g[S],k.push(m>>8),k.push(m&255);return k},h.prototype.toFixedLengthString=function(){const m=(function(){const g=[];for(let S=0;S<this.parts.length;S++)g.push(A(this.parts[S].toString(16),4));return g}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),m+k},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),k=m[0],g=m[1];return new v.IPv4([k>>8,k&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){const m=(function(){const g=[];for(let S=0;S<this.parts.length;S++)g.push(this.parts[S].toString(16));return g}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),m+k},h.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,k=this.toNormalizedString();let g=0,S=-1,w;for(;w=m.exec(k);)w[0].length>S&&(g=w.index,S=w[0].length);return S<0?k:`${k.substring(0,g)}::${k.substring(g+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),v.IPv6.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),k=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[];let w=0;for(;w<16;)S.push(parseInt(k[w],10)|parseInt(g[w],10)^255),w++;return new this(S)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},v.IPv6.isIPv6=function(h){return this.parser(h)!==null},v.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}},v.IPv6.networkAddressFromCIDR=function(h){let m,k,g,S,w;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),w=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[],k=0;k<16;)S.push(parseInt(g[k],10)&parseInt(w[k],10)),k++;return new this(S)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},v.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)},v.IPv6.parseCIDR=function(h){let m,k,g;if((k=h.match(/^(.+)\/(\d+)$/))&&(m=parseInt(k[2]),m>=0&&m<=128))return g=[this.parse(k[1]),m],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},v.IPv6.parser=function(h){let m,k,g,S,w,C;if(g=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(l.native.test(h))return d(h,8);if((g=h.match(l.transitional))&&(C=g[6]||"",m=d(g[1].slice(0,-1)+C,6),m.parts)){for(w=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],k=0;k<w.length;k++)if(S=w[k],!(0<=S&&S<=255))return null;return m.parts.push(w[0]<<8|w[1]),m.parts.push(w[2]<<8|w[3]),{parts:m.parts,zoneId:m.zoneId}}return null},v.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 k=0;const g=Math.floor(h/8);for(;k<g;)m[k]=255,k++;return g<16&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},v.fromByteArray=function(h){const m=h.length;if(m===4)return new v.IPv4(h);if(m===16)return new v.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},v.isValid=function(h){return v.IPv6.isValid(h)||v.IPv4.isValid(h)},v.parse=function(h){if(v.IPv6.isValid(h))return v.IPv6.parse(h);if(v.IPv4.isValid(h))return v.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},v.parseCIDR=function(h){try{return v.IPv6.parseCIDR(h)}catch{try{return v.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},v.process=function(h){const m=this.parse(h);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},v.subnetMatch=function(h,m,k){let g,S,w,C;k==null&&(k="unicast");for(S in m)if(Object.prototype.hasOwnProperty.call(m,S)){for(w=m[S],w[0]&&!(w[0]instanceof Array)&&(w=[w]),g=0;g<w.length;g++)if(C=w[g],h.kind()===C[0].kind()&&h.match.apply(h,C))return S}return k},e.exports?e.exports=v:t.ipaddr=v})(lo)})(Qc);var Xc=Qc.exports;class el{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 No,Oo,_o;let Ne=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:b.TeletexString})],Ne.prototype,"teletexString",void 0),u([f({type:b.PrintableString})],Ne.prototype,"printableString",void 0),u([f({type:b.UniversalString})],Ne.prototype,"universalString",void 0),u([f({type:b.Utf8String})],Ne.prototype,"utf8String",void 0),u([f({type:b.BmpString})],Ne.prototype,"bmpString",void 0),Ne=u([T({type:N.Choice})],Ne);let hr=class extends Ne{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?R.ToHex(this.anyValue):super.toString())}};u([f({type:b.IA5String})],hr.prototype,"ia5String",void 0),u([f({type:b.Any})],hr.prototype,"anyValue",void 0),hr=u([T({type:N.Choice})],hr);class Jr{constructor(t={}){this.type="",this.value=new hr,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Jr.prototype,"type",void 0),u([f({type:hr})],Jr.prototype,"value",void 0);let yr=No=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,No.prototype)}};yr=No=u([T({type:N.Set,itemType:Jr})],yr);let To=Oo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Oo.prototype)}};To=Oo=u([T({type:N.Sequence,itemType:yr})],To);let xe=_o=class extends To{constructor(t){super(t),Object.setPrototypeOf(this,_o.prototype)}};xe=_o=u([T({type:N.Sequence})],xe);const $p={fromASN:e=>el.toString(Ji.fromASN(e)),toASN:e=>Ji.toASN(el.fromString(e))};class Yr{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Yr.prototype,"typeId",void 0),u([f({type:b.Any,context:0})],Yr.prototype,"value",void 0);class Vo{constructor(t={}){this.partyName=new Ne,Object.assign(this,t)}}u([f({type:Ne,optional:!0,context:0,implicit:!0})],Vo.prototype,"nameAssigner",void 0),u([f({type:Ne,context:1,implicit:!0})],Vo.prototype,"partyName",void 0);let ee=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Yr,context:0,implicit:!0})],ee.prototype,"otherName",void 0),u([f({type:b.IA5String,context:1,implicit:!0})],ee.prototype,"rfc822Name",void 0),u([f({type:b.IA5String,context:2,implicit:!0})],ee.prototype,"dNSName",void 0),u([f({type:b.Any,context:3,implicit:!0})],ee.prototype,"x400Address",void 0),u([f({type:xe,context:4,implicit:!1})],ee.prototype,"directoryName",void 0),u([f({type:Vo,context:5})],ee.prototype,"ediPartyName",void 0),u([f({type:b.IA5String,context:6,implicit:!0})],ee.prototype,"uniformResourceIdentifier",void 0),u([f({type:b.OctetString,context:7,implicit:!0,converter:$p})],ee.prototype,"iPAddress",void 0),u([f({type:b.ObjectIdentifier,context:8,implicit:!0})],ee.prototype,"registeredID",void 0),ee=u([T({type:N.Choice})],ee);const mr="1.3.6.1.5.5.7.3",Yt="2.5.29";var jo;class Yi{constructor(t={}){this.accessMethod="",this.accessLocation=new ee,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Yi.prototype,"accessMethod",void 0),u([f({type:ee})],Yi.prototype,"accessLocation",void 0);let tl=jo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,jo.prototype)}};tl=jo=u([T({type:N.Sequence,itemType:Yi})],tl);const Do=`${Yt}.35`;class Po extends ne{}class Zt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Po,context:0,optional:!0,implicit:!0})],Zt.prototype,"keyIdentifier",void 0),u([f({type:ee,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Zt.prototype,"authorityCertIssuer",void 0),u([f({type:b.Integer,context:2,optional:!0,implicit:!0,converter:ge})],Zt.prototype,"authorityCertSerialNumber",void 0);const rl=`${Yt}.19`;class Zi{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:b.Boolean,defaultValue:!1})],Zi.prototype,"cA",void 0),u([f({type:b.Integer,optional:!0})],Zi.prototype,"pathLenConstraint",void 0);var $o;let Re=$o=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};Re=$o=u([T({type:N.Sequence,itemType:ee})],Re);var Mo;let il=Mo=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};il=Mo=u([T({type:N.Sequence})],il);var Ro;const nl=`${Yt}.32`;let xt=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:b.IA5String})],xt.prototype,"ia5String",void 0),u([f({type:b.VisibleString})],xt.prototype,"visibleString",void 0),u([f({type:b.BmpString})],xt.prototype,"bmpString",void 0),u([f({type:b.Utf8String})],xt.prototype,"utf8String",void 0),xt=u([T({type:N.Choice})],xt);class Uo{constructor(t={}){this.organization=new xt,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:xt})],Uo.prototype,"organization",void 0),u([f({type:b.Integer,repeated:"sequence"})],Uo.prototype,"noticeNumbers",void 0);class Lo{constructor(t={}){Object.assign(this,t)}}u([f({type:Uo,optional:!0})],Lo.prototype,"noticeRef",void 0),u([f({type:xt,optional:!0})],Lo.prototype,"explicitText",void 0);let Qi=class{constructor(t={}){Object.assign(this,t)}};u([f({type:b.IA5String})],Qi.prototype,"cPSuri",void 0),u([f({type:Lo})],Qi.prototype,"userNotice",void 0),Qi=u([T({type:N.Choice})],Qi);class Ho{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Ho.prototype,"policyQualifierId",void 0),u([f({type:b.Any})],Ho.prototype,"qualifier",void 0);class Xi{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Xi.prototype,"policyIdentifier",void 0),u([f({type:Ho,repeated:"sequence",optional:!0})],Xi.prototype,"policyQualifiers",void 0);let en=Ro=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};en=Ro=u([T({type:N.Sequence,itemType:Xi})],en);let tn=class{constructor(t=0){this.value=t}};u([f({type:b.Integer})],tn.prototype,"value",void 0),tn=u([T({type:N.Choice})],tn);let ol=class extends tn{};ol=u([T({type:N.Choice})],ol);var Fo,ot;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(ot||(ot={}));class sl extends Wi{toJSON(){const t=[],r=this.toNumber();return r&ot.aACompromise&&t.push("aACompromise"),r&ot.affiliationChanged&&t.push("affiliationChanged"),r&ot.cACompromise&&t.push("cACompromise"),r&ot.certificateHold&&t.push("certificateHold"),r&ot.cessationOfOperation&&t.push("cessationOfOperation"),r&ot.keyCompromise&&t.push("keyCompromise"),r&ot.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&ot.superseded&&t.push("superseded"),r&ot.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let gr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,context:0,repeated:"sequence",implicit:!0})],gr.prototype,"fullName",void 0),u([f({type:yr,context:1,implicit:!0})],gr.prototype,"nameRelativeToCRLIssuer",void 0),gr=u([T({type:N.Choice})],gr);class Zr{constructor(t={}){Object.assign(this,t)}}u([f({type:gr,context:0,optional:!0})],Zr.prototype,"distributionPoint",void 0),u([f({type:sl,context:1,optional:!0,implicit:!0})],Zr.prototype,"reasons",void 0),u([f({type:ee,context:2,optional:!0,repeated:"sequence",implicit:!0})],Zr.prototype,"cRLIssuer",void 0);let Ko=Fo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};Ko=Fo=u([T({type:N.Sequence,itemType:Zr})],Ko);var qo;let al=qo=class extends Ko{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};al=qo=u([T({type:N.Sequence,itemType:Zr})],al);class je{constructor(t={}){this.onlyContainsUserCerts=je.ONLY,this.onlyContainsCACerts=je.ONLY,this.indirectCRL=je.ONLY,this.onlyContainsAttributeCerts=je.ONLY,Object.assign(this,t)}}je.ONLY=!1,u([f({type:gr,context:0,optional:!0})],je.prototype,"distributionPoint",void 0),u([f({type:b.Boolean,context:1,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsUserCerts",void 0),u([f({type:b.Boolean,context:2,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsCACerts",void 0),u([f({type:sl,context:3,optional:!0,implicit:!0})],je.prototype,"onlySomeReasons",void 0),u([f({type:b.Boolean,context:4,defaultValue:je.ONLY,implicit:!0})],je.prototype,"indirectCRL",void 0),u([f({type:b.Boolean,context:5,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsAttributeCerts",void 0);var Qr;(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"})(Qr||(Qr={}));let zo=class{constructor(t=Qr.unspecified){this.reason=Qr.unspecified,this.reason=t}toJSON(){return Qr[this.reason]}toString(){return this.toJSON()}};u([f({type:b.Enumerated})],zo.prototype,"reason",void 0),zo=u([T({type:N.Choice})],zo);var Go;const cl=`${Yt}.37`;let rn=Go=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Go.prototype)}};rn=Go=u([T({type:N.Sequence,itemType:b.ObjectIdentifier})],rn);const Mp=`${mr}.1`,Rp=`${mr}.2`,Up=`${mr}.3`,Lp=`${mr}.4`,Hp=`${mr}.8`,Fp=`${mr}.9`;let Wo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:b.Integer,converter:ge})],Wo.prototype,"value",void 0),Wo=u([T({type:N.Choice})],Wo);let Jo=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:b.GeneralizedTime})],Jo.prototype,"value",void 0),Jo=u([T({type:N.Choice})],Jo);var Yo;let ll=Yo=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};ll=Yo=u([T({type:N.Sequence})],ll);const ul=`${Yt}.15`;var st;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(st||(st={}));class Zo extends Wi{toJSON(){const t=this.toNumber(),r=[];return t&st.cRLSign&&r.push("crlSign"),t&st.dataEncipherment&&r.push("dataEncipherment"),t&st.decipherOnly&&r.push("decipherOnly"),t&st.digitalSignature&&r.push("digitalSignature"),t&st.encipherOnly&&r.push("encipherOnly"),t&st.keyAgreement&&r.push("keyAgreement"),t&st.keyCertSign&&r.push("keyCertSign"),t&st.keyEncipherment&&r.push("keyEncipherment"),t&st.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var Qo;class nn{constructor(t={}){this.base=new ee,this.minimum=0,Object.assign(this,t)}}u([f({type:ee})],nn.prototype,"base",void 0),u([f({type:b.Integer,context:0,defaultValue:0,implicit:!0})],nn.prototype,"minimum",void 0),u([f({type:b.Integer,context:1,optional:!0,implicit:!0})],nn.prototype,"maximum",void 0);let on=Qo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};on=Qo=u([T({type:N.Sequence,itemType:nn})],on);class dl{constructor(t={}){Object.assign(this,t)}}u([f({type:on,context:0,optional:!0,implicit:!0})],dl.prototype,"permittedSubtrees",void 0),u([f({type:on,context:1,optional:!0,implicit:!0})],dl.prototype,"excludedSubtrees",void 0);class fl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.Integer,context:0,implicit:!0,optional:!0,converter:ge})],fl.prototype,"requireExplicitPolicy",void 0),u([f({type:b.Integer,context:1,implicit:!0,optional:!0,converter:ge})],fl.prototype,"inhibitPolicyMapping",void 0);var Xo;class es{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],es.prototype,"issuerDomainPolicy",void 0),u([f({type:b.ObjectIdentifier})],es.prototype,"subjectDomainPolicy",void 0);let pl=Xo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};pl=Xo=u([T({type:N.Sequence,itemType:es})],pl);var ts;const hl=`${Yt}.17`;let rs=ts=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};rs=ts=u([T({type:N.Sequence})],rs);let At=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],At.prototype,"type",void 0),u([f({type:b.Any,repeated:"set"})],At.prototype,"values",void 0);var is;let yl=is=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};yl=is=u([T({type:N.Sequence,itemType:At})],yl);const ml=`${Yt}.14`;class jt extends Po{}class gl{constructor(t={}){Object.assign(this,t)}}u([f({type:b.GeneralizedTime,context:0,implicit:!0,optional:!0})],gl.prototype,"notBefore",void 0),u([f({type:b.GeneralizedTime,context:1,implicit:!0,optional:!0})],gl.prototype,"notAfter",void 0);var Xr;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(Xr||(Xr={}));class bl extends Wi{toJSON(){const t=[],r=this.toNumber();return r&Xr.pKIXCertificate&&t.push("pKIXCertificate"),r&Xr.newExtensions&&t.push("newExtensions"),r&Xr.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class wl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new bl,Object.assign(this,t)}}u([f({type:b.GeneralString})],wl.prototype,"entrustVers",void 0),u([f({type:bl})],wl.prototype,"entrustInfoFlags",void 0);var ns;let vl=ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};vl=ns=u([T({type:N.Sequence,itemType:Yi})],vl);class L{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof L&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&Ga(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:b.ObjectIdentifier})],L.prototype,"algorithm",void 0),u([f({type:b.Any,optional:!0})],L.prototype,"parameters",void 0);class Bt{constructor(t={}){this.algorithm=new L,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:L})],Bt.prototype,"algorithm",void 0),u([f({type:b.BitString})],Bt.prototype,"subjectPublicKey",void 0);let De=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:b.UTCTime})],De.prototype,"utcTime",void 0),u([f({type:b.GeneralizedTime})],De.prototype,"generalTime",void 0),De=u([T({type:N.Choice})],De);class sn{constructor(t){this.notBefore=new De(new Date),this.notAfter=new De(new Date),t&&(this.notBefore=new De(t.notBefore),this.notAfter=new De(t.notAfter))}}u([f({type:De})],sn.prototype,"notBefore",void 0),u([f({type:De})],sn.prototype,"notAfter",void 0);var os;let at=class Ff{constructor(t={}){this.extnID="",this.critical=Ff.CRITICAL,this.extnValue=new ne,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:b.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:b.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:ne})],at.prototype,"extnValue",void 0);let Qt=os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};Qt=os=u([T({type:N.Sequence,itemType:at})],Qt);var br;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(br||(br={}));class et{constructor(t={}){this.version=br.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new L,this.issuer=new xe,this.validity=new sn,this.subject=new xe,this.subjectPublicKeyInfo=new Bt,Object.assign(this,t)}}u([f({type:b.Integer,context:0,defaultValue:br.v1})],et.prototype,"version",void 0),u([f({type:b.Integer,converter:ge})],et.prototype,"serialNumber",void 0),u([f({type:L})],et.prototype,"signature",void 0),u([f({type:xe})],et.prototype,"issuer",void 0),u([f({type:sn})],et.prototype,"validity",void 0),u([f({type:xe})],et.prototype,"subject",void 0),u([f({type:Bt})],et.prototype,"subjectPublicKeyInfo",void 0),u([f({type:b.BitString,context:1,implicit:!0,optional:!0})],et.prototype,"issuerUniqueID",void 0),u([f({type:b.BitString,context:2,implicit:!0,optional:!0})],et.prototype,"subjectUniqueID",void 0),u([f({type:Qt,context:3,optional:!0})],et.prototype,"extensions",void 0);class wr{constructor(t={}){this.tbsCertificate=new et,this.signatureAlgorithm=new L,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:et})],wr.prototype,"tbsCertificate",void 0),u([f({type:L})],wr.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],wr.prototype,"signatureValue",void 0);class an{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new De,Object.assign(this,t)}}u([f({type:b.Integer,converter:ge})],an.prototype,"userCertificate",void 0),u([f({type:De})],an.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],an.prototype,"crlEntryExtensions",void 0);class It{constructor(t={}){this.signature=new L,this.issuer=new xe,this.thisUpdate=new De,Object.assign(this,t)}}u([f({type:b.Integer,optional:!0})],It.prototype,"version",void 0),u([f({type:L})],It.prototype,"signature",void 0),u([f({type:xe})],It.prototype,"issuer",void 0),u([f({type:De})],It.prototype,"thisUpdate",void 0),u([f({type:De,optional:!0})],It.prototype,"nextUpdate",void 0),u([f({type:an,repeated:"sequence",optional:!0})],It.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],It.prototype,"crlExtensions",void 0);let ss=class{constructor(t={}){this.tbsCertList=new It,this.signatureAlgorithm=new L,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:It})],ss.prototype,"tbsCertList",void 0),u([f({type:L})],ss.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],ss.prototype,"signature",void 0);let vr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],vr.prototype,"attrType",void 0),u([f({type:b.Any,repeated:"set"})],vr.prototype,"attrValues",void 0);class as{constructor(t={}){this.acIssuer=new ee,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ee})],as.prototype,"acIssuer",void 0),u([f({type:b.Integer})],as.prototype,"acSerial",void 0),u([f({type:At,repeated:"sequence"})],as.prototype,"attrs",void 0);var cs;let cn=cs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};cn=cs=u([T({type:N.Sequence,itemType:b.ObjectIdentifier})],cn);class ln{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:b.Integer,optional:!0})],ln.prototype,"pathLenConstraint",void 0),u([f({type:cn,implicit:!0,context:0,optional:!0})],ln.prototype,"permittedAttrs",void 0),u([f({type:cn,implicit:!0,context:1,optional:!0})],ln.prototype,"excludedAttrs",void 0),u([f({type:b.Boolean,defaultValue:!0})],ln.prototype,"permitUnSpecified",void 0);class Xt{constructor(t={}){this.issuer=new Re,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Re})],Xt.prototype,"issuer",void 0),u([f({type:b.Integer,converter:ge})],Xt.prototype,"serial",void 0),u([f({type:b.BitString,optional:!0})],Xt.prototype,"issuerUID",void 0);var ls;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(ls||(ls={}));class er{constructor(t={}){this.digestedObjectType=ls.publicKey,this.digestAlgorithm=new L,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Enumerated})],er.prototype,"digestedObjectType",void 0),u([f({type:b.ObjectIdentifier,optional:!0})],er.prototype,"otherObjectTypeID",void 0),u([f({type:L})],er.prototype,"digestAlgorithm",void 0),u([f({type:b.BitString})],er.prototype,"objectDigest",void 0);class un{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,optional:!0})],un.prototype,"issuerName",void 0),u([f({type:Xt,context:0,implicit:!0,optional:!0})],un.prototype,"baseCertificateID",void 0),u([f({type:er,context:1,implicit:!0,optional:!0})],un.prototype,"objectDigestInfo",void 0);let kr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,repeated:"sequence"})],kr.prototype,"v1Form",void 0),u([f({type:un,context:0,implicit:!0})],kr.prototype,"v2Form",void 0),kr=u([T({type:N.Choice})],kr);class dn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:b.GeneralizedTime})],dn.prototype,"notBeforeTime",void 0),u([f({type:b.GeneralizedTime})],dn.prototype,"notAfterTime",void 0);class ei{constructor(t={}){Object.assign(this,t)}}u([f({type:Xt,implicit:!0,context:0,optional:!0})],ei.prototype,"baseCertificateID",void 0),u([f({type:Re,implicit:!0,context:1,optional:!0})],ei.prototype,"entityName",void 0),u([f({type:er,implicit:!0,context:2,optional:!0})],ei.prototype,"objectDigestInfo",void 0);var us;(function(e){e[e.v2=1]="v2"})(us||(us={}));class ct{constructor(t={}){this.version=us.v2,this.holder=new ei,this.issuer=new kr,this.signature=new L,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new dn,this.attributes=[],Object.assign(this,t)}}u([f({type:b.Integer})],ct.prototype,"version",void 0),u([f({type:ei})],ct.prototype,"holder",void 0),u([f({type:kr})],ct.prototype,"issuer",void 0),u([f({type:L})],ct.prototype,"signature",void 0),u([f({type:b.Integer,converter:ge})],ct.prototype,"serialNumber",void 0),u([f({type:dn})],ct.prototype,"attrCertValidityPeriod",void 0),u([f({type:At,repeated:"sequence"})],ct.prototype,"attributes",void 0),u([f({type:b.BitString,optional:!0})],ct.prototype,"issuerUniqueID",void 0),u([f({type:Qt,optional:!0})],ct.prototype,"extensions",void 0);class fn{constructor(t={}){this.acinfo=new ct,this.signatureAlgorithm=new L,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ct})],fn.prototype,"acinfo",void 0),u([f({type:L})],fn.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],fn.prototype,"signatureValue",void 0);var pn;(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"})(pn||(pn={}));class ds extends Wi{}class fs{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier,implicit:!0,context:0})],fs.prototype,"type",void 0),u([f({type:b.Any,implicit:!0,context:1})],fs.prototype,"value",void 0);class ps{constructor(t={}){this.policyId="",this.classList=new ds(pn.unclassified),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ps.prototype,"policyId",void 0),u([f({type:ds,defaultValue:new ds(pn.unclassified)})],ps.prototype,"classList",void 0),u([f({type:fs,repeated:"set"})],ps.prototype,"securityCategories",void 0);class hn{constructor(t={}){Object.assign(this,t)}}u([f({type:ne})],hn.prototype,"cotets",void 0),u([f({type:b.ObjectIdentifier})],hn.prototype,"oid",void 0),u([f({type:b.Utf8String})],hn.prototype,"string",void 0);class kl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],kl.prototype,"policyAuthority",void 0),u([f({type:hn,repeated:"sequence"})],kl.prototype,"values",void 0);var hs;class yn{constructor(t={}){this.targetCertificate=new Xt,Object.assign(this,t)}}u([f({type:Xt})],yn.prototype,"targetCertificate",void 0),u([f({type:ee,optional:!0})],yn.prototype,"targetName",void 0),u([f({type:er,optional:!0})],yn.prototype,"certDigestInfo",void 0);let Cr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,context:0,implicit:!0})],Cr.prototype,"targetName",void 0),u([f({type:ee,context:1,implicit:!0})],Cr.prototype,"targetGroup",void 0),u([f({type:yn,context:2,implicit:!0})],Cr.prototype,"targetCert",void 0),Cr=u([T({type:N.Choice})],Cr);let ys=hs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};ys=hs=u([T({type:N.Sequence,itemType:Cr})],ys);var ms;let Cl=ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};Cl=ms=u([T({type:N.Sequence,itemType:ys})],Cl);class Sl{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],Sl.prototype,"roleAuthority",void 0),u([f({type:ee,implicit:!0,context:1})],Sl.prototype,"roleName",void 0);class gs{constructor(t={}){this.service=new ee,this.ident=new ee,Object.assign(this,t)}}u([f({type:ee})],gs.prototype,"service",void 0),u([f({type:ee})],gs.prototype,"ident",void 0),u([f({type:ne,optional:!0})],gs.prototype,"authInfo",void 0);var bs;class ws{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ws.prototype,"otherCertFormat",void 0),u([f({type:b.Any})],ws.prototype,"otherCert",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:wr})],Sr.prototype,"certificate",void 0),u([f({type:fn,context:2,implicit:!0})],Sr.prototype,"v2AttrCert",void 0),u([f({type:ws,context:3,implicit:!0})],Sr.prototype,"other",void 0),Sr=u([T({type:N.Choice})],Sr);let mn=bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};mn=bs=u([T({type:N.Set,itemType:Sr})],mn);class xr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],xr.prototype,"contentType",void 0),u([f({type:b.Any,context:0})],xr.prototype,"content",void 0);let ti=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ne})],ti.prototype,"single",void 0),u([f({type:b.Any})],ti.prototype,"any",void 0),ti=u([T({type:N.Choice})],ti);class gn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],gn.prototype,"eContentType",void 0),u([f({type:ti,context:0,optional:!0})],gn.prototype,"eContent",void 0);var Et;(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"})(Et||(Et={}));let ri=class extends L{};ri=u([T({type:N.Sequence})],ri);let bn=class extends L{};bn=u([T({type:N.Sequence})],bn);let pt=class extends L{};pt=u([T({type:N.Sequence})],pt);let wn=class extends L{};wn=u([T({type:N.Sequence})],wn);let xl=class extends L{};xl=u([T({type:N.Sequence})],xl);let vs=class extends L{};vs=u([T({type:N.Sequence})],vs);let ii=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ne,context:0,implicit:!0,optional:!0})],ii.prototype,"value",void 0),u([f({type:ne,converter:wp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ii.prototype,"constructedValue",void 0),ii=u([T({type:N.Choice})],ii);class ni{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new wn,Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ni.prototype,"contentType",void 0),u([f({type:wn})],ni.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ii,optional:!0})],ni.prototype,"encryptedContent",void 0);class Ar{constructor(t={}){this.issuer=new xe,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:xe})],Ar.prototype,"issuer",void 0),u([f({type:b.Integer,converter:ge})],Ar.prototype,"serialNumber",void 0);class vn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],vn.prototype,"keyAttrId",void 0),u([f({type:b.Any,optional:!0})],vn.prototype,"keyAttr",void 0);var ks;class kn{constructor(t={}){this.subjectKeyIdentifier=new jt,Object.assign(this,t)}}u([f({type:jt})],kn.prototype,"subjectKeyIdentifier",void 0),u([f({type:b.GeneralizedTime,optional:!0})],kn.prototype,"date",void 0),u([f({type:vn,optional:!0})],kn.prototype,"other",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:kn,context:0,implicit:!0,optional:!0})],Br.prototype,"rKeyId",void 0),u([f({type:Ar,optional:!0})],Br.prototype,"issuerAndSerialNumber",void 0),Br=u([T({type:N.Choice})],Br);class Cs{constructor(t={}){this.rid=new Br,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:Br})],Cs.prototype,"rid",void 0),u([f({type:ne})],Cs.prototype,"encryptedKey",void 0);let Cn=ks=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};Cn=ks=u([T({type:N.Sequence,itemType:Cs})],Cn);class Ss{constructor(t={}){this.algorithm=new L,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:L})],Ss.prototype,"algorithm",void 0),u([f({type:b.BitString})],Ss.prototype,"publicKey",void 0);let tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0,optional:!0})],tr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ss,context:1,implicit:!0,optional:!0})],tr.prototype,"originatorKey",void 0),u([f({type:Ar,optional:!0})],tr.prototype,"issuerAndSerialNumber",void 0),tr=u([T({type:N.Choice})],tr);class Ir{constructor(t={}){this.version=Et.v3,this.originator=new tr,this.keyEncryptionAlgorithm=new pt,this.recipientEncryptedKeys=new Cn,Object.assign(this,t)}}u([f({type:b.Integer})],Ir.prototype,"version",void 0),u([f({type:tr,context:0})],Ir.prototype,"originator",void 0),u([f({type:ne,context:1,optional:!0})],Ir.prototype,"ukm",void 0),u([f({type:pt})],Ir.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:Cn})],Ir.prototype,"recipientEncryptedKeys",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0})],Er.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ar})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([T({type:N.Choice})],Er);class oi{constructor(t={}){this.version=Et.v0,this.rid=new Er,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:b.Integer})],oi.prototype,"version",void 0),u([f({type:Er})],oi.prototype,"rid",void 0),u([f({type:pt})],oi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],oi.prototype,"encryptedKey",void 0);class si{constructor(t={}){this.keyIdentifier=new ne,Object.assign(this,t)}}u([f({type:ne})],si.prototype,"keyIdentifier",void 0),u([f({type:b.GeneralizedTime,optional:!0})],si.prototype,"date",void 0),u([f({type:vn,optional:!0})],si.prototype,"other",void 0);class ai{constructor(t={}){this.version=Et.v4,this.kekid=new si,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:b.Integer})],ai.prototype,"version",void 0),u([f({type:si})],ai.prototype,"kekid",void 0),u([f({type:pt})],ai.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],ai.prototype,"encryptedKey",void 0);class ci{constructor(t={}){this.version=Et.v0,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:b.Integer})],ci.prototype,"version",void 0),u([f({type:vs,context:0,optional:!0})],ci.prototype,"keyDerivationAlgorithm",void 0),u([f({type:pt})],ci.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],ci.prototype,"encryptedKey",void 0);class xs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],xs.prototype,"oriType",void 0),u([f({type:b.Any})],xs.prototype,"oriValue",void 0);let Dt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oi,optional:!0})],Dt.prototype,"ktri",void 0),u([f({type:Ir,context:1,implicit:!0,optional:!0})],Dt.prototype,"kari",void 0),u([f({type:ai,context:2,implicit:!0,optional:!0})],Dt.prototype,"kekri",void 0),u([f({type:ci,context:3,implicit:!0,optional:!0})],Dt.prototype,"pwri",void 0),u([f({type:xs,context:4,implicit:!0,optional:!0})],Dt.prototype,"ori",void 0),Dt=u([T({type:N.Choice})],Dt);var As;let Sn=As=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};Sn=As=u([T({type:N.Set,itemType:Dt})],Sn);var Bs;class xn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],xn.prototype,"otherRevInfoFormat",void 0),u([f({type:b.Any})],xn.prototype,"otherRevInfo",void 0);let li=class{constructor(t={}){this.other=new xn,Object.assign(this,t)}};u([f({type:xn,context:1,implicit:!0})],li.prototype,"other",void 0),li=u([T({type:N.Choice})],li);let Is=Bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Bs.prototype)}};Is=Bs=u([T({type:N.Set,itemType:li})],Is);class Es{constructor(t={}){Object.assign(this,t)}}u([f({type:mn,context:0,implicit:!0,optional:!0})],Es.prototype,"certs",void 0),u([f({type:Is,context:1,implicit:!0,optional:!0})],Es.prototype,"crls",void 0);var Ns;let Os=Ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};Os=Ns=u([T({type:N.Set,itemType:vr})],Os);class ui{constructor(t={}){this.version=Et.v0,this.recipientInfos=new Sn,this.encryptedContentInfo=new ni,Object.assign(this,t)}}u([f({type:b.Integer})],ui.prototype,"version",void 0),u([f({type:Es,context:0,implicit:!0,optional:!0})],ui.prototype,"originatorInfo",void 0),u([f({type:Sn})],ui.prototype,"recipientInfos",void 0),u([f({type:ni})],ui.prototype,"encryptedContentInfo",void 0),u([f({type:Os,context:1,implicit:!0,optional:!0})],ui.prototype,"unprotectedAttrs",void 0);const Kp="1.2.840.113549.1.7.2";let Nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0})],Nr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ar})],Nr.prototype,"issuerAndSerialNumber",void 0),Nr=u([T({type:N.Choice})],Nr);var _s;class Nt{constructor(t={}){this.version=Et.v0,this.sid=new Nr,this.digestAlgorithm=new ri,this.signatureAlgorithm=new bn,this.signature=new ne,Object.assign(this,t)}}u([f({type:b.Integer})],Nt.prototype,"version",void 0),u([f({type:Nr})],Nt.prototype,"sid",void 0),u([f({type:ri})],Nt.prototype,"digestAlgorithm",void 0),u([f({type:vr,repeated:"set",context:0,implicit:!0,optional:!0})],Nt.prototype,"signedAttrs",void 0),u([f({type:bn})],Nt.prototype,"signatureAlgorithm",void 0),u([f({type:ne})],Nt.prototype,"signature",void 0),u([f({type:vr,repeated:"set",context:1,implicit:!0,optional:!0})],Nt.prototype,"unsignedAttrs",void 0);let An=_s=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};An=_s=u([T({type:N.Set,itemType:Nt})],An);var Ts;let Bn=Ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Bn=Ts=u([T({type:N.Set,itemType:ri})],Bn);class Or{constructor(t={}){this.version=Et.v0,this.digestAlgorithms=new Bn,this.encapContentInfo=new gn,this.signerInfos=new An,Object.assign(this,t)}}u([f({type:b.Integer})],Or.prototype,"version",void 0),u([f({type:Bn})],Or.prototype,"digestAlgorithms",void 0),u([f({type:gn})],Or.prototype,"encapContentInfo",void 0),u([f({type:mn,context:0,implicit:!0,optional:!0})],Or.prototype,"certificates",void 0),u([f({type:li,context:1,implicit:!0,optional:!0})],Or.prototype,"crls",void 0),u([f({type:An})],Or.prototype,"signerInfos",void 0);const di="1.2.840.10045.2.1",Vs="1.2.840.10045.4.1",Al="1.2.840.10045.4.3.1",js="1.2.840.10045.4.3.2",Ds="1.2.840.10045.4.3.3",Ps="1.2.840.10045.4.3.4",Bl="1.2.840.10045.3.1.7",Il="1.3.132.0.34",El="1.3.132.0.35";function fi(e){return new L({algorithm:e})}const qp=fi(Vs);fi(Al);const zp=fi(js),Gp=fi(Ds),Wp=fi(Ps);let _r=class{constructor(t={}){Object.assign(this,t)}};u([f({type:b.ObjectIdentifier})],_r.prototype,"namedCurve",void 0),_r=u([T({type:N.Choice})],_r);class In{constructor(t={}){this.version=1,this.privateKey=new ne,Object.assign(this,t)}}u([f({type:b.Integer})],In.prototype,"version",void 0),u([f({type:ne})],In.prototype,"privateKey",void 0),u([f({type:_r,context:0,optional:!0})],In.prototype,"parameters",void 0),u([f({type:b.BitString,context:1,optional:!0})],In.prototype,"publicKey",void 0);class En{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:ge})],En.prototype,"r",void 0),u([f({type:b.Integer,converter:ge})],En.prototype,"s",void 0);const Fe="1.2.840.113549.1.1",Tr=`${Fe}.1`,Jp=`${Fe}.7`,Yp=`${Fe}.9`,Zp=`${Fe}.10`,Qp=`${Fe}.2`,Xp=`${Fe}.4`,Nn=`${Fe}.5`,eh=`${Fe}.14`,$s=`${Fe}.11`,On=`${Fe}.12`,_n=`${Fe}.13`,Nl=`${Fe}.15`,Ol=`${Fe}.16`,_l="1.3.14.3.2.26",Tl="2.16.840.1.101.3.4.2.4",Vl="2.16.840.1.101.3.4.2.1",jl="2.16.840.1.101.3.4.2.2",Dl="2.16.840.1.101.3.4.2.3",th="2.16.840.1.101.3.4.2.5",rh="2.16.840.1.101.3.4.2.6",ih="1.2.840.113549.2.2",nh="1.2.840.113549.2.5",Ms=`${Fe}.8`;function Ae(e){return new L({algorithm:e,parameters:null})}Ae(ih),Ae(nh);const rr=Ae(_l);Ae(Tl),Ae(Vl),Ae(jl),Ae(Dl),Ae(th),Ae(rh);const Pl=new L({algorithm:Ms,parameters:H.serialize(rr)}),$l=new L({algorithm:Yp,parameters:H.serialize(Ji.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ae(Tr),Ae(Qp),Ae(Xp),Ae(Nn),Ae(Nl),Ae(Ol),Ae(On),Ae(_n),Ae(Nl),Ae(Ol);class Tn{constructor(t={}){this.hashAlgorithm=new L(rr),this.maskGenAlgorithm=new L({algorithm:Ms,parameters:H.serialize(rr)}),this.pSourceAlgorithm=new L($l),Object.assign(this,t)}}u([f({type:L,context:0,defaultValue:rr})],Tn.prototype,"hashAlgorithm",void 0),u([f({type:L,context:1,defaultValue:Pl})],Tn.prototype,"maskGenAlgorithm",void 0),u([f({type:L,context:2,defaultValue:$l})],Tn.prototype,"pSourceAlgorithm",void 0),new L({algorithm:Jp,parameters:H.serialize(new Tn)});class pi{constructor(t={}){this.hashAlgorithm=new L(rr),this.maskGenAlgorithm=new L({algorithm:Ms,parameters:H.serialize(rr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:L,context:0,defaultValue:rr})],pi.prototype,"hashAlgorithm",void 0),u([f({type:L,context:1,defaultValue:Pl})],pi.prototype,"maskGenAlgorithm",void 0),u([f({type:b.Integer,context:2,defaultValue:20})],pi.prototype,"saltLength",void 0),u([f({type:b.Integer,context:3,defaultValue:1})],pi.prototype,"trailerField",void 0),new L({algorithm:Zp,parameters:H.serialize(new pi)});class Vn{constructor(t={}){this.digestAlgorithm=new L,this.digest=new ne,Object.assign(this,t)}}u([f({type:L})],Vn.prototype,"digestAlgorithm",void 0),u([f({type:ne})],Vn.prototype,"digest",void 0);var Rs;class jn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:ge})],jn.prototype,"prime",void 0),u([f({type:b.Integer,converter:ge})],jn.prototype,"exponent",void 0),u([f({type:b.Integer,converter:ge})],jn.prototype,"coefficient",void 0);let Us=Rs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};Us=Rs=u([T({type:N.Sequence,itemType:jn})],Us);class ht{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:b.Integer})],ht.prototype,"version",void 0),u([f({type:b.Integer,converter:ge})],ht.prototype,"modulus",void 0),u([f({type:b.Integer,converter:ge})],ht.prototype,"publicExponent",void 0),u([f({type:b.Integer,converter:ge})],ht.prototype,"privateExponent",void 0),u([f({type:b.Integer,converter:ge})],ht.prototype,"prime1",void 0),u([f({type:b.Integer,converter:ge})],ht.prototype,"prime2",void 0),u([f({type:b.Integer,converter:ge})],ht.prototype,"exponent1",void 0),u([f({type:b.Integer,converter:ge})],ht.prototype,"exponent2",void 0),u([f({type:b.Integer,converter:ge})],ht.prototype,"coefficient",void 0),u([f({type:Us,optional:!0})],ht.prototype,"otherPrimeInfos",void 0);class Ls{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.Integer,converter:ge})],Ls.prototype,"modulus",void 0),u([f({type:b.Integer,converter:ge})],Ls.prototype,"publicExponent",void 0);var Hs;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Hs||(Hs={}));const Ke=Hs;/*! *****************************************************************************
75
+ `)}`:`${r} :`}}nc=He,$.Constructed=nc,He.NAME="CONSTRUCTED";class oc extends Me{fromBER(t,r,i){return r}toBER(t){return nt}}oc.override="EndOfContentValueBlock";var sc;class mo extends Ee{constructor(t={}){super(t,oc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}sc=mo,$.EndOfContent=sc,mo.NAME=Kr;var ac;class Kt extends Ee{constructor(t={}){super(t,Me),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}`}}ac=Kt,$.Null=ac,Kt.NAME="NULL";class cc extends dt(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=j.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=j.toUint8Array(t);return wt(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}}}cc.NAME="BooleanValueBlock";var lc;let Vi=class extends Ee{constructor(t={}){super(t,cc),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}`}};lc=Vi,$.Boolean=lc,Vi.NAME="BOOLEAN";class uc extends dt(Vt){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=Vt.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===Kr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Za)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?Vt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}uc.NAME="OctetStringValueBlock";var dc;let zt=class Hf extends Ee{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},uc),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=fr(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?He.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 j.concat(t)}};dc=zt,$.OctetString=dc,zt.NAME=Za;class fc extends dt(Vt){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=Vt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const c of this.value){const l=c.constructor.NAME;if(l===Kr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==Qa)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=j.toUint8Array(t);if(!wt(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=fr(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 Vt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return nt;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}}}fc.NAME="BitStringValueBlock";var pc;let Gt=class extends Ee{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},fc),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 He.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};pc=Gt,$.BitString=pc,Gt.NAME=Qa;var hc;function lp(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 y=l<a?a:l;let p=0;for(let A=y;A>=0;A--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=fo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=fo(r,s)),s}function yc(e){if(e>=qr.length)for(let t=qr.length;t<=e;t++){const r=new Uint8Array([0]);let i=qr[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=fo(r,i)),qr.push(i)}return qr[e]}function up(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,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class go extends dt(Me){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=Wa.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Zf(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=up(yc(i),r),a="-";break;default:r=lp(r,yc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=Ja.charAt(r[l]));return c===!1&&(a+=Ja.charAt(0)),a}}hc=go,go.NAME="IntegerValueBlock",Object.defineProperty(hc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var mc;class ft extends Ee{constructor(t={}){super(t,go),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Oi(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Oi();const r=BigInt(t),i=new _i,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,y=j.toUint8Array(R.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new ft({valueHex:i.final()})}convertToDER(){const t=new ft({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ft({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}mc=ft,$.Integer=mc,ft.NAME="INTEGER";var gc;class ji extends ft{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}gc=ji,$.Enumerated=gc,ji.NAME="ENUMERATED";class bo extends dt(Me){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=j.toUint8Array(t);if(!wt(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=dr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Oi();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=Ft(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;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}}}bo.NAME="sidBlock";class bc extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new bo;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,nt;r.push(o)}return po(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 bo;if(o>Number.MAX_SAFE_INTEGER){Oi();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}}bc.NAME="ObjectIdentifierValueBlock";var wc;class Di extends Ee{constructor(t={}){super(t,bc),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()}}}wc=Di,$.ObjectIdentifier=wc,Di.NAME="OBJECT IDENTIFIER";class wo extends dt(qt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=j.toUint8Array(t);if(!wt(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=dr(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=Ft(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;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}}}wo.NAME="relativeSidBlock";class vc extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new wo;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,nt;i.push(s)}return po(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 wo;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}}vc.NAME="RelativeObjectIdentifierValueBlock";var kc;class vo extends Ee{constructor(t={}){super(t,vc),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()}}}kc=vo,$.RelativeObjectIdentifier=kc,vo.NAME="RelativeObjectIdentifier";var Cc;class vt extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Cc=vt,$.Sequence=Cc,vt.NAME="SEQUENCE";var Sc;let kt=class extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Sc=kt,$.Set=Sc,kt.NAME="SET";class xc extends dt(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}xc.NAME="StringValueBlock";class Ac extends xc{}Ac.NAME="SimpleStringValueBlock";class Je extends yo{constructor({...t}={}){super(t,Ac)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,j.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}}Je.NAME="SIMPLE STRING";class Bc extends Je{fromBuffer(t){this.valueBlock.valueHexView=j.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}}Bc.NAME="Utf8StringValueBlock";var Ic;class Ct extends Bc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Ic=Ct,$.Utf8String=Ic,Ct.NAME="UTF8String";class Ec extends Je{fromBuffer(t){this.valueBlock.value=R.ToUtf16String(t),this.valueBlock.valueHexView=j.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(R.FromUtf16String(t))}}Ec.NAME="BmpStringValueBlock";var Nc;class Pi extends Ec{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Nc=Pi,$.BmpString=Nc,Pi.NAME="BMPString";class Oc extends Je{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=Ft(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}}Oc.NAME="UniversalStringValueBlock";var _c;class $i extends Oc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}_c=$i,$.UniversalString=_c,$i.NAME="UniversalString";var Tc;class Mi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Tc=Mi,$.NumericString=Tc,Mi.NAME="NumericString";var Vc;class Ri extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Vc=Ri,$.PrintableString=Vc,Ri.NAME="PrintableString";var jc;class Ui extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}jc=Ui,$.TeletexString=jc,Ui.NAME="TeletexString";var Dc;class Li extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Dc=Li,$.VideotexString=Dc,Li.NAME="VideotexString";var Pc;class Hi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Pc=Hi,$.IA5String=Pc,Hi.NAME="IA5String";var $c;class Fi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}$c=Fi,$.GraphicString=$c,Fi.NAME="GraphicString";var Mc;class Gr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Mc=Gr,$.VisibleString=Mc,Gr.NAME="VisibleString";var Rc;class qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Rc=qi,$.GeneralString=Rc,qi.NAME="GeneralString";var Uc;class Ki extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Uc=Ki,$.CharacterString=Uc,Ki.NAME="CharacterString";var Lc;class Wr extends Gr{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,j.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]=We(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=We(this.month,2),r[2]=We(this.day,2),r[3]=We(this.hour,2),r[4]=We(this.minute,2),r[5]=We(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}Lc=Wr,$.UTCTime=Lc,Wr.NAME="UTCTime";var Hc;class zi extends Wr{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 p=new Number(t[t.length-1]);if(isNaN(p.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 p=1,A=i.indexOf("+"),b="";if(A===-1&&(A=i.indexOf("-"),p=-1),A!==-1){if(b=i.substring(A+1),i=i.substring(0,A),b.length!==2&&b.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(b.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,b.length===4){if(h=parseInt(b.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.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 p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(o);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(We(this.year,4)),r.push(We(this.month,2)),r.push(We(this.day,2)),r.push(We(this.hour,2)),r.push(We(this.minute,2)),r.push(We(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(We(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Hc=zi,$.GeneralizedTime=Hc,zi.NAME="GeneralizedTime";var Fc;class ko extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Fc=ko,$.DATE=Fc,ko.NAME="DATE";var qc;class Co extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}qc=Co,$.TimeOfDay=qc,Co.NAME="TimeOfDay";var Kc;class So extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Kc=So,$.DateTime=Kc,So.NAME="DateTime";var zc;class xo extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}zc=xo,$.Duration=zc,xo.NAME="Duration";var Gc;class Ao extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Gc=Ao,$.TIME=Gc,Ao.NAME="TIME";class Wt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Bo extends Wt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Gi extends Wt{constructor({value:t=new Wt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class dp{constructor({data:t=Ti}={}){this.dataView=j.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=j.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=j.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Jt(e,t,r){if(r instanceof Bo){for(let s=0;s<r.value.length;s++)if(Jt(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(ho)&&(s.name=r.name),s}}if(r instanceof Wt)return r.hasOwnProperty(ho)&&(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(!(ep in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(np in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(op 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(tp)===!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(rp)===!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(ip)===!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(!(Ya 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,Le),r.name&&(e[r.name]=t)),r instanceof $.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Gi&&(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,Le),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,Le),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Gi){if(a=Jt(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,Le),r.name&&delete e[r.name]),a;if(ho in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};sp 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=Jt(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,Le),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,Le),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&Ya in t.valueBlock){const s=fr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],a.name=r.name)),a}return Jt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function fp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=fr(j.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Jt(r.result,r.result,t)}const Wc=Object.freeze(Object.defineProperty({__proto__:null,Any:Wt,BaseBlock:Ee,BaseStringBlock:yo,BitString:Gt,BmpString:Pi,Boolean:Vi,CharacterString:Ki,Choice:Bo,Constructed:He,DATE:ko,DateTime:So,Duration:xo,EndOfContent:mo,Enumerated:ji,GeneralString:qi,GeneralizedTime:zi,GraphicString:Fi,HexBlock:dt,IA5String:Hi,Integer:ft,Null:Kt,NumericString:Mi,ObjectIdentifier:Di,OctetString:zt,Primitive:zr,PrintableString:Ri,RawData:dp,RelativeObjectIdentifier:vo,Repeated:Gi,Sequence:vt,Set:kt,TIME:Ao,TeletexString:Ui,TimeOfDay:Co,UTCTime:Wr,UniversalString:$i,Utf8String:Ct,ValueBlock:Me,VideotexString:Li,ViewWriter:_i,VisibleString:Gr,compareSchema:Jt,fromBER:pr,verifySchema:fp},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 w;(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"})(w||(w={}));class Wi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(j.isBufferSource(t))this.unusedBits=r,this.value=j.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Gt))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 Gt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Gt({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 ne{constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):j.isBufferSource(t)?this.buffer=j.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 zt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new zt({valueHex:this.buffer})}toSchema(t){return new zt({name:t})}}const pp={fromASN:e=>e instanceof Kt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Kt;const t=pr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},hp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ft({value:+e})},yp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new ji({value:e})},ge={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ft({valueHex:e})},mp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Gt({valueHex:e})},gp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Di({value:e})},bp={fromASN:e=>e.valueBlock.value,toASN:e=>new Vi({value:e})},Ji={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new zt({valueHex:e})},wp={fromASN:e=>new ne(e.getValue()),toASN:e=>e.toASN()};function Qe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const Jc=Qe(Ct),vp=Qe(Pi),kp=Qe($i),Cp=Qe(Mi),Sp=Qe(Ri),xp=Qe(Ui),Ap=Qe(Li),Bp=Qe(Hi),Ip=Qe(Fi),Ep=Qe(Gr),Np=Qe(qi),Op=Qe(Ki),_p={fromASN:e=>e.toDate(),toASN:e=>new Wr({valueDate:e})},Tp={fromASN:e=>e.toDate(),toASN:e=>new zi({valueDate:e})},Vp={fromASN:()=>null,toASN:()=>new Kt};function Io(e){switch(e){case w.Any:return pp;case w.BitString:return mp;case w.BmpString:return vp;case w.Boolean:return bp;case w.CharacterString:return Op;case w.Enumerated:return yp;case w.GeneralString:return Np;case w.GeneralizedTime:return Tp;case w.GraphicString:return Ip;case w.IA5String:return Bp;case w.Integer:return hp;case w.Null:return Vp;case w.NumericString:return Cp;case w.ObjectIdentifier:return gp;case w.OctetString:return Ji;case w.PrintableString:return Sp;case w.TeletexString:return xp;case w.UTCTime:return _p;case w.UniversalString:return kp;case w.Utf8String:return Jc;case w.VideotexString:return Ap;case w.VisibleString:return Ep;default:return null}}function St(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:St(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function Yc(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:Yc(r)}return!1}function jp(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 Dp{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 y=w[a.type],p=Wc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else St(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===N.Choice?l=new Wt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Wt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?kt:vt;l=new y({name:"",value:[new Gi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||St(a.type)){const y=a.repeated?He:zr;o.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new He({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new He({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 vt({value:o,name:""});case N.Set:return new kt({value:o,name:""});case N.Choice:return new Bo({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 Xe=new Dp,T=e=>t=>{let r;Xe.has(t)?r=Xe.get(t):(r=Xe.createDefault(t),Xe.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;Xe.has(t.constructor)?i=Xe.get(t.constructor):(i=Xe.createDefault(t.constructor),Xe.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Io(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 Zc extends Error{constructor(){super(...arguments),this.schemas=[]}}class Pp{static parse(t,r){const i=pr(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(St(r))return new r().fromASN(t);const o=Xe.get(r);Xe.cache(r);let s=o.schema;if(t.constructor===He&&o.type!==N.Choice){s=new He({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=Jt({},t,s);if(!a.verified)throw new Zc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(Yc(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=Io(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const y=o.items[l],p=y.type;if(typeof p=="number"||St(p)){const A=(i=y.converter)!==null&&i!==void 0?i:St(p)?new p:null;if(!A)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const b=y.repeated==="sequence"?vt:kt,h=new b;h.valueBlock=d.valueBlock;const m=pr(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 k=m.result.valueBlock.value;c[l]=Array.from(k,g=>A.fromASN(g))}else c[l]=Array.from(d,b=>A.fromASN(b));else{let b=d;if(y.implicit){let h;if(St(p))h=new p().toSchema("");else{const m=w[p],k=Wc[m];if(!k)throw new Error(`Cannot get '${m}' class from asn1js module`);h=new k}h.valueBlock=b.valueBlock,b=pr(h.toBER(!1)).result}c[l]=A.fromASN(b)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");c[l]=Array.from(d,A=>this.fromASN(A,p))}else c[l]=this.fromASN(d,p)}return c}catch(o){throw o instanceof Zc&&o.schemas.push(r.name),o}}}class Eo{static serialize(t){return t instanceof Ee?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&St(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=Xe.get(r);Xe.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=Io(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"&&jp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Eo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||St(c.type))){const y={};y.valueHex=d instanceof Kt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new zr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else o.push(new He({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new He({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 vt({value:o});break;case N.Set:s=new kt({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 ${w[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"?vt:kt;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"?vt:kt;s=new c({value:a})}else s=this.toASN(o);return s}}class le extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class H{static serialize(t){return Eo.serialize(t)}static parse(t,r){return Pp.parse(t,r)}static toString(t){const r=j.isBufferSource(t)?j.toArrayBuffer(t):H.serialize(t),i=pr(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 Qc={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 k=0,g=-1,S=(h.match(l.zoneIndex)||[])[0],v,C;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)k++;if(h.substr(0,2)==="::"&&k--,h.substr(-2,2)==="::"&&k--,k>m)return null;for(C=m-k,v=":";C--;)v+="0:";return h=h.replace("::",v),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),m=function(){const O=h.split(":"),F=[];for(let Y=0;Y<O.length;Y++)F.push(parseInt(O[Y],16));return F}(),{parts:m,zoneId:S}}function y(h,m,k,g){if(h.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,v;for(;g>0;){if(v=k-g,v<0&&(v=0),h[S]>>v!==m[S]>>v)return!1;g-=k,S+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function A(h,m){for(;h.length<m;)h=`0${h}`;return h}const b={};b.IPv4=function(){function h(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let k,g;for(k=0;k<m.length;k++)if(g=m[k],!(0<=g&&g<=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,k){let g;if(k===void 0&&(g=m,m=g[0],k=g[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,m.octets,8,k)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,k=!1;const g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let S,v,C;for(S=3;S>=0;S-=1)if(v=this.octets[S],v in g){if(C=g[v],k&&C!==0)return null;C!==8&&(k=!0),m+=C}else return null;return 32-m},h.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return b.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),b.IPv4.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),k=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[];let v=0;for(;v<4;)S.push(parseInt(k[v],10)|parseInt(g[v],10)^255),v++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.IPv4.isIPv4=function(h){return this.parser(h)!==null},b.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},b.IPv4.isValidFourPartDecimal=function(h){return!!(b.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},b.IPv4.networkAddressFromCIDR=function(h){let m,k,g,S,v;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),v=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[],k=0;k<4;)S.push(parseInt(g[k],10)&parseInt(v[k],10)),k++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.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)},b.IPv4.parseCIDR=function(h){let m;if(m=h.match(/^(.+)\/(\d+)$/)){const k=parseInt(m[2]);if(k>=0&&k<=32){const g=[this.parse(m[1]),k];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},b.IPv4.parser=function(h){let m,k,g;if(m=h.match(i.fourOctet))return function(){const S=m.slice(1,6),v=[];for(let C=0;C<S.length;C++)k=S[C],v.push(p(k));return v}();if(m=h.match(i.longValue)){if(g=p(m[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){const S=[];let v;for(v=0;v<=24;v+=8)S.push(g>>v&255);return S}().reverse()}else return(m=h.match(i.twoOctet))?function(){const S=m.slice(1,4),v=[];if(g=p(S[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return v.push(p(S[0])),v.push(g>>16&255),v.push(g>>8&255),v.push(g&255),v}():(m=h.match(i.threeOctet))?function(){const S=m.slice(1,5),v=[];if(g=p(S[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return v.push(p(S[0])),v.push(p(S[1])),v.push(g>>8&255),v.push(g&255),v}():null},b.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 k=0;const g=Math.floor(h/8);for(;k<g;)m[k]=255,k++;return g<4&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},b.IPv6=function(){function h(m,k){let g,S;if(m.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(m[g]<<8|m[g+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(S=this.parts[g],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");k&&(this.zoneId=k)}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,k){let g;if(k===void 0&&(g=m,m=g[0],k=g[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,m.parts,16,k)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,k=!1;const g={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 S,v;for(let C=7;C>=0;C-=1)if(S=this.parts[C],S in g){if(v=g[S],k&&v!==0)return null;v!==16&&(k=!0),m+=v}else return null;return 128-m},h.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let m;const k=[],g=this.parts;for(let S=0;S<g.length;S++)m=g[S],k.push(m>>8),k.push(m&255);return k},h.prototype.toFixedLengthString=function(){const m=(function(){const g=[];for(let S=0;S<this.parts.length;S++)g.push(A(this.parts[S].toString(16),4));return g}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),m+k},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),k=m[0],g=m[1];return new b.IPv4([k>>8,k&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){const m=(function(){const g=[];for(let S=0;S<this.parts.length;S++)g.push(this.parts[S].toString(16));return g}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),m+k},h.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,k=this.toNormalizedString();let g=0,S=-1,v;for(;v=m.exec(k);)v[0].length>S&&(g=v.index,S=v[0].length);return S<0?k:`${k.substring(0,g)}::${k.substring(g+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),b.IPv6.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),k=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[];let v=0;for(;v<16;)S.push(parseInt(k[v],10)|parseInt(g[v],10)^255),v++;return new this(S)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},b.IPv6.isIPv6=function(h){return this.parser(h)!==null},b.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}},b.IPv6.networkAddressFromCIDR=function(h){let m,k,g,S,v;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),v=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[],k=0;k<16;)S.push(parseInt(g[k],10)&parseInt(v[k],10)),k++;return new this(S)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},b.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)},b.IPv6.parseCIDR=function(h){let m,k,g;if((k=h.match(/^(.+)\/(\d+)$/))&&(m=parseInt(k[2]),m>=0&&m<=128))return g=[this.parse(k[1]),m],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},b.IPv6.parser=function(h){let m,k,g,S,v,C;if(g=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(l.native.test(h))return d(h,8);if((g=h.match(l.transitional))&&(C=g[6]||"",m=d(g[1].slice(0,-1)+C,6),m.parts)){for(v=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],k=0;k<v.length;k++)if(S=v[k],!(0<=S&&S<=255))return null;return m.parts.push(v[0]<<8|v[1]),m.parts.push(v[2]<<8|v[3]),{parts:m.parts,zoneId:m.zoneId}}return null},b.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 k=0;const g=Math.floor(h/8);for(;k<g;)m[k]=255,k++;return g<16&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},b.fromByteArray=function(h){const m=h.length;if(m===4)return new b.IPv4(h);if(m===16)return new b.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},b.isValid=function(h){return b.IPv6.isValid(h)||b.IPv4.isValid(h)},b.parse=function(h){if(b.IPv6.isValid(h))return b.IPv6.parse(h);if(b.IPv4.isValid(h))return b.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},b.parseCIDR=function(h){try{return b.IPv6.parseCIDR(h)}catch{try{return b.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},b.process=function(h){const m=this.parse(h);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},b.subnetMatch=function(h,m,k){let g,S,v,C;k==null&&(k="unicast");for(S in m)if(Object.prototype.hasOwnProperty.call(m,S)){for(v=m[S],v[0]&&!(v[0]instanceof Array)&&(v=[v]),g=0;g<v.length;g++)if(C=v[g],h.kind()===C[0].kind()&&h.match.apply(h,C))return S}return k},e.exports?e.exports=b:t.ipaddr=b})(lo)})(Qc);var Xc=Qc.exports;class el{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 No,Oo,_o;let Ne=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:w.TeletexString})],Ne.prototype,"teletexString",void 0),u([f({type:w.PrintableString})],Ne.prototype,"printableString",void 0),u([f({type:w.UniversalString})],Ne.prototype,"universalString",void 0),u([f({type:w.Utf8String})],Ne.prototype,"utf8String",void 0),u([f({type:w.BmpString})],Ne.prototype,"bmpString",void 0),Ne=u([T({type:N.Choice})],Ne);let hr=class extends Ne{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?R.ToHex(this.anyValue):super.toString())}};u([f({type:w.IA5String})],hr.prototype,"ia5String",void 0),u([f({type:w.Any})],hr.prototype,"anyValue",void 0),hr=u([T({type:N.Choice})],hr);class Jr{constructor(t={}){this.type="",this.value=new hr,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Jr.prototype,"type",void 0),u([f({type:hr})],Jr.prototype,"value",void 0);let yr=No=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,No.prototype)}};yr=No=u([T({type:N.Set,itemType:Jr})],yr);let To=Oo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Oo.prototype)}};To=Oo=u([T({type:N.Sequence,itemType:yr})],To);let xe=_o=class extends To{constructor(t){super(t),Object.setPrototypeOf(this,_o.prototype)}};xe=_o=u([T({type:N.Sequence})],xe);const $p={fromASN:e=>el.toString(Ji.fromASN(e)),toASN:e=>Ji.toASN(el.fromString(e))};class Yr{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Yr.prototype,"typeId",void 0),u([f({type:w.Any,context:0})],Yr.prototype,"value",void 0);class Vo{constructor(t={}){this.partyName=new Ne,Object.assign(this,t)}}u([f({type:Ne,optional:!0,context:0,implicit:!0})],Vo.prototype,"nameAssigner",void 0),u([f({type:Ne,context:1,implicit:!0})],Vo.prototype,"partyName",void 0);let ee=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Yr,context:0,implicit:!0})],ee.prototype,"otherName",void 0),u([f({type:w.IA5String,context:1,implicit:!0})],ee.prototype,"rfc822Name",void 0),u([f({type:w.IA5String,context:2,implicit:!0})],ee.prototype,"dNSName",void 0),u([f({type:w.Any,context:3,implicit:!0})],ee.prototype,"x400Address",void 0),u([f({type:xe,context:4,implicit:!1})],ee.prototype,"directoryName",void 0),u([f({type:Vo,context:5})],ee.prototype,"ediPartyName",void 0),u([f({type:w.IA5String,context:6,implicit:!0})],ee.prototype,"uniformResourceIdentifier",void 0),u([f({type:w.OctetString,context:7,implicit:!0,converter:$p})],ee.prototype,"iPAddress",void 0),u([f({type:w.ObjectIdentifier,context:8,implicit:!0})],ee.prototype,"registeredID",void 0),ee=u([T({type:N.Choice})],ee);const mr="1.3.6.1.5.5.7.3",Yt="2.5.29";var jo;class Yi{constructor(t={}){this.accessMethod="",this.accessLocation=new ee,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Yi.prototype,"accessMethod",void 0),u([f({type:ee})],Yi.prototype,"accessLocation",void 0);let tl=jo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,jo.prototype)}};tl=jo=u([T({type:N.Sequence,itemType:Yi})],tl);const Do=`${Yt}.35`;class Po extends ne{}class Zt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Po,context:0,optional:!0,implicit:!0})],Zt.prototype,"keyIdentifier",void 0),u([f({type:ee,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Zt.prototype,"authorityCertIssuer",void 0),u([f({type:w.Integer,context:2,optional:!0,implicit:!0,converter:ge})],Zt.prototype,"authorityCertSerialNumber",void 0);const rl=`${Yt}.19`;class Zi{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:w.Boolean,defaultValue:!1})],Zi.prototype,"cA",void 0),u([f({type:w.Integer,optional:!0})],Zi.prototype,"pathLenConstraint",void 0);var $o;let Re=$o=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};Re=$o=u([T({type:N.Sequence,itemType:ee})],Re);var Mo;let il=Mo=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};il=Mo=u([T({type:N.Sequence})],il);var Ro;const nl=`${Yt}.32`;let xt=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:w.IA5String})],xt.prototype,"ia5String",void 0),u([f({type:w.VisibleString})],xt.prototype,"visibleString",void 0),u([f({type:w.BmpString})],xt.prototype,"bmpString",void 0),u([f({type:w.Utf8String})],xt.prototype,"utf8String",void 0),xt=u([T({type:N.Choice})],xt);class Uo{constructor(t={}){this.organization=new xt,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:xt})],Uo.prototype,"organization",void 0),u([f({type:w.Integer,repeated:"sequence"})],Uo.prototype,"noticeNumbers",void 0);class Lo{constructor(t={}){Object.assign(this,t)}}u([f({type:Uo,optional:!0})],Lo.prototype,"noticeRef",void 0),u([f({type:xt,optional:!0})],Lo.prototype,"explicitText",void 0);let Qi=class{constructor(t={}){Object.assign(this,t)}};u([f({type:w.IA5String})],Qi.prototype,"cPSuri",void 0),u([f({type:Lo})],Qi.prototype,"userNotice",void 0),Qi=u([T({type:N.Choice})],Qi);class Ho{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Ho.prototype,"policyQualifierId",void 0),u([f({type:w.Any})],Ho.prototype,"qualifier",void 0);class Xi{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Xi.prototype,"policyIdentifier",void 0),u([f({type:Ho,repeated:"sequence",optional:!0})],Xi.prototype,"policyQualifiers",void 0);let en=Ro=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};en=Ro=u([T({type:N.Sequence,itemType:Xi})],en);let tn=class{constructor(t=0){this.value=t}};u([f({type:w.Integer})],tn.prototype,"value",void 0),tn=u([T({type:N.Choice})],tn);let ol=class extends tn{};ol=u([T({type:N.Choice})],ol);var Fo,ot;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(ot||(ot={}));class sl extends Wi{toJSON(){const t=[],r=this.toNumber();return r&ot.aACompromise&&t.push("aACompromise"),r&ot.affiliationChanged&&t.push("affiliationChanged"),r&ot.cACompromise&&t.push("cACompromise"),r&ot.certificateHold&&t.push("certificateHold"),r&ot.cessationOfOperation&&t.push("cessationOfOperation"),r&ot.keyCompromise&&t.push("keyCompromise"),r&ot.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&ot.superseded&&t.push("superseded"),r&ot.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let gr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,context:0,repeated:"sequence",implicit:!0})],gr.prototype,"fullName",void 0),u([f({type:yr,context:1,implicit:!0})],gr.prototype,"nameRelativeToCRLIssuer",void 0),gr=u([T({type:N.Choice})],gr);class Zr{constructor(t={}){Object.assign(this,t)}}u([f({type:gr,context:0,optional:!0})],Zr.prototype,"distributionPoint",void 0),u([f({type:sl,context:1,optional:!0,implicit:!0})],Zr.prototype,"reasons",void 0),u([f({type:ee,context:2,optional:!0,repeated:"sequence",implicit:!0})],Zr.prototype,"cRLIssuer",void 0);let qo=Fo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};qo=Fo=u([T({type:N.Sequence,itemType:Zr})],qo);var Ko;let al=Ko=class extends qo{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};al=Ko=u([T({type:N.Sequence,itemType:Zr})],al);class je{constructor(t={}){this.onlyContainsUserCerts=je.ONLY,this.onlyContainsCACerts=je.ONLY,this.indirectCRL=je.ONLY,this.onlyContainsAttributeCerts=je.ONLY,Object.assign(this,t)}}je.ONLY=!1,u([f({type:gr,context:0,optional:!0})],je.prototype,"distributionPoint",void 0),u([f({type:w.Boolean,context:1,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsUserCerts",void 0),u([f({type:w.Boolean,context:2,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsCACerts",void 0),u([f({type:sl,context:3,optional:!0,implicit:!0})],je.prototype,"onlySomeReasons",void 0),u([f({type:w.Boolean,context:4,defaultValue:je.ONLY,implicit:!0})],je.prototype,"indirectCRL",void 0),u([f({type:w.Boolean,context:5,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsAttributeCerts",void 0);var Qr;(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"})(Qr||(Qr={}));let zo=class{constructor(t=Qr.unspecified){this.reason=Qr.unspecified,this.reason=t}toJSON(){return Qr[this.reason]}toString(){return this.toJSON()}};u([f({type:w.Enumerated})],zo.prototype,"reason",void 0),zo=u([T({type:N.Choice})],zo);var Go;const cl=`${Yt}.37`;let rn=Go=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Go.prototype)}};rn=Go=u([T({type:N.Sequence,itemType:w.ObjectIdentifier})],rn);const Mp=`${mr}.1`,Rp=`${mr}.2`,Up=`${mr}.3`,Lp=`${mr}.4`,Hp=`${mr}.8`,Fp=`${mr}.9`;let Wo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:w.Integer,converter:ge})],Wo.prototype,"value",void 0),Wo=u([T({type:N.Choice})],Wo);let Jo=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:w.GeneralizedTime})],Jo.prototype,"value",void 0),Jo=u([T({type:N.Choice})],Jo);var Yo;let ll=Yo=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};ll=Yo=u([T({type:N.Sequence})],ll);const ul=`${Yt}.15`;var st;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(st||(st={}));class Zo extends Wi{toJSON(){const t=this.toNumber(),r=[];return t&st.cRLSign&&r.push("crlSign"),t&st.dataEncipherment&&r.push("dataEncipherment"),t&st.decipherOnly&&r.push("decipherOnly"),t&st.digitalSignature&&r.push("digitalSignature"),t&st.encipherOnly&&r.push("encipherOnly"),t&st.keyAgreement&&r.push("keyAgreement"),t&st.keyCertSign&&r.push("keyCertSign"),t&st.keyEncipherment&&r.push("keyEncipherment"),t&st.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var Qo;class nn{constructor(t={}){this.base=new ee,this.minimum=0,Object.assign(this,t)}}u([f({type:ee})],nn.prototype,"base",void 0),u([f({type:w.Integer,context:0,defaultValue:0,implicit:!0})],nn.prototype,"minimum",void 0),u([f({type:w.Integer,context:1,optional:!0,implicit:!0})],nn.prototype,"maximum",void 0);let on=Qo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};on=Qo=u([T({type:N.Sequence,itemType:nn})],on);class dl{constructor(t={}){Object.assign(this,t)}}u([f({type:on,context:0,optional:!0,implicit:!0})],dl.prototype,"permittedSubtrees",void 0),u([f({type:on,context:1,optional:!0,implicit:!0})],dl.prototype,"excludedSubtrees",void 0);class fl{constructor(t={}){Object.assign(this,t)}}u([f({type:w.Integer,context:0,implicit:!0,optional:!0,converter:ge})],fl.prototype,"requireExplicitPolicy",void 0),u([f({type:w.Integer,context:1,implicit:!0,optional:!0,converter:ge})],fl.prototype,"inhibitPolicyMapping",void 0);var Xo;class es{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],es.prototype,"issuerDomainPolicy",void 0),u([f({type:w.ObjectIdentifier})],es.prototype,"subjectDomainPolicy",void 0);let pl=Xo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};pl=Xo=u([T({type:N.Sequence,itemType:es})],pl);var ts;const hl=`${Yt}.17`;let rs=ts=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};rs=ts=u([T({type:N.Sequence})],rs);let At=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],At.prototype,"type",void 0),u([f({type:w.Any,repeated:"set"})],At.prototype,"values",void 0);var is;let yl=is=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};yl=is=u([T({type:N.Sequence,itemType:At})],yl);const ml=`${Yt}.14`;class jt extends Po{}class gl{constructor(t={}){Object.assign(this,t)}}u([f({type:w.GeneralizedTime,context:0,implicit:!0,optional:!0})],gl.prototype,"notBefore",void 0),u([f({type:w.GeneralizedTime,context:1,implicit:!0,optional:!0})],gl.prototype,"notAfter",void 0);var Xr;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(Xr||(Xr={}));class bl extends Wi{toJSON(){const t=[],r=this.toNumber();return r&Xr.pKIXCertificate&&t.push("pKIXCertificate"),r&Xr.newExtensions&&t.push("newExtensions"),r&Xr.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class wl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new bl,Object.assign(this,t)}}u([f({type:w.GeneralString})],wl.prototype,"entrustVers",void 0),u([f({type:bl})],wl.prototype,"entrustInfoFlags",void 0);var ns;let vl=ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};vl=ns=u([T({type:N.Sequence,itemType:Yi})],vl);class L{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof L&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&Ga(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:w.ObjectIdentifier})],L.prototype,"algorithm",void 0),u([f({type:w.Any,optional:!0})],L.prototype,"parameters",void 0);class Bt{constructor(t={}){this.algorithm=new L,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:L})],Bt.prototype,"algorithm",void 0),u([f({type:w.BitString})],Bt.prototype,"subjectPublicKey",void 0);let De=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:w.UTCTime})],De.prototype,"utcTime",void 0),u([f({type:w.GeneralizedTime})],De.prototype,"generalTime",void 0),De=u([T({type:N.Choice})],De);class sn{constructor(t){this.notBefore=new De(new Date),this.notAfter=new De(new Date),t&&(this.notBefore=new De(t.notBefore),this.notAfter=new De(t.notAfter))}}u([f({type:De})],sn.prototype,"notBefore",void 0),u([f({type:De})],sn.prototype,"notAfter",void 0);var os;let at=class Ff{constructor(t={}){this.extnID="",this.critical=Ff.CRITICAL,this.extnValue=new ne,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:w.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:w.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:ne})],at.prototype,"extnValue",void 0);let Qt=os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};Qt=os=u([T({type:N.Sequence,itemType:at})],Qt);var br;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(br||(br={}));class et{constructor(t={}){this.version=br.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new L,this.issuer=new xe,this.validity=new sn,this.subject=new xe,this.subjectPublicKeyInfo=new Bt,Object.assign(this,t)}}u([f({type:w.Integer,context:0,defaultValue:br.v1})],et.prototype,"version",void 0),u([f({type:w.Integer,converter:ge})],et.prototype,"serialNumber",void 0),u([f({type:L})],et.prototype,"signature",void 0),u([f({type:xe})],et.prototype,"issuer",void 0),u([f({type:sn})],et.prototype,"validity",void 0),u([f({type:xe})],et.prototype,"subject",void 0),u([f({type:Bt})],et.prototype,"subjectPublicKeyInfo",void 0),u([f({type:w.BitString,context:1,implicit:!0,optional:!0})],et.prototype,"issuerUniqueID",void 0),u([f({type:w.BitString,context:2,implicit:!0,optional:!0})],et.prototype,"subjectUniqueID",void 0),u([f({type:Qt,context:3,optional:!0})],et.prototype,"extensions",void 0);class wr{constructor(t={}){this.tbsCertificate=new et,this.signatureAlgorithm=new L,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:et})],wr.prototype,"tbsCertificate",void 0),u([f({type:L})],wr.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],wr.prototype,"signatureValue",void 0);class an{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new De,Object.assign(this,t)}}u([f({type:w.Integer,converter:ge})],an.prototype,"userCertificate",void 0),u([f({type:De})],an.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],an.prototype,"crlEntryExtensions",void 0);class It{constructor(t={}){this.signature=new L,this.issuer=new xe,this.thisUpdate=new De,Object.assign(this,t)}}u([f({type:w.Integer,optional:!0})],It.prototype,"version",void 0),u([f({type:L})],It.prototype,"signature",void 0),u([f({type:xe})],It.prototype,"issuer",void 0),u([f({type:De})],It.prototype,"thisUpdate",void 0),u([f({type:De,optional:!0})],It.prototype,"nextUpdate",void 0),u([f({type:an,repeated:"sequence",optional:!0})],It.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],It.prototype,"crlExtensions",void 0);let ss=class{constructor(t={}){this.tbsCertList=new It,this.signatureAlgorithm=new L,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:It})],ss.prototype,"tbsCertList",void 0),u([f({type:L})],ss.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],ss.prototype,"signature",void 0);let vr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],vr.prototype,"attrType",void 0),u([f({type:w.Any,repeated:"set"})],vr.prototype,"attrValues",void 0);class as{constructor(t={}){this.acIssuer=new ee,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ee})],as.prototype,"acIssuer",void 0),u([f({type:w.Integer})],as.prototype,"acSerial",void 0),u([f({type:At,repeated:"sequence"})],as.prototype,"attrs",void 0);var cs;let cn=cs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};cn=cs=u([T({type:N.Sequence,itemType:w.ObjectIdentifier})],cn);class ln{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:w.Integer,optional:!0})],ln.prototype,"pathLenConstraint",void 0),u([f({type:cn,implicit:!0,context:0,optional:!0})],ln.prototype,"permittedAttrs",void 0),u([f({type:cn,implicit:!0,context:1,optional:!0})],ln.prototype,"excludedAttrs",void 0),u([f({type:w.Boolean,defaultValue:!0})],ln.prototype,"permitUnSpecified",void 0);class Xt{constructor(t={}){this.issuer=new Re,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Re})],Xt.prototype,"issuer",void 0),u([f({type:w.Integer,converter:ge})],Xt.prototype,"serial",void 0),u([f({type:w.BitString,optional:!0})],Xt.prototype,"issuerUID",void 0);var ls;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(ls||(ls={}));class er{constructor(t={}){this.digestedObjectType=ls.publicKey,this.digestAlgorithm=new L,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Enumerated})],er.prototype,"digestedObjectType",void 0),u([f({type:w.ObjectIdentifier,optional:!0})],er.prototype,"otherObjectTypeID",void 0),u([f({type:L})],er.prototype,"digestAlgorithm",void 0),u([f({type:w.BitString})],er.prototype,"objectDigest",void 0);class un{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,optional:!0})],un.prototype,"issuerName",void 0),u([f({type:Xt,context:0,implicit:!0,optional:!0})],un.prototype,"baseCertificateID",void 0),u([f({type:er,context:1,implicit:!0,optional:!0})],un.prototype,"objectDigestInfo",void 0);let kr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,repeated:"sequence"})],kr.prototype,"v1Form",void 0),u([f({type:un,context:0,implicit:!0})],kr.prototype,"v2Form",void 0),kr=u([T({type:N.Choice})],kr);class dn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:w.GeneralizedTime})],dn.prototype,"notBeforeTime",void 0),u([f({type:w.GeneralizedTime})],dn.prototype,"notAfterTime",void 0);class ei{constructor(t={}){Object.assign(this,t)}}u([f({type:Xt,implicit:!0,context:0,optional:!0})],ei.prototype,"baseCertificateID",void 0),u([f({type:Re,implicit:!0,context:1,optional:!0})],ei.prototype,"entityName",void 0),u([f({type:er,implicit:!0,context:2,optional:!0})],ei.prototype,"objectDigestInfo",void 0);var us;(function(e){e[e.v2=1]="v2"})(us||(us={}));class ct{constructor(t={}){this.version=us.v2,this.holder=new ei,this.issuer=new kr,this.signature=new L,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new dn,this.attributes=[],Object.assign(this,t)}}u([f({type:w.Integer})],ct.prototype,"version",void 0),u([f({type:ei})],ct.prototype,"holder",void 0),u([f({type:kr})],ct.prototype,"issuer",void 0),u([f({type:L})],ct.prototype,"signature",void 0),u([f({type:w.Integer,converter:ge})],ct.prototype,"serialNumber",void 0),u([f({type:dn})],ct.prototype,"attrCertValidityPeriod",void 0),u([f({type:At,repeated:"sequence"})],ct.prototype,"attributes",void 0),u([f({type:w.BitString,optional:!0})],ct.prototype,"issuerUniqueID",void 0),u([f({type:Qt,optional:!0})],ct.prototype,"extensions",void 0);class fn{constructor(t={}){this.acinfo=new ct,this.signatureAlgorithm=new L,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ct})],fn.prototype,"acinfo",void 0),u([f({type:L})],fn.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],fn.prototype,"signatureValue",void 0);var pn;(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"})(pn||(pn={}));class ds extends Wi{}class fs{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier,implicit:!0,context:0})],fs.prototype,"type",void 0),u([f({type:w.Any,implicit:!0,context:1})],fs.prototype,"value",void 0);class ps{constructor(t={}){this.policyId="",this.classList=new ds(pn.unclassified),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ps.prototype,"policyId",void 0),u([f({type:ds,defaultValue:new ds(pn.unclassified)})],ps.prototype,"classList",void 0),u([f({type:fs,repeated:"set"})],ps.prototype,"securityCategories",void 0);class hn{constructor(t={}){Object.assign(this,t)}}u([f({type:ne})],hn.prototype,"cotets",void 0),u([f({type:w.ObjectIdentifier})],hn.prototype,"oid",void 0),u([f({type:w.Utf8String})],hn.prototype,"string",void 0);class kl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],kl.prototype,"policyAuthority",void 0),u([f({type:hn,repeated:"sequence"})],kl.prototype,"values",void 0);var hs;class yn{constructor(t={}){this.targetCertificate=new Xt,Object.assign(this,t)}}u([f({type:Xt})],yn.prototype,"targetCertificate",void 0),u([f({type:ee,optional:!0})],yn.prototype,"targetName",void 0),u([f({type:er,optional:!0})],yn.prototype,"certDigestInfo",void 0);let Cr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,context:0,implicit:!0})],Cr.prototype,"targetName",void 0),u([f({type:ee,context:1,implicit:!0})],Cr.prototype,"targetGroup",void 0),u([f({type:yn,context:2,implicit:!0})],Cr.prototype,"targetCert",void 0),Cr=u([T({type:N.Choice})],Cr);let ys=hs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};ys=hs=u([T({type:N.Sequence,itemType:Cr})],ys);var ms;let Cl=ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};Cl=ms=u([T({type:N.Sequence,itemType:ys})],Cl);class Sl{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],Sl.prototype,"roleAuthority",void 0),u([f({type:ee,implicit:!0,context:1})],Sl.prototype,"roleName",void 0);class gs{constructor(t={}){this.service=new ee,this.ident=new ee,Object.assign(this,t)}}u([f({type:ee})],gs.prototype,"service",void 0),u([f({type:ee})],gs.prototype,"ident",void 0),u([f({type:ne,optional:!0})],gs.prototype,"authInfo",void 0);var bs;class ws{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ws.prototype,"otherCertFormat",void 0),u([f({type:w.Any})],ws.prototype,"otherCert",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:wr})],Sr.prototype,"certificate",void 0),u([f({type:fn,context:2,implicit:!0})],Sr.prototype,"v2AttrCert",void 0),u([f({type:ws,context:3,implicit:!0})],Sr.prototype,"other",void 0),Sr=u([T({type:N.Choice})],Sr);let mn=bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};mn=bs=u([T({type:N.Set,itemType:Sr})],mn);class xr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],xr.prototype,"contentType",void 0),u([f({type:w.Any,context:0})],xr.prototype,"content",void 0);let ti=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ne})],ti.prototype,"single",void 0),u([f({type:w.Any})],ti.prototype,"any",void 0),ti=u([T({type:N.Choice})],ti);class gn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],gn.prototype,"eContentType",void 0),u([f({type:ti,context:0,optional:!0})],gn.prototype,"eContent",void 0);var Et;(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"})(Et||(Et={}));let ri=class extends L{};ri=u([T({type:N.Sequence})],ri);let bn=class extends L{};bn=u([T({type:N.Sequence})],bn);let pt=class extends L{};pt=u([T({type:N.Sequence})],pt);let wn=class extends L{};wn=u([T({type:N.Sequence})],wn);let xl=class extends L{};xl=u([T({type:N.Sequence})],xl);let vs=class extends L{};vs=u([T({type:N.Sequence})],vs);let ii=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ne,context:0,implicit:!0,optional:!0})],ii.prototype,"value",void 0),u([f({type:ne,converter:wp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ii.prototype,"constructedValue",void 0),ii=u([T({type:N.Choice})],ii);class ni{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new wn,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ni.prototype,"contentType",void 0),u([f({type:wn})],ni.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ii,optional:!0})],ni.prototype,"encryptedContent",void 0);class Ar{constructor(t={}){this.issuer=new xe,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:xe})],Ar.prototype,"issuer",void 0),u([f({type:w.Integer,converter:ge})],Ar.prototype,"serialNumber",void 0);class vn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],vn.prototype,"keyAttrId",void 0),u([f({type:w.Any,optional:!0})],vn.prototype,"keyAttr",void 0);var ks;class kn{constructor(t={}){this.subjectKeyIdentifier=new jt,Object.assign(this,t)}}u([f({type:jt})],kn.prototype,"subjectKeyIdentifier",void 0),u([f({type:w.GeneralizedTime,optional:!0})],kn.prototype,"date",void 0),u([f({type:vn,optional:!0})],kn.prototype,"other",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:kn,context:0,implicit:!0,optional:!0})],Br.prototype,"rKeyId",void 0),u([f({type:Ar,optional:!0})],Br.prototype,"issuerAndSerialNumber",void 0),Br=u([T({type:N.Choice})],Br);class Cs{constructor(t={}){this.rid=new Br,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:Br})],Cs.prototype,"rid",void 0),u([f({type:ne})],Cs.prototype,"encryptedKey",void 0);let Cn=ks=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};Cn=ks=u([T({type:N.Sequence,itemType:Cs})],Cn);class Ss{constructor(t={}){this.algorithm=new L,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:L})],Ss.prototype,"algorithm",void 0),u([f({type:w.BitString})],Ss.prototype,"publicKey",void 0);let tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0,optional:!0})],tr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ss,context:1,implicit:!0,optional:!0})],tr.prototype,"originatorKey",void 0),u([f({type:Ar,optional:!0})],tr.prototype,"issuerAndSerialNumber",void 0),tr=u([T({type:N.Choice})],tr);class Ir{constructor(t={}){this.version=Et.v3,this.originator=new tr,this.keyEncryptionAlgorithm=new pt,this.recipientEncryptedKeys=new Cn,Object.assign(this,t)}}u([f({type:w.Integer})],Ir.prototype,"version",void 0),u([f({type:tr,context:0})],Ir.prototype,"originator",void 0),u([f({type:ne,context:1,optional:!0})],Ir.prototype,"ukm",void 0),u([f({type:pt})],Ir.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:Cn})],Ir.prototype,"recipientEncryptedKeys",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0})],Er.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ar})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([T({type:N.Choice})],Er);class oi{constructor(t={}){this.version=Et.v0,this.rid=new Er,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],oi.prototype,"version",void 0),u([f({type:Er})],oi.prototype,"rid",void 0),u([f({type:pt})],oi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],oi.prototype,"encryptedKey",void 0);class si{constructor(t={}){this.keyIdentifier=new ne,Object.assign(this,t)}}u([f({type:ne})],si.prototype,"keyIdentifier",void 0),u([f({type:w.GeneralizedTime,optional:!0})],si.prototype,"date",void 0),u([f({type:vn,optional:!0})],si.prototype,"other",void 0);class ai{constructor(t={}){this.version=Et.v4,this.kekid=new si,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],ai.prototype,"version",void 0),u([f({type:si})],ai.prototype,"kekid",void 0),u([f({type:pt})],ai.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],ai.prototype,"encryptedKey",void 0);class ci{constructor(t={}){this.version=Et.v0,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],ci.prototype,"version",void 0),u([f({type:vs,context:0,optional:!0})],ci.prototype,"keyDerivationAlgorithm",void 0),u([f({type:pt})],ci.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],ci.prototype,"encryptedKey",void 0);class xs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],xs.prototype,"oriType",void 0),u([f({type:w.Any})],xs.prototype,"oriValue",void 0);let Dt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oi,optional:!0})],Dt.prototype,"ktri",void 0),u([f({type:Ir,context:1,implicit:!0,optional:!0})],Dt.prototype,"kari",void 0),u([f({type:ai,context:2,implicit:!0,optional:!0})],Dt.prototype,"kekri",void 0),u([f({type:ci,context:3,implicit:!0,optional:!0})],Dt.prototype,"pwri",void 0),u([f({type:xs,context:4,implicit:!0,optional:!0})],Dt.prototype,"ori",void 0),Dt=u([T({type:N.Choice})],Dt);var As;let Sn=As=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};Sn=As=u([T({type:N.Set,itemType:Dt})],Sn);var Bs;class xn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],xn.prototype,"otherRevInfoFormat",void 0),u([f({type:w.Any})],xn.prototype,"otherRevInfo",void 0);let li=class{constructor(t={}){this.other=new xn,Object.assign(this,t)}};u([f({type:xn,context:1,implicit:!0})],li.prototype,"other",void 0),li=u([T({type:N.Choice})],li);let Is=Bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Bs.prototype)}};Is=Bs=u([T({type:N.Set,itemType:li})],Is);class Es{constructor(t={}){Object.assign(this,t)}}u([f({type:mn,context:0,implicit:!0,optional:!0})],Es.prototype,"certs",void 0),u([f({type:Is,context:1,implicit:!0,optional:!0})],Es.prototype,"crls",void 0);var Ns;let Os=Ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};Os=Ns=u([T({type:N.Set,itemType:vr})],Os);class ui{constructor(t={}){this.version=Et.v0,this.recipientInfos=new Sn,this.encryptedContentInfo=new ni,Object.assign(this,t)}}u([f({type:w.Integer})],ui.prototype,"version",void 0),u([f({type:Es,context:0,implicit:!0,optional:!0})],ui.prototype,"originatorInfo",void 0),u([f({type:Sn})],ui.prototype,"recipientInfos",void 0),u([f({type:ni})],ui.prototype,"encryptedContentInfo",void 0),u([f({type:Os,context:1,implicit:!0,optional:!0})],ui.prototype,"unprotectedAttrs",void 0);const qp="1.2.840.113549.1.7.2";let Nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0})],Nr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ar})],Nr.prototype,"issuerAndSerialNumber",void 0),Nr=u([T({type:N.Choice})],Nr);var _s;class Nt{constructor(t={}){this.version=Et.v0,this.sid=new Nr,this.digestAlgorithm=new ri,this.signatureAlgorithm=new bn,this.signature=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],Nt.prototype,"version",void 0),u([f({type:Nr})],Nt.prototype,"sid",void 0),u([f({type:ri})],Nt.prototype,"digestAlgorithm",void 0),u([f({type:vr,repeated:"set",context:0,implicit:!0,optional:!0})],Nt.prototype,"signedAttrs",void 0),u([f({type:bn})],Nt.prototype,"signatureAlgorithm",void 0),u([f({type:ne})],Nt.prototype,"signature",void 0),u([f({type:vr,repeated:"set",context:1,implicit:!0,optional:!0})],Nt.prototype,"unsignedAttrs",void 0);let An=_s=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};An=_s=u([T({type:N.Set,itemType:Nt})],An);var Ts;let Bn=Ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Bn=Ts=u([T({type:N.Set,itemType:ri})],Bn);class Or{constructor(t={}){this.version=Et.v0,this.digestAlgorithms=new Bn,this.encapContentInfo=new gn,this.signerInfos=new An,Object.assign(this,t)}}u([f({type:w.Integer})],Or.prototype,"version",void 0),u([f({type:Bn})],Or.prototype,"digestAlgorithms",void 0),u([f({type:gn})],Or.prototype,"encapContentInfo",void 0),u([f({type:mn,context:0,implicit:!0,optional:!0})],Or.prototype,"certificates",void 0),u([f({type:li,context:1,implicit:!0,optional:!0})],Or.prototype,"crls",void 0),u([f({type:An})],Or.prototype,"signerInfos",void 0);const di="1.2.840.10045.2.1",Vs="1.2.840.10045.4.1",Al="1.2.840.10045.4.3.1",js="1.2.840.10045.4.3.2",Ds="1.2.840.10045.4.3.3",Ps="1.2.840.10045.4.3.4",Bl="1.2.840.10045.3.1.7",Il="1.3.132.0.34",El="1.3.132.0.35";function fi(e){return new L({algorithm:e})}const Kp=fi(Vs);fi(Al);const zp=fi(js),Gp=fi(Ds),Wp=fi(Ps);let _r=class{constructor(t={}){Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],_r.prototype,"namedCurve",void 0),_r=u([T({type:N.Choice})],_r);class In{constructor(t={}){this.version=1,this.privateKey=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],In.prototype,"version",void 0),u([f({type:ne})],In.prototype,"privateKey",void 0),u([f({type:_r,context:0,optional:!0})],In.prototype,"parameters",void 0),u([f({type:w.BitString,context:1,optional:!0})],In.prototype,"publicKey",void 0);class En{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:ge})],En.prototype,"r",void 0),u([f({type:w.Integer,converter:ge})],En.prototype,"s",void 0);const Fe="1.2.840.113549.1.1",Tr=`${Fe}.1`,Jp=`${Fe}.7`,Yp=`${Fe}.9`,Zp=`${Fe}.10`,Qp=`${Fe}.2`,Xp=`${Fe}.4`,Nn=`${Fe}.5`,eh=`${Fe}.14`,$s=`${Fe}.11`,On=`${Fe}.12`,_n=`${Fe}.13`,Nl=`${Fe}.15`,Ol=`${Fe}.16`,_l="1.3.14.3.2.26",Tl="2.16.840.1.101.3.4.2.4",Vl="2.16.840.1.101.3.4.2.1",jl="2.16.840.1.101.3.4.2.2",Dl="2.16.840.1.101.3.4.2.3",th="2.16.840.1.101.3.4.2.5",rh="2.16.840.1.101.3.4.2.6",ih="1.2.840.113549.2.2",nh="1.2.840.113549.2.5",Ms=`${Fe}.8`;function Ae(e){return new L({algorithm:e,parameters:null})}Ae(ih),Ae(nh);const rr=Ae(_l);Ae(Tl),Ae(Vl),Ae(jl),Ae(Dl),Ae(th),Ae(rh);const Pl=new L({algorithm:Ms,parameters:H.serialize(rr)}),$l=new L({algorithm:Yp,parameters:H.serialize(Ji.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ae(Tr),Ae(Qp),Ae(Xp),Ae(Nn),Ae(Nl),Ae(Ol),Ae(On),Ae(_n),Ae(Nl),Ae(Ol);class Tn{constructor(t={}){this.hashAlgorithm=new L(rr),this.maskGenAlgorithm=new L({algorithm:Ms,parameters:H.serialize(rr)}),this.pSourceAlgorithm=new L($l),Object.assign(this,t)}}u([f({type:L,context:0,defaultValue:rr})],Tn.prototype,"hashAlgorithm",void 0),u([f({type:L,context:1,defaultValue:Pl})],Tn.prototype,"maskGenAlgorithm",void 0),u([f({type:L,context:2,defaultValue:$l})],Tn.prototype,"pSourceAlgorithm",void 0),new L({algorithm:Jp,parameters:H.serialize(new Tn)});class pi{constructor(t={}){this.hashAlgorithm=new L(rr),this.maskGenAlgorithm=new L({algorithm:Ms,parameters:H.serialize(rr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:L,context:0,defaultValue:rr})],pi.prototype,"hashAlgorithm",void 0),u([f({type:L,context:1,defaultValue:Pl})],pi.prototype,"maskGenAlgorithm",void 0),u([f({type:w.Integer,context:2,defaultValue:20})],pi.prototype,"saltLength",void 0),u([f({type:w.Integer,context:3,defaultValue:1})],pi.prototype,"trailerField",void 0),new L({algorithm:Zp,parameters:H.serialize(new pi)});class Vn{constructor(t={}){this.digestAlgorithm=new L,this.digest=new ne,Object.assign(this,t)}}u([f({type:L})],Vn.prototype,"digestAlgorithm",void 0),u([f({type:ne})],Vn.prototype,"digest",void 0);var Rs;class jn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:ge})],jn.prototype,"prime",void 0),u([f({type:w.Integer,converter:ge})],jn.prototype,"exponent",void 0),u([f({type:w.Integer,converter:ge})],jn.prototype,"coefficient",void 0);let Us=Rs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};Us=Rs=u([T({type:N.Sequence,itemType:jn})],Us);class ht{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:w.Integer})],ht.prototype,"version",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"modulus",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"publicExponent",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"privateExponent",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"prime1",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"prime2",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"exponent1",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"exponent2",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"coefficient",void 0),u([f({type:Us,optional:!0})],ht.prototype,"otherPrimeInfos",void 0);class Ls{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:ge})],Ls.prototype,"modulus",void 0),u([f({type:w.Integer,converter:ge})],Ls.prototype,"publicExponent",void 0);var Hs;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Hs||(Hs={}));const qe=Hs;/*! *****************************************************************************
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 Fs=function(e,t){return Fs=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])},Fs(e,t)};function Ks(e,t){Fs(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function oh(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(y){try{d(i.next(y))}catch(p){a(p)}}function l(y){try{d(i.throw(y))}catch(p){a(p)}}function d(y){y.done?s(y.value):o(y.value).then(c,l)}d((i=i.apply(e,t||[])).next())})}function sh(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(y){return l([d,y])}}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(y){d=[6,y],o=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Dn(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 Pn(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 ir(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pn(arguments[t]));return e}var ah="injectionTokens";function ch(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(ah,e)||{};return Object.keys(r).forEach(function(i){t[+i]=r[i]}),t}function Ml(e){return!!e.useClass}function qs(e){return!!e.useFactory}var Rl=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,ir(s))}};return this.reflectMethods.forEach(i),r},e}();function Vr(e){return typeof e=="string"||typeof e=="symbol"}function lh(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function Ul(e){return typeof e=="object"&&"token"in e&&"transform"in e}function uh(e){return typeof e=="function"||e instanceof Rl}function $n(e){return!!e.useToken}function Mn(e){return e.useValue!=null}function dh(e){return Ml(e)||Mn(e)||$n(e)||qs(e)}var zs=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}(),fh=function(e){Ks(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zs),Ll=function(){function e(){this.scopedResolutions=new Map}return e}();function ph(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function hh(e,t,r){return r===void 0&&(r=" "),ir([e],t.message.split(`
88
+ ***************************************************************************** */var Fs=function(e,t){return Fs=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])},Fs(e,t)};function qs(e,t){Fs(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function oh(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(y){try{d(i.next(y))}catch(p){a(p)}}function l(y){try{d(i.throw(y))}catch(p){a(p)}}function d(y){y.done?s(y.value):o(y.value).then(c,l)}d((i=i.apply(e,t||[])).next())})}function sh(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(y){return l([d,y])}}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(y){d=[6,y],o=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Dn(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 Pn(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 ir(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Pn(arguments[t]));return e}var ah="injectionTokens";function ch(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(ah,e)||{};return Object.keys(r).forEach(function(i){t[+i]=r[i]}),t}function Ml(e){return!!e.useClass}function Ks(e){return!!e.useFactory}var Rl=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,ir(s))}};return this.reflectMethods.forEach(i),r},e}();function Vr(e){return typeof e=="string"||typeof e=="symbol"}function lh(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function Ul(e){return typeof e=="object"&&"token"in e&&"transform"in e}function uh(e){return typeof e=="function"||e instanceof Rl}function $n(e){return!!e.useToken}function Mn(e){return e.useValue!=null}function dh(e){return Ml(e)||Mn(e)||$n(e)||Ks(e)}var zs=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}(),fh=function(e){qs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zs),Ll=function(){function e(){this.scopedResolutions=new Map}return e}();function ph(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function hh(e,t,r){return r===void 0&&(r=" "),ir([e],t.message.split(`
89
89
  `).map(function(i){return r+i})).join(`
90
- `)}function yh(e,t,r){var i=Pn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=ph(s,t);return hh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function mh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var gh=function(e){Ks(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zs),bh=function(e){Ks(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zs),wh=function(){function e(){this.preResolution=new gh,this.postResolution=new bh}return e}(),Hl=new Map,vh=function(){function e(t){this.parent=t,this._registry=new fh,this.interceptors=new wh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:Ke.Transient}),this.ensureNotDisposed();var o;if(dh(r)?o=r:o={useClass:r},$n(o))for(var s=[t],a=o;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+ir(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&$n(l.provider)?a=l.provider:a=null}if((i.lifecycle===Ke.Singleton||i.lifecycle==Ke.ContainerScoped||i.lifecycle==Ke.ResolutionScoped)&&(Mn(o)||qs(o)))throw new Error('Cannot use lifecycle "'+Ke[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(),Vr(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(),Vr(t)){if(Vr(r))return this.register(t,{useToken:r},{lifecycle:Ke.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:Ke.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!Vr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:Ke.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Ll),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&Vr(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(uh(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=Dn(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=Dn(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(y){o={error:y}}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===Ke.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===Ke.Singleton,o=t.options.lifecycle===Ke.ContainerScoped,s=i||o,a;return Mn(t.provider)?a=t.provider.useValue:$n(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):Ml(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):qs(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===Ke.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Ll),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&Vr(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=Dn(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=Pn(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Mn(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=Dn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=Pn(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===Ke.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===Ke.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 oh(this,void 0,void 0,function(){var t;return sh(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=Hl.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,ir([void 0],a)))}();return mh(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 lh(o)?Ul(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,ir([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,ir([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Ul(o)?(l=i.resolve(o.transform,t)).transform.apply(l,ir([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(yh(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}(),tt=new vh;function Gs(){return function(e){Hl.set(e,ch(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 Ws;class Rn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:b.ObjectIdentifier})],Rn.prototype,"attrId",void 0),u([f({type:b.Any,repeated:"set"})],Rn.prototype,"attrValues",void 0);let Fl=Ws=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};Fl=Ws=u([T({type:N.Sequence,itemType:Rn})],Fl);var Js;let Kl=Js=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Js.prototype)}};Kl=Js=u([T({type:N.Sequence,itemType:xr})],Kl);class ql{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],ql.prototype,"certId",void 0),u([f({type:b.Any,context:0})],ql.prototype,"certValue",void 0);class zl{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],zl.prototype,"crlId",void 0),u([f({type:b.Any,context:0})],zl.prototype,"crltValue",void 0);class Gl extends ne{}let Un=class{constructor(t={}){this.encryptionAlgorithm=new L,this.encryptedData=new Gl,Object.assign(this,t)}};u([f({type:L})],Un.prototype,"encryptionAlgorithm",void 0),u([f({type:Gl})],Un.prototype,"encryptedData",void 0);var Ys,Zs;(function(e){e[e.v1=0]="v1"})(Zs||(Zs={}));class Wl extends ne{}let Qs=Ys=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ys.prototype)}};Qs=Ys=u([T({type:N.Sequence,itemType:At})],Qs);class hi{constructor(t={}){this.version=Zs.v1,this.privateKeyAlgorithm=new L,this.privateKey=new Wl,Object.assign(this,t)}}u([f({type:b.Integer})],hi.prototype,"version",void 0),u([f({type:L})],hi.prototype,"privateKeyAlgorithm",void 0),u([f({type:Wl})],hi.prototype,"privateKey",void 0),u([f({type:Qs,implicit:!0,context:0,optional:!0})],hi.prototype,"attributes",void 0);let Jl=class extends hi{};Jl=u([T({type:N.Sequence})],Jl);let Yl=class extends Un{};Yl=u([T({type:N.Sequence})],Yl);class Zl{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Zl.prototype,"secretTypeId",void 0),u([f({type:b.Any,context:0})],Zl.prototype,"secretValue",void 0);class yi{constructor(t={}){this.mac=new Vn,this.macSalt=new ne,this.iterations=1,Object.assign(this,t)}}u([f({type:Vn})],yi.prototype,"mac",void 0),u([f({type:ne})],yi.prototype,"macSalt",void 0),u([f({type:b.Integer,defaultValue:1})],yi.prototype,"iterations",void 0);class Ln{constructor(t={}){this.version=3,this.authSafe=new xr,this.macData=new yi,Object.assign(this,t)}}u([f({type:b.Integer})],Ln.prototype,"version",void 0),u([f({type:xr})],Ln.prototype,"authSafe",void 0),u([f({type:yi,optional:!0})],Ln.prototype,"macData",void 0);var Xs;class Hn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:b.ObjectIdentifier})],Hn.prototype,"bagId",void 0),u([f({type:b.Any,context:0})],Hn.prototype,"bagValue",void 0),u([f({type:Rn,repeated:"set",optional:!0})],Hn.prototype,"bagAttributes",void 0);let Ql=Xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};Ql=Xs=u([T({type:N.Sequence,itemType:Hn})],Ql);var ea,ta,ra;const Xl="1.2.840.113549.1.9",eu=`${Xl}.7`,ia=`${Xl}.14`;let Fn=class extends Ne{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:b.IA5String})],Fn.prototype,"ia5String",void 0),Fn=u([T({type:N.Choice})],Fn);let tu=class extends xr{};tu=u([T({type:N.Sequence})],tu);let ru=class extends Ln{};ru=u([T({type:N.Sequence})],ru);let iu=class extends Un{};iu=u([T({type:N.Sequence})],iu);let na=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.IA5String})],na.prototype,"value",void 0),na=u([T({type:N.Choice})],na);let nu=class extends Fn{};nu=u([T({type:N.Choice})],nu);let ou=class extends Ne{};ou=u([T({type:N.Choice})],ou);let oa=class{constructor(t=new Date){this.value=t}};u([f({type:b.GeneralizedTime})],oa.prototype,"value",void 0),oa=u([T({type:N.Choice})],oa);let su=class extends Ne{};su=u([T({type:N.Choice})],su);let sa=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:b.PrintableString})],sa.prototype,"value",void 0),sa=u([T({type:N.Choice})],sa);let Kn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.PrintableString})],Kn.prototype,"value",void 0),Kn=u([T({type:N.Choice})],Kn);let au=class extends Kn{};au=u([T({type:N.Choice})],au);let cu=class extends Ne{};cu=u([T({type:N.Choice})],cu);let aa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.ObjectIdentifier})],aa.prototype,"value",void 0),aa=u([T({type:N.Choice})],aa);let lu=class extends De{};lu=u([T({type:N.Choice})],lu);let ca=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:b.Integer})],ca.prototype,"value",void 0),ca=u([T({type:N.Choice})],ca);let uu=class extends Nt{};uu=u([T({type:N.Sequence})],uu);let qn=class extends Ne{};qn=u([T({type:N.Choice})],qn);let du=ea=class extends Qt{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};du=ea=u([T({type:N.Sequence})],du);let fu=ta=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};fu=ta=u([T({type:N.Set,itemType:vr})],fu);let la=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:b.BmpString})],la.prototype,"value",void 0),la=u([T({type:N.Choice})],la);let ua=class extends L{};ua=u([T({type:N.Sequence})],ua);let pu=ra=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ra.prototype)}};pu=ra=u([T({type:N.Sequence,itemType:ua})],pu);var da;let zn=da=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,da.prototype)}};zn=da=u([T({type:N.Sequence,itemType:At})],zn);class jr{constructor(t={}){this.version=0,this.subject=new xe,this.subjectPKInfo=new Bt,this.attributes=new zn,Object.assign(this,t)}}u([f({type:b.Integer})],jr.prototype,"version",void 0),u([f({type:xe})],jr.prototype,"subject",void 0),u([f({type:Bt})],jr.prototype,"subjectPKInfo",void 0),u([f({type:zn,implicit:!0,context:0})],jr.prototype,"attributes",void 0);class mi{constructor(t={}){this.certificationRequestInfo=new jr,this.signatureAlgorithm=new L,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:jr})],mi.prototype,"certificationRequestInfo",void 0),u([f({type:L})],mi.prototype,"signatureAlgorithm",void 0),u([f({type:b.BitString})],mi.prototype,"signature",void 0);/*!
90
+ `)}function yh(e,t,r){var i=Pn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=ph(s,t);return hh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function mh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var gh=function(e){qs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zs),bh=function(e){qs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zs),wh=function(){function e(){this.preResolution=new gh,this.postResolution=new bh}return e}(),Hl=new Map,vh=function(){function e(t){this.parent=t,this._registry=new fh,this.interceptors=new wh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:qe.Transient}),this.ensureNotDisposed();var o;if(dh(r)?o=r:o={useClass:r},$n(o))for(var s=[t],a=o;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+ir(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&$n(l.provider)?a=l.provider:a=null}if((i.lifecycle===qe.Singleton||i.lifecycle==qe.ContainerScoped||i.lifecycle==qe.ResolutionScoped)&&(Mn(o)||Ks(o)))throw new Error('Cannot use lifecycle "'+qe[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(),Vr(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(),Vr(t)){if(Vr(r))return this.register(t,{useToken:r},{lifecycle:qe.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:qe.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!Vr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:qe.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Ll),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&Vr(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(uh(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=Dn(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=Dn(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(y){o={error:y}}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===qe.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===qe.Singleton,o=t.options.lifecycle===qe.ContainerScoped,s=i||o,a;return Mn(t.provider)?a=t.provider.useValue:$n(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):Ml(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Ks(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Ll),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&Vr(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=Dn(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=Pn(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Mn(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=Dn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=Pn(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===qe.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===qe.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 oh(this,void 0,void 0,function(){var t;return sh(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=Hl.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,ir([void 0],a)))}();return mh(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 lh(o)?Ul(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,ir([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,ir([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Ul(o)?(l=i.resolve(o.transform,t)).transform.apply(l,ir([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(yh(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}(),tt=new vh;function Gs(){return function(e){Hl.set(e,ch(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 Ws;class Rn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:w.ObjectIdentifier})],Rn.prototype,"attrId",void 0),u([f({type:w.Any,repeated:"set"})],Rn.prototype,"attrValues",void 0);let Fl=Ws=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};Fl=Ws=u([T({type:N.Sequence,itemType:Rn})],Fl);var Js;let ql=Js=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Js.prototype)}};ql=Js=u([T({type:N.Sequence,itemType:xr})],ql);class Kl{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Kl.prototype,"certId",void 0),u([f({type:w.Any,context:0})],Kl.prototype,"certValue",void 0);class zl{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],zl.prototype,"crlId",void 0),u([f({type:w.Any,context:0})],zl.prototype,"crltValue",void 0);class Gl extends ne{}let Un=class{constructor(t={}){this.encryptionAlgorithm=new L,this.encryptedData=new Gl,Object.assign(this,t)}};u([f({type:L})],Un.prototype,"encryptionAlgorithm",void 0),u([f({type:Gl})],Un.prototype,"encryptedData",void 0);var Ys,Zs;(function(e){e[e.v1=0]="v1"})(Zs||(Zs={}));class Wl extends ne{}let Qs=Ys=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ys.prototype)}};Qs=Ys=u([T({type:N.Sequence,itemType:At})],Qs);class hi{constructor(t={}){this.version=Zs.v1,this.privateKeyAlgorithm=new L,this.privateKey=new Wl,Object.assign(this,t)}}u([f({type:w.Integer})],hi.prototype,"version",void 0),u([f({type:L})],hi.prototype,"privateKeyAlgorithm",void 0),u([f({type:Wl})],hi.prototype,"privateKey",void 0),u([f({type:Qs,implicit:!0,context:0,optional:!0})],hi.prototype,"attributes",void 0);let Jl=class extends hi{};Jl=u([T({type:N.Sequence})],Jl);let Yl=class extends Un{};Yl=u([T({type:N.Sequence})],Yl);class Zl{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Zl.prototype,"secretTypeId",void 0),u([f({type:w.Any,context:0})],Zl.prototype,"secretValue",void 0);class yi{constructor(t={}){this.mac=new Vn,this.macSalt=new ne,this.iterations=1,Object.assign(this,t)}}u([f({type:Vn})],yi.prototype,"mac",void 0),u([f({type:ne})],yi.prototype,"macSalt",void 0),u([f({type:w.Integer,defaultValue:1})],yi.prototype,"iterations",void 0);class Ln{constructor(t={}){this.version=3,this.authSafe=new xr,this.macData=new yi,Object.assign(this,t)}}u([f({type:w.Integer})],Ln.prototype,"version",void 0),u([f({type:xr})],Ln.prototype,"authSafe",void 0),u([f({type:yi,optional:!0})],Ln.prototype,"macData",void 0);var Xs;class Hn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Hn.prototype,"bagId",void 0),u([f({type:w.Any,context:0})],Hn.prototype,"bagValue",void 0),u([f({type:Rn,repeated:"set",optional:!0})],Hn.prototype,"bagAttributes",void 0);let Ql=Xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};Ql=Xs=u([T({type:N.Sequence,itemType:Hn})],Ql);var ea,ta,ra;const Xl="1.2.840.113549.1.9",eu=`${Xl}.7`,ia=`${Xl}.14`;let Fn=class extends Ne{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:w.IA5String})],Fn.prototype,"ia5String",void 0),Fn=u([T({type:N.Choice})],Fn);let tu=class extends xr{};tu=u([T({type:N.Sequence})],tu);let ru=class extends Ln{};ru=u([T({type:N.Sequence})],ru);let iu=class extends Un{};iu=u([T({type:N.Sequence})],iu);let na=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.IA5String})],na.prototype,"value",void 0),na=u([T({type:N.Choice})],na);let nu=class extends Fn{};nu=u([T({type:N.Choice})],nu);let ou=class extends Ne{};ou=u([T({type:N.Choice})],ou);let oa=class{constructor(t=new Date){this.value=t}};u([f({type:w.GeneralizedTime})],oa.prototype,"value",void 0),oa=u([T({type:N.Choice})],oa);let su=class extends Ne{};su=u([T({type:N.Choice})],su);let sa=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:w.PrintableString})],sa.prototype,"value",void 0),sa=u([T({type:N.Choice})],sa);let qn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.PrintableString})],qn.prototype,"value",void 0),qn=u([T({type:N.Choice})],qn);let au=class extends qn{};au=u([T({type:N.Choice})],au);let cu=class extends Ne{};cu=u([T({type:N.Choice})],cu);let aa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.ObjectIdentifier})],aa.prototype,"value",void 0),aa=u([T({type:N.Choice})],aa);let lu=class extends De{};lu=u([T({type:N.Choice})],lu);let ca=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:w.Integer})],ca.prototype,"value",void 0),ca=u([T({type:N.Choice})],ca);let uu=class extends Nt{};uu=u([T({type:N.Sequence})],uu);let Kn=class extends Ne{};Kn=u([T({type:N.Choice})],Kn);let du=ea=class extends Qt{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};du=ea=u([T({type:N.Sequence})],du);let fu=ta=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};fu=ta=u([T({type:N.Set,itemType:vr})],fu);let la=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.BmpString})],la.prototype,"value",void 0),la=u([T({type:N.Choice})],la);let ua=class extends L{};ua=u([T({type:N.Sequence})],ua);let pu=ra=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ra.prototype)}};pu=ra=u([T({type:N.Sequence,itemType:ua})],pu);var da;let zn=da=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,da.prototype)}};zn=da=u([T({type:N.Sequence,itemType:At})],zn);class jr{constructor(t={}){this.version=0,this.subject=new xe,this.subjectPKInfo=new Bt,this.attributes=new zn,Object.assign(this,t)}}u([f({type:w.Integer})],jr.prototype,"version",void 0),u([f({type:xe})],jr.prototype,"subject",void 0),u([f({type:Bt})],jr.prototype,"subjectPKInfo",void 0),u([f({type:zn,implicit:!0,context:0})],jr.prototype,"attributes",void 0);class mi{constructor(t={}){this.certificationRequestInfo=new jr,this.signatureAlgorithm=new L,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:jr})],mi.prototype,"certificationRequestInfo",void 0),u([f({type:L})],mi.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],mi.prototype,"signature",void 0);/*!
91
91
  * MIT License
92
92
  *
93
93
  * Copyright (c) Peculiar Ventures. All rights reserved.
@@ -110,30 +110,30 @@ ${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 Gn="crypto.algorithm";class kh{getAlgorithms(){return tt.resolveAll(Gn)}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 L({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 Wn="crypto.algorithmProvider";tt.registerSingleton(Wn,kh);var Jn;const qe="1.3.36.3.3.2.8.1.1",hu=`${qe}.1`,yu=`${qe}.2`,mu=`${qe}.3`,gu=`${qe}.4`,bu=`${qe}.5`,wu=`${qe}.6`,vu=`${qe}.7`,ku=`${qe}.8`,Cu=`${qe}.9`,Su=`${qe}.10`,xu=`${qe}.11`,Au=`${qe}.12`,Bu=`${qe}.13`,Iu=`${qe}.14`,Eu="brainpoolP160r1",Nu="brainpoolP160t1",Ou="brainpoolP192r1",_u="brainpoolP192t1",Tu="brainpoolP224r1",Vu="brainpoolP224t1",ju="brainpoolP256r1",Du="brainpoolP256t1",Pu="brainpoolP320r1",$u="brainpoolP320t1",Mu="brainpoolP384r1",Ru="brainpoolP384t1",Uu="brainpoolP512r1",Lu="brainpoolP512t1",be="ECDSA";let gi=Jn=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case be.toLowerCase():if("hash"in t)switch((typeof t.hash=="string"?t.hash:t.hash.name).toLowerCase()){case"sha-1":return qp;case"sha-256":return zp;case"sha-384":return Gp;case"sha-512":return Wp}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Bl;break;case"K-256":r=Jn.SECP256K1;break;case"P-384":r=Il;break;case"P-521":r=El;break;case Eu:r=hu;break;case Nu:r=yu;break;case Ou:r=mu;break;case _u:r=gu;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;case Lu:r=Iu;break}if(r)return new L({algorithm:di,parameters:H.serialize(new _r({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Vs:return{name:be,hash:{name:"SHA-1"}};case js:return{name:be,hash:{name:"SHA-256"}};case Ds:return{name:be,hash:{name:"SHA-384"}};case Ps:return{name:be,hash:{name:"SHA-512"}};case di:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(H.parse(t.parameters,_r).namedCurve){case Bl:return{name:be,namedCurve:"P-256"};case Jn.SECP256K1:return{name:be,namedCurve:"K-256"};case Il:return{name:be,namedCurve:"P-384"};case El:return{name:be,namedCurve:"P-521"};case hu:return{name:be,namedCurve:Eu};case yu:return{name:be,namedCurve:Nu};case mu:return{name:be,namedCurve:Ou};case gu:return{name:be,namedCurve:_u};case bu:return{name:be,namedCurve:Tu};case wu:return{name:be,namedCurve:Vu};case vu:return{name:be,namedCurve:ju};case ku:return{name:be,namedCurve:Du};case Cu:return{name:be,namedCurve:Pu};case Su:return{name:be,namedCurve:$u};case xu:return{name:be,namedCurve:Mu};case Au:return{name:be,namedCurve:Ru};case Bu:return{name:be,namedCurve:Uu};case Iu:return{name:be,namedCurve:Lu}}}}return null}};gi.SECP256K1="1.3.132.0.10",gi=Jn=u([Gs()],gi),tt.registerSingleton(Gn,gi);const Hu=Symbol("name"),Fu=Symbol("value");class ue{constructor(t,r={},i=""){this[Hu]=t,this[Fu]=i;for(const o in r)this[o]=r[o]}}ue.NAME=Hu,ue.VALUE=Fu;class Ch{static toTextObject(t){const r=new ue("Algorithm Identifier",{},Pt.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case di:{const i=new gi().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class Pt{static toString(t){const r=this.items[t];return r||t}}Pt.items={[_l]:"sha1",[Tl]:"sha224",[Vl]:"sha256",[jl]:"sha384",[Dl]:"sha512",[Tr]:"rsaEncryption",[Nn]:"sha1WithRSAEncryption",[eh]:"sha224WithRSAEncryption",[$s]:"sha256WithRSAEncryption",[On]:"sha384WithRSAEncryption",[_n]:"sha512WithRSAEncryption",[di]:"ecPublicKey",[Vs]:"ecdsaWithSHA1",[Al]:"ecdsaWithSHA224",[js]:"ecdsaWithSHA256",[Ds]:"ecdsaWithSHA384",[Ps]:"ecdsaWithSHA512",[Mp]:"TLS WWW server authentication",[Rp]:"TLS WWW client authentication",[Up]:"Code Signing",[Lp]:"E-mail Protection",[Hp]:"Time Stamping",[Fp]:"OCSP Signing",[Kp]:"Signed Data"};class nr{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[ue.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ue.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 y of l)y[ue.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,i.push(...this.serializeObj(l,r));else if(j.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 y=l.toTextObject();y[ue.NAME]=c,i.push(...this.serializeObj(y,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=j.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)}}nr.oidSerializer=Pt,nr.algorithmSerializer=Ch;class $t{constructor(...t){if(t.length===1){const r=t[0];this.rawData=H.serialize(r),this.onInit(r)}else{const r=H.parse(t[0],t[1]);this.rawData=j.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof $t?Ga(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return H.toString(this.rawData);case"text":return nr.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 ue(this.getTextName(),{},t)}}$t.NAME="ASN";class yt extends $t{constructor(...t){let r;j.isBufferSource(t[0])?r=j.toArrayBuffer(t[0]):r=H.serialize(new at({extnID:t[0],critical:t[1],extnValue:new ne(j.toArrayBuffer(t[2]))})),super(r,at)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[ue.NAME]===yt.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}var Ku;class or{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[Ku]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(or.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=or.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(or.DEFAULT,t);return this}}Ku=Symbol.toStringTag,or.DEFAULT="default";const Ye=new or,Sh=/^[0-2](?:\.[1-9][0-9]*)+$/;function xh(e){return new RegExp(Sh).test(e)}class qu{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return xh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const ze=new qu;ze.register("CN","2.5.4.3"),ze.register("L","2.5.4.7"),ze.register("ST","2.5.4.8"),ze.register("O","2.5.4.10"),ze.register("OU","2.5.4.11"),ze.register("C","2.5.4.6"),ze.register("DC","0.9.2342.19200300.100.1.25"),ze.register("E","1.2.840.113549.1.9.1"),ze.register("G","2.5.4.42"),ze.register("I","2.5.4.43"),ze.register("SN","2.5.4.4"),ze.register("T","2.5.4.12");function Ah(e,t){return`\\${R.ToHex(R.FromUtf8String(t)).toUpperCase()}`}function Bh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Ah)}class Mt{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 qu,this.asn=new xe;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 xe?this.asn=t:j.isBufferSource(t)?this.asn=H.parse(t,xe):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||ze.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)||ze.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)}`:Bh(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 xe,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 y=new Jr({type:a});if(c.charAt(0)==="#")y.value.anyValue=R.FromHex(c.slice(1));else{const p=/"(.*?[^\\])?"/.exec(c);p&&(c=p[1]),c=c.replace(/\\0a/ig,`
113
+ */const Gn="crypto.algorithm";class kh{getAlgorithms(){return tt.resolveAll(Gn)}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 L({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 Wn="crypto.algorithmProvider";tt.registerSingleton(Wn,kh);var Jn;const Ke="1.3.36.3.3.2.8.1.1",hu=`${Ke}.1`,yu=`${Ke}.2`,mu=`${Ke}.3`,gu=`${Ke}.4`,bu=`${Ke}.5`,wu=`${Ke}.6`,vu=`${Ke}.7`,ku=`${Ke}.8`,Cu=`${Ke}.9`,Su=`${Ke}.10`,xu=`${Ke}.11`,Au=`${Ke}.12`,Bu=`${Ke}.13`,Iu=`${Ke}.14`,Eu="brainpoolP160r1",Nu="brainpoolP160t1",Ou="brainpoolP192r1",_u="brainpoolP192t1",Tu="brainpoolP224r1",Vu="brainpoolP224t1",ju="brainpoolP256r1",Du="brainpoolP256t1",Pu="brainpoolP320r1",$u="brainpoolP320t1",Mu="brainpoolP384r1",Ru="brainpoolP384t1",Uu="brainpoolP512r1",Lu="brainpoolP512t1",be="ECDSA";let gi=Jn=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case be.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 zp;case"sha-384":return Gp;case"sha-512":return Wp}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Bl;break;case"K-256":r=Jn.SECP256K1;break;case"P-384":r=Il;break;case"P-521":r=El;break;case Eu:r=hu;break;case Nu:r=yu;break;case Ou:r=mu;break;case _u:r=gu;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;case Lu:r=Iu;break}if(r)return new L({algorithm:di,parameters:H.serialize(new _r({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Vs:return{name:be,hash:{name:"SHA-1"}};case js:return{name:be,hash:{name:"SHA-256"}};case Ds:return{name:be,hash:{name:"SHA-384"}};case Ps:return{name:be,hash:{name:"SHA-512"}};case di:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(H.parse(t.parameters,_r).namedCurve){case Bl:return{name:be,namedCurve:"P-256"};case Jn.SECP256K1:return{name:be,namedCurve:"K-256"};case Il:return{name:be,namedCurve:"P-384"};case El:return{name:be,namedCurve:"P-521"};case hu:return{name:be,namedCurve:Eu};case yu:return{name:be,namedCurve:Nu};case mu:return{name:be,namedCurve:Ou};case gu:return{name:be,namedCurve:_u};case bu:return{name:be,namedCurve:Tu};case wu:return{name:be,namedCurve:Vu};case vu:return{name:be,namedCurve:ju};case ku:return{name:be,namedCurve:Du};case Cu:return{name:be,namedCurve:Pu};case Su:return{name:be,namedCurve:$u};case xu:return{name:be,namedCurve:Mu};case Au:return{name:be,namedCurve:Ru};case Bu:return{name:be,namedCurve:Uu};case Iu:return{name:be,namedCurve:Lu}}}}return null}};gi.SECP256K1="1.3.132.0.10",gi=Jn=u([Gs()],gi),tt.registerSingleton(Gn,gi);const Hu=Symbol("name"),Fu=Symbol("value");class ue{constructor(t,r={},i=""){this[Hu]=t,this[Fu]=i;for(const o in r)this[o]=r[o]}}ue.NAME=Hu,ue.VALUE=Fu;class Ch{static toTextObject(t){const r=new ue("Algorithm Identifier",{},Pt.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case di:{const i=new gi().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class Pt{static toString(t){const r=this.items[t];return r||t}}Pt.items={[_l]:"sha1",[Tl]:"sha224",[Vl]:"sha256",[jl]:"sha384",[Dl]:"sha512",[Tr]:"rsaEncryption",[Nn]:"sha1WithRSAEncryption",[eh]:"sha224WithRSAEncryption",[$s]:"sha256WithRSAEncryption",[On]:"sha384WithRSAEncryption",[_n]:"sha512WithRSAEncryption",[di]:"ecPublicKey",[Vs]:"ecdsaWithSHA1",[Al]:"ecdsaWithSHA224",[js]:"ecdsaWithSHA256",[Ds]:"ecdsaWithSHA384",[Ps]:"ecdsaWithSHA512",[Mp]:"TLS WWW server authentication",[Rp]:"TLS WWW client authentication",[Up]:"Code Signing",[Lp]:"E-mail Protection",[Hp]:"Time Stamping",[Fp]:"OCSP Signing",[qp]:"Signed Data"};class nr{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[ue.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ue.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 y of l)y[ue.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,i.push(...this.serializeObj(l,r));else if(j.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 y=l.toTextObject();y[ue.NAME]=c,i.push(...this.serializeObj(y,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=j.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)}}nr.oidSerializer=Pt,nr.algorithmSerializer=Ch;class $t{constructor(...t){if(t.length===1){const r=t[0];this.rawData=H.serialize(r),this.onInit(r)}else{const r=H.parse(t[0],t[1]);this.rawData=j.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof $t?Ga(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return H.toString(this.rawData);case"text":return nr.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 ue(this.getTextName(),{},t)}}$t.NAME="ASN";class yt extends $t{constructor(...t){let r;j.isBufferSource(t[0])?r=j.toArrayBuffer(t[0]):r=H.serialize(new at({extnID:t[0],critical:t[1],extnValue:new ne(j.toArrayBuffer(t[2]))})),super(r,at)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[ue.NAME]===yt.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}var qu;class or{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[qu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(or.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=or.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(or.DEFAULT,t);return this}}qu=Symbol.toStringTag,or.DEFAULT="default";const Ye=new or,Sh=/^[0-2](?:\.[1-9][0-9]*)+$/;function xh(e){return new RegExp(Sh).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 xh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const ze=new Ku;ze.register("CN","2.5.4.3"),ze.register("L","2.5.4.7"),ze.register("ST","2.5.4.8"),ze.register("O","2.5.4.10"),ze.register("OU","2.5.4.11"),ze.register("C","2.5.4.6"),ze.register("DC","0.9.2342.19200300.100.1.25"),ze.register("E","1.2.840.113549.1.9.1"),ze.register("G","2.5.4.42"),ze.register("I","2.5.4.43"),ze.register("SN","2.5.4.4"),ze.register("T","2.5.4.12");function Ah(e,t){return`\\${R.ToHex(R.FromUtf8String(t)).toUpperCase()}`}function Bh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Ah)}class Mt{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 xe;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 xe?this.asn=t:j.isBufferSource(t)?this.asn=H.parse(t,xe):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||ze.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)||ze.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)}`:Bh(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 xe,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 y=new Jr({type:a});if(c.charAt(0)==="#")y.value.anyValue=R.FromHex(c.slice(1));else{const p=/"(.*?[^\\])?"/.exec(c);p&&(c=p[1]),c=c.replace(/\\0a/ig,`
115
115
  `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Mt.isASCII(c)?y.value.printableString=c:y.value.utf8String=c}s==="+"?r[r.length-1].push(y):r.push(new yr([y])),s=d}return r}fromJSON(t){const r=new xe;for(const i of t){const o=new yr;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 Jr({type:a});if(typeof l=="object")for(const y in l)switch(y){case"ia5String":d.value.ia5String=l[y];break;case"utf8String":d.value.utf8String=l[y];break;case"universalString":d.value.universalString=l[y];break;case"bmpString":d.value.bmpString=l[y];break;case"printableString":d.value.printableString=l[y];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 H.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]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const zu="Cannot initialize GeneralName from ASN.1 data.",Gu=`${zu} Unsupported string format in use.`,Ih=`${zu} Value doesn't match to GUID regular expression.`,Wu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Ju="1.3.6.1.4.1.311.25.1",Yu="1.3.6.1.4.1.311.20.2.3",fa="dns",pa="dn",ha="email",ya="ip",ma="url",ga="guid",ba="upn",Yn="id";class Zu extends $t{constructor(...t){let r;if(t.length===2)switch(t[0]){case pa:{const i=new Mt(t[1]).toArrayBuffer(),o=H.parse(i,xe);r=new ee({directoryName:o});break}case fa:r=new ee({dNSName:t[1]});break;case ha:r=new ee({rfc822Name:t[1]});break;case ga:{const i=new RegExp(Wu,"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 ee({otherName:new Yr({typeId:Ju,value:H.serialize(new ne(R.FromHex(o)))})});break}case ya:r=new ee({iPAddress:t[1]});break;case Yn:r=new ee({registeredID:t[1]});break;case ba:{r=new ee({otherName:new Yr({typeId:Yu,value:H.serialize(Jc.toASN(t[1]))})});break}case ma:r=new ee({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else j.isBufferSource(t[0])?r=H.parse(t[0],ee):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=fa,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=ha,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=ya,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=ma,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=Yn,this.value=t.registeredID;else if(t.directoryName!=null)this.type=pa,this.value=new Mt(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===Ju){this.type=ga;const r=H.parse(t.otherName.value,ne),i=new RegExp(Wu,"i").exec(R.ToHex(r));if(!i)throw new Error(Ih);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===Yu)this.type=ba,this.value=H.parse(t.otherName.value,Ne).toString();else throw new Error(Gu);else throw new Error(Gu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case pa:case fa:case ga:case ya:case Yn:case ba:case ma:t=this.type.toUpperCase();break;case ha:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===Yn&&(r=Pt.toString(r)),new ue(t,void 0,r)}}class bi extends $t{constructor(t){let r;if(t instanceof Re)r=t;else if(Array.isArray(t)){const i=[];for(const o of t)if(o instanceof ee)i.push(o);else{const s=H.parse(new Zu(o.type,o.value).rawData,ee);i.push(s)}r=new Re(i)}else if(j.isBufferSource(t))r=H.parse(t,Re);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 Zu(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[ue.NAME]];Array.isArray(o)||(o=[],t[i[ue.NAME]]=o),o.push(i)}return t}}bi.NAME="GeneralNames";const wi="-{5}",vi="\\n",Eh=`[^${vi}]+`,Nh=`${wi}BEGIN (${Eh}(?=${wi}))${wi}`,Oh=`${wi}END \\1${wi}`,Dr="\\n",_h=`[^:${vi}]+`,Th=`(?:[^${vi}]+${Dr}(?: +[^${vi}]+${Dr})*)`,Vh=`(?:[a-zA-Z0-9=+/]+${Dr})+`,Qu=`${Nh}${Dr}(?:((?:${_h}: ${Th})+))?${Dr}?(${Vh})${Oh}`;class Ze{static isPem(t){return typeof t=="string"&&new RegExp(Qu,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(Qu,"g"),i=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${vi}]+`,"g"),""),a={type:o[1],headers:[],rawData:R.FromBase64(s)},c=o[2];if(c){const l=c.split(new RegExp(Dr,"g"));let d=null;for(const y of l){const[p,A]=y.split(/:(.*)/);if(A===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=p.trim()}else d&&a.headers.push(d),d={key:p,value:A.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(!j.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:j.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
116
  `)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:j.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
- `)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class Ot extends $t{static isAsnEncoded(t){return j.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.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 Ze.isPem(r)?Ze.decode(r)[0]:R.isHex(r)?R.FromHex(r):R.isBase64(r)?R.FromBase64(r):R.isBase64Url(r)?R.FromBase64Url(r):j.toArrayBuffer(t)}}constructor(...t){Ot.isAsnEncoded(t[0])?super(Ot.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class sr extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,Bt):super(t),this.tag=Ze.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]||Ye.get()):r=t[0]||Ye.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=tt.resolve(Wn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const o=H.parse(t.subjectPublicKey,Ls),s=j.toUint8Array(o.modulus);i.publicExponent=j.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]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ye.get());const r=H.parse(this.rawData,Bt);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,Bt);switch(t.Algorithm=nr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case di:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class mt{static register(t,r){this.items.set(t,r)}static create(t){const r=new yt(t),i=this.items.get(r.type);return i?new i(t):r}}mt.items=new Map;const Zn="crypto.signatureFormatter";class jh{toAsnSignature(t,r){return j.toArrayBuffer(r)}toWebSignature(t,r){return j.toArrayBuffer(r)}}class Qn extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,wr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=H.serialize(r),this.serialNumber=R.ToHex(r.serialNumber),this.subjectName=new Mt(r.subject),this.subject=new Mt(r.subject).toString(),this.issuerName=new Mt(r.issuer),this.issuer=this.issuerName.toString();const i=tt.resolve(Wn);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=>mt.create(H.serialize(a)))),this.publicKey=new sr(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Ye.get()){let 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 sr)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(j.isBufferSource(s)){const d=new sr(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=tt.resolveAll(Zn).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 y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<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=Ye.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Ye.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,wr),i=r.tbsCertificate,o=new ue("",{Version:`${br[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":nr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"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 ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ue("",{Algorithm:nr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}Qn.NAME="Certificate";class ki extends yt{static async create(t,r=!1,i=Ye.get()){if(t instanceof Qn||or.isCryptoKey(t)){const o=t instanceof Qn?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new sr(s).getKeyIdentifier(i);return new ki(R.ToHex(c),r)}else return new ki(t,r)}constructor(...t){if(j.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Zt({keyIdentifier:new Po(R.FromHex(t[0]))});super(Do,t[1],H.serialize(r))}else{const r=t[0],i=r.name instanceof bi?H.parse(r.name.rawData,Re):r.name,o=new Zt({authorityCertIssuer:i,authorityCertSerialNumber:R.FromHex(r.serialNumber)});super(Do,t[1],H.serialize(o))}}onInit(t){super.onInit(t);const r=H.parse(t.extnValue,Zt);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=H.parse(this.value,Zt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new bi(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}ki.NAME="Authority Key Identifier";class Xu extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Zi);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new Zi({cA:t[0],pathLenConstraint:t[1]});super(rl,t[2],H.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 ed;(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"})(ed||(ed={}));class td extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,rn);this.usages=r.map(i=>i)}else{const r=new rn(t[0]);super(cl,t[1],H.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}td.NAME="Extended Key Usages";var wa;(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"})(wa||(wa={}));class va extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Zo);this.usages=r.toNumber()}else{const r=new Zo(t[0]);super(ul,t[1],H.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,Zo);return t[""]=r.toJSON().join(", "),t}}va.NAME="Key Usages";class Xn extends yt{static async create(t,r=!1,i=Ye.get()){let o;t instanceof sr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:j.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new sr(o).getKeyIdentifier(i);return new Xn(R.ToHex(a),r)}constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,jt);this.keyId=R.ToHex(r)}else{const r=typeof t[0]=="string"?R.FromHex(t[0]):t[0],i=new jt(r);super(ml,t[1],H.serialize(i)),this.keyId=R.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,jt);return t[""]=r,t}}Xn.NAME="Subject Key Identifier";class ka extends yt{constructor(...t){j.isBufferSource(t[0])?super(t[0]):super(hl,t[1],new bi(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=H.parse(t.extnValue,rs);this.names=new bi(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}ka.NAME="Subject Alternative Name";class rd extends yt{constructor(...t){var r;if(j.isBufferSource(t[0])){super(t[0]);const i=H.parse(this.value,en);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new en(i.map(a=>new Xi({policyIdentifier:a})));super(nl,o,H.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Pt.toString(r))),t}}rd.NAME="Certificate Policies",mt.register(nl,rd);class Pr extends $t{constructor(...t){let r;if(j.isBufferSource(t[0]))r=j.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>j.toArrayBuffer(s)):[];r=H.serialize(new At({type:i,values:o}))}super(r,At)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===Pr.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}Pr.NAME="Attribute";class id extends Pr{constructor(...t){var r;if(j.isBufferSource(t[0]))super(t[0]);else{const i=new qn({printableString:t[0]});super(eu,[H.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=H.parse(this.values[0],qn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}id.NAME="Challenge Password";class Ca extends Pr{constructor(...t){var r;if(j.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new Qt;for(const s of i)o.push(H.parse(s.rawData,at));super(ia,[H.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=H.parse(this.values[0],Qt);this.items=r.map(i=>mt.create(H.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ue.NAME]]=i;return t}}Ca.NAME="Extensions";class eo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Pr(t),i=this.items.get(r.type);return i?new i(t):r}}eo.items=new Map;let Sa=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 L({algorithm:Nn,parameters:null});case"sha-256":return new L({algorithm:$s,parameters:null});case"sha-384":return new L({algorithm:On,parameters:null});case"sha-512":return new L({algorithm:_n,parameters:null})}}else return new L({algorithm:Tr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Tr:return{name:"RSASSA-PKCS1-v1_5"};case Nn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case $s:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case On:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case _n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Sa=u([Gs()],Sa),tt.registerSingleton(Gn,Sa);class rt{addPadding(t,r){const i=j.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=j.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=rt.namedCurveSize.get(i)||rt.defaultNamedCurveSize,s=new En,a=j.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),H.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=H.parse(r,En),o=t.namedCurve,s=rt.namedCurveSize.get(o)||rt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return Yf(a,c)}return null}}rt.namedCurveSize=new Map,rt.defaultNamedCurveSize=32;const nd="1.3.101.110",od="1.3.101.111",sd="1.3.101.112",ad="1.3.101.113";let xa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=sd;break;case"ed448":r=ad;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=nd;break;case"x448":r=od;break}}return r?new L({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case sd:return{name:"EdDSA",namedCurve:"Ed25519"};case ad:return{name:"EdDSA",namedCurve:"Ed448"};case nd:return{name:"ECDH-ES",namedCurve:"X25519"};case od:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};xa=u([Gs()],xa),tt.registerSingleton(Gn,xa);class Dh extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,mi):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=H.serialize(t.certificationRequestInfo),this.publicKey=new sr(t.certificationRequestInfo.subjectPKInfo);const r=tt.resolve(Wn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>eo.create(H.serialize(o)));const i=this.getAttribute(ia);this.extensions=[],i instanceof Ca&&(this.extensions=i.items),this.subjectName=new Mt(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Ye.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=tt.resolveAll(Zn).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=H.parse(this.rawData,mi),i=r.certificationRequestInfo,o=new ue("",{Version:`${br[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ue("",{Algorithm:nr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Dh.NAME="PKCS#10 Certificate Request";var cd;(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"})(cd||(cd={})),mt.register(rl,Xu),mt.register(cl,td),mt.register(ul,va),mt.register(ml,Xn),mt.register(Do,ki),mt.register(hl,ka),eo.register(eu,id),eo.register(ia,Ca),tt.registerSingleton(Zn,jh),tt.registerSingleton(Zn,rt),rt.namedCurveSize.set("P-256",32),rt.namedCurveSize.set("K-256",32),rt.namedCurveSize.set("P-384",48),rt.namedCurveSize.set("P-521",66);function ld(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new Qn(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof ka){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof va){const s=Object.values(wa),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Ph(){const e=ld(),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 $h={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 Mh(){const e=ur.createI18n("en-us",$h);return{i18n:e,i18nT:ur.i18nTComponent(e)}}const gt={useCertificate:Ph,useI18n:Mh,useX509:ld},Ci={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"}}},Rh={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Uh="Copy to clipboard",Lh={message:Rh,iconTitle:Uh},Hh="kong-ui-copy-uuid-notify",ud="24px",Fh=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Kh=e=>(n.pushScopeId("data-v-641e0aee"),e=e(),n.popScopeId(),e),qh=["aria-hidden"],zh={key:0,"data-testid":"kui-icon-svg-title"},Gh=Kh(()=>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)),Wh=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:ud,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 ud}),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",zh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Gh],8,qh))]),_:1},8,["aria-hidden","style"]))}}),Jh=Fh(Wh,[["__scopeId","data-v-641e0aee"]]),Yh="16px",Zh={class:"kong-ui-copy-uuid"},Qh=["onClick"],dd=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{t:r}=ur.createI18n("en-us",Lh),i=e,o=t,s=i.notify||n.inject(Hh,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var v;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(v=i.uuid)==null?void 0:v.substring(0,5)}`:i.uuid}),p=v=>{l.value=v,setTimeout(()=>{l.value=i.tooltip},1800)},A=v=>{var h,m;if(!v(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>dd,g=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((m=i.uuid)==null?void 0:m.substring(0,dd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(v,h)=>{const m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Zh,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.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(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(g=>A(k),["stop"])},[n.createVNode(n.unref(Jh),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Yh),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Qh)]),_:1})]),_:1},16))])}}}),ey=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},ty=ey(Xh,[["__scopeId","data-v-0c07874b"]]);var Aa=(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))(Aa||{}),ar=(e=>(e.Edit="edit",e.Create="create",e))(ar||{}),Rt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Rt||{}),se=(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))(se||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function Ba(e={}){return{axiosInstance:Kf.create({withCredentials:!0,timeout:3e4,...e})}}function ry(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ia="khcp-user-table-preferences",iy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ny(){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(Ia));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(Ia,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||iy},deleteAllTablePreferences:()=>{localStorage.removeItem(Ia)}}}const oy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},sy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ay={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},cy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ly={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"}},uy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},dy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},fy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},py={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"}},hy={global:oy,deleteModal:sy,baseForm:ay,baseTable:cy,baseConfigCard:ly,filter:uy,debouncedFilter:dy,errors:fy,toggleModal:py};function Ea(){const e=ur.createI18n("en-us",hy);return{i18n:e,i18nT:ur.i18nTComponent(e)}}function fd(){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 yy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=Ba({headers:e.requestHeaders}),{i18n:{t:s}}=Ea(),{debounce:a}=ry(),c=a(async C=>{await w(C)},200),l=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),A=n.ref([]),v=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:k}=fd(),g=async()=>{try{l.value=!0;const{data:C}=await o.get(`${m}?size=${r}`);C!=null&&C.next||(v.value=i.fetchedItemsKey in C?C[i.fetchedItemsKey]:[]),A.value=i.fetchedItemsKey in C?C[i.fetchedItemsKey]:[],p.value=A.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},S=n.ref(""),w=async C=>{var O,F,Z;if(S.value!==C)if(S.value=C||"",v.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let I=m+"";C&&(I+=`/${C}`);const{data:E}=await o.get(`${I}?size=${r}`);i.fetchedItemsKey in E?p.value=E[i.fetchedItemsKey]:E!=null&&E.id?p.value=[E]:p.value=[]}else if(C){const I=[];k(C)&&i.searchKeys.includes("id")?I.push((async()=>{const{data:P}=await o.get(`${m}/${C}`);return[P[i.fetchedItemsKey]??P]})()):I.push(...i.searchKeys.filter(P=>P!=="id").map(async P=>{const{data:q}=await o.get(`${m}?${P}=${C}`);return q[i.fetchedItemsKey]}));const E=await Promise.all(I),K=new Set;p.value=[],(O=E==null?void 0:E.forEach)==null||O.call(E,P=>{var q;(q=P==null?void 0:P.forEach)==null||q.call(P,U=>{K.has(U.id)||(K.add(U.id),p.value.push(U))})})}else p.value=A.value}catch(I){((F=I==null?void 0:I.response)==null?void 0:F.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",C?(p.value=(Z=v.value)==null?void 0:Z.filter(I=>{var E;let K=!1;for(const P of i.searchKeys){const q=typeof I[P]=="string"?(E=I[P])==null?void 0:E.toLowerCase():I[P];q!=null&&q.includes(C.toLowerCase())&&(K=!0)}return K}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=v.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:v,loadItems:g,debouncedQueryChange:c}}function my(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}}=Ea();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 by(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-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.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 pd(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:y,sortColumnOrder:p,query:A}=a;try{let v=new URL(s.value.href);return o.value&&A?(v.search="",v=r.value.app==="konnect"?new URL(`${v.href}?filter[name][contains]=${A}`):new URL(`${v.href}/${A}/`)):(o.value||new URLSearchParams(A).forEach((h,m)=>{v.searchParams.append(m,h)}),y&&v.searchParams.append("sort_by",y),p==="desc"&&v.searchParams.append("sort_desc","1"),v.searchParams.append("size",String(l))),d&&c!==1&&v.searchParams.append("offset",String(d)),v.href}catch(v){return console.error("RouteList(fetcher)",v),i.value}}}function wy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=Ba({headers:e.requestHeaders}),s=pd(e,i),a=n.ref({status:Rt.Idle});return{fetcher:async c=>{try{a.value={status:Rt.Loading};const l=s(c),{data:d}=await o.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const A={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Rt.Idle,response:A},A}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Rt.NoResults,response:d,error:l},d):(a.value={status:Rt.Error,response:d,error:l},d)}},fetcherState:a}}function vy(){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 hd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,yd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(hd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},md=e=>e==="*"||e==="x"||e==="X",gd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},ky=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Cy=(e,t)=>{if(md(e)||md(t))return 0;const[r,i]=ky(gd(e),gd(t));return r>i?1:r<i?-1:0},bd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Cy(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Sy=(e,t)=>{const r=yd(e),i=yd(t),o=r.pop(),s=i.pop(),a=bd(r,i);return a!==0?a:o&&s?bd(o.split("."),s.split(".")):o||s?o?-1:1:0},wd=(e,t,r)=>{xy(r);const i=Sy(e,t);return vd[r].includes(i)},vd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},kd=Object.keys(vd),xy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(kd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${kd.join("|")}`)},Ay=e=>typeof e=="string"&&/^[v\d]/.test(e)&&hd.test(e);function By(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Ay(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&wd(o,a,"<")||c&&wd(o,c,">"))}function Iy(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 Ie={useAxios:Ba,useDebouncedFilter:yy,useDeleteUrlBuilder:my,useErrors:gy,useExternalLinkCreator:by,useFetcher:wy,useFetchUrlBuilder:pd,useHelpers:fd,useStringHelpers:vy,useI18n:Ea,useGatewayFeatureSupported:By,useTruncationDetector:Iy},Ey={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ny="Copy to clipboard",Oy={message:Ey,iconTitle:Ny},_y="kong-ui-copy-uuid-notify",Cd="24px",Ty=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Vy=e=>(n.pushScopeId("data-v-641e0aee"),e=e(),n.popScopeId(),e),jy=["aria-hidden"],Dy={key:0,"data-testid":"kui-icon-svg-title"},Py=Vy(()=>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)),$y=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:Cd,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 Cd}),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",Dy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Py],8,jy))]),_:1},8,["aria-hidden","style"]))}}),My=Ty($y,[["__scopeId","data-v-641e0aee"]]),Ry="16px",Uy={class:"kong-ui-copy-uuid"},Ly=["onClick"],Sd=15,Hy=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{t:r}=ur.createI18n("en-us",Oy),i=e,o=t,s=i.notify||n.inject(_y,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var v;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(v=i.uuid)==null?void 0:v.substring(0,5)}`:i.uuid}),p=v=>{l.value=v,setTimeout(()=>{l.value=i.tooltip},1800)},A=v=>{var h,m;if(!v(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>Sd,g=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((m=i.uuid)==null?void 0:m.substring(0,Sd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(v,h)=>{const m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Uy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.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(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(g=>A(k),["stop"])},[n.createVNode(n.unref(My),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Ry),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Ly)]),_:1})]),_:1},16))])}}}),Fy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},xd=Fy(Hy,[["__scopeId","data-v-0c07874b"]]),Ky={key:0,class:"config-card-fieldset-title"},qy=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}}=Ie.useI18n(),{convertKeyToTitle:i}=Ie.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",Ky,[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),(y,p)=>(n.openBlock(),n.createBlock(Si,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),lt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Ad=lt(qy,[["__scopeId","data-v-68ca83ec"]]),zy=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ie.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})])}}}),Gy=lt(zy,[["__scopeId","data-v-c96811e5"]]),Wy=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ie.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",Qy="1px",Xy="20px",em={class:"config-card-details-row"},tm=["data-testid"],rm=["data-testid"],im=["data-testid"],nm=["data-testid"],om={key:1},sm=["data-testid"],am=["data-testid"],cm=["data-testid"],lm=["data-testid"],um={name:"ConfigCardItem",components:{CopyUuid:xd,JsonCardItem:Ad,StatusBadge:Wy,InternalLinkItem:Gy}},dm=n.defineComponent({...um,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}){n.useCssVars(h=>({"0da74440":y.value?"none":`solid ${n.unref(Qy)} ${n.unref(Yy)}`,"02a039da":d.value&&c.value?"block":"flex","690f3ced":d.value&&c.value?"100%":r.slim?"50%":"25%","691182c8":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Ie.useI18n(),c=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=n.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=n.computed(()=>r.item.type===se.Json||r.item.type===se.JsonArray),y=n.computed(()=>r.item.type===se.JsonArray),p=n.computed(()=>{switch(r.item.type){case se.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case se.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case se.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case se.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case se.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case se.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case se.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case se.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case se.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case se.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case se.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case se.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}}}),A=n.ref(),{isTruncated:v}=Ie.useTruncationDetector(A);return(h,m)=>{const k=n.resolveComponent("KLabel"),g=n.resolveComponent("KBadge"),S=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",em,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(k,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(h.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,rm)]),key:"0"}:void 0]),1024)],!0)],8,tm),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(n.openBlock(),n.createElementBlock("div",om,[(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,(w,C)=>(n.openBlock(),n.createBlock(g,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:w,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,sm)):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,(w,C)=>(n.openBlock(),n.createBlock(n.unref(xd),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,uuid:w}),null,16,["data-testid","uuid"]))),128))],8,am)):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,(w,C)=>(n.openBlock(),n.createBlock(g,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(n.unref(qf.BadgeMethodAppearances)).includes(w.toLowerCase())?w.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,cm)):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,(w,C)=>(n.openBlock(),n.createBlock(Ad,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:w},null,8,["index","item"]))),128))],8,lm)):(n.openBlock(),n.createBlock(S,{key:4,label:n.unref(v)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:A,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,nm))],!0)],8,im)])}}}),Si=lt(dm,[["__scopeId","data-v-9c87856b"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Bd(e){return typeof e>"u"||e===null}function fm(e){return typeof e=="object"&&e!==null}function pm(e){return Array.isArray(e)?e:Bd(e)?[]:[e]}function hm(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 ym(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function mm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var gm=Bd,bm=fm,wm=pm,vm=ym,km=mm,Cm=hm,Be={isNothing:gm,isObject:bm,toArray:wm,repeat:vm,isNegativeZero:km,extend:Cm};function Id(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+=`
117
+ `)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class Ot extends $t{static isAsnEncoded(t){return j.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.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 Ze.isPem(r)?Ze.decode(r)[0]:R.isHex(r)?R.FromHex(r):R.isBase64(r)?R.FromBase64(r):R.isBase64Url(r)?R.FromBase64Url(r):j.toArrayBuffer(t)}}constructor(...t){Ot.isAsnEncoded(t[0])?super(Ot.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class sr extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,Bt):super(t),this.tag=Ze.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]||Ye.get()):r=t[0]||Ye.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=tt.resolve(Wn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const o=H.parse(t.subjectPublicKey,Ls),s=j.toUint8Array(o.modulus);i.publicExponent=j.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]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ye.get());const r=H.parse(this.rawData,Bt);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,Bt);switch(t.Algorithm=nr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case di:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class mt{static register(t,r){this.items.set(t,r)}static create(t){const r=new yt(t),i=this.items.get(r.type);return i?new i(t):r}}mt.items=new Map;const Zn="crypto.signatureFormatter";class jh{toAsnSignature(t,r){return j.toArrayBuffer(r)}toWebSignature(t,r){return j.toArrayBuffer(r)}}class Qn extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,wr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=H.serialize(r),this.serialNumber=R.ToHex(r.serialNumber),this.subjectName=new Mt(r.subject),this.subject=new Mt(r.subject).toString(),this.issuerName=new Mt(r.issuer),this.issuer=this.issuerName.toString();const i=tt.resolve(Wn);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=>mt.create(H.serialize(a)))),this.publicKey=new sr(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Ye.get()){let 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 sr)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(j.isBufferSource(s)){const d=new sr(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=tt.resolveAll(Zn).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 y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<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=Ye.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Ye.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,wr),i=r.tbsCertificate,o=new ue("",{Version:`${br[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":nr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"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 ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ue("",{Algorithm:nr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}Qn.NAME="Certificate";class ki extends yt{static async create(t,r=!1,i=Ye.get()){if(t instanceof Qn||or.isCryptoKey(t)){const o=t instanceof Qn?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new sr(s).getKeyIdentifier(i);return new ki(R.ToHex(c),r)}else return new ki(t,r)}constructor(...t){if(j.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Zt({keyIdentifier:new Po(R.FromHex(t[0]))});super(Do,t[1],H.serialize(r))}else{const r=t[0],i=r.name instanceof bi?H.parse(r.name.rawData,Re):r.name,o=new Zt({authorityCertIssuer:i,authorityCertSerialNumber:R.FromHex(r.serialNumber)});super(Do,t[1],H.serialize(o))}}onInit(t){super.onInit(t);const r=H.parse(t.extnValue,Zt);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=H.parse(this.value,Zt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new bi(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}ki.NAME="Authority Key Identifier";class Xu extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Zi);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new Zi({cA:t[0],pathLenConstraint:t[1]});super(rl,t[2],H.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 ed;(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"})(ed||(ed={}));class td extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,rn);this.usages=r.map(i=>i)}else{const r=new rn(t[0]);super(cl,t[1],H.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}td.NAME="Extended Key Usages";var wa;(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"})(wa||(wa={}));class va extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Zo);this.usages=r.toNumber()}else{const r=new Zo(t[0]);super(ul,t[1],H.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,Zo);return t[""]=r.toJSON().join(", "),t}}va.NAME="Key Usages";class Xn extends yt{static async create(t,r=!1,i=Ye.get()){let o;t instanceof sr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:j.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new sr(o).getKeyIdentifier(i);return new Xn(R.ToHex(a),r)}constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,jt);this.keyId=R.ToHex(r)}else{const r=typeof t[0]=="string"?R.FromHex(t[0]):t[0],i=new jt(r);super(ml,t[1],H.serialize(i)),this.keyId=R.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,jt);return t[""]=r,t}}Xn.NAME="Subject Key Identifier";class ka extends yt{constructor(...t){j.isBufferSource(t[0])?super(t[0]):super(hl,t[1],new bi(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=H.parse(t.extnValue,rs);this.names=new bi(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}ka.NAME="Subject Alternative Name";class rd extends yt{constructor(...t){var r;if(j.isBufferSource(t[0])){super(t[0]);const i=H.parse(this.value,en);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new en(i.map(a=>new Xi({policyIdentifier:a})));super(nl,o,H.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Pt.toString(r))),t}}rd.NAME="Certificate Policies",mt.register(nl,rd);class Pr extends $t{constructor(...t){let r;if(j.isBufferSource(t[0]))r=j.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>j.toArrayBuffer(s)):[];r=H.serialize(new At({type:i,values:o}))}super(r,At)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===Pr.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}Pr.NAME="Attribute";class id extends Pr{constructor(...t){var r;if(j.isBufferSource(t[0]))super(t[0]);else{const i=new Kn({printableString:t[0]});super(eu,[H.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=H.parse(this.values[0],Kn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}id.NAME="Challenge Password";class Ca extends Pr{constructor(...t){var r;if(j.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new Qt;for(const s of i)o.push(H.parse(s.rawData,at));super(ia,[H.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=H.parse(this.values[0],Qt);this.items=r.map(i=>mt.create(H.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ue.NAME]]=i;return t}}Ca.NAME="Extensions";class eo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Pr(t),i=this.items.get(r.type);return i?new i(t):r}}eo.items=new Map;let Sa=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 L({algorithm:Nn,parameters:null});case"sha-256":return new L({algorithm:$s,parameters:null});case"sha-384":return new L({algorithm:On,parameters:null});case"sha-512":return new L({algorithm:_n,parameters:null})}}else return new L({algorithm:Tr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Tr:return{name:"RSASSA-PKCS1-v1_5"};case Nn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case $s:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case On:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case _n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Sa=u([Gs()],Sa),tt.registerSingleton(Gn,Sa);class rt{addPadding(t,r){const i=j.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=j.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=rt.namedCurveSize.get(i)||rt.defaultNamedCurveSize,s=new En,a=j.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),H.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=H.parse(r,En),o=t.namedCurve,s=rt.namedCurveSize.get(o)||rt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return Yf(a,c)}return null}}rt.namedCurveSize=new Map,rt.defaultNamedCurveSize=32;const nd="1.3.101.110",od="1.3.101.111",sd="1.3.101.112",ad="1.3.101.113";let xa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=sd;break;case"ed448":r=ad;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=nd;break;case"x448":r=od;break}}return r?new L({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case sd:return{name:"EdDSA",namedCurve:"Ed25519"};case ad:return{name:"EdDSA",namedCurve:"Ed448"};case nd:return{name:"ECDH-ES",namedCurve:"X25519"};case od:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};xa=u([Gs()],xa),tt.registerSingleton(Gn,xa);class Dh extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,mi):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=H.serialize(t.certificationRequestInfo),this.publicKey=new sr(t.certificationRequestInfo.subjectPKInfo);const r=tt.resolve(Wn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>eo.create(H.serialize(o)));const i=this.getAttribute(ia);this.extensions=[],i instanceof Ca&&(this.extensions=i.items),this.subjectName=new Mt(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Ye.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=tt.resolveAll(Zn).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=H.parse(this.rawData,mi),i=r.certificationRequestInfo,o=new ue("",{Version:`${br[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ue("",{Algorithm:nr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Dh.NAME="PKCS#10 Certificate Request";var cd;(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"})(cd||(cd={})),mt.register(rl,Xu),mt.register(cl,td),mt.register(ul,va),mt.register(ml,Xn),mt.register(Do,ki),mt.register(hl,ka),eo.register(eu,id),eo.register(ia,Ca),tt.registerSingleton(Zn,jh),tt.registerSingleton(Zn,rt),rt.namedCurveSize.set("P-256",32),rt.namedCurveSize.set("K-256",32),rt.namedCurveSize.set("P-384",48),rt.namedCurveSize.set("P-521",66);function ld(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new Qn(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof ka){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof va){const s=Object.values(wa),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Ph(){const e=ld(),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 $h={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 Mh(){const e=ur.createI18n("en-us",$h);return{i18n:e,i18nT:ur.i18nTComponent(e)}}const gt={useCertificate:Ph,useI18n:Mh,useX509:ld},Ci={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"}}},Rh={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Uh="Copy to clipboard",Lh={message:Rh,iconTitle:Uh},Hh="kong-ui-copy-uuid-notify",ud="24px",Fh=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},qh=e=>(n.pushScopeId("data-v-641e0aee"),e=e(),n.popScopeId(),e),Kh=["aria-hidden"],zh={key:0,"data-testid":"kui-icon-svg-title"},Gh=qh(()=>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)),Wh=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:ud,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 ud}),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",zh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Gh],8,Kh))]),_:1},8,["aria-hidden","style"]))}}),Jh=Fh(Wh,[["__scopeId","data-v-641e0aee"]]),Yh="16px",Zh={class:"kong-ui-copy-uuid"},Qh=["onClick"],dd=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{t:r}=ur.createI18n("en-us",Lh),i=e,o=t,s=i.notify||n.inject(Hh,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var b;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(b=i.uuid)==null?void 0:b.substring(0,5)}`:i.uuid}),p=b=>{l.value=b,setTimeout(()=>{l.value=i.tooltip},1800)},A=b=>{var h,m;if(!b(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>dd,g=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((m=i.uuid)==null?void 0:m.substring(0,dd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(b,h)=>{const m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Zh,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.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(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(g=>A(k),["stop"])},[n.createVNode(n.unref(Jh),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Yh),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Qh)]),_:1})]),_:1},16))])}}}),ey=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},ty=ey(Xh,[["__scopeId","data-v-0c07874b"]]);var Aa=(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))(Aa||{}),ar=(e=>(e.Edit="edit",e.Create="create",e))(ar||{}),Rt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Rt||{}),se=(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))(se||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function Ba(e={}){return{axiosInstance:qf.create({withCredentials:!0,timeout:3e4,...e})}}function ry(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ia="khcp-user-table-preferences",iy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ny(){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(Ia));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(Ia,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||iy},deleteAllTablePreferences:()=>{localStorage.removeItem(Ia)}}}const oy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},sy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ay={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},cy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ly={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"},endpoints:{get:"Get"},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"}},uy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},dy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},fy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},py={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"}},hy={global:oy,deleteModal:sy,baseForm:ay,baseTable:cy,baseConfigCard:ly,filter:uy,debouncedFilter:dy,errors:fy,toggleModal:py};function Ea(){const e=ur.createI18n("en-us",hy);return{i18n:e,i18nT:ur.i18nTComponent(e)}}function fd(){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 yy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=Ba({headers:e.requestHeaders}),{i18n:{t:s}}=Ea(),{debounce:a}=ry(),c=a(async C=>{await v(C)},200),l=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),A=n.ref([]),b=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:k}=fd(),g=async()=>{try{l.value=!0;const{data:C}=await o.get(`${m}?size=${r}`);C!=null&&C.next||(b.value=i.fetchedItemsKey in C?C[i.fetchedItemsKey]:[]),A.value=i.fetchedItemsKey in C?C[i.fetchedItemsKey]:[],p.value=A.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},S=n.ref(""),v=async C=>{var O,F,Y;if(S.value!==C)if(S.value=C||"",b.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let I=m+"";C&&(I+=`/${C}`);const{data:E}=await o.get(`${I}?size=${r}`);i.fetchedItemsKey in E?p.value=E[i.fetchedItemsKey]:E!=null&&E.id?p.value=[E]:p.value=[]}else if(C){const I=[];k(C)&&i.searchKeys.includes("id")?I.push((async()=>{const{data:P}=await o.get(`${m}/${C}`);return[P[i.fetchedItemsKey]??P]})()):I.push(...i.searchKeys.filter(P=>P!=="id").map(async P=>{const{data:K}=await o.get(`${m}?${P}=${C}`);return K[i.fetchedItemsKey]}));const E=await Promise.all(I),q=new Set;p.value=[],(O=E==null?void 0:E.forEach)==null||O.call(E,P=>{var K;(K=P==null?void 0:P.forEach)==null||K.call(P,U=>{q.has(U.id)||(q.add(U.id),p.value.push(U))})})}else p.value=A.value}catch(I){((F=I==null?void 0:I.response)==null?void 0:F.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",C?(p.value=(Y=b.value)==null?void 0:Y.filter(I=>{var E;let q=!1;for(const P of i.searchKeys){const K=typeof I[P]=="string"?(E=I[P])==null?void 0:E.toLowerCase():I[P];K!=null&&K.includes(C.toLowerCase())&&(q=!0)}return q}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=b.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:b,loadItems:g,debouncedQueryChange:c}}function my(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}}=Ea();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 by(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-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.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 pd(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:y,sortColumnOrder:p,query:A}=a;try{let b=new URL(s.value.href);return o.value&&A?(b.search="",b=r.value.app==="konnect"?new URL(`${b.href}?filter[name][contains]=${A}`):new URL(`${b.href}/${A}/`)):(o.value||new URLSearchParams(A).forEach((h,m)=>{b.searchParams.append(m,h)}),y&&b.searchParams.append("sort_by",y),p==="desc"&&b.searchParams.append("sort_desc","1"),b.searchParams.append("size",String(l))),d&&c!==1&&b.searchParams.append("offset",String(d)),b.href}catch(b){return console.error("RouteList(fetcher)",b),i.value}}}function wy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=Ba({headers:e.requestHeaders}),s=pd(e,i),a=n.ref({status:Rt.Idle});return{fetcher:async c=>{try{a.value={status:Rt.Loading};const l=s(c),{data:d}=await o.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const A={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Rt.Idle,response:A},A}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Rt.NoResults,response:d,error:l},d):(a.value={status:Rt.Error,response:d,error:l},d)}},fetcherState:a}}function vy(){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 hd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,yd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(hd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},md=e=>e==="*"||e==="x"||e==="X",gd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},ky=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Cy=(e,t)=>{if(md(e)||md(t))return 0;const[r,i]=ky(gd(e),gd(t));return r>i?1:r<i?-1:0},bd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Cy(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Sy=(e,t)=>{const r=yd(e),i=yd(t),o=r.pop(),s=i.pop(),a=bd(r,i);return a!==0?a:o&&s?bd(o.split("."),s.split(".")):o||s?o?-1:1:0},wd=(e,t,r)=>{xy(r);const i=Sy(e,t);return vd[r].includes(i)},vd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},kd=Object.keys(vd),xy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(kd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${kd.join("|")}`)},Ay=e=>typeof e=="string"&&/^[v\d]/.test(e)&&hd.test(e);function By(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Ay(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&wd(o,a,"<")||c&&wd(o,c,">"))}function Iy(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 Ie={useAxios:Ba,useDebouncedFilter:yy,useDeleteUrlBuilder:my,useErrors:gy,useExternalLinkCreator:by,useFetcher:wy,useFetchUrlBuilder:pd,useHelpers:fd,useStringHelpers:vy,useI18n:Ea,useGatewayFeatureSupported:By,useTruncationDetector:Iy},Ey={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ny="Copy to clipboard",Oy={message:Ey,iconTitle:Ny},_y="kong-ui-copy-uuid-notify",Cd="24px",Ty=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Vy=e=>(n.pushScopeId("data-v-641e0aee"),e=e(),n.popScopeId(),e),jy=["aria-hidden"],Dy={key:0,"data-testid":"kui-icon-svg-title"},Py=Vy(()=>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)),$y=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:Cd,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 Cd}),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",Dy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Py],8,jy))]),_:1},8,["aria-hidden","style"]))}}),My=Ty($y,[["__scopeId","data-v-641e0aee"]]),Ry="16px",Uy={class:"kong-ui-copy-uuid"},Ly=["onClick"],Sd=15,Hy=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{t:r}=ur.createI18n("en-us",Oy),i=e,o=t,s=i.notify||n.inject(_y,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var b;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(b=i.uuid)==null?void 0:b.substring(0,5)}`:i.uuid}),p=b=>{l.value=b,setTimeout(()=>{l.value=i.tooltip},1800)},A=b=>{var h,m;if(!b(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>Sd,g=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((m=i.uuid)==null?void 0:m.substring(0,Sd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(b,h)=>{const m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Uy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.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(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(g=>A(k),["stop"])},[n.createVNode(n.unref(My),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Ry),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Ly)]),_:1})]),_:1},16))])}}}),Fy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},xd=Fy(Hy,[["__scopeId","data-v-0c07874b"]]),qy={key:0,class:"config-card-fieldset-title"},Ky=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}}=Ie.useI18n(),{convertKeyToTitle:i}=Ie.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),(y,p)=>(n.openBlock(),n.createBlock(Si,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),lt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Ad=lt(Ky,[["__scopeId","data-v-68ca83ec"]]),zy=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ie.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})])}}}),Gy=lt(zy,[["__scopeId","data-v-c96811e5"]]),Wy=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ie.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",Qy="1px",Xy="20px",em={class:"config-card-details-row"},tm=["data-testid"],rm=["data-testid"],im=["data-testid"],nm=["data-testid"],om={key:1},sm=["data-testid"],am=["data-testid"],cm=["data-testid"],lm=["data-testid"],um={name:"ConfigCardItem",components:{CopyUuid:xd,JsonCardItem:Ad,StatusBadge:Wy,InternalLinkItem:Gy}},dm=n.defineComponent({...um,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}){n.useCssVars(h=>({"0da74440":y.value?"none":`solid ${n.unref(Qy)} ${n.unref(Yy)}`,"02a039da":d.value&&c.value?"block":"flex","690f3ced":d.value&&c.value?"100%":r.slim?"50%":"25%","691182c8":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Ie.useI18n(),c=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=n.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=n.computed(()=>r.item.type===se.Json||r.item.type===se.JsonArray),y=n.computed(()=>r.item.type===se.JsonArray),p=n.computed(()=>{switch(r.item.type){case se.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case se.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case se.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case se.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case se.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case se.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case se.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case se.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case se.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case se.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case se.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case se.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}}}),A=n.ref(),{isTruncated:b}=Ie.useTruncationDetector(A);return(h,m)=>{const k=n.resolveComponent("KLabel"),g=n.resolveComponent("KBadge"),S=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",em,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(k,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(h.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,rm)]),key:"0"}:void 0]),1024)],!0)],8,tm),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(n.openBlock(),n.createElementBlock("div",om,[(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,(v,C)=>(n.openBlock(),n.createBlock(g,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:v,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,sm)):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,(v,C)=>(n.openBlock(),n.createBlock(n.unref(xd),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,uuid:v}),null,16,["data-testid","uuid"]))),128))],8,am)):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,(v,C)=>(n.openBlock(),n.createBlock(g,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(n.unref(Kf.BadgeMethodAppearances)).includes(v.toLowerCase())?v.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,cm)):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,(v,C)=>(n.openBlock(),n.createBlock(Ad,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:v},null,8,["index","item"]))),128))],8,lm)):(n.openBlock(),n.createBlock(S,{key:4,label:n.unref(b)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:A,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,nm))],!0)],8,im)])}}}),Si=lt(dm,[["__scopeId","data-v-9c87856b"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Bd(e){return typeof e>"u"||e===null}function fm(e){return typeof e=="object"&&e!==null}function pm(e){return Array.isArray(e)?e:Bd(e)?[]:[e]}function hm(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 ym(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function mm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var gm=Bd,bm=fm,wm=pm,vm=ym,km=mm,Cm=hm,Be={isNothing:gm,isObject:bm,toArray:wm,repeat:vm,isNegativeZero:km,extend:Cm};function Id(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
119
  `+e.mark.snippet),i+" "+r):i}function xi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Id(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}xi.prototype=Object.create(Error.prototype),xi.prototype.constructor=xi,xi.prototype.toString=function(e){return this.name+": "+Id(this,e)};var Ue=xi;function Na(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 Oa(e,t){return Be.repeat(" ",t-e.length)+e}function Sm(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,y=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+y+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=Na(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),p),c=Be.repeat(" ",t.indent)+Oa((e.line-l+1).toString(),y)+" | "+d.str+`
120
120
  `+c;for(d=Na(e.buffer,i[a],o[a],e.position,p),c+=Be.repeat(" ",t.indent)+Oa((e.line+1).toString(),y)+" | "+d.str+`
121
121
  `,c+=Be.repeat("-",t.indent+y+3+d.pos)+`^
122
122
  `,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)d=Na(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),p),c+=Be.repeat(" ",t.indent)+Oa((e.line+l+1).toString(),y)+" | "+d.str+`
123
- `;return c.replace(/\n$/,"")}var xm=Sm,Am=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Bm=["scalar","sequence","mapping"];function Im(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function Em(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Am.indexOf(r)===-1)throw new Ue('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=Im(t.styleAliases||null),Bm.indexOf(this.kind)===-1)throw new Ue('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Oe=Em;function Ed(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 Nm(){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 _a(e){return this.extend(e)}_a.prototype.extend=function(e){var t=[],r=[];if(e instanceof Oe)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 Ue("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof Oe))throw new Ue("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Ue("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 Ue("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 Oe))throw new Ue("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(_a.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Ed(i,"implicit"),i.compiledExplicit=Ed(i,"explicit"),i.compiledTypeMap=Nm(i.compiledImplicit,i.compiledExplicit),i};var Nd=_a,Od=new Oe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),_d=new Oe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Td=new Oe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Vd=new Nd({explicit:[Od,_d,Td]});function Om(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function _m(){return null}function Tm(e){return e===null}var jd=new Oe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Om,construct:_m,predicate:Tm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Vm(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 jm(e){return e==="true"||e==="True"||e==="TRUE"}function Dm(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Dd=new Oe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Vm,construct:jm,predicate:Dm,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 Pm(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function $m(e){return 48<=e&&e<=55}function Mm(e){return 48<=e&&e<=57}function Rm(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(!Pm(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!$m(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Mm(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function Um(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 Lm(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Be.isNegativeZero(e)}var Pd=new Oe("tag:yaml.org,2002:int",{kind:"scalar",resolve:Rm,construct:Um,predicate:Lm,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"]}}),Hm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Fm(e){return!(e===null||!Hm.test(e)||e[e.length-1]==="_")}function Km(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 qm=/^[-+]?[0-9]+e/;function zm(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(Be.isNegativeZero(e))return"-0.0";return r=e.toString(10),qm.test(r)?r.replace("e",".e"):r}function Gm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Be.isNegativeZero(e))}var $d=new Oe("tag:yaml.org,2002:float",{kind:"scalar",resolve:Fm,construct:Km,predicate:Gm,represent:zm,defaultStyle:"lowercase"}),Md=Vd.extend({implicit:[jd,Dd,Pd,$d]}),Rd=Md,Ud=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ld=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 Wm(e){return e===null?!1:Ud.exec(e)!==null||Ld.exec(e)!==null}function Jm(e){var t,r,i,o,s,a,c,l=0,d=null,y,p,A;if(t=Ud.exec(e),t===null&&(t=Ld.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]&&(y=+t[10],p=+(t[11]||0),d=(y*60+p)*6e4,t[9]==="-"&&(d=-d)),A=new Date(Date.UTC(r,i,o,s,a,c,l)),d&&A.setTime(A.getTime()-d),A}function Ym(e){return e.toISOString()}var Hd=new Oe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Wm,construct:Jm,instanceOf:Date,represent:Ym});function Zm(e){return e==="<<"||e===null}var Fd=new Oe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Zm}),Ta=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
124
- \r`;function Qm(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Ta;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 Xm(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Ta,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 eg(e){var t="",r=0,i,o,s=e.length,a=Ta;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 tg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Kd=new Oe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Qm,construct:Xm,predicate:tg,represent:eg}),rg=Object.prototype.hasOwnProperty,ig=Object.prototype.toString;function ng(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,ig.call(o)!=="[object Object]")return!1;for(s in o)if(rg.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 og(e){return e!==null?e:[]}var qd=new Oe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ng,construct:og}),sg=Object.prototype.toString;function ag(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],sg.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function cg(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 zd=new Oe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ag,construct:cg}),lg=Object.prototype.hasOwnProperty;function ug(e){if(e===null)return!0;var t,r=e;for(t in r)if(lg.call(r,t)&&r[t]!==null)return!1;return!0}function dg(e){return e!==null?e:{}}var Gd=new Oe("tag:yaml.org,2002:set",{kind:"mapping",resolve:ug,construct:dg}),Va=Rd.extend({implicit:[Hd,Fd],explicit:[Kd,qd,zd,Gd]}),Ut=Object.prototype.hasOwnProperty,to=1,Wd=2,Jd=3,ro=4,ja=1,fg=2,Yd=3,pg=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,hg=/[\x85\u2028\u2029]/,yg=/[,\[\]\{\}]/,Zd=/^(?:!|!!|![a-z\-]+!)$/i,Qd=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Xd(e){return Object.prototype.toString.call(e)}function bt(e){return e===10||e===13}function cr(e){return e===9||e===32}function Ge(e){return e===9||e===32||e===10||e===13}function $r(e){return e===44||e===91||e===93||e===123||e===125}function mg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function gg(e){return e===120?2:e===117?4:e===85?8:0}function bg(e){return 48<=e&&e<=57?e-48:-1}function ef(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
123
+ `;return c.replace(/\n$/,"")}var xm=Sm,Am=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Bm=["scalar","sequence","mapping"];function Im(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function Em(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Am.indexOf(r)===-1)throw new Ue('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=Im(t.styleAliases||null),Bm.indexOf(this.kind)===-1)throw new Ue('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Oe=Em;function Ed(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 Nm(){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 _a(e){return this.extend(e)}_a.prototype.extend=function(e){var t=[],r=[];if(e instanceof Oe)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 Ue("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof Oe))throw new Ue("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Ue("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 Ue("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 Oe))throw new Ue("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(_a.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Ed(i,"implicit"),i.compiledExplicit=Ed(i,"explicit"),i.compiledTypeMap=Nm(i.compiledImplicit,i.compiledExplicit),i};var Nd=_a,Od=new Oe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),_d=new Oe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Td=new Oe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Vd=new Nd({explicit:[Od,_d,Td]});function Om(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function _m(){return null}function Tm(e){return e===null}var jd=new Oe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Om,construct:_m,predicate:Tm,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Vm(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 jm(e){return e==="true"||e==="True"||e==="TRUE"}function Dm(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Dd=new Oe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Vm,construct:jm,predicate:Dm,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 Pm(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function $m(e){return 48<=e&&e<=55}function Mm(e){return 48<=e&&e<=57}function Rm(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(!Pm(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!$m(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Mm(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function Um(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 Lm(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Be.isNegativeZero(e)}var Pd=new Oe("tag:yaml.org,2002:int",{kind:"scalar",resolve:Rm,construct:Um,predicate:Lm,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"]}}),Hm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Fm(e){return!(e===null||!Hm.test(e)||e[e.length-1]==="_")}function qm(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 Km=/^[-+]?[0-9]+e/;function zm(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(Be.isNegativeZero(e))return"-0.0";return r=e.toString(10),Km.test(r)?r.replace("e",".e"):r}function Gm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Be.isNegativeZero(e))}var $d=new Oe("tag:yaml.org,2002:float",{kind:"scalar",resolve:Fm,construct:qm,predicate:Gm,represent:zm,defaultStyle:"lowercase"}),Md=Vd.extend({implicit:[jd,Dd,Pd,$d]}),Rd=Md,Ud=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ld=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 Wm(e){return e===null?!1:Ud.exec(e)!==null||Ld.exec(e)!==null}function Jm(e){var t,r,i,o,s,a,c,l=0,d=null,y,p,A;if(t=Ud.exec(e),t===null&&(t=Ld.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]&&(y=+t[10],p=+(t[11]||0),d=(y*60+p)*6e4,t[9]==="-"&&(d=-d)),A=new Date(Date.UTC(r,i,o,s,a,c,l)),d&&A.setTime(A.getTime()-d),A}function Ym(e){return e.toISOString()}var Hd=new Oe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Wm,construct:Jm,instanceOf:Date,represent:Ym});function Zm(e){return e==="<<"||e===null}var Fd=new Oe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Zm}),Ta=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
124
+ \r`;function Qm(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Ta;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 Xm(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Ta,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 eg(e){var t="",r=0,i,o,s=e.length,a=Ta;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 tg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var qd=new Oe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Qm,construct:Xm,predicate:tg,represent:eg}),rg=Object.prototype.hasOwnProperty,ig=Object.prototype.toString;function ng(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,ig.call(o)!=="[object Object]")return!1;for(s in o)if(rg.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 og(e){return e!==null?e:[]}var Kd=new Oe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ng,construct:og}),sg=Object.prototype.toString;function ag(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],sg.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function cg(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 zd=new Oe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ag,construct:cg}),lg=Object.prototype.hasOwnProperty;function ug(e){if(e===null)return!0;var t,r=e;for(t in r)if(lg.call(r,t)&&r[t]!==null)return!1;return!0}function dg(e){return e!==null?e:{}}var Gd=new Oe("tag:yaml.org,2002:set",{kind:"mapping",resolve:ug,construct:dg}),Va=Rd.extend({implicit:[Hd,Fd],explicit:[qd,Kd,zd,Gd]}),Ut=Object.prototype.hasOwnProperty,to=1,Wd=2,Jd=3,ro=4,ja=1,fg=2,Yd=3,pg=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,hg=/[\x85\u2028\u2029]/,yg=/[,\[\]\{\}]/,Zd=/^(?:!|!!|![a-z\-]+!)$/i,Qd=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Xd(e){return Object.prototype.toString.call(e)}function bt(e){return e===10||e===13}function cr(e){return e===9||e===32}function Ge(e){return e===9||e===32||e===10||e===13}function $r(e){return e===44||e===91||e===93||e===123||e===125}function mg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function gg(e){return e===120?2:e===117?4:e===85?8:0}function bg(e){return 48<=e&&e<=57?e-48:-1}function ef(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
125
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 wg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var tf=new Array(256),rf=new Array(256),Mr=0;Mr<256;Mr++)tf[Mr]=ef(Mr)?1:0,rf[Mr]=ef(Mr);function vg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Va,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 nf(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=xm(r),new Ue(t,r)}function z(e,t){throw nf(e,t)}function io(e,t){e.onWarning&&e.onWarning.call(null,nf(e,t))}var of={YAML:function(e,t,r){var i,o,s;e.version!==null&&z(e,"duplication of %YAML directive"),r.length!==1&&z(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&z(e,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&z(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&io(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,o;r.length!==2&&z(e,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],Zd.test(i)||z(e,"ill-formed tag handle (first argument) of the TAG directive"),Ut.call(e.tagMap,i)&&z(e,'there is a previously declared suffix for "'+i+'" tag handle'),Qd.test(o)||z(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{z(e,"tag prefix is malformed: "+o)}e.tagMap[i]=o}};function Lt(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||z(e,"expected valid JSON character");else pg.test(c)&&z(e,"the stream contains non-printable characters");e.result+=c}}function sf(e,t,r,i){var o,s,a,c;for(Be.isObject(r)||z(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],Ut.call(t,s)||(t[s]=r[s],i[s]=!0)}function Rr(e,t,r,i,o,s,a,c,l){var d,y;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),d=0,y=o.length;d<y;d+=1)Array.isArray(o[d])&&z(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,y=s.length;d<y;d+=1)sf(e,t,s[d],r);else sf(e,t,s,r);else!e.json&&!Ut.call(r,o)&&Ut.call(t,o)&&(e.line=a||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,z(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 Da(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++):z(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ke(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;cr(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(bt(o))for(Da(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&&io(e,"deficient indentation"),i}function no(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||Ge(r)))}function Pa(e,t){t===1?e.result+=" ":t>1&&(e.result+=Be.repeat(`
126
- `,t-1))}function kg(e,t,r){var i,o,s,a,c,l,d,y,p=e.kind,A=e.result,v;if(v=e.input.charCodeAt(e.position),Ge(v)||$r(v)||v===35||v===38||v===42||v===33||v===124||v===62||v===39||v===34||v===37||v===64||v===96||(v===63||v===45)&&(o=e.input.charCodeAt(e.position+1),Ge(o)||r&&$r(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;v!==0;){if(v===58){if(o=e.input.charCodeAt(e.position+1),Ge(o)||r&&$r(o))break}else if(v===35){if(i=e.input.charCodeAt(e.position-1),Ge(i))break}else{if(e.position===e.lineStart&&no(e)||r&&$r(v))break;if(bt(v))if(l=e.line,d=e.lineStart,y=e.lineIndent,ke(e,!1,-1),e.lineIndent>=t){c=!0,v=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=y;break}}c&&(Lt(e,s,a,!1),Pa(e,e.line-l),s=a=e.position,c=!1),cr(v)||(a=e.position+1),v=e.input.charCodeAt(++e.position)}return Lt(e,s,a,!1),e.result?!0:(e.kind=p,e.result=A,!1)}function Cg(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(Lt(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 bt(r)?(Lt(e,i,o,!0),Pa(e,ke(e,!1,t)),i=o=e.position):e.position===e.lineStart&&no(e)?z(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);z(e,"unexpected end of the stream within a single quoted scalar")}function Sg(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 Lt(e,r,e.position,!0),e.position++,!0;if(c===92){if(Lt(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),bt(c))ke(e,!1,t);else if(c<256&&tf[c])e.result+=rf[c],e.position++;else if((a=gg(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=mg(c))>=0?s=(s<<4)+a:z(e,"expected hexadecimal character");e.result+=wg(s),e.position++}else z(e,"unknown escape sequence");r=i=e.position}else bt(c)?(Lt(e,r,i,!0),Pa(e,ke(e,!1,t)),r=i=e.position):e.position===e.lineStart&&no(e)?z(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}z(e,"unexpected end of the stream within a double quoted scalar")}function xg(e,t){var r=!0,i,o,s,a=e.tag,c,l=e.anchor,d,y,p,A,v,h=Object.create(null),m,k,g,S;if(S=e.input.charCodeAt(e.position),S===91)y=93,v=!1,c=[];else if(S===123)y=125,v=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),S=e.input.charCodeAt(++e.position);S!==0;){if(ke(e,!0,t),S=e.input.charCodeAt(e.position),S===y)return e.position++,e.tag=a,e.anchor=l,e.kind=v?"mapping":"sequence",e.result=c,!0;r?S===44&&z(e,"expected the node content, but found ','"):z(e,"missed comma between flow collection entries"),k=m=g=null,p=A=!1,S===63&&(d=e.input.charCodeAt(e.position+1),Ge(d)&&(p=A=!0,e.position++,ke(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Ur(e,t,to,!1,!0),k=e.tag,m=e.result,ke(e,!0,t),S=e.input.charCodeAt(e.position),(A||e.line===i)&&S===58&&(p=!0,S=e.input.charCodeAt(++e.position),ke(e,!0,t),Ur(e,t,to,!1,!0),g=e.result),v?Rr(e,c,h,k,m,g,i,o,s):p?c.push(Rr(e,null,h,k,m,g,i,o,s)):c.push(m),ke(e,!0,t),S=e.input.charCodeAt(e.position),S===44?(r=!0,S=e.input.charCodeAt(++e.position)):r=!1}z(e,"unexpected end of the stream within a flow collection")}function Ag(e,t){var r,i,o=ja,s=!1,a=!1,c=t,l=0,d=!1,y,p;if(p=e.input.charCodeAt(e.position),p===124)i=!1;else if(p===62)i=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)ja===o?o=p===43?Yd:fg:z(e,"repeat of a chomping mode identifier");else if((y=bg(p))>=0)y===0?z(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?z(e,"repeat of an indentation width identifier"):(c=t+y-1,a=!0);else break;if(cr(p)){do p=e.input.charCodeAt(++e.position);while(cr(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!bt(p)&&p!==0)}for(;p!==0;){for(Da(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),bt(p)){l++;continue}if(e.lineIndent<c){o===Yd?e.result+=Be.repeat(`
126
+ `,t-1))}function kg(e,t,r){var i,o,s,a,c,l,d,y,p=e.kind,A=e.result,b;if(b=e.input.charCodeAt(e.position),Ge(b)||$r(b)||b===35||b===38||b===42||b===33||b===124||b===62||b===39||b===34||b===37||b===64||b===96||(b===63||b===45)&&(o=e.input.charCodeAt(e.position+1),Ge(o)||r&&$r(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;b!==0;){if(b===58){if(o=e.input.charCodeAt(e.position+1),Ge(o)||r&&$r(o))break}else if(b===35){if(i=e.input.charCodeAt(e.position-1),Ge(i))break}else{if(e.position===e.lineStart&&no(e)||r&&$r(b))break;if(bt(b))if(l=e.line,d=e.lineStart,y=e.lineIndent,ke(e,!1,-1),e.lineIndent>=t){c=!0,b=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=y;break}}c&&(Lt(e,s,a,!1),Pa(e,e.line-l),s=a=e.position,c=!1),cr(b)||(a=e.position+1),b=e.input.charCodeAt(++e.position)}return Lt(e,s,a,!1),e.result?!0:(e.kind=p,e.result=A,!1)}function Cg(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(Lt(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 bt(r)?(Lt(e,i,o,!0),Pa(e,ke(e,!1,t)),i=o=e.position):e.position===e.lineStart&&no(e)?z(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);z(e,"unexpected end of the stream within a single quoted scalar")}function Sg(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 Lt(e,r,e.position,!0),e.position++,!0;if(c===92){if(Lt(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),bt(c))ke(e,!1,t);else if(c<256&&tf[c])e.result+=rf[c],e.position++;else if((a=gg(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=mg(c))>=0?s=(s<<4)+a:z(e,"expected hexadecimal character");e.result+=wg(s),e.position++}else z(e,"unknown escape sequence");r=i=e.position}else bt(c)?(Lt(e,r,i,!0),Pa(e,ke(e,!1,t)),r=i=e.position):e.position===e.lineStart&&no(e)?z(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}z(e,"unexpected end of the stream within a double quoted scalar")}function xg(e,t){var r=!0,i,o,s,a=e.tag,c,l=e.anchor,d,y,p,A,b,h=Object.create(null),m,k,g,S;if(S=e.input.charCodeAt(e.position),S===91)y=93,b=!1,c=[];else if(S===123)y=125,b=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),S=e.input.charCodeAt(++e.position);S!==0;){if(ke(e,!0,t),S=e.input.charCodeAt(e.position),S===y)return e.position++,e.tag=a,e.anchor=l,e.kind=b?"mapping":"sequence",e.result=c,!0;r?S===44&&z(e,"expected the node content, but found ','"):z(e,"missed comma between flow collection entries"),k=m=g=null,p=A=!1,S===63&&(d=e.input.charCodeAt(e.position+1),Ge(d)&&(p=A=!0,e.position++,ke(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Ur(e,t,to,!1,!0),k=e.tag,m=e.result,ke(e,!0,t),S=e.input.charCodeAt(e.position),(A||e.line===i)&&S===58&&(p=!0,S=e.input.charCodeAt(++e.position),ke(e,!0,t),Ur(e,t,to,!1,!0),g=e.result),b?Rr(e,c,h,k,m,g,i,o,s):p?c.push(Rr(e,null,h,k,m,g,i,o,s)):c.push(m),ke(e,!0,t),S=e.input.charCodeAt(e.position),S===44?(r=!0,S=e.input.charCodeAt(++e.position)):r=!1}z(e,"unexpected end of the stream within a flow collection")}function Ag(e,t){var r,i,o=ja,s=!1,a=!1,c=t,l=0,d=!1,y,p;if(p=e.input.charCodeAt(e.position),p===124)i=!1;else if(p===62)i=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)ja===o?o=p===43?Yd:fg:z(e,"repeat of a chomping mode identifier");else if((y=bg(p))>=0)y===0?z(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?z(e,"repeat of an indentation width identifier"):(c=t+y-1,a=!0);else break;if(cr(p)){do p=e.input.charCodeAt(++e.position);while(cr(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!bt(p)&&p!==0)}for(;p!==0;){for(Da(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),bt(p)){l++;continue}if(e.lineIndent<c){o===Yd?e.result+=Be.repeat(`
127
127
  `,s?1+l:l):o===ja&&s&&(e.result+=`
128
128
  `);break}for(i?cr(p)?(d=!0,e.result+=Be.repeat(`
129
129
  `,s?1+l:l)):d?(d=!1,e.result+=Be.repeat(`
130
130
  `,l+1)):l===0?s&&(e.result+=" "):e.result+=Be.repeat(`
131
131
  `,l):e.result+=Be.repeat(`
132
- `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!bt(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Lt(e,r,e.position,!1)}return!0}function af(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,z(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Ge(a))));){if(c=!0,e.position++,ke(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Ur(e,t,Jd,!1,!0),s.push(e.result),ke(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)z(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 Bg(e,t,r){var i,o,s,a,c,l,d=e.tag,y=e.anchor,p={},A=Object.create(null),v=null,h=null,m=null,k=!1,g=!1,S;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),S=e.input.charCodeAt(e.position);S!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(S===63||S===58)&&Ge(i))S===63?(k&&(Rr(e,p,A,v,h,null,a,c,l),v=h=m=null),g=!0,k=!0,o=!0):k?(k=!1,o=!0):z(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,S=i;else{if(a=e.line,c=e.lineStart,l=e.position,!Ur(e,r,Wd,!1,!0))break;if(e.line===s){for(S=e.input.charCodeAt(e.position);cr(S);)S=e.input.charCodeAt(++e.position);if(S===58)S=e.input.charCodeAt(++e.position),Ge(S)||z(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Rr(e,p,A,v,h,null,a,c,l),v=h=m=null),g=!0,k=!1,o=!1,v=e.tag,h=e.result;else if(g)z(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(g)z(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=y,!0}if((e.line===s||e.lineIndent>t)&&(k&&(a=e.line,c=e.lineStart,l=e.position),Ur(e,t,ro,!0,o)&&(k?h=e.result:m=e.result),k||(Rr(e,p,A,v,h,m,a,c,l),v=h=m=null),ke(e,!0,-1),S=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&S!==0)z(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Rr(e,p,A,v,h,null,a,c,l),g&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),g}function Ig(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&&z(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)):z(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ge(a);)a===33&&(i?z(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Zd.test(o)||z(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),yg.test(s)&&z(e,"tag suffix cannot contain flow indicator characters")}s&&!Qd.test(s)&&z(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{z(e,"tag name is malformed: "+s)}return r?e.tag=s:Ut.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:z(e,'undeclared tag handle "'+o+'"'),!0}function Eg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&z(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Ge(r)&&!$r(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Ng(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&&!Ge(i)&&!$r(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Ut.call(e.anchorMap,r)||z(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ke(e,!0,-1),!0}function Ur(e,t,r,i,o){var s,a,c,l=1,d=!1,y=!1,p,A,v,h,m,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=c=ro===r||Jd===r,i&&ke(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Ig(e)||Eg(e);)ke(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||ro===r)&&(to===r||Wd===r?m=t:m=t+1,k=e.position-e.lineStart,l===1?c&&(af(e,k)||Bg(e,k,m))||xg(e,m)?y=!0:(a&&Ag(e,m)||Cg(e,m)||Sg(e,m)?y=!0:Ng(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&z(e,"alias node should not have any properties")):kg(e,m,to===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&af(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&z(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,A=e.implicitTypes.length;p<A;p+=1)if(h=e.implicitTypes[p],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(Ut.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,v=e.typeMap.multi[e.kind||"fallback"],p=0,A=v.length;p<A;p+=1)if(e.tag.slice(0,v[p].tag.length)===v[p].tag){h=v[p];break}h||z(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&z(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)):z(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||y}function Og(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&&(ke(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&&!Ge(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&z(e,"directive name must not be less than one character in length");a!==0;){for(;cr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!bt(a));break}if(bt(a))break;for(r=e.position;a!==0&&!Ge(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Da(e),Ut.call(of,i)?of[i](e,i,o):io(e,'unknown document directive "'+i+'"')}if(ke(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,ke(e,!0,-1)):s&&z(e,"directives end mark is expected"),Ur(e,e.lineIndent-1,ro,!1,!0),ke(e,!0,-1),e.checkLineBreaks&&hg.test(e.input.slice(t,e.position))&&io(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&no(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ke(e,!0,-1));return}if(e.position<e.length-1)z(e,"end of the stream or a document separator is expected");else return}function cf(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 vg(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,z(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;)Og(r);return r.documents}function _g(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=cf(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Tg(e,t){var r=cf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Ue("expected a single document in the stream, but found more")}}var Vg=_g,jg=Tg,lf={loadAll:Vg,load:jg},uf=Object.prototype.toString,df=Object.prototype.hasOwnProperty,$a=65279,Dg=9,Ai=10,Pg=13,$g=32,Mg=33,Rg=34,Ma=35,Ug=37,Lg=38,Hg=39,Fg=42,ff=44,Kg=45,oo=58,qg=61,zg=62,Gg=63,Wg=64,pf=91,hf=93,Jg=96,yf=123,Yg=124,mf=125,Pe={};Pe[0]="\\0",Pe[7]="\\a",Pe[8]="\\b",Pe[9]="\\t",Pe[10]="\\n",Pe[11]="\\v",Pe[12]="\\f",Pe[13]="\\r",Pe[27]="\\e",Pe[34]='\\"',Pe[92]="\\\\",Pe[133]="\\N",Pe[160]="\\_",Pe[8232]="\\L",Pe[8233]="\\P";var Zg=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Qg=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Xg(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&&df.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 Ue("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Be.repeat("0",i-t.length)+t}var t0=1,Bi=2;function r0(e){this.schema=e.schema||Va,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Be.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Xg(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==='"'?Bi: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=Be.repeat(" ",t),i=0,o=-1,s="",a,c=e.length;i<c;)o=e.indexOf(`
132
+ `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!bt(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Lt(e,r,e.position,!1)}return!0}function af(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,z(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Ge(a))));){if(c=!0,e.position++,ke(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Ur(e,t,Jd,!1,!0),s.push(e.result),ke(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)z(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 Bg(e,t,r){var i,o,s,a,c,l,d=e.tag,y=e.anchor,p={},A=Object.create(null),b=null,h=null,m=null,k=!1,g=!1,S;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),S=e.input.charCodeAt(e.position);S!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(S===63||S===58)&&Ge(i))S===63?(k&&(Rr(e,p,A,b,h,null,a,c,l),b=h=m=null),g=!0,k=!0,o=!0):k?(k=!1,o=!0):z(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,S=i;else{if(a=e.line,c=e.lineStart,l=e.position,!Ur(e,r,Wd,!1,!0))break;if(e.line===s){for(S=e.input.charCodeAt(e.position);cr(S);)S=e.input.charCodeAt(++e.position);if(S===58)S=e.input.charCodeAt(++e.position),Ge(S)||z(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Rr(e,p,A,b,h,null,a,c,l),b=h=m=null),g=!0,k=!1,o=!1,b=e.tag,h=e.result;else if(g)z(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(g)z(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=y,!0}if((e.line===s||e.lineIndent>t)&&(k&&(a=e.line,c=e.lineStart,l=e.position),Ur(e,t,ro,!0,o)&&(k?h=e.result:m=e.result),k||(Rr(e,p,A,b,h,m,a,c,l),b=h=m=null),ke(e,!0,-1),S=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&S!==0)z(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Rr(e,p,A,b,h,null,a,c,l),g&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),g}function Ig(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&&z(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)):z(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ge(a);)a===33&&(i?z(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Zd.test(o)||z(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),yg.test(s)&&z(e,"tag suffix cannot contain flow indicator characters")}s&&!Qd.test(s)&&z(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{z(e,"tag name is malformed: "+s)}return r?e.tag=s:Ut.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:z(e,'undeclared tag handle "'+o+'"'),!0}function Eg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&z(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Ge(r)&&!$r(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Ng(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&&!Ge(i)&&!$r(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&z(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Ut.call(e.anchorMap,r)||z(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ke(e,!0,-1),!0}function Ur(e,t,r,i,o){var s,a,c,l=1,d=!1,y=!1,p,A,b,h,m,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=c=ro===r||Jd===r,i&&ke(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Ig(e)||Eg(e);)ke(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||ro===r)&&(to===r||Wd===r?m=t:m=t+1,k=e.position-e.lineStart,l===1?c&&(af(e,k)||Bg(e,k,m))||xg(e,m)?y=!0:(a&&Ag(e,m)||Cg(e,m)||Sg(e,m)?y=!0:Ng(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&z(e,"alias node should not have any properties")):kg(e,m,to===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&af(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&z(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,A=e.implicitTypes.length;p<A;p+=1)if(h=e.implicitTypes[p],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(Ut.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,b=e.typeMap.multi[e.kind||"fallback"],p=0,A=b.length;p<A;p+=1)if(e.tag.slice(0,b[p].tag.length)===b[p].tag){h=b[p];break}h||z(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&z(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)):z(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||y}function Og(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&&(ke(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&&!Ge(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&z(e,"directive name must not be less than one character in length");a!==0;){for(;cr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!bt(a));break}if(bt(a))break;for(r=e.position;a!==0&&!Ge(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Da(e),Ut.call(of,i)?of[i](e,i,o):io(e,'unknown document directive "'+i+'"')}if(ke(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,ke(e,!0,-1)):s&&z(e,"directives end mark is expected"),Ur(e,e.lineIndent-1,ro,!1,!0),ke(e,!0,-1),e.checkLineBreaks&&hg.test(e.input.slice(t,e.position))&&io(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&no(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ke(e,!0,-1));return}if(e.position<e.length-1)z(e,"end of the stream or a document separator is expected");else return}function cf(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 vg(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,z(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;)Og(r);return r.documents}function _g(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=cf(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Tg(e,t){var r=cf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Ue("expected a single document in the stream, but found more")}}var Vg=_g,jg=Tg,lf={loadAll:Vg,load:jg},uf=Object.prototype.toString,df=Object.prototype.hasOwnProperty,$a=65279,Dg=9,Ai=10,Pg=13,$g=32,Mg=33,Rg=34,Ma=35,Ug=37,Lg=38,Hg=39,Fg=42,ff=44,qg=45,oo=58,Kg=61,zg=62,Gg=63,Wg=64,pf=91,hf=93,Jg=96,yf=123,Yg=124,mf=125,Pe={};Pe[0]="\\0",Pe[7]="\\a",Pe[8]="\\b",Pe[9]="\\t",Pe[10]="\\n",Pe[11]="\\v",Pe[12]="\\f",Pe[13]="\\r",Pe[27]="\\e",Pe[34]='\\"',Pe[92]="\\\\",Pe[133]="\\N",Pe[160]="\\_",Pe[8232]="\\L",Pe[8233]="\\P";var Zg=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Qg=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Xg(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&&df.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 Ue("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Be.repeat("0",i-t.length)+t}var t0=1,Bi=2;function r0(e){this.schema=e.schema||Va,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Be.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Xg(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==='"'?Bi: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=Be.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 Ra(e,t){return`
136
- `+Be.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 so(e){return e===$g||e===Dg}function Ii(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==$a||65536<=e&&e<=1114111}function bf(e){return Ii(e)&&e!==$a&&e!==Pg&&e!==Ai}function wf(e,t,r){var i=bf(e),o=i&&!so(e);return(r?i:i&&e!==ff&&e!==pf&&e!==hf&&e!==yf&&e!==mf)&&e!==Ma&&!(t===oo&&!o)||bf(t)&&!so(t)&&e===Ma||t===oo&&o}function n0(e){return Ii(e)&&e!==$a&&!so(e)&&e!==Kg&&e!==Gg&&e!==oo&&e!==ff&&e!==pf&&e!==hf&&e!==yf&&e!==mf&&e!==Ma&&e!==Lg&&e!==Fg&&e!==Mg&&e!==Yg&&e!==qg&&e!==zg&&e!==Hg&&e!==Rg&&e!==Ug&&e!==Wg&&e!==Jg}function o0(e){return!so(e)&&e!==oo}function Ei(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 vf(e){var t=/^\n* /;return t.test(e)}var kf=1,Ua=2,Cf=3,Sf=4,Lr=5;function s0(e,t,r,i,o,s,a,c){var l,d=0,y=null,p=!1,A=!1,v=i!==-1,h=-1,m=n0(Ei(e,0))&&o0(Ei(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ei(e,l),!Ii(d))return Lr;m=m&&wf(d,y,c),y=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ei(e,l),d===Ai)p=!0,v&&(A=A||l-h-1>i&&e[h+1]!==" ",h=l);else if(!Ii(d))return Lr;m=m&&wf(d,y,c),y=d}A=A||v&&l-h-1>i&&e[h+1]!==" "}return!p&&!A?m&&!a&&!o(e)?kf:s===Bi?Lr:Ua:r>9&&vf(e)?Lr:a?s===Bi?Lr:Ua:A?Sf:Cf}function a0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===Bi?'""':"''";if(!e.noCompatMode&&(Zg.indexOf(t)!==-1||Qg.test(t)))return e.quotingType===Bi?'"'+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 kf:return t;case Ua:return"'"+t.replace(/'/g,"''")+"'";case Cf:return"|"+xf(t,e.indent)+Af(gf(t,s));case Sf:return">"+xf(t,e.indent)+Af(gf(c0(t,a),s));case Lr:return'"'+l0(t)+'"';default:throw new Ue("impossible error: invalid scalar style")}}()}function xf(e,t){var r=vf(e)?String(t):"",i=e[e.length-1]===`
136
+ `+Be.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 so(e){return e===$g||e===Dg}function Ii(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==$a||65536<=e&&e<=1114111}function bf(e){return Ii(e)&&e!==$a&&e!==Pg&&e!==Ai}function wf(e,t,r){var i=bf(e),o=i&&!so(e);return(r?i:i&&e!==ff&&e!==pf&&e!==hf&&e!==yf&&e!==mf)&&e!==Ma&&!(t===oo&&!o)||bf(t)&&!so(t)&&e===Ma||t===oo&&o}function n0(e){return Ii(e)&&e!==$a&&!so(e)&&e!==qg&&e!==Gg&&e!==oo&&e!==ff&&e!==pf&&e!==hf&&e!==yf&&e!==mf&&e!==Ma&&e!==Lg&&e!==Fg&&e!==Mg&&e!==Yg&&e!==Kg&&e!==zg&&e!==Hg&&e!==Rg&&e!==Ug&&e!==Wg&&e!==Jg}function o0(e){return!so(e)&&e!==oo}function Ei(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 vf(e){var t=/^\n* /;return t.test(e)}var kf=1,Ua=2,Cf=3,Sf=4,Lr=5;function s0(e,t,r,i,o,s,a,c){var l,d=0,y=null,p=!1,A=!1,b=i!==-1,h=-1,m=n0(Ei(e,0))&&o0(Ei(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ei(e,l),!Ii(d))return Lr;m=m&&wf(d,y,c),y=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ei(e,l),d===Ai)p=!0,b&&(A=A||l-h-1>i&&e[h+1]!==" ",h=l);else if(!Ii(d))return Lr;m=m&&wf(d,y,c),y=d}A=A||b&&l-h-1>i&&e[h+1]!==" "}return!p&&!A?m&&!a&&!o(e)?kf:s===Bi?Lr:Ua:r>9&&vf(e)?Lr:a?s===Bi?Lr:Ua:A?Sf:Cf}function a0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===Bi?'""':"''";if(!e.noCompatMode&&(Zg.indexOf(t)!==-1||Qg.test(t)))return e.quotingType===Bi?'"'+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 kf:return t;case Ua:return"'"+t.replace(/'/g,"''")+"'";case Cf:return"|"+xf(t,e.indent)+Af(gf(t,s));case Sf:return">"+xf(t,e.indent)+Af(gf(c0(t,a),s));case Lr:return'"'+l0(t)+'"';default:throw new Ue("impossible error: invalid scalar style")}}()}function xf(e,t){var r=vf(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+`
@@ -145,4 +145,4 @@ ${t.join(`
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
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=Ei(e,o),i=Pe[r],!i&&Ii(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)),(_t(e,t,c,!1,!1)||typeof c>"u"&&_t(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}function If(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)),(_t(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&_t(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Ra(e,t)),e.dump&&Ai===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,y;for(a=0,c=s.length;a<c;a+=1)y="",i!==""&&(y+=", "),e.condenseFlow&&(y+='"'),l=s[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),_t(e,t,l,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),_t(e,t,d,!1,!1)&&(y+=e.dump,i+=y));e.tag=o,e.dump="{"+i+"}"}function f0(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),c,l,d,y,p,A;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Ue("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)A="",(!i||o!=="")&&(A+=Ra(e,t)),d=a[c],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),_t(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Ai===e.dump.charCodeAt(0)?A+="?":A+="? "),A+=e.dump,p&&(A+=Ra(e,t)),_t(e,t+1,y,!0,p)&&(e.dump&&Ai===e.dump.charCodeAt(0)?A+=":":A+=": ",A+=e.dump,o+=A));e.tag=s,e.dump=o||"{}"}function Ef(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,uf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(df.call(c.represent,l))i=c.represent[l](t,l);else throw new Ue("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function _t(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Ef(e,r,!1)||Ef(e,r,!0);var c=uf.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var y=c==="[object Object]"||c==="[object Array]",p,A;if(y&&(p=e.duplicates.indexOf(r),A=p!==-1),(e.tag!==null&&e.tag!=="?"||A||e.indent!==2&&t>0)&&(o=!1),A&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&A&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(f0(e,t,e.dump,o),A&&(e.dump="&ref_"+p+e.dump)):(d0(e,t,e.dump),A&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?If(e,t-1,e.dump,o):If(e,t,e.dump,o),A&&(e.dump="&ref_"+p+e.dump)):(u0(e,t,e.dump),A&&(e.dump="&ref_"+p+" "+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 Ue("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(La(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}function La(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)La(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)La(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)),_t(r,0,i,!0,!0)?r.dump+`
148
- `:""}var y0=h0,m0={dump:y0};function Ha(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 g0=Oe,b0=Nd,w0=Vd,v0=Md,k0=Rd,C0=Va,S0=lf.load,x0=lf.loadAll,A0=m0.dump,B0=Ue,I0={binary:Kd,float:$d,map:Td,null:jd,pairs:zd,set:Gd,timestamp:Hd,bool:Dd,int:Pd,merge:Fd,omap:qd,seq:_d,str:Od},E0=Ha("safeLoad","load"),N0=Ha("safeLoadAll","loadAll"),O0=Ha("safeDump","dump"),_0={Type:g0,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:O0};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=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}}=Ie.useI18n(),o=c=>!!(c.tooltip||r[`${c.key}-label-tooltip`]),s=n.ref(""),a=n.ref("");return n.watch(()=>t.format,c=>{if(c!=="structured"){const l=JSON.parse(JSON.stringify(t.record));delete l.created_at,delete l.updated_at,c==="json"?s.value=JSON.stringify(l,null,2):c==="yaml"&&(a.value=_0.dump(l))}},{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,y=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${y}-props`,class:n.normalizeClass(`config-card-details-${y}-props`),"data-testid":`config-card-details-${y}-props`},[y!=="basic"?(n.openBlock(),n.createElementBlock("div",j0,n.toDisplayString(y==="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[y],p=>(n.openBlock(),n.createBlock(Si,{key:p.key,item:p},n.createSlots({label:n.withCtx(()=>[n.renderSlot(c.$slots,`${p.key}-label`,{row:p},void 0,!0)]),[p.key]:n.withCtx(({rowValue:A})=>[n.renderSlot(c.$slots,p.key,{row:p,rowValue:A},void 0,!0)]),_:2},[o(p)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(c.$slots,`${p.key}-label-tooltip`,{row:p},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)}}}),M0=lt($0,[["__scopeId","data-v-c914c7e4"]]),Nf="24px",R0=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},U0=e=>(n.pushScopeId("data-v-a53b73fd"),e=e(),n.popScopeId(),e),L0=["aria-hidden"],H0={key:0,"data-testid":"kui-icon-svg-title"},F0=U0(()=>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)),K0=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:Nf,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 Nf}),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",H0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),F0],8,L0))]),_:1},8,["aria-hidden","style"]))}}),q0=R0(K0,[["__scopeId","data-v-a53b73fd"]]),z0={"data-testid":"config-card-title"},G0={class:"config-card-actions"},W0=["href"],J0={key:2,class:"config-card-details-section"},Y0={key:3,class:"config-card-details-section"},Z0=["data-testid"],Q0={key:0,class:"config-card-prop-section-title"},X0=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=t,o=e,s=n.useSlots(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:c}=Ie.useErrors(),{convertKeyToTitle:l}=Ie.useStringHelpers(),{axiosInstance:d}=Ie.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),y=[{label:a("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),A=E=>{p.value=E==null?void 0:E.value},v={id:{type:se.ID,label:a("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:se.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:se.Date,label:a("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:se.Date,label:a("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:se.BadgeTag,order:-1,section:fe.Basic}},h=n.ref(!1),m=n.ref(!1),k=n.ref(""),g=n.ref(),S=n.computed(()=>{var E,K,P;if(!g.value)return[];const q=[],U=Object.keys(g.value).length;for(const D in g.value){const oe=(K=(E=o.configSchema)==null?void 0:E[D])==null?void 0:K.order,de=(P=v[D])==null?void 0:P.order;let we=U;(de||de===0)&&(we=de===-1?U+1:de),oe&&(we=oe===-1?U+1:oe),q.push([D,we])}return q.sort(function(D,oe){return D[1]-oe[1]}),q.map(D=>{var oe,de;const we=D[0],pe=(oe=g.value)==null?void 0:oe[we],he=((de=o.configSchema)==null?void 0:de[we])||{},Ce=v[we];return{key:we,value:pe,hidden:he.hidden||!1,type:he.type??((Ce==null?void 0:Ce.type)||se.Text),label:he.label??((Ce==null?void 0:Ce.label)||l(we)),tooltip:he.tooltip??((Ce==null?void 0:Ce.tooltip)||void 0),section:he.section??((Ce==null?void 0:Ce.section)||fe.Advanced)}}).filter(D=>!D.hidden&&D.key!==o.pluginConfigKey)}),w=n.computed(()=>{var E,K;if(!g.value||!o.pluginConfigKey)return[];const P=g.value[o.pluginConfigKey]||{},q=Object.keys(P).length,U=[];for(const D in P){const oe=(K=(E=o.pluginConfigSchema)==null?void 0:E[D])==null?void 0:K.order,de=P[D];let we=de!=null&&de!==""?q-1:q;oe&&(we=oe===-1?q+1:oe),U.push([D,we])}return U.sort(function(D,oe){return D[1]-oe[1]}),U.map(D=>{var oe;const de=D[0],we=P[de],pe=((oe=o.pluginConfigSchema)==null?void 0:oe[de])||{};return{key:de,value:we,hidden:pe.hidden||!1,type:pe.type??se.Text,label:pe.label??l(de),tooltip:pe.tooltip??void 0,section:fe.Plugin}}).filter(D=>!D.hidden)}),C=n.computed(()=>{var E,K,P,q;return{basic:(E=S.value)==null?void 0:E.filter(U=>U.section===fe.Basic),advanced:(K=S.value)==null?void 0:K.filter(U=>U.section===fe.Advanced),plugin:(q=w.value)==null?void 0:q.concat((P=S.value)==null?void 0:P.filter(U=>U.section===fe.Plugin))}}),O=n.computed(()=>{const E=[];return C.value.basic.length&&E.push("basic"),C.value.advanced.length&&E.push("advanced"),C.value.plugin.length&&E.push("plugin"),E}),F=E=>!!(E.tooltip||s[`${E.key}-label-tooltip`]),Z=n.computed(()=>{var E,K;let P=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?P=P.replace(/{controlPlaneId}/gi,((E=o.config)==null?void 0:E.controlPlaneId)||""):o.config.app==="kongManager"&&(P=P.replace(/\/{workspace}/gi,(K=o.config)!=null&&K.workspace?`/${o.config.workspace}`:"")),P=P.replace(/{id}/gi,o.config.entityId),P}),I=E=>{g.value&&E(JSON.stringify(g.value))?i("copy:success",g.value):i("copy:error")};return n.watch(h,E=>{i("loading",E)},{immediate:!0}),n.onBeforeMount(async()=>{m.value=!1,h.value=!0;try{const{data:E}=await d.get(Z.value);if(o.dataKey)if(typeof E[o.dataKey]<"u")g.value={...E[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else g.value={...E};Object.keys(o.configSchema).filter(K=>o.configSchema[K].forceShow).forEach(K=>{g.value&&typeof g.value[K]>"u"&&(g.value[K]=null)}),i("fetch:success",E)}catch(E){const K=c(E);k.value=K.startsWith("code")?a("baseConfigCard.errors.load"):K,m.value=!0,i("fetch:error",E)}finally{h.value=!1}}),(E,K)=>{const P=n.resolveComponent("KLabel"),q=n.resolveComponent("KSelect"),U=n.resolveComponent("KButton"),D=n.resolveComponent("KClipboardProvider"),oe=n.resolveComponent("KSkeleton"),de=n.resolveComponent("KEmptyState"),we=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(we,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",G0,[n.renderSlot(E.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(P,{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(q,{key:1,appearance:"select","data-testid":"select-config-format",items:y,onChange:A})):n.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(U,{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(q0),{size:n.unref(Xy)},null,8,["size"])],8,W0)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(D,{key:3},{default:n.withCtx(({copyToClipboard:pe})=>[!h.value&&!m.value?(n.openBlock(),n.createBlock(U,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:he=>I(pe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),default:n.withCtx(()=>[h.value?(n.openBlock(),n.createBlock(oe,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):m.value?(n.openBlock(),n.createBlock(de,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(k.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",J0,[n.createVNode(M0,{format:p.value,"prop-list-types":O.value,"property-collections":C.value,record:g.value},n.createSlots({_:2},[n.renderList(Object.keys(E.$slots),pe=>({name:pe,fn:n.withCtx(({row:he,rowValue:Ce})=>[n.renderSlot(E.$slots,pe,{row:he,rowValue:Ce},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",Y0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(O.value,pe=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${pe}-props`,class:n.normalizeClass(`config-card-details-${pe}-props`),"data-testid":`config-card-details-${pe}-props`},[pe!=="basic"?(n.openBlock(),n.createElementBlock("div",Q0,n.toDisplayString(pe==="advanced"?n.unref(a)("baseConfigCard.sections.advanced"):n.unref(a)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value[pe],he=>(n.openBlock(),n.createBlock(Si,{key:he.key,item:he},n.createSlots({label:n.withCtx(()=>[n.renderSlot(E.$slots,`${he.key}-label`,{row:he},void 0,!0)]),[he.key]:n.withCtx(({rowValue:Ce})=>[n.renderSlot(E.$slots,he.key,{row:he,rowValue:Ce},void 0,!0)]),_:2},[F(he)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(E.$slots,`${he.key}-label-tooltip`,{row:he},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Z0))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",z0,[n.renderSlot(E.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Of=lt(X0,[["__scopeId","data-v-bea4df63"]]),e1={class:"form-actions","data-testid":"form-actions"},t1=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=t,o=e,s=Fr.useRouter(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:c}=Ie.useErrors(),{axiosInstance:l}=Ie.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),d=n.ref(!1),y=n.ref(!1),p=n.ref(""),A=n.computed(()=>o.canSubmit===!1||o.isReadonly),v=n.computed(()=>{var g,S;if(!o.editId)return"";let w=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((g=o.config)==null?void 0:g.controlPlaneId)||""):o.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(S=o.config)!=null&&S.workspace?`/${o.config.workspace}`:"")),w=w.replace(/{id}/gi,o.editId),w}),h=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):m()},m=()=>{i("cancel")},k=()=>{A.value||i("submit")};return n.watch(()=>d.value,g=>{i("loading",g)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:g}=await l.get(v.value);i("fetch:success",g)}catch(g){const S=c(g);p.value=S.startsWith("code")?a("baseForm.errors.edit"):S,y.value=!0,i("fetch:error",g)}finally{d.value=!1}}),(g,S)=>{const w=n.resolveComponent("KSkeleton"),C=n.resolveComponent("KEmptyState"),O=n.resolveComponent("KAlert"),F=n.resolveComponent("KButton"),Z=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(Z,{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(w,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(C,{key:1,"cta-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":h,"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(m,["prevent"]),onSubmit:n.withModifiers(k,["prevent"])},[n.renderSlot(g.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(O,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",e1,[n.renderSlot(g.$slots,"form-actions",{},()=>[n.createVNode(F,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(F,{appearance:"primary","data-testid":"form-submit",disabled:A.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32))]),_:3})}}}),_f=lt(t1,[["__scopeId","data-v-448d8512"]]),r1={key:0,"data-testid":"first-col"},i1=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,k;const g=(m=t.rowEl)==null?void 0:m.querySelectorAll("td");return g?((k=g[0])==null?void 0:k.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var m,k,g;d.value=((m=i.value)==null?void 0:m.getBoundingClientRect().width)||0,y.value=((k=r.value)==null?void 0:k.clientWidth)||0,p.value=((g=l.value)==null?void 0:g.innerText)||""},l=n.ref({}),d=n.ref(0),y=n.ref(0),p=n.ref(""),A=n.computed(()=>[i.value,r.value]),v=n.watch(A,m=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(k=>{window.requestAnimationFrame(()=>{!Array.isArray(k)||!k.length||c()})});for(const k of m)k&&s.observe(k)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>y.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{v()}),(m,k)=>{const g=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",r1,[n.createVNode(g,{label:h.value?p.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)}}}),n1=lt(i1,[["__scopeId","data-v-e42a20c9"]]),o1={class:"toolbar-container"},s1={key:0,class:"toolbar-button-container"},a1=["data-testid"],c1=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,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,i=t,{i18n:{t:o}}=Ie.useI18n(),s=n.computed(()=>{var O,F;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(O=r.errorMessage)==null?void 0:O.title,message:(F=r.errorMessage)==null?void 0:F.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=O=>O.hasData||!!r.query,l=n.computed(()=>{const O=[];return Object.keys(r.tableHeaders).forEach(F=>{const Z=r.tableHeaders[F];O.push({label:Z.label??F,key:F,sortable:Z.sortable??!1})}),r.enableEntityActions&&O.push({key:"actions",hideLabel:!0}),O}),d=O=>({"data-rowid":O.id,"data-testid":O.name,...r.rowAttributes(O)}),y=n.ref({}),p=O=>{var F;return(F=y.value)==null?void 0:F.$el.querySelector(`[data-rowid="${O.id}"]`)},A=O=>{const F={"data-testid":O.headerKey,...r.cellAttributes(O)};return O.colIndex===0&&(F.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),F},v=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},m=n.computed(()=>r.disableRowClick?void 0:(O,F)=>{i("click:row",F)}),k=O=>{i("sort",O)},{setTablePreferences:g,getTablePreferences:S}=ny(),w=n.computed(()=>{const O=S(r.preferencesStorageKey);return{...r.initialFetcherParams,...O}}),C=O=>{r.preferencesStorageKey&&g(r.preferencesStorageKey,O)};return(O,F)=>{const Z=n.resolveComponent("KIcon"),I=n.resolveComponent("KButton"),E=n.resolveComponent("KDropdown"),K=n.resolveComponent("KTable"),P=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(P,{class:"kong-ui-entity-base-table",title:e.title},{default:n.withCtx(()=>[n.createVNode(K,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":A,"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(o)("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(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":w.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:v,"onRow:click":m.value,onSort:F[0]||(F[0]=q=>k(q)),"onUpdate:tablePreferences":C},n.createSlots({toolbar:n.withCtx(({state:q})=>[n.withDirectives(n.createElementVNode("div",o1,[n.renderSlot(O.$slots,"toolbar-filter",{},void 0,!0),O.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",s1,[n.renderSlot(O.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,c(q)]])]),actions:n.withCtx(({row:q,rowKey:U,rowValue:D})=>[n.createElementVNode("div",{class:"actions-container","data-testid":q.name},[n.createVNode(E,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(O.$slots,"actions",{row:q,rowKey:U,rowValue:D},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(I,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(Z,{color:n.unref(Zy),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,a1)]),_:2},[n.renderList(e.tableHeaders,(q,U)=>({name:U,fn:n.withCtx(({row:D,rowKey:oe,rowValue:de})=>[n.createVNode(n1,{"key-name":String(U),"row-el":p(D)},{default:n.withCtx(()=>[n.renderSlot(O.$slots,U,{row:D,rowKey:oe,rowValue:de},()=>[n.createTextVNode(n.toDisplayString(de),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-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Tf=lt(c1,[["__scopeId","data-v-57b5a97b"]]),l1={key:0,class:"kong-ui-entity-delete-error"},u1={key:1,class:"description"},d1=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{i18nT:r}=Ie.useI18n(),i=e,o=t,s=n.computed(()=>i.needConfirm?i.entityName:""),a=()=>{o("cancel")},c=()=>{o("proceed")};return(l,d)=>{const y=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":s.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:a,onProceed:c},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",l1,[n.createVNode(y,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(n.openBlock(),n.createElementBlock("div",u1,[n.renderSlot(l.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Vf=lt(d1,[["__scopeId","data-v-1c9a2a07"]]),f1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},p1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},h1=["fill"],y1={mask:"url(#mask0_180_20349)"},m1=["fill"],jf=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",f1,[n.createElementVNode("mask",p1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,h1)]),n.createElementVNode("g",y1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,m1)])]))}}),g1={key:1,class:"kong-ui-entity-filter"},b1={class:"menu-item-title"},w1={class:"menu-item-indicator"},v1={class:"menu-item-body"},k1=["for"],C1={class:"menu-item-buttons"},S1={class:"filter-clear-button-container"},x1=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{i18n:{t:r}}=Ie.useI18n(),i=e,o=t,s=n.ref(!1),a=n.ref({}),c=n.computed(()=>{const g=[];return new URLSearchParams(i.modelValue).forEach((S,w)=>{S!==""&&g.push(w)}),g}),l=n.computed(()=>{const g=i.config.fields;return Object.keys(g).filter(S=>g[S].searchable).map(S=>({label:g[S].label||S,value:S}))});n.watch(()=>i.modelValue,g=>{a.value={},new URLSearchParams(g).forEach((S,w)=>{a.value[w]=S})});const d=()=>{s.value=!s.value},y=g=>{o("update:modelValue",g)},p=g=>`filter-${g}`,A=g=>{var S,w;return(((w=(S=i.config.schema)==null?void 0:S[g])==null?void 0:w.values)??[]).map(C=>({value:C,label:C}))},v=g=>{var S,w;return((w=(S=i.config.schema)==null?void 0:S[g])==null?void 0:w.type)??"text"},h=g=>{a.value={...a.value,[g]:""},k()},m=()=>{a.value={},k(!0)},k=(g=!1)=>{const S=Object.keys(a.value).reduce((w,C)=>(a.value[C]&&(w[C]=`${a.value[C]}`),w),{});g&&(s.value=!1),o("update:modelValue",new URLSearchParams(S).toString())};return(g,S)=>{const w=n.resolveComponent("KInput"),C=n.resolveComponent("KButton"),O=n.resolveComponent("KSelect"),F=n.resolveComponent("KMenuItem"),Z=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":y},{before:n.withCtx(()=>[n.createVNode(jf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",g1,[n.createVNode(C,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:n.withCtx(()=>[n.createVNode(jf),n.createTextVNode(" "+n.toDisplayString(n.unref(r)("filter.filterButtonText"))+" "+n.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:d},null,512),[[n.vShow,s.value]]),n.withDirectives(n.createVNode(Z,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(I,E)=>(n.openBlock(),n.createBlock(F,{key:I.value,"data-testid":I.value,expandable:"","last-menu-item":E===l.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",b1,[n.createTextVNode(n.toDisplayString(I.label)+" ",1),n.withDirectives(n.createElementVNode("span",w1,null,512),[[n.vShow,c.value.includes(I.value)]])])]),itemBody:n.withCtx(()=>{var K,P;return[n.createElementVNode("div",v1,[n.createElementVNode("label",{class:"menu-item-label",for:p(I.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,k1),((P=(K=e.config.schema)==null?void 0:K[I.value])==null?void 0:P.type)==="select"?(n.openBlock(),n.createBlock(O,{key:0,id:p(I.value),modelValue:a.value[I.value],"onUpdate:modelValue":q=>a.value[I.value]=q,appearance:"select",items:A(I.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(w,{key:1,id:p(I.value),modelValue:a.value[I.value],"onUpdate:modelValue":q=>a.value[I.value]=q,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:v(I.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",C1,[n.createVNode(C,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:S[0]||(S[0]=q=>k(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(C,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:q=>h(I.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createElementVNode("div",S1,[n.createVNode(C,{appearance:"tertiary",size:"small",onClick:m},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[n.vShow,s.value]])]))}}}),Df=lt(x1,[["__scopeId","data-v-15962ee2"]]),Tt=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)}}),A1={class:"form-section-wrapper"},B1={key:0,class:"form-section-title"},I1={key:1,class:"form-section-description"},E1={key:2,class:"form-section-footer"},N1={class:"form-section-content"},O1=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",A1,[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",B1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",I1,[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",E1,[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))}}),ao=lt(O1,[["__scopeId","data-v-8b6dc312"]]),{useAxios:co,useDeleteUrlBuilder:Pf,useErrors:$f,useExternalLinkCreator:mb,useFetchUrlBuilder:gb,useFetcher:Mf,useDebouncedFilter:bb,useStringHelpers:Rf,useHelpers:Uf,useGatewayFeatureSupported:wb,useTruncationDetector:vb}=Ie,_1={class:"kong-ui-entities-certificates-list"},T1={key:0},V1={key:1},j1={key:0},D1={key:1},P1={key:0},$1={key:1},M1={key:1},R1={key:1},U1=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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var Q;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),c=Fr.useRouter(),{axiosInstance:l}=co({headers:(Q=i.config)==null?void 0:Q.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),A={subject:{label:o("certificates.list.table_headers.subject")},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},v=n.computed(()=>{var ie,me;let M=`${i.config.apiBaseUrl}${Ci.list[i.config.app]}`;return i.config.app==="konnect"?M=M.replace(/{controlPlaneId}/gi,((ie=i.config)==null?void 0:ie.controlPlaneId)||""):i.config.app==="kongManager"&&(M=M.replace(/\/{workspace}/gi,(me=i.config)!=null&&me.workspace?`/${i.config.workspace}`:"")),M}),h=n.ref(""),m=n.computed(()=>{const M=i.config.app==="konnect"||i.config.isExactMatch;return M?{isExactMatch:M,placeholder:o("certificates.search.placeholder")}:{isExactMatch:M,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:g}=Mf(i.config,v.value),S=()=>{h.value=""},w=()=>{d.value++},C=n.ref(null),O=(M,ie)=>{const me=M.id;if(!ie(me)){r("copy:error",{entity:M,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:M,field:"id",message:o("certificates.copy.success",{val:me})})},F=(M,ie)=>{const me=JSON.stringify(M);if(!ie(me)){r("copy:error",{entity:M,message:o("certificates.errors.copy")});return}r("copy:success",{entity:M,message:o("certificates.copy.success_brief")})},Z=(M,ie)=>{M.type==="error"?r("copy:error",{entity:ie,field:"cert",message:o("certificates.errors.copy")}):r("copy:success",{entity:ie,field:"cert",message:o("certificates.copy.success_brief")})},I=async M=>{var me;await((me=i.canRetrieve)==null?void 0:me.call(i,M))&&c.push(i.config.getViewRoute(M.id))},E=M=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(M)}),K=M=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(M)}),P=M=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(M)}},q=n.ref(void 0),U=n.ref(!1),D=n.ref(!1),oe=n.ref(""),de=Pf(i.config,v.value),{certificateDataCache:we,getCertificateData:pe}=gt.useCertificate(),he=M=>{q.value=M,U.value=!0},Ce=()=>{U.value=!1},ye=async()=>{var M,ie,me;if((M=q.value)!=null&&M.id){D.value=!0;try{await l.delete(de(q.value.id)),D.value=!1,U.value=!1,d.value++,r("delete:success",q.value)}catch($e){oe.value=((me=(ie=$e.response)==null?void 0:ie.data)==null?void 0:me.message)||$e.message||o("certificates.errors.delete"),r("error",$e)}finally{D.value=!1}}},it=n.ref(!0);n.watch(g,M=>{var ie,me,$e,_e;if(Array.isArray((ie=M==null?void 0:M.response)==null?void 0:ie.data)&&(it.value=M.response.data.length>0),M.status===Rt.Error){C.value={title:o("certificates.errors.general")},(_e=($e=(me=M.error)==null?void 0:me.response)==null?void 0:$e.data)!=null&&_e.message&&(C.value.message=M.error.response.data.message),r("error",M.error);return}we.value={},C.value=null});const Y=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("certificates.list.empty_state.description"),title:o("certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(Y.value.title=o("certificates.list.empty_state.title"),Y.value.ctaText=o("certificates.actions.create"))}),(M,ie)=>{const me=n.resolveComponent("KButton"),$e=n.resolveComponent("KBadge"),_e=n.resolveComponent("KTruncate"),X=n.resolveComponent("KDropdownItem"),ve=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",_1,[n.createVNode(n.unref(Tf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Y.value,"enable-entity-actions":"","error-message":C.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(A),"use-action-outside":e.useActionOutside,onClearSearchInput:S,"onClick:row":ie[2]||(ie[2]=W=>I(W)),onSort:w},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Df),{modelValue:h.value,"onUpdate:modelValue":ie[0]||(ie[0]=W=>h.value=W),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[n.createVNode(n.unref(Tt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(me,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,it.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",T1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.subject?W.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",V1,n.toDisplayString(n.unref(pe)(W).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",j1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.expiry?n.unref(s)(W.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",D1,n.toDisplayString(n.unref(pe)(W).schemaExpiry?n.unref(s)(n.unref(pe)(W).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",P1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.dns_names?`dns=${W.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",$1,n.toDisplayString(n.unref(pe)(W).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:W})=>[W!=null&&W.cert?(n.openBlock(),n.createBlock(n.unref(ty),{key:0,"data-testid":"copy-certificate-cert",notify:Se=>Z(Se,W),truncated:!0,uuid:W.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",M1,"-"))]),tags:n.withCtx(({row:W})=>{var Se;return[((Se=W==null?void 0:W.tags)==null?void 0:Se.length)>0?(n.openBlock(),n.createBlock(_e,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W==null?void 0:W.tags,lr=>(n.openBlock(),n.createBlock($e,{key:lr,onClick:ie[1]||(ie[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(lr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",R1,"-"))]}),actions:n.withCtx(({row:W})=>[n.createVNode(ve,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(X,{"data-testid":"action-entity-copy-id",onClick:lr=>O(W,Se)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(ve,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(X,{"data-testid":"action-entity-copy-json",onClick:lr=>F(W,Se)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canRetrieve(W)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-view","has-divider":"",item:E(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canEdit(W)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-edit",item:K(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Tt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-add-sni",item:P(W.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canDelete(W)},{default:n.withCtx(()=>[n.createVNode(X,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>he(W)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Vf),{"action-pending":D.value,"entity-type":n.unref(Aa).Certificate,error:oe.value,title:n.unref(o)("certificates.delete.title"),visible:U.value,onCancel:Ce,onProceed:ye},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},L1=Hr(U1,[["__scopeId","data-v-412e1ee1"]]),H1={class:"kong-ui-entities-certificates-form"},F1=Hr(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=t,i=e,o=Fr.useRouter(),{i18nT:s,i18n:{t:a}}=gt.useI18n(),{getMessageFromError:c}=$f(),{axiosInstance:l}=co({headers:(w=i.config)==null?void 0:w.requestHeaders}),d=n.computed(()=>Ci.form[i.config.app].edit),y=n.computed(()=>i.certificateId?ar.Edit:ar.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),A=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),v=n.computed(()=>(y.value===ar.Create||JSON.stringify(p.fields)!==JSON.stringify(A))&&!!p.fields.cert&&!!p.fields.key),h=C=>{var O;p.fields.cert=(C==null?void 0:C.cert)||"",p.fields.key=(C==null?void 0:C.key)||"",p.fields.certAlt=(C==null?void 0:C.cert_alt)||"",p.fields.keyAlt=(C==null?void 0:C.key_alt)||"",p.fields.tags=((O=C==null?void 0:C.tags)==null?void 0:O.join(", "))||"",Object.assign(A,p.fields)},m=()=>{o.push(i.config.cancelRoute)},k=n.computed(()=>{var O,F;let C=`${i.config.apiBaseUrl}${Ci.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(F=i.config)!=null&&F.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),g=n.computed(()=>{var O,F;let C=`${i.config.apiBaseUrl}${Ci.form[i.config.app][y.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(F=i.config)!=null&&F.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),S=async()=>{var C,O,F,Z,I,E,K,P,q;try{p.isReadonly=!0;const U={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(O=(C=p.fields.tags.split(","))==null?void 0:C.map(oe=>String(oe||"").trim()))==null?void 0:O.filter(oe=>oe!=="")};let D;await l.post(k.value,U),y.value==="create"?D=await l.post(g.value,U):y.value==="edit"&&(D=((F=i.config)==null?void 0:F.app)==="konnect"?await l.put(g.value,U):await l.patch(g.value,U)),p.fields.cert=((Z=D==null?void 0:D.data)==null?void 0:Z.cert)||"",p.fields.key=((I=D==null?void 0:D.data)==null?void 0:I.key)||"",p.fields.certAlt=((E=D==null?void 0:D.data)==null?void 0:E.cert_alt)||"",p.fields.keyAlt=((K=D==null?void 0:D.data)==null?void 0:K.key_alt)||"",p.fields.tags=((q=(P=D==null?void 0:D.data)==null?void 0:P.tags)==null?void 0:q.join(", "))||"",Object.assign(A,p.fields),r("update",D==null?void 0:D.data)}catch(U){p.errorMessage=c(U),r("error",U)}finally{p.isReadonly=!1}};return(C,O)=>{const F=n.resolveComponent("KTextArea"),Z=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",H1,[n.createVNode(n.unref(_f),{"can-submit":v.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":O[5]||(O[5]=I=>C.$emit("error",I)),"onFetch:success":h,onLoading:O[6]||(O[6]=I=>C.$emit("loading",I)),onSubmit:S},{default:n.withCtx(()=>[n.createVNode(n.unref(ao),{description:n.unref(a)("certificates.form.sections.ssl.description"),title:n.unref(a)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(F,{modelValue:p.fields.cert,"onUpdate:modelValue":O[0]||(O[0]=I=>p.fields.cert=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:n.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.key,"onUpdate:modelValue":O[1]||(O[1]=I=>p.fields.key=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:n.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.certAlt,"onUpdate:modelValue":O[2]||(O[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(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":O[3]||(O[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(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(ao),{description:n.unref(a)("certificates.form.sections.general.description"),title:n.unref(a)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(Z,{modelValue:p.fields.tags,"onUpdate:modelValue":O[4]||(O[4]=I=>p.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(a)("certificates.form.fields.tags.help"),label:n.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),[["__scopeId","data-v-f66bc18c"]]),Ni={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"}}},K1={class:"kong-ui-ca-certificate-entity-config-card"},q1={key:0},z1=Hr(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=["dns_names","san_names","subject"],i=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=gt.useI18n(),{convertKeyToTitle:c}=Rf(),{getPropValue:l}=Uf(),{getCertificateData:d}=gt.useCertificate(),y=n.computed(()=>Ni.form[o.config.app].edit),p=n.ref(),A=n.computed(()=>{if(p.value)return d(p.value)}),v=n.computed(()=>{var w;return((w=A.value)==null?void 0:w.schemaIssuer)||""}),h=n.computed(()=>{var w,C;return(w=A.value)!=null&&w.schemaExpiry?a((C=A.value)==null?void 0:C.schemaExpiry):""}),m=n.computed(()=>{var w;return((w=A.value)==null?void 0:w.schemaKeyUsages)||[]}),k=(w,C)=>{const O=l("rowValue",C);if(w==="expiry")return h.value;if(w==="key_usages")return m.value;if(O)return O[w]},g=w=>{p.value=w,i("fetch:success",w)},S=n.ref({id:{},updated_at:{},created_at:{},cert:{section:fe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:fe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:fe.Basic,type:se.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:fe.Basic,order:1.7,forceShow:!0},issuer:{section:fe.Basic,order:1.5,forceShow:!0},key_usages:{section:fe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(w,C)=>{const O=n.resolveComponent("KCodeBlock"),F=n.resolveComponent("KLabel"),Z=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",K1,[n.createVNode(n.unref(Of),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":S.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":C[0]||(C[0]=I=>w.$emit("copy:success",I)),"onFetch:error":C[1]||(C[1]=I=>w.$emit("fetch:error",I)),"onFetch:success":g,onLoading:C[2]||(C[2]=I=>w.$emit("loading",I))},{cert:n.withCtx(I=>[n.unref(l)("rowValue",I)?(n.openBlock(),n.createBlock(O,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",I),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(F,{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(l)("rowValue",I)).filter(E=>!r.includes(E)),E=>(n.openBlock(),n.createBlock(n.unref(Si),{key:E,"data-testid":`ca-cert-metadata-${E}`,item:{key:E,label:n.unref(c)(E),value:k(E,I),type:E==="key_usages"?n.unref(se).BadgeTag:n.unref(se).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),key_usages:n.withCtx(()=>[m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",q1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(I,E)=>(n.openBlock(),n.createBlock(Z,{key:`key_usages-badge-tag-${E}`,class:"config-badge","data-testid":`key_usages-badge-tag-${E}`,tooltip:I,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(I),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),G1={class:"kong-ui-entities-ca-certificates-list"},W1={key:0},J1={key:1},Y1={key:0},Z1={key:1},Q1={key:1},X1=Hr(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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var it;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),c=Fr.useRouter(),{axiosInstance:l}=co({headers:(it=i.config)==null?void 0:it.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),A={issuer:{label:o("ca-certificates.list.table_headers.issuer")},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},v=n.computed(()=>{var Q,M;let Y=`${i.config.apiBaseUrl}${Ni.list[i.config.app]}`;return i.config.app==="konnect"?Y=Y.replace(/{controlPlaneId}/gi,((Q=i.config)==null?void 0:Q.controlPlaneId)||""):i.config.app==="kongManager"&&(Y=Y.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),Y}),h=n.ref(""),m=n.computed(()=>{const Y=i.config.app==="konnect"||i.config.isExactMatch;return Y?{isExactMatch:Y,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:Y,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:g}=Mf(i.config,v.value),S=()=>{h.value=""},w=()=>{d.value++},C=n.ref(null),O=(Y,Q)=>{const M=Y.id;if(!Q(M)){r("copy:error",{entity:Y,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:Y,field:"id",message:o("ca-certificates.copy.success",{val:M})})},F=(Y,Q)=>{const M=JSON.stringify(Y);if(!Q(M)){r("copy:error",{entity:Y,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:Y,message:o("ca-certificates.copy.success_brief")})},Z=async Y=>{var M;await((M=i.canRetrieve)==null?void 0:M.call(i,Y))&&c.push(i.config.getViewRoute(Y.id))},I=Y=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(Y)}),E=Y=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(Y)}),K=n.ref(void 0),P=n.ref(!1),q=n.ref(!1),U=n.ref(""),D=Pf(i.config,v.value),{certificateDataCache:oe,getCertificateData:de}=gt.useCertificate(),we=Y=>{K.value=Y,P.value=!0},pe=()=>{P.value=!1},he=async()=>{var Y,Q,M;if((Y=K.value)!=null&&Y.id){q.value=!0;try{await l.delete(D(K.value.id)),q.value=!1,P.value=!1,d.value++,r("delete:success",K.value)}catch(ie){U.value=((M=(Q=ie.response)==null?void 0:Q.data)==null?void 0:M.message)||ie.message||o("ca-certificates.errors.delete"),r("error",ie)}finally{q.value=!1}}},Ce=n.ref(!0);n.watch(g,Y=>{var Q,M,ie,me;if(Array.isArray((Q=Y==null?void 0:Y.response)==null?void 0:Q.data)&&(Ce.value=Y.response.data.length>0),Y.status===Rt.Error){C.value={title:o("ca-certificates.errors.general")},(me=(ie=(M=Y.error)==null?void 0:M.response)==null?void 0:ie.data)!=null&&me.message&&(C.value.message=Y.error.response.data.message),r("error",Y.error);return}oe.value={},C.value=null});const ye=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("ca-certificates.list.empty_state.description"),title:o("ca-certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(ye.value.title=o("ca-certificates.list.empty_state.title"),ye.value.ctaText=o("ca-certificates.actions.create"))}),(Y,Q)=>{const M=n.resolveComponent("KButton"),ie=n.resolveComponent("KBadge"),me=n.resolveComponent("KTruncate"),$e=n.resolveComponent("KDropdownItem"),_e=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",G1,[n.createVNode(n.unref(Tf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ye.value,"enable-entity-actions":"","error-message":C.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(A),"use-action-outside":e.useActionOutside,onClearSearchInput:S,"onClick:row":Q[2]||(Q[2]=X=>Z(X)),onSort:w},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Df),{modelValue:h.value,"onUpdate:modelValue":Q[0]||(Q[0]=X=>h.value=X),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[n.createVNode(n.unref(Tt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(M,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,Ce.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:n.withCtx(({row:X})=>{var ve;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",W1,n.toDisplayString((ve=X==null?void 0:X.metadata)!=null&&ve.issuer?X.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",J1,n.toDisplayString(n.unref(de)(X).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:X})=>{var ve;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",Y1,n.toDisplayString((ve=X==null?void 0:X.metadata)!=null&&ve.expiry?n.unref(s)(X.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",Z1,n.toDisplayString(n.unref(de)(X).schemaExpiry?n.unref(s)(n.unref(de)(X).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:X})=>{var ve;return[((ve=X==null?void 0:X.tags)==null?void 0:ve.length)>0?(n.openBlock(),n.createBlock(me,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(X==null?void 0:X.tags,W=>(n.openBlock(),n.createBlock(ie,{key:W,onClick:Q[1]||(Q[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(W),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",Q1,"-"))]}),actions:n.withCtx(({row:X})=>[n.createVNode(_e,null,{default:n.withCtx(({copyToClipboard:ve})=>[n.createVNode($e,{"data-testid":"action-entity-copy-id",onClick:W=>O(X,ve)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(_e,null,{default:n.withCtx(({copyToClipboard:ve})=>[n.createVNode($e,{"data-testid":"action-entity-copy-json",onClick:W=>F(X,ve)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canRetrieve(X)},{default:n.withCtx(()=>[n.createVNode($e,{"data-testid":"action-entity-view","has-divider":"",item:I(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canEdit(X)},{default:n.withCtx(()=>[n.createVNode($e,{"data-testid":"action-entity-edit",item:E(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canDelete(X)},{default:n.withCtx(()=>[n.createVNode($e,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ve=>we(X)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Vf),{"action-pending":q.value,"entity-type":n.unref(Aa).CACertificate,error:U.value,title:n.unref(o)("ca-certificates.delete.title"),visible:P.value,onCancel:pe,onProceed:he},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-067baf74"]]),eb={class:"kong-ui-entities-ca-certificates-form"},tb=Hr(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 S;const r=t,i=e,o=Fr.useRouter(),{i18n:{t:s}}=gt.useI18n(),{getMessageFromError:a}=$f(),{axiosInstance:c}=co({headers:(S=i.config)==null?void 0:S.requestHeaders}),l=n.computed(()=>Ni.form[i.config.app].edit),d=n.computed(()=>i.certificateId?ar.Edit:ar.Create),y=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),A=n.computed(()=>(d.value===ar.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),v=w=>{var C;y.fields.cert=(w==null?void 0:w.cert)||"",y.fields.certDigest=(w==null?void 0:w.cert_digest)||"",y.fields.tags=((C=w==null?void 0:w.tags)==null?void 0:C.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},m=n.computed(()=>{var C,O;let w=`${i.config.apiBaseUrl}${Ni.form[i.config.app].validate}`;return i.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),w=w.replace(/{id}/gi,i.certificateId),w}),k=n.computed(()=>{var C,O;let w=`${i.config.apiBaseUrl}${Ni.form[i.config.app][d.value]}`;return i.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),w=w.replace(/{id}/gi,i.certificateId),w}),g=async()=>{var w,C,O,F,Z,I,E;try{y.isReadonly=!0;const K={cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(C=(w=y.fields.tags.split(","))==null?void 0:w.map(q=>String(q||"").trim()))==null?void 0:C.filter(q=>q!=="")};let P;await c.post(m.value,K),d.value==="create"?P=await c.post(k.value,K):d.value==="edit"&&(P=((O=i.config)==null?void 0:O.app)==="konnect"?await c.put(k.value,K):await c.patch(k.value,K)),y.fields.cert=((F=P==null?void 0:P.data)==null?void 0:F.cert)||"",y.fields.certDigest=((Z=P==null?void 0:P.data)==null?void 0:Z.cert_digest)||"",y.fields.tags=((E=(I=P==null?void 0:P.data)==null?void 0:I.tags)==null?void 0:E.join(", "))||"",Object.assign(p,y.fields),r("update",P==null?void 0:P.data)}catch(K){y.errorMessage=a(K),r("error",K)}finally{y.isReadonly=!1}};return(w,C)=>{const O=n.resolveComponent("KTextArea"),F=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",eb,[n.createVNode(n.unref(_f),{"can-submit":A.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":C[3]||(C[3]=Z=>w.$emit("error",Z)),"onFetch:success":v,onLoading:C[4]||(C[4]=Z=>w.$emit("loading",Z)),onSubmit:g},{default:n.withCtx(()=>[n.createVNode(n.unref(ao),{description:n.unref(s)("ca-certificates.form.sections.cert.description"),title:n.unref(s)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=Z=>y.fields.cert=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:n.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(F,{modelValue:y.fields.certDigest,"onUpdate:modelValue":C[1]||(C[1]=Z=>y.fields.certDigest=Z),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(ao),{description:n.unref(s)("ca-certificates.form.sections.general.description"),title:n.unref(s)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(F,{modelValue:y.fields.tags,"onUpdate:modelValue":C[2]||(C[2]=Z=>y.fields.tags=Z),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(s)("ca-certificates.form.fields.tags.help"),label:n.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),[["__scopeId","data-v-bad536b1"]]),rb={class:"kong-ui-certificate-entity-config-card"},ib={key:0},nb=Hr(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=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),{convertKeyToTitle:c}=Rf(),{getPropValue:l}=Uf(),{getCertificateData:d}=gt.useCertificate(),y=n.computed(()=>Ci.form[i.config.app].edit),p=n.ref(),A=n.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:se.Redacted},metadata:{section:fe.Basic,type:se.Json},snis:{section:fe.Basic,type:se.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:fe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:fe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:fe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:fe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:fe.Advanced},key_alt:{section:fe.Advanced,type:se.Redacted}}),v=I=>{p.value=I,r("fetch:success",I)},h=(I,E)=>{const K=l("rowValue",E);if(I==="expiry")return k.value;if(I==="key_usages")return C.value;if(I==="san_names")return S.value;if(K)return K[I]},m=n.computed(()=>{if(p.value)return d(p.value)}),k=n.computed(()=>{var I,E;return(I=m.value)!=null&&I.schemaExpiry?s((E=m.value)==null?void 0:E.schemaExpiry):""}),g=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaIssuer)||""}),S=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaSanNames)||""}),w=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaSubject)||""}),C=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaKeyUsages)||[]}),O=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}),F=n.computed(()=>{var I;return!!((I=p==null?void 0:p.value)!=null&&I.cert_alt)}),Z=I=>{var E,K;return I==="san_names"?o("certificates.list.table_headers.san"):((K=(E=A.value)==null?void 0:E[I])==null?void 0:K.label)||c(I)};return(I,E)=>{const K=n.resolveComponent("KCodeBlock"),P=n.resolveComponent("KLabel"),q=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",rb,[n.createVNode(n.unref(Of),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":A.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":E[0]||(E[0]=U=>I.$emit("copy:success",U)),"onFetch:error":E[1]||(E[1]=U=>I.$emit("fetch:error",U)),"onFetch:success":v,onLoading:E[2]||(E[2]=U=>I.$emit("loading",U))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(U=>[n.unref(l)("rowValue",U)?(n.openBlock(),n.createBlock(K,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",U),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(P,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(U=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",U)),D=>(n.openBlock(),n.createBlock(n.unref(Si),{key:D,item:{key:D,value:h(D,U),label:Z(D),type:D==="key_usages"||D==="snis"||D==="dns_names"?n.unref(se).BadgeTag:n.unref(se).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(S.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[C.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",ib,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value,(U,D)=>(n.openBlock(),n.createBlock(q,{key:`key_usages-badge-tag-${D}`,class:"config-badge","data-testid":`key_usages-badge-tag-${D}`,tooltip:U,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(U),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[O.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},F.value?{name:"cert_alt",fn:n.withCtx(U=>[n.createTextVNode(" > "),n.unref(l)("rowValue",U)?(n.openBlock(),n.createBlock(K,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(l)("rowValue",U),"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"])])}}}),[["__scopeId","data-v-920043bf"]]);Ve.CACertificateConfigCard=z1,Ve.CACertificateForm=tb,Ve.CACertificateList=X1,Ve.CertificateConfigCard=nb,Ve.CertificateForm=F1,Ve.CertificateList=L1,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
148
+ `:""}var y0=h0,m0={dump:y0};function Ha(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 g0=Oe,b0=Nd,w0=Vd,v0=Md,k0=Rd,C0=Va,S0=lf.load,x0=lf.loadAll,A0=m0.dump,B0=Ue,I0={binary:qd,float:$d,map:Td,null:jd,pairs:zd,set:Gd,timestamp:Hd,bool:Dd,int:Pd,merge:Fd,omap:Kd,seq:_d,str:Od},E0=Ha("safeLoad","load"),N0=Ha("safeLoadAll","loadAll"),O0=Ha("safeDump","dump"),_0={Type:g0,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:O0};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:0,class:"config-card-display-json-endpoint"},$0={key:2,class:"config-card-display-yaml"},M0=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},fetcherUrl:{type:String,required:!0}},setup(e){n.useCssVars(l=>({"7b486894":`${c.value}ch`}));const t=e,r=n.useSlots(),{i18n:{t:i}}=Ie.useI18n(),o=l=>!!(l.tooltip||r[`${l.key}-label-tooltip`]),s=n.ref(""),a=n.ref(""),c=n.computed(()=>{var l;if(!t.fetcherUrl)return 0;const d=(l=t.fetcherUrl)==null?void 0:l.split("/");return d.length<2?0:41+d[d.length-2].length});return n.watch(()=>t.format,l=>{if(l!=="structured"){const d=JSON.parse(JSON.stringify(t.record));delete d.created_at,delete d.updated_at,l==="json"?s.value=JSON.stringify(d,null,2):l==="yaml"&&(a.value=_0.dump(d))}},{immediate:!0}),(l,d)=>{const y=n.resolveComponent("KBadge"),p=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,A=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${A}-props`,class:n.normalizeClass(`config-card-details-${A}-props`),"data-testid":`config-card-details-${A}-props`},[A!=="basic"?(n.openBlock(),n.createElementBlock("div",j0,n.toDisplayString(A==="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[A],b=>(n.openBlock(),n.createBlock(Si,{key:b.key,item:b},n.createSlots({label:n.withCtx(()=>[n.renderSlot(l.$slots,`${b.key}-label`,{row:b},void 0,!0)]),[b.key]:n.withCtx(({rowValue:h})=>[n.renderSlot(l.$slots,b.key,{row:b,rowValue:h},void 0,!0)]),_:2},[o(b)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(l.$slots,`${b.key}-label-tooltip`,{row:b},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,[t.fetcherUrl?(n.openBlock(),n.createElementBlock("div",P0,[n.createVNode(y,{appearance:"get"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("baseConfigCard.endpoints.get")),1)]),_:1}),n.createVNode(p,{id:"config-card-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),n.createVNode(p,{id:"config-card-codeblock",class:n.normalizeClass({"config-card-display-json-content":t.fetcherUrl}),code:s.value,language:"json",theme:"dark"},null,8,["class","code"])])):n.createCommentVNode("",!0),e.format==="yaml"?(n.openBlock(),n.createElementBlock("div",$0,[n.createVNode(p,{id:"config-card-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0)],64)}}}),R0=lt(M0,[["__scopeId","data-v-27f85338"]]),Nf="24px",U0=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},L0=e=>(n.pushScopeId("data-v-a53b73fd"),e=e(),n.popScopeId(),e),H0=["aria-hidden"],F0={key:0,"data-testid":"kui-icon-svg-title"},q0=L0(()=>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)),K0=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:Nf,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 Nf}),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",F0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),q0],8,H0))]),_:1},8,["aria-hidden","style"]))}}),z0=U0(K0,[["__scopeId","data-v-a53b73fd"]]),G0={"data-testid":"config-card-title"},W0={class:"config-card-actions"},J0=["href"],Y0={key:2,class:"config-card-details-section"},Z0={key:3,class:"config-card-details-section"},Q0=["data-testid"],X0={key:0,class:"config-card-prop-section-title"},e1=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=t,o=e,s=n.useSlots(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:c}=Ie.useErrors(),{convertKeyToTitle:l}=Ie.useStringHelpers(),{axiosInstance:d}=Ie.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),y=[{label:a("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),A=E=>{p.value=E==null?void 0:E.value},b={id:{type:se.ID,label:a("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:se.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:se.Date,label:a("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:se.Date,label:a("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:se.BadgeTag,order:-1,section:fe.Basic}},h=n.ref(!1),m=n.ref(!1),k=n.ref(""),g=n.ref(),S=n.computed(()=>{var E,q,P;if(!g.value)return[];const K=[],U=Object.keys(g.value).length;for(const D in g.value){const oe=(q=(E=o.configSchema)==null?void 0:E[D])==null?void 0:q.order,de=(P=b[D])==null?void 0:P.order;let we=U;(de||de===0)&&(we=de===-1?U+1:de),oe&&(we=oe===-1?U+1:oe),K.push([D,we])}return K.sort(function(D,oe){return D[1]-oe[1]}),K.map(D=>{var oe,de;const we=D[0],pe=(oe=g.value)==null?void 0:oe[we],he=((de=o.configSchema)==null?void 0:de[we])||{},Ce=b[we];return{key:we,value:pe,hidden:he.hidden||!1,type:he.type??((Ce==null?void 0:Ce.type)||se.Text),label:he.label??((Ce==null?void 0:Ce.label)||l(we)),tooltip:he.tooltip??((Ce==null?void 0:Ce.tooltip)||void 0),section:he.section??((Ce==null?void 0:Ce.section)||fe.Advanced)}}).filter(D=>!D.hidden&&D.key!==o.pluginConfigKey)}),v=n.computed(()=>{var E,q;if(!g.value||!o.pluginConfigKey)return[];const P=g.value[o.pluginConfigKey]||{},K=Object.keys(P).length,U=[];for(const D in P){const oe=(q=(E=o.pluginConfigSchema)==null?void 0:E[D])==null?void 0:q.order,de=P[D];let we=de!=null&&de!==""?K-1:K;oe&&(we=oe===-1?K+1:oe),U.push([D,we])}return U.sort(function(D,oe){return D[1]-oe[1]}),U.map(D=>{var oe;const de=D[0],we=P[de],pe=((oe=o.pluginConfigSchema)==null?void 0:oe[de])||{};return{key:de,value:we,hidden:pe.hidden||!1,type:pe.type??se.Text,label:pe.label??l(de),tooltip:pe.tooltip??void 0,section:fe.Plugin}}).filter(D=>!D.hidden)}),C=n.computed(()=>{var E,q,P,K;return{basic:(E=S.value)==null?void 0:E.filter(U=>U.section===fe.Basic),advanced:(q=S.value)==null?void 0:q.filter(U=>U.section===fe.Advanced),plugin:(K=v.value)==null?void 0:K.concat((P=S.value)==null?void 0:P.filter(U=>U.section===fe.Plugin))}}),O=n.computed(()=>{const E=[];return C.value.basic.length&&E.push("basic"),C.value.advanced.length&&E.push("advanced"),C.value.plugin.length&&E.push("plugin"),E}),F=E=>!!(E.tooltip||s[`${E.key}-label-tooltip`]),Y=n.computed(()=>{var E,q;let P=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?P=P.replace(/{controlPlaneId}/gi,((E=o.config)==null?void 0:E.controlPlaneId)||""):o.config.app==="kongManager"&&(P=P.replace(/\/{workspace}/gi,(q=o.config)!=null&&q.workspace?`/${o.config.workspace}`:"")),P=P.replace(/{id}/gi,o.config.entityId),P}),I=E=>{g.value&&E(JSON.stringify(g.value))?i("copy:success",g.value):i("copy:error")};return n.watch(h,E=>{i("loading",E)},{immediate:!0}),n.onBeforeMount(async()=>{m.value=!1,h.value=!0;try{const{data:E}=await d.get(Y.value);if(o.dataKey)if(typeof E[o.dataKey]<"u")g.value={...E[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else g.value={...E};Object.keys(o.configSchema).filter(q=>o.configSchema[q].forceShow).forEach(q=>{g.value&&typeof g.value[q]>"u"&&(g.value[q]=null)}),i("fetch:success",E)}catch(E){const q=c(E);k.value=q.startsWith("code")?a("baseConfigCard.errors.load"):q,m.value=!0,i("fetch:error",E)}finally{h.value=!1}}),(E,q)=>{const P=n.resolveComponent("KLabel"),K=n.resolveComponent("KSelect"),U=n.resolveComponent("KButton"),D=n.resolveComponent("KClipboardProvider"),oe=n.resolveComponent("KSkeleton"),de=n.resolveComponent("KEmptyState"),we=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(we,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",W0,[n.renderSlot(E.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(P,{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(K,{key:1,appearance:"select","data-testid":"select-config-format",items:y,onChange:A})):n.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(U,{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(z0),{size:n.unref(Xy)},null,8,["size"])],8,J0)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(D,{key:3},{default:n.withCtx(({copyToClipboard:pe})=>[!h.value&&!m.value?(n.openBlock(),n.createBlock(U,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:he=>I(pe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),default:n.withCtx(()=>[h.value?(n.openBlock(),n.createBlock(oe,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):m.value?(n.openBlock(),n.createBlock(de,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(k.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",Y0,[n.createVNode(R0,{"fetcher-url":Y.value,format:p.value,"prop-list-types":O.value,"property-collections":C.value,record:g.value},n.createSlots({_:2},[n.renderList(Object.keys(E.$slots),pe=>({name:pe,fn:n.withCtx(({row:he,rowValue:Ce})=>[n.renderSlot(E.$slots,pe,{row:he,rowValue:Ce},void 0,!0)])}))]),1032,["fetcher-url","format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",Z0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(O.value,pe=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${pe}-props`,class:n.normalizeClass(`config-card-details-${pe}-props`),"data-testid":`config-card-details-${pe}-props`},[pe!=="basic"?(n.openBlock(),n.createElementBlock("div",X0,n.toDisplayString(pe==="advanced"?n.unref(a)("baseConfigCard.sections.advanced"):n.unref(a)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value[pe],he=>(n.openBlock(),n.createBlock(Si,{key:he.key,item:he},n.createSlots({label:n.withCtx(()=>[n.renderSlot(E.$slots,`${he.key}-label`,{row:he},void 0,!0)]),[he.key]:n.withCtx(({rowValue:Ce})=>[n.renderSlot(E.$slots,he.key,{row:he,rowValue:Ce},void 0,!0)]),_:2},[F(he)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(E.$slots,`${he.key}-label-tooltip`,{row:he},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Q0))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",G0,[n.renderSlot(E.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Of=lt(e1,[["__scopeId","data-v-4f47d6ad"]]),t1={class:"form-actions","data-testid":"form-actions"},r1=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=t,o=e,s=Fr.useRouter(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:c}=Ie.useErrors(),{axiosInstance:l}=Ie.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),d=n.ref(!1),y=n.ref(!1),p=n.ref(""),A=n.computed(()=>o.canSubmit===!1||o.isReadonly),b=n.computed(()=>{var g,S;if(!o.editId)return"";let v=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((g=o.config)==null?void 0:g.controlPlaneId)||""):o.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(S=o.config)!=null&&S.workspace?`/${o.config.workspace}`:"")),v=v.replace(/{id}/gi,o.editId),v}),h=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):m()},m=()=>{i("cancel")},k=()=>{A.value||i("submit")};return n.watch(()=>d.value,g=>{i("loading",g)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:g}=await l.get(b.value);i("fetch:success",g)}catch(g){const S=c(g);p.value=S.startsWith("code")?a("baseForm.errors.edit"):S,y.value=!0,i("fetch:error",g)}finally{d.value=!1}}),(g,S)=>{const v=n.resolveComponent("KSkeleton"),C=n.resolveComponent("KEmptyState"),O=n.resolveComponent("KAlert"),F=n.resolveComponent("KButton"),Y=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(Y,{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(v,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(C,{key:1,"cta-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":h,"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(m,["prevent"]),onSubmit:n.withModifiers(k,["prevent"])},[n.renderSlot(g.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(O,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",t1,[n.renderSlot(g.$slots,"form-actions",{},()=>[n.createVNode(F,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(F,{appearance:"primary","data-testid":"form-submit",disabled:A.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32))]),_:3})}}}),_f=lt(r1,[["__scopeId","data-v-448d8512"]]),i1={key:0,"data-testid":"first-col"},n1=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,k;const g=(m=t.rowEl)==null?void 0:m.querySelectorAll("td");return g?((k=g[0])==null?void 0:k.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var m,k,g;d.value=((m=i.value)==null?void 0:m.getBoundingClientRect().width)||0,y.value=((k=r.value)==null?void 0:k.clientWidth)||0,p.value=((g=l.value)==null?void 0:g.innerText)||""},l=n.ref({}),d=n.ref(0),y=n.ref(0),p=n.ref(""),A=n.computed(()=>[i.value,r.value]),b=n.watch(A,m=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(k=>{window.requestAnimationFrame(()=>{!Array.isArray(k)||!k.length||c()})});for(const k of m)k&&s.observe(k)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>y.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{b()}),(m,k)=>{const g=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",i1,[n.createVNode(g,{label:h.value?p.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)}}}),o1=lt(n1,[["__scopeId","data-v-e42a20c9"]]),s1={class:"toolbar-container"},a1={key:0,class:"toolbar-button-container"},c1=["data-testid"],l1=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,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,i=t,{i18n:{t:o}}=Ie.useI18n(),s=n.computed(()=>{var O,F;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(O=r.errorMessage)==null?void 0:O.title,message:(F=r.errorMessage)==null?void 0:F.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=O=>O.hasData||!!r.query,l=n.computed(()=>{const O=[];return Object.keys(r.tableHeaders).forEach(F=>{const Y=r.tableHeaders[F];O.push({label:Y.label??F,key:F,sortable:Y.sortable??!1})}),r.enableEntityActions&&O.push({key:"actions",hideLabel:!0}),O}),d=O=>({"data-rowid":O.id,"data-testid":O.name,...r.rowAttributes(O)}),y=n.ref({}),p=O=>{var F;return(F=y.value)==null?void 0:F.$el.querySelector(`[data-rowid="${O.id}"]`)},A=O=>{const F={"data-testid":O.headerKey,...r.cellAttributes(O)};return O.colIndex===0&&(F.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),F},b=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},m=n.computed(()=>r.disableRowClick?void 0:(O,F)=>{i("click:row",F)}),k=O=>{i("sort",O)},{setTablePreferences:g,getTablePreferences:S}=ny(),v=n.computed(()=>{const O=S(r.preferencesStorageKey);return{...r.initialFetcherParams,...O}}),C=O=>{r.preferencesStorageKey&&g(r.preferencesStorageKey,O)};return(O,F)=>{const Y=n.resolveComponent("KIcon"),I=n.resolveComponent("KButton"),E=n.resolveComponent("KDropdown"),q=n.resolveComponent("KTable"),P=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(P,{class:"kong-ui-entity-base-table",title:e.title},{default:n.withCtx(()=>[n.createVNode(q,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":A,"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(o)("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(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:b,"onRow:click":m.value,onSort:F[0]||(F[0]=K=>k(K)),"onUpdate:tablePreferences":C},n.createSlots({toolbar:n.withCtx(({state:K})=>[n.withDirectives(n.createElementVNode("div",s1,[n.renderSlot(O.$slots,"toolbar-filter",{},void 0,!0),O.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",a1,[n.renderSlot(O.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,c(K)]])]),actions:n.withCtx(({row:K,rowKey:U,rowValue:D})=>[n.createElementVNode("div",{class:"actions-container","data-testid":K.name},[n.createVNode(E,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(O.$slots,"actions",{row:K,rowKey:U,rowValue:D},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(I,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(Y,{color:n.unref(Zy),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,c1)]),_:2},[n.renderList(e.tableHeaders,(K,U)=>({name:U,fn:n.withCtx(({row:D,rowKey:oe,rowValue:de})=>[n.createVNode(o1,{"key-name":String(U),"row-el":p(D)},{default:n.withCtx(()=>[n.renderSlot(O.$slots,U,{row:D,rowKey:oe,rowValue:de},()=>[n.createTextVNode(n.toDisplayString(de),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-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Tf=lt(l1,[["__scopeId","data-v-57b5a97b"]]),u1={key:0,class:"kong-ui-entity-delete-error"},d1={key:1,class:"description"},f1=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{i18nT:r}=Ie.useI18n(),i=e,o=t,s=n.computed(()=>i.needConfirm?i.entityName:""),a=()=>{o("cancel")},c=()=>{o("proceed")};return(l,d)=>{const y=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":s.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:a,onProceed:c},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",u1,[n.createVNode(y,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(n.openBlock(),n.createElementBlock("div",d1,[n.renderSlot(l.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Vf=lt(f1,[["__scopeId","data-v-1c9a2a07"]]),p1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},h1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},y1=["fill"],m1={mask:"url(#mask0_180_20349)"},g1=["fill"],jf=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",p1,[n.createElementVNode("mask",h1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,y1)]),n.createElementVNode("g",m1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,g1)])]))}}),b1={key:1,class:"kong-ui-entity-filter"},w1={class:"menu-item-title"},v1={class:"menu-item-indicator"},k1={class:"menu-item-body"},C1=["for"],S1={class:"menu-item-buttons"},x1={class:"filter-clear-button-container"},A1=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{i18n:{t:r}}=Ie.useI18n(),i=e,o=t,s=n.ref(!1),a=n.ref({}),c=n.computed(()=>{const g=[];return new URLSearchParams(i.modelValue).forEach((S,v)=>{S!==""&&g.push(v)}),g}),l=n.computed(()=>{const g=i.config.fields;return Object.keys(g).filter(S=>g[S].searchable).map(S=>({label:g[S].label||S,value:S}))});n.watch(()=>i.modelValue,g=>{a.value={},new URLSearchParams(g).forEach((S,v)=>{a.value[v]=S})});const d=()=>{s.value=!s.value},y=g=>{o("update:modelValue",g)},p=g=>`filter-${g}`,A=g=>{var S,v;return(((v=(S=i.config.schema)==null?void 0:S[g])==null?void 0:v.values)??[]).map(C=>({value:C,label:C}))},b=g=>{var S,v;return((v=(S=i.config.schema)==null?void 0:S[g])==null?void 0:v.type)??"text"},h=g=>{a.value={...a.value,[g]:""},k()},m=()=>{a.value={},k(!0)},k=(g=!1)=>{const S=Object.keys(a.value).reduce((v,C)=>(a.value[C]&&(v[C]=`${a.value[C]}`),v),{});g&&(s.value=!1),o("update:modelValue",new URLSearchParams(S).toString())};return(g,S)=>{const v=n.resolveComponent("KInput"),C=n.resolveComponent("KButton"),O=n.resolveComponent("KSelect"),F=n.resolveComponent("KMenuItem"),Y=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(v,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":y},{before:n.withCtx(()=>[n.createVNode(jf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",b1,[n.createVNode(C,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:n.withCtx(()=>[n.createVNode(jf),n.createTextVNode(" "+n.toDisplayString(n.unref(r)("filter.filterButtonText"))+" "+n.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:d},null,512),[[n.vShow,s.value]]),n.withDirectives(n.createVNode(Y,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(I,E)=>(n.openBlock(),n.createBlock(F,{key:I.value,"data-testid":I.value,expandable:"","last-menu-item":E===l.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",w1,[n.createTextVNode(n.toDisplayString(I.label)+" ",1),n.withDirectives(n.createElementVNode("span",v1,null,512),[[n.vShow,c.value.includes(I.value)]])])]),itemBody:n.withCtx(()=>{var q,P;return[n.createElementVNode("div",k1,[n.createElementVNode("label",{class:"menu-item-label",for:p(I.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,C1),((P=(q=e.config.schema)==null?void 0:q[I.value])==null?void 0:P.type)==="select"?(n.openBlock(),n.createBlock(O,{key:0,id:p(I.value),modelValue:a.value[I.value],"onUpdate:modelValue":K=>a.value[I.value]=K,appearance:"select",items:A(I.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(v,{key:1,id:p(I.value),modelValue:a.value[I.value],"onUpdate:modelValue":K=>a.value[I.value]=K,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:b(I.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",S1,[n.createVNode(C,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:S[0]||(S[0]=K=>k(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(C,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:K=>h(I.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createElementVNode("div",x1,[n.createVNode(C,{appearance:"tertiary",size:"small",onClick:m},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[n.vShow,s.value]])]))}}}),Df=lt(A1,[["__scopeId","data-v-15962ee2"]]),Tt=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)}}),B1={class:"form-section-wrapper"},I1={key:0,class:"form-section-title"},E1={key:1,class:"form-section-description"},N1={key:2,class:"form-section-footer"},O1={class:"form-section-content"},_1=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",B1,[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",I1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",E1,[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",N1,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",O1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),ao=lt(_1,[["__scopeId","data-v-8b6dc312"]]),{useAxios:co,useDeleteUrlBuilder:Pf,useErrors:$f,useExternalLinkCreator:gb,useFetchUrlBuilder:bb,useFetcher:Mf,useDebouncedFilter:wb,useStringHelpers:Rf,useHelpers:Uf,useGatewayFeatureSupported:vb,useTruncationDetector:kb}=Ie,T1={class:"kong-ui-entities-certificates-list"},V1={key:0},j1={key:1},D1={key:0},P1={key:1},$1={key:0},M1={key:1},R1={key:1},U1={key:1},L1=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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var Q;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),c=Fr.useRouter(),{axiosInstance:l}=co({headers:(Q=i.config)==null?void 0:Q.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),A={subject:{label:o("certificates.list.table_headers.subject")},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},b=n.computed(()=>{var ie,me;let M=`${i.config.apiBaseUrl}${Ci.list[i.config.app]}`;return i.config.app==="konnect"?M=M.replace(/{controlPlaneId}/gi,((ie=i.config)==null?void 0:ie.controlPlaneId)||""):i.config.app==="kongManager"&&(M=M.replace(/\/{workspace}/gi,(me=i.config)!=null&&me.workspace?`/${i.config.workspace}`:"")),M}),h=n.ref(""),m=n.computed(()=>{const M=i.config.app==="konnect"||i.config.isExactMatch;return M?{isExactMatch:M,placeholder:o("certificates.search.placeholder")}:{isExactMatch:M,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:g}=Mf(i.config,b.value),S=()=>{h.value=""},v=()=>{d.value++},C=n.ref(null),O=(M,ie)=>{const me=M.id;if(!ie(me)){r("copy:error",{entity:M,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:M,field:"id",message:o("certificates.copy.success",{val:me})})},F=(M,ie)=>{const me=JSON.stringify(M);if(!ie(me)){r("copy:error",{entity:M,message:o("certificates.errors.copy")});return}r("copy:success",{entity:M,message:o("certificates.copy.success_brief")})},Y=(M,ie)=>{M.type==="error"?r("copy:error",{entity:ie,field:"cert",message:o("certificates.errors.copy")}):r("copy:success",{entity:ie,field:"cert",message:o("certificates.copy.success_brief")})},I=async M=>{var me;await((me=i.canRetrieve)==null?void 0:me.call(i,M))&&c.push(i.config.getViewRoute(M.id))},E=M=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(M)}),q=M=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(M)}),P=M=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(M)}},K=n.ref(void 0),U=n.ref(!1),D=n.ref(!1),oe=n.ref(""),de=Pf(i.config,b.value),{certificateDataCache:we,getCertificateData:pe}=gt.useCertificate(),he=M=>{K.value=M,U.value=!0},Ce=()=>{U.value=!1},ye=async()=>{var M,ie,me;if((M=K.value)!=null&&M.id){D.value=!0;try{await l.delete(de(K.value.id)),D.value=!1,U.value=!1,d.value++,r("delete:success",K.value)}catch($e){oe.value=((me=(ie=$e.response)==null?void 0:ie.data)==null?void 0:me.message)||$e.message||o("certificates.errors.delete"),r("error",$e)}finally{D.value=!1}}},it=n.ref(!0);n.watch(g,M=>{var ie,me,$e,_e;if(Array.isArray((ie=M==null?void 0:M.response)==null?void 0:ie.data)&&(it.value=M.response.data.length>0),M.status===Rt.Error){C.value={title:o("certificates.errors.general")},(_e=($e=(me=M.error)==null?void 0:me.response)==null?void 0:$e.data)!=null&&_e.message&&(C.value.message=M.error.response.data.message),r("error",M.error);return}we.value={},C.value=null});const Z=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("certificates.list.empty_state.description"),title:o("certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(Z.value.title=o("certificates.list.empty_state.title"),Z.value.ctaText=o("certificates.actions.create"))}),(M,ie)=>{const me=n.resolveComponent("KButton"),$e=n.resolveComponent("KBadge"),_e=n.resolveComponent("KTruncate"),X=n.resolveComponent("KDropdownItem"),ve=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",T1,[n.createVNode(n.unref(Tf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Z.value,"enable-entity-actions":"","error-message":C.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(A),"use-action-outside":e.useActionOutside,onClearSearchInput:S,"onClick:row":ie[2]||(ie[2]=W=>I(W)),onSort:v},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Df),{modelValue:h.value,"onUpdate:modelValue":ie[0]||(ie[0]=W=>h.value=W),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[n.createVNode(n.unref(Tt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(me,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,it.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",V1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.subject?W.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",j1,n.toDisplayString(n.unref(pe)(W).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",D1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.expiry?n.unref(s)(W.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",P1,n.toDisplayString(n.unref(pe)(W).schemaExpiry?n.unref(s)(n.unref(pe)(W).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",$1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.dns_names?`dns=${W.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",M1,n.toDisplayString(n.unref(pe)(W).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:W})=>[W!=null&&W.cert?(n.openBlock(),n.createBlock(n.unref(ty),{key:0,"data-testid":"copy-certificate-cert",notify:Se=>Y(Se,W),truncated:!0,uuid:W.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",R1,"-"))]),tags:n.withCtx(({row:W})=>{var Se;return[((Se=W==null?void 0:W.tags)==null?void 0:Se.length)>0?(n.openBlock(),n.createBlock(_e,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W==null?void 0:W.tags,lr=>(n.openBlock(),n.createBlock($e,{key:lr,onClick:ie[1]||(ie[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(lr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",U1,"-"))]}),actions:n.withCtx(({row:W})=>[n.createVNode(ve,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(X,{"data-testid":"action-entity-copy-id",onClick:lr=>O(W,Se)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(ve,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(X,{"data-testid":"action-entity-copy-json",onClick:lr=>F(W,Se)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canRetrieve(W)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-view","has-divider":"",item:E(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canEdit(W)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-edit",item:q(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Tt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-add-sni",item:P(W.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canDelete(W)},{default:n.withCtx(()=>[n.createVNode(X,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>he(W)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Vf),{"action-pending":D.value,"entity-type":n.unref(Aa).Certificate,error:oe.value,title:n.unref(o)("certificates.delete.title"),visible:U.value,onCancel:Ce,onProceed:ye},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},H1=Hr(L1,[["__scopeId","data-v-412e1ee1"]]),F1={class:"kong-ui-entities-certificates-form"},q1=Hr(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 v;const r=t,i=e,o=Fr.useRouter(),{i18nT:s,i18n:{t:a}}=gt.useI18n(),{getMessageFromError:c}=$f(),{axiosInstance:l}=co({headers:(v=i.config)==null?void 0:v.requestHeaders}),d=n.computed(()=>Ci.form[i.config.app].edit),y=n.computed(()=>i.certificateId?ar.Edit:ar.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),A=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),b=n.computed(()=>(y.value===ar.Create||JSON.stringify(p.fields)!==JSON.stringify(A))&&!!p.fields.cert&&!!p.fields.key),h=C=>{var O;p.fields.cert=(C==null?void 0:C.cert)||"",p.fields.key=(C==null?void 0:C.key)||"",p.fields.certAlt=(C==null?void 0:C.cert_alt)||"",p.fields.keyAlt=(C==null?void 0:C.key_alt)||"",p.fields.tags=((O=C==null?void 0:C.tags)==null?void 0:O.join(", "))||"",Object.assign(A,p.fields)},m=()=>{o.push(i.config.cancelRoute)},k=n.computed(()=>{var O,F;let C=`${i.config.apiBaseUrl}${Ci.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(F=i.config)!=null&&F.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),g=n.computed(()=>{var O,F;let C=`${i.config.apiBaseUrl}${Ci.form[i.config.app][y.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(F=i.config)!=null&&F.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),S=async()=>{var C,O,F,Y,I,E,q,P,K;try{p.isReadonly=!0;const U={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(O=(C=p.fields.tags.split(","))==null?void 0:C.map(oe=>String(oe||"").trim()))==null?void 0:O.filter(oe=>oe!=="")};let D;await l.post(k.value,U),y.value==="create"?D=await l.post(g.value,U):y.value==="edit"&&(D=((F=i.config)==null?void 0:F.app)==="konnect"?await l.put(g.value,U):await l.patch(g.value,U)),p.fields.cert=((Y=D==null?void 0:D.data)==null?void 0:Y.cert)||"",p.fields.key=((I=D==null?void 0:D.data)==null?void 0:I.key)||"",p.fields.certAlt=((E=D==null?void 0:D.data)==null?void 0:E.cert_alt)||"",p.fields.keyAlt=((q=D==null?void 0:D.data)==null?void 0:q.key_alt)||"",p.fields.tags=((K=(P=D==null?void 0:D.data)==null?void 0:P.tags)==null?void 0:K.join(", "))||"",Object.assign(A,p.fields),r("update",D==null?void 0:D.data)}catch(U){p.errorMessage=c(U),r("error",U)}finally{p.isReadonly=!1}};return(C,O)=>{const F=n.resolveComponent("KTextArea"),Y=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",F1,[n.createVNode(n.unref(_f),{"can-submit":b.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":O[5]||(O[5]=I=>C.$emit("error",I)),"onFetch:success":h,onLoading:O[6]||(O[6]=I=>C.$emit("loading",I)),onSubmit:S},{default:n.withCtx(()=>[n.createVNode(n.unref(ao),{description:n.unref(a)("certificates.form.sections.ssl.description"),title:n.unref(a)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(F,{modelValue:p.fields.cert,"onUpdate:modelValue":O[0]||(O[0]=I=>p.fields.cert=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:n.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.key,"onUpdate:modelValue":O[1]||(O[1]=I=>p.fields.key=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:n.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.certAlt,"onUpdate:modelValue":O[2]||(O[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(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":O[3]||(O[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(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(ao),{description:n.unref(a)("certificates.form.sections.general.description"),title:n.unref(a)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(Y,{modelValue:p.fields.tags,"onUpdate:modelValue":O[4]||(O[4]=I=>p.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(a)("certificates.form.fields.tags.help"),label:n.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),[["__scopeId","data-v-f66bc18c"]]),Ni={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"}}},K1={class:"kong-ui-ca-certificate-entity-config-card"},z1={key:0},G1=Hr(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=["dns_names","san_names","subject"],i=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=gt.useI18n(),{convertKeyToTitle:c}=Rf(),{getPropValue:l}=Uf(),{getCertificateData:d}=gt.useCertificate(),y=n.computed(()=>Ni.form[o.config.app].edit),p=n.ref(),A=n.computed(()=>{if(p.value)return d(p.value)}),b=n.computed(()=>{var v;return((v=A.value)==null?void 0:v.schemaIssuer)||""}),h=n.computed(()=>{var v,C;return(v=A.value)!=null&&v.schemaExpiry?a((C=A.value)==null?void 0:C.schemaExpiry):""}),m=n.computed(()=>{var v;return((v=A.value)==null?void 0:v.schemaKeyUsages)||[]}),k=(v,C)=>{const O=l("rowValue",C);if(v==="expiry")return h.value;if(v==="key_usages")return m.value;if(O)return O[v]},g=v=>{p.value=v,i("fetch:success",v)},S=n.ref({id:{},updated_at:{},created_at:{},cert:{section:fe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:fe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:fe.Basic,type:se.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:fe.Basic,order:1.7,forceShow:!0},issuer:{section:fe.Basic,order:1.5,forceShow:!0},key_usages:{section:fe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(v,C)=>{const O=n.resolveComponent("KCodeBlock"),F=n.resolveComponent("KLabel"),Y=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",K1,[n.createVNode(n.unref(Of),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":S.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":C[0]||(C[0]=I=>v.$emit("copy:success",I)),"onFetch:error":C[1]||(C[1]=I=>v.$emit("fetch:error",I)),"onFetch:success":g,onLoading:C[2]||(C[2]=I=>v.$emit("loading",I))},{cert:n.withCtx(I=>[n.unref(l)("rowValue",I)?(n.openBlock(),n.createBlock(O,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",I),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(F,{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(l)("rowValue",I)).filter(E=>!r.includes(E)),E=>(n.openBlock(),n.createBlock(n.unref(Si),{key:E,"data-testid":`ca-cert-metadata-${E}`,item:{key:E,label:n.unref(c)(E),value:k(E,I),type:E==="key_usages"?n.unref(se).BadgeTag:n.unref(se).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),key_usages:n.withCtx(()=>[m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",z1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(I,E)=>(n.openBlock(),n.createBlock(Y,{key:`key_usages-badge-tag-${E}`,class:"config-badge","data-testid":`key_usages-badge-tag-${E}`,tooltip:I,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(I),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),W1={class:"kong-ui-entities-ca-certificates-list"},J1={key:0},Y1={key:1},Z1={key:0},Q1={key:1},X1={key:1},eb=Hr(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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var it;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),c=Fr.useRouter(),{axiosInstance:l}=co({headers:(it=i.config)==null?void 0:it.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),A={issuer:{label:o("ca-certificates.list.table_headers.issuer")},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},b=n.computed(()=>{var Q,M;let Z=`${i.config.apiBaseUrl}${Ni.list[i.config.app]}`;return i.config.app==="konnect"?Z=Z.replace(/{controlPlaneId}/gi,((Q=i.config)==null?void 0:Q.controlPlaneId)||""):i.config.app==="kongManager"&&(Z=Z.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),Z}),h=n.ref(""),m=n.computed(()=>{const Z=i.config.app==="konnect"||i.config.isExactMatch;return Z?{isExactMatch:Z,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:Z,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:g}=Mf(i.config,b.value),S=()=>{h.value=""},v=()=>{d.value++},C=n.ref(null),O=(Z,Q)=>{const M=Z.id;if(!Q(M)){r("copy:error",{entity:Z,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:Z,field:"id",message:o("ca-certificates.copy.success",{val:M})})},F=(Z,Q)=>{const M=JSON.stringify(Z);if(!Q(M)){r("copy:error",{entity:Z,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:Z,message:o("ca-certificates.copy.success_brief")})},Y=async Z=>{var M;await((M=i.canRetrieve)==null?void 0:M.call(i,Z))&&c.push(i.config.getViewRoute(Z.id))},I=Z=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(Z)}),E=Z=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(Z)}),q=n.ref(void 0),P=n.ref(!1),K=n.ref(!1),U=n.ref(""),D=Pf(i.config,b.value),{certificateDataCache:oe,getCertificateData:de}=gt.useCertificate(),we=Z=>{q.value=Z,P.value=!0},pe=()=>{P.value=!1},he=async()=>{var Z,Q,M;if((Z=q.value)!=null&&Z.id){K.value=!0;try{await l.delete(D(q.value.id)),K.value=!1,P.value=!1,d.value++,r("delete:success",q.value)}catch(ie){U.value=((M=(Q=ie.response)==null?void 0:Q.data)==null?void 0:M.message)||ie.message||o("ca-certificates.errors.delete"),r("error",ie)}finally{K.value=!1}}},Ce=n.ref(!0);n.watch(g,Z=>{var Q,M,ie,me;if(Array.isArray((Q=Z==null?void 0:Z.response)==null?void 0:Q.data)&&(Ce.value=Z.response.data.length>0),Z.status===Rt.Error){C.value={title:o("ca-certificates.errors.general")},(me=(ie=(M=Z.error)==null?void 0:M.response)==null?void 0:ie.data)!=null&&me.message&&(C.value.message=Z.error.response.data.message),r("error",Z.error);return}oe.value={},C.value=null});const ye=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("ca-certificates.list.empty_state.description"),title:o("ca-certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(ye.value.title=o("ca-certificates.list.empty_state.title"),ye.value.ctaText=o("ca-certificates.actions.create"))}),(Z,Q)=>{const M=n.resolveComponent("KButton"),ie=n.resolveComponent("KBadge"),me=n.resolveComponent("KTruncate"),$e=n.resolveComponent("KDropdownItem"),_e=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",W1,[n.createVNode(n.unref(Tf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ye.value,"enable-entity-actions":"","error-message":C.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(A),"use-action-outside":e.useActionOutside,onClearSearchInput:S,"onClick:row":Q[2]||(Q[2]=X=>Y(X)),onSort:v},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Df),{modelValue:h.value,"onUpdate:modelValue":Q[0]||(Q[0]=X=>h.value=X),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[n.createVNode(n.unref(Tt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(M,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,Ce.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:n.withCtx(({row:X})=>{var ve;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",J1,n.toDisplayString((ve=X==null?void 0:X.metadata)!=null&&ve.issuer?X.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",Y1,n.toDisplayString(n.unref(de)(X).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:X})=>{var ve;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",Z1,n.toDisplayString((ve=X==null?void 0:X.metadata)!=null&&ve.expiry?n.unref(s)(X.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",Q1,n.toDisplayString(n.unref(de)(X).schemaExpiry?n.unref(s)(n.unref(de)(X).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:X})=>{var ve;return[((ve=X==null?void 0:X.tags)==null?void 0:ve.length)>0?(n.openBlock(),n.createBlock(me,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(X==null?void 0:X.tags,W=>(n.openBlock(),n.createBlock(ie,{key:W,onClick:Q[1]||(Q[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(W),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",X1,"-"))]}),actions:n.withCtx(({row:X})=>[n.createVNode(_e,null,{default:n.withCtx(({copyToClipboard:ve})=>[n.createVNode($e,{"data-testid":"action-entity-copy-id",onClick:W=>O(X,ve)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(_e,null,{default:n.withCtx(({copyToClipboard:ve})=>[n.createVNode($e,{"data-testid":"action-entity-copy-json",onClick:W=>F(X,ve)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canRetrieve(X)},{default:n.withCtx(()=>[n.createVNode($e,{"data-testid":"action-entity-view","has-divider":"",item:I(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canEdit(X)},{default:n.withCtx(()=>[n.createVNode($e,{"data-testid":"action-entity-edit",item:E(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canDelete(X)},{default:n.withCtx(()=>[n.createVNode($e,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ve=>we(X)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Vf),{"action-pending":K.value,"entity-type":n.unref(Aa).CACertificate,error:U.value,title:n.unref(o)("ca-certificates.delete.title"),visible:P.value,onCancel:pe,onProceed:he},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-067baf74"]]),tb={class:"kong-ui-entities-ca-certificates-form"},rb=Hr(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 S;const r=t,i=e,o=Fr.useRouter(),{i18n:{t:s}}=gt.useI18n(),{getMessageFromError:a}=$f(),{axiosInstance:c}=co({headers:(S=i.config)==null?void 0:S.requestHeaders}),l=n.computed(()=>Ni.form[i.config.app].edit),d=n.computed(()=>i.certificateId?ar.Edit:ar.Create),y=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),A=n.computed(()=>(d.value===ar.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),b=v=>{var C;y.fields.cert=(v==null?void 0:v.cert)||"",y.fields.certDigest=(v==null?void 0:v.cert_digest)||"",y.fields.tags=((C=v==null?void 0:v.tags)==null?void 0:C.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},m=n.computed(()=>{var C,O;let v=`${i.config.apiBaseUrl}${Ni.form[i.config.app].validate}`;return i.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),v=v.replace(/{id}/gi,i.certificateId),v}),k=n.computed(()=>{var C,O;let v=`${i.config.apiBaseUrl}${Ni.form[i.config.app][d.value]}`;return i.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),v=v.replace(/{id}/gi,i.certificateId),v}),g=async()=>{var v,C,O,F,Y,I,E;try{y.isReadonly=!0;const q={cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(C=(v=y.fields.tags.split(","))==null?void 0:v.map(K=>String(K||"").trim()))==null?void 0:C.filter(K=>K!=="")};let P;await c.post(m.value,q),d.value==="create"?P=await c.post(k.value,q):d.value==="edit"&&(P=((O=i.config)==null?void 0:O.app)==="konnect"?await c.put(k.value,q):await c.patch(k.value,q)),y.fields.cert=((F=P==null?void 0:P.data)==null?void 0:F.cert)||"",y.fields.certDigest=((Y=P==null?void 0:P.data)==null?void 0:Y.cert_digest)||"",y.fields.tags=((E=(I=P==null?void 0:P.data)==null?void 0:I.tags)==null?void 0:E.join(", "))||"",Object.assign(p,y.fields),r("update",P==null?void 0:P.data)}catch(q){y.errorMessage=a(q),r("error",q)}finally{y.isReadonly=!1}};return(v,C)=>{const O=n.resolveComponent("KTextArea"),F=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",tb,[n.createVNode(n.unref(_f),{"can-submit":A.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":C[3]||(C[3]=Y=>v.$emit("error",Y)),"onFetch:success":b,onLoading:C[4]||(C[4]=Y=>v.$emit("loading",Y)),onSubmit:g},{default:n.withCtx(()=>[n.createVNode(n.unref(ao),{description:n.unref(s)("ca-certificates.form.sections.cert.description"),title:n.unref(s)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=Y=>y.fields.cert=Y),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:n.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(F,{modelValue:y.fields.certDigest,"onUpdate:modelValue":C[1]||(C[1]=Y=>y.fields.certDigest=Y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(ao),{description:n.unref(s)("ca-certificates.form.sections.general.description"),title:n.unref(s)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(F,{modelValue:y.fields.tags,"onUpdate:modelValue":C[2]||(C[2]=Y=>y.fields.tags=Y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(s)("ca-certificates.form.fields.tags.help"),label:n.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),[["__scopeId","data-v-bad536b1"]]),ib={class:"kong-ui-certificate-entity-config-card"},nb={key:0},ob=Hr(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=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),{convertKeyToTitle:c}=Rf(),{getPropValue:l}=Uf(),{getCertificateData:d}=gt.useCertificate(),y=n.computed(()=>Ci.form[i.config.app].edit),p=n.ref(),A=n.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:se.Redacted},metadata:{section:fe.Basic,type:se.Json},snis:{section:fe.Basic,type:se.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:fe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:fe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:fe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:fe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:fe.Advanced},key_alt:{section:fe.Advanced,type:se.Redacted}}),b=I=>{p.value=I,r("fetch:success",I)},h=(I,E)=>{const q=l("rowValue",E);if(I==="expiry")return k.value;if(I==="key_usages")return C.value;if(I==="san_names")return S.value;if(q)return q[I]},m=n.computed(()=>{if(p.value)return d(p.value)}),k=n.computed(()=>{var I,E;return(I=m.value)!=null&&I.schemaExpiry?s((E=m.value)==null?void 0:E.schemaExpiry):""}),g=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaIssuer)||""}),S=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaSanNames)||""}),v=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaSubject)||""}),C=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaKeyUsages)||[]}),O=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}),F=n.computed(()=>{var I;return!!((I=p==null?void 0:p.value)!=null&&I.cert_alt)}),Y=I=>{var E,q;return I==="san_names"?o("certificates.list.table_headers.san"):((q=(E=A.value)==null?void 0:E[I])==null?void 0:q.label)||c(I)};return(I,E)=>{const q=n.resolveComponent("KCodeBlock"),P=n.resolveComponent("KLabel"),K=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",ib,[n.createVNode(n.unref(Of),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":A.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":E[0]||(E[0]=U=>I.$emit("copy:success",U)),"onFetch:error":E[1]||(E[1]=U=>I.$emit("fetch:error",U)),"onFetch:success":b,onLoading:E[2]||(E[2]=U=>I.$emit("loading",U))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(U=>[n.unref(l)("rowValue",U)?(n.openBlock(),n.createBlock(q,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",U),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(P,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(U=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",U)),D=>(n.openBlock(),n.createBlock(n.unref(Si),{key:D,item:{key:D,value:h(D,U),label:Y(D),type:D==="key_usages"||D==="snis"||D==="dns_names"?n.unref(se).BadgeTag:n.unref(se).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(S.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[C.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",nb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value,(U,D)=>(n.openBlock(),n.createBlock(K,{key:`key_usages-badge-tag-${D}`,class:"config-badge","data-testid":`key_usages-badge-tag-${D}`,tooltip:U,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(U),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[O.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},F.value?{name:"cert_alt",fn:n.withCtx(U=>[n.createTextVNode(" > "),n.unref(l)("rowValue",U)?(n.openBlock(),n.createBlock(q,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(l)("rowValue",U),"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"])])}}}),[["__scopeId","data-v-920043bf"]]);Ve.CACertificateConfigCard=G1,Ve.CACertificateForm=rb,Ve.CACertificateList=eb,Ve.CertificateConfigCard=ob,Ve.CertificateForm=q1,Ve.CertificateList=H1,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});