@kong-ui-public/entities-certificates 3.5.8 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities-certificates.es.js +6835 -11509
- package/dist/entities-certificates.umd.js +37 -87
- package/package.json +6 -4
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
(function(xe,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],o):(xe=typeof globalThis<"u"?globalThis:xe||self,o(xe["kong-ui-public-entities-certificates"]={},xe.Vue,xe.VueRouter,xe.KongIcons,xe["kong-ui-public-i18n"],xe["kong-ui-public-entities-shared"]))})(this,function(xe,o,ni,oi,ea,T){"use strict";var Pn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
|
|
2
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
***************************************************************************** */var fl;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof No=="object"?No:typeof self=="object"?self:typeof this=="object"?this:l(),n=o(e);typeof r.Reflect<"u"&&(n=o(r.Reflect,n)),t(n,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(c,d){return function(y,f){Object.defineProperty(c,y,{configurable:!0,writable:!0,value:f}),d&&d(y,f)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function l(){return s()||a()}})(function(t,r){var n=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",s=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,y={create:l?function(){return cl(Object.create(null))}:c?function(){return cl({__proto__:null})}:function(){return cl({})},has:d?function(k,I){return n.call(k,I)}:function(k,I){return I in k},get:d?function(k,I){return n.call(k,I)?k[I]:void 0}:function(k,I){return k[I]}},f=Object.getPrototypeOf(Function),x=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Wb(),b=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Jb(),h=typeof WeakMap=="function"?WeakMap:Yb(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,m=Kb(),v=zb(m);function S(k,I,V,$){if(ee(V)){if(!xe(k))throw new TypeError;if(!Ae(I))throw new TypeError;return J(k,I)}else{if(!xe(k))throw new TypeError;if(!K(I))throw new TypeError;if(!K($)&&!ee($)&&!te($))throw new TypeError;return te($)&&($=void 0),V=re(V),Q(k,I,V,$)}}t("decorate",S);function C(k,I){function V($,X){if(!K($))throw new TypeError;if(!ee(X)&&!Jr(X))throw new TypeError;zr(k,I,$,X)}return V}t("metadata",C);function E(k,I,V,$){if(!K(V))throw new TypeError;return ee($)||($=re($)),zr(k,I,V,$)}t("defineMetadata",E);function T(k,I,V){if(!K(I))throw new TypeError;return ee(V)||(V=re(V)),ne(k,I,V)}t("hasMetadata",T);function N(k,I,V){if(!K(I))throw new TypeError;return ee(V)||(V=re(V)),me(k,I,V)}t("hasOwnMetadata",N);function A(k,I,V){if(!K(I))throw new TypeError;return ee(V)||(V=re(V)),ie(k,I,V)}t("getMetadata",A);function B(k,I,V){if(!K(I))throw new TypeError;return ee(V)||(V=re(V)),Ee(k,I,V)}t("getOwnMetadata",B);function O(k,I){if(!K(k))throw new TypeError;return ee(I)||(I=re(I)),Gr(k,I)}t("getMetadataKeys",O);function H(k,I){if(!K(k))throw new TypeError;return ee(I)||(I=re(I)),hr(k,I)}t("getOwnMetadataKeys",H);function R(k,I,V){if(!K(I))throw new TypeError;if(ee(V)||(V=re(V)),!K(I))throw new TypeError;ee(V)||(V=re(V));var $=Mi(I,V,!1);return ee($)?!1:$.OrdinaryDeleteMetadata(k,I,V)}t("deleteMetadata",R);function J(k,I){for(var V=k.length-1;V>=0;--V){var $=k[V],X=$(I);if(!ee(X)&&!te(X)){if(!Ae(X))throw new TypeError;I=X}}return I}function Q(k,I,V,$){for(var X=k.length-1;X>=0;--X){var be=k[X],Be=be(I,V,$);if(!ee(Be)&&!te(Be)){if(!K(Be))throw new TypeError;$=Be}}return $}function ne(k,I,V){var $=me(k,I,V);if($)return!0;var X=ll(I);return te(X)?!1:ne(k,X,V)}function me(k,I,V){var $=Mi(I,V,!1);return ee($)?!1:Xe($.OrdinaryHasOwnMetadata(k,I,V))}function ie(k,I,V){var $=me(k,I,V);if($)return Ee(k,I,V);var X=ll(I);if(!te(X))return ie(k,X,V)}function Ee(k,I,V){var $=Mi(I,V,!1);if(!ee($))return $.OrdinaryGetOwnMetadata(k,I,V)}function zr(k,I,V,$){var X=Mi(V,$,!0);X.OrdinaryDefineOwnMetadata(k,I,V,$)}function Gr(k,I){var V=hr(k,I),$=ll(k);if($===null)return V;var X=Gr($,I);if(X.length<=0)return V;if(V.length<=0)return X;for(var be=new b,Be=[],se=0,D=V;se<D.length;se++){var z=D[se],F=be.has(z);F||(be.add(z),Be.push(z))}for(var W=0,ae=X;W<ae.length;W++){var z=ae[W],F=be.has(z);F||(be.add(z),Be.push(z))}return Be}function hr(k,I){var V=Mi(k,I,!1);return V?V.OrdinaryOwnMetadataKeys(k,I):[]}function Dt(k){if(k===null)return 1;switch(typeof k){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return k===null?1:6;default:return 6}}function ee(k){return k===void 0}function te(k){return k===null}function U(k){return typeof k=="symbol"}function K(k){return typeof k=="object"?k!==null:typeof k=="function"}function fe(k,I){switch(Dt(k)){case 0:return k;case 1:return k;case 2:return k;case 3:return k;case 4:return k;case 5:return k}var V=I===3?"string":I===5?"number":"default",$=lp(k,s);if($!==void 0){var X=$.call(k,V);if(K(X))throw new TypeError;return X}return Le(k,V==="default"?"number":V)}function Le(k,I){if(I==="string"){var V=k.toString;if(Z(V)){var $=V.call(k);if(!K($))return $}var X=k.valueOf;if(Z(X)){var $=X.call(k);if(!K($))return $}}else{var X=k.valueOf;if(Z(X)){var $=X.call(k);if(!K($))return $}var be=k.toString;if(Z(be)){var $=be.call(k);if(!K($))return $}}throw new TypeError}function Xe(k){return!!k}function Wr(k){return""+k}function re(k){var I=fe(k,3);return U(I)?I:Wr(I)}function xe(k){return Array.isArray?Array.isArray(k):k instanceof Object?k instanceof Array:Object.prototype.toString.call(k)==="[object Array]"}function Z(k){return typeof k=="function"}function Ae(k){return typeof k=="function"}function Jr(k){switch(Dt(k)){case 3:return!0;case 4:return!0;default:return!1}}function al(k,I){return k===I||k!==k&&I!==I}function lp(k,I){var V=k[I];if(V!=null){if(!Z(V))throw new TypeError;return V}}function cp(k){var I=lp(k,a);if(!Z(I))throw new TypeError;var V=I.call(k);if(!K(V))throw new TypeError;return V}function up(k){return k.value}function dp(k){var I=k.next();return I.done?!1:I}function fp(k){var I=k.return;I&&I.call(k)}function ll(k){var I=Object.getPrototypeOf(k);if(typeof k!="function"||k===f||I!==f)return I;var V=k.prototype,$=V&&Object.getPrototypeOf(V);if($==null||$===Object.prototype)return I;var X=$.constructor;return typeof X!="function"||X===k?I:X}function qb(){var k;!ee(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(k=Gb(r.Reflect));var I,V,$,X=new h,be={registerProvider:Be,getProvider:D,setProvider:F};return be;function Be(W){if(!Object.isExtensible(be))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case k===W:break;case ee(I):I=W;break;case I===W:break;case ee(V):V=W;break;case V===W:break;default:$===void 0&&($=new b),$.add(W);break}}function se(W,ae){if(!ee(I)){if(I.isProviderFor(W,ae))return I;if(!ee(V)){if(V.isProviderFor(W,ae))return I;if(!ee($))for(var he=cp($);;){var we=dp(he);if(!we)return;var ft=up(we);if(ft.isProviderFor(W,ae))return fp(he),ft}}}if(!ee(k)&&k.isProviderFor(W,ae))return k}function D(W,ae){var he=X.get(W),we;return ee(he)||(we=he.get(ae)),ee(we)&&(we=se(W,ae),ee(we)||(ee(he)&&(he=new x,X.set(W,he)),he.set(ae,we))),we}function z(W){if(ee(W))throw new TypeError;return I===W||V===W||!ee($)&&$.has(W)}function F(W,ae,he){if(!z(he))throw new Error("Metadata provider not registered.");var we=D(W,ae);if(we!==he){if(!ee(we))return!1;var ft=X.get(W);ee(ft)&&(ft=new x,X.set(W,ft)),ft.set(ae,he)}return!0}}function Kb(){var k;return!ee(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(k=r.Reflect[g]),ee(k)&&(k=qb()),!ee(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:k}),k}function zb(k){var I=new h,V={isProviderFor:function(z,F){var W=I.get(z);return ee(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:Be,OrdinaryHasOwnMetadata:X,OrdinaryGetOwnMetadata:be,OrdinaryOwnMetadataKeys:se,OrdinaryDeleteMetadata:D};return m.registerProvider(V),V;function $(z,F,W){var ae=I.get(z),he=!1;if(ee(ae)){if(!W)return;ae=new x,I.set(z,ae),he=!0}var we=ae.get(F);if(ee(we)){if(!W)return;if(we=new x,ae.set(F,we),!k.setProvider(z,F,V))throw ae.delete(F),he&&I.delete(z),new Error("Wrong provider for target.")}return we}function X(z,F,W){var ae=$(F,W,!1);return ee(ae)?!1:Xe(ae.has(z))}function be(z,F,W){var ae=$(F,W,!1);if(!ee(ae))return ae.get(z)}function Be(z,F,W,ae){var he=$(W,ae,!0);he.set(z,F)}function se(z,F){var W=[],ae=$(z,F,!1);if(ee(ae))return W;for(var he=ae.keys(),we=cp(he),ft=0;;){var pp=dp(we);if(!pp)return W.length=ft,W;var Zb=up(pp);try{W[ft]=Zb}catch(Qb){try{fp(we)}finally{throw Qb}}ft++}}function D(z,F,W){var ae=$(F,W,!1);if(ee(ae)||!ae.delete(z))return!1;if(ae.size===0){var he=I.get(F);ee(he)||(he.delete(W),he.size===0&&I.delete(he))}return!0}}function Gb(k){var I=k.defineMetadata,V=k.hasOwnMetadata,$=k.getOwnMetadata,X=k.getOwnMetadataKeys,be=k.deleteMetadata,Be=new h,se={isProviderFor:function(D,z){var F=Be.get(D);return ee(F)?X(D,z).length?(ee(F)&&(F=new b,Be.set(D,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:I,OrdinaryHasOwnMetadata:V,OrdinaryGetOwnMetadata:$,OrdinaryOwnMetadataKeys:X,OrdinaryDeleteMetadata:be};return se}function Mi(k,I,V){var $=m.getProvider(k,I);if(!ee($))return $;if(V){if(m.setProvider(k,I,v))return v;throw new Error("Illegal state.")}}function Wb(){var k={},I=[],V=function(){function se(D,z,F){this._index=0,this._keys=D,this._values=z,this._selector=F}return se.prototype["@@iterator"]=function(){return this},se.prototype[a]=function(){return this},se.prototype.next=function(){var D=this._index;if(D>=0&&D<this._keys.length){var z=this._selector(this._keys[D],this._values[D]);return D+1>=this._keys.length?(this._index=-1,this._keys=I,this._values=I):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},se.prototype.throw=function(D){throw this._index>=0&&(this._index=-1,this._keys=I,this._values=I),D},se.prototype.return=function(D){return this._index>=0&&(this._index=-1,this._keys=I,this._values=I),{value:D,done:!0}},se}(),$=function(){function se(){this._keys=[],this._values=[],this._cacheKey=k,this._cacheIndex=-2}return Object.defineProperty(se.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),se.prototype.has=function(D){return this._find(D,!1)>=0},se.prototype.get=function(D){var z=this._find(D,!1);return z>=0?this._values[z]:void 0},se.prototype.set=function(D,z){var F=this._find(D,!0);return this._values[F]=z,this},se.prototype.delete=function(D){var z=this._find(D,!1);if(z>=0){for(var F=this._keys.length,W=z+1;W<F;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,al(D,this._cacheKey)&&(this._cacheKey=k,this._cacheIndex=-2),!0}return!1},se.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=k,this._cacheIndex=-2},se.prototype.keys=function(){return new V(this._keys,this._values,X)},se.prototype.values=function(){return new V(this._keys,this._values,be)},se.prototype.entries=function(){return new V(this._keys,this._values,Be)},se.prototype["@@iterator"]=function(){return this.entries()},se.prototype[a]=function(){return this.entries()},se.prototype._find=function(D,z){if(!al(this._cacheKey,D)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(al(this._keys[F],D)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(D),this._values.push(void 0)),this._cacheIndex},se}();return $;function X(se,D){return se}function be(se,D){return D}function Be(se,D){return[se,D]}}function Jb(){var k=function(){function I(){this._map=new x}return Object.defineProperty(I.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),I.prototype.has=function(V){return this._map.has(V)},I.prototype.add=function(V){return this._map.set(V,V),this},I.prototype.delete=function(V){return this._map.delete(V)},I.prototype.clear=function(){this._map.clear()},I.prototype.keys=function(){return this._map.keys()},I.prototype.values=function(){return this._map.keys()},I.prototype.entries=function(){return this._map.entries()},I.prototype["@@iterator"]=function(){return this.keys()},I.prototype[a]=function(){return this.keys()},I}();return k}function Yb(){var k=16,I=y.create(),V=$();return function(){function D(){this._key=$()}return D.prototype.has=function(z){var F=X(z,!1);return F!==void 0?y.has(F,this._key):!1},D.prototype.get=function(z){var F=X(z,!1);return F!==void 0?y.get(F,this._key):void 0},D.prototype.set=function(z,F){var W=X(z,!0);return W[this._key]=F,this},D.prototype.delete=function(z){var F=X(z,!1);return F!==void 0?delete F[this._key]:!1},D.prototype.clear=function(){this._key=$()},D}();function $(){var D;do D="@@WeakMap@@"+se();while(y.has(I,D));return I[D]=!0,D}function X(D,z){if(!n.call(D,V)){if(!z)return;Object.defineProperty(D,V,{value:y.create()})}return D[V]}function be(D,z){for(var F=0;F<z;++F)D[F]=Math.random()*255|0;return D}function Be(D){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(D)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(D)):be(new Uint8Array(D),D):be(new Array(D),D)}function se(){var D=Be(k);D[6]=D[6]&79|64,D[8]=D[8]&191|128;for(var z="",F=0;F<k;++F){var W=D[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function cl(k){return k.__=void 0,delete k.__,k}})})(fl||(fl={}));/*!
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */var ta;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Pn=="object"?Pn:typeof self=="object"?self:typeof this=="object"?this:u(),i=n(r);typeof t.Reflect<"u"&&(i=n(t.Reflect,i)),e(i,t),typeof t.Reflect>"u"&&(t.Reflect=r);function n(f,d){return function(v,y){Object.defineProperty(f,v,{configurable:!0,writable:!0,value:y}),d&&d(v,y)}}function s(){try{return Function("return this;")()}catch{}}function c(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||c()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",c=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,d=!u&&!f,v={create:u?function(){return Xs(Object.create(null))}:f?function(){return Xs({__proto__:null})}:function(){return Xs({})},has:d?function(g,b){return i.call(g,b)}:function(g,b){return b in g},get:d?function(g,b){return i.call(g,b)?g[b]:void 0}:function(g,b){return g[b]}},y=Object.getPrototypeOf(Function),z=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ap(),O=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:cp(),p=typeof WeakMap=="function"?WeakMap:lp(),m=n?Symbol.for("@reflect-metadata:registry"):void 0,S=np(),w=op(S);function I(g,b,A,N){if(W(A)){if(!ve(g))throw new TypeError;if(!be(b))throw new TypeError;return Be(g,b)}else{if(!ve(g))throw new TypeError;if(!H(b))throw new TypeError;if(!H(N)&&!W(N)&&!J(N))throw new TypeError;return J(N)&&(N=void 0),A=Y(A),ce(g,b,A,N)}}e("decorate",I);function k(g,b){function A(N,G){if(!H(N))throw new TypeError;if(!W(G)&&!Ar(G))throw new TypeError;br(g,b,N,G)}return A}e("metadata",k);function B(g,b,A,N){if(!H(A))throw new TypeError;return W(N)||(N=Y(N)),br(g,b,A,N)}e("defineMetadata",B);function Z(g,b,A){if(!H(b))throw new TypeError;return W(A)||(A=Y(A)),pe(g,b,A)}e("hasMetadata",Z);function se(g,b,A){if(!H(b))throw new TypeError;return W(A)||(A=Y(A)),at(g,b,A)}e("hasOwnMetadata",se);function D(g,b,A){if(!H(b))throw new TypeError;return W(A)||(A=Y(A)),ee(g,b,A)}e("getMetadata",D);function C(g,b,A){if(!H(b))throw new TypeError;return W(A)||(A=Y(A)),bt(g,b,A)}e("getOwnMetadata",C);function j(g,b){if(!H(g))throw new TypeError;return W(b)||(b=Y(b)),wr(g,b)}e("getMetadataKeys",j);function de(g,b){if(!H(g))throw new TypeError;return W(b)||(b=Y(b)),Gt(g,b)}e("getOwnMetadataKeys",de);function re(g,b,A){if(!H(b))throw new TypeError;if(W(A)||(A=Y(A)),!H(b))throw new TypeError;W(A)||(A=Y(A));var N=ii(b,A,!1);return W(N)?!1:N.OrdinaryDeleteMetadata(g,b,A)}e("deleteMetadata",re);function Be(g,b){for(var A=g.length-1;A>=0;--A){var N=g[A],G=N(b);if(!W(G)&&!J(G)){if(!be(G))throw new TypeError;b=G}}return b}function ce(g,b,A,N){for(var G=g.length-1;G>=0;--G){var he=g[G],we=he(b,A,N);if(!W(we)&&!J(we)){if(!H(we))throw new TypeError;N=we}}return N}function pe(g,b,A){var N=at(g,b,A);if(N)return!0;var G=Qs(b);return J(G)?!1:pe(g,G,A)}function at(g,b,A){var N=ii(b,A,!1);return W(N)?!1:Ue(N.OrdinaryHasOwnMetadata(g,b,A))}function ee(g,b,A){var N=at(g,b,A);if(N)return bt(g,b,A);var G=Qs(b);if(!J(G))return ee(g,G,A)}function bt(g,b,A){var N=ii(b,A,!1);if(!W(N))return N.OrdinaryGetOwnMetadata(g,b,A)}function br(g,b,A,N){var G=ii(A,N,!0);G.OrdinaryDefineOwnMetadata(g,b,A,N)}function wr(g,b){var A=Gt(g,b),N=Qs(g);if(N===null)return A;var G=wr(N,b);if(G.length<=0)return A;if(A.length<=0)return G;for(var he=new O,we=[],X=0,V=A;X<V.length;X++){var L=V[X],$=he.has(L);$||(he.add(L),we.push(L))}for(var K=0,te=G;K<te.length;K++){var L=te[K],$=he.has(L);$||(he.add(L),we.push(L))}return we}function Gt(g,b){var A=ii(g,b,!1);return A?A.OrdinaryOwnMetadataKeys(g,b):[]}function wt(g){if(g===null)return 1;switch(typeof g){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return g===null?1:6;default:return 6}}function W(g){return g===void 0}function J(g){return g===null}function R(g){return typeof g=="symbol"}function H(g){return typeof g=="object"?g!==null:typeof g=="function"}function ae(g,b){switch(wt(g)){case 0:return g;case 1:return g;case 2:return g;case 3:return g;case 4:return g;case 5:return g}var A=b===3?"string":b===5?"number":"default",N=Au(g,s);if(N!==void 0){var G=N.call(g,A);if(H(G))throw new TypeError;return G}return Ne(g,A==="default"?"number":A)}function Ne(g,b){if(b==="string"){var A=g.toString;if(q(A)){var N=A.call(g);if(!H(N))return N}var G=g.valueOf;if(q(G)){var N=G.call(g);if(!H(N))return N}}else{var G=g.valueOf;if(q(G)){var N=G.call(g);if(!H(N))return N}var he=g.toString;if(q(he)){var N=he.call(g);if(!H(N))return N}}throw new TypeError}function Ue(g){return!!g}function Sr(g){return""+g}function Y(g){var b=ae(g,3);return R(b)?b:Sr(b)}function ve(g){return Array.isArray?Array.isArray(g):g instanceof Object?g instanceof Array:Object.prototype.toString.call(g)==="[object Array]"}function q(g){return typeof g=="function"}function be(g){return typeof g=="function"}function Ar(g){switch(wt(g)){case 3:return!0;case 4:return!0;default:return!1}}function Zs(g,b){return g===b||g!==g&&b!==b}function Au(g,b){var A=g[b];if(A!=null){if(!q(A))throw new TypeError;return A}}function ku(g){var b=Au(g,c);if(!q(b))throw new TypeError;var A=b.call(g);if(!H(A))throw new TypeError;return A}function xu(g){return g.value}function Cu(g){var b=g.next();return b.done?!1:b}function Bu(g){var b=g.return;b&&b.call(g)}function Qs(g){var b=Object.getPrototypeOf(g);if(typeof g!="function"||g===y||b!==y)return b;var A=g.prototype,N=A&&Object.getPrototypeOf(A);if(N==null||N===Object.prototype)return b;var G=N.constructor;return typeof G!="function"||G===g?b:G}function ip(){var g;!W(m)&&typeof t.Reflect<"u"&&!(m in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(g=sp(t.Reflect));var b,A,N,G=new p,he={registerProvider:we,getProvider:V,setProvider:$};return he;function we(K){if(!Object.isExtensible(he))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case g===K:break;case W(b):b=K;break;case b===K:break;case W(A):A=K;break;case A===K:break;default:N===void 0&&(N=new O),N.add(K);break}}function X(K,te){if(!W(b)){if(b.isProviderFor(K,te))return b;if(!W(A)){if(A.isProviderFor(K,te))return b;if(!W(N))for(var le=ku(N);;){var ye=Cu(le);if(!ye)return;var Qe=xu(ye);if(Qe.isProviderFor(K,te))return Bu(le),Qe}}}if(!W(g)&&g.isProviderFor(K,te))return g}function V(K,te){var le=G.get(K),ye;return W(le)||(ye=le.get(te)),W(ye)&&(ye=X(K,te),W(ye)||(W(le)&&(le=new z,G.set(K,le)),le.set(te,ye))),ye}function L(K){if(W(K))throw new TypeError;return b===K||A===K||!W(N)&&N.has(K)}function $(K,te,le){if(!L(le))throw new Error("Metadata provider not registered.");var ye=V(K,te);if(ye!==le){if(!W(ye))return!1;var Qe=G.get(K);W(Qe)&&(Qe=new z,G.set(K,Qe)),Qe.set(te,le)}return!0}}function np(){var g;return!W(m)&&H(t.Reflect)&&Object.isExtensible(t.Reflect)&&(g=t.Reflect[m]),W(g)&&(g=ip()),!W(m)&&H(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,m,{enumerable:!1,configurable:!1,writable:!1,value:g}),g}function op(g){var b=new p,A={isProviderFor:function(L,$){var K=b.get(L);return W(K)?!1:K.has($)},OrdinaryDefineOwnMetadata:we,OrdinaryHasOwnMetadata:G,OrdinaryGetOwnMetadata:he,OrdinaryOwnMetadataKeys:X,OrdinaryDeleteMetadata:V};return S.registerProvider(A),A;function N(L,$,K){var te=b.get(L),le=!1;if(W(te)){if(!K)return;te=new z,b.set(L,te),le=!0}var ye=te.get($);if(W(ye)){if(!K)return;if(ye=new z,te.set($,ye),!g.setProvider(L,$,A))throw te.delete($),le&&b.delete(L),new Error("Wrong provider for target.")}return ye}function G(L,$,K){var te=N($,K,!1);return W(te)?!1:Ue(te.has(L))}function he(L,$,K){var te=N($,K,!1);if(!W(te))return te.get(L)}function we(L,$,K,te){var le=N(K,te,!0);le.set(L,$)}function X(L,$){var K=[],te=N(L,$,!1);if(W(te))return K;for(var le=te.keys(),ye=ku(le),Qe=0;;){var Eu=Cu(ye);if(!Eu)return K.length=Qe,K;var up=xu(Eu);try{K[Qe]=up}catch(fp){try{Bu(ye)}finally{throw fp}}Qe++}}function V(L,$,K){var te=N($,K,!1);if(W(te)||!te.delete(L))return!1;if(te.size===0){var le=b.get($);W(le)||(le.delete(K),le.size===0&&b.delete(le))}return!0}}function sp(g){var b=g.defineMetadata,A=g.hasOwnMetadata,N=g.getOwnMetadata,G=g.getOwnMetadataKeys,he=g.deleteMetadata,we=new p,X={isProviderFor:function(V,L){var $=we.get(V);return W($)?G(V,L).length?(W($)&&($=new O,we.set(V,$)),$.add(L),!0):!1:$.has(L)},OrdinaryDefineOwnMetadata:b,OrdinaryHasOwnMetadata:A,OrdinaryGetOwnMetadata:N,OrdinaryOwnMetadataKeys:G,OrdinaryDeleteMetadata:he};return X}function ii(g,b,A){var N=S.getProvider(g,b);if(!W(N))return N;if(A){if(S.setProvider(g,b,w))return w;throw new Error("Illegal state.")}}function ap(){var g={},b=[],A=function(){function X(V,L,$){this._index=0,this._keys=V,this._values=L,this._selector=$}return X.prototype["@@iterator"]=function(){return this},X.prototype[c]=function(){return this},X.prototype.next=function(){var V=this._index;if(V>=0&&V<this._keys.length){var L=this._selector(this._keys[V],this._values[V]);return V+1>=this._keys.length?(this._index=-1,this._keys=b,this._values=b):this._index++,{value:L,done:!1}}return{value:void 0,done:!0}},X.prototype.throw=function(V){throw this._index>=0&&(this._index=-1,this._keys=b,this._values=b),V},X.prototype.return=function(V){return this._index>=0&&(this._index=-1,this._keys=b,this._values=b),{value:V,done:!0}},X}(),N=function(){function X(){this._keys=[],this._values=[],this._cacheKey=g,this._cacheIndex=-2}return Object.defineProperty(X.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),X.prototype.has=function(V){return this._find(V,!1)>=0},X.prototype.get=function(V){var L=this._find(V,!1);return L>=0?this._values[L]:void 0},X.prototype.set=function(V,L){var $=this._find(V,!0);return this._values[$]=L,this},X.prototype.delete=function(V){var L=this._find(V,!1);if(L>=0){for(var $=this._keys.length,K=L+1;K<$;K++)this._keys[K-1]=this._keys[K],this._values[K-1]=this._values[K];return this._keys.length--,this._values.length--,Zs(V,this._cacheKey)&&(this._cacheKey=g,this._cacheIndex=-2),!0}return!1},X.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=g,this._cacheIndex=-2},X.prototype.keys=function(){return new A(this._keys,this._values,G)},X.prototype.values=function(){return new A(this._keys,this._values,he)},X.prototype.entries=function(){return new A(this._keys,this._values,we)},X.prototype["@@iterator"]=function(){return this.entries()},X.prototype[c]=function(){return this.entries()},X.prototype._find=function(V,L){if(!Zs(this._cacheKey,V)){this._cacheIndex=-1;for(var $=0;$<this._keys.length;$++)if(Zs(this._keys[$],V)){this._cacheIndex=$;break}}return this._cacheIndex<0&&L&&(this._cacheIndex=this._keys.length,this._keys.push(V),this._values.push(void 0)),this._cacheIndex},X}();return N;function G(X,V){return X}function he(X,V){return V}function we(X,V){return[X,V]}}function cp(){var g=function(){function b(){this._map=new z}return Object.defineProperty(b.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),b.prototype.has=function(A){return this._map.has(A)},b.prototype.add=function(A){return this._map.set(A,A),this},b.prototype.delete=function(A){return this._map.delete(A)},b.prototype.clear=function(){this._map.clear()},b.prototype.keys=function(){return this._map.keys()},b.prototype.values=function(){return this._map.keys()},b.prototype.entries=function(){return this._map.entries()},b.prototype["@@iterator"]=function(){return this.keys()},b.prototype[c]=function(){return this.keys()},b}();return g}function lp(){var g=16,b=v.create(),A=N();return function(){function V(){this._key=N()}return V.prototype.has=function(L){var $=G(L,!1);return $!==void 0?v.has($,this._key):!1},V.prototype.get=function(L){var $=G(L,!1);return $!==void 0?v.get($,this._key):void 0},V.prototype.set=function(L,$){var K=G(L,!0);return K[this._key]=$,this},V.prototype.delete=function(L){var $=G(L,!1);return $!==void 0?delete $[this._key]:!1},V.prototype.clear=function(){this._key=N()},V}();function N(){var V;do V="@@WeakMap@@"+X();while(v.has(b,V));return b[V]=!0,V}function G(V,L){if(!i.call(V,A)){if(!L)return;Object.defineProperty(V,A,{value:v.create()})}return V[A]}function he(V,L){for(var $=0;$<L;++$)V[$]=Math.random()*255|0;return V}function we(V){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(V)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(V)):he(new Uint8Array(V),V):he(new Array(V),V)}function X(){var V=we(g);V[6]=V[6]&79|64,V[8]=V[8]&191|128;for(var L="",$=0;$<g;++$){var K=V[$];($===4||$===6||$===8)&&(L+="-"),K<16&&(L+="0"),L+=K.toString(16).toLowerCase()}return L}}function Xs(g){return g.__=void 0,delete g.__,g}})})(ta||(ta={}));/*!
|
|
15
15
|
* MIT License
|
|
16
16
|
*
|
|
17
17
|
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
35
|
* SOFTWARE.
|
|
36
36
|
*
|
|
37
|
-
*/const
|
|
37
|
+
*/const Ou="[object ArrayBuffer]";class _{static isArrayBuffer(e){return Object.prototype.toString.call(e)===Ou}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){const i=_.toUint8Array(e),n=_.toUint8Array(t);if(i.length!==n.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let i=0;for(const c of t)i+=c.byteLength;const n=new Uint8Array(i);let s=0;for(const c of t){const u=this.toUint8Array(c);n.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}}const Dn="string",Tu=/^[0-9a-f]+$/i,Vu=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,_u=/^[a-zA-Z0-9-_]+$/;class ra{static fromString(e){const t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i.buffer}static toString(e){const t=_.toUint8Array(e);let i="";for(let s=0;s<t.length;s++)i+=String.fromCharCode(t[s]);return decodeURIComponent(escape(i))}}class Xe{static toString(e,t=!1){const i=_.toArrayBuffer(e),n=new DataView(i);let s="";for(let c=0;c<i.byteLength;c+=2){const u=n.getUint16(c,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){const i=new ArrayBuffer(e.length*2),n=new DataView(i);for(let s=0;s<e.length;s++)n.setUint16(s*2,e.charCodeAt(s),t);return i}}class M{static isHex(e){return typeof e===Dn&&Tu.test(e)}static isBase64(e){return typeof e===Dn&&Vu.test(e)}static isBase64Url(e){return typeof e===Dn&&_u.test(e)}static ToString(e,t="utf8"){const i=_.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return Xe.toString(i,!0);case"utf16":case"utf16be":return Xe.toString(i);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return Xe.fromString(e,!0);case"utf16":case"utf16be":return Xe.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){const t=_.toUint8Array(e);if(typeof btoa<"u"){const i=this.ToString(t,"binary");return btoa(i)}else return Buffer.from(t).toString("base64")}static FromBase64(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!M.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!M.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=M.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return ra.fromString(e);case"utf16":case"utf16be":return Xe.fromString(e);case"utf16le":case"usc2":return Xe.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=M.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return ra.toString(e);case"utf16":case"utf16be":return Xe.toString(e);case"utf16le":case"usc2":return Xe.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){const t=e.length,i=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);return i.buffer}static ToBinary(e){const t=_.toUint8Array(e);let i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){const t=_.toUint8Array(e);let i="";const n=t.length;for(let s=0;s<n;s++){const c=t[s];c<16&&(i+="0"),i+=c.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!M.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);const i=new Uint8Array(t.length/2);for(let n=0;n<t.length;n=n+2){const s=t.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,t=!1){return Xe.toString(e,t)}static FromUtf16String(e,t=!1){return Xe.fromString(e,t)}static Base64Padding(e){const t=4-e.length%4;if(t<4)for(let i=0;i<t;i++)e+="=";return e}static formatString(e){return(e==null?void 0:e.replace(/[\n\r\t ]/g,""))||""}}M.DEFAULT_UTF8_ENCODING="utf8";function ju(...r){const e=r.map(n=>n.byteLength).reduce((n,s)=>n+s),t=new Uint8Array(e);let i=0;return r.map(n=>new Uint8Array(n)).forEach(n=>{for(const s of n)t[i++]=s}),t.buffer}function ia(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}/*!
|
|
38
38
|
Copyright (c) Peculiar Ventures, LLC
|
|
39
|
-
*/function
|
|
39
|
+
*/function zt(r,e){let t=0;if(r.length===1)return r[0];for(let i=r.length-1;i>=0;i--)t+=r[r.length-1-i]*Math.pow(2,e*i);return t}function Et(r,e,t=-1){const i=t;let n=r,s=0,c=Math.pow(2,e);for(let u=1;u<8;u++){if(r<c){let f;if(i<0)f=new ArrayBuffer(u),s=u;else{if(i<u)return new ArrayBuffer(0);f=new ArrayBuffer(i),s=i}const d=new Uint8Array(f);for(let v=u-1;v>=0;v--){const y=Math.pow(2,v*e);d[s-v-1]=Math.floor(n/y),n-=d[s-v-1]*y}return f}c*=Math.pow(2,e)}return new ArrayBuffer(0)}function Rn(...r){let e=0,t=0;for(const s of r)e+=s.length;const i=new ArrayBuffer(e),n=new Uint8Array(i);for(const s of r)n.set(s,t),t+=s.length;return n}function na(){const r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const u=r[0]===255&&r[1]&128,f=r[0]===0&&(r[1]&128)===0;(u||f)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;const i=zt(t,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let u=0;u<this.valueHex.byteLength;u++)s[u]=r[u];return s[0]&=127,zt(s,8)-i}function Pu(r){const e=r<0?r*-1:r;let t=128;for(let i=1;i<8;i++){if(e<=t){if(r<0){const c=t-e,u=Et(c,8,i),f=new Uint8Array(u);return f[0]|=128,u}let n=Et(e,8,i),s=new Uint8Array(n);if(s[0]&128){const c=n.slice(0),u=new Uint8Array(c);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let f=0;f<c.byteLength;f++)s[f+1]=u[f];s[0]=0}return n}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function Du(r,e){if(r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}function De(r,e){const t=r.toString(10);if(e<t.length)return"";const i=e-t.length,n=new Array(i);for(let c=0;c<i;c++)n[c]="0";return n.join("").concat(t)}/*!
|
|
40
40
|
* Copyright (c) 2014, GMO GlobalSign
|
|
41
41
|
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
42
42
|
* All rights reserved.
|
|
@@ -68,26 +68,26 @@
|
|
|
68
68
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
69
69
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
70
70
|
*
|
|
71
|
-
*/function Ui(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function _o(e){let t=0,r=0;for(let o=0;o<e.length;o++){const s=e[o];t+=s.byteLength}const n=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];n.set(new Uint8Array(s),r),r+=s.byteLength}return n.buffer}function St(e,t,r,n){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):n<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-n<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 Li{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return _o(this.items)}}const Zr=[new Uint8Array([1])],gl="0123456789",To="name",ml="valueHexView",Tp="isHexOnly",jp="idBlock",$p="tagClass",Dp="tagNumber",Mp="isConstructed",Rp="fromBER",Pp="toBER",Up="local",Fe="",ot=new ArrayBuffer(0),Fi=new Uint8Array(0),Qr="EndOfContent",bl="OCTET STRING",wl="BIT STRING";function ht(e){var t;return t=class extends e{constructor(...n){var o;super(...n);const s=n[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?M.toUint8Array(s.valueHex):Fi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,o,s){const a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!St(this,a,o,s))return-1;const l=o+s;return this.valueHexView=a.subarray(o,l),this.valueHexView.length?(this.blockLength=s,l):(this.warnings.push("Zero buffer length"),o)}toBER(n=!1){return this.isHexOnly?n?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",ot)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Wt{constructor({blockLength:t=0,error:r=Fe,warnings:n=[],valueBeforeDecode:o=Fi}={}){this.blockLength=t,this.error=r,this.warnings=n,this.valueBeforeDecodeView=M.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:L.ToHex(this.valueBeforeDecodeView)}}}Wt.NAME="baseBlock";class Me extends Wt{fromBER(t,r,n){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 vl extends ht(Wt){constructor({idBlock:t={}}={}){var r,n,o,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?M.toUint8Array(t.valueHex):Fi,this.tagClass=(n=t.tagClass)!==null&&n!==void 0?n:-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",ot}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=Gt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,l=new Uint8Array(a+1);if(l[0]=r|31,!t){for(let c=0;c<a-1;c++)l[c+1]=s[c]|128;l[a]=s[a-1]}return l.buffer}const n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=r|31,!t){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)n[s+1]=o[s]|128;n[this.valueHexView.byteLength]=o[o.length-1]}return n.buffer}fromBER(t,r,n){const o=M.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);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 l=s[0]&31;if(l!==31)this.tagNumber=l,this.blockLength=1;else{let c=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[c]&128;){if(d[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===y){y+=255;const x=new Uint8Array(y);for(let b=0;b<d.length;b++)x[b]=d[b];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=c+1,d[c-1]=s[c]&127;const f=new Uint8Array(c);for(let x=0;x<c;x++)f[x]=d[x];d=this.valueHexView=new Uint8Array(c),d.set(f),this.blockLength<=9?this.tagNumber=yr(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}}}vl.NAME="identificationBlock";class kl extends Wt{constructor({lenBlock:t={}}={}){var r,n,o;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(n=t.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(o=t.length)!==null&&o!==void 0?o:0}fromBER(t,r,n){const o=M.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);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 l=r+1,c=o.subarray(l,l+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=yr(c,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,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(n=new Uint8Array(r),n[0]=128),r;if(this.longFormUsed){const o=Gt(this.length,8);if(o.byteLength>127)return this.error="Too big length",ot;if(r=new ArrayBuffer(o.byteLength+1),t)return r;const s=new Uint8Array(o);n=new Uint8Array(r),n[0]=o.byteLength|128;for(let a=0;a<o.byteLength;a++)n[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(n=new Uint8Array(r),n[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}kl.NAME="lengthBlock";const P={};class Ne extends Wt{constructor({name:t=Fe,optional:r=!1,primitiveSchema:n,...o}={},s){super(o),this.name=t,this.optional=r,n&&(this.primitiveSchema=n),this.idBlock=new vl(o),this.lenBlock=new kl(o),this.valueBlock=s?new s(o):new Me(o)}fromBER(t,r,n){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?n: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 n=r||new Li;r||Cl(this);const o=this.idBlock.toBER(t);if(n.write(o),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,n),n.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);n.write(a),n.write(s)}return r?ot:n.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():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),n=t.toBER();return _p(r,n)}}Ne.NAME="BaseBlock";function Cl(e){if(e instanceof P.Constructed)for(const t of e.valueBlock.value)Cl(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class jo extends Ne{constructor({value:t=Fe,...r}={},n){super(r,n),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,n){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?n: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}'`}}jo.NAME="BaseStringBlock";class Sl extends ht(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}Sl.NAME="PrimitiveValueBlock";var xl;class Xr extends Ne{constructor(t={}){super(t,Sl),this.idBlock.isConstructed=!1}}xl=Xr,P.Primitive=xl,Xr.NAME="PRIMITIVE";function Lp(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 gr(e,t=0,r=e.length){const n=t;let o=new Ne({},Me);const s=new Wt;if(!St(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 l=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),l===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=l,r-=o.idBlock.blockLength,l=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),l===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=l,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 c=Ne;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};c=P.EndOfContent;break;case 1:c=P.Boolean;break;case 2:c=P.Integer;break;case 3:c=P.BitString;break;case 4:c=P.OctetString;break;case 5:c=P.Null;break;case 6:c=P.ObjectIdentifier;break;case 10:c=P.Enumerated;break;case 12:c=P.Utf8String;break;case 13:c=P.RelativeObjectIdentifier;break;case 14:c=P.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=P.Sequence;break;case 17:c=P.Set;break;case 18:c=P.NumericString;break;case 19:c=P.PrintableString;break;case 20:c=P.TeletexString;break;case 21:c=P.VideotexString;break;case 22:c=P.IA5String;break;case 23:c=P.UTCTime;break;case 24:c=P.GeneralizedTime;break;case 25:c=P.GraphicString;break;case 26:c=P.VisibleString;break;case 27:c=P.GeneralString;break;case 28:c=P.UniversalString;break;case 29:c=P.CharacterString;break;case 30:c=P.BmpString;break;case 31:c=P.DATE;break;case 32:c=P.TimeOfDay;break;case 33:c=P.DateTime;break;case 34:c=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:c=o.idBlock.isConstructed?P.Constructed:P.Primitive}return o=Lp(o,c),l=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(n,n+o.blockLength),{offset:l,result:o}}function mr(e){if(!e.byteLength){const t=new Ne({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return gr(M.toUint8Array(e).slice(),0,e.byteLength)}function Fp(e,t){return e?1:t}class Mt extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...n}={}){super(n),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,n){const o=M.toUint8Array(t);if(!St(this,o,r,n))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;Fp(this.isIndefiniteForm,n)>0;){const a=gr(o,s,n);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,n-=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 n=r||new Li;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,n);return r?ot:n.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Mt.NAME="ConstructedValueBlock";var Al;class He extends Ne{constructor(t={}){super(t,Mt),this.idBlock.isConstructed=!0}fromBER(t,r,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?n: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 n of this.valueBlock.value)t.push(n.toString("ascii").split(`
|
|
72
|
-
`).map(
|
|
73
|
-
`));const
|
|
74
|
-
${
|
|
75
|
-
`)}`:`${r} :`}}Al=He,P.Constructed=Al,He.NAME="CONSTRUCTED";class Bl extends Me{fromBER(t,r,n){return r}toBER(t){return ot}}Bl.override="EndOfContentValueBlock";var Il;class $o extends Ne{constructor(t={}){super(t,Bl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}Il=$o,P.EndOfContent=Il,$o.NAME=Qr;var El;class Jt extends Ne{constructor(t={}){super(t,Me),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,n){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=n,r+n>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+n}toBER(t,r){const n=new ArrayBuffer(2);if(!t){const o=new Uint8Array(n);o[0]=5,o[1]=0}return r&&r.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}}El=Jt,P.Null=El,Jt.NAME="NULL";class Nl extends ht(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=M.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,n){const o=M.toUint8Array(t);return St(this,o,r,n)?(this.valueHexView=o.subarray(r,r+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,yl.call(this),this.blockLength=n,r+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Nl.NAME="BooleanValueBlock";var Ol;let Hi=class extends Ne{constructor(t={}){super(t,Nl),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}`}};Ol=Hi,P.Boolean=Ol,Hi.NAME="BOOLEAN";class Vl extends ht(Mt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,n){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=Mt.prototype.fromBER.call(this,t,r,n),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Qr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==bl)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,n),this.blockLength=n;return o}toBER(t,r){return this.isConstructed?Mt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Vl.NAME="OctetStringValueBlock";var _l;let Yt=class hp extends Ne{constructor({idBlock:t={},lenBlock:r={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Vl),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+n);try{if(s.byteLength){const a=gr(s,0,s.byteLength);a.offset!==-1&&a.offset===n&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,n)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?He.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof hp&&t.push(r.valueBlock.valueHexView);return M.concat(t)}};_l=Yt,P.OctetString=_l,Yt.NAME=bl;class Tl extends ht(Mt){constructor({unusedBits:t=0,isConstructed:r=!1,...n}={}){super(n),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,n){if(!n)return r;let o=-1;if(this.isConstructed){if(o=Mt.prototype.fromBER.call(this,t,r,n),o===-1)return o;for(const l of this.value){const c=l.constructor.NAME;if(c===Qr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==wl)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=l.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return o}const s=M.toUint8Array(t);if(!St(this,s,r,n))return-1;const a=s.subarray(r,r+n);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const l=a.subarray(1);try{if(l.byteLength){const c=gr(l,0,l.byteLength);c.offset!==-1&&c.offset===n-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+n}toBER(t,r){if(this.isConstructed)return Mt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return ot;const n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Tl.NAME="BitStringValueBlock";var jl;let Zt=class extends Ne{constructor({idBlock:t={},lenBlock:r={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!n.isIndefiniteForm},...n},Tl),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return He.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const n=t.join("");return`${this.constructor.NAME} : ${n.substring(0,n.length-this.valueBlock.unusedBits)}`}}};jl=Zt,P.BitString=jl,Zt.NAME=wl;var $l;function Hp(e,t){const r=new Uint8Array([0]),n=new Uint8Array(e),o=new Uint8Array(t);let s=n.slice(0);const a=s.length-1,l=o.slice(0),c=l.length-1;let d=0;const y=c<a?a:c;let f=0;for(let x=y;x>=0;x--,f++){switch(!0){case f<l.length:d=s[a-f]+l[c-f]+r[0];break;default:d=s[a-f]+r[0]}switch(r[0]=d/10,!0){case f>=s.length:s=Vo(new Uint8Array([d%10]),s);break;default:s[a-f]=d%10}}return r[0]>0&&(s=Vo(r,s)),s}function Dl(e){if(e>=Zr.length)for(let t=Zr.length;t<=e;t++){const r=new Uint8Array([0]);let n=Zr[t-1].slice(0);for(let o=n.length-1;o>=0;o--){const s=new Uint8Array([(n[o]<<1)+r[0]]);r[0]=s[0]/10,n[o]=s[0]%10}r[0]>0&&(n=Vo(r,n)),Zr.push(n)}return Zr[e]}function qp(e,t){let r=0;const n=new Uint8Array(e),o=new Uint8Array(t),s=n.slice(0),a=s.length-1,l=o.slice(0),c=l.length-1;let d,y=0;for(let f=c;f>=0;f--,y++)switch(d=s[a-y]-l[c-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let f=a-c+1;f>=0;f--,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 Do extends ht(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=yl.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Vp(t))}get valueDec(){return this._valueDec}fromDER(t,r,n,o=0){const s=this.fromBER(t,r,n);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):o!==0&&a.length<o&&(o-a.length>1&&(o=a.length+1),this.valueHexView=a.subarray(o-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(r,1),this.valueHexView=n}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,n){const o=super.fromBER(t,r,n);return o===-1||this.setValueHex(),o}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),n=0,o;const s=this.valueHexView;let a="",l=!1;for(let c=s.byteLength-1;c>=0;c--){o=s[c];for(let d=0;d<8;d++){if((o&1)===1)switch(n){case t:r=qp(Dl(n),r),a="-";break;default:r=Hp(r,Dl(n))}n++,o>>=1}}for(let c=0;c<r.length;c++)r[c]&&(l=!0),l&&(a+=gl.charAt(r[c]));return l===!1&&(a+=gl.charAt(0)),a}}$l=Do,Do.NAME="IntegerValueBlock",Object.defineProperty($l.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ml;class yt extends Ne{constructor(t={}){super(t,Do),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ui(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Ui();const r=BigInt(t),n=new Li,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const l=new Uint8Array(s.length+(s[0]&128?1:0));l[0]|=128;const d=BigInt(`0x${L.ToHex(l)}`)+r,y=M.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,n.write(y)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new yt({valueHex:n.final()})}convertToDER(){const t=new yt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new yt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Ml=yt,P.Integer=Ml,yt.NAME="INTEGER";var Rl;class qi extends yt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Rl=qi,P.Enumerated=Rl,qi.NAME="ENUMERATED";class Mo extends ht(Me){constructor({valueDec:t=-1,isFirstSid:r=!1,...n}={}){super(n),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,n){if(!n)return r;const o=M.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=yr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Ui();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const n=new Uint8Array(r.length/7);for(let o=0;o<n.length;o++)n[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Gt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",ot;const n=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)n[a]=o[a]|128;n[s]=o[s]}return n}toString(){let t="";if(this.isHexOnly)t=L.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}Mo.NAME="sidBlock";class Pl extends Me{constructor({value:t=Fe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new Mo;if(o=s.fromBER(t,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let n=0;n<this.value.length;n++){const o=this.value[n].toBER(t);if(o.byteLength===0)return this.error=this.value[n].error,ot;r.push(o)}return _o(r)}fromString(t){this.value=[];let r=0,n=0,o="",s=!1;do if(n=t.indexOf(".",r),n===-1?o=t.substring(r):o=t.substring(r,n),r=n+1,s){const a=this.value[0];let l=0;switch(a.valueDec){case 0:break;case 1:l=40;break;case 2:l=80;break;default:this.value=[];return}const c=parseInt(o,10);if(isNaN(c))return;a.valueDec=c+l,s=!1}else{const a=new Mo;if(o>Number.MAX_SAFE_INTEGER){Ui();const l=BigInt(o);a.valueBigInt=l}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(n!==-1)}toString(){let t="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[n].isFirstSid?t=`2.{${o} - 80}`:t+=o):t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Pl.NAME="ObjectIdentifierValueBlock";var Ul;class Ki extends Ne{constructor(t={}){super(t,Pl),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()}}}Ul=Ki,P.ObjectIdentifier=Ul,Ki.NAME="OBJECT IDENTIFIER";class Ro extends ht(Wt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,n){if(n===0)return r;const o=M.toUint8Array(t);if(!St(this,o,r,n))return-1;const s=o.subarray(r,r+n);this.valueHexView=new Uint8Array(n);for(let l=0;l<n&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=yr(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=Gt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",ot;const n=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)n[a]=o[a]|128;n[s]=o[s]}return n.buffer}toString(){let t="";return this.isHexOnly?t=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Ro.NAME="relativeSidBlock";class Ll extends Me{constructor({value:t=Fe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,n){let o=r;for(;n>0;){const s=new Ro;if(o=s.fromBER(t,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const n=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(t);if(s.byteLength===0)return this.error=this.value[o].error,ot;n.push(s)}return _o(n)}fromString(t){this.value=[];let r=0,n=0,o="";do{n=t.indexOf(".",r),n===-1?o=t.substring(r):o=t.substring(r,n),r=n+1;const s=new Ro;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let t="",r=!1;for(let n=0;n<this.value.length;n++){r=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(t=`${t}.`),r&&(o=`{${o}}`),t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Ll.NAME="RelativeObjectIdentifierValueBlock";var Fl;class Po extends Ne{constructor(t={}){super(t,Ll),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()}}}Fl=Po,P.RelativeObjectIdentifier=Fl,Po.NAME="RelativeObjectIdentifier";var Hl;class xt extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Hl=xt,P.Sequence=Hl,xt.NAME="SEQUENCE";var ql;let At=class extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};ql=At,P.Set=ql,At.NAME="SET";class Kl extends ht(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Fe}toJSON(){return{...super.toJSON(),value:this.value}}}Kl.NAME="StringValueBlock";class zl extends Kl{}zl.NAME="SimpleStringValueBlock";class Ye extends jo{constructor({...t}={}){super(t,zl)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,M.toUint8Array(t))}fromString(t){const r=t.length,n=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);this.valueBlock.value=t}}Ye.NAME="SIMPLE STRING";class Gl extends Ye{fromBuffer(t){this.valueBlock.valueHexView=M.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}Gl.NAME="Utf8StringValueBlock";var Wl;class Bt extends Gl{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Wl=Bt,P.Utf8String=Wl,Bt.NAME="UTF8String";class Jl extends Ye{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=M.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}Jl.NAME="BmpStringValueBlock";var Yl;class zi extends Jl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Yl=zi,P.BmpString=Yl,zi.NAME="BMPString";class Zl extends Ye{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),n=new Uint8Array(r);for(let o=0;o<n.length;o+=4)n[o]=n[o+3],n[o+1]=n[o+2],n[o+2]=0,n[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,n=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=Gt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const l=4-a.length;for(let c=a.length-1;c>=0;c--)n[o*4+c+l]=a[c]}this.valueBlock.value=t}}Zl.NAME="UniversalStringValueBlock";var Ql;class Gi extends Zl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Ql=Gi,P.UniversalString=Ql,Gi.NAME="UniversalString";var Xl;class Wi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Xl=Wi,P.NumericString=Xl,Wi.NAME="NumericString";var ec;class Ji extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}ec=Ji,P.PrintableString=ec,Ji.NAME="PrintableString";var tc;class Yi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}tc=Yi,P.TeletexString=tc,Yi.NAME="TeletexString";var rc;class Zi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}rc=Zi,P.VideotexString=rc,Zi.NAME="VideotexString";var ic;class Qi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}ic=Qi,P.IA5String=ic,Qi.NAME="IA5String";var nc;class Xi extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}nc=Xi,P.GraphicString=nc,Xi.NAME="GraphicString";var oc;class ei extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}oc=ei,P.VisibleString=oc,ei.NAME="VisibleString";var sc;class en extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}sc=en,P.GeneralString=sc,en.NAME="GeneralString";var ac;class tn extends Ye{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}ac=tn,P.CharacterString=ac,tn.NAME="CharacterString";var lc;class ti extends ei{constructor({value:t,valueDate:r,...n}={}){if(super(n),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let o=0;o<t.length;o++)this.valueBlock.valueHexView[o]=t.charCodeAt(o)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,M.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),n=new Uint8Array(r);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(n===null){this.error="Wrong input string for conversion";return}const o=parseInt(n[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=Je(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Je(this.month,2),r[2]=Je(this.day,2),r[3]=Je(this.hour,2),r[4]=Je(this.minute,2),r[5]=Je(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=ti,P.UTCTime=lc,ti.NAME="UTCTime";var cc;class rn extends ti{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,n="",o="",s=0,a,l=0,c=0;if(t[t.length-1]==="Z")n=t.substring(0,t.length-1),r=!0;else{const f=new Number(t[t.length-1]);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");n=t}if(r){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let f=1,x=n.indexOf("+"),b="";if(x===-1&&(x=n.indexOf("-"),f=-1),x!==-1){if(b=n.substring(x+1),n=n.substring(0,x),b.length!==2&&b.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(b.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(l=f*h,b.length===4){if(h=parseInt(b.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");c=f*h}}}let d=n.indexOf(".");if(d===-1&&(d=n.indexOf(",")),d!==-1){const f=new Number(`0${n.substring(d)}`);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");s=f.valueOf(),o=n.substring(0,d)}else o=n;switch(!0){case o.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let f=60*s;this.minute=Math.floor(f),f=60*(f-this.minute),this.second=Math.floor(f),f=1e3*(f-this.second),this.millisecond=Math.floor(f)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let f=60*s;this.second=Math.floor(f),f=1e3*(f-this.second),this.millisecond=Math.floor(f)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const f=1e3*s;this.millisecond=Math.floor(f)}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 f=1;f<y.length;f++)switch(f){case 1:this.year=parseInt(y[f],10);break;case 2:this.month=parseInt(y[f],10);break;case 3:this.day=parseInt(y[f],10);break;case 4:this.hour=parseInt(y[f],10)+l;break;case 5:this.minute=parseInt(y[f],10)+c;break;case 6:this.second=parseInt(y[f],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const f=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=f.getUTCFullYear(),this.month=f.getUTCMonth(),this.day=f.getUTCDay(),this.hour=f.getUTCHours(),this.minute=f.getUTCMinutes(),this.second=f.getUTCSeconds(),this.millisecond=f.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Je(this.year,4)),r.push(Je(this.month,2)),r.push(Je(this.day,2)),r.push(Je(this.hour,2)),r.push(Je(this.minute,2)),r.push(Je(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Je(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}cc=rn,P.GeneralizedTime=cc,rn.NAME="GeneralizedTime";var uc;class Uo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}uc=Uo,P.DATE=uc,Uo.NAME="DATE";var dc;class Lo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}dc=Lo,P.TimeOfDay=dc,Lo.NAME="TimeOfDay";var fc;class Fo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}fc=Fo,P.DateTime=fc,Fo.NAME="DateTime";var pc;class Ho extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}pc=Ho,P.Duration=pc,Ho.NAME="Duration";var hc;class qo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}hc=qo,P.TIME=hc,qo.NAME="TIME";class Qt{constructor({name:t=Fe,optional:r=!1}={}){this.name=t,this.optional=r}}class Ko extends Qt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class nn extends Qt{constructor({value:t=new Qt,local:r=!1,...n}={}){super(n),this.value=t,this.local=r}}class Kp{constructor({data:t=Fi}={}){this.dataView=M.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=M.toUint8Array(t)}fromBER(t,r,n){const o=r+n;return this.dataView=M.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Xt(e,t,r){if(r instanceof Ko){for(let s=0;s<r.value.length;s++)if(Xt(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(To)&&(s.name=r.name),s}}if(r instanceof Qt)return r.hasOwnProperty(To)&&(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(!(jp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Rp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Pp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const n=r.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty($p)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(Dp)===!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(Mp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Tp 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(!(ml in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let l=0;l<s.length;l++)if(s[l]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Fe),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},l=r.valueBlock.value.length;if(l>0&&r.valueBlock.value[0]instanceof nn&&(l=t.valueBlock.value.length),l===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Fe),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let c=0;c<l;c++)if(c-s>=t.valueBlock.value.length){if(r.valueBlock.value[c].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Fe),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof nn){if(a=Xt(e,t.valueBlock.value[c],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Fe),r.name&&delete e[r.name]),a;if(To in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};Up in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[c])}}else if(a=Xt(e,t.valueBlock.value[c-s],r.valueBlock.value[c]),a.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Fe),r.name&&delete e[r.name]),a;if(a.verified===!1){const c={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Fe),r.name&&(delete e[r.name],c.name=r.name)),c}return{verified:!0,result:e}}if(r.primitiveSchema&&ml in t.valueBlock){const s=gr(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,Fe),r.name&&(delete e[r.name],a.name=r.name)),a}return Xt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function zp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=gr(M.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Xt(r.result,r.result,t)}const yc=Object.freeze(Object.defineProperty({__proto__:null,Any:Qt,BaseBlock:Ne,BaseStringBlock:jo,BitString:Zt,BmpString:zi,Boolean:Hi,CharacterString:tn,Choice:Ko,Constructed:He,DATE:Uo,DateTime:Fo,Duration:Ho,EndOfContent:$o,Enumerated:qi,GeneralString:en,GeneralizedTime:rn,GraphicString:Xi,HexBlock:ht,IA5String:Qi,Integer:yt,Null:Jt,NumericString:Wi,ObjectIdentifier:Ki,OctetString:Yt,Primitive:Xr,PrintableString:Ji,RawData:Kp,RelativeObjectIdentifier:Po,Repeated:nn,Sequence:xt,Set:At,TIME:qo,TeletexString:Yi,TimeOfDay:Lo,UTCTime:ti,UniversalString:Gi,Utf8String:Bt,ValueBlock:Me,VideotexString:Zi,ViewWriter:Li,VisibleString:ei,compareSchema:Xt,fromBER:mr,verifySchema:zp},Symbol.toStringTag,{value:"Module"}));var _;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(_||(_={}));var w;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(w||(w={}));class on{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(M.isBufferSource(t))this.unusedBits=r,this.value=M.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof 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 n of r)t+=n.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const n=r.length+7>>3;this.unusedBits=(n<<3)-r.length;const o=new Uint8Array(n);r=r.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class le{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):M.isBufferSource(t)?this.buffer=M.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Yt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Yt({valueHex:this.buffer})}toSchema(t){return new Yt({name:t})}}const Gp={fromASN:e=>e instanceof Jt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Jt;const t=mr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Wp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new yt({value:+e})},Jp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new qi({value:e})},ye={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new yt({valueHex:e})},Yp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Zt({valueHex:e})},Zp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Ki({value:e})},Qp={fromASN:e=>e.valueBlock.value,toASN:e=>new Hi({value:e})},sn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},Xp={fromASN:e=>new le(e.getValue()),toASN:e=>e.toASN()};function et(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const gc=et(Bt),eh=et(zi),th=et(Gi),rh=et(Wi),ih=et(Ji),nh=et(Yi),oh=et(Zi),sh=et(Qi),ah=et(Xi),lh=et(ei),ch=et(en),uh=et(tn),dh={fromASN:e=>e.toDate(),toASN:e=>new ti({valueDate:e})},fh={fromASN:e=>e.toDate(),toASN:e=>new rn({valueDate:e})},ph={fromASN:()=>null,toASN:()=>new Jt};function zo(e){switch(e){case w.Any:return Gp;case w.BitString:return Yp;case w.BmpString:return eh;case w.Boolean:return Qp;case w.CharacterString:return uh;case w.Enumerated:return Jp;case w.GeneralString:return ch;case w.GeneralizedTime:return fh;case w.GraphicString:return ah;case w.IA5String:return sh;case w.Integer:return Wp;case w.Null:return ph;case w.NumericString:return rh;case w.ObjectIdentifier:return Zp;case w.OctetString:return sn;case w.PrintableString:return ih;case w.TeletexString:return nh;case w.UTCTime:return dh;case w.UniversalString:return th;case w.Utf8String:return gc;case w.VideotexString:return oh;case w.VisibleString:return lh;default:return null}}function It(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:It(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function mc(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:mc(r)}return!1}function hh(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==n[o])return!1;return!0}class yh{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const n=this.items.get(t);if(!n)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!n.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:_.Sequence,items:{}},n=this.findParentSchema(t);return n&&(Object.assign(r,n),r.items=Object.assign({},r.items,n.items)),r}create(t,r){const n=this.items.get(t)||this.createDefault(t),o=[];for(const s in n.items){const a=n.items[s],l=r?s:"";let c;if(typeof a.type=="number"){const y=w[a.type],f=yc[y];if(!f)throw new Error(`Cannot get ASN1 class by name '${y}'`);c=new f({name:l})}else It(a.type)?c=new a.type().toSchema(l):a.optional?this.get(a.type).type===_.Choice?c=new Qt({name:l}):(c=this.create(a.type,!1),c.name=l):c=new Qt({name:l});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){c.name="";const y=a.repeated==="set"?At:xt;c=new y({name:"",value:[new nn({name:l,value:c})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||It(a.type)){const y=a.repeated?He:Xr;o.push(new y({name:l,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let f=y?c:this.get(a.type,!0).schema;f="valueBlock"in f?f.valueBlock.value:f.value,o.push(new He({name:y?"":l,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:f}))}else o.push(new He({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else c.optional=d,o.push(c)}switch(n.type){case _.Sequence:return new xt({value:o,name:""});case _.Set:return new At({value:o,name:""});case _.Choice:return new Ko({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 tt=new yh,j=e=>t=>{let r;tt.has(t)?r=tt.get(t):(r=tt.createDefault(t),tt.set(t,r)),Object.assign(r,e)},p=e=>(t,r)=>{let n;tt.has(t.constructor)?n=tt.get(t.constructor):(n=tt.createDefault(t.constructor),tt.set(t.constructor,n));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=zo(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}n.items[r]=o};class bc extends Error{constructor(){super(...arguments),this.schemas=[]}}class gh{static parse(t,r){const n=mr(t);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,r)}static fromASN(t,r){var n;try{if(It(r))return new r().fromASN(t);const o=tt.get(r);tt.cache(r);let s=o.schema;if(t.constructor===He&&o.type!==_.Choice){s=new He({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const c in o.items)delete t[c]}const a=Xt({},t,s);if(!a.verified)throw new bc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const l=new r;if(mc(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const c=o.itemType;if(typeof c=="number"){const d=zo(c);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,c))}for(const c in o.items){const d=a.result[c];if(!d)continue;const y=o.items[c],f=y.type;if(typeof f=="number"||It(f)){const x=(n=y.converter)!==null&&n!==void 0?n:It(f)?new f:null;if(!x)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const b=y.repeated==="sequence"?xt:At,h=new b;h.valueBlock=d.valueBlock;const g=mr(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;l[c]=Array.from(m,v=>x.fromASN(v))}else l[c]=Array.from(d,b=>x.fromASN(b));else{let b=d;if(y.implicit){let h;if(It(f))h=new f().toSchema("");else{const g=w[f],m=yc[g];if(!m)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new m}h.valueBlock=b.valueBlock,b=mr(h.toBER(!1)).result}l[c]=x.fromASN(b)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");l[c]=Array.from(d,x=>this.fromASN(x,f))}else l[c]=this.fromASN(d,f)}return l}catch(o){throw o instanceof bc&&o.schemas.push(r.name),o}}}class Go{static serialize(t){return t instanceof Ne?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&It(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,n=tt.get(r);tt.cache(r);let o=[];if(n.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){const a=zo(n.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(l=>a.toASN(l))}else o=t.map(a=>this.toAsnItem({type:n.itemType},"[]",r,a))}else for(const a in n.items){const l=n.items[a],c=t[a];if(c===void 0||l.defaultValue===c||typeof l.defaultValue=="object"&&typeof c=="object"&&hh(this.serialize(l.defaultValue),this.serialize(c)))continue;const d=Go.toAsnItem(l,a,r,c);if(typeof l.context=="number")if(l.implicit)if(!l.repeated&&(typeof l.type=="number"||It(l.type))){const y={};y.valueHex=d instanceof Jt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Xr({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},...y}))}else o.push(new He({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:d.valueBlock.value}));else o.push(new He({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:[d]}));else l.repeated?o=o.concat(d):o.push(d)}let s;switch(n.type){case _.Sequence:s=new xt({value:o});break;case _.Set:s=new At({value:o});break;case _.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(t,r,n,o){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${w[t.type]} in schema '${n.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,d=>a.toASN(d)),c=t.repeated==="sequence"?xt:At;s=new c({value:l})}else s=a.toASN(o)}else if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(o,c=>this.toASN(c)),l=t.repeated==="sequence"?xt:At;s=new l({value:a})}else s=this.toASN(o);return s}}class ue extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class G{static serialize(t){return Go.serialize(t)}static parse(t,r){return gh.parse(t,r)}static toString(t){const r=M.isBufferSource(t)?M.toArrayBuffer(t):G.serialize(t),n=mr(r);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}}function u(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(o<3?a(s):o>3?a(t,r,s):a(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var wc={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",l="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let m=0,v=-1,S=(h.match(c.zoneIndex)||[])[0],C,E;for(S&&(S=S.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(E=g-m,C=":";E--;)C+="0:";return h=h.replace("::",C),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const T=h.split(":"),N=[];for(let A=0;A<T.length;A++)N.push(parseInt(T[A],16));return N}(),{parts:g,zoneId:S}}function y(h,g,m,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,C;for(;v>0;){if(C=m-v,C<0&&(C=0),h[S]>>C!==g[S]>>C)return!1;v-=m,S+=1}return!0}function f(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 b={};b.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 y(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 S,C,E;for(S=3;S>=0;S-=1)if(C=this.octets[S],C in v){if(E=v[C],m&&E!==0)return null;E!==8&&(m=!0),g+=E}else return null;return 32-g},h.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return b.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),b.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),m=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),S=[];let C=0;for(;C<4;)S.push(parseInt(m[C],10)|parseInt(v[C],10)^255),C++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.IPv4.isIPv4=function(h){return this.parser(h)!==null},b.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},b.IPv4.isValidFourPartDecimal=function(h){return!!(b.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},b.IPv4.networkAddressFromCIDR=function(h){let g,m,v,S,C;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),S=[],m=0;m<4;)S.push(parseInt(v[m],10)&parseInt(C[m],10)),m++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.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)},b.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")},b.IPv4.parser=function(h){let g,m,v;if(g=h.match(n.fourOctet))return function(){const S=g.slice(1,6),C=[];for(let E=0;E<S.length;E++)m=S[E],C.push(f(m));return C}();if(g=h.match(n.longValue)){if(v=f(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const S=[];let C;for(C=0;C<=24;C+=8)S.push(v>>C&255);return S}().reverse()}else return(g=h.match(n.twoOctet))?function(){const S=g.slice(1,4),C=[];if(v=f(S[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return C.push(f(S[0])),C.push(v>>16&255),C.push(v>>8&255),C.push(v&255),C}():(g=h.match(n.threeOctet))?function(){const S=g.slice(1,5),C=[];if(v=f(S[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return C.push(f(S[0])),C.push(f(S[1])),C.push(v>>8&255),C.push(v&255),C}():null},b.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)},b.IPv6=function(){function h(g,m){let v,S;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(S=this.parts[v],!(0<=S&&S<=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 y(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 S,C;for(let E=7;E>=0;E-=1)if(S=this.parts[E],S in v){if(C=v[S],m&&C!==0)return null;C!==16&&(m=!0),g+=C}else return null;return 128-g},h.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const m=[],v=this.parts;for(let S=0;S<v.length;S++)g=v[S],m.push(g>>8),m.push(g&255);return m},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let S=0;S<this.parts.length;S++)v.push(x(this.parts[S].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 b.IPv4([m>>8,m&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let S=0;S<this.parts.length;S++)v.push(this.parts[S].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,S=-1,C;for(;C=g.exec(m);)C[0].length>S&&(v=C.index,S=C[0].length);return S<0?m:`${m.substring(0,v)}::${m.substring(v+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),b.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),m=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),S=[];let C=0;for(;C<16;)S.push(parseInt(m[C],10)|parseInt(v[C],10)^255),C++;return new this(S)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},b.IPv6.isIPv6=function(h){return this.parser(h)!==null},b.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const g=this.parser(h);return new this(g.parts,g.zoneId),!0}catch{return!1}},b.IPv6.networkAddressFromCIDR=function(h){let g,m,v,S,C;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),S=[],m=0;m<16;)S.push(parseInt(v[m],10)&parseInt(C[m],10)),m++;return new this(S)}catch(E){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${E})`)}},b.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)},b.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")},b.IPv6.parser=function(h){let g,m,v,S,C,E;if(v=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(c.native.test(h))return d(h,8);if((v=h.match(c.transitional))&&(E=v[6]||"",g=d(v[1].slice(0,-1)+E,6),g.parts)){for(C=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],m=0;m<C.length;m++)if(S=C[m],!(0<=S&&S<=255))return null;return g.parts.push(C[0]<<8|C[1]),g.parts.push(C[2]<<8|C[3]),{parts:g.parts,zoneId:g.zoneId}}return null},b.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)},b.fromByteArray=function(h){const g=h.length;if(g===4)return new b.IPv4(h);if(g===16)return new b.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},b.isValid=function(h){return b.IPv6.isValid(h)||b.IPv4.isValid(h)},b.parse=function(h){if(b.IPv6.isValid(h))return b.IPv6.parse(h);if(b.IPv4.isValid(h))return b.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},b.parseCIDR=function(h){try{return b.IPv6.parseCIDR(h)}catch{try{return b.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},b.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},b.subnetMatch=function(h,g,m){let v,S,C,E;m==null&&(m="unicast");for(S in g)if(Object.prototype.hasOwnProperty.call(g,S)){for(C=g[S],C[0]&&!(C[0]instanceof Array)&&(C=[C]),v=0;v<C.length;v++)if(E=C[v],h.kind()===E[0].kind()&&h.match.apply(h,E))return S}return m},e.exports?e.exports=b:t.ipaddr=b})(No)})(wc);var vc=wc.exports;class kc{static decodeIP(t){if(t.length===64&&parseInt(t,16)===0)return"::/0";if(t.length!==16)return t;const r=parseInt(t.slice(8),16).toString(2).split("").reduce((o,s)=>o+ +s,0);let n=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return n=n.slice(0,-1),`${n}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return vc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=vc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Wo,Jo,Yo;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([p({type:w.TeletexString})],Oe.prototype,"teletexString",void 0),u([p({type:w.PrintableString})],Oe.prototype,"printableString",void 0),u([p({type:w.UniversalString})],Oe.prototype,"universalString",void 0),u([p({type:w.Utf8String})],Oe.prototype,"utf8String",void 0),u([p({type:w.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([j({type:_.Choice})],Oe);let br=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([p({type:w.IA5String})],br.prototype,"ia5String",void 0),u([p({type:w.Any})],br.prototype,"anyValue",void 0),br=u([j({type:_.Choice})],br);class ri{constructor(t={}){this.type="",this.value=new br,Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],ri.prototype,"type",void 0),u([p({type:br})],ri.prototype,"value",void 0);let wr=Wo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};wr=Wo=u([j({type:_.Set,itemType:ri})],wr);let Zo=Jo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Jo.prototype)}};Zo=Jo=u([j({type:_.Sequence,itemType:wr})],Zo);let ke=Yo=class extends Zo{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};ke=Yo=u([j({type:_.Sequence})],ke);const mh={fromASN:e=>kc.toString(sn.fromASN(e)),toASN:e=>sn.toASN(kc.fromString(e))};class ii{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],ii.prototype,"typeId",void 0),u([p({type:w.Any,context:0})],ii.prototype,"value",void 0);class Qo{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([p({type:Oe,optional:!0,context:0,implicit:!0})],Qo.prototype,"nameAssigner",void 0),u([p({type:Oe,context:1,implicit:!0})],Qo.prototype,"partyName",void 0);let oe=class{constructor(t={}){Object.assign(this,t)}};u([p({type:ii,context:0,implicit:!0})],oe.prototype,"otherName",void 0),u([p({type:w.IA5String,context:1,implicit:!0})],oe.prototype,"rfc822Name",void 0),u([p({type:w.IA5String,context:2,implicit:!0})],oe.prototype,"dNSName",void 0),u([p({type:w.Any,context:3,implicit:!0})],oe.prototype,"x400Address",void 0),u([p({type:ke,context:4,implicit:!1})],oe.prototype,"directoryName",void 0),u([p({type:Qo,context:5})],oe.prototype,"ediPartyName",void 0),u([p({type:w.IA5String,context:6,implicit:!0})],oe.prototype,"uniformResourceIdentifier",void 0),u([p({type:w.OctetString,context:7,implicit:!0,converter:mh})],oe.prototype,"iPAddress",void 0),u([p({type:w.ObjectIdentifier,context:8,implicit:!0})],oe.prototype,"registeredID",void 0),oe=u([j({type:_.Choice})],oe);const vr="1.3.6.1.5.5.7.3",er="2.5.29";var Xo;class an{constructor(t={}){this.accessMethod="",this.accessLocation=new oe,Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],an.prototype,"accessMethod",void 0),u([p({type:oe})],an.prototype,"accessLocation",void 0);let Cc=Xo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};Cc=Xo=u([j({type:_.Sequence,itemType:an})],Cc);const es=`${er}.35`;class ts extends le{}class tr{constructor(t={}){t&&Object.assign(this,t)}}u([p({type:ts,context:0,optional:!0,implicit:!0})],tr.prototype,"keyIdentifier",void 0),u([p({type:oe,context:1,optional:!0,implicit:!0,repeated:"sequence"})],tr.prototype,"authorityCertIssuer",void 0),u([p({type:w.Integer,context:2,optional:!0,implicit:!0,converter:ye})],tr.prototype,"authorityCertSerialNumber",void 0);const Sc=`${er}.19`;class ln{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([p({type:w.Boolean,defaultValue:!1})],ln.prototype,"cA",void 0),u([p({type:w.Integer,optional:!0})],ln.prototype,"pathLenConstraint",void 0);var rs;let Re=rs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,rs.prototype)}};Re=rs=u([j({type:_.Sequence,itemType:oe})],Re);var is;let xc=is=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};xc=is=u([j({type:_.Sequence})],xc);var ns;const Ac=`${er}.32`;let Et=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([p({type:w.IA5String})],Et.prototype,"ia5String",void 0),u([p({type:w.VisibleString})],Et.prototype,"visibleString",void 0),u([p({type:w.BmpString})],Et.prototype,"bmpString",void 0),u([p({type:w.Utf8String})],Et.prototype,"utf8String",void 0),Et=u([j({type:_.Choice})],Et);class os{constructor(t={}){this.organization=new Et,this.noticeNumbers=[],Object.assign(this,t)}}u([p({type:Et})],os.prototype,"organization",void 0),u([p({type:w.Integer,repeated:"sequence"})],os.prototype,"noticeNumbers",void 0);class ss{constructor(t={}){Object.assign(this,t)}}u([p({type:os,optional:!0})],ss.prototype,"noticeRef",void 0),u([p({type:Et,optional:!0})],ss.prototype,"explicitText",void 0);let cn=class{constructor(t={}){Object.assign(this,t)}};u([p({type:w.IA5String})],cn.prototype,"cPSuri",void 0),u([p({type:ss})],cn.prototype,"userNotice",void 0),cn=u([j({type:_.Choice})],cn);class as{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],as.prototype,"policyQualifierId",void 0),u([p({type:w.Any})],as.prototype,"qualifier",void 0);class un{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],un.prototype,"policyIdentifier",void 0),u([p({type:as,repeated:"sequence",optional:!0})],un.prototype,"policyQualifiers",void 0);let dn=ns=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};dn=ns=u([j({type:_.Sequence,itemType:un})],dn);let fn=class{constructor(t=0){this.value=t}};u([p({type:w.Integer})],fn.prototype,"value",void 0),fn=u([j({type:_.Choice})],fn);let Bc=class extends fn{};Bc=u([j({type:_.Choice})],Bc);var ls,st;(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"})(st||(st={}));class Ic extends on{toJSON(){const t=[],r=this.toNumber();return r&st.aACompromise&&t.push("aACompromise"),r&st.affiliationChanged&&t.push("affiliationChanged"),r&st.cACompromise&&t.push("cACompromise"),r&st.certificateHold&&t.push("certificateHold"),r&st.cessationOfOperation&&t.push("cessationOfOperation"),r&st.keyCompromise&&t.push("keyCompromise"),r&st.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&st.superseded&&t.push("superseded"),r&st.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let kr=class{constructor(t={}){Object.assign(this,t)}};u([p({type:oe,context:0,repeated:"sequence",implicit:!0})],kr.prototype,"fullName",void 0),u([p({type:wr,context:1,implicit:!0})],kr.prototype,"nameRelativeToCRLIssuer",void 0),kr=u([j({type:_.Choice})],kr);class ni{constructor(t={}){Object.assign(this,t)}}u([p({type:kr,context:0,optional:!0})],ni.prototype,"distributionPoint",void 0),u([p({type:Ic,context:1,optional:!0,implicit:!0})],ni.prototype,"reasons",void 0),u([p({type:oe,context:2,optional:!0,repeated:"sequence",implicit:!0})],ni.prototype,"cRLIssuer",void 0);let cs=ls=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};cs=ls=u([j({type:_.Sequence,itemType:ni})],cs);var us;let Ec=us=class extends cs{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};Ec=us=u([j({type:_.Sequence,itemType:ni})],Ec);class $e{constructor(t={}){this.onlyContainsUserCerts=$e.ONLY,this.onlyContainsCACerts=$e.ONLY,this.indirectCRL=$e.ONLY,this.onlyContainsAttributeCerts=$e.ONLY,Object.assign(this,t)}}$e.ONLY=!1,u([p({type:kr,context:0,optional:!0})],$e.prototype,"distributionPoint",void 0),u([p({type:w.Boolean,context:1,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsUserCerts",void 0),u([p({type:w.Boolean,context:2,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsCACerts",void 0),u([p({type:Ic,context:3,optional:!0,implicit:!0})],$e.prototype,"onlySomeReasons",void 0),u([p({type:w.Boolean,context:4,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"indirectCRL",void 0),u([p({type:w.Boolean,context:5,defaultValue:$e.ONLY,implicit:!0})],$e.prototype,"onlyContainsAttributeCerts",void 0);var oi;(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"})(oi||(oi={}));let ds=class{constructor(t=oi.unspecified){this.reason=oi.unspecified,this.reason=t}toJSON(){return oi[this.reason]}toString(){return this.toJSON()}};u([p({type:w.Enumerated})],ds.prototype,"reason",void 0),ds=u([j({type:_.Choice})],ds);var fs;const Nc=`${er}.37`;let pn=fs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};pn=fs=u([j({type:_.Sequence,itemType:w.ObjectIdentifier})],pn);const bh=`${vr}.1`,wh=`${vr}.2`,vh=`${vr}.3`,kh=`${vr}.4`,Ch=`${vr}.8`,Sh=`${vr}.9`;let ps=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([p({type:w.Integer,converter:ye})],ps.prototype,"value",void 0),ps=u([j({type:_.Choice})],ps);let hs=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([p({type:w.GeneralizedTime})],hs.prototype,"value",void 0),hs=u([j({type:_.Choice})],hs);var ys;let Oc=ys=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};Oc=ys=u([j({type:_.Sequence})],Oc);const Vc=`${er}.15`;var at;(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"})(at||(at={}));class gs extends on{toJSON(){const t=this.toNumber(),r=[];return t&at.cRLSign&&r.push("crlSign"),t&at.dataEncipherment&&r.push("dataEncipherment"),t&at.decipherOnly&&r.push("decipherOnly"),t&at.digitalSignature&&r.push("digitalSignature"),t&at.encipherOnly&&r.push("encipherOnly"),t&at.keyAgreement&&r.push("keyAgreement"),t&at.keyCertSign&&r.push("keyCertSign"),t&at.keyEncipherment&&r.push("keyEncipherment"),t&at.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var ms;class hn{constructor(t={}){this.base=new oe,this.minimum=0,Object.assign(this,t)}}u([p({type:oe})],hn.prototype,"base",void 0),u([p({type:w.Integer,context:0,defaultValue:0,implicit:!0})],hn.prototype,"minimum",void 0),u([p({type:w.Integer,context:1,optional:!0,implicit:!0})],hn.prototype,"maximum",void 0);let yn=ms=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};yn=ms=u([j({type:_.Sequence,itemType:hn})],yn);class _c{constructor(t={}){Object.assign(this,t)}}u([p({type:yn,context:0,optional:!0,implicit:!0})],_c.prototype,"permittedSubtrees",void 0),u([p({type:yn,context:1,optional:!0,implicit:!0})],_c.prototype,"excludedSubtrees",void 0);class Tc{constructor(t={}){Object.assign(this,t)}}u([p({type:w.Integer,context:0,implicit:!0,optional:!0,converter:ye})],Tc.prototype,"requireExplicitPolicy",void 0),u([p({type:w.Integer,context:1,implicit:!0,optional:!0,converter:ye})],Tc.prototype,"inhibitPolicyMapping",void 0);var bs;class ws{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],ws.prototype,"issuerDomainPolicy",void 0),u([p({type:w.ObjectIdentifier})],ws.prototype,"subjectDomainPolicy",void 0);let jc=bs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};jc=bs=u([j({type:_.Sequence,itemType:ws})],jc);var vs;const $c=`${er}.17`;let ks=vs=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,vs.prototype)}};ks=vs=u([j({type:_.Sequence})],ks);let Nt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([p({type:w.ObjectIdentifier})],Nt.prototype,"type",void 0),u([p({type:w.Any,repeated:"set"})],Nt.prototype,"values",void 0);var Cs;let Dc=Cs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Cs.prototype)}};Dc=Cs=u([j({type:_.Sequence,itemType:Nt})],Dc);const Mc=`${er}.14`;class Rt extends ts{}class Rc{constructor(t={}){Object.assign(this,t)}}u([p({type:w.GeneralizedTime,context:0,implicit:!0,optional:!0})],Rc.prototype,"notBefore",void 0),u([p({type:w.GeneralizedTime,context:1,implicit:!0,optional:!0})],Rc.prototype,"notAfter",void 0);var si;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(si||(si={}));class Pc extends on{toJSON(){const t=[],r=this.toNumber();return r&si.pKIXCertificate&&t.push("pKIXCertificate"),r&si.newExtensions&&t.push("newExtensions"),r&si.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Uc{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Pc,Object.assign(this,t)}}u([p({type:w.GeneralString})],Uc.prototype,"entrustVers",void 0),u([p({type:Pc})],Uc.prototype,"entrustInfoFlags",void 0);var Ss;let Lc=Ss=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};Lc=Ss=u([j({type:_.Sequence,itemType:an})],Lc);class q{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof q&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&hl(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([p({type:w.ObjectIdentifier})],q.prototype,"algorithm",void 0),u([p({type:w.Any,optional:!0})],q.prototype,"parameters",void 0);class Ot{constructor(t={}){this.algorithm=new q,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:q})],Ot.prototype,"algorithm",void 0),u([p({type:w.BitString})],Ot.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([p({type:w.UTCTime})],Ve.prototype,"utcTime",void 0),u([p({type:w.GeneralizedTime})],Ve.prototype,"generalTime",void 0),Ve=u([j({type:_.Choice})],Ve);class gn{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([p({type:Ve})],gn.prototype,"notBefore",void 0),u([p({type:Ve})],gn.prototype,"notAfter",void 0);var xs;let lt=class yp{constructor(t={}){this.extnID="",this.critical=yp.CRITICAL,this.extnValue=new le,Object.assign(this,t)}};lt.CRITICAL=!1,u([p({type:w.ObjectIdentifier})],lt.prototype,"extnID",void 0),u([p({type:w.Boolean,defaultValue:lt.CRITICAL})],lt.prototype,"critical",void 0),u([p({type:le})],lt.prototype,"extnValue",void 0);let rr=xs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};rr=xs=u([j({type:_.Sequence,itemType:lt})],rr);var Cr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(Cr||(Cr={}));class rt{constructor(t={}){this.version=Cr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new q,this.issuer=new ke,this.validity=new gn,this.subject=new ke,this.subjectPublicKeyInfo=new Ot,Object.assign(this,t)}}u([p({type:w.Integer,context:0,defaultValue:Cr.v1})],rt.prototype,"version",void 0),u([p({type:w.Integer,converter:ye})],rt.prototype,"serialNumber",void 0),u([p({type:q})],rt.prototype,"signature",void 0),u([p({type:ke})],rt.prototype,"issuer",void 0),u([p({type:gn})],rt.prototype,"validity",void 0),u([p({type:ke})],rt.prototype,"subject",void 0),u([p({type:Ot})],rt.prototype,"subjectPublicKeyInfo",void 0),u([p({type:w.BitString,context:1,implicit:!0,optional:!0})],rt.prototype,"issuerUniqueID",void 0),u([p({type:w.BitString,context:2,implicit:!0,optional:!0})],rt.prototype,"subjectUniqueID",void 0),u([p({type:rr,context:3,optional:!0})],rt.prototype,"extensions",void 0);class Sr{constructor(t={}){this.tbsCertificate=new rt,this.signatureAlgorithm=new q,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:rt})],Sr.prototype,"tbsCertificate",void 0),u([p({type:q})],Sr.prototype,"signatureAlgorithm",void 0),u([p({type:w.BitString})],Sr.prototype,"signatureValue",void 0);class mn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Ve,Object.assign(this,t)}}u([p({type:w.Integer,converter:ye})],mn.prototype,"userCertificate",void 0),u([p({type:Ve})],mn.prototype,"revocationDate",void 0),u([p({type:lt,optional:!0,repeated:"sequence"})],mn.prototype,"crlEntryExtensions",void 0);class Vt{constructor(t={}){this.signature=new q,this.issuer=new ke,this.thisUpdate=new Ve,Object.assign(this,t)}}u([p({type:w.Integer,optional:!0})],Vt.prototype,"version",void 0),u([p({type:q})],Vt.prototype,"signature",void 0),u([p({type:ke})],Vt.prototype,"issuer",void 0),u([p({type:Ve})],Vt.prototype,"thisUpdate",void 0),u([p({type:Ve,optional:!0})],Vt.prototype,"nextUpdate",void 0),u([p({type:mn,repeated:"sequence",optional:!0})],Vt.prototype,"revokedCertificates",void 0),u([p({type:lt,optional:!0,context:0,repeated:"sequence"})],Vt.prototype,"crlExtensions",void 0);let As=class{constructor(t={}){this.tbsCertList=new Vt,this.signatureAlgorithm=new q,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([p({type:Vt})],As.prototype,"tbsCertList",void 0),u([p({type:q})],As.prototype,"signatureAlgorithm",void 0),u([p({type:w.BitString})],As.prototype,"signature",void 0);class xr{constructor(t={}){this.issuer=new ke,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:ke})],xr.prototype,"issuer",void 0),u([p({type:w.Integer,converter:ye})],xr.prototype,"serialNumber",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Rt,context:0,implicit:!0})],Ar.prototype,"subjectKeyIdentifier",void 0),u([p({type:xr})],Ar.prototype,"issuerAndSerialNumber",void 0),Ar=u([j({type:_.Choice})],Ar);var _t;(function(e){e[e.v0=0]="v0",e[e.v1=1]="v1",e[e.v2=2]="v2",e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v5=5]="v5"})(_t||(_t={}));let ai=class extends q{};ai=u([j({type:_.Sequence})],ai);let bn=class extends q{};bn=u([j({type:_.Sequence})],bn);let gt=class extends q{};gt=u([j({type:_.Sequence})],gt);let wn=class extends q{};wn=u([j({type:_.Sequence})],wn);let Fc=class extends q{};Fc=u([j({type:_.Sequence})],Fc);let Bs=class extends q{};Bs=u([j({type:_.Sequence})],Bs);let Br=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([p({type:w.ObjectIdentifier})],Br.prototype,"attrType",void 0),u([p({type:w.Any,repeated:"set"})],Br.prototype,"attrValues",void 0);var Is;class mt{constructor(t={}){this.version=_t.v0,this.sid=new Ar,this.digestAlgorithm=new ai,this.signatureAlgorithm=new bn,this.signature=new le,Object.assign(this,t)}}u([p({type:w.Integer})],mt.prototype,"version",void 0),u([p({type:Ar})],mt.prototype,"sid",void 0),u([p({type:ai})],mt.prototype,"digestAlgorithm",void 0),u([p({type:Br,repeated:"set",context:0,implicit:!0,optional:!0})],mt.prototype,"signedAttrs",void 0),u([p({type:bn})],mt.prototype,"signatureAlgorithm",void 0),u([p({type:le})],mt.prototype,"signature",void 0),u([p({type:Br,repeated:"set",context:1,implicit:!0,optional:!0})],mt.prototype,"unsignedAttrs",void 0);let vn=Is=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};vn=Is=u([j({type:_.Set,itemType:mt})],vn);let Hc=class extends Ve{};Hc=u([j({type:_.Choice})],Hc);let qc=class extends mt{};qc=u([j({type:_.Sequence})],qc);class Es{constructor(t={}){this.acIssuer=new oe,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([p({type:oe})],Es.prototype,"acIssuer",void 0),u([p({type:w.Integer})],Es.prototype,"acSerial",void 0),u([p({type:Nt,repeated:"sequence"})],Es.prototype,"attrs",void 0);var Ns;let kn=Ns=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};kn=Ns=u([j({type:_.Sequence,itemType:w.ObjectIdentifier})],kn);class Cn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([p({type:w.Integer,optional:!0})],Cn.prototype,"pathLenConstraint",void 0),u([p({type:kn,implicit:!0,context:0,optional:!0})],Cn.prototype,"permittedAttrs",void 0),u([p({type:kn,implicit:!0,context:1,optional:!0})],Cn.prototype,"excludedAttrs",void 0),u([p({type:w.Boolean,defaultValue:!0})],Cn.prototype,"permitUnSpecified",void 0);class ir{constructor(t={}){this.issuer=new Re,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:Re})],ir.prototype,"issuer",void 0),u([p({type:w.Integer,converter:ye})],ir.prototype,"serial",void 0),u([p({type:w.BitString,optional:!0})],ir.prototype,"issuerUID",void 0);var Os;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(Os||(Os={}));class nr{constructor(t={}){this.digestedObjectType=Os.publicKey,this.digestAlgorithm=new q,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.Enumerated})],nr.prototype,"digestedObjectType",void 0),u([p({type:w.ObjectIdentifier,optional:!0})],nr.prototype,"otherObjectTypeID",void 0),u([p({type:q})],nr.prototype,"digestAlgorithm",void 0),u([p({type:w.BitString})],nr.prototype,"objectDigest",void 0);class Sn{constructor(t={}){Object.assign(this,t)}}u([p({type:Re,optional:!0})],Sn.prototype,"issuerName",void 0),u([p({type:ir,context:0,implicit:!0,optional:!0})],Sn.prototype,"baseCertificateID",void 0),u([p({type:nr,context:1,implicit:!0,optional:!0})],Sn.prototype,"objectDigestInfo",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([p({type:oe,repeated:"sequence"})],Ir.prototype,"v1Form",void 0),u([p({type:Sn,context:0,implicit:!0})],Ir.prototype,"v2Form",void 0),Ir=u([j({type:_.Choice})],Ir);class xn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([p({type:w.GeneralizedTime})],xn.prototype,"notBeforeTime",void 0),u([p({type:w.GeneralizedTime})],xn.prototype,"notAfterTime",void 0);class li{constructor(t={}){Object.assign(this,t)}}u([p({type:ir,implicit:!0,context:0,optional:!0})],li.prototype,"baseCertificateID",void 0),u([p({type:Re,implicit:!0,context:1,optional:!0})],li.prototype,"entityName",void 0),u([p({type:nr,implicit:!0,context:2,optional:!0})],li.prototype,"objectDigestInfo",void 0);var Vs;(function(e){e[e.v2=1]="v2"})(Vs||(Vs={}));class ct{constructor(t={}){this.version=Vs.v2,this.holder=new li,this.issuer=new Ir,this.signature=new q,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new xn,this.attributes=[],Object.assign(this,t)}}u([p({type:w.Integer})],ct.prototype,"version",void 0),u([p({type:li})],ct.prototype,"holder",void 0),u([p({type:Ir})],ct.prototype,"issuer",void 0),u([p({type:q})],ct.prototype,"signature",void 0),u([p({type:w.Integer,converter:ye})],ct.prototype,"serialNumber",void 0),u([p({type:xn})],ct.prototype,"attrCertValidityPeriod",void 0),u([p({type:Nt,repeated:"sequence"})],ct.prototype,"attributes",void 0),u([p({type:w.BitString,optional:!0})],ct.prototype,"issuerUniqueID",void 0),u([p({type:rr,optional:!0})],ct.prototype,"extensions",void 0);class An{constructor(t={}){this.acinfo=new ct,this.signatureAlgorithm=new q,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:ct})],An.prototype,"acinfo",void 0),u([p({type:q})],An.prototype,"signatureAlgorithm",void 0),u([p({type:w.BitString})],An.prototype,"signatureValue",void 0);var Bn;(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"})(Bn||(Bn={}));class _s extends on{}class Ts{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier,implicit:!0,context:0})],Ts.prototype,"type",void 0),u([p({type:w.Any,implicit:!0,context:1})],Ts.prototype,"value",void 0);class js{constructor(t={}){this.policyId="",this.classList=new _s(Bn.unclassified),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],js.prototype,"policyId",void 0),u([p({type:_s,defaultValue:new _s(Bn.unclassified)})],js.prototype,"classList",void 0),u([p({type:Ts,repeated:"set"})],js.prototype,"securityCategories",void 0);class In{constructor(t={}){Object.assign(this,t)}}u([p({type:le})],In.prototype,"cotets",void 0),u([p({type:w.ObjectIdentifier})],In.prototype,"oid",void 0),u([p({type:w.Utf8String})],In.prototype,"string",void 0);class Kc{constructor(t={}){this.values=[],Object.assign(this,t)}}u([p({type:Re,implicit:!0,context:0,optional:!0})],Kc.prototype,"policyAuthority",void 0),u([p({type:In,repeated:"sequence"})],Kc.prototype,"values",void 0);var $s;class En{constructor(t={}){this.targetCertificate=new ir,Object.assign(this,t)}}u([p({type:ir})],En.prototype,"targetCertificate",void 0),u([p({type:oe,optional:!0})],En.prototype,"targetName",void 0),u([p({type:nr,optional:!0})],En.prototype,"certDigestInfo",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([p({type:oe,context:0,implicit:!0})],Er.prototype,"targetName",void 0),u([p({type:oe,context:1,implicit:!0})],Er.prototype,"targetGroup",void 0),u([p({type:En,context:2,implicit:!0})],Er.prototype,"targetCert",void 0),Er=u([j({type:_.Choice})],Er);let Ds=$s=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};Ds=$s=u([j({type:_.Sequence,itemType:Er})],Ds);var Ms;let zc=Ms=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ms.prototype)}};zc=Ms=u([j({type:_.Sequence,itemType:Ds})],zc);class Gc{constructor(t={}){Object.assign(this,t)}}u([p({type:Re,implicit:!0,context:0,optional:!0})],Gc.prototype,"roleAuthority",void 0),u([p({type:oe,implicit:!0,context:1})],Gc.prototype,"roleName",void 0);class Rs{constructor(t={}){this.service=new oe,this.ident=new oe,Object.assign(this,t)}}u([p({type:oe})],Rs.prototype,"service",void 0),u([p({type:oe})],Rs.prototype,"ident",void 0),u([p({type:le,optional:!0})],Rs.prototype,"authInfo",void 0);var Ps;class Us{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],Us.prototype,"otherCertFormat",void 0),u([p({type:w.Any})],Us.prototype,"otherCert",void 0);let Nr=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Sr})],Nr.prototype,"certificate",void 0),u([p({type:An,context:2,implicit:!0})],Nr.prototype,"v2AttrCert",void 0),u([p({type:Us,context:3,implicit:!0})],Nr.prototype,"other",void 0),Nr=u([j({type:_.Choice})],Nr);let Nn=Ps=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};Nn=Ps=u([j({type:_.Set,itemType:Nr})],Nn);class Or{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],Or.prototype,"contentType",void 0),u([p({type:w.Any,context:0})],Or.prototype,"content",void 0);let ci=class{constructor(t={}){Object.assign(this,t)}};u([p({type:le})],ci.prototype,"single",void 0),u([p({type:w.Any})],ci.prototype,"any",void 0),ci=u([j({type:_.Choice})],ci);class On{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],On.prototype,"eContentType",void 0),u([p({type:ci,context:0,optional:!0})],On.prototype,"eContent",void 0);let ui=class{constructor(t={}){Object.assign(this,t)}};u([p({type:le,context:0,implicit:!0,optional:!0})],ui.prototype,"value",void 0),u([p({type:le,converter:Xp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ui.prototype,"constructedValue",void 0),ui=u([j({type:_.Choice})],ui);class di{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new wn,Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],di.prototype,"contentType",void 0),u([p({type:wn})],di.prototype,"contentEncryptionAlgorithm",void 0),u([p({type:ui,optional:!0})],di.prototype,"encryptedContent",void 0);class Vn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],Vn.prototype,"keyAttrId",void 0),u([p({type:w.Any,optional:!0})],Vn.prototype,"keyAttr",void 0);var Ls;class _n{constructor(t={}){this.subjectKeyIdentifier=new Rt,Object.assign(this,t)}}u([p({type:Rt})],_n.prototype,"subjectKeyIdentifier",void 0),u([p({type:w.GeneralizedTime,optional:!0})],_n.prototype,"date",void 0),u([p({type:Vn,optional:!0})],_n.prototype,"other",void 0);let Vr=class{constructor(t={}){Object.assign(this,t)}};u([p({type:_n,context:0,implicit:!0,optional:!0})],Vr.prototype,"rKeyId",void 0),u([p({type:xr,optional:!0})],Vr.prototype,"issuerAndSerialNumber",void 0),Vr=u([j({type:_.Choice})],Vr);class Fs{constructor(t={}){this.rid=new Vr,this.encryptedKey=new le,Object.assign(this,t)}}u([p({type:Vr})],Fs.prototype,"rid",void 0),u([p({type:le})],Fs.prototype,"encryptedKey",void 0);let Tn=Ls=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ls.prototype)}};Tn=Ls=u([j({type:_.Sequence,itemType:Fs})],Tn);class Hs{constructor(t={}){this.algorithm=new q,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:q})],Hs.prototype,"algorithm",void 0),u([p({type:w.BitString})],Hs.prototype,"publicKey",void 0);let or=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Rt,context:0,implicit:!0,optional:!0})],or.prototype,"subjectKeyIdentifier",void 0),u([p({type:Hs,context:1,implicit:!0,optional:!0})],or.prototype,"originatorKey",void 0),u([p({type:xr,optional:!0})],or.prototype,"issuerAndSerialNumber",void 0),or=u([j({type:_.Choice})],or);class _r{constructor(t={}){this.version=_t.v3,this.originator=new or,this.keyEncryptionAlgorithm=new gt,this.recipientEncryptedKeys=new Tn,Object.assign(this,t)}}u([p({type:w.Integer})],_r.prototype,"version",void 0),u([p({type:or,context:0})],_r.prototype,"originator",void 0),u([p({type:le,context:1,optional:!0})],_r.prototype,"ukm",void 0),u([p({type:gt})],_r.prototype,"keyEncryptionAlgorithm",void 0),u([p({type:Tn})],_r.prototype,"recipientEncryptedKeys",void 0);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([p({type:Rt,context:0,implicit:!0})],Tr.prototype,"subjectKeyIdentifier",void 0),u([p({type:xr})],Tr.prototype,"issuerAndSerialNumber",void 0),Tr=u([j({type:_.Choice})],Tr);class fi{constructor(t={}){this.version=_t.v0,this.rid=new Tr,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new le,Object.assign(this,t)}}u([p({type:w.Integer})],fi.prototype,"version",void 0),u([p({type:Tr})],fi.prototype,"rid",void 0),u([p({type:gt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([p({type:le})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.keyIdentifier=new le,Object.assign(this,t)}}u([p({type:le})],pi.prototype,"keyIdentifier",void 0),u([p({type:w.GeneralizedTime,optional:!0})],pi.prototype,"date",void 0),u([p({type:Vn,optional:!0})],pi.prototype,"other",void 0);class hi{constructor(t={}){this.version=_t.v4,this.kekid=new pi,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new le,Object.assign(this,t)}}u([p({type:w.Integer})],hi.prototype,"version",void 0),u([p({type:pi})],hi.prototype,"kekid",void 0),u([p({type:gt})],hi.prototype,"keyEncryptionAlgorithm",void 0),u([p({type:le})],hi.prototype,"encryptedKey",void 0);class yi{constructor(t={}){this.version=_t.v0,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new le,Object.assign(this,t)}}u([p({type:w.Integer})],yi.prototype,"version",void 0),u([p({type:Bs,context:0,optional:!0})],yi.prototype,"keyDerivationAlgorithm",void 0),u([p({type:gt})],yi.prototype,"keyEncryptionAlgorithm",void 0),u([p({type:le})],yi.prototype,"encryptedKey",void 0);class qs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],qs.prototype,"oriType",void 0),u([p({type:w.Any})],qs.prototype,"oriValue",void 0);let Pt=class{constructor(t={}){Object.assign(this,t)}};u([p({type:fi,optional:!0})],Pt.prototype,"ktri",void 0),u([p({type:_r,context:1,implicit:!0,optional:!0})],Pt.prototype,"kari",void 0),u([p({type:hi,context:2,implicit:!0,optional:!0})],Pt.prototype,"kekri",void 0),u([p({type:yi,context:3,implicit:!0,optional:!0})],Pt.prototype,"pwri",void 0),u([p({type:qs,context:4,implicit:!0,optional:!0})],Pt.prototype,"ori",void 0),Pt=u([j({type:_.Choice})],Pt);var Ks;let jn=Ks=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ks.prototype)}};jn=Ks=u([j({type:_.Set,itemType:Pt})],jn);var zs;class $n{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],$n.prototype,"otherRevInfoFormat",void 0),u([p({type:w.Any})],$n.prototype,"otherRevInfo",void 0);let gi=class{constructor(t={}){this.other=new $n,Object.assign(this,t)}};u([p({type:$n,context:1,implicit:!0})],gi.prototype,"other",void 0),gi=u([j({type:_.Choice})],gi);let Gs=zs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Gs=zs=u([j({type:_.Set,itemType:gi})],Gs);class Ws{constructor(t={}){Object.assign(this,t)}}u([p({type:Nn,context:0,implicit:!0,optional:!0})],Ws.prototype,"certs",void 0),u([p({type:Gs,context:1,implicit:!0,optional:!0})],Ws.prototype,"crls",void 0);var Js;let Ys=Js=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Js.prototype)}};Ys=Js=u([j({type:_.Set,itemType:Br})],Ys);class mi{constructor(t={}){this.version=_t.v0,this.recipientInfos=new jn,this.encryptedContentInfo=new di,Object.assign(this,t)}}u([p({type:w.Integer})],mi.prototype,"version",void 0),u([p({type:Ws,context:0,implicit:!0,optional:!0})],mi.prototype,"originatorInfo",void 0),u([p({type:jn})],mi.prototype,"recipientInfos",void 0),u([p({type:di})],mi.prototype,"encryptedContentInfo",void 0),u([p({type:Ys,context:1,implicit:!0,optional:!0})],mi.prototype,"unprotectedAttrs",void 0);const xh="1.2.840.113549.1.7.2";var Zs;let Dn=Zs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Zs.prototype)}};Dn=Zs=u([j({type:_.Set,itemType:ai})],Dn);class jr{constructor(t={}){this.version=_t.v0,this.digestAlgorithms=new Dn,this.encapContentInfo=new On,this.signerInfos=new vn,Object.assign(this,t)}}u([p({type:w.Integer})],jr.prototype,"version",void 0),u([p({type:Dn})],jr.prototype,"digestAlgorithms",void 0),u([p({type:On})],jr.prototype,"encapContentInfo",void 0),u([p({type:Nn,context:0,implicit:!0,optional:!0})],jr.prototype,"certificates",void 0),u([p({type:gi,context:1,implicit:!0,optional:!0})],jr.prototype,"crls",void 0),u([p({type:vn})],jr.prototype,"signerInfos",void 0);const bi="1.2.840.10045.2.1",Qs="1.2.840.10045.4.1",Wc="1.2.840.10045.4.3.1",Xs="1.2.840.10045.4.3.2",ea="1.2.840.10045.4.3.3",ta="1.2.840.10045.4.3.4",Jc="1.2.840.10045.3.1.7",Yc="1.3.132.0.34",Zc="1.3.132.0.35";function wi(e){return new q({algorithm:e})}const Ah=wi(Qs);wi(Wc);const Bh=wi(Xs),Ih=wi(ea),Eh=wi(ta);let $r=class{constructor(t={}){Object.assign(this,t)}};u([p({type:w.ObjectIdentifier})],$r.prototype,"namedCurve",void 0),$r=u([j({type:_.Choice})],$r);class Mn{constructor(t={}){this.version=1,this.privateKey=new le,Object.assign(this,t)}}u([p({type:w.Integer})],Mn.prototype,"version",void 0),u([p({type:le})],Mn.prototype,"privateKey",void 0),u([p({type:$r,context:0,optional:!0})],Mn.prototype,"parameters",void 0),u([p({type:w.BitString,context:1,optional:!0})],Mn.prototype,"publicKey",void 0);class Rn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.Integer,converter:ye})],Rn.prototype,"r",void 0),u([p({type:w.Integer,converter:ye})],Rn.prototype,"s",void 0);const qe="1.2.840.113549.1.1",Dr=`${qe}.1`,Nh=`${qe}.7`,Oh=`${qe}.9`,Vh=`${qe}.10`,_h=`${qe}.2`,Th=`${qe}.4`,Pn=`${qe}.5`,jh=`${qe}.14`,ra=`${qe}.11`,Un=`${qe}.12`,Ln=`${qe}.13`,Qc=`${qe}.15`,Xc=`${qe}.16`,eu="1.3.14.3.2.26",tu="2.16.840.1.101.3.4.2.4",ru="2.16.840.1.101.3.4.2.1",iu="2.16.840.1.101.3.4.2.2",nu="2.16.840.1.101.3.4.2.3",$h="2.16.840.1.101.3.4.2.5",Dh="2.16.840.1.101.3.4.2.6",Mh="1.2.840.113549.2.2",Rh="1.2.840.113549.2.5",ia=`${qe}.8`;function Ce(e){return new q({algorithm:e,parameters:null})}Ce(Mh),Ce(Rh);const sr=Ce(eu);Ce(tu),Ce(ru),Ce(iu),Ce(nu),Ce($h),Ce(Dh);const ou=new q({algorithm:ia,parameters:G.serialize(sr)}),su=new q({algorithm:Oh,parameters:G.serialize(sn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ce(Dr),Ce(_h),Ce(Th),Ce(Pn),Ce(Qc),Ce(Xc),Ce(Un),Ce(Ln),Ce(Qc),Ce(Xc);class Fn{constructor(t={}){this.hashAlgorithm=new q(sr),this.maskGenAlgorithm=new q({algorithm:ia,parameters:G.serialize(sr)}),this.pSourceAlgorithm=new q(su),Object.assign(this,t)}}u([p({type:q,context:0,defaultValue:sr})],Fn.prototype,"hashAlgorithm",void 0),u([p({type:q,context:1,defaultValue:ou})],Fn.prototype,"maskGenAlgorithm",void 0),u([p({type:q,context:2,defaultValue:su})],Fn.prototype,"pSourceAlgorithm",void 0),new q({algorithm:Nh,parameters:G.serialize(new Fn)});class vi{constructor(t={}){this.hashAlgorithm=new q(sr),this.maskGenAlgorithm=new q({algorithm:ia,parameters:G.serialize(sr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([p({type:q,context:0,defaultValue:sr})],vi.prototype,"hashAlgorithm",void 0),u([p({type:q,context:1,defaultValue:ou})],vi.prototype,"maskGenAlgorithm",void 0),u([p({type:w.Integer,context:2,defaultValue:20})],vi.prototype,"saltLength",void 0),u([p({type:w.Integer,context:3,defaultValue:1})],vi.prototype,"trailerField",void 0),new q({algorithm:Vh,parameters:G.serialize(new vi)});class Hn{constructor(t={}){this.digestAlgorithm=new q,this.digest=new le,Object.assign(this,t)}}u([p({type:q})],Hn.prototype,"digestAlgorithm",void 0),u([p({type:le})],Hn.prototype,"digest",void 0);var na;class qn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.Integer,converter:ye})],qn.prototype,"prime",void 0),u([p({type:w.Integer,converter:ye})],qn.prototype,"exponent",void 0),u([p({type:w.Integer,converter:ye})],qn.prototype,"coefficient",void 0);let oa=na=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,na.prototype)}};oa=na=u([j({type:_.Sequence,itemType:qn})],oa);class bt{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([p({type:w.Integer})],bt.prototype,"version",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"modulus",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"publicExponent",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"privateExponent",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"prime1",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"prime2",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"exponent1",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"exponent2",void 0),u([p({type:w.Integer,converter:ye})],bt.prototype,"coefficient",void 0),u([p({type:oa,optional:!0})],bt.prototype,"otherPrimeInfos",void 0);class sa{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.Integer,converter:ye})],sa.prototype,"modulus",void 0),u([p({type:w.Integer,converter:ye})],sa.prototype,"publicExponent",void 0);var aa;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(aa||(aa={}));const Ke=aa;/*! *****************************************************************************
|
|
76
|
-
|
|
71
|
+
*/function si(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Mn(r){let e=0,t=0;for(let n=0;n<r.length;n++){const s=r[n];e+=s.byteLength}const i=new Uint8Array(e);for(let n=0;n<r.length;n++){const s=r[n];i.set(new Uint8Array(s),t),t+=s.byteLength}return i.buffer}function ct(r,e,t,i){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):i<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-i<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class ai{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Mn(this.items)}}const kr=[new Uint8Array([1])],oa="0123456789",$n="name",sa="valueHexView",Ru="isHexOnly",Mu="idBlock",$u="tagClass",Uu="tagNumber",Hu="isConstructed",Lu="fromBER",Fu="toBER",Ku="local",Oe="",Ge=new ArrayBuffer(0),ci=new Uint8Array(0),xr="EndOfContent",aa="OCTET STRING",ca="BIT STRING";function et(r){var e;return e=class extends r{constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?_.toUint8Array(s.valueHex):ci}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const c=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!ct(this,c,n,s))return-1;const u=n+s;return this.valueHexView=c.subarray(n,u),this.valueHexView.length?(this.blockLength=s,u):(this.warnings.push("Zero buffer length"),n)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Ge)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:M.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class It{constructor({blockLength:e=0,error:t=Oe,warnings:i=[],valueBeforeDecode:n=ci}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=_.toUint8Array(n)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:M.ToHex(this.valueBeforeDecodeView)}}}It.NAME="baseBlock";class Ee extends It{fromBER(e,t,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}Ee.NAME="valueBlock";class la extends et(It){constructor({idBlock:e={}}={}){var t,i,n,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?_.toUint8Array(e.valueHex):ci,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=e.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Ge}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,n[0]=t}return n.buffer}if(!this.isHexOnly){const n=Et(this.tagNumber,7),s=new Uint8Array(n),c=n.byteLength,u=new Uint8Array(c+1);if(u[0]=t|31,!e){for(let f=0;f<c-1;f++)u[f+1]=s[f]|128;u[c]=s[c-1]}return u.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=t|31,!e){const n=this.valueHexView;for(let s=0;s<n.length-1;s++)i[s+1]=n[s]|128;i[this.valueHexView.byteLength]=n[n.length-1]}return i.buffer}fromBER(e,t,i){const n=_.toUint8Array(e);if(!ct(this,n,t,i))return-1;const s=n.subarray(t,t+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let f=1,d=this.valueHexView=new Uint8Array(255),v=255;for(;s[f]&128;){if(d[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===v){v+=255;const z=new Uint8Array(v);for(let O=0;O<d.length;O++)z[O]=d[O];d=this.valueHexView=new Uint8Array(v)}}this.blockLength=f+1,d[f-1]=s[f]&127;const y=new Uint8Array(f);for(let z=0;z<f;z++)y[z]=d[z];d=this.valueHexView=new Uint8Array(f),d.set(y),this.blockLength<=9?this.tagNumber=zt(d,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}la.NAME="identificationBlock";class ua extends It{constructor({lenBlock:e={}}={}){var t,i,n;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(n=e.length)!==null&&n!==void 0?n:0}fromBER(e,t,i){const n=_.toUint8Array(e);if(!ct(this,n,t,i))return-1;const s=n.subarray(t,t+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;const c=s[0]&127;if(c>8)return this.error="Too big integer",-1;if(c+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const u=t+1,f=n.subarray(u,u+c);return f[c-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=zt(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=c+1,t+this.blockLength}toBER(e=!1){let t,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=128),t;if(this.longFormUsed){const n=Et(this.length,8);if(n.byteLength>127)return this.error="Too big length",Ge;if(t=new ArrayBuffer(n.byteLength+1),e)return t;const s=new Uint8Array(n);i=new Uint8Array(t),i[0]=n.byteLength|128;for(let c=0;c<n.byteLength;c++)i[c+1]=s[c];return t}return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}ua.NAME="lengthBlock";const P={};class Se extends It{constructor({name:e=Oe,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new la(n),this.lenBlock=new ua(n),this.valueBlock=s?new s(n):new Ee(n)}fromBER(e,t,i){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}toBER(e,t){const i=t||new ai;t||fa(this);const n=this.idBlock.toBER(e);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const c=this.lenBlock.toBER(e);i.write(c),i.write(s)}return t?Ge:i.final()}toJSON(){const e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():M.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${M.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return Du(t,i)}}Se.NAME="BaseBlock";function fa(r){if(r instanceof P.Constructed)for(const e of r.valueBlock.value)fa(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}class Un extends Se{constructor({value:e=Oe,...t}={},i){super(t,i),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,i){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}Un.NAME="BaseStringBlock";class da extends et(Ee){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}da.NAME="PrimitiveValueBlock";var pa;class Cr extends Se{constructor(e={}){super(e,da),this.idBlock.isConstructed=!1}}pa=Cr,P.Primitive=pa,Cr.NAME="PRIMITIVE";function qu(r,e){if(r instanceof e)return r;const t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function Wt(r,e=0,t=r.length){const i=e;let n=new Se({},Ee);const s=new It;if(!ct(s,r,e,t))return n.error=s.error,{offset:-1,result:n};if(!r.subarray(e,e+t).length)return n.error="Zero buffer length",{offset:-1,result:n};let u=n.idBlock.fromBER(r,e,t);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),u===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(e=u,t-=n.idBlock.blockLength,u=n.lenBlock.fromBER(r,e,t),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),u===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(e=u,t-=n.lenBlock.blockLength,!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm)return n.error="Indefinite length form used for primitive encoding form",{offset:-1,result:n};let f=Se;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};f=P.EndOfContent;break;case 1:f=P.Boolean;break;case 2:f=P.Integer;break;case 3:f=P.BitString;break;case 4:f=P.OctetString;break;case 5:f=P.Null;break;case 6:f=P.ObjectIdentifier;break;case 10:f=P.Enumerated;break;case 12:f=P.Utf8String;break;case 13:f=P.RelativeObjectIdentifier;break;case 14:f=P.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=P.Sequence;break;case 17:f=P.Set;break;case 18:f=P.NumericString;break;case 19:f=P.PrintableString;break;case 20:f=P.TeletexString;break;case 21:f=P.VideotexString;break;case 22:f=P.IA5String;break;case 23:f=P.UTCTime;break;case 24:f=P.GeneralizedTime;break;case 25:f=P.GraphicString;break;case 26:f=P.VisibleString;break;case 27:f=P.GeneralString;break;case 28:f=P.UniversalString;break;case 29:f=P.CharacterString;break;case 30:f=P.BmpString;break;case 31:f=P.DATE;break;case 32:f=P.TimeOfDay;break;case 33:f=P.DateTime;break;case 34:f=P.Duration;break;default:{const d=n.idBlock.isConstructed?new P.Constructed:new P.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?P.Constructed:P.Primitive}return n=qu(n,f),u=n.fromBER(r,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=r.subarray(i,i+n.blockLength),{offset:u,result:n}}function Jt(r){if(!r.byteLength){const e=new Se({},Ee);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Wt(_.toUint8Array(r).slice(),0,r.byteLength)}function Gu(r,e){return r?1:e}class St extends Ee{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=_.toUint8Array(e);if(!ct(this,n,t,i))return-1;if(this.valueBeforeDecodeView=n.subarray(t,t+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;Gu(this.isIndefiniteForm,i)>0;){const c=Wt(n,s,i);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(s=c.offset,this.blockLength+=c.result.blockLength,i-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===xr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===xr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new ai;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?Ge:i.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}St.NAME="ConstructedValueBlock";var ha;class Te extends Se{constructor(e={}){super(e,St),this.idBlock.isConstructed=!0}fromBER(e,t,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){const e=[];for(const i of this.valueBlock.value)e.push(i.toString("ascii").split(`
|
|
72
|
+
`).map(n=>` ${n}`).join(`
|
|
73
|
+
`));const t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
|
|
74
|
+
${e.join(`
|
|
75
|
+
`)}`:`${t} :`}}ha=Te,P.Constructed=ha,Te.NAME="CONSTRUCTED";class ya extends Ee{fromBER(e,t,i){return t}toBER(e){return Ge}}ya.override="EndOfContentValueBlock";var ga;class Hn extends Se{constructor(e={}){super(e,ya),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}ga=Hn,P.EndOfContent=ga,Hn.NAME=xr;var ma;class Nt extends Se{constructor(e={}){super(e,Ee),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,t+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+i}toBER(e,t){const i=new ArrayBuffer(2);if(!e){const n=new Uint8Array(i);n[0]=5,n[1]=0}return t&&t.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}ma=Nt,P.Null=ma,Nt.NAME="NULL";class va extends et(Ee){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=_.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,i){const n=_.toUint8Array(e);return ct(this,n,t,i)?(this.valueHexView=n.subarray(t,t+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,na.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}va.NAME="BooleanValueBlock";var ba;let li=class extends Se{constructor(e={}){super(e,va),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};ba=li,P.Boolean=ba,li.NAME="BOOLEAN";class wa extends et(St){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=St.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const c=this.value[s].constructor.NAME;if(c===xr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==aa)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(e,t,i),this.blockLength=i;return n}toBER(e,t){return this.isConstructed?St.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}wa.NAME="OctetStringValueBlock";var Sa;let Ot=class Iu extends Se{constructor({idBlock:e={},lenBlock:t={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},wa),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){const s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+i);try{if(s.byteLength){const c=Wt(s,0,s.byteLength);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Te.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${M.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof Iu&&e.push(t.valueBlock.valueHexView);return _.concat(e)}};Sa=Ot,P.OctetString=Sa,Ot.NAME=aa;class Aa extends et(St){constructor({unusedBits:e=0,isConstructed:t=!1,...i}={}){super(i),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,i){if(!i)return t;let n=-1;if(this.isConstructed){if(n=St.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===xr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==ca)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=u.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return n}const s=_.toUint8Array(e);if(!ct(this,s,t,i))return-1;const c=s.subarray(t,t+i);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=c.subarray(1);try{if(u.byteLength){const f=Wt(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,t+i}toBER(e,t){if(this.isConstructed)return St.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Ge;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}}}Aa.NAME="BitStringValueBlock";var ka;let Tt=class extends Se{constructor({idBlock:e={},lenBlock:t={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},Aa),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Te.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const n of t)e.push(n.toString(2).padStart(8,"0"));const i=e.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};ka=Tt,P.BitString=ka,Tt.NAME=ca;var xa;function zu(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const c=s.length-1,u=n.slice(0),f=u.length-1;let d=0;const v=f<c?c:f;let y=0;for(let z=v;z>=0;z--,y++){switch(!0){case y<u.length:d=s[c-y]+u[f-y]+t[0];break;default:d=s[c-y]+t[0]}switch(t[0]=d/10,!0){case y>=s.length:s=Rn(new Uint8Array([d%10]),s);break;default:s[c-y]=d%10}}return t[0]>0&&(s=Rn(t,s)),s}function Ca(r){if(r>=kr.length)for(let e=kr.length;e<=r;e++){const t=new Uint8Array([0]);let i=kr[e-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+t[0]]);t[0]=s[0]/10,i[n]=s[0]%10}t[0]>0&&(i=Rn(t,i)),kr.push(i)}return kr[r]}function Wu(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),c=s.length-1,u=n.slice(0),f=u.length-1;let d,v=0;for(let y=f;y>=0;y--,v++)switch(d=s[c-v]-u[f-v]-t,!0){case d<0:t=1,s[c-v]=d+10;break;default:t=0,s[c-v]=d}if(t>0)for(let y=c-f+1;y>=0;y--,v++)if(d=s[c-v]-t,d<0)t=1,s[c-v]=d+10;else{t=0,s[c-v]=d;break}return s.slice()}class Ln extends et(Ee){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}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=na.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Pu(e))}get valueDec(){return this._valueDec}fromDER(e,t,i,n=0){const s=this.fromBER(e,t,i);if(s===-1)return s;const c=this.valueHexView;return c[0]===0&&c[1]&128?this.valueHexView=c.subarray(1):n!==0&&c.length<n&&(n-c.length>1&&(n=c.length+1),this.valueHexView=c.subarray(n-c.length)),s}toDER(e=!1){const t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(t,1),this.valueHexView=i}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,i){const n=super.fromBER(e,t,i);return n===-1||this.setValueHex(),n}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const e=this.valueHexView.length*8-1;let t=new Uint8Array(this.valueHexView.length*8/3),i=0,n;const s=this.valueHexView;let c="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case e:t=Wu(Ca(i),t),c="-";break;default:t=zu(t,Ca(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(c+=oa.charAt(t[f]));return u===!1&&(c+=oa.charAt(0)),c}}xa=Ln,Ln.NAME="IntegerValueBlock",Object.defineProperty(xa.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ba;class tt extends Se{constructor(e={}){super(e,Ln),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return si(),BigInt(this.valueBlock.toString())}static fromBigInt(e){si();const t=BigInt(e),i=new ai,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(M.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const d=BigInt(`0x${M.ToHex(u)}`)+t,v=_.toUint8Array(M.FromHex(d.toString(16)));v[0]|=128,i.write(v)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new tt({valueHex:i.final()})}convertToDER(){const e=new tt({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new tt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Ba=tt,P.Integer=Ba,tt.NAME="INTEGER";var Ea;class ui extends tt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ea=ui,P.Enumerated=Ea,ui.NAME="ENUMERATED";class Fn extends et(Ee){constructor({valueDec:e=-1,isFirstSid:t=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,i){if(!i)return t;const n=_.toUint8Array(e);if(!ct(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,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=zt(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){si();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const i=new Uint8Array(t.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(t.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Et(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ge;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=M.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}Fn.NAME="sidBlock";class Ia extends Ee{constructor({value:e=Oe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new Fn;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e){const t=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,Ge;t.push(n)}return Mn(t)}fromString(e){this.value=[];let t=0,i=0,n="",s=!1;do if(i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1,s){const c=this.value[0];let u=0;switch(c.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}const f=parseInt(n,10);if(isNaN(f))return;c.valueDec=f+u,s=!1}else{const c=new Fn;if(n>Number.MAX_SAFE_INTEGER){si();const u=BigInt(n);c.valueBigInt=u}else if(c.valueDec=parseInt(n,10),isNaN(c.valueDec))return;this.value.length||(c.isFirstSid=!0,s=!0),this.value.push(c)}while(i!==-1)}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t?(n=`{${n}}`,this.value[i].isFirstSid?e=`2.{${n} - 80}`:e+=n):e+=n}return e}toJSON(){const e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}}Ia.NAME="ObjectIdentifierValueBlock";var Na;class fi extends Se{constructor(e={}){super(e,Ia),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Na=fi,P.ObjectIdentifier=Na,fi.NAME="OBJECT IDENTIFIER";class Kn extends et(It){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=_.toUint8Array(e);if(!ct(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,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=zt(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Et(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ge;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=M.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Kn.NAME="relativeSidBlock";class Oa extends Ee{constructor({value:e=Oe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new Kn;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e,t){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,Ge;i.push(s)}return Mn(i)}fromString(e){this.value=[];let t=0,i=0,n="";do{i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1;const s=new Kn;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t&&(n=`{${n}}`),e+=n}return e}toJSON(){const e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}}Oa.NAME="RelativeObjectIdentifierValueBlock";var Ta;class qn extends Se{constructor(e={}){super(e,Oa),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ta=qn,P.RelativeObjectIdentifier=Ta,qn.NAME="RelativeObjectIdentifier";var Va;class lt extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Va=lt,P.Sequence=Va,lt.NAME="SEQUENCE";var _a;let ut=class extends Te{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};_a=ut,P.Set=_a,ut.NAME="SET";class ja extends et(Ee){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Oe}toJSON(){return{...super.toJSON(),value:this.value}}}ja.NAME="StringValueBlock";class Pa extends ja{}Pa.NAME="SimpleStringValueBlock";class Re extends Un{constructor({...e}={}){super(e,Pa)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,_.toUint8Array(e))}fromString(e){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);this.valueBlock.value=e}}Re.NAME="SIMPLE STRING";class Da extends Re{fromBuffer(e){this.valueBlock.valueHexView=_.toUint8Array(e);try{this.valueBlock.value=M.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=M.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(M.FromUtf8String(e)),this.valueBlock.value=e}}Da.NAME="Utf8StringValueBlock";var Ra;class ft extends Da{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Ra=ft,P.Utf8String=Ra,ft.NAME="UTF8String";class Ma extends Re{fromBuffer(e){this.valueBlock.value=M.ToUtf16String(e),this.valueBlock.valueHexView=_.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(M.FromUtf16String(e))}}Ma.NAME="BmpStringValueBlock";var $a;class di extends Ma{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}$a=di,P.BmpString=$a,di.NAME="BMPString";class Ua extends Re{fromBuffer(e){const t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(t);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let n=0;n<t;n++){const s=Et(e.charCodeAt(n),8),c=new Uint8Array(s);if(c.length>4)continue;const u=4-c.length;for(let f=c.length-1;f>=0;f--)i[n*4+f+u]=c[f]}this.valueBlock.value=e}}Ua.NAME="UniversalStringValueBlock";var Ha;class pi extends Ua{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Ha=pi,P.UniversalString=Ha,pi.NAME="UniversalString";var La;class hi extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}La=hi,P.NumericString=La,hi.NAME="NumericString";var Fa;class yi extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Fa=yi,P.PrintableString=Fa,yi.NAME="PrintableString";var Ka;class gi extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Ka=gi,P.TeletexString=Ka,gi.NAME="TeletexString";var qa;class mi extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}qa=mi,P.VideotexString=qa,mi.NAME="VideotexString";var Ga;class vi extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Ga=vi,P.IA5String=Ga,vi.NAME="IA5String";var za;class bi extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}za=bi,P.GraphicString=za,bi.NAME="GraphicString";var Wa;class Br extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Wa=Br,P.VisibleString=Wa,Br.NAME="VisibleString";var Ja;class wi extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Ja=wi,P.GeneralString=Ja,wi.NAME="GeneralString";var Ya;class Si extends Re{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Ya=Si,P.CharacterString=Ya,Si.NAME="CharacterString";var Za;class Er extends Br{constructor({value:e,valueDate:t,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let n=0;n<e.length;n++)this.valueBlock.valueHexView[n]=e.charCodeAt(n)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,_.toUint8Array(e)))}toBuffer(){const e=this.toString(),t=new ArrayBuffer(e.length),i=new Uint8Array(t);for(let n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}const n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(e="iso"){if(e==="iso"){const t=new Array(7);return t[0]=De(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=De(this.month,2),t[2]=De(this.day,2),t[3]=De(this.hour,2),t[4]=De(this.minute,2),t[5]=De(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}Za=Er,P.UTCTime=Za,Er.NAME="UTCTime";var Qa;class Ai extends Er{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,i="",n="",s=0,c,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const y=new Number(e[e.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(t){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let y=1,z=i.indexOf("+"),O="";if(z===-1&&(z=i.indexOf("-"),y=-1),z!==-1){if(O=i.substring(z+1),i=i.substring(0,z),O.length!==2&&O.length!==4)throw new Error("Wrong input string for conversion");let p=parseInt(O.substring(0,2),10);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");if(u=y*p,O.length===4){if(p=parseInt(O.substring(2,4),10),isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");f=y*p}}}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(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(c=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(c=/(\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 n.length===12:if(c=/(\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 n.length===14:if(c=/(\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 v=c.exec(n);if(v===null)throw new Error("Wrong input string for conversion");for(let y=1;y<v.length;y++)switch(y){case 1:this.year=parseInt(v[y],10);break;case 2:this.month=parseInt(v[y],10);break;case 3:this.day=parseInt(v[y],10);break;case 4:this.hour=parseInt(v[y],10)+u;break;case 5:this.minute=parseInt(v[y],10)+f;break;case 6:this.second=parseInt(v[y],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!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(e="iso"){if(e==="iso"){const t=[];return t.push(De(this.year,4)),t.push(De(this.month,2)),t.push(De(this.day,2)),t.push(De(this.hour,2)),t.push(De(this.minute,2)),t.push(De(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(De(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Qa=Ai,P.GeneralizedTime=Qa,Ai.NAME="GeneralizedTime";var Xa;class Gn extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Xa=Gn,P.DATE=Xa,Gn.NAME="DATE";var ec;class zn extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}ec=zn,P.TimeOfDay=ec,zn.NAME="TimeOfDay";var tc;class Wn extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}tc=Wn,P.DateTime=tc,Wn.NAME="DateTime";var rc;class Jn extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}rc=Jn,P.Duration=rc,Jn.NAME="Duration";var ic;class Yn extends ft{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}ic=Yn,P.TIME=ic,Yn.NAME="TIME";class Vt{constructor({name:e=Oe,optional:t=!1}={}){this.name=e,this.optional=t}}class Zn extends Vt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class ki extends Vt{constructor({value:e=new Vt,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class Ju{constructor({data:e=ci}={}){this.dataView=_.toUint8Array(e)}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=_.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=_.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function _t(r,e,t){if(t instanceof Zn){for(let s=0;s<t.value.length;s++)if(_t(r,e,t.value[s]).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty($n)&&(s.name=t.name),s}}if(t instanceof Vt)return t.hasOwnProperty($n)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Mu in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Lu in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Fu in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=t.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty($u)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(Uu)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(Hu)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(Ru in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(sa in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,c=e.idBlock.valueHexView;if(s.length!==c.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==c[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(r[t.name]=e)),t instanceof P.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof ki&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let f=!0;for(let d=0;d<t.valueBlock.value.length;d++)f=f&&(t.valueBlock.value[d].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let f=0;f<u;f++)if(f-s>=e.valueBlock.value.length){if(t.valueBlock.value[f].optional===!1){const d={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(delete r[t.name],d.name=t.name)),d}}else if(t.valueBlock.value[0]instanceof ki){if(c=_t(r,e.valueBlock.value[f],t.valueBlock.value[0].value),c.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),c;if($n in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let d={};Ku in t.valueBlock.value[0]&&t.valueBlock.value[0].local?d=e:d=r,typeof d[t.valueBlock.value[0].name]>"u"&&(d[t.valueBlock.value[0].name]=[]),d[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(c=_t(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),c.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&delete r[t.name]),c;if(c.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&sa in e.valueBlock){const s=Wt(e.valueBlock.valueHexView);if(s.offset===-1){const c={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Oe),t.name&&(delete r[t.name],c.name=t.name)),c}return _t(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function Yu(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=Wt(_.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:_t(t.result,t.result,e)}const nc=Object.freeze(Object.defineProperty({__proto__:null,Any:Vt,BaseBlock:Se,BaseStringBlock:Un,BitString:Tt,BmpString:di,Boolean:li,CharacterString:Si,Choice:Zn,Constructed:Te,DATE:Gn,DateTime:Wn,Duration:Jn,EndOfContent:Hn,Enumerated:ui,GeneralString:wi,GeneralizedTime:Ai,GraphicString:bi,HexBlock:et,IA5String:vi,Integer:tt,Null:Nt,NumericString:hi,ObjectIdentifier:fi,OctetString:Ot,Primitive:Cr,PrintableString:yi,RawData:Ju,RelativeObjectIdentifier:qn,Repeated:ki,Sequence:lt,Set:ut,TIME:Yn,TeletexString:gi,TimeOfDay:zn,UTCTime:Er,UniversalString:pi,Utf8String:ft,ValueBlock:Ee,VideotexString:mi,ViewWriter:ai,VisibleString:Br,compareSchema:_t,fromBER:Jt,verifySchema:Yu},Symbol.toStringTag,{value:"Module"}));var x;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(x||(x={}));var h;(function(r){r[r.Any=1]="Any",r[r.Boolean=2]="Boolean",r[r.OctetString=3]="OctetString",r[r.BitString=4]="BitString",r[r.Integer=5]="Integer",r[r.Enumerated=6]="Enumerated",r[r.ObjectIdentifier=7]="ObjectIdentifier",r[r.Utf8String=8]="Utf8String",r[r.BmpString=9]="BmpString",r[r.UniversalString=10]="UniversalString",r[r.NumericString=11]="NumericString",r[r.PrintableString=12]="PrintableString",r[r.TeletexString=13]="TeletexString",r[r.VideotexString=14]="VideotexString",r[r.IA5String=15]="IA5String",r[r.GraphicString=16]="GraphicString",r[r.VisibleString=17]="VisibleString",r[r.GeneralString=18]="GeneralString",r[r.CharacterString=19]="CharacterString",r[r.UTCTime=20]="UTCTime",r[r.GeneralizedTime=21]="GeneralizedTime",r[r.DATE=22]="DATE",r[r.TimeOfDay=23]="TimeOfDay",r[r.DateTime=24]="DateTime",r[r.Duration=25]="Duration",r[r.TIME=26]="TIME",r[r.Null=27]="Null"})(h||(h={}));class xi{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(_.isBufferSource(e))this.unusedBits=t,this.value=_.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Tt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new Tt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Tt({name:e})}toNumber(){let e="";const t=new Uint8Array(this.value);for(const i of t)e+=i.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let t=e.toString(2);const i=t.length+7>>3;this.unusedBits=(i<<3)-t.length;const n=new Uint8Array(i);t=t.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(t.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}}class ie{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):_.isBufferSource(e)?this.buffer=_.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Ot))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new Ot({valueHex:this.buffer})}toSchema(e){return new Ot({name:e})}}const Zu={fromASN:r=>r instanceof Nt?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Nt;const e=Jt(r);if(e.result.error)throw new Error(e.result.error);return e.result}},Qu={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new tt({value:+r})},Xu={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new ui({value:r})},ue={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new tt({valueHex:r})},ef={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Tt({valueHex:r})},tf={fromASN:r=>r.valueBlock.toString(),toASN:r=>new fi({value:r})},rf={fromASN:r=>r.valueBlock.value,toASN:r=>new li({value:r})},Ci={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ot({valueHex:r})},nf={fromASN:r=>new ie(r.getValue()),toASN:r=>r.toASN()};function He(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const oc=He(ft),of=He(di),sf=He(pi),af=He(hi),cf=He(yi),lf=He(gi),uf=He(mi),ff=He(vi),df=He(bi),pf=He(Br),hf=He(wi),yf=He(Si),gf={fromASN:r=>r.toDate(),toASN:r=>new Er({valueDate:r})},mf={fromASN:r=>r.toDate(),toASN:r=>new Ai({valueDate:r})},vf={fromASN:()=>null,toASN:()=>new Nt};function Qn(r){switch(r){case h.Any:return Zu;case h.BitString:return ef;case h.BmpString:return of;case h.Boolean:return rf;case h.CharacterString:return yf;case h.Enumerated:return Xu;case h.GeneralString:return hf;case h.GeneralizedTime:return mf;case h.GraphicString:return df;case h.IA5String:return ff;case h.Integer:return Qu;case h.Null:return vf;case h.NumericString:return af;case h.ObjectIdentifier:return tf;case h.OctetString:return Ci;case h.PrintableString:return cf;case h.TeletexString:return lf;case h.UTCTime:return gf;case h.UniversalString:return sf;case h.Utf8String:return oc;case h.VideotexString:return uf;case h.VisibleString:return pf;default:return null}}function dt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:dt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function sc(r){var e;if(r){const t=Object.getPrototypeOf(r);return((e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:sc(t)}return!1}function bf(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}class wf{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){const i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:x.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(t,i),t.items=Object.assign({},t.items,i.items)),t}create(e,t){const i=this.items.get(e)||this.createDefault(e),n=[];for(const s in i.items){const c=i.items[s],u=t?s:"";let f;if(typeof c.type=="number"){const v=h[c.type],y=nc[v];if(!y)throw new Error(`Cannot get ASN1 class by name '${v}'`);f=new y({name:u})}else dt(c.type)?f=new c.type().toSchema(u):c.optional?this.get(c.type).type===x.Choice?f=new Vt({name:u}):(f=this.create(c.type,!1),f.name=u):f=new Vt({name:u});const d=!!c.optional||c.defaultValue!==void 0;if(c.repeated){f.name="";const v=c.repeated==="set"?ut:lt;f=new v({name:"",value:[new ki({name:u,value:f})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||dt(c.type)){const v=c.repeated?Te:Cr;n.push(new v({name:u,optional:d,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const v=!!c.repeated;let y=v?f:this.get(c.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,n.push(new Te({name:v?"":u,optional:d,idBlock:{tagClass:3,tagNumber:c.context},value:y}))}else n.push(new Te({optional:d,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else f.optional=d,n.push(f)}switch(i.type){case x.Sequence:return new lt({value:n,name:""});case x.Set:return new ut({value:n,name:""});case x.Choice:return new Zn({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){const t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}}const Le=new wf,E=r=>e=>{let t;Le.has(e)?t=Le.get(e):(t=Le.createDefault(e),Le.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;Le.has(e.constructor)?i=Le.get(e.constructor):(i=Le.createDefault(e.constructor),Le.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=Qn(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}i.items[t]=n};class ac extends Error{constructor(){super(...arguments),this.schemas=[]}}class Sf{static parse(e,t){const i=Jt(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){var i;try{if(dt(t))return new t().fromASN(e);const n=Le.get(t);Le.cache(t);let s=n.schema;if(e.constructor===Te&&n.type!==x.Choice){s=new Te({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const f in n.items)delete e[f]}const c=_t({},e,s);if(!c.verified)throw new ac(`Data does not match to ${t.name} ASN1 schema. ${c.result.error}`);const u=new t;if(sc(t)){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const f=n.itemType;if(typeof f=="number"){const d=Qn(f);if(!d)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);return t.from(e.valueBlock.value,v=>d.fromASN(v))}else return t.from(e.valueBlock.value,d=>this.fromASN(d,f))}for(const f in n.items){const d=c.result[f];if(!d)continue;const v=n.items[f],y=v.type;if(typeof y=="number"||dt(y)){const z=(i=v.converter)!==null&&i!==void 0?i:dt(y)?new y:null;if(!z)throw new Error("Converter is empty");if(v.repeated)if(v.implicit){const O=v.repeated==="sequence"?lt:ut,p=new O;p.valueBlock=d.valueBlock;const m=Jt(p.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 S=m.result.valueBlock.value;u[f]=Array.from(S,w=>z.fromASN(w))}else u[f]=Array.from(d,O=>z.fromASN(O));else{let O=d;if(v.implicit){let p;if(dt(y))p=new y().toSchema("");else{const m=h[y],S=nc[m];if(!S)throw new Error(`Cannot get '${m}' class from asn1js module`);p=new S}p.valueBlock=O.valueBlock,O=Jt(p.toBER(!1)).result}u[f]=z.fromASN(O)}}else if(v.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.");u[f]=Array.from(d,z=>this.fromASN(z,y))}else u[f]=this.fromASN(d,y)}return u}catch(n){throw n instanceof ac&&n.schemas.push(t.name),n}}}class Xn{static serialize(e){return e instanceof Se?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&dt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=Le.get(t);Le.cache(t);let n=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const c=Qn(i.itemType);if(!c)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>c.toASN(u))}else n=e.map(c=>this.toAsnItem({type:i.itemType},"[]",t,c))}else for(const c in i.items){const u=i.items[c],f=e[c];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&bf(this.serialize(u.defaultValue),this.serialize(f)))continue;const d=Xn.toAsnItem(u,c,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||dt(u.type))){const v={};v.valueHex=d instanceof Nt?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Cr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...v}))}else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:d.valueBlock.value}));else n.push(new Te({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[d]}));else u.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case x.Sequence:s=new lt({value:n});break;case x.Set:s=new ut({value:n});break;case x.Choice:if(!n[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(e,t,i,n){let s;if(typeof e.type=="number"){const c=e.converter;if(!c)throw new Error(`Property '${t}' doesn't have converter for type ${h[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const u=Array.from(n,d=>c.toASN(d)),f=e.repeated==="sequence"?lt:ut;s=new f({value:u})}else s=c.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?lt:ut;s=new u({value:c})}else s=this.toASN(n);return s}}class ne extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class F{static serialize(e){return Xn.serialize(e)}static parse(e,t){return Sf.parse(e,t)}static toString(e){const t=_.isBufferSource(e)?_.toArrayBuffer(e):F.serialize(e),i=Jt(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function a(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(s=(n<3?c(s):n>3?c(e,t,s):c(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;var cc={exports:{}};(function(r){(function(e){const t="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",f={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${c})?$`,"i")};function d(p,m){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let S=0,w=-1,I=(p.match(f.zoneIndex)||[])[0],k,B;for(I&&(I=I.substring(1),p=p.replace(/%.+$/,""));(w=p.indexOf(":",w+1))>=0;)S++;if(p.substr(0,2)==="::"&&S--,p.substr(-2,2)==="::"&&S--,S>m)return null;for(B=m-S,k=":";B--;)k+="0:";return p=p.replace("::",k),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),m=function(){const Z=p.split(":"),se=[];for(let D=0;D<Z.length;D++)se.push(parseInt(Z[D],16));return se}(),{parts:m,zoneId:I}}function v(p,m,S,w){if(p.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let I=0,k;for(;w>0;){if(k=S-w,k<0&&(k=0),p[I]>>k!==m[I]>>k)return!1;w-=S,I+=1}return!0}function y(p){if(s.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(n.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}function z(p,m){for(;p.length<m;)p=`0${p}`;return p}const O={};O.IPv4=function(){function p(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let S,w;for(S=0;S<m.length;S++)if(w=m[S],!(0<=w&&w<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return p.prototype.SpecialRanges={unspecified:[[new p([0,0,0,0]),8]],broadcast:[[new p([255,255,255,255]),32]],multicast:[[new p([224,0,0,0]),4]],linkLocal:[[new p([169,254,0,0]),16]],loopback:[[new p([127,0,0,0]),8]],carrierGradeNat:[[new p([100,64,0,0]),10]],private:[[new p([10,0,0,0]),8],[new p([172,16,0,0]),12],[new p([192,168,0,0]),16]],reserved:[[new p([192,0,0,0]),24],[new p([192,0,2,0]),24],[new p([192,88,99,0]),24],[new p([198,18,0,0]),15],[new p([198,51,100,0]),24],[new p([203,0,113,0]),24],[new p([240,0,0,0]),4]]},p.prototype.kind=function(){return"ipv4"},p.prototype.match=function(m,S){let w;if(S===void 0&&(w=m,m=w[0],S=w[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,m.octets,8,S)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,S=!1;const w={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let I,k,B;for(I=3;I>=0;I-=1)if(k=this.octets[I],k in w){if(B=w[k],S&&B!==0)return null;B!==8&&(S=!0),m+=B}else return null;return 32-m},p.prototype.range=function(){return O.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return O.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p}(),O.IPv4.broadcastAddressFromCIDR=function(p){try{const m=this.parseCIDR(p),S=m[0].toByteArray(),w=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),I=[];let k=0;for(;k<4;)I.push(parseInt(S[k],10)|parseInt(w[k],10)^255),k++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},O.IPv4.isIPv4=function(p){return this.parser(p)!==null},O.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},O.IPv4.isValidFourPartDecimal=function(p){return!!(O.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},O.IPv4.networkAddressFromCIDR=function(p){let m,S,w,I,k;try{for(m=this.parseCIDR(p),w=m[0].toByteArray(),k=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),I=[],S=0;S<4;)I.push(parseInt(w[S],10)&parseInt(k[S],10)),S++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},O.IPv4.parse=function(p){const m=this.parser(p);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},O.IPv4.parseCIDR=function(p){let m;if(m=p.match(/^(.+)\/(\d+)$/)){const S=parseInt(m[2]);if(S>=0&&S<=32){const w=[this.parse(m[1]),S];return Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},O.IPv4.parser=function(p){let m,S,w;if(m=p.match(i.fourOctet))return function(){const I=m.slice(1,6),k=[];for(let B=0;B<I.length;B++)S=I[B],k.push(y(S));return k}();if(m=p.match(i.longValue)){if(w=y(m[1]),w>4294967295||w<0)throw new Error("ipaddr: address outside defined range");return function(){const I=[];let k;for(k=0;k<=24;k+=8)I.push(w>>k&255);return I}().reverse()}else return(m=p.match(i.twoOctet))?function(){const I=m.slice(1,4),k=[];if(w=y(I[1]),w>16777215||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(I[0])),k.push(w>>16&255),k.push(w>>8&255),k.push(w&255),k}():(m=p.match(i.threeOctet))?function(){const I=m.slice(1,5),k=[];if(w=y(I[2]),w>65535||w<0)throw new Error("ipaddr: address outside defined range");return k.push(y(I[0])),k.push(y(I[1])),k.push(w>>8&255),k.push(w&255),k}():null},O.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");const m=[0,0,0,0];let S=0;const w=Math.floor(p/8);for(;S<w;)m[S]=255,S++;return w<4&&(m[w]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},O.IPv6=function(){function p(m,S){let w,I;if(m.length===16)for(this.parts=[],w=0;w<=14;w+=2)this.parts.push(m[w]<<8|m[w+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(w=0;w<this.parts.length;w++)if(I=this.parts[w],!(0<=I&&I<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");S&&(this.zoneId=S)}return p.prototype.SpecialRanges={unspecified:[new p([0,0,0,0,0,0,0,0]),128],linkLocal:[new p([65152,0,0,0,0,0,0,0]),10],multicast:[new p([65280,0,0,0,0,0,0,0]),8],loopback:[new p([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new p([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new p([0,0,0,0,0,65535,0,0]),96],rfc6145:[new p([0,0,0,0,65535,0,0,0]),96],rfc6052:[new p([100,65435,0,0,0,0,0,0]),96],"6to4":[new p([8194,0,0,0,0,0,0,0]),16],teredo:[new p([8193,0,0,0,0,0,0,0]),32],reserved:[[new p([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new p([8193,2,0,0,0,0,0,0]),48],amt:[new p([8193,3,0,0,0,0,0,0]),32],as112v6:[new p([8193,4,274,0,0,0,0,0]),48],deprecated:[new p([8193,16,0,0,0,0,0,0]),28],orchid2:[new p([8193,32,0,0,0,0,0,0]),28]},p.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},p.prototype.kind=function(){return"ipv6"},p.prototype.match=function(m,S){let w;if(S===void 0&&(w=m,m=w[0],S=w[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,m.parts,16,S)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,S=!1;const w={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 I,k;for(let B=7;B>=0;B-=1)if(I=this.parts[B],I in w){if(k=w[I],S&&k!==0)return null;k!==16&&(S=!0),m+=k}else return null;return 128-m},p.prototype.range=function(){return O.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let m;const S=[],w=this.parts;for(let I=0;I<w.length;I++)m=w[I],S.push(m>>8),S.push(m&255);return S},p.prototype.toFixedLengthString=function(){const m=(function(){const w=[];for(let I=0;I<this.parts.length;I++)w.push(z(this.parts[I].toString(16),4));return w}).call(this).join(":");let S="";return this.zoneId&&(S=`%${this.zoneId}`),m+S},p.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),S=m[0],w=m[1];return new O.IPv4([S>>8,S&255,w>>8,w&255])},p.prototype.toNormalizedString=function(){const m=(function(){const w=[];for(let I=0;I<this.parts.length;I++)w.push(this.parts[I].toString(16));return w}).call(this).join(":");let S="";return this.zoneId&&(S=`%${this.zoneId}`),m+S},p.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,S=this.toNormalizedString();let w=0,I=-1,k;for(;k=m.exec(S);)k[0].length>I&&(w=k.index,I=k[0].length);return I<0?S:`${S.substring(0,w)}::${S.substring(w+I)}`},p.prototype.toString=function(){return this.toRFC5952String()},p}(),O.IPv6.broadcastAddressFromCIDR=function(p){try{const m=this.parseCIDR(p),S=m[0].toByteArray(),w=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),I=[];let k=0;for(;k<16;)I.push(parseInt(S[k],10)|parseInt(w[k],10)^255),k++;return new this(I)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},O.IPv6.isIPv6=function(p){return this.parser(p)!==null},O.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{const m=this.parser(p);return new this(m.parts,m.zoneId),!0}catch{return!1}},O.IPv6.networkAddressFromCIDR=function(p){let m,S,w,I,k;try{for(m=this.parseCIDR(p),w=m[0].toByteArray(),k=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),I=[],S=0;S<16;)I.push(parseInt(w[S],10)&parseInt(k[S],10)),S++;return new this(I)}catch(B){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${B})`)}},O.IPv6.parse=function(p){const m=this.parser(p);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},O.IPv6.parseCIDR=function(p){let m,S,w;if((S=p.match(/^(.+)\/(\d+)$/))&&(m=parseInt(S[2]),m>=0&&m<=128))return w=[this.parse(S[1]),m],Object.defineProperty(w,"toString",{value:function(){return this.join("/")}}),w;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},O.IPv6.parser=function(p){let m,S,w,I,k,B;if(w=p.match(f.deprecatedTransitional))return this.parser(`::ffff:${w[1]}`);if(f.native.test(p))return d(p,8);if((w=p.match(f.transitional))&&(B=w[6]||"",m=d(w[1].slice(0,-1)+B,6),m.parts)){for(k=[parseInt(w[2]),parseInt(w[3]),parseInt(w[4]),parseInt(w[5])],S=0;S<k.length;S++)if(I=k[S],!(0<=I&&I<=255))return null;return m.parts.push(k[0]<<8|k[1]),m.parts.push(k[2]<<8|k[3]),{parts:m.parts,zoneId:m.zoneId}}return null},O.IPv6.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>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 S=0;const w=Math.floor(p/8);for(;S<w;)m[S]=255,S++;return w<16&&(m[w]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},O.fromByteArray=function(p){const m=p.length;if(m===4)return new O.IPv4(p);if(m===16)return new O.IPv6(p);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},O.isValid=function(p){return O.IPv6.isValid(p)||O.IPv4.isValid(p)},O.parse=function(p){if(O.IPv6.isValid(p))return O.IPv6.parse(p);if(O.IPv4.isValid(p))return O.IPv4.parse(p);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},O.parseCIDR=function(p){try{return O.IPv6.parseCIDR(p)}catch{try{return O.IPv4.parseCIDR(p)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},O.process=function(p){const m=this.parse(p);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},O.subnetMatch=function(p,m,S){let w,I,k,B;S==null&&(S="unicast");for(I in m)if(Object.prototype.hasOwnProperty.call(m,I)){for(k=m[I],k[0]&&!(k[0]instanceof Array)&&(k=[k]),w=0;w<k.length;w++)if(B=k[w],p.kind()===B[0].kind()&&p.match.apply(p,B))return I}return S},r.exports?r.exports=O:e.ipaddr=O})(Pn)})(cc);var lc=cc.exports;class uc{static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const t=parseInt(e.slice(8),16).toString(2).split("").reduce((n,s)=>n+ +s,0);let i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${t}`}static toString(e){if(e.byteLength===4||e.byteLength===16){const t=new Uint8Array(e);return lc.fromByteArray(Array.from(t)).toString()}return this.decodeIP(M.ToHex(e))}static fromString(e){const t=lc.parse(e);return new Uint8Array(t.toByteArray()).buffer}}var eo,to,ro;let Ae=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:h.TeletexString})],Ae.prototype,"teletexString",void 0),a([l({type:h.PrintableString})],Ae.prototype,"printableString",void 0),a([l({type:h.UniversalString})],Ae.prototype,"universalString",void 0),a([l({type:h.Utf8String})],Ae.prototype,"utf8String",void 0),a([l({type:h.BmpString})],Ae.prototype,"bmpString",void 0),Ae=a([E({type:x.Choice})],Ae);let Yt=class extends Ae{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?M.ToHex(this.anyValue):super.toString())}};a([l({type:h.IA5String})],Yt.prototype,"ia5String",void 0),a([l({type:h.Any})],Yt.prototype,"anyValue",void 0),Yt=a([E({type:x.Choice})],Yt);class Ir{constructor(e={}){this.type="",this.value=new Yt,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Ir.prototype,"type",void 0),a([l({type:Yt})],Ir.prototype,"value",void 0);let Zt=eo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,eo.prototype)}};Zt=eo=a([E({type:x.Set,itemType:Ir})],Zt);let io=to=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,to.prototype)}};io=to=a([E({type:x.Sequence,itemType:Zt})],io);let ge=ro=class extends io{constructor(e){super(e),Object.setPrototypeOf(this,ro.prototype)}};ge=ro=a([E({type:x.Sequence})],ge);const Af={fromASN:r=>uc.toString(Ci.fromASN(r)),toASN:r=>Ci.toASN(uc.fromString(r))};class Nr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Nr.prototype,"typeId",void 0),a([l({type:h.Any,context:0})],Nr.prototype,"value",void 0);class no{constructor(e={}){this.partyName=new Ae,Object.assign(this,e)}}a([l({type:Ae,optional:!0,context:0,implicit:!0})],no.prototype,"nameAssigner",void 0),a([l({type:Ae,context:1,implicit:!0})],no.prototype,"partyName",void 0);let Q=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Nr,context:0,implicit:!0})],Q.prototype,"otherName",void 0),a([l({type:h.IA5String,context:1,implicit:!0})],Q.prototype,"rfc822Name",void 0),a([l({type:h.IA5String,context:2,implicit:!0})],Q.prototype,"dNSName",void 0),a([l({type:h.Any,context:3,implicit:!0})],Q.prototype,"x400Address",void 0),a([l({type:ge,context:4,implicit:!1})],Q.prototype,"directoryName",void 0),a([l({type:no,context:5})],Q.prototype,"ediPartyName",void 0),a([l({type:h.IA5String,context:6,implicit:!0})],Q.prototype,"uniformResourceIdentifier",void 0),a([l({type:h.OctetString,context:7,implicit:!0,converter:Af})],Q.prototype,"iPAddress",void 0),a([l({type:h.ObjectIdentifier,context:8,implicit:!0})],Q.prototype,"registeredID",void 0),Q=a([E({type:x.Choice})],Q);const Qt="1.3.6.1.5.5.7.3",jt="2.5.29";var oo;class Bi{constructor(e={}){this.accessMethod="",this.accessLocation=new Q,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Bi.prototype,"accessMethod",void 0),a([l({type:Q})],Bi.prototype,"accessLocation",void 0);let fc=oo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,oo.prototype)}};fc=oo=a([E({type:x.Sequence,itemType:Bi})],fc);const so=`${jt}.35`;class ao extends ie{}class Pt{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:ao,context:0,optional:!0,implicit:!0})],Pt.prototype,"keyIdentifier",void 0),a([l({type:Q,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Pt.prototype,"authorityCertIssuer",void 0),a([l({type:h.Integer,context:2,optional:!0,implicit:!0,converter:ue})],Pt.prototype,"authorityCertSerialNumber",void 0);const dc=`${jt}.19`;class Ei{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:h.Boolean,defaultValue:!1})],Ei.prototype,"cA",void 0),a([l({type:h.Integer,optional:!0})],Ei.prototype,"pathLenConstraint",void 0);var co;let Ie=co=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,co.prototype)}};Ie=co=a([E({type:x.Sequence,itemType:Q})],Ie);var lo;let pc=lo=class extends Ie{constructor(e){super(e),Object.setPrototypeOf(this,lo.prototype)}};pc=lo=a([E({type:x.Sequence})],pc);var uo;const hc=`${jt}.32`;let pt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:h.IA5String})],pt.prototype,"ia5String",void 0),a([l({type:h.VisibleString})],pt.prototype,"visibleString",void 0),a([l({type:h.BmpString})],pt.prototype,"bmpString",void 0),a([l({type:h.Utf8String})],pt.prototype,"utf8String",void 0),pt=a([E({type:x.Choice})],pt);class fo{constructor(e={}){this.organization=new pt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:pt})],fo.prototype,"organization",void 0),a([l({type:h.Integer,repeated:"sequence"})],fo.prototype,"noticeNumbers",void 0);class po{constructor(e={}){Object.assign(this,e)}}a([l({type:fo,optional:!0})],po.prototype,"noticeRef",void 0),a([l({type:pt,optional:!0})],po.prototype,"explicitText",void 0);let Ii=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.IA5String})],Ii.prototype,"cPSuri",void 0),a([l({type:po})],Ii.prototype,"userNotice",void 0),Ii=a([E({type:x.Choice})],Ii);class ho{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ho.prototype,"policyQualifierId",void 0),a([l({type:h.Any})],ho.prototype,"qualifier",void 0);class Ni{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Ni.prototype,"policyIdentifier",void 0),a([l({type:ho,repeated:"sequence",optional:!0})],Ni.prototype,"policyQualifiers",void 0);let Oi=uo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,uo.prototype)}};Oi=uo=a([E({type:x.Sequence,itemType:Ni})],Oi);let Ti=class{constructor(e=0){this.value=e}};a([l({type:h.Integer})],Ti.prototype,"value",void 0),Ti=a([E({type:x.Choice})],Ti);let yc=class extends Ti{};yc=a([E({type:x.Choice})],yc);var yo,ze;(function(r){r[r.unused=1]="unused",r[r.keyCompromise=2]="keyCompromise",r[r.cACompromise=4]="cACompromise",r[r.affiliationChanged=8]="affiliationChanged",r[r.superseded=16]="superseded",r[r.cessationOfOperation=32]="cessationOfOperation",r[r.certificateHold=64]="certificateHold",r[r.privilegeWithdrawn=128]="privilegeWithdrawn",r[r.aACompromise=256]="aACompromise"})(ze||(ze={}));class gc extends xi{toJSON(){const e=[],t=this.toNumber();return t&ze.aACompromise&&e.push("aACompromise"),t&ze.affiliationChanged&&e.push("affiliationChanged"),t&ze.cACompromise&&e.push("cACompromise"),t&ze.certificateHold&&e.push("certificateHold"),t&ze.cessationOfOperation&&e.push("cessationOfOperation"),t&ze.keyCompromise&&e.push("keyCompromise"),t&ze.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&ze.superseded&&e.push("superseded"),t&ze.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Xt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Q,context:0,repeated:"sequence",implicit:!0})],Xt.prototype,"fullName",void 0),a([l({type:Zt,context:1,implicit:!0})],Xt.prototype,"nameRelativeToCRLIssuer",void 0),Xt=a([E({type:x.Choice})],Xt);class Or{constructor(e={}){Object.assign(this,e)}}a([l({type:Xt,context:0,optional:!0})],Or.prototype,"distributionPoint",void 0),a([l({type:gc,context:1,optional:!0,implicit:!0})],Or.prototype,"reasons",void 0),a([l({type:Q,context:2,optional:!0,repeated:"sequence",implicit:!0})],Or.prototype,"cRLIssuer",void 0);let go=yo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,yo.prototype)}};go=yo=a([E({type:x.Sequence,itemType:Or})],go);var mo;let mc=mo=class extends go{constructor(e){super(e),Object.setPrototypeOf(this,mo.prototype)}};mc=mo=a([E({type:x.Sequence,itemType:Or})],mc);class Ce{constructor(e={}){this.onlyContainsUserCerts=Ce.ONLY,this.onlyContainsCACerts=Ce.ONLY,this.indirectCRL=Ce.ONLY,this.onlyContainsAttributeCerts=Ce.ONLY,Object.assign(this,e)}}Ce.ONLY=!1,a([l({type:Xt,context:0,optional:!0})],Ce.prototype,"distributionPoint",void 0),a([l({type:h.Boolean,context:1,defaultValue:Ce.ONLY,implicit:!0})],Ce.prototype,"onlyContainsUserCerts",void 0),a([l({type:h.Boolean,context:2,defaultValue:Ce.ONLY,implicit:!0})],Ce.prototype,"onlyContainsCACerts",void 0),a([l({type:gc,context:3,optional:!0,implicit:!0})],Ce.prototype,"onlySomeReasons",void 0),a([l({type:h.Boolean,context:4,defaultValue:Ce.ONLY,implicit:!0})],Ce.prototype,"indirectCRL",void 0),a([l({type:h.Boolean,context:5,defaultValue:Ce.ONLY,implicit:!0})],Ce.prototype,"onlyContainsAttributeCerts",void 0);var Tr;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(Tr||(Tr={}));let vo=class{constructor(e=Tr.unspecified){this.reason=Tr.unspecified,this.reason=e}toJSON(){return Tr[this.reason]}toString(){return this.toJSON()}};a([l({type:h.Enumerated})],vo.prototype,"reason",void 0),vo=a([E({type:x.Choice})],vo);var bo;const vc=`${jt}.37`;let Vi=bo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,bo.prototype)}};Vi=bo=a([E({type:x.Sequence,itemType:h.ObjectIdentifier})],Vi);const kf=`${Qt}.1`,xf=`${Qt}.2`,Cf=`${Qt}.3`,Bf=`${Qt}.4`,Ef=`${Qt}.8`,If=`${Qt}.9`;let wo=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:h.Integer,converter:ue})],wo.prototype,"value",void 0),wo=a([E({type:x.Choice})],wo);let So=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:h.GeneralizedTime})],So.prototype,"value",void 0),So=a([E({type:x.Choice})],So);var Ao;let bc=Ao=class extends Ie{constructor(e){super(e),Object.setPrototypeOf(this,Ao.prototype)}};bc=Ao=a([E({type:x.Sequence})],bc);const wc=`${jt}.15`;var We;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(We||(We={}));class ko extends xi{toJSON(){const e=this.toNumber(),t=[];return e&We.cRLSign&&t.push("crlSign"),e&We.dataEncipherment&&t.push("dataEncipherment"),e&We.decipherOnly&&t.push("decipherOnly"),e&We.digitalSignature&&t.push("digitalSignature"),e&We.encipherOnly&&t.push("encipherOnly"),e&We.keyAgreement&&t.push("keyAgreement"),e&We.keyCertSign&&t.push("keyCertSign"),e&We.keyEncipherment&&t.push("keyEncipherment"),e&We.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var xo;class _i{constructor(e={}){this.base=new Q,this.minimum=0,Object.assign(this,e)}}a([l({type:Q})],_i.prototype,"base",void 0),a([l({type:h.Integer,context:0,defaultValue:0,implicit:!0})],_i.prototype,"minimum",void 0),a([l({type:h.Integer,context:1,optional:!0,implicit:!0})],_i.prototype,"maximum",void 0);let ji=xo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,xo.prototype)}};ji=xo=a([E({type:x.Sequence,itemType:_i})],ji);class Sc{constructor(e={}){Object.assign(this,e)}}a([l({type:ji,context:0,optional:!0,implicit:!0})],Sc.prototype,"permittedSubtrees",void 0),a([l({type:ji,context:1,optional:!0,implicit:!0})],Sc.prototype,"excludedSubtrees",void 0);class Ac{constructor(e={}){Object.assign(this,e)}}a([l({type:h.Integer,context:0,implicit:!0,optional:!0,converter:ue})],Ac.prototype,"requireExplicitPolicy",void 0),a([l({type:h.Integer,context:1,implicit:!0,optional:!0,converter:ue})],Ac.prototype,"inhibitPolicyMapping",void 0);var Co;class Bo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Bo.prototype,"issuerDomainPolicy",void 0),a([l({type:h.ObjectIdentifier})],Bo.prototype,"subjectDomainPolicy",void 0);let kc=Co=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Co.prototype)}};kc=Co=a([E({type:x.Sequence,itemType:Bo})],kc);var Eo;const xc=`${jt}.17`;let Io=Eo=class extends Ie{constructor(e){super(e),Object.setPrototypeOf(this,Eo.prototype)}};Io=Eo=a([E({type:x.Sequence})],Io);let ht=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],ht.prototype,"type",void 0),a([l({type:h.Any,repeated:"set"})],ht.prototype,"values",void 0);var No;let Cc=No=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,No.prototype)}};Cc=No=a([E({type:x.Sequence,itemType:ht})],Cc);const Bc=`${jt}.14`;class At extends ao{}class Ec{constructor(e={}){Object.assign(this,e)}}a([l({type:h.GeneralizedTime,context:0,implicit:!0,optional:!0})],Ec.prototype,"notBefore",void 0),a([l({type:h.GeneralizedTime,context:1,implicit:!0,optional:!0})],Ec.prototype,"notAfter",void 0);var Vr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Vr||(Vr={}));class Ic extends xi{toJSON(){const e=[],t=this.toNumber();return t&Vr.pKIXCertificate&&e.push("pKIXCertificate"),t&Vr.newExtensions&&e.push("newExtensions"),t&Vr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class Nc{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Ic,Object.assign(this,e)}}a([l({type:h.GeneralString})],Nc.prototype,"entrustVers",void 0),a([l({type:Ic})],Nc.prototype,"entrustInfoFlags",void 0);var Oo;let Oc=Oo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Oo.prototype)}};Oc=Oo=a([E({type:x.Sequence,itemType:Bi})],Oc);class U{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof U&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&ia(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:h.ObjectIdentifier})],U.prototype,"algorithm",void 0),a([l({type:h.Any,optional:!0})],U.prototype,"parameters",void 0);class yt{constructor(e={}){this.algorithm=new U,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:U})],yt.prototype,"algorithm",void 0),a([l({type:h.BitString})],yt.prototype,"subjectPublicKey",void 0);let ke=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const t=new Date(e);t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};a([l({type:h.UTCTime})],ke.prototype,"utcTime",void 0),a([l({type:h.GeneralizedTime})],ke.prototype,"generalTime",void 0),ke=a([E({type:x.Choice})],ke);class Pi{constructor(e){this.notBefore=new ke(new Date),this.notAfter=new ke(new Date),e&&(this.notBefore=new ke(e.notBefore),this.notAfter=new ke(e.notAfter))}}a([l({type:ke})],Pi.prototype,"notBefore",void 0),a([l({type:ke})],Pi.prototype,"notAfter",void 0);var To;let Je=class Nu{constructor(e={}){this.extnID="",this.critical=Nu.CRITICAL,this.extnValue=new ie,Object.assign(this,e)}};Je.CRITICAL=!1,a([l({type:h.ObjectIdentifier})],Je.prototype,"extnID",void 0),a([l({type:h.Boolean,defaultValue:Je.CRITICAL})],Je.prototype,"critical",void 0),a([l({type:ie})],Je.prototype,"extnValue",void 0);let Dt=To=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,To.prototype)}};Dt=To=a([E({type:x.Sequence,itemType:Je})],Dt);var er;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(er||(er={}));class Fe{constructor(e={}){this.version=er.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new U,this.issuer=new ge,this.validity=new Pi,this.subject=new ge,this.subjectPublicKeyInfo=new yt,Object.assign(this,e)}}a([l({type:h.Integer,context:0,defaultValue:er.v1})],Fe.prototype,"version",void 0),a([l({type:h.Integer,converter:ue})],Fe.prototype,"serialNumber",void 0),a([l({type:U})],Fe.prototype,"signature",void 0),a([l({type:ge})],Fe.prototype,"issuer",void 0),a([l({type:Pi})],Fe.prototype,"validity",void 0),a([l({type:ge})],Fe.prototype,"subject",void 0),a([l({type:yt})],Fe.prototype,"subjectPublicKeyInfo",void 0),a([l({type:h.BitString,context:1,implicit:!0,optional:!0})],Fe.prototype,"issuerUniqueID",void 0),a([l({type:h.BitString,context:2,implicit:!0,optional:!0})],Fe.prototype,"subjectUniqueID",void 0),a([l({type:Dt,context:3,optional:!0})],Fe.prototype,"extensions",void 0);class tr{constructor(e={}){this.tbsCertificate=new Fe,this.signatureAlgorithm=new U,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Fe})],tr.prototype,"tbsCertificate",void 0),a([l({type:U})],tr.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],tr.prototype,"signatureValue",void 0);class Di{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new ke,Object.assign(this,e)}}a([l({type:h.Integer,converter:ue})],Di.prototype,"userCertificate",void 0),a([l({type:ke})],Di.prototype,"revocationDate",void 0),a([l({type:Je,optional:!0,repeated:"sequence"})],Di.prototype,"crlEntryExtensions",void 0);class gt{constructor(e={}){this.signature=new U,this.issuer=new ge,this.thisUpdate=new ke,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],gt.prototype,"version",void 0),a([l({type:U})],gt.prototype,"signature",void 0),a([l({type:ge})],gt.prototype,"issuer",void 0),a([l({type:ke})],gt.prototype,"thisUpdate",void 0),a([l({type:ke,optional:!0})],gt.prototype,"nextUpdate",void 0),a([l({type:Di,repeated:"sequence",optional:!0})],gt.prototype,"revokedCertificates",void 0),a([l({type:Je,optional:!0,context:0,repeated:"sequence"})],gt.prototype,"crlExtensions",void 0);let Vo=class{constructor(e={}){this.tbsCertList=new gt,this.signatureAlgorithm=new U,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:gt})],Vo.prototype,"tbsCertList",void 0),a([l({type:U})],Vo.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Vo.prototype,"signature",void 0);class rr{constructor(e={}){this.issuer=new ge,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:ge})],rr.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ue})],rr.prototype,"serialNumber",void 0);let ir=class{constructor(e={}){Object.assign(this,e)}};a([l({type:At,context:0,implicit:!0})],ir.prototype,"subjectKeyIdentifier",void 0),a([l({type:rr})],ir.prototype,"issuerAndSerialNumber",void 0),ir=a([E({type:x.Choice})],ir);var mt;(function(r){r[r.v0=0]="v0",r[r.v1=1]="v1",r[r.v2=2]="v2",r[r.v3=3]="v3",r[r.v4=4]="v4",r[r.v5=5]="v5"})(mt||(mt={}));let _r=class extends U{};_r=a([E({type:x.Sequence})],_r);let Ri=class extends U{};Ri=a([E({type:x.Sequence})],Ri);let rt=class extends U{};rt=a([E({type:x.Sequence})],rt);let Mi=class extends U{};Mi=a([E({type:x.Sequence})],Mi);let Tc=class extends U{};Tc=a([E({type:x.Sequence})],Tc);let _o=class extends U{};_o=a([E({type:x.Sequence})],_o);let nr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],nr.prototype,"attrType",void 0),a([l({type:h.Any,repeated:"set"})],nr.prototype,"attrValues",void 0);var jo;class it{constructor(e={}){this.version=mt.v0,this.sid=new ir,this.digestAlgorithm=new _r,this.signatureAlgorithm=new Ri,this.signature=new ie,Object.assign(this,e)}}a([l({type:h.Integer})],it.prototype,"version",void 0),a([l({type:ir})],it.prototype,"sid",void 0),a([l({type:_r})],it.prototype,"digestAlgorithm",void 0),a([l({type:nr,repeated:"set",context:0,implicit:!0,optional:!0})],it.prototype,"signedAttrs",void 0),a([l({type:Ri})],it.prototype,"signatureAlgorithm",void 0),a([l({type:ie})],it.prototype,"signature",void 0),a([l({type:nr,repeated:"set",context:1,implicit:!0,optional:!0})],it.prototype,"unsignedAttrs",void 0);let $i=jo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,jo.prototype)}};$i=jo=a([E({type:x.Set,itemType:it})],$i);let Vc=class extends ke{};Vc=a([E({type:x.Choice})],Vc);let _c=class extends it{};_c=a([E({type:x.Sequence})],_c);class Po{constructor(e={}){this.acIssuer=new Q,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:Q})],Po.prototype,"acIssuer",void 0),a([l({type:h.Integer})],Po.prototype,"acSerial",void 0),a([l({type:ht,repeated:"sequence"})],Po.prototype,"attrs",void 0);var Do;let Ui=Do=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Do.prototype)}};Ui=Do=a([E({type:x.Sequence,itemType:h.ObjectIdentifier})],Ui);class Hi{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:h.Integer,optional:!0})],Hi.prototype,"pathLenConstraint",void 0),a([l({type:Ui,implicit:!0,context:0,optional:!0})],Hi.prototype,"permittedAttrs",void 0),a([l({type:Ui,implicit:!0,context:1,optional:!0})],Hi.prototype,"excludedAttrs",void 0),a([l({type:h.Boolean,defaultValue:!0})],Hi.prototype,"permitUnSpecified",void 0);class Rt{constructor(e={}){this.issuer=new Ie,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ie})],Rt.prototype,"issuer",void 0),a([l({type:h.Integer,converter:ue})],Rt.prototype,"serial",void 0),a([l({type:h.BitString,optional:!0})],Rt.prototype,"issuerUID",void 0);var Ro;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(Ro||(Ro={}));class Mt{constructor(e={}){this.digestedObjectType=Ro.publicKey,this.digestAlgorithm=new U,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Enumerated})],Mt.prototype,"digestedObjectType",void 0),a([l({type:h.ObjectIdentifier,optional:!0})],Mt.prototype,"otherObjectTypeID",void 0),a([l({type:U})],Mt.prototype,"digestAlgorithm",void 0),a([l({type:h.BitString})],Mt.prototype,"objectDigest",void 0);class Li{constructor(e={}){Object.assign(this,e)}}a([l({type:Ie,optional:!0})],Li.prototype,"issuerName",void 0),a([l({type:Rt,context:0,implicit:!0,optional:!0})],Li.prototype,"baseCertificateID",void 0),a([l({type:Mt,context:1,implicit:!0,optional:!0})],Li.prototype,"objectDigestInfo",void 0);let or=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Q,repeated:"sequence"})],or.prototype,"v1Form",void 0),a([l({type:Li,context:0,implicit:!0})],or.prototype,"v2Form",void 0),or=a([E({type:x.Choice})],or);class Fi{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:h.GeneralizedTime})],Fi.prototype,"notBeforeTime",void 0),a([l({type:h.GeneralizedTime})],Fi.prototype,"notAfterTime",void 0);class jr{constructor(e={}){Object.assign(this,e)}}a([l({type:Rt,implicit:!0,context:0,optional:!0})],jr.prototype,"baseCertificateID",void 0),a([l({type:Ie,implicit:!0,context:1,optional:!0})],jr.prototype,"entityName",void 0),a([l({type:Mt,implicit:!0,context:2,optional:!0})],jr.prototype,"objectDigestInfo",void 0);var Mo;(function(r){r[r.v2=1]="v2"})(Mo||(Mo={}));class Ye{constructor(e={}){this.version=Mo.v2,this.holder=new jr,this.issuer=new or,this.signature=new U,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Fi,this.attributes=[],Object.assign(this,e)}}a([l({type:h.Integer})],Ye.prototype,"version",void 0),a([l({type:jr})],Ye.prototype,"holder",void 0),a([l({type:or})],Ye.prototype,"issuer",void 0),a([l({type:U})],Ye.prototype,"signature",void 0),a([l({type:h.Integer,converter:ue})],Ye.prototype,"serialNumber",void 0),a([l({type:Fi})],Ye.prototype,"attrCertValidityPeriod",void 0),a([l({type:ht,repeated:"sequence"})],Ye.prototype,"attributes",void 0),a([l({type:h.BitString,optional:!0})],Ye.prototype,"issuerUniqueID",void 0),a([l({type:Dt,optional:!0})],Ye.prototype,"extensions",void 0);class Ki{constructor(e={}){this.acinfo=new Ye,this.signatureAlgorithm=new U,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ye})],Ki.prototype,"acinfo",void 0),a([l({type:U})],Ki.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Ki.prototype,"signatureValue",void 0);var qi;(function(r){r[r.unmarked=1]="unmarked",r[r.unclassified=2]="unclassified",r[r.restricted=4]="restricted",r[r.confidential=8]="confidential",r[r.secret=16]="secret",r[r.topSecret=32]="topSecret"})(qi||(qi={}));class $o extends xi{}class Uo{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier,implicit:!0,context:0})],Uo.prototype,"type",void 0),a([l({type:h.Any,implicit:!0,context:1})],Uo.prototype,"value",void 0);class Ho{constructor(e={}){this.policyId="",this.classList=new $o(qi.unclassified),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Ho.prototype,"policyId",void 0),a([l({type:$o,defaultValue:new $o(qi.unclassified)})],Ho.prototype,"classList",void 0),a([l({type:Uo,repeated:"set"})],Ho.prototype,"securityCategories",void 0);class Gi{constructor(e={}){Object.assign(this,e)}}a([l({type:ie})],Gi.prototype,"cotets",void 0),a([l({type:h.ObjectIdentifier})],Gi.prototype,"oid",void 0),a([l({type:h.Utf8String})],Gi.prototype,"string",void 0);class jc{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Ie,implicit:!0,context:0,optional:!0})],jc.prototype,"policyAuthority",void 0),a([l({type:Gi,repeated:"sequence"})],jc.prototype,"values",void 0);var Lo;class zi{constructor(e={}){this.targetCertificate=new Rt,Object.assign(this,e)}}a([l({type:Rt})],zi.prototype,"targetCertificate",void 0),a([l({type:Q,optional:!0})],zi.prototype,"targetName",void 0),a([l({type:Mt,optional:!0})],zi.prototype,"certDigestInfo",void 0);let sr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Q,context:0,implicit:!0})],sr.prototype,"targetName",void 0),a([l({type:Q,context:1,implicit:!0})],sr.prototype,"targetGroup",void 0),a([l({type:zi,context:2,implicit:!0})],sr.prototype,"targetCert",void 0),sr=a([E({type:x.Choice})],sr);let Fo=Lo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Lo.prototype)}};Fo=Lo=a([E({type:x.Sequence,itemType:sr})],Fo);var Ko;let Pc=Ko=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};Pc=Ko=a([E({type:x.Sequence,itemType:Fo})],Pc);class Dc{constructor(e={}){Object.assign(this,e)}}a([l({type:Ie,implicit:!0,context:0,optional:!0})],Dc.prototype,"roleAuthority",void 0),a([l({type:Q,implicit:!0,context:1})],Dc.prototype,"roleName",void 0);class qo{constructor(e={}){this.service=new Q,this.ident=new Q,Object.assign(this,e)}}a([l({type:Q})],qo.prototype,"service",void 0),a([l({type:Q})],qo.prototype,"ident",void 0),a([l({type:ie,optional:!0})],qo.prototype,"authInfo",void 0);var Go;class zo{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],zo.prototype,"otherCertFormat",void 0),a([l({type:h.Any})],zo.prototype,"otherCert",void 0);let ar=class{constructor(e={}){Object.assign(this,e)}};a([l({type:tr})],ar.prototype,"certificate",void 0),a([l({type:Ki,context:2,implicit:!0})],ar.prototype,"v2AttrCert",void 0),a([l({type:zo,context:3,implicit:!0})],ar.prototype,"other",void 0),ar=a([E({type:x.Choice})],ar);let Wi=Go=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Go.prototype)}};Wi=Go=a([E({type:x.Set,itemType:ar})],Wi);class cr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],cr.prototype,"contentType",void 0),a([l({type:h.Any,context:0})],cr.prototype,"content",void 0);let Pr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ie})],Pr.prototype,"single",void 0),a([l({type:h.Any})],Pr.prototype,"any",void 0),Pr=a([E({type:x.Choice})],Pr);class Ji{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Ji.prototype,"eContentType",void 0),a([l({type:Pr,context:0,optional:!0})],Ji.prototype,"eContent",void 0);let Dr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ie,context:0,implicit:!0,optional:!0})],Dr.prototype,"value",void 0),a([l({type:ie,converter:nf,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Dr.prototype,"constructedValue",void 0),Dr=a([E({type:x.Choice})],Dr);class Rr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Mi,Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Rr.prototype,"contentType",void 0),a([l({type:Mi})],Rr.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:Dr,optional:!0})],Rr.prototype,"encryptedContent",void 0);class Yi{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Yi.prototype,"keyAttrId",void 0),a([l({type:h.Any,optional:!0})],Yi.prototype,"keyAttr",void 0);var Wo;class Zi{constructor(e={}){this.subjectKeyIdentifier=new At,Object.assign(this,e)}}a([l({type:At})],Zi.prototype,"subjectKeyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],Zi.prototype,"date",void 0),a([l({type:Yi,optional:!0})],Zi.prototype,"other",void 0);let lr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Zi,context:0,implicit:!0,optional:!0})],lr.prototype,"rKeyId",void 0),a([l({type:rr,optional:!0})],lr.prototype,"issuerAndSerialNumber",void 0),lr=a([E({type:x.Choice})],lr);class Jo{constructor(e={}){this.rid=new lr,this.encryptedKey=new ie,Object.assign(this,e)}}a([l({type:lr})],Jo.prototype,"rid",void 0),a([l({type:ie})],Jo.prototype,"encryptedKey",void 0);let Qi=Wo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Wo.prototype)}};Qi=Wo=a([E({type:x.Sequence,itemType:Jo})],Qi);class Yo{constructor(e={}){this.algorithm=new U,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:U})],Yo.prototype,"algorithm",void 0),a([l({type:h.BitString})],Yo.prototype,"publicKey",void 0);let $t=class{constructor(e={}){Object.assign(this,e)}};a([l({type:At,context:0,implicit:!0,optional:!0})],$t.prototype,"subjectKeyIdentifier",void 0),a([l({type:Yo,context:1,implicit:!0,optional:!0})],$t.prototype,"originatorKey",void 0),a([l({type:rr,optional:!0})],$t.prototype,"issuerAndSerialNumber",void 0),$t=a([E({type:x.Choice})],$t);class ur{constructor(e={}){this.version=mt.v3,this.originator=new $t,this.keyEncryptionAlgorithm=new rt,this.recipientEncryptedKeys=new Qi,Object.assign(this,e)}}a([l({type:h.Integer})],ur.prototype,"version",void 0),a([l({type:$t,context:0})],ur.prototype,"originator",void 0),a([l({type:ie,context:1,optional:!0})],ur.prototype,"ukm",void 0),a([l({type:rt})],ur.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Qi})],ur.prototype,"recipientEncryptedKeys",void 0);let fr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:At,context:0,implicit:!0})],fr.prototype,"subjectKeyIdentifier",void 0),a([l({type:rr})],fr.prototype,"issuerAndSerialNumber",void 0),fr=a([E({type:x.Choice})],fr);class Mr{constructor(e={}){this.version=mt.v0,this.rid=new fr,this.keyEncryptionAlgorithm=new rt,this.encryptedKey=new ie,Object.assign(this,e)}}a([l({type:h.Integer})],Mr.prototype,"version",void 0),a([l({type:fr})],Mr.prototype,"rid",void 0),a([l({type:rt})],Mr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:ie})],Mr.prototype,"encryptedKey",void 0);class $r{constructor(e={}){this.keyIdentifier=new ie,Object.assign(this,e)}}a([l({type:ie})],$r.prototype,"keyIdentifier",void 0),a([l({type:h.GeneralizedTime,optional:!0})],$r.prototype,"date",void 0),a([l({type:Yi,optional:!0})],$r.prototype,"other",void 0);class Ur{constructor(e={}){this.version=mt.v4,this.kekid=new $r,this.keyEncryptionAlgorithm=new rt,this.encryptedKey=new ie,Object.assign(this,e)}}a([l({type:h.Integer})],Ur.prototype,"version",void 0),a([l({type:$r})],Ur.prototype,"kekid",void 0),a([l({type:rt})],Ur.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:ie})],Ur.prototype,"encryptedKey",void 0);class Hr{constructor(e={}){this.version=mt.v0,this.keyEncryptionAlgorithm=new rt,this.encryptedKey=new ie,Object.assign(this,e)}}a([l({type:h.Integer})],Hr.prototype,"version",void 0),a([l({type:_o,context:0,optional:!0})],Hr.prototype,"keyDerivationAlgorithm",void 0),a([l({type:rt})],Hr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:ie})],Hr.prototype,"encryptedKey",void 0);class Zo{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],Zo.prototype,"oriType",void 0),a([l({type:h.Any})],Zo.prototype,"oriValue",void 0);let kt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Mr,optional:!0})],kt.prototype,"ktri",void 0),a([l({type:ur,context:1,implicit:!0,optional:!0})],kt.prototype,"kari",void 0),a([l({type:Ur,context:2,implicit:!0,optional:!0})],kt.prototype,"kekri",void 0),a([l({type:Hr,context:3,implicit:!0,optional:!0})],kt.prototype,"pwri",void 0),a([l({type:Zo,context:4,implicit:!0,optional:!0})],kt.prototype,"ori",void 0),kt=a([E({type:x.Choice})],kt);var Qo;let Xi=Qo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Xi=Qo=a([E({type:x.Set,itemType:kt})],Xi);var Xo;class en{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],en.prototype,"otherRevInfoFormat",void 0),a([l({type:h.Any})],en.prototype,"otherRevInfo",void 0);let Lr=class{constructor(e={}){this.other=new en,Object.assign(this,e)}};a([l({type:en,context:1,implicit:!0})],Lr.prototype,"other",void 0),Lr=a([E({type:x.Choice})],Lr);let es=Xo=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Xo.prototype)}};es=Xo=a([E({type:x.Set,itemType:Lr})],es);class ts{constructor(e={}){Object.assign(this,e)}}a([l({type:Wi,context:0,implicit:!0,optional:!0})],ts.prototype,"certs",void 0),a([l({type:es,context:1,implicit:!0,optional:!0})],ts.prototype,"crls",void 0);var rs;let is=rs=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,rs.prototype)}};is=rs=a([E({type:x.Set,itemType:nr})],is);class Fr{constructor(e={}){this.version=mt.v0,this.recipientInfos=new Xi,this.encryptedContentInfo=new Rr,Object.assign(this,e)}}a([l({type:h.Integer})],Fr.prototype,"version",void 0),a([l({type:ts,context:0,implicit:!0,optional:!0})],Fr.prototype,"originatorInfo",void 0),a([l({type:Xi})],Fr.prototype,"recipientInfos",void 0),a([l({type:Rr})],Fr.prototype,"encryptedContentInfo",void 0),a([l({type:is,context:1,implicit:!0,optional:!0})],Fr.prototype,"unprotectedAttrs",void 0);const Nf="1.2.840.113549.1.7.2";var ns;let tn=ns=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,ns.prototype)}};tn=ns=a([E({type:x.Set,itemType:_r})],tn);class dr{constructor(e={}){this.version=mt.v0,this.digestAlgorithms=new tn,this.encapContentInfo=new Ji,this.signerInfos=new $i,Object.assign(this,e)}}a([l({type:h.Integer})],dr.prototype,"version",void 0),a([l({type:tn})],dr.prototype,"digestAlgorithms",void 0),a([l({type:Ji})],dr.prototype,"encapContentInfo",void 0),a([l({type:Wi,context:0,implicit:!0,optional:!0})],dr.prototype,"certificates",void 0),a([l({type:Lr,context:1,implicit:!0,optional:!0})],dr.prototype,"crls",void 0),a([l({type:$i})],dr.prototype,"signerInfos",void 0);const Kr="1.2.840.10045.2.1",os="1.2.840.10045.4.1",Rc="1.2.840.10045.4.3.1",ss="1.2.840.10045.4.3.2",as="1.2.840.10045.4.3.3",cs="1.2.840.10045.4.3.4",Mc="1.2.840.10045.3.1.7",$c="1.3.132.0.34",Uc="1.3.132.0.35";function qr(r){return new U({algorithm:r})}const Of=qr(os);qr(Rc);const Tf=qr(ss),Vf=qr(as),_f=qr(cs);let pr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:h.ObjectIdentifier})],pr.prototype,"namedCurve",void 0),pr=a([E({type:x.Choice})],pr);class rn{constructor(e={}){this.version=1,this.privateKey=new ie,Object.assign(this,e)}}a([l({type:h.Integer})],rn.prototype,"version",void 0),a([l({type:ie})],rn.prototype,"privateKey",void 0),a([l({type:pr,context:0,optional:!0})],rn.prototype,"parameters",void 0),a([l({type:h.BitString,context:1,optional:!0})],rn.prototype,"publicKey",void 0);class nn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ue})],nn.prototype,"r",void 0),a([l({type:h.Integer,converter:ue})],nn.prototype,"s",void 0);const Ve="1.2.840.113549.1.1",hr=`${Ve}.1`,jf=`${Ve}.7`,Pf=`${Ve}.9`,Df=`${Ve}.10`,Rf=`${Ve}.2`,Mf=`${Ve}.4`,on=`${Ve}.5`,$f=`${Ve}.14`,ls=`${Ve}.11`,sn=`${Ve}.12`,an=`${Ve}.13`,Hc=`${Ve}.15`,Lc=`${Ve}.16`,Fc="1.3.14.3.2.26",Kc="2.16.840.1.101.3.4.2.4",qc="2.16.840.1.101.3.4.2.1",Gc="2.16.840.1.101.3.4.2.2",zc="2.16.840.1.101.3.4.2.3",Uf="2.16.840.1.101.3.4.2.5",Hf="2.16.840.1.101.3.4.2.6",Lf="1.2.840.113549.2.2",Ff="1.2.840.113549.2.5",us=`${Ve}.8`;function me(r){return new U({algorithm:r,parameters:null})}me(Lf),me(Ff);const Ut=me(Fc);me(Kc),me(qc),me(Gc),me(zc),me(Uf),me(Hf);const Wc=new U({algorithm:us,parameters:F.serialize(Ut)}),Jc=new U({algorithm:Pf,parameters:F.serialize(Ci.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});me(hr),me(Rf),me(Mf),me(on),me(Hc),me(Lc),me(sn),me(an),me(Hc),me(Lc);class cn{constructor(e={}){this.hashAlgorithm=new U(Ut),this.maskGenAlgorithm=new U({algorithm:us,parameters:F.serialize(Ut)}),this.pSourceAlgorithm=new U(Jc),Object.assign(this,e)}}a([l({type:U,context:0,defaultValue:Ut})],cn.prototype,"hashAlgorithm",void 0),a([l({type:U,context:1,defaultValue:Wc})],cn.prototype,"maskGenAlgorithm",void 0),a([l({type:U,context:2,defaultValue:Jc})],cn.prototype,"pSourceAlgorithm",void 0),new U({algorithm:jf,parameters:F.serialize(new cn)});class Gr{constructor(e={}){this.hashAlgorithm=new U(Ut),this.maskGenAlgorithm=new U({algorithm:us,parameters:F.serialize(Ut)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:U,context:0,defaultValue:Ut})],Gr.prototype,"hashAlgorithm",void 0),a([l({type:U,context:1,defaultValue:Wc})],Gr.prototype,"maskGenAlgorithm",void 0),a([l({type:h.Integer,context:2,defaultValue:20})],Gr.prototype,"saltLength",void 0),a([l({type:h.Integer,context:3,defaultValue:1})],Gr.prototype,"trailerField",void 0),new U({algorithm:Df,parameters:F.serialize(new Gr)});class ln{constructor(e={}){this.digestAlgorithm=new U,this.digest=new ie,Object.assign(this,e)}}a([l({type:U})],ln.prototype,"digestAlgorithm",void 0),a([l({type:ie})],ln.prototype,"digest",void 0);var fs;class un{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ue})],un.prototype,"prime",void 0),a([l({type:h.Integer,converter:ue})],un.prototype,"exponent",void 0),a([l({type:h.Integer,converter:ue})],un.prototype,"coefficient",void 0);let ds=fs=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,fs.prototype)}};ds=fs=a([E({type:x.Sequence,itemType:un})],ds);class nt{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer})],nt.prototype,"version",void 0),a([l({type:h.Integer,converter:ue})],nt.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ue})],nt.prototype,"publicExponent",void 0),a([l({type:h.Integer,converter:ue})],nt.prototype,"privateExponent",void 0),a([l({type:h.Integer,converter:ue})],nt.prototype,"prime1",void 0),a([l({type:h.Integer,converter:ue})],nt.prototype,"prime2",void 0),a([l({type:h.Integer,converter:ue})],nt.prototype,"exponent1",void 0),a([l({type:h.Integer,converter:ue})],nt.prototype,"exponent2",void 0),a([l({type:h.Integer,converter:ue})],nt.prototype,"coefficient",void 0),a([l({type:ds,optional:!0})],nt.prototype,"otherPrimeInfos",void 0);class ps{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.Integer,converter:ue})],ps.prototype,"modulus",void 0),a([l({type:h.Integer,converter:ue})],ps.prototype,"publicExponent",void 0);var hs;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(hs||(hs={}));const _e=hs;/*! *****************************************************************************
|
|
76
|
+
Copyright (c) Microsoft Corporation.
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
79
|
+
purpose with or without fee is hereby granted.
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
`).map(function(
|
|
90
|
-
`)}function Jh(e,t,r){var n=zn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=n[1],s=o===void 0?null:o,a=Gh(s,t);return Wh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function Yh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Zh=function(e){ca(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(da),Qh=function(e){ca(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(da),Xh=function(){function e(){this.preResolution=new Zh,this.postResolution=new Qh}return e}(),du=new Map,ey=function(){function e(t){this.parent=t,this._registry=new zh,this.interceptors=new Xh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,n){n===void 0&&(n={lifecycle:Ke.Transient}),this.ensureNotDisposed();var o;if(Kh(r)?o=r:o={useClass:r},Gn(o))for(var s=[t],a=o;a!=null;){var l=a.useToken;if(s.includes(l))throw new Error("Token registration cycle detected! "+ar(s,[l]).join(" -> "));s.push(l);var c=this._registry.get(l);c&&Gn(c.provider)?a=c.provider:a=null}if((n.lifecycle===Ke.Singleton||n.lifecycle==Ke.ContainerScoped||n.lifecycle==Ke.ResolutionScoped)&&(Wn(o)||ua(o)))throw new Error('Cannot use lifecycle "'+Ke[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:n}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),Mr(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(),Mr(t)){if(Mr(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 n=t;return r&&!Mr(r)&&(n=r),this.register(t,{useClass:n},{lifecycle:Ke.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new uu),this.ensureNotDisposed();var n=this.getRegistration(t);if(!n&&Mr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),n){var o=this.resolveRegistration(n,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}if(qh(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 n,o;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Kn(this.interceptors.preResolution.getAll(t)),l=a.next();!l.done;l=a.next()){var c=l.value;c.options.frequency!="Once"&&s.push(c),c.callback(t,r)}}catch(d){n={error:d}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,n){var o,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var l=Kn(this.interceptors.postResolution.getAll(t)),c=l.next();!c.done;c=l.next()){var d=c.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,n)}}catch(y){o={error:y}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}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 n=t.options.lifecycle===Ke.Singleton,o=t.options.lifecycle===Ke.ContainerScoped,s=n||o,a;return Wn(t.provider)?a=t.provider.useValue:Gn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):au(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):ua(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 n=this;r===void 0&&(r=new uu),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&Mr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(l){return n.resolveRegistration(l,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 n=Kn(this._registry.entries()),o=n.next();!o.done;o=n.next()){var s=zn(o.value,2),a=s[0],l=s[1];this._registry.setAll(a,l.filter(function(c){return!Wn(c.provider)}).map(function(c){return c.instance=void 0,c}))}}catch(c){t={error:c}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var n=new e(this);try{for(var o=Kn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=zn(s.value,2),l=a[0],c=a[1];c.some(function(d){var y=d.options;return y.lifecycle===Ke.ContainerScoped})&&n._registry.setAll(l,c.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 n},e.prototype.beforeResolution=function(t,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:n})},e.prototype.afterResolution=function(t,r,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:n})},e.prototype.dispose=function(){return Ph(this,void 0,void 0,function(){var t;return Uh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(n){var o=n.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 n=this;if(t instanceof lu)return t.createProxy(function(s){return n.resolve(s,r)});var o=function(){var s=du.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(n.resolveParams(r,t));return new(t.bind.apply(t,ar([void 0],a)))}();return Yh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var n=this;return function(o,s){var a,l,c;try{return Hh(o)?cu(o)?o.multiple?(a=n.resolve(o.transform)).transform.apply(a,ar([n.resolveAll(o.token)],o.transformArgs)):(l=n.resolve(o.transform)).transform.apply(l,ar([n.resolve(o.token,t)],o.transformArgs)):o.multiple?n.resolveAll(o.token):n.resolve(o.token,t):cu(o)?(c=n.resolve(o.transform,t)).transform.apply(c,ar([n.resolve(o.token,t)],o.transformArgs)):n.resolve(o,t)}catch(d){throw new Error(Jh(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}(),it=new ey;function fa(){return function(e){du.set(e,Fh(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 pa;class Jn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([p({type:w.ObjectIdentifier})],Jn.prototype,"attrId",void 0),u([p({type:w.Any,repeated:"set"})],Jn.prototype,"attrValues",void 0);let fu=pa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,pa.prototype)}};fu=pa=u([j({type:_.Sequence,itemType:Jn})],fu);var ha;let pu=ha=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ha.prototype)}};pu=ha=u([j({type:_.Sequence,itemType:Or})],pu);class hu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],hu.prototype,"certId",void 0),u([p({type:w.Any,context:0})],hu.prototype,"certValue",void 0);class yu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],yu.prototype,"crlId",void 0),u([p({type:w.Any,context:0})],yu.prototype,"crltValue",void 0);class gu extends le{}let Yn=class{constructor(t={}){this.encryptionAlgorithm=new q,this.encryptedData=new gu,Object.assign(this,t)}};u([p({type:q})],Yn.prototype,"encryptionAlgorithm",void 0),u([p({type:gu})],Yn.prototype,"encryptedData",void 0);var ya,ga;(function(e){e[e.v1=0]="v1"})(ga||(ga={}));class mu extends le{}let ma=ya=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ya.prototype)}};ma=ya=u([j({type:_.Sequence,itemType:Nt})],ma);class ki{constructor(t={}){this.version=ga.v1,this.privateKeyAlgorithm=new q,this.privateKey=new mu,Object.assign(this,t)}}u([p({type:w.Integer})],ki.prototype,"version",void 0),u([p({type:q})],ki.prototype,"privateKeyAlgorithm",void 0),u([p({type:mu})],ki.prototype,"privateKey",void 0),u([p({type:ma,implicit:!0,context:0,optional:!0})],ki.prototype,"attributes",void 0);let bu=class extends ki{};bu=u([j({type:_.Sequence})],bu);let wu=class extends Yn{};wu=u([j({type:_.Sequence})],wu);class vu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],vu.prototype,"secretTypeId",void 0),u([p({type:w.Any,context:0})],vu.prototype,"secretValue",void 0);class Ci{constructor(t={}){this.mac=new Hn,this.macSalt=new le,this.iterations=1,Object.assign(this,t)}}u([p({type:Hn})],Ci.prototype,"mac",void 0),u([p({type:le})],Ci.prototype,"macSalt",void 0),u([p({type:w.Integer,defaultValue:1})],Ci.prototype,"iterations",void 0);class Zn{constructor(t={}){this.version=3,this.authSafe=new Or,this.macData=new Ci,Object.assign(this,t)}}u([p({type:w.Integer})],Zn.prototype,"version",void 0),u([p({type:Or})],Zn.prototype,"authSafe",void 0),u([p({type:Ci,optional:!0})],Zn.prototype,"macData",void 0);var ba;class Qn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:w.ObjectIdentifier})],Qn.prototype,"bagId",void 0),u([p({type:w.Any,context:0})],Qn.prototype,"bagValue",void 0),u([p({type:Jn,repeated:"set",optional:!0})],Qn.prototype,"bagAttributes",void 0);let ku=ba=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ba.prototype)}};ku=ba=u([j({type:_.Sequence,itemType:Qn})],ku);var wa,va,ka;const Cu="1.2.840.113549.1.9",Su=`${Cu}.7`,Ca=`${Cu}.14`;let Xn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([p({type:w.IA5String})],Xn.prototype,"ia5String",void 0),Xn=u([j({type:_.Choice})],Xn);let xu=class extends Or{};xu=u([j({type:_.Sequence})],xu);let Au=class extends Zn{};Au=u([j({type:_.Sequence})],Au);let Bu=class extends Yn{};Bu=u([j({type:_.Sequence})],Bu);let Sa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([p({type:w.IA5String})],Sa.prototype,"value",void 0),Sa=u([j({type:_.Choice})],Sa);let Iu=class extends Xn{};Iu=u([j({type:_.Choice})],Iu);let Eu=class extends Oe{};Eu=u([j({type:_.Choice})],Eu);let xa=class{constructor(t=new Date){this.value=t}};u([p({type:w.GeneralizedTime})],xa.prototype,"value",void 0),xa=u([j({type:_.Choice})],xa);let Nu=class extends Oe{};Nu=u([j({type:_.Choice})],Nu);let Aa=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([p({type:w.PrintableString})],Aa.prototype,"value",void 0),Aa=u([j({type:_.Choice})],Aa);let eo=class{constructor(t=""){this.value=t}toString(){return this.value}};u([p({type:w.PrintableString})],eo.prototype,"value",void 0),eo=u([j({type:_.Choice})],eo);let Ou=class extends eo{};Ou=u([j({type:_.Choice})],Ou);let Vu=class extends Oe{};Vu=u([j({type:_.Choice})],Vu);let Ba=class{constructor(t=""){this.value=t}toString(){return this.value}};u([p({type:w.ObjectIdentifier})],Ba.prototype,"value",void 0),Ba=u([j({type:_.Choice})],Ba);let _u=class extends Ve{};_u=u([j({type:_.Choice})],_u);let Ia=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([p({type:w.Integer})],Ia.prototype,"value",void 0),Ia=u([j({type:_.Choice})],Ia);let Tu=class extends mt{};Tu=u([j({type:_.Sequence})],Tu);let to=class extends Oe{};to=u([j({type:_.Choice})],to);let ju=wa=class extends rr{constructor(t){super(t),Object.setPrototypeOf(this,wa.prototype)}};ju=wa=u([j({type:_.Sequence})],ju);let $u=va=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,va.prototype)}};$u=va=u([j({type:_.Set,itemType:Br})],$u);let Ea=class{constructor(t=""){this.value=t}toString(){return this.value}};u([p({type:w.BmpString})],Ea.prototype,"value",void 0),Ea=u([j({type:_.Choice})],Ea);let Na=class extends q{};Na=u([j({type:_.Sequence})],Na);let Du=ka=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ka.prototype)}};Du=ka=u([j({type:_.Sequence,itemType:Na})],Du);var Oa;let ro=Oa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Oa.prototype)}};ro=Oa=u([j({type:_.Sequence,itemType:Nt})],ro);class Rr{constructor(t={}){this.version=0,this.subject=new ke,this.subjectPKInfo=new Ot,this.attributes=new ro,Object.assign(this,t)}}u([p({type:w.Integer})],Rr.prototype,"version",void 0),u([p({type:ke})],Rr.prototype,"subject",void 0),u([p({type:Ot})],Rr.prototype,"subjectPKInfo",void 0),u([p({type:ro,implicit:!0,context:0})],Rr.prototype,"attributes",void 0);class Si{constructor(t={}){this.certificationRequestInfo=new Rr,this.signatureAlgorithm=new q,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([p({type:Rr})],Si.prototype,"certificationRequestInfo",void 0),u([p({type:q})],Si.prototype,"signatureAlgorithm",void 0),u([p({type:w.BitString})],Si.prototype,"signature",void 0);/*!
|
|
81
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
82
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
83
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
84
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
85
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
+
***************************************************************************** */var ys=function(r,e){return ys=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},ys(r,e)};function gs(r,e){ys(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Kf(r,e,t,i){function n(s){return s instanceof t?s:new t(function(c){c(s)})}return new(t||(t=Promise))(function(s,c){function u(v){try{d(i.next(v))}catch(y){c(y)}}function f(v){try{d(i.throw(v))}catch(y){c(y)}}function d(v){v.done?s(v.value):n(v.value).then(u,f)}d((i=i.apply(r,e||[])).next())})}function qf(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(d){return function(v){return f([d,v])}}function f(d){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,n=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){t.label=d[1];break}if(d[0]===6&&t.label<s[1]){t.label=s[1],s=d;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(d);break}s[2]&&t.ops.pop(),t.trys.pop();continue}d=e.call(r,t)}catch(v){d=[6,v],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function fn(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function dn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],c;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){c={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}return s}function Ht(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(dn(arguments[e]));return r}var Gf="injectionTokens";function zf(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(Gf,r)||{};return Object.keys(t).forEach(function(i){e[+i]=t[i]}),e}function Yc(r){return!!r.useClass}function ms(r){return!!r.useFactory}var Zc=function(){function r(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return r.prototype.createProxy=function(e){var t=this,i={},n=!1,s,c=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(i,this.createHandler(c))},r.prototype.createHandler=function(e){var t={},i=function(n){t[n]=function(){for(var s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];s[0]=e();var u=Reflect[n];return u.apply(void 0,Ht(s))}};return this.reflectMethods.forEach(i),t},r}();function yr(r){return typeof r=="string"||typeof r=="symbol"}function Wf(r){return typeof r=="object"&&"token"in r&&"multiple"in r}function Qc(r){return typeof r=="object"&&"token"in r&&"transform"in r}function Jf(r){return typeof r=="function"||r instanceof Zc}function pn(r){return!!r.useToken}function hn(r){return r.useValue!=null}function Yf(r){return Yc(r)||hn(r)||pn(r)||ms(r)}var vs=function(){function r(){this._registryMap=new Map}return r.prototype.entries=function(){return this._registryMap.entries()},r.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},r.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},r.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},r.prototype.setAll=function(e,t){this._registryMap.set(e,t)},r.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},r.prototype.clear=function(){this._registryMap.clear()},r.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},r}(),Zf=function(r){gs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(vs),Xc=function(){function r(){this.scopedResolutions=new Map}return r}();function Qf(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}function Xf(r,e,t){return t===void 0&&(t=" "),Ht([r],e.message.split(`
|
|
89
|
+
`).map(function(i){return t+i})).join(`
|
|
90
|
+
`)}function ed(r,e,t){var i=dn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,c=Qf(s,e);return Xf("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function td(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var rd=function(r){gs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(vs),id=function(r){gs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(vs),nd=function(){function r(){this.preResolution=new rd,this.postResolution=new id}return r}(),el=new Map,od=function(){function r(e){this.parent=e,this._registry=new Zf,this.interceptors=new nd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:_e.Transient}),this.ensureNotDisposed();var n;if(Yf(t)?n=t:n={useClass:t},pn(n))for(var s=[e],c=n;c!=null;){var u=c.useToken;if(s.includes(u))throw new Error("Token registration cycle detected! "+Ht(s,[u]).join(" -> "));s.push(u);var f=this._registry.get(u);f&&pn(f.provider)?c=f.provider:c=null}if((i.lifecycle===_e.Singleton||i.lifecycle==_e.ContainerScoped||i.lifecycle==_e.ResolutionScoped)&&(hn(n)||ms(n)))throw new Error('Cannot use lifecycle "'+_e[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:i}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),yr(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},r.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},r.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),yr(e)){if(yr(t))return this.register(e,{useToken:t},{lifecycle:_e.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:_e.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!yr(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:_e.Singleton})},r.prototype.resolve=function(e,t){t===void 0&&(t=new Xc),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&yr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),i){var n=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}if(Jf(e)){var n=this.construct(e,t);return this.executePostResolutionInterceptor(e,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var i,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var c=fn(this.interceptors.preResolution.getAll(e)),u=c.next();!u.done;u=c.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(d){i={error:d}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(e,s)}},r.prototype.executePostResolutionInterceptor=function(e,t,i){var n,s;if(this.interceptors.postResolution.has(e)){var c=[];try{for(var u=fn(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var d=f.value;d.options.frequency!="Once"&&c.push(d),d.callback(e,t,i)}}catch(v){n={error:v}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,c)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===_e.Singleton,n=e.options.lifecycle===_e.ContainerScoped,s=i||n,c;return hn(e.provider)?c=e.provider.useValue:pn(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Yc(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):ms(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t){var i=this;t===void 0&&(t=new Xc),this.ensureNotDisposed();var n=this.getAllRegistrations(e);if(!n&&yr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),n){var s=n.map(function(u){return i.resolveRegistration(u,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var c=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,c,"All"),c},r.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},r.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},r.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var i=fn(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=dn(n.value,2),c=s[0],u=s[1];this._registry.setAll(c,u.filter(function(f){return!hn(f.provider)}).map(function(f){return f.instance=void 0,f}))}}catch(f){e={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var i=new r(this);try{for(var n=fn(this._registry.entries()),s=n.next();!s.done;s=n.next()){var c=dn(s.value,2),u=c[0],f=c[1];f.some(function(d){var v=d.options;return v.lifecycle===_e.ContainerScoped})&&i._registry.setAll(u,f.map(function(d){return d.options.lifecycle===_e.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){e={error:d}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return i},r.prototype.beforeResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:i})},r.prototype.afterResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:i})},r.prototype.dispose=function(){return Kf(this,void 0,void 0,function(){var e;return qf(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(i){var n=i.dispose();n&&e.push(n)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},r.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},r.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},r.prototype.construct=function(e,t){var i=this;if(e instanceof Zc)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=el.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var c=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Ht([void 0],c)))}();return td(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var c,u,f;try{return Wf(n)?Qc(n)?n.multiple?(c=i.resolve(n.transform)).transform.apply(c,Ht([i.resolveAll(n.token)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Ht([i.resolve(n.token,e)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,e):Qc(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Ht([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(d){throw new Error(ed(t,s,d))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),Ke=new od;function bs(){return function(r){el.set(r,zf(r))}}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 yn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:h.ObjectIdentifier})],yn.prototype,"attrId",void 0),a([l({type:h.Any,repeated:"set"})],yn.prototype,"attrValues",void 0);let tl=ws=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};tl=ws=a([E({type:x.Sequence,itemType:yn})],tl);var Ss;let rl=Ss=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Ss.prototype)}};rl=Ss=a([E({type:x.Sequence,itemType:cr})],rl);class il{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],il.prototype,"certId",void 0),a([l({type:h.Any,context:0})],il.prototype,"certValue",void 0);class nl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],nl.prototype,"crlId",void 0),a([l({type:h.Any,context:0})],nl.prototype,"crltValue",void 0);class ol extends ie{}let gn=class{constructor(e={}){this.encryptionAlgorithm=new U,this.encryptedData=new ol,Object.assign(this,e)}};a([l({type:U})],gn.prototype,"encryptionAlgorithm",void 0),a([l({type:ol})],gn.prototype,"encryptedData",void 0);var As,ks;(function(r){r[r.v1=0]="v1"})(ks||(ks={}));class sl extends ie{}let xs=As=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};xs=As=a([E({type:x.Sequence,itemType:ht})],xs);class zr{constructor(e={}){this.version=ks.v1,this.privateKeyAlgorithm=new U,this.privateKey=new sl,Object.assign(this,e)}}a([l({type:h.Integer})],zr.prototype,"version",void 0),a([l({type:U})],zr.prototype,"privateKeyAlgorithm",void 0),a([l({type:sl})],zr.prototype,"privateKey",void 0),a([l({type:xs,implicit:!0,context:0,optional:!0})],zr.prototype,"attributes",void 0);let al=class extends zr{};al=a([E({type:x.Sequence})],al);let cl=class extends gn{};cl=a([E({type:x.Sequence})],cl);class ll{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],ll.prototype,"secretTypeId",void 0),a([l({type:h.Any,context:0})],ll.prototype,"secretValue",void 0);class Wr{constructor(e={}){this.mac=new ln,this.macSalt=new ie,this.iterations=1,Object.assign(this,e)}}a([l({type:ln})],Wr.prototype,"mac",void 0),a([l({type:ie})],Wr.prototype,"macSalt",void 0),a([l({type:h.Integer,defaultValue:1})],Wr.prototype,"iterations",void 0);class mn{constructor(e={}){this.version=3,this.authSafe=new cr,this.macData=new Wr,Object.assign(this,e)}}a([l({type:h.Integer})],mn.prototype,"version",void 0),a([l({type:cr})],mn.prototype,"authSafe",void 0),a([l({type:Wr,optional:!0})],mn.prototype,"macData",void 0);var Cs;class vn{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:h.ObjectIdentifier})],vn.prototype,"bagId",void 0),a([l({type:h.Any,context:0})],vn.prototype,"bagValue",void 0),a([l({type:yn,repeated:"set",optional:!0})],vn.prototype,"bagAttributes",void 0);let ul=Cs=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};ul=Cs=a([E({type:x.Sequence,itemType:vn})],ul);var Bs,Es,Is;const fl="1.2.840.113549.1.9",dl=`${fl}.7`,Ns=`${fl}.14`;let bn=class extends Ae{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:h.IA5String})],bn.prototype,"ia5String",void 0),bn=a([E({type:x.Choice})],bn);let pl=class extends cr{};pl=a([E({type:x.Sequence})],pl);let hl=class extends mn{};hl=a([E({type:x.Sequence})],hl);let yl=class extends gn{};yl=a([E({type:x.Sequence})],yl);let Os=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.IA5String})],Os.prototype,"value",void 0),Os=a([E({type:x.Choice})],Os);let gl=class extends bn{};gl=a([E({type:x.Choice})],gl);let ml=class extends Ae{};ml=a([E({type:x.Choice})],ml);let Ts=class{constructor(e=new Date){this.value=e}};a([l({type:h.GeneralizedTime})],Ts.prototype,"value",void 0),Ts=a([E({type:x.Choice})],Ts);let vl=class extends Ae{};vl=a([E({type:x.Choice})],vl);let Vs=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],Vs.prototype,"value",void 0),Vs=a([E({type:x.Choice})],Vs);let wn=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.PrintableString})],wn.prototype,"value",void 0),wn=a([E({type:x.Choice})],wn);let bl=class extends wn{};bl=a([E({type:x.Choice})],bl);let wl=class extends Ae{};wl=a([E({type:x.Choice})],wl);let _s=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.ObjectIdentifier})],_s.prototype,"value",void 0),_s=a([E({type:x.Choice})],_s);let Sl=class extends ke{};Sl=a([E({type:x.Choice})],Sl);let js=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:h.Integer})],js.prototype,"value",void 0),js=a([E({type:x.Choice})],js);let Al=class extends it{};Al=a([E({type:x.Sequence})],Al);let Sn=class extends Ae{};Sn=a([E({type:x.Choice})],Sn);let kl=Bs=class extends Dt{constructor(e){super(e),Object.setPrototypeOf(this,Bs.prototype)}};kl=Bs=a([E({type:x.Sequence})],kl);let xl=Es=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Es.prototype)}};xl=Es=a([E({type:x.Set,itemType:nr})],xl);let Ps=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:h.BmpString})],Ps.prototype,"value",void 0),Ps=a([E({type:x.Choice})],Ps);let Ds=class extends U{};Ds=a([E({type:x.Sequence})],Ds);let Cl=Is=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Is.prototype)}};Cl=Is=a([E({type:x.Sequence,itemType:Ds})],Cl);var Rs;let An=Rs=class extends ne{constructor(e){super(e),Object.setPrototypeOf(this,Rs.prototype)}};An=Rs=a([E({type:x.Sequence,itemType:ht})],An);class gr{constructor(e={}){this.version=0,this.subject=new ge,this.subjectPKInfo=new yt,this.attributes=new An,Object.assign(this,e)}}a([l({type:h.Integer})],gr.prototype,"version",void 0),a([l({type:ge})],gr.prototype,"subject",void 0),a([l({type:yt})],gr.prototype,"subjectPKInfo",void 0),a([l({type:An,implicit:!0,context:0})],gr.prototype,"attributes",void 0);class Jr{constructor(e={}){this.certificationRequestInfo=new gr,this.signatureAlgorithm=new U,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:gr})],Jr.prototype,"certificationRequestInfo",void 0),a([l({type:U})],Jr.prototype,"signatureAlgorithm",void 0),a([l({type:h.BitString})],Jr.prototype,"signature",void 0);/*!
|
|
91
91
|
* MIT License
|
|
92
92
|
*
|
|
93
93
|
* Copyright (c) Peculiar Ventures. All rights reserved.
|
|
@@ -110,58 +110,8 @@ ${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
|
|
114
|
-
`)}static pad(
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),
|
|
116
|
-
`)}else{if(!
|
|
117
|
-
`)}}Qe.CertificateTag="CERTIFICATE",Qe.CrlTag="CRL",Qe.CertificateRequestTag="CERTIFICATE REQUEST",Qe.PublicKeyTag="PUBLIC KEY",Qe.PrivateKeyTag="PRIVATE KEY";class Tt extends Lt{static isAsnEncoded(t){return M.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Qe.isPem(t))return Qe.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Qe.isPem(r)?Qe.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):M.toArrayBuffer(t)}}constructor(...t){Tt.isAsnEncoded(t[0])?super(Tt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Qe.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ur extends Tt{constructor(t){Tt.isAsnEncoded(t)?super(t,Ot):super(t),this.tag=Qe.PublicKeyTag}async export(...t){let r,n=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,n=t[1]||n,r=t[2]||Ze.get()):r=t[0]||Ze.get(),r.subtle.importKey("spki",this.rawData,o,!0,n)}onInit(t){const r=it.resolve(no),n=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Dr:{const o=G.parse(t.subjectPublicKey,sa),s=M.toUint8Array(o.modulus);n.publicExponent=M.toUint8Array(o.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let n,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,n=t[1]||Ze.get()):n=t[0]||Ze.get(),await n.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ze.get());const r=G.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Ot);switch(t.Algorithm=lr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case bi:t["EC Point"]=r.subjectPublicKey;break;case Dr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class vt{static register(t,r){this.items.set(t,r)}static create(t){const r=new wt(t),n=this.items.get(r.type);return n?new n(t):r}}vt.items=new Map;const ao="crypto.signatureFormatter";class hy{toAsnSignature(t,r){return M.toArrayBuffer(r)}toWebSignature(t,r){return M.toArrayBuffer(r)}}class lo extends Tt{constructor(t){Tt.isAsnEncoded(t)?super(t,Sr):super(t),this.tag=Qe.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Ft(r.subject),this.subject=new Ft(r.subject).toString(),this.issuerName=new Ft(r.issuer),this.issuer=this.issuerName.toString();const n=it.resolve(no);this.signatureAlgorithm=n.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const o=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>vt.create(G.serialize(a)))),this.publicKey=new ur(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Ze.get()){let n,o;const s=t.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(n,["verify"],r);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(n,["verify"],r);else if(s instanceof ur)n={...s.algorithm,...this.signatureAlgorithm},o=await s.export(n,["verify"],r);else if(M.isBufferSource(s)){const d=new ur(s);n={...d.algorithm,...this.signatureAlgorithm},o=await d.export(n,["verify"],r)}else n={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=it.resolveAll(ao).reverse();let l=null;for(const d of a)if(l=d.toWebSignature(n,this.signature),l)break;if(!l)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const c=await r.subtle.verify(this.signatureAlgorithm,o,l,this.tbs);if(t.signatureOnly)return c;{const y=(t.date||new Date).getTime();return c&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,n="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(n=t[0]||n,r=t[1])),r??(r=Ze.get()),await r.subtle.digest(n,this.rawData)}async isSelfSigned(t=Ze.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Sr),n=r.tbsCertificate,o=new de("",{Version:`${Cr[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":lr.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new de("",{"Not Before":n.validity.notBefore.getTime(),"Not After":n.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(n.issuerUniqueID&&(o["Issuer Unique ID"]=n.issuerUniqueID),n.subjectUniqueID&&(o["Subject Unique ID"]=n.subjectUniqueID),this.extensions.length){const s=new de("");for(const a of this.extensions){const l=a.toTextObject();s[l[de.NAME]]=l}o.Extensions=s}return t.Data=o,t.Signature=new de("",{Algorithm:lr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}lo.NAME="Certificate";class Ei extends wt{static async create(t,r=!1,n=Ze.get()){if(t instanceof lo||cr.isCryptoKey(t)){const o=t instanceof lo?await t.publicKey.export(n):t,s=await n.subtle.exportKey("spki",o),l=await new ur(s).getKeyIdentifier(n);return new Ei(L.ToHex(l),r)}else return new Ei(t,r)}constructor(...t){if(M.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new ts(L.FromHex(t[0]))});super(es,t[1],G.serialize(r))}else{const r=t[0],n=r.name instanceof Ai?G.parse(r.name.rawData,Re):r.name,o=new tr({authorityCertIssuer:n,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(es,t[1],G.serialize(o))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,tr);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,tr);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ai(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ei.NAME="Authority Key Identifier";class Cd extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ln);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new ln({cA:t[0],pathLenConstraint:t[1]});super(Sc,t[2],G.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}}Cd.NAME="Basic Constraints";var Sd;(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"})(Sd||(Sd={}));class xd extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,pn);this.usages=r.map(n=>n)}else{const r=new pn(t[0]);super(Nc,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}xd.NAME="Extended Key Usages";var Ra;(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"})(Ra||(Ra={}));class Pa extends wt{constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,gs);this.usages=r.toNumber()}else{const r=new gs(t[0]);super(Vc,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,gs);return t[""]=r.toJSON().join(", "),t}}Pa.NAME="Key Usages";class co extends wt{static async create(t,r=!1,n=Ze.get()){let o;t instanceof ur?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:M.isBufferSource(t)?o=t:o=await n.subtle.exportKey("spki",t);const a=await new ur(o).getKeyIdentifier(n);return new co(L.ToHex(a),r)}constructor(...t){if(M.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,Rt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],n=new Rt(r);super(Mc,t[1],G.serialize(n)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Rt);return t[""]=r,t}}co.NAME="Subject Key Identifier";class Ua extends wt{constructor(...t){M.isBufferSource(t[0])?super(t[0]):super($c,t[1],new Ai(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,ks);this.names=new Ai(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const n in r)t[n]=r[n];return t}}Ua.NAME="Subject Alternative Name";class Ad extends wt{constructor(...t){var r;if(M.isBufferSource(t[0])){super(t[0]);const n=G.parse(this.value,dn);this.policies=n.map(o=>o.policyIdentifier)}else{const n=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new dn(n.map(a=>new un({policyIdentifier:a})));super(Ac,o,G.serialize(s)),this.policies=n}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new de("",{},Ut.toString(r))),t}}Ad.NAME="Certificate Policies",vt.register(Ac,Ad);class Ur extends Lt{constructor(...t){let r;if(M.isBufferSource(t[0]))r=M.toArrayBuffer(t[0]);else{const n=t[0],o=Array.isArray(t[1])?t[1].map(s=>M.toArrayBuffer(s)):[];r=G.serialize(new Nt({type:n,values:o}))}super(r,Nt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new de("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[de.NAME]===Ur.NAME&&(t[de.NAME]=Ut.toString(this.type)),t}}Ur.NAME="Attribute";class Bd extends Ur{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=new to({printableString:t[0]});super(Su,[G.serialize(n)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],to);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[de.VALUE]=this.password,t}}Bd.NAME="Challenge Password";class La extends Ur{constructor(...t){var r;if(M.isBufferSource(t[0]))super(t[0]);else{const n=t[0],o=new rr;for(const s of n)o.push(G.parse(s.rawData,lt));super(Ca,[G.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],rr);this.items=r.map(n=>vt.create(G.serialize(n)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(n=>n.toTextObject());for(const n of r)t[n[de.NAME]]=n;return t}}La.NAME="Extensions";class uo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Ur(t),n=this.items.get(r.type);return n?new n(t):r}}uo.items=new Map;let Fa=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 q({algorithm:Pn,parameters:null});case"sha-256":return new q({algorithm:ra,parameters:null});case"sha-384":return new q({algorithm:Un,parameters:null});case"sha-512":return new q({algorithm:Ln,parameters:null})}}else return new q({algorithm:Dr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Dr:return{name:"RSASSA-PKCS1-v1_5"};case Pn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case ra:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Un:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Ln:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Fa=u([fa()],Fa),it.registerSingleton(io,Fa);class nt{addPadding(t,r){const n=M.toUint8Array(r),o=new Uint8Array(t);return o.set(n,t-n.length),o}removePadding(t,r=!1){let n=M.toUint8Array(t);for(let o=0;o<n.length;o++)if(n[o]){n=n.slice(o);break}if(r&&n[0]>127){const o=new Uint8Array(n.length+1);return o.set(n,1),o.buffer}return n.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const n=t.namedCurve,o=nt.namedCurveSize.get(n)||nt.defaultNamedCurveSize,s=new Rn,a=M.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const n=G.parse(r,Rn),o=t.namedCurve,s=nt.namedCurveSize.get(o)||nt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(n.r)),l=this.addPadding(s,this.removePadding(n.s));return Op(a,l)}return null}}nt.namedCurveSize=new Map,nt.defaultNamedCurveSize=32;const Id="1.3.101.110",Ed="1.3.101.111",Nd="1.3.101.112",Od="1.3.101.113";let Ha=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Nd;break;case"ed448":r=Od;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=Id;break;case"x448":r=Ed;break}}return r?new q({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Nd:return{name:"EdDSA",namedCurve:"Ed25519"};case Od:return{name:"EdDSA",namedCurve:"Ed448"};case Id:return{name:"ECDH-ES",namedCurve:"X25519"};case Ed:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ha=u([fa()],Ha),it.registerSingleton(io,Ha);class yy extends Tt{constructor(t){Tt.isAsnEncoded(t)?super(t,Si):super(t),this.tag=Qe.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new ur(t.certificationRequestInfo.subjectPKInfo);const r=it.resolve(no);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>uo.create(G.serialize(o)));const n=this.getAttribute(Ca);this.extensions=[],n instanceof La&&(this.extensions=n.items),this.subjectName=new Ft(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Ze.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(r,["verify"],t),o=it.resolveAll(ao).reverse();let s=null;for(const l of o)if(s=l.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,n,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Si),n=r.certificationRequestInfo,o=new de("",{Version:`${Cr[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new de("");for(const a of this.attributes){const l=a.toTextObject();s[l[de.NAME]]=l}o.Attributes=s}return t.Data=o,t.Signature=new de("",{Algorithm:lr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}yy.NAME="PKCS#10 Certificate Request";var Vd;(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"})(Vd||(Vd={})),vt.register(Sc,Cd),vt.register(Nc,xd),vt.register(Vc,Pa),vt.register(Mc,co),vt.register(es,Ei),vt.register($c,Ua),uo.register(Su,Bd),uo.register(Ca,La),it.registerSingleton(ao,hy),it.registerSingleton(ao,nt),nt.namedCurveSize.set("P-256",32),nt.namedCurveSize.set("K-256",32),nt.namedCurveSize.set("P-384",48),nt.namedCurveSize.set("P-521",66);function _d(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new lo(t),n={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ua){const s=o.names.toJSON(),l=Object.entries(s).map(c=>({type:c[1].type,value:c[1].value})).reduce((c,d)=>{const y=d.type,f=c[y]??[];return{...c,[y]:[...f,d.value]}},{});for(const c in l)n.subjectAltName=`${c}=${l[c].join(", ")}`}else if(o instanceof Pa){const s=Object.values(Ra),a=Array(s.length/2).fill(null).reduce((l,c,d)=>{const y=s[s.length/2+d];if(o.usages&y){const f=s[d];l.push(f)}return l},[]);n.keyUsage=a}return n}}}function gy(){const e=_d(),t=i.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(o);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const my={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function by(){const e=Ri.createI18n("en-us",my);return{i18n:e,i18nT:Ri.i18nTComponent(e)}}const ut={useCertificate:gy,useI18n:by,useX509:_d},fo="/v2/control-planes/{controlPlaneId}/core-entities",po="/{workspace}",Ni={list:{konnect:`${fo}/certificates`,kongManager:`${po}/certificates`},form:{konnect:{create:`${fo}/certificates`,edit:`${fo}/certificates/{id}`,validate:`${fo}/v1/schemas/json/certificate/validate`},kongManager:{create:`${po}/certificates`,edit:`${po}/certificates/{id}`,validate:`${po}/schemas/certificates/validate`}}};var qa=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e.Secret="secret",e))(qa||{}),Ht=(e=>(e.Edit="edit",e.Create="create",e))(Ht||{}),qt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(qt||{}),dr=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e.Other="other",e))(dr||{});const ho=Object.values(dr);var ce=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ce||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function wy(){return{getAxiosInstance:(e={})=>{try{const t=i.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):ul.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),ul.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function vy(){return{debounce:(e,t)=>{let r;return(...n)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...n)},t)}}}}const Ka="khcp-user-table-preferences",ky={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function Cy(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},t=()=>{const r=e(localStorage.getItem(Ka));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,n)=>{try{const o=t();o.set(r,n),localStorage.setItem(Ka,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const n=t();return(n==null?void 0:n.get(r))||void 0||ky},deleteAllTablePreferences:()=>{localStorage.removeItem(Ka)}}}function za(e={}){const{getAxiosInstance:t}=wy();return{axiosInstance:t(e)}}const Sy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},xy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Ay={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON",terraform:"Terraform"},errors:{edit:"The entity could not be edited at this time."}},By={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Iy={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"}},Ey={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Ny={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Oy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Vy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},_y={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"}},Ty={global:Sy,deleteModal:xy,baseForm:Ay,baseTable:By,baseConfigCard:Iy,filter:Ey,debouncedFilter:Ny,errors:Oy,validationErrors:Vy,toggleModal:_y};function yo(){const e=Ri.createI18n("en-us",Ty);return{i18n:e,i18nT:Ri.i18nTComponent(e)}}function Td(){const e=(r,n)=>(n==null?void 0:n[r])??void 0,t=(r,n)=>{if(r.length!==n.length)return!1;const o=new Set([...r,...n]);for(const s of o){const a=r.filter(c=>c===s).length,l=n.filter(c=>c===s).length;if(a!==l)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,n,o)=>{if(o){if(Object.keys(r).length===Object.keys(n).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(n[s])){if(t(r[s],n[s]))continue;return!1}else{if(r[s]===n[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(n)}catch{return!1}},sortAlpha:r=>(n,o)=>{let s=n[r]===void 0||n[r]===null?"":n[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(n[r])&&(s=n[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function jy(e,t,r,n={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=za(e.axiosRequestConfig),{i18n:{t:s}}=yo(),{debounce:a}=vy(),l=a(async C=>{await S(C)},200),c=i.ref(!1),d=i.ref(""),y=i.ref(""),f=i.ref([]),x=i.ref([]),b=i.ref(void 0),h=i.computed(()=>{const C=`${e.apiBaseUrl}${i.unref(t)}`;return e.app==="konnect"?C.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?C.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):C}),{isValidUuid:g}=Td(),m=async()=>{try{c.value=!0;const{data:C}=await o.get(`${h.value}?size=${r}`);C!=null&&C.next||(b.value=n.fetchedItemsKey in C?C[n.fetchedItemsKey]:[]),x.value=n.fetchedItemsKey in C?C[n.fetchedItemsKey]:[],f.value=x.value}catch{f.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},v=i.ref(""),S=async C=>{var E,T,N;if(v.value!==C){if(v.value=C??"",!C){f.value=x.value;return}if(b.value===void 0)try{if(c.value=!0,d.value="",y.value="",e.app==="konnect"){const A=`${h.value}/${C}`,{data:B}=await o.get(`${A}?size=${r}`);n.fetchedItemsKey in B?f.value=B[n.fetchedItemsKey]:B!=null&&B[n.exactMatchKey??"id"]?f.value=[B]:f.value=[]}else{const A=[];g(C)&&n.searchKeys.includes("id")?A.push((async()=>{const{data:H}=await o.get(`${h.value}/${C}`);return[H[n.fetchedItemsKey]??H]})()):A.push(...n.searchKeys.filter(H=>H!=="id").map(async H=>{const{data:R}=await o.get(`${h.value}?${H}=${C}`);return R[n.fetchedItemsKey]}));const B=await Promise.all(A),O=new Set;f.value=[],(E=B==null?void 0:B.forEach)==null||E.call(B,H=>{var R;(R=H==null?void 0:H.forEach)==null||R.call(H,J=>{O.has(J.id)||(O.add(J.id),f.value.push(J))})})}}catch(A){((T=A==null?void 0:A.response)==null?void 0:T.status)===404?y.value=s("debouncedFilter.errors.invalid"):(f.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,y.value="",f.value=(N=b.value)==null?void 0:N.filter(A=>{var B;let O=!1;for(const H of n.searchKeys){const R=typeof A[H]=="string"?(B=A[H])==null?void 0:B.toLowerCase():A[H];R!=null&&R.includes(C.toLowerCase())&&(O=!0)}return O}),(!f.value||!f.value.length)&&(y.value=s("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:d,validationError:y,results:f,allRecords:b,loadItems:m,debouncedQueryChange:l}}function $y(e,t){const r=i.unref(t),n=i.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return n.value.search="",o=>`${n.value.href}/${o}`}function Dy(){const{i18n:{t:e}}=yo();return{getMessageFromError:t=>{var r,n,o,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((n=t==null?void 0:t.response)!=null&&n.data){if(t.response.data.detail)return t.response.data.detail;if((o=t.response.data.details)!=null&&o.length)return t.response.data.details.map(a=>{let l=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(l=a.messages.join(", ")),a.field?`${a.field} - ${l}`:l}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function My(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const n=e.join("/"),o=`${r}${n}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${r}${n}`;throw new Error("Invalid url")}catch(n){return console.warn("Failed to build valid URL:",n),""}}function jd(e,t){const r=i.ref(i.unref(e)),n=i.ref(i.unref(t)),o=i.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=i.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return a=>{const{page:l,pageSize:c,offset:d,sortColumnKey:y,sortColumnOrder:f,query:x}=a;try{let b=new URL(s.value.href);return o.value&&x?(b.search="",b=r.value.isExactMatch?new URL(`${b.href}/${x}/`):new URL(`${b.href}?filter[name][contains]=${x}`)):(o.value||new URLSearchParams(x).forEach((h,g)=>{b.searchParams.append(g,h)}),y&&b.searchParams.append("sort_by",y),f==="desc"&&b.searchParams.append("sort_desc","1"),b.searchParams.append("size",String(c))),d&&l!==1&&b.searchParams.append("offset",String(d)),b.href}catch(b){return console.error("RouteList(fetcher)",b),n.value}}}function Ry(e,t,r){const n=i.unref(t),{axiosInstance:o}=za(e.axiosRequestConfig),s=jd(e,n),a=i.ref({status:qt.Idle});return{fetcher:async l=>{var c;const d=i.toValue(r)||"data";try{a.value={status:qt.Loading};let y=s(l);y.includes("filter[name]")&&(y=`${y}&page[size]=${l.pageSize}&page[number]=${l.page}`);const f=await o.get(y);if(f.status>=400)throw f;const x=f.data,b=d&&d.replace(/[^\w-_]/gi,"");let h;x[b]?h=Array.isArray(x[b])?x[b]:[x[b]]:Array.isArray(x)?h=x:h=Object.keys(x).length?[x]:[];const g={data:h,total:h.length,...x.offset?{pagination:{offset:x.offset}}:null};return a.value={status:qt.Idle,response:g},g}catch(y){const f={data:[],total:0};return l.query&&(((c=y.response)==null?void 0:c.status)===404||y.status===404)?(a.value={status:qt.NoResults,response:f,error:y.response?y:{response:y}},f):(a.value={status:qt.Error,response:f,error:y.response?y:{response:y}},f)}},fetcherState:a}}function Py(){const e=(r,n="_")=>r?r.split(n).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,n=>n.toUpperCase()):"",convertKeyToTitle:e}}const $d=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Dd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match($d);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Md=e=>e==="*"||e==="x"||e==="X",Rd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Uy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Ly=(e,t)=>{if(Md(e)||Md(t))return 0;const[r,n]=Uy(Rd(e),Rd(t));return r>n?1:r<n?-1:0},Pd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=Ly(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0},Fy=(e,t)=>{const r=Dd(e),n=Dd(t),o=r.pop(),s=n.pop(),a=Pd(r,n);return a!==0?a:o&&s?Pd(o.split("."),s.split(".")):o||s?o?-1:1:0},Ud=(e,t,r)=>{Hy(r);const n=Fy(e,t);return Ld[r].includes(n)},Ld={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Fd=Object.keys(Ld),Hy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Fd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Fd.join("|")}`)},qy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&$d.test(e);function Ky(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:n,version:o}=t;if(!qy(o))return console.error("Invalid version"),!1;const s=r[n];if(!s)return!1;const[a,l]=s;return!(a&&Ud(o,a,"<")||l&&Ud(o,l,">"))}function zy(e){const t=i.ref(0),r=i.ref(0),n=i.ref(!1);return i.watch(e,o=>{o&&!n.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,n.value=!0)}),{isTruncated:i.computed(()=>t.value<r.value)}}function Gy(){const{i18n:{t:e}}=yo();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Ie={useAxios:za,useDebouncedFilter:jy,useDeleteUrlBuilder:$y,useErrors:Dy,useExternalLinkCreator:My,useFetcher:Ry,useFetchUrlBuilder:jd,useHelpers:Td,useStringHelpers:Py,useI18n:yo,useGatewayFeatureSupported:Ky,useTruncationDetector:zy,useValidators:Gy},Wy={key:0,class:"config-card-fieldset-title"},Jy=i.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Ie.useI18n(),{convertKeyToTitle:n}=Ie.useStringHelpers(),o=i.computed(()=>t.item.key??"json-array-item"),s=i.computed(()=>t.item.value??t.item),a=i.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete c.name,c}),l=i.computed(()=>{var c;return t.isArrayItem?(c=s.value)!=null&&c.name?n(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(c,d)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:i.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:i.withCtx(()=>[e.isArrayItem?(i.openBlock(),i.createElementBlock("legend",Wy,[i.createElementVNode("b",null,i.toDisplayString(l.value),1)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(a.value),(y,f)=>(i.openBlock(),i.createBlock(go,{key:`${o.value}-property-${f}`,item:{key:y,label:i.unref(n)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),dt=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},Hd=dt(Jy,[["__scopeId","data-v-68ca83ec"]]),Yy=i.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ie.useI18n();return(r,n)=>{const o=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:n[0]||(n[0]=s=>r.$emit("navigation-click",e.item))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.value||i.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Zy=dt(Yy,[["__scopeId","data-v-c96811e5"]]),Qy=i.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ie.useI18n();return(r,n)=>{const o=i.resolveComponent("KBadge");return i.openBlock(),i.createBlock(o,{appearance:e.status?"success":"neutral"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.status?i.unref(t)("baseConfigCard.statusBadge.enabledLabel"):i.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Xy="#0044f4",eg="#e0e4ea",tg="#afb7c5",rg="1px",ig="20px",ng={class:"config-card-details-row"},og=["data-testid"],sg=["data-testid"],ag=["data-testid"],lg=["data-testid"],cg={key:1},ug=["data-testid"],dg=["data-testid"],fg=["data-testid"],pg=["data-testid"],hg={name:"ConfigCardItem",components:{JsonCardItem:Hd,StatusBadge:Qy,InternalLinkItem:Zy}},yg=i.defineComponent({...hg,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){i.useCssVars(h=>({"2f5b0492":y.value?"none":`solid ${i.unref(rg)} ${i.unref(eg)}`,"5d59c22c":d.value&&l.value?"block":"flex",aa41a894:d.value&&l.value?"100%":r.slim?"50%":"25%",aa3d1cde:d.value&&l.value?"100%":r.slim?"50%":"75%"}));const r=e,n=t,o=i.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Ie.useI18n(),l=i.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=i.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=i.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=i.computed(()=>r.item.type===ce.JsonArray),f=i.computed(()=>{switch(r.item.type){case ce.ID:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case ce.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case ce.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ce.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ce.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:r.item.value}};case ce.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{n("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),x=i.ref(),{isTruncated:b}=Ie.useTruncationDetector(x);return(h,g)=>{const m=i.resolveComponent("KLabel"),v=i.resolveComponent("KBadge"),S=i.resolveComponent("KCopy"),C=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("div",ng,[i.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[i.renderSlot(h.$slots,"label",{item:e.item},()=>[i.createVNode(m,{"tooltip-attributes":{maxWidth:"500px"}},i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:i.withCtx(()=>[i.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[i.renderSlot(h.$slots,"label-tooltip",{},()=>[i.createTextVNode(i.toDisplayString(e.item.tooltip),1)],!0)],8,sg)]),key:"0"}:void 0]),1024)],!0)],8,og),i.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[i.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[l.value?(i.openBlock(),i.createElementBlock("div",cg,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(f.value.tag),i.normalizeProps(i.guardReactiveProps(f.value.attrs)),{default:i.withCtx(()=>[f.value.additionalComponent==="KBadge"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(E,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-tag-${T}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${T}`,tooltip:E,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(E),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,ug)):i.createCommentVNode("",!0),f.value.additionalComponent==="KCopy"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(E,T)=>(i.openBlock(),i.createBlock(S,i.mergeProps({ref_for:!0},f.value.childAttrs,{key:`${e.item.key}-copy-uuid-${T}`,"data-testid":`${e.item.key}-copy-uuid-${T}`,text:E}),null,16,["data-testid","text"]))),128))],8,dg)):f.value.additionalComponent==="KMethodBadge"?(i.openBlock(),i.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(E,T)=>(i.openBlock(),i.createBlock(v,{key:`${e.item.key}-badge-method-${T}`,appearance:Object.values(i.unref(gp.BadgeMethodAppearances)).includes(E.toLowerCase())?E.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${T}`},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(E),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,fg)):i.createCommentVNode("",!0),f.value.additionalComponent==="JsonCardItem"?(i.openBlock(),i.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.item.value,(E,T)=>(i.openBlock(),i.createBlock(Hd,{key:`json-array-item-${T}`,index:T,"is-array-item":"",item:E},null,8,["index","item"]))),128))],8,pg)):(i.openBlock(),i.createBlock(C,{key:4,text:i.unref(b)?e.item.value:""},{default:i.withCtx(()=>[i.createElementVNode("span",{ref_key:"textContent",ref:x,class:i.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},i.toDisplayString(f.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,lg))],!0)],8,ag)])}}}),go=dt(yg,[["__scopeId","data-v-711ebcf2"]]),gg={class:"json-config"},mg={key:0,class:"json-endpoint"},qd=i.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},entityRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){i.useCssVars(o=>({"454fa8c4":`${n.value}ch`}));const t=e,r=i.computed(()=>t.entityRecord),n=i.computed(()=>{var o;if(!t.fetcherUrl)return 0;const s=(o=t.fetcherUrl)==null?void 0:o.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(o,s)=>{const a=i.resolveComponent("KBadge"),l=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",gg,[t.fetcherUrl?(i.openBlock(),i.createElementBlock("div",mg,[i.createVNode(a,{appearance:t.requestMethod},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),i.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):i.createCommentVNode("",!0),t.entityRecord?(i.openBlock(),i.createBlock(l,{key:1,id:"json-codeblock",class:i.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):i.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Kd(e){return typeof e>"u"||e===null}function bg(e){return typeof e=="object"&&e!==null}function wg(e){return Array.isArray(e)?e:Kd(e)?[]:[e]}function vg(e,t){var r,n,o,s;if(t)for(s=Object.keys(t),r=0,n=s.length;r<n;r+=1)o=s[r],e[o]=t[o];return e}function kg(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}function Cg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Sg=Kd,xg=bg,Ag=wg,Bg=kg,Ig=Cg,Eg=vg,Se={isNothing:Sg,isObject:xg,toArray:Ag,repeat:Bg,isNegativeZero:Ig,extend:Eg};function zd(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
118
|
-
|
|
119
|
-
`+e.mark.snippet),n+" "+r):n}function Oi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=zd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Oi.prototype=Object.create(Error.prototype),Oi.prototype.constructor=Oi,Oi.prototype.toString=function(e){return this.name+": "+zd(this,e)};var Pe=Oi;function Ga(e,t,r,n,o){var s="",a="",l=Math.floor(o/2)-1;return n-t>l&&(s=" ... ",t=n-l+s.length),r-n>l&&(a=" ...",r=n+l-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:n-t+s.length}}function Wa(e,t){return Se.repeat(" ",t-e.length)+e}function Ng(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),n.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var l="",c,d,y=Math.min(e.line+t.linesAfter,o.length).toString().length,f=t.maxLength-(t.indent+y+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)d=Ga(e.buffer,n[a-c],o[a-c],e.position-(n[a]-n[a-c]),f),l=Se.repeat(" ",t.indent)+Wa((e.line-c+1).toString(),y)+" | "+d.str+`
|
|
120
|
-
`+l;for(d=Ga(e.buffer,n[a],o[a],e.position,f),l+=Se.repeat(" ",t.indent)+Wa((e.line+1).toString(),y)+" | "+d.str+`
|
|
121
|
-
`,l+=Se.repeat("-",t.indent+y+3+d.pos)+`^
|
|
122
|
-
`,c=1;c<=t.linesAfter&&!(a+c>=o.length);c++)d=Ga(e.buffer,n[a+c],o[a+c],e.position-(n[a]-n[a+c]),f),l+=Se.repeat(" ",t.indent)+Wa((e.line+c+1).toString(),y)+" | "+d.str+`
|
|
123
|
-
`;return l.replace(/\n$/,"")}var Og=Ng,Vg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_g=["scalar","sequence","mapping"];function Tg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}function jg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Vg.indexOf(r)===-1)throw new Pe('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Tg(t.styleAliases||null),_g.indexOf(this.kind)===-1)throw new Pe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var _e=jg;function Gd(e,t){var r=[];return e[t].forEach(function(n){var o=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(o=a)}),r[o]=n}),r}function $g(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(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(n);return e}function Ja(e){return this.extend(e)}Ja.prototype.extend=function(e){var t=[],r=[];if(e instanceof _e)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new Pe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof _e))throw new Pe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Pe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Pe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof _e))throw new Pe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var n=Object.create(Ja.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=Gd(n,"implicit"),n.compiledExplicit=Gd(n,"explicit"),n.compiledTypeMap=$g(n.compiledImplicit,n.compiledExplicit),n};var Wd=Ja,Jd=new _e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Yd=new _e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Zd=new _e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Qd=new Wd({explicit:[Jd,Yd,Zd]});function Dg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Mg(){return null}function Rg(e){return e===null}var Xd=new _e("tag:yaml.org,2002:null",{kind:"scalar",resolve:Dg,construct:Mg,predicate:Rg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Pg(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 Ug(e){return e==="true"||e==="True"||e==="TRUE"}function Lg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ef=new _e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Pg,construct:Ug,predicate:Lg,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 Fg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Hg(e){return 48<=e&&e<=55}function qg(e){return 48<=e&&e<=57}function Kg(e){if(e===null)return!1;var t=e.length,r=0,n=!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;n=!0}return n&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Fg(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Hg(e.charCodeAt(r)))return!1;n=!0}return n&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!qg(e.charCodeAt(r)))return!1;n=!0}return!(!n||o==="_")}function zg(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="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 Gg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Se.isNegativeZero(e)}var tf=new _e("tag:yaml.org,2002:int",{kind:"scalar",resolve:Kg,construct:zg,predicate:Gg,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"]}}),Wg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Jg(e){return!(e===null||!Wg.test(e)||e[e.length-1]==="_")}function Yg(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 Zg=/^[-+]?[0-9]+e/;function Qg(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Se.isNegativeZero(e))return"-0.0";return r=e.toString(10),Zg.test(r)?r.replace("e",".e"):r}function Xg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Se.isNegativeZero(e))}var rf=new _e("tag:yaml.org,2002:float",{kind:"scalar",resolve:Jg,construct:Yg,predicate:Xg,represent:Qg,defaultStyle:"lowercase"}),nf=Qd.extend({implicit:[Xd,ef,tf,rf]}),of=nf,sf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),af=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 em(e){return e===null?!1:sf.exec(e)!==null||af.exec(e)!==null}function tm(e){var t,r,n,o,s,a,l,c=0,d=null,y,f,x;if(t=sf.exec(e),t===null&&(t=af.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,n,o));if(s=+t[4],a=+t[5],l=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(y=+t[10],f=+(t[11]||0),d=(y*60+f)*6e4,t[9]==="-"&&(d=-d)),x=new Date(Date.UTC(r,n,o,s,a,l,c)),d&&x.setTime(x.getTime()-d),x}function rm(e){return e.toISOString()}var lf=new _e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:em,construct:tm,instanceOf:Date,represent:rm});function im(e){return e==="<<"||e===null}var cf=new _e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:im}),Ya=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
124
|
-
\r`;function nm(e){if(e===null)return!1;var t,r,n=0,o=e.length,s=Ya;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}function om(e){var t,r,n=e.replace(/[\r\n=]/g,""),o=n.length,s=Ya,a=0,l=[];for(t=0;t<o;t++)t%4===0&&t&&(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)),a=a<<6|s.indexOf(n.charAt(t));return r=o%4*6,r===0?(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)):r===18?(l.push(a>>10&255),l.push(a>>2&255)):r===12&&l.push(a>>4&255),new Uint8Array(l)}function sm(e){var t="",r=0,n,o,s=e.length,a=Ya;for(n=0;n<s;n++)n%3===0&&n&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[n];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 am(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var uf=new _e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:nm,construct:om,predicate:am,represent:sm}),lm=Object.prototype.hasOwnProperty,cm=Object.prototype.toString;function um(e){if(e===null)return!0;var t=[],r,n,o,s,a,l=e;for(r=0,n=l.length;r<n;r+=1){if(o=l[r],a=!1,cm.call(o)!=="[object Object]")return!1;for(s in o)if(lm.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 dm(e){return e!==null?e:[]}var df=new _e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:um,construct:dm}),fm=Object.prototype.toString;function pm(e){if(e===null)return!0;var t,r,n,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(n=a[t],fm.call(n)!=="[object Object]"||(o=Object.keys(n),o.length!==1))return!1;s[t]=[o[0],n[o[0]]]}return!0}function hm(e){if(e===null)return[];var t,r,n,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)n=a[t],o=Object.keys(n),s[t]=[o[0],n[o[0]]];return s}var ff=new _e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pm,construct:hm}),ym=Object.prototype.hasOwnProperty;function gm(e){if(e===null)return!0;var t,r=e;for(t in r)if(ym.call(r,t)&&r[t]!==null)return!1;return!0}function mm(e){return e!==null?e:{}}var pf=new _e("tag:yaml.org,2002:set",{kind:"mapping",resolve:gm,construct:mm}),Za=of.extend({implicit:[lf,cf],explicit:[uf,df,ff,pf]}),Kt=Object.prototype.hasOwnProperty,mo=1,hf=2,yf=3,bo=4,Qa=1,bm=2,gf=3,wm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,vm=/[\x85\u2028\u2029]/,km=/[,\[\]\{\}]/,mf=/^(?:!|!!|![a-z\-]+!)$/i,bf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function wf(e){return Object.prototype.toString.call(e)}function kt(e){return e===10||e===13}function fr(e){return e===9||e===32}function We(e){return e===9||e===32||e===10||e===13}function Lr(e){return e===44||e===91||e===93||e===123||e===125}function Cm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Sm(e){return e===120?2:e===117?4:e===85?8:0}function xm(e){return 48<=e&&e<=57?e-48:-1}function vf(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 Am(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var kf=new Array(256),Cf=new Array(256),Fr=0;Fr<256;Fr++)kf[Fr]=vf(Fr)?1:0,Cf[Fr]=vf(Fr);function Bm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Za,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 Sf(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=Og(r),new Pe(t,r)}function Y(e,t){throw Sf(e,t)}function wo(e,t){e.onWarning&&e.onWarning.call(null,Sf(e,t))}var xf={YAML:function(e,t,r){var n,o,s;e.version!==null&&Y(e,"duplication of %YAML directive"),r.length!==1&&Y(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),n===null&&Y(e,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),s=parseInt(n[2],10),o!==1&&Y(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&wo(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var n,o;r.length!==2&&Y(e,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],mf.test(n)||Y(e,"ill-formed tag handle (first argument) of the TAG directive"),Kt.call(e.tagMap,n)&&Y(e,'there is a previously declared suffix for "'+n+'" tag handle'),bf.test(o)||Y(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{Y(e,"tag prefix is malformed: "+o)}e.tagMap[n]=o}};function zt(e,t,r,n){var o,s,a,l;if(t<r){if(l=e.input.slice(t,r),n)for(o=0,s=l.length;o<s;o+=1)a=l.charCodeAt(o),a===9||32<=a&&a<=1114111||Y(e,"expected valid JSON character");else wm.test(l)&&Y(e,"the stream contains non-printable characters");e.result+=l}}function Af(e,t,r,n){var o,s,a,l;for(Se.isObject(r)||Y(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,l=o.length;a<l;a+=1)s=o[a],Kt.call(t,s)||(t[s]=r[s],n[s]=!0)}function Hr(e,t,r,n,o,s,a,l,c){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])&&Y(e,"nested arrays are not supported inside keys"),typeof o=="object"&&wf(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&wf(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,y=s.length;d<y;d+=1)Af(e,t,s[d],r);else Af(e,t,s,r);else!e.json&&!Kt.call(r,o)&&Kt.call(t,o)&&(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,Y(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 Xa(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++):Y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ve(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);o!==0;){for(;fr(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(kt(o))for(Xa(e),o=e.input.charCodeAt(e.position),n++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&wo(e,"deficient indentation"),n}function vo(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||We(r)))}function el(e,t){t===1?e.result+=" ":t>1&&(e.result+=Se.repeat(`
|
|
126
|
-
`,t-1))}function Im(e,t,r){var n,o,s,a,l,c,d,y,f=e.kind,x=e.result,b;if(b=e.input.charCodeAt(e.position),We(b)||Lr(b)||b===35||b===38||b===42||b===33||b===124||b===62||b===39||b===34||b===37||b===64||b===96||(b===63||b===45)&&(o=e.input.charCodeAt(e.position+1),We(o)||r&&Lr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,l=!1;b!==0;){if(b===58){if(o=e.input.charCodeAt(e.position+1),We(o)||r&&Lr(o))break}else if(b===35){if(n=e.input.charCodeAt(e.position-1),We(n))break}else{if(e.position===e.lineStart&&vo(e)||r&&Lr(b))break;if(kt(b))if(c=e.line,d=e.lineStart,y=e.lineIndent,ve(e,!1,-1),e.lineIndent>=t){l=!0,b=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=c,e.lineStart=d,e.lineIndent=y;break}}l&&(zt(e,s,a,!1),el(e,e.line-c),s=a=e.position,l=!1),fr(b)||(a=e.position+1),b=e.input.charCodeAt(++e.position)}return zt(e,s,a,!1),e.result?!0:(e.kind=f,e.result=x,!1)}function Em(e,t){var r,n,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(zt(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,o=e.position;else return!0;else kt(r)?(zt(e,n,o,!0),el(e,ve(e,!1,t)),n=o=e.position):e.position===e.lineStart&&vo(e)?Y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);Y(e,"unexpected end of the stream within a single quoted scalar")}function Nm(e,t){var r,n,o,s,a,l;if(l=e.input.charCodeAt(e.position),l!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(l=e.input.charCodeAt(e.position))!==0;){if(l===34)return zt(e,r,e.position,!0),e.position++,!0;if(l===92){if(zt(e,r,e.position,!0),l=e.input.charCodeAt(++e.position),kt(l))ve(e,!1,t);else if(l<256&&kf[l])e.result+=Cf[l],e.position++;else if((a=Sm(l))>0){for(o=a,s=0;o>0;o--)l=e.input.charCodeAt(++e.position),(a=Cm(l))>=0?s=(s<<4)+a:Y(e,"expected hexadecimal character");e.result+=Am(s),e.position++}else Y(e,"unknown escape sequence");r=n=e.position}else kt(l)?(zt(e,r,n,!0),el(e,ve(e,!1,t)),r=n=e.position):e.position===e.lineStart&&vo(e)?Y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}Y(e,"unexpected end of the stream within a double quoted scalar")}function Om(e,t){var r=!0,n,o,s,a=e.tag,l,c=e.anchor,d,y,f,x,b,h=Object.create(null),g,m,v,S;if(S=e.input.charCodeAt(e.position),S===91)y=93,b=!1,l=[];else if(S===123)y=125,b=!0,l={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),S=e.input.charCodeAt(++e.position);S!==0;){if(ve(e,!0,t),S=e.input.charCodeAt(e.position),S===y)return e.position++,e.tag=a,e.anchor=c,e.kind=b?"mapping":"sequence",e.result=l,!0;r?S===44&&Y(e,"expected the node content, but found ','"):Y(e,"missed comma between flow collection entries"),m=g=v=null,f=x=!1,S===63&&(d=e.input.charCodeAt(e.position+1),We(d)&&(f=x=!0,e.position++,ve(e,!0,t))),n=e.line,o=e.lineStart,s=e.position,qr(e,t,mo,!1,!0),m=e.tag,g=e.result,ve(e,!0,t),S=e.input.charCodeAt(e.position),(x||e.line===n)&&S===58&&(f=!0,S=e.input.charCodeAt(++e.position),ve(e,!0,t),qr(e,t,mo,!1,!0),v=e.result),b?Hr(e,l,h,m,g,v,n,o,s):f?l.push(Hr(e,null,h,m,g,v,n,o,s)):l.push(g),ve(e,!0,t),S=e.input.charCodeAt(e.position),S===44?(r=!0,S=e.input.charCodeAt(++e.position)):r=!1}Y(e,"unexpected end of the stream within a flow collection")}function Vm(e,t){var r,n,o=Qa,s=!1,a=!1,l=t,c=0,d=!1,y,f;if(f=e.input.charCodeAt(e.position),f===124)n=!1;else if(f===62)n=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)Qa===o?o=f===43?gf:bm:Y(e,"repeat of a chomping mode identifier");else if((y=xm(f))>=0)y===0?Y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Y(e,"repeat of an indentation width identifier"):(l=t+y-1,a=!0);else break;if(fr(f)){do f=e.input.charCodeAt(++e.position);while(fr(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!kt(f)&&f!==0)}for(;f!==0;){for(Xa(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!a||e.lineIndent<l)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>l&&(l=e.lineIndent),kt(f)){c++;continue}if(e.lineIndent<l){o===gf?e.result+=Se.repeat(`
|
|
127
|
-
`,s?1+c:c):o===Qa&&s&&(e.result+=`
|
|
128
|
-
`);break}for(n?fr(f)?(d=!0,e.result+=Se.repeat(`
|
|
129
|
-
`,s?1+c:c)):d?(d=!1,e.result+=Se.repeat(`
|
|
130
|
-
`,c+1)):c===0?s&&(e.result+=" "):e.result+=Se.repeat(`
|
|
131
|
-
`,c):e.result+=Se.repeat(`
|
|
132
|
-
`,s?1+c:c),s=!0,a=!0,c=0,r=e.position;!kt(f)&&f!==0;)f=e.input.charCodeAt(++e.position);zt(e,r,e.position,!1)}return!0}function Bf(e,t){var r,n=e.tag,o=e.anchor,s=[],a,l=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),!(c!==45||(a=e.input.charCodeAt(e.position+1),!We(a))));){if(l=!0,e.position++,ve(e,!0,-1)&&e.lineIndent<=t){s.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,qr(e,t,yf,!1,!0),s.push(e.result),ve(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)Y(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return l?(e.tag=n,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function _m(e,t,r){var n,o,s,a,l,c,d=e.tag,y=e.anchor,f={},x=Object.create(null),b=null,h=null,g=null,m=!1,v=!1,S;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),S=e.input.charCodeAt(e.position);S!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,(S===63||S===58)&&We(n))S===63?(m&&(Hr(e,f,x,b,h,null,a,l,c),b=h=g=null),v=!0,m=!0,o=!0):m?(m=!1,o=!0):Y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,S=n;else{if(a=e.line,l=e.lineStart,c=e.position,!qr(e,r,hf,!1,!0))break;if(e.line===s){for(S=e.input.charCodeAt(e.position);fr(S);)S=e.input.charCodeAt(++e.position);if(S===58)S=e.input.charCodeAt(++e.position),We(S)||Y(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(Hr(e,f,x,b,h,null,a,l,c),b=h=g=null),v=!0,m=!1,o=!1,b=e.tag,h=e.result;else if(v)Y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(v)Y(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)&&(m&&(a=e.line,l=e.lineStart,c=e.position),qr(e,t,bo,!0,o)&&(m?h=e.result:g=e.result),m||(Hr(e,f,x,b,h,g,a,l,c),b=h=g=null),ve(e,!0,-1),S=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&S!==0)Y(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&Hr(e,f,x,b,h,null,a,l,c),v&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=f),v}function Tm(e){var t,r=!1,n=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&Y(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(n=!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)):Y(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!We(a);)a===33&&(n?Y(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),mf.test(o)||Y(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),km.test(s)&&Y(e,"tag suffix cannot contain flow indicator characters")}s&&!bf.test(s)&&Y(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{Y(e,"tag name is malformed: "+s)}return r?e.tag=s:Kt.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:Y(e,'undeclared tag handle "'+o+'"'),!0}function jm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Y(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!We(r)&&!Lr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function $m(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!We(n)&&!Lr(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Kt.call(e.anchorMap,r)||Y(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ve(e,!0,-1),!0}function qr(e,t,r,n,o){var s,a,l,c=1,d=!1,y=!1,f,x,b,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=l=bo===r||yf===r,n&&ve(e,!0,-1)&&(d=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Tm(e)||jm(e);)ve(e,!0,-1)?(d=!0,l=s,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):l=!1;if(l&&(l=d||o),(c===1||bo===r)&&(mo===r||hf===r?g=t:g=t+1,m=e.position-e.lineStart,c===1?l&&(Bf(e,m)||_m(e,m,g))||Om(e,g)?y=!0:(a&&Vm(e,g)||Em(e,g)||Nm(e,g)?y=!0:$m(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&Y(e,"alias node should not have any properties")):Im(e,g,mo===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(y=l&&Bf(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"&&Y(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,x=e.implicitTypes.length;f<x;f+=1)if(h=e.implicitTypes[f],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(Kt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,b=e.typeMap.multi[e.kind||"fallback"],f=0,x=b.length;f<x;f+=1)if(e.tag.slice(0,b[f].tag.length)===b[f].tag){h=b[f];break}h||Y(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&Y(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)):Y(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 Dm(e){var t=e.position,r,n,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&&!We(a);)a=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),o=[],n.length<1&&Y(e,"directive name must not be less than one character in length");a!==0;){for(;fr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!kt(a));break}if(kt(a))break;for(r=e.position;a!==0&&!We(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Xa(e),Kt.call(xf,n)?xf[n](e,n,o):wo(e,'unknown document directive "'+n+'"')}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&&Y(e,"directives end mark is expected"),qr(e,e.lineIndent-1,bo,!1,!0),ve(e,!0,-1),e.checkLineBreaks&&vm.test(e.input.slice(t,e.position))&&wo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&vo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ve(e,!0,-1));return}if(e.position<e.length-1)Y(e,"end of the stream or a document separator is expected");else return}function If(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 Bm(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,Y(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;)Dm(r);return r.documents}function Mm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=If(e,r);if(typeof t!="function")return n;for(var o=0,s=n.length;o<s;o+=1)t(n[o])}function Rm(e,t){var r=If(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Pe("expected a single document in the stream, but found more")}}var Pm=Mm,Um=Rm,Ef={loadAll:Pm,load:Um},Nf=Object.prototype.toString,Of=Object.prototype.hasOwnProperty,tl=65279,Lm=9,Vi=10,Fm=13,Hm=32,qm=33,Km=34,rl=35,zm=37,Gm=38,Wm=39,Jm=42,Vf=44,Ym=45,ko=58,Zm=61,Qm=62,Xm=63,e0=64,_f=91,Tf=93,t0=96,jf=123,r0=124,$f=125,De={};De[0]="\\0",De[7]="\\a",De[8]="\\b",De[9]="\\t",De[10]="\\n",De[11]="\\v",De[12]="\\f",De[13]="\\r",De[27]="\\e",De[34]='\\"',De[92]="\\\\",De[133]="\\N",De[160]="\\_",De[8232]="\\L",De[8233]="\\P";var i0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],n0=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function o0(e,t){var r,n,o,s,a,l,c;if(t===null)return{};for(r={},n=Object.keys(t),o=0,s=n.length;o<s;o+=1)a=n[o],l=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&Of.call(c.styleAliases,l)&&(l=c.styleAliases[l]),r[a]=l;return r}function s0(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new Pe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Se.repeat("0",n-t.length)+t}var a0=1,_i=2;function l0(e){this.schema=e.schema||Za,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Se.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=o0(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==='"'?_i:a0,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 Df(e,t){for(var r=Se.repeat(" ",t),n=0,o=-1,s="",a,l=e.length;n<l;)o=e.indexOf(`
|
|
134
|
-
`,n),o===-1?(a=e.slice(n),n=l):(a=e.slice(n,o+1),n=o+1),a.length&&a!==`
|
|
135
|
-
`&&(s+=r),s+=a;return s}function il(e,t){return`
|
|
136
|
-
`+Se.repeat(" ",e.indent*t)}function c0(e,t){var r,n,o;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function Co(e){return e===Hm||e===Lm}function Ti(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==tl||65536<=e&&e<=1114111}function Mf(e){return Ti(e)&&e!==tl&&e!==Fm&&e!==Vi}function Rf(e,t,r){var n=Mf(e),o=n&&!Co(e);return(r?n:n&&e!==Vf&&e!==_f&&e!==Tf&&e!==jf&&e!==$f)&&e!==rl&&!(t===ko&&!o)||Mf(t)&&!Co(t)&&e===rl||t===ko&&o}function u0(e){return Ti(e)&&e!==tl&&!Co(e)&&e!==Ym&&e!==Xm&&e!==ko&&e!==Vf&&e!==_f&&e!==Tf&&e!==jf&&e!==$f&&e!==rl&&e!==Gm&&e!==Jm&&e!==qm&&e!==r0&&e!==Zm&&e!==Qm&&e!==Wm&&e!==Km&&e!==zm&&e!==e0&&e!==t0}function d0(e){return!Co(e)&&e!==ko}function ji(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function Pf(e){var t=/^\n* /;return t.test(e)}var Uf=1,nl=2,Lf=3,Ff=4,Kr=5;function f0(e,t,r,n,o,s,a,l){var c,d=0,y=null,f=!1,x=!1,b=n!==-1,h=-1,g=u0(ji(e,0))&&d0(ji(e,e.length-1));if(t||a)for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=ji(e,c),!Ti(d))return Kr;g=g&&Rf(d,y,l),y=d}else{for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=ji(e,c),d===Vi)f=!0,b&&(x=x||c-h-1>n&&e[h+1]!==" ",h=c);else if(!Ti(d))return Kr;g=g&&Rf(d,y,l),y=d}x=x||b&&c-h-1>n&&e[h+1]!==" "}return!f&&!x?g&&!a&&!o(e)?Uf:s===_i?Kr:nl:r>9&&Pf(e)?Kr:a?s===_i?Kr:nl:x?Ff:Lf}function p0(e,t,r,n,o){e.dump=function(){if(t.length===0)return e.quotingType===_i?'""':"''";if(!e.noCompatMode&&(i0.indexOf(t)!==-1||n0.test(t)))return e.quotingType===_i?'"'+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),l=n||e.flowLevel>-1&&r>=e.flowLevel;function c(d){return c0(e,d)}switch(f0(t,l,e.indent,a,c,e.quotingType,e.forceQuotes&&!n,o)){case Uf:return t;case nl:return"'"+t.replace(/'/g,"''")+"'";case Lf:return"|"+Hf(t,e.indent)+qf(Df(t,s));case Ff:return">"+Hf(t,e.indent)+qf(Df(h0(t,a),s));case Kr:return'"'+y0(t)+'"';default:throw new Pe("impossible error: invalid scalar style")}}()}function Hf(e,t){var r=Pf(e)?String(t):"",n=e[e.length-1]===`
|
|
137
|
-
`,o=n&&(e[e.length-2]===`
|
|
138
|
-
`||e===`
|
|
139
|
-
`),s=o?"+":n?"":"-";return r+s+`
|
|
140
|
-
`}function qf(e){return e[e.length-1]===`
|
|
141
|
-
`?e.slice(0,-1):e}function h0(e,t){for(var r=/(\n+)([^\n]*)/g,n=function(){var d=e.indexOf(`
|
|
142
|
-
`);return d=d!==-1?d:e.length,r.lastIndex=d,Kf(e.slice(0,d),t)}(),o=e[0]===`
|
|
143
|
-
`||e[0]===" ",s,a;a=r.exec(e);){var l=a[1],c=a[2];s=c[0]===" ",n+=l+(!o&&!s&&c!==""?`
|
|
144
|
-
`:"")+Kf(c,t),o=s}return n}function Kf(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,o=0,s,a=0,l=0,c="";n=r.exec(e);)l=n.index,l-o>t&&(s=a>o?a:l,c+=`
|
|
145
|
-
`+e.slice(o,s),o=s+1),a=l;return c+=`
|
|
146
|
-
`,e.length-o>t&&a>o?c+=e.slice(o,a)+`
|
|
147
|
-
`+e.slice(a+1):c+=e.slice(o),c.slice(1)}function y0(e){for(var t="",r=0,n,o=0;o<e.length;r>=65536?o+=2:o++)r=ji(e,o),n=De[r],!n&&Ti(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=n||s0(r);return t}function g0(e,t,r){var n="",o=e.tag,s,a,l;for(s=0,a=r.length;s<a;s+=1)l=r[s],e.replacer&&(l=e.replacer.call(r,String(s),l)),(jt(e,t,l,!1,!1)||typeof l>"u"&&jt(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=o,e.dump="["+n+"]"}function zf(e,t,r,n){var o="",s=e.tag,a,l,c;for(a=0,l=r.length;a<l;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(jt(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&jt(e,t+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=il(e,t)),e.dump&&Vi===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function m0(e,t,r){var n="",o=e.tag,s=Object.keys(r),a,l,c,d,y;for(a=0,l=s.length;a<l;a+=1)y="",n!==""&&(y+=", "),e.condenseFlow&&(y+='"'),c=s[a],d=r[c],e.replacer&&(d=e.replacer.call(r,c,d)),jt(e,t,c,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),jt(e,t,d,!1,!1)&&(y+=e.dump,n+=y));e.tag=o,e.dump="{"+n+"}"}function b0(e,t,r,n){var o="",s=e.tag,a=Object.keys(r),l,c,d,y,f,x;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Pe("sortKeys must be a boolean or a function");for(l=0,c=a.length;l<c;l+=1)x="",(!n||o!=="")&&(x+=il(e,t)),d=a[l],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),jt(e,t+1,d,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Vi===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,f&&(x+=il(e,t)),jt(e,t+1,y,!0,f)&&(e.dump&&Vi===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,o+=x));e.tag=s,e.dump=o||"{}"}function Gf(e,t,r){var n,o,s,a,l,c;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(l=o[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof t=="object"&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(r?l.multi&&l.representName?e.tag=l.representName(t):e.tag=l.tag:e.tag="?",l.represent){if(c=e.styleMap[l.tag]||l.defaultStyle,Nf.call(l.represent)==="[object Function]")n=l.represent(t,c);else if(Of.call(l.represent,c))n=l.represent[c](t,c);else throw new Pe("!<"+l.tag+'> tag resolver accepts not "'+c+'" style');e.dump=n}return!0}return!1}function jt(e,t,r,n,o,s,a){e.tag=null,e.dump=r,Gf(e,r,!1)||Gf(e,r,!0);var l=Nf.call(e.dump),c=n,d;n&&(n=e.flowLevel<0||e.flowLevel>t);var y=l==="[object Object]"||l==="[object Array]",f,x;if(y&&(f=e.duplicates.indexOf(r),x=f!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(o=!1),x&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(y&&x&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),l==="[object Object]")n&&Object.keys(e.dump).length!==0?(b0(e,t,e.dump,o),x&&(e.dump="&ref_"+f+e.dump)):(m0(e,t,e.dump),x&&(e.dump="&ref_"+f+" "+e.dump));else if(l==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?zf(e,t-1,e.dump,o):zf(e,t,e.dump,o),x&&(e.dump="&ref_"+f+e.dump)):(g0(e,t,e.dump),x&&(e.dump="&ref_"+f+" "+e.dump));else if(l==="[object String]")e.tag!=="?"&&p0(e,e.dump,t,s,c);else{if(l==="[object Undefined]"||e.skipInvalid)return!1;throw new Pe("unacceptable kind of an object to dump "+l)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function w0(e,t){var r=[],n=[],o,s;for(ol(e,r,n),o=0,s=n.length;o<s;o+=1)t.duplicates.push(r[n[o]]);t.usedDuplicates=new Array(s)}function ol(e,t,r){var n,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)ol(e[o],t,r);else for(n=Object.keys(e),o=0,s=n.length;o<s;o+=1)ol(e[n[o]],t,r)}function v0(e,t){t=t||{};var r=new l0(t);r.noRefs||w0(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),jt(r,0,n,!0,!0)?r.dump+`
|
|
148
|
-
`:""}var k0=v0,C0={dump:k0};function sl(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 S0=_e,x0=Wd,A0=Qd,B0=nf,I0=of,E0=Za,N0=Ef.load,O0=Ef.loadAll,V0=C0.dump,_0=Pe,T0={binary:uf,float:rf,map:Zd,null:Xd,pairs:ff,set:pf,timestamp:lf,bool:ef,int:tf,merge:cf,omap:df,seq:Yd,str:Jd},j0=sl("safeLoad","load"),$0=sl("safeLoadAll","loadAll"),D0=sl("safeDump","dump"),M0={Type:S0,Schema:x0,FAILSAFE_SCHEMA:A0,JSON_SCHEMA:B0,CORE_SCHEMA:I0,DEFAULT_SCHEMA:E0,load:N0,loadAll:O0,dump:V0,YAMLException:_0,types:T0,safeLoad:j0,safeLoadAll:$0,safeDump:D0};const R0={class:"yaml-config"},Wf=i.defineComponent({__name:"YamlCodeBlock",props:{entityRecord:{type:Object,required:!0}},setup(e){const t=e,r=i.computed(()=>{const n=Object.fromEntries(Object.entries(t.entityRecord).filter(([,o])=>o!==null&&o!==""&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(n).length===0&&n.constructor===Object?"":M0.dump(n).trim()});return(n,o)=>{const s=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",R0,[t.entityRecord?(i.openBlock(),i.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):i.createCommentVNode("",!0)])}}}),P0={class:"terraform-config"},Ue=" ",Jf=i.defineComponent({__name:"TerraformCodeBlock",props:{entityRecord:{type:Object,required:!0},entityType:{type:String,required:!0,validator:e=>ho.includes(e)},credentialType:{type:String,default:""}},setup(e){const t=e,r=(l,c)=>{const d=Ue;let y="";return typeof l=="string"?y+=`${d}${c} = "${l}"
|
|
149
|
-
`:y+=`${d}${c} = ${String(l??"")}
|
|
150
|
-
`,y},n=(l,c,d="")=>{if(typeof l!="object")return"Invalid object";const y=Ue+d;let f="";if(c&&(f+=`${y}${c} = {
|
|
151
|
-
`),l===null)return c?f+=`${y}}`:f="{}",f;const x=Object.fromEntries(Object.entries(l).filter(([,h])=>h!==null));let b="";for(const[h,g]of Object.entries(x))Array.isArray(g)?g.length===0?b="[]":(b=`[
|
|
152
|
-
`,b+=o(g,void 0,y),b+=`${y}${Ue}]`):g&&typeof g=="object"?(b=`{
|
|
153
|
-
`,b+=n(g,void 0,y),b+=`${y}${Ue}}`):b=String(g??""),typeof g=="string"&&(b=`"${b}"`),f+=`${y}${Ue}${h} = ${b}
|
|
154
|
-
`;return c?f+=`${y}}
|
|
155
|
-
`:f},o=(l,c,d="")=>{if(!Array.isArray(l))return"Invalid array";const y=Ue+d;let f="";c&&(l.length===0?f+=`${y}${c} = [`:f+=`${y}${c} = [
|
|
156
|
-
`);for(let x=0;x<l.length;x++){const b=l[x];typeof b=="object"?(f+=`${y}${Ue}{
|
|
157
|
-
`,f+=n(b,void 0,y),f+=`${y}${Ue}}`):typeof b=="string"?f+=`${y}${Ue}"${b}"`:f+=`${y}${Ue}${String(b??"")}`,x<l.length-1&&(f+=","),f+=`
|
|
158
|
-
`}return c&&(l.length===0?f+=`]
|
|
159
|
-
`:f+=`${y}]
|
|
160
|
-
`),f},s=l=>{let c="";for(const[d,y]of Object.entries(l))Array.isArray(y)?c+=o(y,d):typeof y=="object"?c+=n(y,d):c+=r(y,d);return c},a=i.computed(()=>{var l,c,d,y,f,x,b;const h=Object.fromEntries(Object.entries(t.entityRecord).filter(([,S])=>S!=null)),g=t.entityRecord.config?Object.fromEntries(Object.entries((l=t.entityRecord)==null?void 0:l.config).filter(([,S])=>S!=null)):void 0;if(g&&(h.config=g),Object.keys(h).length===0)return"";delete h.id;let m="",v="";if((c=h.service)!=null&&c.id?(v="service",delete h.service):(d=h.route)!=null&&d.id?(v="route",delete h.route):(y=h.consumer)!=null&&y.id?(v="consumer",delete h.consumer):(f=h.consumer_group)!=null&&f.id?(v="consumer_group",delete h.consumer_group):(x=h.certificate)!=null&&x.id?(v="certificate",delete h.certificate):(b=h.set)!=null&&b.id&&(v="set",delete h.set),t.entityType==="plugin"){const S=t.credentialType.replace(/-/g,"_")||(h.name+"").replace(/-/g,"_");delete h.name,m+=`resource "konnect_gateway_plugin_${S}" "my_${S}" {
|
|
161
|
-
`}else m+=`resource "konnect_gateway_${t.entityType}" "my_${t.entityType}" {
|
|
162
|
-
`;return m+=s(h),m+=`${Ue}control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
|
|
163
|
-
`,v&&(m+=`${Ue}${v} = {
|
|
164
|
-
`,m+=`${Ue}${Ue}id = konnect_gateway_${v}.my_${v}.id
|
|
165
|
-
`,m+=`${Ue}}
|
|
166
|
-
`),m+=`}
|
|
167
|
-
`,m});return(l,c)=>{const d=i.resolveComponent("KCodeBlock");return i.openBlock(),i.createElementBlock("div",P0,[t.entityRecord?(i.openBlock(),i.createBlock(d,{key:0,id:"terraform-codeblock",code:a.value,language:"terraform",theme:"dark"},null,8,["code"])):i.createCommentVNode("",!0)])}}}),U0={key:0,class:"config-card-display-form"},L0=["data-testid"],F0={key:0,class:"config-card-prop-section-title"},H0=i.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},entityType:{type:String,required:!0,validator:e=>ho.includes(e)},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json","terraform"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=i.useSlots(),{i18n:{t:n}}=Ie.useI18n(),o=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=i.computed(()=>{if(!t.record)return t.record;const a=JSON.parse(JSON.stringify(t.record));return delete a.created_at,delete a.updated_at,a});return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[e.format==="structured"?(i.openBlock(),i.createElementBlock("div",U0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propListTypes,c=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${c}-props`,class:i.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(i.openBlock(),i.createElementBlock("div",F0,i.toDisplayString(c==="advanced"?i.unref(n)("baseConfigCard.sections.advanced"):i.unref(n)("baseConfigCard.sections.plugin")),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.propertyCollections[c],d=>(i.openBlock(),i.createBlock(go,{key:d.key,item:d},i.createSlots({label:i.withCtx(()=>[i.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:i.withCtx(({rowValue:y})=>[i.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[o(d)?{name:"label-tooltip",fn:i.withCtx(()=>[i.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,L0))),128))])):i.createCommentVNode("",!0),e.format==="json"&&s.value?(i.openBlock(),i.createBlock(qd,{key:1,config:t.config,"entity-record":s.value,"fetcher-url":t.fetcherUrl,"request-method":"get"},null,8,["config","entity-record","fetcher-url"])):i.createCommentVNode("",!0),e.format==="yaml"&&s.value?(i.openBlock(),i.createBlock(Wf,{key:2,"entity-record":s.value},null,8,["entity-record"])):i.createCommentVNode("",!0),e.format==="terraform"&&s.value?(i.openBlock(),i.createBlock(Jf,{key:3,"entity-record":s.value,"entity-type":t.entityType},null,8,["entity-record","entity-type"])):i.createCommentVNode("",!0)],64))}}),q0=dt(H0,[["__scopeId","data-v-d15be7fe"]]),Ct="24px",$i=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},K0=e=>(i.pushScopeId("data-v-c1f7c39c"),e=e(),i.popScopeId(),e),z0=["aria-hidden"],G0={key:0,"data-testid":"kui-icon-svg-title"},W0=K0(()=>i.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),J0=i.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Ct,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",G0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),W0],8,z0))]),_:1},8,["aria-hidden","style"]))}}),Y0=$i(J0,[["__scopeId","data-v-c1f7c39c"]]),Z0=e=>(i.pushScopeId("data-v-fbe6ddff"),e=e(),i.popScopeId(),e),Q0=["aria-hidden"],X0={key:0,"data-testid":"kui-icon-svg-title"},e1=Z0(()=>i.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),t1=i.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Ct,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",X0,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),e1],8,Q0))]),_:1},8,["aria-hidden","style"]))}}),r1=$i(t1,[["__scopeId","data-v-fbe6ddff"]]),i1=e=>(i.pushScopeId("data-v-745761f6"),e=e(),i.popScopeId(),e),n1=["aria-hidden"],o1={key:0,"data-testid":"kui-icon-svg-title"},s1=i1(()=>i.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),a1=i.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Ct,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",o1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),s1],8,n1))]),_:1},8,["aria-hidden","style"]))}}),l1=$i(a1,[["__scopeId","data-v-745761f6"]]),c1=e=>(i.pushScopeId("data-v-863d10eb"),e=e(),i.popScopeId(),e),u1=["aria-hidden"],d1={key:0,"data-testid":"kui-icon-svg-title"},f1=c1(()=>i.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),p1=i.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Ct,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",d1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),f1],8,u1))]),_:1},8,["aria-hidden","style"]))}}),h1=$i(p1,[["__scopeId","data-v-863d10eb"]]),y1=e=>(i.pushScopeId("data-v-d9894a05"),e=e(),i.popScopeId(),e),g1=["aria-hidden"],m1={key:0,"data-testid":"kui-icon-svg-title"},b1=y1(()=>i.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),w1=i.defineComponent({__name:"MoreIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Ct,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=i.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ct}),n=i.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,flexShrink:"0",height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon more-icon","data-testid":"kui-icon-wrapper-more-icon",style:i.normalizeStyle(n.value)},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-more-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(i.openBlock(),i.createElementBlock("title",m1,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0),b1],8,g1))]),_:1},8,["aria-hidden","style"]))}}),v1=$i(w1,[["__scopeId","data-v-d9894a05"]]),k1={class:"config-card-title","data-testid":"config-card-title"},C1={class:"config-card-actions"},S1=["href"],x1={class:"config-card-details-section"},A1=i.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},entityType:{type:String,required:!0,validator:e=>ho.includes(e)},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const n=t,o=e,{i18n:{t:s}}=Ie.useI18n(),{getMessageFromError:a}=Ie.useErrors(),{convertKeyToTitle:l}=Ie.useStringHelpers(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:s("baseForm.configuration.json"),value:"json"},{label:s("baseForm.configuration.yaml"),value:"yaml"}];o.enableTerraform&&d.splice(2,0,{label:s("baseForm.configuration.terraform"),value:"terraform"});const y=i.ref("structured"),f=N=>{y.value=N==null?void 0:N.value},x={id:{type:ce.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:pe.Basic},name:{order:1,section:pe.Basic},enabled:{type:ce.BadgeStatus,order:2,section:pe.Basic},updated_at:{type:ce.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:ce.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:ce.BadgeTag,order:-1,section:pe.Basic}},b=i.ref(!1),h=i.ref(!1),g=i.ref(""),m=i.ref({}),v=i.computed(()=>{var N,A,B;if(!m.value)return[];const O=[],H=Object.keys(m.value).length;for(const R in m.value){const J=(A=(N=o.configSchema)==null?void 0:N[R])==null?void 0:A.order,Q=(B=x[R])==null?void 0:B.order;let ne=H;(Q||Q===0)&&(ne=Q===-1?H+1:Q),J&&(ne=J===-1?H+1:J),O.push([R,ne])}return O.sort(function(R,J){return R[1]-J[1]}),O.map(R=>{var J,Q;const ne=R[0],me=(J=m.value)==null?void 0:J[ne],ie=((Q=o.configSchema)==null?void 0:Q[ne])||{},Ee=x[ne];return{key:ne,value:me,hidden:ie.hidden||!1,type:ie.type??((Ee==null?void 0:Ee.type)||ce.Text),label:ie.label??((Ee==null?void 0:Ee.label)||l(ne)),tooltip:ie.tooltip??((Ee==null?void 0:Ee.tooltip)||void 0),section:ie.section??((Ee==null?void 0:Ee.section)||pe.Advanced)}}).filter(R=>!R.hidden&&R.key!==o.pluginConfigKey)}),S=i.computed(()=>{var N,A;if(!m.value||!o.pluginConfigKey)return[];const B=m.value[o.pluginConfigKey]||{},O=Object.keys(B).length,H=[];for(const R in B){const J=(A=(N=o.pluginConfigSchema)==null?void 0:N[R])==null?void 0:A.order,Q=B[R];let ne=Q!=null&&Q!==""?O-1:O;J&&(ne=J===-1?O+1:J),H.push([R,ne])}return H.sort(function(R,J){return R[1]-J[1]}),H.map(R=>{var J;const Q=R[0],ne=B[Q],me=((J=o.pluginConfigSchema)==null?void 0:J[Q])||{};return{key:Q,value:ne,hidden:me.hidden||!1,type:me.type??ce.Text,label:me.label??l(Q),tooltip:me.tooltip??void 0,section:pe.Plugin}}).filter(R=>!R.hidden)}),C=i.computed(()=>{var N,A,B,O;return{basic:(N=v.value)==null?void 0:N.filter(H=>H.section===pe.Basic),advanced:(A=v.value)==null?void 0:A.filter(H=>H.section===pe.Advanced),plugin:(O=S.value)==null?void 0:O.concat((B=v.value)==null?void 0:B.filter(H=>H.section===pe.Plugin))}}),E=i.computed(()=>{const N=[];return C.value.basic.length&&N.push("basic"),C.value.advanced.length&&N.push("advanced"),C.value.plugin.length&&N.push("plugin"),N}),T=i.computed(()=>{var N,A;let B=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):o.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(A=o.config)!=null&&A.workspace?`/${o.config.workspace}`:"")),B=B.replace(/{id}/gi,o.config.entityId),B});return i.watch(b,N=>{n("loading",N)},{immediate:!0}),i.onBeforeMount(async()=>{h.value=!1,b.value=!0;try{const{data:N}=await c.get(T.value);if(o.dataKey)if(typeof N[o.dataKey]<"u")m.value={...N[o.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:o.dataKey}));else m.value={...N};Object.keys(o.configSchema).filter(A=>o.configSchema[A].forceShow).forEach(A=>{m.value&&typeof m.value[A]>"u"&&(m.value[A]=null)}),n("fetch:success",N)}catch(N){const A=a(N);g.value=A.startsWith("code")?s("baseConfigCard.errors.load"):A,h.value=!0,n("fetch:error",N)}finally{b.value=!1}}),(N,A)=>{const B=i.resolveComponent("KLabel"),O=i.resolveComponent("KSelect"),H=i.resolveComponent("KButton"),R=i.resolveComponent("KSkeleton"),J=i.resolveComponent("KEmptyState"),Q=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(Q,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},i.createSlots({actions:i.withCtx(()=>[i.createElementVNode("div",C1,[i.renderSlot(N.$slots,"actions",{},void 0,!0),i.createVNode(B,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.label),1)]),_:1}),i.createVNode(O,{"data-testid":"select-config-format",items:d,onChange:f}),e.configCardDoc?(i.openBlock(),i.createBlock(H,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:i.withCtx(()=>[i.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[i.createVNode(i.unref(r1),{size:i.unref(ig)},null,8,["size"])],8,S1)]),_:1})):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[b.value?(i.openBlock(),i.createBlock(R,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(i.openBlock(),i.createBlock(J,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(g.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",x1,[i.createVNode(q0,{config:e.config,"entity-type":e.entityType,"fetcher-url":T.value,format:y.value,"prop-list-types":E.value,"property-collections":C.value,record:m.value},i.createSlots({_:2},[i.renderList(Object.keys(N.$slots),ne=>({name:ne,fn:i.withCtx(({row:me,rowValue:ie})=>[i.renderSlot(N.$slots,ne,{row:me,rowValue:ie},void 0,!0)])}))]),1032,["config","entity-type","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("span",k1,[i.renderSlot(N.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Yf=dt(A1,[["__scopeId","data-v-85381f68"]]),B1=["novalidate"],I1={class:"form-actions","data-testid":"form-actions"},E1=i.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},entityType:{type:String,required:!0,validator:e=>ho.includes(e)},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const n=t,o=e,s=Yr.useRouter(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:l}=Ie.useErrors(),{axiosInstance:c}=Ie.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=i.ref(!1),y=i.computed(()=>!!o.editId),f=i.ref(!1),x=i.ref(""),b=i.computed(()=>o.canSubmit===!1||o.isReadonly),h=i.ref(!1),g=i.computed(()=>{var T,N;let A=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?A=A.replace(/{controlPlaneId}/gi,((T=o.config)==null?void 0:T.controlPlaneId)||""):o.config.app==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(N=o.config)!=null&&N.workspace?`/${o.config.workspace}`:"")),o.editId?(A=A.replace(/{id}/gi,o.editId),A):(A=A.replace(/\/{id}/gi,""),A)}),m=()=>{h.value=!h.value},v=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):S()},S=()=>{n("cancel")},C=()=>{b.value||n("submit")},E=i.ref([{title:a("baseForm.configuration.json"),hash:"#json"},{title:a("baseForm.configuration.yaml"),hash:"#yaml"}]);return o.enableTerraform&&o.entityType!==dr.Other&&E.value.splice(1,0,{title:a("baseForm.configuration.terraform"),hash:"#terraform"}),i.watch(()=>d.value,T=>{n("loading",T)},{immediate:!0}),i.onBeforeMount(async()=>{if(o.editId)try{f.value=!1,d.value=!0;const{data:T}=await c.get(g.value);n("fetch:success",T)}catch(T){const N=l(T);x.value=N.startsWith("code")?a("baseForm.errors.edit"):N,f.value=!0,n("fetch:error",T)}finally{d.value=!1}}),(T,N)=>{const A=i.resolveComponent("KSkeleton"),B=i.resolveComponent("KEmptyState"),O=i.resolveComponent("KAlert"),H=i.resolveComponent("KButton"),R=i.resolveComponent("KTabs"),J=i.resolveComponent("KSlideout");return i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(A,{key:0,type:"form"})):f.value?(i.openBlock(),i.createBlock(B,{key:1,"action-button-text":i.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:v},{default:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(x.value),1)]),_:1},8,["action-button-text"])):(i.openBlock(),i.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:o.noValidate,onReset:i.withModifiers(S,["prevent"]),onSubmit:i.withModifiers(C,["prevent"])},[i.renderSlot(T.$slots,"default",{},void 0,!0),e.errorMessage?(i.openBlock(),i.createBlock(O,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):i.createCommentVNode("",!0),i.createElementVNode("div",I1,[i.renderSlot(T.$slots,"form-actions",{},()=>[i.createVNode(H,{appearance:"tertiary","data-testid":`${e.entityType}-${y.value?"edit":"create"}-form-view-configuration`,onClick:N[0]||(N[0]=Q=>m())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1},8,["data-testid"]),i.createVNode(H,{appearance:"secondary","data-testid":`${e.entityType}-${y.value?"edit":"create"}-form-cancel`,disabled:e.isReadonly,type:"reset"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["data-testid","disabled"]),i.createVNode(H,{appearance:"primary","data-testid":`${e.entityType}-${y.value?"edit":"create"}-form-submit`,disabled:b.value,type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(a)("baseForm.actions.save")),1)]),_:1},8,["data-testid","disabled"])],!0)])],40,B1)),i.createVNode(J,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:i.unref(a)("baseForm.configuration.title"),visible:h.value,onClose:N[1]||(N[1]=Q=>m())},{default:i.withCtx(()=>[i.createElementVNode("div",null,i.toDisplayString(i.unref(a)("baseForm.configuration.message")),1),i.createVNode(R,{"data-testid":"form-view-configuration-slideout-tabs",tabs:E.value},{json:i.withCtx(()=>[i.createVNode(qd,{config:e.config,"entity-record":o.formFields,"fetcher-url":g.value,"request-method":o.editId?"put":"post"},null,8,["config","entity-record","fetcher-url","request-method"])]),yaml:i.withCtx(()=>[i.createVNode(Wf,{"entity-record":o.formFields},null,8,["entity-record"])]),terraform:i.withCtx(()=>[i.createVNode(Jf,{"entity-record":o.formFields,"entity-type":e.entityType},null,8,["entity-record","entity-type"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Zf=dt(E1,[["__scopeId","data-v-94d27e50"]]),N1=["data-truncate"],O1=i.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const t=e,r=i.computed(()=>{var m;return((m=t.rowEl)==null?void 0:m.querySelector(`[data-testid="${t.keyName}"]`))||null}),n=i.computed(()=>{var m;return((m=r.value)==null?void 0:m.querySelector('[data-truncate="true"]'))||null}),o=i.computed(()=>{var m,v;const S=(m=t.rowEl)==null?void 0:m.querySelectorAll("td");return S?((v=S[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!0}),s=i.computed(()=>o.value||t.tooltip);let a;const l=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{var m,v,S;let C=((m=r.value)==null?void 0:m.clientWidth)||0;if(r.value&&"getComputedStyle"in window){const E=window.getComputedStyle(r.value);C-=(parseFloat(E.paddingLeft)||0)+(parseFloat(E.paddingRight)||0)}y.value=((v=n.value)==null?void 0:v.getBoundingClientRect().width)||0,f.value=C,x.value=((S=d.value)==null?void 0:S.innerText)||""},d=i.ref({}),y=i.ref(0),f=i.ref(0),x=i.ref(""),b=i.computed(()=>[n.value,r.value]),h=i.watch(b,m=>{if(s.value&&(l(),"ResizeObserver"in window&&window)){a=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of m)v&&a.observe(v)}},{immediate:!0,flush:"post",deep:!0}),g=i.computed(()=>s.value?y.value>f.value:!1);return i.onMounted(()=>{c()}),i.onUnmounted(()=>{h()}),(m,v)=>{const S=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:d,class:"content-wrapper"},[s.value?(i.openBlock(),i.createElementBlock("span",{key:0,"data-truncate":s.value||void 0},[i.createVNode(S,{"max-width":"300",placement:"bottom-start",text:g.value?x.value:""},{default:i.withCtx(()=>[i.renderSlot(m.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,N1)):i.renderSlot(m.$slots,"default",{key:1},void 0,!0)],512)}}}),V1=dt(O1,[["__scopeId","data-v-b252463e"]]),_1={class:"toolbar-container"},T1={key:0,class:"toolbar-button-container"},j1=["data-testid"],$1=i.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},sortHandlerFunction:{type:Function,default:()=>({})},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,n=t,{i18n:{t:o}}=Ie.useI18n(),s=i.computed(()=>{var N,A;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(N=r.errorMessage)==null?void 0:N.title,message:(A=r.errorMessage)==null?void 0:A.message}}),a=i.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),l=N=>N.hasData||!!r.query,c=i.computed(()=>{const N=[];return Object.keys(r.tableHeaders).forEach(A=>{const B=r.tableHeaders[A];N.push({label:B.label??A,key:A,sortable:B.sortable??!1,hidable:B.hidable??!0})}),r.enableEntityActions&&N.push({key:"actions",hideLabel:!0}),N}),d=N=>({"data-rowid":N.id,"data-testid":N.name,...r.rowAttributes(N)}),y=i.ref({}),f=N=>{var A;return(A=y.value)==null?void 0:A.$el.querySelector(`[data-rowid="${N.id}"]`)},x=N=>{const A={"data-testid":N.headerKey,...r.cellAttributes(N)};return N.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},b=()=>{n("empty-state-cta-clicked"),h()},h=()=>{n("clear-search-input")},g=i.computed(()=>r.disableRowClick?void 0:(N,A)=>{n("click:row",A)}),m=N=>{n("sort",N)},{setTablePreferences:v,getTablePreferences:S}=Cy(),C=i.ref(S(a.value)),E=i.computed(()=>{const N=S(a.value);return{...r.initialFetcherParams,...N}}),T=N=>{C.value=N,c.value.forEach(A=>{!("hidable"in A)||!C.value.columnVisibility||A.hidable===!1&&(C.value.columnVisibility[A.key]=!0)}),a.value&&v(a.value,N)};return(N,A)=>{const B=i.resolveComponent("KButton"),O=i.resolveComponent("KDropdown"),H=i.resolveComponent("KTable"),R=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(R,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:i.withCtx(()=>[i.createVNode(H,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":x,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?i.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,error:s.value.hasError,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":E.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":d,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":C.value,onEmptyStateActionClick:b,"onRow:click":g.value,onSort:A[0]||(A[0]=J=>m(J)),"onUpdate:tablePreferences":T},i.createSlots({toolbar:i.withCtx(({state:J})=>[i.withDirectives(i.createElementVNode("div",_1,[i.renderSlot(N.$slots,"toolbar-filter",{},void 0,!0),N.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",T1,[i.renderSlot(N.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,l(J)]])]),actions:i.withCtx(({row:J,rowKey:Q,rowValue:ne})=>[i.createElementVNode("div",{class:"actions-container","data-testid":J.name},[i.createVNode(O,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(N.$slots,"actions",{row:J,rowKey:Q,rowValue:ne},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(B,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:i.withCtx(()=>[i.createVNode(i.unref(v1))]),_:1})]),_:2},1032,["width"])],8,j1)]),_:2},[i.renderList(e.tableHeaders,(J,Q)=>({name:Q,fn:i.withCtx(({row:ne,rowKey:me,rowValue:ie})=>[i.createVNode(V1,{"key-name":String(Q),"row-el":f(ne),tooltip:J.tooltip},{default:i.withCtx(()=>[i.renderSlot(N.$slots,Q,{row:ne,rowKey:me,rowValue:ie},()=>[i.createTextVNode(i.toDisplayString(ie),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:i.withCtx(()=>[i.createVNode(i.unref(Y0))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Qf=dt($1,[["__scopeId","data-v-71b4425a"]]),D1={key:0,class:"kong-ui-entity-delete-error"},M1={key:1,class:"description"},R1=i.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:t}){const{i18nT:r}=Ie.useI18n(),n=e,o=t,s=i.computed(()=>n.needConfirm?n.entityName:""),a=()=>{o("cancel")},l=()=>{o("proceed")};return(c,d)=>{const y=i.resolveComponent("KAlert"),f=i.resolveComponent("KPrompt");return i.openBlock(),i.createBlock(f,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:l},{default:i.withCtx(()=>[e.error?(i.openBlock(),i.createElementBlock("div",D1,[i.createVNode(y,{appearance:"danger"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.error),1)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(i.unref(r),{class:"message",keypath:n.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},i.createSlots({entityType:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.entityType),1)]),_:2},[n.entityName?{name:"entityName",fn:i.withCtx(()=>[i.createElementVNode("strong",null,i.toDisplayString(n.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),n.description||c.$slots.description?(i.openBlock(),i.createElementBlock("div",M1,[i.renderSlot(c.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(n.description),1)],!0)])):i.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Xf=dt(R1,[["__scopeId","data-v-4361d622"]]),P1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},U1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},L1=["fill"],F1={mask:"url(#mask0_180_20349)"},H1=["fill"],ep=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Xy})`}},setup(e){return(t,r)=>(i.openBlock(),i.createElementBlock("svg",P1,[i.createElementVNode("mask",U1,[i.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,L1)]),i.createElementVNode("g",F1,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,H1)])]))}}),q1={key:1,class:"kong-ui-entity-filter"},K1={class:"kong-ui-entity-filter-menu"},z1=["data-testid"],G1=["onClick","onKeydown"],W1={class:"menu-item-indicator"},J1={class:"menu-item-body"},Y1=["for"],Z1={class:"menu-item-buttons"},Q1={class:"filter-clear-button-container"},X1=i.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{i18n:{t:r}}=Ie.useI18n(),n=e,o=t,s=i.ref(!1),a=i.ref({}),l=i.ref(new Set),c=i.computed(()=>{const E=[];return new URLSearchParams(n.modelValue).forEach((T,N)=>{T!==""&&E.push(N)}),E}),d=i.computed(()=>{const E=n.config.fields;return Object.keys(E).filter(T=>{var N;return(N=E==null?void 0:E[T])==null?void 0:N.searchable}).map(T=>({label:E[T].label||T,value:T,expanded:!1}))});i.watch(()=>n.modelValue,E=>{a.value={},new URLSearchParams(E).forEach((T,N)=>{a.value[N]=T})});const y=()=>{s.value=!s.value},f=E=>{l.value.has(E)?l.value.delete(E):l.value.add(E)},x=E=>{o("update:modelValue",E)},b=()=>{x("")},h=E=>`filter-${E}`,g=E=>{var T,N;return(((N=(T=n.config.schema)==null?void 0:T[E])==null?void 0:N.values)??[]).map(A=>({value:A,label:A}))},m=E=>{var T,N;return((N=(T=n.config.schema)==null?void 0:T[E])==null?void 0:N.type)??"text"},v=E=>{a.value={...a.value,[E]:""},C()},S=()=>{a.value={},C(!0)},C=(E=!1)=>{const T=Object.keys(a.value).reduce((N,A)=>(a.value[A]&&(N[A]=`${a.value[A]}`),N),{});E&&(s.value=!1),o("update:modelValue",new URLSearchParams(T).toString())};return(E,T)=>{const N=i.resolveComponent("KInput"),A=i.resolveComponent("KButton"),B=i.resolveComponent("KSelect");return e.config.isExactMatch?(i.openBlock(),i.createBlock(N,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":x},{before:i.withCtx(()=>[i.createVNode(ep)]),after:i.withCtx(()=>[i.withDirectives(i.createVNode(i.unref(h1),{class:"kong-ui-entity-filter-clear",onClick:b},null,512),[[i.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",q1,[i.createVNode(A,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:i.withCtx(()=>[i.createVNode(ep),i.createTextVNode(" "+i.toDisplayString(i.unref(r)("filter.filterButtonText"))+" "+i.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),i.withDirectives(i.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:y},null,512),[[i.vShow,s.value]]),i.withDirectives(i.createElementVNode("div",K1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,O=>{var H,R;return i.openBlock(),i.createElementBlock("div",{key:O.value,class:"kong-ui-entity-filter-menu-item","data-testid":O.value},[i.createElementVNode("span",{class:i.normalizeClass(["menu-item-title",{expanded:l.value.has(O.value)}]),role:"button",tabindex:"0",onClick:J=>f(O.value),onKeydown:i.withKeys(J=>f(O.value),["enter"])},[i.createTextVNode(i.toDisplayString(O.label)+" ",1),i.withDirectives(i.createElementVNode("span",W1,null,512),[[i.vShow,c.value.includes(O.value)]]),i.createVNode(i.unref(l1),{class:i.normalizeClass(["menu-item-expand-icon",{expanded:l.value.has(O.value)}]),color:i.unref(tg)},null,8,["class","color"])],42,G1),i.withDirectives(i.createElementVNode("div",J1,[i.createElementVNode("label",{class:"menu-item-label",for:h(O.value)},i.toDisplayString(i.unref(r)("filter.fieldLabel")),9,Y1),((R=(H=e.config.schema)==null?void 0:H[O.value])==null?void 0:R.type)==="select"?(i.openBlock(),i.createBlock(B,{key:0,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,items:g(O.value),placeholder:i.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(N,{key:1,id:h(O.value),modelValue:a.value[O.value],"onUpdate:modelValue":J=>a.value[O.value]=J,autocomplete:"off",placeholder:i.unref(r)("filter.inputPlaceholder"),type:m(O.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[i.vShow,l.value.has(O.value)]]),i.withDirectives(i.createElementVNode("div",Z1,[i.createVNode(A,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:T[0]||(T[0]=J=>C(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.applyButtonText")),1)]),_:1}),i.createVNode(A,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:J=>v(O.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[i.vShow,l.value.has(O.value)]])],8,z1)}),128)),i.createElementVNode("div",Q1,[i.createVNode(A,{appearance:"tertiary",size:"small",onClick:S},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[i.vShow,s.value]])]))}}}),tp=dt(X1,[["__scopeId","data-v-94990087"]]),$t=i.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=i.ref(void 0),n=i.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return i.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>n.value?i.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):i.createCommentVNode("",!0)}});let So;const eb=new Uint8Array(16);function tb(){if(!So&&(So=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!So))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return So(eb)}const Te=[];for(let e=0;e<256;++e)Te.push((e+256).toString(16).slice(1));function rb(e,t=0){return Te[e[t+0]]+Te[e[t+1]]+Te[e[t+2]]+Te[e[t+3]]+"-"+Te[e[t+4]]+Te[e[t+5]]+"-"+Te[e[t+6]]+Te[e[t+7]]+"-"+Te[e[t+8]]+Te[e[t+9]]+"-"+Te[e[t+10]]+Te[e[t+11]]+Te[e[t+12]]+Te[e[t+13]]+Te[e[t+14]]+Te[e[t+15]]}const ib=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rp={randomUUID:ib};function nb(e,t,r){if(rp.randomUUID&&!t&&!e)return rp.randomUUID();e=e||{};const n=e.random||(e.rng||tb)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return rb(n)}const ob=["aria-labelledby"],sb={class:"form-section-wrapper"},ab={key:1,class:"form-section-description"},lb={key:2,class:"form-section-footer"},cb={class:"form-section-content"},ub=i.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(e){const t=i.useSlots(),r=nb();return(n,o)=>(i.openBlock(),i.createElementBlock("div",{"aria-labelledby":e.title?i.unref(r):void 0,class:i.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[i.createElementVNode("div",sb,[e.hideInfoHeader?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.titleTag),{key:0,id:i.unref(r),class:"form-section-title"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(e.title),1)]),_:1},8,["id"])):i.createCommentVNode("",!0),e.description||i.unref(t).description?(i.openBlock(),i.createElementBlock("div",ab,[i.renderSlot(n.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(e.description),1)],!0)])):i.createCommentVNode("",!0),i.unref(t).footer?(i.openBlock(),i.createElementBlock("div",lb,[i.renderSlot(n.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",cb,[i.renderSlot(n.$slots,"default",{},void 0,!0)])])],10,ob))}}),xo=dt(ub,[["__scopeId","data-v-b1f74200"]]),{useAxios:Ao,useDeleteUrlBuilder:ip,useErrors:np,useExternalLinkCreator:ow,useFetchUrlBuilder:sw,useFetcher:op,useDebouncedFilter:aw,useStringHelpers:sp,useHelpers:ap,useGatewayFeatureSupported:lw,useTruncationDetector:cw,useValidators:uw}=Ie,db={class:"kong-ui-entities-certificates-list"},fb={key:0},pb={key:1},hb={key:0},yb={key:1},gb={key:0},mb={key:1},bb={key:1},wb={key:1},vb=i.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var te;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ut.useI18n(),l=Yr.useRouter(),{axiosInstance:c}=Ao((te=n.config)==null?void 0:te.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),x={subject:{label:o("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},b=i.computed(()=>{var K,fe;let U=`${n.config.apiBaseUrl}${Ni.list[n.config.app]}`;return n.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((K=n.config)==null?void 0:K.controlPlaneId)||""):n.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(fe=n.config)!=null&&fe.workspace?`/${n.config.workspace}`:"")),U}),h=i.ref(""),g=i.computed(()=>{const U=n.config.app==="konnect"||n.config.isExactMatch;return U?{isExactMatch:U,placeholder:o("certificates.search.placeholder")}:{isExactMatch:U,schema:n.config.filterSchema}}),{fetcher:m,fetcherState:v}=op(n.config,b.value),S=()=>{h.value=""},C=()=>{d.value++},E=i.ref(null),T=(U,K)=>{const fe=U.id;if(!K(fe)){r("copy:error",{entity:U,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:o("certificates.copy.success",{val:fe})})},N=(U,K)=>{const fe=JSON.stringify(U);if(!K(fe)){r("copy:error",{entity:U,message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,message:o("certificates.copy.success_brief")})},A=async U=>{var fe;await((fe=n.canRetrieve)==null?void 0:fe.call(n,U))&&l.push(n.config.getViewRoute(U.id))},B=U=>({label:o("certificates.actions.view"),to:n.config.getViewRoute(U)}),O=U=>({label:o("certificates.actions.edit"),to:n.config.getEditRoute(U)}),H=U=>{if(n.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:n.config.getCreateSniRoute(U)}},R=i.ref(void 0),J=i.ref(!1),Q=i.ref(!1),ne=i.ref(""),me=ip(n.config,b.value),{certificateDataCache:ie,getCertificateData:Ee}=ut.useCertificate(),zr=U=>{R.value=U,J.value=!0},Gr=()=>{J.value=!1},hr=async()=>{var U,K,fe;if((U=R.value)!=null&&U.id){Q.value=!0;try{await c.delete(me(R.value.id)),Q.value=!1,J.value=!1,d.value++,r("delete:success",R.value)}catch(Le){ne.value=((fe=(K=Le.response)==null?void 0:K.data)==null?void 0:fe.message)||Le.message||o("certificates.errors.delete"),r("error",Le)}finally{Q.value=!1}}},Dt=i.ref(!1);i.watch(v,U=>{var K,fe,Le,Xe;if(Array.isArray((K=U==null?void 0:U.response)==null?void 0:K.data)&&(Dt.value=U.response.data.length>0),U.status===qt.Error){E.value={title:o("certificates.errors.general")},(Xe=(Le=(fe=U.error)==null?void 0:fe.response)==null?void 0:Le.data)!=null&&Xe.message&&(E.value.message=U.error.response.data.message),r("error",U.error);return}ie.value={},E.value=null});const ee=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(ee.value.title=o("certificates.list.empty_state.title"),ee.value.ctaText=o("certificates.actions.create"))}),(U,K)=>{const fe=i.resolveComponent("KButton"),Le=i.resolveComponent("KCopy"),Xe=i.resolveComponent("KBadge"),Wr=i.resolveComponent("KTruncate"),re=i.resolveComponent("KDropdownItem"),xe=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",db,[i.createVNode(i.unref(Qf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ee.value,"enable-entity-actions":"","error-message":E.value,fetcher:i.unref(m),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":i.unref(x),"use-action-outside":e.useActionOutside,onClearSearchInput:S,"onClick:row":K[2]||(K[2]=Z=>A(Z)),onSort:C},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(tp),{modelValue:h.value,"onUpdate:modelValue":K[0]||(K[0]=Z=>h.value=Z),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref($t),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(fe,{appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[i.vShow,Dt.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",fb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.subject?Z.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",pb,i.toDisplayString(i.unref(Ee)(Z).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",hb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.expiry?i.unref(s)(Z.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",yb,i.toDisplayString(i.unref(Ee)(Z).schemaExpiry?i.unref(s)(i.unref(Ee)(Z).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:Z})=>{var Ae;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",gb,i.toDisplayString((Ae=Z==null?void 0:Z.metadata)!=null&&Ae.dns_names?`dns=${Z.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",mb,i.toDisplayString(i.unref(Ee)(Z).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:Z})=>[Z!=null&&Z.cert?(i.openBlock(),i.createBlock(Le,{key:0,"data-testid":"copy-certificate-cert",text:Z.cert,truncate:""},null,8,["text"])):(i.openBlock(),i.createElementBlock("span",bb,"-"))]),tags:i.withCtx(({row:Z})=>{var Ae;return[((Ae=Z==null?void 0:Z.tags)==null?void 0:Ae.length)>0?(i.openBlock(),i.createBlock(Wr,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Z==null?void 0:Z.tags,Jr=>(i.openBlock(),i.createBlock(Xe,{key:Jr,onClick:K[1]||(K[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Jr),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",wb,"-"))]}),actions:i.withCtx(({row:Z})=>[i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-id",onClick:Jr=>T(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(xe,null,{default:i.withCtx(({copyToClipboard:Ae})=>[i.createVNode(re,{"data-testid":"action-entity-copy-json",onClick:Jr=>N(Z,Ae)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref($t),{"auth-function":()=>e.canRetrieve(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-view","has-divider":"",item:B(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref($t),{"auth-function":()=>e.canEdit(Z)},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-edit",item:O(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(i.openBlock(),i.createBlock(i.unref($t),{key:0,"auth-function":()=>e.canCreateSni()},{default:i.withCtx(()=>[i.createVNode(re,{"data-testid":"action-entity-add-sni",item:H(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref($t),{"auth-function":()=>e.canDelete(Z)},{default:i.withCtx(()=>[i.createVNode(re,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ae=>zr(Z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),i.createVNode(i.unref(Xf),{"action-pending":Q.value,"entity-type":i.unref(qa).Certificate,error:ne.value,title:i.unref(o)("certificates.delete.title"),visible:J.value,onCancel:Gr,onProceed:hr},{description:i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(o)("certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),pr=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},kb=pr(vb,[["__scopeId","data-v-8059a087"]]),Cb="#d60027",Sb={class:"sni-field-container"},xb={key:1,class:"sni-field-controls-container"},Ab={key:0},Bb=pr(i.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(e,{emit:t}){const r=e,n=t,{i18nT:o,i18n:{t:s}}=ut.useI18n(),a=i.ref([]);return i.watch(r.modelValue,l=>{a.value=[...l]},{immediate:!0,deep:!0}),i.watch(a,l=>{n("update:modelValue",l)},{deep:!0}),(l,c)=>{const d=i.resolveComponent("KLabel"),y=i.resolveComponent("KInput"),f=i.resolveComponent("KButton"),x=i.resolveComponent("router-link");return i.openBlock(),i.createElementBlock("div",Sb,[i.createVNode(d,{info:i.unref(s)("certificates.form.fields.snis.tooltip")},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(b,h)=>(i.openBlock(),i.createElementBlock("div",{key:h,class:"sni-field-input"},[!e.isEditing||a.value[h]?(i.openBlock(),i.createBlock(y,{key:0,modelValue:a.value[h],"onUpdate:modelValue":g=>a.value[h]=g,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${h+1}`,disabled:e.isEditing,placeholder:i.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):i.createCommentVNode("",!0),e.isEditing?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",xb,[i.createVNode(f,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:g=>l.$emit("remove",h)},{default:i.withCtx(()=>[i.createVNode(i.unref(Ap),{color:i.unref(Cb)},null,8,["color"])]),_:2},1032,["onClick"]),i.createVNode(f,{appearance:"tertiary","data-testid":"add-sni",disabled:h!==a.value.length-1,icon:"",onClick:c[0]||(c[0]=g=>l.$emit("add"))},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo))]),_:2},1032,["disabled"])]))]))),128)),a.value.length===0?(i.openBlock(),i.createElementBlock("div",Ab,[i.createVNode(f,{onClick:c[1]||(c[1]=b=>l.$emit("add"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):i.createCommentVNode("",!0),e.isEditing?(i.openBlock(),i.createBlock(i.unref(o),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:i.withCtx(()=>[i.createVNode(x,{to:e.sniListRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),Ib={class:"kong-ui-entities-certificates-form"},Eb=pr(i.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(e,{emit:t}){var N;const r=t,n=e,o=Yr.useRouter(),{i18nT:s,i18n:{t:a}}=ut.useI18n(),{getMessageFromError:l}=np(),{axiosInstance:c}=Ao((N=n.config)==null?void 0:N.axiosRequestConfig),d=i.computed(()=>Ni.form[n.config.app].edit),y=i.computed(()=>n.certificateId?Ht.Edit:Ht.Create),f=i.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),x=i.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),b=i.computed(()=>(y.value===Ht.Create||JSON.stringify(f.fields)!==JSON.stringify(x))&&!!f.fields.cert&&!!f.fields.key),h=A=>{var B,O;f.fields.cert=(A==null?void 0:A.cert)||"",f.fields.key=(A==null?void 0:A.key)||"",f.fields.certAlt=(A==null?void 0:A.cert_alt)||"",f.fields.keyAlt=(A==null?void 0:A.key_alt)||"",f.fields.snis=(B=A==null?void 0:A.snis)!=null&&B.length?A.snis:[""],f.fields.tags=((O=A==null?void 0:A.tags)==null?void 0:O.join(", "))||"",Object.assign(x,f.fields)},g=()=>{o.push(n.config.cancelRoute)},m=()=>{f.fields.snis.push("")},v=A=>{f.fields.snis.splice(A,1)},S=i.computed(()=>{var B,O;let A=`${n.config.apiBaseUrl}${Ni.form[n.config.app].validate}`;return n.config.app==="konnect"?A=A.replace(/{controlPlaneId}/gi,((B=n.config)==null?void 0:B.controlPlaneId)||""):n.config.app==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),A=A.replace(/{id}/gi,n.certificateId),A}),C=i.computed(()=>{var B,O;let A=`${n.config.apiBaseUrl}${Ni.form[n.config.app][y.value]}`;return n.config.app==="konnect"?A=A.replace(/{controlPlaneId}/gi,((B=n.config)==null?void 0:B.controlPlaneId)||""):n.config.app==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(O=n.config)!=null&&O.workspace?`/${n.config.workspace}`:"")),A=A.replace(/{id}/gi,n.certificateId),A}),E=i.computed(()=>{var A,B;return{cert:f.fields.cert,key:f.fields.key,cert_alt:f.fields.certAlt||null,key_alt:f.fields.keyAlt||null,...n.showSnisField?{snis:f.fields.snis.filter(Boolean)}:{},tags:(B=(A=f.fields.tags.split(","))==null?void 0:A.map(O=>String(O||"").trim()))==null?void 0:B.filter(O=>O!=="")}}),T=async()=>{var A,B,O,H,R,J,Q,ne,me;try{f.isReadonly=!0;let ie;await c.post(S.value,E.value),y.value==="create"?ie=await c.post(C.value,E.value):y.value==="edit"&&(ie=((A=n.config)==null?void 0:A.app)==="konnect"?await c.put(C.value,E.value):await c.patch(C.value,E.value)),f.fields.cert=((B=ie==null?void 0:ie.data)==null?void 0:B.cert)||"",f.fields.key=((O=ie==null?void 0:ie.data)==null?void 0:O.key)||"",f.fields.certAlt=((H=ie==null?void 0:ie.data)==null?void 0:H.cert_alt)||"",f.fields.keyAlt=((R=ie==null?void 0:ie.data)==null?void 0:R.key_alt)||"",f.fields.snis=(Q=(J=ie==null?void 0:ie.data)==null?void 0:J.snis)!=null&&Q.length?ie.data.snis:[""],f.fields.tags=((me=(ne=ie==null?void 0:ie.data)==null?void 0:ne.tags)==null?void 0:me.join(", "))||"",Object.assign(x,f.fields),r("update",ie==null?void 0:ie.data)}catch(ie){f.errorMessage=l(ie),r("error",ie)}finally{f.isReadonly=!1}};return(A,B)=>{const O=i.resolveComponent("KTextArea"),H=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Ib,[i.createVNode(i.unref(Zf),{"can-submit":b.value,config:e.config,"edit-id":e.certificateId,"enable-terraform":e.enableTerraform,"entity-type":i.unref(dr).Certificate,"error-message":f.errorMessage,"fetch-url":d.value,"form-fields":E.value,"is-readonly":f.isReadonly,onCancel:g,"onFetch:error":B[7]||(B[7]=R=>A.$emit("error",R)),"onFetch:success":h,onLoading:B[8]||(B[8]=R=>A.$emit("loading",R)),onSubmit:T},{default:i.withCtx(()=>[i.createVNode(i.unref(xo),{description:i.unref(a)("certificates.form.sections.ssl.description"),title:i.unref(a)("certificates.form.sections.ssl.title")},{default:i.withCtx(()=>[i.createVNode(O,{modelValue:f.fields.cert,"onUpdate:modelValue":B[0]||(B[0]=R=>f.fields.cert=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:i.unref(a)("certificates.form.fields.cert.label"),readonly:f.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:f.fields.key,"onUpdate:modelValue":B[1]||(B[1]=R=>f.fields.key=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:i.unref(a)("certificates.form.fields.key.label"),readonly:f.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:f.fields.certAlt,"onUpdate:modelValue":B[2]||(B[2]=R=>f.fields.certAlt=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:i.unref(a)("certificates.form.fields.cert_alt.label"),readonly:f.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(O,{modelValue:f.fields.keyAlt,"onUpdate:modelValue":B[3]||(B[3]=R=>f.fields.keyAlt=R),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:i.unref(a)("certificates.form.fields.key_alt.label"),readonly:f.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),e.showSnisField&&e.config.sniListRoute?(i.openBlock(),i.createBlock(Bb,{key:0,modelValue:f.fields.snis,"onUpdate:modelValue":B[4]||(B[4]=R=>f.fields.snis=R),"is-editing":y.value===i.unref(Ht).Edit,"sni-list-route":e.config.sniListRoute,onAdd:m,onRemove:B[5]||(B[5]=R=>v(R))},null,8,["modelValue","is-editing","sni-list-route"])):i.createCommentVNode("",!0)]),_:1},8,["description","title"]),i.createVNode(i.unref(xo),{description:i.unref(a)("certificates.form.sections.general.description"),title:i.unref(a)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(H,{modelValue:f.fields.tags,"onUpdate:modelValue":B[6]||(B[6]=R=>f.fields.tags=R),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:i.unref(a)("certificates.form.fields.tags.help"),label:i.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:i.unref(a)("certificates.form.fields.tags.placeholder"),readonly:f.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-1f98afe8"]]),Bo="/v2/control-planes/{controlPlaneId}/core-entities",Io="/{workspace}",Di={list:{konnect:`${Bo}/ca_certificates`,kongManager:`${Io}/ca_certificates`},form:{konnect:{create:`${Bo}/ca_certificates`,edit:`${Bo}/ca_certificates/{id}`,validate:`${Bo}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${Io}/ca_certificates`,edit:`${Io}/ca_certificates/{id}`,validate:`${Io}/schemas/ca_certificates/validate`}}},Nb={class:"kong-ui-ca-certificate-entity-config-card"},Ob={key:0},Vb=pr(i.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],n=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=ut.useI18n(),{convertKeyToTitle:l}=sp(),{getPropValue:c}=ap(),{getCertificateData:d}=ut.useCertificate(),y=i.computed(()=>Di.form[o.config.app].edit),f=i.ref(),x=i.computed(()=>{if(f.value)return d(f.value)}),b=i.computed(()=>{var C;return((C=x.value)==null?void 0:C.schemaIssuer)||""}),h=i.computed(()=>{var C,E;return(C=x.value)!=null&&C.schemaExpiry?a((E=x.value)==null?void 0:E.schemaExpiry):""}),g=i.computed(()=>{var C;return((C=x.value)==null?void 0:C.schemaKeyUsages)||[]}),m=(C,E)=>{const T=c("rowValue",E);if(C==="expiry")return h.value;if(C==="key_usages")return g.value;if(T)return T[C]},v=C=>{f.value=C,n("fetch:success",C)},S=i.ref({id:{},updated_at:{},created_at:{},cert:{section:pe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:pe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:pe.Basic,type:ce.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:pe.Basic,order:1.7,forceShow:!0},issuer:{section:pe.Basic,order:1.5,forceShow:!0},key_usages:{section:pe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(C,E)=>{const T=i.resolveComponent("KCodeBlock"),N=i.resolveComponent("KLabel"),A=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",Nb,[i.createVNode(i.unref(Yf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":S.value,"enable-terraform":e.enableTerraform,"entity-type":i.unref(dr).CaCertificate,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":E[0]||(E[0]=B=>C.$emit("fetch:error",B)),"onFetch:success":v,onLoading:E[1]||(E[1]=B=>C.$emit("loading",B))},{cert:i.withCtx(B=>[i.unref(c)("rowValue",B)?(i.openBlock(),i.createBlock(T,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",B),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),"metadata-label":i.withCtx(()=>[i.createVNode(N,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(B=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",B)).filter(O=>!r.includes(O)),O=>(i.openBlock(),i.createBlock(i.unref(go),{key:O,"data-testid":`ca-cert-metadata-${O}`,item:{key:O,label:i.unref(l)(O),value:m(O,B),type:O==="key_usages"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.value||"–"),1)]),key_usages:i.withCtx(()=>[g.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ob,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(g.value,(B,O)=>(i.openBlock(),i.createBlock(A,{key:`key_usages-badge-tag-${O}`,class:"config-badge","data-testid":`key_usages-badge-tag-${O}`,tooltip:B,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(B),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-46ffa2f8"]]),_b={class:"kong-ui-entities-ca-certificates-list"},Tb={key:0},jb={key:1},$b={key:0},Db={key:1},Mb={key:1},Rb=pr(i.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var ee;const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ut.useI18n(),l=Yr.useRouter(),{axiosInstance:c}=Ao((ee=n.config)==null?void 0:ee.axiosRequestConfig),d=i.ref(1),y=i.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),x={issuer:{label:o("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},b=i.computed(()=>{var U,K;let te=`${n.config.apiBaseUrl}${Di.list[n.config.app]}`;return n.config.app==="konnect"?te=te.replace(/{controlPlaneId}/gi,((U=n.config)==null?void 0:U.controlPlaneId)||""):n.config.app==="kongManager"&&(te=te.replace(/\/{workspace}/gi,(K=n.config)!=null&&K.workspace?`/${n.config.workspace}`:"")),te}),h=i.ref(""),g=i.computed(()=>{const te=n.config.app==="konnect"||n.config.isExactMatch;return te?{isExactMatch:te,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:te,schema:n.config.filterSchema}}),{fetcher:m,fetcherState:v}=op(n.config,b.value),S=()=>{h.value=""},C=()=>{d.value++},E=i.ref(null),T=(te,U)=>{const K=te.id;if(!U(K)){r("copy:error",{entity:te,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,field:"id",message:o("ca-certificates.copy.success",{val:K})})},N=(te,U)=>{const K=JSON.stringify(te);if(!U(K)){r("copy:error",{entity:te,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:te,message:o("ca-certificates.copy.success_brief")})},A=async te=>{var K;await((K=n.canRetrieve)==null?void 0:K.call(n,te))&&l.push(n.config.getViewRoute(te.id))},B=te=>({label:o("ca-certificates.actions.view"),to:n.config.getViewRoute(te)}),O=te=>({label:o("ca-certificates.actions.edit"),to:n.config.getEditRoute(te)}),H=i.ref(void 0),R=i.ref(!1),J=i.ref(!1),Q=i.ref(""),ne=ip(n.config,b.value),{certificateDataCache:me,getCertificateData:ie}=ut.useCertificate(),Ee=te=>{H.value=te,R.value=!0},zr=()=>{R.value=!1},Gr=async()=>{var te,U,K;if((te=H.value)!=null&&te.id){J.value=!0;try{await c.delete(ne(H.value.id)),J.value=!1,R.value=!1,d.value++,r("delete:success",H.value)}catch(fe){Q.value=((K=(U=fe.response)==null?void 0:U.data)==null?void 0:K.message)||fe.message||o("ca-certificates.errors.delete"),r("error",fe)}finally{J.value=!1}}},hr=i.ref(!1);i.watch(v,te=>{var U,K,fe,Le;if(Array.isArray((U=te==null?void 0:te.response)==null?void 0:U.data)&&(hr.value=te.response.data.length>0),te.status===qt.Error){E.value={title:o("ca-certificates.errors.general")},(Le=(fe=(K=te.error)==null?void 0:K.response)==null?void 0:fe.data)!=null&&Le.message&&(E.value.message=te.error.response.data.message),r("error",te.error);return}me.value={},E.value=null});const Dt=i.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:`${o("ca-certificates.list.empty_state.description")}${n.config.additionMessageForEmptyState?` ${n.config.additionMessageForEmptyState}`:""}`,title:o("ca-certificates.title")});return i.onBeforeMount(async()=>{await n.canCreate()&&(Dt.value.title=o("ca-certificates.list.empty_state.title"),Dt.value.ctaText=o("ca-certificates.actions.create"))}),(te,U)=>{const K=i.resolveComponent("KButton"),fe=i.resolveComponent("KBadge"),Le=i.resolveComponent("KTruncate"),Xe=i.resolveComponent("KDropdownItem"),Wr=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",_b,[i.createVNode(i.unref(Qf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Dt.value,"enable-entity-actions":"","error-message":E.value,fetcher:i.unref(m),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":i.unref(x),"use-action-outside":e.useActionOutside,onClearSearchInput:S,"onClick:row":U[2]||(U[2]=re=>A(re)),onSort:C},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref(tp),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=re=>h.value=re),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[(i.openBlock(),i.createBlock(i.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[i.createVNode(i.unref($t),{"auth-function":()=>e.canCreate()},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:e.config.createRoute},{default:i.withCtx(()=>[i.createVNode(i.unref(Eo)),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[i.vShow,hr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Tb,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.issuer?re.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",jb,i.toDisplayString(i.unref(ie)(re).schemaIssuer||"-"),1))]}),expiry:i.withCtx(({row:re})=>{var xe;return[e.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",$b,i.toDisplayString((xe=re==null?void 0:re.metadata)!=null&&xe.expiry?i.unref(s)(re.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",Db,i.toDisplayString(i.unref(ie)(re).schemaExpiry?i.unref(s)(i.unref(ie)(re).schemaExpiry):"-"),1))]}),tags:i.withCtx(({row:re})=>{var xe;return[((xe=re==null?void 0:re.tags)==null?void 0:xe.length)>0?(i.openBlock(),i.createBlock(Le,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(re==null?void 0:re.tags,Z=>(i.openBlock(),i.createBlock(fe,{key:Z,onClick:U[1]||(U[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Z),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Mb,"-"))]}),actions:i.withCtx(({row:re})=>[i.createVNode(Wr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Xe,{"data-testid":"action-entity-copy-id",onClick:Z=>T(re,xe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(Wr,null,{default:i.withCtx(({copyToClipboard:xe})=>[i.createVNode(Xe,{"data-testid":"action-entity-copy-json",onClick:Z=>N(re,xe)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref($t),{"auth-function":()=>e.canRetrieve(re)},{default:i.withCtx(()=>[i.createVNode(Xe,{"data-testid":"action-entity-view","has-divider":"",item:B(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref($t),{"auth-function":()=>e.canEdit(re)},{default:i.withCtx(()=>[i.createVNode(Xe,{"data-testid":"action-entity-edit",item:O(re.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref($t),{"auth-function":()=>e.canDelete(re)},{default:i.withCtx(()=>[i.createVNode(Xe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Ee(re)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),i.createVNode(i.unref(Xf),{"action-pending":J.value,"entity-type":i.unref(qa).CACertificate,error:Q.value,title:i.unref(o)("ca-certificates.delete.title"),visible:R.value,onCancel:zr,onProceed:Gr},{description:i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-8620b081"]]),Pb={class:"kong-ui-entities-ca-certificates-form"},Ub=pr(i.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(e,{emit:t}){var C;const r=t,n=e,o=Yr.useRouter(),{i18n:{t:s}}=ut.useI18n(),{getMessageFromError:a}=np(),{axiosInstance:l}=Ao((C=n.config)==null?void 0:C.axiosRequestConfig),c=i.computed(()=>Di.form[n.config.app].edit),d=i.computed(()=>n.certificateId?Ht.Edit:Ht.Create),y=i.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),f=i.reactive({cert:"",certDigest:"",tags:""}),x=i.computed(()=>(d.value===Ht.Create||JSON.stringify(y.fields)!==JSON.stringify(f))&&!!y.fields.cert),b=E=>{var T;y.fields.cert=(E==null?void 0:E.cert)||"",y.fields.certDigest=(E==null?void 0:E.cert_digest)||"",y.fields.tags=((T=E==null?void 0:E.tags)==null?void 0:T.join(", "))||"",Object.assign(f,y.fields)},h=()=>{o.push(n.config.cancelRoute)},g=i.computed(()=>{var T,N;let E=`${n.config.apiBaseUrl}${Di.form[n.config.app].validate}`;return n.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),E=E.replace(/{id}/gi,n.certificateId),E}),m=i.computed(()=>{var T,N;let E=`${n.config.apiBaseUrl}${Di.form[n.config.app][d.value]}`;return n.config.app==="konnect"?E=E.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(E=E.replace(/\/{workspace}/gi,(N=n.config)!=null&&N.workspace?`/${n.config.workspace}`:"")),E=E.replace(/{id}/gi,n.certificateId),E}),v=i.computed(()=>{var E,T;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(T=(E=y.fields.tags.split(","))==null?void 0:E.map(N=>String(N||"").trim()))==null?void 0:T.filter(N=>N!=="")}}),S=async()=>{var E,T,N,A,B;try{y.isReadonly=!0;let O;await l.post(g.value,v.value),d.value==="create"?O=await l.post(m.value,v.value):d.value==="edit"&&(O=((E=n.config)==null?void 0:E.app)==="konnect"?await l.put(m.value,v.value):await l.patch(m.value,v.value)),y.fields.cert=((T=O==null?void 0:O.data)==null?void 0:T.cert)||"",y.fields.certDigest=((N=O==null?void 0:O.data)==null?void 0:N.cert_digest)||"",y.fields.tags=((B=(A=O==null?void 0:O.data)==null?void 0:A.tags)==null?void 0:B.join(", "))||"",Object.assign(f,y.fields),r("update",O==null?void 0:O.data)}catch(O){y.errorMessage=a(O),r("error",O)}finally{y.isReadonly=!1}};return(E,T)=>{const N=i.resolveComponent("KTextArea"),A=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Pb,[i.createVNode(i.unref(Zf),{"can-submit":x.value,config:e.config,"edit-id":e.certificateId,"enable-terraform":e.enableTerraform,"entity-type":i.unref(dr).CaCertificate,"error-message":y.errorMessage,"fetch-url":c.value,"form-fields":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":T[3]||(T[3]=B=>E.$emit("error",B)),"onFetch:success":b,onLoading:T[4]||(T[4]=B=>E.$emit("loading",B)),onSubmit:S},{default:i.withCtx(()=>[i.createVNode(i.unref(xo),{description:i.unref(s)("ca-certificates.form.sections.cert.description"),title:i.unref(s)("ca-certificates.form.sections.cert.title")},{default:i.withCtx(()=>[i.createVNode(N,{modelValue:y.fields.cert,"onUpdate:modelValue":T[0]||(T[0]=B=>y.fields.cert=B),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:i.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:i.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),i.createVNode(A,{modelValue:y.fields.certDigest,"onUpdate:modelValue":T[1]||(T[1]=B=>y.fields.certDigest=B),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:i.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(xo),{description:i.unref(s)("ca-certificates.form.sections.general.description"),title:i.unref(s)("ca-certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(A,{modelValue:y.fields.tags,"onUpdate:modelValue":T[2]||(T[2]=B=>y.fields.tags=B),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:i.unref(s)("ca-certificates.form.fields.tags.help"),label:i.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:i.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-b74c6273"]]),Lb={class:"kong-ui-certificate-entity-config-card"},Fb={key:0},Hb=pr(i.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=t,n=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=ut.useI18n(),{convertKeyToTitle:l}=sp(),{getPropValue:c}=ap(),{getCertificateData:d}=ut.useCertificate(),y=i.computed(()=>Ni.form[n.config.app].edit),f=i.ref(),x=i.ref({id:{},cert:{section:pe.Basic},key:{section:pe.Basic,type:ce.Redacted},metadata:{section:pe.Basic,type:ce.Json},snis:{section:pe.Basic,type:ce.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...n.config.app==="kongManager"&&{expiry:{section:pe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:pe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:pe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:pe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:pe.Advanced},key_alt:{section:pe.Advanced,type:ce.Redacted}}),b=B=>{f.value=B,r("fetch:success",B)},h=(B,O)=>{const H=c("rowValue",O);if(B==="expiry")return m.value;if(B==="key_usages")return E.value;if(B==="san_names")return S.value;if(H)return H[B]},g=i.computed(()=>{if(f.value)return d(f.value)}),m=i.computed(()=>{var B,O;return(B=g.value)!=null&&B.schemaExpiry?s((O=g.value)==null?void 0:O.schemaExpiry):""}),v=i.computed(()=>{var B;return((B=g.value)==null?void 0:B.schemaIssuer)||""}),S=i.computed(()=>{var B;return((B=g.value)==null?void 0:B.schemaSanNames)||""}),C=i.computed(()=>{var B;return((B=g.value)==null?void 0:B.schemaSubject)||""}),E=i.computed(()=>{var B;return((B=g.value)==null?void 0:B.schemaKeyUsages)||[]}),T=i.computed(()=>{var B,O;return((O=(B=f==null?void 0:f.value)==null?void 0:B.snis)==null?void 0:O.length)>0}),N=i.computed(()=>{var B;return!!((B=f==null?void 0:f.value)!=null&&B.cert_alt)}),A=B=>{var O,H;return B==="san_names"?o("certificates.list.table_headers.san"):((H=(O=x.value)==null?void 0:O[B])==null?void 0:H.label)||l(B)};return(B,O)=>{const H=i.resolveComponent("KCodeBlock"),R=i.resolveComponent("KLabel"),J=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",Lb,[i.createVNode(i.unref(Yf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":x.value,"enable-terraform":e.enableTerraform,"entity-type":i.unref(dr).Certificate,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":O[0]||(O[0]=Q=>B.$emit("fetch:error",Q)),"onFetch:success":b,onLoading:O[1]||(O[1]=Q=>B.$emit("loading",Q))},i.createSlots({"cert-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:i.withCtx(Q=>[i.unref(c)("rowValue",Q)?(i.openBlock(),i.createBlock(H,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:i.unref(c)("rowValue",Q),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),"key-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":i.withCtx(()=>[i.createVNode(R,{class:"metadata-label"},{default:i.withCtx(()=>[i.createTextVNode(" Metadata ")]),_:1})]),metadata:i.withCtx(Q=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(i.unref(c)("rowValue",Q)),ne=>(i.openBlock(),i.createBlock(i.unref(go),{key:ne,item:{key:ne,value:h(ne,Q),label:A(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?i.unref(ce).BadgeTag:i.unref(ce).Text}},null,8,["item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(v.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C.value||"–"),1)]),"cert_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:i.withCtx(()=>[E.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Fb,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.value,(Q,ne)=>(i.openBlock(),i.createBlock(J,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:Q,"truncation-tooltip":""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Q),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[T.value?void 0:{name:"snis",fn:i.withCtx(()=>[i.createTextVNode(" – ")]),key:"0"},N.value?{name:"cert_alt",fn:i.withCtx(Q=>[i.createTextVNode(" > "),i.unref(c)("rowValue",Q)?(i.openBlock(),i.createBlock(H,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:i.unref(c)("rowValue",Q),language:"plaintext","single-line":""},null,8,["id","code"])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-c65f3278"]]);je.CACertificateConfigCard=Vb,je.CACertificateForm=Ub,je.CACertificateList=Rb,je.CertificateConfigCard=Hb,je.CertificateForm=Eb,je.CertificateList=kb,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|
|
113
|
+
*/const kn="crypto.algorithm";class sd{getAlgorithms(){return Ke.resolveAll(kn)}toAsnAlgorithm(e){({...e});for(const t of this.getAlgorithms()){const i=t.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){const t=new U({algorithm:e.name});if("parameters"in e){const i=e;t.parameters=i.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const i of this.getAlgorithms()){const n=i.toWebAlgorithm(e);if(n)return n}return{name:e.algorithm,parameters:e.parameters}}}const xn="crypto.algorithmProvider";Ke.registerSingleton(xn,sd);var Cn;const je="1.3.36.3.3.2.8.1.1",Bl=`${je}.1`,El=`${je}.2`,Il=`${je}.3`,Nl=`${je}.4`,Ol=`${je}.5`,Tl=`${je}.6`,Vl=`${je}.7`,_l=`${je}.8`,jl=`${je}.9`,Pl=`${je}.10`,Dl=`${je}.11`,Rl=`${je}.12`,Ml=`${je}.13`,$l=`${je}.14`,Ul="brainpoolP160r1",Hl="brainpoolP160t1",Ll="brainpoolP192r1",Fl="brainpoolP192t1",Kl="brainpoolP224r1",ql="brainpoolP224t1",Gl="brainpoolP256r1",zl="brainpoolP256t1",Wl="brainpoolP320r1",Jl="brainpoolP320t1",Yl="brainpoolP384r1",Zl="brainpoolP384t1",Ql="brainpoolP512r1",Xl="brainpoolP512t1",fe="ECDSA";let Yr=Cn=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case fe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Of;case"sha-256":return Tf;case"sha-384":return Vf;case"sha-512":return _f}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=Mc;break;case"K-256":t=Cn.SECP256K1;break;case"P-384":t=$c;break;case"P-521":t=Uc;break;case Ul:t=Bl;break;case Hl:t=El;break;case Ll:t=Il;break;case Fl:t=Nl;break;case Kl:t=Ol;break;case ql:t=Tl;break;case Gl:t=Vl;break;case zl:t=_l;break;case Wl:t=jl;break;case Jl:t=Pl;break;case Yl:t=Dl;break;case Zl:t=Rl;break;case Ql:t=Ml;break;case Xl:t=$l;break}if(t)return new U({algorithm:Kr,parameters:F.serialize(new pr({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case os:return{name:fe,hash:{name:"SHA-1"}};case ss:return{name:fe,hash:{name:"SHA-256"}};case as:return{name:fe,hash:{name:"SHA-384"}};case cs:return{name:fe,hash:{name:"SHA-512"}};case Kr:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(F.parse(e.parameters,pr).namedCurve){case Mc:return{name:fe,namedCurve:"P-256"};case Cn.SECP256K1:return{name:fe,namedCurve:"K-256"};case $c:return{name:fe,namedCurve:"P-384"};case Uc:return{name:fe,namedCurve:"P-521"};case Bl:return{name:fe,namedCurve:Ul};case El:return{name:fe,namedCurve:Hl};case Il:return{name:fe,namedCurve:Ll};case Nl:return{name:fe,namedCurve:Fl};case Ol:return{name:fe,namedCurve:Kl};case Tl:return{name:fe,namedCurve:ql};case Vl:return{name:fe,namedCurve:Gl};case _l:return{name:fe,namedCurve:zl};case jl:return{name:fe,namedCurve:Wl};case Pl:return{name:fe,namedCurve:Jl};case Dl:return{name:fe,namedCurve:Yl};case Rl:return{name:fe,namedCurve:Zl};case Ml:return{name:fe,namedCurve:Ql};case $l:return{name:fe,namedCurve:Xl}}}}return null}};Yr.SECP256K1="1.3.132.0.10",Yr=Cn=a([bs()],Yr),Ke.registerSingleton(kn,Yr);const eu=Symbol("name"),tu=Symbol("value");class oe{constructor(e,t={},i=""){this[eu]=e,this[tu]=i;for(const n in t)this[n]=t[n]}}oe.NAME=eu,oe.VALUE=tu;class ad{static toTextObject(e){const t=new oe("Algorithm Identifier",{},xt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case Kr:{const i=new Yr().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class xt{static toString(e){const t=this.items[e];return t||e}}xt.items={[Fc]:"sha1",[Kc]:"sha224",[qc]:"sha256",[Gc]:"sha384",[zc]:"sha512",[hr]:"rsaEncryption",[on]:"sha1WithRSAEncryption",[$f]:"sha224WithRSAEncryption",[ls]:"sha256WithRSAEncryption",[sn]:"sha384WithRSAEncryption",[an]:"sha512WithRSAEncryption",[Kr]:"ecPublicKey",[os]:"ecdsaWithSHA1",[Rc]:"ecdsaWithSHA224",[ss]:"ecdsaWithSHA256",[as]:"ecdsaWithSHA384",[cs]:"ecdsaWithSHA512",[kf]:"TLS WWW server authentication",[xf]:"TLS WWW client authentication",[Cf]:"Code Signing",[Bf]:"E-mail Protection",[Ef]:"Time Stamping",[If]:"OCSP Signing",[Nf]:"Signed Data"};class Lt{static serialize(e){return this.serializeObj(e).join(`
|
|
114
|
+
`)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const i=[];let n=this.pad(t++),s="";const c=e[oe.VALUE];c&&(s=` ${c}`),i.push(`${n}${e[oe.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],d=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${d}${f}`);else if(f instanceof Date)i.push(`${n}${d}${f.toUTCString()}`);else if(Array.isArray(f))for(const v of f)v[oe.NAME]=u,i.push(...this.serializeObj(v,t));else if(f instanceof oe)f[oe.NAME]=u,i.push(...this.serializeObj(f,t));else if(_.isBufferSource(f))u?(i.push(`${n}${d}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const v=f.toTextObject();v[oe.NAME]=u,i.push(...this.serializeObj(v,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(e,t=0){const i=this.pad(t),n=_.toUint8Array(e),s=[];for(let c=0;c<n.length;){const u=[];for(let f=0;f<16&&c<n.length;f++){f===8&&u.push("");const d=n[c++].toString(16).padStart(2,"0");u.push(d)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Lt.oidSerializer=xt,Lt.algorithmSerializer=ad;class Ct{constructor(...e){if(e.length===1){const t=e[0];this.rawData=F.serialize(t),this.onInit(t)}else{const t=F.parse(e[0],e[1]);this.rawData=_.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof Ct?ia(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return F.toString(this.rawData);case"text":return Lt.serialize(this.toTextObject());case"hex":return M.ToHex(this.rawData);case"base64":return M.ToBase64(this.rawData);case"base64url":return M.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new oe(this.getTextName(),{},e)}}Ct.NAME="ASN";class ot extends Ct{constructor(...e){let t;_.isBufferSource(e[0])?t=_.toArrayBuffer(e[0]):t=F.serialize(new Je({extnID:e[0],critical:e[1],extnValue:new ie(_.toArrayBuffer(e[2]))})),super(t,Je)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[oe.NAME]===ot.NAME&&(e[oe.NAME]=xt.toString(this.type)),e}}var ru;class Ft{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[ru]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(Ft.DEFAULT,crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,t){return this.items.forEach(e,t)}has(e){return this.items.has(e)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(e=Ft.DEFAULT){const t=this.items.get(e.toLowerCase());if(!t)throw new Error(`Cannot get Crypto by name '${e}'`);return t}set(e,t){if(typeof e=="string"){if(!t)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),t)}else this.items.set(Ft.DEFAULT,e);return this}}ru=Symbol.toStringTag,Ft.DEFAULT="default";const Me=new Ft,cd=/^[0-2](?:\.[1-9][0-9]*)+$/;function ld(r){return new RegExp(cd).test(r)}class iu{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return ld(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Pe=new iu;Pe.register("CN","2.5.4.3"),Pe.register("L","2.5.4.7"),Pe.register("ST","2.5.4.8"),Pe.register("O","2.5.4.10"),Pe.register("OU","2.5.4.11"),Pe.register("C","2.5.4.6"),Pe.register("DC","0.9.2342.19200300.100.1.25"),Pe.register("E","1.2.840.113549.1.9.1"),Pe.register("G","2.5.4.42"),Pe.register("I","2.5.4.43"),Pe.register("SN","2.5.4.4"),Pe.register("T","2.5.4.12");function ud(r,e){return`\\${M.ToHex(M.FromUtf8String(e)).toUpperCase()}`}function fd(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,ud)}class Bt{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,t={}){this.extraNames=new iu,this.asn=new ge;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];this.extraNames.register(i,n)}typeof e=="string"?this.asn=this.fromString(e):e instanceof ge?this.asn=e:_.isBufferSource(e)?this.asn=F.parse(e,ge):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Pe.findId(e),i=[];for(const n of this.asn)for(const s of n)s.type===t&&i.push(s.value.toString());return i}getName(e){return this.extraNames.get(e)||Pe.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${M.ToHex(t.value.anyValue)}`:fd(t.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var e;const t=[];for(const i of this.asn){const n={};for(const s of i){const c=this.getName(s.type)||s.type;(e=n[c])!==null&&e!==void 0||(n[c]=[]),n[c].push(s.value.anyValue?`#${M.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(n)}return t}fromString(e){const t=new ge,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${e},`);){let[,c,u]=n;const f=u[u.length-1];(f===","||f==="+")&&(u=u.slice(0,u.length-1),n[3]=f);const d=n[3];if(/[\d.]+/.test(c)||(c=this.getName(c)||""),!c)throw new Error(`Cannot get OID for name type '${c}'`);const v=new Ir({type:c});if(u.charAt(0)==="#")v.value.anyValue=M.FromHex(u.slice(1));else{const y=/"(.*?[^\\])?"/.exec(u);y&&(u=y[1]),u=u.replace(/\\0a/ig,`
|
|
115
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),c===this.getName("E")||c===this.getName("DC")?v.value.ia5String=u:Bt.isPrintableString(u)?v.value.printableString=u:v.value.utf8String=u}s==="+"?t[t.length-1].push(v):t.push(new Zt([v])),s=d}return t}fromJSON(e){const t=new ge;for(const i of e){const n=new Zt;for(const s in i){let c=s;if(/[\d.]+/.test(s)||(c=this.getName(s)||""),!c)throw new Error(`Cannot get OID for name type '${s}'`);const u=i[s];for(const f of u){const d=new Ir({type:c});if(typeof f=="object")for(const v in f)switch(v){case"ia5String":d.value.ia5String=f[v];break;case"utf8String":d.value.utf8String=f[v];break;case"universalString":d.value.universalString=f[v];break;case"bmpString":d.value.bmpString=f[v];break;case"printableString":d.value.printableString=f[v];break}else f[0]==="#"?d.value.anyValue=M.FromHex(f.slice(1)):c===this.getName("E")||c===this.getName("DC")?d.value.ia5String=f:d.value.printableString=f;n.push(d)}}t.push(n)}return t}toArrayBuffer(){return F.serialize(this.asn)}async getThumbprint(...e){var t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||Me.get()):i=e[0]||Me.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const nu="Cannot initialize GeneralName from ASN.1 data.",ou=`${nu} Unsupported string format in use.`,dd=`${nu} Value doesn't match to GUID regular expression.`,su=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,au="1.3.6.1.4.1.311.25.1",cu="1.3.6.1.4.1.311.20.2.3",Ms="dns",$s="dn",Us="email",Hs="ip",Ls="url",Fs="guid",Ks="upn",Bn="id";class lu extends Ct{constructor(...e){let t;if(e.length===2)switch(e[0]){case $s:{const i=new Bt(e[1]).toArrayBuffer(),n=F.parse(i,ge);t=new Q({directoryName:n});break}case Ms:t=new Q({dNSName:e[1]});break;case Us:t=new Q({rfc822Name:e[1]});break;case Fs:{const i=new RegExp(su,"i").exec(e[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,c)=>c<3?M.ToHex(new Uint8Array(M.FromHex(s)).reverse()):s).join("");t=new Q({otherName:new Nr({typeId:au,value:F.serialize(new ie(M.FromHex(n)))})});break}case Hs:t=new Q({iPAddress:e[1]});break;case Bn:t=new Q({registeredID:e[1]});break;case Ks:{t=new Q({otherName:new Nr({typeId:cu,value:F.serialize(oc.toASN(e[1]))})});break}case Ls:t=new Q({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else _.isBufferSource(e[0])?t=F.parse(e[0],Q):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=Ms,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=Us,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=Hs,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=Ls,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Bn,this.value=e.registeredID;else if(e.directoryName!=null)this.type=$s,this.value=new Bt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===au){this.type=Fs;const t=F.parse(e.otherName.value,ie),i=new RegExp(su,"i").exec(M.ToHex(t));if(!i)throw new Error(dd);this.value=i.slice(1).map((n,s)=>s<3?M.ToHex(new Uint8Array(M.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===cu)this.type=Ks,this.value=F.parse(e.otherName.value,Ae).toString();else throw new Error(ou);else throw new Error(ou)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case $s:case Ms:case Fs:case Hs:case Bn:case Ks:case Ls:e=this.type.toUpperCase();break;case Us:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Bn&&(t=xt.toString(t)),new oe(e,void 0,t)}}class Zr extends Ct{constructor(e){let t;if(e instanceof Ie)t=e;else if(Array.isArray(e)){const i=[];for(const n of e)if(n instanceof Q)i.push(n);else{const s=F.parse(new lu(n.type,n.value).rawData,Q);i.push(s)}t=new Ie(i)}else if(_.isBufferSource(e))t=F.parse(e,Ie);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){const t=[];for(const i of e){let n=null;try{n=new lu(i)}catch{continue}t.push(n)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const t of this.items){const i=t.toTextObject();let n=e[i[oe.NAME]];Array.isArray(n)||(n=[],e[i[oe.NAME]]=n),n.push(i)}return e}}Zr.NAME="GeneralNames";const Qr="-{5}",Xr="\\n",pd=`[^${Xr}]+`,hd=`${Qr}BEGIN (${pd}(?=${Qr}))${Qr}`,yd=`${Qr}END \\1${Qr}`,mr="\\n",gd=`[^:${Xr}]+`,md=`(?:[^${Xr}]+${mr}(?: +[^${Xr}]+${mr})*)`,vd=`(?:[a-zA-Z0-9=+/]+${mr})+`,uu=`${hd}${mr}(?:((?:${gd}: ${md})+))?${mr}?(${vd})${yd}`;class $e{static isPem(e){return typeof e=="string"&&new RegExp(uu,"g").test(e)}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(uu,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${Xr}]+`,"g"),""),c={type:n[1],headers:[],rawData:M.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(mr,"g"));let d=null;for(const v of f){const[y,z]=v.split(/:(.*)/);if(z===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=y.trim()}else d&&c.headers.push(d),d={key:y,value:z.trim()}}d&&c.headers.push(d)}i.push(c)}return i}static decode(e){return this.decodeWithHeaders(e).map(i=>i.rawData)}static decodeFirst(e){const t=this.decode(e);if(!t.length)throw new RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){const i=new Array;return t?e.forEach(n=>{if(!_.isBufferSource(n))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:t,rawData:_.toArrayBuffer(n)}))}):e.forEach(n=>{if(!("type"in n))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(n))}),i.join(`
|
|
116
|
+
`)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:_.toArrayBuffer(e)})}}static encodeStruct(e){var t;const i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(const d of e.headers)n.push(`${d.key}: ${d.value}`);n.push("")}const s=M.ToBase64(e.rawData);let c,u=0;const f=Array();for(;u<s.length&&(s.length-u<64?c=s.substring(u):(c=s.substring(u,u+64),u+=64),c.length!==0);)if(f.push(c),c.length<64)break;return n.push(...f),n.push(`-----END ${i}-----`),n.join(`
|
|
117
|
+
`)}}$e.CertificateTag="CERTIFICATE",$e.CrlTag="CRL",$e.CertificateRequestTag="CERTIFICATE REQUEST",$e.PublicKeyTag="PUBLIC KEY",$e.PrivateKeyTag="PRIVATE KEY";class vt extends Ct{static isAsnEncoded(e){return _.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if($e.isPem(e))return $e.decode(e)[0];if(M.isHex(e))return M.FromHex(e);if(M.isBase64(e))return M.FromBase64(e);if(M.isBase64Url(e))return M.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=M.ToBinary(e);return $e.isPem(t)?$e.decode(t)[0]:M.isHex(t)?M.FromHex(t):M.isBase64(t)?M.FromBase64(t):M.isBase64Url(t)?M.FromBase64Url(t):_.toArrayBuffer(e)}}constructor(...e){vt.isAsnEncoded(e[0])?super(vt.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return $e.encode(this.rawData,this.tag);default:return super.toString(e)}}}class Kt extends vt{constructor(e){vt.isAsnEncoded(e)?super(e,yt):super(e),this.tag=$e.PublicKeyTag}async export(...e){let t,i=["verify"],n={hash:"SHA-256",...this.algorithm};return e.length>1?(n=e[0]||n,i=e[1]||i,t=e[2]||Me.get()):t=e[0]||Me.get(),t.subtle.importKey("spki",this.rawData,n,!0,i)}onInit(e){const t=Ke.resolve(xn),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case hr:{const n=F.parse(e.subjectPublicKey,ps),s=_.toUint8Array(n.modulus);i.publicExponent=_.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...e){var t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||Me.get()):i=e[0]||Me.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(e){e||(e=Me.get());const t=F.parse(this.rawData,yt);return await e.subtle.digest("SHA-1",t.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=F.parse(this.rawData,yt);switch(e.Algorithm=Lt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case Kr:e["EC Point"]=t.subjectPublicKey;break;case hr:default:e["Raw Data"]=t.subjectPublicKey}return e}}class st{static register(e,t){this.items.set(e,t)}static create(e){const t=new ot(e),i=this.items.get(t.type);return i?new i(e):t}}st.items=new Map;const En="crypto.signatureFormatter";class bd{toAsnSignature(e,t){return _.toArrayBuffer(t)}toWebSignature(e,t){return _.toArrayBuffer(t)}}class In extends vt{constructor(e){vt.isAsnEncoded(e)?super(e,tr):super(e),this.tag=$e.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=F.serialize(t),this.serialNumber=M.ToHex(t.serialNumber),this.subjectName=new Bt(t.subject),this.subject=new Bt(t.subject).toString(),this.issuerName=new Bt(t.issuer),this.issuer=this.issuerName.toString();const i=Ke.resolve(xn);this.signatureAlgorithm=i.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const n=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;const s=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(c=>st.create(F.serialize(c)))),this.publicKey=new Kt(t.subjectPublicKeyInfo)}getExtension(e){for(const t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e={},t=Me.get()){let i,n;const s=e.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],t);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],t);else if(s instanceof Kt)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(_.isBufferSource(s)){const d=new Kt(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const c=Ke.resolveAll(En).reverse();let u=null;for(const d of c)if(u=d.toWebSignature(i,this.signature),u)break;if(!u)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const f=await t.subtle.verify(this.signatureAlgorithm,n,u,this.tbs);if(e.signatureOnly)return f;{const v=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<v&&v<this.notAfter.getTime()}}async getThumbprint(...e){let t,i="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(i=e[0]||i,t=e[1])),t??(t=Me.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Me.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=F.parse(this.rawData,tr),i=t.tbsCertificate,n=new oe("",{Version:`${er[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Lt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new oe("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new oe("");for(const c of this.extensions){const u=c.toTextObject();s[u[oe.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new oe("",{Algorithm:Lt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}In.NAME="Certificate";class ei extends ot{static async create(e,t=!1,i=Me.get()){if(e instanceof In||Ft.isCryptoKey(e)){const n=e instanceof In?await e.publicKey.export(i):e,s=await i.subtle.exportKey("spki",n),u=await new Kt(s).getKeyIdentifier(i);return new ei(M.ToHex(u),t)}else return new ei(e,t)}constructor(...e){if(_.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Pt({keyIdentifier:new ao(M.FromHex(e[0]))});super(so,e[1],F.serialize(t))}else{const t=e[0],i=t.name instanceof Zr?F.parse(t.name.rawData,Ie):t.name,n=new Pt({authorityCertIssuer:i,authorityCertSerialNumber:M.FromHex(t.serialNumber)});super(so,e[1],F.serialize(n))}}onInit(e){super.onInit(e);const t=F.parse(e.extnValue,Pt);t.keyIdentifier&&(this.keyId=M.ToHex(t.keyIdentifier)),t.authorityCertIssuer&&t.authorityCertSerialNumber&&(this.certId={name:t.authorityCertIssuer,serialNumber:M.ToHex(t.authorityCertSerialNumber)})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=F.parse(this.value,Pt);return t.authorityCertIssuer&&(e["Authority Issuer"]=new Zr(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}ei.NAME="Authority Key Identifier";class fu extends ot{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=F.parse(this.value,Ei);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Ei({cA:e[0],pathLenConstraint:e[1]});super(dc,e[2],F.serialize(t)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}}fu.NAME="Basic Constraints";var du;(function(r){r.serverAuth="1.3.6.1.5.5.7.3.1",r.clientAuth="1.3.6.1.5.5.7.3.2",r.codeSigning="1.3.6.1.5.5.7.3.3",r.emailProtection="1.3.6.1.5.5.7.3.4",r.timeStamping="1.3.6.1.5.5.7.3.8",r.ocspSigning="1.3.6.1.5.5.7.3.9"})(du||(du={}));class pu extends ot{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=F.parse(this.value,Vi);this.usages=t.map(i=>i)}else{const t=new Vi(e[0]);super(vc,e[1],F.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>xt.toString(t)).join(", "),e}}pu.NAME="Extended Key Usages";var qs;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(qs||(qs={}));class Gs extends ot{constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=F.parse(this.value,ko);this.usages=t.toNumber()}else{const t=new ko(e[0]);super(wc,e[1],F.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=F.parse(this.value,ko);return e[""]=t.toJSON().join(", "),e}}Gs.NAME="Key Usages";class Nn extends ot{static async create(e,t=!1,i=Me.get()){let n;e instanceof Kt?n=e.rawData:"publicKey"in e?n=e.publicKey.rawData:_.isBufferSource(e)?n=e:n=await i.subtle.exportKey("spki",e);const c=await new Kt(n).getKeyIdentifier(i);return new Nn(M.ToHex(c),t)}constructor(...e){if(_.isBufferSource(e[0])){super(e[0]);const t=F.parse(this.value,At);this.keyId=M.ToHex(t)}else{const t=typeof e[0]=="string"?M.FromHex(e[0]):e[0],i=new At(t);super(Bc,e[1],F.serialize(i)),this.keyId=M.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=F.parse(this.value,At);return e[""]=t,e}}Nn.NAME="Subject Key Identifier";class zs extends ot{constructor(...e){_.isBufferSource(e[0])?super(e[0]):super(xc,e[1],new Zr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=F.parse(e.extnValue,Io);this.names=new Zr(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}zs.NAME="Subject Alternative Name";class hu extends ot{constructor(...e){var t;if(_.isBufferSource(e[0])){super(e[0]);const i=F.parse(this.value,Oi);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new Oi(i.map(c=>new Ni({policyIdentifier:c})));super(hc,n,F.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new oe("",{},xt.toString(t))),e}}hu.NAME="Certificate Policies",st.register(hc,hu);class vr extends Ct{constructor(...e){let t;if(_.isBufferSource(e[0]))t=_.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>_.toArrayBuffer(s)):[];t=F.serialize(new ht({type:i,values:n}))}super(t,ht)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new oe("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[oe.NAME]===vr.NAME&&(e[oe.NAME]=xt.toString(this.type)),e}}vr.NAME="Attribute";class yu extends vr{constructor(...e){var t;if(_.isBufferSource(e[0]))super(e[0]);else{const i=new Sn({printableString:e[0]});super(dl,[F.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=F.parse(this.values[0],Sn);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[oe.VALUE]=this.password,e}}yu.NAME="Challenge Password";class Ws extends vr{constructor(...e){var t;if(_.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new Dt;for(const s of i)n.push(F.parse(s.rawData,Je));super(Ns,[F.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=F.parse(this.values[0],Dt);this.items=t.map(i=>st.create(F.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[oe.NAME]]=i;return e}}Ws.NAME="Extensions";class On{static register(e,t){this.items.set(e,t)}static create(e){const t=new vr(e),i=this.items.get(t.type);return i?new i(e):t}}On.items=new Map;let Js=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let t;if(typeof e.hash=="string")t=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")t=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(t.toLowerCase()){case"sha-1":return new U({algorithm:on,parameters:null});case"sha-256":return new U({algorithm:ls,parameters:null});case"sha-384":return new U({algorithm:sn,parameters:null});case"sha-512":return new U({algorithm:an,parameters:null})}}else return new U({algorithm:hr,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case hr:return{name:"RSASSA-PKCS1-v1_5"};case on:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case ls:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case sn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case an:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Js=a([bs()],Js),Ke.registerSingleton(kn,Js);class qe{addPadding(e,t){const i=_.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}removePadding(e,t=!1){let i=_.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(t&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){const i=e.namedCurve,n=qe.namedCurveSize.get(i)||qe.defaultNamedCurveSize,s=new nn,c=_.toUint8Array(t);return s.r=this.removePadding(c.slice(0,n),!0),s.s=this.removePadding(c.slice(n,n+n),!0),F.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=F.parse(t,nn),n=e.namedCurve,s=qe.namedCurveSize.get(n)||qe.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return ju(c,u)}return null}}qe.namedCurveSize=new Map,qe.defaultNamedCurveSize=32;const gu="1.3.101.110",mu="1.3.101.111",vu="1.3.101.112",bu="1.3.101.113";let Ys=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=vu;break;case"ed448":t=bu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=gu;break;case"x448":t=mu;break}}return t?new U({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case vu:return{name:"EdDSA",namedCurve:"Ed25519"};case bu:return{name:"EdDSA",namedCurve:"Ed448"};case gu:return{name:"ECDH-ES",namedCurve:"X25519"};case mu:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ys=a([bs()],Ys),Ke.registerSingleton(kn,Ys);class wd extends vt{constructor(e){vt.isAsnEncoded(e)?super(e,Jr):super(e),this.tag=$e.CertificateRequestTag}onInit(e){this.tbs=F.serialize(e.certificationRequestInfo),this.publicKey=new Kt(e.certificationRequestInfo.subjectPKInfo);const t=Ke.resolve(xn);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>On.create(F.serialize(n)));const i=this.getAttribute(Ns);this.extensions=[],i instanceof Ws&&(this.extensions=i.items),this.subjectName=new Bt(e.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(e){for(const t of this.attributes)if(t.type===e)return t;return null}getAttributes(e){return this.attributes.filter(t=>t.type===e)}getExtension(e){for(const t of this.extensions)if(t.type===e)return t;return null}getExtensions(e){return this.extensions.filter(t=>t.type===e)}async verify(e=Me.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=Ke.resolveAll(En).reverse();let s=null;for(const u of n)if(s=u.toWebSignature(t,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const e=this.toTextObjectEmpty(),t=F.parse(this.rawData,Jr),i=t.certificationRequestInfo,n=new oe("",{Version:`${er[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new oe("");for(const c of this.attributes){const u=c.toTextObject();s[u[oe.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new oe("",{Algorithm:Lt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}wd.NAME="PKCS#10 Certificate Request";var wu;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(wu||(wu={})),st.register(dc,fu),st.register(vc,pu),st.register(wc,Gs),st.register(Bc,Nn),st.register(so,ei),st.register(xc,zs),On.register(dl,yu),On.register(Ns,Ws),Ke.registerSingleton(En,bd),Ke.registerSingleton(En,qe),qe.namedCurveSize.set("P-256",32),qe.namedCurveSize.set("K-256",32),qe.namedCurveSize.set("P-384",48),qe.namedCurveSize.set("P-521",66);function Su(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new In(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof zs){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,d)=>{const v=d.type,y=f[v]??[];return{...f,[v]:[...y,d.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof Gs){const s=Object.values(qs),c=Array(s.length/2).fill(null).reduce((u,f,d)=>{const v=s[s.length/2+d];if(n.usages&v){const y=s[d];u.push(y)}return u},[]);i.keyUsage=c}return i}}}function Sd(){const r=Su(),e=o.ref({}),t=n=>{if(!(n.id in e.value))try{e.value[n.id]=r.parseMetaCertificateData(n.cert)}catch{e.value[n.id]=void 0}return e.value[n.id]};return{certificateDataCache:e,getCertificateData:n=>{const s=t(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Ad={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function kd(){const r=ea.createI18n("en-us",Ad);return{i18n:r,i18nT:ea.i18nTComponent(r)}}const Ze={useCertificate:Sd,useI18n:kd,useX509:Su},Tn="/v2/control-planes/{controlPlaneId}/core-entities",Vn="/{workspace}",ti={list:{konnect:`${Tn}/certificates`,kongManager:`${Vn}/certificates`},form:{konnect:{create:`${Tn}/certificates`,edit:`${Tn}/certificates/{id}`,validate:`${Tn}/v1/schemas/json/certificate/validate`},kongManager:{create:`${Vn}/certificates`,edit:`${Vn}/certificates/{id}`,validate:`${Vn}/schemas/certificates/validate`}}},xd={class:"kong-ui-entities-certificates-list"},Cd={key:0},Bd={key:1},Ed={key:0},Id={key:1},Nd={key:0},Od={key:1},Td={key:1},Vd={key:1},_d=o.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var J;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=Ze.useI18n(),u=ni.useRouter(),{axiosInstance:f}=T.useAxios((J=i.config)==null?void 0:J.axiosRequestConfig),d=o.ref(1),v=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),z={subject:{label:n("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:n("certificates.list.table_headers.expiry")},san:{label:n("certificates.list.table_headers.san")},cert:{label:n("certificates.list.table_headers.cert")},tags:{label:n("certificates.list.table_headers.tags"),sortable:!0}},O=o.computed(()=>{var H,ae;let R=`${i.config.apiBaseUrl}${ti.list[i.config.app]}`;return i.config.app==="konnect"?R=R.replace(/{controlPlaneId}/gi,((H=i.config)==null?void 0:H.controlPlaneId)||""):i.config.app==="kongManager"&&(R=R.replace(/\/{workspace}/gi,(ae=i.config)!=null&&ae.workspace?`/${i.config.workspace}`:"")),R}),p=o.ref(""),m=o.computed(()=>{const R=i.config.app==="konnect"||i.config.isExactMatch;return R?{isExactMatch:R,placeholder:n("certificates.search.placeholder")}:{isExactMatch:R,schema:i.config.filterSchema}}),{fetcher:S,fetcherState:w}=T.useFetcher(i.config,O.value),I=()=>{p.value=""},k=()=>{d.value++},B=o.ref(null),Z=(R,H)=>{const ae=R.id;if(!H(ae)){t("copy:error",{entity:R,field:"id",message:n("certificates.errors.copy")});return}t("copy:success",{entity:R,field:"id",message:n("certificates.copy.success",{val:ae})})},se=(R,H)=>{const ae=JSON.stringify(R);if(!H(ae)){t("copy:error",{entity:R,message:n("certificates.errors.copy")});return}t("copy:success",{entity:R,message:n("certificates.copy.success_brief")})},D=async R=>{var ae;await((ae=i.canRetrieve)==null?void 0:ae.call(i,R))&&u.push(i.config.getViewRoute(R.id))},C=R=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(R)}),j=R=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(R)}),de=R=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(R)}},re=o.ref(void 0),Be=o.ref(!1),ce=o.ref(!1),pe=o.ref(""),at=T.useDeleteUrlBuilder(i.config,O.value),{certificateDataCache:ee,getCertificateData:bt}=Ze.useCertificate(),br=R=>{re.value=R,Be.value=!0},wr=()=>{Be.value=!1},Gt=async()=>{var R,H,ae;if((R=re.value)!=null&&R.id){ce.value=!0;try{await f.delete(at(re.value.id)),ce.value=!1,Be.value=!1,d.value++,t("delete:success",re.value)}catch(Ne){pe.value=((ae=(H=Ne.response)==null?void 0:H.data)==null?void 0:ae.message)||Ne.message||n("certificates.errors.delete"),t("error",Ne)}finally{ce.value=!1}}},wt=o.ref(!1);o.watch(w,R=>{var H,ae,Ne,Ue;if(Array.isArray((H=R==null?void 0:R.response)==null?void 0:H.data)&&(wt.value=R.response.data.length>0),R.status===T.FetcherStatus.Error){B.value={title:n("certificates.errors.general")},(Ue=(Ne=(ae=R.error)==null?void 0:ae.response)==null?void 0:Ne.data)!=null&&Ue.message&&(B.value.message=R.error.response.data.message),t("error",R.error);return}ee.value={},B.value=null});const W=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(W.value.title=n("certificates.list.empty_state.title"),W.value.ctaText=n("certificates.actions.create"))}),(R,H)=>{const ae=o.resolveComponent("KButton"),Ne=o.resolveComponent("KCopy"),Ue=o.resolveComponent("KBadge"),Sr=o.resolveComponent("KTruncate"),Y=o.resolveComponent("KDropdownItem"),ve=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",xd,[o.createVNode(o.unref(T.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":v.value,"empty-state-options":W.value,"enable-entity-actions":"","error-message":B.value,fetcher:o.unref(S),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:p.value,"table-headers":o.unref(z),"use-action-outside":r.useActionOutside,onClearSearchInput:I,"onClick:row":H[2]||(H[2]=q=>D(q)),onSort:k},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(T.EntityFilter),{modelValue:p.value,"onUpdate:modelValue":H[0]||(H[0]=q=>p.value=q),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(ae,{appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(oi.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[o.vShow,wt.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:o.withCtx(({row:q})=>{var be;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Cd,o.toDisplayString((be=q==null?void 0:q.metadata)!=null&&be.subject?q.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",Bd,o.toDisplayString(o.unref(bt)(q).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:q})=>{var be;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Ed,o.toDisplayString((be=q==null?void 0:q.metadata)!=null&&be.expiry?o.unref(s)(q.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Id,o.toDisplayString(o.unref(bt)(q).schemaExpiry?o.unref(s)(o.unref(bt)(q).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:q})=>{var be;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Nd,o.toDisplayString((be=q==null?void 0:q.metadata)!=null&&be.dns_names?`dns=${q.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",Od,o.toDisplayString(o.unref(bt)(q).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:q})=>[q!=null&&q.cert?(o.openBlock(),o.createBlock(Ne,{key:0,"data-testid":"copy-certificate-cert",text:q.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Td,"-"))]),tags:o.withCtx(({row:q})=>{var be;return[((be=q==null?void 0:q.tags)==null?void 0:be.length)>0?(o.openBlock(),o.createBlock(Sr,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(q==null?void 0:q.tags,Ar=>(o.openBlock(),o.createBlock(Ue,{key:Ar,onClick:H[1]||(H[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Ar),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",Vd,"-"))]}),actions:o.withCtx(({row:q})=>[o.createVNode(ve,null,{default:o.withCtx(({copyToClipboard:be})=>[o.createVNode(Y,{"data-testid":"action-entity-copy-id",onClick:Ar=>Z(q,be)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(ve,null,{default:o.withCtx(({copyToClipboard:be})=>[o.createVNode(Y,{"data-testid":"action-entity-copy-json",onClick:Ar=>se(q,be)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(q)},{default:o.withCtx(()=>[o.createVNode(Y,{"data-testid":"action-entity-view","has-divider":"",item:C(q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canEdit(q)},{default:o.withCtx(()=>[o.createVNode(Y,{"data-testid":"action-entity-edit",item:j(q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(T.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(Y,{"data-testid":"action-entity-add-sni",item:de(q.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canDelete(q)},{default:o.withCtx(()=>[o.createVNode(Y,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:be=>br(q)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("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"]),o.createVNode(o.unref(T.EntityDeleteModal),{"action-pending":ce.value,"entity-type":o.unref(T.EntityTypes).Certificate,error:pe.value,title:o.unref(n)("certificates.delete.title"),visible:Be.value,onCancel:wr,onProceed:Gt},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),qt=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},jd=qt(_d,[["__scopeId","data-v-8059a087"]]),Pd="#d60027",Dd={class:"sni-field-container"},Rd={key:1,class:"sni-field-controls-container"},Md={key:0},$d=qt(o.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{i18nT:n,i18n:{t:s}}=Ze.useI18n(),c=o.ref([]);return o.watch(t.modelValue,u=>{c.value=[...u]},{immediate:!0,deep:!0}),o.watch(c,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const d=o.resolveComponent("KLabel"),v=o.resolveComponent("KInput"),y=o.resolveComponent("KButton"),z=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",Dd,[o.createVNode(d,{info:o.unref(s)("certificates.form.fields.snis.tooltip")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,(O,p)=>(o.openBlock(),o.createElementBlock("div",{key:p,class:"sni-field-input"},[!r.isEditing||c.value[p]?(o.openBlock(),o.createBlock(v,{key:0,modelValue:c.value[p],"onUpdate:modelValue":m=>c.value[p]=m,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${p+1}`,disabled:r.isEditing,placeholder:o.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):o.createCommentVNode("",!0),r.isEditing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Rd,[o.createVNode(y,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:m=>u.$emit("remove",p)},{default:o.withCtx(()=>[o.createVNode(o.unref(oi.TrashIcon),{color:o.unref(Pd)},null,8,["color"])]),_:2},1032,["onClick"]),o.createVNode(y,{appearance:"tertiary","data-testid":"add-sni",disabled:p!==c.value.length-1,icon:"",onClick:f[0]||(f[0]=m=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(oi.AddIcon))]),_:2},1032,["disabled"])]))]))),128)),c.value.length===0?(o.openBlock(),o.createElementBlock("div",Md,[o.createVNode(y,{onClick:f[1]||(f[1]=O=>u.$emit("add"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):o.createCommentVNode("",!0),r.isEditing?(o.openBlock(),o.createBlock(o.unref(n),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:o.withCtx(()=>[o.createVNode(z,{to:r.sniListRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):o.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-543a45f0"]]),Ud={class:"kong-ui-entities-certificates-form"},Hd=qt(o.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(r,{emit:e}){var se;const t=e,i=r,n=ni.useRouter(),{i18nT:s,i18n:{t:c}}=Ze.useI18n(),{getMessageFromError:u}=T.useErrors(),{axiosInstance:f}=T.useAxios((se=i.config)==null?void 0:se.axiosRequestConfig),d=o.computed(()=>ti.form[i.config.app].edit),v=o.computed(()=>i.certificateId?T.EntityBaseFormType.Edit:T.EntityBaseFormType.Create),y=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),z=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),O=o.computed(()=>(v.value===T.EntityBaseFormType.Create||JSON.stringify(y.fields)!==JSON.stringify(z))&&!!y.fields.cert&&!!y.fields.key),p=D=>{var C,j;y.fields.cert=(D==null?void 0:D.cert)||"",y.fields.key=(D==null?void 0:D.key)||"",y.fields.certAlt=(D==null?void 0:D.cert_alt)||"",y.fields.keyAlt=(D==null?void 0:D.key_alt)||"",y.fields.snis=(C=D==null?void 0:D.snis)!=null&&C.length?D.snis:[""],y.fields.tags=((j=D==null?void 0:D.tags)==null?void 0:j.join(", "))||"",Object.assign(z,y.fields)},m=()=>{n.push(i.config.cancelRoute)},S=()=>{y.fields.snis.push("")},w=D=>{y.fields.snis.splice(D,1)},I=o.computed(()=>{var C,j;let D=`${i.config.apiBaseUrl}${ti.form[i.config.app].validate}`;return i.config.app==="konnect"?D=D.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(D=D.replace(/\/{workspace}/gi,(j=i.config)!=null&&j.workspace?`/${i.config.workspace}`:"")),D=D.replace(/{id}/gi,i.certificateId),D}),k=o.computed(()=>{var C,j;let D=`${i.config.apiBaseUrl}${ti.form[i.config.app][v.value]}`;return i.config.app==="konnect"?D=D.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(D=D.replace(/\/{workspace}/gi,(j=i.config)!=null&&j.workspace?`/${i.config.workspace}`:"")),D=D.replace(/{id}/gi,i.certificateId),D}),B=o.computed(()=>{var D,C;return{cert:y.fields.cert,key:y.fields.key,cert_alt:y.fields.certAlt||null,key_alt:y.fields.keyAlt||null,...i.showSnisField?{snis:y.fields.snis.filter(Boolean)}:{},tags:(C=(D=y.fields.tags.split(","))==null?void 0:D.map(j=>String(j||"").trim()))==null?void 0:C.filter(j=>j!=="")}}),Z=async()=>{var D,C,j,de,re,Be,ce,pe,at;try{y.isReadonly=!0;let ee;await f.post(I.value,B.value),v.value==="create"?ee=await f.post(k.value,B.value):v.value==="edit"&&(ee=((D=i.config)==null?void 0:D.app)==="konnect"?await f.put(k.value,B.value):await f.patch(k.value,B.value)),y.fields.cert=((C=ee==null?void 0:ee.data)==null?void 0:C.cert)||"",y.fields.key=((j=ee==null?void 0:ee.data)==null?void 0:j.key)||"",y.fields.certAlt=((de=ee==null?void 0:ee.data)==null?void 0:de.cert_alt)||"",y.fields.keyAlt=((re=ee==null?void 0:ee.data)==null?void 0:re.key_alt)||"",y.fields.snis=(ce=(Be=ee==null?void 0:ee.data)==null?void 0:Be.snis)!=null&&ce.length?ee.data.snis:[""],y.fields.tags=((at=(pe=ee==null?void 0:ee.data)==null?void 0:pe.tags)==null?void 0:at.join(", "))||"",Object.assign(z,y.fields),t("update",ee==null?void 0:ee.data)}catch(ee){y.errorMessage=u(ee),t("error",ee)}finally{y.isReadonly=!1}};return(D,C)=>{const j=o.resolveComponent("KTextArea"),de=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",Ud,[o.createVNode(o.unref(T.EntityBaseForm),{"can-submit":O.value,config:r.config,"edit-id":r.certificateId,"enable-terraform":r.enableTerraform,"entity-type":o.unref(T.SupportedEntityType).Certificate,"error-message":y.errorMessage,"fetch-url":d.value,"form-fields":B.value,"is-readonly":y.isReadonly,onCancel:m,"onFetch:error":C[7]||(C[7]=re=>D.$emit("error",re)),"onFetch:success":p,onLoading:C[8]||(C[8]=re=>D.$emit("loading",re)),onSubmit:Z},{default:o.withCtx(()=>[o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(c)("certificates.form.sections.ssl.description"),title:o.unref(c)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(j,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=re=>y.fields.cert=re),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(c)("certificates.form.fields.cert.label"),readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(j,{modelValue:y.fields.key,"onUpdate:modelValue":C[1]||(C[1]=re=>y.fields.key=re),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(c)("certificates.form.fields.key.label"),readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(j,{modelValue:y.fields.certAlt,"onUpdate:modelValue":C[2]||(C[2]=re=>y.fields.certAlt=re),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(c)("certificates.form.fields.cert_alt.label"),readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(j,{modelValue:y.fields.keyAlt,"onUpdate:modelValue":C[3]||(C[3]=re=>y.fields.keyAlt=re),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(c)("certificates.form.fields.key_alt.label"),readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock($d,{key:0,modelValue:y.fields.snis,"onUpdate:modelValue":C[4]||(C[4]=re=>y.fields.snis=re),"is-editing":v.value===o.unref(T.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:S,onRemove:C[5]||(C[5]=re=>w(re))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(c)("certificates.form.sections.general.description"),title:o.unref(c)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(de,{modelValue:y.fields.tags,"onUpdate:modelValue":C[6]||(C[6]=re=>y.fields.tags=re),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(c)("certificates.form.fields.tags.help"),label:o.unref(c)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(c)("certificates.form.fields.tags.tooltip")},placeholder:o.unref(c)("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","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-1f98afe8"]]),_n="/v2/control-planes/{controlPlaneId}/core-entities",jn="/{workspace}",ri={list:{konnect:`${_n}/ca_certificates`,kongManager:`${jn}/ca_certificates`},form:{konnect:{create:`${_n}/ca_certificates`,edit:`${_n}/ca_certificates/{id}`,validate:`${_n}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${jn}/ca_certificates`,edit:`${jn}/ca_certificates/{id}`,validate:`${jn}/schemas/ca_certificates/validate`}}},Ld={class:"kong-ui-ca-certificate-entity-config-card"},Fd={key:0},Kd=qt(o.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=["dns_names","san_names","subject"],i=e,n=r,{i18n:{t:s,formatUnixTimeStamp:c}}=Ze.useI18n(),{convertKeyToTitle:u}=T.useStringHelpers(),{getPropValue:f}=T.useHelpers(),{getCertificateData:d}=Ze.useCertificate(),v=o.computed(()=>ri.form[n.config.app].edit),y=o.ref(),z=o.computed(()=>{if(y.value)return d(y.value)}),O=o.computed(()=>{var k;return((k=z.value)==null?void 0:k.schemaIssuer)||""}),p=o.computed(()=>{var k,B;return(k=z.value)!=null&&k.schemaExpiry?c((B=z.value)==null?void 0:B.schemaExpiry):""}),m=o.computed(()=>{var k;return((k=z.value)==null?void 0:k.schemaKeyUsages)||[]}),S=(k,B)=>{const Z=f("rowValue",B);if(k==="expiry")return p.value;if(k==="key_usages")return m.value;if(Z)return Z[k]},w=k=>{y.value=k,i("fetch:success",k)},I=o.ref({id:{},updated_at:{},created_at:{},cert:{section:T.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:T.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:T.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:T.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:T.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(k,B)=>{const Z=o.resolveComponent("KCodeBlock"),se=o.resolveComponent("KLabel"),D=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",Ld,[o.createVNode(o.unref(T.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":I.value,"enable-terraform":r.enableTerraform,"entity-type":o.unref(T.SupportedEntityType).CaCertificate,"fetch-url":v.value,"hide-title":r.hideTitle,"onFetch:error":B[0]||(B[0]=C=>k.$emit("fetch:error",C)),"onFetch:success":w,onLoading:B[1]||(B[1]=C=>k.$emit("loading",C))},{cert:o.withCtx(C=>[o.unref(f)("rowValue",C)?(o.openBlock(),o.createBlock(Z,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",C),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(se,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(C=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",C)).filter(j=>!t.includes(j)),j=>(o.openBlock(),o.createBlock(o.unref(T.ConfigCardItem),{key:j,"data-testid":`ca-cert-metadata-${j}`,item:{key:j,label:o.unref(u)(j),value:S(j,C),type:j==="key_usages"?o.unref(T.ConfigurationSchemaType).BadgeTag:o.unref(T.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(p.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(O.value||"–"),1)]),key_usages:o.withCtx(()=>[m.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Fd,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(m.value,(C,j)=>(o.openBlock(),o.createBlock(D,{key:`key_usages-badge-tag-${j}`,class:"config-badge","data-testid":`key_usages-badge-tag-${j}`,tooltip:C,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-46ffa2f8"]]),qd={class:"kong-ui-entities-ca-certificates-list"},Gd={key:0},zd={key:1},Wd={key:0},Jd={key:1},Yd={key:1},Zd=qt(o.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var W;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=Ze.useI18n(),u=ni.useRouter(),{axiosInstance:f}=T.useAxios((W=i.config)==null?void 0:W.axiosRequestConfig),d=o.ref(1),v=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),z={issuer:{label:n("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},O=o.computed(()=>{var R,H;let J=`${i.config.apiBaseUrl}${ri.list[i.config.app]}`;return i.config.app==="konnect"?J=J.replace(/{controlPlaneId}/gi,((R=i.config)==null?void 0:R.controlPlaneId)||""):i.config.app==="kongManager"&&(J=J.replace(/\/{workspace}/gi,(H=i.config)!=null&&H.workspace?`/${i.config.workspace}`:"")),J}),p=o.ref(""),m=o.computed(()=>{const J=i.config.app==="konnect"||i.config.isExactMatch;return J?{isExactMatch:J,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:J,schema:i.config.filterSchema}}),{fetcher:S,fetcherState:w}=T.useFetcher(i.config,O.value),I=()=>{p.value=""},k=()=>{d.value++},B=o.ref(null),Z=(J,R)=>{const H=J.id;if(!R(H)){t("copy:error",{entity:J,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:J,field:"id",message:n("ca-certificates.copy.success",{val:H})})},se=(J,R)=>{const H=JSON.stringify(J);if(!R(H)){t("copy:error",{entity:J,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:J,message:n("ca-certificates.copy.success_brief")})},D=async J=>{var H;await((H=i.canRetrieve)==null?void 0:H.call(i,J))&&u.push(i.config.getViewRoute(J.id))},C=J=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(J)}),j=J=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(J)}),de=o.ref(void 0),re=o.ref(!1),Be=o.ref(!1),ce=o.ref(""),pe=T.useDeleteUrlBuilder(i.config,O.value),{certificateDataCache:at,getCertificateData:ee}=Ze.useCertificate(),bt=J=>{de.value=J,re.value=!0},br=()=>{re.value=!1},wr=async()=>{var J,R,H;if((J=de.value)!=null&&J.id){Be.value=!0;try{await f.delete(pe(de.value.id)),Be.value=!1,re.value=!1,d.value++,t("delete:success",de.value)}catch(ae){ce.value=((H=(R=ae.response)==null?void 0:R.data)==null?void 0:H.message)||ae.message||n("ca-certificates.errors.delete"),t("error",ae)}finally{Be.value=!1}}},Gt=o.ref(!1);o.watch(w,J=>{var R,H,ae,Ne;if(Array.isArray((R=J==null?void 0:J.response)==null?void 0:R.data)&&(Gt.value=J.response.data.length>0),J.status===T.FetcherStatus.Error){B.value={title:n("ca-certificates.errors.general")},(Ne=(ae=(H=J.error)==null?void 0:H.response)==null?void 0:ae.data)!=null&&Ne.message&&(B.value.message=J.error.response.data.message),t("error",J.error);return}at.value={},B.value=null});const wt=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("ca-certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(wt.value.title=n("ca-certificates.list.empty_state.title"),wt.value.ctaText=n("ca-certificates.actions.create"))}),(J,R)=>{const H=o.resolveComponent("KButton"),ae=o.resolveComponent("KBadge"),Ne=o.resolveComponent("KTruncate"),Ue=o.resolveComponent("KDropdownItem"),Sr=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",qd,[o.createVNode(o.unref(T.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":v.value,"empty-state-options":wt.value,"enable-entity-actions":"","error-message":B.value,fetcher:o.unref(S),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:p.value,"table-headers":o.unref(z),"use-action-outside":r.useActionOutside,onClearSearchInput:I,"onClick:row":R[2]||(R[2]=Y=>D(Y)),onSort:k},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(T.EntityFilter),{modelValue:p.value,"onUpdate:modelValue":R[0]||(R[0]=Y=>p.value=Y),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(H,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(oi.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[o.vShow,Gt.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:o.withCtx(({row:Y})=>{var ve;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Gd,o.toDisplayString((ve=Y==null?void 0:Y.metadata)!=null&&ve.issuer?Y.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",zd,o.toDisplayString(o.unref(ee)(Y).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:Y})=>{var ve;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Wd,o.toDisplayString((ve=Y==null?void 0:Y.metadata)!=null&&ve.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Jd,o.toDisplayString(o.unref(ee)(Y).schemaExpiry?o.unref(s)(o.unref(ee)(Y).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:Y})=>{var ve;return[((ve=Y==null?void 0:Y.tags)==null?void 0:ve.length)>0?(o.openBlock(),o.createBlock(Ne,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Y==null?void 0:Y.tags,q=>(o.openBlock(),o.createBlock(ae,{key:q,onClick:R[1]||(R[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(q),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",Yd,"-"))]}),actions:o.withCtx(({row:Y})=>[o.createVNode(Sr,null,{default:o.withCtx(({copyToClipboard:ve})=>[o.createVNode(Ue,{"data-testid":"action-entity-copy-id",onClick:q=>Z(Y,ve)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Sr,null,{default:o.withCtx(({copyToClipboard:ve})=>[o.createVNode(Ue,{"data-testid":"action-entity-copy-json",onClick:q=>se(Y,ve)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(Y)},{default:o.withCtx(()=>[o.createVNode(Ue,{"data-testid":"action-entity-view","has-divider":"",item:C(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canEdit(Y)},{default:o.withCtx(()=>[o.createVNode(Ue,{"data-testid":"action-entity-edit",item:j(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(T.PermissionsWrapper),{"auth-function":()=>r.canDelete(Y)},{default:o.withCtx(()=>[o.createVNode(Ue,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ve=>bt(Y)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("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"]),o.createVNode(o.unref(T.EntityDeleteModal),{"action-pending":Be.value,"entity-type":o.unref(T.EntityTypes).CACertificate,error:ce.value,title:o.unref(n)("ca-certificates.delete.title"),visible:re.value,onCancel:br,onProceed:wr},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-8620b081"]]),Qd={class:"kong-ui-entities-ca-certificates-form"},Xd=qt(o.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(r,{emit:e}){var k;const t=e,i=r,n=ni.useRouter(),{i18n:{t:s}}=Ze.useI18n(),{getMessageFromError:c}=T.useErrors(),{axiosInstance:u}=T.useAxios((k=i.config)==null?void 0:k.axiosRequestConfig),f=o.computed(()=>ri.form[i.config.app].edit),d=o.computed(()=>i.certificateId?T.EntityBaseFormType.Edit:T.EntityBaseFormType.Create),v=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),y=o.reactive({cert:"",certDigest:"",tags:""}),z=o.computed(()=>(d.value===T.EntityBaseFormType.Create||JSON.stringify(v.fields)!==JSON.stringify(y))&&!!v.fields.cert),O=B=>{var Z;v.fields.cert=(B==null?void 0:B.cert)||"",v.fields.certDigest=(B==null?void 0:B.cert_digest)||"",v.fields.tags=((Z=B==null?void 0:B.tags)==null?void 0:Z.join(", "))||"",Object.assign(y,v.fields)},p=()=>{n.push(i.config.cancelRoute)},m=o.computed(()=>{var Z,se;let B=`${i.config.apiBaseUrl}${ri.form[i.config.app].validate}`;return i.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((Z=i.config)==null?void 0:Z.controlPlaneId)||""):i.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),B=B.replace(/{id}/gi,i.certificateId),B}),S=o.computed(()=>{var Z,se;let B=`${i.config.apiBaseUrl}${ri.form[i.config.app][d.value]}`;return i.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((Z=i.config)==null?void 0:Z.controlPlaneId)||""):i.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),B=B.replace(/{id}/gi,i.certificateId),B}),w=o.computed(()=>{var B,Z;return{cert:v.fields.cert,cert_digest:v.fields.certDigest||null,tags:(Z=(B=v.fields.tags.split(","))==null?void 0:B.map(se=>String(se||"").trim()))==null?void 0:Z.filter(se=>se!=="")}}),I=async()=>{var B,Z,se,D,C;try{v.isReadonly=!0;let j;await u.post(m.value,w.value),d.value==="create"?j=await u.post(S.value,w.value):d.value==="edit"&&(j=((B=i.config)==null?void 0:B.app)==="konnect"?await u.put(S.value,w.value):await u.patch(S.value,w.value)),v.fields.cert=((Z=j==null?void 0:j.data)==null?void 0:Z.cert)||"",v.fields.certDigest=((se=j==null?void 0:j.data)==null?void 0:se.cert_digest)||"",v.fields.tags=((C=(D=j==null?void 0:j.data)==null?void 0:D.tags)==null?void 0:C.join(", "))||"",Object.assign(y,v.fields),t("update",j==null?void 0:j.data)}catch(j){v.errorMessage=c(j),t("error",j)}finally{v.isReadonly=!1}};return(B,Z)=>{const se=o.resolveComponent("KTextArea"),D=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",Qd,[o.createVNode(o.unref(T.EntityBaseForm),{"can-submit":z.value,config:r.config,"edit-id":r.certificateId,"enable-terraform":r.enableTerraform,"entity-type":o.unref(T.SupportedEntityType).CaCertificate,"error-message":v.errorMessage,"fetch-url":f.value,"form-fields":w.value,"is-readonly":v.isReadonly,onCancel:p,"onFetch:error":Z[3]||(Z[3]=C=>B.$emit("error",C)),"onFetch:success":O,onLoading:Z[4]||(Z[4]=C=>B.$emit("loading",C)),onSubmit:I},{default:o.withCtx(()=>[o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.cert.description"),title:o.unref(s)("ca-certificates.form.sections.cert.title")},{default:o.withCtx(()=>[o.createVNode(se,{modelValue:v.fields.cert,"onUpdate:modelValue":Z[0]||(Z[0]=C=>v.fields.cert=C),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:o.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:v.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(D,{modelValue:v.fields.certDigest,"onUpdate:modelValue":Z[1]||(Z[1]=C=>v.fields.certDigest=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:v.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(T.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.general.description"),title:o.unref(s)("ca-certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(D,{modelValue:v.fields.tags,"onUpdate:modelValue":Z[2]||(Z[2]=C=>v.fields.tags=C),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:o.unref(s)("ca-certificates.form.fields.tags.help"),label:o.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:o.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:v.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-b74c6273"]]),ep={class:"kong-ui-certificate-entity-config-card"},tp={key:0},rp=qt(o.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=Ze.useI18n(),{convertKeyToTitle:u}=T.useStringHelpers(),{getPropValue:f}=T.useHelpers(),{getCertificateData:d}=Ze.useCertificate(),v=o.computed(()=>ti.form[i.config.app].edit),y=o.ref(),z=o.ref({id:{},cert:{section:T.ConfigurationSchemaSection.Basic},key:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Redacted},metadata:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.Json},snis:{section:T.ConfigurationSchemaSection.Basic,type:T.ConfigurationSchemaType.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:T.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:T.ConfigurationSchemaSection.Advanced},key_alt:{section:T.ConfigurationSchemaSection.Advanced,type:T.ConfigurationSchemaType.Redacted}}),O=C=>{y.value=C,t("fetch:success",C)},p=(C,j)=>{const de=f("rowValue",j);if(C==="expiry")return S.value;if(C==="key_usages")return B.value;if(C==="san_names")return I.value;if(de)return de[C]},m=o.computed(()=>{if(y.value)return d(y.value)}),S=o.computed(()=>{var C,j;return(C=m.value)!=null&&C.schemaExpiry?s((j=m.value)==null?void 0:j.schemaExpiry):""}),w=o.computed(()=>{var C;return((C=m.value)==null?void 0:C.schemaIssuer)||""}),I=o.computed(()=>{var C;return((C=m.value)==null?void 0:C.schemaSanNames)||""}),k=o.computed(()=>{var C;return((C=m.value)==null?void 0:C.schemaSubject)||""}),B=o.computed(()=>{var C;return((C=m.value)==null?void 0:C.schemaKeyUsages)||[]}),Z=o.computed(()=>{var C,j;return((j=(C=y==null?void 0:y.value)==null?void 0:C.snis)==null?void 0:j.length)>0}),se=o.computed(()=>{var C;return!!((C=y==null?void 0:y.value)!=null&&C.cert_alt)}),D=C=>{var j,de;return C==="san_names"?n("certificates.list.table_headers.san"):((de=(j=z.value)==null?void 0:j[C])==null?void 0:de.label)||u(C)};return(C,j)=>{const de=o.resolveComponent("KCodeBlock"),re=o.resolveComponent("KLabel"),Be=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",ep,[o.createVNode(o.unref(T.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":z.value,"enable-terraform":r.enableTerraform,"entity-type":o.unref(T.SupportedEntityType).Certificate,"fetch-url":v.value,"hide-title":r.hideTitle,"onFetch:error":j[0]||(j[0]=ce=>C.$emit("fetch:error",ce)),"onFetch:success":O,onLoading:j[1]||(j[1]=ce=>C.$emit("loading",ce))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:o.withCtx(ce=>[o.unref(f)("rowValue",ce)?(o.openBlock(),o.createBlock(de,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",ce),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":o.withCtx(()=>[o.createVNode(re,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(ce=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",ce)),pe=>(o.openBlock(),o.createBlock(o.unref(T.ConfigCardItem),{key:pe,item:{key:pe,value:p(pe,ce),label:D(pe),type:pe==="key_usages"||pe==="snis"||pe==="dns_names"?o.unref(T.ConfigurationSchemaType).BadgeTag:o.unref(T.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(I.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:o.withCtx(()=>[B.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",tp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(B.value,(ce,pe)=>(o.openBlock(),o.createBlock(Be,{key:`key_usages-badge-tag-${pe}`,class:"config-badge","data-testid":`key_usages-badge-tag-${pe}`,tooltip:ce,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ce),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[Z.value?void 0:{name:"snis",fn:o.withCtx(()=>[o.createTextVNode(" – ")]),key:"0"},se.value?{name:"cert_alt",fn:o.withCtx(ce=>[o.createTextVNode(" > "),o.unref(f)("rowValue",ce)?(o.openBlock(),o.createBlock(de,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",ce),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-c65f3278"]]);xe.CACertificateConfigCard=Kd,xe.CACertificateForm=Xd,xe.CACertificateList=Zd,xe.CertificateConfigCard=rp,xe.CertificateForm=Hd,xe.CertificateList=jd,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})});
|