@kong-ui-public/entities-certificates 3.0.9 → 3.0.10
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 +1595 -1582
- package/dist/entities-certificates.umd.js +35 -35
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(je,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],o):(je=typeof globalThis<"u"?globalThis:je||self,o(je["kong-ui-public-entities-certificates"]={},je.Vue,je.VueRouter,je["kong-ui-public-i18n"],je.axios,je.Kongponents))})(this,function(je,o,Wr,Di,
|
|
1
|
+
(function(je,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],o):(je=typeof globalThis<"u"?globalThis:je||self,o(je["kong-ui-public-entities-certificates"]={},je.Vue,je.VueRouter,je["kong-ui-public-i18n"],je.axios,je.Kongponents))})(this,function(je,o,Wr,Di,ol,cp){"use strict";var xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
|
|
2
2
|
Copyright (C) Microsoft. All rights reserved.
|
|
3
3
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
4
|
this file except in compliance with the License. You may obtain a copy of the
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
13
|
and limitations under the License.
|
|
14
|
-
***************************************************************************** */var sc;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof xo=="object"?xo:typeof self=="object"?self:typeof this=="object"?this:c(),i=n(e);typeof r.Reflect<"u"&&(i=n(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function n(l,d){return function(y,p){Object.defineProperty(l,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function c(){return s()||a()}})(function(t,r){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,d=!c&&!l,y={create:c?function(){return nc(Object.create(null))}:l?function(){return nc({__proto__:null})}:function(){return nc({})},has:d?function(v,x){return i.call(v,x)}:function(v,x){return x in v},get:d?function(v,x){return i.call(v,x)?v[x]:void 0}:function(v,x){return v[x]}},p=Object.getPrototypeOf(Function),I=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:kb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Cb(),h=typeof WeakMap=="function"?WeakMap:Sb(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,b=bb(),k=wb(b);function B(v,x,O,D){if(X(O)){if(!Se(v))throw new TypeError;if(!xe(x))throw new TypeError;return j(v,x)}else{if(!Se(v))throw new TypeError;if(!K(x))throw new TypeError;if(!K(D)&&!X(D)&&!ee(D))throw new TypeError;return ee(D)&&(D=void 0),O=te(O),Z(v,x,O,D)}}t("decorate",B);function E(v,x){function O(D,Q){if(!K(D))throw new TypeError;if(!X(Q)&&!Gr(Q))throw new TypeError;qr(v,x,D,Q)}return O}t("metadata",E);function S(v,x,O,D){if(!K(O))throw new TypeError;return X(D)||(D=te(D)),qr(v,x,O,D)}t("defineMetadata",S);function C(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),ne(v,x,O)}t("hasMetadata",C);function A(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ie(v,x,O)}t("hasOwnMetadata",A);function M(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ce(v,x,O)}t("getMetadata",M);function _(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ee(v,x,O)}t("getOwnMetadata",_);function N(v,x){if(!K(v))throw new TypeError;return X(x)||(x=te(x)),Kr(v,x)}t("getMetadataKeys",N);function re(v,x){if(!K(v))throw new TypeError;return X(x)||(x=te(x)),dr(v,x)}t("getOwnMetadataKeys",re);function q(v,x,O){if(!K(x))throw new TypeError;if(X(O)||(O=te(O)),!K(x))throw new TypeError;X(O)||(O=te(O));var D=ji(x,O,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(v,x,O)}t("deleteMetadata",q);function j(v,x){for(var O=v.length-1;O>=0;--O){var D=v[O],Q=D(x);if(!X(Q)&&!ee(Q)){if(!xe(Q))throw new TypeError;x=Q}}return x}function Z(v,x,O,D){for(var Q=v.length-1;Q>=0;--Q){var ge=v[Q],Ae=ge(x,O,D);if(!X(Ae)&&!ee(Ae)){if(!K(Ae))throw new TypeError;D=Ae}}return D}function ne(v,x,O){var D=Ie(v,x,O);if(D)return!0;var Q=ic(x);return ee(Q)?!1:ne(v,Q,O)}function Ie(v,x,O){var D=ji(x,O,!1);return X(D)?!1:Qe(D.OrdinaryHasOwnMetadata(v,x,O))}function Ce(v,x,O){var D=Ie(v,x,O);if(D)return Ee(v,x,O);var Q=ic(x);if(!ee(Q))return Ce(v,Q,O)}function Ee(v,x,O){var D=ji(x,O,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(v,x,O)}function qr(v,x,O,D){var Q=ji(O,D,!0);Q.OrdinaryDefineOwnMetadata(v,x,O,D)}function Kr(v,x){var O=dr(v,x),D=ic(v);if(D===null)return O;var Q=Kr(D,x);if(Q.length<=0)return O;if(O.length<=0)return Q;for(var ge=new w,Ae=[],oe=0,$=O;oe<$.length;oe++){var z=$[oe],F=ge.has(z);F||(ge.add(z),Ae.push(z))}for(var W=0,se=Q;W<se.length;W++){var z=se[W],F=ge.has(z);F||(ge.add(z),Ae.push(z))}return Ae}function dr(v,x){var O=ji(v,x,!1);return O?O.OrdinaryOwnMetadataKeys(v,x):[]}function jt(v){if(v===null)return 1;switch(typeof v){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return v===null?1:6;default:return 6}}function X(v){return v===void 0}function ee(v){return v===null}function U(v){return typeof v=="symbol"}function K(v){return typeof v=="object"?v!==null:typeof v=="function"}function de(v,x){switch(jt(v)){case 0:return v;case 1:return v;case 2:return v;case 3:return v;case 4:return v;case 5:return v}var O=x===3?"string":x===5?"number":"default",D=tp(v,s);if(D!==void 0){var Q=D.call(v,O);if(K(Q))throw new TypeError;return Q}return Ue(v,O==="default"?"number":O)}function Ue(v,x){if(x==="string"){var O=v.toString;if(Y(O)){var D=O.call(v);if(!K(D))return D}var Q=v.valueOf;if(Y(Q)){var D=Q.call(v);if(!K(D))return D}}else{var Q=v.valueOf;if(Y(Q)){var D=Q.call(v);if(!K(D))return D}var ge=v.toString;if(Y(ge)){var D=ge.call(v);if(!K(D))return D}}throw new TypeError}function Qe(v){return!!v}function zr(v){return""+v}function te(v){var x=de(v,3);return U(x)?x:zr(x)}function Se(v){return Array.isArray?Array.isArray(v):v instanceof Object?v instanceof Array:Object.prototype.toString.call(v)==="[object Array]"}function Y(v){return typeof v=="function"}function xe(v){return typeof v=="function"}function Gr(v){switch(jt(v)){case 3:return!0;case 4:return!0;default:return!1}}function rc(v,x){return v===x||v!==v&&x!==x}function tp(v,x){var O=v[x];if(O!=null){if(!Y(O))throw new TypeError;return O}}function rp(v){var x=tp(v,a);if(!Y(x))throw new TypeError;var O=x.call(v);if(!K(O))throw new TypeError;return O}function ip(v){return v.value}function np(v){var x=v.next();return x.done?!1:x}function op(v){var x=v.return;x&&x.call(v)}function ic(v){var x=Object.getPrototypeOf(v);if(typeof v!="function"||v===p||x!==p)return x;var O=v.prototype,D=O&&Object.getPrototypeOf(O);if(D==null||D===Object.prototype)return x;var Q=D.constructor;return typeof Q!="function"||Q===v?x:Q}function mb(){var v;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(v=vb(r.Reflect));var x,O,D,Q=new h,ge={registerProvider:Ae,getProvider:$,setProvider:F};return ge;function Ae(W){if(!Object.isExtensible(ge))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case v===W:break;case X(x):x=W;break;case x===W:break;case X(O):O=W;break;case O===W:break;default:D===void 0&&(D=new w),D.add(W);break}}function oe(W,se){if(!X(x)){if(x.isProviderFor(W,se))return x;if(!X(O)){if(O.isProviderFor(W,se))return x;if(!X(D))for(var pe=rp(D);;){var me=np(pe);if(!me)return;var ut=ip(me);if(ut.isProviderFor(W,se))return op(pe),ut}}}if(!X(v)&&v.isProviderFor(W,se))return v}function $(W,se){var pe=Q.get(W),me;return X(pe)||(me=pe.get(se)),X(me)&&(me=oe(W,se),X(me)||(X(pe)&&(pe=new I,Q.set(W,pe)),pe.set(se,me))),me}function z(W){if(X(W))throw new TypeError;return x===W||O===W||!X(D)&&D.has(W)}function F(W,se,pe){if(!z(pe))throw new Error("Metadata provider not registered.");var me=$(W,se);if(me!==pe){if(!X(me))return!1;var ut=Q.get(W);X(ut)&&(ut=new I,Q.set(W,ut)),ut.set(se,pe)}return!0}}function bb(){var v;return!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(v=r.Reflect[g]),X(v)&&(v=mb()),!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:v}),v}function wb(v){var x=new h,O={isProviderFor:function(z,F){var W=x.get(z);return X(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:Ae,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:ge,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:$};return b.registerProvider(O),O;function D(z,F,W){var se=x.get(z),pe=!1;if(X(se)){if(!W)return;se=new I,x.set(z,se),pe=!0}var me=se.get(F);if(X(me)){if(!W)return;if(me=new I,se.set(F,me),!v.setProvider(z,F,O))throw se.delete(F),pe&&x.delete(z),new Error("Wrong provider for target.")}return me}function Q(z,F,W){var se=D(F,W,!1);return X(se)?!1:Qe(se.has(z))}function ge(z,F,W){var se=D(F,W,!1);if(!X(se))return se.get(z)}function Ae(z,F,W,se){var pe=D(W,se,!0);pe.set(z,F)}function oe(z,F){var W=[],se=D(z,F,!1);if(X(se))return W;for(var pe=se.keys(),me=rp(pe),ut=0;;){var sp=np(me);if(!sp)return W.length=ut,W;var xb=ip(sp);try{W[ut]=xb}catch(Ab){try{op(me)}finally{throw Ab}}ut++}}function $(z,F,W){var se=D(F,W,!1);if(X(se)||!se.delete(z))return!1;if(se.size===0){var pe=x.get(F);X(pe)||(pe.delete(W),pe.size===0&&x.delete(pe))}return!0}}function vb(v){var x=v.defineMetadata,O=v.hasOwnMetadata,D=v.getOwnMetadata,Q=v.getOwnMetadataKeys,ge=v.deleteMetadata,Ae=new h,oe={isProviderFor:function($,z){var F=Ae.get($);return X(F)?Q($,z).length?(X(F)&&(F=new w,Ae.set($,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:x,OrdinaryHasOwnMetadata:O,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:ge};return oe}function ji(v,x,O){var D=b.getProvider(v,x);if(!X(D))return D;if(O){if(b.setProvider(v,x,k))return k;throw new Error("Illegal state.")}}function kb(){var v={},x=[],O=function(){function oe($,z,F){this._index=0,this._keys=$,this._values=z,this._selector=F}return oe.prototype["@@iterator"]=function(){return this},oe.prototype[a]=function(){return this},oe.prototype.next=function(){var $=this._index;if($>=0&&$<this._keys.length){var z=this._selector(this._keys[$],this._values[$]);return $+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},oe.prototype.throw=function($){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),$},oe.prototype.return=function($){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:$,done:!0}},oe}(),D=function(){function oe(){this._keys=[],this._values=[],this._cacheKey=v,this._cacheIndex=-2}return Object.defineProperty(oe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),oe.prototype.has=function($){return this._find($,!1)>=0},oe.prototype.get=function($){var z=this._find($,!1);return z>=0?this._values[z]:void 0},oe.prototype.set=function($,z){var F=this._find($,!0);return this._values[F]=z,this},oe.prototype.delete=function($){var z=this._find($,!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--,rc($,this._cacheKey)&&(this._cacheKey=v,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=v,this._cacheIndex=-2},oe.prototype.keys=function(){return new O(this._keys,this._values,Q)},oe.prototype.values=function(){return new O(this._keys,this._values,ge)},oe.prototype.entries=function(){return new O(this._keys,this._values,Ae)},oe.prototype["@@iterator"]=function(){return this.entries()},oe.prototype[a]=function(){return this.entries()},oe.prototype._find=function($,z){if(!rc(this._cacheKey,$)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(rc(this._keys[F],$)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push($),this._values.push(void 0)),this._cacheIndex},oe}();return D;function Q(oe,$){return oe}function ge(oe,$){return $}function Ae(oe,$){return[oe,$]}}function Cb(){var v=function(){function x(){this._map=new I}return Object.defineProperty(x.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),x.prototype.has=function(O){return this._map.has(O)},x.prototype.add=function(O){return this._map.set(O,O),this},x.prototype.delete=function(O){return this._map.delete(O)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.keys()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[a]=function(){return this.keys()},x}();return v}function Sb(){var v=16,x=y.create(),O=D();return function(){function $(){this._key=D()}return $.prototype.has=function(z){var F=Q(z,!1);return F!==void 0?y.has(F,this._key):!1},$.prototype.get=function(z){var F=Q(z,!1);return F!==void 0?y.get(F,this._key):void 0},$.prototype.set=function(z,F){var W=Q(z,!0);return W[this._key]=F,this},$.prototype.delete=function(z){var F=Q(z,!1);return F!==void 0?delete F[this._key]:!1},$.prototype.clear=function(){this._key=D()},$}();function D(){var $;do $="@@WeakMap@@"+oe();while(y.has(x,$));return x[$]=!0,$}function Q($,z){if(!i.call($,O)){if(!z)return;Object.defineProperty($,O,{value:y.create()})}return $[O]}function ge($,z){for(var F=0;F<z;++F)$[F]=Math.random()*255|0;return $}function Ae($){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array($)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array($)):ge(new Uint8Array($),$):ge(new Array($),$)}function oe(){var $=Ae(v);$[6]=$[6]&79|64,$[8]=$[8]&191|128;for(var z="",F=0;F<v;++F){var W=$[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function nc(v){return v.__=void 0,delete v.__,v}})})(sc||(sc={}));/*!
|
|
14
|
+
***************************************************************************** */var sl;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof xo=="object"?xo:typeof self=="object"?self:typeof this=="object"?this:l(),i=n(e);typeof r.Reflect<"u"&&(i=n(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function n(c,d){return function(y,p){Object.defineProperty(c,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function l(){return s()||a()}})(function(t,r){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,y={create:l?function(){return nl(Object.create(null))}:c?function(){return nl({__proto__:null})}:function(){return nl({})},has:d?function(C,B){return i.call(C,B)}:function(C,B){return B in C},get:d?function(C,B){return i.call(C,B)?C[B]:void 0}:function(C,B){return C[B]}},p=Object.getPrototypeOf(Function),I=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:kb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Cb(),h=typeof WeakMap=="function"?WeakMap:Sb(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,b=bb(),v=wb(b);function x(C,B,O,D){if(X(O)){if(!Se(C))throw new TypeError;if(!xe(B))throw new TypeError;return j(C,B)}else{if(!Se(C))throw new TypeError;if(!K(B))throw new TypeError;if(!K(D)&&!X(D)&&!ee(D))throw new TypeError;return ee(D)&&(D=void 0),O=te(O),Z(C,B,O,D)}}t("decorate",x);function E(C,B){function O(D,Q){if(!K(D))throw new TypeError;if(!X(Q)&&!Gr(Q))throw new TypeError;qr(C,B,D,Q)}return O}t("metadata",E);function k(C,B,O,D){if(!K(O))throw new TypeError;return X(D)||(D=te(D)),qr(C,B,O,D)}t("defineMetadata",k);function S(C,B,O){if(!K(B))throw new TypeError;return X(O)||(O=te(O)),ne(C,B,O)}t("hasMetadata",S);function A(C,B,O){if(!K(B))throw new TypeError;return X(O)||(O=te(O)),Ie(C,B,O)}t("hasOwnMetadata",A);function $(C,B,O){if(!K(B))throw new TypeError;return X(O)||(O=te(O)),Ce(C,B,O)}t("getMetadata",$);function _(C,B,O){if(!K(B))throw new TypeError;return X(O)||(O=te(O)),Ee(C,B,O)}t("getOwnMetadata",_);function N(C,B){if(!K(C))throw new TypeError;return X(B)||(B=te(B)),Kr(C,B)}t("getMetadataKeys",N);function re(C,B){if(!K(C))throw new TypeError;return X(B)||(B=te(B)),dr(C,B)}t("getOwnMetadataKeys",re);function q(C,B,O){if(!K(B))throw new TypeError;if(X(O)||(O=te(O)),!K(B))throw new TypeError;X(O)||(O=te(O));var D=ji(B,O,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(C,B,O)}t("deleteMetadata",q);function j(C,B){for(var O=C.length-1;O>=0;--O){var D=C[O],Q=D(B);if(!X(Q)&&!ee(Q)){if(!xe(Q))throw new TypeError;B=Q}}return B}function Z(C,B,O,D){for(var Q=C.length-1;Q>=0;--Q){var ge=C[Q],Ae=ge(B,O,D);if(!X(Ae)&&!ee(Ae)){if(!K(Ae))throw new TypeError;D=Ae}}return D}function ne(C,B,O){var D=Ie(C,B,O);if(D)return!0;var Q=il(B);return ee(Q)?!1:ne(C,Q,O)}function Ie(C,B,O){var D=ji(B,O,!1);return X(D)?!1:Qe(D.OrdinaryHasOwnMetadata(C,B,O))}function Ce(C,B,O){var D=Ie(C,B,O);if(D)return Ee(C,B,O);var Q=il(B);if(!ee(Q))return Ce(C,Q,O)}function Ee(C,B,O){var D=ji(B,O,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(C,B,O)}function qr(C,B,O,D){var Q=ji(O,D,!0);Q.OrdinaryDefineOwnMetadata(C,B,O,D)}function Kr(C,B){var O=dr(C,B),D=il(C);if(D===null)return O;var Q=Kr(D,B);if(Q.length<=0)return O;if(O.length<=0)return Q;for(var ge=new w,Ae=[],oe=0,M=O;oe<M.length;oe++){var z=M[oe],F=ge.has(z);F||(ge.add(z),Ae.push(z))}for(var W=0,se=Q;W<se.length;W++){var z=se[W],F=ge.has(z);F||(ge.add(z),Ae.push(z))}return Ae}function dr(C,B){var O=ji(C,B,!1);return O?O.OrdinaryOwnMetadataKeys(C,B):[]}function jt(C){if(C===null)return 1;switch(typeof C){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return C===null?1:6;default:return 6}}function X(C){return C===void 0}function ee(C){return C===null}function U(C){return typeof C=="symbol"}function K(C){return typeof C=="object"?C!==null:typeof C=="function"}function de(C,B){switch(jt(C)){case 0:return C;case 1:return C;case 2:return C;case 3:return C;case 4:return C;case 5:return C}var O=B===3?"string":B===5?"number":"default",D=tp(C,s);if(D!==void 0){var Q=D.call(C,O);if(K(Q))throw new TypeError;return Q}return Ue(C,O==="default"?"number":O)}function Ue(C,B){if(B==="string"){var O=C.toString;if(Y(O)){var D=O.call(C);if(!K(D))return D}var Q=C.valueOf;if(Y(Q)){var D=Q.call(C);if(!K(D))return D}}else{var Q=C.valueOf;if(Y(Q)){var D=Q.call(C);if(!K(D))return D}var ge=C.toString;if(Y(ge)){var D=ge.call(C);if(!K(D))return D}}throw new TypeError}function Qe(C){return!!C}function zr(C){return""+C}function te(C){var B=de(C,3);return U(B)?B:zr(B)}function Se(C){return Array.isArray?Array.isArray(C):C instanceof Object?C instanceof Array:Object.prototype.toString.call(C)==="[object Array]"}function Y(C){return typeof C=="function"}function xe(C){return typeof C=="function"}function Gr(C){switch(jt(C)){case 3:return!0;case 4:return!0;default:return!1}}function rl(C,B){return C===B||C!==C&&B!==B}function tp(C,B){var O=C[B];if(O!=null){if(!Y(O))throw new TypeError;return O}}function rp(C){var B=tp(C,a);if(!Y(B))throw new TypeError;var O=B.call(C);if(!K(O))throw new TypeError;return O}function ip(C){return C.value}function np(C){var B=C.next();return B.done?!1:B}function op(C){var B=C.return;B&&B.call(C)}function il(C){var B=Object.getPrototypeOf(C);if(typeof C!="function"||C===p||B!==p)return B;var O=C.prototype,D=O&&Object.getPrototypeOf(O);if(D==null||D===Object.prototype)return B;var Q=D.constructor;return typeof Q!="function"||Q===C?B:Q}function mb(){var C;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(C=vb(r.Reflect));var B,O,D,Q=new h,ge={registerProvider:Ae,getProvider:M,setProvider:F};return ge;function Ae(W){if(!Object.isExtensible(ge))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case C===W:break;case X(B):B=W;break;case B===W:break;case X(O):O=W;break;case O===W:break;default:D===void 0&&(D=new w),D.add(W);break}}function oe(W,se){if(!X(B)){if(B.isProviderFor(W,se))return B;if(!X(O)){if(O.isProviderFor(W,se))return B;if(!X(D))for(var pe=rp(D);;){var me=np(pe);if(!me)return;var ut=ip(me);if(ut.isProviderFor(W,se))return op(pe),ut}}}if(!X(C)&&C.isProviderFor(W,se))return C}function M(W,se){var pe=Q.get(W),me;return X(pe)||(me=pe.get(se)),X(me)&&(me=oe(W,se),X(me)||(X(pe)&&(pe=new I,Q.set(W,pe)),pe.set(se,me))),me}function z(W){if(X(W))throw new TypeError;return B===W||O===W||!X(D)&&D.has(W)}function F(W,se,pe){if(!z(pe))throw new Error("Metadata provider not registered.");var me=M(W,se);if(me!==pe){if(!X(me))return!1;var ut=Q.get(W);X(ut)&&(ut=new I,Q.set(W,ut)),ut.set(se,pe)}return!0}}function bb(){var C;return!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(C=r.Reflect[g]),X(C)&&(C=mb()),!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:C}),C}function wb(C){var B=new h,O={isProviderFor:function(z,F){var W=B.get(z);return X(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:Ae,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:ge,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:M};return b.registerProvider(O),O;function D(z,F,W){var se=B.get(z),pe=!1;if(X(se)){if(!W)return;se=new I,B.set(z,se),pe=!0}var me=se.get(F);if(X(me)){if(!W)return;if(me=new I,se.set(F,me),!C.setProvider(z,F,O))throw se.delete(F),pe&&B.delete(z),new Error("Wrong provider for target.")}return me}function Q(z,F,W){var se=D(F,W,!1);return X(se)?!1:Qe(se.has(z))}function ge(z,F,W){var se=D(F,W,!1);if(!X(se))return se.get(z)}function Ae(z,F,W,se){var pe=D(W,se,!0);pe.set(z,F)}function oe(z,F){var W=[],se=D(z,F,!1);if(X(se))return W;for(var pe=se.keys(),me=rp(pe),ut=0;;){var sp=np(me);if(!sp)return W.length=ut,W;var xb=ip(sp);try{W[ut]=xb}catch(Ab){try{op(me)}finally{throw Ab}}ut++}}function M(z,F,W){var se=D(F,W,!1);if(X(se)||!se.delete(z))return!1;if(se.size===0){var pe=B.get(F);X(pe)||(pe.delete(W),pe.size===0&&B.delete(pe))}return!0}}function vb(C){var B=C.defineMetadata,O=C.hasOwnMetadata,D=C.getOwnMetadata,Q=C.getOwnMetadataKeys,ge=C.deleteMetadata,Ae=new h,oe={isProviderFor:function(M,z){var F=Ae.get(M);return X(F)?Q(M,z).length?(X(F)&&(F=new w,Ae.set(M,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:B,OrdinaryHasOwnMetadata:O,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:ge};return oe}function ji(C,B,O){var D=b.getProvider(C,B);if(!X(D))return D;if(O){if(b.setProvider(C,B,v))return v;throw new Error("Illegal state.")}}function kb(){var C={},B=[],O=function(){function oe(M,z,F){this._index=0,this._keys=M,this._values=z,this._selector=F}return oe.prototype["@@iterator"]=function(){return this},oe.prototype[a]=function(){return this},oe.prototype.next=function(){var M=this._index;if(M>=0&&M<this._keys.length){var z=this._selector(this._keys[M],this._values[M]);return M+1>=this._keys.length?(this._index=-1,this._keys=B,this._values=B):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},oe.prototype.throw=function(M){throw this._index>=0&&(this._index=-1,this._keys=B,this._values=B),M},oe.prototype.return=function(M){return this._index>=0&&(this._index=-1,this._keys=B,this._values=B),{value:M,done:!0}},oe}(),D=function(){function oe(){this._keys=[],this._values=[],this._cacheKey=C,this._cacheIndex=-2}return Object.defineProperty(oe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),oe.prototype.has=function(M){return this._find(M,!1)>=0},oe.prototype.get=function(M){var z=this._find(M,!1);return z>=0?this._values[z]:void 0},oe.prototype.set=function(M,z){var F=this._find(M,!0);return this._values[F]=z,this},oe.prototype.delete=function(M){var z=this._find(M,!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--,rl(M,this._cacheKey)&&(this._cacheKey=C,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=C,this._cacheIndex=-2},oe.prototype.keys=function(){return new O(this._keys,this._values,Q)},oe.prototype.values=function(){return new O(this._keys,this._values,ge)},oe.prototype.entries=function(){return new O(this._keys,this._values,Ae)},oe.prototype["@@iterator"]=function(){return this.entries()},oe.prototype[a]=function(){return this.entries()},oe.prototype._find=function(M,z){if(!rl(this._cacheKey,M)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(rl(this._keys[F],M)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(M),this._values.push(void 0)),this._cacheIndex},oe}();return D;function Q(oe,M){return oe}function ge(oe,M){return M}function Ae(oe,M){return[oe,M]}}function Cb(){var C=function(){function B(){this._map=new I}return Object.defineProperty(B.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),B.prototype.has=function(O){return this._map.has(O)},B.prototype.add=function(O){return this._map.set(O,O),this},B.prototype.delete=function(O){return this._map.delete(O)},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[a]=function(){return this.keys()},B}();return C}function Sb(){var C=16,B=y.create(),O=D();return function(){function M(){this._key=D()}return M.prototype.has=function(z){var F=Q(z,!1);return F!==void 0?y.has(F,this._key):!1},M.prototype.get=function(z){var F=Q(z,!1);return F!==void 0?y.get(F,this._key):void 0},M.prototype.set=function(z,F){var W=Q(z,!0);return W[this._key]=F,this},M.prototype.delete=function(z){var F=Q(z,!1);return F!==void 0?delete F[this._key]:!1},M.prototype.clear=function(){this._key=D()},M}();function D(){var M;do M="@@WeakMap@@"+oe();while(y.has(B,M));return B[M]=!0,M}function Q(M,z){if(!i.call(M,O)){if(!z)return;Object.defineProperty(M,O,{value:y.create()})}return M[O]}function ge(M,z){for(var F=0;F<z;++F)M[F]=Math.random()*255|0;return M}function Ae(M){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(M)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(M)):ge(new Uint8Array(M),M):ge(new Array(M),M)}function oe(){var M=Ae(C);M[6]=M[6]&79|64,M[8]=M[8]&191|128;for(var z="",F=0;F<C;++F){var W=M[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function nl(C){return C.__=void 0,delete C.__,C}})})(sl||(sl={}));/*!
|
|
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 up="[object ArrayBuffer]";class P{static isArrayBuffer(t){return Object.prototype.toString.call(t)===up}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength||t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t.buffer).slice(t.byteOffset,t.byteOffset+t.byteLength).buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const i=P.toUint8Array(t),n=P.toUint8Array(r);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(...t){let r;Array.isArray(t[0])&&!(t[1]instanceof Function)||Array.isArray(t[0])&&t[1]instanceof Function?r=t[0]:t[t.length-1]instanceof Function?r=t.slice(0,t.length-1):r=t;let i=0;for(const a of r)i+=a.byteLength;const n=new Uint8Array(i);let s=0;for(const a of r){const
|
|
37
|
+
*/const up="[object ArrayBuffer]";class P{static isArrayBuffer(t){return Object.prototype.toString.call(t)===up}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength||t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t.buffer).slice(t.byteOffset,t.byteOffset+t.byteLength).buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const i=P.toUint8Array(t),n=P.toUint8Array(r);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(...t){let r;Array.isArray(t[0])&&!(t[1]instanceof Function)||Array.isArray(t[0])&&t[1]instanceof Function?r=t[0]:t[t.length-1]instanceof Function?r=t.slice(0,t.length-1):r=t;let i=0;for(const a of r)i+=a.byteLength;const n=new Uint8Array(i);let s=0;for(const a of r){const l=this.toUint8Array(a);n.set(l,s),s+=l.length}return t[t.length-1]instanceof Function?this.toView(n,t[t.length-1]):n.buffer}}const Ao="string",dp=/^[0-9a-f]+$/i,fp=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,pp=/^[a-zA-Z0-9-_]+$/;class al{static fromString(t){const r=unescape(encodeURIComponent(t)),i=new Uint8Array(r.length);for(let n=0;n<r.length;n++)i[n]=r.charCodeAt(n);return i.buffer}static toString(t){const r=P.toUint8Array(t);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class dt{static toString(t,r=!1){const i=P.toArrayBuffer(t),n=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const l=n.getUint16(a,r);s+=String.fromCharCode(l)}return s}static fromString(t,r=!1){const i=new ArrayBuffer(t.length*2),n=new DataView(i);for(let s=0;s<t.length;s++)n.setUint16(s*2,t.charCodeAt(s),r);return i}}class L{static isHex(t){return typeof t===Ao&&dp.test(t)}static isBase64(t){return typeof t===Ao&&fp.test(t)}static isBase64Url(t){return typeof t===Ao&&pp.test(t)}static ToString(t,r="utf8"){const i=P.toUint8Array(t);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return dt.toString(i,!0);case"utf16":case"utf16be":return dt.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(t,r="utf8"){if(!t)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(t);case"binary":return this.FromBinary(t);case"hex":return this.FromHex(t);case"base64":return this.FromBase64(t);case"base64url":return this.FromBase64Url(t);case"utf16le":return dt.fromString(t,!0);case"utf16":case"utf16be":return dt.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=P.toUint8Array(t);if(typeof btoa<"u"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return al.fromString(t);case"utf16":case"utf16be":return dt.fromString(t);case"utf16le":case"usc2":return dt.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return al.toString(t);case"utf16":case"utf16be":return dt.toString(t);case"utf16le":case"usc2":return dt.toString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(t){const r=t.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer}static ToBinary(t){const r=P.toUint8Array(t);let i="";for(let n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);return i}static ToHex(t){const r=P.toUint8Array(t);let i="";const n=r.length;for(let s=0;s<n;s++){const a=r[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!L.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let n=0;n<r.length;n=n+2){const s=r.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(t,r=!1){return dt.toString(t,r)}static FromUtf16String(t,r=!1){return dt.fromString(t,r)}static Base64Padding(t){const r=4-t.length%4;if(r<4)for(let i=0;i<r;i++)t+="=";return t}static formatString(t){return(t==null?void 0:t.replace(/[\n\r\t ]/g,""))||""}}L.DEFAULT_UTF8_ENCODING="utf8";function hp(...e){const t=e.map(n=>n.byteLength).reduce((n,s)=>n+s),r=new Uint8Array(t);let i=0;return e.map(n=>new Uint8Array(n)).forEach(n=>{for(const s of n)r[i++]=s}),r.buffer}function ll(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<e.byteLength;n++)if(r[n]!==i[n])return!1;return!0}/*!
|
|
38
38
|
Copyright (c) Peculiar Ventures, LLC
|
|
39
|
-
*/function fr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function Kt(e,t,r=-1){const i=r;let n=e,s=0,a=Math.pow(2,t);for(let
|
|
39
|
+
*/function fr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function Kt(e,t,r=-1){const i=r;let n=e,s=0,a=Math.pow(2,t);for(let l=1;l<8;l++){if(e<a){let c;if(i<0)c=new ArrayBuffer(l),s=l;else{if(i<l)return new ArrayBuffer(0);c=new ArrayBuffer(i),s=i}const d=new Uint8Array(c);for(let y=l-1;y>=0;y--){const p=Math.pow(2,y*t);d[s-y-1]=Math.floor(n/p),n-=d[s-y-1]*p}return c}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function Bo(...e){let t=0,r=0;for(const s of e)t+=s.length;const i=new ArrayBuffer(t),n=new Uint8Array(i);for(const s of e)n.set(s,r),r+=s.length;return n}function cl(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const l=e[0]===255&&e[1]&128,c=e[0]===0&&(e[1]&128)===0;(l||c)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let l=0;l<this.valueHex.byteLength;l++)r[l]=0;r[0]=e[0]&128;const i=fr(r,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let l=0;l<this.valueHex.byteLength;l++)s[l]=e[l];return s[0]&=127,fr(s,8)-i}function yp(e){const t=e<0?e*-1:e;let r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){const a=r-t,l=Kt(a,8,i),c=new Uint8Array(l);return c[0]|=128,l}let n=Kt(t,8,i),s=new Uint8Array(n);if(s[0]&128){const a=n.slice(0),l=new Uint8Array(a);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let c=0;c<a.byteLength;c++)s[c+1]=l[c];s[0]=0}return n}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function gp(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<r.length;n++)if(r[n]!==i[n])return!1;return!0}function We(e,t){const r=e.toString(10);if(t<r.length)return"";const i=t-r.length,n=new Array(i);for(let a=0;a<i;a++)n[a]="0";return n.join("").concat(r)}/*!
|
|
40
40
|
* Copyright (c) 2014, GMO GlobalSign
|
|
41
41
|
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
42
42
|
* All rights reserved.
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
69
69
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
70
70
|
*
|
|
71
|
-
*/function Mi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Io(e){let t=0,r=0;for(let n=0;n<e.length;n++){const s=e[n];t+=s.byteLength}const i=new Uint8Array(t);for(let n=0;n<e.length;n++){const s=e[n];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function kt(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class $i{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return Io(this.items)}}const Jr=[new Uint8Array([1])],uc="0123456789",Eo="name",dc="valueHexView",mp="isHexOnly",bp="idBlock",wp="tagClass",vp="tagNumber",kp="isConstructed",Cp="fromBER",Sp="toBER",xp="local",Le="",nt=new ArrayBuffer(0),Pi=new Uint8Array(0),Yr="EndOfContent",fc="OCTET STRING",pc="BIT STRING";function ft(e){var t;return t=class extends e{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?P.toUint8Array(s.valueHex):Pi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!kt(this,a,n,s))return-1;const c=n+s;return this.valueHexView=a.subarray(n,c),this.valueHexView.length?(this.blockLength=s,c):(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",nt)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class zt{constructor({blockLength:t=0,error:r=Le,warnings:i=[],valueBeforeDecode:n=Pi}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=P.toUint8Array(n)}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)}}}zt.NAME="baseBlock";class $e extends zt{fromBER(t,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}$e.NAME="valueBlock";class hc extends ft(zt){constructor({idBlock:t={}}={}){var r,i,n,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?P.toUint8Array(t.valueHex):Pi,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=t.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",nt}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,n[0]=r}return n.buffer}if(!this.isHexOnly){const n=Kt(this.tagNumber,7),s=new Uint8Array(n),a=n.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const 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(t,r,i){const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;const s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===y){y+=255;const I=new Uint8Array(y);for(let w=0;w<d.length;w++)I[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let I=0;I<l;I++)p[I]=d[I];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=fr(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}}}hc.NAME="identificationBlock";class yc extends zt{constructor({lenBlock:t={}}={}){var r,i,n;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(n=t.length)!==null&&n!==void 0?n:0}fromBER(t,r,i){const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;const s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=r+1,l=n.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=fr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const n=Kt(this.length,8);if(n.byteLength>127)return this.error="Too big length",nt;if(r=new ArrayBuffer(n.byteLength+1),t)return r;const s=new Uint8Array(n);i=new Uint8Array(r),i[0]=n.byteLength|128;for(let a=0;a<n.byteLength;a++)i[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}yc.NAME="lengthBlock";const R={};class Ne extends zt{constructor({name:t=Le,optional:r=!1,primitiveSchema:i,...n}={},s){super(n),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new hc(n),this.lenBlock=new yc(n),this.valueBlock=s?new s(n):new $e(n)}fromBER(t,r,i){const n=this.valueBlock.fromBER(t,r,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(t,r){const i=r||new $i;r||gc(this);const n=this.idBlock.toBER(t);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?nt:i.final()}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(t.primitiveSchema=this.primitiveSchema.toJSON()),t}toString(t="ascii"){return t==="ascii"?this.onAsciiEncoding():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(),i=t.toBER();return gp(r,i)}}Ne.NAME="BaseBlock";function gc(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)gc(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class No extends Ne{constructor({value:t=Le,...r}={},i){super(r,i),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,i){const n=this.valueBlock.fromBER(t,r,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}'`}}No.NAME="BaseStringBlock";class mc extends ft($e){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}mc.NAME="PrimitiveValueBlock";var bc;class Zr extends Ne{constructor(t={}){super(t,mc),this.idBlock.isConstructed=!1}}bc=Zr,R.Primitive=bc,Zr.NAME="PRIMITIVE";function Ap(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function pr(e,t=0,r=e.length){const i=t;let n=new Ne({},$e);const s=new zt;if(!kt(s,e,t,r))return n.error=s.error,{offset:-1,result:n};if(!e.subarray(t,t+r).length)return n.error="Zero buffer length",{offset:-1,result:n};let c=n.idBlock.fromBER(e,t,r);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),c===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(t=c,r-=n.idBlock.blockLength,c=n.lenBlock.fromBER(e,t,r),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),c===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(t=c,r-=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 l=Ne;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};l=R.EndOfContent;break;case 1:l=R.Boolean;break;case 2:l=R.Integer;break;case 3:l=R.BitString;break;case 4:l=R.OctetString;break;case 5:l=R.Null;break;case 6:l=R.ObjectIdentifier;break;case 10:l=R.Enumerated;break;case 12:l=R.Utf8String;break;case 13:l=R.RelativeObjectIdentifier;break;case 14:l=R.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:l=R.Sequence;break;case 17:l=R.Set;break;case 18:l=R.NumericString;break;case 19:l=R.PrintableString;break;case 20:l=R.TeletexString;break;case 21:l=R.VideotexString;break;case 22:l=R.IA5String;break;case 23:l=R.UTCTime;break;case 24:l=R.GeneralizedTime;break;case 25:l=R.GraphicString;break;case 26:l=R.VisibleString;break;case 27:l=R.GeneralString;break;case 28:l=R.UniversalString;break;case 29:l=R.CharacterString;break;case 30:l=R.BmpString;break;case 31:l=R.DATE;break;case 32:l=R.TimeOfDay;break;case 33:l=R.DateTime;break;case 34:l=R.Duration;break;default:{const d=n.idBlock.isConstructed?new R.Constructed:new R.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:l=n.idBlock.isConstructed?R.Constructed:R.Primitive}return n=Ap(n,l),c=n.fromBER(e,t,n.lenBlock.isIndefiniteForm?r:n.lenBlock.length),n.valueBeforeDecodeView=e.subarray(i,i+n.blockLength),{offset:c,result:n}}function hr(e){if(!e.byteLength){const t=new Ne({},$e);return t.error="Input buffer has zero length",{offset:-1,result:t}}return pr(P.toUint8Array(e).slice(),0,e.byteLength)}function Bp(e,t){return e?1:t}class Dt extends $e{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;if(this.valueBeforeDecodeView=n.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;Bp(this.isIndefiniteForm,i)>0;){const a=pr(n,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Yr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Yr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new $i;for(let n=0;n<this.value.length;n++)this.value[n].toBER(t,i);return r?nt:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Dt.NAME="ConstructedValueBlock";var wc;class Fe extends Ne{constructor(t={}){super(t,Dt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(t,r,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 t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
71
|
+
*/function $i(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Io(e){let t=0,r=0;for(let n=0;n<e.length;n++){const s=e[n];t+=s.byteLength}const i=new Uint8Array(t);for(let n=0;n<e.length;n++){const s=e[n];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function kt(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class Mi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return Io(this.items)}}const Jr=[new Uint8Array([1])],ul="0123456789",Eo="name",dl="valueHexView",mp="isHexOnly",bp="idBlock",wp="tagClass",vp="tagNumber",kp="isConstructed",Cp="fromBER",Sp="toBER",xp="local",Le="",nt=new ArrayBuffer(0),Pi=new Uint8Array(0),Yr="EndOfContent",fl="OCTET STRING",pl="BIT STRING";function ft(e){var t;return t=class extends e{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?P.toUint8Array(s.valueHex):Pi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!kt(this,a,n,s))return-1;const l=n+s;return this.valueHexView=a.subarray(n,l),this.valueHexView.length?(this.blockLength=s,l):(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",nt)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class zt{constructor({blockLength:t=0,error:r=Le,warnings:i=[],valueBeforeDecode:n=Pi}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=P.toUint8Array(n)}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)}}}zt.NAME="baseBlock";class Me extends zt{fromBER(t,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}Me.NAME="valueBlock";class hl extends ft(zt){constructor({idBlock:t={}}={}){var r,i,n,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?P.toUint8Array(t.valueHex):Pi,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=t.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",nt}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,n[0]=r}return n.buffer}if(!this.isHexOnly){const n=Kt(this.tagNumber,7),s=new Uint8Array(n),a=n.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 i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){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(t,r,i){const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;const s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const 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 I=new Uint8Array(y);for(let w=0;w<d.length;w++)I[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=c+1,d[c-1]=s[c]&127;const p=new Uint8Array(c);for(let I=0;I<c;I++)p[I]=d[I];d=this.valueHexView=new Uint8Array(c),d.set(p),this.blockLength<=9?this.tagNumber=fr(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}}}hl.NAME="identificationBlock";class yl extends zt{constructor({lenBlock:t={}}={}){var r,i,n;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(n=t.length)!==null&&n!==void 0?n:0}fromBER(t,r,i){const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;const s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const l=r+1,c=n.subarray(l,l+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=fr(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,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const n=Kt(this.length,8);if(n.byteLength>127)return this.error="Too big length",nt;if(r=new ArrayBuffer(n.byteLength+1),t)return r;const s=new Uint8Array(n);i=new Uint8Array(r),i[0]=n.byteLength|128;for(let a=0;a<n.byteLength;a++)i[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}yl.NAME="lengthBlock";const R={};class Ne extends zt{constructor({name:t=Le,optional:r=!1,primitiveSchema:i,...n}={},s){super(n),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new hl(n),this.lenBlock=new yl(n),this.valueBlock=s?new s(n):new Me(n)}fromBER(t,r,i){const n=this.valueBlock.fromBER(t,r,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(t,r){const i=r||new Mi;r||gl(this);const n=this.idBlock.toBER(t);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?nt:i.final()}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(t.primitiveSchema=this.primitiveSchema.toJSON()),t}toString(t="ascii"){return t==="ascii"?this.onAsciiEncoding():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(),i=t.toBER();return gp(r,i)}}Ne.NAME="BaseBlock";function gl(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)gl(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class No extends Ne{constructor({value:t=Le,...r}={},i){super(r,i),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,i){const n=this.valueBlock.fromBER(t,r,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}'`}}No.NAME="BaseStringBlock";class ml extends ft(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}ml.NAME="PrimitiveValueBlock";var bl;class Zr extends Ne{constructor(t={}){super(t,ml),this.idBlock.isConstructed=!1}}bl=Zr,R.Primitive=bl,Zr.NAME="PRIMITIVE";function Ap(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function pr(e,t=0,r=e.length){const i=t;let n=new Ne({},Me);const s=new zt;if(!kt(s,e,t,r))return n.error=s.error,{offset:-1,result:n};if(!e.subarray(t,t+r).length)return n.error="Zero buffer length",{offset:-1,result:n};let l=n.idBlock.fromBER(e,t,r);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),l===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(t=l,r-=n.idBlock.blockLength,l=n.lenBlock.fromBER(e,t,r),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),l===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(t=l,r-=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 c=Ne;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};c=R.EndOfContent;break;case 1:c=R.Boolean;break;case 2:c=R.Integer;break;case 3:c=R.BitString;break;case 4:c=R.OctetString;break;case 5:c=R.Null;break;case 6:c=R.ObjectIdentifier;break;case 10:c=R.Enumerated;break;case 12:c=R.Utf8String;break;case 13:c=R.RelativeObjectIdentifier;break;case 14:c=R.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:c=R.Sequence;break;case 17:c=R.Set;break;case 18:c=R.NumericString;break;case 19:c=R.PrintableString;break;case 20:c=R.TeletexString;break;case 21:c=R.VideotexString;break;case 22:c=R.IA5String;break;case 23:c=R.UTCTime;break;case 24:c=R.GeneralizedTime;break;case 25:c=R.GraphicString;break;case 26:c=R.VisibleString;break;case 27:c=R.GeneralString;break;case 28:c=R.UniversalString;break;case 29:c=R.CharacterString;break;case 30:c=R.BmpString;break;case 31:c=R.DATE;break;case 32:c=R.TimeOfDay;break;case 33:c=R.DateTime;break;case 34:c=R.Duration;break;default:{const d=n.idBlock.isConstructed?new R.Constructed:new R.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:c=n.idBlock.isConstructed?R.Constructed:R.Primitive}return n=Ap(n,c),l=n.fromBER(e,t,n.lenBlock.isIndefiniteForm?r:n.lenBlock.length),n.valueBeforeDecodeView=e.subarray(i,i+n.blockLength),{offset:l,result:n}}function hr(e){if(!e.byteLength){const t=new Ne({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return pr(P.toUint8Array(e).slice(),0,e.byteLength)}function Bp(e,t){return e?1:t}class Dt extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;if(this.valueBeforeDecodeView=n.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;Bp(this.isIndefiniteForm,i)>0;){const a=pr(n,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Yr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Yr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Mi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(t,i);return r?nt:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Dt.NAME="ConstructedValueBlock";var wl;class Fe extends Ne{constructor(t={}){super(t,Dt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(t,r,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 t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
72
72
|
`).map(n=>` ${n}`).join(`
|
|
73
73
|
`));const r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${r} :
|
|
74
74
|
${t.join(`
|
|
75
|
-
`)}`:`${r} :`}}wc=Fe,R.Constructed=wc,Fe.NAME="CONSTRUCTED";class vc extends $e{fromBER(t,r,i){return r}toBER(t){return nt}}vc.override="EndOfContentValueBlock";var kc;class Oo extends Ne{constructor(t={}){super(t,vc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}kc=Oo,R.EndOfContent=kc,Oo.NAME=Yr;var Cc;class Gt extends Ne{constructor(t={}){super(t,$e),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const n=new Uint8Array(i);n[0]=5,n[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}Cc=Gt,R.Null=Cc,Gt.NAME="NULL";class Sc extends ft($e){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=P.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,i){const n=P.toUint8Array(t);return kt(this,n,r,i)?(this.valueHexView=n.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,lc.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Sc.NAME="BooleanValueBlock";var xc;let Ri=class extends Ne{constructor(t={}){super(t,Sc),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}`}};xc=Ri,R.Boolean=xc,Ri.NAME="BOOLEAN";class Ac extends ft(Dt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=Dt.prototype.fromBER.call(this,t,r,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==fc)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(t,r,i),this.blockLength=i;return n}toBER(t,r){return this.isConstructed?Dt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Ac.NAME="OctetStringValueBlock";var Bc;let Wt=class ap extends Ne{constructor({idBlock:t={},lenBlock:r={},...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,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},Ac),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=pr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Fe.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 ap&&t.push(r.valueBlock.valueHexView);return P.concat(t)}};Bc=Wt,R.OctetString=Bc,Wt.NAME=fc;class Ic extends ft(Dt){constructor({unusedBits:t=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,i){if(!i)return r;let n=-1;if(this.isConstructed){if(n=Dt.prototype.fromBER.call(this,t,r,i),n===-1)return n;for(const c of this.value){const l=c.constructor.NAME;if(l===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==pc)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return n}const s=P.toUint8Array(t);if(!kt(this,s,r,i))return-1;const a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const c=a.subarray(1);try{if(c.byteLength){const l=pr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return Dt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return nt;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Ic.NAME="BitStringValueBlock";var Ec;let Jt=class extends Ne{constructor({idBlock:t={},lenBlock:r={},...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,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},Ic),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Fe.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const n of r)t.push(n.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};Ec=Jt,R.BitString=Ec,Jt.NAME=pc;var Nc;function Ip(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),n=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=n.slice(0),l=c.length-1;let d=0;const y=l<a?a:l;let p=0;for(let I=y;I>=0;I--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=Bo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=Bo(r,s)),s}function Oc(e){if(e>=Jr.length)for(let t=Jr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Jr[t-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=s[0]/10,i[n]=s[0]%10}r[0]>0&&(i=Bo(r,i)),Jr.push(i)}return Jr[e]}function Ep(e,t){let r=0;const i=new Uint8Array(e),n=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=n.slice(0),l=c.length-1;let d,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class _o extends ft($e){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=lc.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(yp(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,n=0){const s=this.fromBER(t,r,i);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):n!==0&&a.length<n&&(n-a.length>1&&(n=a.length+1),this.valueHexView=a.subarray(n-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,i){const n=super.fromBER(t,r,i);return n===-1||this.setValueHex(),n}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),i=0,n;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){n=s[l];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case t:r=Ep(Oc(i),r),a="-";break;default:r=Ip(r,Oc(i))}i++,n>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=uc.charAt(r[l]));return c===!1&&(a+=uc.charAt(0)),a}}Nc=_o,_o.NAME="IntegerValueBlock",Object.defineProperty(Nc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var _c;class pt extends Ne{constructor(t={}){super(t,_o),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Mi(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Mi();const r=BigInt(t),i=new $i,n=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(n));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${L.ToHex(c)}`)+r,y=P.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new pt({valueHex:i.final()})}convertToDER(){const t=new pt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new pt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}_c=pt,R.Integer=_c,pt.NAME="INTEGER";var Tc;class Ui extends pt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Tc=Ui,R.Enumerated=Tc,Ui.NAME="ENUMERATED";class To extends ft($e){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;const s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=fr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Mi();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(r.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const r=Kt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const i=new Uint8Array(r.byteLength);if(!t){const n=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i}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}}}To.NAME="sidBlock";class Vc extends $e{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let n=r;for(;i>0;){const s=new To;if(n=s.fromBER(t,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(t){const r=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(t);if(n.byteLength===0)return this.error=this.value[i].error,nt;r.push(n)}return Io(r)}fromString(t){this.value=[];let r=0,i=0,n="",s=!1;do if(i=t.indexOf(".",r),i===-1?n=t.substring(r):n=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(n,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new To;if(n>Number.MAX_SAFE_INTEGER){Mi();const c=BigInt(n);a.valueBigInt=c}else if(a.valueDec=parseInt(n,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(t=`${t}.`),r?(n=`{${n}}`,this.value[i].isFirstSid?t=`2.{${n} - 80}`:t+=n):t+=n}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Vc.NAME="ObjectIdentifierValueBlock";var jc;class Li extends Ne{constructor(t={}){super(t,Vc),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()}}}jc=Li,R.ObjectIdentifier=jc,Li.NAME="OBJECT IDENTIFIER";class Vo extends ft(zt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;const s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=fr(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 n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const r=Kt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const i=new Uint8Array(r.byteLength);if(!t){const n=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i.buffer}toString(){let t="";return this.isHexOnly?t=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Vo.NAME="relativeSidBlock";class Dc extends $e{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let n=r;for(;i>0;){const s=new Vo;if(n=s.fromBER(t,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(t,r){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(t);if(s.byteLength===0)return this.error=this.value[n].error,nt;i.push(s)}return Io(i)}fromString(t){this.value=[];let r=0,i=0,n="";do{i=t.indexOf(".",r),i===-1?n=t.substring(r):n=t.substring(r,i),r=i+1;const s=new Vo;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(n=`{${n}}`),t+=n}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}}Dc.NAME="RelativeObjectIdentifierValueBlock";var Mc;class jo extends Ne{constructor(t={}){super(t,Dc),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()}}}Mc=jo,R.RelativeObjectIdentifier=Mc,jo.NAME="RelativeObjectIdentifier";var $c;class Ct extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}$c=Ct,R.Sequence=$c,Ct.NAME="SEQUENCE";var Pc;let St=class extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Pc=St,R.Set=Pc,St.NAME="SET";class Rc extends ft($e){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}Rc.NAME="StringValueBlock";class Uc extends Rc{}Uc.NAME="SimpleStringValueBlock";class Je extends No{constructor({...t}={}){super(t,Uc)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,P.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);this.valueBlock.value=t}}Je.NAME="SIMPLE STRING";class Lc extends Je{fromBuffer(t){this.valueBlock.valueHexView=P.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}}Lc.NAME="Utf8StringValueBlock";var Fc;class xt extends Lc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Fc=xt,R.Utf8String=Fc,xt.NAME="UTF8String";class Hc extends Je{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=P.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}Hc.NAME="BmpStringValueBlock";var qc;class Fi extends Hc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}qc=Fi,R.BmpString=qc,Fi.NAME="BMPString";class Kc extends Je{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);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(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let n=0;n<r;n++){const s=Kt(t.charCodeAt(n),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[n*4+l+c]=a[l]}this.valueBlock.value=t}}Kc.NAME="UniversalStringValueBlock";var zc;class Hi extends Kc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}zc=Hi,R.UniversalString=zc,Hi.NAME="UniversalString";var Gc;class qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Gc=qi,R.NumericString=Gc,qi.NAME="NumericString";var Wc;class Ki extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Wc=Ki,R.PrintableString=Wc,Ki.NAME="PrintableString";var Jc;class zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Jc=zi,R.TeletexString=Jc,zi.NAME="TeletexString";var Yc;class Gi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Yc=Gi,R.VideotexString=Yc,Gi.NAME="VideotexString";var Zc;class Wi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Zc=Wi,R.IA5String=Zc,Wi.NAME="IA5String";var Qc;class Ji extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Qc=Ji,R.GraphicString=Qc,Ji.NAME="GraphicString";var Xc;class Qr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Xc=Qr,R.VisibleString=Xc,Qr.NAME="VisibleString";var el;class Yi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}el=Yi,R.GeneralString=el,Yi.NAME="GeneralString";var tl;class Zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}tl=Zi,R.CharacterString=tl,Zi.NAME="CharacterString";var rl;class Xr extends Qr{constructor({value:t,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let n=0;n<t.length;n++)this.valueBlock.valueHexView[n]=t.charCodeAt(n)}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,P.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const 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(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=We(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=We(this.month,2),r[2]=We(this.day,2),r[3]=We(this.hour,2),r[4]=We(this.minute,2),r[5]=We(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}rl=Xr,R.UTCTime=rl,Xr.NAME="UTCTime";var il;class Qi extends Xr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,i="",n="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,I=i.indexOf("+"),w="";if(I===-1&&(I=i.indexOf("-"),p=-1),I!==-1){if(w=i.substring(I+1),i=i.substring(0,I),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(w.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case n.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case n.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(n);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(We(this.year,4)),r.push(We(this.month,2)),r.push(We(this.day,2)),r.push(We(this.hour,2)),r.push(We(this.minute,2)),r.push(We(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(We(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}il=Qi,R.GeneralizedTime=il,Qi.NAME="GeneralizedTime";var nl;class Do extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}nl=Do,R.DATE=nl,Do.NAME="DATE";var ol;class Mo extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}ol=Mo,R.TimeOfDay=ol,Mo.NAME="TimeOfDay";var sl;class $o extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}sl=$o,R.DateTime=sl,$o.NAME="DateTime";var al;class Po extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}al=Po,R.Duration=al,Po.NAME="Duration";var cl;class Ro extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}cl=Ro,R.TIME=cl,Ro.NAME="TIME";class Yt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Uo extends Yt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Xi extends Yt{constructor({value:t=new Yt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class Np{constructor({data:t=Pi}={}){this.dataView=P.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=P.toUint8Array(t)}fromBER(t,r,i){const n=r+i;return this.dataView=P.toUint8Array(t).subarray(r,n),n}toBER(t){return this.dataView.slice().buffer}}function Zt(e,t,r){if(r instanceof Uo){for(let s=0;s<r.value.length;s++)if(Zt(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(Eo)&&(s.name=r.name),s}}if(r instanceof Yt)return r.hasOwnProperty(Eo)&&(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(!(bp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Cp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Sp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(wp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(vp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(kp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(mp 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(!(dc in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(e[r.name]=t)),r instanceof R.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Xi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Xi){if(a=Zt(e,t.valueBlock.value[l],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(Eo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};xp in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[l])}}else if(a=Zt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&dc in t.valueBlock){const s=pr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],a.name=r.name)),a}return Zt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Op(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=pr(P.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Zt(r.result,r.result,t)}const ll=Object.freeze(Object.defineProperty({__proto__:null,Any:Yt,BaseBlock:Ne,BaseStringBlock:No,BitString:Jt,BmpString:Fi,Boolean:Ri,CharacterString:Zi,Choice:Uo,Constructed:Fe,DATE:Do,DateTime:$o,Duration:Po,EndOfContent:Oo,Enumerated:Ui,GeneralString:Yi,GeneralizedTime:Qi,GraphicString:Ji,HexBlock:ft,IA5String:Wi,Integer:pt,Null:Gt,NumericString:qi,ObjectIdentifier:Li,OctetString:Wt,Primitive:Zr,PrintableString:Ki,RawData:Np,RelativeObjectIdentifier:jo,Repeated:Xi,Sequence:Ct,Set:St,TIME:Ro,TeletexString:zi,TimeOfDay:Mo,UTCTime:Xr,UniversalString:Hi,Utf8String:xt,ValueBlock:$e,VideotexString:Gi,ViewWriter:$i,VisibleString:Qr,compareSchema:Zt,fromBER:hr,verifySchema:Op},Symbol.toStringTag,{value:"Module"}));var T;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(T||(T={}));var m;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(m||(m={}));class en{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(P.isBufferSource(t))this.unusedBits=r,this.value=P.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Jt))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 Jt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Jt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const n=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}}class ae{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):P.isBufferSource(t)?this.buffer=P.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Wt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Wt({valueHex:this.buffer})}toSchema(t){return new Wt({name:t})}}const _p={fromASN:e=>e instanceof Gt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Gt;const t=hr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Tp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new pt({value:+e})},Vp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ui({value:e})},he={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new pt({valueHex:e})},jp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Jt({valueHex:e})},Dp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Li({value:e})},Mp={fromASN:e=>e.valueBlock.value,toASN:e=>new Ri({value:e})},tn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Wt({valueHex:e})},$p={fromASN:e=>new ae(e.getValue()),toASN:e=>e.toASN()};function Xe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const ul=Xe(xt),Pp=Xe(Fi),Rp=Xe(Hi),Up=Xe(qi),Lp=Xe(Ki),Fp=Xe(zi),Hp=Xe(Gi),qp=Xe(Wi),Kp=Xe(Ji),zp=Xe(Qr),Gp=Xe(Yi),Wp=Xe(Zi),Jp={fromASN:e=>e.toDate(),toASN:e=>new Xr({valueDate:e})},Yp={fromASN:e=>e.toDate(),toASN:e=>new Qi({valueDate:e})},Zp={fromASN:()=>null,toASN:()=>new Gt};function Lo(e){switch(e){case m.Any:return _p;case m.BitString:return jp;case m.BmpString:return Pp;case m.Boolean:return Mp;case m.CharacterString:return Wp;case m.Enumerated:return Vp;case m.GeneralString:return Gp;case m.GeneralizedTime:return Yp;case m.GraphicString:return Kp;case m.IA5String:return qp;case m.Integer:return Tp;case m.Null:return Zp;case m.NumericString:return Up;case m.ObjectIdentifier:return Dp;case m.OctetString:return tn;case m.PrintableString:return Lp;case m.TeletexString:return Fp;case m.UTCTime:return Jp;case m.UniversalString:return Rp;case m.Utf8String:return ul;case m.VideotexString:return Hp;case m.VisibleString:return zp;default:return null}}function At(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:At(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function dl(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:dl(r)}return!1}function Qp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<e.byteLength;n++)if(r[n]!==i[n])return!1;return!0}class Xp{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const i=this.items.get(t);if(!i)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:T.Sequence,items:{}},i=this.findParentSchema(t);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(t,r){const i=this.items.get(t)||this.createDefault(t),n=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const y=m[a.type],p=ll[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else At(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===T.Choice?l=new Yt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Yt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?St:Ct;l=new y({name:"",value:[new Xi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||At(a.type)){const y=a.repeated?Fe:Zr;n.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,n.push(new Fe({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else n.push(new Fe({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,n.push(l)}switch(i.type){case T.Sequence:return new Ct({value:n,name:""});case T.Set:return new St({value:n,name:""});case T.Choice:return new Uo({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const et=new Xp,V=e=>t=>{let r;et.has(t)?r=et.get(t):(r=et.createDefault(t),et.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;et.has(t.constructor)?i=et.get(t.constructor):(i=et.createDefault(t.constructor),et.set(t.constructor,i));const n=Object.assign({},e);if(typeof n.type=="number"&&!n.converter){const s=Lo(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);n.converter=s}i.items[r]=n};class fl extends Error{constructor(){super(...arguments),this.schemas=[]}}class eh{static parse(t,r){const i=hr(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(At(r))return new r().fromASN(t);const n=et.get(r);et.cache(r);let s=n.schema;if(t.constructor===Fe&&n.type!==T.Choice){s=new Fe({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const l in n.items)delete t[l]}const a=Zt({},t,s);if(!a.verified)throw new fl(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(dl(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const l=n.itemType;if(typeof l=="number"){const d=Lo(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in n.items){const d=a.result[l];if(!d)continue;const y=n.items[l],p=y.type;if(typeof p=="number"||At(p)){const I=(i=y.converter)!==null&&i!==void 0?i:At(p)?new p:null;if(!I)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?Ct:St,h=new w;h.valueBlock=d.valueBlock;const g=hr(h.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const b=g.result.valueBlock.value;c[l]=Array.from(b,k=>I.fromASN(k))}else c[l]=Array.from(d,w=>I.fromASN(w));else{let w=d;if(y.implicit){let h;if(At(p))h=new p().toSchema("");else{const g=m[p],b=ll[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=hr(h.toBER(!1)).result}c[l]=I.fromASN(w)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");c[l]=Array.from(d,I=>this.fromASN(I,p))}else c[l]=this.fromASN(d,p)}return c}catch(n){throw n instanceof fl&&n.schemas.push(r.name),n}}}class Fo{static serialize(t){return t instanceof Ne?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&At(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=et.get(r);et.cache(r);let n=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=Lo(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);n=t.map(c=>a.toASN(c))}else n=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&Qp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Fo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||At(c.type))){const y={};y.valueHex=d instanceof Gt?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Zr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else n.push(new Fe({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else n.push(new Fe({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case T.Sequence:s=new Ct({value:n});break;case T.Set:s=new St({value:n});break;case T.Choice:if(!n[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(t,r,i,n){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${m[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,d=>a.toASN(d)),l=t.repeated==="sequence"?Ct:St;s=new l({value:c})}else s=a.toASN(n)}else if(t.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(n,l=>this.toASN(l)),c=t.repeated==="sequence"?Ct:St;s=new c({value:a})}else s=this.toASN(n);return s}}class le extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class G{static serialize(t){return Fo.serialize(t)}static parse(t,r){return eh.parse(t,r)}static toString(t){const r=P.isBufferSource(t)?P.toArrayBuffer(t):G.serialize(t),i=hr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var n=arguments.length,s=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(n<3?a(s):n>3?a(t,r,s):a(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var pl={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,k=-1,B=(h.match(l.zoneIndex)||[])[0],E,S;for(B&&(B=B.substring(1),h=h.replace(/%.+$/,""));(k=h.indexOf(":",k+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(S=g-b,E=":";S--;)E+="0:";return h=h.replace("::",E),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const C=h.split(":"),A=[];for(let M=0;M<C.length;M++)A.push(parseInt(C[M],16));return A}(),{parts:g,zoneId:B}}function y(h,g,b,k){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let B=0,E;for(;k>0;){if(E=b-k,E<0&&(E=0),h[B]>>E!==g[B]>>E)return!1;k-=b,B+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function I(h,g){for(;h.length<g;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,k;for(b=0;b<g.length;b++)if(k=g[b],!(0<=k&&k<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(g,b){let k;if(b===void 0&&(k=g,g=k[0],b=k[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const k={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let B,E,S;for(B=3;B>=0;B-=1)if(E=this.octets[B],E in k){if(S=k[E],b&&S!==0)return null;S!==8&&(b=!0),g+=S}else return null;return 32-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return w.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),w.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let E=0;for(;E<4;)B.push(parseInt(b[E],10)|parseInt(k[E],10)^255),E++;return new this(B)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.isIPv4=function(h){return this.parser(h)!==null},w.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},w.IPv4.isValidFourPartDecimal=function(h){return!!(w.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},w.IPv4.networkAddressFromCIDR=function(h){let g,b,k,B,E;try{for(g=this.parseCIDR(h),k=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<4;)B.push(parseInt(k[b],10)&parseInt(E[b],10)),b++;return new this(B)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.parse=function(h){const g=this.parser(h);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},w.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(g[2]);if(b>=0&&b<=32){const k=[this.parse(g[1]),b];return Object.defineProperty(k,"toString",{value:function(){return this.join("/")}}),k}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,k;if(g=h.match(i.fourOctet))return function(){const B=g.slice(1,6),E=[];for(let S=0;S<B.length;S++)b=B[S],E.push(p(b));return E}();if(g=h.match(i.longValue)){if(k=p(g[1]),k>4294967295||k<0)throw new Error("ipaddr: address outside defined range");return function(){const B=[];let E;for(E=0;E<=24;E+=8)B.push(k>>E&255);return B}().reverse()}else return(g=h.match(i.twoOctet))?function(){const B=g.slice(1,4),E=[];if(k=p(B[1]),k>16777215||k<0)throw new Error("ipaddr: address outside defined range");return E.push(p(B[0])),E.push(k>>16&255),E.push(k>>8&255),E.push(k&255),E}():(g=h.match(i.threeOctet))?function(){const B=g.slice(1,5),E=[];if(k=p(B[2]),k>65535||k<0)throw new Error("ipaddr: address outside defined range");return E.push(p(B[0])),E.push(p(B[1])),E.push(k>>8&255),E.push(k&255),E}():null},w.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let b=0;const k=Math.floor(h/8);for(;b<k;)g[b]=255,b++;return k<4&&(g[k]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let k,B;if(g.length===16)for(this.parts=[],k=0;k<=14;k+=2)this.parts.push(g[k]<<8|g[k+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(k=0;k<this.parts.length;k++)if(B=this.parts[k],!(0<=B&&B<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(g,b){let k;if(b===void 0&&(k=g,g=k[0],b=k[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const k={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let B,E;for(let S=7;S>=0;S-=1)if(B=this.parts[S],B in k){if(E=k[B],b&&E!==0)return null;E!==16&&(b=!0),g+=E}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],k=this.parts;for(let B=0;B<k.length;B++)g=k[B],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const k=[];for(let B=0;B<this.parts.length;B++)k.push(I(this.parts[B].toString(16),4));return k}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),b=g[0],k=g[1];return new w.IPv4([b>>8,b&255,k>>8,k&255])},h.prototype.toNormalizedString=function(){const g=(function(){const k=[];for(let B=0;B<this.parts.length;B++)k.push(this.parts[B].toString(16));return k}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let k=0,B=-1,E;for(;E=g.exec(b);)E[0].length>B&&(k=E.index,B=E[0].length);return B<0?b:`${b.substring(0,k)}::${b.substring(k+B)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let E=0;for(;E<16;)B.push(parseInt(b[E],10)|parseInt(k[E],10)^255),E++;return new this(B)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},w.IPv6.isIPv6=function(h){return this.parser(h)!==null},w.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const g=this.parser(h);return new this(g.parts,g.zoneId),!0}catch{return!1}},w.IPv6.networkAddressFromCIDR=function(h){let g,b,k,B,E;try{for(g=this.parseCIDR(h),k=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<16;)B.push(parseInt(k[b],10)&parseInt(E[b],10)),b++;return new this(B)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},w.IPv6.parse=function(h){const g=this.parser(h);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},w.IPv6.parseCIDR=function(h){let g,b,k;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return k=[this.parse(b[1]),g],Object.defineProperty(k,"toString",{value:function(){return this.join("/")}}),k;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,k,B,E,S;if(k=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${k[1]}`);if(l.native.test(h))return d(h,8);if((k=h.match(l.transitional))&&(S=k[6]||"",g=d(k[1].slice(0,-1)+S,6),g.parts)){for(E=[parseInt(k[2]),parseInt(k[3]),parseInt(k[4]),parseInt(k[5])],b=0;b<E.length;b++)if(B=E[b],!(0<=B&&B<=255))return null;return g.parts.push(E[0]<<8|E[1]),g.parts.push(E[2]<<8|E[3]),{parts:g.parts,zoneId:g.zoneId}}return null},w.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let b=0;const k=Math.floor(h/8);for(;b<k;)g[b]=255,b++;return k<16&&(g[k]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.fromByteArray=function(h){const g=h.length;if(g===4)return new w.IPv4(h);if(g===16)return new w.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},w.isValid=function(h){return w.IPv6.isValid(h)||w.IPv4.isValid(h)},w.parse=function(h){if(w.IPv6.isValid(h))return w.IPv6.parse(h);if(w.IPv4.isValid(h))return w.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},w.parseCIDR=function(h){try{return w.IPv6.parseCIDR(h)}catch{try{return w.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},w.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},w.subnetMatch=function(h,g,b){let k,B,E,S;b==null&&(b="unicast");for(B in g)if(Object.prototype.hasOwnProperty.call(g,B)){for(E=g[B],E[0]&&!(E[0]instanceof Array)&&(E=[E]),k=0;k<E.length;k++)if(S=E[k],h.kind()===S[0].kind()&&h.match.apply(h,S))return B}return b},e.exports?e.exports=w:t.ipaddr=w})(xo)})(pl);var hl=pl.exports;class yl{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((n,s)=>n+ +s,0);let i=t.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return hl.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=hl.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Ho,qo,Ko;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:m.TeletexString})],Oe.prototype,"teletexString",void 0),u([f({type:m.PrintableString})],Oe.prototype,"printableString",void 0),u([f({type:m.UniversalString})],Oe.prototype,"universalString",void 0),u([f({type:m.Utf8String})],Oe.prototype,"utf8String",void 0),u([f({type:m.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([V({type:T.Choice})],Oe);let yr=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:m.IA5String})],yr.prototype,"ia5String",void 0),u([f({type:m.Any})],yr.prototype,"anyValue",void 0),yr=u([V({type:T.Choice})],yr);class ei{constructor(t={}){this.type="",this.value=new yr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"type",void 0),u([f({type:yr})],ei.prototype,"value",void 0);let gr=Ho=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};gr=Ho=u([V({type:T.Set,itemType:ei})],gr);let zo=qo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};zo=qo=u([V({type:T.Sequence,itemType:gr})],zo);let we=Ko=class extends zo{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};we=Ko=u([V({type:T.Sequence})],we);const th={fromASN:e=>yl.toString(tn.fromASN(e)),toASN:e=>tn.toASN(yl.fromString(e))};class ti{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ti.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ti.prototype,"value",void 0);class Go{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Go.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Go.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ti,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type:m.IA5String,context:1,implicit:!0})],ie.prototype,"rfc822Name",void 0),u([f({type:m.IA5String,context:2,implicit:!0})],ie.prototype,"dNSName",void 0),u([f({type:m.Any,context:3,implicit:!0})],ie.prototype,"x400Address",void 0),u([f({type:we,context:4,implicit:!1})],ie.prototype,"directoryName",void 0),u([f({type:Go,context:5})],ie.prototype,"ediPartyName",void 0),u([f({type:m.IA5String,context:6,implicit:!0})],ie.prototype,"uniformResourceIdentifier",void 0),u([f({type:m.OctetString,context:7,implicit:!0,converter:th})],ie.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([V({type:T.Choice})],ie);const mr="1.3.6.1.5.5.7.3",Qt="2.5.29";var Wo;class rn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],rn.prototype,"accessMethod",void 0),u([f({type:ie})],rn.prototype,"accessLocation",void 0);let gl=Wo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};gl=Wo=u([V({type:T.Sequence,itemType:rn})],gl);const Jo=`${Qt}.35`;class Yo extends ae{}class Xt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Yo,context:0,optional:!0,implicit:!0})],Xt.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Xt.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:he})],Xt.prototype,"authorityCertSerialNumber",void 0);const ml=`${Qt}.19`;class nn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],nn.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],nn.prototype,"pathLenConstraint",void 0);var Zo;let Pe=Zo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};Pe=Zo=u([V({type:T.Sequence,itemType:ie})],Pe);var Qo;let bl=Qo=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};bl=Qo=u([V({type:T.Sequence})],bl);var Xo;const wl=`${Qt}.32`;let Bt=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],Bt.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],Bt.prototype,"visibleString",void 0),u([f({type:m.BmpString})],Bt.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],Bt.prototype,"utf8String",void 0),Bt=u([V({type:T.Choice})],Bt);class es{constructor(t={}){this.organization=new Bt,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:Bt})],es.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],es.prototype,"noticeNumbers",void 0);class ts{constructor(t={}){Object.assign(this,t)}}u([f({type:es,optional:!0})],ts.prototype,"noticeRef",void 0),u([f({type:Bt,optional:!0})],ts.prototype,"explicitText",void 0);let on=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],on.prototype,"cPSuri",void 0),u([f({type:ts})],on.prototype,"userNotice",void 0),on=u([V({type:T.Choice})],on);class rs{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],rs.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],rs.prototype,"qualifier",void 0);class sn{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],sn.prototype,"policyIdentifier",void 0),u([f({type:rs,repeated:"sequence",optional:!0})],sn.prototype,"policyQualifiers",void 0);let an=Xo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};an=Xo=u([V({type:T.Sequence,itemType:sn})],an);let cn=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],cn.prototype,"value",void 0),cn=u([V({type:T.Choice})],cn);let vl=class extends cn{};vl=u([V({type:T.Choice})],vl);var is,ot;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(ot||(ot={}));class kl extends en{toJSON(){const t=[],r=this.toNumber();return r&ot.aACompromise&&t.push("aACompromise"),r&ot.affiliationChanged&&t.push("affiliationChanged"),r&ot.cACompromise&&t.push("cACompromise"),r&ot.certificateHold&&t.push("certificateHold"),r&ot.cessationOfOperation&&t.push("cessationOfOperation"),r&ot.keyCompromise&&t.push("keyCompromise"),r&ot.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&ot.superseded&&t.push("superseded"),r&ot.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],br.prototype,"fullName",void 0),u([f({type:gr,context:1,implicit:!0})],br.prototype,"nameRelativeToCRLIssuer",void 0),br=u([V({type:T.Choice})],br);class ri{constructor(t={}){Object.assign(this,t)}}u([f({type:br,context:0,optional:!0})],ri.prototype,"distributionPoint",void 0),u([f({type:kl,context:1,optional:!0,implicit:!0})],ri.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ri.prototype,"cRLIssuer",void 0);let ns=is=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};ns=is=u([V({type:T.Sequence,itemType:ri})],ns);var os;let Cl=os=class extends ns{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};Cl=os=u([V({type:T.Sequence,itemType:ri})],Cl);class De{constructor(t={}){this.onlyContainsUserCerts=De.ONLY,this.onlyContainsCACerts=De.ONLY,this.indirectCRL=De.ONLY,this.onlyContainsAttributeCerts=De.ONLY,Object.assign(this,t)}}De.ONLY=!1,u([f({type:br,context:0,optional:!0})],De.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsCACerts",void 0),u([f({type:kl,context:3,optional:!0,implicit:!0})],De.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:De.ONLY,implicit:!0})],De.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsAttributeCerts",void 0);var ii;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ii||(ii={}));let ss=class{constructor(t=ii.unspecified){this.reason=ii.unspecified,this.reason=t}toJSON(){return ii[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],ss.prototype,"reason",void 0),ss=u([V({type:T.Choice})],ss);var as;const Sl=`${Qt}.37`;let ln=as=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};ln=as=u([V({type:T.Sequence,itemType:m.ObjectIdentifier})],ln);const rh=`${mr}.1`,ih=`${mr}.2`,nh=`${mr}.3`,oh=`${mr}.4`,sh=`${mr}.8`,ah=`${mr}.9`;let cs=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:he})],cs.prototype,"value",void 0),cs=u([V({type:T.Choice})],cs);let ls=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],ls.prototype,"value",void 0),ls=u([V({type:T.Choice})],ls);var us;let xl=us=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};xl=us=u([V({type:T.Sequence})],xl);const Al=`${Qt}.15`;var st;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(st||(st={}));class ds extends en{toJSON(){const t=this.toNumber(),r=[];return t&st.cRLSign&&r.push("crlSign"),t&st.dataEncipherment&&r.push("dataEncipherment"),t&st.decipherOnly&&r.push("decipherOnly"),t&st.digitalSignature&&r.push("digitalSignature"),t&st.encipherOnly&&r.push("encipherOnly"),t&st.keyAgreement&&r.push("keyAgreement"),t&st.keyCertSign&&r.push("keyCertSign"),t&st.keyEncipherment&&r.push("keyEncipherment"),t&st.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var fs;class un{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],un.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],un.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],un.prototype,"maximum",void 0);let dn=fs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};dn=fs=u([V({type:T.Sequence,itemType:un})],dn);class Bl{constructor(t={}){Object.assign(this,t)}}u([f({type:dn,context:0,optional:!0,implicit:!0})],Bl.prototype,"permittedSubtrees",void 0),u([f({type:dn,context:1,optional:!0,implicit:!0})],Bl.prototype,"excludedSubtrees",void 0);class Il{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:he})],Il.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:he})],Il.prototype,"inhibitPolicyMapping",void 0);var ps;class hs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],hs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],hs.prototype,"subjectDomainPolicy",void 0);let El=ps=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};El=ps=u([V({type:T.Sequence,itemType:hs})],El);var ys;const Nl=`${Qt}.17`;let gs=ys=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};gs=ys=u([V({type:T.Sequence})],gs);let It=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],It.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],It.prototype,"values",void 0);var ms;let Ol=ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};Ol=ms=u([V({type:T.Sequence,itemType:It})],Ol);const _l=`${Qt}.14`;class Mt extends Yo{}class Tl{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],Tl.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],Tl.prototype,"notAfter",void 0);var ni;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ni||(ni={}));class Vl extends en{toJSON(){const t=[],r=this.toNumber();return r&ni.pKIXCertificate&&t.push("pKIXCertificate"),r&ni.newExtensions&&t.push("newExtensions"),r&ni.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class jl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Vl,Object.assign(this,t)}}u([f({type:m.GeneralString})],jl.prototype,"entrustVers",void 0),u([f({type:Vl})],jl.prototype,"entrustInfoFlags",void 0);var bs;let Dl=bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};Dl=bs=u([V({type:T.Sequence,itemType:rn})],Dl);class H{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof H&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&cc(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],H.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],H.prototype,"parameters",void 0);class Et{constructor(t={}){this.algorithm=new H,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Et.prototype,"algorithm",void 0),u([f({type:m.BitString})],Et.prototype,"subjectPublicKey",void 0);let _e=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:m.UTCTime})],_e.prototype,"utcTime",void 0),u([f({type:m.GeneralizedTime})],_e.prototype,"generalTime",void 0),_e=u([V({type:T.Choice})],_e);class fn{constructor(t){this.notBefore=new _e(new Date),this.notAfter=new _e(new Date),t&&(this.notBefore=new _e(t.notBefore),this.notAfter=new _e(t.notAfter))}}u([f({type:_e})],fn.prototype,"notBefore",void 0),u([f({type:_e})],fn.prototype,"notAfter",void 0);var ws;let at=class cp{constructor(t={}){this.extnID="",this.critical=cp.CRITICAL,this.extnValue=new ae,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:ae})],at.prototype,"extnValue",void 0);let er=ws=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};er=ws=u([V({type:T.Sequence,itemType:at})],er);var wr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(wr||(wr={}));class tt{constructor(t={}){this.version=wr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new H,this.issuer=new we,this.validity=new fn,this.subject=new we,this.subjectPublicKeyInfo=new Et,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:wr.v1})],tt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],tt.prototype,"serialNumber",void 0),u([f({type:H})],tt.prototype,"signature",void 0),u([f({type:we})],tt.prototype,"issuer",void 0),u([f({type:fn})],tt.prototype,"validity",void 0),u([f({type:we})],tt.prototype,"subject",void 0),u([f({type:Et})],tt.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],tt.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],tt.prototype,"subjectUniqueID",void 0),u([f({type:er,context:3,optional:!0})],tt.prototype,"extensions",void 0);class vr{constructor(t={}){this.tbsCertificate=new tt,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:tt})],vr.prototype,"tbsCertificate",void 0),u([f({type:H})],vr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vr.prototype,"signatureValue",void 0);class pn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],pn.prototype,"userCertificate",void 0),u([f({type:_e})],pn.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],pn.prototype,"crlEntryExtensions",void 0);class Nt{constructor(t={}){this.signature=new H,this.issuer=new we,this.thisUpdate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],Nt.prototype,"version",void 0),u([f({type:H})],Nt.prototype,"signature",void 0),u([f({type:we})],Nt.prototype,"issuer",void 0),u([f({type:_e})],Nt.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Nt.prototype,"nextUpdate",void 0),u([f({type:pn,repeated:"sequence",optional:!0})],Nt.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],Nt.prototype,"crlExtensions",void 0);let vs=class{constructor(t={}){this.tbsCertList=new Nt,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Nt})],vs.prototype,"tbsCertList",void 0),u([f({type:H})],vs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vs.prototype,"signature",void 0);class kr{constructor(t={}){this.issuer=new we,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:we})],kr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],kr.prototype,"serialNumber",void 0);let Cr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Cr.prototype,"subjectKeyIdentifier",void 0),u([f({type:kr})],Cr.prototype,"issuerAndSerialNumber",void 0),Cr=u([V({type:T.Choice})],Cr);var Ot;(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"})(Ot||(Ot={}));let oi=class extends H{};oi=u([V({type:T.Sequence})],oi);let hn=class extends H{};hn=u([V({type:T.Sequence})],hn);let ht=class extends H{};ht=u([V({type:T.Sequence})],ht);let yn=class extends H{};yn=u([V({type:T.Sequence})],yn);let Ml=class extends H{};Ml=u([V({type:T.Sequence})],Ml);let ks=class extends H{};ks=u([V({type:T.Sequence})],ks);let Sr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Sr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],Sr.prototype,"attrValues",void 0);var Cs;class yt{constructor(t={}){this.version=Ot.v0,this.sid=new Cr,this.digestAlgorithm=new oi,this.signatureAlgorithm=new hn,this.signature=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],yt.prototype,"version",void 0),u([f({type:Cr})],yt.prototype,"sid",void 0),u([f({type:oi})],yt.prototype,"digestAlgorithm",void 0),u([f({type:Sr,repeated:"set",context:0,implicit:!0,optional:!0})],yt.prototype,"signedAttrs",void 0),u([f({type:hn})],yt.prototype,"signatureAlgorithm",void 0),u([f({type:ae})],yt.prototype,"signature",void 0),u([f({type:Sr,repeated:"set",context:1,implicit:!0,optional:!0})],yt.prototype,"unsignedAttrs",void 0);let gn=Cs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Cs.prototype)}};gn=Cs=u([V({type:T.Set,itemType:yt})],gn);let $l=class extends _e{};$l=u([V({type:T.Choice})],$l);let Pl=class extends yt{};Pl=u([V({type:T.Sequence})],Pl);class Ss{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],Ss.prototype,"acIssuer",void 0),u([f({type:m.Integer})],Ss.prototype,"acSerial",void 0),u([f({type:It,repeated:"sequence"})],Ss.prototype,"attrs",void 0);var xs;let mn=xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};mn=xs=u([V({type:T.Sequence,itemType:m.ObjectIdentifier})],mn);class bn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],bn.prototype,"pathLenConstraint",void 0),u([f({type:mn,implicit:!0,context:0,optional:!0})],bn.prototype,"permittedAttrs",void 0),u([f({type:mn,implicit:!0,context:1,optional:!0})],bn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],bn.prototype,"permitUnSpecified",void 0);class tr{constructor(t={}){this.issuer=new Pe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pe})],tr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],tr.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],tr.prototype,"issuerUID",void 0);var As;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(As||(As={}));class rr{constructor(t={}){this.digestedObjectType=As.publicKey,this.digestAlgorithm=new H,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],rr.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],rr.prototype,"otherObjectTypeID",void 0),u([f({type:H})],rr.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],rr.prototype,"objectDigest",void 0);class wn{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,optional:!0})],wn.prototype,"issuerName",void 0),u([f({type:tr,context:0,implicit:!0,optional:!0})],wn.prototype,"baseCertificateID",void 0),u([f({type:rr,context:1,implicit:!0,optional:!0})],wn.prototype,"objectDigestInfo",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],xr.prototype,"v1Form",void 0),u([f({type:wn,context:0,implicit:!0})],xr.prototype,"v2Form",void 0),xr=u([V({type:T.Choice})],xr);class vn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],vn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],vn.prototype,"notAfterTime",void 0);class si{constructor(t={}){Object.assign(this,t)}}u([f({type:tr,implicit:!0,context:0,optional:!0})],si.prototype,"baseCertificateID",void 0),u([f({type:Pe,implicit:!0,context:1,optional:!0})],si.prototype,"entityName",void 0),u([f({type:rr,implicit:!0,context:2,optional:!0})],si.prototype,"objectDigestInfo",void 0);var Bs;(function(e){e[e.v2=1]="v2"})(Bs||(Bs={}));class ct{constructor(t={}){this.version=Bs.v2,this.holder=new si,this.issuer=new xr,this.signature=new H,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new vn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],ct.prototype,"version",void 0),u([f({type:si})],ct.prototype,"holder",void 0),u([f({type:xr})],ct.prototype,"issuer",void 0),u([f({type:H})],ct.prototype,"signature",void 0),u([f({type:m.Integer,converter:he})],ct.prototype,"serialNumber",void 0),u([f({type:vn})],ct.prototype,"attrCertValidityPeriod",void 0),u([f({type:It,repeated:"sequence"})],ct.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],ct.prototype,"issuerUniqueID",void 0),u([f({type:er,optional:!0})],ct.prototype,"extensions",void 0);class kn{constructor(t={}){this.acinfo=new ct,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ct})],kn.prototype,"acinfo",void 0),u([f({type:H})],kn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],kn.prototype,"signatureValue",void 0);var Cn;(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"})(Cn||(Cn={}));class Is extends en{}class Es{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Es.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Es.prototype,"value",void 0);class Ns{constructor(t={}){this.policyId="",this.classList=new Is(Cn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ns.prototype,"policyId",void 0),u([f({type:Is,defaultValue:new Is(Cn.unclassified)})],Ns.prototype,"classList",void 0),u([f({type:Es,repeated:"set"})],Ns.prototype,"securityCategories",void 0);class Sn{constructor(t={}){Object.assign(this,t)}}u([f({type:ae})],Sn.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],Sn.prototype,"oid",void 0),u([f({type:m.Utf8String})],Sn.prototype,"string",void 0);class Rl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Rl.prototype,"policyAuthority",void 0),u([f({type:Sn,repeated:"sequence"})],Rl.prototype,"values",void 0);var Os;class xn{constructor(t={}){this.targetCertificate=new tr,Object.assign(this,t)}}u([f({type:tr})],xn.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],xn.prototype,"targetName",void 0),u([f({type:rr,optional:!0})],xn.prototype,"certDigestInfo",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],Ar.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],Ar.prototype,"targetGroup",void 0),u([f({type:xn,context:2,implicit:!0})],Ar.prototype,"targetCert",void 0),Ar=u([V({type:T.Choice})],Ar);let _s=Os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Os.prototype)}};_s=Os=u([V({type:T.Sequence,itemType:Ar})],_s);var Ts;let Ul=Ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Ul=Ts=u([V({type:T.Sequence,itemType:_s})],Ul);class Ll{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Ll.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Ll.prototype,"roleName",void 0);class Vs{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],Vs.prototype,"service",void 0),u([f({type:ie})],Vs.prototype,"ident",void 0),u([f({type:ae,optional:!0})],Vs.prototype,"authInfo",void 0);var js;class Ds{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ds.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Ds.prototype,"otherCert",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:vr})],Br.prototype,"certificate",void 0),u([f({type:kn,context:2,implicit:!0})],Br.prototype,"v2AttrCert",void 0),u([f({type:Ds,context:3,implicit:!0})],Br.prototype,"other",void 0),Br=u([V({type:T.Choice})],Br);let An=js=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};An=js=u([V({type:T.Set,itemType:Br})],An);class Ir{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ir.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Ir.prototype,"content",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae})],ai.prototype,"single",void 0),u([f({type:m.Any})],ai.prototype,"any",void 0),ai=u([V({type:T.Choice})],ai);class Bn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Bn.prototype,"eContentType",void 0),u([f({type:ai,context:0,optional:!0})],Bn.prototype,"eContent",void 0);let ci=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae,context:0,implicit:!0,optional:!0})],ci.prototype,"value",void 0),u([f({type:ae,converter:$p,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ci.prototype,"constructedValue",void 0),ci=u([V({type:T.Choice})],ci);class li{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new yn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],li.prototype,"contentType",void 0),u([f({type:yn})],li.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ci,optional:!0})],li.prototype,"encryptedContent",void 0);class In{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],In.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],In.prototype,"keyAttr",void 0);var Ms;class En{constructor(t={}){this.subjectKeyIdentifier=new Mt,Object.assign(this,t)}}u([f({type:Mt})],En.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],En.prototype,"date",void 0),u([f({type:In,optional:!0})],En.prototype,"other",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:En,context:0,implicit:!0,optional:!0})],Er.prototype,"rKeyId",void 0),u([f({type:kr,optional:!0})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([V({type:T.Choice})],Er);class $s{constructor(t={}){this.rid=new Er,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Er})],$s.prototype,"rid",void 0),u([f({type:ae})],$s.prototype,"encryptedKey",void 0);let Nn=Ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ms.prototype)}};Nn=Ms=u([V({type:T.Sequence,itemType:$s})],Nn);class Ps{constructor(t={}){this.algorithm=new H,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Ps.prototype,"algorithm",void 0),u([f({type:m.BitString})],Ps.prototype,"publicKey",void 0);let ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0,optional:!0})],ir.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ps,context:1,implicit:!0,optional:!0})],ir.prototype,"originatorKey",void 0),u([f({type:kr,optional:!0})],ir.prototype,"issuerAndSerialNumber",void 0),ir=u([V({type:T.Choice})],ir);class Nr{constructor(t={}){this.version=Ot.v3,this.originator=new ir,this.keyEncryptionAlgorithm=new ht,this.recipientEncryptedKeys=new Nn,Object.assign(this,t)}}u([f({type:m.Integer})],Nr.prototype,"version",void 0),u([f({type:ir,context:0})],Nr.prototype,"originator",void 0),u([f({type:ae,context:1,optional:!0})],Nr.prototype,"ukm",void 0),u([f({type:ht})],Nr.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:Nn})],Nr.prototype,"recipientEncryptedKeys",void 0);let Or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Or.prototype,"subjectKeyIdentifier",void 0),u([f({type:kr})],Or.prototype,"issuerAndSerialNumber",void 0),Or=u([V({type:T.Choice})],Or);class ui{constructor(t={}){this.version=Ot.v0,this.rid=new Or,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],ui.prototype,"version",void 0),u([f({type:Or})],ui.prototype,"rid",void 0),u([f({type:ht})],ui.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],ui.prototype,"encryptedKey",void 0);class di{constructor(t={}){this.keyIdentifier=new ae,Object.assign(this,t)}}u([f({type:ae})],di.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],di.prototype,"date",void 0),u([f({type:In,optional:!0})],di.prototype,"other",void 0);class fi{constructor(t={}){this.version=Ot.v4,this.kekid=new di,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:di})],fi.prototype,"kekid",void 0),u([f({type:ht})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.version=Ot.v0,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],pi.prototype,"version",void 0),u([f({type:ks,context:0,optional:!0})],pi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:ht})],pi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],pi.prototype,"encryptedKey",void 0);class Rs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Rs.prototype,"oriType",void 0),u([f({type:m.Any})],Rs.prototype,"oriValue",void 0);let $t=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ui,optional:!0})],$t.prototype,"ktri",void 0),u([f({type:Nr,context:1,implicit:!0,optional:!0})],$t.prototype,"kari",void 0),u([f({type:fi,context:2,implicit:!0,optional:!0})],$t.prototype,"kekri",void 0),u([f({type:pi,context:3,implicit:!0,optional:!0})],$t.prototype,"pwri",void 0),u([f({type:Rs,context:4,implicit:!0,optional:!0})],$t.prototype,"ori",void 0),$t=u([V({type:T.Choice})],$t);var Us;let On=Us=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Us.prototype)}};On=Us=u([V({type:T.Set,itemType:$t})],On);var Ls;class _n{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],_n.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],_n.prototype,"otherRevInfo",void 0);let hi=class{constructor(t={}){this.other=new _n,Object.assign(this,t)}};u([f({type:_n,context:1,implicit:!0})],hi.prototype,"other",void 0),hi=u([V({type:T.Choice})],hi);let Fs=Ls=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ls.prototype)}};Fs=Ls=u([V({type:T.Set,itemType:hi})],Fs);class Hs{constructor(t={}){Object.assign(this,t)}}u([f({type:An,context:0,implicit:!0,optional:!0})],Hs.prototype,"certs",void 0),u([f({type:Fs,context:1,implicit:!0,optional:!0})],Hs.prototype,"crls",void 0);var qs;let Ks=qs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([V({type:T.Set,itemType:Sr})],Ks);class yi{constructor(t={}){this.version=Ot.v0,this.recipientInfos=new On,this.encryptedContentInfo=new li,Object.assign(this,t)}}u([f({type:m.Integer})],yi.prototype,"version",void 0),u([f({type:Hs,context:0,implicit:!0,optional:!0})],yi.prototype,"originatorInfo",void 0),u([f({type:On})],yi.prototype,"recipientInfos",void 0),u([f({type:li})],yi.prototype,"encryptedContentInfo",void 0),u([f({type:Ks,context:1,implicit:!0,optional:!0})],yi.prototype,"unprotectedAttrs",void 0);const ch="1.2.840.113549.1.7.2";var zs;let Tn=zs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Tn=zs=u([V({type:T.Set,itemType:oi})],Tn);class _r{constructor(t={}){this.version=Ot.v0,this.digestAlgorithms=new Tn,this.encapContentInfo=new Bn,this.signerInfos=new gn,Object.assign(this,t)}}u([f({type:m.Integer})],_r.prototype,"version",void 0),u([f({type:Tn})],_r.prototype,"digestAlgorithms",void 0),u([f({type:Bn})],_r.prototype,"encapContentInfo",void 0),u([f({type:An,context:0,implicit:!0,optional:!0})],_r.prototype,"certificates",void 0),u([f({type:hi,context:1,implicit:!0,optional:!0})],_r.prototype,"crls",void 0),u([f({type:gn})],_r.prototype,"signerInfos",void 0);const gi="1.2.840.10045.2.1",Gs="1.2.840.10045.4.1",Fl="1.2.840.10045.4.3.1",Ws="1.2.840.10045.4.3.2",Js="1.2.840.10045.4.3.3",Ys="1.2.840.10045.4.3.4",Hl="1.2.840.10045.3.1.7",ql="1.3.132.0.34",Kl="1.3.132.0.35";function mi(e){return new H({algorithm:e})}const lh=mi(Gs);mi(Fl);const uh=mi(Ws),dh=mi(Js),fh=mi(Ys);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Tr.prototype,"namedCurve",void 0),Tr=u([V({type:T.Choice})],Tr);class Vn{constructor(t={}){this.version=1,this.privateKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],Vn.prototype,"version",void 0),u([f({type:ae})],Vn.prototype,"privateKey",void 0),u([f({type:Tr,context:0,optional:!0})],Vn.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],Vn.prototype,"publicKey",void 0);class jn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],jn.prototype,"r",void 0),u([f({type:m.Integer,converter:he})],jn.prototype,"s",void 0);const He="1.2.840.113549.1.1",Vr=`${He}.1`,ph=`${He}.7`,hh=`${He}.9`,yh=`${He}.10`,gh=`${He}.2`,mh=`${He}.4`,Dn=`${He}.5`,bh=`${He}.14`,Zs=`${He}.11`,Mn=`${He}.12`,$n=`${He}.13`,zl=`${He}.15`,Gl=`${He}.16`,Wl="1.3.14.3.2.26",Jl="2.16.840.1.101.3.4.2.4",Yl="2.16.840.1.101.3.4.2.1",Zl="2.16.840.1.101.3.4.2.2",Ql="2.16.840.1.101.3.4.2.3",wh="2.16.840.1.101.3.4.2.5",vh="2.16.840.1.101.3.4.2.6",kh="1.2.840.113549.2.2",Ch="1.2.840.113549.2.5",Qs=`${He}.8`;function ve(e){return new H({algorithm:e,parameters:null})}ve(kh),ve(Ch);const nr=ve(Wl);ve(Jl),ve(Yl),ve(Zl),ve(Ql),ve(wh),ve(vh);const Xl=new H({algorithm:Qs,parameters:G.serialize(nr)}),eu=new H({algorithm:hh,parameters:G.serialize(tn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ve(Vr),ve(gh),ve(mh),ve(Dn),ve(zl),ve(Gl),ve(Mn),ve($n),ve(zl),ve(Gl);class Pn{constructor(t={}){this.hashAlgorithm=new H(nr),this.maskGenAlgorithm=new H({algorithm:Qs,parameters:G.serialize(nr)}),this.pSourceAlgorithm=new H(eu),Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:nr})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Xl})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:eu})],Pn.prototype,"pSourceAlgorithm",void 0),new H({algorithm:ph,parameters:G.serialize(new Pn)});class bi{constructor(t={}){this.hashAlgorithm=new H(nr),this.maskGenAlgorithm=new H({algorithm:Qs,parameters:G.serialize(nr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:nr})],bi.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Xl})],bi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],bi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],bi.prototype,"trailerField",void 0),new H({algorithm:yh,parameters:G.serialize(new bi)});class Rn{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],Rn.prototype,"digestAlgorithm",void 0),u([f({type:ae})],Rn.prototype,"digest",void 0);var Xs;class Un{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Un.prototype,"prime",void 0),u([f({type:m.Integer,converter:he})],Un.prototype,"exponent",void 0),u([f({type:m.Integer,converter:he})],Un.prototype,"coefficient",void 0);let ea=Xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};ea=Xs=u([V({type:T.Sequence,itemType:Un})],ea);class gt{constructor(t={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer})],gt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"coefficient",void 0),u([f({type:ea,optional:!0})],gt.prototype,"otherPrimeInfos",void 0);class ta{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],ta.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],ta.prototype,"publicExponent",void 0);var ra;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(ra||(ra={}));const qe=ra;/*! *****************************************************************************
|
|
75
|
+
`)}`:`${r} :`}}wl=Fe,R.Constructed=wl,Fe.NAME="CONSTRUCTED";class vl extends Me{fromBER(t,r,i){return r}toBER(t){return nt}}vl.override="EndOfContentValueBlock";var kl;class Oo extends Ne{constructor(t={}){super(t,vl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}kl=Oo,R.EndOfContent=kl,Oo.NAME=Yr;var Cl;class Gt extends Ne{constructor(t={}){super(t,Me),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const n=new Uint8Array(i);n[0]=5,n[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}Cl=Gt,R.Null=Cl,Gt.NAME="NULL";class Sl extends ft(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=P.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,i){const n=P.toUint8Array(t);return kt(this,n,r,i)?(this.valueHexView=n.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,cl.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Sl.NAME="BooleanValueBlock";var xl;let Ri=class extends Ne{constructor(t={}){super(t,Sl),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}`}};xl=Ri,R.Boolean=xl,Ri.NAME="BOOLEAN";class Al extends ft(Dt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=Dt.prototype.fromBER.call(this,t,r,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==fl)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(t,r,i),this.blockLength=i;return n}toBER(t,r){return this.isConstructed?Dt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Al.NAME="OctetStringValueBlock";var Bl;let Wt=class ap extends Ne{constructor({idBlock:t={},lenBlock:r={},...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,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},Al),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=pr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Fe.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 ap&&t.push(r.valueBlock.valueHexView);return P.concat(t)}};Bl=Wt,R.OctetString=Bl,Wt.NAME=fl;class Il extends ft(Dt){constructor({unusedBits:t=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,i){if(!i)return r;let n=-1;if(this.isConstructed){if(n=Dt.prototype.fromBER.call(this,t,r,i),n===-1)return n;for(const l of this.value){const c=l.constructor.NAME;if(c===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==pl)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 n}const s=P.toUint8Array(t);if(!kt(this,s,r,i))return-1;const a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const l=a.subarray(1);try{if(l.byteLength){const c=pr(l,0,l.byteLength);c.offset!==-1&&c.offset===i-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return Dt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return nt;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Il.NAME="BitStringValueBlock";var El;let Jt=class extends Ne{constructor({idBlock:t={},lenBlock:r={},...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,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},Il),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Fe.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const n of r)t.push(n.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};El=Jt,R.BitString=El,Jt.NAME=pl;var Nl;function Ip(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),n=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,l=n.slice(0),c=l.length-1;let d=0;const y=c<a?a:c;let p=0;for(let I=y;I>=0;I--,p++){switch(!0){case p<l.length:d=s[a-p]+l[c-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=Bo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=Bo(r,s)),s}function Ol(e){if(e>=Jr.length)for(let t=Jr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Jr[t-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=s[0]/10,i[n]=s[0]%10}r[0]>0&&(i=Bo(r,i)),Jr.push(i)}return Jr[e]}function Ep(e,t){let r=0;const i=new Uint8Array(e),n=new Uint8Array(t),s=i.slice(0),a=s.length-1,l=n.slice(0),c=l.length-1;let d,y=0;for(let p=c;p>=0;p--,y++)switch(d=s[a-y]-l[c-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-c+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class _o extends ft(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=cl.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(yp(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,n=0){const s=this.fromBER(t,r,i);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):n!==0&&a.length<n&&(n-a.length>1&&(n=a.length+1),this.valueHexView=a.subarray(n-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,i){const n=super.fromBER(t,r,i);return n===-1||this.setValueHex(),n}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),i=0,n;const s=this.valueHexView;let a="",l=!1;for(let c=s.byteLength-1;c>=0;c--){n=s[c];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case t:r=Ep(Ol(i),r),a="-";break;default:r=Ip(r,Ol(i))}i++,n>>=1}}for(let c=0;c<r.length;c++)r[c]&&(l=!0),l&&(a+=ul.charAt(r[c]));return l===!1&&(a+=ul.charAt(0)),a}}Nl=_o,_o.NAME="IntegerValueBlock",Object.defineProperty(Nl.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var _l;class pt extends Ne{constructor(t={}){super(t,_o),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return $i(),BigInt(this.valueBlock.toString())}static fromBigInt(t){$i();const r=BigInt(t),i=new Mi,n=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(n));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=P.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new pt({valueHex:i.final()})}convertToDER(){const t=new pt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new pt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}_l=pt,R.Integer=_l,pt.NAME="INTEGER";var Tl;class Ui extends pt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Tl=Ui,R.Enumerated=Tl,Ui.NAME="ENUMERATED";class To extends ft(Me){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;const s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let l=0;l<i&&(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=fr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){$i();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(r.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const r=Kt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const i=new Uint8Array(r.byteLength);if(!t){const n=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i}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}}}To.NAME="sidBlock";class Vl extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let n=r;for(;i>0;){const s=new To;if(n=s.fromBER(t,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(t){const r=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(t);if(n.byteLength===0)return this.error=this.value[i].error,nt;r.push(n)}return Io(r)}fromString(t){this.value=[];let r=0,i=0,n="",s=!1;do if(i=t.indexOf(".",r),i===-1?n=t.substring(r):n=t.substring(r,i),r=i+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(n,10);if(isNaN(c))return;a.valueDec=c+l,s=!1}else{const a=new To;if(n>Number.MAX_SAFE_INTEGER){$i();const l=BigInt(n);a.valueBigInt=l}else if(a.valueDec=parseInt(n,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(t=`${t}.`),r?(n=`{${n}}`,this.value[i].isFirstSid?t=`2.{${n} - 80}`:t+=n):t+=n}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}}Vl.NAME="ObjectIdentifierValueBlock";var jl;class Li extends Ne{constructor(t={}){super(t,Vl),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()}}}jl=Li,R.ObjectIdentifier=jl,Li.NAME="OBJECT IDENTIFIER";class Vo extends ft(zt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const n=P.toUint8Array(t);if(!kt(this,n,r,i))return-1;const s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let l=0;l<i&&(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=fr(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 n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const r=Kt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const i=new Uint8Array(r.byteLength);if(!t){const n=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i.buffer}toString(){let t="";return this.isHexOnly?t=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Vo.NAME="relativeSidBlock";class Dl extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let n=r;for(;i>0;){const s=new Vo;if(n=s.fromBER(t,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(t,r){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(t);if(s.byteLength===0)return this.error=this.value[n].error,nt;i.push(s)}return Io(i)}fromString(t){this.value=[];let r=0,i=0,n="";do{i=t.indexOf(".",r),i===-1?n=t.substring(r):n=t.substring(r,i),r=i+1;const s=new Vo;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(n=`{${n}}`),t+=n}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}}Dl.NAME="RelativeObjectIdentifierValueBlock";var $l;class jo extends Ne{constructor(t={}){super(t,Dl),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()}}}$l=jo,R.RelativeObjectIdentifier=$l,jo.NAME="RelativeObjectIdentifier";var Ml;class Ct extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ml=Ct,R.Sequence=Ml,Ct.NAME="SEQUENCE";var Pl;let St=class extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Pl=St,R.Set=Pl,St.NAME="SET";class Rl extends ft(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}Rl.NAME="StringValueBlock";class Ul extends Rl{}Ul.NAME="SimpleStringValueBlock";class Je extends No{constructor({...t}={}){super(t,Ul)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,P.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);this.valueBlock.value=t}}Je.NAME="SIMPLE STRING";class Ll extends Je{fromBuffer(t){this.valueBlock.valueHexView=P.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}}Ll.NAME="Utf8StringValueBlock";var Fl;class xt extends Ll{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Fl=xt,R.Utf8String=Fl,xt.NAME="UTF8String";class Hl extends Je{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=P.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}Hl.NAME="BmpStringValueBlock";var ql;class Fi extends Hl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}ql=Fi,R.BmpString=ql,Fi.NAME="BMPString";class Kl extends Je{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);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(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let n=0;n<r;n++){const s=Kt(t.charCodeAt(n),8),a=new Uint8Array(s);if(a.length>4)continue;const l=4-a.length;for(let c=a.length-1;c>=0;c--)i[n*4+c+l]=a[c]}this.valueBlock.value=t}}Kl.NAME="UniversalStringValueBlock";var zl;class Hi extends Kl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}zl=Hi,R.UniversalString=zl,Hi.NAME="UniversalString";var Gl;class qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Gl=qi,R.NumericString=Gl,qi.NAME="NumericString";var Wl;class Ki extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Wl=Ki,R.PrintableString=Wl,Ki.NAME="PrintableString";var Jl;class zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Jl=zi,R.TeletexString=Jl,zi.NAME="TeletexString";var Yl;class Gi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Yl=Gi,R.VideotexString=Yl,Gi.NAME="VideotexString";var Zl;class Wi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Zl=Wi,R.IA5String=Zl,Wi.NAME="IA5String";var Ql;class Ji extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Ql=Ji,R.GraphicString=Ql,Ji.NAME="GraphicString";var Xl;class Qr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Xl=Qr,R.VisibleString=Xl,Qr.NAME="VisibleString";var ec;class Yi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}ec=Yi,R.GeneralString=ec,Yi.NAME="GeneralString";var tc;class Zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}tc=Zi,R.CharacterString=tc,Zi.NAME="CharacterString";var rc;class Xr extends Qr{constructor({value:t,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let n=0;n<t.length;n++)this.valueBlock.valueHexView[n]=t.charCodeAt(n)}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,P.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const 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(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=We(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=We(this.month,2),r[2]=We(this.day,2),r[3]=We(this.hour,2),r[4]=We(this.minute,2),r[5]=We(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}rc=Xr,R.UTCTime=rc,Xr.NAME="UTCTime";var ic;class Qi extends Xr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,i="",n="",s=0,a,l=0,c=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,I=i.indexOf("+"),w="";if(I===-1&&(I=i.indexOf("-"),p=-1),I!==-1){if(w=i.substring(I+1),i=i.substring(0,I),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(w.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(l=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");c=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case n.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case n.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(n);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+l;break;case 5:this.minute=parseInt(y[p],10)+c;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(We(this.year,4)),r.push(We(this.month,2)),r.push(We(this.day,2)),r.push(We(this.hour,2)),r.push(We(this.minute,2)),r.push(We(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(We(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}ic=Qi,R.GeneralizedTime=ic,Qi.NAME="GeneralizedTime";var nc;class Do extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}nc=Do,R.DATE=nc,Do.NAME="DATE";var oc;class $o extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}oc=$o,R.TimeOfDay=oc,$o.NAME="TimeOfDay";var sc;class Mo extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}sc=Mo,R.DateTime=sc,Mo.NAME="DateTime";var ac;class Po extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}ac=Po,R.Duration=ac,Po.NAME="Duration";var lc;class Ro extends xt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}lc=Ro,R.TIME=lc,Ro.NAME="TIME";class Yt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Uo extends Yt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Xi extends Yt{constructor({value:t=new Yt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class Np{constructor({data:t=Pi}={}){this.dataView=P.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=P.toUint8Array(t)}fromBER(t,r,i){const n=r+i;return this.dataView=P.toUint8Array(t).subarray(r,n),n}toBER(t){return this.dataView.slice().buffer}}function Zt(e,t,r){if(r instanceof Uo){for(let s=0;s<r.value.length;s++)if(Zt(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(Eo)&&(s.name=r.name),s}}if(r instanceof Yt)return r.hasOwnProperty(Eo)&&(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(!(bp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Cp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Sp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(wp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(vp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(kp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(mp 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(!(dl in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let l=0;l<s.length;l++)if(s[l]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(e[r.name]=t)),r instanceof R.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},l=r.valueBlock.value.length;if(l>0&&r.valueBlock.value[0]instanceof Xi&&(l=t.valueBlock.value.length),l===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let c=0;c<l;c++)if(c-s>=t.valueBlock.value.length){if(r.valueBlock.value[c].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Xi){if(a=Zt(e,t.valueBlock.value[c],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(Eo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};xp 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=Zt(e,t.valueBlock.value[c-s],r.valueBlock.value[c]),a.verified===!1)if(r.valueBlock.value[c].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(a.verified===!1){const c={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],c.name=r.name)),c}return{verified:!0,result:e}}if(r.primitiveSchema&&dl in t.valueBlock){const s=pr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],a.name=r.name)),a}return Zt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Op(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=pr(P.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Zt(r.result,r.result,t)}const cc=Object.freeze(Object.defineProperty({__proto__:null,Any:Yt,BaseBlock:Ne,BaseStringBlock:No,BitString:Jt,BmpString:Fi,Boolean:Ri,CharacterString:Zi,Choice:Uo,Constructed:Fe,DATE:Do,DateTime:Mo,Duration:Po,EndOfContent:Oo,Enumerated:Ui,GeneralString:Yi,GeneralizedTime:Qi,GraphicString:Ji,HexBlock:ft,IA5String:Wi,Integer:pt,Null:Gt,NumericString:qi,ObjectIdentifier:Li,OctetString:Wt,Primitive:Zr,PrintableString:Ki,RawData:Np,RelativeObjectIdentifier:jo,Repeated:Xi,Sequence:Ct,Set:St,TIME:Ro,TeletexString:zi,TimeOfDay:$o,UTCTime:Xr,UniversalString:Hi,Utf8String:xt,ValueBlock:Me,VideotexString:Gi,ViewWriter:Mi,VisibleString:Qr,compareSchema:Zt,fromBER:hr,verifySchema:Op},Symbol.toStringTag,{value:"Module"}));var T;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(T||(T={}));var m;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(m||(m={}));class en{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(P.isBufferSource(t))this.unusedBits=r,this.value=P.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Jt))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 Jt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Jt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const n=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}}class ae{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):P.isBufferSource(t)?this.buffer=P.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Wt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Wt({valueHex:this.buffer})}toSchema(t){return new Wt({name:t})}}const _p={fromASN:e=>e instanceof Gt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Gt;const t=hr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Tp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new pt({value:+e})},Vp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ui({value:e})},he={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new pt({valueHex:e})},jp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Jt({valueHex:e})},Dp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Li({value:e})},$p={fromASN:e=>e.valueBlock.value,toASN:e=>new Ri({value:e})},tn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Wt({valueHex:e})},Mp={fromASN:e=>new ae(e.getValue()),toASN:e=>e.toASN()};function Xe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const uc=Xe(xt),Pp=Xe(Fi),Rp=Xe(Hi),Up=Xe(qi),Lp=Xe(Ki),Fp=Xe(zi),Hp=Xe(Gi),qp=Xe(Wi),Kp=Xe(Ji),zp=Xe(Qr),Gp=Xe(Yi),Wp=Xe(Zi),Jp={fromASN:e=>e.toDate(),toASN:e=>new Xr({valueDate:e})},Yp={fromASN:e=>e.toDate(),toASN:e=>new Qi({valueDate:e})},Zp={fromASN:()=>null,toASN:()=>new Gt};function Lo(e){switch(e){case m.Any:return _p;case m.BitString:return jp;case m.BmpString:return Pp;case m.Boolean:return $p;case m.CharacterString:return Wp;case m.Enumerated:return Vp;case m.GeneralString:return Gp;case m.GeneralizedTime:return Yp;case m.GraphicString:return Kp;case m.IA5String:return qp;case m.Integer:return Tp;case m.Null:return Zp;case m.NumericString:return Up;case m.ObjectIdentifier:return Dp;case m.OctetString:return tn;case m.PrintableString:return Lp;case m.TeletexString:return Fp;case m.UTCTime:return Jp;case m.UniversalString:return Rp;case m.Utf8String:return uc;case m.VideotexString:return Hp;case m.VisibleString:return zp;default:return null}}function At(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:At(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function dc(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:dc(r)}return!1}function Qp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<e.byteLength;n++)if(r[n]!==i[n])return!1;return!0}class Xp{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const i=this.items.get(t);if(!i)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:T.Sequence,items:{}},i=this.findParentSchema(t);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(t,r){const i=this.items.get(t)||this.createDefault(t),n=[];for(const s in i.items){const a=i.items[s],l=r?s:"";let c;if(typeof a.type=="number"){const y=m[a.type],p=cc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);c=new p({name:l})}else At(a.type)?c=new a.type().toSchema(l):a.optional?this.get(a.type).type===T.Choice?c=new Yt({name:l}):(c=this.create(a.type,!1),c.name=l):c=new Yt({name:l});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){c.name="";const y=a.repeated==="set"?St:Ct;c=new y({name:"",value:[new Xi({name:l,value:c})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||At(a.type)){const y=a.repeated?Fe:Zr;n.push(new y({name:l,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?c:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,n.push(new Fe({name:y?"":l,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else n.push(new Fe({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else c.optional=d,n.push(c)}switch(i.type){case T.Sequence:return new Ct({value:n,name:""});case T.Set:return new St({value:n,name:""});case T.Choice:return new Uo({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const et=new Xp,V=e=>t=>{let r;et.has(t)?r=et.get(t):(r=et.createDefault(t),et.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;et.has(t.constructor)?i=et.get(t.constructor):(i=et.createDefault(t.constructor),et.set(t.constructor,i));const n=Object.assign({},e);if(typeof n.type=="number"&&!n.converter){const s=Lo(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);n.converter=s}i.items[r]=n};class fc extends Error{constructor(){super(...arguments),this.schemas=[]}}class eh{static parse(t,r){const i=hr(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(At(r))return new r().fromASN(t);const n=et.get(r);et.cache(r);let s=n.schema;if(t.constructor===Fe&&n.type!==T.Choice){s=new Fe({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const c in n.items)delete t[c]}const a=Zt({},t,s);if(!a.verified)throw new fc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const l=new r;if(dc(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=n.itemType;if(typeof c=="number"){const d=Lo(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 n.items){const d=a.result[c];if(!d)continue;const y=n.items[c],p=y.type;if(typeof p=="number"||At(p)){const I=(i=y.converter)!==null&&i!==void 0?i:At(p)?new p:null;if(!I)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?Ct:St,h=new w;h.valueBlock=d.valueBlock;const g=hr(h.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const b=g.result.valueBlock.value;l[c]=Array.from(b,v=>I.fromASN(v))}else l[c]=Array.from(d,w=>I.fromASN(w));else{let w=d;if(y.implicit){let h;if(At(p))h=new p().toSchema("");else{const g=m[p],b=cc[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=hr(h.toBER(!1)).result}l[c]=I.fromASN(w)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");l[c]=Array.from(d,I=>this.fromASN(I,p))}else l[c]=this.fromASN(d,p)}return l}catch(n){throw n instanceof fc&&n.schemas.push(r.name),n}}}class Fo{static serialize(t){return t instanceof Ne?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&At(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=et.get(r);et.cache(r);let n=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=Lo(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);n=t.map(l=>a.toASN(l))}else n=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const l=i.items[a],c=t[a];if(c===void 0||l.defaultValue===c||typeof l.defaultValue=="object"&&typeof c=="object"&&Qp(this.serialize(l.defaultValue),this.serialize(c)))continue;const d=Fo.toAsnItem(l,a,r,c);if(typeof l.context=="number")if(l.implicit)if(!l.repeated&&(typeof l.type=="number"||At(l.type))){const y={};y.valueHex=d instanceof Gt?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Zr({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},...y}))}else n.push(new Fe({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:d.valueBlock.value}));else n.push(new Fe({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:[d]}));else l.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case T.Sequence:s=new Ct({value:n});break;case T.Set:s=new St({value:n});break;case T.Choice:if(!n[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(t,r,i,n){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${m[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(n,d=>a.toASN(d)),c=t.repeated==="sequence"?Ct:St;s=new c({value:l})}else s=a.toASN(n)}else if(t.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(n,c=>this.toASN(c)),l=t.repeated==="sequence"?Ct:St;s=new l({value:a})}else s=this.toASN(n);return s}}class ce 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 Fo.serialize(t)}static parse(t,r){return eh.parse(t,r)}static toString(t){const r=P.isBufferSource(t)?P.toArrayBuffer(t):G.serialize(t),i=hr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var n=arguments.length,s=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(s=(n<3?a(s):n>3?a(t,r,s):a(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var pc={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",l="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,x=(h.match(c.zoneIndex)||[])[0],E,k;for(x&&(x=x.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(k=g-b,E=":";k--;)E+="0:";return h=h.replace("::",E),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const S=h.split(":"),A=[];for(let $=0;$<S.length;$++)A.push(parseInt(S[$],16));return A}(),{parts:g,zoneId:x}}function y(h,g,b,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,E;for(;v>0;){if(E=b-v,E<0&&(E=0),h[x]>>E!==g[x]>>E)return!1;v-=b,x+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function I(h,g){for(;h.length<g;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,v;for(b=0;b<g.length;b++)if(v=g[b],!(0<=v&&v<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(g,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let x,E,k;for(x=3;x>=0;x-=1)if(E=this.octets[x],E in v){if(k=v[E],b&&k!==0)return null;k!==8&&(b=!0),g+=k}else return null;return 32-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return w.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),w.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let E=0;for(;E<4;)x.push(parseInt(b[E],10)|parseInt(v[E],10)^255),E++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.isIPv4=function(h){return this.parser(h)!==null},w.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},w.IPv4.isValidFourPartDecimal=function(h){return!!(w.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},w.IPv4.networkAddressFromCIDR=function(h){let g,b,v,x,E;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],b=0;b<4;)x.push(parseInt(v[b],10)&parseInt(E[b],10)),b++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.parse=function(h){const g=this.parser(h);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},w.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(g[2]);if(b>=0&&b<=32){const v=[this.parse(g[1]),b];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,v;if(g=h.match(i.fourOctet))return function(){const x=g.slice(1,6),E=[];for(let k=0;k<x.length;k++)b=x[k],E.push(p(b));return E}();if(g=h.match(i.longValue)){if(v=p(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const x=[];let E;for(E=0;E<=24;E+=8)x.push(v>>E&255);return x}().reverse()}else return(g=h.match(i.twoOctet))?function(){const x=g.slice(1,4),E=[];if(v=p(x[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return E.push(p(x[0])),E.push(v>>16&255),E.push(v>>8&255),E.push(v&255),E}():(g=h.match(i.threeOctet))?function(){const x=g.slice(1,5),E=[];if(v=p(x[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return E.push(p(x[0])),E.push(p(x[1])),E.push(v>>8&255),E.push(v&255),E}():null},w.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let v,x;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(x=this.parts[v],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(g,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let x,E;for(let k=7;k>=0;k-=1)if(x=this.parts[k],x in v){if(E=v[x],b&&E!==0)return null;E!==16&&(b=!0),g+=E}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let x=0;x<v.length;x++)g=v[x],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let x=0;x<this.parts.length;x++)v.push(I(this.parts[x].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),b=g[0],v=g[1];return new w.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let x=0;x<this.parts.length;x++)v.push(this.parts[x].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,x=-1,E;for(;E=g.exec(b);)E[0].length>x&&(v=E.index,x=E[0].length);return x<0?b:`${b.substring(0,v)}::${b.substring(v+x)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let E=0;for(;E<16;)x.push(parseInt(b[E],10)|parseInt(v[E],10)^255),E++;return new this(x)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},w.IPv6.isIPv6=function(h){return this.parser(h)!==null},w.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const g=this.parser(h);return new this(g.parts,g.zoneId),!0}catch{return!1}},w.IPv6.networkAddressFromCIDR=function(h){let g,b,v,x,E;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],b=0;b<16;)x.push(parseInt(v[b],10)&parseInt(E[b],10)),b++;return new this(x)}catch(k){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${k})`)}},w.IPv6.parse=function(h){const g=this.parser(h);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},w.IPv6.parseCIDR=function(h){let g,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return v=[this.parse(b[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,v,x,E,k;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))&&(k=v[6]||"",g=d(v[1].slice(0,-1)+k,6),g.parts)){for(E=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<E.length;b++)if(x=E[b],!(0<=x&&x<=255))return null;return g.parts.push(E[0]<<8|E[1]),g.parts.push(E[2]<<8|E[3]),{parts:g.parts,zoneId:g.zoneId}}return null},w.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<16&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.fromByteArray=function(h){const g=h.length;if(g===4)return new w.IPv4(h);if(g===16)return new w.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},w.isValid=function(h){return w.IPv6.isValid(h)||w.IPv4.isValid(h)},w.parse=function(h){if(w.IPv6.isValid(h))return w.IPv6.parse(h);if(w.IPv4.isValid(h))return w.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},w.parseCIDR=function(h){try{return w.IPv6.parseCIDR(h)}catch{try{return w.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},w.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},w.subnetMatch=function(h,g,b){let v,x,E,k;b==null&&(b="unicast");for(x in g)if(Object.prototype.hasOwnProperty.call(g,x)){for(E=g[x],E[0]&&!(E[0]instanceof Array)&&(E=[E]),v=0;v<E.length;v++)if(k=E[v],h.kind()===k[0].kind()&&h.match.apply(h,k))return x}return b},e.exports?e.exports=w:t.ipaddr=w})(xo)})(pc);var hc=pc.exports;class yc{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((n,s)=>n+ +s,0);let i=t.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return hc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=hc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Ho,qo,Ko;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:m.TeletexString})],Oe.prototype,"teletexString",void 0),u([f({type:m.PrintableString})],Oe.prototype,"printableString",void 0),u([f({type:m.UniversalString})],Oe.prototype,"universalString",void 0),u([f({type:m.Utf8String})],Oe.prototype,"utf8String",void 0),u([f({type:m.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([V({type:T.Choice})],Oe);let yr=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:m.IA5String})],yr.prototype,"ia5String",void 0),u([f({type:m.Any})],yr.prototype,"anyValue",void 0),yr=u([V({type:T.Choice})],yr);class ei{constructor(t={}){this.type="",this.value=new yr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"type",void 0),u([f({type:yr})],ei.prototype,"value",void 0);let gr=Ho=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};gr=Ho=u([V({type:T.Set,itemType:ei})],gr);let zo=qo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};zo=qo=u([V({type:T.Sequence,itemType:gr})],zo);let we=Ko=class extends zo{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};we=Ko=u([V({type:T.Sequence})],we);const th={fromASN:e=>yc.toString(tn.fromASN(e)),toASN:e=>tn.toASN(yc.fromString(e))};class ti{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ti.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ti.prototype,"value",void 0);class Go{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Go.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Go.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ti,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type:m.IA5String,context:1,implicit:!0})],ie.prototype,"rfc822Name",void 0),u([f({type:m.IA5String,context:2,implicit:!0})],ie.prototype,"dNSName",void 0),u([f({type:m.Any,context:3,implicit:!0})],ie.prototype,"x400Address",void 0),u([f({type:we,context:4,implicit:!1})],ie.prototype,"directoryName",void 0),u([f({type:Go,context:5})],ie.prototype,"ediPartyName",void 0),u([f({type:m.IA5String,context:6,implicit:!0})],ie.prototype,"uniformResourceIdentifier",void 0),u([f({type:m.OctetString,context:7,implicit:!0,converter:th})],ie.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([V({type:T.Choice})],ie);const mr="1.3.6.1.5.5.7.3",Qt="2.5.29";var Wo;class rn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],rn.prototype,"accessMethod",void 0),u([f({type:ie})],rn.prototype,"accessLocation",void 0);let gc=Wo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};gc=Wo=u([V({type:T.Sequence,itemType:rn})],gc);const Jo=`${Qt}.35`;class Yo extends ae{}class Xt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Yo,context:0,optional:!0,implicit:!0})],Xt.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Xt.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:he})],Xt.prototype,"authorityCertSerialNumber",void 0);const mc=`${Qt}.19`;class nn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],nn.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],nn.prototype,"pathLenConstraint",void 0);var Zo;let Pe=Zo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};Pe=Zo=u([V({type:T.Sequence,itemType:ie})],Pe);var Qo;let bc=Qo=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};bc=Qo=u([V({type:T.Sequence})],bc);var Xo;const wc=`${Qt}.32`;let Bt=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],Bt.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],Bt.prototype,"visibleString",void 0),u([f({type:m.BmpString})],Bt.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],Bt.prototype,"utf8String",void 0),Bt=u([V({type:T.Choice})],Bt);class es{constructor(t={}){this.organization=new Bt,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:Bt})],es.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],es.prototype,"noticeNumbers",void 0);class ts{constructor(t={}){Object.assign(this,t)}}u([f({type:es,optional:!0})],ts.prototype,"noticeRef",void 0),u([f({type:Bt,optional:!0})],ts.prototype,"explicitText",void 0);let on=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],on.prototype,"cPSuri",void 0),u([f({type:ts})],on.prototype,"userNotice",void 0),on=u([V({type:T.Choice})],on);class rs{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],rs.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],rs.prototype,"qualifier",void 0);class sn{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],sn.prototype,"policyIdentifier",void 0),u([f({type:rs,repeated:"sequence",optional:!0})],sn.prototype,"policyQualifiers",void 0);let an=Xo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};an=Xo=u([V({type:T.Sequence,itemType:sn})],an);let ln=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],ln.prototype,"value",void 0),ln=u([V({type:T.Choice})],ln);let vc=class extends ln{};vc=u([V({type:T.Choice})],vc);var is,ot;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(ot||(ot={}));class kc extends en{toJSON(){const t=[],r=this.toNumber();return r&ot.aACompromise&&t.push("aACompromise"),r&ot.affiliationChanged&&t.push("affiliationChanged"),r&ot.cACompromise&&t.push("cACompromise"),r&ot.certificateHold&&t.push("certificateHold"),r&ot.cessationOfOperation&&t.push("cessationOfOperation"),r&ot.keyCompromise&&t.push("keyCompromise"),r&ot.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&ot.superseded&&t.push("superseded"),r&ot.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],br.prototype,"fullName",void 0),u([f({type:gr,context:1,implicit:!0})],br.prototype,"nameRelativeToCRLIssuer",void 0),br=u([V({type:T.Choice})],br);class ri{constructor(t={}){Object.assign(this,t)}}u([f({type:br,context:0,optional:!0})],ri.prototype,"distributionPoint",void 0),u([f({type:kc,context:1,optional:!0,implicit:!0})],ri.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ri.prototype,"cRLIssuer",void 0);let ns=is=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};ns=is=u([V({type:T.Sequence,itemType:ri})],ns);var os;let Cc=os=class extends ns{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};Cc=os=u([V({type:T.Sequence,itemType:ri})],Cc);class De{constructor(t={}){this.onlyContainsUserCerts=De.ONLY,this.onlyContainsCACerts=De.ONLY,this.indirectCRL=De.ONLY,this.onlyContainsAttributeCerts=De.ONLY,Object.assign(this,t)}}De.ONLY=!1,u([f({type:br,context:0,optional:!0})],De.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsCACerts",void 0),u([f({type:kc,context:3,optional:!0,implicit:!0})],De.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:De.ONLY,implicit:!0})],De.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsAttributeCerts",void 0);var ii;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ii||(ii={}));let ss=class{constructor(t=ii.unspecified){this.reason=ii.unspecified,this.reason=t}toJSON(){return ii[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],ss.prototype,"reason",void 0),ss=u([V({type:T.Choice})],ss);var as;const Sc=`${Qt}.37`;let cn=as=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};cn=as=u([V({type:T.Sequence,itemType:m.ObjectIdentifier})],cn);const rh=`${mr}.1`,ih=`${mr}.2`,nh=`${mr}.3`,oh=`${mr}.4`,sh=`${mr}.8`,ah=`${mr}.9`;let ls=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:he})],ls.prototype,"value",void 0),ls=u([V({type:T.Choice})],ls);let cs=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],cs.prototype,"value",void 0),cs=u([V({type:T.Choice})],cs);var us;let xc=us=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};xc=us=u([V({type:T.Sequence})],xc);const Ac=`${Qt}.15`;var st;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(st||(st={}));class ds extends en{toJSON(){const t=this.toNumber(),r=[];return t&st.cRLSign&&r.push("crlSign"),t&st.dataEncipherment&&r.push("dataEncipherment"),t&st.decipherOnly&&r.push("decipherOnly"),t&st.digitalSignature&&r.push("digitalSignature"),t&st.encipherOnly&&r.push("encipherOnly"),t&st.keyAgreement&&r.push("keyAgreement"),t&st.keyCertSign&&r.push("keyCertSign"),t&st.keyEncipherment&&r.push("keyEncipherment"),t&st.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var fs;class un{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],un.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],un.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],un.prototype,"maximum",void 0);let dn=fs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};dn=fs=u([V({type:T.Sequence,itemType:un})],dn);class Bc{constructor(t={}){Object.assign(this,t)}}u([f({type:dn,context:0,optional:!0,implicit:!0})],Bc.prototype,"permittedSubtrees",void 0),u([f({type:dn,context:1,optional:!0,implicit:!0})],Bc.prototype,"excludedSubtrees",void 0);class Ic{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:he})],Ic.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:he})],Ic.prototype,"inhibitPolicyMapping",void 0);var ps;class hs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],hs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],hs.prototype,"subjectDomainPolicy",void 0);let Ec=ps=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};Ec=ps=u([V({type:T.Sequence,itemType:hs})],Ec);var ys;const Nc=`${Qt}.17`;let gs=ys=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};gs=ys=u([V({type:T.Sequence})],gs);let It=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],It.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],It.prototype,"values",void 0);var ms;let Oc=ms=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};Oc=ms=u([V({type:T.Sequence,itemType:It})],Oc);const _c=`${Qt}.14`;class $t extends Yo{}class Tc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],Tc.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],Tc.prototype,"notAfter",void 0);var ni;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ni||(ni={}));class Vc extends en{toJSON(){const t=[],r=this.toNumber();return r&ni.pKIXCertificate&&t.push("pKIXCertificate"),r&ni.newExtensions&&t.push("newExtensions"),r&ni.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class jc{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Vc,Object.assign(this,t)}}u([f({type:m.GeneralString})],jc.prototype,"entrustVers",void 0),u([f({type:Vc})],jc.prototype,"entrustInfoFlags",void 0);var bs;let Dc=bs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};Dc=bs=u([V({type:T.Sequence,itemType:rn})],Dc);class H{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof H&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&ll(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],H.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],H.prototype,"parameters",void 0);class Et{constructor(t={}){this.algorithm=new H,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Et.prototype,"algorithm",void 0),u([f({type:m.BitString})],Et.prototype,"subjectPublicKey",void 0);let _e=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:m.UTCTime})],_e.prototype,"utcTime",void 0),u([f({type:m.GeneralizedTime})],_e.prototype,"generalTime",void 0),_e=u([V({type:T.Choice})],_e);class fn{constructor(t){this.notBefore=new _e(new Date),this.notAfter=new _e(new Date),t&&(this.notBefore=new _e(t.notBefore),this.notAfter=new _e(t.notAfter))}}u([f({type:_e})],fn.prototype,"notBefore",void 0),u([f({type:_e})],fn.prototype,"notAfter",void 0);var ws;let at=class lp{constructor(t={}){this.extnID="",this.critical=lp.CRITICAL,this.extnValue=new ae,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:ae})],at.prototype,"extnValue",void 0);let er=ws=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};er=ws=u([V({type:T.Sequence,itemType:at})],er);var wr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(wr||(wr={}));class tt{constructor(t={}){this.version=wr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new H,this.issuer=new we,this.validity=new fn,this.subject=new we,this.subjectPublicKeyInfo=new Et,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:wr.v1})],tt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],tt.prototype,"serialNumber",void 0),u([f({type:H})],tt.prototype,"signature",void 0),u([f({type:we})],tt.prototype,"issuer",void 0),u([f({type:fn})],tt.prototype,"validity",void 0),u([f({type:we})],tt.prototype,"subject",void 0),u([f({type:Et})],tt.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],tt.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],tt.prototype,"subjectUniqueID",void 0),u([f({type:er,context:3,optional:!0})],tt.prototype,"extensions",void 0);class vr{constructor(t={}){this.tbsCertificate=new tt,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:tt})],vr.prototype,"tbsCertificate",void 0),u([f({type:H})],vr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vr.prototype,"signatureValue",void 0);class pn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],pn.prototype,"userCertificate",void 0),u([f({type:_e})],pn.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],pn.prototype,"crlEntryExtensions",void 0);class Nt{constructor(t={}){this.signature=new H,this.issuer=new we,this.thisUpdate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],Nt.prototype,"version",void 0),u([f({type:H})],Nt.prototype,"signature",void 0),u([f({type:we})],Nt.prototype,"issuer",void 0),u([f({type:_e})],Nt.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Nt.prototype,"nextUpdate",void 0),u([f({type:pn,repeated:"sequence",optional:!0})],Nt.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],Nt.prototype,"crlExtensions",void 0);let vs=class{constructor(t={}){this.tbsCertList=new Nt,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Nt})],vs.prototype,"tbsCertList",void 0),u([f({type:H})],vs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vs.prototype,"signature",void 0);class kr{constructor(t={}){this.issuer=new we,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:we})],kr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],kr.prototype,"serialNumber",void 0);let Cr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0})],Cr.prototype,"subjectKeyIdentifier",void 0),u([f({type:kr})],Cr.prototype,"issuerAndSerialNumber",void 0),Cr=u([V({type:T.Choice})],Cr);var Ot;(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"})(Ot||(Ot={}));let oi=class extends H{};oi=u([V({type:T.Sequence})],oi);let hn=class extends H{};hn=u([V({type:T.Sequence})],hn);let ht=class extends H{};ht=u([V({type:T.Sequence})],ht);let yn=class extends H{};yn=u([V({type:T.Sequence})],yn);let $c=class extends H{};$c=u([V({type:T.Sequence})],$c);let ks=class extends H{};ks=u([V({type:T.Sequence})],ks);let Sr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Sr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],Sr.prototype,"attrValues",void 0);var Cs;class yt{constructor(t={}){this.version=Ot.v0,this.sid=new Cr,this.digestAlgorithm=new oi,this.signatureAlgorithm=new hn,this.signature=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],yt.prototype,"version",void 0),u([f({type:Cr})],yt.prototype,"sid",void 0),u([f({type:oi})],yt.prototype,"digestAlgorithm",void 0),u([f({type:Sr,repeated:"set",context:0,implicit:!0,optional:!0})],yt.prototype,"signedAttrs",void 0),u([f({type:hn})],yt.prototype,"signatureAlgorithm",void 0),u([f({type:ae})],yt.prototype,"signature",void 0),u([f({type:Sr,repeated:"set",context:1,implicit:!0,optional:!0})],yt.prototype,"unsignedAttrs",void 0);let gn=Cs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Cs.prototype)}};gn=Cs=u([V({type:T.Set,itemType:yt})],gn);let Mc=class extends _e{};Mc=u([V({type:T.Choice})],Mc);let Pc=class extends yt{};Pc=u([V({type:T.Sequence})],Pc);class Ss{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],Ss.prototype,"acIssuer",void 0),u([f({type:m.Integer})],Ss.prototype,"acSerial",void 0),u([f({type:It,repeated:"sequence"})],Ss.prototype,"attrs",void 0);var xs;let mn=xs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};mn=xs=u([V({type:T.Sequence,itemType:m.ObjectIdentifier})],mn);class bn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],bn.prototype,"pathLenConstraint",void 0),u([f({type:mn,implicit:!0,context:0,optional:!0})],bn.prototype,"permittedAttrs",void 0),u([f({type:mn,implicit:!0,context:1,optional:!0})],bn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],bn.prototype,"permitUnSpecified",void 0);class tr{constructor(t={}){this.issuer=new Pe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pe})],tr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],tr.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],tr.prototype,"issuerUID",void 0);var As;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(As||(As={}));class rr{constructor(t={}){this.digestedObjectType=As.publicKey,this.digestAlgorithm=new H,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],rr.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],rr.prototype,"otherObjectTypeID",void 0),u([f({type:H})],rr.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],rr.prototype,"objectDigest",void 0);class wn{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,optional:!0})],wn.prototype,"issuerName",void 0),u([f({type:tr,context:0,implicit:!0,optional:!0})],wn.prototype,"baseCertificateID",void 0),u([f({type:rr,context:1,implicit:!0,optional:!0})],wn.prototype,"objectDigestInfo",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],xr.prototype,"v1Form",void 0),u([f({type:wn,context:0,implicit:!0})],xr.prototype,"v2Form",void 0),xr=u([V({type:T.Choice})],xr);class vn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],vn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],vn.prototype,"notAfterTime",void 0);class si{constructor(t={}){Object.assign(this,t)}}u([f({type:tr,implicit:!0,context:0,optional:!0})],si.prototype,"baseCertificateID",void 0),u([f({type:Pe,implicit:!0,context:1,optional:!0})],si.prototype,"entityName",void 0),u([f({type:rr,implicit:!0,context:2,optional:!0})],si.prototype,"objectDigestInfo",void 0);var Bs;(function(e){e[e.v2=1]="v2"})(Bs||(Bs={}));class lt{constructor(t={}){this.version=Bs.v2,this.holder=new si,this.issuer=new xr,this.signature=new H,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new vn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],lt.prototype,"version",void 0),u([f({type:si})],lt.prototype,"holder",void 0),u([f({type:xr})],lt.prototype,"issuer",void 0),u([f({type:H})],lt.prototype,"signature",void 0),u([f({type:m.Integer,converter:he})],lt.prototype,"serialNumber",void 0),u([f({type:vn})],lt.prototype,"attrCertValidityPeriod",void 0),u([f({type:It,repeated:"sequence"})],lt.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],lt.prototype,"issuerUniqueID",void 0),u([f({type:er,optional:!0})],lt.prototype,"extensions",void 0);class kn{constructor(t={}){this.acinfo=new lt,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:lt})],kn.prototype,"acinfo",void 0),u([f({type:H})],kn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],kn.prototype,"signatureValue",void 0);var Cn;(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"})(Cn||(Cn={}));class Is extends en{}class Es{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Es.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Es.prototype,"value",void 0);class Ns{constructor(t={}){this.policyId="",this.classList=new Is(Cn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ns.prototype,"policyId",void 0),u([f({type:Is,defaultValue:new Is(Cn.unclassified)})],Ns.prototype,"classList",void 0),u([f({type:Es,repeated:"set"})],Ns.prototype,"securityCategories",void 0);class Sn{constructor(t={}){Object.assign(this,t)}}u([f({type:ae})],Sn.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],Sn.prototype,"oid",void 0),u([f({type:m.Utf8String})],Sn.prototype,"string",void 0);class Rc{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Rc.prototype,"policyAuthority",void 0),u([f({type:Sn,repeated:"sequence"})],Rc.prototype,"values",void 0);var Os;class xn{constructor(t={}){this.targetCertificate=new tr,Object.assign(this,t)}}u([f({type:tr})],xn.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],xn.prototype,"targetName",void 0),u([f({type:rr,optional:!0})],xn.prototype,"certDigestInfo",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],Ar.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],Ar.prototype,"targetGroup",void 0),u([f({type:xn,context:2,implicit:!0})],Ar.prototype,"targetCert",void 0),Ar=u([V({type:T.Choice})],Ar);let _s=Os=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Os.prototype)}};_s=Os=u([V({type:T.Sequence,itemType:Ar})],_s);var Ts;let Uc=Ts=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Uc=Ts=u([V({type:T.Sequence,itemType:_s})],Uc);class Lc{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Lc.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Lc.prototype,"roleName",void 0);class Vs{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],Vs.prototype,"service",void 0),u([f({type:ie})],Vs.prototype,"ident",void 0),u([f({type:ae,optional:!0})],Vs.prototype,"authInfo",void 0);var js;class Ds{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ds.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Ds.prototype,"otherCert",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:vr})],Br.prototype,"certificate",void 0),u([f({type:kn,context:2,implicit:!0})],Br.prototype,"v2AttrCert",void 0),u([f({type:Ds,context:3,implicit:!0})],Br.prototype,"other",void 0),Br=u([V({type:T.Choice})],Br);let An=js=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};An=js=u([V({type:T.Set,itemType:Br})],An);class Ir{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ir.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Ir.prototype,"content",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae})],ai.prototype,"single",void 0),u([f({type:m.Any})],ai.prototype,"any",void 0),ai=u([V({type:T.Choice})],ai);class Bn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Bn.prototype,"eContentType",void 0),u([f({type:ai,context:0,optional:!0})],Bn.prototype,"eContent",void 0);let li=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae,context:0,implicit:!0,optional:!0})],li.prototype,"value",void 0),u([f({type:ae,converter:Mp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],li.prototype,"constructedValue",void 0),li=u([V({type:T.Choice})],li);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new yn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:yn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:li,optional:!0})],ci.prototype,"encryptedContent",void 0);class In{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],In.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],In.prototype,"keyAttr",void 0);var $s;class En{constructor(t={}){this.subjectKeyIdentifier=new $t,Object.assign(this,t)}}u([f({type:$t})],En.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],En.prototype,"date",void 0),u([f({type:In,optional:!0})],En.prototype,"other",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:En,context:0,implicit:!0,optional:!0})],Er.prototype,"rKeyId",void 0),u([f({type:kr,optional:!0})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([V({type:T.Choice})],Er);class Ms{constructor(t={}){this.rid=new Er,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Er})],Ms.prototype,"rid",void 0),u([f({type:ae})],Ms.prototype,"encryptedKey",void 0);let Nn=$s=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};Nn=$s=u([V({type:T.Sequence,itemType:Ms})],Nn);class Ps{constructor(t={}){this.algorithm=new H,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Ps.prototype,"algorithm",void 0),u([f({type:m.BitString})],Ps.prototype,"publicKey",void 0);let ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0,optional:!0})],ir.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ps,context:1,implicit:!0,optional:!0})],ir.prototype,"originatorKey",void 0),u([f({type:kr,optional:!0})],ir.prototype,"issuerAndSerialNumber",void 0),ir=u([V({type:T.Choice})],ir);class Nr{constructor(t={}){this.version=Ot.v3,this.originator=new ir,this.keyEncryptionAlgorithm=new ht,this.recipientEncryptedKeys=new Nn,Object.assign(this,t)}}u([f({type:m.Integer})],Nr.prototype,"version",void 0),u([f({type:ir,context:0})],Nr.prototype,"originator",void 0),u([f({type:ae,context:1,optional:!0})],Nr.prototype,"ukm",void 0),u([f({type:ht})],Nr.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:Nn})],Nr.prototype,"recipientEncryptedKeys",void 0);let Or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:$t,context:0,implicit:!0})],Or.prototype,"subjectKeyIdentifier",void 0),u([f({type:kr})],Or.prototype,"issuerAndSerialNumber",void 0),Or=u([V({type:T.Choice})],Or);class ui{constructor(t={}){this.version=Ot.v0,this.rid=new Or,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],ui.prototype,"version",void 0),u([f({type:Or})],ui.prototype,"rid",void 0),u([f({type:ht})],ui.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],ui.prototype,"encryptedKey",void 0);class di{constructor(t={}){this.keyIdentifier=new ae,Object.assign(this,t)}}u([f({type:ae})],di.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],di.prototype,"date",void 0),u([f({type:In,optional:!0})],di.prototype,"other",void 0);class fi{constructor(t={}){this.version=Ot.v4,this.kekid=new di,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:di})],fi.prototype,"kekid",void 0),u([f({type:ht})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.version=Ot.v0,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],pi.prototype,"version",void 0),u([f({type:ks,context:0,optional:!0})],pi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:ht})],pi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],pi.prototype,"encryptedKey",void 0);class Rs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Rs.prototype,"oriType",void 0),u([f({type:m.Any})],Rs.prototype,"oriValue",void 0);let Mt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ui,optional:!0})],Mt.prototype,"ktri",void 0),u([f({type:Nr,context:1,implicit:!0,optional:!0})],Mt.prototype,"kari",void 0),u([f({type:fi,context:2,implicit:!0,optional:!0})],Mt.prototype,"kekri",void 0),u([f({type:pi,context:3,implicit:!0,optional:!0})],Mt.prototype,"pwri",void 0),u([f({type:Rs,context:4,implicit:!0,optional:!0})],Mt.prototype,"ori",void 0),Mt=u([V({type:T.Choice})],Mt);var Us;let On=Us=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Us.prototype)}};On=Us=u([V({type:T.Set,itemType:Mt})],On);var Ls;class _n{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],_n.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],_n.prototype,"otherRevInfo",void 0);let hi=class{constructor(t={}){this.other=new _n,Object.assign(this,t)}};u([f({type:_n,context:1,implicit:!0})],hi.prototype,"other",void 0),hi=u([V({type:T.Choice})],hi);let Fs=Ls=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Ls.prototype)}};Fs=Ls=u([V({type:T.Set,itemType:hi})],Fs);class Hs{constructor(t={}){Object.assign(this,t)}}u([f({type:An,context:0,implicit:!0,optional:!0})],Hs.prototype,"certs",void 0),u([f({type:Fs,context:1,implicit:!0,optional:!0})],Hs.prototype,"crls",void 0);var qs;let Ks=qs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([V({type:T.Set,itemType:Sr})],Ks);class yi{constructor(t={}){this.version=Ot.v0,this.recipientInfos=new On,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:m.Integer})],yi.prototype,"version",void 0),u([f({type:Hs,context:0,implicit:!0,optional:!0})],yi.prototype,"originatorInfo",void 0),u([f({type:On})],yi.prototype,"recipientInfos",void 0),u([f({type:ci})],yi.prototype,"encryptedContentInfo",void 0),u([f({type:Ks,context:1,implicit:!0,optional:!0})],yi.prototype,"unprotectedAttrs",void 0);const lh="1.2.840.113549.1.7.2";var zs;let Tn=zs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Tn=zs=u([V({type:T.Set,itemType:oi})],Tn);class _r{constructor(t={}){this.version=Ot.v0,this.digestAlgorithms=new Tn,this.encapContentInfo=new Bn,this.signerInfos=new gn,Object.assign(this,t)}}u([f({type:m.Integer})],_r.prototype,"version",void 0),u([f({type:Tn})],_r.prototype,"digestAlgorithms",void 0),u([f({type:Bn})],_r.prototype,"encapContentInfo",void 0),u([f({type:An,context:0,implicit:!0,optional:!0})],_r.prototype,"certificates",void 0),u([f({type:hi,context:1,implicit:!0,optional:!0})],_r.prototype,"crls",void 0),u([f({type:gn})],_r.prototype,"signerInfos",void 0);const gi="1.2.840.10045.2.1",Gs="1.2.840.10045.4.1",Fc="1.2.840.10045.4.3.1",Ws="1.2.840.10045.4.3.2",Js="1.2.840.10045.4.3.3",Ys="1.2.840.10045.4.3.4",Hc="1.2.840.10045.3.1.7",qc="1.3.132.0.34",Kc="1.3.132.0.35";function mi(e){return new H({algorithm:e})}const ch=mi(Gs);mi(Fc);const uh=mi(Ws),dh=mi(Js),fh=mi(Ys);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Tr.prototype,"namedCurve",void 0),Tr=u([V({type:T.Choice})],Tr);class Vn{constructor(t={}){this.version=1,this.privateKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],Vn.prototype,"version",void 0),u([f({type:ae})],Vn.prototype,"privateKey",void 0),u([f({type:Tr,context:0,optional:!0})],Vn.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],Vn.prototype,"publicKey",void 0);class jn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],jn.prototype,"r",void 0),u([f({type:m.Integer,converter:he})],jn.prototype,"s",void 0);const He="1.2.840.113549.1.1",Vr=`${He}.1`,ph=`${He}.7`,hh=`${He}.9`,yh=`${He}.10`,gh=`${He}.2`,mh=`${He}.4`,Dn=`${He}.5`,bh=`${He}.14`,Zs=`${He}.11`,$n=`${He}.12`,Mn=`${He}.13`,zc=`${He}.15`,Gc=`${He}.16`,Wc="1.3.14.3.2.26",Jc="2.16.840.1.101.3.4.2.4",Yc="2.16.840.1.101.3.4.2.1",Zc="2.16.840.1.101.3.4.2.2",Qc="2.16.840.1.101.3.4.2.3",wh="2.16.840.1.101.3.4.2.5",vh="2.16.840.1.101.3.4.2.6",kh="1.2.840.113549.2.2",Ch="1.2.840.113549.2.5",Qs=`${He}.8`;function ve(e){return new H({algorithm:e,parameters:null})}ve(kh),ve(Ch);const nr=ve(Wc);ve(Jc),ve(Yc),ve(Zc),ve(Qc),ve(wh),ve(vh);const Xc=new H({algorithm:Qs,parameters:G.serialize(nr)}),eu=new H({algorithm:hh,parameters:G.serialize(tn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ve(Vr),ve(gh),ve(mh),ve(Dn),ve(zc),ve(Gc),ve($n),ve(Mn),ve(zc),ve(Gc);class Pn{constructor(t={}){this.hashAlgorithm=new H(nr),this.maskGenAlgorithm=new H({algorithm:Qs,parameters:G.serialize(nr)}),this.pSourceAlgorithm=new H(eu),Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:nr})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Xc})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:eu})],Pn.prototype,"pSourceAlgorithm",void 0),new H({algorithm:ph,parameters:G.serialize(new Pn)});class bi{constructor(t={}){this.hashAlgorithm=new H(nr),this.maskGenAlgorithm=new H({algorithm:Qs,parameters:G.serialize(nr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:nr})],bi.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Xc})],bi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],bi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],bi.prototype,"trailerField",void 0),new H({algorithm:yh,parameters:G.serialize(new bi)});class Rn{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],Rn.prototype,"digestAlgorithm",void 0),u([f({type:ae})],Rn.prototype,"digest",void 0);var Xs;class Un{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Un.prototype,"prime",void 0),u([f({type:m.Integer,converter:he})],Un.prototype,"exponent",void 0),u([f({type:m.Integer,converter:he})],Un.prototype,"coefficient",void 0);let ea=Xs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};ea=Xs=u([V({type:T.Sequence,itemType:Un})],ea);class gt{constructor(t={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer})],gt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"coefficient",void 0),u([f({type:ea,optional:!0})],gt.prototype,"otherPrimeInfos",void 0);class ta{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],ta.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],ta.prototype,"publicExponent",void 0);var ra;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(ra||(ra={}));const qe=ra;/*! *****************************************************************************
|
|
76
76
|
Copyright (c) Microsoft Corporation.
|
|
77
77
|
|
|
78
78
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -85,9 +85,9 @@ ${t.join(`
|
|
|
85
85
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
86
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
87
|
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
-
***************************************************************************** */var ia=function(e,t){return ia=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},ia(e,t)};function na(e,t){ia(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Sh(e,t,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function
|
|
88
|
+
***************************************************************************** */var ia=function(e,t){return ia=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},ia(e,t)};function na(e,t){ia(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Sh(e,t,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function l(y){try{d(i.next(y))}catch(p){a(p)}}function c(y){try{d(i.throw(y))}catch(p){a(p)}}function d(y){y.done?s(y.value):n(y.value).then(l,c)}d((i=i.apply(e,t||[])).next())})}function xh(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(d){return function(y){return c([d,y])}}function c(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)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 r.label++,{value:d[1],done:!1};case 5:r.label++,n=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(y){d=[6,y],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Ln(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fn(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,s=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(l){a={error:l}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function or(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Fn(arguments[t]));return e}var Ah="injectionTokens";function Bh(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(Ah,e)||{};return Object.keys(r).forEach(function(i){t[+i]=r[i]}),t}function tu(e){return!!e.useClass}function oa(e){return!!e.useFactory}var ru=function(){function e(t){this.wrap=t,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return e.prototype.createProxy=function(t){var r=this,i={},n=!1,s,a=function(){return n||(s=t(r.wrap()),n=!0),s};return new Proxy(i,this.createHandler(a))},e.prototype.createHandler=function(t){var r={},i=function(n){r[n]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=t();var l=Reflect[n];return l.apply(void 0,or(s))}};return this.reflectMethods.forEach(i),r},e}();function jr(e){return typeof e=="string"||typeof e=="symbol"}function Ih(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function iu(e){return typeof e=="object"&&"token"in e&&"transform"in e}function Eh(e){return typeof e=="function"||e instanceof ru}function Hn(e){return!!e.useToken}function qn(e){return e.useValue!=null}function Nh(e){return tu(e)||qn(e)||Hn(e)||oa(e)}var sa=function(){function e(){this._registryMap=new Map}return e.prototype.entries=function(){return this._registryMap.entries()},e.prototype.getAll=function(t){return this.ensure(t),this._registryMap.get(t)},e.prototype.get=function(t){this.ensure(t);var r=this._registryMap.get(t);return r[r.length-1]||null},e.prototype.set=function(t,r){this.ensure(t),this._registryMap.get(t).push(r)},e.prototype.setAll=function(t,r){this._registryMap.set(t,r)},e.prototype.has=function(t){return this.ensure(t),this._registryMap.get(t).length>0},e.prototype.clear=function(){this._registryMap.clear()},e.prototype.ensure=function(t){this._registryMap.has(t)||this._registryMap.set(t,[])},e}(),Oh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),nu=function(){function e(){this.scopedResolutions=new Map}return e}();function _h(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function Th(e,t,r){return r===void 0&&(r=" "),or([e],t.message.split(`
|
|
89
89
|
`).map(function(i){return r+i})).join(`
|
|
90
|
-
`)}function Vh(e,t,r){var i=Fn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,a=_h(s,t);return Th("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function jh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Dh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),Mh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),$h=function(){function e(){this.preResolution=new Dh,this.postResolution=new Mh}return e}(),ou=new Map,Ph=function(){function e(t){this.parent=t,this._registry=new Oh,this.interceptors=new $h,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:qe.Transient}),this.ensureNotDisposed();var n;if(Nh(r)?n=r:n={useClass:r},Hn(n))for(var s=[t],a=n;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+or(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Hn(l.provider)?a=l.provider:a=null}if((i.lifecycle===qe.Singleton||i.lifecycle==qe.ContainerScoped||i.lifecycle==qe.ResolutionScoped)&&(qn(n)||oa(n)))throw new Error('Cannot use lifecycle "'+qe[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:n,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),jr(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(),jr(t)){if(jr(r))return this.register(t,{useToken:r},{lifecycle:qe.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:qe.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!jr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:qe.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new nu),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&jr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var n=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,n,"Single"),n}if(Eh(t)){var n=this.construct(t,r);return this.executePostResolutionInterceptor(t,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(t,r){var i,n;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Ln(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var n,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Ln(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){n={error:y}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===qe.Singleton,n=t.options.lifecycle===qe.ContainerScoped,s=i||n,a;return qn(t.provider)?a=t.provider.useValue:Hn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):tu(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):oa(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new nu),this.ensureNotDisposed();var n=this.getAllRegistrations(t);if(!n&&jr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),n){var s=n.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Ln(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Fn(n.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!qn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var n=Ln(this._registry.entries()),s=n.next();!s.done;s=n.next()){var a=Fn(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===qe.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===qe.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:i})},e.prototype.afterResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:i})},e.prototype.dispose=function(){return Sh(this,void 0,void 0,function(){var t;return xh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var n=i.dispose();n&&t.push(n)}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},e.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},e.prototype.construct=function(t,r){var i=this;if(t instanceof ru)return t.createProxy(function(s){return i.resolve(s,r)});var n=function(){var s=ou.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,or([void 0],a)))}();return jh(n)&&this.disposables.add(n),n},e.prototype.resolveParams=function(t,r){var i=this;return function(n,s){var a,c,l;try{return Ih(n)?iu(n)?n.multiple?(a=i.resolve(n.transform)).transform.apply(a,or([i.resolveAll(n.token)],n.transformArgs)):(c=i.resolve(n.transform)).transform.apply(c,or([i.resolve(n.token,t)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,t):iu(n)?(l=i.resolve(n.transform,t)).transform.apply(l,or([i.resolve(n.token,t)],n.transformArgs)):i.resolve(n,t)}catch(d){throw new Error(Vh(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}(),rt=new Ph;function aa(){return function(e){ou.set(e,Bh(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 ca;class Kn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:m.ObjectIdentifier})],Kn.prototype,"attrId",void 0),u([f({type:m.Any,repeated:"set"})],Kn.prototype,"attrValues",void 0);let su=ca=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ca.prototype)}};su=ca=u([V({type:T.Sequence,itemType:Kn})],su);var la;let au=la=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,la.prototype)}};au=la=u([V({type:T.Sequence,itemType:Ir})],au);class cu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],cu.prototype,"certId",void 0),u([f({type:m.Any,context:0})],cu.prototype,"certValue",void 0);class lu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],lu.prototype,"crlId",void 0),u([f({type:m.Any,context:0})],lu.prototype,"crltValue",void 0);class uu extends ae{}let zn=class{constructor(t={}){this.encryptionAlgorithm=new H,this.encryptedData=new uu,Object.assign(this,t)}};u([f({type:H})],zn.prototype,"encryptionAlgorithm",void 0),u([f({type:uu})],zn.prototype,"encryptedData",void 0);var ua,da;(function(e){e[e.v1=0]="v1"})(da||(da={}));class du extends ae{}let fa=ua=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ua.prototype)}};fa=ua=u([V({type:T.Sequence,itemType:It})],fa);class wi{constructor(t={}){this.version=da.v1,this.privateKeyAlgorithm=new H,this.privateKey=new du,Object.assign(this,t)}}u([f({type:m.Integer})],wi.prototype,"version",void 0),u([f({type:H})],wi.prototype,"privateKeyAlgorithm",void 0),u([f({type:du})],wi.prototype,"privateKey",void 0),u([f({type:fa,implicit:!0,context:0,optional:!0})],wi.prototype,"attributes",void 0);let fu=class extends wi{};fu=u([V({type:T.Sequence})],fu);let pu=class extends zn{};pu=u([V({type:T.Sequence})],pu);class hu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],hu.prototype,"secretTypeId",void 0),u([f({type:m.Any,context:0})],hu.prototype,"secretValue",void 0);class vi{constructor(t={}){this.mac=new Rn,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:Rn})],vi.prototype,"mac",void 0),u([f({type:ae})],vi.prototype,"macSalt",void 0),u([f({type:m.Integer,defaultValue:1})],vi.prototype,"iterations",void 0);class Gn{constructor(t={}){this.version=3,this.authSafe=new Ir,this.macData=new vi,Object.assign(this,t)}}u([f({type:m.Integer})],Gn.prototype,"version",void 0),u([f({type:Ir})],Gn.prototype,"authSafe",void 0),u([f({type:vi,optional:!0})],Gn.prototype,"macData",void 0);var pa;class Wn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Wn.prototype,"bagId",void 0),u([f({type:m.Any,context:0})],Wn.prototype,"bagValue",void 0),u([f({type:Kn,repeated:"set",optional:!0})],Wn.prototype,"bagAttributes",void 0);let yu=pa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,pa.prototype)}};yu=pa=u([V({type:T.Sequence,itemType:Wn})],yu);var ha,ya,ga;const gu="1.2.840.113549.1.9",mu=`${gu}.7`,ma=`${gu}.14`;let Jn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:m.IA5String})],Jn.prototype,"ia5String",void 0),Jn=u([V({type:T.Choice})],Jn);let bu=class extends Ir{};bu=u([V({type:T.Sequence})],bu);let wu=class extends Gn{};wu=u([V({type:T.Sequence})],wu);let vu=class extends zn{};vu=u([V({type:T.Sequence})],vu);let ba=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.IA5String})],ba.prototype,"value",void 0),ba=u([V({type:T.Choice})],ba);let ku=class extends Jn{};ku=u([V({type:T.Choice})],ku);let Cu=class extends Oe{};Cu=u([V({type:T.Choice})],Cu);let wa=class{constructor(t=new Date){this.value=t}};u([f({type:m.GeneralizedTime})],wa.prototype,"value",void 0),wa=u([V({type:T.Choice})],wa);let Su=class extends Oe{};Su=u([V({type:T.Choice})],Su);let va=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],va.prototype,"value",void 0),va=u([V({type:T.Choice})],va);let Yn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],Yn.prototype,"value",void 0),Yn=u([V({type:T.Choice})],Yn);let xu=class extends Yn{};xu=u([V({type:T.Choice})],xu);let Au=class extends Oe{};Au=u([V({type:T.Choice})],Au);let ka=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.ObjectIdentifier})],ka.prototype,"value",void 0),ka=u([V({type:T.Choice})],ka);let Bu=class extends _e{};Bu=u([V({type:T.Choice})],Bu);let Ca=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:m.Integer})],Ca.prototype,"value",void 0),Ca=u([V({type:T.Choice})],Ca);let Iu=class extends yt{};Iu=u([V({type:T.Sequence})],Iu);let Zn=class extends Oe{};Zn=u([V({type:T.Choice})],Zn);let Eu=ha=class extends er{constructor(t){super(t),Object.setPrototypeOf(this,ha.prototype)}};Eu=ha=u([V({type:T.Sequence})],Eu);let Nu=ya=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ya.prototype)}};Nu=ya=u([V({type:T.Set,itemType:Sr})],Nu);let Sa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.BmpString})],Sa.prototype,"value",void 0),Sa=u([V({type:T.Choice})],Sa);let xa=class extends H{};xa=u([V({type:T.Sequence})],xa);let Ou=ga=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Ou=ga=u([V({type:T.Sequence,itemType:xa})],Ou);var Aa;let Qn=Aa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Aa.prototype)}};Qn=Aa=u([V({type:T.Sequence,itemType:It})],Qn);class Dr{constructor(t={}){this.version=0,this.subject=new we,this.subjectPKInfo=new Et,this.attributes=new Qn,Object.assign(this,t)}}u([f({type:m.Integer})],Dr.prototype,"version",void 0),u([f({type:we})],Dr.prototype,"subject",void 0),u([f({type:Et})],Dr.prototype,"subjectPKInfo",void 0),u([f({type:Qn,implicit:!0,context:0})],Dr.prototype,"attributes",void 0);class ki{constructor(t={}){this.certificationRequestInfo=new Dr,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Dr})],ki.prototype,"certificationRequestInfo",void 0),u([f({type:H})],ki.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],ki.prototype,"signature",void 0);/*!
|
|
90
|
+
`)}function Vh(e,t,r){var i=Fn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,a=_h(s,t);return Th("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function jh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Dh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),$h=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),Mh=function(){function e(){this.preResolution=new Dh,this.postResolution=new $h}return e}(),ou=new Map,Ph=function(){function e(t){this.parent=t,this._registry=new Oh,this.interceptors=new Mh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:qe.Transient}),this.ensureNotDisposed();var n;if(Nh(r)?n=r:n={useClass:r},Hn(n))for(var s=[t],a=n;a!=null;){var l=a.useToken;if(s.includes(l))throw new Error("Token registration cycle detected! "+or(s,[l]).join(" -> "));s.push(l);var c=this._registry.get(l);c&&Hn(c.provider)?a=c.provider:a=null}if((i.lifecycle===qe.Singleton||i.lifecycle==qe.ContainerScoped||i.lifecycle==qe.ResolutionScoped)&&(qn(n)||oa(n)))throw new Error('Cannot use lifecycle "'+qe[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:n,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),jr(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(),jr(t)){if(jr(r))return this.register(t,{useToken:r},{lifecycle:qe.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:qe.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!jr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:qe.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new nu),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&jr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var n=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,n,"Single"),n}if(Eh(t)){var n=this.construct(t,r);return this.executePostResolutionInterceptor(t,n,"Single"),n}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(t,r){var i,n;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Ln(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){i={error:d}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var n,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var l=Ln(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,i)}}catch(y){n={error:y}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===qe.Singleton,n=t.options.lifecycle===qe.ContainerScoped,s=i||n,a;return qn(t.provider)?a=t.provider.useValue:Hn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):tu(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):oa(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new nu),this.ensureNotDisposed();var n=this.getAllRegistrations(t);if(!n&&jr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),n){var s=n.map(function(l){return i.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 i=Ln(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Fn(n.value,2),a=s[0],l=s[1];this._registry.setAll(a,l.filter(function(c){return!qn(c.provider)}).map(function(c){return c.instance=void 0,c}))}}catch(c){t={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var n=Ln(this._registry.entries()),s=n.next();!s.done;s=n.next()){var a=Fn(s.value,2),l=a[0],c=a[1];c.some(function(d){var y=d.options;return y.lifecycle===qe.ContainerScoped})&&i._registry.setAll(l,c.map(function(d){return d.options.lifecycle===qe.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:i})},e.prototype.afterResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:i})},e.prototype.dispose=function(){return Sh(this,void 0,void 0,function(){var t;return xh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var n=i.dispose();n&&t.push(n)}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},e.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},e.prototype.construct=function(t,r){var i=this;if(t instanceof ru)return t.createProxy(function(s){return i.resolve(s,r)});var n=function(){var s=ou.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,or([void 0],a)))}();return jh(n)&&this.disposables.add(n),n},e.prototype.resolveParams=function(t,r){var i=this;return function(n,s){var a,l,c;try{return Ih(n)?iu(n)?n.multiple?(a=i.resolve(n.transform)).transform.apply(a,or([i.resolveAll(n.token)],n.transformArgs)):(l=i.resolve(n.transform)).transform.apply(l,or([i.resolve(n.token,t)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,t):iu(n)?(c=i.resolve(n.transform,t)).transform.apply(c,or([i.resolve(n.token,t)],n.transformArgs)):i.resolve(n,t)}catch(d){throw new Error(Vh(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}(),rt=new Ph;function aa(){return function(e){ou.set(e,Bh(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 la;class Kn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:m.ObjectIdentifier})],Kn.prototype,"attrId",void 0),u([f({type:m.Any,repeated:"set"})],Kn.prototype,"attrValues",void 0);let su=la=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,la.prototype)}};su=la=u([V({type:T.Sequence,itemType:Kn})],su);var ca;let au=ca=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ca.prototype)}};au=ca=u([V({type:T.Sequence,itemType:Ir})],au);class lu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],lu.prototype,"certId",void 0),u([f({type:m.Any,context:0})],lu.prototype,"certValue",void 0);class cu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],cu.prototype,"crlId",void 0),u([f({type:m.Any,context:0})],cu.prototype,"crltValue",void 0);class uu extends ae{}let zn=class{constructor(t={}){this.encryptionAlgorithm=new H,this.encryptedData=new uu,Object.assign(this,t)}};u([f({type:H})],zn.prototype,"encryptionAlgorithm",void 0),u([f({type:uu})],zn.prototype,"encryptedData",void 0);var ua,da;(function(e){e[e.v1=0]="v1"})(da||(da={}));class du extends ae{}let fa=ua=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ua.prototype)}};fa=ua=u([V({type:T.Sequence,itemType:It})],fa);class wi{constructor(t={}){this.version=da.v1,this.privateKeyAlgorithm=new H,this.privateKey=new du,Object.assign(this,t)}}u([f({type:m.Integer})],wi.prototype,"version",void 0),u([f({type:H})],wi.prototype,"privateKeyAlgorithm",void 0),u([f({type:du})],wi.prototype,"privateKey",void 0),u([f({type:fa,implicit:!0,context:0,optional:!0})],wi.prototype,"attributes",void 0);let fu=class extends wi{};fu=u([V({type:T.Sequence})],fu);let pu=class extends zn{};pu=u([V({type:T.Sequence})],pu);class hu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],hu.prototype,"secretTypeId",void 0),u([f({type:m.Any,context:0})],hu.prototype,"secretValue",void 0);class vi{constructor(t={}){this.mac=new Rn,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:Rn})],vi.prototype,"mac",void 0),u([f({type:ae})],vi.prototype,"macSalt",void 0),u([f({type:m.Integer,defaultValue:1})],vi.prototype,"iterations",void 0);class Gn{constructor(t={}){this.version=3,this.authSafe=new Ir,this.macData=new vi,Object.assign(this,t)}}u([f({type:m.Integer})],Gn.prototype,"version",void 0),u([f({type:Ir})],Gn.prototype,"authSafe",void 0),u([f({type:vi,optional:!0})],Gn.prototype,"macData",void 0);var pa;class Wn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Wn.prototype,"bagId",void 0),u([f({type:m.Any,context:0})],Wn.prototype,"bagValue",void 0),u([f({type:Kn,repeated:"set",optional:!0})],Wn.prototype,"bagAttributes",void 0);let yu=pa=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,pa.prototype)}};yu=pa=u([V({type:T.Sequence,itemType:Wn})],yu);var ha,ya,ga;const gu="1.2.840.113549.1.9",mu=`${gu}.7`,ma=`${gu}.14`;let Jn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:m.IA5String})],Jn.prototype,"ia5String",void 0),Jn=u([V({type:T.Choice})],Jn);let bu=class extends Ir{};bu=u([V({type:T.Sequence})],bu);let wu=class extends Gn{};wu=u([V({type:T.Sequence})],wu);let vu=class extends zn{};vu=u([V({type:T.Sequence})],vu);let ba=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.IA5String})],ba.prototype,"value",void 0),ba=u([V({type:T.Choice})],ba);let ku=class extends Jn{};ku=u([V({type:T.Choice})],ku);let Cu=class extends Oe{};Cu=u([V({type:T.Choice})],Cu);let wa=class{constructor(t=new Date){this.value=t}};u([f({type:m.GeneralizedTime})],wa.prototype,"value",void 0),wa=u([V({type:T.Choice})],wa);let Su=class extends Oe{};Su=u([V({type:T.Choice})],Su);let va=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],va.prototype,"value",void 0),va=u([V({type:T.Choice})],va);let Yn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],Yn.prototype,"value",void 0),Yn=u([V({type:T.Choice})],Yn);let xu=class extends Yn{};xu=u([V({type:T.Choice})],xu);let Au=class extends Oe{};Au=u([V({type:T.Choice})],Au);let ka=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.ObjectIdentifier})],ka.prototype,"value",void 0),ka=u([V({type:T.Choice})],ka);let Bu=class extends _e{};Bu=u([V({type:T.Choice})],Bu);let Ca=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:m.Integer})],Ca.prototype,"value",void 0),Ca=u([V({type:T.Choice})],Ca);let Iu=class extends yt{};Iu=u([V({type:T.Sequence})],Iu);let Zn=class extends Oe{};Zn=u([V({type:T.Choice})],Zn);let Eu=ha=class extends er{constructor(t){super(t),Object.setPrototypeOf(this,ha.prototype)}};Eu=ha=u([V({type:T.Sequence})],Eu);let Nu=ya=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ya.prototype)}};Nu=ya=u([V({type:T.Set,itemType:Sr})],Nu);let Sa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.BmpString})],Sa.prototype,"value",void 0),Sa=u([V({type:T.Choice})],Sa);let xa=class extends H{};xa=u([V({type:T.Sequence})],xa);let Ou=ga=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Ou=ga=u([V({type:T.Sequence,itemType:xa})],Ou);var Aa;let Qn=Aa=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Aa.prototype)}};Qn=Aa=u([V({type:T.Sequence,itemType:It})],Qn);class Dr{constructor(t={}){this.version=0,this.subject=new we,this.subjectPKInfo=new Et,this.attributes=new Qn,Object.assign(this,t)}}u([f({type:m.Integer})],Dr.prototype,"version",void 0),u([f({type:we})],Dr.prototype,"subject",void 0),u([f({type:Et})],Dr.prototype,"subjectPKInfo",void 0),u([f({type:Qn,implicit:!0,context:0})],Dr.prototype,"attributes",void 0);class ki{constructor(t={}){this.certificationRequestInfo=new Dr,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Dr})],ki.prototype,"certificationRequestInfo",void 0),u([f({type:H})],ki.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],ki.prototype,"signature",void 0);/*!
|
|
91
91
|
* MIT License
|
|
92
92
|
*
|
|
93
93
|
* Copyright (c) Peculiar Ventures. All rights reserved.
|
|
@@ -110,39 +110,39 @@ ${t.join(`
|
|
|
110
110
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
111
111
|
* SOFTWARE.
|
|
112
112
|
*
|
|
113
|
-
*/const Xn="crypto.algorithm";class Rh{getAlgorithms(){return rt.resolveAll(Xn)}toAsnAlgorithm(t){({...t});for(const r of this.getAlgorithms()){const i=r.toAsnAlgorithm(t);if(i)return i}if(/^[0-9.]+$/.test(t.name)){const r=new H({algorithm:t.name});if("parameters"in t){const i=t;r.parameters=i.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const i of this.getAlgorithms()){const n=i.toWebAlgorithm(t);if(n)return n}return{name:t.algorithm,parameters:t.parameters}}}const eo="crypto.algorithmProvider";rt.registerSingleton(eo,Rh);var to;const Ke="1.3.36.3.3.2.8.1.1",_u=`${Ke}.1`,Tu=`${Ke}.2`,Vu=`${Ke}.3`,ju=`${Ke}.4`,Du=`${Ke}.5
|
|
114
|
-
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let n=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),i.push(`${n}${t[ue.NAME]}:${s}`),n=this.pad(r);for(const
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=
|
|
116
|
-
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:P.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((r=t.headers)===null||r===void 0)&&r.length){for(const d of t.headers)n.push(`${d.key}: ${d.value}`);n.push("")}const s=L.ToBase64(t.rawData);let a,
|
|
117
|
-
`)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class _t extends Rt{static isAsnEncoded(t){return P.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Ze.isPem(r)?Ze.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):P.toArrayBuffer(t)}}constructor(...t){_t.isAsnEncoded(t[0])?super(_t.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class cr extends _t{constructor(t){_t.isAsnEncoded(t)?super(t,Et):super(t),this.tag=Ze.PublicKeyTag}async export(...t){let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};return t.length>1?(n=t[0]||n,i=t[1]||i,r=t[2]||Ye.get()):r=t[0]||Ye.get(),r.subtle.importKey("spki",this.rawData,n,!0,i)}onInit(t){const r=rt.resolve(eo),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Vr:{const n=G.parse(t.subjectPublicKey,ta),s=P.toUint8Array(n.modulus);i.publicExponent=P.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(t){t||(t=Ye.get());const r=G.parse(this.rawData,Et);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Et);switch(t.Algorithm=sr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case gi:t["EC Point"]=r.subjectPublicKey;break;case Vr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class bt{static register(t,r){this.items.set(t,r)}static create(t){const r=new mt(t),i=this.items.get(r.type);return i?new i(t):r}}bt.items=new Map;const io="crypto.signatureFormatter";class Qh{toAsnSignature(t,r){return P.toArrayBuffer(r)}toWebSignature(t,r){return P.toArrayBuffer(r)}}class no extends _t{constructor(t){_t.isAsnEncoded(t)?super(t,vr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Ut(r.subject),this.subject=new Ut(r.subject).toString(),this.issuerName=new Ut(r.issuer),this.issuer=this.issuerName.toString();const i=rt.resolve(eo);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const n=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;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=>bt.create(G.serialize(a)))),this.publicKey=new cr(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Ye.get()){let i,n;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],r);else if(s instanceof cr)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],r);else if(P.isBufferSource(s)){const d=new cr(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=rt.resolveAll(io).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,n,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Ye.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Ye.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,vr),i=r.tbsCertificate,n=new ue("",{Version:`${wr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":sr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Extensions=s}return t.Data=n,t.Signature=new ue("",{Algorithm:sr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}no.NAME="Certificate";class Bi extends mt{static async create(t,r=!1,i=Ye.get()){if(t instanceof no||ar.isCryptoKey(t)){const n=t instanceof no?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",n),c=await new cr(s).getKeyIdentifier(i);return new Bi(L.ToHex(c),r)}else return new Bi(t,r)}constructor(...t){if(P.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Xt({keyIdentifier:new Yo(L.FromHex(t[0]))});super(Jo,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Si?G.parse(r.name.rawData,Pe):r.name,n=new Xt({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Jo,t[1],G.serialize(n))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,Xt);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,Xt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Si(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Bi.NAME="Authority Key Identifier";class gd extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,nn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new nn({cA:t[0],pathLenConstraint:t[1]});super(ml,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}}gd.NAME="Basic Constraints";var md;(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"})(md||(md={}));class bd extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ln);this.usages=r.map(i=>i)}else{const r=new ln(t[0]);super(Sl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}bd.NAME="Extended Key Usages";var Va;(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"})(Va||(Va={}));class ja extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ds);this.usages=r.toNumber()}else{const r=new ds(t[0]);super(Al,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ds);return t[""]=r.toJSON().join(", "),t}}ja.NAME="Key Usages";class oo extends mt{static async create(t,r=!1,i=Ye.get()){let n;t instanceof cr?n=t.rawData:"publicKey"in t?n=t.publicKey.rawData:P.isBufferSource(t)?n=t:n=await i.subtle.exportKey("spki",t);const a=await new cr(n).getKeyIdentifier(i);return new oo(L.ToHex(a),r)}constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,Mt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new Mt(r);super(_l,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Mt);return t[""]=r,t}}oo.NAME="Subject Key Identifier";class Da extends mt{constructor(...t){P.isBufferSource(t[0])?super(t[0]):super(Nl,t[1],new Si(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,gs);this.names=new Si(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Da.NAME="Subject Alternative Name";class wd extends mt{constructor(...t){var r;if(P.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,an);this.policies=i.map(n=>n.policyIdentifier)}else{const i=t[0],n=(r=t[1])!==null&&r!==void 0?r:!1,s=new an(i.map(a=>new sn({policyIdentifier:a})));super(wl,n,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Pt.toString(r))),t}}wd.NAME="Certificate Policies",bt.register(wl,wd);class $r extends Rt{constructor(...t){let r;if(P.isBufferSource(t[0]))r=P.toArrayBuffer(t[0]);else{const i=t[0],n=Array.isArray(t[1])?t[1].map(s=>P.toArrayBuffer(s)):[];r=G.serialize(new It({type:i,values:n}))}super(r,It)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===$r.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}$r.NAME="Attribute";class vd extends $r{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=new Zn({printableString:t[0]});super(mu,[G.serialize(i)])}(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],Zn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}vd.NAME="Challenge Password";class Ma extends $r{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=t[0],n=new er;for(const s of i)n.push(G.parse(s.rawData,at));super(ma,[G.serialize(n)])}(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],er);this.items=r.map(i=>bt.create(G.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ue.NAME]]=i;return t}}Ma.NAME="Extensions";class so{static register(t,r){this.items.set(t,r)}static create(t){const r=new $r(t),i=this.items.get(r.type);return i?new i(t):r}}so.items=new Map;let $a=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 H({algorithm:Dn,parameters:null});case"sha-256":return new H({algorithm:Zs,parameters:null});case"sha-384":return new H({algorithm:Mn,parameters:null});case"sha-512":return new H({algorithm:$n,parameters:null})}}else return new H({algorithm:Vr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Vr:return{name:"RSASSA-PKCS1-v1_5"};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Zs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case $n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};$a=u([aa()],$a),rt.registerSingleton(Xn,$a);class it{addPadding(t,r){const i=P.toUint8Array(r),n=new Uint8Array(t);return n.set(i,t-i.length),n}removePadding(t,r=!1){let i=P.toUint8Array(t);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(r&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,n=it.namedCurveSize.get(i)||it.defaultNamedCurveSize,s=new jn,a=P.toUint8Array(r);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,jn),n=t.namedCurve,s=it.namedCurveSize.get(n)||it.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return hp(a,c)}return null}}it.namedCurveSize=new Map,it.defaultNamedCurveSize=32;const kd="1.3.101.110",Cd="1.3.101.111",Sd="1.3.101.112",xd="1.3.101.113";let Pa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Sd;break;case"ed448":r=xd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=kd;break;case"x448":r=Cd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Sd:return{name:"EdDSA",namedCurve:"Ed25519"};case xd:return{name:"EdDSA",namedCurve:"Ed448"};case kd:return{name:"ECDH-ES",namedCurve:"X25519"};case Cd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Pa=u([aa()],Pa),rt.registerSingleton(Xn,Pa);class Xh extends _t{constructor(t){_t.isAsnEncoded(t)?super(t,ki):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new cr(t.certificationRequestInfo.subjectPKInfo);const r=rt.resolve(eo);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(n=>so.create(G.serialize(n)));const i=this.getAttribute(ma);this.extensions=[],i instanceof Ma&&(this.extensions=i.items),this.subjectName=new Ut(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Ye.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),n=rt.resolveAll(io).reverse();let s=null;for(const c of n)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,ki),i=r.certificationRequestInfo,n=new ue("",{Version:`${wr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Attributes=s}return t.Data=n,t.Signature=new ue("",{Algorithm:sr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Xh.NAME="PKCS#10 Certificate Request";var Ad;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(Ad||(Ad={})),bt.register(ml,gd),bt.register(Sl,bd),bt.register(Al,ja),bt.register(_l,oo),bt.register(Jo,Bi),bt.register(Nl,Da),so.register(mu,vd),so.register(ma,Ma),rt.registerSingleton(io,Qh),rt.registerSingleton(io,it),it.namedCurveSize.set("P-256",32),it.namedCurveSize.set("K-256",32),it.namedCurveSize.set("P-384",48),it.namedCurveSize.set("P-521",66);function Bd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new no(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const n of r.extensions)if(n instanceof Da){const s=n.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(n instanceof ja){const s=Object.values(Va),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(n.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function ey(){const e=Bd(),t=o.ref({}),r=n=>{if(!(n.id in t.value))try{t.value[n.id]=e.parseMetaCertificateData(n.cert)}catch{t.value[n.id]=void 0}return t.value[n.id]};return{certificateDataCache:t,getCertificateData:n=>{const s=r(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 ty={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function ry(){const e=Di.createI18n("en-us",ty);return{i18n:e,i18nT:Di.i18nTComponent(e)}}const wt={useCertificate:ey,useI18n:ry,useX509:Bd},ao="/v2/control-planes/{controlPlaneId}/core-entities",co="/{workspace}",Ii={list:{konnect:`${ao}/certificates`,kongManager:`${co}/certificates`},form:{konnect:{create:`${ao}/certificates`,edit:`${ao}/certificates/{id}`,validate:`${ao}/v1/schemas/json/certificate/validate`},kongManager:{create:`${co}/certificates`,edit:`${co}/certificates/{id}`,validate:`${co}/schemas/certificates/validate`}}};var Ra=(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))(Ra||{}),lr=(e=>(e.Edit="edit",e.Create="create",e))(lr||{}),Lt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Lt||{}),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.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(ce||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function iy(){return{getAxiosInstance:(e={})=>{try{const t=o.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):oc.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),oc.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 ny(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ua="khcp-user-table-preferences",oy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function sy(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Ua));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const n=t();n.set(r,i),localStorage.setItem(Ua,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||oy},deleteAllTablePreferences:()=>{localStorage.removeItem(Ua)}}}function La(e={}){const{getAxiosInstance:t}=iy();return{axiosInstance:t(e)}}const ay={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},cy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ly={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},uy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},dy={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"}},fy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},py={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},hy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},yy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},gy={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"}},my={global:ay,deleteModal:cy,baseForm:ly,baseTable:uy,baseConfigCard:dy,filter:fy,debouncedFilter:py,errors:hy,validationErrors:yy,toggleModal:gy};function lo(){const e=Di.createI18n("en-us",my);return{i18n:e,i18nT:Di.i18nTComponent(e)}}function Id(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const n=new Set([...r,...i]);for(const s of n){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,n)=>{if(n){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,n)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=n[r]===void 0||n[r]===null?"":n[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(n[r])&&(a=n[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 by(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:n}=La(e.axiosRequestConfig),{i18n:{t:s}}=lo(),{debounce:a}=ny(),c=a(async S=>{await E(S)},200),l=o.ref(!1),d=o.ref(""),y=o.ref(""),p=o.ref([]),I=o.ref([]),w=o.ref(void 0),h=o.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:b}=Id(),k=async()=>{try{l.value=!0;const{data:S}=await n.get(`${g}?size=${r}`);S!=null&&S.next||(w.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[]),I.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},B=o.ref(""),E=async S=>{var C,A,M;if(B.value!==S)if(B.value=S||"",w.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let _=g+"";S&&(_+=`/${S}`);const{data:N}=await n.get(`${_}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(S){const _=[];b(S)&&i.searchKeys.includes("id")?_.push((async()=>{const{data:q}=await n.get(`${g}/${S}`);return[q[i.fetchedItemsKey]??q]})()):_.push(...i.searchKeys.filter(q=>q!=="id").map(async q=>{const{data:j}=await n.get(`${g}?${q}=${S}`);return j[i.fetchedItemsKey]}));const N=await Promise.all(_),re=new Set;p.value=[],(C=N==null?void 0:N.forEach)==null||C.call(N,q=>{var j;(j=q==null?void 0:q.forEach)==null||j.call(q,Z=>{re.has(Z.id)||(re.add(Z.id),p.value.push(Z))})})}else p.value=I.value}catch(_){((A=_==null?void 0:_.response)==null?void 0:A.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",S?(p.value=(M=w.value)==null?void 0:M.filter(_=>{var N;let re=!1;for(const q of i.searchKeys){const j=typeof _[q]=="string"?(N=_[q])==null?void 0:N.toLowerCase():_[q];j!=null&&j.includes(S.toLowerCase())&&(re=!0)}return re}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:w,loadItems:k,debouncedQueryChange:c}}function wy(e,t){const r=o.unref(t),i=o.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",n=>`${i.value.href}/${n}`}function vy(){const{i18n:{t:e}}=lo();return{getMessageFromError:t=>{var r,i,n,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((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((n=t.response.data.details)!=null&&n.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).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 ky(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),n=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!s&&new URL(n))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Ed(e,t){const r=o.ref(o.unref(e)),i=o.ref(o.unref(t)),n=o.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=o.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let w=new URL(s.value.href);return n.value&&I?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${I}/`):new URL(`${w.href}?filter[name][contains]=${I}`)):(n.value||new URLSearchParams(I).forEach((h,g)=>{w.searchParams.append(g,h)}),y&&w.searchParams.append("sort_by",y),p==="desc"&&w.searchParams.append("sort_desc","1"),w.searchParams.append("size",String(l))),d&&c!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),i.value}}}function Cy(e,t,r="data"){const i=o.unref(t),{axiosInstance:n}=La(e.axiosRequestConfig),s=Ed(e,i),a=o.ref({status:Lt.Idle});return{fetcher:async c=>{var l;try{a.value={status:Lt.Loading};let d=s(c);d.includes("filter[name]")&&(d=`${d}&page[size]=${c.pageSize}&page[number]=${c.page}`);const y=await n.get(d);if(y.status>=400)throw y;const p=y.data,I=r&&r.replace(/[^\w-_]/gi,"");let w;p[I]&&Array.isArray(p[I])?w=p[I]:Array.isArray(p)?w=p:w=Object.keys(p).length?[p]:[];const h={data:w,total:w.length,...p.offset?{pagination:{offset:p.offset}}:null};return a.value={status:Lt.Idle,response:h},h}catch(d){const y={data:[],total:0};return c.query&&(((l=d.response)==null?void 0:l.status)===404||d.status===404)?(a.value={status:Lt.NoResults,response:y,error:d.response?d:{response:d}},y):(a.value={status:Lt.Error,response:y,error:d.response?d:{response:d}},y)}},fetcherState:a}}function Sy(){const e=(r,i="_")=>r?r.split(i).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Nd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Od=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Nd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},_d=e=>e==="*"||e==="x"||e==="X",Td=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},xy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Ay=(e,t)=>{if(_d(e)||_d(t))return 0;const[r,i]=xy(Td(e),Td(t));return r>i?1:r<i?-1:0},Vd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Ay(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},By=(e,t)=>{const r=Od(e),i=Od(t),n=r.pop(),s=i.pop(),a=Vd(r,i);return a!==0?a:n&&s?Vd(n.split("."),s.split(".")):n||s?n?-1:1:0},jd=(e,t,r)=>{Iy(r);const i=By(e,t);return Dd[r].includes(i)},Dd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Md=Object.keys(Dd),Iy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Md.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Md.join("|")}`)},Ey=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Nd.test(e);function Ny(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:n}=t;if(!Ey(n))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&jd(n,a,"<")||c&&jd(n,c,">"))}function Oy(e){const t=o.ref(0),r=o.ref(0),i=o.ref(!1);return o.watch(e,n=>{n&&!i.value&&(t.value=n.offsetWidth,r.value=n.scrollWidth,i.value=!0)}),{isTruncated:o.computed(()=>t.value<r.value)}}function _y(){const{i18n:{t:e}}=lo();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Be={useAxios:La,useDebouncedFilter:by,useDeleteUrlBuilder:wy,useErrors:vy,useExternalLinkCreator:ky,useFetcher:Cy,useFetchUrlBuilder:Ed,useHelpers:Id,useStringHelpers:Sy,useI18n:lo,useGatewayFeatureSupported:Ny,useTruncationDetector:Oy,useValidators:_y},Ty={key:0,class:"config-card-fieldset-title"},Vy=o.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Be.useI18n(),{convertKeyToTitle:i}=Be.useStringHelpers(),n=o.computed(()=>t.item.key??"json-array-item"),s=o.computed(()=>t.item.value??t.item),a=o.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=o.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:o.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:o.withCtx(()=>[e.isArrayItem?(o.openBlock(),o.createElementBlock("legend",Ty,[o.createElementVNode("b",null,o.toDisplayString(c.value),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(a.value),(y,p)=>(o.openBlock(),o.createBlock(uo,{key:`${n.value}-property-${p}`,item:{key:y,label:o.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),lt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},$d=lt(Vy,[["__scopeId","data-v-68ca83ec"]]),jy=o.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KButton");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.value||o.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Dy=lt(jy,[["__scopeId","data-v-c96811e5"]]),My=o.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KBadge");return o.openBlock(),o.createBlock(n,{appearance:e.status?"success":"neutral"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.status?o.unref(t)("baseConfigCard.statusBadge.enabledLabel"):o.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),$y="#0044f4",Py="#e0e4ea",Ry="#3a3f51",Uy="#afb7c5",Ly="1px",Fy="20px",Hy={class:"config-card-details-row"},qy=["data-testid"],Ky=["data-testid"],zy=["data-testid"],Gy=["data-testid"],Wy={key:1},Jy=["data-testid"],Yy=["data-testid"],Zy=["data-testid"],Qy=["data-testid"],Xy={name:"ConfigCardItem",components:{JsonCardItem:$d,StatusBadge:My,InternalLinkItem:Dy}},eg=o.defineComponent({...Xy,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}){o.useCssVars(h=>({"07753575":y.value?"none":`solid ${o.unref(Ly)} ${o.unref(Py)}`,"32d44ea8":d.value&&c.value?"block":"flex","5036b738":d.value&&c.value?"100%":r.slim?"50%":"25%","5038fd13":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,n=o.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Be.useI18n(),c=o.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=o.computed(()=>!!(r.item.tooltip||n["label-tooltip"])),d=o.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=o.computed(()=>r.item.type===ce.JsonArray),p=o.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.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=>{i("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}}}),I=o.ref(),{isTruncated:w}=Be.useTruncationDetector(I);return(h,g)=>{const b=o.resolveComponent("KLabel"),k=o.resolveComponent("KBadge"),B=o.resolveComponent("KCopy"),E=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("div",Hy,[o.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[o.renderSlot(h.$slots,"label",{item:e.item},()=>[o.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},o.createSlots({default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:o.withCtx(()=>[o.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[o.renderSlot(h.$slots,"label-tooltip",{},()=>[o.createTextVNode(o.toDisplayString(e.item.tooltip),1)],!0)],8,Ky)]),key:"0"}:void 0]),1024)],!0)],8,qy),o.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[o.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(o.openBlock(),o.createElementBlock("div",Wy,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.value.tag),o.normalizeProps(o.guardReactiveProps(p.value.attrs)),{default:o.withCtx(()=>[p.value.additionalComponent==="KBadge"?(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(k,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:S,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Jy)):o.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(B,o.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,text:S}),null,16,["data-testid","text"]))),128))],8,Yy)):p.value.additionalComponent==="KMethodBadge"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(k,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(o.unref(lp.BadgeMethodAppearances)).includes(S.toLowerCase())?S.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Zy)):o.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(o.openBlock(),o.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock($d,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:S},null,8,["index","item"]))),128))],8,Qy)):(o.openBlock(),o.createBlock(E,{key:4,text:o.unref(w)?e.item.value:""},{default:o.withCtx(()=>[o.createElementVNode("span",{ref_key:"textContent",ref:I,class:o.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},o.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Gy))],!0)],8,zy)])}}}),uo=lt(eg,[["__scopeId","data-v-d056663c"]]),tg={class:"json-config"},rg={key:0,class:"json-endpoint"},Pd=o.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){o.useCssVars(n=>({"4520e3ec":`${i.value}ch`}));const t=e,r=o.computed(()=>t.jsonRecord),i=o.computed(()=>{var n;if(!t.fetcherUrl)return 0;const s=(n=t.fetcherUrl)==null?void 0:n.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(n,s)=>{const a=o.resolveComponent("KBadge"),c=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",tg,[t.fetcherUrl?(o.openBlock(),o.createElementBlock("div",rg,[o.createVNode(a,{appearance:t.requestMethod},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),o.createVNode(c,{id:"json-endpoint-codeblock",code:t.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):o.createCommentVNode("",!0),t.jsonRecord?(o.openBlock(),o.createBlock(c,{key:1,id:"json-codeblock",class:o.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):o.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Rd(e){return typeof e>"u"||e===null}function ig(e){return typeof e=="object"&&e!==null}function ng(e){return Array.isArray(e)?e:Rd(e)?[]:[e]}function og(e,t){var r,i,n,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)n=s[r],e[n]=t[n];return e}function sg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function ag(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var cg=Rd,lg=ig,ug=ng,dg=sg,fg=ag,pg=og,ke={isNothing:cg,isObject:lg,toArray:ug,repeat:dg,isNegativeZero:fg,extend:pg};function Ud(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
113
|
+
*/const Xn="crypto.algorithm";class Rh{getAlgorithms(){return rt.resolveAll(Xn)}toAsnAlgorithm(t){({...t});for(const r of this.getAlgorithms()){const i=r.toAsnAlgorithm(t);if(i)return i}if(/^[0-9.]+$/.test(t.name)){const r=new H({algorithm:t.name});if("parameters"in t){const i=t;r.parameters=i.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const i of this.getAlgorithms()){const n=i.toWebAlgorithm(t);if(n)return n}return{name:t.algorithm,parameters:t.parameters}}}const eo="crypto.algorithmProvider";rt.registerSingleton(eo,Rh);var to;const Ke="1.3.36.3.3.2.8.1.1",_u=`${Ke}.1`,Tu=`${Ke}.2`,Vu=`${Ke}.3`,ju=`${Ke}.4`,Du=`${Ke}.5`,$u=`${Ke}.6`,Mu=`${Ke}.7`,Pu=`${Ke}.8`,Ru=`${Ke}.9`,Uu=`${Ke}.10`,Lu=`${Ke}.11`,Fu=`${Ke}.12`,Hu=`${Ke}.13`,qu=`${Ke}.14`,Ku="brainpoolP160r1",zu="brainpoolP160t1",Gu="brainpoolP192r1",Wu="brainpoolP192t1",Ju="brainpoolP224r1",Yu="brainpoolP224t1",Zu="brainpoolP256r1",Qu="brainpoolP256t1",Xu="brainpoolP320r1",ed="brainpoolP320t1",td="brainpoolP384r1",rd="brainpoolP384t1",id="brainpoolP512r1",nd="brainpoolP512t1",ye="ECDSA";let Ci=to=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case ye.toLowerCase():if("hash"in t)switch((typeof t.hash=="string"?t.hash:t.hash.name).toLowerCase()){case"sha-1":return ch;case"sha-256":return uh;case"sha-384":return dh;case"sha-512":return fh}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Hc;break;case"K-256":r=to.SECP256K1;break;case"P-384":r=qc;break;case"P-521":r=Kc;break;case Ku:r=_u;break;case zu:r=Tu;break;case Gu:r=Vu;break;case Wu:r=ju;break;case Ju:r=Du;break;case Yu:r=$u;break;case Zu:r=Mu;break;case Qu:r=Pu;break;case Xu:r=Ru;break;case ed:r=Uu;break;case td:r=Lu;break;case rd:r=Fu;break;case id:r=Hu;break;case nd:r=qu;break}if(r)return new H({algorithm:gi,parameters:G.serialize(new Tr({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Gs:return{name:ye,hash:{name:"SHA-1"}};case Ws:return{name:ye,hash:{name:"SHA-256"}};case Js:return{name:ye,hash:{name:"SHA-384"}};case Ys:return{name:ye,hash:{name:"SHA-512"}};case gi:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(G.parse(t.parameters,Tr).namedCurve){case Hc:return{name:ye,namedCurve:"P-256"};case to.SECP256K1:return{name:ye,namedCurve:"K-256"};case qc:return{name:ye,namedCurve:"P-384"};case Kc:return{name:ye,namedCurve:"P-521"};case _u:return{name:ye,namedCurve:Ku};case Tu:return{name:ye,namedCurve:zu};case Vu:return{name:ye,namedCurve:Gu};case ju:return{name:ye,namedCurve:Wu};case Du:return{name:ye,namedCurve:Ju};case $u:return{name:ye,namedCurve:Yu};case Mu:return{name:ye,namedCurve:Zu};case Pu:return{name:ye,namedCurve:Qu};case Ru:return{name:ye,namedCurve:Xu};case Uu:return{name:ye,namedCurve:ed};case Lu:return{name:ye,namedCurve:td};case Fu:return{name:ye,namedCurve:rd};case Hu:return{name:ye,namedCurve:id};case qu:return{name:ye,namedCurve:nd}}}}return null}};Ci.SECP256K1="1.3.132.0.10",Ci=to=u([aa()],Ci),rt.registerSingleton(Xn,Ci);const od=Symbol("name"),sd=Symbol("value");class ue{constructor(t,r={},i=""){this[od]=t,this[sd]=i;for(const n in r)this[n]=r[n]}}ue.NAME=od,ue.VALUE=sd;class Uh{static toTextObject(t){const r=new ue("Algorithm Identifier",{},Pt.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case gi:{const i=new Ci().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class Pt{static toString(t){const r=this.items[t];return r||t}}Pt.items={[Wc]:"sha1",[Jc]:"sha224",[Yc]:"sha256",[Zc]:"sha384",[Qc]:"sha512",[Vr]:"rsaEncryption",[Dn]:"sha1WithRSAEncryption",[bh]:"sha224WithRSAEncryption",[Zs]:"sha256WithRSAEncryption",[$n]:"sha384WithRSAEncryption",[Mn]:"sha512WithRSAEncryption",[gi]:"ecPublicKey",[Gs]:"ecdsaWithSHA1",[Fc]:"ecdsaWithSHA224",[Ws]:"ecdsaWithSHA256",[Js]:"ecdsaWithSHA384",[Ys]:"ecdsaWithSHA512",[rh]:"TLS WWW server authentication",[ih]:"TLS WWW client authentication",[nh]:"Code Signing",[oh]:"E-mail Protection",[sh]:"Time Stamping",[ah]:"OCSP Signing",[lh]:"Signed Data"};class sr{static serialize(t){return this.serializeObj(t).join(`
|
|
114
|
+
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let n=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),i.push(`${n}${t[ue.NAME]}:${s}`),n=this.pad(r);for(const l in t){if(typeof l=="symbol")continue;const c=t[l],d=l?`${l}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")i.push(`${n}${d}${c}`);else if(c instanceof Date)i.push(`${n}${d}${c.toUTCString()}`);else if(Array.isArray(c))for(const y of c)y[ue.NAME]=l,i.push(...this.serializeObj(y,r));else if(c instanceof ue)c[ue.NAME]=l,i.push(...this.serializeObj(c,r));else if(P.isBufferSource(c))l?(i.push(`${n}${d}`),i.push(...this.serializeBufferSource(c,r+1))):i.push(...this.serializeBufferSource(c,r));else if("toTextObject"in c){const y=c.toTextObject();y[ue.NAME]=l,i.push(...this.serializeObj(y,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(t,r=0){const i=this.pad(r),n=P.toUint8Array(t),s=[];for(let a=0;a<n.length;){const l=[];for(let c=0;c<16&&a<n.length;c++){c===8&&l.push("");const d=n[a++].toString(16).padStart(2,"0");l.push(d)}s.push(`${i}${l.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}sr.oidSerializer=Pt,sr.algorithmSerializer=Uh;class Rt{constructor(...t){if(t.length===1){const r=t[0];this.rawData=G.serialize(r),this.onInit(r)}else{const r=G.parse(t[0],t[1]);this.rawData=P.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Rt?ll(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return G.toString(this.rawData);case"text":return sr.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const t=this.toTextObjectEmpty();return t[""]=this.rawData,t}toTextObjectEmpty(t){return new ue(this.getTextName(),{},t)}}Rt.NAME="ASN";class mt extends Rt{constructor(...t){let r;P.isBufferSource(t[0])?r=P.toArrayBuffer(t[0]):r=G.serialize(new at({extnID:t[0],critical:t[1],extnValue:new ae(P.toArrayBuffer(t[2]))})),super(r,at)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[ue.NAME]===mt.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}var ad;class ar{static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&t.extractable!==void 0}constructor(){this.items=new Map,this[ad]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(ar.DEFAULT,crypto)}clear(){this.items.clear()}delete(t){return this.items.delete(t)}forEach(t,r){return this.items.forEach(t,r)}has(t){return this.items.has(t)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(t=ar.DEFAULT){const r=this.items.get(t.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${t}'`);return r}set(t,r){if(typeof t=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(t.toLowerCase(),r)}else this.items.set(ar.DEFAULT,t);return this}}ad=Symbol.toStringTag,ar.DEFAULT="default";const Ye=new ar,Lh=/^[0-2](?:\.[1-9][0-9]*)+$/;function Fh(e){return new RegExp(Lh).test(e)}class ld{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Fh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const ze=new ld;ze.register("CN","2.5.4.3"),ze.register("L","2.5.4.7"),ze.register("ST","2.5.4.8"),ze.register("O","2.5.4.10"),ze.register("OU","2.5.4.11"),ze.register("C","2.5.4.6"),ze.register("DC","0.9.2342.19200300.100.1.25"),ze.register("E","1.2.840.113549.1.9.1"),ze.register("G","2.5.4.42"),ze.register("I","2.5.4.43"),ze.register("SN","2.5.4.4"),ze.register("T","2.5.4.12");function Hh(e,t){return`\\${L.ToHex(L.FromUtf8String(t)).toUpperCase()}`}function qh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Hh)}class Ut{static isASCII(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return!1;return!0}static isPrintableString(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(t)}constructor(t,r={}){this.extraNames=new ld,this.asn=new we;for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)){const n=r[i];this.extraNames.register(i,n)}typeof t=="string"?this.asn=this.fromString(t):t instanceof we?this.asn=t:P.isBufferSource(t)?this.asn=G.parse(t,we):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||ze.findId(t),i=[];for(const n of this.asn)for(const s of n)s.type===r&&i.push(s.value.toString());return i}getName(t){return this.extraNames.get(t)||ze.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,n=r.value.anyValue?`#${L.ToHex(r.value.anyValue)}`:qh(r.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const i of this.asn){const n={};for(const s of i){const a=this.getName(s.type)||s.type;(t=n[a])!==null&&t!==void 0||(n[a]=[]),n[a].push(s.value.anyValue?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(n)}return r}fromString(t){const r=new we,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${t},`);){let[,a,l]=n;const c=l[l.length-1];(c===","||c==="+")&&(l=l.slice(0,l.length-1),n[3]=c);const d=n[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const y=new ei({type:a});if(l.charAt(0)==="#")y.value.anyValue=L.FromHex(l.slice(1));else{const p=/"(.*?[^\\])?"/.exec(l);p&&(l=p[1]),l=l.replace(/\\0a/ig,`
|
|
115
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=l:Ut.isPrintableString(l)?y.value.printableString=l:y.value.utf8String=l}s==="+"?r[r.length-1].push(y):r.push(new gr([y])),s=d}return r}fromJSON(t){const r=new we;for(const i of t){const n=new gr;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const l=i[s];for(const c of l){const d=new ei({type:a});if(typeof c=="object")for(const y in c)switch(y){case"ia5String":d.value.ia5String=c[y];break;case"utf8String":d.value.utf8String=c[y];break;case"universalString":d.value.universalString=c[y];break;case"bmpString":d.value.bmpString=c[y];break;case"printableString":d.value.printableString=c[y];break}else c[0]==="#"?d.value.anyValue=L.FromHex(c.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=c:d.value.printableString=c;n.push(d)}}r.push(n)}return r}toArrayBuffer(){return G.serialize(this.asn)}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const cd="Cannot initialize GeneralName from ASN.1 data.",ud=`${cd} Unsupported string format in use.`,Kh=`${cd} Value doesn't match to GUID regular expression.`,dd=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,fd="1.3.6.1.4.1.311.25.1",pd="1.3.6.1.4.1.311.20.2.3",Ba="dns",Ia="dn",Ea="email",Na="ip",Oa="url",_a="guid",Ta="upn",ro="id";class hd extends Rt{constructor(...t){let r;if(t.length===2)switch(t[0]){case Ia:{const i=new Ut(t[1]).toArrayBuffer(),n=G.parse(i,we);r=new ie({directoryName:n});break}case Ba:r=new ie({dNSName:t[1]});break;case Ea:r=new ie({rfc822Name:t[1]});break;case _a:{const i=new RegExp(dd,"i").exec(t[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,a)=>a<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ti({typeId:fd,value:G.serialize(new ae(L.FromHex(n)))})});break}case Na:r=new ie({iPAddress:t[1]});break;case ro:r=new ie({registeredID:t[1]});break;case Ta:{r=new ie({otherName:new ti({typeId:pd,value:G.serialize(uc.toASN(t[1]))})});break}case Oa:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else P.isBufferSource(t[0])?r=G.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=Ba,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=Ea,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=Na,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=Oa,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=ro,this.value=t.registeredID;else if(t.directoryName!=null)this.type=Ia,this.value=new Ut(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===fd){this.type=_a;const r=G.parse(t.otherName.value,ae),i=new RegExp(dd,"i").exec(L.ToHex(r));if(!i)throw new Error(Kh);this.value=i.slice(1).map((n,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(n)).reverse()):n).join("-")}else if(t.otherName.typeId===pd)this.type=Ta,this.value=G.parse(t.otherName.value,Oe).toString();else throw new Error(ud);else throw new Error(ud)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case Ia:case Ba:case _a:case Na:case ro:case Ta:case Oa:t=this.type.toUpperCase();break;case Ea:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===ro&&(r=Pt.toString(r)),new ue(t,void 0,r)}}class Si extends Rt{constructor(t){let r;if(t instanceof Pe)r=t;else if(Array.isArray(t)){const i=[];for(const n of t)if(n instanceof ie)i.push(n);else{const s=G.parse(new hd(n.type,n.value).rawData,ie);i.push(s)}r=new Pe(i)}else if(P.isBufferSource(t))r=G.parse(t,Pe);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let n=null;try{n=new hd(i)}catch{continue}r.push(n)}this.items=r}toJSON(){return this.items.map(t=>t.toJSON())}toTextObject(){const t=super.toTextObjectEmpty();for(const r of this.items){const i=r.toTextObject();let n=t[i[ue.NAME]];Array.isArray(n)||(n=[],t[i[ue.NAME]]=n),n.push(i)}return t}}Si.NAME="GeneralNames";const xi="-{5}",Ai="\\n",zh=`[^${Ai}]+`,Gh=`${xi}BEGIN (${zh}(?=${xi}))${xi}`,Wh=`${xi}END \\1${xi}`,$r="\\n",Jh=`[^:${Ai}]+`,Yh=`(?:[^${Ai}]+${$r}(?: +[^${Ai}]+${$r})*)`,Zh=`(?:[a-zA-Z0-9=+/]+${$r})+`,yd=`${Gh}${$r}(?:((?:${Jh}: ${Yh})+))?${$r}?(${Zh})${Wh}`;class Ze{static isPem(t){return typeof t=="string"&&new RegExp(yd,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(yd,"g"),i=[];let n=null;for(;n=r.exec(t);){const s=n[3].replace(new RegExp(`[${Ai}]+`,"g"),""),a={type:n[1],headers:[],rawData:L.FromBase64(s)},l=n[2];if(l){const c=l.split(new RegExp($r,"g"));let d=null;for(const y of c){const[p,I]=y.split(/:(.*)/);if(I===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=p.trim()}else d&&a.headers.push(d),d={key:p,value:I.trim()}}d&&a.headers.push(d)}i.push(a)}return i}static decode(t){return this.decodeWithHeaders(t).map(i=>i.rawData)}static decodeFirst(t){const r=this.decode(t);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(t,r){if(Array.isArray(t)){const i=new Array;return r?t.forEach(n=>{if(!P.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:r,rawData:P.toArrayBuffer(n)}))}):t.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(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:P.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((r=t.headers)===null||r===void 0)&&r.length){for(const d of t.headers)n.push(`${d.key}: ${d.value}`);n.push("")}const s=L.ToBase64(t.rawData);let a,l=0;const c=Array();for(;l<s.length&&(s.length-l<64?a=s.substring(l):(a=s.substring(l,l+64),l+=64),a.length!==0);)if(c.push(a),a.length<64)break;return n.push(...c),n.push(`-----END ${i}-----`),n.join(`
|
|
117
|
+
`)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class _t extends Rt{static isAsnEncoded(t){return P.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Ze.isPem(r)?Ze.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):P.toArrayBuffer(t)}}constructor(...t){_t.isAsnEncoded(t[0])?super(_t.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class lr extends _t{constructor(t){_t.isAsnEncoded(t)?super(t,Et):super(t),this.tag=Ze.PublicKeyTag}async export(...t){let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};return t.length>1?(n=t[0]||n,i=t[1]||i,r=t[2]||Ye.get()):r=t[0]||Ye.get(),r.subtle.importKey("spki",this.rawData,n,!0,i)}onInit(t){const r=rt.resolve(eo),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Vr:{const n=G.parse(t.subjectPublicKey,ta),s=P.toUint8Array(n.modulus);i.publicExponent=P.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(t){t||(t=Ye.get());const r=G.parse(this.rawData,Et);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Et);switch(t.Algorithm=sr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case gi:t["EC Point"]=r.subjectPublicKey;break;case Vr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class bt{static register(t,r){this.items.set(t,r)}static create(t){const r=new mt(t),i=this.items.get(r.type);return i?new i(t):r}}bt.items=new Map;const io="crypto.signatureFormatter";class Qh{toAsnSignature(t,r){return P.toArrayBuffer(r)}toWebSignature(t,r){return P.toArrayBuffer(r)}}class no extends _t{constructor(t){_t.isAsnEncoded(t)?super(t,vr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Ut(r.subject),this.subject=new Ut(r.subject).toString(),this.issuerName=new Ut(r.issuer),this.issuer=this.issuerName.toString();const i=rt.resolve(eo);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const n=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;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=>bt.create(G.serialize(a)))),this.publicKey=new lr(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Ye.get()){let i,n;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],r);else if(s instanceof lr)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],r);else if(P.isBufferSource(s)){const d=new lr(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=rt.resolveAll(io).reverse();let l=null;for(const d of a)if(l=d.toWebSignature(i,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,n,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,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Ye.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Ye.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,vr),i=r.tbsCertificate,n=new ue("",{Version:`${wr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":sr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const l=a.toTextObject();s[l[ue.NAME]]=l}n.Extensions=s}return t.Data=n,t.Signature=new ue("",{Algorithm:sr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}no.NAME="Certificate";class Bi extends mt{static async create(t,r=!1,i=Ye.get()){if(t instanceof no||ar.isCryptoKey(t)){const n=t instanceof no?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",n),l=await new lr(s).getKeyIdentifier(i);return new Bi(L.ToHex(l),r)}else return new Bi(t,r)}constructor(...t){if(P.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Xt({keyIdentifier:new Yo(L.FromHex(t[0]))});super(Jo,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Si?G.parse(r.name.rawData,Pe):r.name,n=new Xt({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Jo,t[1],G.serialize(n))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,Xt);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,Xt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Si(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Bi.NAME="Authority Key Identifier";class gd extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,nn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new nn({cA:t[0],pathLenConstraint:t[1]});super(mc,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}}gd.NAME="Basic Constraints";var md;(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"})(md||(md={}));class bd extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(Sc,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}bd.NAME="Extended Key Usages";var Va;(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"})(Va||(Va={}));class ja extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ds);this.usages=r.toNumber()}else{const r=new ds(t[0]);super(Ac,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ds);return t[""]=r.toJSON().join(", "),t}}ja.NAME="Key Usages";class oo extends mt{static async create(t,r=!1,i=Ye.get()){let n;t instanceof lr?n=t.rawData:"publicKey"in t?n=t.publicKey.rawData:P.isBufferSource(t)?n=t:n=await i.subtle.exportKey("spki",t);const a=await new lr(n).getKeyIdentifier(i);return new oo(L.ToHex(a),r)}constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,$t);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new $t(r);super(_c,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,$t);return t[""]=r,t}}oo.NAME="Subject Key Identifier";class Da extends mt{constructor(...t){P.isBufferSource(t[0])?super(t[0]):super(Nc,t[1],new Si(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,gs);this.names=new Si(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Da.NAME="Subject Alternative Name";class wd extends mt{constructor(...t){var r;if(P.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,an);this.policies=i.map(n=>n.policyIdentifier)}else{const i=t[0],n=(r=t[1])!==null&&r!==void 0?r:!1,s=new an(i.map(a=>new sn({policyIdentifier:a})));super(wc,n,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Pt.toString(r))),t}}wd.NAME="Certificate Policies",bt.register(wc,wd);class Mr extends Rt{constructor(...t){let r;if(P.isBufferSource(t[0]))r=P.toArrayBuffer(t[0]);else{const i=t[0],n=Array.isArray(t[1])?t[1].map(s=>P.toArrayBuffer(s)):[];r=G.serialize(new It({type:i,values:n}))}super(r,It)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===Mr.NAME&&(t[ue.NAME]=Pt.toString(this.type)),t}}Mr.NAME="Attribute";class vd extends Mr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=new Zn({printableString:t[0]});super(mu,[G.serialize(i)])}(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],Zn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}vd.NAME="Challenge Password";class $a extends Mr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=t[0],n=new er;for(const s of i)n.push(G.parse(s.rawData,at));super(ma,[G.serialize(n)])}(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],er);this.items=r.map(i=>bt.create(G.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ue.NAME]]=i;return t}}$a.NAME="Extensions";class so{static register(t,r){this.items.set(t,r)}static create(t){const r=new Mr(t),i=this.items.get(r.type);return i?new i(t):r}}so.items=new Map;let Ma=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 H({algorithm:Dn,parameters:null});case"sha-256":return new H({algorithm:Zs,parameters:null});case"sha-384":return new H({algorithm:$n,parameters:null});case"sha-512":return new H({algorithm:Mn,parameters:null})}}else return new H({algorithm:Vr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Vr:return{name:"RSASSA-PKCS1-v1_5"};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Zs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case $n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ma=u([aa()],Ma),rt.registerSingleton(Xn,Ma);class it{addPadding(t,r){const i=P.toUint8Array(r),n=new Uint8Array(t);return n.set(i,t-i.length),n}removePadding(t,r=!1){let i=P.toUint8Array(t);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(r&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,n=it.namedCurveSize.get(i)||it.defaultNamedCurveSize,s=new jn,a=P.toUint8Array(r);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,jn),n=t.namedCurve,s=it.namedCurveSize.get(n)||it.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),l=this.addPadding(s,this.removePadding(i.s));return hp(a,l)}return null}}it.namedCurveSize=new Map,it.defaultNamedCurveSize=32;const kd="1.3.101.110",Cd="1.3.101.111",Sd="1.3.101.112",xd="1.3.101.113";let Pa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Sd;break;case"ed448":r=xd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=kd;break;case"x448":r=Cd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Sd:return{name:"EdDSA",namedCurve:"Ed25519"};case xd:return{name:"EdDSA",namedCurve:"Ed448"};case kd:return{name:"ECDH-ES",namedCurve:"X25519"};case Cd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Pa=u([aa()],Pa),rt.registerSingleton(Xn,Pa);class Xh extends _t{constructor(t){_t.isAsnEncoded(t)?super(t,ki):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new lr(t.certificationRequestInfo.subjectPKInfo);const r=rt.resolve(eo);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(n=>so.create(G.serialize(n)));const i=this.getAttribute(ma);this.extensions=[],i instanceof $a&&(this.extensions=i.items),this.subjectName=new Ut(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Ye.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),n=rt.resolveAll(io).reverse();let s=null;for(const l of n)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,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,ki),i=r.certificationRequestInfo,n=new ue("",{Version:`${wr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const l=a.toTextObject();s[l[ue.NAME]]=l}n.Attributes=s}return t.Data=n,t.Signature=new ue("",{Algorithm:sr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Xh.NAME="PKCS#10 Certificate Request";var Ad;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(Ad||(Ad={})),bt.register(mc,gd),bt.register(Sc,bd),bt.register(Ac,ja),bt.register(_c,oo),bt.register(Jo,Bi),bt.register(Nc,Da),so.register(mu,vd),so.register(ma,$a),rt.registerSingleton(io,Qh),rt.registerSingleton(io,it),it.namedCurveSize.set("P-256",32),it.namedCurveSize.set("K-256",32),it.namedCurveSize.set("P-384",48),it.namedCurveSize.set("P-521",66);function Bd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new no(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const n of r.extensions)if(n instanceof Da){const s=n.names.toJSON(),l=Object.entries(s).map(c=>({type:c[1].type,value:c[1].value})).reduce((c,d)=>{const y=d.type,p=c[y]??[];return{...c,[y]:[...p,d.value]}},{});for(const c in l)i.subjectAltName=`${c}=${l[c].join(", ")}`}else if(n instanceof ja){const s=Object.values(Va),a=Array(s.length/2).fill(null).reduce((l,c,d)=>{const y=s[s.length/2+d];if(n.usages&y){const p=s[d];l.push(p)}return l},[]);i.keyUsage=a}return i}}}function ey(){const e=Bd(),t=o.ref({}),r=n=>{if(!(n.id in t.value))try{t.value[n.id]=e.parseMetaCertificateData(n.cert)}catch{t.value[n.id]=void 0}return t.value[n.id]};return{certificateDataCache:t,getCertificateData:n=>{const s=r(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 ty={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function ry(){const e=Di.createI18n("en-us",ty);return{i18n:e,i18nT:Di.i18nTComponent(e)}}const wt={useCertificate:ey,useI18n:ry,useX509:Bd},ao="/v2/control-planes/{controlPlaneId}/core-entities",lo="/{workspace}",Ii={list:{konnect:`${ao}/certificates`,kongManager:`${lo}/certificates`},form:{konnect:{create:`${ao}/certificates`,edit:`${ao}/certificates/{id}`,validate:`${ao}/v1/schemas/json/certificate/validate`},kongManager:{create:`${lo}/certificates`,edit:`${lo}/certificates/{id}`,validate:`${lo}/schemas/certificates/validate`}}};var Ra=(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))(Ra||{}),cr=(e=>(e.Edit="edit",e.Create="create",e))(cr||{}),Lt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Lt||{}),le=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(le||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function iy(){return{getAxiosInstance:(e={})=>{try{const t=o.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):ol.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),ol.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 ny(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ua="khcp-user-table-preferences",oy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function sy(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Ua));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const n=t();n.set(r,i),localStorage.setItem(Ua,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||oy},deleteAllTablePreferences:()=>{localStorage.removeItem(Ua)}}}function La(e={}){const{getAxiosInstance:t}=iy();return{axiosInstance:t(e)}}const ay={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},ly={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},cy={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},uy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},dy={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"}},fy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},py={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},hy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},yy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},gy={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"}},my={global:ay,deleteModal:ly,baseForm:cy,baseTable:uy,baseConfigCard:dy,filter:fy,debouncedFilter:py,errors:hy,validationErrors:yy,toggleModal:gy};function co(){const e=Di.createI18n("en-us",my);return{i18n:e,i18nT:Di.i18nTComponent(e)}}function Id(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const n=new Set([...r,...i]);for(const s of n){const a=r.filter(c=>c===s).length,l=i.filter(c=>c===s).length;if(a!==l)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,n)=>{if(n){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,n)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=n[r]===void 0||n[r]===null?"":n[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(n[r])&&(a=n[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 by(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:n}=La(e.axiosRequestConfig),{i18n:{t:s}}=co(),{debounce:a}=ny(),l=a(async k=>{await E(k)},200),c=o.ref(!1),d=o.ref(""),y=o.ref(""),p=o.ref([]),I=o.ref([]),w=o.ref(void 0),h=o.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:b}=Id(),v=async()=>{try{c.value=!0;const{data:k}=await n.get(`${g}?size=${r}`);k!=null&&k.next||(w.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[]),I.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},x=o.ref(""),E=async k=>{var S,A,$;if(x.value!==k)if(x.value=k||"",w.value===void 0)try{if(c.value=!0,d.value="",y.value="",e.app==="konnect"){let _=g+"";k&&(_+=`/${k}`);const{data:N}=await n.get(`${_}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(k){const _=[];b(k)&&i.searchKeys.includes("id")?_.push((async()=>{const{data:q}=await n.get(`${g}/${k}`);return[q[i.fetchedItemsKey]??q]})()):_.push(...i.searchKeys.filter(q=>q!=="id").map(async q=>{const{data:j}=await n.get(`${g}?${q}=${k}`);return j[i.fetchedItemsKey]}));const N=await Promise.all(_),re=new Set;p.value=[],(S=N==null?void 0:N.forEach)==null||S.call(N,q=>{var j;(j=q==null?void 0:q.forEach)==null||j.call(q,Z=>{re.has(Z.id)||(re.add(Z.id),p.value.push(Z))})})}else p.value=I.value}catch(_){((A=_==null?void 0:_.response)==null?void 0:A.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,y.value="",k?(p.value=($=w.value)==null?void 0:$.filter(_=>{var N;let re=!1;for(const q of i.searchKeys){const j=typeof _[q]=="string"?(N=_[q])==null?void 0:N.toLowerCase():_[q];j!=null&&j.includes(k.toLowerCase())&&(re=!0)}return re}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,c.value=!1};return{loading:c,error:d,validationError:y,results:p,allRecords:w,loadItems:v,debouncedQueryChange:l}}function wy(e,t){const r=o.unref(t),i=o.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",n=>`${i.value.href}/${n}`}function vy(){const{i18n:{t:e}}=co();return{getMessageFromError:t=>{var r,i,n,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((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((n=t.response.data.details)!=null&&n.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 ky(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),n=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!s&&new URL(n))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Ed(e,t){const r=o.ref(o.unref(e)),i=o.ref(o.unref(t)),n=o.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=o.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:l,pageSize:c,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let w=new URL(s.value.href);return n.value&&I?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${I}/`):new URL(`${w.href}?filter[name][contains]=${I}`)):(n.value||new URLSearchParams(I).forEach((h,g)=>{w.searchParams.append(g,h)}),y&&w.searchParams.append("sort_by",y),p==="desc"&&w.searchParams.append("sort_desc","1"),w.searchParams.append("size",String(c))),d&&l!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),i.value}}}function Cy(e,t,r="data"){const i=o.unref(t),{axiosInstance:n}=La(e.axiosRequestConfig),s=Ed(e,i),a=o.ref({status:Lt.Idle});return{fetcher:async l=>{var c;try{a.value={status:Lt.Loading};let d=s(l);d.includes("filter[name]")&&(d=`${d}&page[size]=${l.pageSize}&page[number]=${l.page}`);const y=await n.get(d);if(y.status>=400)throw y;const p=y.data,I=r&&r.replace(/[^\w-_]/gi,"");let w;p[I]&&Array.isArray(p[I])?w=p[I]:Array.isArray(p)?w=p:w=Object.keys(p).length?[p]:[];const h={data:w,total:w.length,...p.offset?{pagination:{offset:p.offset}}:null};return a.value={status:Lt.Idle,response:h},h}catch(d){const y={data:[],total:0};return l.query&&(((c=d.response)==null?void 0:c.status)===404||d.status===404)?(a.value={status:Lt.NoResults,response:y,error:d.response?d:{response:d}},y):(a.value={status:Lt.Error,response:y,error:d.response?d:{response:d}},y)}},fetcherState:a}}function Sy(){const e=(r,i="_")=>r?r.split(i).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Nd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Od=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Nd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},_d=e=>e==="*"||e==="x"||e==="X",Td=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},xy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Ay=(e,t)=>{if(_d(e)||_d(t))return 0;const[r,i]=xy(Td(e),Td(t));return r>i?1:r<i?-1:0},Vd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Ay(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},By=(e,t)=>{const r=Od(e),i=Od(t),n=r.pop(),s=i.pop(),a=Vd(r,i);return a!==0?a:n&&s?Vd(n.split("."),s.split(".")):n||s?n?-1:1:0},jd=(e,t,r)=>{Iy(r);const i=By(e,t);return Dd[r].includes(i)},Dd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},$d=Object.keys(Dd),Iy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if($d.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${$d.join("|")}`)},Ey=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Nd.test(e);function Ny(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:n}=t;if(!Ey(n))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,l]=s;return!(a&&jd(n,a,"<")||l&&jd(n,l,">"))}function Oy(e){const t=o.ref(0),r=o.ref(0),i=o.ref(!1);return o.watch(e,n=>{n&&!i.value&&(t.value=n.offsetWidth,r.value=n.scrollWidth,i.value=!0)}),{isTruncated:o.computed(()=>t.value<r.value)}}function _y(){const{i18n:{t:e}}=co();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Be={useAxios:La,useDebouncedFilter:by,useDeleteUrlBuilder:wy,useErrors:vy,useExternalLinkCreator:ky,useFetcher:Cy,useFetchUrlBuilder:Ed,useHelpers:Id,useStringHelpers:Sy,useI18n:co,useGatewayFeatureSupported:Ny,useTruncationDetector:Oy,useValidators:_y},Ty={key:0,class:"config-card-fieldset-title"},Vy=o.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Be.useI18n(),{convertKeyToTitle:i}=Be.useStringHelpers(),n=o.computed(()=>t.item.key??"json-array-item"),s=o.computed(()=>t.item.value??t.item),a=o.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete c.name,c}),l=o.computed(()=>{var c;return t.isArrayItem?(c=s.value)!=null&&c.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(c,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:o.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:o.withCtx(()=>[e.isArrayItem?(o.openBlock(),o.createElementBlock("legend",Ty,[o.createElementVNode("b",null,o.toDisplayString(l.value),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(a.value),(y,p)=>(o.openBlock(),o.createBlock(uo,{key:`${n.value}-property-${p}`,item:{key:y,label:o.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ct=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},Md=ct(Vy,[["__scopeId","data-v-68ca83ec"]]),jy=o.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KButton");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.value||o.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Dy=ct(jy,[["__scopeId","data-v-c96811e5"]]),$y=o.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KBadge");return o.openBlock(),o.createBlock(n,{appearance:e.status?"success":"neutral"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.status?o.unref(t)("baseConfigCard.statusBadge.enabledLabel"):o.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),My="#0044f4",Py="#e0e4ea",Ry="#3a3f51",Uy="#afb7c5",Ly="1px",Fy="20px",Hy={class:"config-card-details-row"},qy=["data-testid"],Ky=["data-testid"],zy=["data-testid"],Gy=["data-testid"],Wy={key:1},Jy=["data-testid"],Yy=["data-testid"],Zy=["data-testid"],Qy=["data-testid"],Xy={name:"ConfigCardItem",components:{JsonCardItem:Md,StatusBadge:$y,InternalLinkItem:Dy}},eg=o.defineComponent({...Xy,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}){o.useCssVars(h=>({"07753575":y.value?"none":`solid ${o.unref(Ly)} ${o.unref(Py)}`,"32d44ea8":d.value&&l.value?"block":"flex","5036b738":d.value&&l.value?"100%":r.slim?"50%":"25%","5038fd13":d.value&&l.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,n=o.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Be.useI18n(),l=o.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=o.computed(()=>!!(r.item.tooltip||n["label-tooltip"])),d=o.computed(()=>r.item.type===le.Json||r.item.type===le.JsonArray),y=o.computed(()=>r.item.type===le.JsonArray),p=o.computed(()=>{switch(r.item.type){case le.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 le.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case le.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 le.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case le.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case le.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case le.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case le.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case le.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case le.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case le.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case le.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}}}),I=o.ref(),{isTruncated:w}=Be.useTruncationDetector(I);return(h,g)=>{const b=o.resolveComponent("KLabel"),v=o.resolveComponent("KBadge"),x=o.resolveComponent("KCopy"),E=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("div",Hy,[o.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[o.renderSlot(h.$slots,"label",{item:e.item},()=>[o.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},o.createSlots({default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:o.withCtx(()=>[o.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[o.renderSlot(h.$slots,"label-tooltip",{},()=>[o.createTextVNode(o.toDisplayString(e.item.tooltip),1)],!0)],8,Ky)]),key:"0"}:void 0]),1024)],!0)],8,qy),o.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[o.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[l.value?(o.openBlock(),o.createElementBlock("div",Wy,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.value.tag),o.normalizeProps(o.guardReactiveProps(p.value.attrs)),{default:o.withCtx(()=>[p.value.additionalComponent==="KBadge"?(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(k,S)=>(o.openBlock(),o.createBlock(v,{key:`${e.item.key}-badge-tag-${S}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${S}`,tooltip:k,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Jy)):o.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(k,S)=>(o.openBlock(),o.createBlock(x,o.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${S}`,"data-testid":`${e.item.key}-copy-uuid-${S}`,text:k}),null,16,["data-testid","text"]))),128))],8,Yy)):p.value.additionalComponent==="KMethodBadge"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(k,S)=>(o.openBlock(),o.createBlock(v,{key:`${e.item.key}-badge-method-${S}`,appearance:Object.values(o.unref(cp.BadgeMethodAppearances)).includes(k.toLowerCase())?k.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${S}`},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Zy)):o.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(o.openBlock(),o.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(k,S)=>(o.openBlock(),o.createBlock(Md,{key:`json-array-item-${S}`,index:S,"is-array-item":"",item:k},null,8,["index","item"]))),128))],8,Qy)):(o.openBlock(),o.createBlock(E,{key:4,text:o.unref(w)?e.item.value:""},{default:o.withCtx(()=>[o.createElementVNode("span",{ref_key:"textContent",ref:I,class:o.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},o.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Gy))],!0)],8,zy)])}}}),uo=ct(eg,[["__scopeId","data-v-d056663c"]]),tg={class:"json-config"},rg={key:0,class:"json-endpoint"},Pd=o.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){o.useCssVars(n=>({"4520e3ec":`${i.value}ch`}));const t=e,r=o.computed(()=>t.jsonRecord),i=o.computed(()=>{var n;if(!t.fetcherUrl)return 0;const s=(n=t.fetcherUrl)==null?void 0:n.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(n,s)=>{const a=o.resolveComponent("KBadge"),l=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",tg,[t.fetcherUrl?(o.openBlock(),o.createElementBlock("div",rg,[o.createVNode(a,{appearance:t.requestMethod},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),o.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):o.createCommentVNode("",!0),t.jsonRecord?(o.openBlock(),o.createBlock(l,{key:1,id:"json-codeblock",class:o.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):o.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Rd(e){return typeof e>"u"||e===null}function ig(e){return typeof e=="object"&&e!==null}function ng(e){return Array.isArray(e)?e:Rd(e)?[]:[e]}function og(e,t){var r,i,n,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)n=s[r],e[n]=t[n];return e}function sg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function ag(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var lg=Rd,cg=ig,ug=ng,dg=sg,fg=ag,pg=og,ke={isNothing:lg,isObject:cg,toArray:ug,repeat:dg,isNegativeZero:fg,extend:pg};function Ud(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
118
118
|
|
|
119
|
-
`+e.mark.snippet),i+" "+r):i}function Ei(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ud(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.toString=function(e){return this.name+": "+Ud(this,e)};var Re=Ei;function Fa(e,t,r,i,n){var s="",a="",
|
|
120
|
-
`+
|
|
121
|
-
`,
|
|
122
|
-
`,
|
|
123
|
-
`;return
|
|
124
|
-
\r`;function Hg(e){if(e===null)return!1;var t,r,i=0,n=e.length,s=Ka;for(r=0;r<n;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function qg(e){var t,r,i=e.replace(/[\r\n=]/g,""),n=i.length,s=Ka,a=0,
|
|
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 um(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var yf=new Array(256),gf=new Array(256),Rr=0;Rr<256;Rr++)yf[Rr]=hf(Rr)?1:0,gf[Rr]=hf(Rr);function dm(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 mf(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=yg(r),new Re(t,r)}function J(e,t){throw mf(e,t)}function ho(e,t){e.onWarning&&e.onWarning.call(null,mf(e,t))}var bf={YAML:function(e,t,r){var i,n,s;e.version!==null&&J(e,"duplication of %YAML directive"),r.length!==1&&J(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&J(e,"ill-formed argument of the YAML directive"),n=parseInt(i[1],10),s=parseInt(i[2],10),n!==1&&J(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&ho(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,n;r.length!==2&&J(e,"TAG directive accepts exactly two arguments"),i=r[0],n=r[1],df.test(i)||J(e,"ill-formed tag handle (first argument) of the TAG directive"),Ft.call(e.tagMap,i)&&J(e,'there is a previously declared suffix for "'+i+'" tag handle'),ff.test(n)||J(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{J(e,"tag prefix is malformed: "+n)}e.tagMap[i]=n}};function Ht(e,t,r,i){var n,s,a,
|
|
126
|
-
`,t-1))}function fm(e,t,r){var i,n,s,a,c,
|
|
127
|
-
`,s?1+
|
|
119
|
+
`+e.mark.snippet),i+" "+r):i}function Ei(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ud(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.toString=function(e){return this.name+": "+Ud(this,e)};var Re=Ei;function Fa(e,t,r,i,n){var s="",a="",l=Math.floor(n/2)-1;return i-t>l&&(s=" ... ",t=i-l+s.length),r-i>l&&(a=" ...",r=i+l-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Ha(e,t){return ke.repeat(" ",t-e.length)+e}function hg(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],n=[],s,a=-1;s=r.exec(e.buffer);)n.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var l="",c,d,y=Math.min(e.line+t.linesAfter,n.length).toString().length,p=t.maxLength-(t.indent+y+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)d=Fa(e.buffer,i[a-c],n[a-c],e.position-(i[a]-i[a-c]),p),l=ke.repeat(" ",t.indent)+Ha((e.line-c+1).toString(),y)+" | "+d.str+`
|
|
120
|
+
`+l;for(d=Fa(e.buffer,i[a],n[a],e.position,p),l+=ke.repeat(" ",t.indent)+Ha((e.line+1).toString(),y)+" | "+d.str+`
|
|
121
|
+
`,l+=ke.repeat("-",t.indent+y+3+d.pos)+`^
|
|
122
|
+
`,c=1;c<=t.linesAfter&&!(a+c>=n.length);c++)d=Fa(e.buffer,i[a+c],n[a+c],e.position-(i[a]-i[a+c]),p),l+=ke.repeat(" ",t.indent)+Ha((e.line+c+1).toString(),y)+" | "+d.str+`
|
|
123
|
+
`;return l.replace(/\n$/,"")}var yg=hg,gg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],mg=["scalar","sequence","mapping"];function bg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function wg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(gg.indexOf(r)===-1)throw new Re('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=bg(t.styleAliases||null),mg.indexOf(this.kind)===-1)throw new Re('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Te=wg;function Ld(e,t){var r=[];return e[t].forEach(function(i){var n=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(n=a)}),r[n]=i}),r}function vg(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}function qa(e){return this.extend(e)}qa.prototype.extend=function(e){var t=[],r=[];if(e instanceof Te)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 Re("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(n){if(!(n instanceof Te))throw new Re("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new Re("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new Re("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(n){if(!(n instanceof Te))throw new Re("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(qa.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Ld(i,"implicit"),i.compiledExplicit=Ld(i,"explicit"),i.compiledTypeMap=vg(i.compiledImplicit,i.compiledExplicit),i};var Fd=qa,Hd=new Te("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),qd=new Te("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Kd=new Te("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),zd=new Fd({explicit:[Hd,qd,Kd]});function kg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Cg(){return null}function Sg(e){return e===null}var Gd=new Te("tag:yaml.org,2002:null",{kind:"scalar",resolve:kg,construct:Cg,predicate:Sg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function xg(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 Ag(e){return e==="true"||e==="True"||e==="TRUE"}function Bg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Wd=new Te("tag:yaml.org,2002:bool",{kind:"scalar",resolve:xg,construct:Ag,predicate:Bg,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 Ig(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Eg(e){return 48<=e&&e<=55}function Ng(e){return 48<=e&&e<=57}function Og(e){if(e===null)return!1;var t=e.length,r=0,i=!1,n;if(!t)return!1;if(n=e[r],(n==="-"||n==="+")&&(n=e[++r]),n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;i=!0}return i&&n!=="_"}if(n==="x"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!Ig(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!Eg(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!Ng(e.charCodeAt(r)))return!1;i=!0}return!(!i||n==="_")}function _g(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function Tg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ke.isNegativeZero(e)}var Jd=new Te("tag:yaml.org,2002:int",{kind:"scalar",resolve:Og,construct:_g,predicate:Tg,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"]}}),Vg=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||!Vg.test(e)||e[e.length-1]==="_")}function Dg(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 $g=/^[-+]?[0-9]+e/;function Mg(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(ke.isNegativeZero(e))return"-0.0";return r=e.toString(10),$g.test(r)?r.replace("e",".e"):r}function Pg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ke.isNegativeZero(e))}var Yd=new Te("tag:yaml.org,2002:float",{kind:"scalar",resolve:jg,construct:Dg,predicate:Pg,represent:Mg,defaultStyle:"lowercase"}),Zd=zd.extend({implicit:[Gd,Wd,Jd,Yd]}),Qd=Zd,Xd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ef=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 Rg(e){return e===null?!1:Xd.exec(e)!==null||ef.exec(e)!==null}function Ug(e){var t,r,i,n,s,a,l,c=0,d=null,y,p,I;if(t=Xd.exec(e),t===null&&(t=ef.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,i,n));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],p=+(t[11]||0),d=(y*60+p)*6e4,t[9]==="-"&&(d=-d)),I=new Date(Date.UTC(r,i,n,s,a,l,c)),d&&I.setTime(I.getTime()-d),I}function Lg(e){return e.toISOString()}var tf=new Te("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Rg,construct:Ug,instanceOf:Date,represent:Lg});function Fg(e){return e==="<<"||e===null}var rf=new Te("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Fg}),Ka=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
124
|
+
\r`;function Hg(e){if(e===null)return!1;var t,r,i=0,n=e.length,s=Ka;for(r=0;r<n;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function qg(e){var t,r,i=e.replace(/[\r\n=]/g,""),n=i.length,s=Ka,a=0,l=[];for(t=0;t<n;t++)t%4===0&&t&&(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=n%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 Kg(e){var t="",r=0,i,n,s=e.length,a=Ka;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return n=s%3,n===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):n===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):n===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function zg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var nf=new Te("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Hg,construct:qg,predicate:zg,represent:Kg}),Gg=Object.prototype.hasOwnProperty,Wg=Object.prototype.toString;function Jg(e){if(e===null)return!0;var t=[],r,i,n,s,a,l=e;for(r=0,i=l.length;r<i;r+=1){if(n=l[r],a=!1,Wg.call(n)!=="[object Object]")return!1;for(s in n)if(Gg.call(n,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 Yg(e){return e!==null?e:[]}var of=new Te("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Jg,construct:Yg}),Zg=Object.prototype.toString;function Qg(e){if(e===null)return!0;var t,r,i,n,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],Zg.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;s[t]=[n[0],i[n[0]]]}return!0}function Xg(e){if(e===null)return[];var t,r,i,n,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],n=Object.keys(i),s[t]=[n[0],i[n[0]]];return s}var sf=new Te("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Qg,construct:Xg}),em=Object.prototype.hasOwnProperty;function tm(e){if(e===null)return!0;var t,r=e;for(t in r)if(em.call(r,t)&&r[t]!==null)return!1;return!0}function rm(e){return e!==null?e:{}}var af=new Te("tag:yaml.org,2002:set",{kind:"mapping",resolve:tm,construct:rm}),za=Qd.extend({implicit:[tf,rf],explicit:[nf,of,sf,af]}),Ft=Object.prototype.hasOwnProperty,fo=1,lf=2,cf=3,po=4,Ga=1,im=2,uf=3,nm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,om=/[\x85\u2028\u2029]/,sm=/[,\[\]\{\}]/,df=/^(?:!|!!|![a-z\-]+!)$/i,ff=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function pf(e){return Object.prototype.toString.call(e)}function vt(e){return e===10||e===13}function ur(e){return e===9||e===32}function Ge(e){return e===9||e===32||e===10||e===13}function Pr(e){return e===44||e===91||e===93||e===123||e===125}function am(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function lm(e){return e===120?2:e===117?4:e===85?8:0}function cm(e){return 48<=e&&e<=57?e-48:-1}function hf(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 um(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var yf=new Array(256),gf=new Array(256),Rr=0;Rr<256;Rr++)yf[Rr]=hf(Rr)?1:0,gf[Rr]=hf(Rr);function dm(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 mf(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=yg(r),new Re(t,r)}function J(e,t){throw mf(e,t)}function ho(e,t){e.onWarning&&e.onWarning.call(null,mf(e,t))}var bf={YAML:function(e,t,r){var i,n,s;e.version!==null&&J(e,"duplication of %YAML directive"),r.length!==1&&J(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&J(e,"ill-formed argument of the YAML directive"),n=parseInt(i[1],10),s=parseInt(i[2],10),n!==1&&J(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&ho(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,n;r.length!==2&&J(e,"TAG directive accepts exactly two arguments"),i=r[0],n=r[1],df.test(i)||J(e,"ill-formed tag handle (first argument) of the TAG directive"),Ft.call(e.tagMap,i)&&J(e,'there is a previously declared suffix for "'+i+'" tag handle'),ff.test(n)||J(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{J(e,"tag prefix is malformed: "+n)}e.tagMap[i]=n}};function Ht(e,t,r,i){var n,s,a,l;if(t<r){if(l=e.input.slice(t,r),i)for(n=0,s=l.length;n<s;n+=1)a=l.charCodeAt(n),a===9||32<=a&&a<=1114111||J(e,"expected valid JSON character");else nm.test(l)&&J(e,"the stream contains non-printable characters");e.result+=l}}function wf(e,t,r,i){var n,s,a,l;for(ke.isObject(r)||J(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),a=0,l=n.length;a<l;a+=1)s=n[a],Ft.call(t,s)||(t[s]=r[s],i[s]=!0)}function Ur(e,t,r,i,n,s,a,l,c){var d,y;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),d=0,y=n.length;d<y;d+=1)Array.isArray(n[d])&&J(e,"nested arrays are not supported inside keys"),typeof n=="object"&&pf(n[d])==="[object Object]"&&(n[d]="[object Object]");if(typeof n=="object"&&pf(n)==="[object Object]"&&(n="[object Object]"),n=String(n),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,y=s.length;d<y;d+=1)wf(e,t,s[d],r);else wf(e,t,s,r);else!e.json&&!Ft.call(r,n)&&Ft.call(t,n)&&(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,J(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[n]=s,delete r[n];return t}function Wa(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++):J(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function be(e,t,r){for(var i=0,n=e.input.charCodeAt(e.position);n!==0;){for(;ur(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(vt(n))for(Wa(e),n=e.input.charCodeAt(e.position),i++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&ho(e,"deficient indentation"),i}function yo(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Ge(r)))}function Ja(e,t){t===1?e.result+=" ":t>1&&(e.result+=ke.repeat(`
|
|
126
|
+
`,t-1))}function fm(e,t,r){var i,n,s,a,l,c,d,y,p=e.kind,I=e.result,w;if(w=e.input.charCodeAt(e.position),Ge(w)||Pr(w)||w===35||w===38||w===42||w===33||w===124||w===62||w===39||w===34||w===37||w===64||w===96||(w===63||w===45)&&(n=e.input.charCodeAt(e.position+1),Ge(n)||r&&Pr(n)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,l=!1;w!==0;){if(w===58){if(n=e.input.charCodeAt(e.position+1),Ge(n)||r&&Pr(n))break}else if(w===35){if(i=e.input.charCodeAt(e.position-1),Ge(i))break}else{if(e.position===e.lineStart&&yo(e)||r&&Pr(w))break;if(vt(w))if(c=e.line,d=e.lineStart,y=e.lineIndent,be(e,!1,-1),e.lineIndent>=t){l=!0,w=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=c,e.lineStart=d,e.lineIndent=y;break}}l&&(Ht(e,s,a,!1),Ja(e,e.line-c),s=a=e.position,l=!1),ur(w)||(a=e.position+1),w=e.input.charCodeAt(++e.position)}return Ht(e,s,a,!1),e.result?!0:(e.kind=p,e.result=I,!1)}function pm(e,t){var r,i,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Ht(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,n=e.position;else return!0;else vt(r)?(Ht(e,i,n,!0),Ja(e,be(e,!1,t)),i=n=e.position):e.position===e.lineStart&&yo(e)?J(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);J(e,"unexpected end of the stream within a single quoted scalar")}function hm(e,t){var r,i,n,s,a,l;if(l=e.input.charCodeAt(e.position),l!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(l=e.input.charCodeAt(e.position))!==0;){if(l===34)return Ht(e,r,e.position,!0),e.position++,!0;if(l===92){if(Ht(e,r,e.position,!0),l=e.input.charCodeAt(++e.position),vt(l))be(e,!1,t);else if(l<256&&yf[l])e.result+=gf[l],e.position++;else if((a=lm(l))>0){for(n=a,s=0;n>0;n--)l=e.input.charCodeAt(++e.position),(a=am(l))>=0?s=(s<<4)+a:J(e,"expected hexadecimal character");e.result+=um(s),e.position++}else J(e,"unknown escape sequence");r=i=e.position}else vt(l)?(Ht(e,r,i,!0),Ja(e,be(e,!1,t)),r=i=e.position):e.position===e.lineStart&&yo(e)?J(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}J(e,"unexpected end of the stream within a double quoted scalar")}function ym(e,t){var r=!0,i,n,s,a=e.tag,l,c=e.anchor,d,y,p,I,w,h=Object.create(null),g,b,v,x;if(x=e.input.charCodeAt(e.position),x===91)y=93,w=!1,l=[];else if(x===123)y=125,w=!0,l={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),x=e.input.charCodeAt(++e.position);x!==0;){if(be(e,!0,t),x=e.input.charCodeAt(e.position),x===y)return e.position++,e.tag=a,e.anchor=c,e.kind=w?"mapping":"sequence",e.result=l,!0;r?x===44&&J(e,"expected the node content, but found ','"):J(e,"missed comma between flow collection entries"),b=g=v=null,p=I=!1,x===63&&(d=e.input.charCodeAt(e.position+1),Ge(d)&&(p=I=!0,e.position++,be(e,!0,t))),i=e.line,n=e.lineStart,s=e.position,Lr(e,t,fo,!1,!0),b=e.tag,g=e.result,be(e,!0,t),x=e.input.charCodeAt(e.position),(I||e.line===i)&&x===58&&(p=!0,x=e.input.charCodeAt(++e.position),be(e,!0,t),Lr(e,t,fo,!1,!0),v=e.result),w?Ur(e,l,h,b,g,v,i,n,s):p?l.push(Ur(e,null,h,b,g,v,i,n,s)):l.push(g),be(e,!0,t),x=e.input.charCodeAt(e.position),x===44?(r=!0,x=e.input.charCodeAt(++e.position)):r=!1}J(e,"unexpected end of the stream within a flow collection")}function gm(e,t){var r,i,n=Ga,s=!1,a=!1,l=t,c=0,d=!1,y,p;if(p=e.input.charCodeAt(e.position),p===124)i=!1;else if(p===62)i=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Ga===n?n=p===43?uf:im:J(e,"repeat of a chomping mode identifier");else if((y=cm(p))>=0)y===0?J(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?J(e,"repeat of an indentation width identifier"):(l=t+y-1,a=!0);else break;if(ur(p)){do p=e.input.charCodeAt(++e.position);while(ur(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!vt(p)&&p!==0)}for(;p!==0;){for(Wa(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<l)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>l&&(l=e.lineIndent),vt(p)){c++;continue}if(e.lineIndent<l){n===uf?e.result+=ke.repeat(`
|
|
127
|
+
`,s?1+c:c):n===Ga&&s&&(e.result+=`
|
|
128
128
|
`);break}for(i?ur(p)?(d=!0,e.result+=ke.repeat(`
|
|
129
|
-
`,s?1+
|
|
130
|
-
`,
|
|
131
|
-
`,
|
|
132
|
-
`,s?1+
|
|
133
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new dm(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,J(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;)km(r);return r.documents}function Cm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=kf(e,r);if(typeof t!="function")return i;for(var n=0,s=i.length;n<s;n+=1)t(i[n])}function Sm(e,t){var r=kf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Re("expected a single document in the stream, but found more")}}var xm=Cm,Am=Sm,Cf={loadAll:xm,load:Am},Sf=Object.prototype.toString,xf=Object.prototype.hasOwnProperty,Ya=65279,Bm=9,Ni=10,Im=13,Em=32,Nm=33,Om=34,Za=35,_m=37,Tm=38,Vm=39,jm=42,Af=44,Dm=45,go=58,Mm=
|
|
134
|
-
`,i),n===-1?(a=e.slice(i),i=
|
|
129
|
+
`,s?1+c:c)):d?(d=!1,e.result+=ke.repeat(`
|
|
130
|
+
`,c+1)):c===0?s&&(e.result+=" "):e.result+=ke.repeat(`
|
|
131
|
+
`,c):e.result+=ke.repeat(`
|
|
132
|
+
`,s?1+c:c),s=!0,a=!0,c=0,r=e.position;!vt(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Ht(e,r,e.position,!1)}return!0}function vf(e,t){var r,i=e.tag,n=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,J(e,"tab characters must not be used in indentation")),!(c!==45||(a=e.input.charCodeAt(e.position+1),!Ge(a))));){if(l=!0,e.position++,be(e,!0,-1)&&e.lineIndent<=t){s.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Lr(e,t,cf,!1,!0),s.push(e.result),be(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)J(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return l?(e.tag=i,e.anchor=n,e.kind="sequence",e.result=s,!0):!1}function mm(e,t,r){var i,n,s,a,l,c,d=e.tag,y=e.anchor,p={},I=Object.create(null),w=null,h=null,g=null,b=!1,v=!1,x;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),x=e.input.charCodeAt(e.position);x!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,J(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(x===63||x===58)&&Ge(i))x===63?(b&&(Ur(e,p,I,w,h,null,a,l,c),w=h=g=null),v=!0,b=!0,n=!0):b?(b=!1,n=!0):J(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,x=i;else{if(a=e.line,l=e.lineStart,c=e.position,!Lr(e,r,lf,!1,!0))break;if(e.line===s){for(x=e.input.charCodeAt(e.position);ur(x);)x=e.input.charCodeAt(++e.position);if(x===58)x=e.input.charCodeAt(++e.position),Ge(x)||J(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Ur(e,p,I,w,h,null,a,l,c),w=h=g=null),v=!0,b=!1,n=!1,w=e.tag,h=e.result;else if(v)J(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(v)J(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)&&(b&&(a=e.line,l=e.lineStart,c=e.position),Lr(e,t,po,!0,n)&&(b?h=e.result:g=e.result),b||(Ur(e,p,I,w,h,g,a,l,c),w=h=g=null),be(e,!0,-1),x=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&x!==0)J(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&Ur(e,p,I,w,h,null,a,l,c),v&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),v}function bm(e){var t,r=!1,i=!1,n,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&J(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",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)):J(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ge(a);)a===33&&(i?J(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),df.test(n)||J(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),sm.test(s)&&J(e,"tag suffix cannot contain flow indicator characters")}s&&!ff.test(s)&&J(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{J(e,"tag name is malformed: "+s)}return r?e.tag=s:Ft.call(e.tagMap,n)?e.tag=e.tagMap[n]+s:n==="!"?e.tag="!"+s:n==="!!"?e.tag="tag:yaml.org,2002:"+s:J(e,'undeclared tag handle "'+n+'"'),!0}function wm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&J(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Ge(r)&&!Pr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&J(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function vm(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ge(i)&&!Pr(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&J(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Ft.call(e.anchorMap,r)||J(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],be(e,!0,-1),!0}function Lr(e,t,r,i,n){var s,a,l,c=1,d=!1,y=!1,p,I,w,h,g,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=l=po===r||cf===r,i&&be(e,!0,-1)&&(d=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;bm(e)||wm(e);)be(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||n),(c===1||po===r)&&(fo===r||lf===r?g=t:g=t+1,b=e.position-e.lineStart,c===1?l&&(vf(e,b)||mm(e,b,g))||ym(e,g)?y=!0:(a&&gm(e,g)||pm(e,g)||hm(e,g)?y=!0:vm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&J(e,"alias node should not have any properties")):fm(e,g,fo===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(y=l&&vf(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&J(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,I=e.implicitTypes.length;p<I;p+=1)if(h=e.implicitTypes[p],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Ft.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,w=e.typeMap.multi[e.kind||"fallback"],p=0,I=w.length;p<I;p+=1)if(e.tag.slice(0,w[p].tag.length)===w[p].tag){h=w[p];break}h||J(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&J(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)):J(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 km(e){var t=e.position,r,i,n,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&&(be(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Ge(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),n=[],i.length<1&&J(e,"directive name must not be less than one character in length");a!==0;){for(;ur(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!vt(a));break}if(vt(a))break;for(r=e.position;a!==0&&!Ge(a);)a=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}a!==0&&Wa(e),Ft.call(bf,i)?bf[i](e,i,n):ho(e,'unknown document directive "'+i+'"')}if(be(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,be(e,!0,-1)):s&&J(e,"directives end mark is expected"),Lr(e,e.lineIndent-1,po,!1,!0),be(e,!0,-1),e.checkLineBreaks&&om.test(e.input.slice(t,e.position))&&ho(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&yo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,be(e,!0,-1));return}if(e.position<e.length-1)J(e,"end of the stream or a document separator is expected");else return}function kf(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 dm(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,J(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;)km(r);return r.documents}function Cm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=kf(e,r);if(typeof t!="function")return i;for(var n=0,s=i.length;n<s;n+=1)t(i[n])}function Sm(e,t){var r=kf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Re("expected a single document in the stream, but found more")}}var xm=Cm,Am=Sm,Cf={loadAll:xm,load:Am},Sf=Object.prototype.toString,xf=Object.prototype.hasOwnProperty,Ya=65279,Bm=9,Ni=10,Im=13,Em=32,Nm=33,Om=34,Za=35,_m=37,Tm=38,Vm=39,jm=42,Af=44,Dm=45,go=58,$m=61,Mm=62,Pm=63,Rm=64,Bf=91,If=93,Um=96,Ef=123,Lm=124,Nf=125,$e={};$e[0]="\\0",$e[7]="\\a",$e[8]="\\b",$e[9]="\\t",$e[10]="\\n",$e[11]="\\v",$e[12]="\\f",$e[13]="\\r",$e[27]="\\e",$e[34]='\\"',$e[92]="\\\\",$e[133]="\\N",$e[160]="\\_",$e[8232]="\\L",$e[8233]="\\P";var Fm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Hm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function qm(e,t){var r,i,n,s,a,l,c;if(t===null)return{};for(r={},i=Object.keys(t),n=0,s=i.length;n<s;n+=1)a=i[n],l=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&xf.call(c.styleAliases,l)&&(l=c.styleAliases[l]),r[a]=l;return r}function Km(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new Re("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ke.repeat("0",i-t.length)+t}var zm=1,Oi=2;function Gm(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=ke.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=qm(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Oi:zm,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 Of(e,t){for(var r=ke.repeat(" ",t),i=0,n=-1,s="",a,l=e.length;i<l;)n=e.indexOf(`
|
|
134
|
+
`,i),n===-1?(a=e.slice(i),i=l):(a=e.slice(i,n+1),i=n+1),a.length&&a!==`
|
|
135
135
|
`&&(s+=r),s+=a;return s}function Qa(e,t){return`
|
|
136
|
-
`+ke.repeat(" ",e.indent*t)}function Wm(e,t){var r,i,n;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}function mo(e){return e===Em||e===Bm}function _i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ya||65536<=e&&e<=1114111}function _f(e){return _i(e)&&e!==Ya&&e!==Im&&e!==Ni}function Tf(e,t,r){var i=_f(e),n=i&&!mo(e);return(r?i:i&&e!==Af&&e!==Bf&&e!==If&&e!==Ef&&e!==Nf)&&e!==Za&&!(t===go&&!n)||_f(t)&&!mo(t)&&e===Za||t===go&&n}function Jm(e){return _i(e)&&e!==Ya&&!mo(e)&&e!==Dm&&e!==Pm&&e!==go&&e!==Af&&e!==Bf&&e!==If&&e!==Ef&&e!==Nf&&e!==Za&&e!==Tm&&e!==jm&&e!==Nm&&e!==Lm&&e
|
|
136
|
+
`+ke.repeat(" ",e.indent*t)}function Wm(e,t){var r,i,n;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}function mo(e){return e===Em||e===Bm}function _i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ya||65536<=e&&e<=1114111}function _f(e){return _i(e)&&e!==Ya&&e!==Im&&e!==Ni}function Tf(e,t,r){var i=_f(e),n=i&&!mo(e);return(r?i:i&&e!==Af&&e!==Bf&&e!==If&&e!==Ef&&e!==Nf)&&e!==Za&&!(t===go&&!n)||_f(t)&&!mo(t)&&e===Za||t===go&&n}function Jm(e){return _i(e)&&e!==Ya&&!mo(e)&&e!==Dm&&e!==Pm&&e!==go&&e!==Af&&e!==Bf&&e!==If&&e!==Ef&&e!==Nf&&e!==Za&&e!==Tm&&e!==jm&&e!==Nm&&e!==Lm&&e!==$m&&e!==Mm&&e!==Vm&&e!==Om&&e!==_m&&e!==Rm&&e!==Um}function Ym(e){return!mo(e)&&e!==go}function Ti(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function Vf(e){var t=/^\n* /;return t.test(e)}var jf=1,Xa=2,Df=3,$f=4,Fr=5;function Zm(e,t,r,i,n,s,a,l){var c,d=0,y=null,p=!1,I=!1,w=i!==-1,h=-1,g=Jm(Ti(e,0))&&Ym(Ti(e,e.length-1));if(t||a)for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=Ti(e,c),!_i(d))return Fr;g=g&&Tf(d,y,l),y=d}else{for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=Ti(e,c),d===Ni)p=!0,w&&(I=I||c-h-1>i&&e[h+1]!==" ",h=c);else if(!_i(d))return Fr;g=g&&Tf(d,y,l),y=d}I=I||w&&c-h-1>i&&e[h+1]!==" "}return!p&&!I?g&&!a&&!n(e)?jf:s===Oi?Fr:Xa:r>9&&Vf(e)?Fr:a?s===Oi?Fr:Xa:I?$f:Df}function Qm(e,t,r,i,n){e.dump=function(){if(t.length===0)return e.quotingType===Oi?'""':"''";if(!e.noCompatMode&&(Fm.indexOf(t)!==-1||Hm.test(t)))return e.quotingType===Oi?'"'+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=i||e.flowLevel>-1&&r>=e.flowLevel;function c(d){return Wm(e,d)}switch(Zm(t,l,e.indent,a,c,e.quotingType,e.forceQuotes&&!i,n)){case jf:return t;case Xa:return"'"+t.replace(/'/g,"''")+"'";case Df:return"|"+Mf(t,e.indent)+Pf(Of(t,s));case $f:return">"+Mf(t,e.indent)+Pf(Of(Xm(t,a),s));case Fr:return'"'+e0(t)+'"';default:throw new Re("impossible error: invalid scalar style")}}()}function Mf(e,t){var r=Vf(e)?String(t):"",i=e[e.length-1]===`
|
|
137
137
|
`,n=i&&(e[e.length-2]===`
|
|
138
138
|
`||e===`
|
|
139
139
|
`),s=n?"+":i?"":"-";return r+s+`
|
|
140
140
|
`}function Pf(e){return e[e.length-1]===`
|
|
141
141
|
`?e.slice(0,-1):e}function Xm(e,t){for(var r=/(\n+)([^\n]*)/g,i=function(){var d=e.indexOf(`
|
|
142
142
|
`);return d=d!==-1?d:e.length,r.lastIndex=d,Rf(e.slice(0,d),t)}(),n=e[0]===`
|
|
143
|
-
`||e[0]===" ",s,a;a=r.exec(e);){var
|
|
144
|
-
`:"")+Rf(
|
|
145
|
-
`+e.slice(n,s),n=s+1),a=
|
|
146
|
-
`,e.length-n>t&&a>n?
|
|
147
|
-
`+e.slice(a+1):
|
|
148
|
-
`:""}var s0=o0,a0={dump:s0};function tc(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 c0=Te,l0=Fd,u0=zd,d0=Zd,f0=Qd,p0=za,h0=Cf.load,y0=Cf.loadAll,g0=a0.dump,m0=Re,b0={binary:nf,float:Yd,map:Kd,null:Gd,pairs:sf,set:af,timestamp:tf,bool:Wd,int:Jd,merge:rf,omap:of,seq:qd,str:Hd},w0=tc("safeLoad","load"),v0=tc("safeLoadAll","loadAll"),k0=tc("safeDump","dump"),C0={Type:c0,Schema:l0,FAILSAFE_SCHEMA:u0,JSON_SCHEMA:d0,CORE_SCHEMA:f0,DEFAULT_SCHEMA:p0,load:h0,loadAll:y0,dump:g0,YAMLException:m0,types:b0,safeLoad:w0,safeLoadAll:v0,safeDump:k0};const S0={class:"yaml-config"},Ff=o.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=o.computed(()=>{const i=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,n])=>n!==null&&n!==""&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(i).length===0&&i.constructor===Object?"":C0.dump(i).trim()});return(i,n)=>{const s=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",S0,[t.yamlRecord?(o.openBlock(),o.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):o.createCommentVNode("",!0)])}}}),x0={key:0,class:"config-card-display-form"},A0=["data-testid"],B0={key:0,class:"config-card-prop-section-title"},I0=o.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=o.useSlots(),{i18n:{t:i}}=Be.useI18n(),n=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=o.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,c)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[e.format==="structured"?(o.openBlock(),o.createElementBlock("div",x0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.propListTypes,l=>(o.openBlock(),o.createElementBlock("div",{key:`config-card-details-${l}-props`,class:o.normalizeClass(`config-card-details-${l}-props`),"data-testid":`config-card-details-${l}-props`},[l!=="basic"?(o.openBlock(),o.createElementBlock("div",B0,o.toDisplayString(l==="advanced"?o.unref(i)("baseConfigCard.sections.advanced"):o.unref(i)("baseConfigCard.sections.plugin")),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.propertyCollections[l],d=>(o.openBlock(),o.createBlock(uo,{key:d.key,item:d},o.createSlots({label:o.withCtx(()=>[o.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:o.withCtx(({rowValue:y})=>[o.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[n(d)?{name:"label-tooltip",fn:o.withCtx(()=>[o.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,A0))),128))])):o.createCommentVNode("",!0),e.format==="json"&&t.record?(o.openBlock(),o.createBlock(Pd,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):o.createCommentVNode("",!0),e.format==="yaml"&&t.record?(o.openBlock(),o.createBlock(Ff,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):o.createCommentVNode("",!0)],64))}}),E0=lt(I0,[["__scopeId","data-v-147a2f70"]]),qt="24px",bo=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},N0=e=>(o.pushScopeId("data-v-20c17c32"),e=e(),o.popScopeId(),e),O0=["aria-hidden"],_0={key:0,"data-testid":"kui-icon-svg-title"},T0=N0(()=>o.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),V0=o.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:qt,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qt}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",_0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),T0],8,O0))]),_:1},8,["aria-hidden","style"]))}}),j0=bo(V0,[["__scopeId","data-v-20c17c32"]]),D0=e=>(o.pushScopeId("data-v-b939f1df"),e=e(),o.popScopeId(),e),M0=["aria-hidden"],$0={key:0,"data-testid":"kui-icon-svg-title"},P0=D0(()=>o.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)),R0=o.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:qt,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qt}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",$0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),P0],8,M0))]),_:1},8,["aria-hidden","style"]))}}),U0=bo(R0,[["__scopeId","data-v-b939f1df"]]),L0=e=>(o.pushScopeId("data-v-f1d0332e"),e=e(),o.popScopeId(),e),F0=["aria-hidden"],H0={key:0,"data-testid":"kui-icon-svg-title"},q0=L0(()=>o.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),K0=o.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:qt,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qt}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.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:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",H0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),q0],8,F0))]),_:1},8,["aria-hidden","style"]))}}),z0=bo(K0,[["__scopeId","data-v-f1d0332e"]]),G0=e=>(o.pushScopeId("data-v-288b6455"),e=e(),o.popScopeId(),e),W0=["aria-hidden"],J0={key:0,"data-testid":"kui-icon-svg-title"},Y0=G0(()=>o.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)),Z0=o.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:qt,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qt}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",J0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),Y0],8,W0))]),_:1},8,["aria-hidden","style"]))}}),Q0=bo(Z0,[["__scopeId","data-v-288b6455"]]),X0={class:"config-card-title","data-testid":"config-card-title"},e1={class:"config-card-actions"},t1=["href"],r1={class:"config-card-details-section"},i1=o.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const i=t,n=e,{i18n:{t:s}}=Be.useI18n(),{getMessageFromError:a}=Be.useErrors(),{convertKeyToTitle:c}=Be.useStringHelpers(),{axiosInstance:l}=Be.useAxios((r=n.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=o.ref("structured"),p=A=>{y.value=A==null?void 0:A.value},I={id:{type:ce.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:ce.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:ce.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:ce.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:ce.BadgeTag,order:-1,section:fe.Basic}},w=o.ref(!1),h=o.ref(!1),g=o.ref(""),b=o.ref({}),k=o.computed(()=>{var A,M,_;if(!b.value)return[];const N=[],re=Object.keys(b.value).length;for(const q in b.value){const j=(M=(A=n.configSchema)==null?void 0:A[q])==null?void 0:M.order,Z=(_=I[q])==null?void 0:_.order;let ne=re;(Z||Z===0)&&(ne=Z===-1?re+1:Z),j&&(ne=j===-1?re+1:j),N.push([q,ne])}return N.sort(function(q,j){return q[1]-j[1]}),N.map(q=>{var j,Z;const ne=q[0],Ie=(j=b.value)==null?void 0:j[ne],Ce=((Z=n.configSchema)==null?void 0:Z[ne])||{},Ee=I[ne];return{key:ne,value:Ie,hidden:Ce.hidden||!1,type:Ce.type??((Ee==null?void 0:Ee.type)||ce.Text),label:Ce.label??((Ee==null?void 0:Ee.label)||c(ne)),tooltip:Ce.tooltip??((Ee==null?void 0:Ee.tooltip)||void 0),section:Ce.section??((Ee==null?void 0:Ee.section)||fe.Advanced)}}).filter(q=>!q.hidden&&q.key!==n.pluginConfigKey)}),B=o.computed(()=>{var A,M;if(!b.value||!n.pluginConfigKey)return[];const _=b.value[n.pluginConfigKey]||{},N=Object.keys(_).length,re=[];for(const q in _){const j=(M=(A=n.pluginConfigSchema)==null?void 0:A[q])==null?void 0:M.order,Z=_[q];let ne=Z!=null&&Z!==""?N-1:N;j&&(ne=j===-1?N+1:j),re.push([q,ne])}return re.sort(function(q,j){return q[1]-j[1]}),re.map(q=>{var j;const Z=q[0],ne=_[Z],Ie=((j=n.pluginConfigSchema)==null?void 0:j[Z])||{};return{key:Z,value:ne,hidden:Ie.hidden||!1,type:Ie.type??ce.Text,label:Ie.label??c(Z),tooltip:Ie.tooltip??void 0,section:fe.Plugin}}).filter(q=>!q.hidden)}),E=o.computed(()=>{var A,M,_,N;return{basic:(A=k.value)==null?void 0:A.filter(re=>re.section===fe.Basic),advanced:(M=k.value)==null?void 0:M.filter(re=>re.section===fe.Advanced),plugin:(N=B.value)==null?void 0:N.concat((_=k.value)==null?void 0:_.filter(re=>re.section===fe.Plugin))}}),S=o.computed(()=>{const A=[];return E.value.basic.length&&A.push("basic"),E.value.advanced.length&&A.push("advanced"),E.value.plugin.length&&A.push("plugin"),A}),C=o.computed(()=>{var A,M;let _=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((A=n.config)==null?void 0:A.controlPlaneId)||""):n.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(M=n.config)!=null&&M.workspace?`/${n.config.workspace}`:"")),_=_.replace(/{id}/gi,n.config.entityId),_});return o.watch(w,A=>{i("loading",A)},{immediate:!0}),o.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:A}=await l.get(C.value);if(n.dataKey)if(typeof A[n.dataKey]<"u")b.value={...A[n.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:n.dataKey}));else b.value={...A};Object.keys(n.configSchema).filter(M=>n.configSchema[M].forceShow).forEach(M=>{b.value&&typeof b.value[M]>"u"&&(b.value[M]=null)}),i("fetch:success",A)}catch(A){const M=a(A);g.value=M.startsWith("code")?s("baseConfigCard.errors.load"):M,h.value=!0,i("fetch:error",A)}finally{w.value=!1}}),(A,M)=>{const _=o.resolveComponent("KLabel"),N=o.resolveComponent("KSelect"),re=o.resolveComponent("KButton"),q=o.resolveComponent("KSkeleton"),j=o.resolveComponent("KEmptyState"),Z=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(Z,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},o.createSlots({actions:o.withCtx(()=>[o.createElementVNode("div",e1,[o.renderSlot(A.$slots,"actions",{},void 0,!0),o.createVNode(_,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1}),o.createVNode(N,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(o.openBlock(),o.createBlock(re,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:o.withCtx(()=>[o.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[o.createVNode(o.unref(U0),{size:o.unref(Fy)},null,8,["size"])],8,t1)]),_:1})):o.createCommentVNode("",!0)])]),default:o.withCtx(()=>[w.value?(o.openBlock(),o.createBlock(q,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(o.openBlock(),o.createBlock(j,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:o.withCtx(()=>[o.createElementVNode("h3",null,o.toDisplayString(g.value),1)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",r1,[o.createVNode(E0,{config:e.config,"fetcher-url":C.value,format:y.value,"prop-list-types":S.value,"property-collections":E.value,record:b.value},o.createSlots({_:2},[o.renderList(Object.keys(A.$slots),ne=>({name:ne,fn:o.withCtx(({row:Ie,rowValue:Ce})=>[o.renderSlot(A.$slots,ne,{row:Ie,rowValue:Ce},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:o.withCtx(()=>[o.createElementVNode("span",X0,[o.renderSlot(A.$slots,"title",{},()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Hf=lt(i1,[["__scopeId","data-v-f40a683b"]]),n1=["novalidate"],o1={class:"form-actions","data-testid":"form-actions"},s1=o.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=t,n=e,s=Wr.useRouter(),{i18n:{t:a}}=Be.useI18n(),{getMessageFromError:c}=Be.useErrors(),{axiosInstance:l}=Be.useAxios((r=n.config)==null?void 0:r.axiosRequestConfig),d=o.ref(!1),y=o.ref(!1),p=o.ref(""),I=o.computed(()=>n.canSubmit===!1||n.isReadonly),w=o.ref(!1),h=o.computed(()=>{var S,C;let A=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?A=A.replace(/{controlPlaneId}/gi,((S=n.config)==null?void 0:S.controlPlaneId)||""):n.config.app==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(C=n.config)!=null&&C.workspace?`/${n.config.workspace}`:"")),n.editId?(A=A.replace(/{id}/gi,n.editId),A):(A=A.replace(/\/{id}/gi,""),A)}),g=()=>{w.value=!w.value},b=()=>{n.config.cancelRoute?s.push(n.config.cancelRoute):k()},k=()=>{i("cancel")},B=()=>{I.value||i("submit")},E=o.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return o.watch(()=>d.value,S=>{i("loading",S)},{immediate:!0}),o.onBeforeMount(async()=>{if(n.editId)try{y.value=!1,d.value=!0;const{data:S}=await l.get(h.value);i("fetch:success",S)}catch(S){const C=c(S);p.value=C.startsWith("code")?a("baseForm.errors.edit"):C,y.value=!0,i("fetch:error",S)}finally{d.value=!1}}),(S,C)=>{const A=o.resolveComponent("KSkeleton"),M=o.resolveComponent("KEmptyState"),_=o.resolveComponent("KAlert"),N=o.resolveComponent("KButton"),re=o.resolveComponent("KTabs"),q=o.resolveComponent("KSlideout"),j=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(j,{class:"kong-ui-entity-base-form"},{default:o.withCtx(()=>[d.value?(o.openBlock(),o.createBlock(A,{key:0,type:"form"})):y.value?(o.openBlock(),o.createBlock(M,{key:1,"action-button-text":o.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:o.withCtx(()=>[o.createElementVNode("h3",null,o.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(o.openBlock(),o.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:n.noValidate,onReset:o.withModifiers(k,["prevent"]),onSubmit:o.withModifiers(B,["prevent"])},[o.renderSlot(S.$slots,"default",{},void 0,!0),e.errorMessage?(o.openBlock(),o.createBlock(_,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):o.createCommentVNode("",!0),o.createElementVNode("div",o1,[o.renderSlot(S.$slots,"form-actions",{},()=>[o.createVNode(N,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:C[0]||(C[0]=Z=>g())},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),o.createVNode(N,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),o.createVNode(N,{appearance:"primary","data-testid":"form-submit",disabled:I.value,type:"submit"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,n1)),o.createVNode(q,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:o.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:C[1]||(C[1]=Z=>g())},{default:o.withCtx(()=>[o.createElementVNode("div",null,o.toDisplayString(o.unref(a)("baseForm.configuration.message")),1),o.createVNode(re,{"data-testid":"form-view-configuration-slideout-tabs",tabs:E.value},{json:o.withCtx(()=>[o.createVNode(Pd,{config:e.config,"fetcher-url":h.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:o.withCtx(()=>[o.createVNode(Ff,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),qf=lt(s1,[["__scopeId","data-v-3def74fe"]]),a1={key:0,"data-testid":"first-col"},c1=o.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=o.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=o.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[data-testid="first-col"]'))||null}),n=o.computed(()=>{var g,b;const k=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return k?((b=k[0])==null?void 0:b.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,b,k;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,y.value=((b=r.value)==null?void 0:b.clientWidth)||0,p.value=((k=l.value)==null?void 0:k.innerText)||""},l=o.ref({}),d=o.ref(0),y=o.ref(0),p=o.ref(""),I=o.computed(()=>[i.value,r.value]),w=o.watch(I,g=>{if(n.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(b=>{window.requestAnimationFrame(()=>{!Array.isArray(b)||!b.length||c()})});for(const b of g)b&&s.observe(b)}},{immediate:!0,flush:"post",deep:!0}),h=o.computed(()=>n.value?d.value>y.value:!1);return o.onMounted(()=>{c()}),o.onUnmounted(()=>{w()}),(g,b)=>{const k=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[n.value?(o.openBlock(),o.createElementBlock("span",a1,[o.createVNode(k,{"max-width":"300",placement:"bottomStart",text:h.value?p.value:""},{default:o.withCtx(()=>[o.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):o.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),l1=lt(c1,[["__scopeId","data-v-c4379fd4"]]),u1={class:"toolbar-container"},d1={key:0,class:"toolbar-button-container"},f1=["data-testid"],p1=o.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},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,i=t,{i18n:{t:n}}=Be.useI18n(),s=o.computed(()=>{var C,A;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(C=r.errorMessage)==null?void 0:C.title,message:(A=r.errorMessage)==null?void 0:A.message}}),a=o.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=C=>C.hasData||!!r.query,l=o.computed(()=>{const C=[];return Object.keys(r.tableHeaders).forEach(A=>{const M=r.tableHeaders[A];C.push({label:M.label??A,key:A,sortable:M.sortable??!1})}),r.enableEntityActions&&C.push({key:"actions",hideLabel:!0}),C}),d=C=>({"data-rowid":C.id,"data-testid":C.name,...r.rowAttributes(C)}),y=o.ref({}),p=C=>{var A;return(A=y.value)==null?void 0:A.$el.querySelector(`[data-rowid="${C.id}"]`)},I=C=>{const A={"data-testid":C.headerKey,...r.cellAttributes(C)};return C.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},w=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=o.computed(()=>r.disableRowClick?void 0:(C,A)=>{i("click:row",A)}),b=C=>{i("sort",C)},{setTablePreferences:k,getTablePreferences:B}=sy(),E=o.computed(()=>{const C=B(r.preferencesStorageKey);return{...r.initialFetcherParams,...C}}),S=C=>{r.preferencesStorageKey&&k(r.preferencesStorageKey,C)};return(C,A)=>{const M=o.resolveComponent("KIcon"),_=o.resolveComponent("KButton"),N=o.resolveComponent("KDropdown"),re=o.resolveComponent("KTable"),q=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(q,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:o.withCtx(()=>[o.createVNode(re,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":I,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-message":e.query?o.unref(n)("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?o.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?o.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":E.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:w,"onRow:click":g.value,onSort:A[0]||(A[0]=j=>b(j)),"onUpdate:tablePreferences":S},o.createSlots({toolbar:o.withCtx(({state:j})=>[o.withDirectives(o.createElementVNode("div",u1,[o.renderSlot(C.$slots,"toolbar-filter",{},void 0,!0),C.$slots["toolbar-button"]?(o.openBlock(),o.createElementBlock("div",d1,[o.renderSlot(C.$slots,"toolbar-button",{},void 0,!0)])):o.createCommentVNode("",!0)],512),[[o.vShow,c(j)]])]),actions:o.withCtx(({row:j,rowKey:Z,rowValue:ne})=>[o.createElementVNode("div",{class:"actions-container","data-testid":j.name},[o.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:o.withCtx(()=>[o.renderSlot(C.$slots,"actions",{row:j,rowKey:Z,rowValue:ne},void 0,!0)]),default:o.withCtx(()=>[o.createVNode(_,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:o.withCtx(()=>[o.createVNode(M,{color:o.unref(Ry),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,f1)]),_:2},[o.renderList(e.tableHeaders,(j,Z)=>({name:Z,fn:o.withCtx(({row:ne,rowKey:Ie,rowValue:Ce})=>[o.createVNode(l1,{"key-name":String(Z),"row-el":p(ne)},{default:o.withCtx(()=>[o.renderSlot(C.$slots,Z,{row:ne,rowKey:Ie,rowValue:Ce},()=>[o.createTextVNode(o.toDisplayString(Ce),1)],!0)]),_:2},1032,["key-name","row-el"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:o.withCtx(()=>[o.createVNode(o.unref(j0))]),key:"0"}]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Kf=lt(p1,[["__scopeId","data-v-590c2d76"]]),h1={key:0,class:"kong-ui-entity-delete-error"},y1={key:1,class:"description"},g1=o.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}=Be.useI18n(),i=e,n=t,s=o.computed(()=>i.needConfirm?i.entityName:""),a=()=>{n("cancel")},c=()=>{n("proceed")};return(l,d)=>{const y=o.resolveComponent("KAlert"),p=o.resolveComponent("KPrompt");return o.openBlock(),o.createBlock(p,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:c},{default:o.withCtx(()=>[e.error?(o.openBlock(),o.createElementBlock("div",h1,[o.createVNode(y,{appearance:"danger"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.error),1)]),_:1})])):o.createCommentVNode("",!0),o.createVNode(o.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},o.createSlots({entityType:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(o.openBlock(),o.createElementBlock("div",y1,[o.renderSlot(l.$slots,"description",{},()=>[o.createElementVNode("p",null,o.toDisplayString(i.description),1)],!0)])):o.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),zf=lt(g1,[["__scopeId","data-v-4361d622"]]),m1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},b1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},w1=["fill"],v1={mask:"url(#mask0_180_20349)"},k1=["fill"],Gf=o.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${$y})`}},setup(e){return(t,r)=>(o.openBlock(),o.createElementBlock("svg",m1,[o.createElementVNode("mask",b1,[o.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,w1)]),o.createElementVNode("g",v1,[o.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,k1)])]))}}),C1={key:1,class:"kong-ui-entity-filter"},S1={class:"kong-ui-entity-filter-menu"},x1=["data-testid"],A1=["onClick","onKeydown"],B1={class:"menu-item-indicator"},I1={class:"menu-item-body"},E1=["for"],N1={class:"menu-item-buttons"},O1={class:"filter-clear-button-container"},_1=o.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}}=Be.useI18n(),i=e,n=t,s=o.ref(!1),a=o.ref({}),c=o.ref(new Set),l=o.computed(()=>{const S=[];return new URLSearchParams(i.modelValue).forEach((C,A)=>{C!==""&&S.push(A)}),S}),d=o.computed(()=>{const S=i.config.fields;return Object.keys(S).filter(C=>S[C].searchable).map(C=>({label:S[C].label||C,value:C,expanded:!1}))});o.watch(()=>i.modelValue,S=>{a.value={},new URLSearchParams(S).forEach((C,A)=>{a.value[A]=C})});const y=()=>{s.value=!s.value},p=S=>{c.value.has(S)?c.value.delete(S):c.value.add(S)},I=S=>{n("update:modelValue",S)},w=()=>{I("")},h=S=>`filter-${S}`,g=S=>{var C,A;return(((A=(C=i.config.schema)==null?void 0:C[S])==null?void 0:A.values)??[]).map(M=>({value:M,label:M}))},b=S=>{var C,A;return((A=(C=i.config.schema)==null?void 0:C[S])==null?void 0:A.type)??"text"},k=S=>{a.value={...a.value,[S]:""},E()},B=()=>{a.value={},E(!0)},E=(S=!1)=>{const C=Object.keys(a.value).reduce((A,M)=>(a.value[M]&&(A[M]=`${a.value[M]}`),A),{});S&&(s.value=!1),n("update:modelValue",new URLSearchParams(C).toString())};return(S,C)=>{const A=o.resolveComponent("KInput"),M=o.resolveComponent("KButton"),_=o.resolveComponent("KSelect");return e.config.isExactMatch?(o.openBlock(),o.createBlock(A,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":I},{before:o.withCtx(()=>[o.createVNode(Gf)]),after:o.withCtx(()=>[o.withDirectives(o.createVNode(o.unref(Q0),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[o.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(o.openBlock(),o.createElementBlock("div",C1,[o.createVNode(M,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:o.withCtx(()=>[o.createVNode(Gf),o.createTextVNode(" "+o.toDisplayString(o.unref(r)("filter.filterButtonText"))+" "+o.toDisplayString(l.value.length>0?`(${l.value.length})`:""),1)]),_:1}),o.withDirectives(o.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:y},null,512),[[o.vShow,s.value]]),o.withDirectives(o.createElementVNode("div",S1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,N=>{var re,q;return o.openBlock(),o.createElementBlock("div",{key:N.value,class:"kong-ui-entity-filter-menu-item","data-testid":N.value},[o.createElementVNode("span",{class:o.normalizeClass(["menu-item-title",{expanded:c.value.has(N.value)}]),role:"button",tabindex:"0",onClick:j=>p(N.value),onKeydown:o.withKeys(j=>p(N.value),["enter"])},[o.createTextVNode(o.toDisplayString(N.label)+" ",1),o.withDirectives(o.createElementVNode("span",B1,null,512),[[o.vShow,l.value.includes(N.value)]]),o.createVNode(o.unref(z0),{class:o.normalizeClass(["menu-item-expand-icon",{expanded:c.value.has(N.value)}]),color:o.unref(Uy)},null,8,["class","color"])],42,A1),o.withDirectives(o.createElementVNode("div",I1,[o.createElementVNode("label",{class:"menu-item-label",for:h(N.value)},o.toDisplayString(o.unref(r)("filter.fieldLabel")),9,E1),((q=(re=e.config.schema)==null?void 0:re[N.value])==null?void 0:q.type)==="select"?(o.openBlock(),o.createBlock(_,{key:0,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":j=>a.value[N.value]=j,items:g(N.value),placeholder:o.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(o.openBlock(),o.createBlock(A,{key:1,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":j=>a.value[N.value]=j,autocomplete:"off",placeholder:o.unref(r)("filter.inputPlaceholder"),type:b(N.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[o.vShow,c.value.has(N.value)]]),o.withDirectives(o.createElementVNode("div",N1,[o.createVNode(M,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:C[0]||(C[0]=j=>E(!0))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.applyButtonText")),1)]),_:1}),o.createVNode(M,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:j=>k(N.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[o.vShow,c.value.has(N.value)]])],8,x1)}),128)),o.createElementVNode("div",O1,[o.createVNode(M,{appearance:"tertiary",size:"small",onClick:B},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[o.vShow,s.value]])]))}}}),Wf=lt(_1,[["__scopeId","data-v-8cfadde3"]]),Vt=o.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=o.ref(void 0),i=o.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return o.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(n,s)=>i.value?o.renderSlot(n.$slots,"default",{key:0,isAllowed:r.value}):o.createCommentVNode("",!0)}});let wo;const T1=new Uint8Array(16);function V1(){if(!wo&&(wo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!wo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return wo(T1)}const Ve=[];for(let e=0;e<256;++e)Ve.push((e+256).toString(16).slice(1));function j1(e,t=0){return Ve[e[t+0]]+Ve[e[t+1]]+Ve[e[t+2]]+Ve[e[t+3]]+"-"+Ve[e[t+4]]+Ve[e[t+5]]+"-"+Ve[e[t+6]]+Ve[e[t+7]]+"-"+Ve[e[t+8]]+Ve[e[t+9]]+"-"+Ve[e[t+10]]+Ve[e[t+11]]+Ve[e[t+12]]+Ve[e[t+13]]+Ve[e[t+14]]+Ve[e[t+15]]}const D1=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jf={randomUUID:D1};function M1(e,t,r){if(Jf.randomUUID&&!t&&!e)return Jf.randomUUID();e=e||{};const i=e.random||(e.rng||V1)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return j1(i)}const $1=["aria-labelledby"],P1={class:"form-section-wrapper"},R1={key:1,class:"form-section-description"},U1={key:2,class:"form-section-footer"},L1={class:"form-section-content"},F1=o.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=o.useSlots(),r=M1();return(i,n)=>(o.openBlock(),o.createElementBlock("div",{"aria-labelledby":e.title?o.unref(r):void 0,class:o.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[o.createElementVNode("div",P1,[e.hideInfoHeader?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.titleTag),{key:0,id:o.unref(r),class:"form-section-title"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1},8,["id"])):o.createCommentVNode("",!0),e.description||o.unref(t).description?(o.openBlock(),o.createElementBlock("div",R1,[o.renderSlot(i.$slots,"description",{},()=>[o.createElementVNode("p",null,o.toDisplayString(e.description),1)],!0)])):o.createCommentVNode("",!0),o.unref(t).footer?(o.openBlock(),o.createElementBlock("div",U1,[o.renderSlot(i.$slots,"footer",{},void 0,!0)])):o.createCommentVNode("",!0)],2)),o.createElementVNode("div",L1,[o.renderSlot(i.$slots,"default",{},void 0,!0)])])],10,$1))}}),vo=lt(F1,[["__scopeId","data-v-76e52dbd"]]),{useAxios:ko,useDeleteUrlBuilder:Yf,useErrors:Zf,useExternalLinkCreator:Ob,useFetchUrlBuilder:_b,useFetcher:Qf,useDebouncedFilter:Tb,useStringHelpers:Xf,useHelpers:ep,useGatewayFeatureSupported:Vb,useTruncationDetector:jb,useValidators:Db}=Be,H1={class:"kong-ui-entities-certificates-list"},q1={key:0},K1={key:1},z1={key:0},G1={key:1},W1={key:0},J1={key:1},Y1={key:1},Z1={key:1},Q1=o.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 ee;const r=t,i=e,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),c=Wr.useRouter(),{axiosInstance:l}=ko((ee=i.config)==null?void 0:ee.axiosRequestConfig),d=o.ref(1),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={subject:{label:n("certificates.list.table_headers.subject")},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}},w=o.computed(()=>{var K,de;let U=`${i.config.apiBaseUrl}${Ii.list[i.config.app]}`;return i.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((K=i.config)==null?void 0:K.controlPlaneId)||""):i.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(de=i.config)!=null&&de.workspace?`/${i.config.workspace}`:"")),U}),h=o.ref(""),g=o.computed(()=>{const U=i.config.app==="konnect"||i.config.isExactMatch;return U?{isExactMatch:U,placeholder:n("certificates.search.placeholder")}:{isExactMatch:U,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:k}=Qf(i.config,w.value),B=()=>{h.value=""},E=()=>{d.value++},S=o.ref(null),C=(U,K)=>{const de=U.id;if(!K(de)){r("copy:error",{entity:U,field:"id",message:n("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:n("certificates.copy.success",{val:de})})},A=(U,K)=>{const de=JSON.stringify(U);if(!K(de)){r("copy:error",{entity:U,message:n("certificates.errors.copy")});return}r("copy:success",{entity:U,message:n("certificates.copy.success_brief")})},M=async U=>{var de;await((de=i.canRetrieve)==null?void 0:de.call(i,U))&&c.push(i.config.getViewRoute(U.id))},_=U=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(U)}),N=U=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(U)}),re=U=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(U)}},q=o.ref(void 0),j=o.ref(!1),Z=o.ref(!1),ne=o.ref(""),Ie=Yf(i.config,w.value),{certificateDataCache:Ce,getCertificateData:Ee}=wt.useCertificate(),qr=U=>{q.value=U,j.value=!0},Kr=()=>{j.value=!1},dr=async()=>{var U,K,de;if((U=q.value)!=null&&U.id){Z.value=!0;try{await l.delete(Ie(q.value.id)),Z.value=!1,j.value=!1,d.value++,r("delete:success",q.value)}catch(Ue){ne.value=((de=(K=Ue.response)==null?void 0:K.data)==null?void 0:de.message)||Ue.message||n("certificates.errors.delete"),r("error",Ue)}finally{Z.value=!1}}},jt=o.ref(!0);o.watch(k,U=>{var K,de,Ue,Qe;if(Array.isArray((K=U==null?void 0:U.response)==null?void 0:K.data)&&(jt.value=U.response.data.length>0),U.status===Lt.Error){S.value={title:n("certificates.errors.general")},(Qe=(Ue=(de=U.error)==null?void 0:de.response)==null?void 0:Ue.data)!=null&&Qe.message&&(S.value.message=U.error.response.data.message),r("error",U.error);return}Ce.value={},S.value=null});const X=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()&&(X.value.title=n("certificates.list.empty_state.title"),X.value.ctaText=n("certificates.actions.create"))}),(U,K)=>{const de=o.resolveComponent("KButton"),Ue=o.resolveComponent("KCopy"),Qe=o.resolveComponent("KBadge"),zr=o.resolveComponent("KTruncate"),te=o.resolveComponent("KDropdownItem"),Se=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",H1,[o.createVNode(o.unref(Kf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":S.value,fetcher:o.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":o.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":K[2]||(K[2]=Y=>M(Y)),onSort:E},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(Wf),{modelValue:h.value,"onUpdate:modelValue":K[0]||(K[0]=Y=>h.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:o.withCtx(()=>[o.createVNode(o.unref(Vt),{"auth-function":()=>e.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(de,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",size:"large",to:e.config.createRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[o.vShow,jt.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",q1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.subject?Y.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",K1,o.toDisplayString(o.unref(Ee)(Y).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",z1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",G1,o.toDisplayString(o.unref(Ee)(Y).schemaExpiry?o.unref(s)(o.unref(Ee)(Y).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",W1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.dns_names?`dns=${Y.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",J1,o.toDisplayString(o.unref(Ee)(Y).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:Y})=>[Y!=null&&Y.cert?(o.openBlock(),o.createBlock(Ue,{key:0,"data-testid":"copy-certificate-cert",text:Y.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Y1,"-"))]),tags:o.withCtx(({row:Y})=>{var xe;return[((xe=Y==null?void 0:Y.tags)==null?void 0:xe.length)>0?(o.openBlock(),o.createBlock(zr,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Y==null?void 0:Y.tags,Gr=>(o.openBlock(),o.createBlock(Qe,{key:Gr,onClick:K[1]||(K[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Gr),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",Z1,"-"))]}),actions:o.withCtx(({row:Y})=>[o.createVNode(Se,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:Gr=>C(Y,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Se,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:Gr=>A(Y,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canRetrieve(Y)},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:_(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canEdit(Y)},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-edit",item:N(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(Vt),{key:0,"auth-function":()=>e.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-add-sni",item:re(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canDelete(Y)},{default:o.withCtx(()=>[o.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>qr(Y)},{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(zf),{"action-pending":Z.value,"entity-type":o.unref(Ra).Certificate,error:ne.value,title:o.unref(n)("certificates.delete.title"),visible:j.value,onCancel:Kr,onProceed:dr},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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"])])}}}),Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},X1=Hr(Q1,[["__scopeId","data-v-1845028e"]]),eb={class:"kong-ui-entities-certificates-form"},tb=Hr(o.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var S;const r=t,i=e,n=Wr.useRouter(),{i18nT:s,i18n:{t:a}}=wt.useI18n(),{getMessageFromError:c}=Zf(),{axiosInstance:l}=ko((S=i.config)==null?void 0:S.axiosRequestConfig),d=o.computed(()=>Ii.form[i.config.app].edit),y=o.computed(()=>i.certificateId?lr.Edit:lr.Create),p=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),I=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),w=o.computed(()=>(y.value===lr.Create||JSON.stringify(p.fields)!==JSON.stringify(I))&&!!p.fields.cert&&!!p.fields.key),h=C=>{var A;p.fields.cert=(C==null?void 0:C.cert)||"",p.fields.key=(C==null?void 0:C.key)||"",p.fields.certAlt=(C==null?void 0:C.cert_alt)||"",p.fields.keyAlt=(C==null?void 0:C.key_alt)||"",p.fields.tags=((A=C==null?void 0:C.tags)==null?void 0:A.join(", "))||"",Object.assign(I,p.fields)},g=()=>{n.push(i.config.cancelRoute)},b=o.computed(()=>{var A,M;let C=`${i.config.apiBaseUrl}${Ii.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((A=i.config)==null?void 0:A.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),k=o.computed(()=>{var A,M;let C=`${i.config.apiBaseUrl}${Ii.form[i.config.app][y.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((A=i.config)==null?void 0:A.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),B=o.computed(()=>{var C,A;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(A=(C=p.fields.tags.split(","))==null?void 0:C.map(M=>String(M||"").trim()))==null?void 0:A.filter(M=>M!=="")}}),E=async()=>{var C,A,M,_,N,re,q;try{p.isReadonly=!0;let j;await l.post(b.value,B.value),y.value==="create"?j=await l.post(k.value,B.value):y.value==="edit"&&(j=((C=i.config)==null?void 0:C.app)==="konnect"?await l.put(k.value,B.value):await l.patch(k.value,B.value)),p.fields.cert=((A=j==null?void 0:j.data)==null?void 0:A.cert)||"",p.fields.key=((M=j==null?void 0:j.data)==null?void 0:M.key)||"",p.fields.certAlt=((_=j==null?void 0:j.data)==null?void 0:_.cert_alt)||"",p.fields.keyAlt=((N=j==null?void 0:j.data)==null?void 0:N.key_alt)||"",p.fields.tags=((q=(re=j==null?void 0:j.data)==null?void 0:re.tags)==null?void 0:q.join(", "))||"",Object.assign(I,p.fields),r("update",j==null?void 0:j.data)}catch(j){p.errorMessage=c(j),r("error",j)}finally{p.isReadonly=!1}};return(C,A)=>{const M=o.resolveComponent("KTextArea"),_=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",eb,[o.createVNode(o.unref(qf),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":B.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":A[5]||(A[5]=N=>C.$emit("error",N)),"onFetch:success":h,onLoading:A[6]||(A[6]=N=>C.$emit("loading",N)),onSubmit:E},{default:o.withCtx(()=>[o.createVNode(o.unref(vo),{description:o.unref(a)("certificates.form.sections.ssl.description"),title:o.unref(a)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(M,{modelValue:p.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=N=>p.fields.cert=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(a)("certificates.form.fields.cert.label"),readonly:p.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(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.key,"onUpdate:modelValue":A[1]||(A[1]=N=>p.fields.key=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(a)("certificates.form.fields.key.label"),readonly:p.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(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=N=>p.fields.certAlt=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.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(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=N=>p.fields.keyAlt=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.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(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(vo),{description:o.unref(a)("certificates.form.sections.general.description"),title:o.unref(a)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(_,{modelValue:p.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=N=>p.fields.tags=N),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(a)("certificates.form.fields.tags.help"),label:o.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:o.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-cec1c591"]]),Co="/v2/control-planes/{controlPlaneId}/core-entities",So="/{workspace}",Vi={list:{konnect:`${Co}/ca_certificates`,kongManager:`${So}/ca_certificates`},form:{konnect:{create:`${Co}/ca_certificates`,edit:`${Co}/ca_certificates/{id}`,validate:`${Co}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${So}/ca_certificates`,edit:`${So}/ca_certificates/{id}`,validate:`${So}/schemas/ca_certificates/validate`}}},rb={class:"kong-ui-ca-certificate-entity-config-card"},ib={key:0},nb=Hr(o.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],i=t,n=e,{i18n:{t:s,formatUnixTimeStamp:a}}=wt.useI18n(),{convertKeyToTitle:c}=Xf(),{getPropValue:l}=ep(),{getCertificateData:d}=wt.useCertificate(),y=o.computed(()=>Vi.form[n.config.app].edit),p=o.ref(),I=o.computed(()=>{if(p.value)return d(p.value)}),w=o.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaIssuer)||""}),h=o.computed(()=>{var E,S;return(E=I.value)!=null&&E.schemaExpiry?a((S=I.value)==null?void 0:S.schemaExpiry):""}),g=o.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaKeyUsages)||[]}),b=(E,S)=>{const C=l("rowValue",S);if(E==="expiry")return h.value;if(E==="key_usages")return g.value;if(C)return C[E]},k=E=>{p.value=E,i("fetch:success",E)},B=o.ref({id:{},updated_at:{},created_at:{},cert:{section:fe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:fe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:fe.Basic,type:ce.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:fe.Basic,order:1.7,forceShow:!0},issuer:{section:fe.Basic,order:1.5,forceShow:!0},key_usages:{section:fe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(E,S)=>{const C=o.resolveComponent("KCodeBlock"),A=o.resolveComponent("KLabel"),M=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",rb,[o.createVNode(o.unref(Hf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":S[0]||(S[0]=_=>E.$emit("fetch:error",_)),"onFetch:success":k,onLoading:S[1]||(S[1]=_=>E.$emit("loading",_))},{cert:o.withCtx(_=>[o.unref(l)("rowValue",_)?(o.openBlock(),o.createBlock(C,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:o.unref(l)("rowValue",_),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(A,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(_=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(l)("rowValue",_)).filter(N=>!r.includes(N)),N=>(o.openBlock(),o.createBlock(o.unref(uo),{key:N,"data-testid":`ca-cert-metadata-${N}`,item:{key:N,label:o.unref(c)(N),value:b(N,_),type:N==="key_usages"?o.unref(ce).BadgeTag:o.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),key_usages:o.withCtx(()=>[g.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",ib,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,(_,N)=>(o.openBlock(),o.createBlock(M,{key:`key_usages-badge-tag-${N}`,class:"config-badge","data-testid":`key_usages-badge-tag-${N}`,tooltip:_,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(_),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-b34eea10"]]),ob={class:"kong-ui-entities-ca-certificates-list"},sb={key:0},ab={key:1},cb={key:0},lb={key:1},ub={key:1},db=Hr(o.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var X;const r=t,i=e,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),c=Wr.useRouter(),{axiosInstance:l}=ko((X=i.config)==null?void 0:X.axiosRequestConfig),d=o.ref(1),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={issuer:{label:n("ca-certificates.list.table_headers.issuer")},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},w=o.computed(()=>{var U,K;let ee=`${i.config.apiBaseUrl}${Vi.list[i.config.app]}`;return i.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((U=i.config)==null?void 0:U.controlPlaneId)||""):i.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(K=i.config)!=null&&K.workspace?`/${i.config.workspace}`:"")),ee}),h=o.ref(""),g=o.computed(()=>{const ee=i.config.app==="konnect"||i.config.isExactMatch;return ee?{isExactMatch:ee,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:ee,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:k}=Qf(i.config,w.value),B=()=>{h.value=""},E=()=>{d.value++},S=o.ref(null),C=(ee,U)=>{const K=ee.id;if(!U(K)){r("copy:error",{entity:ee,field:"id",message:n("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,field:"id",message:n("ca-certificates.copy.success",{val:K})})},A=(ee,U)=>{const K=JSON.stringify(ee);if(!U(K)){r("copy:error",{entity:ee,message:n("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:n("ca-certificates.copy.success_brief")})},M=async ee=>{var K;await((K=i.canRetrieve)==null?void 0:K.call(i,ee))&&c.push(i.config.getViewRoute(ee.id))},_=ee=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),N=ee=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),re=o.ref(void 0),q=o.ref(!1),j=o.ref(!1),Z=o.ref(""),ne=Yf(i.config,w.value),{certificateDataCache:Ie,getCertificateData:Ce}=wt.useCertificate(),Ee=ee=>{re.value=ee,q.value=!0},qr=()=>{q.value=!1},Kr=async()=>{var ee,U,K;if((ee=re.value)!=null&&ee.id){j.value=!0;try{await l.delete(ne(re.value.id)),j.value=!1,q.value=!1,d.value++,r("delete:success",re.value)}catch(de){Z.value=((K=(U=de.response)==null?void 0:U.data)==null?void 0:K.message)||de.message||n("ca-certificates.errors.delete"),r("error",de)}finally{j.value=!1}}},dr=o.ref(!0);o.watch(k,ee=>{var U,K,de,Ue;if(Array.isArray((U=ee==null?void 0:ee.response)==null?void 0:U.data)&&(dr.value=ee.response.data.length>0),ee.status===Lt.Error){S.value={title:n("ca-certificates.errors.general")},(Ue=(de=(K=ee.error)==null?void 0:K.response)==null?void 0:de.data)!=null&&Ue.message&&(S.value.message=ee.error.response.data.message),r("error",ee.error);return}Ie.value={},S.value=null});const jt=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()&&(jt.value.title=n("ca-certificates.list.empty_state.title"),jt.value.ctaText=n("ca-certificates.actions.create"))}),(ee,U)=>{const K=o.resolveComponent("KButton"),de=o.resolveComponent("KBadge"),Ue=o.resolveComponent("KTruncate"),Qe=o.resolveComponent("KDropdownItem"),zr=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",ob,[o.createVNode(o.unref(Kf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":jt.value,"enable-entity-actions":"","error-message":S.value,fetcher:o.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":o.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":U[2]||(U[2]=te=>M(te)),onSort:E},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(Wf),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:o.withCtx(()=>[o.createVNode(o.unref(Vt),{"auth-function":()=>e.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",size:"large",to:e.config.createRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[o.vShow,dr.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:o.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",sb,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.issuer?te.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",ab,o.toDisplayString(o.unref(Ce)(te).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",cb,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.expiry?o.unref(s)(te.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",lb,o.toDisplayString(o.unref(Ce)(te).schemaExpiry?o.unref(s)(o.unref(Ce)(te).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:te})=>{var Se;return[((Se=te==null?void 0:te.tags)==null?void 0:Se.length)>0?(o.openBlock(),o.createBlock(Ue,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(te==null?void 0:te.tags,Y=>(o.openBlock(),o.createBlock(de,{key:Y,onClick:U[1]||(U[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",ub,"-"))]}),actions:o.withCtx(({row:te})=>[o.createVNode(zr,null,{default:o.withCtx(({copyToClipboard:Se})=>[o.createVNode(Qe,{"data-testid":"action-entity-copy-id",onClick:Y=>C(te,Se)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(zr,null,{default:o.withCtx(({copyToClipboard:Se})=>[o.createVNode(Qe,{"data-testid":"action-entity-copy-json",onClick:Y=>A(te,Se)},{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(Vt),{"auth-function":()=>e.canRetrieve(te)},{default:o.withCtx(()=>[o.createVNode(Qe,{"data-testid":"action-entity-view","has-divider":"",item:_(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canEdit(te)},{default:o.withCtx(()=>[o.createVNode(Qe,{"data-testid":"action-entity-edit",item:N(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canDelete(te)},{default:o.withCtx(()=>[o.createVNode(Qe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>Ee(te)},{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(zf),{"action-pending":j.value,"entity-type":o.unref(Ra).CACertificate,error:Z.value,title:o.unref(n)("ca-certificates.delete.title"),visible:q.value,onCancel:qr,onProceed:Kr},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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-c0528843"]]),fb={class:"kong-ui-entities-ca-certificates-form"},pb=Hr(o.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var E;const r=t,i=e,n=Wr.useRouter(),{i18n:{t:s}}=wt.useI18n(),{getMessageFromError:a}=Zf(),{axiosInstance:c}=ko((E=i.config)==null?void 0:E.axiosRequestConfig),l=o.computed(()=>Vi.form[i.config.app].edit),d=o.computed(()=>i.certificateId?lr.Edit:lr.Create),y=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=o.reactive({cert:"",certDigest:"",tags:""}),I=o.computed(()=>(d.value===lr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=S=>{var C;y.fields.cert=(S==null?void 0:S.cert)||"",y.fields.certDigest=(S==null?void 0:S.cert_digest)||"",y.fields.tags=((C=S==null?void 0:S.tags)==null?void 0:C.join(", "))||"",Object.assign(p,y.fields)},h=()=>{n.push(i.config.cancelRoute)},g=o.computed(()=>{var C,A;let S=`${i.config.apiBaseUrl}${Vi.form[i.config.app].validate}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(A=i.config)!=null&&A.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),b=o.computed(()=>{var C,A;let S=`${i.config.apiBaseUrl}${Vi.form[i.config.app][d.value]}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(A=i.config)!=null&&A.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),k=o.computed(()=>{var S,C;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(C=(S=y.fields.tags.split(","))==null?void 0:S.map(A=>String(A||"").trim()))==null?void 0:C.filter(A=>A!=="")}}),B=async()=>{var S,C,A,M,_;try{y.isReadonly=!0;let N;await c.post(g.value,k.value),d.value==="create"?N=await c.post(b.value,k.value):d.value==="edit"&&(N=((S=i.config)==null?void 0:S.app)==="konnect"?await c.put(b.value,k.value):await c.patch(b.value,k.value)),y.fields.cert=((C=N==null?void 0:N.data)==null?void 0:C.cert)||"",y.fields.certDigest=((A=N==null?void 0:N.data)==null?void 0:A.cert_digest)||"",y.fields.tags=((_=(M=N==null?void 0:N.data)==null?void 0:M.tags)==null?void 0:_.join(", "))||"",Object.assign(p,y.fields),r("update",N==null?void 0:N.data)}catch(N){y.errorMessage=a(N),r("error",N)}finally{y.isReadonly=!1}};return(S,C)=>{const A=o.resolveComponent("KTextArea"),M=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",fb,[o.createVNode(o.unref(qf),{"can-submit":I.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"form-fields":k.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":C[3]||(C[3]=_=>S.$emit("error",_)),"onFetch:success":w,onLoading:C[4]||(C[4]=_=>S.$emit("loading",_)),onSubmit:B},{default:o.withCtx(()=>[o.createVNode(o.unref(vo),{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(A,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=_=>y.fields.cert=_),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:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(M,{modelValue:y.fields.certDigest,"onUpdate:modelValue":C[1]||(C[1]=_=>y.fields.certDigest=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(vo),{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(M,{modelValue:y.fields.tags,"onUpdate:modelValue":C[2]||(C[2]=_=>y.fields.tags=_),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:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-54396784"]]),hb={class:"kong-ui-certificate-entity-config-card"},yb={key:0},gb=Hr(o.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=t,i=e,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),{convertKeyToTitle:c}=Xf(),{getPropValue:l}=ep(),{getCertificateData:d}=wt.useCertificate(),y=o.computed(()=>Ii.form[i.config.app].edit),p=o.ref(),I=o.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:ce.Redacted},metadata:{section:fe.Basic,type:ce.Json},snis:{section:fe.Basic,type:ce.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:fe.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:fe.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:fe.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:fe.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:fe.Advanced},key_alt:{section:fe.Advanced,type:ce.Redacted}}),w=_=>{p.value=_,r("fetch:success",_)},h=(_,N)=>{const re=l("rowValue",N);if(_==="expiry")return b.value;if(_==="key_usages")return S.value;if(_==="san_names")return B.value;if(re)return re[_]},g=o.computed(()=>{if(p.value)return d(p.value)}),b=o.computed(()=>{var _,N;return(_=g.value)!=null&&_.schemaExpiry?s((N=g.value)==null?void 0:N.schemaExpiry):""}),k=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaIssuer)||""}),B=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaSanNames)||""}),E=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaSubject)||""}),S=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaKeyUsages)||[]}),C=o.computed(()=>{var _,N;return((N=(_=p==null?void 0:p.value)==null?void 0:_.snis)==null?void 0:N.length)>0}),A=o.computed(()=>{var _;return!!((_=p==null?void 0:p.value)!=null&&_.cert_alt)}),M=_=>{var N,re;return _==="san_names"?n("certificates.list.table_headers.san"):((re=(N=I.value)==null?void 0:N[_])==null?void 0:re.label)||c(_)};return(_,N)=>{const re=o.resolveComponent("KCodeBlock"),q=o.resolveComponent("KLabel"),j=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",hb,[o.createVNode(o.unref(Hf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":I.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":N[0]||(N[0]=Z=>_.$emit("fetch:error",Z)),"onFetch:success":w,onLoading:N[1]||(N[1]=Z=>_.$emit("loading",Z))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(Z=>[o.unref(l)("rowValue",Z)?(o.openBlock(),o.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:o.unref(l)("rowValue",Z),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(q,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(Z=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(l)("rowValue",Z)),ne=>(o.openBlock(),o.createBlock(o.unref(uo),{key:ne,item:{key:ne,value:h(ne,Z),label:M(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?o.unref(ce).BadgeTag:o.unref(ce).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(b.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(B.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(E.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(a),{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(()=>[S.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",yb,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(S.value,(Z,ne)=>(o.openBlock(),o.createBlock(j,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:Z,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Z),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[C.value?void 0:{name:"snis",fn:o.withCtx(()=>[o.createTextVNode(" – ")]),key:"0"},A.value?{name:"cert_alt",fn:o.withCtx(Z=>[o.createTextVNode(" > "),o.unref(l)("rowValue",Z)?(o.openBlock(),o.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:o.unref(l)("rowValue",Z),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-d40682b9"]]);je.CACertificateConfigCard=nb,je.CACertificateForm=pb,je.CACertificateList=db,je.CertificateConfigCard=gb,je.CertificateForm=tb,je.CertificateList=X1,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|
|
143
|
+
`||e[0]===" ",s,a;a=r.exec(e);){var l=a[1],c=a[2];s=c[0]===" ",i+=l+(!n&&!s&&c!==""?`
|
|
144
|
+
`:"")+Rf(c,t),n=s}return i}function Rf(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,n=0,s,a=0,l=0,c="";i=r.exec(e);)l=i.index,l-n>t&&(s=a>n?a:l,c+=`
|
|
145
|
+
`+e.slice(n,s),n=s+1),a=l;return c+=`
|
|
146
|
+
`,e.length-n>t&&a>n?c+=e.slice(n,a)+`
|
|
147
|
+
`+e.slice(a+1):c+=e.slice(n),c.slice(1)}function e0(e){for(var t="",r=0,i,n=0;n<e.length;r>=65536?n+=2:n++)r=Ti(e,n),i=$e[r],!i&&_i(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=i||Km(r);return t}function t0(e,t,r){var i="",n=e.tag,s,a,l;for(s=0,a=r.length;s<a;s+=1)l=r[s],e.replacer&&(l=e.replacer.call(r,String(s),l)),(Tt(e,t,l,!1,!1)||typeof l>"u"&&Tt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=n,e.dump="["+i+"]"}function Uf(e,t,r,i){var n="",s=e.tag,a,l,c;for(a=0,l=r.length;a<l;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(Tt(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Tt(e,t+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=Qa(e,t)),e.dump&&Ni===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=s,e.dump=n||"[]"}function r0(e,t,r){var i="",n=e.tag,s=Object.keys(r),a,l,c,d,y;for(a=0,l=s.length;a<l;a+=1)y="",i!==""&&(y+=", "),e.condenseFlow&&(y+='"'),c=s[a],d=r[c],e.replacer&&(d=e.replacer.call(r,c,d)),Tt(e,t,c,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Tt(e,t,d,!1,!1)&&(y+=e.dump,i+=y));e.tag=n,e.dump="{"+i+"}"}function i0(e,t,r,i){var n="",s=e.tag,a=Object.keys(r),l,c,d,y,p,I;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Re("sortKeys must be a boolean or a function");for(l=0,c=a.length;l<c;l+=1)I="",(!i||n!=="")&&(I+=Qa(e,t)),d=a[l],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),Tt(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Ni===e.dump.charCodeAt(0)?I+="?":I+="? "),I+=e.dump,p&&(I+=Qa(e,t)),Tt(e,t+1,y,!0,p)&&(e.dump&&Ni===e.dump.charCodeAt(0)?I+=":":I+=": ",I+=e.dump,n+=I));e.tag=s,e.dump=n||"{}"}function Lf(e,t,r){var i,n,s,a,l,c;for(n=r?e.explicitTypes:e.implicitTypes,s=0,a=n.length;s<a;s+=1)if(l=n[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,Sf.call(l.represent)==="[object Function]")i=l.represent(t,c);else if(xf.call(l.represent,c))i=l.represent[c](t,c);else throw new Re("!<"+l.tag+'> tag resolver accepts not "'+c+'" style');e.dump=i}return!0}return!1}function Tt(e,t,r,i,n,s,a){e.tag=null,e.dump=r,Lf(e,r,!1)||Lf(e,r,!0);var l=Sf.call(e.dump),c=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var y=l==="[object Object]"||l==="[object Array]",p,I;if(y&&(p=e.duplicates.indexOf(r),I=p!==-1),(e.tag!==null&&e.tag!=="?"||I||e.indent!==2&&t>0)&&(n=!1),I&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&I&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),l==="[object Object]")i&&Object.keys(e.dump).length!==0?(i0(e,t,e.dump,n),I&&(e.dump="&ref_"+p+e.dump)):(r0(e,t,e.dump),I&&(e.dump="&ref_"+p+" "+e.dump));else if(l==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Uf(e,t-1,e.dump,n):Uf(e,t,e.dump,n),I&&(e.dump="&ref_"+p+e.dump)):(t0(e,t,e.dump),I&&(e.dump="&ref_"+p+" "+e.dump));else if(l==="[object String]")e.tag!=="?"&&Qm(e,e.dump,t,s,c);else{if(l==="[object Undefined]"||e.skipInvalid)return!1;throw new Re("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 n0(e,t){var r=[],i=[],n,s;for(el(e,r,i),n=0,s=i.length;n<s;n+=1)t.duplicates.push(r[i[n]]);t.usedDuplicates=new Array(s)}function el(e,t,r){var i,n,s;if(e!==null&&typeof e=="object")if(n=t.indexOf(e),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(t.push(e),Array.isArray(e))for(n=0,s=e.length;n<s;n+=1)el(e[n],t,r);else for(i=Object.keys(e),n=0,s=i.length;n<s;n+=1)el(e[i[n]],t,r)}function o0(e,t){t=t||{};var r=new Gm(t);r.noRefs||n0(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Tt(r,0,i,!0,!0)?r.dump+`
|
|
148
|
+
`:""}var s0=o0,a0={dump:s0};function tl(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 l0=Te,c0=Fd,u0=zd,d0=Zd,f0=Qd,p0=za,h0=Cf.load,y0=Cf.loadAll,g0=a0.dump,m0=Re,b0={binary:nf,float:Yd,map:Kd,null:Gd,pairs:sf,set:af,timestamp:tf,bool:Wd,int:Jd,merge:rf,omap:of,seq:qd,str:Hd},w0=tl("safeLoad","load"),v0=tl("safeLoadAll","loadAll"),k0=tl("safeDump","dump"),C0={Type:l0,Schema:c0,FAILSAFE_SCHEMA:u0,JSON_SCHEMA:d0,CORE_SCHEMA:f0,DEFAULT_SCHEMA:p0,load:h0,loadAll:y0,dump:g0,YAMLException:m0,types:b0,safeLoad:w0,safeLoadAll:v0,safeDump:k0};const S0={class:"yaml-config"},Ff=o.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=o.computed(()=>{const i=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,n])=>n!==null&&n!==""&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(i).length===0&&i.constructor===Object?"":C0.dump(i).trim()});return(i,n)=>{const s=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",S0,[t.yamlRecord?(o.openBlock(),o.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):o.createCommentVNode("",!0)])}}}),x0={key:0,class:"config-card-display-form"},A0=["data-testid"],B0={key:0,class:"config-card-prop-section-title"},I0=o.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=o.useSlots(),{i18n:{t:i}}=Be.useI18n(),n=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=o.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)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[e.format==="structured"?(o.openBlock(),o.createElementBlock("div",x0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.propListTypes,c=>(o.openBlock(),o.createElementBlock("div",{key:`config-card-details-${c}-props`,class:o.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(o.openBlock(),o.createElementBlock("div",B0,o.toDisplayString(c==="advanced"?o.unref(i)("baseConfigCard.sections.advanced"):o.unref(i)("baseConfigCard.sections.plugin")),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.propertyCollections[c],d=>(o.openBlock(),o.createBlock(uo,{key:d.key,item:d},o.createSlots({label:o.withCtx(()=>[o.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:o.withCtx(({rowValue:y})=>[o.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[n(d)?{name:"label-tooltip",fn:o.withCtx(()=>[o.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,A0))),128))])):o.createCommentVNode("",!0),e.format==="json"&&t.record?(o.openBlock(),o.createBlock(Pd,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):o.createCommentVNode("",!0),e.format==="yaml"&&t.record?(o.openBlock(),o.createBlock(Ff,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):o.createCommentVNode("",!0)],64))}}),E0=ct(I0,[["__scopeId","data-v-147a2f70"]]),qt="24px",bo=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},N0=e=>(o.pushScopeId("data-v-20c17c32"),e=e(),o.popScopeId(),e),O0=["aria-hidden"],_0={key:0,"data-testid":"kui-icon-svg-title"},T0=N0(()=>o.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),V0=o.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:qt,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qt}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",_0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),T0],8,O0))]),_:1},8,["aria-hidden","style"]))}}),j0=bo(V0,[["__scopeId","data-v-20c17c32"]]),D0=e=>(o.pushScopeId("data-v-b939f1df"),e=e(),o.popScopeId(),e),$0=["aria-hidden"],M0={key:0,"data-testid":"kui-icon-svg-title"},P0=D0(()=>o.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)),R0=o.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:qt,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qt}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",M0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),P0],8,$0))]),_:1},8,["aria-hidden","style"]))}}),U0=bo(R0,[["__scopeId","data-v-b939f1df"]]),L0=e=>(o.pushScopeId("data-v-f1d0332e"),e=e(),o.popScopeId(),e),F0=["aria-hidden"],H0={key:0,"data-testid":"kui-icon-svg-title"},q0=L0(()=>o.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),K0=o.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:qt,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qt}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.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:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",H0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),q0],8,F0))]),_:1},8,["aria-hidden","style"]))}}),z0=bo(K0,[["__scopeId","data-v-f1d0332e"]]),G0=e=>(o.pushScopeId("data-v-288b6455"),e=e(),o.popScopeId(),e),W0=["aria-hidden"],J0={key:0,"data-testid":"kui-icon-svg-title"},Y0=G0(()=>o.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)),Z0=o.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:qt,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qt}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",J0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),Y0],8,W0))]),_:1},8,["aria-hidden","style"]))}}),Q0=bo(Z0,[["__scopeId","data-v-288b6455"]]),X0={class:"config-card-title","data-testid":"config-card-title"},e1={class:"config-card-actions"},t1=["href"],r1={class:"config-card-details-section"},i1=o.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const i=t,n=e,{i18n:{t:s}}=Be.useI18n(),{getMessageFromError:a}=Be.useErrors(),{convertKeyToTitle:l}=Be.useStringHelpers(),{axiosInstance:c}=Be.useAxios((r=n.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=o.ref("structured"),p=A=>{y.value=A==null?void 0:A.value},I={id:{type:le.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:le.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:le.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:le.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:le.BadgeTag,order:-1,section:fe.Basic}},w=o.ref(!1),h=o.ref(!1),g=o.ref(""),b=o.ref({}),v=o.computed(()=>{var A,$,_;if(!b.value)return[];const N=[],re=Object.keys(b.value).length;for(const q in b.value){const j=($=(A=n.configSchema)==null?void 0:A[q])==null?void 0:$.order,Z=(_=I[q])==null?void 0:_.order;let ne=re;(Z||Z===0)&&(ne=Z===-1?re+1:Z),j&&(ne=j===-1?re+1:j),N.push([q,ne])}return N.sort(function(q,j){return q[1]-j[1]}),N.map(q=>{var j,Z;const ne=q[0],Ie=(j=b.value)==null?void 0:j[ne],Ce=((Z=n.configSchema)==null?void 0:Z[ne])||{},Ee=I[ne];return{key:ne,value:Ie,hidden:Ce.hidden||!1,type:Ce.type??((Ee==null?void 0:Ee.type)||le.Text),label:Ce.label??((Ee==null?void 0:Ee.label)||l(ne)),tooltip:Ce.tooltip??((Ee==null?void 0:Ee.tooltip)||void 0),section:Ce.section??((Ee==null?void 0:Ee.section)||fe.Advanced)}}).filter(q=>!q.hidden&&q.key!==n.pluginConfigKey)}),x=o.computed(()=>{var A,$;if(!b.value||!n.pluginConfigKey)return[];const _=b.value[n.pluginConfigKey]||{},N=Object.keys(_).length,re=[];for(const q in _){const j=($=(A=n.pluginConfigSchema)==null?void 0:A[q])==null?void 0:$.order,Z=_[q];let ne=Z!=null&&Z!==""?N-1:N;j&&(ne=j===-1?N+1:j),re.push([q,ne])}return re.sort(function(q,j){return q[1]-j[1]}),re.map(q=>{var j;const Z=q[0],ne=_[Z],Ie=((j=n.pluginConfigSchema)==null?void 0:j[Z])||{};return{key:Z,value:ne,hidden:Ie.hidden||!1,type:Ie.type??le.Text,label:Ie.label??l(Z),tooltip:Ie.tooltip??void 0,section:fe.Plugin}}).filter(q=>!q.hidden)}),E=o.computed(()=>{var A,$,_,N;return{basic:(A=v.value)==null?void 0:A.filter(re=>re.section===fe.Basic),advanced:($=v.value)==null?void 0:$.filter(re=>re.section===fe.Advanced),plugin:(N=x.value)==null?void 0:N.concat((_=v.value)==null?void 0:_.filter(re=>re.section===fe.Plugin))}}),k=o.computed(()=>{const A=[];return E.value.basic.length&&A.push("basic"),E.value.advanced.length&&A.push("advanced"),E.value.plugin.length&&A.push("plugin"),A}),S=o.computed(()=>{var A,$;let _=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((A=n.config)==null?void 0:A.controlPlaneId)||""):n.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,($=n.config)!=null&&$.workspace?`/${n.config.workspace}`:"")),_=_.replace(/{id}/gi,n.config.entityId),_});return o.watch(w,A=>{i("loading",A)},{immediate:!0}),o.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:A}=await c.get(S.value);if(n.dataKey)if(typeof A[n.dataKey]<"u")b.value={...A[n.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:n.dataKey}));else b.value={...A};Object.keys(n.configSchema).filter($=>n.configSchema[$].forceShow).forEach($=>{b.value&&typeof b.value[$]>"u"&&(b.value[$]=null)}),i("fetch:success",A)}catch(A){const $=a(A);g.value=$.startsWith("code")?s("baseConfigCard.errors.load"):$,h.value=!0,i("fetch:error",A)}finally{w.value=!1}}),(A,$)=>{const _=o.resolveComponent("KLabel"),N=o.resolveComponent("KSelect"),re=o.resolveComponent("KButton"),q=o.resolveComponent("KSkeleton"),j=o.resolveComponent("KEmptyState"),Z=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(Z,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},o.createSlots({actions:o.withCtx(()=>[o.createElementVNode("div",e1,[o.renderSlot(A.$slots,"actions",{},void 0,!0),o.createVNode(_,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1}),o.createVNode(N,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(o.openBlock(),o.createBlock(re,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:o.withCtx(()=>[o.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[o.createVNode(o.unref(U0),{size:o.unref(Fy)},null,8,["size"])],8,t1)]),_:1})):o.createCommentVNode("",!0)])]),default:o.withCtx(()=>[w.value?(o.openBlock(),o.createBlock(q,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(o.openBlock(),o.createBlock(j,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:o.withCtx(()=>[o.createElementVNode("h3",null,o.toDisplayString(g.value),1)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",r1,[o.createVNode(E0,{config:e.config,"fetcher-url":S.value,format:y.value,"prop-list-types":k.value,"property-collections":E.value,record:b.value},o.createSlots({_:2},[o.renderList(Object.keys(A.$slots),ne=>({name:ne,fn:o.withCtx(({row:Ie,rowValue:Ce})=>[o.renderSlot(A.$slots,ne,{row:Ie,rowValue:Ce},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:o.withCtx(()=>[o.createElementVNode("span",X0,[o.renderSlot(A.$slots,"title",{},()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Hf=ct(i1,[["__scopeId","data-v-f40a683b"]]),n1=["novalidate"],o1={class:"form-actions","data-testid":"form-actions"},s1=o.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=t,n=e,s=Wr.useRouter(),{i18n:{t:a}}=Be.useI18n(),{getMessageFromError:l}=Be.useErrors(),{axiosInstance:c}=Be.useAxios((r=n.config)==null?void 0:r.axiosRequestConfig),d=o.ref(!1),y=o.ref(!1),p=o.ref(""),I=o.computed(()=>n.canSubmit===!1||n.isReadonly),w=o.ref(!1),h=o.computed(()=>{var k,S;let A=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?A=A.replace(/{controlPlaneId}/gi,((k=n.config)==null?void 0:k.controlPlaneId)||""):n.config.app==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(S=n.config)!=null&&S.workspace?`/${n.config.workspace}`:"")),n.editId?(A=A.replace(/{id}/gi,n.editId),A):(A=A.replace(/\/{id}/gi,""),A)}),g=()=>{w.value=!w.value},b=()=>{n.config.cancelRoute?s.push(n.config.cancelRoute):v()},v=()=>{i("cancel")},x=()=>{I.value||i("submit")},E=o.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return o.watch(()=>d.value,k=>{i("loading",k)},{immediate:!0}),o.onBeforeMount(async()=>{if(n.editId)try{y.value=!1,d.value=!0;const{data:k}=await c.get(h.value);i("fetch:success",k)}catch(k){const S=l(k);p.value=S.startsWith("code")?a("baseForm.errors.edit"):S,y.value=!0,i("fetch:error",k)}finally{d.value=!1}}),(k,S)=>{const A=o.resolveComponent("KSkeleton"),$=o.resolveComponent("KEmptyState"),_=o.resolveComponent("KAlert"),N=o.resolveComponent("KButton"),re=o.resolveComponent("KTabs"),q=o.resolveComponent("KSlideout"),j=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(j,{class:"kong-ui-entity-base-form"},{default:o.withCtx(()=>[d.value?(o.openBlock(),o.createBlock(A,{key:0,type:"form"})):y.value?(o.openBlock(),o.createBlock($,{key:1,"action-button-text":o.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:o.withCtx(()=>[o.createElementVNode("h3",null,o.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(o.openBlock(),o.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:n.noValidate,onReset:o.withModifiers(v,["prevent"]),onSubmit:o.withModifiers(x,["prevent"])},[o.renderSlot(k.$slots,"default",{},void 0,!0),e.errorMessage?(o.openBlock(),o.createBlock(_,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):o.createCommentVNode("",!0),o.createElementVNode("div",o1,[o.renderSlot(k.$slots,"form-actions",{},()=>[o.createVNode(N,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:S[0]||(S[0]=Z=>g())},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),o.createVNode(N,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),o.createVNode(N,{appearance:"primary","data-testid":"form-submit",disabled:I.value,type:"submit"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,n1)),o.createVNode(q,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:o.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:S[1]||(S[1]=Z=>g())},{default:o.withCtx(()=>[o.createElementVNode("div",null,o.toDisplayString(o.unref(a)("baseForm.configuration.message")),1),o.createVNode(re,{"data-testid":"form-view-configuration-slideout-tabs",tabs:E.value},{json:o.withCtx(()=>[o.createVNode(Pd,{config:e.config,"fetcher-url":h.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:o.withCtx(()=>[o.createVNode(Ff,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),qf=ct(s1,[["__scopeId","data-v-3def74fe"]]),a1=["data-truncate"],l1=o.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=o.computed(()=>{var b;return((b=t.rowEl)==null?void 0:b.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=o.computed(()=>{var b;return((b=r.value)==null?void 0:b.querySelector('[data-truncate="true"]'))||null}),n=o.computed(()=>{var b,v;const x=(b=t.rowEl)==null?void 0:b.querySelectorAll("td");return x?((v=x[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!1}),s=o.computed(()=>n.value||t.tooltip);let a;const l=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{var b,v,x;let E=((b=r.value)==null?void 0:b.clientWidth)||0;if(r.value&&"getComputedStyle"in window){const k=window.getComputedStyle(r.value);E-=(parseFloat(k.paddingLeft)||0)+(parseFloat(k.paddingRight)||0)}y.value=((v=i.value)==null?void 0:v.getBoundingClientRect().width)||0,p.value=E,I.value=((x=d.value)==null?void 0:x.innerText)||""},d=o.ref({}),y=o.ref(0),p=o.ref(0),I=o.ref(""),w=o.computed(()=>[i.value,r.value]),h=o.watch(w,b=>{if(s.value&&(l(),"ResizeObserver"in window&&window)){a=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of b)v&&a.observe(v)}},{immediate:!0,flush:"post",deep:!0}),g=o.computed(()=>s.value?y.value>p.value:!1);return o.onMounted(()=>{c()}),o.onUnmounted(()=>{h()}),(b,v)=>{const x=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("span",{ref_key:"contentRef",ref:d,class:"content-wrapper"},[s.value?(o.openBlock(),o.createElementBlock("span",{key:0,"data-truncate":s.value||void 0},[o.createVNode(x,{"max-width":"300",placement:"bottomStart",text:g.value?I.value:""},{default:o.withCtx(()=>[o.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,a1)):o.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),c1=ct(l1,[["__scopeId","data-v-6019026f"]]),u1={class:"toolbar-container"},d1={key:0,class:"toolbar-button-container"},f1=["data-testid"],p1=o.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},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,i=t,{i18n:{t:n}}=Be.useI18n(),s=o.computed(()=>{var S,A;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(S=r.errorMessage)==null?void 0:S.title,message:(A=r.errorMessage)==null?void 0:A.message}}),a=o.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),l=S=>S.hasData||!!r.query,c=o.computed(()=>{const S=[];return Object.keys(r.tableHeaders).forEach(A=>{const $=r.tableHeaders[A];S.push({label:$.label??A,key:A,sortable:$.sortable??!1})}),r.enableEntityActions&&S.push({key:"actions",hideLabel:!0}),S}),d=S=>({"data-rowid":S.id,"data-testid":S.name,...r.rowAttributes(S)}),y=o.ref({}),p=S=>{var A;return(A=y.value)==null?void 0:A.$el.querySelector(`[data-rowid="${S.id}"]`)},I=S=>{const A={"data-testid":S.headerKey,...r.cellAttributes(S)};return S.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},w=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=o.computed(()=>r.disableRowClick?void 0:(S,A)=>{i("click:row",A)}),b=S=>{i("sort",S)},{setTablePreferences:v,getTablePreferences:x}=sy(),E=o.computed(()=>{const S=x(r.preferencesStorageKey);return{...r.initialFetcherParams,...S}}),k=S=>{r.preferencesStorageKey&&v(r.preferencesStorageKey,S)};return(S,A)=>{const $=o.resolveComponent("KIcon"),_=o.resolveComponent("KButton"),N=o.resolveComponent("KDropdown"),re=o.resolveComponent("KTable"),q=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(q,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:o.withCtx(()=>[o.createVNode(re,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":I,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-message":e.query?o.unref(n)("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?o.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?o.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":E.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:w,"onRow:click":g.value,onSort:A[0]||(A[0]=j=>b(j)),"onUpdate:tablePreferences":k},o.createSlots({toolbar:o.withCtx(({state:j})=>[o.withDirectives(o.createElementVNode("div",u1,[o.renderSlot(S.$slots,"toolbar-filter",{},void 0,!0),S.$slots["toolbar-button"]?(o.openBlock(),o.createElementBlock("div",d1,[o.renderSlot(S.$slots,"toolbar-button",{},void 0,!0)])):o.createCommentVNode("",!0)],512),[[o.vShow,l(j)]])]),actions:o.withCtx(({row:j,rowKey:Z,rowValue:ne})=>[o.createElementVNode("div",{class:"actions-container","data-testid":j.name},[o.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:o.withCtx(()=>[o.renderSlot(S.$slots,"actions",{row:j,rowKey:Z,rowValue:ne},void 0,!0)]),default:o.withCtx(()=>[o.createVNode(_,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:o.withCtx(()=>[o.createVNode($,{color:o.unref(Ry),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,f1)]),_:2},[o.renderList(e.tableHeaders,(j,Z)=>({name:Z,fn:o.withCtx(({row:ne,rowKey:Ie,rowValue:Ce})=>[o.createVNode(c1,{"key-name":String(Z),"row-el":p(ne),tooltip:j.tooltip},{default:o.withCtx(()=>[o.renderSlot(S.$slots,Z,{row:ne,rowKey:Ie,rowValue:Ce},()=>[o.createTextVNode(o.toDisplayString(Ce),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:o.withCtx(()=>[o.createVNode(o.unref(j0))]),key:"0"}]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Kf=ct(p1,[["__scopeId","data-v-adb02213"]]),h1={key:0,class:"kong-ui-entity-delete-error"},y1={key:1,class:"description"},g1=o.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}=Be.useI18n(),i=e,n=t,s=o.computed(()=>i.needConfirm?i.entityName:""),a=()=>{n("cancel")},l=()=>{n("proceed")};return(c,d)=>{const y=o.resolveComponent("KAlert"),p=o.resolveComponent("KPrompt");return o.openBlock(),o.createBlock(p,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:l},{default:o.withCtx(()=>[e.error?(o.openBlock(),o.createElementBlock("div",h1,[o.createVNode(y,{appearance:"danger"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.error),1)]),_:1})])):o.createCommentVNode("",!0),o.createVNode(o.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},o.createSlots({entityType:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||c.$slots.description?(o.openBlock(),o.createElementBlock("div",y1,[o.renderSlot(c.$slots,"description",{},()=>[o.createElementVNode("p",null,o.toDisplayString(i.description),1)],!0)])):o.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),zf=ct(g1,[["__scopeId","data-v-4361d622"]]),m1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},b1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},w1=["fill"],v1={mask:"url(#mask0_180_20349)"},k1=["fill"],Gf=o.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${My})`}},setup(e){return(t,r)=>(o.openBlock(),o.createElementBlock("svg",m1,[o.createElementVNode("mask",b1,[o.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,w1)]),o.createElementVNode("g",v1,[o.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,k1)])]))}}),C1={key:1,class:"kong-ui-entity-filter"},S1={class:"kong-ui-entity-filter-menu"},x1=["data-testid"],A1=["onClick","onKeydown"],B1={class:"menu-item-indicator"},I1={class:"menu-item-body"},E1=["for"],N1={class:"menu-item-buttons"},O1={class:"filter-clear-button-container"},_1=o.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}}=Be.useI18n(),i=e,n=t,s=o.ref(!1),a=o.ref({}),l=o.ref(new Set),c=o.computed(()=>{const k=[];return new URLSearchParams(i.modelValue).forEach((S,A)=>{S!==""&&k.push(A)}),k}),d=o.computed(()=>{const k=i.config.fields;return Object.keys(k).filter(S=>{var A;return(A=k==null?void 0:k[S])==null?void 0:A.searchable}).map(S=>({label:k[S].label||S,value:S,expanded:!1}))});o.watch(()=>i.modelValue,k=>{a.value={},new URLSearchParams(k).forEach((S,A)=>{a.value[A]=S})});const y=()=>{s.value=!s.value},p=k=>{l.value.has(k)?l.value.delete(k):l.value.add(k)},I=k=>{n("update:modelValue",k)},w=()=>{I("")},h=k=>`filter-${k}`,g=k=>{var S,A;return(((A=(S=i.config.schema)==null?void 0:S[k])==null?void 0:A.values)??[]).map($=>({value:$,label:$}))},b=k=>{var S,A;return((A=(S=i.config.schema)==null?void 0:S[k])==null?void 0:A.type)??"text"},v=k=>{a.value={...a.value,[k]:""},E()},x=()=>{a.value={},E(!0)},E=(k=!1)=>{const S=Object.keys(a.value).reduce((A,$)=>(a.value[$]&&(A[$]=`${a.value[$]}`),A),{});k&&(s.value=!1),n("update:modelValue",new URLSearchParams(S).toString())};return(k,S)=>{const A=o.resolveComponent("KInput"),$=o.resolveComponent("KButton"),_=o.resolveComponent("KSelect");return e.config.isExactMatch?(o.openBlock(),o.createBlock(A,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":I},{before:o.withCtx(()=>[o.createVNode(Gf)]),after:o.withCtx(()=>[o.withDirectives(o.createVNode(o.unref(Q0),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[o.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(o.openBlock(),o.createElementBlock("div",C1,[o.createVNode($,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:o.withCtx(()=>[o.createVNode(Gf),o.createTextVNode(" "+o.toDisplayString(o.unref(r)("filter.filterButtonText"))+" "+o.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),o.withDirectives(o.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:y},null,512),[[o.vShow,s.value]]),o.withDirectives(o.createElementVNode("div",S1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,N=>{var re,q;return o.openBlock(),o.createElementBlock("div",{key:N.value,class:"kong-ui-entity-filter-menu-item","data-testid":N.value},[o.createElementVNode("span",{class:o.normalizeClass(["menu-item-title",{expanded:l.value.has(N.value)}]),role:"button",tabindex:"0",onClick:j=>p(N.value),onKeydown:o.withKeys(j=>p(N.value),["enter"])},[o.createTextVNode(o.toDisplayString(N.label)+" ",1),o.withDirectives(o.createElementVNode("span",B1,null,512),[[o.vShow,c.value.includes(N.value)]]),o.createVNode(o.unref(z0),{class:o.normalizeClass(["menu-item-expand-icon",{expanded:l.value.has(N.value)}]),color:o.unref(Uy)},null,8,["class","color"])],42,A1),o.withDirectives(o.createElementVNode("div",I1,[o.createElementVNode("label",{class:"menu-item-label",for:h(N.value)},o.toDisplayString(o.unref(r)("filter.fieldLabel")),9,E1),((q=(re=e.config.schema)==null?void 0:re[N.value])==null?void 0:q.type)==="select"?(o.openBlock(),o.createBlock(_,{key:0,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":j=>a.value[N.value]=j,items:g(N.value),placeholder:o.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(o.openBlock(),o.createBlock(A,{key:1,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":j=>a.value[N.value]=j,autocomplete:"off",placeholder:o.unref(r)("filter.inputPlaceholder"),type:b(N.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[o.vShow,l.value.has(N.value)]]),o.withDirectives(o.createElementVNode("div",N1,[o.createVNode($,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:S[0]||(S[0]=j=>E(!0))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.applyButtonText")),1)]),_:1}),o.createVNode($,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:j=>v(N.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[o.vShow,l.value.has(N.value)]])],8,x1)}),128)),o.createElementVNode("div",O1,[o.createVNode($,{appearance:"tertiary",size:"small",onClick:x},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[o.vShow,s.value]])]))}}}),Wf=ct(_1,[["__scopeId","data-v-9a370e3a"]]),Vt=o.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=o.ref(void 0),i=o.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return o.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(n,s)=>i.value?o.renderSlot(n.$slots,"default",{key:0,isAllowed:r.value}):o.createCommentVNode("",!0)}});let wo;const T1=new Uint8Array(16);function V1(){if(!wo&&(wo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!wo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return wo(T1)}const Ve=[];for(let e=0;e<256;++e)Ve.push((e+256).toString(16).slice(1));function j1(e,t=0){return Ve[e[t+0]]+Ve[e[t+1]]+Ve[e[t+2]]+Ve[e[t+3]]+"-"+Ve[e[t+4]]+Ve[e[t+5]]+"-"+Ve[e[t+6]]+Ve[e[t+7]]+"-"+Ve[e[t+8]]+Ve[e[t+9]]+"-"+Ve[e[t+10]]+Ve[e[t+11]]+Ve[e[t+12]]+Ve[e[t+13]]+Ve[e[t+14]]+Ve[e[t+15]]}const D1=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jf={randomUUID:D1};function $1(e,t,r){if(Jf.randomUUID&&!t&&!e)return Jf.randomUUID();e=e||{};const i=e.random||(e.rng||V1)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return j1(i)}const M1=["aria-labelledby"],P1={class:"form-section-wrapper"},R1={key:1,class:"form-section-description"},U1={key:2,class:"form-section-footer"},L1={class:"form-section-content"},F1=o.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=o.useSlots(),r=$1();return(i,n)=>(o.openBlock(),o.createElementBlock("div",{"aria-labelledby":e.title?o.unref(r):void 0,class:o.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[o.createElementVNode("div",P1,[e.hideInfoHeader?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.titleTag),{key:0,id:o.unref(r),class:"form-section-title"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1},8,["id"])):o.createCommentVNode("",!0),e.description||o.unref(t).description?(o.openBlock(),o.createElementBlock("div",R1,[o.renderSlot(i.$slots,"description",{},()=>[o.createElementVNode("p",null,o.toDisplayString(e.description),1)],!0)])):o.createCommentVNode("",!0),o.unref(t).footer?(o.openBlock(),o.createElementBlock("div",U1,[o.renderSlot(i.$slots,"footer",{},void 0,!0)])):o.createCommentVNode("",!0)],2)),o.createElementVNode("div",L1,[o.renderSlot(i.$slots,"default",{},void 0,!0)])])],10,M1))}}),vo=ct(F1,[["__scopeId","data-v-b1f74200"]]),{useAxios:ko,useDeleteUrlBuilder:Yf,useErrors:Zf,useExternalLinkCreator:Ob,useFetchUrlBuilder:_b,useFetcher:Qf,useDebouncedFilter:Tb,useStringHelpers:Xf,useHelpers:ep,useGatewayFeatureSupported:Vb,useTruncationDetector:jb,useValidators:Db}=Be,H1={class:"kong-ui-entities-certificates-list"},q1={key:0},K1={key:1},z1={key:0},G1={key:1},W1={key:0},J1={key:1},Y1={key:1},Z1={key:1},Q1=o.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 ee;const r=t,i=e,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=ko((ee=i.config)==null?void 0:ee.axiosRequestConfig),d=o.ref(1),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={subject:{label:n("certificates.list.table_headers.subject")},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}},w=o.computed(()=>{var K,de;let U=`${i.config.apiBaseUrl}${Ii.list[i.config.app]}`;return i.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((K=i.config)==null?void 0:K.controlPlaneId)||""):i.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(de=i.config)!=null&&de.workspace?`/${i.config.workspace}`:"")),U}),h=o.ref(""),g=o.computed(()=>{const U=i.config.app==="konnect"||i.config.isExactMatch;return U?{isExactMatch:U,placeholder:n("certificates.search.placeholder")}:{isExactMatch:U,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:v}=Qf(i.config,w.value),x=()=>{h.value=""},E=()=>{d.value++},k=o.ref(null),S=(U,K)=>{const de=U.id;if(!K(de)){r("copy:error",{entity:U,field:"id",message:n("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:n("certificates.copy.success",{val:de})})},A=(U,K)=>{const de=JSON.stringify(U);if(!K(de)){r("copy:error",{entity:U,message:n("certificates.errors.copy")});return}r("copy:success",{entity:U,message:n("certificates.copy.success_brief")})},$=async U=>{var de;await((de=i.canRetrieve)==null?void 0:de.call(i,U))&&l.push(i.config.getViewRoute(U.id))},_=U=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(U)}),N=U=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(U)}),re=U=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(U)}},q=o.ref(void 0),j=o.ref(!1),Z=o.ref(!1),ne=o.ref(""),Ie=Yf(i.config,w.value),{certificateDataCache:Ce,getCertificateData:Ee}=wt.useCertificate(),qr=U=>{q.value=U,j.value=!0},Kr=()=>{j.value=!1},dr=async()=>{var U,K,de;if((U=q.value)!=null&&U.id){Z.value=!0;try{await c.delete(Ie(q.value.id)),Z.value=!1,j.value=!1,d.value++,r("delete:success",q.value)}catch(Ue){ne.value=((de=(K=Ue.response)==null?void 0:K.data)==null?void 0:de.message)||Ue.message||n("certificates.errors.delete"),r("error",Ue)}finally{Z.value=!1}}},jt=o.ref(!0);o.watch(v,U=>{var K,de,Ue,Qe;if(Array.isArray((K=U==null?void 0:U.response)==null?void 0:K.data)&&(jt.value=U.response.data.length>0),U.status===Lt.Error){k.value={title:n("certificates.errors.general")},(Qe=(Ue=(de=U.error)==null?void 0:de.response)==null?void 0:Ue.data)!=null&&Qe.message&&(k.value.message=U.error.response.data.message),r("error",U.error);return}Ce.value={},k.value=null});const X=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()&&(X.value.title=n("certificates.list.empty_state.title"),X.value.ctaText=n("certificates.actions.create"))}),(U,K)=>{const de=o.resolveComponent("KButton"),Ue=o.resolveComponent("KCopy"),Qe=o.resolveComponent("KBadge"),zr=o.resolveComponent("KTruncate"),te=o.resolveComponent("KDropdownItem"),Se=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",H1,[o.createVNode(o.unref(Kf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":k.value,fetcher:o.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":o.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":K[2]||(K[2]=Y=>$(Y)),onSort:E},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(Wf),{modelValue:h.value,"onUpdate:modelValue":K[0]||(K[0]=Y=>h.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:o.withCtx(()=>[o.createVNode(o.unref(Vt),{"auth-function":()=>e.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(de,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",size:"large",to:e.config.createRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[o.vShow,jt.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",q1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.subject?Y.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",K1,o.toDisplayString(o.unref(Ee)(Y).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",z1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",G1,o.toDisplayString(o.unref(Ee)(Y).schemaExpiry?o.unref(s)(o.unref(Ee)(Y).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",W1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.dns_names?`dns=${Y.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",J1,o.toDisplayString(o.unref(Ee)(Y).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:Y})=>[Y!=null&&Y.cert?(o.openBlock(),o.createBlock(Ue,{key:0,"data-testid":"copy-certificate-cert",text:Y.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Y1,"-"))]),tags:o.withCtx(({row:Y})=>{var xe;return[((xe=Y==null?void 0:Y.tags)==null?void 0:xe.length)>0?(o.openBlock(),o.createBlock(zr,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Y==null?void 0:Y.tags,Gr=>(o.openBlock(),o.createBlock(Qe,{key:Gr,onClick:K[1]||(K[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Gr),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",Z1,"-"))]}),actions:o.withCtx(({row:Y})=>[o.createVNode(Se,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:Gr=>S(Y,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Se,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:Gr=>A(Y,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canRetrieve(Y)},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:_(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canEdit(Y)},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-edit",item:N(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(Vt),{key:0,"auth-function":()=>e.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-add-sni",item:re(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canDelete(Y)},{default:o.withCtx(()=>[o.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>qr(Y)},{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(zf),{"action-pending":Z.value,"entity-type":o.unref(Ra).Certificate,error:ne.value,title:o.unref(n)("certificates.delete.title"),visible:j.value,onCancel:Kr,onProceed:dr},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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"])])}}}),Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},X1=Hr(Q1,[["__scopeId","data-v-1845028e"]]),eb={class:"kong-ui-entities-certificates-form"},tb=Hr(o.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var k;const r=t,i=e,n=Wr.useRouter(),{i18nT:s,i18n:{t:a}}=wt.useI18n(),{getMessageFromError:l}=Zf(),{axiosInstance:c}=ko((k=i.config)==null?void 0:k.axiosRequestConfig),d=o.computed(()=>Ii.form[i.config.app].edit),y=o.computed(()=>i.certificateId?cr.Edit:cr.Create),p=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),I=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),w=o.computed(()=>(y.value===cr.Create||JSON.stringify(p.fields)!==JSON.stringify(I))&&!!p.fields.cert&&!!p.fields.key),h=S=>{var A;p.fields.cert=(S==null?void 0:S.cert)||"",p.fields.key=(S==null?void 0:S.key)||"",p.fields.certAlt=(S==null?void 0:S.cert_alt)||"",p.fields.keyAlt=(S==null?void 0:S.key_alt)||"",p.fields.tags=((A=S==null?void 0:S.tags)==null?void 0:A.join(", "))||"",Object.assign(I,p.fields)},g=()=>{n.push(i.config.cancelRoute)},b=o.computed(()=>{var A,$;let S=`${i.config.apiBaseUrl}${Ii.form[i.config.app].validate}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((A=i.config)==null?void 0:A.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),v=o.computed(()=>{var A,$;let S=`${i.config.apiBaseUrl}${Ii.form[i.config.app][y.value]}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((A=i.config)==null?void 0:A.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,($=i.config)!=null&&$.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),x=o.computed(()=>{var S,A;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(A=(S=p.fields.tags.split(","))==null?void 0:S.map($=>String($||"").trim()))==null?void 0:A.filter($=>$!=="")}}),E=async()=>{var S,A,$,_,N,re,q;try{p.isReadonly=!0;let j;await c.post(b.value,x.value),y.value==="create"?j=await c.post(v.value,x.value):y.value==="edit"&&(j=((S=i.config)==null?void 0:S.app)==="konnect"?await c.put(v.value,x.value):await c.patch(v.value,x.value)),p.fields.cert=((A=j==null?void 0:j.data)==null?void 0:A.cert)||"",p.fields.key=(($=j==null?void 0:j.data)==null?void 0:$.key)||"",p.fields.certAlt=((_=j==null?void 0:j.data)==null?void 0:_.cert_alt)||"",p.fields.keyAlt=((N=j==null?void 0:j.data)==null?void 0:N.key_alt)||"",p.fields.tags=((q=(re=j==null?void 0:j.data)==null?void 0:re.tags)==null?void 0:q.join(", "))||"",Object.assign(I,p.fields),r("update",j==null?void 0:j.data)}catch(j){p.errorMessage=l(j),r("error",j)}finally{p.isReadonly=!1}};return(S,A)=>{const $=o.resolveComponent("KTextArea"),_=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",eb,[o.createVNode(o.unref(qf),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":x.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":A[5]||(A[5]=N=>S.$emit("error",N)),"onFetch:success":h,onLoading:A[6]||(A[6]=N=>S.$emit("loading",N)),onSubmit:E},{default:o.withCtx(()=>[o.createVNode(o.unref(vo),{description:o.unref(a)("certificates.form.sections.ssl.description"),title:o.unref(a)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode($,{modelValue:p.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=N=>p.fields.cert=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(a)("certificates.form.fields.cert.label"),readonly:p.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(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode($,{modelValue:p.fields.key,"onUpdate:modelValue":A[1]||(A[1]=N=>p.fields.key=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(a)("certificates.form.fields.key.label"),readonly:p.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(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode($,{modelValue:p.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=N=>p.fields.certAlt=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.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(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode($,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=N=>p.fields.keyAlt=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.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(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(vo),{description:o.unref(a)("certificates.form.sections.general.description"),title:o.unref(a)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(_,{modelValue:p.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=N=>p.fields.tags=N),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(a)("certificates.form.fields.tags.help"),label:o.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:o.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-cec1c591"]]),Co="/v2/control-planes/{controlPlaneId}/core-entities",So="/{workspace}",Vi={list:{konnect:`${Co}/ca_certificates`,kongManager:`${So}/ca_certificates`},form:{konnect:{create:`${Co}/ca_certificates`,edit:`${Co}/ca_certificates/{id}`,validate:`${Co}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${So}/ca_certificates`,edit:`${So}/ca_certificates/{id}`,validate:`${So}/schemas/ca_certificates/validate`}}},rb={class:"kong-ui-ca-certificate-entity-config-card"},ib={key:0},nb=Hr(o.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],i=t,n=e,{i18n:{t:s,formatUnixTimeStamp:a}}=wt.useI18n(),{convertKeyToTitle:l}=Xf(),{getPropValue:c}=ep(),{getCertificateData:d}=wt.useCertificate(),y=o.computed(()=>Vi.form[n.config.app].edit),p=o.ref(),I=o.computed(()=>{if(p.value)return d(p.value)}),w=o.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaIssuer)||""}),h=o.computed(()=>{var E,k;return(E=I.value)!=null&&E.schemaExpiry?a((k=I.value)==null?void 0:k.schemaExpiry):""}),g=o.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaKeyUsages)||[]}),b=(E,k)=>{const S=c("rowValue",k);if(E==="expiry")return h.value;if(E==="key_usages")return g.value;if(S)return S[E]},v=E=>{p.value=E,i("fetch:success",E)},x=o.ref({id:{},updated_at:{},created_at:{},cert:{section:fe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:fe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:fe.Basic,type:le.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:fe.Basic,order:1.7,forceShow:!0},issuer:{section:fe.Basic,order:1.5,forceShow:!0},key_usages:{section:fe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(E,k)=>{const S=o.resolveComponent("KCodeBlock"),A=o.resolveComponent("KLabel"),$=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",rb,[o.createVNode(o.unref(Hf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":x.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":k[0]||(k[0]=_=>E.$emit("fetch:error",_)),"onFetch:success":v,onLoading:k[1]||(k[1]=_=>E.$emit("loading",_))},{cert:o.withCtx(_=>[o.unref(c)("rowValue",_)?(o.openBlock(),o.createBlock(S,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:o.unref(c)("rowValue",_),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(A,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(_=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(c)("rowValue",_)).filter(N=>!r.includes(N)),N=>(o.openBlock(),o.createBlock(o.unref(uo),{key:N,"data-testid":`ca-cert-metadata-${N}`,item:{key:N,label:o.unref(l)(N),value:b(N,_),type:N==="key_usages"?o.unref(le).BadgeTag:o.unref(le).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),key_usages:o.withCtx(()=>[g.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",ib,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,(_,N)=>(o.openBlock(),o.createBlock($,{key:`key_usages-badge-tag-${N}`,class:"config-badge","data-testid":`key_usages-badge-tag-${N}`,tooltip:_,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(_),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-b34eea10"]]),ob={class:"kong-ui-entities-ca-certificates-list"},sb={key:0},ab={key:1},lb={key:0},cb={key:1},ub={key:1},db=Hr(o.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var X;const r=t,i=e,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=ko((X=i.config)==null?void 0:X.axiosRequestConfig),d=o.ref(1),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={issuer:{label:n("ca-certificates.list.table_headers.issuer")},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},w=o.computed(()=>{var U,K;let ee=`${i.config.apiBaseUrl}${Vi.list[i.config.app]}`;return i.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((U=i.config)==null?void 0:U.controlPlaneId)||""):i.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(K=i.config)!=null&&K.workspace?`/${i.config.workspace}`:"")),ee}),h=o.ref(""),g=o.computed(()=>{const ee=i.config.app==="konnect"||i.config.isExactMatch;return ee?{isExactMatch:ee,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:ee,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:v}=Qf(i.config,w.value),x=()=>{h.value=""},E=()=>{d.value++},k=o.ref(null),S=(ee,U)=>{const K=ee.id;if(!U(K)){r("copy:error",{entity:ee,field:"id",message:n("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,field:"id",message:n("ca-certificates.copy.success",{val:K})})},A=(ee,U)=>{const K=JSON.stringify(ee);if(!U(K)){r("copy:error",{entity:ee,message:n("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:n("ca-certificates.copy.success_brief")})},$=async ee=>{var K;await((K=i.canRetrieve)==null?void 0:K.call(i,ee))&&l.push(i.config.getViewRoute(ee.id))},_=ee=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),N=ee=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),re=o.ref(void 0),q=o.ref(!1),j=o.ref(!1),Z=o.ref(""),ne=Yf(i.config,w.value),{certificateDataCache:Ie,getCertificateData:Ce}=wt.useCertificate(),Ee=ee=>{re.value=ee,q.value=!0},qr=()=>{q.value=!1},Kr=async()=>{var ee,U,K;if((ee=re.value)!=null&&ee.id){j.value=!0;try{await c.delete(ne(re.value.id)),j.value=!1,q.value=!1,d.value++,r("delete:success",re.value)}catch(de){Z.value=((K=(U=de.response)==null?void 0:U.data)==null?void 0:K.message)||de.message||n("ca-certificates.errors.delete"),r("error",de)}finally{j.value=!1}}},dr=o.ref(!0);o.watch(v,ee=>{var U,K,de,Ue;if(Array.isArray((U=ee==null?void 0:ee.response)==null?void 0:U.data)&&(dr.value=ee.response.data.length>0),ee.status===Lt.Error){k.value={title:n("ca-certificates.errors.general")},(Ue=(de=(K=ee.error)==null?void 0:K.response)==null?void 0:de.data)!=null&&Ue.message&&(k.value.message=ee.error.response.data.message),r("error",ee.error);return}Ie.value={},k.value=null});const jt=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()&&(jt.value.title=n("ca-certificates.list.empty_state.title"),jt.value.ctaText=n("ca-certificates.actions.create"))}),(ee,U)=>{const K=o.resolveComponent("KButton"),de=o.resolveComponent("KBadge"),Ue=o.resolveComponent("KTruncate"),Qe=o.resolveComponent("KDropdownItem"),zr=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",ob,[o.createVNode(o.unref(Kf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":jt.value,"enable-entity-actions":"","error-message":k.value,fetcher:o.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":o.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":U[2]||(U[2]=te=>$(te)),onSort:E},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(Wf),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:o.withCtx(()=>[o.createVNode(o.unref(Vt),{"auth-function":()=>e.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",size:"large",to:e.config.createRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[o.vShow,dr.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:o.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",sb,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.issuer?te.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",ab,o.toDisplayString(o.unref(Ce)(te).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",lb,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.expiry?o.unref(s)(te.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",cb,o.toDisplayString(o.unref(Ce)(te).schemaExpiry?o.unref(s)(o.unref(Ce)(te).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:te})=>{var Se;return[((Se=te==null?void 0:te.tags)==null?void 0:Se.length)>0?(o.openBlock(),o.createBlock(Ue,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(te==null?void 0:te.tags,Y=>(o.openBlock(),o.createBlock(de,{key:Y,onClick:U[1]||(U[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",ub,"-"))]}),actions:o.withCtx(({row:te})=>[o.createVNode(zr,null,{default:o.withCtx(({copyToClipboard:Se})=>[o.createVNode(Qe,{"data-testid":"action-entity-copy-id",onClick:Y=>S(te,Se)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(zr,null,{default:o.withCtx(({copyToClipboard:Se})=>[o.createVNode(Qe,{"data-testid":"action-entity-copy-json",onClick:Y=>A(te,Se)},{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(Vt),{"auth-function":()=>e.canRetrieve(te)},{default:o.withCtx(()=>[o.createVNode(Qe,{"data-testid":"action-entity-view","has-divider":"",item:_(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canEdit(te)},{default:o.withCtx(()=>[o.createVNode(Qe,{"data-testid":"action-entity-edit",item:N(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Vt),{"auth-function":()=>e.canDelete(te)},{default:o.withCtx(()=>[o.createVNode(Qe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>Ee(te)},{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(zf),{"action-pending":j.value,"entity-type":o.unref(Ra).CACertificate,error:Z.value,title:o.unref(n)("ca-certificates.delete.title"),visible:q.value,onCancel:qr,onProceed:Kr},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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-c0528843"]]),fb={class:"kong-ui-entities-ca-certificates-form"},pb=Hr(o.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var E;const r=t,i=e,n=Wr.useRouter(),{i18n:{t:s}}=wt.useI18n(),{getMessageFromError:a}=Zf(),{axiosInstance:l}=ko((E=i.config)==null?void 0:E.axiosRequestConfig),c=o.computed(()=>Vi.form[i.config.app].edit),d=o.computed(()=>i.certificateId?cr.Edit:cr.Create),y=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=o.reactive({cert:"",certDigest:"",tags:""}),I=o.computed(()=>(d.value===cr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=k=>{var S;y.fields.cert=(k==null?void 0:k.cert)||"",y.fields.certDigest=(k==null?void 0:k.cert_digest)||"",y.fields.tags=((S=k==null?void 0:k.tags)==null?void 0:S.join(", "))||"",Object.assign(p,y.fields)},h=()=>{n.push(i.config.cancelRoute)},g=o.computed(()=>{var S,A;let k=`${i.config.apiBaseUrl}${Vi.form[i.config.app].validate}`;return i.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((S=i.config)==null?void 0:S.controlPlaneId)||""):i.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(A=i.config)!=null&&A.workspace?`/${i.config.workspace}`:"")),k=k.replace(/{id}/gi,i.certificateId),k}),b=o.computed(()=>{var S,A;let k=`${i.config.apiBaseUrl}${Vi.form[i.config.app][d.value]}`;return i.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((S=i.config)==null?void 0:S.controlPlaneId)||""):i.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(A=i.config)!=null&&A.workspace?`/${i.config.workspace}`:"")),k=k.replace(/{id}/gi,i.certificateId),k}),v=o.computed(()=>{var k,S;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(S=(k=y.fields.tags.split(","))==null?void 0:k.map(A=>String(A||"").trim()))==null?void 0:S.filter(A=>A!=="")}}),x=async()=>{var k,S,A,$,_;try{y.isReadonly=!0;let N;await l.post(g.value,v.value),d.value==="create"?N=await l.post(b.value,v.value):d.value==="edit"&&(N=((k=i.config)==null?void 0:k.app)==="konnect"?await l.put(b.value,v.value):await l.patch(b.value,v.value)),y.fields.cert=((S=N==null?void 0:N.data)==null?void 0:S.cert)||"",y.fields.certDigest=((A=N==null?void 0:N.data)==null?void 0:A.cert_digest)||"",y.fields.tags=((_=($=N==null?void 0:N.data)==null?void 0:$.tags)==null?void 0:_.join(", "))||"",Object.assign(p,y.fields),r("update",N==null?void 0:N.data)}catch(N){y.errorMessage=a(N),r("error",N)}finally{y.isReadonly=!1}};return(k,S)=>{const A=o.resolveComponent("KTextArea"),$=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",fb,[o.createVNode(o.unref(qf),{"can-submit":I.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":c.value,"form-fields":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":S[3]||(S[3]=_=>k.$emit("error",_)),"onFetch:success":w,onLoading:S[4]||(S[4]=_=>k.$emit("loading",_)),onSubmit:x},{default:o.withCtx(()=>[o.createVNode(o.unref(vo),{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(A,{modelValue:y.fields.cert,"onUpdate:modelValue":S[0]||(S[0]=_=>y.fields.cert=_),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:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode($,{modelValue:y.fields.certDigest,"onUpdate:modelValue":S[1]||(S[1]=_=>y.fields.certDigest=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(vo),{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($,{modelValue:y.fields.tags,"onUpdate:modelValue":S[2]||(S[2]=_=>y.fields.tags=_),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:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-54396784"]]),hb={class:"kong-ui-certificate-entity-config-card"},yb={key:0},gb=Hr(o.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e,{emit:t}){const r=t,i=e,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),{convertKeyToTitle:l}=Xf(),{getPropValue:c}=ep(),{getCertificateData:d}=wt.useCertificate(),y=o.computed(()=>Ii.form[i.config.app].edit),p=o.ref(),I=o.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:le.Redacted},metadata:{section:fe.Basic,type:le.Json},snis:{section:fe.Basic,type:le.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:fe.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:fe.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:fe.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:fe.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:fe.Advanced},key_alt:{section:fe.Advanced,type:le.Redacted}}),w=_=>{p.value=_,r("fetch:success",_)},h=(_,N)=>{const re=c("rowValue",N);if(_==="expiry")return b.value;if(_==="key_usages")return k.value;if(_==="san_names")return x.value;if(re)return re[_]},g=o.computed(()=>{if(p.value)return d(p.value)}),b=o.computed(()=>{var _,N;return(_=g.value)!=null&&_.schemaExpiry?s((N=g.value)==null?void 0:N.schemaExpiry):""}),v=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaIssuer)||""}),x=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaSanNames)||""}),E=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaSubject)||""}),k=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaKeyUsages)||[]}),S=o.computed(()=>{var _,N;return((N=(_=p==null?void 0:p.value)==null?void 0:_.snis)==null?void 0:N.length)>0}),A=o.computed(()=>{var _;return!!((_=p==null?void 0:p.value)!=null&&_.cert_alt)}),$=_=>{var N,re;return _==="san_names"?n("certificates.list.table_headers.san"):((re=(N=I.value)==null?void 0:N[_])==null?void 0:re.label)||l(_)};return(_,N)=>{const re=o.resolveComponent("KCodeBlock"),q=o.resolveComponent("KLabel"),j=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",hb,[o.createVNode(o.unref(Hf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":I.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":N[0]||(N[0]=Z=>_.$emit("fetch:error",Z)),"onFetch:success":w,onLoading:N[1]||(N[1]=Z=>_.$emit("loading",Z))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(Z=>[o.unref(c)("rowValue",Z)?(o.openBlock(),o.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:o.unref(c)("rowValue",Z),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(q,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(Z=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(c)("rowValue",Z)),ne=>(o.openBlock(),o.createBlock(o.unref(uo),{key:ne,item:{key:ne,value:h(ne,Z),label:$(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?o.unref(le).BadgeTag:o.unref(le).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(b.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(v.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(x.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(E.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(a),{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(()=>[k.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",yb,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(k.value,(Z,ne)=>(o.openBlock(),o.createBlock(j,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:Z,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Z),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[S.value?void 0:{name:"snis",fn:o.withCtx(()=>[o.createTextVNode(" – ")]),key:"0"},A.value?{name:"cert_alt",fn:o.withCtx(Z=>[o.createTextVNode(" > "),o.unref(c)("rowValue",Z)?(o.openBlock(),o.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:o.unref(c)("rowValue",Z),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-d40682b9"]]);je.CACertificateConfigCard=nb,je.CACertificateForm=pb,je.CACertificateList=db,je.CertificateConfigCard=gb,je.CertificateForm=tb,je.CertificateList=X1,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|