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

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(_e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],n):(_e=typeof globalThis<"u"?globalThis:_e||self,n(_e["kong-ui-public-entities-certificates"]={},_e.Vue,_e.VueRouter,_e["kong-ui-public-i18n"],_e.axios,_e.Kongponents))})(this,function(_e,n,Hr,cr,qf,Kf){"use strict";var co=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,Kf,qf){"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 co=="object"?co: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 Fa(Object.create(null))}:c?function(){return Fa({__proto__:null})}:function(){return Fa({})},has:l?function(S,B){return r.call(S,B)}:function(S,B){return B in S},get:l?function(S,B){return r.call(S,B)?S[B]:void 0}:function(S,B){return S[B]}},p=Object.getPrototypeOf(Function),y=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",x=!y&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ub(),C=!y&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:db(),h=!y&&typeof WeakMap=="function"?WeakMap:fb(),g=new h;function m(S,B,O,j){if(pe(O)){if(!Ae(S))throw new TypeError;if(!we(B))throw new TypeError;return q(S,B)}else{if(!Ae(S))throw new TypeError;if(!T(B))throw new TypeError;if(!T(j)&&!pe(j)&&!G(j))throw new TypeError;return G(j)&&(j=void 0),O=Y(O),U(S,B,O,j)}}t("decorate",m);function v(S,B){function O(j,W){if(!T(j))throw new TypeError;if(!pe(W)&&!Lr(W))throw new TypeError;de(S,B,j,W)}return O}t("metadata",v);function b(S,B,O,j){if(!T(O))throw new TypeError;return pe(j)||(j=Y(j)),de(S,B,O,j)}t("defineMetadata",b);function w(S,B,O){if(!T(B))throw new TypeError;return pe(O)||(O=Y(O)),V(S,B,O)}t("hasMetadata",w);function A(S,B,O){if(!T(B))throw new TypeError;return pe(O)||(O=Y(O)),te(S,B,O)}t("hasOwnMetadata",A);function F(S,B,O){if(!T(B))throw new TypeError;return pe(O)||(O=Y(O)),le(S,B,O)}t("getMetadata",F);function Z(S,B,O){if(!T(B))throw new TypeError;return pe(O)||(O=Y(O)),be(S,B,O)}t("getOwnMetadata",Z);function I(S,B){if(!T(S))throw new TypeError;return pe(B)||(B=Y(B)),fe(S,B)}t("getMetadataKeys",I);function E(S,B){if(!T(S))throw new TypeError;return pe(B)||(B=Y(B)),ke(S,B)}t("getOwnMetadataKeys",E);function M(S,B,O){if(!T(B))throw new TypeError;pe(O)||(O=Y(O));var j=$(B,O,!1);if(pe(j)||!j.delete(S))return!1;if(j.size>0)return!0;var W=g.get(B);return W.delete(O),W.size>0||g.delete(B),!0}t("deleteMetadata",M);function q(S,B){for(var O=S.length-1;O>=0;--O){var j=S[O],W=j(B);if(!pe(W)&&!G(W)){if(!we(W))throw new TypeError;B=W}}return B}function U(S,B,O,j){for(var W=S.length-1;W>=0;--W){var Oe=S[W],X=Oe(B,O,j);if(!pe(X)&&!G(X)){if(!T(X))throw new TypeError;j=X}}return j}function $(S,B,O){var j=g.get(S);if(pe(j)){if(!O)return;j=new x,g.set(S,j)}var W=j.get(B);if(pe(W)){if(!O)return;W=new x,j.set(B,W)}return W}function V(S,B,O){var j=te(S,B,O);if(j)return!0;var W=Ha(B);return G(W)?!1:V(S,W,O)}function te(S,B,O){var j=$(B,O,!1);return pe(j)?!1:De(j.has(S))}function le(S,B,O){var j=te(S,B,O);if(j)return be(S,B,O);var W=Ha(B);if(!G(W))return le(S,W,O)}function be(S,B,O){var j=$(B,O,!1);if(!pe(j))return j.get(S)}function de(S,B,O,j){var W=$(O,j,!0);W.set(S,B)}function fe(S,B){var O=ke(S,B),j=Ha(S);if(j===null)return O;var W=fe(j,B);if(W.length<=0)return O;if(O.length<=0)return W;for(var Oe=new C,X=[],ee=0,J=O;ee<J.length;ee++){var oe=J[ee],se=Oe.has(oe);se||(Oe.add(oe),X.push(oe))}for(var Lt=0,Lf=W;Lt<Lf.length;Lt++){var oe=Lf[Lt],se=Oe.has(oe);se||(Oe.add(oe),X.push(oe))}return X}function ke(S,B){var O=[],j=$(S,B,!1);if(pe(j))return O;for(var W=j.keys(),Oe=sb(W),X=0;;){var ee=cb(Oe);if(!ee)return O.length=X,O;var J=ab(ee);try{O[X]=J}catch(oe){try{lb(Oe)}finally{throw oe}}X++}}function Ut(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function pe(S){return S===void 0}function G(S){return S===null}function he(S){return typeof S=="symbol"}function T(S){return typeof S=="object"?S!==null:typeof S=="function"}function re(S,B){switch(Ut(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var O=B===3?"string":B===5?"number":"default",j=Uf(S,o);if(j!==void 0){var W=j.call(S,O);if(T(W))throw new TypeError;return W}return ye(S,O==="default"?"number":O)}function ye(S,B){if(B==="string"){var O=S.toString;if(K(O)){var j=O.call(S);if(!T(j))return j}var W=S.valueOf;if(K(W)){var j=W.call(S);if(!T(j))return j}}else{var W=S.valueOf;if(K(W)){var j=W.call(S);if(!T(j))return j}var Oe=S.toString;if(K(Oe)){var j=Oe.call(S);if(!T(j))return j}}throw new TypeError}function De(S){return!!S}function Ot(S){return""+S}function Y(S){var B=re(S,3);return he(B)?B:Ot(B)}function Ae(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function K(S){return typeof S=="function"}function we(S){return typeof S=="function"}function Lr(S){switch(Ut(S)){case 3:return!0;case 4:return!0;default:return!1}}function Uf(S,B){var O=S[B];if(O!=null){if(!K(O))throw new TypeError;return O}}function sb(S){var B=Uf(S,s);if(!K(B))throw new TypeError;var O=B.call(S);if(!T(O))throw new TypeError;return O}function ab(S){return S.value}function cb(S){var B=S.next();return B.done?!1:B}function lb(S){var B=S.return;B&&B.call(S)}function Ha(S){var B=Object.getPrototypeOf(S);if(typeof S!="function"||S===p||B!==p)return B;var O=S.prototype,j=O&&Object.getPrototypeOf(O);if(j==null||j===Object.prototype)return B;var W=j.constructor;return typeof W!="function"||W===S?B:W}function ub(){var S={},B=[],O=function(){function X(ee,J,oe){this._index=0,this._keys=ee,this._values=J,this._selector=oe}return X.prototype["@@iterator"]=function(){return this},X.prototype[s]=function(){return this},X.prototype.next=function(){var ee=this._index;if(ee>=0&&ee<this._keys.length){var J=this._selector(this._keys[ee],this._values[ee]);return ee+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}},X.prototype.throw=function(ee){throw this._index>=0&&(this._index=-1,this._keys=B,this._values=B),ee},X.prototype.return=function(ee){return this._index>=0&&(this._index=-1,this._keys=B,this._values=B),{value:ee,done:!0}},X}();return function(){function X(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(X.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),X.prototype.has=function(ee){return this._find(ee,!1)>=0},X.prototype.get=function(ee){var J=this._find(ee,!1);return J>=0?this._values[J]:void 0},X.prototype.set=function(ee,J){var oe=this._find(ee,!0);return this._values[oe]=J,this},X.prototype.delete=function(ee){var J=this._find(ee,!1);if(J>=0){for(var oe=this._keys.length,se=J+1;se<oe;se++)this._keys[se-1]=this._keys[se],this._values[se-1]=this._values[se];return this._keys.length--,this._values.length--,ee===this._cacheKey&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},X.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},X.prototype.keys=function(){return new O(this._keys,this._values,j)},X.prototype.values=function(){return new O(this._keys,this._values,W)},X.prototype.entries=function(){return new O(this._keys,this._values,Oe)},X.prototype["@@iterator"]=function(){return this.entries()},X.prototype[s]=function(){return this.entries()},X.prototype._find=function(ee,J){return this._cacheKey!==ee&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=ee)),this._cacheIndex<0&&J&&(this._cacheIndex=this._keys.length,this._keys.push(ee),this._values.push(void 0)),this._cacheIndex},X}();function j(X,ee){return X}function W(X,ee){return ee}function Oe(X,ee){return[X,ee]}}function db(){return function(){function S(){this._map=new x}return Object.defineProperty(S.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),S.prototype.has=function(B){return this._map.has(B)},S.prototype.add=function(B){return this._map.set(B,B),this},S.prototype.delete=function(B){return this._map.delete(B)},S.prototype.clear=function(){this._map.clear()},S.prototype.keys=function(){return this._map.keys()},S.prototype.values=function(){return this._map.values()},S.prototype.entries=function(){return this._map.entries()},S.prototype["@@iterator"]=function(){return this.keys()},S.prototype[s]=function(){return this.keys()},S}()}function fb(){var S=16,B=d.create(),O=j();return function(){function J(){this._key=j()}return J.prototype.has=function(oe){var se=W(oe,!1);return se!==void 0?d.has(se,this._key):!1},J.prototype.get=function(oe){var se=W(oe,!1);return se!==void 0?d.get(se,this._key):void 0},J.prototype.set=function(oe,se){var Lt=W(oe,!0);return Lt[this._key]=se,this},J.prototype.delete=function(oe){var se=W(oe,!1);return se!==void 0?delete se[this._key]:!1},J.prototype.clear=function(){this._key=j()},J}();function j(){var J;do J="@@WeakMap@@"+ee();while(d.has(B,J));return B[J]=!0,J}function W(J,oe){if(!r.call(J,O)){if(!oe)return;Object.defineProperty(J,O,{value:d.create()})}return J[O]}function Oe(J,oe){for(var se=0;se<oe;++se)J[se]=Math.random()*255|0;return J}function X(J){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(J)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(J)):Oe(new Uint8Array(J),J):Oe(new Array(J),J)}function ee(){var J=X(S);J[6]=J[6]&79|64,J[8]=J[8]&191|128;for(var oe="",se=0;se<S;++se){var Lt=J[se];(se===4||se===6||se===8)&&(oe+="-"),Lt<16&&(oe+="0"),oe+=Lt.toString(16).toLowerCase()}return oe}}function Fa(S){return S.__=void 0,delete S.__,S}})})(qa||(qa={}));/*!
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={}));/*!
15
15
  * MIT License
16
16
  *
17
17
  * Copyright (c) 2017-2022 Peculiar Ventures, LLC
@@ -34,9 +34,9 @@
34
34
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
35
  * SOFTWARE.
36
36
  *
37
- */const zf="[object ArrayBuffer]";class D{static isArrayBuffer(t){return Object.prototype.toString.call(t)===zf}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength||t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t.buffer).slice(t.byteOffset,t.byteOffset+t.byteLength).buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const i=D.toUint8Array(t),o=D.toUint8Array(r);if(i.length!==o.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==o[s])return!1;return!0}static concat(...t){let r;Array.isArray(t[0])&&!(t[1]instanceof Function)||Array.isArray(t[0])&&t[1]instanceof Function?r=t[0]:t[t.length-1]instanceof Function?r=t.slice(0,t.length-1):r=t;let i=0;for(const a of r)i+=a.byteLength;const o=new Uint8Array(i);let s=0;for(const a of r){const c=this.toUint8Array(a);o.set(c,s),s+=c.length}return t[t.length-1]instanceof Function?this.toView(o,t[t.length-1]):o.buffer}}const lo="string",Wf=/^[0-9a-f]+$/i,Gf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Jf=/^[a-zA-Z0-9-_]+$/;class Ka{static fromString(t){const r=unescape(encodeURIComponent(t)),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i.buffer}static toString(t){const r=D.toUint8Array(t);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class at{static toString(t,r=!1){const i=D.toArrayBuffer(t),o=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const c=o.getUint16(a,r);s+=String.fromCharCode(c)}return s}static fromString(t,r=!1){const i=new ArrayBuffer(t.length*2),o=new DataView(i);for(let s=0;s<t.length;s++)o.setUint16(s*2,t.charCodeAt(s),r);return i}}class R{static isHex(t){return typeof t===lo&&Wf.test(t)}static isBase64(t){return typeof t===lo&&Gf.test(t)}static isBase64Url(t){return typeof t===lo&&Jf.test(t)}static ToString(t,r="utf8"){const i=D.toUint8Array(t);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return at.toString(i,!0);case"utf16":case"utf16be":return at.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(t,r="utf8"){if(!t)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(t);case"binary":return this.FromBinary(t);case"hex":return this.FromHex(t);case"base64":return this.FromBase64(t);case"base64url":return this.FromBase64Url(t);case"utf16le":return at.fromString(t,!0);case"utf16":case"utf16be":return at.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=D.toUint8Array(t);if(typeof btoa<"u"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=R.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return Ka.fromString(t);case"utf16":case"utf16be":return at.fromString(t);case"utf16le":case"usc2":return at.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=R.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return Ka.toString(t);case"utf16":case"utf16be":return at.toString(t);case"utf16le":case"usc2":return at.toString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(t){const r=t.length,i=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);return i.buffer}static ToBinary(t){const r=D.toUint8Array(t);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(t){const r=D.toUint8Array(t);let i="";const o=r.length;for(let s=0;s<o;s++){const a=r[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const s=r.slice(o,o+2);i[o/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(t,r=!1){return at.toString(t,r)}static FromUtf16String(t,r=!1){return at.fromString(t,r)}static Base64Padding(t){const r=4-t.length%4;if(r<4)for(let i=0;i<r;i++)t+="=";return t}static formatString(t){return(t==null?void 0:t.replace(/[\n\r\t ]/g,""))||""}}R.DEFAULT_UTF8_ENCODING="utf8";function Yf(...e){const t=e.map(o=>o.byteLength).reduce((o,s)=>o+s),r=new Uint8Array(t);let i=0;return e.map(o=>new Uint8Array(o)).forEach(o=>{for(const s of o)r[i++]=s}),r.buffer}function za(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}/*!
37
+ */const zf="[object ArrayBuffer]";class j{static isArrayBuffer(t){return Object.prototype.toString.call(t)===zf}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength||t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t.buffer).slice(t.byteOffset,t.byteOffset+t.byteLength).buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const i=j.toUint8Array(t),o=j.toUint8Array(r);if(i.length!==o.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==o[s])return!1;return!0}static concat(...t){let r;Array.isArray(t[0])&&!(t[1]instanceof Function)||Array.isArray(t[0])&&t[1]instanceof Function?r=t[0]:t[t.length-1]instanceof Function?r=t.slice(0,t.length-1):r=t;let i=0;for(const a of r)i+=a.byteLength;const o=new Uint8Array(i);let s=0;for(const a of r){const c=this.toUint8Array(a);o.set(c,s),s+=c.length}return t[t.length-1]instanceof Function?this.toView(o,t[t.length-1]):o.buffer}}const uo="string",Gf=/^[0-9a-f]+$/i,Wf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Jf=/^[a-zA-Z0-9-_]+$/;class za{static fromString(t){const r=unescape(encodeURIComponent(t)),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i.buffer}static toString(t){const r=j.toUint8Array(t);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class ut{static toString(t,r=!1){const i=j.toArrayBuffer(t),o=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const c=o.getUint16(a,r);s+=String.fromCharCode(c)}return s}static fromString(t,r=!1){const i=new ArrayBuffer(t.length*2),o=new DataView(i);for(let s=0;s<t.length;s++)o.setUint16(s*2,t.charCodeAt(s),r);return i}}class R{static isHex(t){return typeof t===uo&&Gf.test(t)}static isBase64(t){return typeof t===uo&&Wf.test(t)}static isBase64Url(t){return typeof t===uo&&Jf.test(t)}static ToString(t,r="utf8"){const i=j.toUint8Array(t);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return ut.toString(i,!0);case"utf16":case"utf16be":return ut.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(t,r="utf8"){if(!t)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(t);case"binary":return this.FromBinary(t);case"hex":return this.FromHex(t);case"base64":return this.FromBase64(t);case"base64url":return this.FromBase64Url(t);case"utf16le":return ut.fromString(t,!0);case"utf16":case"utf16be":return ut.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=j.toUint8Array(t);if(typeof btoa<"u"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=R.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return za.fromString(t);case"utf16":case"utf16be":return ut.fromString(t);case"utf16le":case"usc2":return ut.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=R.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return za.toString(t);case"utf16":case"utf16be":return ut.toString(t);case"utf16le":case"usc2":return ut.toString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(t){const r=t.length,i=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);return i.buffer}static ToBinary(t){const r=j.toUint8Array(t);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(t){const r=j.toUint8Array(t);let i="";const o=r.length;for(let s=0;s<o;s++){const a=r[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!R.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const s=r.slice(o,o+2);i[o/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(t,r=!1){return ut.toString(t,r)}static FromUtf16String(t,r=!1){return ut.fromString(t,r)}static Base64Padding(t){const r=4-t.length%4;if(r<4)for(let i=0;i<r;i++)t+="=";return t}static formatString(t){return(t==null?void 0:t.replace(/[\n\r\t ]/g,""))||""}}R.DEFAULT_UTF8_ENCODING="utf8";function Yf(...e){const t=e.map(o=>o.byteLength).reduce((o,s)=>o+s),r=new Uint8Array(t);let i=0;return e.map(o=>new Uint8Array(o)).forEach(o=>{for(const s of o)r[i++]=s}),r.buffer}function Ga(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}/*!
38
38
  Copyright (c) Peculiar Ventures, LLC
39
- */function lr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function Ht(e,t,r=-1){const i=r;let o=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(i<0)l=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);l=new ArrayBuffer(i),s=i}const d=new Uint8Array(l);for(let p=c-1;p>=0;p--){const y=Math.pow(2,p*t);d[s-p-1]=Math.floor(o/y),o-=d[s-p-1]*y}return l}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function uo(...e){let t=0,r=0;for(const s of e)t+=s.length;const i=new ArrayBuffer(t),o=new Uint8Array(i);for(const s of e)o.set(s,r),r+=s.length;return o}function Wa(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=e[0]===255&&e[1]&128,l=e[0]===0&&(e[1]&128)===0;(c||l)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let c=0;c<this.valueHex.byteLength;c++)r[c]=0;r[0]=e[0]&128;const i=lr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=e[c];return s[0]&=127,lr(s,8)-i}function Zf(e){const t=e<0?e*-1:e;let r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){const a=r-t,c=Ht(a,8,i),l=new Uint8Array(c);return l[0]|=128,c}let o=Ht(t,8,i),s=new Uint8Array(o);if(s[0]&128){const a=o.slice(0),c=new Uint8Array(a);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let l=0;l<a.byteLength;l++)s[l+1]=c[l];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function Qf(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function ze(e,t){const r=e.toString(10);if(t<r.length)return"";const i=t-r.length,o=new Array(i);for(let a=0;a<i;a++)o[a]="0";return o.join("").concat(r)}/*!
39
+ */function dr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function Ft(e,t,r=-1){const i=r;let o=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(i<0)l=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);l=new ArrayBuffer(i),s=i}const d=new Uint8Array(l);for(let y=c-1;y>=0;y--){const p=Math.pow(2,y*t);d[s-y-1]=Math.floor(o/p),o-=d[s-y-1]*p}return l}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function fo(...e){let t=0,r=0;for(const s of e)t+=s.length;const i=new ArrayBuffer(t),o=new Uint8Array(i);for(const s of e)o.set(s,r),r+=s.length;return o}function Wa(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=e[0]===255&&e[1]&128,l=e[0]===0&&(e[1]&128)===0;(c||l)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let c=0;c<this.valueHex.byteLength;c++)r[c]=0;r[0]=e[0]&128;const i=dr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=e[c];return s[0]&=127,dr(s,8)-i}function Zf(e){const t=e<0?e*-1:e;let r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){const a=r-t,c=Ft(a,8,i),l=new Uint8Array(c);return l[0]|=128,c}let o=Ft(t,8,i),s=new Uint8Array(o);if(s[0]&128){const a=o.slice(0),c=new Uint8Array(a);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let l=0;l<a.byteLength;l++)s[l+1]=c[l];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function Qf(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function We(e,t){const r=e.toString(10);if(t<r.length)return"";const i=t-r.length,o=new Array(i);for(let a=0;a<i;a++)o[a]="0";return o.join("").concat(r)}/*!
40
40
  * Copyright (c) 2014, GMO GlobalSign
41
41
  * Copyright (c) 2015-2022, Peculiar Ventures
42
42
  * All rights reserved.
@@ -68,11 +68,11 @@
68
68
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
69
69
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
70
70
  *
71
- */function Ni(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function fo(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 gt(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 Oi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return fo(this.items)}}const Fr=[new Uint8Array([1])],Ga="0123456789",po="name",Ja="valueHexView",Xf="isHexOnly",ep="idBlock",tp="tagClass",rp="tagNumber",ip="isConstructed",np="fromBER",op="toBER",sp="local",Re="",tt=new ArrayBuffer(0),_i=new Uint8Array(0),qr="EndOfContent",Ya="OCTET STRING",Za="BIT STRING";function ct(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?D.toUint8Array(s.valueHex):_i}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,o,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!gt(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",tt)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:R.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Ft{constructor({blockLength:t=0,error:r=Re,warnings:i=[],valueBeforeDecode:o=_i}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=D.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)}}}Ft.NAME="baseBlock";class $e extends Ft{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'")}}$e.NAME="valueBlock";class Qa extends ct(Ft){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?D.toUint8Array(t.valueHex):_i,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=t.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",tt}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=Ht(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=D.toUint8Array(t);if(!gt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),p=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===p){p+=255;const x=new Uint8Array(p);for(let C=0;C<d.length;C++)x[C]=d[C];d=this.valueHexView=new Uint8Array(p)}}this.blockLength=l+1,d[l-1]=s[l]&127;const y=new Uint8Array(l);for(let x=0;x<l;x++)y[x]=d[x];d=this.valueHexView=new Uint8Array(l),d.set(y),this.blockLength<=9?this.tagNumber=lr(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}}}Qa.NAME="identificationBlock";class Xa extends Ft{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=D.toUint8Array(t);if(!gt(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=lr(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=Ht(this.length,8);if(o.byteLength>127)return this.error="Too big length",tt;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}}}Xa.NAME="lengthBlock";const P={};class Ie extends Ft{constructor({name:t=Re,optional:r=!1,primitiveSchema:i,...o}={},s){super(o),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new Qa(o),this.lenBlock=new Xa(o),this.valueBlock=s?new s(o):new $e(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 Oi;r||ec(this);const o=this.idBlock.toBER(t);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?tt: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)}}Ie.NAME="BaseBlock";function ec(e){if(e instanceof P.Constructed)for(const t of e.valueBlock.value)ec(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class ho extends Ie{constructor({value:t=Re,...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}'`}}ho.NAME="BaseStringBlock";class tc extends ct($e){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}tc.NAME="PrimitiveValueBlock";var rc;class Kr extends Ie{constructor(t={}){super(t,tc),this.idBlock.isConstructed=!1}}rc=Kr,P.Primitive=rc,Kr.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 ur(e,t=0,r=e.length){const i=t;let o=new Ie({},$e);const s=new Ft;if(!gt(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=Ie;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};l=P.EndOfContent;break;case 1:l=P.Boolean;break;case 2:l=P.Integer;break;case 3:l=P.BitString;break;case 4:l=P.OctetString;break;case 5:l=P.Null;break;case 6:l=P.ObjectIdentifier;break;case 10:l=P.Enumerated;break;case 12:l=P.Utf8String;break;case 13:l=P.RelativeObjectIdentifier;break;case 14:l=P.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=P.Sequence;break;case 17:l=P.Set;break;case 18:l=P.NumericString;break;case 19:l=P.PrintableString;break;case 20:l=P.TeletexString;break;case 21:l=P.VideotexString;break;case 22:l=P.IA5String;break;case 23:l=P.UTCTime;break;case 24:l=P.GeneralizedTime;break;case 25:l=P.GraphicString;break;case 26:l=P.VisibleString;break;case 27:l=P.GeneralString;break;case 28:l=P.UniversalString;break;case 29:l=P.CharacterString;break;case 30:l=P.BmpString;break;case 31:l=P.DATE;break;case 32:l=P.TimeOfDay;break;case 33:l=P.DateTime;break;case 34:l=P.Duration;break;default:{const d=o.idBlock.isConstructed?new P.Constructed:new P.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:l=o.idBlock.isConstructed?P.Constructed:P.Primitive}return o=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 dr(e){if(!e.byteLength){const t=new Ie({},$e);return t.error="Input buffer has zero length",{offset:-1,result:t}}return ur(D.toUint8Array(e).slice(),0,e.byteLength)}function cp(e,t){return e?1:t}class _t extends $e{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=D.toUint8Array(t);if(!gt(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=ur(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 Oi;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?tt:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}_t.NAME="ConstructedValueBlock";var ic;class Ue extends Ie{constructor(t={}){super(t,_t),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 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(`
72
72
  `).map(o=>` ${o}`).join(`
73
73
  `));const r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${r} :
74
74
  ${t.join(`
75
- `)}`:`${r} :`}}ic=Ue,P.Constructed=ic,Ue.NAME="CONSTRUCTED";class nc extends $e{fromBER(t,r,i){return r}toBER(t){return tt}}nc.override="EndOfContentValueBlock";var oc;class yo extends Ie{constructor(t={}){super(t,nc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}oc=yo,P.EndOfContent=oc,yo.NAME=qr;var sc;class qt extends Ie{constructor(t={}){super(t,$e),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}sc=qt,P.Null=sc,qt.NAME="NULL";class ac extends ct($e){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=D.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=D.toUint8Array(t);return gt(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Wa.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}ac.NAME="BooleanValueBlock";var cc;let Ti=class extends Ie{constructor(t={}){super(t,ac),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};cc=Ti,P.Boolean=cc,Ti.NAME="BOOLEAN";class lc extends ct(_t){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=_t.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!==Ya)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,i),this.blockLength=i;return o}toBER(t,r){return this.isConstructed?_t.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}lc.NAME="OctetStringValueBlock";var uc;let Kt=class Hf extends Ie{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},lc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=ur(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?Ue.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 D.concat(t)}};uc=Kt,P.OctetString=uc,Kt.NAME=Ya;class dc extends ct(_t){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=_t.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!==Za)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return o}const s=D.toUint8Array(t);if(!gt(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=ur(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 _t.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return tt;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}dc.NAME="BitStringValueBlock";var fc;let zt=class extends Ie{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},dc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ue.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};fc=zt,P.BitString=fc,zt.NAME=Za;var pc;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 p=l<a?a:l;let y=0;for(let x=p;x>=0;x--,y++){switch(!0){case y<c.length:d=s[a-y]+c[l-y]+r[0];break;default:d=s[a-y]+r[0]}switch(r[0]=d/10,!0){case y>=s.length:s=uo(new Uint8Array([d%10]),s);break;default:s[a-y]=d%10}}return r[0]>0&&(s=uo(r,s)),s}function hc(e){if(e>=Fr.length)for(let t=Fr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Fr[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=uo(r,i)),Fr.push(i)}return Fr[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,p=0;for(let y=l;y>=0;y--,p++)switch(d=s[a-p]-c[l-p]-r,!0){case d<0:r=1,s[a-p]=d+10;break;default:r=0,s[a-p]=d}if(r>0)for(let y=a-l+1;y>=0;y--,p++)if(d=s[a-p]-r,d<0)r=1,s[a-p]=d+10;else{r=0,s[a-p]=d;break}return s.slice()}class go extends ct($e){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(hc(i),r),a="-";break;default:r=lp(r,hc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=Ga.charAt(r[l]));return c===!1&&(a+=Ga.charAt(0)),a}}pc=go,go.NAME="IntegerValueBlock",Object.defineProperty(pc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var yc;class lt extends Ie{constructor(t={}){super(t,go),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ni(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Ni();const r=BigInt(t),i=new Oi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(R.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${R.ToHex(c)}`)+r,p=D.toUint8Array(R.FromHex(d.toString(16)));p[0]|=128,i.write(p)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new lt({valueHex:i.final()})}convertToDER(){const t=new lt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new lt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}yc=lt,P.Integer=yc,lt.NAME="INTEGER";var gc;class Vi extends lt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}gc=Vi,P.Enumerated=gc,Vi.NAME="ENUMERATED";class mo extends ct($e){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=D.toUint8Array(t);if(!gt(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=lr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Ni();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=Ht(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",tt;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}}}mo.NAME="sidBlock";class mc extends $e{constructor({value:t=Re,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new mo;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(t);if(o.byteLength===0)return this.error=this.value[i].error,tt;r.push(o)}return fo(r)}fromString(t){this.value=[];let r=0,i=0,o="",s=!1;do if(i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(o,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new mo;if(o>Number.MAX_SAFE_INTEGER){Ni();const c=BigInt(o);a.valueBigInt=c}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[i].isFirstSid?t=`2.{${o} - 80}`:t+=o):t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}mc.NAME="ObjectIdentifierValueBlock";var bc;class ji extends Ie{constructor(t={}){super(t,mc),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}bc=ji,P.ObjectIdentifier=bc,ji.NAME="OBJECT IDENTIFIER";class bo extends ct(Ft){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=D.toUint8Array(t);if(!gt(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=lr(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=Ht(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",tt;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}}}bo.NAME="relativeSidBlock";class wc extends $e{constructor({value:t=Re,...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.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,tt;i.push(s)}return fo(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 bo;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(o=`{${o}}`),t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}wc.NAME="RelativeObjectIdentifierValueBlock";var vc;class wo extends Ie{constructor(t={}){super(t,wc),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}vc=wo,P.RelativeObjectIdentifier=vc,wo.NAME="RelativeObjectIdentifier";var kc;class mt extends Ue{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}kc=mt,P.Sequence=kc,mt.NAME="SEQUENCE";var Cc;let bt=class extends Ue{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Cc=bt,P.Set=Cc,bt.NAME="SET";class Sc extends ct($e){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Re}toJSON(){return{...super.toJSON(),value:this.value}}}Sc.NAME="StringValueBlock";class xc extends Sc{}xc.NAME="SimpleStringValueBlock";class We extends ho{constructor({...t}={}){super(t,xc)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,D.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}}We.NAME="SIMPLE STRING";class Ac extends We{fromBuffer(t){this.valueBlock.valueHexView=D.toUint8Array(t);try{this.valueBlock.value=R.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=R.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(R.FromUtf8String(t)),this.valueBlock.value=t}}Ac.NAME="Utf8StringValueBlock";var Bc;class wt extends Ac{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Bc=wt,P.Utf8String=Bc,wt.NAME="UTF8String";class Ic extends We{fromBuffer(t){this.valueBlock.value=R.ToUtf16String(t),this.valueBlock.valueHexView=D.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(R.FromUtf16String(t))}}Ic.NAME="BmpStringValueBlock";var Ec;class Di extends Ic{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Ec=Di,P.BmpString=Ec,Di.NAME="BMPString";class Nc extends We{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=Ht(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[o*4+l+c]=a[l]}this.valueBlock.value=t}}Nc.NAME="UniversalStringValueBlock";var Oc;class $i extends Nc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Oc=$i,P.UniversalString=Oc,$i.NAME="UniversalString";var _c;class Pi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}_c=Pi,P.NumericString=_c,Pi.NAME="NumericString";var Tc;class Mi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Tc=Mi,P.PrintableString=Tc,Mi.NAME="PrintableString";var Vc;class Ri extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Vc=Ri,P.TeletexString=Vc,Ri.NAME="TeletexString";var jc;class Ui extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}jc=Ui,P.VideotexString=jc,Ui.NAME="VideotexString";var Dc;class Li extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Dc=Li,P.IA5String=Dc,Li.NAME="IA5String";var $c;class Hi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}$c=Hi,P.GraphicString=$c,Hi.NAME="GraphicString";var Pc;class zr extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Pc=zr,P.VisibleString=Pc,zr.NAME="VisibleString";var Mc;class Fi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Mc=Fi,P.GeneralString=Mc,Fi.NAME="GeneralString";var Rc;class qi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Rc=qi,P.CharacterString=Rc,qi.NAME="CharacterString";var Uc;class Wr extends zr{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,D.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]=ze(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=ze(this.month,2),r[2]=ze(this.day,2),r[3]=ze(this.hour,2),r[4]=ze(this.minute,2),r[5]=ze(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}Uc=Wr,P.UTCTime=Uc,Wr.NAME="UTCTime";var Lc;class Ki 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 y=new Number(t[t.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let y=1,x=i.indexOf("+"),C="";if(x===-1&&(x=i.indexOf("-"),y=-1),x!==-1){if(C=i.substring(x+1),i=i.substring(0,x),C.length!==2&&C.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(C.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=y*h,C.length===4){if(h=parseInt(C.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=y*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const y=new Number(`0${i.substring(d)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),o=i.substring(0,d)}else o=i;switch(!0){case o.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}const p=a.exec(o);if(p===null)throw new Error("Wrong input string for conversion");for(let y=1;y<p.length;y++)switch(y){case 1:this.year=parseInt(p[y],10);break;case 2:this.month=parseInt(p[y],10);break;case 3:this.day=parseInt(p[y],10);break;case 4:this.hour=parseInt(p[y],10)+c;break;case 5:this.minute=parseInt(p[y],10)+l;break;case 6:this.second=parseInt(p[y],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(ze(this.year,4)),r.push(ze(this.month,2)),r.push(ze(this.day,2)),r.push(ze(this.hour,2)),r.push(ze(this.minute,2)),r.push(ze(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(ze(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Lc=Ki,P.GeneralizedTime=Lc,Ki.NAME="GeneralizedTime";var Hc;class vo extends wt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Hc=vo,P.DATE=Hc,vo.NAME="DATE";var Fc;class ko extends wt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Fc=ko,P.TimeOfDay=Fc,ko.NAME="TimeOfDay";var qc;class Co extends wt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}qc=Co,P.DateTime=qc,Co.NAME="DateTime";var Kc;class So extends wt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Kc=So,P.Duration=Kc,So.NAME="Duration";var zc;class xo extends wt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}zc=xo,P.TIME=zc,xo.NAME="TIME";class Wt{constructor({name:t=Re,optional:r=!1}={}){this.name=t,this.optional=r}}class Ao extends Wt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class zi extends Wt{constructor({value:t=new Wt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class dp{constructor({data:t=_i}={}){this.dataView=D.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=D.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=D.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Gt(e,t,r){if(r instanceof Ao){for(let s=0;s<r.value.length;s++)if(Gt(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(po)&&(s.name=r.name),s}}if(r instanceof Wt)return r.hasOwnProperty(po)&&(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(!(Ja in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Re),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof zi&&(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,Re),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,Re),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof zi){if(a=Gt(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,Re),r.name&&delete e[r.name]),a;if(po 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=Gt(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,Re),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,Re),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&Ja in t.valueBlock){const s=ur(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,Re),r.name&&(delete e[r.name],a.name=r.name)),a}return Gt(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=ur(D.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Gt(r.result,r.result,t)}const Wc=Object.freeze(Object.defineProperty({__proto__:null,Any:Wt,BaseBlock:Ie,BaseStringBlock:ho,BitString:zt,BmpString:Di,Boolean:Ti,CharacterString:qi,Choice:Ao,Constructed:Ue,DATE:vo,DateTime:Co,Duration:So,EndOfContent:yo,Enumerated:Vi,GeneralString:Fi,GeneralizedTime:Ki,GraphicString:Hi,HexBlock:ct,IA5String:Li,Integer:lt,Null:qt,NumericString:Pi,ObjectIdentifier:ji,OctetString:Kt,Primitive:Kr,PrintableString:Mi,RawData:dp,RelativeObjectIdentifier:wo,Repeated:zi,Sequence:mt,Set:bt,TIME:xo,TeletexString:Ri,TimeOfDay:ko,UTCTime:Wr,UniversalString:$i,Utf8String:wt,ValueBlock:$e,VideotexString:Ui,ViewWriter:Oi,VisibleString:zr,compareSchema:Gt,fromBER:dr,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 k;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(k||(k={}));class Wi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(D.isBufferSource(t))this.unusedBits=r,this.value=D.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof zt))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 zt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new zt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class ie{constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):D.isBufferSource(t)?this.buffer=D.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 Kt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Kt({valueHex:this.buffer})}toSchema(t){return new Kt({name:t})}}const pp={fromASN:e=>e instanceof qt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new qt;const t=dr(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 lt({value:+e})},yp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Vi({value:e})},ge={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new lt({valueHex:e})},gp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new zt({valueHex:e})},mp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new ji({value:e})},bp={fromASN:e=>e.valueBlock.value,toASN:e=>new Ti({value:e})},Gi={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Kt({valueHex:e})},wp={fromASN:e=>new ie(e.getValue()),toASN:e=>e.toASN()};function Ye(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const Gc=Ye(wt),vp=Ye(Di),kp=Ye($i),Cp=Ye(Pi),Sp=Ye(Mi),xp=Ye(Ri),Ap=Ye(Ui),Bp=Ye(Li),Ip=Ye(Hi),Ep=Ye(zr),Np=Ye(Fi),Op=Ye(qi),_p={fromASN:e=>e.toDate(),toASN:e=>new Wr({valueDate:e})},Tp={fromASN:e=>e.toDate(),toASN:e=>new Ki({valueDate:e})},Vp={fromASN:()=>null,toASN:()=>new qt};function Bo(e){switch(e){case k.Any:return pp;case k.BitString:return gp;case k.BmpString:return vp;case k.Boolean:return bp;case k.CharacterString:return Op;case k.Enumerated:return yp;case k.GeneralString:return Np;case k.GeneralizedTime:return Tp;case k.GraphicString:return Ip;case k.IA5String:return Bp;case k.Integer:return hp;case k.Null:return Vp;case k.NumericString:return Cp;case k.ObjectIdentifier:return mp;case k.OctetString:return Gi;case k.PrintableString:return Sp;case k.TeletexString:return xp;case k.UTCTime:return _p;case k.UniversalString:return kp;case k.Utf8String:return Gc;case k.VideotexString:return Ap;case k.VisibleString:return Ep;default:return null}}function vt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:vt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function Jc(e){var t;if(e){const r=Object.getPrototypeOf(e);return((t=r==null?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array?!0:Jc(r)}return!1}function 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 p=k[a.type],y=Wc[p];if(!y)throw new Error(`Cannot get ASN1 class by name '${p}'`);l=new y({name:c})}else vt(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 p=a.repeated==="set"?bt:mt;l=new p({name:"",value:[new zi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||vt(a.type)){const p=a.repeated?Ue:Kr;o.push(new p({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const p=!!a.repeated;let y=p?l:this.get(a.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,o.push(new Ue({name:p?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:y}))}else o.push(new Ue({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,o.push(l)}switch(i.type){case N.Sequence:return new mt({value:o,name:""});case N.Set:return new bt({value:o,name:""});case N.Choice:return new Ao({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 Ze=new Dp,_=e=>t=>{let r;Ze.has(t)?r=Ze.get(t):(r=Ze.createDefault(t),Ze.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;Ze.has(t.constructor)?i=Ze.get(t.constructor):(i=Ze.createDefault(t.constructor),Ze.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Bo(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}i.items[r]=o};class Yc extends Error{constructor(){super(...arguments),this.schemas=[]}}class $p{static parse(t,r){const i=dr(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(vt(r))return new r().fromASN(t);const o=Ze.get(r);Ze.cache(r);let s=o.schema;if(t.constructor===Ue&&o.type!==N.Choice){s=new Ue({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=Gt({},t,s);if(!a.verified)throw new Yc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(Jc(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const l=o.itemType;if(typeof l=="number"){const d=Bo(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,p=>d.fromASN(p))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const p=o.items[l],y=p.type;if(typeof y=="number"||vt(y)){const x=(i=p.converter)!==null&&i!==void 0?i:vt(y)?new y:null;if(!x)throw new Error("Converter is empty");if(p.repeated)if(p.implicit){const C=p.repeated==="sequence"?mt:bt,h=new C;h.valueBlock=d.valueBlock;const g=dr(h.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const m=g.result.valueBlock.value;c[l]=Array.from(m,v=>x.fromASN(v))}else c[l]=Array.from(d,C=>x.fromASN(C));else{let C=d;if(p.implicit){let h;if(vt(y))h=new y().toSchema("");else{const g=k[y],m=Wc[g];if(!m)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new m}h.valueBlock=C.valueBlock,C=dr(h.toBER(!1)).result}c[l]=x.fromASN(C)}}else if(p.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");c[l]=Array.from(d,x=>this.fromASN(x,y))}else c[l]=this.fromASN(d,y)}return c}catch(o){throw o instanceof Yc&&o.schemas.push(r.name),o}}}class Io{static serialize(t){return t instanceof Ie?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&vt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=Ze.get(r);Ze.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=Bo(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=Io.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||vt(c.type))){const p={};p.valueHex=d instanceof qt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Kr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...p}))}else o.push(new Ue({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new Ue({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case N.Sequence:s=new mt({value:o});break;case N.Set:s=new bt({value:o});break;case N.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(t,r,i,o){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${k[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,d=>a.toASN(d)),l=t.repeated==="sequence"?mt:bt;s=new l({value:c})}else s=a.toASN(o)}else if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(o,l=>this.toASN(l)),c=t.repeated==="sequence"?mt:bt;s=new c({value:a})}else s=this.toASN(o);return s}}class ae extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class H{static serialize(t){return Io.serialize(t)}static parse(t,r){return $p.parse(t,r)}static toString(t){const r=D.isBufferSource(t)?D.toArrayBuffer(t):H.serialize(t),i=dr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(o<3?a(s):o>3?a(t,r,s):a(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var Zc={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let m=0,v=-1,b=(h.match(l.zoneIndex)||[])[0],w,A;for(b&&(b=b.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)m++;if(h.substr(0,2)==="::"&&m--,h.substr(-2,2)==="::"&&m--,m>g)return null;for(A=g-m,w=":";A--;)w+="0:";return h=h.replace("::",w),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const F=h.split(":"),Z=[];for(let I=0;I<F.length;I++)Z.push(parseInt(F[I],16));return Z}(),{parts:g,zoneId:b}}function p(h,g,m,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let b=0,w;for(;v>0;){if(w=m-v,w<0&&(w=0),h[b]>>w!==g[b]>>w)return!1;v-=m,b+=1}return!0}function y(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function x(h,g){for(;h.length<g;)h=`0${h}`;return h}const C={};C.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let m,v;for(m=0;m<g.length;m++)if(v=g[m],!(0<=v&&v<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(g,m){let v;if(m===void 0&&(v=g,g=v[0],m=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,g.octets,8,m)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,m=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let b,w,A;for(b=3;b>=0;b-=1)if(w=this.octets[b],w in v){if(A=v[w],m&&A!==0)return null;A!==8&&(m=!0),g+=A}else return null;return 32-g},h.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return C.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),C.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),m=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[];let w=0;for(;w<4;)b.push(parseInt(m[w],10)|parseInt(v[w],10)^255),w++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.isIPv4=function(h){return this.parser(h)!==null},C.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},C.IPv4.isValidFourPartDecimal=function(h){return!!(C.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},C.IPv4.networkAddressFromCIDR=function(h){let g,m,v,b,w;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],m=0;m<4;)b.push(parseInt(v[m],10)&parseInt(w[m],10)),m++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.parse=function(h){const g=this.parser(h);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},C.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const m=parseInt(g[2]);if(m>=0&&m<=32){const v=[this.parse(g[1]),m];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},C.IPv4.parser=function(h){let g,m,v;if(g=h.match(i.fourOctet))return function(){const b=g.slice(1,6),w=[];for(let A=0;A<b.length;A++)m=b[A],w.push(y(m));return w}();if(g=h.match(i.longValue)){if(v=y(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const b=[];let w;for(w=0;w<=24;w+=8)b.push(v>>w&255);return b}().reverse()}else return(g=h.match(i.twoOctet))?function(){const b=g.slice(1,4),w=[];if(v=y(b[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return w.push(y(b[0])),w.push(v>>16&255),w.push(v>>8&255),w.push(v&255),w}():(g=h.match(i.threeOctet))?function(){const b=g.slice(1,5),w=[];if(v=y(b[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return w.push(y(b[0])),w.push(y(b[1])),w.push(v>>8&255),w.push(v&255),w}():null},C.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let m=0;const v=Math.floor(h/8);for(;m<v;)g[m]=255,m++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},C.IPv6=function(){function h(g,m){let v,b;if(g.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(g[v]<<8|g[v+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(b=this.parts[v],!(0<=b&&b<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");m&&(this.zoneId=m)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(g,m){let v;if(m===void 0&&(v=g,g=v[0],m=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,g.parts,16,m)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,m=!1;const v={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let b,w;for(let A=7;A>=0;A-=1)if(b=this.parts[A],b in v){if(w=v[b],m&&w!==0)return null;w!==16&&(m=!0),g+=w}else return null;return 128-g},h.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const m=[],v=this.parts;for(let b=0;b<v.length;b++)g=v[b],m.push(g>>8),m.push(g&255);return m},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let b=0;b<this.parts.length;b++)v.push(x(this.parts[b].toString(16),4));return v}).call(this).join(":");let m="";return this.zoneId&&(m=`%${this.zoneId}`),g+m},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),m=g[0],v=g[1];return new C.IPv4([m>>8,m&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let b=0;b<this.parts.length;b++)v.push(this.parts[b].toString(16));return v}).call(this).join(":");let m="";return this.zoneId&&(m=`%${this.zoneId}`),g+m},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,m=this.toNormalizedString();let v=0,b=-1,w;for(;w=g.exec(m);)w[0].length>b&&(v=w.index,b=w[0].length);return b<0?m:`${m.substring(0,v)}::${m.substring(v+b)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),C.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),m=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[];let w=0;for(;w<16;)b.push(parseInt(m[w],10)|parseInt(v[w],10)^255),w++;return new this(b)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},C.IPv6.isIPv6=function(h){return this.parser(h)!==null},C.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const g=this.parser(h);return new this(g.parts,g.zoneId),!0}catch{return!1}},C.IPv6.networkAddressFromCIDR=function(h){let g,m,v,b,w;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),w=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],m=0;m<16;)b.push(parseInt(v[m],10)&parseInt(w[m],10)),m++;return new this(b)}catch(A){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${A})`)}},C.IPv6.parse=function(h){const g=this.parser(h);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},C.IPv6.parseCIDR=function(h){let g,m,v;if((m=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(m[2]),g>=0&&g<=128))return v=[this.parse(m[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},C.IPv6.parser=function(h){let g,m,v,b,w,A;if(v=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(l.native.test(h))return d(h,8);if((v=h.match(l.transitional))&&(A=v[6]||"",g=d(v[1].slice(0,-1)+A,6),g.parts)){for(w=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],m=0;m<w.length;m++)if(b=w[m],!(0<=b&&b<=255))return null;return g.parts.push(w[0]<<8|w[1]),g.parts.push(w[2]<<8|w[3]),{parts:g.parts,zoneId:g.zoneId}}return null},C.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let m=0;const v=Math.floor(h/8);for(;m<v;)g[m]=255,m++;return v<16&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},C.fromByteArray=function(h){const g=h.length;if(g===4)return new C.IPv4(h);if(g===16)return new C.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},C.isValid=function(h){return C.IPv6.isValid(h)||C.IPv4.isValid(h)},C.parse=function(h){if(C.IPv6.isValid(h))return C.IPv6.parse(h);if(C.IPv4.isValid(h))return C.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},C.parseCIDR=function(h){try{return C.IPv6.parseCIDR(h)}catch{try{return C.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},C.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},C.subnetMatch=function(h,g,m){let v,b,w,A;m==null&&(m="unicast");for(b in g)if(Object.prototype.hasOwnProperty.call(g,b)){for(w=g[b],w[0]&&!(w[0]instanceof Array)&&(w=[w]),v=0;v<w.length;v++)if(A=w[v],h.kind()===A[0].kind()&&h.match.apply(h,A))return b}return m},e.exports?e.exports=C:t.ipaddr=C})(co)})(Zc);var Qc=Zc.exports;class Xc{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 Qc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(R.ToHex(t))}static fromString(t){const r=Qc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Eo,No,Oo;let Ee=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:k.TeletexString})],Ee.prototype,"teletexString",void 0),u([f({type:k.PrintableString})],Ee.prototype,"printableString",void 0),u([f({type:k.UniversalString})],Ee.prototype,"universalString",void 0),u([f({type:k.Utf8String})],Ee.prototype,"utf8String",void 0),u([f({type:k.BmpString})],Ee.prototype,"bmpString",void 0),Ee=u([_({type:N.Choice})],Ee);let fr=class extends Ee{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?R.ToHex(this.anyValue):super.toString())}};u([f({type:k.IA5String})],fr.prototype,"ia5String",void 0),u([f({type:k.Any})],fr.prototype,"anyValue",void 0),fr=u([_({type:N.Choice})],fr);class Gr{constructor(t={}){this.type="",this.value=new fr,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Gr.prototype,"type",void 0),u([f({type:fr})],Gr.prototype,"value",void 0);let pr=Eo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Eo.prototype)}};pr=Eo=u([_({type:N.Set,itemType:Gr})],pr);let _o=No=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,No.prototype)}};_o=No=u([_({type:N.Sequence,itemType:pr})],_o);let Ce=Oo=class extends _o{constructor(t){super(t),Object.setPrototypeOf(this,Oo.prototype)}};Ce=Oo=u([_({type:N.Sequence})],Ce);const Pp={fromASN:e=>Xc.toString(Gi.fromASN(e)),toASN:e=>Gi.toASN(Xc.fromString(e))};class Jr{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Jr.prototype,"typeId",void 0),u([f({type:k.Any,context:0})],Jr.prototype,"value",void 0);class To{constructor(t={}){this.partyName=new Ee,Object.assign(this,t)}}u([f({type:Ee,optional:!0,context:0,implicit:!0})],To.prototype,"nameAssigner",void 0),u([f({type:Ee,context:1,implicit:!0})],To.prototype,"partyName",void 0);let Q=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Jr,context:0,implicit:!0})],Q.prototype,"otherName",void 0),u([f({type:k.IA5String,context:1,implicit:!0})],Q.prototype,"rfc822Name",void 0),u([f({type:k.IA5String,context:2,implicit:!0})],Q.prototype,"dNSName",void 0),u([f({type:k.Any,context:3,implicit:!0})],Q.prototype,"x400Address",void 0),u([f({type:Ce,context:4,implicit:!1})],Q.prototype,"directoryName",void 0),u([f({type:To,context:5})],Q.prototype,"ediPartyName",void 0),u([f({type:k.IA5String,context:6,implicit:!0})],Q.prototype,"uniformResourceIdentifier",void 0),u([f({type:k.OctetString,context:7,implicit:!0,converter:Pp})],Q.prototype,"iPAddress",void 0),u([f({type:k.ObjectIdentifier,context:8,implicit:!0})],Q.prototype,"registeredID",void 0),Q=u([_({type:N.Choice})],Q);const hr="1.3.6.1.5.5.7.3",Jt="2.5.29";var Vo;class Ji{constructor(t={}){this.accessMethod="",this.accessLocation=new Q,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Ji.prototype,"accessMethod",void 0),u([f({type:Q})],Ji.prototype,"accessLocation",void 0);let el=Vo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Vo.prototype)}};el=Vo=u([_({type:N.Sequence,itemType:Ji})],el);const jo=`${Jt}.35`;class Do extends ie{}class Yt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Do,context:0,optional:!0,implicit:!0})],Yt.prototype,"keyIdentifier",void 0),u([f({type:Q,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Yt.prototype,"authorityCertIssuer",void 0),u([f({type:k.Integer,context:2,optional:!0,implicit:!0,converter:ge})],Yt.prototype,"authorityCertSerialNumber",void 0);const tl=`${Jt}.19`;class Yi{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:k.Boolean,defaultValue:!1})],Yi.prototype,"cA",void 0),u([f({type:k.Integer,optional:!0})],Yi.prototype,"pathLenConstraint",void 0);var $o;let Pe=$o=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};Pe=$o=u([_({type:N.Sequence,itemType:Q})],Pe);var Po;let rl=Po=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,Po.prototype)}};rl=Po=u([_({type:N.Sequence})],rl);var Mo;const il=`${Jt}.32`;let kt=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:k.IA5String})],kt.prototype,"ia5String",void 0),u([f({type:k.VisibleString})],kt.prototype,"visibleString",void 0),u([f({type:k.BmpString})],kt.prototype,"bmpString",void 0),u([f({type:k.Utf8String})],kt.prototype,"utf8String",void 0),kt=u([_({type:N.Choice})],kt);class Ro{constructor(t={}){this.organization=new kt,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:kt})],Ro.prototype,"organization",void 0),u([f({type:k.Integer,repeated:"sequence"})],Ro.prototype,"noticeNumbers",void 0);class Uo{constructor(t={}){Object.assign(this,t)}}u([f({type:Ro,optional:!0})],Uo.prototype,"noticeRef",void 0),u([f({type:kt,optional:!0})],Uo.prototype,"explicitText",void 0);let Zi=class{constructor(t={}){Object.assign(this,t)}};u([f({type:k.IA5String})],Zi.prototype,"cPSuri",void 0),u([f({type:Uo})],Zi.prototype,"userNotice",void 0),Zi=u([_({type:N.Choice})],Zi);class Lo{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Lo.prototype,"policyQualifierId",void 0),u([f({type:k.Any})],Lo.prototype,"qualifier",void 0);class Qi{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Qi.prototype,"policyIdentifier",void 0),u([f({type:Lo,repeated:"sequence",optional:!0})],Qi.prototype,"policyQualifiers",void 0);let Xi=Mo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};Xi=Mo=u([_({type:N.Sequence,itemType:Qi})],Xi);let en=class{constructor(t=0){this.value=t}};u([f({type:k.Integer})],en.prototype,"value",void 0),en=u([_({type:N.Choice})],en);let nl=class extends en{};nl=u([_({type:N.Choice})],nl);var Ho,rt;(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"})(rt||(rt={}));class ol extends Wi{toJSON(){const t=[],r=this.toNumber();return r&rt.aACompromise&&t.push("aACompromise"),r&rt.affiliationChanged&&t.push("affiliationChanged"),r&rt.cACompromise&&t.push("cACompromise"),r&rt.certificateHold&&t.push("certificateHold"),r&rt.cessationOfOperation&&t.push("cessationOfOperation"),r&rt.keyCompromise&&t.push("keyCompromise"),r&rt.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&rt.superseded&&t.push("superseded"),r&rt.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let yr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Q,context:0,repeated:"sequence",implicit:!0})],yr.prototype,"fullName",void 0),u([f({type:pr,context:1,implicit:!0})],yr.prototype,"nameRelativeToCRLIssuer",void 0),yr=u([_({type:N.Choice})],yr);class Yr{constructor(t={}){Object.assign(this,t)}}u([f({type:yr,context:0,optional:!0})],Yr.prototype,"distributionPoint",void 0),u([f({type:ol,context:1,optional:!0,implicit:!0})],Yr.prototype,"reasons",void 0),u([f({type:Q,context:2,optional:!0,repeated:"sequence",implicit:!0})],Yr.prototype,"cRLIssuer",void 0);let Fo=Ho=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};Fo=Ho=u([_({type:N.Sequence,itemType:Yr})],Fo);var qo;let sl=qo=class extends Fo{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};sl=qo=u([_({type:N.Sequence,itemType:Yr})],sl);class Te{constructor(t={}){this.onlyContainsUserCerts=Te.ONLY,this.onlyContainsCACerts=Te.ONLY,this.indirectCRL=Te.ONLY,this.onlyContainsAttributeCerts=Te.ONLY,Object.assign(this,t)}}Te.ONLY=!1,u([f({type:yr,context:0,optional:!0})],Te.prototype,"distributionPoint",void 0),u([f({type:k.Boolean,context:1,defaultValue:Te.ONLY,implicit:!0})],Te.prototype,"onlyContainsUserCerts",void 0),u([f({type:k.Boolean,context:2,defaultValue:Te.ONLY,implicit:!0})],Te.prototype,"onlyContainsCACerts",void 0),u([f({type:ol,context:3,optional:!0,implicit:!0})],Te.prototype,"onlySomeReasons",void 0),u([f({type:k.Boolean,context:4,defaultValue:Te.ONLY,implicit:!0})],Te.prototype,"indirectCRL",void 0),u([f({type:k.Boolean,context:5,defaultValue:Te.ONLY,implicit:!0})],Te.prototype,"onlyContainsAttributeCerts",void 0);var Zr;(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"})(Zr||(Zr={}));let Ko=class{constructor(t=Zr.unspecified){this.reason=Zr.unspecified,this.reason=t}toJSON(){return Zr[this.reason]}toString(){return this.toJSON()}};u([f({type:k.Enumerated})],Ko.prototype,"reason",void 0),Ko=u([_({type:N.Choice})],Ko);var zo;const al=`${Jt}.37`;let tn=zo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,zo.prototype)}};tn=zo=u([_({type:N.Sequence,itemType:k.ObjectIdentifier})],tn);const Mp=`${hr}.1`,Rp=`${hr}.2`,Up=`${hr}.3`,Lp=`${hr}.4`,Hp=`${hr}.8`,Fp=`${hr}.9`;let Wo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:k.Integer,converter:ge})],Wo.prototype,"value",void 0),Wo=u([_({type:N.Choice})],Wo);let Go=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:k.GeneralizedTime})],Go.prototype,"value",void 0),Go=u([_({type:N.Choice})],Go);var Jo;let cl=Jo=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,Jo.prototype)}};cl=Jo=u([_({type:N.Sequence})],cl);const ll=`${Jt}.15`;var it;(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"})(it||(it={}));class Yo extends Wi{toJSON(){const t=this.toNumber(),r=[];return t&it.cRLSign&&r.push("crlSign"),t&it.dataEncipherment&&r.push("dataEncipherment"),t&it.decipherOnly&&r.push("decipherOnly"),t&it.digitalSignature&&r.push("digitalSignature"),t&it.encipherOnly&&r.push("encipherOnly"),t&it.keyAgreement&&r.push("keyAgreement"),t&it.keyCertSign&&r.push("keyCertSign"),t&it.keyEncipherment&&r.push("keyEncipherment"),t&it.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var Zo;class rn{constructor(t={}){this.base=new Q,this.minimum=0,Object.assign(this,t)}}u([f({type:Q})],rn.prototype,"base",void 0),u([f({type:k.Integer,context:0,defaultValue:0,implicit:!0})],rn.prototype,"minimum",void 0),u([f({type:k.Integer,context:1,optional:!0,implicit:!0})],rn.prototype,"maximum",void 0);let nn=Zo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};nn=Zo=u([_({type:N.Sequence,itemType:rn})],nn);class ul{constructor(t={}){Object.assign(this,t)}}u([f({type:nn,context:0,optional:!0,implicit:!0})],ul.prototype,"permittedSubtrees",void 0),u([f({type:nn,context:1,optional:!0,implicit:!0})],ul.prototype,"excludedSubtrees",void 0);class dl{constructor(t={}){Object.assign(this,t)}}u([f({type:k.Integer,context:0,implicit:!0,optional:!0,converter:ge})],dl.prototype,"requireExplicitPolicy",void 0),u([f({type:k.Integer,context:1,implicit:!0,optional:!0,converter:ge})],dl.prototype,"inhibitPolicyMapping",void 0);var Qo;class Xo{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Xo.prototype,"issuerDomainPolicy",void 0),u([f({type:k.ObjectIdentifier})],Xo.prototype,"subjectDomainPolicy",void 0);let fl=Qo=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};fl=Qo=u([_({type:N.Sequence,itemType:Xo})],fl);var es;const pl=`${Jt}.17`;let ts=es=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,es.prototype)}};ts=es=u([_({type:N.Sequence})],ts);let Ct=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],Ct.prototype,"type",void 0),u([f({type:k.Any,repeated:"set"})],Ct.prototype,"values",void 0);var rs;let hl=rs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,rs.prototype)}};hl=rs=u([_({type:N.Sequence,itemType:Ct})],hl);const yl=`${Jt}.14`;class Tt extends Do{}class gl{constructor(t={}){Object.assign(this,t)}}u([f({type:k.GeneralizedTime,context:0,implicit:!0,optional:!0})],gl.prototype,"notBefore",void 0),u([f({type:k.GeneralizedTime,context:1,implicit:!0,optional:!0})],gl.prototype,"notAfter",void 0);var Qr;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(Qr||(Qr={}));class ml extends Wi{toJSON(){const t=[],r=this.toNumber();return r&Qr.pKIXCertificate&&t.push("pKIXCertificate"),r&Qr.newExtensions&&t.push("newExtensions"),r&Qr.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class bl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new ml,Object.assign(this,t)}}u([f({type:k.GeneralString})],bl.prototype,"entrustVers",void 0),u([f({type:ml})],bl.prototype,"entrustInfoFlags",void 0);var is;let wl=is=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};wl=is=u([_({type:N.Sequence,itemType:Ji})],wl);class L{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof L&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&za(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:k.ObjectIdentifier})],L.prototype,"algorithm",void 0),u([f({type:k.Any,optional:!0})],L.prototype,"parameters",void 0);class St{constructor(t={}){this.algorithm=new L,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:L})],St.prototype,"algorithm",void 0),u([f({type:k.BitString})],St.prototype,"subjectPublicKey",void 0);let Ve=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:k.UTCTime})],Ve.prototype,"utcTime",void 0),u([f({type:k.GeneralizedTime})],Ve.prototype,"generalTime",void 0),Ve=u([_({type:N.Choice})],Ve);class on{constructor(t){this.notBefore=new Ve(new Date),this.notAfter=new Ve(new Date),t&&(this.notBefore=new Ve(t.notBefore),this.notAfter=new Ve(t.notAfter))}}u([f({type:Ve})],on.prototype,"notBefore",void 0),u([f({type:Ve})],on.prototype,"notAfter",void 0);var ns;let nt=class Ff{constructor(t={}){this.extnID="",this.critical=Ff.CRITICAL,this.extnValue=new ie,Object.assign(this,t)}};nt.CRITICAL=!1,u([f({type:k.ObjectIdentifier})],nt.prototype,"extnID",void 0),u([f({type:k.Boolean,defaultValue:nt.CRITICAL})],nt.prototype,"critical",void 0),u([f({type:ie})],nt.prototype,"extnValue",void 0);let Zt=ns=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};Zt=ns=u([_({type:N.Sequence,itemType:nt})],Zt);var gr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(gr||(gr={}));class Qe{constructor(t={}){this.version=gr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new L,this.issuer=new Ce,this.validity=new on,this.subject=new Ce,this.subjectPublicKeyInfo=new St,Object.assign(this,t)}}u([f({type:k.Integer,context:0,defaultValue:gr.v1})],Qe.prototype,"version",void 0),u([f({type:k.Integer,converter:ge})],Qe.prototype,"serialNumber",void 0),u([f({type:L})],Qe.prototype,"signature",void 0),u([f({type:Ce})],Qe.prototype,"issuer",void 0),u([f({type:on})],Qe.prototype,"validity",void 0),u([f({type:Ce})],Qe.prototype,"subject",void 0),u([f({type:St})],Qe.prototype,"subjectPublicKeyInfo",void 0),u([f({type:k.BitString,context:1,implicit:!0,optional:!0})],Qe.prototype,"issuerUniqueID",void 0),u([f({type:k.BitString,context:2,implicit:!0,optional:!0})],Qe.prototype,"subjectUniqueID",void 0),u([f({type:Zt,context:3,optional:!0})],Qe.prototype,"extensions",void 0);class mr{constructor(t={}){this.tbsCertificate=new Qe,this.signatureAlgorithm=new L,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Qe})],mr.prototype,"tbsCertificate",void 0),u([f({type:L})],mr.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],mr.prototype,"signatureValue",void 0);class sn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Ve,Object.assign(this,t)}}u([f({type:k.Integer,converter:ge})],sn.prototype,"userCertificate",void 0),u([f({type:Ve})],sn.prototype,"revocationDate",void 0),u([f({type:nt,optional:!0,repeated:"sequence"})],sn.prototype,"crlEntryExtensions",void 0);class xt{constructor(t={}){this.signature=new L,this.issuer=new Ce,this.thisUpdate=new Ve,Object.assign(this,t)}}u([f({type:k.Integer,optional:!0})],xt.prototype,"version",void 0),u([f({type:L})],xt.prototype,"signature",void 0),u([f({type:Ce})],xt.prototype,"issuer",void 0),u([f({type:Ve})],xt.prototype,"thisUpdate",void 0),u([f({type:Ve,optional:!0})],xt.prototype,"nextUpdate",void 0),u([f({type:sn,repeated:"sequence",optional:!0})],xt.prototype,"revokedCertificates",void 0),u([f({type:nt,optional:!0,context:0,repeated:"sequence"})],xt.prototype,"crlExtensions",void 0);let os=class{constructor(t={}){this.tbsCertList=new xt,this.signatureAlgorithm=new L,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:xt})],os.prototype,"tbsCertList",void 0),u([f({type:L})],os.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],os.prototype,"signature",void 0);let br=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],br.prototype,"attrType",void 0),u([f({type:k.Any,repeated:"set"})],br.prototype,"attrValues",void 0);class ss{constructor(t={}){this.acIssuer=new Q,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:Q})],ss.prototype,"acIssuer",void 0),u([f({type:k.Integer})],ss.prototype,"acSerial",void 0),u([f({type:Ct,repeated:"sequence"})],ss.prototype,"attrs",void 0);var as;let an=as=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};an=as=u([_({type:N.Sequence,itemType:k.ObjectIdentifier})],an);class cn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:k.Integer,optional:!0})],cn.prototype,"pathLenConstraint",void 0),u([f({type:an,implicit:!0,context:0,optional:!0})],cn.prototype,"permittedAttrs",void 0),u([f({type:an,implicit:!0,context:1,optional:!0})],cn.prototype,"excludedAttrs",void 0),u([f({type:k.Boolean,defaultValue:!0})],cn.prototype,"permitUnSpecified",void 0);class Qt{constructor(t={}){this.issuer=new Pe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pe})],Qt.prototype,"issuer",void 0),u([f({type:k.Integer,converter:ge})],Qt.prototype,"serial",void 0),u([f({type:k.BitString,optional:!0})],Qt.prototype,"issuerUID",void 0);var cs;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(cs||(cs={}));class Xt{constructor(t={}){this.digestedObjectType=cs.publicKey,this.digestAlgorithm=new L,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Enumerated})],Xt.prototype,"digestedObjectType",void 0),u([f({type:k.ObjectIdentifier,optional:!0})],Xt.prototype,"otherObjectTypeID",void 0),u([f({type:L})],Xt.prototype,"digestAlgorithm",void 0),u([f({type:k.BitString})],Xt.prototype,"objectDigest",void 0);class ln{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,optional:!0})],ln.prototype,"issuerName",void 0),u([f({type:Qt,context:0,implicit:!0,optional:!0})],ln.prototype,"baseCertificateID",void 0),u([f({type:Xt,context:1,implicit:!0,optional:!0})],ln.prototype,"objectDigestInfo",void 0);let wr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Q,repeated:"sequence"})],wr.prototype,"v1Form",void 0),u([f({type:ln,context:0,implicit:!0})],wr.prototype,"v2Form",void 0),wr=u([_({type:N.Choice})],wr);class un{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:k.GeneralizedTime})],un.prototype,"notBeforeTime",void 0),u([f({type:k.GeneralizedTime})],un.prototype,"notAfterTime",void 0);class Xr{constructor(t={}){Object.assign(this,t)}}u([f({type:Qt,implicit:!0,context:0,optional:!0})],Xr.prototype,"baseCertificateID",void 0),u([f({type:Pe,implicit:!0,context:1,optional:!0})],Xr.prototype,"entityName",void 0),u([f({type:Xt,implicit:!0,context:2,optional:!0})],Xr.prototype,"objectDigestInfo",void 0);var ls;(function(e){e[e.v2=1]="v2"})(ls||(ls={}));class ot{constructor(t={}){this.version=ls.v2,this.holder=new Xr,this.issuer=new wr,this.signature=new L,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new un,this.attributes=[],Object.assign(this,t)}}u([f({type:k.Integer})],ot.prototype,"version",void 0),u([f({type:Xr})],ot.prototype,"holder",void 0),u([f({type:wr})],ot.prototype,"issuer",void 0),u([f({type:L})],ot.prototype,"signature",void 0),u([f({type:k.Integer,converter:ge})],ot.prototype,"serialNumber",void 0),u([f({type:un})],ot.prototype,"attrCertValidityPeriod",void 0),u([f({type:Ct,repeated:"sequence"})],ot.prototype,"attributes",void 0),u([f({type:k.BitString,optional:!0})],ot.prototype,"issuerUniqueID",void 0),u([f({type:Zt,optional:!0})],ot.prototype,"extensions",void 0);class dn{constructor(t={}){this.acinfo=new ot,this.signatureAlgorithm=new L,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ot})],dn.prototype,"acinfo",void 0),u([f({type:L})],dn.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],dn.prototype,"signatureValue",void 0);var fn;(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"})(fn||(fn={}));class us extends Wi{}class ds{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier,implicit:!0,context:0})],ds.prototype,"type",void 0),u([f({type:k.Any,implicit:!0,context:1})],ds.prototype,"value",void 0);class fs{constructor(t={}){this.policyId="",this.classList=new us(fn.unclassified),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],fs.prototype,"policyId",void 0),u([f({type:us,defaultValue:new us(fn.unclassified)})],fs.prototype,"classList",void 0),u([f({type:ds,repeated:"set"})],fs.prototype,"securityCategories",void 0);class pn{constructor(t={}){Object.assign(this,t)}}u([f({type:ie})],pn.prototype,"cotets",void 0),u([f({type:k.ObjectIdentifier})],pn.prototype,"oid",void 0),u([f({type:k.Utf8String})],pn.prototype,"string",void 0);class vl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],vl.prototype,"policyAuthority",void 0),u([f({type:pn,repeated:"sequence"})],vl.prototype,"values",void 0);var ps;class hn{constructor(t={}){this.targetCertificate=new Qt,Object.assign(this,t)}}u([f({type:Qt})],hn.prototype,"targetCertificate",void 0),u([f({type:Q,optional:!0})],hn.prototype,"targetName",void 0),u([f({type:Xt,optional:!0})],hn.prototype,"certDigestInfo",void 0);let vr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Q,context:0,implicit:!0})],vr.prototype,"targetName",void 0),u([f({type:Q,context:1,implicit:!0})],vr.prototype,"targetGroup",void 0),u([f({type:hn,context:2,implicit:!0})],vr.prototype,"targetCert",void 0),vr=u([_({type:N.Choice})],vr);let hs=ps=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};hs=ps=u([_({type:N.Sequence,itemType:vr})],hs);var ys;let kl=ys=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};kl=ys=u([_({type:N.Sequence,itemType:hs})],kl);class Cl{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Cl.prototype,"roleAuthority",void 0),u([f({type:Q,implicit:!0,context:1})],Cl.prototype,"roleName",void 0);class gs{constructor(t={}){this.service=new Q,this.ident=new Q,Object.assign(this,t)}}u([f({type:Q})],gs.prototype,"service",void 0),u([f({type:Q})],gs.prototype,"ident",void 0),u([f({type:ie,optional:!0})],gs.prototype,"authInfo",void 0);var ms;class bs{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],bs.prototype,"otherCertFormat",void 0),u([f({type:k.Any})],bs.prototype,"otherCert",void 0);let kr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:mr})],kr.prototype,"certificate",void 0),u([f({type:dn,context:2,implicit:!0})],kr.prototype,"v2AttrCert",void 0),u([f({type:bs,context:3,implicit:!0})],kr.prototype,"other",void 0),kr=u([_({type:N.Choice})],kr);let yn=ms=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};yn=ms=u([_({type:N.Set,itemType:kr})],yn);class Cr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Cr.prototype,"contentType",void 0),u([f({type:k.Any,context:0})],Cr.prototype,"content",void 0);let ei=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie})],ei.prototype,"single",void 0),u([f({type:k.Any})],ei.prototype,"any",void 0),ei=u([_({type:N.Choice})],ei);class gn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],gn.prototype,"eContentType",void 0),u([f({type:ei,context:0,optional:!0})],gn.prototype,"eContent",void 0);var At;(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"})(At||(At={}));let ti=class extends L{};ti=u([_({type:N.Sequence})],ti);let mn=class extends L{};mn=u([_({type:N.Sequence})],mn);let ut=class extends L{};ut=u([_({type:N.Sequence})],ut);let bn=class extends L{};bn=u([_({type:N.Sequence})],bn);let Sl=class extends L{};Sl=u([_({type:N.Sequence})],Sl);let ws=class extends L{};ws=u([_({type:N.Sequence})],ws);let ri=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0,optional:!0})],ri.prototype,"value",void 0),u([f({type:ie,converter:wp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ri.prototype,"constructedValue",void 0),ri=u([_({type:N.Choice})],ri);class ii{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new bn,Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ii.prototype,"contentType",void 0),u([f({type:bn})],ii.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ri,optional:!0})],ii.prototype,"encryptedContent",void 0);class Sr{constructor(t={}){this.issuer=new Ce,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Ce})],Sr.prototype,"issuer",void 0),u([f({type:k.Integer,converter:ge})],Sr.prototype,"serialNumber",void 0);class wn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],wn.prototype,"keyAttrId",void 0),u([f({type:k.Any,optional:!0})],wn.prototype,"keyAttr",void 0);var vs;class vn{constructor(t={}){this.subjectKeyIdentifier=new Tt,Object.assign(this,t)}}u([f({type:Tt})],vn.prototype,"subjectKeyIdentifier",void 0),u([f({type:k.GeneralizedTime,optional:!0})],vn.prototype,"date",void 0),u([f({type:wn,optional:!0})],vn.prototype,"other",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:vn,context:0,implicit:!0,optional:!0})],xr.prototype,"rKeyId",void 0),u([f({type:Sr,optional:!0})],xr.prototype,"issuerAndSerialNumber",void 0),xr=u([_({type:N.Choice})],xr);class ks{constructor(t={}){this.rid=new xr,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:xr})],ks.prototype,"rid",void 0),u([f({type:ie})],ks.prototype,"encryptedKey",void 0);let kn=vs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,vs.prototype)}};kn=vs=u([_({type:N.Sequence,itemType:ks})],kn);class Cs{constructor(t={}){this.algorithm=new L,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:L})],Cs.prototype,"algorithm",void 0),u([f({type:k.BitString})],Cs.prototype,"publicKey",void 0);let er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Tt,context:0,implicit:!0,optional:!0})],er.prototype,"subjectKeyIdentifier",void 0),u([f({type:Cs,context:1,implicit:!0,optional:!0})],er.prototype,"originatorKey",void 0),u([f({type:Sr,optional:!0})],er.prototype,"issuerAndSerialNumber",void 0),er=u([_({type:N.Choice})],er);class Ar{constructor(t={}){this.version=At.v3,this.originator=new er,this.keyEncryptionAlgorithm=new ut,this.recipientEncryptedKeys=new kn,Object.assign(this,t)}}u([f({type:k.Integer})],Ar.prototype,"version",void 0),u([f({type:er,context:0})],Ar.prototype,"originator",void 0),u([f({type:ie,context:1,optional:!0})],Ar.prototype,"ukm",void 0),u([f({type:ut})],Ar.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:kn})],Ar.prototype,"recipientEncryptedKeys",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Tt,context:0,implicit:!0})],Br.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],Br.prototype,"issuerAndSerialNumber",void 0),Br=u([_({type:N.Choice})],Br);class ni{constructor(t={}){this.version=At.v0,this.rid=new Br,this.keyEncryptionAlgorithm=new ut,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],ni.prototype,"version",void 0),u([f({type:Br})],ni.prototype,"rid",void 0),u([f({type:ut})],ni.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],ni.prototype,"encryptedKey",void 0);class oi{constructor(t={}){this.keyIdentifier=new ie,Object.assign(this,t)}}u([f({type:ie})],oi.prototype,"keyIdentifier",void 0),u([f({type:k.GeneralizedTime,optional:!0})],oi.prototype,"date",void 0),u([f({type:wn,optional:!0})],oi.prototype,"other",void 0);class si{constructor(t={}){this.version=At.v4,this.kekid=new oi,this.keyEncryptionAlgorithm=new ut,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],si.prototype,"version",void 0),u([f({type:oi})],si.prototype,"kekid",void 0),u([f({type:ut})],si.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],si.prototype,"encryptedKey",void 0);class ai{constructor(t={}){this.version=At.v0,this.keyEncryptionAlgorithm=new ut,this.encryptedKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],ai.prototype,"version",void 0),u([f({type:ws,context:0,optional:!0})],ai.prototype,"keyDerivationAlgorithm",void 0),u([f({type:ut})],ai.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ie})],ai.prototype,"encryptedKey",void 0);class Ss{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Ss.prototype,"oriType",void 0),u([f({type:k.Any})],Ss.prototype,"oriValue",void 0);let Vt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ni,optional:!0})],Vt.prototype,"ktri",void 0),u([f({type:Ar,context:1,implicit:!0,optional:!0})],Vt.prototype,"kari",void 0),u([f({type:si,context:2,implicit:!0,optional:!0})],Vt.prototype,"kekri",void 0),u([f({type:ai,context:3,implicit:!0,optional:!0})],Vt.prototype,"pwri",void 0),u([f({type:Ss,context:4,implicit:!0,optional:!0})],Vt.prototype,"ori",void 0),Vt=u([_({type:N.Choice})],Vt);var xs;let Cn=xs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};Cn=xs=u([_({type:N.Set,itemType:Vt})],Cn);var As;class Sn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Sn.prototype,"otherRevInfoFormat",void 0),u([f({type:k.Any})],Sn.prototype,"otherRevInfo",void 0);let ci=class{constructor(t={}){this.other=new Sn,Object.assign(this,t)}};u([f({type:Sn,context:1,implicit:!0})],ci.prototype,"other",void 0),ci=u([_({type:N.Choice})],ci);let Bs=As=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};Bs=As=u([_({type:N.Set,itemType:ci})],Bs);class Is{constructor(t={}){Object.assign(this,t)}}u([f({type:yn,context:0,implicit:!0,optional:!0})],Is.prototype,"certs",void 0),u([f({type:Bs,context:1,implicit:!0,optional:!0})],Is.prototype,"crls",void 0);var Es;let Ns=Es=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Es.prototype)}};Ns=Es=u([_({type:N.Set,itemType:br})],Ns);class li{constructor(t={}){this.version=At.v0,this.recipientInfos=new Cn,this.encryptedContentInfo=new ii,Object.assign(this,t)}}u([f({type:k.Integer})],li.prototype,"version",void 0),u([f({type:Is,context:0,implicit:!0,optional:!0})],li.prototype,"originatorInfo",void 0),u([f({type:Cn})],li.prototype,"recipientInfos",void 0),u([f({type:ii})],li.prototype,"encryptedContentInfo",void 0),u([f({type:Ns,context:1,implicit:!0,optional:!0})],li.prototype,"unprotectedAttrs",void 0);const qp="1.2.840.113549.1.7.2";let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Tt,context:0,implicit:!0})],Ir.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],Ir.prototype,"issuerAndSerialNumber",void 0),Ir=u([_({type:N.Choice})],Ir);var Os;class Bt{constructor(t={}){this.version=At.v0,this.sid=new Ir,this.digestAlgorithm=new ti,this.signatureAlgorithm=new mn,this.signature=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],Bt.prototype,"version",void 0),u([f({type:Ir})],Bt.prototype,"sid",void 0),u([f({type:ti})],Bt.prototype,"digestAlgorithm",void 0),u([f({type:br,repeated:"set",context:0,implicit:!0,optional:!0})],Bt.prototype,"signedAttrs",void 0),u([f({type:mn})],Bt.prototype,"signatureAlgorithm",void 0),u([f({type:ie})],Bt.prototype,"signature",void 0),u([f({type:br,repeated:"set",context:1,implicit:!0,optional:!0})],Bt.prototype,"unsignedAttrs",void 0);let xn=Os=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Os.prototype)}};xn=Os=u([_({type:N.Set,itemType:Bt})],xn);var _s;let An=_s=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};An=_s=u([_({type:N.Set,itemType:ti})],An);class Er{constructor(t={}){this.version=At.v0,this.digestAlgorithms=new An,this.encapContentInfo=new gn,this.signerInfos=new xn,Object.assign(this,t)}}u([f({type:k.Integer})],Er.prototype,"version",void 0),u([f({type:An})],Er.prototype,"digestAlgorithms",void 0),u([f({type:gn})],Er.prototype,"encapContentInfo",void 0),u([f({type:yn,context:0,implicit:!0,optional:!0})],Er.prototype,"certificates",void 0),u([f({type:ci,context:1,implicit:!0,optional:!0})],Er.prototype,"crls",void 0),u([f({type:xn})],Er.prototype,"signerInfos",void 0);const ui="1.2.840.10045.2.1",Ts="1.2.840.10045.4.1",xl="1.2.840.10045.4.3.1",Vs="1.2.840.10045.4.3.2",js="1.2.840.10045.4.3.3",Ds="1.2.840.10045.4.3.4",Al="1.2.840.10045.3.1.7",Bl="1.3.132.0.34",Il="1.3.132.0.35";function di(e){return new L({algorithm:e})}const Kp=di(Ts);di(xl);const zp=di(Vs),Wp=di(js),Gp=di(Ds);let Nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:k.ObjectIdentifier})],Nr.prototype,"namedCurve",void 0),Nr=u([_({type:N.Choice})],Nr);class Bn{constructor(t={}){this.version=1,this.privateKey=new ie,Object.assign(this,t)}}u([f({type:k.Integer})],Bn.prototype,"version",void 0),u([f({type:ie})],Bn.prototype,"privateKey",void 0),u([f({type:Nr,context:0,optional:!0})],Bn.prototype,"parameters",void 0),u([f({type:k.BitString,context:1,optional:!0})],Bn.prototype,"publicKey",void 0);class In{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:ge})],In.prototype,"r",void 0),u([f({type:k.Integer,converter:ge})],In.prototype,"s",void 0);const Le="1.2.840.113549.1.1",Or=`${Le}.1`,Jp=`${Le}.7`,Yp=`${Le}.9`,Zp=`${Le}.10`,Qp=`${Le}.2`,Xp=`${Le}.4`,En=`${Le}.5`,eh=`${Le}.14`,$s=`${Le}.11`,Nn=`${Le}.12`,On=`${Le}.13`,El=`${Le}.15`,Nl=`${Le}.16`,Ol="1.3.14.3.2.26",_l="2.16.840.1.101.3.4.2.4",Tl="2.16.840.1.101.3.4.2.1",Vl="2.16.840.1.101.3.4.2.2",jl="2.16.840.1.101.3.4.2.3",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",Ps=`${Le}.8`;function Se(e){return new L({algorithm:e,parameters:null})}Se(ih),Se(nh);const tr=Se(Ol);Se(_l),Se(Tl),Se(Vl),Se(jl),Se(th),Se(rh);const Dl=new L({algorithm:Ps,parameters:H.serialize(tr)}),$l=new L({algorithm:Yp,parameters:H.serialize(Gi.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Se(Or),Se(Qp),Se(Xp),Se(En),Se(El),Se(Nl),Se(Nn),Se(On),Se(El),Se(Nl);class _n{constructor(t={}){this.hashAlgorithm=new L(tr),this.maskGenAlgorithm=new L({algorithm:Ps,parameters:H.serialize(tr)}),this.pSourceAlgorithm=new L($l),Object.assign(this,t)}}u([f({type:L,context:0,defaultValue:tr})],_n.prototype,"hashAlgorithm",void 0),u([f({type:L,context:1,defaultValue:Dl})],_n.prototype,"maskGenAlgorithm",void 0),u([f({type:L,context:2,defaultValue:$l})],_n.prototype,"pSourceAlgorithm",void 0),new L({algorithm:Jp,parameters:H.serialize(new _n)});class fi{constructor(t={}){this.hashAlgorithm=new L(tr),this.maskGenAlgorithm=new L({algorithm:Ps,parameters:H.serialize(tr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:L,context:0,defaultValue:tr})],fi.prototype,"hashAlgorithm",void 0),u([f({type:L,context:1,defaultValue:Dl})],fi.prototype,"maskGenAlgorithm",void 0),u([f({type:k.Integer,context:2,defaultValue:20})],fi.prototype,"saltLength",void 0),u([f({type:k.Integer,context:3,defaultValue:1})],fi.prototype,"trailerField",void 0),new L({algorithm:Zp,parameters:H.serialize(new fi)});class Tn{constructor(t={}){this.digestAlgorithm=new L,this.digest=new ie,Object.assign(this,t)}}u([f({type:L})],Tn.prototype,"digestAlgorithm",void 0),u([f({type:ie})],Tn.prototype,"digest",void 0);var Ms;class Vn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:ge})],Vn.prototype,"prime",void 0),u([f({type:k.Integer,converter:ge})],Vn.prototype,"exponent",void 0),u([f({type:k.Integer,converter:ge})],Vn.prototype,"coefficient",void 0);let Rs=Ms=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ms.prototype)}};Rs=Ms=u([_({type:N.Sequence,itemType:Vn})],Rs);class dt{constructor(t={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer})],dt.prototype,"version",void 0),u([f({type:k.Integer,converter:ge})],dt.prototype,"modulus",void 0),u([f({type:k.Integer,converter:ge})],dt.prototype,"publicExponent",void 0),u([f({type:k.Integer,converter:ge})],dt.prototype,"privateExponent",void 0),u([f({type:k.Integer,converter:ge})],dt.prototype,"prime1",void 0),u([f({type:k.Integer,converter:ge})],dt.prototype,"prime2",void 0),u([f({type:k.Integer,converter:ge})],dt.prototype,"exponent1",void 0),u([f({type:k.Integer,converter:ge})],dt.prototype,"exponent2",void 0),u([f({type:k.Integer,converter:ge})],dt.prototype,"coefficient",void 0),u([f({type:Rs,optional:!0})],dt.prototype,"otherPrimeInfos",void 0);class Us{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.Integer,converter:ge})],Us.prototype,"modulus",void 0),u([f({type:k.Integer,converter:ge})],Us.prototype,"publicExponent",void 0);var Ls;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Ls||(Ls={}));const He=Ls;/*! *****************************************************************************
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;/*! *****************************************************************************
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 Hs=function(e,t){return Hs=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])},Hs(e,t)};function Fs(e,t){Hs(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(p){try{d(i.next(p))}catch(y){a(y)}}function l(p){try{d(i.throw(p))}catch(y){a(y)}}function d(p){p.done?s(p.value):o(p.value).then(c,l)}d((i=i.apply(e,t||[])).next())})}function 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(p){return l([d,p])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(p){d=[6,p],o=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function jn(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 Dn(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 rr(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Dn(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 Pl(e){return!!e.useClass}function qs(e){return!!e.useFactory}var Ml=function(){function e(t){this.wrap=t,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return e.prototype.createProxy=function(t){var r=this,i={},o=!1,s,a=function(){return o||(s=t(r.wrap()),o=!0),s};return new Proxy(i,this.createHandler(a))},e.prototype.createHandler=function(t){var r={},i=function(o){r[o]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=t();var c=Reflect[o];return c.apply(void 0,rr(s))}};return this.reflectMethods.forEach(i),r},e}();function _r(e){return typeof e=="string"||typeof e=="symbol"}function lh(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function Rl(e){return typeof e=="object"&&"token"in e&&"transform"in e}function uh(e){return typeof e=="function"||e instanceof Ml}function $n(e){return!!e.useToken}function Pn(e){return e.useValue!=null}function dh(e){return Pl(e)||Pn(e)||$n(e)||qs(e)}var Ks=function(){function e(){this._registryMap=new Map}return e.prototype.entries=function(){return this._registryMap.entries()},e.prototype.getAll=function(t){return this.ensure(t),this._registryMap.get(t)},e.prototype.get=function(t){this.ensure(t);var r=this._registryMap.get(t);return r[r.length-1]||null},e.prototype.set=function(t,r){this.ensure(t),this._registryMap.get(t).push(r)},e.prototype.setAll=function(t,r){this._registryMap.set(t,r)},e.prototype.has=function(t){return this.ensure(t),this._registryMap.get(t).length>0},e.prototype.clear=function(){this._registryMap.clear()},e.prototype.ensure=function(t){this._registryMap.has(t)||this._registryMap.set(t,[])},e}(),fh=function(e){Fs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Ks),Ul=function(){function e(){this.scopedResolutions=new Map}return e}();function 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=" "),rr([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 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(`
89
89
  `).map(function(i){return r+i})).join(`
90
- `)}function yh(e,t,r){var i=Dn(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 gh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var mh=function(e){Fs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Ks),bh=function(e){Fs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Ks),wh=function(){function e(){this.preResolution=new mh,this.postResolution=new bh}return e}(),Ll=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:He.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! "+rr(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&$n(l.provider)?a=l.provider:a=null}if((i.lifecycle===He.Singleton||i.lifecycle==He.ContainerScoped||i.lifecycle==He.ResolutionScoped)&&(Pn(o)||qs(o)))throw new Error('Cannot use lifecycle "'+He[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),_r(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),_r(t)){if(_r(r))return this.register(t,{useToken:r},{lifecycle:He.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:He.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!_r(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:He.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Ul),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&_r(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var o=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}if(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=jn(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=jn(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(p){o={error:p}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===He.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===He.Singleton,o=t.options.lifecycle===He.ContainerScoped,s=i||o,a;return Pn(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):Pl(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===He.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Ul),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&_r(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=jn(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=Dn(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Pn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var o=jn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=Dn(s.value,2),c=a[0],l=a[1];l.some(function(d){var p=d.options;return p.lifecycle===He.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===He.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 Ml)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=Ll.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,rr([void 0],a)))}();return gh(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)?Rl(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,rr([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,rr([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Rl(o)?(l=i.resolve(o.transform,t)).transform.apply(l,rr([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}(),Xe=new vh;function zs(){return function(e){Ll.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 Mn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:k.ObjectIdentifier})],Mn.prototype,"attrId",void 0),u([f({type:k.Any,repeated:"set"})],Mn.prototype,"attrValues",void 0);let Hl=Ws=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};Hl=Ws=u([_({type:N.Sequence,itemType:Mn})],Hl);var Gs;let Fl=Gs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Gs.prototype)}};Fl=Gs=u([_({type:N.Sequence,itemType:Cr})],Fl);class ql{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],ql.prototype,"certId",void 0),u([f({type:k.Any,context:0})],ql.prototype,"certValue",void 0);class Kl{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Kl.prototype,"crlId",void 0),u([f({type:k.Any,context:0})],Kl.prototype,"crltValue",void 0);class zl extends ie{}let Rn=class{constructor(t={}){this.encryptionAlgorithm=new L,this.encryptedData=new zl,Object.assign(this,t)}};u([f({type:L})],Rn.prototype,"encryptionAlgorithm",void 0),u([f({type:zl})],Rn.prototype,"encryptedData",void 0);var Js,Ys;(function(e){e[e.v1=0]="v1"})(Ys||(Ys={}));class Wl extends ie{}let Zs=Js=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Js.prototype)}};Zs=Js=u([_({type:N.Sequence,itemType:Ct})],Zs);class pi{constructor(t={}){this.version=Ys.v1,this.privateKeyAlgorithm=new L,this.privateKey=new Wl,Object.assign(this,t)}}u([f({type:k.Integer})],pi.prototype,"version",void 0),u([f({type:L})],pi.prototype,"privateKeyAlgorithm",void 0),u([f({type:Wl})],pi.prototype,"privateKey",void 0),u([f({type:Zs,implicit:!0,context:0,optional:!0})],pi.prototype,"attributes",void 0);let Gl=class extends pi{};Gl=u([_({type:N.Sequence})],Gl);let Jl=class extends Rn{};Jl=u([_({type:N.Sequence})],Jl);class Yl{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Yl.prototype,"secretTypeId",void 0),u([f({type:k.Any,context:0})],Yl.prototype,"secretValue",void 0);class hi{constructor(t={}){this.mac=new Tn,this.macSalt=new ie,this.iterations=1,Object.assign(this,t)}}u([f({type:Tn})],hi.prototype,"mac",void 0),u([f({type:ie})],hi.prototype,"macSalt",void 0),u([f({type:k.Integer,defaultValue:1})],hi.prototype,"iterations",void 0);class Un{constructor(t={}){this.version=3,this.authSafe=new Cr,this.macData=new hi,Object.assign(this,t)}}u([f({type:k.Integer})],Un.prototype,"version",void 0),u([f({type:Cr})],Un.prototype,"authSafe",void 0),u([f({type:hi,optional:!0})],Un.prototype,"macData",void 0);var Qs;class Ln{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:k.ObjectIdentifier})],Ln.prototype,"bagId",void 0),u([f({type:k.Any,context:0})],Ln.prototype,"bagValue",void 0),u([f({type:Mn,repeated:"set",optional:!0})],Ln.prototype,"bagAttributes",void 0);let Zl=Qs=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,Qs.prototype)}};Zl=Qs=u([_({type:N.Sequence,itemType:Ln})],Zl);var Xs,ea,ta;const Ql="1.2.840.113549.1.9",Xl=`${Ql}.7`,ra=`${Ql}.14`;let Hn=class extends Ee{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:k.IA5String})],Hn.prototype,"ia5String",void 0),Hn=u([_({type:N.Choice})],Hn);let eu=class extends Cr{};eu=u([_({type:N.Sequence})],eu);let tu=class extends Un{};tu=u([_({type:N.Sequence})],tu);let ru=class extends Rn{};ru=u([_({type:N.Sequence})],ru);let ia=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.IA5String})],ia.prototype,"value",void 0),ia=u([_({type:N.Choice})],ia);let iu=class extends Hn{};iu=u([_({type:N.Choice})],iu);let nu=class extends Ee{};nu=u([_({type:N.Choice})],nu);let na=class{constructor(t=new Date){this.value=t}};u([f({type:k.GeneralizedTime})],na.prototype,"value",void 0),na=u([_({type:N.Choice})],na);let ou=class extends Ee{};ou=u([_({type:N.Choice})],ou);let oa=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:k.PrintableString})],oa.prototype,"value",void 0),oa=u([_({type:N.Choice})],oa);let Fn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.PrintableString})],Fn.prototype,"value",void 0),Fn=u([_({type:N.Choice})],Fn);let su=class extends Fn{};su=u([_({type:N.Choice})],su);let au=class extends Ee{};au=u([_({type:N.Choice})],au);let sa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.ObjectIdentifier})],sa.prototype,"value",void 0),sa=u([_({type:N.Choice})],sa);let cu=class extends Ve{};cu=u([_({type:N.Choice})],cu);let aa=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:k.Integer})],aa.prototype,"value",void 0),aa=u([_({type:N.Choice})],aa);let lu=class extends Bt{};lu=u([_({type:N.Sequence})],lu);let qn=class extends Ee{};qn=u([_({type:N.Choice})],qn);let uu=Xs=class extends Zt{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};uu=Xs=u([_({type:N.Sequence})],uu);let du=ea=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};du=ea=u([_({type:N.Set,itemType:br})],du);let ca=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:k.BmpString})],ca.prototype,"value",void 0),ca=u([_({type:N.Choice})],ca);let la=class extends L{};la=u([_({type:N.Sequence})],la);let fu=ta=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};fu=ta=u([_({type:N.Sequence,itemType:la})],fu);var ua;let Kn=ua=class extends ae{constructor(t){super(t),Object.setPrototypeOf(this,ua.prototype)}};Kn=ua=u([_({type:N.Sequence,itemType:Ct})],Kn);class Tr{constructor(t={}){this.version=0,this.subject=new Ce,this.subjectPKInfo=new St,this.attributes=new Kn,Object.assign(this,t)}}u([f({type:k.Integer})],Tr.prototype,"version",void 0),u([f({type:Ce})],Tr.prototype,"subject",void 0),u([f({type:St})],Tr.prototype,"subjectPKInfo",void 0),u([f({type:Kn,implicit:!0,context:0})],Tr.prototype,"attributes",void 0);class yi{constructor(t={}){this.certificationRequestInfo=new Tr,this.signatureAlgorithm=new L,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Tr})],yi.prototype,"certificationRequestInfo",void 0),u([f({type:L})],yi.prototype,"signatureAlgorithm",void 0),u([f({type:k.BitString})],yi.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){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);/*!
91
91
  * MIT License
92
92
  *
93
93
  * Copyright (c) Peculiar Ventures. All rights reserved.
@@ -110,39 +110,39 @@ ${t.join(`
110
110
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
111
111
  * SOFTWARE.
112
112
  *
113
- */const zn="crypto.algorithm";class kh{getAlgorithms(){return Xe.resolveAll(zn)}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";Xe.registerSingleton(Wn,kh);var Gn;const Fe="1.3.36.3.3.2.8.1.1",pu=`${Fe}.1`,hu=`${Fe}.2`,yu=`${Fe}.3`,gu=`${Fe}.4`,mu=`${Fe}.5`,bu=`${Fe}.6`,wu=`${Fe}.7`,vu=`${Fe}.8`,ku=`${Fe}.9`,Cu=`${Fe}.10`,Su=`${Fe}.11`,xu=`${Fe}.12`,Au=`${Fe}.13`,Bu=`${Fe}.14`,Iu="brainpoolP160r1",Eu="brainpoolP160t1",Nu="brainpoolP192r1",Ou="brainpoolP192t1",_u="brainpoolP224r1",Tu="brainpoolP224t1",Vu="brainpoolP256r1",ju="brainpoolP256t1",Du="brainpoolP320r1",$u="brainpoolP320t1",Pu="brainpoolP384r1",Mu="brainpoolP384t1",Ru="brainpoolP512r1",Uu="brainpoolP512t1",me="ECDSA";let gi=Gn=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case me.toLowerCase():if("hash"in t)switch((typeof t.hash=="string"?t.hash:t.hash.name).toLowerCase()){case"sha-1":return Kp;case"sha-256":return zp;case"sha-384":return Wp;case"sha-512":return Gp}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Al;break;case"K-256":r=Gn.SECP256K1;break;case"P-384":r=Bl;break;case"P-521":r=Il;break;case Iu:r=pu;break;case Eu:r=hu;break;case Nu:r=yu;break;case Ou:r=gu;break;case _u:r=mu;break;case Tu:r=bu;break;case Vu:r=wu;break;case ju:r=vu;break;case Du:r=ku;break;case $u:r=Cu;break;case Pu:r=Su;break;case Mu:r=xu;break;case Ru:r=Au;break;case Uu:r=Bu;break}if(r)return new L({algorithm:ui,parameters:H.serialize(new Nr({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Ts:return{name:me,hash:{name:"SHA-1"}};case Vs:return{name:me,hash:{name:"SHA-256"}};case js:return{name:me,hash:{name:"SHA-384"}};case Ds:return{name:me,hash:{name:"SHA-512"}};case ui:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(H.parse(t.parameters,Nr).namedCurve){case Al:return{name:me,namedCurve:"P-256"};case Gn.SECP256K1:return{name:me,namedCurve:"K-256"};case Bl:return{name:me,namedCurve:"P-384"};case Il:return{name:me,namedCurve:"P-521"};case pu:return{name:me,namedCurve:Iu};case hu:return{name:me,namedCurve:Eu};case yu:return{name:me,namedCurve:Nu};case gu:return{name:me,namedCurve:Ou};case mu:return{name:me,namedCurve:_u};case bu:return{name:me,namedCurve:Tu};case wu:return{name:me,namedCurve:Vu};case vu:return{name:me,namedCurve:ju};case ku:return{name:me,namedCurve:Du};case Cu:return{name:me,namedCurve:$u};case Su:return{name:me,namedCurve:Pu};case xu:return{name:me,namedCurve:Mu};case Au:return{name:me,namedCurve:Ru};case Bu:return{name:me,namedCurve:Uu}}}}return null}};gi.SECP256K1="1.3.132.0.10",gi=Gn=u([zs()],gi),Xe.registerSingleton(zn,gi);const Lu=Symbol("name"),Hu=Symbol("value");class ce{constructor(t,r={},i=""){this[Lu]=t,this[Hu]=i;for(const o in r)this[o]=r[o]}}ce.NAME=Lu,ce.VALUE=Hu;class Ch{static toTextObject(t){const r=new ce("Algorithm Identifier",{},jt.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case ui:{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 jt{static toString(t){const r=this.items[t];return r||t}}jt.items={[Ol]:"sha1",[_l]:"sha224",[Tl]:"sha256",[Vl]:"sha384",[jl]:"sha512",[Or]:"rsaEncryption",[En]:"sha1WithRSAEncryption",[eh]:"sha224WithRSAEncryption",[$s]:"sha256WithRSAEncryption",[Nn]:"sha384WithRSAEncryption",[On]:"sha512WithRSAEncryption",[ui]:"ecPublicKey",[Ts]:"ecdsaWithSHA1",[xl]:"ecdsaWithSHA224",[Vs]:"ecdsaWithSHA256",[js]:"ecdsaWithSHA384",[Ds]:"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 ir{static serialize(t){return this.serializeObj(t).join(`
114
- `)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[ce.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ce.NAME]}:${s}`),o=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${o}${d}${l}`);else if(l instanceof Date)i.push(`${o}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const p of l)p[ce.NAME]=c,i.push(...this.serializeObj(p,r));else if(l instanceof ce)l[ce.NAME]=c,i.push(...this.serializeObj(l,r));else if(D.isBufferSource(l))c?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const p=l.toTextObject();p[ce.NAME]=c,i.push(...this.serializeObj(p,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(t,r=0){const i=this.pad(r),o=D.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)}}ir.oidSerializer=jt,ir.algorithmSerializer=Ch;class Dt{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=D.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Dt?za(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return H.toString(this.rawData);case"text":return ir.serialize(this.toTextObject());case"hex":return R.ToHex(this.rawData);case"base64":return R.ToBase64(this.rawData);case"base64url":return R.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const t=this.toTextObjectEmpty();return t[""]=this.rawData,t}toTextObjectEmpty(t){return new ce(this.getTextName(),{},t)}}Dt.NAME="ASN";class ft extends Dt{constructor(...t){let r;D.isBufferSource(t[0])?r=D.toArrayBuffer(t[0]):r=H.serialize(new nt({extnID:t[0],critical:t[1],extnValue:new ie(D.toArrayBuffer(t[2]))})),super(r,nt)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[ce.NAME]===ft.NAME&&(t[ce.NAME]=jt.toString(this.type)),t}}var Fu;class nr{static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&t.extractable!==void 0}constructor(){this.items=new Map,this[Fu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(nr.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=nr.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(nr.DEFAULT,t);return this}}Fu=Symbol.toStringTag,nr.DEFAULT="default";const Ge=new nr,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 qe=new qu;qe.register("CN","2.5.4.3"),qe.register("L","2.5.4.7"),qe.register("ST","2.5.4.8"),qe.register("O","2.5.4.10"),qe.register("OU","2.5.4.11"),qe.register("C","2.5.4.6"),qe.register("DC","0.9.2342.19200300.100.1.25"),qe.register("E","1.2.840.113549.1.9.1"),qe.register("G","2.5.4.42"),qe.register("I","2.5.4.43"),qe.register("SN","2.5.4.4"),qe.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 $t{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 Ce;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 Ce?this.asn=t:D.isBufferSource(t)?this.asn=H.parse(t,Ce):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||qe.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)||qe.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 Ce,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=i.exec(`${t},`);){let[,a,c]=o;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),o[3]=l);const d=o[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const p=new Gr({type:a});if(c.charAt(0)==="#")p.value.anyValue=R.FromHex(c.slice(1));else{const y=/"(.*?[^\\])?"/.exec(c);y&&(c=y[1]),c=c.replace(/\\0a/ig,`
115
- `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?p.value.ia5String=c:$t.isASCII(c)?p.value.printableString=c:p.value.utf8String=c}s==="+"?r[r.length-1].push(p):r.push(new pr([p])),s=d}return r}fromJSON(t){const r=new Ce;for(const i of t){const o=new pr;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Gr({type:a});if(typeof l=="object")for(const p in l)switch(p){case"ia5String":d.value.ia5String=l[p];break;case"utf8String":d.value.utf8String=l[p];break;case"universalString":d.value.universalString=l[p];break;case"bmpString":d.value.bmpString=l[p];break;case"printableString":d.value.printableString=l[p];break}else l[0]==="#"?d.value.anyValue=R.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return 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]||Ge.get()):i=t[0]||Ge.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const Ku="Cannot initialize GeneralName from ASN.1 data.",zu=`${Ku} Unsupported string format in use.`,Ih=`${Ku} 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,Gu="1.3.6.1.4.1.311.25.1",Ju="1.3.6.1.4.1.311.20.2.3",da="dns",fa="dn",pa="email",ha="ip",ya="url",ga="guid",ma="upn",Jn="id";class Yu extends Dt{constructor(...t){let r;if(t.length===2)switch(t[0]){case fa:{const i=new $t(t[1]).toArrayBuffer(),o=H.parse(i,Ce);r=new Q({directoryName:o});break}case da:r=new Q({dNSName:t[1]});break;case pa:r=new Q({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 Q({otherName:new Jr({typeId:Gu,value:H.serialize(new ie(R.FromHex(o)))})});break}case ha:r=new Q({iPAddress:t[1]});break;case Jn:r=new Q({registeredID:t[1]});break;case ma:{r=new Q({otherName:new Jr({typeId:Ju,value:H.serialize(Gc.toASN(t[1]))})});break}case ya:r=new Q({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else D.isBufferSource(t[0])?r=H.parse(t[0],Q):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=da,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=pa,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=ha,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=ya,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=Jn,this.value=t.registeredID;else if(t.directoryName!=null)this.type=fa,this.value=new $t(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===Gu){this.type=ga;const r=H.parse(t.otherName.value,ie),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===Ju)this.type=ma,this.value=H.parse(t.otherName.value,Ee).toString();else throw new Error(zu);else throw new Error(zu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case fa:case da:case ga:case ha:case Jn:case ma:case ya:t=this.type.toUpperCase();break;case pa:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===Jn&&(r=jt.toString(r)),new ce(t,void 0,r)}}class mi extends Dt{constructor(t){let r;if(t instanceof Pe)r=t;else if(Array.isArray(t)){const i=[];for(const o of t)if(o instanceof Q)i.push(o);else{const s=H.parse(new Yu(o.type,o.value).rawData,Q);i.push(s)}r=new Pe(i)}else if(D.isBufferSource(t))r=H.parse(t,Pe);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let o=null;try{o=new Yu(i)}catch{continue}r.push(o)}this.items=r}toJSON(){return this.items.map(t=>t.toJSON())}toTextObject(){const t=super.toTextObjectEmpty();for(const r of this.items){const i=r.toTextObject();let o=t[i[ce.NAME]];Array.isArray(o)||(o=[],t[i[ce.NAME]]=o),o.push(i)}return t}}mi.NAME="GeneralNames";const bi="-{5}",wi="\\n",Eh=`[^${wi}]+`,Nh=`${bi}BEGIN (${Eh}(?=${bi}))${bi}`,Oh=`${bi}END \\1${bi}`,Vr="\\n",_h=`[^:${wi}]+`,Th=`(?:[^${wi}]+${Vr}(?: +[^${wi}]+${Vr})*)`,Vh=`(?:[a-zA-Z0-9=+/]+${Vr})+`,Zu=`${Nh}${Vr}(?:((?:${_h}: ${Th})+))?${Vr}?(${Vh})${Oh}`;class Je{static isPem(t){return typeof t=="string"&&new RegExp(Zu,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(Zu,"g"),i=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${wi}]+`,"g"),""),a={type:o[1],headers:[],rawData:R.FromBase64(s)},c=o[2];if(c){const l=c.split(new RegExp(Vr,"g"));let d=null;for(const p of l){const[y,x]=p.split(/:(.*)/);if(x===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=y.trim()}else d&&a.headers.push(d),d={key:y,value:x.trim()}}d&&a.headers.push(d)}i.push(a)}return i}static decode(t){return this.decodeWithHeaders(t).map(i=>i.rawData)}static decodeFirst(t){const r=this.decode(t);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(t,r){if(Array.isArray(t)){const i=new Array;return r?t.forEach(o=>{if(!D.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:D.toArrayBuffer(o)}))}):t.forEach(o=>{if(!("type"in o))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(o))}),i.join(`
116
- `)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:D.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
- `)}}Je.CertificateTag="CERTIFICATE",Je.CrlTag="CRL",Je.CertificateRequestTag="CERTIFICATE REQUEST",Je.PublicKeyTag="PUBLIC KEY",Je.PrivateKeyTag="PRIVATE KEY";class It extends Dt{static isAsnEncoded(t){return D.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Je.isPem(t))return Je.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 Je.isPem(r)?Je.decode(r)[0]:R.isHex(r)?R.FromHex(r):R.isBase64(r)?R.FromBase64(r):R.isBase64Url(r)?R.FromBase64Url(r):D.toArrayBuffer(t)}}constructor(...t){It.isAsnEncoded(t[0])?super(It.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Je.encode(this.rawData,this.tag);default:return super.toString(t)}}}class or extends It{constructor(t){It.isAsnEncoded(t)?super(t,St):super(t),this.tag=Je.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]||Ge.get()):r=t[0]||Ge.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=Xe.resolve(Wn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Or:{const o=H.parse(t.subjectPublicKey,Us),s=D.toUint8Array(o.modulus);i.publicExponent=D.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]||Ge.get()):i=t[0]||Ge.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ge.get());const r=H.parse(this.rawData,St);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,St);switch(t.Algorithm=ir.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case ui:t["EC Point"]=r.subjectPublicKey;break;case Or:default:t["Raw Data"]=r.subjectPublicKey}return t}}class pt{static register(t,r){this.items.set(t,r)}static create(t){const r=new ft(t),i=this.items.get(r.type);return i?new i(t):r}}pt.items=new Map;const Yn="crypto.signatureFormatter";class jh{toAsnSignature(t,r){return D.toArrayBuffer(r)}toWebSignature(t,r){return D.toArrayBuffer(r)}}class Zn extends It{constructor(t){It.isAsnEncoded(t)?super(t,mr):super(t),this.tag=Je.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=H.serialize(r),this.serialNumber=R.ToHex(r.serialNumber),this.subjectName=new $t(r.subject),this.subject=new $t(r.subject).toString(),this.issuerName=new $t(r.issuer),this.issuer=this.issuerName.toString();const i=Xe.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=>pt.create(H.serialize(a)))),this.publicKey=new or(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=Ge.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 or)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(D.isBufferSource(s)){const d=new or(s);i={...d.algorithm,...this.signatureAlgorithm},o=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=Xe.resolveAll(Yn).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,o,c,this.tbs);if(t.signatureOnly)return l;{const p=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<p&&p<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Ge.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Ge.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,mr),i=r.tbsCertificate,o=new ce("",{Version:`${gr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":ir.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ce("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(o["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(o["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ce("");for(const a of this.extensions){const c=a.toTextObject();s[c[ce.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ce("",{Algorithm:ir.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}Zn.NAME="Certificate";class vi extends ft{static async create(t,r=!1,i=Ge.get()){if(t instanceof Zn||nr.isCryptoKey(t)){const o=t instanceof Zn?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new or(s).getKeyIdentifier(i);return new vi(R.ToHex(c),r)}else return new vi(t,r)}constructor(...t){if(D.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Yt({keyIdentifier:new Do(R.FromHex(t[0]))});super(jo,t[1],H.serialize(r))}else{const r=t[0],i=r.name instanceof mi?H.parse(r.name.rawData,Pe):r.name,o=new Yt({authorityCertIssuer:i,authorityCertSerialNumber:R.FromHex(r.serialNumber)});super(jo,t[1],H.serialize(o))}}onInit(t){super.onInit(t);const r=H.parse(t.extnValue,Yt);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,Yt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new mi(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}vi.NAME="Authority Key Identifier";class Qu extends ft{constructor(...t){if(D.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Yi);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new Yi({cA:t[0],pathLenConstraint:t[1]});super(tl,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}}Qu.NAME="Basic Constraints";var Xu;(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"})(Xu||(Xu={}));class ed extends ft{constructor(...t){if(D.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,tn);this.usages=r.map(i=>i)}else{const r=new tn(t[0]);super(al,t[1],H.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>jt.toString(r)).join(", "),t}}ed.NAME="Extended Key Usages";var ba;(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"})(ba||(ba={}));class wa extends ft{constructor(...t){if(D.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Yo);this.usages=r.toNumber()}else{const r=new Yo(t[0]);super(ll,t[1],H.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,Yo);return t[""]=r.toJSON().join(", "),t}}wa.NAME="Key Usages";class Qn extends ft{static async create(t,r=!1,i=Ge.get()){let o;t instanceof or?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:D.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new or(o).getKeyIdentifier(i);return new Qn(R.ToHex(a),r)}constructor(...t){if(D.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Tt);this.keyId=R.ToHex(r)}else{const r=typeof t[0]=="string"?R.FromHex(t[0]):t[0],i=new Tt(r);super(yl,t[1],H.serialize(i)),this.keyId=R.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,Tt);return t[""]=r,t}}Qn.NAME="Subject Key Identifier";class va extends ft{constructor(...t){D.isBufferSource(t[0])?super(t[0]):super(pl,t[1],new mi(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=H.parse(t.extnValue,ts);this.names=new mi(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}va.NAME="Subject Alternative Name";class td extends ft{constructor(...t){var r;if(D.isBufferSource(t[0])){super(t[0]);const i=H.parse(this.value,Xi);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new Xi(i.map(a=>new Qi({policyIdentifier:a})));super(il,o,H.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ce("",{},jt.toString(r))),t}}td.NAME="Certificate Policies",pt.register(il,td);class jr extends Dt{constructor(...t){let r;if(D.isBufferSource(t[0]))r=D.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>D.toArrayBuffer(s)):[];r=H.serialize(new Ct({type:i,values:o}))}super(r,Ct)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ce("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ce.NAME]===jr.NAME&&(t[ce.NAME]=jt.toString(this.type)),t}}jr.NAME="Attribute";class rd extends jr{constructor(...t){var r;if(D.isBufferSource(t[0]))super(t[0]);else{const i=new qn({printableString:t[0]});super(Xl,[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[ce.VALUE]=this.password,t}}rd.NAME="Challenge Password";class ka extends jr{constructor(...t){var r;if(D.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new Zt;for(const s of i)o.push(H.parse(s.rawData,nt));super(ra,[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],Zt);this.items=r.map(i=>pt.create(H.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ce.NAME]]=i;return t}}ka.NAME="Extensions";class Xn{static register(t,r){this.items.set(t,r)}static create(t){const r=new jr(t),i=this.items.get(r.type);return i?new i(t):r}}Xn.items=new Map;let Ca=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:En,parameters:null});case"sha-256":return new L({algorithm:$s,parameters:null});case"sha-384":return new L({algorithm:Nn,parameters:null});case"sha-512":return new L({algorithm:On,parameters:null})}}else return new L({algorithm:Or,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Or:return{name:"RSASSA-PKCS1-v1_5"};case En:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case $s:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Nn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case On:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ca=u([zs()],Ca),Xe.registerSingleton(zn,Ca);class et{addPadding(t,r){const i=D.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=D.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=et.namedCurveSize.get(i)||et.defaultNamedCurveSize,s=new In,a=D.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,In),o=t.namedCurve,s=et.namedCurveSize.get(o)||et.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return Yf(a,c)}return null}}et.namedCurveSize=new Map,et.defaultNamedCurveSize=32;const id="1.3.101.110",nd="1.3.101.111",od="1.3.101.112",sd="1.3.101.113";let Sa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=od;break;case"ed448":r=sd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=id;break;case"x448":r=nd;break}}return r?new L({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case od:return{name:"EdDSA",namedCurve:"Ed25519"};case sd:return{name:"EdDSA",namedCurve:"Ed448"};case id:return{name:"ECDH-ES",namedCurve:"X25519"};case nd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Sa=u([zs()],Sa),Xe.registerSingleton(zn,Sa);class Dh extends It{constructor(t){It.isAsnEncoded(t)?super(t,yi):super(t),this.tag=Je.CertificateRequestTag}onInit(t){this.tbs=H.serialize(t.certificationRequestInfo),this.publicKey=new or(t.certificationRequestInfo.subjectPKInfo);const r=Xe.resolve(Wn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>Xn.create(H.serialize(o)));const i=this.getAttribute(ra);this.extensions=[],i instanceof ka&&(this.extensions=i.items),this.subjectName=new $t(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=Ge.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=Xe.resolveAll(Yn).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,yi),i=r.certificationRequestInfo,o=new ce("",{Version:`${gr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ce("");for(const a of this.attributes){const c=a.toTextObject();s[c[ce.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ce("",{Algorithm:ir.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Dh.NAME="PKCS#10 Certificate Request";var ad;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ad||(ad={})),pt.register(tl,Qu),pt.register(al,ed),pt.register(ll,wa),pt.register(yl,Qn),pt.register(jo,vi),pt.register(pl,va),Xn.register(Xl,rd),Xn.register(ra,ka),Xe.registerSingleton(Yn,jh),Xe.registerSingleton(Yn,et),et.namedCurveSize.set("P-256",32),et.namedCurveSize.set("K-256",32),et.namedCurveSize.set("P-384",48),et.namedCurveSize.set("P-521",66);function cd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new Zn(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof va){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const p=d.type,y=l[p]??[];return{...l,[p]:[...y,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof wa){const s=Object.values(ba),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const p=s[s.length/2+d];if(o.usages&p){const y=s[d];c.push(y)}return c},[]);i.keyUsage=a}return i}}}function $h(){const e=cd(),t=n.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(o);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Ph={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Mh(){const e=cr.createI18n("en-us",Ph);return{i18n:e,i18nT:cr.i18nTComponent(e)}}const ht={useCertificate:$h,useI18n:Mh,useX509:cd},ki={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",ld="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"},Wh=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)),Gh=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ld,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return ld}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",zh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Wh],8,Kh))]),_:1},8,["aria-hidden","style"]))}}),Jh=Fh(Gh,[["__scopeId","data-v-641e0aee"]]),Yh="16px",Zh={class:"kong-ui-copy-uuid"},Qh=["onClick"],ud=15,Xh=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const r=e,{t:i}=cr.createI18n("en-us",Lh),o=r.notify||n.inject(Hh,()=>{}),s=n.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),a=n.computed(()=>!!(r.tooltip&&r.successTooltip)),c=n.ref(r.tooltip),l=n.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=n.computed(()=>{var x;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(x=r.uuid)==null?void 0:x.substring(0,5)}`:r.uuid}),p=x=>{c.value=x,setTimeout(()=>{c.value=r.tooltip},1800)},y=x=>{var C,h;if(!x(r.uuid)){typeof o=="function"&&o({type:"error",message:i("message.fail")}),a.value?p(i("message.fail")):t("error",r.uuid);return}const g=((C=r.uuid)==null?void 0:C.length)>ud,m=r.format==="hidden"||r.format==="redacted"?i("message.success.prefix"):`"${((h=r.uuid)==null?void 0:h.substring(0,ud))+(g?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${m}${i("message.success.content")}`}),a.value?p(r.successTooltip):t("success",r.uuid)};return(x,C)=>{const h=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Zh,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(d.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(l.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(h,null,{default:n.withCtx(({copyToClipboard:g})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>y(g),["stop"])},[n.createVNode(n.unref(Jh),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Yh),title:n.unref(i)("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 xa=(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))(xa||{}),sr=(e=>(e.Edit="edit",e.Create="create",e))(sr||{}),Pt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Pt||{}),ne=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ne||{}),ue=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(ue||{});function Aa(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 Ba="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(Ba));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(Ba,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(Ba)}}}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 Ia(){const e=cr.createI18n("en-us",hy);return{i18n:e,i18nT:cr.i18nTComponent(e)}}function dd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const s of o){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function yy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=Aa({headers:e.requestHeaders}),{i18n:{t:s}}=Ia(),{debounce:a}=ry(),c=a(async A=>{await w(A)},200),l=n.ref(!1),d=n.ref(""),p=n.ref(""),y=n.ref([]),x=n.ref([]),C=n.ref(void 0),h=n.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=dd(),v=async()=>{try{l.value=!0;const{data:A}=await o.get(`${g}?size=${r}`);A!=null&&A.next||(C.value=i.fetchedItemsKey in A?A[i.fetchedItemsKey]:[]),x.value=i.fetchedItemsKey in A?A[i.fetchedItemsKey]:[],y.value=x.value}catch{y.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},b=n.ref(""),w=async A=>{var F,Z,I;if(b.value!==A)if(b.value=A||"",C.value===void 0)try{if(l.value=!0,d.value="",p.value="",e.app==="konnect"){let E=g+"";A&&(E+=`/${A}`);const{data:M}=await o.get(`${E}?size=${r}`);i.fetchedItemsKey in M?y.value=M[i.fetchedItemsKey]:M!=null&&M.id?y.value=[M]:y.value=[]}else if(A){const E=[];m(A)&&i.searchKeys.includes("id")?E.push((async()=>{const{data:U}=await o.get(`${g}/${A}`);return[U[i.fetchedItemsKey]??U]})()):E.push(...i.searchKeys.filter(U=>U!=="id").map(async U=>{const{data:$}=await o.get(`${g}?${U}=${A}`);return $[i.fetchedItemsKey]}));const M=await Promise.all(E),q=new Set;y.value=[],(F=M==null?void 0:M.forEach)==null||F.call(M,U=>{var $;($=U==null?void 0:U.forEach)==null||$.call(U,V=>{q.has(V.id)||(q.add(V.id),y.value.push(V))})})}else y.value=x.value}catch(E){((Z=E==null?void 0:E.response)==null?void 0:Z.status)===404?p.value=s("debouncedFilter.errors.invalid"):(y.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,p.value="",A?(y.value=(I=C.value)==null?void 0:I.filter(E=>{var M;let q=!1;for(const U of i.searchKeys){const $=typeof E[U]=="string"?(M=E[U])==null?void 0:M.toLowerCase():E[U];$!=null&&$.includes(A.toLowerCase())&&(q=!0)}return q}),(!y.value||!y.value.length)&&(p.value=s("debouncedFilter.errors.invalid"))):y.value=C.value,l.value=!1};return{loading:l,error:d,validationError:p,results:y,allRecords:C,loadItems:v,debouncedQueryChange:c}}function gy(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 my(){const{i18n:{t:e}}=Ia();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 fd(e,t){const r=n.ref(n.unref(e)),i=n.ref(n.unref(t)),o=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:p,sortColumnOrder:y,query:x}=a;try{let C=new URL(s.value.href);return o.value&&x?(C.search="",C=r.value.app==="konnect"?new URL(`${C.href}?filter[name][contains]=${x}`):new URL(`${C.href}/${x}/`)):(o.value||new URLSearchParams(x).forEach((h,g)=>{C.searchParams.append(g,h)}),p&&C.searchParams.append("sort_by",p),y==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(l))),d&&c!==1&&C.searchParams.append("offset",String(d)),C.href}catch(C){return console.error("RouteList(fetcher)",C),i.value}}}function wy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=Aa({headers:e.requestHeaders}),s=fd(e,i),a=n.ref({status:Pt.Idle});return{fetcher:async c=>{try{a.value={status:Pt.Loading};const l=s(c),{data:d}=await o.get(l),p=r&&r.replace(/[^\w-_]/gi,"");let y;d[p]&&Array.isArray(d[p])?y=d[p]:Array.isArray(d)?y=d:y=Object.keys(d).length?[d]:[];const x={data:y,total:y.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Pt.Idle,response:x},x}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Pt.NoResults,response:d,error:l},d):(a.value={status:Pt.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 pd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,hd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(pd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},yd=e=>e==="*"||e==="x"||e==="X",gd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},ky=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Cy=(e,t)=>{if(yd(e)||yd(t))return 0;const[r,i]=ky(gd(e),gd(t));return r>i?1:r<i?-1:0},md=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Cy(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Sy=(e,t)=>{const r=hd(e),i=hd(t),o=r.pop(),s=i.pop(),a=md(r,i);return a!==0?a:o&&s?md(o.split("."),s.split(".")):o||s?o?-1:1:0},bd=(e,t,r)=>{xy(r);const i=Sy(e,t);return wd[r].includes(i)},wd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},vd=Object.keys(wd),xy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(vd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${vd.join("|")}`)},Ay=e=>typeof e=="string"&&/^[v\d]/.test(e)&&pd.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&&bd(o,a,"<")||c&&bd(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 Be={useAxios:Aa,useDebouncedFilter:yy,useDeleteUrlBuilder:gy,useErrors:my,useExternalLinkCreator:by,useFetcher:wy,useFetchUrlBuilder:fd,useHelpers:dd,useStringHelpers:vy,useI18n:Ia,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",kd="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"},$y=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)),Py=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:kd,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return kd}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Dy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),$y],8,jy))]),_:1},8,["aria-hidden","style"]))}}),My=Ty(Py,[["__scopeId","data-v-641e0aee"]]),Ry="16px",Uy={class:"kong-ui-copy-uuid"},Ly=["onClick"],Cd=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 r=e,{t:i}=cr.createI18n("en-us",Oy),o=r.notify||n.inject(_y,()=>{}),s=n.computed(()=>r.idTooltip?{label:r.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:r.uuid}),a=n.computed(()=>!!(r.tooltip&&r.successTooltip)),c=n.ref(r.tooltip),l=n.computed(()=>r.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=n.computed(()=>{var x;return r.format==="redacted"?"*****":r.format==="deleted"?`*${(x=r.uuid)==null?void 0:x.substring(0,5)}`:r.uuid}),p=x=>{c.value=x,setTimeout(()=>{c.value=r.tooltip},1800)},y=x=>{var C,h;if(!x(r.uuid)){typeof o=="function"&&o({type:"error",message:i("message.fail")}),a.value?p(i("message.fail")):t("error",r.uuid);return}const g=((C=r.uuid)==null?void 0:C.length)>Cd,m=r.format==="hidden"||r.format==="redacted"?i("message.success.prefix"):`"${((h=r.uuid)==null?void 0:h.substring(0,Cd))+(g?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${m}${i("message.success.content")}`}),a.value?p(r.successTooltip):t("success",r.uuid)};return(x,C)=>{const h=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Uy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(d.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(l.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(h,null,{default:n.withCtx(({copyToClipboard:g})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>y(g),["stop"])},[n.createVNode(n.unref(My),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Ry),title:n.unref(i)("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},Sd=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}}=Be.useI18n(),{convertKeyToTitle:i}=Be.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=n.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:n.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:n.withCtx(()=>[e.isArrayItem?(n.openBlock(),n.createElementBlock("legend",qy,[n.createElementVNode("b",null,n.toDisplayString(c.value),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(a.value),(p,y)=>(n.openBlock(),n.createBlock(Ci,{key:`${o.value}-property-${y}`,item:{key:p,label:n.unref(i)(p),value:a.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),st=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},xd=st(Ky,[["__scopeId","data-v-68ca83ec"]]),zy=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.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})])}}}),Wy=st(zy,[["__scopeId","data-v-c96811e5"]]),Gy=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.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",eg={class:"config-card-details-row"},tg=["data-testid"],rg=["data-testid"],ig=["data-testid"],ng=["data-testid"],og={key:1},sg=["data-testid"],ag=["data-testid"],cg=["data-testid"],lg=["data-testid"],ug={name:"ConfigCardItem",components:{CopyUuid:Sd,JsonCardItem:xd,StatusBadge:Gy,InternalLinkItem:Wy}},dg=n.defineComponent({...ug,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){const r=e;n.useCssVars(C=>({"0da74440":d.value?"none":`solid ${n.unref(Qy)} ${n.unref(Yy)}`,"02a039da":l.value&&a.value?"block":"flex","690f3ced":l.value&&a.value?"100%":r.slim?"50%":"25%","691182c8":l.value&&a.value?"100%":r.slim?"50%":"75%"}));const i=n.useSlots(),{i18n:{t:o,formatUnixTimeStamp:s}}=Be.useI18n(),a=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=n.computed(()=>!!(r.item.tooltip||i["label-tooltip"])),l=n.computed(()=>r.item.type===ne.Json||r.item.type===ne.JsonArray),d=n.computed(()=>r.item.type===ne.JsonArray),p=n.computed(()=>{switch(r.item.type){case ne.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case ne.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case ne.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case ne.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case ne.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:s(r.item.value)};case ne.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ne.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ne.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ne.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:C=>{t("navigation-click",C)}}};case ne.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ne.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ne.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),y=n.ref(),{isTruncated:x}=Be.useTruncationDetector(y);return(C,h)=>{const g=n.resolveComponent("KLabel"),m=n.resolveComponent("KBadge"),v=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",eg,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(C.$slots,"label",{item:e.item},()=>[n.createVNode(g,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(C.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,rg)]),key:"0"}:void 0]),1024)],!0)],8,tg),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(C.$slots,e.item.key,{rowValue:e.item.value},()=>[a.value?(n.openBlock(),n.createElementBlock("div",og,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value.tag),n.normalizeProps(n.guardReactiveProps(p.value.attrs)),{default:n.withCtx(()=>[p.value.additionalComponent==="KBadge"?(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(b,w)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-tag-${w}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${w}`,tooltip:b,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,sg)):n.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(b,w)=>(n.openBlock(),n.createBlock(n.unref(Sd),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${w}`,"data-testid":`${e.item.key}-copy-uuid-${w}`,uuid:b}),null,16,["data-testid","uuid"]))),128))],8,ag)):p.value.additionalComponent==="KMethodBadge"?(n.openBlock(),n.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(b,w)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-method-${w}`,appearance:Object.values(n.unref(Kf.BadgeMethodAppearances)).includes(b.toLowerCase())?b.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${w}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,cg)):n.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(n.openBlock(),n.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(b,w)=>(n.openBlock(),n.createBlock(xd,{key:`json-array-item-${w}`,index:w,"is-array-item":"",item:b},null,8,["index","item"]))),128))],8,lg)):(n.openBlock(),n.createBlock(v,{key:4,label:n.unref(x)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:y,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,ng))],!0)],8,ig)])}}}),Ci=st(dg,[["__scopeId","data-v-9c87856b"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ad(e){return typeof e>"u"||e===null}function fg(e){return typeof e=="object"&&e!==null}function pg(e){return Array.isArray(e)?e:Ad(e)?[]:[e]}function hg(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}function yg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function gg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var mg=Ad,bg=fg,wg=pg,vg=yg,kg=gg,Cg=hg,xe={isNothing:mg,isObject:bg,toArray:wg,repeat:vg,isNegativeZero:kg,extend:Cg};function Bd(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
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,`
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
+ `)}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+=`
118
118
 
119
- `+e.mark.snippet),i+" "+r):i}function Si(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Bd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Si.prototype=Object.create(Error.prototype),Si.prototype.constructor=Si,Si.prototype.toString=function(e){return this.name+": "+Bd(this,e)};var Me=Si;function Ea(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 Na(e,t){return xe.repeat(" ",t-e.length)+e}function Sg(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var c="",l,d,p=Math.min(e.line+t.linesAfter,o.length).toString().length,y=t.maxLength-(t.indent+p+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=Ea(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),y),c=xe.repeat(" ",t.indent)+Na((e.line-l+1).toString(),p)+" | "+d.str+`
120
- `+c;for(d=Ea(e.buffer,i[a],o[a],e.position,y),c+=xe.repeat(" ",t.indent)+Na((e.line+1).toString(),p)+" | "+d.str+`
121
- `,c+=xe.repeat("-",t.indent+p+3+d.pos)+`^
122
- `,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)d=Ea(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),y),c+=xe.repeat(" ",t.indent)+Na((e.line+l+1).toString(),p)+" | "+d.str+`
123
- `;return c.replace(/\n$/,"")}var xg=Sg,Ag=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Bg=["scalar","sequence","mapping"];function Ig(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function Eg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Ag.indexOf(r)===-1)throw new Me('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Ig(t.styleAliases||null),Bg.indexOf(this.kind)===-1)throw new Me('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ne=Eg;function Id(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}function Ng(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}function Oa(e){return this.extend(e)}Oa.prototype.extend=function(e){var t=[],r=[];if(e instanceof Ne)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 Me("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof Ne))throw new Me("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Me("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 Me("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 Ne))throw new Me("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Oa.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Id(i,"implicit"),i.compiledExplicit=Id(i,"explicit"),i.compiledTypeMap=Ng(i.compiledImplicit,i.compiledExplicit),i};var Ed=Oa,Nd=new Ne("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Od=new Ne("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),_d=new Ne("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Td=new Ed({explicit:[Nd,Od,_d]});function Og(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function _g(){return null}function Tg(e){return e===null}var Vd=new Ne("tag:yaml.org,2002:null",{kind:"scalar",resolve:Og,construct:_g,predicate:Tg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Vg(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function jg(e){return e==="true"||e==="True"||e==="TRUE"}function Dg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var jd=new Ne("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Vg,construct:jg,predicate:Dg,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function $g(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Pg(e){return 48<=e&&e<=55}function Mg(e){return 48<=e&&e<=57}function Rg(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!$g(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Pg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Mg(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function Ug(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function Lg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!xe.isNegativeZero(e)}var Dd=new Ne("tag:yaml.org,2002:int",{kind:"scalar",resolve:Rg,construct:Ug,predicate:Lg,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Hg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Fg(e){return!(e===null||!Hg.test(e)||e[e.length-1]==="_")}function qg(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 Kg=/^[-+]?[0-9]+e/;function zg(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(xe.isNegativeZero(e))return"-0.0";return r=e.toString(10),Kg.test(r)?r.replace("e",".e"):r}function Wg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||xe.isNegativeZero(e))}var $d=new Ne("tag:yaml.org,2002:float",{kind:"scalar",resolve:Fg,construct:qg,predicate:Wg,represent:zg,defaultStyle:"lowercase"}),Pd=Td.extend({implicit:[Vd,jd,Dd,$d]}),Md=Pd,Rd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ud=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Gg(e){return e===null?!1:Rd.exec(e)!==null||Ud.exec(e)!==null}function Jg(e){var t,r,i,o,s,a,c,l=0,d=null,p,y,x;if(t=Rd.exec(e),t===null&&(t=Ud.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(p=+t[10],y=+(t[11]||0),d=(p*60+y)*6e4,t[9]==="-"&&(d=-d)),x=new Date(Date.UTC(r,i,o,s,a,c,l)),d&&x.setTime(x.getTime()-d),x}function Yg(e){return e.toISOString()}var Ld=new Ne("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Gg,construct:Jg,instanceOf:Date,represent:Yg});function Zg(e){return e==="<<"||e===null}var Hd=new Ne("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Zg}),_a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
124
- \r`;function Qg(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=_a;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function Xg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=_a,a=0,c=[];for(t=0;t<o;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):r===18?(c.push(a>>10&255),c.push(a>>2&255)):r===12&&c.push(a>>4&255),new Uint8Array(c)}function em(e){var t="",r=0,i,o,s=e.length,a=_a;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function tm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Fd=new Ne("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Qg,construct:Xg,predicate:tm,represent:em}),rm=Object.prototype.hasOwnProperty,im=Object.prototype.toString;function nm(e){if(e===null)return!0;var t=[],r,i,o,s,a,c=e;for(r=0,i=c.length;r<i;r+=1){if(o=c[r],a=!1,im.call(o)!=="[object Object]")return!1;for(s in o)if(rm.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function om(e){return e!==null?e:[]}var qd=new Ne("tag:yaml.org,2002:omap",{kind:"sequence",resolve:nm,construct:om}),sm=Object.prototype.toString;function am(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],sm.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function cm(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}var Kd=new Ne("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:am,construct:cm}),lm=Object.prototype.hasOwnProperty;function um(e){if(e===null)return!0;var t,r=e;for(t in r)if(lm.call(r,t)&&r[t]!==null)return!1;return!0}function dm(e){return e!==null?e:{}}var zd=new Ne("tag:yaml.org,2002:set",{kind:"mapping",resolve:um,construct:dm}),Ta=Md.extend({implicit:[Ld,Hd],explicit:[Fd,qd,Kd,zd]}),Mt=Object.prototype.hasOwnProperty,eo=1,Wd=2,Gd=3,to=4,Va=1,fm=2,Jd=3,pm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,hm=/[\x85\u2028\u2029]/,ym=/[,\[\]\{\}]/,Yd=/^(?:!|!!|![a-z\-]+!)$/i,Zd=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Qd(e){return Object.prototype.toString.call(e)}function yt(e){return e===10||e===13}function ar(e){return e===9||e===32}function Ke(e){return e===9||e===32||e===10||e===13}function Dr(e){return e===44||e===91||e===93||e===123||e===125}function gm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function mm(e){return e===120?2:e===117?4:e===85?8:0}function bm(e){return 48<=e&&e<=57?e-48:-1}function Xd(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
125
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function wm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ef=new Array(256),tf=new Array(256),$r=0;$r<256;$r++)ef[$r]=Xd($r)?1:0,tf[$r]=Xd($r);function vm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ta,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function rf(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=xg(r),new Me(t,r)}function z(e,t){throw rf(e,t)}function ro(e,t){e.onWarning&&e.onWarning.call(null,rf(e,t))}var nf={YAML:function(e,t,r){var i,o,s;e.version!==null&&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&&ro(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],Yd.test(i)||z(e,"ill-formed tag handle (first argument) of the TAG directive"),Mt.call(e.tagMap,i)&&z(e,'there is a previously declared suffix for "'+i+'" tag handle'),Zd.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 Rt(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 pm.test(c)&&z(e,"the stream contains non-printable characters");e.result+=c}}function of(e,t,r,i){var o,s,a,c;for(xe.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],Mt.call(t,s)||(t[s]=r[s],i[s]=!0)}function Pr(e,t,r,i,o,s,a,c,l){var d,p;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),d=0,p=o.length;d<p;d+=1)Array.isArray(o[d])&&z(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Qd(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&Qd(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,p=s.length;d<p;d+=1)of(e,t,s[d],r);else of(e,t,s,r);else!e.json&&!Mt.call(r,o)&&Mt.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 ja(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 ve(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;ar(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(yt(o))for(ja(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&&ro(e,"deficient indentation"),i}function io(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||Ke(r)))}function Da(e,t){t===1?e.result+=" ":t>1&&(e.result+=xe.repeat(`
126
- `,t-1))}function km(e,t,r){var i,o,s,a,c,l,d,p,y=e.kind,x=e.result,C;if(C=e.input.charCodeAt(e.position),Ke(C)||Dr(C)||C===35||C===38||C===42||C===33||C===124||C===62||C===39||C===34||C===37||C===64||C===96||(C===63||C===45)&&(o=e.input.charCodeAt(e.position+1),Ke(o)||r&&Dr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;C!==0;){if(C===58){if(o=e.input.charCodeAt(e.position+1),Ke(o)||r&&Dr(o))break}else if(C===35){if(i=e.input.charCodeAt(e.position-1),Ke(i))break}else{if(e.position===e.lineStart&&io(e)||r&&Dr(C))break;if(yt(C))if(l=e.line,d=e.lineStart,p=e.lineIndent,ve(e,!1,-1),e.lineIndent>=t){c=!0,C=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=p;break}}c&&(Rt(e,s,a,!1),Da(e,e.line-l),s=a=e.position,c=!1),ar(C)||(a=e.position+1),C=e.input.charCodeAt(++e.position)}return Rt(e,s,a,!1),e.result?!0:(e.kind=y,e.result=x,!1)}function Cm(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Rt(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 yt(r)?(Rt(e,i,o,!0),Da(e,ve(e,!1,t)),i=o=e.position):e.position===e.lineStart&&io(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 Sm(e,t){var r,i,o,s,a,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return Rt(e,r,e.position,!0),e.position++,!0;if(c===92){if(Rt(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),yt(c))ve(e,!1,t);else if(c<256&&ef[c])e.result+=tf[c],e.position++;else if((a=mm(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=gm(c))>=0?s=(s<<4)+a:z(e,"expected hexadecimal character");e.result+=wm(s),e.position++}else z(e,"unknown escape sequence");r=i=e.position}else yt(c)?(Rt(e,r,i,!0),Da(e,ve(e,!1,t)),r=i=e.position):e.position===e.lineStart&&io(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 xm(e,t){var r=!0,i,o,s,a=e.tag,c,l=e.anchor,d,p,y,x,C,h=Object.create(null),g,m,v,b;if(b=e.input.charCodeAt(e.position),b===91)p=93,C=!1,c=[];else if(b===123)p=125,C=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),b=e.input.charCodeAt(++e.position);b!==0;){if(ve(e,!0,t),b=e.input.charCodeAt(e.position),b===p)return e.position++,e.tag=a,e.anchor=l,e.kind=C?"mapping":"sequence",e.result=c,!0;r?b===44&&z(e,"expected the node content, but found ','"):z(e,"missed comma between flow collection entries"),m=g=v=null,y=x=!1,b===63&&(d=e.input.charCodeAt(e.position+1),Ke(d)&&(y=x=!0,e.position++,ve(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Mr(e,t,eo,!1,!0),m=e.tag,g=e.result,ve(e,!0,t),b=e.input.charCodeAt(e.position),(x||e.line===i)&&b===58&&(y=!0,b=e.input.charCodeAt(++e.position),ve(e,!0,t),Mr(e,t,eo,!1,!0),v=e.result),C?Pr(e,c,h,m,g,v,i,o,s):y?c.push(Pr(e,null,h,m,g,v,i,o,s)):c.push(g),ve(e,!0,t),b=e.input.charCodeAt(e.position),b===44?(r=!0,b=e.input.charCodeAt(++e.position)):r=!1}z(e,"unexpected end of the stream within a flow collection")}function Am(e,t){var r,i,o=Va,s=!1,a=!1,c=t,l=0,d=!1,p,y;if(y=e.input.charCodeAt(e.position),y===124)i=!1;else if(y===62)i=!0;else return!1;for(e.kind="scalar",e.result="";y!==0;)if(y=e.input.charCodeAt(++e.position),y===43||y===45)Va===o?o=y===43?Jd:fm:z(e,"repeat of a chomping mode identifier");else if((p=bm(y))>=0)p===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+p-1,a=!0);else break;if(ar(y)){do y=e.input.charCodeAt(++e.position);while(ar(y));if(y===35)do y=e.input.charCodeAt(++e.position);while(!yt(y)&&y!==0)}for(;y!==0;){for(ja(e),e.lineIndent=0,y=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&y===32;)e.lineIndent++,y=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),yt(y)){l++;continue}if(e.lineIndent<c){o===Jd?e.result+=xe.repeat(`
127
- `,s?1+l:l):o===Va&&s&&(e.result+=`
128
- `);break}for(i?ar(y)?(d=!0,e.result+=xe.repeat(`
129
- `,s?1+l:l)):d?(d=!1,e.result+=xe.repeat(`
130
- `,l+1)):l===0?s&&(e.result+=" "):e.result+=xe.repeat(`
131
- `,l):e.result+=xe.repeat(`
132
- `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!yt(y)&&y!==0;)y=e.input.charCodeAt(++e.position);Rt(e,r,e.position,!1)}return!0}function sf(e,t){var r,i=e.tag,o=e.anchor,s=[],a,c=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,z(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Ke(a))));){if(c=!0,e.position++,ve(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Mr(e,t,Gd,!1,!0),s.push(e.result),ve(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 Bm(e,t,r){var i,o,s,a,c,l,d=e.tag,p=e.anchor,y={},x=Object.create(null),C=null,h=null,g=null,m=!1,v=!1,b;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=y),b=e.input.charCodeAt(e.position);b!==0;){if(!m&&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,(b===63||b===58)&&Ke(i))b===63?(m&&(Pr(e,y,x,C,h,null,a,c,l),C=h=g=null),v=!0,m=!0,o=!0):m?(m=!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,b=i;else{if(a=e.line,c=e.lineStart,l=e.position,!Mr(e,r,Wd,!1,!0))break;if(e.line===s){for(b=e.input.charCodeAt(e.position);ar(b);)b=e.input.charCodeAt(++e.position);if(b===58)b=e.input.charCodeAt(++e.position),Ke(b)||z(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Pr(e,y,x,C,h,null,a,c,l),C=h=g=null),v=!0,m=!1,o=!1,C=e.tag,h=e.result;else if(v)z(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=p,!0}else if(v)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=p,!0}if((e.line===s||e.lineIndent>t)&&(m&&(a=e.line,c=e.lineStart,l=e.position),Mr(e,t,to,!0,o)&&(m?h=e.result:g=e.result),m||(Pr(e,y,x,C,h,g,a,c,l),C=h=g=null),ve(e,!0,-1),b=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&b!==0)z(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Pr(e,y,x,C,h,null,a,c,l),v&&(e.tag=d,e.anchor=p,e.kind="mapping",e.result=y),v}function Im(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&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&&!Ke(a);)a===33&&(i?z(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Yd.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),ym.test(s)&&z(e,"tag suffix cannot contain flow indicator characters")}s&&!Zd.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:Mt.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 Em(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&&!Ke(r)&&!Dr(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 Nm(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ke(i)&&!Dr(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),Mt.call(e.anchorMap,r)||z(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ve(e,!0,-1),!0}function Mr(e,t,r,i,o){var s,a,c,l=1,d=!1,p=!1,y,x,C,h,g,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=c=to===r||Gd===r,i&&ve(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Im(e)||Em(e);)ve(e,!0,-1)?(d=!0,c=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):c=!1;if(c&&(c=d||o),(l===1||to===r)&&(eo===r||Wd===r?g=t:g=t+1,m=e.position-e.lineStart,l===1?c&&(sf(e,m)||Bm(e,m,g))||xm(e,g)?p=!0:(a&&Am(e,g)||Cm(e,g)||Sm(e,g)?p=!0:Nm(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&z(e,"alias node should not have any properties")):km(e,g,eo===r)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(p=c&&sf(e,m))),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+'"'),y=0,x=e.implicitTypes.length;y<x;y+=1)if(h=e.implicitTypes[y],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Mt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,C=e.typeMap.multi[e.kind||"fallback"],y=0,x=C.length;y<x;y+=1)if(e.tag.slice(0,C[y].tag.length)===C[y].tag){h=C[y];break}h||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||p}function Om(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(ve(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Ke(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(;ar(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!yt(a));break}if(yt(a))break;for(r=e.position;a!==0&&!Ke(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&ja(e),Mt.call(nf,i)?nf[i](e,i,o):ro(e,'unknown document directive "'+i+'"')}if(ve(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ve(e,!0,-1)):s&&z(e,"directives end mark is expected"),Mr(e,e.lineIndent-1,to,!1,!0),ve(e,!0,-1),e.checkLineBreaks&&hm.test(e.input.slice(t,e.position))&&ro(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&io(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ve(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 af(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
133
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new vm(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,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;)Om(r);return r.documents}function _m(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=af(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Tm(e,t){var r=af(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Me("expected a single document in the stream, but found more")}}var Vm=_m,jm=Tm,cf={loadAll:Vm,load:jm},lf=Object.prototype.toString,uf=Object.prototype.hasOwnProperty,$a=65279,Dm=9,xi=10,$m=13,Pm=32,Mm=33,Rm=34,Pa=35,Um=37,Lm=38,Hm=39,Fm=42,df=44,qm=45,no=58,Km=61,zm=62,Wm=63,Gm=64,ff=91,pf=93,Jm=96,hf=123,Ym=124,yf=125,je={};je[0]="\\0",je[7]="\\a",je[8]="\\b",je[9]="\\t",je[10]="\\n",je[11]="\\v",je[12]="\\f",je[13]="\\r",je[27]="\\e",je[34]='\\"',je[92]="\\\\",je[133]="\\N",je[160]="\\_",je[8232]="\\L",je[8233]="\\P";var Zm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Qm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Xm(e,t){var r,i,o,s,a,c,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],c=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&uf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function e0(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new Me("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+xe.repeat("0",i-t.length)+t}var t0=1,Ai=2;function r0(e){this.schema=e.schema||Ta,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=xe.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Xm(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==='"'?Ai: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=xe.repeat(" ",t),i=0,o=-1,s="",a,c=e.length;i<c;)o=e.indexOf(`
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
+ `+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
+ `,c+=Be.repeat("-",t.indent+y+3+d.pos)+`^
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?`
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(`
127
+ `,s?1+l:l):o===ja&&s&&(e.result+=`
128
+ `);break}for(i?cr(p)?(d=!0,e.result+=Be.repeat(`
129
+ `,s?1+l:l)):d?(d=!1,e.result+=Be.repeat(`
130
+ `,l+1)):l===0?s&&(e.result+=" "):e.result+=Be.repeat(`
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(`
134
134
  `,i),o===-1?(a=e.slice(i),i=c):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
135
- `&&(s+=r),s+=a;return s}function Ma(e,t){return`
136
- `+xe.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 oo(e){return e===Pm||e===Dm}function Bi(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 mf(e){return Bi(e)&&e!==$a&&e!==$m&&e!==xi}function bf(e,t,r){var i=mf(e),o=i&&!oo(e);return(r?i:i&&e!==df&&e!==ff&&e!==pf&&e!==hf&&e!==yf)&&e!==Pa&&!(t===no&&!o)||mf(t)&&!oo(t)&&e===Pa||t===no&&o}function n0(e){return Bi(e)&&e!==$a&&!oo(e)&&e!==qm&&e!==Wm&&e!==no&&e!==df&&e!==ff&&e!==pf&&e!==hf&&e!==yf&&e!==Pa&&e!==Lm&&e!==Fm&&e!==Mm&&e!==Ym&&e!==Km&&e!==zm&&e!==Hm&&e!==Rm&&e!==Um&&e!==Gm&&e!==Jm}function o0(e){return!oo(e)&&e!==no}function Ii(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function wf(e){var t=/^\n* /;return t.test(e)}var vf=1,Ra=2,kf=3,Cf=4,Rr=5;function s0(e,t,r,i,o,s,a,c){var l,d=0,p=null,y=!1,x=!1,C=i!==-1,h=-1,g=n0(Ii(e,0))&&o0(Ii(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ii(e,l),!Bi(d))return Rr;g=g&&bf(d,p,c),p=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ii(e,l),d===xi)y=!0,C&&(x=x||l-h-1>i&&e[h+1]!==" ",h=l);else if(!Bi(d))return Rr;g=g&&bf(d,p,c),p=d}x=x||C&&l-h-1>i&&e[h+1]!==" "}return!y&&!x?g&&!a&&!o(e)?vf:s===Ai?Rr:Ra:r>9&&wf(e)?Rr:a?s===Ai?Rr:Ra:x?Cf:kf}function a0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===Ai?'""':"''";if(!e.noCompatMode&&(Zm.indexOf(t)!==-1||Qm.test(t)))return e.quotingType===Ai?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=i||e.flowLevel>-1&&r>=e.flowLevel;function l(d){return i0(e,d)}switch(s0(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case vf:return t;case Ra:return"'"+t.replace(/'/g,"''")+"'";case kf:return"|"+Sf(t,e.indent)+xf(gf(t,s));case Cf:return">"+Sf(t,e.indent)+xf(gf(c0(t,a),s));case Rr:return'"'+l0(t)+'"';default:throw new Me("impossible error: invalid scalar style")}}()}function Sf(e,t){var r=wf(e)?String(t):"",i=e[e.length-1]===`
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]===`
137
137
  `,o=i&&(e[e.length-2]===`
138
138
  `||e===`
139
139
  `),s=o?"+":i?"":"-";return r+s+`
140
- `}function xf(e){return e[e.length-1]===`
140
+ `}function Af(e){return e[e.length-1]===`
141
141
  `?e.slice(0,-1):e}function c0(e,t){for(var r=/(\n+)([^\n]*)/g,i=function(){var d=e.indexOf(`
142
- `);return d=d!==-1?d:e.length,r.lastIndex=d,Af(e.slice(0,d),t)}(),o=e[0]===`
142
+ `);return d=d!==-1?d:e.length,r.lastIndex=d,Bf(e.slice(0,d),t)}(),o=e[0]===`
143
143
  `||e[0]===" ",s,a;a=r.exec(e);){var c=a[1],l=a[2];s=l[0]===" ",i+=c+(!o&&!s&&l!==""?`
144
- `:"")+Af(l,t),o=s}return i}function Af(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,c=0,l="";i=r.exec(e);)c=i.index,c-o>t&&(s=a>o?a:c,l+=`
144
+ `:"")+Bf(l,t),o=s}return i}function Bf(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,c=0,l="";i=r.exec(e);)c=i.index,c-o>t&&(s=a>o?a:c,l+=`
145
145
  `+e.slice(o,s),o=s+1),a=c;return l+=`
146
146
  `,e.length-o>t&&a>o?l+=e.slice(o,a)+`
147
- `+e.slice(a+1):l+=e.slice(o),l.slice(1)}function l0(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=Ii(e,o),i=je[r],!i&&Bi(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)),(Et(e,t,c,!1,!1)||typeof c>"u"&&Et(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}function Bf(e,t,r,i){var o="",s=e.tag,a,c,l;for(a=0,c=r.length;a<c;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(Et(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Et(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Ma(e,t)),e.dump&&xi===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function d0(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,c,l,d,p;for(a=0,c=s.length;a<c;a+=1)p="",i!==""&&(p+=", "),e.condenseFlow&&(p+='"'),l=s[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),Et(e,t,l,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Et(e,t,d,!1,!1)&&(p+=e.dump,i+=p));e.tag=o,e.dump="{"+i+"}"}function f0(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),c,l,d,p,y,x;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Me("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)x="",(!i||o!=="")&&(x+=Ma(e,t)),d=a[c],p=r[d],e.replacer&&(p=e.replacer.call(r,d,p)),Et(e,t+1,d,!0,!0,!0)&&(y=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,y&&(e.dump&&xi===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,y&&(x+=Ma(e,t)),Et(e,t+1,p,!0,y)&&(e.dump&&xi===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,o+=x));e.tag=s,e.dump=o||"{}"}function If(e,t,r){var i,o,s,a,c,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(c=o[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(r?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(l=e.styleMap[c.tag]||c.defaultStyle,lf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(uf.call(c.represent,l))i=c.represent[l](t,l);else throw new Me("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function Et(e,t,r,i,o,s,a){e.tag=null,e.dump=r,If(e,r,!1)||If(e,r,!0);var c=lf.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var p=c==="[object Object]"||c==="[object Array]",y,x;if(p&&(y=e.duplicates.indexOf(r),x=y!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(o=!1),x&&e.usedDuplicates[y])e.dump="*ref_"+y;else{if(p&&x&&!e.usedDuplicates[y]&&(e.usedDuplicates[y]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(f0(e,t,e.dump,o),x&&(e.dump="&ref_"+y+e.dump)):(d0(e,t,e.dump),x&&(e.dump="&ref_"+y+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Bf(e,t-1,e.dump,o):Bf(e,t,e.dump,o),x&&(e.dump="&ref_"+y+e.dump)):(u0(e,t,e.dump),x&&(e.dump="&ref_"+y+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&a0(e,e.dump,t,s,l);else{if(c==="[object Undefined]"||e.skipInvalid)return!1;throw new Me("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(Ua(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}function Ua(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)Ua(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)Ua(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)),Et(r,0,i,!0,!0)?r.dump+`
148
- `:""}var y0=h0,g0={dump:y0};function La(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var m0=Ne,b0=Ed,w0=Td,v0=Pd,k0=Md,C0=Ta,S0=cf.load,x0=cf.loadAll,A0=g0.dump,B0=Me,I0={binary:Fd,float:$d,map:_d,null:Vd,pairs:Kd,set:zd,timestamp:Ld,bool:jd,int:Dd,merge:Hd,omap:qd,seq:Od,str:Nd},E0=La("safeLoad","load"),N0=La("safeLoadAll","loadAll"),O0=La("safeDump","dump"),_0={Type:m0,Schema:b0,FAILSAFE_SCHEMA:w0,JSON_SCHEMA:v0,CORE_SCHEMA:k0,DEFAULT_SCHEMA:C0,load:S0,loadAll:x0,dump:A0,YAMLException:B0,types:I0,safeLoad:E0,safeLoadAll:N0,safeDump: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"},$0={key:2,class:"config-card-display-yaml"},P0=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}}=Be.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,p=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${p}-props`,class:n.normalizeClass(`config-card-details-${p}-props`),"data-testid":`config-card-details-${p}-props`},[p!=="basic"?(n.openBlock(),n.createElementBlock("div",j0,n.toDisplayString(p==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[p],y=>(n.openBlock(),n.createBlock(Ci,{key:y.key,item:y},n.createSlots({label:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label`,{row:y},void 0,!0)]),[y.key]:n.withCtx(({rowValue:x})=>[n.renderSlot(c.$slots,y.key,{row:y,rowValue:x},void 0,!0)]),_:2},[o(y)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label-tooltip`,{row:y},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,V0))),128))])):n.createCommentVNode("",!0),e.format==="json"?(n.openBlock(),n.createElementBlock("div",D0,[n.createVNode(d,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),e.format==="yaml"?(n.openBlock(),n.createElementBlock("div",$0,[n.createVNode(d,{id:"config-card-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0)],64)}}}),M0=st(P0,[["__scopeId","data-v-c914c7e4"]]),Ef="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)),q0=n.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Ef,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ef}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",H0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),F0],8,L0))]),_:1},8,["aria-hidden","style"]))}}),K0=R0(q0,[["__scopeId","data-v-a53b73fd"]]),z0={"data-testid":"config-card-title"},W0={class:"config-card-actions"},G0=["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=e,o=n.useSlots(),{i18n:{t:s}}=Be.useI18n(),{getMessageFromError:a}=Be.useErrors(),{convertKeyToTitle:c}=Be.useStringHelpers(),{axiosInstance:l}=Be.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),y=E=>{p.value=E==null?void 0:E.value},x={id:{type:ne.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:ue.Basic},name:{order:1,section:ue.Basic},enabled:{type:ne.BadgeStatus,order:2,section:ue.Basic},updated_at:{type:ne.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:ue.Basic},created_at:{type:ne.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:ue.Basic},tags:{type:ne.BadgeTag,order:-1,section:ue.Basic}},C=n.ref(!1),h=n.ref(!1),g=n.ref(""),m=n.ref(),v=n.computed(()=>{var E,M,q;if(!m.value)return[];const U=[],$=Object.keys(m.value).length;for(const V in m.value){const te=(M=(E=i.configSchema)==null?void 0:E[V])==null?void 0:M.order,le=(q=x[V])==null?void 0:q.order;let be=$;(le||le===0)&&(be=le===-1?$+1:le),te&&(be=te===-1?$+1:te),U.push([V,be])}return U.sort(function(V,te){return V[1]-te[1]}),U.map(V=>{var te,le;const be=V[0],de=(te=m.value)==null?void 0:te[be],fe=((le=i.configSchema)==null?void 0:le[be])||{},ke=x[be];return{key:be,value:de,hidden:fe.hidden||!1,type:fe.type??((ke==null?void 0:ke.type)||ne.Text),label:fe.label??((ke==null?void 0:ke.label)||c(be)),tooltip:fe.tooltip??((ke==null?void 0:ke.tooltip)||void 0),section:fe.section??((ke==null?void 0:ke.section)||ue.Advanced)}}).filter(V=>!V.hidden&&V.key!==i.pluginConfigKey)}),b=n.computed(()=>{var E,M;if(!m.value||!i.pluginConfigKey)return[];const q=m.value[i.pluginConfigKey]||{},U=Object.keys(q).length,$=[];for(const V in q){const te=(M=(E=i.pluginConfigSchema)==null?void 0:E[V])==null?void 0:M.order,le=q[V];let be=le!=null&&le!==""?U-1:U;te&&(be=te===-1?U+1:te),$.push([V,be])}return $.sort(function(V,te){return V[1]-te[1]}),$.map(V=>{var te;const le=V[0],be=q[le],de=((te=i.pluginConfigSchema)==null?void 0:te[le])||{};return{key:le,value:be,hidden:de.hidden||!1,type:de.type??ne.Text,label:de.label??c(le),tooltip:de.tooltip??void 0,section:ue.Plugin}}).filter(V=>!V.hidden)}),w=n.computed(()=>{var E,M,q,U;return{basic:(E=v.value)==null?void 0:E.filter($=>$.section===ue.Basic),advanced:(M=v.value)==null?void 0:M.filter($=>$.section===ue.Advanced),plugin:(U=b.value)==null?void 0:U.concat((q=v.value)==null?void 0:q.filter($=>$.section===ue.Plugin))}}),A=n.computed(()=>{const E=[];return w.value.basic.length&&E.push("basic"),w.value.advanced.length&&E.push("advanced"),w.value.plugin.length&&E.push("plugin"),E}),F=E=>!!(E.tooltip||o[`${E.key}-label-tooltip`]),Z=n.computed(()=>{var E,M;let q=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?q=q.replace(/{controlPlaneId}/gi,((E=i.config)==null?void 0:E.controlPlaneId)||""):i.config.app==="kongManager"&&(q=q.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),q=q.replace(/{id}/gi,i.config.entityId),q}),I=E=>{m.value&&E(JSON.stringify(m.value))?t("copy:success",m.value):t("copy:error")};return n.watch(C,E=>{t("loading",E)},{immediate:!0}),n.onBeforeMount(async()=>{h.value=!1,C.value=!0;try{const{data:E}=await l.get(Z.value);if(i.dataKey)if(typeof E[i.dataKey]<"u")m.value={...E[i.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:i.dataKey}));else m.value={...E};Object.keys(i.configSchema).filter(M=>i.configSchema[M].forceShow).forEach(M=>{m.value&&typeof m.value[M]>"u"&&(m.value[M]=null)}),t("fetch:success",E)}catch(E){const M=a(E);g.value=M.startsWith("code")?s("baseConfigCard.errors.load"):M,h.value=!0,t("fetch:error",E)}finally{C.value=!1}}),(E,M)=>{const q=n.resolveComponent("KLabel"),U=n.resolveComponent("KSelect"),$=n.resolveComponent("KButton"),V=n.resolveComponent("KClipboardProvider"),te=n.resolveComponent("KSkeleton"),le=n.resolveComponent("KEmptyState"),be=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(be,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",W0,[n.renderSlot(E.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(q,{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(U,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:y})):n.createCommentVNode("",!0),i.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock($,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(K0),{size:n.unref(Xy)},null,8,["size"])],8,G0)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(V,{key:3},{default:n.withCtx(({copyToClipboard:de})=>[!C.value&&!h.value?(n.openBlock(),n.createBlock($,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:fe=>I(de)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),default:n.withCtx(()=>[C.value?(n.openBlock(),n.createBlock(te,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(n.openBlock(),n.createBlock(le,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(g.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",J0,[n.createVNode(M0,{format:p.value,"prop-list-types":A.value,"property-collections":w.value,record:m.value},n.createSlots({_:2},[n.renderList(Object.keys(E.$slots),de=>({name:de,fn:n.withCtx(({row:fe,rowValue:ke})=>[n.renderSlot(E.$slots,de,{row:fe,rowValue:ke},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(A.value,de=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${de}-props`,class:n.normalizeClass(`config-card-details-${de}-props`),"data-testid":`config-card-details-${de}-props`},[de!=="basic"?(n.openBlock(),n.createElementBlock("div",Q0,n.toDisplayString(de==="advanced"?n.unref(s)("baseConfigCard.sections.advanced"):n.unref(s)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value[de],fe=>(n.openBlock(),n.createBlock(Ci,{key:fe.key,item:fe},n.createSlots({label:n.withCtx(()=>[n.renderSlot(E.$slots,`${fe.key}-label`,{row:fe},void 0,!0)]),[fe.key]:n.withCtx(({rowValue:ke})=>[n.renderSlot(E.$slots,fe.key,{row:fe,rowValue:ke},void 0,!0)]),_:2},[F(fe)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(E.$slots,`${fe.key}-label-tooltip`,{row:fe},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(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Nf=st(X0,[["__scopeId","data-v-bea4df63"]]),e1=["onReset","onSubmit"],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=e,o=Hr.useRouter(),{i18n:{t:s}}=Be.useI18n(),{getMessageFromError:a}=Be.useErrors(),{axiosInstance:c}=Be.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),l=n.ref(!1),d=n.ref(!1),p=n.ref(""),y=n.computed(()=>i.canSubmit===!1||i.isReadonly),x=n.computed(()=>{var m,v;if(!i.editId)return"";let b=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((m=i.config)==null?void 0:m.controlPlaneId)||""):i.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(v=i.config)!=null&&v.workspace?`/${i.config.workspace}`:"")),b=b.replace(/{id}/gi,i.editId),b}),C=()=>{i.config.cancelRoute?o.push(i.config.cancelRoute):h()},h=()=>{t("cancel")},g=()=>{y.value||t("submit")};return n.watch(()=>l.value,m=>{t("loading",m)},{immediate:!0}),n.onBeforeMount(async()=>{if(i.editId)try{d.value=!1,l.value=!0;const{data:m}=await c.get(x.value);t("fetch:success",m)}catch(m){const v=a(m);p.value=v.startsWith("code")?s("baseForm.errors.edit"):v,d.value=!0,t("fetch:error",m)}finally{l.value=!1}}),(m,v)=>{const b=n.resolveComponent("KSkeleton"),w=n.resolveComponent("KEmptyState"),A=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(()=>[l.value?(n.openBlock(),n.createBlock(b,{key:0,type:"form"})):d.value?(n.openBlock(),n.createBlock(w,{key:1,"cta-text":n.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":C,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(h,["prevent"]),onSubmit:n.withModifiers(g,["prevent"])},[n.renderSlot(m.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(A,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",t1,[n.renderSlot(m.$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(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(F,{appearance:"primary","data-testid":"form-submit",disabled:y.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,e1))]),_:3})}}}),Of=st(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 g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[data-testid="first-col"]'))||null}),o=n.computed(()=>{var g,m;const v=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return v?((m=v[0])==null?void 0:m.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,m,v;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,p.value=((m=r.value)==null?void 0:m.clientWidth)||0,y.value=((v=l.value)==null?void 0:v.innerText)||""},l=n.ref({}),d=n.ref(0),p=n.ref(0),y=n.ref(""),x=n.computed(()=>[i.value,r.value]),C=n.watch(x,g=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||c()})});for(const m of g)m&&s.observe(m)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>p.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{C()}),(g,m)=>{const v=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",i1,[n.createVNode(v,{label:h.value?y.value:"","max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):n.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),o1=st(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,{i18n:{t:i}}=Be.useI18n(),o=n.computed(()=>{var A,F;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(A=r.errorMessage)==null?void 0:A.title,message:(F=r.errorMessage)==null?void 0:F.message}}),s=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),a=A=>A.hasData||!!r.query,c=n.computed(()=>{const A=[];return Object.keys(r.tableHeaders).forEach(F=>{const Z=r.tableHeaders[F];A.push({label:Z.label??F,key:F,sortable:Z.sortable??!1})}),r.enableEntityActions&&A.push({key:"actions",hideLabel:!0}),A}),l=A=>({"data-rowid":A.id,"data-testid":A.name,...r.rowAttributes(A)}),d=n.ref({}),p=A=>{var F;return(F=d.value)==null?void 0:F.$el.querySelector(`[data-rowid="${A.id}"]`)},y=A=>{const F={"data-testid":A.headerKey,...r.cellAttributes(A)};return A.colIndex===0&&(F.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),F},x=()=>{t("empty-state-cta-clicked"),C()},C=()=>{t("clear-search-input")},h=n.computed(()=>r.disableRowClick?void 0:(A,F)=>{t("click:row",F)}),g=A=>{t("sort",A)},{setTablePreferences:m,getTablePreferences:v}=ny(),b=n.computed(()=>{const A=v(r.preferencesStorageKey);return{...r.initialFetcherParams,...A}}),w=A=>{r.preferencesStorageKey&&m(r.preferencesStorageKey,A)};return(A,F)=>{const Z=n.resolveComponent("KIcon"),I=n.resolveComponent("KButton"),E=n.resolveComponent("KDropdown"),M=n.resolveComponent("KTable"),q=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(q,{class:"kong-ui-entity-base-table",title:e.title},{default:n.withCtx(()=>[n.createVNode(M,{ref_key:"tableRefs",ref:d,"cache-identifier":s.value,"cell-attrs":y,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":o.value.message,"error-state-title":o.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":o.value.hasError,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":b.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":l,"search-input":e.query,onKtableEmptyStateCtaClicked:x,"onRow:click":h.value,onSort:F[0]||(F[0]=U=>g(U)),"onUpdate:tablePreferences":w},n.createSlots({toolbar:n.withCtx(({state:U})=>[n.withDirectives(n.createElementVNode("div",s1,[n.renderSlot(A.$slots,"toolbar-filter",{},void 0,!0),A.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",a1,[n.renderSlot(A.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,a(U)]])]),actions:n.withCtx(({row:U,rowKey:$,rowValue:V})=>[n.createElementVNode("div",{class:"actions-container","data-testid":U.name},[n.createVNode(E,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(A.$slots,"actions",{row:U,rowKey:$,rowValue:V},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,c1)]),_:2},[n.renderList(e.tableHeaders,(U,$)=>({name:$,fn:n.withCtx(({row:V,rowKey:te,rowValue:le})=>[n.createVNode(o1,{"key-name":String($),"row-el":p(V)},{default:n.withCtx(()=>[n.renderSlot(A.$slots,$,{row:V,rowKey:te,rowValue:le},()=>[n.createTextVNode(n.toDisplayString(le),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"])}}}),_f=st(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 r=e,{i18nT:i}=Be.useI18n(),o=n.computed(()=>r.needConfirm?r.entityName:""),s=()=>{t("cancel")},a=()=>{t("proceed")};return(c,l)=>{const d=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:s,onProceed:a},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",u1,[n.createVNode(d,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(i),{class:"message",keypath:r.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.entityType),1)]),_:2},[r.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(r.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),r.description||c.$slots.description?(n.openBlock(),n.createElementBlock("div",d1,[n.renderSlot(c.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(r.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Tf=st(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"],g1={mask:"url(#mask0_180_20349)"},m1=["fill"],Vf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Jy})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",p1,[n.createElementVNode("mask",h1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,y1)]),n.createElementVNode("g",g1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,m1)])]))}}),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 r=e,{i18n:{t:i}}=Be.useI18n(),o=n.ref(!1),s=n.ref({}),a=n.computed(()=>{const m=[];return new URLSearchParams(r.modelValue).forEach((v,b)=>{v!==""&&m.push(b)}),m}),c=n.computed(()=>{const m=r.config.fields;return Object.keys(m).filter(v=>m[v].searchable).map(v=>({label:m[v].label||v,value:v}))});n.watch(()=>r.modelValue,m=>{s.value={},new URLSearchParams(m).forEach((v,b)=>{s.value[b]=v})});const l=()=>{o.value=!o.value},d=m=>{t("update:modelValue",m)},p=m=>`filter-${m}`,y=m=>{var v,b;return(((b=(v=r.config.schema)==null?void 0:v[m])==null?void 0:b.values)??[]).map(w=>({value:w,label:w}))},x=m=>{var v,b;return((b=(v=r.config.schema)==null?void 0:v[m])==null?void 0:b.type)??"text"},C=m=>{s.value={...s.value,[m]:""},g()},h=()=>{s.value={},g(!0)},g=(m=!1)=>{const v=Object.keys(s.value).reduce((b,w)=>(s.value[w]&&(b[w]=`${s.value[w]}`),b),{});m&&(o.value=!1),t("update:modelValue",new URLSearchParams(v).toString())};return(m,v)=>{const b=n.resolveComponent("KInput"),w=n.resolveComponent("KButton"),A=n.resolveComponent("KSelect"),F=n.resolveComponent("KMenuItem"),Z=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(b,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{before:n.withCtx(()=>[n.createVNode(Vf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",b1,[n.createVNode(w,{appearance:"tertiary","data-testid":"filter-button",onClick:l},{default:n.withCtx(()=>[n.createVNode(Vf),n.createTextVNode(" "+n.toDisplayString(n.unref(i)("filter.filterButtonText"))+" "+n.toDisplayString(a.value.length>0?`(${a.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:l},null,512),[[n.vShow,o.value]]),n.withDirectives(n.createVNode(Z,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(I,E)=>(n.openBlock(),n.createBlock(F,{key:I.value,"data-testid":I.value,expandable:"","last-menu-item":E===c.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,a.value.includes(I.value)]])])]),itemBody:n.withCtx(()=>{var M,q;return[n.createElementVNode("div",k1,[n.createElementVNode("label",{class:"menu-item-label",for:p(I.value)},n.toDisplayString(n.unref(i)("filter.fieldLabel")),9,C1),((q=(M=e.config.schema)==null?void 0:M[I.value])==null?void 0:q.type)==="select"?(n.openBlock(),n.createBlock(A,{key:0,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":U=>s.value[I.value]=U,appearance:"select",items:y(I.value),placeholder:n.unref(i)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(b,{key:1,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":U=>s.value[I.value]=U,autocomplete:"off",placeholder:n.unref(i)("filter.inputPlaceholder"),type:x(I.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",S1,[n.createVNode(w,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:v[0]||(v[0]=U=>g(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.applyButtonText")),1)]),_:1}),n.createVNode(w,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:U=>C(I.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createElementVNode("div",x1,[n.createVNode(w,{appearance:"tertiary",size:"small",onClick:h},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[n.vShow,o.value]])]))}}}),jf=st(A1,[["__scopeId","data-v-15962ee2"]]),Nt=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))}}),so=st(_1,[["__scopeId","data-v-8b6dc312"]]),{useAxios:ao,useDeleteUrlBuilder:Df,useErrors:$f,useExternalLinkCreator:mb,useFetchUrlBuilder:bb,useFetcher:Pf,useDebouncedFilter:wb,useStringHelpers:Mf,useHelpers:Rf,useGatewayFeatureSupported:vb,useTruncationDetector:kb}=Be,T1={class:"kong-ui-entities-certificates-list"},V1={key:0},j1={key:1},D1={key:0},$1={key:1},P1={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 he;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=ht.useI18n(),a=Hr.useRouter(),{axiosInstance:c}=ao({headers:(he=r.config)==null?void 0:he.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={subject:{label:i("certificates.list.table_headers.subject")},expiry:{label:i("certificates.list.table_headers.expiry")},san:{label:i("certificates.list.table_headers.san")},cert:{label:i("certificates.list.table_headers.cert")},tags:{label:i("certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var re,ye;let T=`${r.config.apiBaseUrl}${ki.list[r.config.app]}`;return r.config.app==="konnect"?T=T.replace(/{controlPlaneId}/gi,((re=r.config)==null?void 0:re.controlPlaneId)||""):r.config.app==="kongManager"&&(T=T.replace(/\/{workspace}/gi,(ye=r.config)!=null&&ye.workspace?`/${r.config.workspace}`:"")),T}),C=n.ref(""),h=n.computed(()=>{const T=r.config.app==="konnect"||r.config.isExactMatch;return T?{isExactMatch:T,placeholder:i("certificates.search.placeholder")}:{isExactMatch:T,schema:r.config.filterSchema}}),{fetcher:g,fetcherState:m}=Pf(r.config,x.value),v=()=>{C.value=""},b=()=>{l.value++},w=n.ref(null),A=(T,re)=>{const ye=T.id;if(!re(ye)){t("copy:error",{entity:T,field:"id",message:i("certificates.errors.copy")});return}t("copy:success",{entity:T,field:"id",message:i("certificates.copy.success",{val:ye})})},F=(T,re)=>{const ye=JSON.stringify(T);if(!re(ye)){t("copy:error",{entity:T,message:i("certificates.errors.copy")});return}t("copy:success",{entity:T,message:i("certificates.copy.success_brief")})},Z=(T,re)=>{T.type==="error"?t("copy:error",{entity:re,field:"cert",message:i("certificates.errors.copy")}):t("copy:success",{entity:re,field:"cert",message:i("certificates.copy.success_brief")})},I=async T=>{var ye;await((ye=r.canRetrieve)==null?void 0:ye.call(r,T))&&a.push(r.config.getViewRoute(T.id))},E=T=>({label:i("certificates.actions.view"),to:r.config.getViewRoute(T)}),M=T=>({label:i("certificates.actions.edit"),to:r.config.getEditRoute(T)}),q=T=>{if(r.config.getCreateSniRoute)return{label:i("certificates.actions.addSni"),to:r.config.getCreateSniRoute(T)}},U=n.ref(void 0),$=n.ref(!1),V=n.ref(!1),te=n.ref(""),le=Df(r.config,x.value),{certificateDataCache:be,getCertificateData:de}=ht.useCertificate(),fe=T=>{U.value=T,$.value=!0},ke=()=>{$.value=!1},Ut=async()=>{var T,re,ye;if((T=U.value)!=null&&T.id){V.value=!0;try{await c.delete(le(U.value.id)),V.value=!1,$.value=!1,l.value++,t("delete:success",U.value)}catch(De){te.value=((ye=(re=De.response)==null?void 0:re.data)==null?void 0:ye.message)||De.message||i("certificates.errors.delete"),t("error",De)}finally{V.value=!1}}},pe=n.ref(!0);n.watch(m,T=>{var re,ye,De,Ot;if(Array.isArray((re=T==null?void 0:T.response)==null?void 0:re.data)&&(pe.value=T.response.data.length>0),T.status===Pt.Error){w.value={title:i("certificates.errors.general")},(Ot=(De=(ye=T.error)==null?void 0:ye.response)==null?void 0:De.data)!=null&&Ot.message&&(w.value.message=T.error.response.data.message),t("error",T.error);return}be.value={},w.value=null});const G=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("certificates.list.empty_state.description"),title:i("certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(G.value.title=i("certificates.list.empty_state.title"),G.value.ctaText=i("certificates.actions.create"))}),(T,re)=>{const ye=n.resolveComponent("KButton"),De=n.resolveComponent("KBadge"),Ot=n.resolveComponent("KTruncate"),Y=n.resolveComponent("KDropdownItem"),Ae=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",T1,[n.createVNode(n.unref(_f),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":G.value,"enable-entity-actions":"","error-message":w.value,fetcher:n.unref(g),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:C.value,"table-headers":n.unref(y),"use-action-outside":e.useActionOutside,onClearSearchInput:v,"onClick:row":re[2]||(re[2]=K=>I(K)),onSort:b},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(jf),{modelValue:C.value,"onUpdate:modelValue":re[0]||(re[0]=K=>C.value=K),config:h.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(Nt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(ye,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,pe.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:n.withCtx(({row:K})=>{var we;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",V1,n.toDisplayString((we=K==null?void 0:K.metadata)!=null&&we.subject?K.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",j1,n.toDisplayString(n.unref(de)(K).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:K})=>{var we;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",D1,n.toDisplayString((we=K==null?void 0:K.metadata)!=null&&we.expiry?n.unref(o)(K.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",$1,n.toDisplayString(n.unref(de)(K).schemaExpiry?n.unref(o)(n.unref(de)(K).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:K})=>{var we;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",P1,n.toDisplayString((we=K==null?void 0:K.metadata)!=null&&we.dns_names?`dns=${K.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",M1,n.toDisplayString(n.unref(de)(K).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:K})=>[K!=null&&K.cert?(n.openBlock(),n.createBlock(n.unref(ty),{key:0,"data-testid":"copy-certificate-cert",notify:we=>Z(we,K),truncated:!0,uuid:K.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",R1,"-"))]),tags:n.withCtx(({row:K})=>{var we;return[((we=K==null?void 0:K.tags)==null?void 0:we.length)>0?(n.openBlock(),n.createBlock(Ot,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(K==null?void 0:K.tags,Lr=>(n.openBlock(),n.createBlock(De,{key:Lr,onClick:re[1]||(re[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:K})=>[n.createVNode(Ae,null,{default:n.withCtx(({copyToClipboard:we})=>[n.createVNode(Y,{"data-testid":"action-entity-copy-id",onClick:Lr=>A(K,we)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Ae,null,{default:n.withCtx(({copyToClipboard:we})=>[n.createVNode(Y,{"data-testid":"action-entity-copy-json",onClick:Lr=>F(K,we)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Nt),{"auth-function":()=>e.canRetrieve(K)},{default:n.withCtx(()=>[n.createVNode(Y,{"data-testid":"action-entity-view","has-divider":"",item:E(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Nt),{"auth-function":()=>e.canEdit(K)},{default:n.withCtx(()=>[n.createVNode(Y,{"data-testid":"action-entity-edit",item:M(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Nt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(Y,{"data-testid":"action-entity-add-sni",item:q(K.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Nt),{"auth-function":()=>e.canDelete(K)},{default:n.withCtx(()=>[n.createVNode(Y,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:we=>fe(K)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Tf),{"action-pending":V.value,"entity-type":n.unref(xa).Certificate,error:te.value,title:n.unref(i)("certificates.delete.title"),visible:$.value,onCancel:ke,onProceed:Ut},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Ur=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},H1=Ur(L1,[["__scopeId","data-v-412e1ee1"]]),F1={class:"kong-ui-entities-certificates-form"},q1=Ur(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 b;const r=e,i=Hr.useRouter(),{i18nT:o,i18n:{t:s}}=ht.useI18n(),{getMessageFromError:a}=$f(),{axiosInstance:c}=ao({headers:(b=r.config)==null?void 0:b.requestHeaders}),l=n.computed(()=>ki.form[r.config.app].edit),d=n.computed(()=>r.certificateId?sr.Edit:sr.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),y=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),x=n.computed(()=>(d.value===sr.Create||JSON.stringify(p.fields)!==JSON.stringify(y))&&!!p.fields.cert&&!!p.fields.key),C=w=>{var A;p.fields.cert=(w==null?void 0:w.cert)||"",p.fields.key=(w==null?void 0:w.key)||"",p.fields.certAlt=(w==null?void 0:w.cert_alt)||"",p.fields.keyAlt=(w==null?void 0:w.key_alt)||"",p.fields.tags=((A=w==null?void 0:w.tags)==null?void 0:A.join(", "))||"",Object.assign(y,p.fields)},h=()=>{i.push(r.config.cancelRoute)},g=n.computed(()=>{var A,F;let w=`${r.config.apiBaseUrl}${ki.form[r.config.app].validate}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((A=r.config)==null?void 0:A.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(F=r.config)!=null&&F.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.certificateId),w}),m=n.computed(()=>{var A,F;let w=`${r.config.apiBaseUrl}${ki.form[r.config.app][d.value]}`;return r.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((A=r.config)==null?void 0:A.controlPlaneId)||""):r.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(F=r.config)!=null&&F.workspace?`/${r.config.workspace}`:"")),w=w.replace(/{id}/gi,r.certificateId),w}),v=async()=>{var w,A,F,Z,I,E,M,q,U;try{p.isReadonly=!0;const $={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(A=(w=p.fields.tags.split(","))==null?void 0:w.map(te=>String(te||"").trim()))==null?void 0:A.filter(te=>te!=="")};let V;await c.post(g.value,$),d.value==="create"?V=await c.post(m.value,$):d.value==="edit"&&(V=((F=r.config)==null?void 0:F.app)==="konnect"?await c.put(m.value,$):await c.patch(m.value,$)),p.fields.cert=((Z=V==null?void 0:V.data)==null?void 0:Z.cert)||"",p.fields.key=((I=V==null?void 0:V.data)==null?void 0:I.key)||"",p.fields.certAlt=((E=V==null?void 0:V.data)==null?void 0:E.cert_alt)||"",p.fields.keyAlt=((M=V==null?void 0:V.data)==null?void 0:M.key_alt)||"",p.fields.tags=((U=(q=V==null?void 0:V.data)==null?void 0:q.tags)==null?void 0:U.join(", "))||"",Object.assign(y,p.fields),t("update",V==null?void 0:V.data)}catch($){p.errorMessage=a($),t("error",$)}finally{p.isReadonly=!1}};return(w,A)=>{const F=n.resolveComponent("KTextArea"),Z=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",F1,[n.createVNode(n.unref(Of),{"can-submit":x.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":l.value,"is-readonly":p.isReadonly,onCancel:h,"onFetch:error":A[5]||(A[5]=I=>w.$emit("error",I)),"onFetch:success":C,onLoading:A[6]||(A[6]=I=>w.$emit("loading",I)),onSubmit:v},{default:n.withCtx(()=>[n.createVNode(n.unref(so),{description:n.unref(s)("certificates.form.sections.ssl.description"),title:n.unref(s)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(F,{modelValue:p.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=I=>p.fields.cert=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:n.unref(s)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.key,"onUpdate:modelValue":A[1]||(A[1]=I=>p.fields.key=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:n.unref(s)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=I=>p.fields.certAlt=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:n.unref(s)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=I=>p.fields.keyAlt=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:n.unref(s)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(so),{description:n.unref(s)("certificates.form.sections.general.description"),title:n.unref(s)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(Z,{modelValue:p.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=I=>p.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(s)("certificates.form.fields.tags.help"),label:n.unref(s)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),[["__scopeId","data-v-f66bc18c"]]),Ei={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},W1=Ur(n.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=e,i=["dns_names","san_names","subject"],{i18n:{t:o,formatUnixTimeStamp:s}}=ht.useI18n(),{convertKeyToTitle:a}=Mf(),{getPropValue:c}=Rf(),{getCertificateData:l}=ht.useCertificate(),d=n.computed(()=>Ei.form[r.config.app].edit),p=n.ref(),y=n.computed(()=>{if(p.value)return l(p.value)}),x=n.computed(()=>{var b;return((b=y.value)==null?void 0:b.schemaIssuer)||""}),C=n.computed(()=>{var b,w;return(b=y.value)!=null&&b.schemaExpiry?s((w=y.value)==null?void 0:w.schemaExpiry):""}),h=n.computed(()=>{var b;return((b=y.value)==null?void 0:b.schemaKeyUsages)||[]}),g=(b,w)=>{const A=c("rowValue",w);if(b==="expiry")return C.value;if(b==="key_usages")return h.value;if(A)return A[b]},m=b=>{p.value=b,t("fetch:success",b)},v=n.ref({id:{},updated_at:{},created_at:{},cert:{section:ue.Basic,label:o("ca-certificates.form.fields.cert.label"),tooltip:o("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:ue.Basic,label:o("ca-certificates.form.fields.cert_digest.label"),tooltip:o("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:ue.Basic,type:ne.Json,order:7},...r.config.app==="kongManager"&&{expiry:{label:o("certificates.list.table_headers.expiry"),section:ue.Basic,order:1.7,forceShow:!0},issuer:{section:ue.Basic,order:1.5,forceShow:!0},key_usages:{section:ue.Basic,forceShow:!0}},tags:{tooltip:o("ca-certificates.form.fields.tags.tooltip")}});return(b,w)=>{const A=n.resolveComponent("KCodeBlock"),F=n.resolveComponent("KLabel"),Z=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",K1,[n.createVNode(n.unref(Nf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":v.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":w[0]||(w[0]=I=>b.$emit("copy:success",I)),"onFetch:error":w[1]||(w[1]=I=>b.$emit("fetch:error",I)),"onFetch:success":m,onLoading:w[2]||(w[2]=I=>b.$emit("loading",I))},{cert:n.withCtx(I=>[n.unref(c)("rowValue",I)?(n.openBlock(),n.createBlock(A,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",I),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(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(c)("rowValue",I)).filter(E=>!i.includes(E)),E=>(n.openBlock(),n.createBlock(n.unref(Ci),{key:E,"data-testid":`ca-cert-metadata-${E}`,item:{key:E,label:n.unref(a)(E),value:g(E,I),type:E==="key_usages"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),key_usages:n.withCtx(()=>[h.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",z1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.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"},J1={key:0},Y1={key:1},Z1={key:0},Q1={key:1},X1={key:1},eb=Ur(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 pe;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=ht.useI18n(),a=Hr.useRouter(),{axiosInstance:c}=ao({headers:(pe=r.config)==null?void 0:pe.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={issuer:{label:i("ca-certificates.list.table_headers.issuer")},expiry:{label:i("ca-certificates.list.table_headers.expiry")},tags:{label:i("ca-certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var he,T;let G=`${r.config.apiBaseUrl}${Ei.list[r.config.app]}`;return r.config.app==="konnect"?G=G.replace(/{controlPlaneId}/gi,((he=r.config)==null?void 0:he.controlPlaneId)||""):r.config.app==="kongManager"&&(G=G.replace(/\/{workspace}/gi,(T=r.config)!=null&&T.workspace?`/${r.config.workspace}`:"")),G}),C=n.ref(""),h=n.computed(()=>{const G=r.config.app==="konnect"||r.config.isExactMatch;return G?{isExactMatch:G,placeholder:i("ca-certificates.search.placeholder")}:{isExactMatch:G,schema:r.config.filterSchema}}),{fetcher:g,fetcherState:m}=Pf(r.config,x.value),v=()=>{C.value=""},b=()=>{l.value++},w=n.ref(null),A=(G,he)=>{const T=G.id;if(!he(T)){t("copy:error",{entity:G,field:"id",message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:G,field:"id",message:i("ca-certificates.copy.success",{val:T})})},F=(G,he)=>{const T=JSON.stringify(G);if(!he(T)){t("copy:error",{entity:G,message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:G,message:i("ca-certificates.copy.success_brief")})},Z=async G=>{var T;await((T=r.canRetrieve)==null?void 0:T.call(r,G))&&a.push(r.config.getViewRoute(G.id))},I=G=>({label:i("ca-certificates.actions.view"),to:r.config.getViewRoute(G)}),E=G=>({label:i("ca-certificates.actions.edit"),to:r.config.getEditRoute(G)}),M=n.ref(void 0),q=n.ref(!1),U=n.ref(!1),$=n.ref(""),V=Df(r.config,x.value),{certificateDataCache:te,getCertificateData:le}=ht.useCertificate(),be=G=>{M.value=G,q.value=!0},de=()=>{q.value=!1},fe=async()=>{var G,he,T;if((G=M.value)!=null&&G.id){U.value=!0;try{await c.delete(V(M.value.id)),U.value=!1,q.value=!1,l.value++,t("delete:success",M.value)}catch(re){$.value=((T=(he=re.response)==null?void 0:he.data)==null?void 0:T.message)||re.message||i("ca-certificates.errors.delete"),t("error",re)}finally{U.value=!1}}},ke=n.ref(!0);n.watch(m,G=>{var he,T,re,ye;if(Array.isArray((he=G==null?void 0:G.response)==null?void 0:he.data)&&(ke.value=G.response.data.length>0),G.status===Pt.Error){w.value={title:i("ca-certificates.errors.general")},(ye=(re=(T=G.error)==null?void 0:T.response)==null?void 0:re.data)!=null&&ye.message&&(w.value.message=G.error.response.data.message),t("error",G.error);return}te.value={},w.value=null});const Ut=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("ca-certificates.list.empty_state.description"),title:i("ca-certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(Ut.value.title=i("ca-certificates.list.empty_state.title"),Ut.value.ctaText=i("ca-certificates.actions.create"))}),(G,he)=>{const T=n.resolveComponent("KButton"),re=n.resolveComponent("KBadge"),ye=n.resolveComponent("KTruncate"),De=n.resolveComponent("KDropdownItem"),Ot=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",G1,[n.createVNode(n.unref(_f),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":Ut.value,"enable-entity-actions":"","error-message":w.value,fetcher:n.unref(g),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:C.value,"table-headers":n.unref(y),"use-action-outside":e.useActionOutside,onClearSearchInput:v,"onClick:row":he[2]||(he[2]=Y=>Z(Y)),onSort:b},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(jf),{modelValue:C.value,"onUpdate:modelValue":he[0]||(he[0]=Y=>C.value=Y),config:h.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(Nt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(T,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,ke.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:n.withCtx(({row:Y})=>{var Ae;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",J1,n.toDisplayString((Ae=Y==null?void 0:Y.metadata)!=null&&Ae.issuer?Y.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",Y1,n.toDisplayString(n.unref(le)(Y).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:Y})=>{var Ae;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",Z1,n.toDisplayString((Ae=Y==null?void 0:Y.metadata)!=null&&Ae.expiry?n.unref(o)(Y.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",Q1,n.toDisplayString(n.unref(le)(Y).schemaExpiry?n.unref(o)(n.unref(le)(Y).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:Y})=>{var Ae;return[((Ae=Y==null?void 0:Y.tags)==null?void 0:Ae.length)>0?(n.openBlock(),n.createBlock(ye,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Y==null?void 0:Y.tags,K=>(n.openBlock(),n.createBlock(re,{key:K,onClick:he[1]||(he[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(K),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",X1,"-"))]}),actions:n.withCtx(({row:Y})=>[n.createVNode(Ot,null,{default:n.withCtx(({copyToClipboard:Ae})=>[n.createVNode(De,{"data-testid":"action-entity-copy-id",onClick:K=>A(Y,Ae)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Ot,null,{default:n.withCtx(({copyToClipboard:Ae})=>[n.createVNode(De,{"data-testid":"action-entity-copy-json",onClick:K=>F(Y,Ae)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Nt),{"auth-function":()=>e.canRetrieve(Y)},{default:n.withCtx(()=>[n.createVNode(De,{"data-testid":"action-entity-view","has-divider":"",item:I(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Nt),{"auth-function":()=>e.canEdit(Y)},{default:n.withCtx(()=>[n.createVNode(De,{"data-testid":"action-entity-edit",item:E(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Nt),{"auth-function":()=>e.canDelete(Y)},{default:n.withCtx(()=>[n.createVNode(De,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ae=>be(Y)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),n.createVNode(n.unref(Tf),{"action-pending":U.value,"entity-type":n.unref(xa).CACertificate,error:$.value,title:n.unref(i)("ca-certificates.delete.title"),visible:q.value,onCancel:de,onProceed:fe},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-067baf74"]]),tb={class:"kong-ui-entities-ca-certificates-form"},rb=Ur(n.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var v;const r=e,i=Hr.useRouter(),{i18n:{t:o}}=ht.useI18n(),{getMessageFromError:s}=$f(),{axiosInstance:a}=ao({headers:(v=r.config)==null?void 0:v.requestHeaders}),c=n.computed(()=>Ei.form[r.config.app].edit),l=n.computed(()=>r.certificateId?sr.Edit:sr.Create),d=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),y=n.computed(()=>(l.value===sr.Create||JSON.stringify(d.fields)!==JSON.stringify(p))&&!!d.fields.cert),x=b=>{var w;d.fields.cert=(b==null?void 0:b.cert)||"",d.fields.certDigest=(b==null?void 0:b.cert_digest)||"",d.fields.tags=((w=b==null?void 0:b.tags)==null?void 0:w.join(", "))||"",Object.assign(p,d.fields)},C=()=>{i.push(r.config.cancelRoute)},h=n.computed(()=>{var w,A;let b=`${r.config.apiBaseUrl}${Ei.form[r.config.app].validate}`;return r.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((w=r.config)==null?void 0:w.controlPlaneId)||""):r.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(A=r.config)!=null&&A.workspace?`/${r.config.workspace}`:"")),b=b.replace(/{id}/gi,r.certificateId),b}),g=n.computed(()=>{var w,A;let b=`${r.config.apiBaseUrl}${Ei.form[r.config.app][l.value]}`;return r.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((w=r.config)==null?void 0:w.controlPlaneId)||""):r.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(A=r.config)!=null&&A.workspace?`/${r.config.workspace}`:"")),b=b.replace(/{id}/gi,r.certificateId),b}),m=async()=>{var b,w,A,F,Z,I,E;try{d.isReadonly=!0;const M={cert:d.fields.cert,cert_digest:d.fields.certDigest||null,tags:(w=(b=d.fields.tags.split(","))==null?void 0:b.map(U=>String(U||"").trim()))==null?void 0:w.filter(U=>U!=="")};let q;await a.post(h.value,M),l.value==="create"?q=await a.post(g.value,M):l.value==="edit"&&(q=((A=r.config)==null?void 0:A.app)==="konnect"?await a.put(g.value,M):await a.patch(g.value,M)),d.fields.cert=((F=q==null?void 0:q.data)==null?void 0:F.cert)||"",d.fields.certDigest=((Z=q==null?void 0:q.data)==null?void 0:Z.cert_digest)||"",d.fields.tags=((E=(I=q==null?void 0:q.data)==null?void 0:I.tags)==null?void 0:E.join(", "))||"",Object.assign(p,d.fields),t("update",q==null?void 0:q.data)}catch(M){d.errorMessage=s(M),t("error",M)}finally{d.isReadonly=!1}};return(b,w)=>{const A=n.resolveComponent("KTextArea"),F=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",tb,[n.createVNode(n.unref(Of),{"can-submit":y.value,config:e.config,"edit-id":e.certificateId,"error-message":d.errorMessage,"fetch-url":c.value,"is-readonly":d.isReadonly,onCancel:C,"onFetch:error":w[3]||(w[3]=Z=>b.$emit("error",Z)),"onFetch:success":x,onLoading:w[4]||(w[4]=Z=>b.$emit("loading",Z)),onSubmit:m},{default:n.withCtx(()=>[n.createVNode(n.unref(so),{description:n.unref(o)("ca-certificates.form.sections.cert.description"),title:n.unref(o)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(A,{modelValue:d.fields.cert,"onUpdate:modelValue":w[0]||(w[0]=Z=>d.fields.cert=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:n.unref(o)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.cert.tooltip")},readonly:d.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(F,{modelValue:d.fields.certDigest,"onUpdate:modelValue":w[1]||(w[1]=Z=>d.fields.certDigest=Z),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(o)("ca-certificates.form.fields.cert_digest.label"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(so),{description:n.unref(o)("ca-certificates.form.sections.general.description"),title:n.unref(o)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(F,{modelValue:d.fields.tags,"onUpdate:modelValue":w[2]||(w[2]=Z=>d.fields.tags=Z),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(o)("ca-certificates.form.fields.tags.help"),label:n.unref(o)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(o)("ca-certificates.form.fields.tags.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),[["__scopeId","data-v-bad536b1"]]),ib={class:"kong-ui-certificate-entity-config-card"},nb={key:0},ob=Ur(n.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=ht.useI18n(),{convertKeyToTitle:a}=Mf(),{getPropValue:c}=Rf(),{getCertificateData:l}=ht.useCertificate(),d=n.computed(()=>ki.form[r.config.app].edit),p=n.ref(),y=n.ref({id:{},cert:{section:ue.Basic},key:{section:ue.Basic,type:ne.Redacted},metadata:{section:ue.Basic,type:ne.Json},snis:{section:ue.Basic,type:ne.BadgeTag,label:i("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:i("certificates.form.fields.tags.tooltip")},...r.config.app==="kongManager"&&{expiry:{section:ue.Basic,label:i("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:ue.Basic,label:i("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:ue.Basic,label:i("certificates.list.table_headers.san"),forceShow:!0},subject:{section:ue.Basic,label:i("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:ue.Advanced},key_alt:{section:ue.Advanced,type:ne.Redacted}}),x=I=>{p.value=I,t("fetch:success",I)},C=(I,E)=>{const M=c("rowValue",E);if(I==="expiry")return g.value;if(I==="key_usages")return w.value;if(I==="san_names")return v.value;if(M)return M[I]},h=n.computed(()=>{if(p.value)return l(p.value)}),g=n.computed(()=>{var I,E;return(I=h.value)!=null&&I.schemaExpiry?o((E=h.value)==null?void 0:E.schemaExpiry):""}),m=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaIssuer)||""}),v=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSanNames)||""}),b=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSubject)||""}),w=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaKeyUsages)||[]}),A=n.computed(()=>{var I,E;return((E=(I=p==null?void 0:p.value)==null?void 0:I.snis)==null?void 0:E.length)>0}),F=n.computed(()=>{var I;return!!((I=p==null?void 0:p.value)!=null&&I.cert_alt)}),Z=I=>{var E,M;return I==="san_names"?i("certificates.list.table_headers.san"):((M=(E=y.value)==null?void 0:E[I])==null?void 0:M.label)||a(I)};return(I,E)=>{const M=n.resolveComponent("KCodeBlock"),q=n.resolveComponent("KLabel"),U=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",ib,[n.createVNode(n.unref(Nf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":y.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":E[0]||(E[0]=$=>I.$emit("copy:success",$)),"onFetch:error":E[1]||(E[1]=$=>I.$emit("fetch:error",$)),"onFetch:success":x,onLoading:E[2]||(E[2]=$=>I.$emit("loading",$))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx($=>[n.unref(c)("rowValue",$)?(n.openBlock(),n.createBlock(M,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",$),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(q,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx($=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",$)),V=>(n.openBlock(),n.createBlock(n.unref(Ci),{key:V,item:{key:V,value:C(V,$),label:Z(V),type:V==="key_usages"||V==="snis"||V==="dns_names"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(m.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[w.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",nb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value,($,V)=>(n.openBlock(),n.createBlock(U,{key:`key_usages-badge-tag-${V}`,class:"config-badge","data-testid":`key_usages-badge-tag-${V}`,tooltip:$,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString($),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[A.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},F.value?{name:"cert_alt",fn:n.withCtx($=>[n.createTextVNode(" > "),n.unref(c)("rowValue",$)?(n.openBlock(),n.createBlock(M,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(c)("rowValue",$),"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"]]);_e.CACertificateConfigCard=W1,_e.CACertificateForm=rb,_e.CACertificateList=eb,_e.CertificateConfigCard=ob,_e.CertificateForm=q1,_e.CertificateList=H1,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
147
+ `+e.slice(a+1):l+=e.slice(o),l.slice(1)}function l0(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=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"})});