@kong-ui-public/entities-key-sets 1.2.28 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,32 @@
1
- (function(Z,e){typeof exports=="object"&&typeof module<"u"?e(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"],e):(Z=typeof globalThis<"u"?globalThis:Z||self,e(Z["kong-ui-public-entities-key-sets"]={},Z.Vue,Z.VueRouter,Z["kong-ui-public-i18n"],Z.axios,Z.Kongponents))})(this,function(Z,e,Nt,ut,hn,Wt){"use strict";const kn={keySets:{title:"Key Sets",list:{toolbar_actions:{new_key_set:"New Key Set"},table_headers:{name:"Name",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key Set",description:"A Key Set object holds a collection of asymmetric key objects. This entity allows to logically group keys by their purpose."}},actions:{create:"New Key Set",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact name or ID"},delete:{title:"Delete a Key Set",description:"Deleting this key set will also delete keys associated. This action cannot be reversed so make sure to check the key set usage before deleting."},errors:{general:"Key sets could not be retrieved",delete:"The key set 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"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key set."}},fields:{name:{label:"Name",placeholder:"Enter a unique name for this key set"},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."}}}}};function bn(){const t=ut.createI18n("en-us",kn);return{i18n:t,i18nT:ut.i18nTComponent(t)}}const _t={useI18n:bn},bt={list:{konnect:"/api/runtime_groups/{controlPlaneId}/key-sets",kongManager:"/{workspace}/key-sets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/key-sets",edit:"/api/runtime_groups/{controlPlaneId}/key-sets/{id}"},kongManager:{create:"/{workspace}/key-sets",edit:"/{workspace}/key-sets/{id}"}}};var Zt=(t=>(t.GatewayService="service",t.Route="route",t.Consumer="consumer",t.ConsumerGroup="consumer group",t.Plugin="plugin",t.Upstream="upstream",t.Certificate="certificate",t.CACertificate="ca certificate",t.SNI="SNI",t.Key="key",t.KeySet="key set",t.Vault="vault",t.Application="application",t.Developer="developer",t.acls="ACL Credential",t["basic-auth"]="Basic Auth Credential",t["key-auth"]="Key Auth Credential",t["key-auth-enc"]="Key Auth Encrypted Credential",t.oauth2="OAuth 2.0 Credential",t["hmac-auth"]="HMAC Credential",t.jwt="JWT Credential",t.Target="target",t.Policy="policy",t))(Zt||{}),Tt=(t=>(t.Edit="edit",t.Create="create",t))(Tt||{}),at=(t=>(t[t.Loading=0]="Loading",t[t.Idle=1]="Idle",t[t.NoResults=2]="NoResults",t[t.Error=3]="Error",t))(at||{}),$=(t=>(t.ID="id",t.IdArray="id-array",t.Text="plain-text",t.Date="date",t.Redacted="redacted",t.RedactedArray="redacted-array",t.Json="json",t.JsonArray="json-array",t.BadgeTag="badge-tag",t.BadgeStatus="badge-status",t.BadgeMethod="badge-method",t.LinkInternal="link-internal",t.LinkExternal="link-external",t))($||{}),G=(t=>(t.Basic="basic",t.Advanced="advanced",t.Plugin="plugin",t))(G||{});function Et(t={}){return{axiosInstance:hn.create({withCredentials:!0,timeout:3e4,...t})}}function Cn(){return{debounce:(t,o)=>{let n;return(...a)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{t(...a)},o)}}}}const Vt="khcp-user-table-preferences",wn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Sn(){const t=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(a){console.error("useTablePreferences(tryParseJson)",a);return}},o=()=>{const n=t(localStorage.getItem(Vt));return!n||!Object.keys(n).length?new Map:new Map(Object.entries(n))};return{setTablePreferences:(n,a)=>{try{const r=o();r.set(n,a),localStorage.setItem(Vt,JSON.stringify(Object.fromEntries(r.entries())))}catch(r){console.error("useTablePreferences(setTablePreferences)",r)}},getTablePreferences:n=>{const a=o();return(a==null?void 0:a.get(n))||void 0||wn},deleteAllTablePreferences:()=>{localStorage.removeItem(Vt)}}}const xn={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Bn={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},In={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},An={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Nn={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"}},_n={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Tn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},En={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Vn={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"}},jn={global:xn,deleteModal:Bn,baseForm:In,baseTable:An,baseConfigCard:Nn,filter:_n,debouncedFilter:Tn,errors:En,toggleModal:Vn};function jt(){const t=ut.createI18n("en-us",jn);return{i18n:t,i18nT:ut.i18nTComponent(t)}}function Gt(){const t=(n,a)=>(a==null?void 0:a[n])??void 0,o=(n,a)=>{if(n.length!==a.length)return!1;const r=new Set([...n,...a]);for(const i of r){const l=n.filter(c=>c===i).length,s=a.filter(c=>c===i).length;if(l!==s)return!1}return!0};return{getPropValue:t,objectsAreEqual:(n,a,r)=>{if(r){if(Object.keys(n).length===Object.keys(a).length)for(const i in n)if(Array.isArray(n[i])&&Array.isArray(a[i])){if(o(n[i],a[i]))continue;return!1}else{if(n[i]===a[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(n)===JSON.stringify(a)}catch{return!1}},sortAlpha:n=>(a,r)=>{let i=a[n]===void 0||a[n]===null?"":a[n],l=r[n]===void 0||r[n]===null?"":r[n];return Array.isArray(a[n])&&(i=a[n][0]),Array.isArray(r[n])&&(l=r[n][0]),i.localeCompare(l)},isValidUuid:n=>n?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n):!1}}function $n(t,o,n,a={fetchedItemsKey:"data",searchKeys:["id"]}){n||(n="100");const{axiosInstance:r}=Et({headers:t.requestHeaders}),{i18n:{t:i}}=jt(),{debounce:l}=Cn(),s=l(async w=>{await b(w)},200),c=e.ref(!1),d=e.ref(""),u=e.ref(""),p=e.ref([]),y=e.ref([]),m=e.ref(void 0),S=e.unref(o);let k=`${t.apiBaseUrl}${S}`;t.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,(t==null?void 0:t.controlPlaneId)||""):t.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,t!=null&&t.workspace?`/${t.workspace}`:""));const{isValidUuid:f}=Gt(),h=async()=>{try{c.value=!0;const{data:w}=await r.get(`${k}?size=${n}`);w!=null&&w.next||(m.value=a.fetchedItemsKey in w?w[a.fetchedItemsKey]:[]),y.value=a.fetchedItemsKey in w?w[a.fetchedItemsKey]:[],p.value=y.value}catch{p.value=[],d.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},g=e.ref(""),b=async w=>{var K,D,T;if(g.value!==w)if(g.value=w||"",m.value===void 0)try{if(c.value=!0,d.value="",u.value="",t.app==="konnect"){let C=k+"";w&&(C+=`/${w}`);const{data:N}=await r.get(`${C}?size=${n}`);a.fetchedItemsKey in N?p.value=N[a.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(w){const C=[];f(w)&&a.searchKeys.includes("id")?C.push((async()=>{const{data:I}=await r.get(`${k}/${w}`);return[I[a.fetchedItemsKey]??I]})()):C.push(...a.searchKeys.filter(I=>I!=="id").map(async I=>{const{data:_}=await r.get(`${k}?${I}=${w}`);return _[a.fetchedItemsKey]}));const N=await Promise.all(C),B=new Set;p.value=[],(K=N==null?void 0:N.forEach)==null||K.call(N,I=>{var _;(_=I==null?void 0:I.forEach)==null||_.call(I,E=>{B.has(E.id)||(B.add(E.id),p.value.push(E))})})}else p.value=y.value}catch(C){((D=C==null?void 0:C.response)==null?void 0:D.status)===404?u.value=i("debouncedFilter.errors.invalid"):(p.value=[],d.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,u.value="",w?(p.value=(T=m.value)==null?void 0:T.filter(C=>{var N;let B=!1;for(const I of a.searchKeys){const _=typeof C[I]=="string"?(N=C[I])==null?void 0:N.toLowerCase():C[I];_!=null&&_.includes(w.toLowerCase())&&(B=!0)}return B}),(!p.value||!p.value.length)&&(u.value=i("debouncedFilter.errors.invalid"))):p.value=m.value,c.value=!1};return{loading:c,error:d,validationError:u,results:p,allRecords:m,loadItems:h,debouncedQueryChange:s}}function On(t,o){const n=e.unref(o),a=e.computed(()=>t.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${n}`):new URL(n));return a.value.search="",r=>`${a.value.href}/${r}`}function Mn(){const{i18n:{t}}=jt();return{getMessageFromError:o=>{var n,a,r;if(!o)return t("errors.unexpected");if((n=o==null?void 0:o.response)!=null&&n.data){if(o.response.data.detail)return o.response.data.detail;if((a=o.response.data.details)!=null&&a.length)return o.response.data.details.map(i=>{let l=t("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(l=i.messages.join(", ")),i.field?`${i.field} - ${l}`:l}).join("; ");if(o.response.data.message){const{message:i}=o.response.data;return Array.isArray(i)?(r=i[0])!=null&&r.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof o.response.data=="string")return o.response.data;if(typeof o.response.data=="object")return Object.keys(o.response.data).map(i=>`${i} ${o.response.data[i]}`).join(", ")}return o.message||t("errors.unexpected")}}}function Fn(t){const o=window.location.origin,n=o.endsWith("/")?o:`${o}/`;try{const a=t.join("/"),r=`${n}${a}`,i=t.some(l=>l.trim()==="");if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(r)&&!i&&new URL(r))return`${n}${a}`;throw new Error("Invalid url")}catch(a){return console.warn("Failed to build valid URL:",a),""}}function Xt(t,o){const n=e.ref(e.unref(t)),a=e.ref(e.unref(o)),r=e.computed(()=>!!(n.value.app==="konnect"||n.value.isExactMatch)),i=e.computed(()=>a.value.startsWith("/")?new URL(`${window.location.origin}${a.value}`):new URL(a.value));return l=>{const{page:s,pageSize:c,offset:d,sortColumnKey:u,sortColumnOrder:p,query:y}=l;try{let m=new URL(i.value.href);return r.value&&y?(m.search="",m=new URL(`${m.href}/${y}/`)):(r.value||new URLSearchParams(y).forEach((S,k)=>{m.searchParams.append(k,S)}),u&&m.searchParams.append("sort_by",u),p==="desc"&&m.searchParams.append("sort_desc","1"),m.searchParams.append("size",String(c))),d&&s!==1&&m.searchParams.append("offset",String(d)),m.href}catch(m){return console.error("RouteList(fetcher)",m),a.value}}}function Kn(t,o,n="data"){const a=e.unref(o),{axiosInstance:r}=Et({headers:t.requestHeaders}),i=Xt(t,a),l=e.ref({status:at.Idle});return{fetcher:async s=>{try{l.value={status:at.Loading};const c=i(s),{data:d}=await r.get(c),u=n&&n.replace(/[^\w-_]/gi,"");let p;d[u]&&Array.isArray(d[u])?p=d[u]:p=Object.keys(d).length?[d]:[];const y={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return l.value={status:at.Idle,response:y},y}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(l.value={status:at.NoResults,response:d,error:c},d):(l.value={status:at.Error,response:d,error:c},d)}},fetcherState:l}}function Dn(){const t=(n,a="_")=>n?n.split(a).map(r=>r.toLowerCase()==="id"?r.toUpperCase():r.charAt(0).toUpperCase()+r.substring(1)).join(" "):"",o=/(?:^|[\s-:'"])\w/g;return{capitalize:n=>n?n.replace(o,a=>a.toUpperCase()):"",convertKeyToTitle:t}}const Qt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,te=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");const o=t.match(Qt);if(!o)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return o.shift(),o},ee=t=>t==="*"||t==="x"||t==="X",ne=t=>{const o=parseInt(t,10);return isNaN(o)?t:o},Ln=(t,o)=>typeof t!=typeof o?[String(t),String(o)]:[t,o],qn=(t,o)=>{if(ee(t)||ee(o))return 0;const[n,a]=Ln(ne(t),ne(o));return n>a?1:n<a?-1:0},oe=(t,o)=>{for(let n=0;n<Math.max(t.length,o.length);n++){const a=qn(t[n]||"0",o[n]||"0");if(a!==0)return a}return 0},vn=(t,o)=>{const n=te(t),a=te(o),r=n.pop(),i=a.pop(),l=oe(n,a);return l!==0?l:r&&i?oe(r.split("."),i.split(".")):r||i?r?-1:1:0},ae=(t,o,n)=>{Pn(n);const a=vn(t,o);return re[n].includes(a)},re={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ie=Object.keys(re),Pn=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(ie.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${ie.join("|")}`)},Rn=t=>typeof t=="string"&&/^[v\d]/.test(t)&&Qt.test(t);function Un(t){const{gatewayInfo:o,supportedRange:n}=t;if(!o)return!0;const{edition:a,version:r}=o;if(!Rn(r))return console.error("Invalid version"),!1;const i=n[a];if(!i)return!1;const[l,s]=i;return!(l&&ae(r,l,"<")||s&&ae(r,s,">"))}function zn(t){const o=e.ref(0),n=e.ref(0),a=e.ref(!1);return e.watch(t,r=>{r&&!a.value&&(o.value=r.offsetWidth,n.value=r.scrollWidth,a.value=!0)}),{isTruncated:e.computed(()=>o.value<n.value)}}const Hn=new Wt.ToastManager;function Jn(){return{notify:async t=>{const o={appearance:"success",message:"Success",timeoutMilliseconds:3e3};Hn.open({...o,...t})}}}const P={useAxios:Et,useDebouncedFilter:$n,useDeleteUrlBuilder:On,useErrors:Mn,useExternalLinkCreator:Fn,useFetcher:Kn,useFetchUrlBuilder:Xt,useHelpers:Gt,useStringHelpers:Dn,useI18n:jt,useGatewayFeatureSupported:Un,useTruncationDetector:zn,useToaster:Jn},Yn={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Wn="Copy to clipboard",Zn={message:Yn,iconTitle:Wn},Gn="kong-ui-copy-uuid-notify",Xn={class:"kong-ui-copy-uuid"},Qn=["onClick"],le=15,to=e.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:t=>["uuid","hidden","redacted","deleted"].includes(t)}},emits:["success","error"],setup(t,{emit:o}){const n=t,{t:a}=ut.createI18n("en-us",Zn),r=n.notify||e.inject(Gn,()=>{}),i=e.computed(()=>n.idTooltip?{label:n.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:n.uuid}),l=e.computed(()=>!!(n.tooltip&&n.successTooltip)),s=e.ref(n.tooltip),c=e.computed(()=>n.tooltip?{label:s.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=e.computed(()=>{var y;return n.format==="redacted"?"*****":n.format==="deleted"?`*${(y=n.uuid)==null?void 0:y.substring(0,5)}`:n.uuid}),u=y=>{s.value=y,setTimeout(()=>{s.value=n.tooltip},1800)},p=y=>{var m,S;if(!y(n.uuid)){typeof r=="function"&&r({type:"error",message:a("message.fail")}),l.value?u(a("message.fail")):o("error",n.uuid);return}const k=((m=n.uuid)==null?void 0:m.length)>le,f=n.format==="hidden"||n.format==="redacted"?a("message.success.prefix"):`"${((S=n.uuid)==null?void 0:S.substring(0,le))+(k?"...":"")}"`;typeof r=="function"&&r({type:"success",message:`${f}${a("message.success.content")}`}),l.value?u(n.successTooltip):o("success",n.uuid)};return(y,m)=>{const S=e.resolveComponent("KIcon"),k=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",Xn,[t.format!=="hidden"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.idTooltip?"KTooltip":"div"),e.mergeProps({key:0},i.value,{"data-testid":"copy-id"}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["uuid-container",t.truncated?"truncated-uuid":null,t.useMono?"mono":null])},e.toDisplayString(d.value),3)]),_:1},16)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tooltip?"KTooltip":"div"),e.mergeProps(c.value,{class:"uuid-icon-wrapper"}),{default:e.withCtx(()=>[e.createVNode(k,null,{default:e.withCtx(({copyToClipboard:f})=>[e.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:e.withModifiers(h=>p(f),["stop"])},[e.createVNode(S,{class:"uuid-icon",color:t.iconColor,"hide-title":!!t.tooltip||void 0,icon:"copy",size:"16",title:e.unref(a)("iconTitle")},null,8,["color","hide-title","title"])],8,Qn)]),_:1})]),_:1},16))])}}}),eo=(t,o)=>{const n=t.__vccOpts||t;for(const[a,r]of o)n[a]=r;return n},se=eo(to,[["__scopeId","data-v-a2ebe0bb"]]),no={key:0,class:"config-card-fieldset-title"},oo=e.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(t){const o=t,{i18n:{t:n}}=P.useI18n(),{convertKeyToTitle:a}=P.useStringHelpers(),r=e.computed(()=>o.item.key??"json-array-item"),i=e.computed(()=>o.item.value??o.item),l=e.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return o.isArrayItem&&delete c.name,c}),s=e.computed(()=>{var c;return o.isArrayItem?(c=i.value)!=null&&c.name?a(i.value.name,"_"):n("baseConfigCard.general.entryTitle",{index:o.index}):""});return(c,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.isArrayItem?"fieldset":"div"),{class:e.normalizeClass(t.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:e.withCtx(()=>[t.isArrayItem?(e.openBlock(),e.createElementBlock("legend",no,[e.createElementVNode("b",null,e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(l.value),(u,p)=>(e.openBlock(),e.createBlock($t,{key:`${r.value}-property-${p}`,item:{key:u,label:e.unref(a)(u),value:l.value[u]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),X=(t,o)=>{const n=t.__vccOpts||t;for(const[a,r]of o)n[a]=r;return n},ce=X(oo,[["__scopeId","data-v-68ca83ec"]]),ao=X(e.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(t){const{i18n:{t:o}}=P.useI18n();return(n,a)=>{const r=e.resolveComponent("KButton");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(r,{appearance:"btn-link",class:"navigation-button",onClick:a[0]||(a[0]=i=>n.$emit("navigation-click",t.item))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.item.value||e.unref(o)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-7410504d"]]),ro=e.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(t){const{i18n:{t:o}}=P.useI18n();return(n,a)=>{const r=e.resolveComponent("KBadge");return e.openBlock(),e.createBlock(r,{appearance:t.status?"success":"neutral"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.status?e.unref(o)("baseConfigCard.statusBadge.enabledLabel"):e.unref(o)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),io="#0044f4",lo="#e0e4ea",so="#3a3f51",co="1px",po="20px",uo={class:"config-card-details-row"},fo=["data-testid"],mo=["data-testid"],yo=["data-testid"],go=["data-testid"],ho={key:1},ko=["data-testid"],bo=["data-testid"],Co=["data-testid"],wo=["data-testid"],So={name:"ConfigCardItem",components:{CopyUuid:se,JsonCardItem:ce,StatusBadge:ro,InternalLinkItem:ao}},xo=e.defineComponent({...So,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(t,{emit:o}){const n=t;e.useCssVars(m=>({"1df60db4":d.value?"none":`solid ${e.unref(co)} ${e.unref(lo)}`,"21d1d34e":c.value&&l.value?"block":"flex","4d3dc7e7":c.value&&l.value?"100%":n.slim?"50%":"25%","4d400dc2":c.value&&l.value?"100%":n.slim?"50%":"75%"}));const a=e.useSlots(),{i18n:{t:r,formatUnixTimeStamp:i}}=P.useI18n(),l=e.computed(()=>n.item.value!==void 0&&n.item.value!==null&&n.item.value!==""),s=e.computed(()=>!!(n.item.tooltip||a["label-tooltip"])),c=e.computed(()=>n.item.type===$.Json||n.item.type===$.JsonArray),d=e.computed(()=>n.item.type===$.JsonArray),u=e.computed(()=>{switch(n.item.type){case $.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid`,"success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case $.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case $.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case $.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":r("baseConfigCard.copy.success"),tooltip:r("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case $.Date:return{tag:"div",attrs:{"data-testid":`${n.item.key}-date`},text:i(n.item.value)};case $.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${n.item.key}-badge-status`,status:n.item.value}};case $.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case $.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case $.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${n.item.key}-internal-link`,item:n.item,onNavigationClick:m=>{o("navigation-click",m)}}};case $.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${n.item.key}-external-link`,href:n.item.value},text:n.item.value};case $.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-content`,item:n.item}};case $.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-array-content`,item:n.item}};default:return{tag:"div",attrs:{"data-testid":`${n.item.key}-plain-text`},text:n.item.value}}}),p=e.ref(),{isTruncated:y}=P.useTruncationDetector(p);return(m,S)=>{const k=e.resolveComponent("KLabel"),f=e.resolveComponent("KBadge"),h=e.resolveComponent("KMethodBadge"),g=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("div",uo,[e.createElementVNode("div",{class:"config-card-details-label","data-testid":`${t.item.key}-label`},[e.renderSlot(m.$slots,"label",{item:t.item},()=>[e.createVNode(k,{"tooltip-attributes":{maxWidth:"500px"}},e.createSlots({default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.item.label)+" ",1)]),_:2},[s.value?{name:"tooltip",fn:e.withCtx(()=>[e.createElementVNode("div",{"data-testid":`${t.item.key}-label-tooltip`},[e.renderSlot(m.$slots,"label-tooltip",{},()=>[e.createTextVNode(e.toDisplayString(t.item.tooltip),1)],!0)],8,mo)]),key:"0"}:void 0]),1024)],!0)],8,fo),e.createElementVNode("div",{class:"config-card-details-value","data-testid":`${t.item.key}-property-value`},[e.renderSlot(m.$slots,t.item.key,{rowValue:t.item.value},()=>[l.value?(e.openBlock(),e.createElementBlock("div",ho,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value.tag),e.normalizeProps(e.guardReactiveProps(u.value.attrs)),{default:e.withCtx(()=>[u.value.additionalComponent==="KBadge"?(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":`${t.item.key}-badge-tags`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(b,w)=>(e.openBlock(),e.createBlock(f,{key:`${t.item.key}-badge-tag-${w}`,class:"config-badge","data-testid":`${t.item.key}-badge-tag-${w}`,"truncation-tooltip":b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,ko)):e.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${t.item.key}-copy-uuid-array`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(b,w)=>(e.openBlock(),e.createBlock(e.unref(se),e.mergeProps(u.value.childAttrs,{key:`${t.item.key}-copy-uuid-${w}`,"data-testid":`${t.item.key}-copy-uuid-${w}`,uuid:b}),null,16,["data-testid","uuid"]))),128))],8,bo)):u.value.additionalComponent==="KMethodBadge"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${t.item.key}-badge-methods`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(b,w)=>(e.openBlock(),e.createBlock(h,{key:`${t.item.key}-badge-method-${w}`,class:"config-badge","data-testid":`${t.item.key}-badge-method-${w}`,"is-rounded":"",label:b,method:e.unref(Wt.MethodsArray).includes(b.toLowerCase())?b.toLowerCase():"custom"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,Co)):e.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(e.openBlock(),e.createElementBlock("div",{key:3,"data-testid":`${n.item.key}-json-array-content`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(b,w)=>(e.openBlock(),e.createBlock(ce,{key:`json-array-item-${w}`,index:w,"is-array-item":"",item:b},null,8,["index","item"]))),128))],8,wo)):(e.openBlock(),e.createBlock(g,{key:4,label:e.unref(y)?t.item.value:""},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"textContent",ref:p,class:e.normalizeClass(["attrs-data-text",{truncated:t.truncated}])},e.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":`${t.item.key}-no-value`}," – ",8,go))],!0)],8,yo)])}}}),$t=X(xo,[["__scopeId","data-v-307ab96d"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function de(t){return typeof t>"u"||t===null}function Bo(t){return typeof t=="object"&&t!==null}function Io(t){return Array.isArray(t)?t:de(t)?[]:[t]}function Ao(t,o){var n,a,r,i;if(o)for(i=Object.keys(o),n=0,a=i.length;n<a;n+=1)r=i[n],t[r]=o[r];return t}function No(t,o){var n="",a;for(a=0;a<o;a+=1)n+=t;return n}function _o(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var To=de,Eo=Bo,Vo=Io,jo=No,$o=_o,Oo=Ao,q={isNothing:To,isObject:Eo,toArray:Vo,repeat:jo,isNegativeZero:$o,extend:Oo};function pe(t,o){var n="",a=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!o&&t.mark.snippet&&(n+=`
1
+ (function(G,e){typeof exports=="object"&&typeof module<"u"?e(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"],e):(G=typeof globalThis<"u"?globalThis:G||self,e(G["kong-ui-public-entities-key-sets"]={},G.Vue,G.VueRouter,G["kong-ui-public-i18n"],G.axios,G.Kongponents))})(this,function(G,e,At,ut,bn,Wt){"use strict";const Cn={keySets:{title:"Key Sets",list:{toolbar_actions:{new_key_set:"New Key Set"},table_headers:{name:"Name",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key Set",description:"A Key Set object holds a collection of asymmetric key objects. This entity allows to logically group keys by their purpose."}},actions:{create:"New Key Set",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact name or ID"},delete:{title:"Delete a Key Set",description:"Deleting this key set will also delete keys associated. This action cannot be reversed so make sure to check the key set usage before deleting."},errors:{general:"Key sets could not be retrieved",delete:"The key set 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"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key set."}},fields:{name:{label:"Name",placeholder:"Enter a unique name for this key set"},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."}}}}};function wn(){const t=ut.createI18n("en-us",Cn);return{i18n:t,i18nT:ut.i18nTComponent(t)}}const _t={useI18n:wn},bt={list:{konnect:"/api/runtime_groups/{controlPlaneId}/key-sets",kongManager:"/{workspace}/key-sets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/key-sets",edit:"/api/runtime_groups/{controlPlaneId}/key-sets/{id}"},kongManager:{create:"/{workspace}/key-sets",edit:"/{workspace}/key-sets/{id}"}}};var Gt=(t=>(t.GatewayService="service",t.Route="route",t.Consumer="consumer",t.ConsumerGroup="consumer group",t.Plugin="plugin",t.Upstream="upstream",t.Certificate="certificate",t.CACertificate="ca certificate",t.SNI="SNI",t.Key="key",t.KeySet="key set",t.Vault="vault",t.Application="application",t.Developer="developer",t.acls="ACL Credential",t["basic-auth"]="Basic Auth Credential",t["key-auth"]="Key Auth Credential",t["key-auth-enc"]="Key Auth Encrypted Credential",t.oauth2="OAuth 2.0 Credential",t["hmac-auth"]="HMAC Credential",t.jwt="JWT Credential",t.Target="target",t.Policy="policy",t))(Gt||{}),Tt=(t=>(t.Edit="edit",t.Create="create",t))(Tt||{}),rt=(t=>(t[t.Loading=0]="Loading",t[t.Idle=1]="Idle",t[t.NoResults=2]="NoResults",t[t.Error=3]="Error",t))(rt||{}),j=(t=>(t.ID="id",t.IdArray="id-array",t.Text="plain-text",t.Date="date",t.Redacted="redacted",t.RedactedArray="redacted-array",t.Json="json",t.JsonArray="json-array",t.BadgeTag="badge-tag",t.BadgeStatus="badge-status",t.BadgeMethod="badge-method",t.LinkInternal="link-internal",t.LinkExternal="link-external",t))(j||{}),Z=(t=>(t.Basic="basic",t.Advanced="advanced",t.Plugin="plugin",t))(Z||{});function Et(t={}){return{axiosInstance:bn.create({withCredentials:!0,timeout:3e4,...t})}}function Sn(){return{debounce:(t,o)=>{let n;return(...r)=>{clearTimeout(n),n=window==null?void 0:window.setTimeout(()=>{t(...r)},o)}}}}const Vt="khcp-user-table-preferences",xn={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Bn(){const t=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},o=()=>{const n=t(localStorage.getItem(Vt));return!n||!Object.keys(n).length?new Map:new Map(Object.entries(n))};return{setTablePreferences:(n,r)=>{try{const a=o();a.set(n,r),localStorage.setItem(Vt,JSON.stringify(Object.fromEntries(a.entries())))}catch(a){console.error("useTablePreferences(setTablePreferences)",a)}},getTablePreferences:n=>{const r=o();return(r==null?void 0:r.get(n))||void 0||xn},deleteAllTablePreferences:()=>{localStorage.removeItem(Vt)}}}const Nn={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},In={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},An={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},_n={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Tn={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"}},En={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Vn={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},$n={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},jn={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"}},On={global:Nn,deleteModal:In,baseForm:An,baseTable:_n,baseConfigCard:Tn,filter:En,debouncedFilter:Vn,errors:$n,toggleModal:jn};function $t(){const t=ut.createI18n("en-us",On);return{i18n:t,i18nT:ut.i18nTComponent(t)}}function Zt(){const t=(n,r)=>(r==null?void 0:r[n])??void 0,o=(n,r)=>{if(n.length!==r.length)return!1;const a=new Set([...n,...r]);for(const i of a){const l=n.filter(c=>c===i).length,s=r.filter(c=>c===i).length;if(l!==s)return!1}return!0};return{getPropValue:t,objectsAreEqual:(n,r,a)=>{if(a){if(Object.keys(n).length===Object.keys(r).length)for(const i in n)if(Array.isArray(n[i])&&Array.isArray(r[i])){if(o(n[i],r[i]))continue;return!1}else{if(n[i]===r[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(n)===JSON.stringify(r)}catch{return!1}},sortAlpha:n=>(r,a)=>{let i=r[n]===void 0||r[n]===null?"":r[n],l=a[n]===void 0||a[n]===null?"":a[n];return Array.isArray(r[n])&&(i=r[n][0]),Array.isArray(a[n])&&(l=a[n][0]),i.localeCompare(l)},isValidUuid:n=>n?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(n):!1}}function Fn(t,o,n,r={fetchedItemsKey:"data",searchKeys:["id"]}){n||(n="100");const{axiosInstance:a}=Et({headers:t.requestHeaders}),{i18n:{t:i}}=$t(),{debounce:l}=Sn(),s=l(async w=>{await b(w)},200),c=e.ref(!1),d=e.ref(""),u=e.ref(""),p=e.ref([]),y=e.ref([]),m=e.ref(void 0),S=e.unref(o);let k=`${t.apiBaseUrl}${S}`;t.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,(t==null?void 0:t.controlPlaneId)||""):t.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,t!=null&&t.workspace?`/${t.workspace}`:""));const{isValidUuid:f}=Zt(),h=async()=>{try{c.value=!0;const{data:w}=await a.get(`${k}?size=${n}`);w!=null&&w.next||(m.value=r.fetchedItemsKey in w?w[r.fetchedItemsKey]:[]),y.value=r.fetchedItemsKey in w?w[r.fetchedItemsKey]:[],p.value=y.value}catch{p.value=[],d.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},g=e.ref(""),b=async w=>{var K,D,T;if(g.value!==w)if(g.value=w||"",m.value===void 0)try{if(c.value=!0,d.value="",u.value="",t.app==="konnect"){let C=k+"";w&&(C+=`/${w}`);const{data:A}=await a.get(`${C}?size=${n}`);r.fetchedItemsKey in A?p.value=A[r.fetchedItemsKey]:A!=null&&A.id?p.value=[A]:p.value=[]}else if(w){const C=[];f(w)&&r.searchKeys.includes("id")?C.push((async()=>{const{data:N}=await a.get(`${k}/${w}`);return[N[r.fetchedItemsKey]??N]})()):C.push(...r.searchKeys.filter(N=>N!=="id").map(async N=>{const{data:_}=await a.get(`${k}?${N}=${w}`);return _[r.fetchedItemsKey]}));const A=await Promise.all(C),B=new Set;p.value=[],(K=A==null?void 0:A.forEach)==null||K.call(A,N=>{var _;(_=N==null?void 0:N.forEach)==null||_.call(N,E=>{B.has(E.id)||(B.add(E.id),p.value.push(E))})})}else p.value=y.value}catch(C){((D=C==null?void 0:C.response)==null?void 0:D.status)===404?u.value=i("debouncedFilter.errors.invalid"):(p.value=[],d.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,u.value="",w?(p.value=(T=m.value)==null?void 0:T.filter(C=>{var A;let B=!1;for(const N of r.searchKeys){const _=typeof C[N]=="string"?(A=C[N])==null?void 0:A.toLowerCase():C[N];_!=null&&_.includes(w.toLowerCase())&&(B=!0)}return B}),(!p.value||!p.value.length)&&(u.value=i("debouncedFilter.errors.invalid"))):p.value=m.value,c.value=!1};return{loading:c,error:d,validationError:u,results:p,allRecords:m,loadItems:h,debouncedQueryChange:s}}function Mn(t,o){const n=e.unref(o),r=e.computed(()=>t.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${n}`):new URL(n));return r.value.search="",a=>`${r.value.href}/${a}`}function Kn(){const{i18n:{t}}=$t();return{getMessageFromError:o=>{var n,r,a;if(!o)return t("errors.unexpected");if((n=o==null?void 0:o.response)!=null&&n.data){if(o.response.data.detail)return o.response.data.detail;if((r=o.response.data.details)!=null&&r.length)return o.response.data.details.map(i=>{let l=t("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(l=i.messages.join(", ")),i.field?`${i.field} - ${l}`:l}).join("; ");if(o.response.data.message){const{message:i}=o.response.data;return Array.isArray(i)?(a=i[0])!=null&&a.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof o.response.data=="string")return o.response.data;if(typeof o.response.data=="object")return Object.keys(o.response.data).map(i=>`${i} ${o.response.data[i]}`).join(", ")}return o.message||t("errors.unexpected")}}}function Dn(t){const o=window.location.origin,n=o.endsWith("/")?o:`${o}/`;try{const r=t.join("/"),a=`${n}${r}`,i=t.some(l=>l.trim()==="");if(!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(a)&&!i&&new URL(a))return`${n}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function Xt(t,o){const n=e.ref(e.unref(t)),r=e.ref(e.unref(o)),a=e.computed(()=>!!(n.value.app==="konnect"||n.value.isExactMatch)),i=e.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return l=>{const{page:s,pageSize:c,offset:d,sortColumnKey:u,sortColumnOrder:p,query:y}=l;try{let m=new URL(i.value.href);return a.value&&y?(m.search="",m=new URL(`${m.href}/${y}/`)):(a.value||new URLSearchParams(y).forEach((S,k)=>{m.searchParams.append(k,S)}),u&&m.searchParams.append("sort_by",u),p==="desc"&&m.searchParams.append("sort_desc","1"),m.searchParams.append("size",String(c))),d&&s!==1&&m.searchParams.append("offset",String(d)),m.href}catch(m){return console.error("RouteList(fetcher)",m),r.value}}}function Ln(t,o,n="data"){const r=e.unref(o),{axiosInstance:a}=Et({headers:t.requestHeaders}),i=Xt(t,r),l=e.ref({status:rt.Idle});return{fetcher:async s=>{try{l.value={status:rt.Loading};const c=i(s),{data:d}=await a.get(c),u=n&&n.replace(/[^\w-_]/gi,"");let p;d[u]&&Array.isArray(d[u])?p=d[u]:p=Object.keys(d).length?[d]:[];const y={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return l.value={status:rt.Idle,response:y},y}catch(c){const d={data:[],total:0};return s.query&&c.response.status===404?(l.value={status:rt.NoResults,response:d,error:c},d):(l.value={status:rt.Error,response:d,error:c},d)}},fetcherState:l}}function qn(){const t=(n,r="_")=>n?n.split(r).map(a=>a.toLowerCase()==="id"?a.toUpperCase():a.charAt(0).toUpperCase()+a.substring(1)).join(" "):"",o=/(?:^|[\s-:'"])\w/g;return{capitalize:n=>n?n.replace(o,r=>r.toUpperCase()):"",convertKeyToTitle:t}}const Qt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,te=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");const o=t.match(Qt);if(!o)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return o.shift(),o},ee=t=>t==="*"||t==="x"||t==="X",ne=t=>{const o=parseInt(t,10);return isNaN(o)?t:o},vn=(t,o)=>typeof t!=typeof o?[String(t),String(o)]:[t,o],Pn=(t,o)=>{if(ee(t)||ee(o))return 0;const[n,r]=vn(ne(t),ne(o));return n>r?1:n<r?-1:0},oe=(t,o)=>{for(let n=0;n<Math.max(t.length,o.length);n++){const r=Pn(t[n]||"0",o[n]||"0");if(r!==0)return r}return 0},Rn=(t,o)=>{const n=te(t),r=te(o),a=n.pop(),i=r.pop(),l=oe(n,r);return l!==0?l:a&&i?oe(a.split("."),i.split(".")):a||i?a?-1:1:0},re=(t,o,n)=>{Un(n);const r=Rn(t,o);return ae[n].includes(r)},ae={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},ie=Object.keys(ae),Un=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(ie.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${ie.join("|")}`)},zn=t=>typeof t=="string"&&/^[v\d]/.test(t)&&Qt.test(t);function Hn(t){const{gatewayInfo:o,supportedRange:n}=t;if(!o)return!0;const{edition:r,version:a}=o;if(!zn(a))return console.error("Invalid version"),!1;const i=n[r];if(!i)return!1;const[l,s]=i;return!(l&&re(a,l,"<")||s&&re(a,s,">"))}function Jn(t){const o=e.ref(0),n=e.ref(0),r=e.ref(!1);return e.watch(t,a=>{a&&!r.value&&(o.value=a.offsetWidth,n.value=a.scrollWidth,r.value=!0)}),{isTruncated:e.computed(()=>o.value<n.value)}}const Yn=new Wt.ToastManager;function Wn(){return{notify:async t=>{const o={appearance:"success",message:"Success",timeoutMilliseconds:3e3};Yn.open({...o,...t})}}}const P={useAxios:Et,useDebouncedFilter:Fn,useDeleteUrlBuilder:Mn,useErrors:Kn,useExternalLinkCreator:Dn,useFetcher:Ln,useFetchUrlBuilder:Xt,useHelpers:Zt,useStringHelpers:qn,useI18n:$t,useGatewayFeatureSupported:Hn,useTruncationDetector:Jn,useToaster:Wn},Gn={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Zn="Copy to clipboard",Xn={message:Gn,iconTitle:Zn},Qn="kong-ui-copy-uuid-notify",le="24px",to=(t,o)=>{const n=t.__vccOpts||t;for(const[r,a]of o)n[r]=a;return n},eo=t=>(e.pushScopeId("data-v-9971cc79"),t=t(),e.popScopeId(),t),no=["aria-hidden"],oo={key:0,"data-testid":"kui-icon-svg-title"},ro=eo(()=>e.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),ao=e.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:le,validator:t=>{if(typeof t=="number"&&t>0)return!0;if(typeof t=="string"){const o=String(t).replace(/px/gi,""),n=Number(o);if(n&&!isNaN(n)&&Number.isInteger(n)&&n>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(t){const o=t,n=e.computed(()=>{if(typeof o.size=="number"&&o.size>0)return`${o.size}px`;if(typeof o.size=="string"){const a=String(o.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return le}),r=e.computed(()=>({boxSizing:"border-box",color:o.color,display:o.display,height:n.value,lineHeight:"0",width:n.value}));return(a,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.as),{"aria-hidden":t.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:e.normalizeStyle(r.value)},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":t.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[t.title?(e.openBlock(),e.createElementBlock("title",oo,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),ro],8,no))]),_:1},8,["aria-hidden","style"]))}}),io=to(ao,[["__scopeId","data-v-9971cc79"]]),lo="16px",so={class:"kong-ui-copy-uuid"},co=["onClick"],se=15,po=e.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:t=>["uuid","hidden","redacted","deleted"].includes(t)}},emits:["success","error"],setup(t,{emit:o}){const n=t,{t:r}=ut.createI18n("en-us",Xn),a=n.notify||e.inject(Qn,()=>{}),i=e.computed(()=>n.idTooltip?{label:n.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:n.uuid}),l=e.computed(()=>!!(n.tooltip&&n.successTooltip)),s=e.ref(n.tooltip),c=e.computed(()=>n.tooltip?{label:s.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=e.computed(()=>{var y;return n.format==="redacted"?"*****":n.format==="deleted"?`*${(y=n.uuid)==null?void 0:y.substring(0,5)}`:n.uuid}),u=y=>{s.value=y,setTimeout(()=>{s.value=n.tooltip},1800)},p=y=>{var m,S;if(!y(n.uuid)){typeof a=="function"&&a({type:"error",message:r("message.fail")}),l.value?u(r("message.fail")):o("error",n.uuid);return}const k=((m=n.uuid)==null?void 0:m.length)>se,f=n.format==="hidden"||n.format==="redacted"?r("message.success.prefix"):`"${((S=n.uuid)==null?void 0:S.substring(0,se))+(k?"...":"")}"`;typeof a=="function"&&a({type:"success",message:`${f}${r("message.success.content")}`}),l.value?u(n.successTooltip):o("success",n.uuid)};return(y,m)=>{const S=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",so,[t.format!=="hidden"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.idTooltip?"KTooltip":"div"),e.mergeProps({key:0},i.value,{"data-testid":"copy-id"}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["uuid-container",t.truncated?"truncated-uuid":null,t.useMono?"mono":null])},e.toDisplayString(d.value),3)]),_:1},16)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tooltip?"KTooltip":"div"),e.mergeProps(c.value,{class:"uuid-icon-wrapper"}),{default:e.withCtx(()=>[e.createVNode(S,null,{default:e.withCtx(({copyToClipboard:k})=>[e.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:e.withModifiers(f=>p(k),["stop"])},[e.createVNode(e.unref(io),{class:"uuid-icon",color:t.iconColor,decorative:!!t.tooltip,size:e.unref(lo),title:e.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,co)]),_:1})]),_:1},16))])}}}),uo=(t,o)=>{const n=t.__vccOpts||t;for(const[r,a]of o)n[r]=a;return n},ce=uo(po,[["__scopeId","data-v-0c07874b"]]),fo={key:0,class:"config-card-fieldset-title"},mo=e.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(t){const o=t,{i18n:{t:n}}=P.useI18n(),{convertKeyToTitle:r}=P.useStringHelpers(),a=e.computed(()=>o.item.key??"json-array-item"),i=e.computed(()=>o.item.value??o.item),l=e.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return o.isArrayItem&&delete c.name,c}),s=e.computed(()=>{var c;return o.isArrayItem?(c=i.value)!=null&&c.name?r(i.value.name,"_"):n("baseConfigCard.general.entryTitle",{index:o.index}):""});return(c,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.isArrayItem?"fieldset":"div"),{class:e.normalizeClass(t.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:e.withCtx(()=>[t.isArrayItem?(e.openBlock(),e.createElementBlock("legend",fo,[e.createElementVNode("b",null,e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(l.value),(u,p)=>(e.openBlock(),e.createBlock(jt,{key:`${a.value}-property-${p}`,item:{key:u,label:e.unref(r)(u),value:l.value[u]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),X=(t,o)=>{const n=t.__vccOpts||t;for(const[r,a]of o)n[r]=a;return n},de=X(mo,[["__scopeId","data-v-68ca83ec"]]),yo=X(e.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(t){const{i18n:{t:o}}=P.useI18n();return(n,r)=>{const a=e.resolveComponent("KButton");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(a,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=i=>n.$emit("navigation-click",t.item))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.item.value||e.unref(o)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-c96811e5"]]),go=e.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(t){const{i18n:{t:o}}=P.useI18n();return(n,r)=>{const a=e.resolveComponent("KBadge");return e.openBlock(),e.createBlock(a,{appearance:t.status?"success":"neutral"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.status?e.unref(o)("baseConfigCard.statusBadge.enabledLabel"):e.unref(o)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),ho="#0044f4",ko="#e0e4ea",bo="#3a3f51",Co="1px",wo="20px",So={class:"config-card-details-row"},xo=["data-testid"],Bo=["data-testid"],No=["data-testid"],Io=["data-testid"],Ao={key:1},_o=["data-testid"],To=["data-testid"],Eo=["data-testid"],Vo=["data-testid"],$o={name:"ConfigCardItem",components:{CopyUuid:ce,JsonCardItem:de,StatusBadge:go,InternalLinkItem:yo}},jo=e.defineComponent({...$o,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(t,{emit:o}){const n=t;e.useCssVars(m=>({"1df60db4":d.value?"none":`solid ${e.unref(Co)} ${e.unref(ko)}`,"21d1d34e":c.value&&l.value?"block":"flex","4d3dc7e7":c.value&&l.value?"100%":n.slim?"50%":"25%","4d400dc2":c.value&&l.value?"100%":n.slim?"50%":"75%"}));const r=e.useSlots(),{i18n:{t:a,formatUnixTimeStamp:i}}=P.useI18n(),l=e.computed(()=>n.item.value!==void 0&&n.item.value!==null&&n.item.value!==""),s=e.computed(()=>!!(n.item.tooltip||r["label-tooltip"])),c=e.computed(()=>n.item.type===j.Json||n.item.type===j.JsonArray),d=e.computed(()=>n.item.type===j.JsonArray),u=e.computed(()=>{switch(n.item.type){case j.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid`,"success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case j.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case j.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${n.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,uuid:n.item.value,notify:()=>{}}};case j.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":a("baseConfigCard.copy.success"),tooltip:a("baseConfigCard.copy.tooltip",{label:n.item.label}),truncated:!1,notify:()=>{}}};case j.Date:return{tag:"div",attrs:{"data-testid":`${n.item.key}-date`},text:i(n.item.value)};case j.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${n.item.key}-badge-status`,status:n.item.value}};case j.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case j.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case j.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${n.item.key}-internal-link`,item:n.item,onNavigationClick:m=>{o("navigation-click",m)}}};case j.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${n.item.key}-external-link`,href:n.item.value},text:n.item.value};case j.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-content`,item:n.item}};case j.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${n.item.key}-json-array-content`,item:n.item}};default:return{tag:"div",attrs:{"data-testid":`${n.item.key}-plain-text`},text:n.item.value}}}),p=e.ref(),{isTruncated:y}=P.useTruncationDetector(p);return(m,S)=>{const k=e.resolveComponent("KLabel"),f=e.resolveComponent("KBadge"),h=e.resolveComponent("KMethodBadge"),g=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("div",So,[e.createElementVNode("div",{class:"config-card-details-label","data-testid":`${t.item.key}-label`},[e.renderSlot(m.$slots,"label",{item:t.item},()=>[e.createVNode(k,{"tooltip-attributes":{maxWidth:"500px"}},e.createSlots({default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.item.label)+" ",1)]),_:2},[s.value?{name:"tooltip",fn:e.withCtx(()=>[e.createElementVNode("div",{"data-testid":`${t.item.key}-label-tooltip`},[e.renderSlot(m.$slots,"label-tooltip",{},()=>[e.createTextVNode(e.toDisplayString(t.item.tooltip),1)],!0)],8,Bo)]),key:"0"}:void 0]),1024)],!0)],8,xo),e.createElementVNode("div",{class:"config-card-details-value","data-testid":`${t.item.key}-property-value`},[e.renderSlot(m.$slots,t.item.key,{rowValue:t.item.value},()=>[l.value?(e.openBlock(),e.createElementBlock("div",Ao,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value.tag),e.normalizeProps(e.guardReactiveProps(u.value.attrs)),{default:e.withCtx(()=>[u.value.additionalComponent==="KBadge"?(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":`${t.item.key}-badge-tags`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(b,w)=>(e.openBlock(),e.createBlock(f,{key:`${t.item.key}-badge-tag-${w}`,class:"config-badge","data-testid":`${t.item.key}-badge-tag-${w}`,"truncation-tooltip":b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,_o)):e.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(e.openBlock(),e.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${t.item.key}-copy-uuid-array`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(b,w)=>(e.openBlock(),e.createBlock(e.unref(ce),e.mergeProps(u.value.childAttrs,{key:`${t.item.key}-copy-uuid-${w}`,"data-testid":`${t.item.key}-copy-uuid-${w}`,uuid:b}),null,16,["data-testid","uuid"]))),128))],8,To)):u.value.additionalComponent==="KMethodBadge"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${t.item.key}-badge-methods`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(b,w)=>(e.openBlock(),e.createBlock(h,{key:`${t.item.key}-badge-method-${w}`,class:"config-badge","data-testid":`${t.item.key}-badge-method-${w}`,"is-rounded":"",label:b,method:e.unref(Wt.MethodsArray).includes(b.toLowerCase())?b.toLowerCase():"custom"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,Eo)):e.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(e.openBlock(),e.createElementBlock("div",{key:3,"data-testid":`${n.item.key}-json-array-content`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.value,(b,w)=>(e.openBlock(),e.createBlock(de,{key:`json-array-item-${w}`,index:w,"is-array-item":"",item:b},null,8,["index","item"]))),128))],8,Vo)):(e.openBlock(),e.createBlock(g,{key:4,label:e.unref(y)?t.item.value:""},{default:e.withCtx(()=>[e.createElementVNode("span",{ref_key:"textContent",ref:p,class:e.normalizeClass(["attrs-data-text",{truncated:t.truncated}])},e.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(e.openBlock(),e.createElementBlock("div",{key:0,"data-testid":`${t.item.key}-no-value`}," – ",8,Io))],!0)],8,No)])}}}),jt=X(jo,[["__scopeId","data-v-307ab96d"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function pe(t){return typeof t>"u"||t===null}function Oo(t){return typeof t=="object"&&t!==null}function Fo(t){return Array.isArray(t)?t:pe(t)?[]:[t]}function Mo(t,o){var n,r,a,i;if(o)for(i=Object.keys(o),n=0,r=i.length;n<r;n+=1)a=i[n],t[a]=o[a];return t}function Ko(t,o){var n="",r;for(r=0;r<o;r+=1)n+=t;return n}function Do(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var Lo=pe,qo=Oo,vo=Fo,Po=Ko,Ro=Do,Uo=Mo,q={isNothing:Lo,isObject:qo,toArray:vo,repeat:Po,isNegativeZero:Ro,extend:Uo};function ue(t,o){var n="",r=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!o&&t.mark.snippet&&(n+=`
2
2
 
3
- `+t.mark.snippet),a+" "+n):a}function ft(t,o){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=o,this.message=pe(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ft.prototype=Object.create(Error.prototype),ft.prototype.constructor=ft,ft.prototype.toString=function(t){return this.name+": "+pe(this,t)};var J=ft;function Ot(t,o,n,a,r){var i="",l="",s=Math.floor(r/2)-1;return a-o>s&&(i=" ... ",o=a-s+i.length),n-a>s&&(l=" ...",n=a+s-l.length),{str:i+t.slice(o,n).replace(/\t/g,"→")+l,pos:a-o+i.length}}function Mt(t,o){return q.repeat(" ",o-t.length)+t}function Mo(t,o){if(o=Object.create(o||null),!t.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);for(var n=/\r?\n|\r|\0/g,a=[0],r=[],i,l=-1;i=n.exec(t.buffer);)r.push(i.index),a.push(i.index+i[0].length),t.position<=i.index&&l<0&&(l=a.length-2);l<0&&(l=a.length-1);var s="",c,d,u=Math.min(t.line+o.linesAfter,r.length).toString().length,p=o.maxLength-(o.indent+u+3);for(c=1;c<=o.linesBefore&&!(l-c<0);c++)d=Ot(t.buffer,a[l-c],r[l-c],t.position-(a[l]-a[l-c]),p),s=q.repeat(" ",o.indent)+Mt((t.line-c+1).toString(),u)+" | "+d.str+`
4
- `+s;for(d=Ot(t.buffer,a[l],r[l],t.position,p),s+=q.repeat(" ",o.indent)+Mt((t.line+1).toString(),u)+" | "+d.str+`
3
+ `+t.mark.snippet),r+" "+n):r}function ft(t,o){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=o,this.message=ue(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ft.prototype=Object.create(Error.prototype),ft.prototype.constructor=ft,ft.prototype.toString=function(t){return this.name+": "+ue(this,t)};var J=ft;function Ot(t,o,n,r,a){var i="",l="",s=Math.floor(a/2)-1;return r-o>s&&(i=" ... ",o=r-s+i.length),n-r>s&&(l=" ...",n=r+s-l.length),{str:i+t.slice(o,n).replace(/\t/g,"→")+l,pos:r-o+i.length}}function Ft(t,o){return q.repeat(" ",o-t.length)+t}function zo(t,o){if(o=Object.create(o||null),!t.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],a=[],i,l=-1;i=n.exec(t.buffer);)a.push(i.index),r.push(i.index+i[0].length),t.position<=i.index&&l<0&&(l=r.length-2);l<0&&(l=r.length-1);var s="",c,d,u=Math.min(t.line+o.linesAfter,a.length).toString().length,p=o.maxLength-(o.indent+u+3);for(c=1;c<=o.linesBefore&&!(l-c<0);c++)d=Ot(t.buffer,r[l-c],a[l-c],t.position-(r[l]-r[l-c]),p),s=q.repeat(" ",o.indent)+Ft((t.line-c+1).toString(),u)+" | "+d.str+`
4
+ `+s;for(d=Ot(t.buffer,r[l],a[l],t.position,p),s+=q.repeat(" ",o.indent)+Ft((t.line+1).toString(),u)+" | "+d.str+`
5
5
  `,s+=q.repeat("-",o.indent+u+3+d.pos)+`^
6
- `,c=1;c<=o.linesAfter&&!(l+c>=r.length);c++)d=Ot(t.buffer,a[l+c],r[l+c],t.position-(a[l]-a[l+c]),p),s+=q.repeat(" ",o.indent)+Mt((t.line+c+1).toString(),u)+" | "+d.str+`
7
- `;return s.replace(/\n$/,"")}var Fo=Mo,Ko=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Do=["scalar","sequence","mapping"];function Lo(t){var o={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(a){o[String(a)]=n})}),o}function qo(t,o){if(o=o||{},Object.keys(o).forEach(function(n){if(Ko.indexOf(n)===-1)throw new J('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=o,this.tag=t,this.kind=o.kind||null,this.resolve=o.resolve||function(){return!0},this.construct=o.construct||function(n){return n},this.instanceOf=o.instanceOf||null,this.predicate=o.predicate||null,this.represent=o.represent||null,this.representName=o.representName||null,this.defaultStyle=o.defaultStyle||null,this.multi=o.multi||!1,this.styleAliases=Lo(o.styleAliases||null),Do.indexOf(this.kind)===-1)throw new J('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var U=qo;function ue(t,o){var n=[];return t[o].forEach(function(a){var r=n.length;n.forEach(function(i,l){i.tag===a.tag&&i.kind===a.kind&&i.multi===a.multi&&(r=l)}),n[r]=a}),n}function vo(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},o,n;function a(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(o=0,n=arguments.length;o<n;o+=1)arguments[o].forEach(a);return t}function Ft(t){return this.extend(t)}Ft.prototype.extend=function(t){var o=[],n=[];if(t instanceof U)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(o=o.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new J("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");o.forEach(function(r){if(!(r instanceof U))throw new J("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(r.loadKind&&r.loadKind!=="scalar")throw new J("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(r.multi)throw new J("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(r){if(!(r instanceof U))throw new J("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(Ft.prototype);return a.implicit=(this.implicit||[]).concat(o),a.explicit=(this.explicit||[]).concat(n),a.compiledImplicit=ue(a,"implicit"),a.compiledExplicit=ue(a,"explicit"),a.compiledTypeMap=vo(a.compiledImplicit,a.compiledExplicit),a};var fe=Ft,me=new U("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),ye=new U("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),ge=new U("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),he=new fe({explicit:[me,ye,ge]});function Po(t){if(t===null)return!0;var o=t.length;return o===1&&t==="~"||o===4&&(t==="null"||t==="Null"||t==="NULL")}function Ro(){return null}function Uo(t){return t===null}var ke=new U("tag:yaml.org,2002:null",{kind:"scalar",resolve:Po,construct:Ro,predicate:Uo,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function zo(t){if(t===null)return!1;var o=t.length;return o===4&&(t==="true"||t==="True"||t==="TRUE")||o===5&&(t==="false"||t==="False"||t==="FALSE")}function Ho(t){return t==="true"||t==="True"||t==="TRUE"}function Jo(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var be=new U("tag:yaml.org,2002:bool",{kind:"scalar",resolve:zo,construct:Ho,predicate:Jo,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function Yo(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function Wo(t){return 48<=t&&t<=55}function Zo(t){return 48<=t&&t<=57}function Go(t){if(t===null)return!1;var o=t.length,n=0,a=!1,r;if(!o)return!1;if(r=t[n],(r==="-"||r==="+")&&(r=t[++n]),r==="0"){if(n+1===o)return!0;if(r=t[++n],r==="b"){for(n++;n<o;n++)if(r=t[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;a=!0}return a&&r!=="_"}if(r==="x"){for(n++;n<o;n++)if(r=t[n],r!=="_"){if(!Yo(t.charCodeAt(n)))return!1;a=!0}return a&&r!=="_"}if(r==="o"){for(n++;n<o;n++)if(r=t[n],r!=="_"){if(!Wo(t.charCodeAt(n)))return!1;a=!0}return a&&r!=="_"}}if(r==="_")return!1;for(;n<o;n++)if(r=t[n],r!=="_"){if(!Zo(t.charCodeAt(n)))return!1;a=!0}return!(!a||r==="_")}function Xo(t){var o=t,n=1,a;if(o.indexOf("_")!==-1&&(o=o.replace(/_/g,"")),a=o[0],(a==="-"||a==="+")&&(a==="-"&&(n=-1),o=o.slice(1),a=o[0]),o==="0")return 0;if(a==="0"){if(o[1]==="b")return n*parseInt(o.slice(2),2);if(o[1]==="x")return n*parseInt(o.slice(2),16);if(o[1]==="o")return n*parseInt(o.slice(2),8)}return n*parseInt(o,10)}function Qo(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!q.isNegativeZero(t)}var Ce=new U("tag:yaml.org,2002:int",{kind:"scalar",resolve:Go,construct:Xo,predicate:Qo,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ta=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ea(t){return!(t===null||!ta.test(t)||t[t.length-1]==="_")}function na(t){var o,n;return o=t.replace(/_/g,"").toLowerCase(),n=o[0]==="-"?-1:1,"+-".indexOf(o[0])>=0&&(o=o.slice(1)),o===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:o===".nan"?NaN:n*parseFloat(o,10)}var oa=/^[-+]?[0-9]+e/;function aa(t,o){var n;if(isNaN(t))switch(o){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(o){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(o){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(q.isNegativeZero(t))return"-0.0";return n=t.toString(10),oa.test(n)?n.replace("e",".e"):n}function ra(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||q.isNegativeZero(t))}var we=new U("tag:yaml.org,2002:float",{kind:"scalar",resolve:ea,construct:na,predicate:ra,represent:aa,defaultStyle:"lowercase"}),Se=he.extend({implicit:[ke,be,Ce,we]}),xe=Se,Be=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ie=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 ia(t){return t===null?!1:Be.exec(t)!==null||Ie.exec(t)!==null}function la(t){var o,n,a,r,i,l,s,c=0,d=null,u,p,y;if(o=Be.exec(t),o===null&&(o=Ie.exec(t)),o===null)throw new Error("Date resolve error");if(n=+o[1],a=+o[2]-1,r=+o[3],!o[4])return new Date(Date.UTC(n,a,r));if(i=+o[4],l=+o[5],s=+o[6],o[7]){for(c=o[7].slice(0,3);c.length<3;)c+="0";c=+c}return o[9]&&(u=+o[10],p=+(o[11]||0),d=(u*60+p)*6e4,o[9]==="-"&&(d=-d)),y=new Date(Date.UTC(n,a,r,i,l,s,c)),d&&y.setTime(y.getTime()-d),y}function sa(t){return t.toISOString()}var Ae=new U("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ia,construct:la,instanceOf:Date,represent:sa});function ca(t){return t==="<<"||t===null}var Ne=new U("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ca}),Kt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
- \r`;function da(t){if(t===null)return!1;var o,n,a=0,r=t.length,i=Kt;for(n=0;n<r;n++)if(o=i.indexOf(t.charAt(n)),!(o>64)){if(o<0)return!1;a+=6}return a%8===0}function pa(t){var o,n,a=t.replace(/[\r\n=]/g,""),r=a.length,i=Kt,l=0,s=[];for(o=0;o<r;o++)o%4===0&&o&&(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)),l=l<<6|i.indexOf(a.charAt(o));return n=r%4*6,n===0?(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)):n===18?(s.push(l>>10&255),s.push(l>>2&255)):n===12&&s.push(l>>4&255),new Uint8Array(s)}function ua(t){var o="",n=0,a,r,i=t.length,l=Kt;for(a=0;a<i;a++)a%3===0&&a&&(o+=l[n>>18&63],o+=l[n>>12&63],o+=l[n>>6&63],o+=l[n&63]),n=(n<<8)+t[a];return r=i%3,r===0?(o+=l[n>>18&63],o+=l[n>>12&63],o+=l[n>>6&63],o+=l[n&63]):r===2?(o+=l[n>>10&63],o+=l[n>>4&63],o+=l[n<<2&63],o+=l[64]):r===1&&(o+=l[n>>2&63],o+=l[n<<4&63],o+=l[64],o+=l[64]),o}function fa(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var _e=new U("tag:yaml.org,2002:binary",{kind:"scalar",resolve:da,construct:pa,predicate:fa,represent:ua}),ma=Object.prototype.hasOwnProperty,ya=Object.prototype.toString;function ga(t){if(t===null)return!0;var o=[],n,a,r,i,l,s=t;for(n=0,a=s.length;n<a;n+=1){if(r=s[n],l=!1,ya.call(r)!=="[object Object]")return!1;for(i in r)if(ma.call(r,i))if(!l)l=!0;else return!1;if(!l)return!1;if(o.indexOf(i)===-1)o.push(i);else return!1}return!0}function ha(t){return t!==null?t:[]}var Te=new U("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ga,construct:ha}),ka=Object.prototype.toString;function ba(t){if(t===null)return!0;var o,n,a,r,i,l=t;for(i=new Array(l.length),o=0,n=l.length;o<n;o+=1){if(a=l[o],ka.call(a)!=="[object Object]"||(r=Object.keys(a),r.length!==1))return!1;i[o]=[r[0],a[r[0]]]}return!0}function Ca(t){if(t===null)return[];var o,n,a,r,i,l=t;for(i=new Array(l.length),o=0,n=l.length;o<n;o+=1)a=l[o],r=Object.keys(a),i[o]=[r[0],a[r[0]]];return i}var Ee=new U("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ba,construct:Ca}),wa=Object.prototype.hasOwnProperty;function Sa(t){if(t===null)return!0;var o,n=t;for(o in n)if(wa.call(n,o)&&n[o]!==null)return!1;return!0}function xa(t){return t!==null?t:{}}var Ve=new U("tag:yaml.org,2002:set",{kind:"mapping",resolve:Sa,construct:xa}),Dt=xe.extend({implicit:[Ae,Ne],explicit:[_e,Te,Ee,Ve]}),nt=Object.prototype.hasOwnProperty,Ct=1,je=2,$e=3,wt=4,Lt=1,Ba=2,Oe=3,Ia=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Aa=/[\x85\u2028\u2029]/,Na=/[,\[\]\{\}]/,Me=/^(?:!|!!|![a-z\-]+!)$/i,Fe=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ke(t){return Object.prototype.toString.call(t)}function Q(t){return t===10||t===13}function rt(t){return t===9||t===32}function W(t){return t===9||t===32||t===10||t===13}function lt(t){return t===44||t===91||t===93||t===123||t===125}function _a(t){var o;return 48<=t&&t<=57?t-48:(o=t|32,97<=o&&o<=102?o-97+10:-1)}function Ta(t){return t===120?2:t===117?4:t===85?8:0}function Ea(t){return 48<=t&&t<=57?t-48:-1}function De(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
9
- `:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"…":t===95?" ":t===76?"\u2028":t===80?"\u2029":""}function Va(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}for(var Le=new Array(256),qe=new Array(256),st=0;st<256;st++)Le[st]=De(st)?1:0,qe[st]=De(st);function ja(t,o){this.input=t,this.filename=o.filename||null,this.schema=o.schema||Dt,this.onWarning=o.onWarning||null,this.legacy=o.legacy||!1,this.json=o.json||!1,this.listener=o.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ve(t,o){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=Fo(n),new J(o,n)}function x(t,o){throw ve(t,o)}function St(t,o){t.onWarning&&t.onWarning.call(null,ve(t,o))}var Pe={YAML:function(t,o,n){var a,r,i;t.version!==null&&x(t,"duplication of %YAML directive"),n.length!==1&&x(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),a===null&&x(t,"ill-formed argument of the YAML directive"),r=parseInt(a[1],10),i=parseInt(a[2],10),r!==1&&x(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=i<2,i!==1&&i!==2&&St(t,"unsupported YAML version of the document")},TAG:function(t,o,n){var a,r;n.length!==2&&x(t,"TAG directive accepts exactly two arguments"),a=n[0],r=n[1],Me.test(a)||x(t,"ill-formed tag handle (first argument) of the TAG directive"),nt.call(t.tagMap,a)&&x(t,'there is a previously declared suffix for "'+a+'" tag handle'),Fe.test(r)||x(t,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch{x(t,"tag prefix is malformed: "+r)}t.tagMap[a]=r}};function ot(t,o,n,a){var r,i,l,s;if(o<n){if(s=t.input.slice(o,n),a)for(r=0,i=s.length;r<i;r+=1)l=s.charCodeAt(r),l===9||32<=l&&l<=1114111||x(t,"expected valid JSON character");else Ia.test(s)&&x(t,"the stream contains non-printable characters");t.result+=s}}function Re(t,o,n,a){var r,i,l,s;for(q.isObject(n)||x(t,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),l=0,s=r.length;l<s;l+=1)i=r[l],nt.call(o,i)||(o[i]=n[i],a[i]=!0)}function ct(t,o,n,a,r,i,l,s,c){var d,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),d=0,u=r.length;d<u;d+=1)Array.isArray(r[d])&&x(t,"nested arrays are not supported inside keys"),typeof r=="object"&&Ke(r[d])==="[object Object]"&&(r[d]="[object Object]");if(typeof r=="object"&&Ke(r)==="[object Object]"&&(r="[object Object]"),r=String(r),o===null&&(o={}),a==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(d=0,u=i.length;d<u;d+=1)Re(t,o,i[d],n);else Re(t,o,i,n);else!t.json&&!nt.call(n,r)&&nt.call(o,r)&&(t.line=l||t.line,t.lineStart=s||t.lineStart,t.position=c||t.position,x(t,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(o,r,{configurable:!0,enumerable:!0,writable:!0,value:i}):o[r]=i,delete n[r];return o}function qt(t){var o;o=t.input.charCodeAt(t.position),o===10?t.position++:o===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):x(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function F(t,o,n){for(var a=0,r=t.input.charCodeAt(t.position);r!==0;){for(;rt(r);)r===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(o&&r===35)do r=t.input.charCodeAt(++t.position);while(r!==10&&r!==13&&r!==0);if(Q(r))for(qt(t),r=t.input.charCodeAt(t.position),a++,t.lineIndent=0;r===32;)t.lineIndent++,r=t.input.charCodeAt(++t.position);else break}return n!==-1&&a!==0&&t.lineIndent<n&&St(t,"deficient indentation"),a}function xt(t){var o=t.position,n;return n=t.input.charCodeAt(o),!!((n===45||n===46)&&n===t.input.charCodeAt(o+1)&&n===t.input.charCodeAt(o+2)&&(o+=3,n=t.input.charCodeAt(o),n===0||W(n)))}function vt(t,o){o===1?t.result+=" ":o>1&&(t.result+=q.repeat(`
10
- `,o-1))}function $a(t,o,n){var a,r,i,l,s,c,d,u,p=t.kind,y=t.result,m;if(m=t.input.charCodeAt(t.position),W(m)||lt(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(r=t.input.charCodeAt(t.position+1),W(r)||n&&lt(r)))return!1;for(t.kind="scalar",t.result="",i=l=t.position,s=!1;m!==0;){if(m===58){if(r=t.input.charCodeAt(t.position+1),W(r)||n&&lt(r))break}else if(m===35){if(a=t.input.charCodeAt(t.position-1),W(a))break}else{if(t.position===t.lineStart&&xt(t)||n&&lt(m))break;if(Q(m))if(c=t.line,d=t.lineStart,u=t.lineIndent,F(t,!1,-1),t.lineIndent>=o){s=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=l,t.line=c,t.lineStart=d,t.lineIndent=u;break}}s&&(ot(t,i,l,!1),vt(t,t.line-c),i=l=t.position,s=!1),rt(m)||(l=t.position+1),m=t.input.charCodeAt(++t.position)}return ot(t,i,l,!1),t.result?!0:(t.kind=p,t.result=y,!1)}function Oa(t,o){var n,a,r;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,a=r=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(ot(t,a,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)a=t.position,t.position++,r=t.position;else return!0;else Q(n)?(ot(t,a,r,!0),vt(t,F(t,!1,o)),a=r=t.position):t.position===t.lineStart&&xt(t)?x(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);x(t,"unexpected end of the stream within a single quoted scalar")}function Ma(t,o){var n,a,r,i,l,s;if(s=t.input.charCodeAt(t.position),s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=a=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return ot(t,n,t.position,!0),t.position++,!0;if(s===92){if(ot(t,n,t.position,!0),s=t.input.charCodeAt(++t.position),Q(s))F(t,!1,o);else if(s<256&&Le[s])t.result+=qe[s],t.position++;else if((l=Ta(s))>0){for(r=l,i=0;r>0;r--)s=t.input.charCodeAt(++t.position),(l=_a(s))>=0?i=(i<<4)+l:x(t,"expected hexadecimal character");t.result+=Va(i),t.position++}else x(t,"unknown escape sequence");n=a=t.position}else Q(s)?(ot(t,n,a,!0),vt(t,F(t,!1,o)),n=a=t.position):t.position===t.lineStart&&xt(t)?x(t,"unexpected end of the document within a double quoted scalar"):(t.position++,a=t.position)}x(t,"unexpected end of the stream within a double quoted scalar")}function Fa(t,o){var n=!0,a,r,i,l=t.tag,s,c=t.anchor,d,u,p,y,m,S=Object.create(null),k,f,h,g;if(g=t.input.charCodeAt(t.position),g===91)u=93,m=!1,s=[];else if(g===123)u=125,m=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),g=t.input.charCodeAt(++t.position);g!==0;){if(F(t,!0,o),g=t.input.charCodeAt(t.position),g===u)return t.position++,t.tag=l,t.anchor=c,t.kind=m?"mapping":"sequence",t.result=s,!0;n?g===44&&x(t,"expected the node content, but found ','"):x(t,"missed comma between flow collection entries"),f=k=h=null,p=y=!1,g===63&&(d=t.input.charCodeAt(t.position+1),W(d)&&(p=y=!0,t.position++,F(t,!0,o))),a=t.line,r=t.lineStart,i=t.position,dt(t,o,Ct,!1,!0),f=t.tag,k=t.result,F(t,!0,o),g=t.input.charCodeAt(t.position),(y||t.line===a)&&g===58&&(p=!0,g=t.input.charCodeAt(++t.position),F(t,!0,o),dt(t,o,Ct,!1,!0),h=t.result),m?ct(t,s,S,f,k,h,a,r,i):p?s.push(ct(t,null,S,f,k,h,a,r,i)):s.push(k),F(t,!0,o),g=t.input.charCodeAt(t.position),g===44?(n=!0,g=t.input.charCodeAt(++t.position)):n=!1}x(t,"unexpected end of the stream within a flow collection")}function Ka(t,o){var n,a,r=Lt,i=!1,l=!1,s=o,c=0,d=!1,u,p;if(p=t.input.charCodeAt(t.position),p===124)a=!1;else if(p===62)a=!0;else return!1;for(t.kind="scalar",t.result="";p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)Lt===r?r=p===43?Oe:Ba:x(t,"repeat of a chomping mode identifier");else if((u=Ea(p))>=0)u===0?x(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?x(t,"repeat of an indentation width identifier"):(s=o+u-1,l=!0);else break;if(rt(p)){do p=t.input.charCodeAt(++t.position);while(rt(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!Q(p)&&p!==0)}for(;p!==0;){for(qt(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!l||t.lineIndent<s)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>s&&(s=t.lineIndent),Q(p)){c++;continue}if(t.lineIndent<s){r===Oe?t.result+=q.repeat(`
11
- `,i?1+c:c):r===Lt&&i&&(t.result+=`
12
- `);break}for(a?rt(p)?(d=!0,t.result+=q.repeat(`
6
+ `,c=1;c<=o.linesAfter&&!(l+c>=a.length);c++)d=Ot(t.buffer,r[l+c],a[l+c],t.position-(r[l]-r[l+c]),p),s+=q.repeat(" ",o.indent)+Ft((t.line+c+1).toString(),u)+" | "+d.str+`
7
+ `;return s.replace(/\n$/,"")}var Ho=zo,Jo=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Yo=["scalar","sequence","mapping"];function Wo(t){var o={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(r){o[String(r)]=n})}),o}function Go(t,o){if(o=o||{},Object.keys(o).forEach(function(n){if(Jo.indexOf(n)===-1)throw new J('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=o,this.tag=t,this.kind=o.kind||null,this.resolve=o.resolve||function(){return!0},this.construct=o.construct||function(n){return n},this.instanceOf=o.instanceOf||null,this.predicate=o.predicate||null,this.represent=o.represent||null,this.representName=o.representName||null,this.defaultStyle=o.defaultStyle||null,this.multi=o.multi||!1,this.styleAliases=Wo(o.styleAliases||null),Yo.indexOf(this.kind)===-1)throw new J('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var U=Go;function fe(t,o){var n=[];return t[o].forEach(function(r){var a=n.length;n.forEach(function(i,l){i.tag===r.tag&&i.kind===r.kind&&i.multi===r.multi&&(a=l)}),n[a]=r}),n}function Zo(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},o,n;function r(a){a.multi?(t.multi[a.kind].push(a),t.multi.fallback.push(a)):t[a.kind][a.tag]=t.fallback[a.tag]=a}for(o=0,n=arguments.length;o<n;o+=1)arguments[o].forEach(r);return t}function Mt(t){return this.extend(t)}Mt.prototype.extend=function(t){var o=[],n=[];if(t instanceof U)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(o=o.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new J("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");o.forEach(function(a){if(!(a instanceof U))throw new J("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new J("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new J("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(a){if(!(a instanceof U))throw new J("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Mt.prototype);return r.implicit=(this.implicit||[]).concat(o),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=fe(r,"implicit"),r.compiledExplicit=fe(r,"explicit"),r.compiledTypeMap=Zo(r.compiledImplicit,r.compiledExplicit),r};var me=Mt,ye=new U("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),ge=new U("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),he=new U("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),ke=new me({explicit:[ye,ge,he]});function Xo(t){if(t===null)return!0;var o=t.length;return o===1&&t==="~"||o===4&&(t==="null"||t==="Null"||t==="NULL")}function Qo(){return null}function tr(t){return t===null}var be=new U("tag:yaml.org,2002:null",{kind:"scalar",resolve:Xo,construct:Qo,predicate:tr,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function er(t){if(t===null)return!1;var o=t.length;return o===4&&(t==="true"||t==="True"||t==="TRUE")||o===5&&(t==="false"||t==="False"||t==="FALSE")}function nr(t){return t==="true"||t==="True"||t==="TRUE"}function or(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var Ce=new U("tag:yaml.org,2002:bool",{kind:"scalar",resolve:er,construct:nr,predicate:or,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function rr(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function ar(t){return 48<=t&&t<=55}function ir(t){return 48<=t&&t<=57}function lr(t){if(t===null)return!1;var o=t.length,n=0,r=!1,a;if(!o)return!1;if(a=t[n],(a==="-"||a==="+")&&(a=t[++n]),a==="0"){if(n+1===o)return!0;if(a=t[++n],a==="b"){for(n++;n<o;n++)if(a=t[n],a!=="_"){if(a!=="0"&&a!=="1")return!1;r=!0}return r&&a!=="_"}if(a==="x"){for(n++;n<o;n++)if(a=t[n],a!=="_"){if(!rr(t.charCodeAt(n)))return!1;r=!0}return r&&a!=="_"}if(a==="o"){for(n++;n<o;n++)if(a=t[n],a!=="_"){if(!ar(t.charCodeAt(n)))return!1;r=!0}return r&&a!=="_"}}if(a==="_")return!1;for(;n<o;n++)if(a=t[n],a!=="_"){if(!ir(t.charCodeAt(n)))return!1;r=!0}return!(!r||a==="_")}function sr(t){var o=t,n=1,r;if(o.indexOf("_")!==-1&&(o=o.replace(/_/g,"")),r=o[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),o=o.slice(1),r=o[0]),o==="0")return 0;if(r==="0"){if(o[1]==="b")return n*parseInt(o.slice(2),2);if(o[1]==="x")return n*parseInt(o.slice(2),16);if(o[1]==="o")return n*parseInt(o.slice(2),8)}return n*parseInt(o,10)}function cr(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!q.isNegativeZero(t)}var we=new U("tag:yaml.org,2002:int",{kind:"scalar",resolve:lr,construct:sr,predicate:cr,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),dr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function pr(t){return!(t===null||!dr.test(t)||t[t.length-1]==="_")}function ur(t){var o,n;return o=t.replace(/_/g,"").toLowerCase(),n=o[0]==="-"?-1:1,"+-".indexOf(o[0])>=0&&(o=o.slice(1)),o===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:o===".nan"?NaN:n*parseFloat(o,10)}var fr=/^[-+]?[0-9]+e/;function mr(t,o){var n;if(isNaN(t))switch(o){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(o){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(o){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(q.isNegativeZero(t))return"-0.0";return n=t.toString(10),fr.test(n)?n.replace("e",".e"):n}function yr(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||q.isNegativeZero(t))}var Se=new U("tag:yaml.org,2002:float",{kind:"scalar",resolve:pr,construct:ur,predicate:yr,represent:mr,defaultStyle:"lowercase"}),xe=ke.extend({implicit:[be,Ce,we,Se]}),Be=xe,Ne=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ie=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 gr(t){return t===null?!1:Ne.exec(t)!==null||Ie.exec(t)!==null}function hr(t){var o,n,r,a,i,l,s,c=0,d=null,u,p,y;if(o=Ne.exec(t),o===null&&(o=Ie.exec(t)),o===null)throw new Error("Date resolve error");if(n=+o[1],r=+o[2]-1,a=+o[3],!o[4])return new Date(Date.UTC(n,r,a));if(i=+o[4],l=+o[5],s=+o[6],o[7]){for(c=o[7].slice(0,3);c.length<3;)c+="0";c=+c}return o[9]&&(u=+o[10],p=+(o[11]||0),d=(u*60+p)*6e4,o[9]==="-"&&(d=-d)),y=new Date(Date.UTC(n,r,a,i,l,s,c)),d&&y.setTime(y.getTime()-d),y}function kr(t){return t.toISOString()}var Ae=new U("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:gr,construct:hr,instanceOf:Date,represent:kr});function br(t){return t==="<<"||t===null}var _e=new U("tag:yaml.org,2002:merge",{kind:"scalar",resolve:br}),Kt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
+ \r`;function Cr(t){if(t===null)return!1;var o,n,r=0,a=t.length,i=Kt;for(n=0;n<a;n++)if(o=i.indexOf(t.charAt(n)),!(o>64)){if(o<0)return!1;r+=6}return r%8===0}function wr(t){var o,n,r=t.replace(/[\r\n=]/g,""),a=r.length,i=Kt,l=0,s=[];for(o=0;o<a;o++)o%4===0&&o&&(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)),l=l<<6|i.indexOf(r.charAt(o));return n=a%4*6,n===0?(s.push(l>>16&255),s.push(l>>8&255),s.push(l&255)):n===18?(s.push(l>>10&255),s.push(l>>2&255)):n===12&&s.push(l>>4&255),new Uint8Array(s)}function Sr(t){var o="",n=0,r,a,i=t.length,l=Kt;for(r=0;r<i;r++)r%3===0&&r&&(o+=l[n>>18&63],o+=l[n>>12&63],o+=l[n>>6&63],o+=l[n&63]),n=(n<<8)+t[r];return a=i%3,a===0?(o+=l[n>>18&63],o+=l[n>>12&63],o+=l[n>>6&63],o+=l[n&63]):a===2?(o+=l[n>>10&63],o+=l[n>>4&63],o+=l[n<<2&63],o+=l[64]):a===1&&(o+=l[n>>2&63],o+=l[n<<4&63],o+=l[64],o+=l[64]),o}function xr(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var Te=new U("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Cr,construct:wr,predicate:xr,represent:Sr}),Br=Object.prototype.hasOwnProperty,Nr=Object.prototype.toString;function Ir(t){if(t===null)return!0;var o=[],n,r,a,i,l,s=t;for(n=0,r=s.length;n<r;n+=1){if(a=s[n],l=!1,Nr.call(a)!=="[object Object]")return!1;for(i in a)if(Br.call(a,i))if(!l)l=!0;else return!1;if(!l)return!1;if(o.indexOf(i)===-1)o.push(i);else return!1}return!0}function Ar(t){return t!==null?t:[]}var Ee=new U("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Ir,construct:Ar}),_r=Object.prototype.toString;function Tr(t){if(t===null)return!0;var o,n,r,a,i,l=t;for(i=new Array(l.length),o=0,n=l.length;o<n;o+=1){if(r=l[o],_r.call(r)!=="[object Object]"||(a=Object.keys(r),a.length!==1))return!1;i[o]=[a[0],r[a[0]]]}return!0}function Er(t){if(t===null)return[];var o,n,r,a,i,l=t;for(i=new Array(l.length),o=0,n=l.length;o<n;o+=1)r=l[o],a=Object.keys(r),i[o]=[a[0],r[a[0]]];return i}var Ve=new U("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Tr,construct:Er}),Vr=Object.prototype.hasOwnProperty;function $r(t){if(t===null)return!0;var o,n=t;for(o in n)if(Vr.call(n,o)&&n[o]!==null)return!1;return!0}function jr(t){return t!==null?t:{}}var $e=new U("tag:yaml.org,2002:set",{kind:"mapping",resolve:$r,construct:jr}),Dt=Be.extend({implicit:[Ae,_e],explicit:[Te,Ee,Ve,$e]}),nt=Object.prototype.hasOwnProperty,Ct=1,je=2,Oe=3,wt=4,Lt=1,Or=2,Fe=3,Fr=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Mr=/[\x85\u2028\u2029]/,Kr=/[,\[\]\{\}]/,Me=/^(?:!|!!|![a-z\-]+!)$/i,Ke=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function De(t){return Object.prototype.toString.call(t)}function Q(t){return t===10||t===13}function at(t){return t===9||t===32}function W(t){return t===9||t===32||t===10||t===13}function lt(t){return t===44||t===91||t===93||t===123||t===125}function Dr(t){var o;return 48<=t&&t<=57?t-48:(o=t|32,97<=o&&o<=102?o-97+10:-1)}function Lr(t){return t===120?2:t===117?4:t===85?8:0}function qr(t){return 48<=t&&t<=57?t-48:-1}function Le(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
9
+ `:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"…":t===95?" ":t===76?"\u2028":t===80?"\u2029":""}function vr(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}for(var qe=new Array(256),ve=new Array(256),st=0;st<256;st++)qe[st]=Le(st)?1:0,ve[st]=Le(st);function Pr(t,o){this.input=t,this.filename=o.filename||null,this.schema=o.schema||Dt,this.onWarning=o.onWarning||null,this.legacy=o.legacy||!1,this.json=o.json||!1,this.listener=o.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Pe(t,o){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=Ho(n),new J(o,n)}function x(t,o){throw Pe(t,o)}function St(t,o){t.onWarning&&t.onWarning.call(null,Pe(t,o))}var Re={YAML:function(t,o,n){var r,a,i;t.version!==null&&x(t,"duplication of %YAML directive"),n.length!==1&&x(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&x(t,"ill-formed argument of the YAML directive"),a=parseInt(r[1],10),i=parseInt(r[2],10),a!==1&&x(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=i<2,i!==1&&i!==2&&St(t,"unsupported YAML version of the document")},TAG:function(t,o,n){var r,a;n.length!==2&&x(t,"TAG directive accepts exactly two arguments"),r=n[0],a=n[1],Me.test(r)||x(t,"ill-formed tag handle (first argument) of the TAG directive"),nt.call(t.tagMap,r)&&x(t,'there is a previously declared suffix for "'+r+'" tag handle'),Ke.test(a)||x(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{x(t,"tag prefix is malformed: "+a)}t.tagMap[r]=a}};function ot(t,o,n,r){var a,i,l,s;if(o<n){if(s=t.input.slice(o,n),r)for(a=0,i=s.length;a<i;a+=1)l=s.charCodeAt(a),l===9||32<=l&&l<=1114111||x(t,"expected valid JSON character");else Fr.test(s)&&x(t,"the stream contains non-printable characters");t.result+=s}}function Ue(t,o,n,r){var a,i,l,s;for(q.isObject(n)||x(t,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(n),l=0,s=a.length;l<s;l+=1)i=a[l],nt.call(o,i)||(o[i]=n[i],r[i]=!0)}function ct(t,o,n,r,a,i,l,s,c){var d,u;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),d=0,u=a.length;d<u;d+=1)Array.isArray(a[d])&&x(t,"nested arrays are not supported inside keys"),typeof a=="object"&&De(a[d])==="[object Object]"&&(a[d]="[object Object]");if(typeof a=="object"&&De(a)==="[object Object]"&&(a="[object Object]"),a=String(a),o===null&&(o={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(d=0,u=i.length;d<u;d+=1)Ue(t,o,i[d],n);else Ue(t,o,i,n);else!t.json&&!nt.call(n,a)&&nt.call(o,a)&&(t.line=l||t.line,t.lineStart=s||t.lineStart,t.position=c||t.position,x(t,"duplicated mapping key")),a==="__proto__"?Object.defineProperty(o,a,{configurable:!0,enumerable:!0,writable:!0,value:i}):o[a]=i,delete n[a];return o}function qt(t){var o;o=t.input.charCodeAt(t.position),o===10?t.position++:o===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):x(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function M(t,o,n){for(var r=0,a=t.input.charCodeAt(t.position);a!==0;){for(;at(a);)a===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),a=t.input.charCodeAt(++t.position);if(o&&a===35)do a=t.input.charCodeAt(++t.position);while(a!==10&&a!==13&&a!==0);if(Q(a))for(qt(t),a=t.input.charCodeAt(t.position),r++,t.lineIndent=0;a===32;)t.lineIndent++,a=t.input.charCodeAt(++t.position);else break}return n!==-1&&r!==0&&t.lineIndent<n&&St(t,"deficient indentation"),r}function xt(t){var o=t.position,n;return n=t.input.charCodeAt(o),!!((n===45||n===46)&&n===t.input.charCodeAt(o+1)&&n===t.input.charCodeAt(o+2)&&(o+=3,n=t.input.charCodeAt(o),n===0||W(n)))}function vt(t,o){o===1?t.result+=" ":o>1&&(t.result+=q.repeat(`
10
+ `,o-1))}function Rr(t,o,n){var r,a,i,l,s,c,d,u,p=t.kind,y=t.result,m;if(m=t.input.charCodeAt(t.position),W(m)||lt(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96||(m===63||m===45)&&(a=t.input.charCodeAt(t.position+1),W(a)||n&&lt(a)))return!1;for(t.kind="scalar",t.result="",i=l=t.position,s=!1;m!==0;){if(m===58){if(a=t.input.charCodeAt(t.position+1),W(a)||n&&lt(a))break}else if(m===35){if(r=t.input.charCodeAt(t.position-1),W(r))break}else{if(t.position===t.lineStart&&xt(t)||n&&lt(m))break;if(Q(m))if(c=t.line,d=t.lineStart,u=t.lineIndent,M(t,!1,-1),t.lineIndent>=o){s=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=l,t.line=c,t.lineStart=d,t.lineIndent=u;break}}s&&(ot(t,i,l,!1),vt(t,t.line-c),i=l=t.position,s=!1),at(m)||(l=t.position+1),m=t.input.charCodeAt(++t.position)}return ot(t,i,l,!1),t.result?!0:(t.kind=p,t.result=y,!1)}function Ur(t,o){var n,r,a;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=a=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(ot(t,r,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)r=t.position,t.position++,a=t.position;else return!0;else Q(n)?(ot(t,r,a,!0),vt(t,M(t,!1,o)),r=a=t.position):t.position===t.lineStart&&xt(t)?x(t,"unexpected end of the document within a single quoted scalar"):(t.position++,a=t.position);x(t,"unexpected end of the stream within a single quoted scalar")}function zr(t,o){var n,r,a,i,l,s;if(s=t.input.charCodeAt(t.position),s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=r=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return ot(t,n,t.position,!0),t.position++,!0;if(s===92){if(ot(t,n,t.position,!0),s=t.input.charCodeAt(++t.position),Q(s))M(t,!1,o);else if(s<256&&qe[s])t.result+=ve[s],t.position++;else if((l=Lr(s))>0){for(a=l,i=0;a>0;a--)s=t.input.charCodeAt(++t.position),(l=Dr(s))>=0?i=(i<<4)+l:x(t,"expected hexadecimal character");t.result+=vr(i),t.position++}else x(t,"unknown escape sequence");n=r=t.position}else Q(s)?(ot(t,n,r,!0),vt(t,M(t,!1,o)),n=r=t.position):t.position===t.lineStart&&xt(t)?x(t,"unexpected end of the document within a double quoted scalar"):(t.position++,r=t.position)}x(t,"unexpected end of the stream within a double quoted scalar")}function Hr(t,o){var n=!0,r,a,i,l=t.tag,s,c=t.anchor,d,u,p,y,m,S=Object.create(null),k,f,h,g;if(g=t.input.charCodeAt(t.position),g===91)u=93,m=!1,s=[];else if(g===123)u=125,m=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),g=t.input.charCodeAt(++t.position);g!==0;){if(M(t,!0,o),g=t.input.charCodeAt(t.position),g===u)return t.position++,t.tag=l,t.anchor=c,t.kind=m?"mapping":"sequence",t.result=s,!0;n?g===44&&x(t,"expected the node content, but found ','"):x(t,"missed comma between flow collection entries"),f=k=h=null,p=y=!1,g===63&&(d=t.input.charCodeAt(t.position+1),W(d)&&(p=y=!0,t.position++,M(t,!0,o))),r=t.line,a=t.lineStart,i=t.position,dt(t,o,Ct,!1,!0),f=t.tag,k=t.result,M(t,!0,o),g=t.input.charCodeAt(t.position),(y||t.line===r)&&g===58&&(p=!0,g=t.input.charCodeAt(++t.position),M(t,!0,o),dt(t,o,Ct,!1,!0),h=t.result),m?ct(t,s,S,f,k,h,r,a,i):p?s.push(ct(t,null,S,f,k,h,r,a,i)):s.push(k),M(t,!0,o),g=t.input.charCodeAt(t.position),g===44?(n=!0,g=t.input.charCodeAt(++t.position)):n=!1}x(t,"unexpected end of the stream within a flow collection")}function Jr(t,o){var n,r,a=Lt,i=!1,l=!1,s=o,c=0,d=!1,u,p;if(p=t.input.charCodeAt(t.position),p===124)r=!1;else if(p===62)r=!0;else return!1;for(t.kind="scalar",t.result="";p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)Lt===a?a=p===43?Fe:Or:x(t,"repeat of a chomping mode identifier");else if((u=qr(p))>=0)u===0?x(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?x(t,"repeat of an indentation width identifier"):(s=o+u-1,l=!0);else break;if(at(p)){do p=t.input.charCodeAt(++t.position);while(at(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!Q(p)&&p!==0)}for(;p!==0;){for(qt(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!l||t.lineIndent<s)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>s&&(s=t.lineIndent),Q(p)){c++;continue}if(t.lineIndent<s){a===Fe?t.result+=q.repeat(`
11
+ `,i?1+c:c):a===Lt&&i&&(t.result+=`
12
+ `);break}for(r?at(p)?(d=!0,t.result+=q.repeat(`
13
13
  `,i?1+c:c)):d?(d=!1,t.result+=q.repeat(`
14
14
  `,c+1)):c===0?i&&(t.result+=" "):t.result+=q.repeat(`
15
15
  `,c):t.result+=q.repeat(`
16
- `,i?1+c:c),i=!0,l=!0,c=0,n=t.position;!Q(p)&&p!==0;)p=t.input.charCodeAt(++t.position);ot(t,n,t.position,!1)}return!0}function Ue(t,o){var n,a=t.tag,r=t.anchor,i=[],l,s=!1,c;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=i),c=t.input.charCodeAt(t.position);c!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,x(t,"tab characters must not be used in indentation")),!(c!==45||(l=t.input.charCodeAt(t.position+1),!W(l))));){if(s=!0,t.position++,F(t,!0,-1)&&t.lineIndent<=o){i.push(null),c=t.input.charCodeAt(t.position);continue}if(n=t.line,dt(t,o,$e,!1,!0),i.push(t.result),F(t,!0,-1),c=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>o)&&c!==0)x(t,"bad indentation of a sequence entry");else if(t.lineIndent<o)break}return s?(t.tag=a,t.anchor=r,t.kind="sequence",t.result=i,!0):!1}function Da(t,o,n){var a,r,i,l,s,c,d=t.tag,u=t.anchor,p={},y=Object.create(null),m=null,S=null,k=null,f=!1,h=!1,g;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=p),g=t.input.charCodeAt(t.position);g!==0;){if(!f&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,x(t,"tab characters must not be used in indentation")),a=t.input.charCodeAt(t.position+1),i=t.line,(g===63||g===58)&&W(a))g===63?(f&&(ct(t,p,y,m,S,null,l,s,c),m=S=k=null),h=!0,f=!0,r=!0):f?(f=!1,r=!0):x(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,g=a;else{if(l=t.line,s=t.lineStart,c=t.position,!dt(t,n,je,!1,!0))break;if(t.line===i){for(g=t.input.charCodeAt(t.position);rt(g);)g=t.input.charCodeAt(++t.position);if(g===58)g=t.input.charCodeAt(++t.position),W(g)||x(t,"a whitespace character is expected after the key-value separator within a block mapping"),f&&(ct(t,p,y,m,S,null,l,s,c),m=S=k=null),h=!0,f=!1,r=!1,m=t.tag,S=t.result;else if(h)x(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=d,t.anchor=u,!0}else if(h)x(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=d,t.anchor=u,!0}if((t.line===i||t.lineIndent>o)&&(f&&(l=t.line,s=t.lineStart,c=t.position),dt(t,o,wt,!0,r)&&(f?S=t.result:k=t.result),f||(ct(t,p,y,m,S,k,l,s,c),m=S=k=null),F(t,!0,-1),g=t.input.charCodeAt(t.position)),(t.line===i||t.lineIndent>o)&&g!==0)x(t,"bad indentation of a mapping entry");else if(t.lineIndent<o)break}return f&&ct(t,p,y,m,S,null,l,s,c),h&&(t.tag=d,t.anchor=u,t.kind="mapping",t.result=p),h}function La(t){var o,n=!1,a=!1,r,i,l;if(l=t.input.charCodeAt(t.position),l!==33)return!1;if(t.tag!==null&&x(t,"duplication of a tag property"),l=t.input.charCodeAt(++t.position),l===60?(n=!0,l=t.input.charCodeAt(++t.position)):l===33?(a=!0,r="!!",l=t.input.charCodeAt(++t.position)):r="!",o=t.position,n){do l=t.input.charCodeAt(++t.position);while(l!==0&&l!==62);t.position<t.length?(i=t.input.slice(o,t.position),l=t.input.charCodeAt(++t.position)):x(t,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!W(l);)l===33&&(a?x(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(o-1,t.position+1),Me.test(r)||x(t,"named tag handle cannot contain such characters"),a=!0,o=t.position+1)),l=t.input.charCodeAt(++t.position);i=t.input.slice(o,t.position),Na.test(i)&&x(t,"tag suffix cannot contain flow indicator characters")}i&&!Fe.test(i)&&x(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{x(t,"tag name is malformed: "+i)}return n?t.tag=i:nt.call(t.tagMap,r)?t.tag=t.tagMap[r]+i:r==="!"?t.tag="!"+i:r==="!!"?t.tag="tag:yaml.org,2002:"+i:x(t,'undeclared tag handle "'+r+'"'),!0}function qa(t){var o,n;if(n=t.input.charCodeAt(t.position),n!==38)return!1;for(t.anchor!==null&&x(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),o=t.position;n!==0&&!W(n)&&!lt(n);)n=t.input.charCodeAt(++t.position);return t.position===o&&x(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(o,t.position),!0}function va(t){var o,n,a;if(a=t.input.charCodeAt(t.position),a!==42)return!1;for(a=t.input.charCodeAt(++t.position),o=t.position;a!==0&&!W(a)&&!lt(a);)a=t.input.charCodeAt(++t.position);return t.position===o&&x(t,"name of an alias node must contain at least one character"),n=t.input.slice(o,t.position),nt.call(t.anchorMap,n)||x(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],F(t,!0,-1),!0}function dt(t,o,n,a,r){var i,l,s,c=1,d=!1,u=!1,p,y,m,S,k,f;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,i=l=s=wt===n||$e===n,a&&F(t,!0,-1)&&(d=!0,t.lineIndent>o?c=1:t.lineIndent===o?c=0:t.lineIndent<o&&(c=-1)),c===1)for(;La(t)||qa(t);)F(t,!0,-1)?(d=!0,s=i,t.lineIndent>o?c=1:t.lineIndent===o?c=0:t.lineIndent<o&&(c=-1)):s=!1;if(s&&(s=d||r),(c===1||wt===n)&&(Ct===n||je===n?k=o:k=o+1,f=t.position-t.lineStart,c===1?s&&(Ue(t,f)||Da(t,f,k))||Fa(t,k)?u=!0:(l&&Ka(t,k)||Oa(t,k)||Ma(t,k)?u=!0:va(t)?(u=!0,(t.tag!==null||t.anchor!==null)&&x(t,"alias node should not have any properties")):$a(t,k,Ct===n)&&(u=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):c===0&&(u=s&&Ue(t,f))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&x(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),p=0,y=t.implicitTypes.length;p<y;p+=1)if(S=t.implicitTypes[p],S.resolve(t.result)){t.result=S.construct(t.result),t.tag=S.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(nt.call(t.typeMap[t.kind||"fallback"],t.tag))S=t.typeMap[t.kind||"fallback"][t.tag];else for(S=null,m=t.typeMap.multi[t.kind||"fallback"],p=0,y=m.length;p<y;p+=1)if(t.tag.slice(0,m[p].tag.length)===m[p].tag){S=m[p];break}S||x(t,"unknown tag !<"+t.tag+">"),t.result!==null&&S.kind!==t.kind&&x(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+S.kind+'", not "'+t.kind+'"'),S.resolve(t.result,t.tag)?(t.result=S.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):x(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||u}function Pa(t){var o=t.position,n,a,r,i=!1,l;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(l=t.input.charCodeAt(t.position))!==0&&(F(t,!0,-1),l=t.input.charCodeAt(t.position),!(t.lineIndent>0||l!==37));){for(i=!0,l=t.input.charCodeAt(++t.position),n=t.position;l!==0&&!W(l);)l=t.input.charCodeAt(++t.position);for(a=t.input.slice(n,t.position),r=[],a.length<1&&x(t,"directive name must not be less than one character in length");l!==0;){for(;rt(l);)l=t.input.charCodeAt(++t.position);if(l===35){do l=t.input.charCodeAt(++t.position);while(l!==0&&!Q(l));break}if(Q(l))break;for(n=t.position;l!==0&&!W(l);)l=t.input.charCodeAt(++t.position);r.push(t.input.slice(n,t.position))}l!==0&&qt(t),nt.call(Pe,a)?Pe[a](t,a,r):St(t,'unknown document directive "'+a+'"')}if(F(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,F(t,!0,-1)):i&&x(t,"directives end mark is expected"),dt(t,t.lineIndent-1,wt,!1,!0),F(t,!0,-1),t.checkLineBreaks&&Aa.test(t.input.slice(o,t.position))&&St(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&xt(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,F(t,!0,-1));return}if(t.position<t.length-1)x(t,"end of the stream or a document separator is expected");else return}function ze(t,o){t=String(t),o=o||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
17
- `),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new ja(t,o),a=t.indexOf("\0");for(a!==-1&&(n.position=a,x(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Pa(n);return n.documents}function Ra(t,o,n){o!==null&&typeof o=="object"&&typeof n>"u"&&(n=o,o=null);var a=ze(t,n);if(typeof o!="function")return a;for(var r=0,i=a.length;r<i;r+=1)o(a[r])}function Ua(t,o){var n=ze(t,o);if(n.length!==0){if(n.length===1)return n[0];throw new J("expected a single document in the stream, but found more")}}var za=Ra,Ha=Ua,He={loadAll:za,load:Ha},Je=Object.prototype.toString,Ye=Object.prototype.hasOwnProperty,Pt=65279,Ja=9,mt=10,Ya=13,Wa=32,Za=33,Ga=34,Rt=35,Xa=37,Qa=38,tr=39,er=42,We=44,nr=45,Bt=58,or=61,ar=62,rr=63,ir=64,Ze=91,Ge=93,lr=96,Xe=123,sr=124,Qe=125,H={};H[0]="\\0",H[7]="\\a",H[8]="\\b",H[9]="\\t",H[10]="\\n",H[11]="\\v",H[12]="\\f",H[13]="\\r",H[27]="\\e",H[34]='\\"',H[92]="\\\\",H[133]="\\N",H[160]="\\_",H[8232]="\\L",H[8233]="\\P";var cr=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],dr=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function pr(t,o){var n,a,r,i,l,s,c;if(o===null)return{};for(n={},a=Object.keys(o),r=0,i=a.length;r<i;r+=1)l=a[r],s=String(o[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),c=t.compiledTypeMap.fallback[l],c&&Ye.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[l]=s;return n}function ur(t){var o,n,a;if(o=t.toString(16).toUpperCase(),t<=255)n="x",a=2;else if(t<=65535)n="u",a=4;else if(t<=4294967295)n="U",a=8;else throw new J("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+q.repeat("0",a-o.length)+o}var fr=1,yt=2;function mr(t){this.schema=t.schema||Dt,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=q.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=pr(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?yt:fr,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function tn(t,o){for(var n=q.repeat(" ",o),a=0,r=-1,i="",l,s=t.length;a<s;)r=t.indexOf(`
18
- `,a),r===-1?(l=t.slice(a),a=s):(l=t.slice(a,r+1),a=r+1),l.length&&l!==`
16
+ `,i?1+c:c),i=!0,l=!0,c=0,n=t.position;!Q(p)&&p!==0;)p=t.input.charCodeAt(++t.position);ot(t,n,t.position,!1)}return!0}function ze(t,o){var n,r=t.tag,a=t.anchor,i=[],l,s=!1,c;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=i),c=t.input.charCodeAt(t.position);c!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,x(t,"tab characters must not be used in indentation")),!(c!==45||(l=t.input.charCodeAt(t.position+1),!W(l))));){if(s=!0,t.position++,M(t,!0,-1)&&t.lineIndent<=o){i.push(null),c=t.input.charCodeAt(t.position);continue}if(n=t.line,dt(t,o,Oe,!1,!0),i.push(t.result),M(t,!0,-1),c=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>o)&&c!==0)x(t,"bad indentation of a sequence entry");else if(t.lineIndent<o)break}return s?(t.tag=r,t.anchor=a,t.kind="sequence",t.result=i,!0):!1}function Yr(t,o,n){var r,a,i,l,s,c,d=t.tag,u=t.anchor,p={},y=Object.create(null),m=null,S=null,k=null,f=!1,h=!1,g;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=p),g=t.input.charCodeAt(t.position);g!==0;){if(!f&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,x(t,"tab characters must not be used in indentation")),r=t.input.charCodeAt(t.position+1),i=t.line,(g===63||g===58)&&W(r))g===63?(f&&(ct(t,p,y,m,S,null,l,s,c),m=S=k=null),h=!0,f=!0,a=!0):f?(f=!1,a=!0):x(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,g=r;else{if(l=t.line,s=t.lineStart,c=t.position,!dt(t,n,je,!1,!0))break;if(t.line===i){for(g=t.input.charCodeAt(t.position);at(g);)g=t.input.charCodeAt(++t.position);if(g===58)g=t.input.charCodeAt(++t.position),W(g)||x(t,"a whitespace character is expected after the key-value separator within a block mapping"),f&&(ct(t,p,y,m,S,null,l,s,c),m=S=k=null),h=!0,f=!1,a=!1,m=t.tag,S=t.result;else if(h)x(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=d,t.anchor=u,!0}else if(h)x(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=d,t.anchor=u,!0}if((t.line===i||t.lineIndent>o)&&(f&&(l=t.line,s=t.lineStart,c=t.position),dt(t,o,wt,!0,a)&&(f?S=t.result:k=t.result),f||(ct(t,p,y,m,S,k,l,s,c),m=S=k=null),M(t,!0,-1),g=t.input.charCodeAt(t.position)),(t.line===i||t.lineIndent>o)&&g!==0)x(t,"bad indentation of a mapping entry");else if(t.lineIndent<o)break}return f&&ct(t,p,y,m,S,null,l,s,c),h&&(t.tag=d,t.anchor=u,t.kind="mapping",t.result=p),h}function Wr(t){var o,n=!1,r=!1,a,i,l;if(l=t.input.charCodeAt(t.position),l!==33)return!1;if(t.tag!==null&&x(t,"duplication of a tag property"),l=t.input.charCodeAt(++t.position),l===60?(n=!0,l=t.input.charCodeAt(++t.position)):l===33?(r=!0,a="!!",l=t.input.charCodeAt(++t.position)):a="!",o=t.position,n){do l=t.input.charCodeAt(++t.position);while(l!==0&&l!==62);t.position<t.length?(i=t.input.slice(o,t.position),l=t.input.charCodeAt(++t.position)):x(t,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!W(l);)l===33&&(r?x(t,"tag suffix cannot contain exclamation marks"):(a=t.input.slice(o-1,t.position+1),Me.test(a)||x(t,"named tag handle cannot contain such characters"),r=!0,o=t.position+1)),l=t.input.charCodeAt(++t.position);i=t.input.slice(o,t.position),Kr.test(i)&&x(t,"tag suffix cannot contain flow indicator characters")}i&&!Ke.test(i)&&x(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{x(t,"tag name is malformed: "+i)}return n?t.tag=i:nt.call(t.tagMap,a)?t.tag=t.tagMap[a]+i:a==="!"?t.tag="!"+i:a==="!!"?t.tag="tag:yaml.org,2002:"+i:x(t,'undeclared tag handle "'+a+'"'),!0}function Gr(t){var o,n;if(n=t.input.charCodeAt(t.position),n!==38)return!1;for(t.anchor!==null&&x(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),o=t.position;n!==0&&!W(n)&&!lt(n);)n=t.input.charCodeAt(++t.position);return t.position===o&&x(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(o,t.position),!0}function Zr(t){var o,n,r;if(r=t.input.charCodeAt(t.position),r!==42)return!1;for(r=t.input.charCodeAt(++t.position),o=t.position;r!==0&&!W(r)&&!lt(r);)r=t.input.charCodeAt(++t.position);return t.position===o&&x(t,"name of an alias node must contain at least one character"),n=t.input.slice(o,t.position),nt.call(t.anchorMap,n)||x(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],M(t,!0,-1),!0}function dt(t,o,n,r,a){var i,l,s,c=1,d=!1,u=!1,p,y,m,S,k,f;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,i=l=s=wt===n||Oe===n,r&&M(t,!0,-1)&&(d=!0,t.lineIndent>o?c=1:t.lineIndent===o?c=0:t.lineIndent<o&&(c=-1)),c===1)for(;Wr(t)||Gr(t);)M(t,!0,-1)?(d=!0,s=i,t.lineIndent>o?c=1:t.lineIndent===o?c=0:t.lineIndent<o&&(c=-1)):s=!1;if(s&&(s=d||a),(c===1||wt===n)&&(Ct===n||je===n?k=o:k=o+1,f=t.position-t.lineStart,c===1?s&&(ze(t,f)||Yr(t,f,k))||Hr(t,k)?u=!0:(l&&Jr(t,k)||Ur(t,k)||zr(t,k)?u=!0:Zr(t)?(u=!0,(t.tag!==null||t.anchor!==null)&&x(t,"alias node should not have any properties")):Rr(t,k,Ct===n)&&(u=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):c===0&&(u=s&&ze(t,f))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&x(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),p=0,y=t.implicitTypes.length;p<y;p+=1)if(S=t.implicitTypes[p],S.resolve(t.result)){t.result=S.construct(t.result),t.tag=S.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(nt.call(t.typeMap[t.kind||"fallback"],t.tag))S=t.typeMap[t.kind||"fallback"][t.tag];else for(S=null,m=t.typeMap.multi[t.kind||"fallback"],p=0,y=m.length;p<y;p+=1)if(t.tag.slice(0,m[p].tag.length)===m[p].tag){S=m[p];break}S||x(t,"unknown tag !<"+t.tag+">"),t.result!==null&&S.kind!==t.kind&&x(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+S.kind+'", not "'+t.kind+'"'),S.resolve(t.result,t.tag)?(t.result=S.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):x(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||u}function Xr(t){var o=t.position,n,r,a,i=!1,l;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(l=t.input.charCodeAt(t.position))!==0&&(M(t,!0,-1),l=t.input.charCodeAt(t.position),!(t.lineIndent>0||l!==37));){for(i=!0,l=t.input.charCodeAt(++t.position),n=t.position;l!==0&&!W(l);)l=t.input.charCodeAt(++t.position);for(r=t.input.slice(n,t.position),a=[],r.length<1&&x(t,"directive name must not be less than one character in length");l!==0;){for(;at(l);)l=t.input.charCodeAt(++t.position);if(l===35){do l=t.input.charCodeAt(++t.position);while(l!==0&&!Q(l));break}if(Q(l))break;for(n=t.position;l!==0&&!W(l);)l=t.input.charCodeAt(++t.position);a.push(t.input.slice(n,t.position))}l!==0&&qt(t),nt.call(Re,r)?Re[r](t,r,a):St(t,'unknown document directive "'+r+'"')}if(M(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,M(t,!0,-1)):i&&x(t,"directives end mark is expected"),dt(t,t.lineIndent-1,wt,!1,!0),M(t,!0,-1),t.checkLineBreaks&&Mr.test(t.input.slice(o,t.position))&&St(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&xt(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,M(t,!0,-1));return}if(t.position<t.length-1)x(t,"end of the stream or a document separator is expected");else return}function He(t,o){t=String(t),o=o||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
17
+ `),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new Pr(t,o),r=t.indexOf("\0");for(r!==-1&&(n.position=r,x(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Xr(n);return n.documents}function Qr(t,o,n){o!==null&&typeof o=="object"&&typeof n>"u"&&(n=o,o=null);var r=He(t,n);if(typeof o!="function")return r;for(var a=0,i=r.length;a<i;a+=1)o(r[a])}function ta(t,o){var n=He(t,o);if(n.length!==0){if(n.length===1)return n[0];throw new J("expected a single document in the stream, but found more")}}var ea=Qr,na=ta,Je={loadAll:ea,load:na},Ye=Object.prototype.toString,We=Object.prototype.hasOwnProperty,Pt=65279,oa=9,mt=10,ra=13,aa=32,ia=33,la=34,Rt=35,sa=37,ca=38,da=39,pa=42,Ge=44,ua=45,Bt=58,fa=61,ma=62,ya=63,ga=64,Ze=91,Xe=93,ha=96,Qe=123,ka=124,tn=125,H={};H[0]="\\0",H[7]="\\a",H[8]="\\b",H[9]="\\t",H[10]="\\n",H[11]="\\v",H[12]="\\f",H[13]="\\r",H[27]="\\e",H[34]='\\"',H[92]="\\\\",H[133]="\\N",H[160]="\\_",H[8232]="\\L",H[8233]="\\P";var ba=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ca=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function wa(t,o){var n,r,a,i,l,s,c;if(o===null)return{};for(n={},r=Object.keys(o),a=0,i=r.length;a<i;a+=1)l=r[a],s=String(o[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),c=t.compiledTypeMap.fallback[l],c&&We.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[l]=s;return n}function Sa(t){var o,n,r;if(o=t.toString(16).toUpperCase(),t<=255)n="x",r=2;else if(t<=65535)n="u",r=4;else if(t<=4294967295)n="U",r=8;else throw new J("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+q.repeat("0",r-o.length)+o}var xa=1,yt=2;function Ba(t){this.schema=t.schema||Dt,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=q.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=wa(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?yt:xa,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function en(t,o){for(var n=q.repeat(" ",o),r=0,a=-1,i="",l,s=t.length;r<s;)a=t.indexOf(`
18
+ `,r),a===-1?(l=t.slice(r),r=s):(l=t.slice(r,a+1),r=a+1),l.length&&l!==`
19
19
  `&&(i+=n),i+=l;return i}function Ut(t,o){return`
20
- `+q.repeat(" ",t.indent*o)}function yr(t,o){var n,a,r;for(n=0,a=t.implicitTypes.length;n<a;n+=1)if(r=t.implicitTypes[n],r.resolve(o))return!0;return!1}function It(t){return t===Wa||t===Ja}function gt(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==Pt||65536<=t&&t<=1114111}function en(t){return gt(t)&&t!==Pt&&t!==Ya&&t!==mt}function nn(t,o,n){var a=en(t),r=a&&!It(t);return(n?a:a&&t!==We&&t!==Ze&&t!==Ge&&t!==Xe&&t!==Qe)&&t!==Rt&&!(o===Bt&&!r)||en(o)&&!It(o)&&t===Rt||o===Bt&&r}function gr(t){return gt(t)&&t!==Pt&&!It(t)&&t!==nr&&t!==rr&&t!==Bt&&t!==We&&t!==Ze&&t!==Ge&&t!==Xe&&t!==Qe&&t!==Rt&&t!==Qa&&t!==er&&t!==Za&&t!==sr&&t!==or&&t!==ar&&t!==tr&&t!==Ga&&t!==Xa&&t!==ir&&t!==lr}function hr(t){return!It(t)&&t!==Bt}function ht(t,o){var n=t.charCodeAt(o),a;return n>=55296&&n<=56319&&o+1<t.length&&(a=t.charCodeAt(o+1),a>=56320&&a<=57343)?(n-55296)*1024+a-56320+65536:n}function on(t){var o=/^\n* /;return o.test(t)}var an=1,zt=2,rn=3,ln=4,pt=5;function kr(t,o,n,a,r,i,l,s){var c,d=0,u=null,p=!1,y=!1,m=a!==-1,S=-1,k=gr(ht(t,0))&&hr(ht(t,t.length-1));if(o||l)for(c=0;c<t.length;d>=65536?c+=2:c++){if(d=ht(t,c),!gt(d))return pt;k=k&&nn(d,u,s),u=d}else{for(c=0;c<t.length;d>=65536?c+=2:c++){if(d=ht(t,c),d===mt)p=!0,m&&(y=y||c-S-1>a&&t[S+1]!==" ",S=c);else if(!gt(d))return pt;k=k&&nn(d,u,s),u=d}y=y||m&&c-S-1>a&&t[S+1]!==" "}return!p&&!y?k&&!l&&!r(t)?an:i===yt?pt:zt:n>9&&on(t)?pt:l?i===yt?pt:zt:y?ln:rn}function br(t,o,n,a,r){t.dump=function(){if(o.length===0)return t.quotingType===yt?'""':"''";if(!t.noCompatMode&&(cr.indexOf(o)!==-1||dr.test(o)))return t.quotingType===yt?'"'+o+'"':"'"+o+"'";var i=t.indent*Math.max(1,n),l=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-i),s=a||t.flowLevel>-1&&n>=t.flowLevel;function c(d){return yr(t,d)}switch(kr(o,s,t.indent,l,c,t.quotingType,t.forceQuotes&&!a,r)){case an:return o;case zt:return"'"+o.replace(/'/g,"''")+"'";case rn:return"|"+sn(o,t.indent)+cn(tn(o,i));case ln:return">"+sn(o,t.indent)+cn(tn(Cr(o,l),i));case pt:return'"'+wr(o)+'"';default:throw new J("impossible error: invalid scalar style")}}()}function sn(t,o){var n=on(t)?String(o):"",a=t[t.length-1]===`
21
- `,r=a&&(t[t.length-2]===`
20
+ `+q.repeat(" ",t.indent*o)}function Na(t,o){var n,r,a;for(n=0,r=t.implicitTypes.length;n<r;n+=1)if(a=t.implicitTypes[n],a.resolve(o))return!0;return!1}function Nt(t){return t===aa||t===oa}function gt(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==Pt||65536<=t&&t<=1114111}function nn(t){return gt(t)&&t!==Pt&&t!==ra&&t!==mt}function on(t,o,n){var r=nn(t),a=r&&!Nt(t);return(n?r:r&&t!==Ge&&t!==Ze&&t!==Xe&&t!==Qe&&t!==tn)&&t!==Rt&&!(o===Bt&&!a)||nn(o)&&!Nt(o)&&t===Rt||o===Bt&&a}function Ia(t){return gt(t)&&t!==Pt&&!Nt(t)&&t!==ua&&t!==ya&&t!==Bt&&t!==Ge&&t!==Ze&&t!==Xe&&t!==Qe&&t!==tn&&t!==Rt&&t!==ca&&t!==pa&&t!==ia&&t!==ka&&t!==fa&&t!==ma&&t!==da&&t!==la&&t!==sa&&t!==ga&&t!==ha}function Aa(t){return!Nt(t)&&t!==Bt}function ht(t,o){var n=t.charCodeAt(o),r;return n>=55296&&n<=56319&&o+1<t.length&&(r=t.charCodeAt(o+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function rn(t){var o=/^\n* /;return o.test(t)}var an=1,zt=2,ln=3,sn=4,pt=5;function _a(t,o,n,r,a,i,l,s){var c,d=0,u=null,p=!1,y=!1,m=r!==-1,S=-1,k=Ia(ht(t,0))&&Aa(ht(t,t.length-1));if(o||l)for(c=0;c<t.length;d>=65536?c+=2:c++){if(d=ht(t,c),!gt(d))return pt;k=k&&on(d,u,s),u=d}else{for(c=0;c<t.length;d>=65536?c+=2:c++){if(d=ht(t,c),d===mt)p=!0,m&&(y=y||c-S-1>r&&t[S+1]!==" ",S=c);else if(!gt(d))return pt;k=k&&on(d,u,s),u=d}y=y||m&&c-S-1>r&&t[S+1]!==" "}return!p&&!y?k&&!l&&!a(t)?an:i===yt?pt:zt:n>9&&rn(t)?pt:l?i===yt?pt:zt:y?sn:ln}function Ta(t,o,n,r,a){t.dump=function(){if(o.length===0)return t.quotingType===yt?'""':"''";if(!t.noCompatMode&&(ba.indexOf(o)!==-1||Ca.test(o)))return t.quotingType===yt?'"'+o+'"':"'"+o+"'";var i=t.indent*Math.max(1,n),l=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-i),s=r||t.flowLevel>-1&&n>=t.flowLevel;function c(d){return Na(t,d)}switch(_a(o,s,t.indent,l,c,t.quotingType,t.forceQuotes&&!r,a)){case an:return o;case zt:return"'"+o.replace(/'/g,"''")+"'";case ln:return"|"+cn(o,t.indent)+dn(en(o,i));case sn:return">"+cn(o,t.indent)+dn(en(Ea(o,l),i));case pt:return'"'+Va(o)+'"';default:throw new J("impossible error: invalid scalar style")}}()}function cn(t,o){var n=rn(t)?String(o):"",r=t[t.length-1]===`
21
+ `,a=r&&(t[t.length-2]===`
22
22
  `||t===`
23
- `),i=r?"+":a?"":"-";return n+i+`
24
- `}function cn(t){return t[t.length-1]===`
25
- `?t.slice(0,-1):t}function Cr(t,o){for(var n=/(\n+)([^\n]*)/g,a=function(){var d=t.indexOf(`
26
- `);return d=d!==-1?d:t.length,n.lastIndex=d,dn(t.slice(0,d),o)}(),r=t[0]===`
27
- `||t[0]===" ",i,l;l=n.exec(t);){var s=l[1],c=l[2];i=c[0]===" ",a+=s+(!r&&!i&&c!==""?`
28
- `:"")+dn(c,o),r=i}return a}function dn(t,o){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,a,r=0,i,l=0,s=0,c="";a=n.exec(t);)s=a.index,s-r>o&&(i=l>r?l:s,c+=`
29
- `+t.slice(r,i),r=i+1),l=s;return c+=`
30
- `,t.length-r>o&&l>r?c+=t.slice(r,l)+`
31
- `+t.slice(l+1):c+=t.slice(r),c.slice(1)}function wr(t){for(var o="",n=0,a,r=0;r<t.length;n>=65536?r+=2:r++)n=ht(t,r),a=H[n],!a&&gt(n)?(o+=t[r],n>=65536&&(o+=t[r+1])):o+=a||ur(n);return o}function Sr(t,o,n){var a="",r=t.tag,i,l,s;for(i=0,l=n.length;i<l;i+=1)s=n[i],t.replacer&&(s=t.replacer.call(n,String(i),s)),(tt(t,o,s,!1,!1)||typeof s>"u"&&tt(t,o,null,!1,!1))&&(a!==""&&(a+=","+(t.condenseFlow?"":" ")),a+=t.dump);t.tag=r,t.dump="["+a+"]"}function pn(t,o,n,a){var r="",i=t.tag,l,s,c;for(l=0,s=n.length;l<s;l+=1)c=n[l],t.replacer&&(c=t.replacer.call(n,String(l),c)),(tt(t,o+1,c,!0,!0,!1,!0)||typeof c>"u"&&tt(t,o+1,null,!0,!0,!1,!0))&&((!a||r!=="")&&(r+=Ut(t,o)),t.dump&&mt===t.dump.charCodeAt(0)?r+="-":r+="- ",r+=t.dump);t.tag=i,t.dump=r||"[]"}function xr(t,o,n){var a="",r=t.tag,i=Object.keys(n),l,s,c,d,u;for(l=0,s=i.length;l<s;l+=1)u="",a!==""&&(u+=", "),t.condenseFlow&&(u+='"'),c=i[l],d=n[c],t.replacer&&(d=t.replacer.call(n,c,d)),tt(t,o,c,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),tt(t,o,d,!1,!1)&&(u+=t.dump,a+=u));t.tag=r,t.dump="{"+a+"}"}function Br(t,o,n,a){var r="",i=t.tag,l=Object.keys(n),s,c,d,u,p,y;if(t.sortKeys===!0)l.sort();else if(typeof t.sortKeys=="function")l.sort(t.sortKeys);else if(t.sortKeys)throw new J("sortKeys must be a boolean or a function");for(s=0,c=l.length;s<c;s+=1)y="",(!a||r!=="")&&(y+=Ut(t,o)),d=l[s],u=n[d],t.replacer&&(u=t.replacer.call(n,d,u)),tt(t,o+1,d,!0,!0,!0)&&(p=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,p&&(t.dump&&mt===t.dump.charCodeAt(0)?y+="?":y+="? "),y+=t.dump,p&&(y+=Ut(t,o)),tt(t,o+1,u,!0,p)&&(t.dump&&mt===t.dump.charCodeAt(0)?y+=":":y+=": ",y+=t.dump,r+=y));t.tag=i,t.dump=r||"{}"}function un(t,o,n){var a,r,i,l,s,c;for(r=n?t.explicitTypes:t.implicitTypes,i=0,l=r.length;i<l;i+=1)if(s=r[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof o=="object"&&o instanceof s.instanceOf)&&(!s.predicate||s.predicate(o))){if(n?s.multi&&s.representName?t.tag=s.representName(o):t.tag=s.tag:t.tag="?",s.represent){if(c=t.styleMap[s.tag]||s.defaultStyle,Je.call(s.represent)==="[object Function]")a=s.represent(o,c);else if(Ye.call(s.represent,c))a=s.represent[c](o,c);else throw new J("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');t.dump=a}return!0}return!1}function tt(t,o,n,a,r,i,l){t.tag=null,t.dump=n,un(t,n,!1)||un(t,n,!0);var s=Je.call(t.dump),c=a,d;a&&(a=t.flowLevel<0||t.flowLevel>o);var u=s==="[object Object]"||s==="[object Array]",p,y;if(u&&(p=t.duplicates.indexOf(n),y=p!==-1),(t.tag!==null&&t.tag!=="?"||y||t.indent!==2&&o>0)&&(r=!1),y&&t.usedDuplicates[p])t.dump="*ref_"+p;else{if(u&&y&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),s==="[object Object]")a&&Object.keys(t.dump).length!==0?(Br(t,o,t.dump,r),y&&(t.dump="&ref_"+p+t.dump)):(xr(t,o,t.dump),y&&(t.dump="&ref_"+p+" "+t.dump));else if(s==="[object Array]")a&&t.dump.length!==0?(t.noArrayIndent&&!l&&o>0?pn(t,o-1,t.dump,r):pn(t,o,t.dump,r),y&&(t.dump="&ref_"+p+t.dump)):(Sr(t,o,t.dump),y&&(t.dump="&ref_"+p+" "+t.dump));else if(s==="[object String]")t.tag!=="?"&&br(t,t.dump,o,i,c);else{if(s==="[object Undefined]"||t.skipInvalid)return!1;throw new J("unacceptable kind of an object to dump "+s)}t.tag!==null&&t.tag!=="?"&&(d=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",t.dump=d+" "+t.dump)}return!0}function Ir(t,o){var n=[],a=[],r,i;for(Ht(t,n,a),r=0,i=a.length;r<i;r+=1)o.duplicates.push(n[a[r]]);o.usedDuplicates=new Array(i)}function Ht(t,o,n){var a,r,i;if(t!==null&&typeof t=="object")if(r=o.indexOf(t),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(o.push(t),Array.isArray(t))for(r=0,i=t.length;r<i;r+=1)Ht(t[r],o,n);else for(a=Object.keys(t),r=0,i=a.length;r<i;r+=1)Ht(t[a[r]],o,n)}function Ar(t,o){o=o||{};var n=new mr(o);n.noRefs||Ir(t,n);var a=t;return n.replacer&&(a=n.replacer.call({"":a},"",a)),tt(n,0,a,!0,!0)?n.dump+`
32
- `:""}var Nr=Ar,_r={dump:Nr};function Jt(t,o){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}var Tr=U,Er=fe,Vr=he,jr=Se,$r=xe,Or=Dt,Mr=He.load,Fr=He.loadAll,Kr=_r.dump,Dr=J,Lr={binary:_e,float:we,map:ge,null:ke,pairs:Ee,set:Ve,timestamp:Ae,bool:be,int:Ce,merge:Ne,omap:Te,seq:ye,str:me},qr=Jt("safeLoad","load"),vr=Jt("safeLoadAll","loadAll"),Pr=Jt("safeDump","dump"),Rr={Type:Tr,Schema:Er,FAILSAFE_SCHEMA:Vr,JSON_SCHEMA:jr,CORE_SCHEMA:$r,DEFAULT_SCHEMA:Or,load:Mr,loadAll:Fr,dump:Kr,YAMLException:Dr,types:Lr,safeLoad:qr,safeLoadAll:vr,safeDump:Pr};const Ur={key:0,class:"config-card-display-form"},zr=["data-testid"],Hr={key:0,class:"config-card-prop-section-title"},Jr={key:1,class:"config-card-display-json"},Yr={key:2,class:"config-card-display-yaml"},Wr=X(e.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:t=>["structured","yaml","json"].includes(t)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null}},setup(t){const o=t,n=e.useSlots(),{i18n:{t:a}}=P.useI18n(),r=s=>!!(s.tooltip||n[`${s.key}-label-tooltip`]),i=e.ref(""),l=e.ref("");return e.watch(()=>o.format,s=>{s==="json"?i.value=JSON.stringify(o.record,null,2):s==="yaml"&&(l.value=Rr.dump(o.record))},{immediate:!0}),(s,c)=>{const d=e.resolveComponent("KCodeBlock");return e.openBlock(),e.createElementBlock(e.Fragment,null,[t.format==="structured"?(e.openBlock(),e.createElementBlock("div",Ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.propListTypes,u=>(e.openBlock(),e.createElementBlock("div",{key:`config-card-details-${u}-props`,class:e.normalizeClass(`config-card-details-${u}-props`),"data-testid":`config-card-details-${u}-props`},[u!=="basic"?(e.openBlock(),e.createElementBlock("div",Hr,e.toDisplayString(u==="advanced"?e.unref(a)("baseConfigCard.sections.advanced"):e.unref(a)("baseConfigCard.sections.plugin")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.propertyCollections[u],p=>(e.openBlock(),e.createBlock($t,{key:p.key,item:p},e.createSlots({label:e.withCtx(()=>[e.renderSlot(s.$slots,`${p.key}-label`,{row:p},void 0,!0)]),[p.key]:e.withCtx(({rowValue:y})=>[e.renderSlot(s.$slots,p.key,{row:p,rowValue:y},void 0,!0)]),_:2},[r(p)?{name:"label-tooltip",fn:e.withCtx(()=>[e.renderSlot(s.$slots,`${p.key}-label-tooltip`,{row:p},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,zr))),128))])):e.createCommentVNode("",!0),t.format==="json"?(e.openBlock(),e.createElementBlock("div",Jr,[e.createVNode(d,{id:"config-card-codeblock",code:i.value,language:"json",theme:"dark"},null,8,["code"])])):e.createCommentVNode("",!0),t.format==="yaml"?(e.openBlock(),e.createElementBlock("div",Yr,[e.createVNode(d,{id:"config-card-codeblock",code:l.value,language:"yaml",theme:"dark"},null,8,["code"])])):e.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-6c45e9e4"]]),fn="24px",Zr=(t,o)=>{const n=t.__vccOpts||t;for(const[a,r]of o)n[a]=r;return n},Gr=t=>(e.pushScopeId("data-v-dd88a2bb"),t=t(),e.popScopeId(),t),Xr=["aria-hidden"],Qr={key:0,"data-testid":"kui-icon-svg-title"},ti=Gr(()=>e.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)),ei=e.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:fn,validator:t=>{if(typeof t=="number"&&t>0)return!0;if(typeof t=="string"){const o=String(t).replace(/px/gi,""),n=Number(o);if(n&&!isNaN(n)&&Number.isInteger(n)&&n>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(t){const o=t,n=e.computed(()=>{if(typeof o.size=="number"&&o.size>0)return`${o.size}px`;if(typeof o.size=="string"){const r=String(o.size).replace(/px/gi,""),i=Number(r);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return fn}),a=e.computed(()=>({boxSizing:"border-box",color:o.color,display:o.display,height:n.value,lineHeight:"0",width:n.value}));return(r,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.as),{"aria-hidden":t.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:e.normalizeStyle(a.value)},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":t.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"},[t.title?(e.openBlock(),e.createElementBlock("title",Qr,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),ti],8,Xr))]),_:1},8,["aria-hidden","style"]))}}),ni=Zr(ei,[["__scopeId","data-v-dd88a2bb"]]),oi={"data-testid":"config-card-title"},ai={class:"config-card-actions"},ri=["href"],ii={key:2,class:"config-card-details-section"},li={key:3,class:"config-card-details-section"},si=["data-testid"],ci={key:0,class:"config-card-prop-section-title"},di=X(e.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(t,{emit:o}){var n;const a=t,r=e.useSlots(),{i18n:{t:i}}=P.useI18n(),{getMessageFromError:l}=P.useErrors(),{convertKeyToTitle:s}=P.useStringHelpers(),{axiosInstance:c}=P.useAxios({headers:(n=a.config)==null?void 0:n.requestHeaders}),d=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=e.ref("structured"),p=C=>{u.value=C==null?void 0:C.value},y={id:{type:$.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:G.Basic},name:{order:1,section:G.Basic},enabled:{type:$.BadgeStatus,order:2,section:G.Basic},updated_at:{type:$.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:G.Basic},created_at:{type:$.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:G.Basic},tags:{type:$.BadgeTag,order:-1,section:G.Basic}},m=e.ref(!1),S=e.ref(!1),k=e.ref(""),f=e.ref(),h=e.computed(()=>{var C,N,B;if(!f.value)return[];const I=[],_=Object.keys(f.value).length;for(const E in f.value){const j=(N=(C=a.configSchema)==null?void 0:C[E])==null?void 0:N.order,v=(B=y[E])==null?void 0:B.order;let R=_;(v||v===0)&&(R=v===-1?_+1:v),j&&(R=j===-1?_+1:j),I.push([E,R])}return I.sort(function(E,j){return E[1]-j[1]}),I.map(E=>{var j,v;const R=E[0],L=(j=f.value)==null?void 0:j[R],O=((v=a.configSchema)==null?void 0:v[R])||{},Y=y[R];return{key:R,value:L,hidden:O.hidden||!1,type:O.type??((Y==null?void 0:Y.type)||$.Text),label:O.label??((Y==null?void 0:Y.label)||s(R)),tooltip:O.tooltip??((Y==null?void 0:Y.tooltip)||void 0),section:O.section??((Y==null?void 0:Y.section)||G.Advanced)}}).filter(E=>!E.hidden&&E.key!==a.pluginConfigKey)}),g=e.computed(()=>{var C,N;if(!f.value||!a.pluginConfigKey)return[];const B=f.value[a.pluginConfigKey]||{},I=Object.keys(B).length,_=[];for(const E in B){const j=(N=(C=a.pluginConfigSchema)==null?void 0:C[E])==null?void 0:N.order,v=B[E];let R=v!=null&&v!==""?I-1:I;j&&(R=j===-1?I+1:j),_.push([E,R])}return _.sort(function(E,j){return E[1]-j[1]}),_.map(E=>{var j;const v=E[0],R=B[v],L=((j=a.pluginConfigSchema)==null?void 0:j[v])||{};return{key:v,value:R,hidden:L.hidden||!1,type:L.type??$.Text,label:L.label??s(v),tooltip:L.tooltip??void 0,section:G.Plugin}}).filter(E=>!E.hidden)}),b=e.computed(()=>{var C,N,B,I;return{basic:(C=h.value)==null?void 0:C.filter(_=>_.section===G.Basic),advanced:(N=h.value)==null?void 0:N.filter(_=>_.section===G.Advanced),plugin:(I=g.value)==null?void 0:I.concat((B=h.value)==null?void 0:B.filter(_=>_.section===G.Plugin))}}),w=e.computed(()=>{const C=[];return b.value.basic.length&&C.push("basic"),b.value.advanced.length&&C.push("advanced"),b.value.plugin.length&&C.push("plugin"),C}),K=C=>!!(C.tooltip||r[`${C.key}-label-tooltip`]),D=e.computed(()=>{var C,N;let B=`${a.config.apiBaseUrl}${a.fetchUrl}`;return a.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((C=a.config)==null?void 0:C.controlPlaneId)||""):a.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(N=a.config)!=null&&N.workspace?`/${a.config.workspace}`:"")),B=B.replace(/{id}/gi,a.config.entityId),B}),T=C=>{f.value&&C(JSON.stringify(f.value))?o("copy:success",f.value):o("copy:error")};return e.watch(m,C=>{o("loading",C)},{immediate:!0}),e.onBeforeMount(async()=>{S.value=!1,m.value=!0;try{const{data:C}=await c.get(D.value);if(a.dataKey)if(typeof C[a.dataKey]<"u")f.value={...C[a.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:a.dataKey}));else f.value={...C};Object.keys(a.configSchema).filter(N=>a.configSchema[N].forceShow).forEach(N=>{f.value&&typeof f.value[N]>"u"&&(f.value[N]=null)}),o("fetch:success",C)}catch(C){const N=l(C);k.value=N.startsWith("code")?i("baseConfigCard.errors.load"):N,S.value=!0,o("fetch:error",C)}finally{m.value=!1}}),(C,N)=>{const B=e.resolveComponent("KLabel"),I=e.resolveComponent("KSelect"),_=e.resolveComponent("KButton"),E=e.resolveComponent("KClipboardProvider"),j=e.resolveComponent("KSkeleton"),v=e.resolveComponent("KEmptyState"),R=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(R,{class:"kong-ui-entity-base-config-card"},e.createSlots({actions:e.withCtx(()=>[e.createElementVNode("div",ai,[e.renderSlot(C.$slots,"actions",{},void 0,!0),t.config.jsonYamlEnabled?(e.openBlock(),e.createBlock(B,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})):e.createCommentVNode("",!0),t.config.jsonYamlEnabled?(e.openBlock(),e.createBlock(I,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:p})):e.createCommentVNode("",!0),a.config.jsonYamlEnabled&&t.configCardDoc?(e.openBlock(),e.createBlock(_,{key:2,appearance:"btn-link",class:"book-icon","data-testid":"book-icon"},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.configCardDoc,rel:"noopener",target:"_blank"},[e.createVNode(e.unref(ni),{size:e.unref(po)},null,8,["size"])],8,ri)]),_:1})):e.createCommentVNode("",!0),t.config.jsonYamlEnabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E,{key:3},{default:e.withCtx(({copyToClipboard:L})=>[!m.value&&!S.value?(e.openBlock(),e.createBlock(_,{key:0,appearance:"btn-link","data-testid":"json-copy-button",onClick:O=>T(L)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:1}))])]),body:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(j,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):S.value?(e.openBlock(),e.createBlock(v,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:e.withCtx(()=>[e.createElementVNode("h3",null,e.toDisplayString(k.value),1)]),_:1})):e.createCommentVNode("",!0),t.config.jsonYamlEnabled?(e.openBlock(),e.createElementBlock("div",ii,[e.createVNode(Wr,{format:u.value,"prop-list-types":w.value,"property-collections":b.value,record:f.value},e.createSlots({_:2},[e.renderList(Object.keys(C.$slots),L=>({name:L,fn:e.withCtx(({row:O,rowValue:Y})=>[e.renderSlot(C.$slots,L,{row:O,rowValue:Y},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(e.openBlock(),e.createElementBlock("div",li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,L=>(e.openBlock(),e.createElementBlock("div",{key:`config-card-details-${L}-props`,class:e.normalizeClass(`config-card-details-${L}-props`),"data-testid":`config-card-details-${L}-props`},[L!=="basic"?(e.openBlock(),e.createElementBlock("div",ci,e.toDisplayString(L==="advanced"?e.unref(i)("baseConfigCard.sections.advanced"):e.unref(i)("baseConfigCard.sections.plugin")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value[L],O=>(e.openBlock(),e.createBlock($t,{key:O.key,item:O},e.createSlots({label:e.withCtx(()=>[e.renderSlot(C.$slots,`${O.key}-label`,{row:O},void 0,!0)]),[O.key]:e.withCtx(({rowValue:Y})=>[e.renderSlot(C.$slots,O.key,{row:O,rowValue:Y},void 0,!0)]),_:2},[K(O)?{name:"label-tooltip",fn:e.withCtx(()=>[e.renderSlot(C.$slots,`${O.key}-label-tooltip`,{row:O},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,si))),128))]))]),_:2},[t.hideTitle?void 0:{name:"title",fn:e.withCtx(()=>[e.createElementVNode("div",oi,[e.renderSlot(C.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-64349aa2"]]),pi=["onReset","onSubmit"],ui={class:"form-actions","data-testid":"form-actions"},fi=X(e.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(t,{emit:o}){var n;const a=t,r=Nt.useRouter(),{i18n:{t:i}}=P.useI18n(),{getMessageFromError:l}=P.useErrors(),{axiosInstance:s}=P.useAxios({headers:(n=a.config)==null?void 0:n.requestHeaders}),c=e.ref(!1),d=e.ref(!1),u=e.ref(""),p=e.computed(()=>a.canSubmit===!1||a.isReadonly),y=e.computed(()=>{var f,h;if(!a.editId)return"";let g=`${a.config.apiBaseUrl}${a.fetchUrl}`;return a.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((f=a.config)==null?void 0:f.controlPlaneId)||""):a.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(h=a.config)!=null&&h.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.editId),g}),m=()=>{a.config.cancelRoute?r.push(a.config.cancelRoute):S()},S=()=>{o("cancel")},k=()=>{p.value||o("submit")};return e.watch(()=>c.value,f=>{o("loading",f)},{immediate:!0}),e.onBeforeMount(async()=>{if(a.editId)try{d.value=!1,c.value=!0;const{data:f}=await s.get(y.value);o("fetch:success",f)}catch(f){const h=l(f);u.value=h.startsWith("code")?i("baseForm.errors.edit"):h,d.value=!0,o("fetch:error",f)}finally{c.value=!1}}),(f,h)=>{const g=e.resolveComponent("KSkeleton"),b=e.resolveComponent("KEmptyState"),w=e.resolveComponent("KAlert"),K=e.resolveComponent("KButton"),D=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(D,{class:"kong-ui-entity-base-form"},{body:e.withCtx(()=>[c.value?(e.openBlock(),e.createBlock(g,{key:0,type:"form"})):d.value?(e.openBlock(),e.createBlock(b,{key:1,"cta-text":e.unref(i)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":m,"is-error":!0},{message:e.withCtx(()=>[e.createElementVNode("h3",null,e.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(e.openBlock(),e.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:e.withModifiers(S,["prevent"]),onSubmit:e.withModifiers(k,["prevent"])},[e.renderSlot(f.$slots,"default",{},void 0,!0),t.errorMessage?(e.openBlock(),e.createBlock(w,{key:0,"alert-message":t.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):e.createCommentVNode("",!0),e.createElementVNode("div",ui,[e.renderSlot(f.$slots,"form-actions",{},()=>[e.createVNode(K,{appearance:"outline","data-testid":"form-cancel",disabled:t.isReadonly,type:"reset"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),e.createVNode(K,{appearance:"primary","data-testid":"form-submit",disabled:p.value,type:"submit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,pi))]),_:3})}}}),[["__scopeId","data-v-44a90aae"]]),mi={key:0,"data-testid":"first-col"},yi=X(e.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(t){const o=t,n=e.computed(()=>{var k;return((k=o.rowEl)==null?void 0:k.querySelector(`[data-testid="${o.keyName}"]`))||null}),a=e.computed(()=>{var k;return((k=n.value)==null?void 0:k.querySelector('[data-testid="first-col"]'))||null}),r=e.computed(()=>{var k,f;const h=(k=o.rowEl)==null?void 0:k.querySelectorAll("td");return h?((f=h[0])==null?void 0:f.getAttribute("data-testid"))===o.keyName:!1});let i;const l=()=>{i&&(i.disconnect(),i=void 0)},s=()=>{var k,f,h;d.value=((k=a.value)==null?void 0:k.getBoundingClientRect().width)||0,u.value=((f=n.value)==null?void 0:f.clientWidth)||0,p.value=((h=c.value)==null?void 0:h.innerText)||""},c=e.ref({}),d=e.ref(0),u=e.ref(0),p=e.ref(""),y=e.computed(()=>[a.value,n.value]),m=e.watch(y,k=>{if(r.value&&(l(),"ResizeObserver"in window&&window)){i=new ResizeObserver(f=>{window.requestAnimationFrame(()=>{!Array.isArray(f)||!f.length||s()})});for(const f of k)f&&i.observe(f)}},{immediate:!0,flush:"post",deep:!0}),S=e.computed(()=>r.value?d.value>u.value:!1);return e.onMounted(()=>{s()}),e.onUnmounted(()=>{m()}),(k,f)=>{const h=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[r.value?(e.openBlock(),e.createElementBlock("span",mi,[e.createVNode(h,{label:S.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:e.withCtx(()=>[e.renderSlot(k.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):e.renderSlot(k.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-e42a20c9"]]),gi={class:"toolbar-container"},hi={key:0,class:"toolbar-button-container"},ki=["data-testid"],bi=X(e.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(t,{emit:o}){const n=t,{i18n:{t:a}}=P.useI18n(),r=e.computed(()=>n.cacheIdentifier||n.preferencesStorageKey),i=b=>b.hasData||!!n.query,l=e.computed(()=>{const b=[];return Object.keys(n.tableHeaders).forEach(w=>{const K=n.tableHeaders[w];b.push({label:K.label??w,key:w,sortable:K.sortable??!1})}),n.enableEntityActions&&b.push({key:"actions",hideLabel:!0}),b}),s=b=>({"data-rowid":b.id,"data-testid":b.name,...n.rowAttributes(b)}),c=e.ref({}),d=b=>{var w;return(w=c.value)==null?void 0:w.$el.querySelector(`[data-rowid="${b.id}"]`)},u=b=>{const w={"data-testid":b.headerKey,...n.cellAttributes(b)};return b.colIndex===0&&(w.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),w},p=()=>{o("empty-state-cta-clicked"),y()},y=()=>{o("clear-search-input")},m=e.computed(()=>n.disableRowClick?void 0:(b,w)=>{o("click:row",w)}),S=b=>{o("sort",b)},{setTablePreferences:k,getTablePreferences:f}=Sn(),h=e.computed(()=>{const b=f(n.preferencesStorageKey);return{...n.initialFetcherParams,...b}}),g=b=>{n.preferencesStorageKey&&k(n.preferencesStorageKey,b)};return(b,w)=>{const K=e.resolveComponent("KIcon"),D=e.resolveComponent("KButton"),T=e.resolveComponent("KDropdownMenu"),C=e.resolveComponent("KTable"),N=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(N,{class:"kong-ui-entity-base-table",title:t.title},{body:e.withCtx(()=>[e.createVNode(C,{ref_key:"tableRefs",ref:c,"cache-identifier":r.value,"cell-attrs":u,"disable-pagination-page-jump":t.disablePaginationPageJump,"disable-sorting":t.disableSorting,"empty-state-action-button-icon":t.query?"":"plus","empty-state-action-message":t.query?e.unref(a)("baseTable.emptyState.noSearchResultsCtaText"):t.emptyStateOptions.ctaText,"empty-state-action-route":t.query?"":t.emptyStateOptions.ctaPath,"empty-state-icon":t.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":t.query?e.unref(a)("baseTable.emptyState.noSearchResultsMessage"):t.emptyStateOptions.message,"empty-state-title":t.query?e.unref(a)("baseTable.emptyState.noSearchResultsTitle"):t.emptyStateOptions.title,"enable-client-sort":t.enableClientSort,"error-state-title":t.errorMessage,fetcher:t.fetcher,"fetcher-cache-key":String(t.fetcherCacheKey),"has-error":!!t.errorMessage,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":h.value,"is-loading":t.isLoading,"pagination-type":t.paginationType,"row-attrs":s,"search-input":t.query,onKtableEmptyStateCtaClicked:p,"onRow:click":m.value,onSort:w[0]||(w[0]=B=>S(B)),"onUpdate:tablePreferences":g},e.createSlots({toolbar:e.withCtx(({state:B})=>[e.withDirectives(e.createElementVNode("div",gi,[e.renderSlot(b.$slots,"toolbar-filter",{},void 0,!0),b.$slots["toolbar-button"]?(e.openBlock(),e.createElementBlock("div",hi,[e.renderSlot(b.$slots,"toolbar-button",{},void 0,!0)])):e.createCommentVNode("",!0)],512),[[e.vShow,i(B)]])]),actions:e.withCtx(({row:B,rowKey:I,rowValue:_})=>[e.createElementVNode("div",{class:"actions-container","data-testid":B.name},[e.createVNode(T,{"kpop-attributes":{placement:"bottomEnd"},width:t.dropdownMenuWidth},{items:e.withCtx(()=>[e.renderSlot(b.$slots,"actions",{row:B,rowKey:I,rowValue:_},void 0,!0)]),default:e.withCtx(()=>[e.createVNode(D,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:e.withCtx(()=>[e.createVNode(K,{color:e.unref(so),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,ki)]),_:2},[e.renderList(t.tableHeaders,(B,I)=>({name:I,fn:e.withCtx(({row:_,rowKey:E,rowValue:j})=>[e.createVNode(yi,{"key-name":String(I),"row-el":d(_)},{default:e.withCtx(()=>[e.renderSlot(b.$slots,I,{row:_,rowKey:E,rowValue:j},()=>[e.createTextVNode(e.toDisplayString(j),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-6bf92df6"]]),Ci={key:0,class:"kong-ui-entity-delete-error"},wi={key:1,class:"description"},Si=X(e.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(t,{emit:o}){const n=t,{i18nT:a}=P.useI18n(),r=e.computed(()=>n.needConfirm?n.entityName:""),i=()=>{o("cancel")},l=()=>{o("proceed")};return(s,c)=>{const d=e.resolveComponent("KAlert"),u=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(u,{"action-button-text":"Yes, delete","action-pending":t.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":r.value,"is-visible":t.visible,title:t.title,type:"danger",onCanceled:i,onProceed:l},{"body-content":e.withCtx(()=>[t.error?(e.openBlock(),e.createElementBlock("div",Ci,[e.createVNode(d,{appearance:"danger"},{alertMessage:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.error),1)]),_:1})])):e.createCommentVNode("",!0),e.createVNode(e.unref(a),{class:"message",keypath:n.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},e.createSlots({entityType:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.entityType),1)]),_:2},[n.entityName?{name:"entityName",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(n.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),n.description||s.$slots.description?(e.openBlock(),e.createElementBlock("div",wi,[e.renderSlot(s.$slots,"description",{},()=>[e.createElementVNode("p",null,e.toDisplayString(n.description),1)],!0)])):e.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),xi={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Bi={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Ii=["fill"],Ai={mask:"url(#mask0_180_20349)"},Ni=["fill"],_i=e.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${io})`}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",xi,[e.createElementVNode("mask",Bi,[e.createElementVNode("rect",{fill:t.color,height:"20",width:"20"},null,8,Ii)]),e.createElementVNode("g",Ai,[e.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:t.color},null,8,Ni)])]))}}),Ti={key:1,class:"kong-ui-entity-filter"},Ei={class:"menu-item-title"},Vi={class:"menu-item-indicator"},ji={class:"menu-item-body"},$i=["for"],Oi={class:"menu-item-buttons"},Mi=X(e.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,{i18n:{t:a}}=P.useI18n(),r=e.ref(!1),i=e.ref({}),l=e.computed(()=>{const f=[];return new URLSearchParams(n.modelValue).forEach((h,g)=>{h!==""&&f.push(g)}),f}),s=e.computed(()=>{const f=n.config.fields;return Object.keys(f).filter(h=>f[h].searchable).map(h=>({label:f[h].label||h,value:h}))});e.watch(()=>n.modelValue,f=>{i.value={},new URLSearchParams(f).forEach((h,g)=>{i.value[g]=h})});const c=()=>{r.value=!r.value},d=f=>{o("update:modelValue",f)},u=f=>`filter-${f}`,p=f=>{var h,g;return(((g=(h=n.config.schema)==null?void 0:h[f])==null?void 0:g.values)??[]).map(b=>({value:b,label:b}))},y=f=>{var h,g;return((g=(h=n.config.schema)==null?void 0:h[f])==null?void 0:g.type)??"text"},m=f=>{i.value={...i.value,[f]:""},k()},S=()=>{i.value={},k(!0)},k=(f=!1)=>{const h=Object.keys(i.value).reduce((g,b)=>(i.value[b]&&(g[b]=`${i.value[b]}`),g),{});f&&(r.value=!1),o("update:modelValue",new URLSearchParams(h).toString())};return(f,h)=>{const g=e.resolveComponent("KInput"),b=e.resolveComponent("KButton"),w=e.resolveComponent("KSelect"),K=e.resolveComponent("KMenuItem"),D=e.resolveComponent("KMenu");return t.config.isExactMatch?(e.openBlock(),e.createBlock(g,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":t.modelValue,placeholder:t.config.placeholder,"onUpdate:modelValue":d},{icon:e.withCtx(()=>[e.createVNode(_i)]),_:1},8,["model-value","placeholder"])):(e.openBlock(),e.createElementBlock("div",Ti,[e.createVNode(b,{appearance:"btn-link","data-testid":"filter-button",icon:"filter",onClick:c},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("filter.filterButtonText"))+" "+e.toDisplayString(l.value.length>0?`(${l.value.length})`:""),1)]),_:1}),e.withDirectives(e.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:c},null,512),[[e.vShow,r.value]]),e.withDirectives(e.createVNode(D,{class:"kong-ui-entity-filter-menu"},{body:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(T,C)=>(e.openBlock(),e.createBlock(K,{key:T.value,"data-testid":T.value,expandable:"","last-menu-item":C===s.value.length-1},{itemTitle:e.withCtx(()=>[e.createElementVNode("span",Ei,[e.createTextVNode(e.toDisplayString(T.label)+" ",1),e.withDirectives(e.createElementVNode("span",Vi,null,512),[[e.vShow,l.value.includes(T.value)]])])]),itemBody:e.withCtx(()=>{var N,B;return[e.createElementVNode("div",ji,[e.createElementVNode("label",{class:"menu-item-label",for:u(T.value)},e.toDisplayString(e.unref(a)("filter.fieldLabel")),9,$i),((B=(N=t.config.schema)==null?void 0:N[T.value])==null?void 0:B.type)==="select"?(e.openBlock(),e.createBlock(w,{key:0,id:u(T.value),modelValue:i.value[T.value],"onUpdate:modelValue":I=>i.value[T.value]=I,appearance:"select",items:p(T.value),placeholder:e.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(e.openBlock(),e.createBlock(g,{key:1,id:u(T.value),modelValue:i.value[T.value],"onUpdate:modelValue":I=>i.value[T.value]=I,autocomplete:"off",placeholder:e.unref(a)("filter.inputPlaceholder"),size:"small",type:y(T.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),e.createElementVNode("div",Oi,[e.createVNode(b,{appearance:"btn-link","data-testid":"apply-filter",size:"small",onClick:h[0]||(h[0]=I=>k(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("filter.applyButtonText")),1)]),_:1}),e.createVNode(b,{appearance:"btn-link","data-testid":"clear-filter",size:"small",onClick:I=>m(T.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:e.withCtx(()=>[e.createVNode(b,{onClick:S},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("filter.clearAllButtonText")),1)]),_:1})]),_:1},512),[[e.vShow,r.value]])]))}}}),[["__scopeId","data-v-745f38c0"]]),At=e.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(t){const o=t,n=e.ref(void 0),a=e.computed(()=>n.value===!0||n.value!==void 0&&o.forceShow===!0);return e.watch(()=>o.authFunction,async()=>{n.value=await o.authFunction()},{immediate:!0}),(r,i)=>a.value?e.renderSlot(r.$slots,"default",{key:0,isAllowed:n.value}):e.createCommentVNode("",!0)}}),Fi={class:"form-section-wrapper"},Ki={key:0,class:"form-section-title"},Di={key:1,class:"form-section-description"},Li={key:2,class:"form-section-footer"},qi={class:"form-section-content"},vi=X(e.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(t){const o=e.useSlots();return(n,a)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(["kong-ui-entity-form-section",{"has-divider":t.hasDivider}])},[e.createElementVNode("div",Fi,[t.hideInfoHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["form-section-info",{sticky:t.stickyInfoHeader}])},[t.title?(e.openBlock(),e.createElementBlock("h4",Ki,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description||e.unref(o).description?(e.openBlock(),e.createElementBlock("div",Di,[e.renderSlot(n.$slots,"description",{},()=>[e.createElementVNode("p",null,e.toDisplayString(t.description),1)],!0)])):e.createCommentVNode("",!0),e.unref(o).footer?(e.openBlock(),e.createElementBlock("div",Li,[e.renderSlot(n.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2)),e.createElementVNode("div",qi,[e.renderSlot(n.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:mn,useDeleteUrlBuilder:Pi,useErrors:Ri,useExternalLinkCreator:ul,useFetchUrlBuilder:fl,useFetcher:Ui,useDebouncedFilter:ml,useStringHelpers:yl,useHelpers:gl,useGatewayFeatureSupported:hl,useTruncationDetector:kl}=P,bl="",zi={class:"kong-ui-entities-key-sets-list"},Hi={key:1},Ji=e.defineComponent({__name:"KeySetList",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.createRoute||!t.getViewRoute||!t.getEditRoute||t.app==="kongManager"&&!t.isExactMatch&&!t.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0}},emits:["error","copy:success","copy:error","delete:success"],setup(t,{emit:o}){var Y;const n=t,{i18n:{t:a}}=_t.useI18n(),r=Nt.useRouter(),{axiosInstance:i}=mn({headers:(Y=n.config)==null?void 0:Y.requestHeaders}),l=e.ref(1),s=e.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),c={name:{label:a("keySets.list.table_headers.name"),searchable:!0,sortable:!0},tags:{label:a("keySets.list.table_headers.tags")},id:{label:a("keySets.list.table_headers.id"),sortable:!0}},d=c,u=e.computed(()=>{var V,z;let A=`${n.config.apiBaseUrl}${bt.list[n.config.app]}`;return n.config.app==="konnect"?A=A.replace(/{controlPlaneId}/gi,((V=n.config)==null?void 0:V.controlPlaneId)||""):n.config.app==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(z=n.config)!=null&&z.workspace?`/${n.config.workspace}`:"")),A}),p=e.ref(""),y=e.computed(()=>{const A=n.config.app==="konnect"||n.config.isExactMatch;if(A)return{isExactMatch:A,placeholder:a("keySets.search.placeholder")};const V={name:c.name};return{isExactMatch:A,fields:V,schema:n.config.filterSchema}}),{fetcher:m,fetcherState:S}=Ui(n.config,u.value),k=()=>{p.value=""},f=()=>{l.value++},h=e.ref(""),g=(A,V)=>{const z=A.id;if(!V(z)){D(A,"id");return}K(A,"id")},b=(A,V)=>{const z=JSON.stringify(A);if(!V(z)){o("copy:error",{entity:A,message:a("keySets.errors.copy")});return}o("copy:success",{entity:A,message:a("keySets.copy.success_brief")})},w=(A,V,z)=>{const{type:it}=A;it==="success"?K(V,z):D(V,z)},K=(A,V)=>{o("copy:success",{entity:A,field:V,message:a("keySets.copy.success",{val:A[V]})})},D=(A,V)=>{o("copy:error",{entity:A,field:V,message:a("keySets.errors.copy")})},T=async A=>{var z;await((z=n.canRetrieve)==null?void 0:z.call(n,A))&&r.push(n.config.getViewRoute(A.id))},C=A=>({label:a("keySets.actions.view"),to:n.config.getViewRoute(A)}),N=A=>({label:a("keySets.actions.edit"),to:n.config.getEditRoute(A)}),B=e.ref(void 0),I=e.ref(!1),_=e.ref(!1),E=e.ref(""),j=Pi(n.config,u.value),v=A=>{B.value=A,I.value=!0},R=()=>{I.value=!1},L=async()=>{var A,V,z;if((A=B.value)!=null&&A.id){_.value=!0;try{await i.delete(j(B.value.id)),_.value=!1,I.value=!1,l.value++,o("delete:success",B.value)}catch(it){E.value=((z=(V=it.response)==null?void 0:V.data)==null?void 0:z.message)||it.message||a("keySets.errors.delete"),o("error",it)}finally{_.value=!1}}};e.watch(S,A=>{if(A.status===at.Error){h.value=a("keySets.errors.general"),o("error",A.error);return}h.value=""});const O=e.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:a("keySets.list.empty_state.description"),title:a("keySets.title")});return e.onBeforeMount(async()=>{await n.canCreate()&&(O.value.title=a("keySets.list.empty_state.title"),O.value.ctaText=a("keySets.actions.create"))}),(A,V)=>{const z=e.resolveComponent("KButton"),it=e.resolveComponent("KBadge"),tl=e.resolveComponent("KTruncate"),el=e.resolveComponent("CopyUuid"),kt=e.resolveComponent("KDropdownItem"),gn=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",zi,[e.createVNode(e.unref(bi),{"cache-identifier":t.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":s.value,"empty-state-options":O.value,"enable-entity-actions":"","error-message":h.value,fetcher:e.unref(m),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-key-sets-list",query:p.value,"table-headers":e.unref(d),onClearSearchInput:k,"onClick:row":V[2]||(V[2]=M=>T(M)),onSort:f},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(Mi),{modelValue:p.value,"onUpdate:modelValue":V[0]||(V[0]=M=>p.value=M),config:y.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[e.createVNode(e.unref(At),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.createVNode(z,{appearance:"primary","data-testid":"toolbar-add-key-set",icon:"plus",to:t.config.createRoute},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("keySets.list.toolbar_actions.new_key_set")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),name:e.withCtx(({rowValue:M})=>[e.createElementVNode("b",null,e.toDisplayString(M??"-"),1)]),tags:e.withCtx(({rowValue:M})=>[(M==null?void 0:M.length)>0?(e.openBlock(),e.createBlock(tl,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M,et=>(e.openBlock(),e.createBlock(it,{key:et,onClick:V[1]||(V[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(et),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Hi,"-"))]),id:e.withCtx(({row:M,rowValue:et})=>[e.createVNode(el,{notify:Yt=>w(Yt,M,"id"),truncated:!1,uuid:et},null,8,["notify","uuid"])]),actions:e.withCtx(({row:M})=>[e.createVNode(gn,null,{default:e.withCtx(({copyToClipboard:et})=>[e.createVNode(kt,{"data-testid":"action-entity-copy-id",onClick:Yt=>g(M,et)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("keySets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(gn,null,{default:e.withCtx(({copyToClipboard:et})=>[e.createVNode(kt,{"data-testid":"action-entity-copy-json",onClick:Yt=>b(M,et)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("keySets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(At),{"auth-function":()=>t.canRetrieve(M)},{default:e.withCtx(()=>[e.createVNode(kt,{"data-testid":"action-entity-view","has-divider":"",item:C(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(At),{"auth-function":()=>t.canEdit(M)},{default:e.withCtx(()=>[e.createVNode(kt,{"data-testid":"action-entity-edit",item:N(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(At),{"auth-function":()=>t.canDelete(M)},{default:e.withCtx(()=>[e.createVNode(kt,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:et=>v(M)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("keySets.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"]),e.createVNode(e.unref(Si),{"action-pending":_.value,description:e.unref(a)("keySets.delete.description"),"entity-name":B.value&&(B.value.name||B.value.id),"entity-type":e.unref(Zt).KeySet,error:E.value,title:e.unref(a)("keySets.delete.title"),visible:I.value,onCancel:R,onProceed:L},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),Cl="",yn=(t,o)=>{const n=t.__vccOpts||t;for(const[a,r]of o)n[a]=r;return n},Yi=yn(Ji,[["__scopeId","data-v-a16aa26a"]]),Wi={class:"kong-ui-entities-key-sets-form"},Zi=e.defineComponent({__name:"KeySetForm",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.cancelRoute)},keySetId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(t,{emit:o}){var f;const n=t,a=Nt.useRouter(),{i18n:{t:r}}=_t.useI18n(),{getMessageFromError:i}=Ri(),{axiosInstance:l}=mn({headers:(f=n.config)==null?void 0:f.requestHeaders}),s=e.computed(()=>bt.form[n.config.app].edit),c=e.computed(()=>n.keySetId?Tt.Edit:Tt.Create),d=e.reactive({fields:{name:"",tags:""},isReadonly:!1,errorMessage:""}),u=e.reactive({name:"",tags:""}),p=e.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(u)&&!!d.fields.name),y=h=>{var g;d.fields.name=(h==null?void 0:h.name)||"",d.fields.tags=((g=h==null?void 0:h.tags)==null?void 0:g.join(", "))||"",Object.assign(u,d.fields)},m=()=>{a.push(n.config.cancelRoute)},S=e.computed(()=>{var g,b;let h=`${n.config.apiBaseUrl}${bt.form[n.config.app][c.value]}`;return n.config.app==="konnect"?h=h.replace(/{controlPlaneId}/gi,((g=n.config)==null?void 0:g.controlPlaneId)||""):n.config.app==="kongManager"&&(h=h.replace(/\/{workspace}/gi,(b=n.config)!=null&&b.workspace?`/${n.config.workspace}`:"")),h=h.replace(/{id}/gi,n.keySetId),h}),k=async()=>{var h,g,b,w,K;try{d.isReadonly=!0;const D={name:d.fields.name,tags:((b=(g=(h=d.fields.tags)==null?void 0:h.split(","))==null?void 0:g.map(C=>String(C||"").trim()))==null?void 0:b.filter(C=>C!==""))||""};let T;if(c.value==="create"?T=await l.post(S.value,D):c.value==="edit"&&(T=((w=n.config)==null?void 0:w.app)==="konnect"?await l.put(S.value,D):await l.patch(S.value,D)),T){const{data:C}=T;d.fields.name=(C==null?void 0:C.name)||"",d.fields.tags=((K=C==null?void 0:C.tags)==null?void 0:K.join(", "))||"",Object.assign(u,d.fields),o("update",T==null?void 0:T.data)}}catch(D){d.errorMessage=i(D),o("error",D)}finally{d.isReadonly=!1}};return(h,g)=>{const b=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",Wi,[e.createVNode(e.unref(fi),{"can-submit":p.value,config:t.config,"edit-id":t.keySetId,"error-message":d.errorMessage,"fetch-url":s.value,"is-readonly":d.isReadonly,onCancel:m,"onFetch:error":g[2]||(g[2]=w=>h.$emit("error",w)),"onFetch:success":y,onLoading:g[3]||(g[3]=w=>h.$emit("loading",w)),onSubmit:k},{default:e.withCtx(()=>[e.createVNode(e.unref(vi),{description:e.unref(r)("keySets.form.sections.general.description"),"has-divider":"",title:e.unref(r)("keySets.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(b,{modelValue:d.fields.name,"onUpdate:modelValue":g[0]||(g[0]=w=>d.fields.name=w),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-set-form-name",label:e.unref(r)("keySets.form.fields.name.label"),placeholder:e.unref(r)("keySets.form.fields.name.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(b,{modelValue:d.fields.tags,"onUpdate:modelValue":g[1]||(g[1]=w=>d.fields.tags=w),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-set-form-tags",help:e.unref(r)("keySets.form.fields.tags.help"),label:e.unref(r)("keySets.form.fields.tags.label"),"label-attributes":{info:e.unref(r)("keySets.form.fields.tags.tooltip")},placeholder:e.unref(r)("keySets.form.fields.tags.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),wl="",Gi=yn(Zi,[["__scopeId","data-v-29df09d7"]]),Xi={class:"kong-ui-entities-keys-entity-config-card"},Qi=e.defineComponent({__name:"KeySetConfigCard",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(t){const o=t,{i18n:{t:n}}=_t.useI18n(),a=e.computed(()=>bt.form[o.config.app].edit),r=e.ref({id:{},name:{},last_updated:{},created:{},tags:{tooltip:n("keySets.form.fields.tags.tooltip")}});return(i,l)=>(e.openBlock(),e.createElementBlock("div",Xi,[e.createVNode(e.unref(di),{config:t.config,"config-card-doc":t.configCardDoc,"config-schema":r.value,"fetch-url":a.value,"hide-title":t.hideTitle,"onCopy:success":l[0]||(l[0]=s=>i.$emit("copy:success",s)),"onFetch:error":l[1]||(l[1]=s=>i.$emit("fetch:error",s)),"onFetch:success":l[2]||(l[2]=s=>i.$emit("fetch:success",s)),onLoading:l[3]||(l[3]=s=>i.$emit("loading",s))},null,8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});Z.KeySetConfigCard=Qi,Z.KeySetForm=Gi,Z.KeySetList=Yi,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
23
+ `),i=a?"+":r?"":"-";return n+i+`
24
+ `}function dn(t){return t[t.length-1]===`
25
+ `?t.slice(0,-1):t}function Ea(t,o){for(var n=/(\n+)([^\n]*)/g,r=function(){var d=t.indexOf(`
26
+ `);return d=d!==-1?d:t.length,n.lastIndex=d,pn(t.slice(0,d),o)}(),a=t[0]===`
27
+ `||t[0]===" ",i,l;l=n.exec(t);){var s=l[1],c=l[2];i=c[0]===" ",r+=s+(!a&&!i&&c!==""?`
28
+ `:"")+pn(c,o),a=i}return r}function pn(t,o){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,r,a=0,i,l=0,s=0,c="";r=n.exec(t);)s=r.index,s-a>o&&(i=l>a?l:s,c+=`
29
+ `+t.slice(a,i),a=i+1),l=s;return c+=`
30
+ `,t.length-a>o&&l>a?c+=t.slice(a,l)+`
31
+ `+t.slice(l+1):c+=t.slice(a),c.slice(1)}function Va(t){for(var o="",n=0,r,a=0;a<t.length;n>=65536?a+=2:a++)n=ht(t,a),r=H[n],!r&&gt(n)?(o+=t[a],n>=65536&&(o+=t[a+1])):o+=r||Sa(n);return o}function $a(t,o,n){var r="",a=t.tag,i,l,s;for(i=0,l=n.length;i<l;i+=1)s=n[i],t.replacer&&(s=t.replacer.call(n,String(i),s)),(tt(t,o,s,!1,!1)||typeof s>"u"&&tt(t,o,null,!1,!1))&&(r!==""&&(r+=","+(t.condenseFlow?"":" ")),r+=t.dump);t.tag=a,t.dump="["+r+"]"}function un(t,o,n,r){var a="",i=t.tag,l,s,c;for(l=0,s=n.length;l<s;l+=1)c=n[l],t.replacer&&(c=t.replacer.call(n,String(l),c)),(tt(t,o+1,c,!0,!0,!1,!0)||typeof c>"u"&&tt(t,o+1,null,!0,!0,!1,!0))&&((!r||a!=="")&&(a+=Ut(t,o)),t.dump&&mt===t.dump.charCodeAt(0)?a+="-":a+="- ",a+=t.dump);t.tag=i,t.dump=a||"[]"}function ja(t,o,n){var r="",a=t.tag,i=Object.keys(n),l,s,c,d,u;for(l=0,s=i.length;l<s;l+=1)u="",r!==""&&(u+=", "),t.condenseFlow&&(u+='"'),c=i[l],d=n[c],t.replacer&&(d=t.replacer.call(n,c,d)),tt(t,o,c,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),tt(t,o,d,!1,!1)&&(u+=t.dump,r+=u));t.tag=a,t.dump="{"+r+"}"}function Oa(t,o,n,r){var a="",i=t.tag,l=Object.keys(n),s,c,d,u,p,y;if(t.sortKeys===!0)l.sort();else if(typeof t.sortKeys=="function")l.sort(t.sortKeys);else if(t.sortKeys)throw new J("sortKeys must be a boolean or a function");for(s=0,c=l.length;s<c;s+=1)y="",(!r||a!=="")&&(y+=Ut(t,o)),d=l[s],u=n[d],t.replacer&&(u=t.replacer.call(n,d,u)),tt(t,o+1,d,!0,!0,!0)&&(p=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,p&&(t.dump&&mt===t.dump.charCodeAt(0)?y+="?":y+="? "),y+=t.dump,p&&(y+=Ut(t,o)),tt(t,o+1,u,!0,p)&&(t.dump&&mt===t.dump.charCodeAt(0)?y+=":":y+=": ",y+=t.dump,a+=y));t.tag=i,t.dump=a||"{}"}function fn(t,o,n){var r,a,i,l,s,c;for(a=n?t.explicitTypes:t.implicitTypes,i=0,l=a.length;i<l;i+=1)if(s=a[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof o=="object"&&o instanceof s.instanceOf)&&(!s.predicate||s.predicate(o))){if(n?s.multi&&s.representName?t.tag=s.representName(o):t.tag=s.tag:t.tag="?",s.represent){if(c=t.styleMap[s.tag]||s.defaultStyle,Ye.call(s.represent)==="[object Function]")r=s.represent(o,c);else if(We.call(s.represent,c))r=s.represent[c](o,c);else throw new J("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');t.dump=r}return!0}return!1}function tt(t,o,n,r,a,i,l){t.tag=null,t.dump=n,fn(t,n,!1)||fn(t,n,!0);var s=Ye.call(t.dump),c=r,d;r&&(r=t.flowLevel<0||t.flowLevel>o);var u=s==="[object Object]"||s==="[object Array]",p,y;if(u&&(p=t.duplicates.indexOf(n),y=p!==-1),(t.tag!==null&&t.tag!=="?"||y||t.indent!==2&&o>0)&&(a=!1),y&&t.usedDuplicates[p])t.dump="*ref_"+p;else{if(u&&y&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),s==="[object Object]")r&&Object.keys(t.dump).length!==0?(Oa(t,o,t.dump,a),y&&(t.dump="&ref_"+p+t.dump)):(ja(t,o,t.dump),y&&(t.dump="&ref_"+p+" "+t.dump));else if(s==="[object Array]")r&&t.dump.length!==0?(t.noArrayIndent&&!l&&o>0?un(t,o-1,t.dump,a):un(t,o,t.dump,a),y&&(t.dump="&ref_"+p+t.dump)):($a(t,o,t.dump),y&&(t.dump="&ref_"+p+" "+t.dump));else if(s==="[object String]")t.tag!=="?"&&Ta(t,t.dump,o,i,c);else{if(s==="[object Undefined]"||t.skipInvalid)return!1;throw new J("unacceptable kind of an object to dump "+s)}t.tag!==null&&t.tag!=="?"&&(d=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",t.dump=d+" "+t.dump)}return!0}function Fa(t,o){var n=[],r=[],a,i;for(Ht(t,n,r),a=0,i=r.length;a<i;a+=1)o.duplicates.push(n[r[a]]);o.usedDuplicates=new Array(i)}function Ht(t,o,n){var r,a,i;if(t!==null&&typeof t=="object")if(a=o.indexOf(t),a!==-1)n.indexOf(a)===-1&&n.push(a);else if(o.push(t),Array.isArray(t))for(a=0,i=t.length;a<i;a+=1)Ht(t[a],o,n);else for(r=Object.keys(t),a=0,i=r.length;a<i;a+=1)Ht(t[r[a]],o,n)}function Ma(t,o){o=o||{};var n=new Ba(o);n.noRefs||Fa(t,n);var r=t;return n.replacer&&(r=n.replacer.call({"":r},"",r)),tt(n,0,r,!0,!0)?n.dump+`
32
+ `:""}var Ka=Ma,Da={dump:Ka};function Jt(t,o){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}var La=U,qa=me,va=ke,Pa=xe,Ra=Be,Ua=Dt,za=Je.load,Ha=Je.loadAll,Ja=Da.dump,Ya=J,Wa={binary:Te,float:Se,map:he,null:be,pairs:Ve,set:$e,timestamp:Ae,bool:Ce,int:we,merge:_e,omap:Ee,seq:ge,str:ye},Ga=Jt("safeLoad","load"),Za=Jt("safeLoadAll","loadAll"),Xa=Jt("safeDump","dump"),Qa={Type:La,Schema:qa,FAILSAFE_SCHEMA:va,JSON_SCHEMA:Pa,CORE_SCHEMA:Ra,DEFAULT_SCHEMA:Ua,load:za,loadAll:Ha,dump:Ja,YAMLException:Ya,types:Wa,safeLoad:Ga,safeLoadAll:Za,safeDump:Xa};const ti={key:0,class:"config-card-display-form"},ei=["data-testid"],ni={key:0,class:"config-card-prop-section-title"},oi={key:1,class:"config-card-display-json"},ri={key:2,class:"config-card-display-yaml"},ai=X(e.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:t=>["structured","yaml","json"].includes(t)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null}},setup(t){const o=t,n=e.useSlots(),{i18n:{t:r}}=P.useI18n(),a=s=>!!(s.tooltip||n[`${s.key}-label-tooltip`]),i=e.ref(""),l=e.ref("");return e.watch(()=>o.format,s=>{s==="json"?i.value=JSON.stringify(o.record,null,2):s==="yaml"&&(l.value=Qa.dump(o.record))},{immediate:!0}),(s,c)=>{const d=e.resolveComponent("KCodeBlock");return e.openBlock(),e.createElementBlock(e.Fragment,null,[t.format==="structured"?(e.openBlock(),e.createElementBlock("div",ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.propListTypes,u=>(e.openBlock(),e.createElementBlock("div",{key:`config-card-details-${u}-props`,class:e.normalizeClass(`config-card-details-${u}-props`),"data-testid":`config-card-details-${u}-props`},[u!=="basic"?(e.openBlock(),e.createElementBlock("div",ni,e.toDisplayString(u==="advanced"?e.unref(r)("baseConfigCard.sections.advanced"):e.unref(r)("baseConfigCard.sections.plugin")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.propertyCollections[u],p=>(e.openBlock(),e.createBlock(jt,{key:p.key,item:p},e.createSlots({label:e.withCtx(()=>[e.renderSlot(s.$slots,`${p.key}-label`,{row:p},void 0,!0)]),[p.key]:e.withCtx(({rowValue:y})=>[e.renderSlot(s.$slots,p.key,{row:p,rowValue:y},void 0,!0)]),_:2},[a(p)?{name:"label-tooltip",fn:e.withCtx(()=>[e.renderSlot(s.$slots,`${p.key}-label-tooltip`,{row:p},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,ei))),128))])):e.createCommentVNode("",!0),t.format==="json"?(e.openBlock(),e.createElementBlock("div",oi,[e.createVNode(d,{id:"config-card-codeblock",code:i.value,language:"json",theme:"dark"},null,8,["code"])])):e.createCommentVNode("",!0),t.format==="yaml"?(e.openBlock(),e.createElementBlock("div",ri,[e.createVNode(d,{id:"config-card-codeblock",code:l.value,language:"yaml",theme:"dark"},null,8,["code"])])):e.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-6c45e9e4"]]),mn="24px",ii=(t,o)=>{const n=t.__vccOpts||t;for(const[r,a]of o)n[r]=a;return n},li=t=>(e.pushScopeId("data-v-dd88a2bb"),t=t(),e.popScopeId(),t),si=["aria-hidden"],ci={key:0,"data-testid":"kui-icon-svg-title"},di=li(()=>e.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)),pi=e.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:mn,validator:t=>{if(typeof t=="number"&&t>0)return!0;if(typeof t=="string"){const o=String(t).replace(/px/gi,""),n=Number(o);if(n&&!isNaN(n)&&Number.isInteger(n)&&n>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(t){const o=t,n=e.computed(()=>{if(typeof o.size=="number"&&o.size>0)return`${o.size}px`;if(typeof o.size=="string"){const a=String(o.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return mn}),r=e.computed(()=>({boxSizing:"border-box",color:o.color,display:o.display,height:n.value,lineHeight:"0",width:n.value}));return(a,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.as),{"aria-hidden":t.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:e.normalizeStyle(r.value)},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":t.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"},[t.title?(e.openBlock(),e.createElementBlock("title",ci,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),di],8,si))]),_:1},8,["aria-hidden","style"]))}}),ui=ii(pi,[["__scopeId","data-v-dd88a2bb"]]),fi={"data-testid":"config-card-title"},mi={class:"config-card-actions"},yi=["href"],gi={key:2,class:"config-card-details-section"},hi={key:3,class:"config-card-details-section"},ki=["data-testid"],bi={key:0,class:"config-card-prop-section-title"},Ci=X(e.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(t,{emit:o}){var n;const r=t,a=e.useSlots(),{i18n:{t:i}}=P.useI18n(),{getMessageFromError:l}=P.useErrors(),{convertKeyToTitle:s}=P.useStringHelpers(),{axiosInstance:c}=P.useAxios({headers:(n=r.config)==null?void 0:n.requestHeaders}),d=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=e.ref("structured"),p=C=>{u.value=C==null?void 0:C.value},y={id:{type:j.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:Z.Basic},name:{order:1,section:Z.Basic},enabled:{type:j.BadgeStatus,order:2,section:Z.Basic},updated_at:{type:j.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:Z.Basic},created_at:{type:j.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:Z.Basic},tags:{type:j.BadgeTag,order:-1,section:Z.Basic}},m=e.ref(!1),S=e.ref(!1),k=e.ref(""),f=e.ref(),h=e.computed(()=>{var C,A,B;if(!f.value)return[];const N=[],_=Object.keys(f.value).length;for(const E in f.value){const $=(A=(C=r.configSchema)==null?void 0:C[E])==null?void 0:A.order,v=(B=y[E])==null?void 0:B.order;let R=_;(v||v===0)&&(R=v===-1?_+1:v),$&&(R=$===-1?_+1:$),N.push([E,R])}return N.sort(function(E,$){return E[1]-$[1]}),N.map(E=>{var $,v;const R=E[0],L=($=f.value)==null?void 0:$[R],O=((v=r.configSchema)==null?void 0:v[R])||{},Y=y[R];return{key:R,value:L,hidden:O.hidden||!1,type:O.type??((Y==null?void 0:Y.type)||j.Text),label:O.label??((Y==null?void 0:Y.label)||s(R)),tooltip:O.tooltip??((Y==null?void 0:Y.tooltip)||void 0),section:O.section??((Y==null?void 0:Y.section)||Z.Advanced)}}).filter(E=>!E.hidden&&E.key!==r.pluginConfigKey)}),g=e.computed(()=>{var C,A;if(!f.value||!r.pluginConfigKey)return[];const B=f.value[r.pluginConfigKey]||{},N=Object.keys(B).length,_=[];for(const E in B){const $=(A=(C=r.pluginConfigSchema)==null?void 0:C[E])==null?void 0:A.order,v=B[E];let R=v!=null&&v!==""?N-1:N;$&&(R=$===-1?N+1:$),_.push([E,R])}return _.sort(function(E,$){return E[1]-$[1]}),_.map(E=>{var $;const v=E[0],R=B[v],L=(($=r.pluginConfigSchema)==null?void 0:$[v])||{};return{key:v,value:R,hidden:L.hidden||!1,type:L.type??j.Text,label:L.label??s(v),tooltip:L.tooltip??void 0,section:Z.Plugin}}).filter(E=>!E.hidden)}),b=e.computed(()=>{var C,A,B,N;return{basic:(C=h.value)==null?void 0:C.filter(_=>_.section===Z.Basic),advanced:(A=h.value)==null?void 0:A.filter(_=>_.section===Z.Advanced),plugin:(N=g.value)==null?void 0:N.concat((B=h.value)==null?void 0:B.filter(_=>_.section===Z.Plugin))}}),w=e.computed(()=>{const C=[];return b.value.basic.length&&C.push("basic"),b.value.advanced.length&&C.push("advanced"),b.value.plugin.length&&C.push("plugin"),C}),K=C=>!!(C.tooltip||a[`${C.key}-label-tooltip`]),D=e.computed(()=>{var C,A;let B=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((C=r.config)==null?void 0:C.controlPlaneId)||""):r.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(A=r.config)!=null&&A.workspace?`/${r.config.workspace}`:"")),B=B.replace(/{id}/gi,r.config.entityId),B}),T=C=>{f.value&&C(JSON.stringify(f.value))?o("copy:success",f.value):o("copy:error")};return e.watch(m,C=>{o("loading",C)},{immediate:!0}),e.onBeforeMount(async()=>{S.value=!1,m.value=!0;try{const{data:C}=await c.get(D.value);if(r.dataKey)if(typeof C[r.dataKey]<"u")f.value={...C[r.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:r.dataKey}));else f.value={...C};Object.keys(r.configSchema).filter(A=>r.configSchema[A].forceShow).forEach(A=>{f.value&&typeof f.value[A]>"u"&&(f.value[A]=null)}),o("fetch:success",C)}catch(C){const A=l(C);k.value=A.startsWith("code")?i("baseConfigCard.errors.load"):A,S.value=!0,o("fetch:error",C)}finally{m.value=!1}}),(C,A)=>{const B=e.resolveComponent("KLabel"),N=e.resolveComponent("KSelect"),_=e.resolveComponent("KButton"),E=e.resolveComponent("KClipboardProvider"),$=e.resolveComponent("KSkeleton"),v=e.resolveComponent("KEmptyState"),R=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(R,{class:"kong-ui-entity-base-config-card"},e.createSlots({actions:e.withCtx(()=>[e.createElementVNode("div",mi,[e.renderSlot(C.$slots,"actions",{},void 0,!0),t.config.jsonYamlEnabled?(e.openBlock(),e.createBlock(B,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})):e.createCommentVNode("",!0),t.config.jsonYamlEnabled?(e.openBlock(),e.createBlock(N,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:p})):e.createCommentVNode("",!0),r.config.jsonYamlEnabled&&t.configCardDoc?(e.openBlock(),e.createBlock(_,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.configCardDoc,rel:"noopener",target:"_blank"},[e.createVNode(e.unref(ui),{size:e.unref(wo)},null,8,["size"])],8,yi)]),_:1})):e.createCommentVNode("",!0),t.config.jsonYamlEnabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E,{key:3},{default:e.withCtx(({copyToClipboard:L})=>[!m.value&&!S.value?(e.openBlock(),e.createBlock(_,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:O=>T(L)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:1}))])]),body:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock($,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):S.value?(e.openBlock(),e.createBlock(v,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:e.withCtx(()=>[e.createElementVNode("h3",null,e.toDisplayString(k.value),1)]),_:1})):e.createCommentVNode("",!0),t.config.jsonYamlEnabled?(e.openBlock(),e.createElementBlock("div",gi,[e.createVNode(ai,{format:u.value,"prop-list-types":w.value,"property-collections":b.value,record:f.value},e.createSlots({_:2},[e.renderList(Object.keys(C.$slots),L=>({name:L,fn:e.withCtx(({row:O,rowValue:Y})=>[e.renderSlot(C.$slots,L,{row:O,rowValue:Y},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(e.openBlock(),e.createElementBlock("div",hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,L=>(e.openBlock(),e.createElementBlock("div",{key:`config-card-details-${L}-props`,class:e.normalizeClass(`config-card-details-${L}-props`),"data-testid":`config-card-details-${L}-props`},[L!=="basic"?(e.openBlock(),e.createElementBlock("div",bi,e.toDisplayString(L==="advanced"?e.unref(i)("baseConfigCard.sections.advanced"):e.unref(i)("baseConfigCard.sections.plugin")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value[L],O=>(e.openBlock(),e.createBlock(jt,{key:O.key,item:O},e.createSlots({label:e.withCtx(()=>[e.renderSlot(C.$slots,`${O.key}-label`,{row:O},void 0,!0)]),[O.key]:e.withCtx(({rowValue:Y})=>[e.renderSlot(C.$slots,O.key,{row:O,rowValue:Y},void 0,!0)]),_:2},[K(O)?{name:"label-tooltip",fn:e.withCtx(()=>[e.renderSlot(C.$slots,`${O.key}-label-tooltip`,{row:O},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,ki))),128))]))]),_:2},[t.hideTitle?void 0:{name:"title",fn:e.withCtx(()=>[e.createElementVNode("div",fi,[e.renderSlot(C.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-24515123"]]),wi=["onReset","onSubmit"],Si={class:"form-actions","data-testid":"form-actions"},xi=X(e.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(t,{emit:o}){var n;const r=t,a=At.useRouter(),{i18n:{t:i}}=P.useI18n(),{getMessageFromError:l}=P.useErrors(),{axiosInstance:s}=P.useAxios({headers:(n=r.config)==null?void 0:n.requestHeaders}),c=e.ref(!1),d=e.ref(!1),u=e.ref(""),p=e.computed(()=>r.canSubmit===!1||r.isReadonly),y=e.computed(()=>{var f,h;if(!r.editId)return"";let g=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((f=r.config)==null?void 0:f.controlPlaneId)||""):r.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(h=r.config)!=null&&h.workspace?`/${r.config.workspace}`:"")),g=g.replace(/{id}/gi,r.editId),g}),m=()=>{r.config.cancelRoute?a.push(r.config.cancelRoute):S()},S=()=>{o("cancel")},k=()=>{p.value||o("submit")};return e.watch(()=>c.value,f=>{o("loading",f)},{immediate:!0}),e.onBeforeMount(async()=>{if(r.editId)try{d.value=!1,c.value=!0;const{data:f}=await s.get(y.value);o("fetch:success",f)}catch(f){const h=l(f);u.value=h.startsWith("code")?i("baseForm.errors.edit"):h,d.value=!0,o("fetch:error",f)}finally{c.value=!1}}),(f,h)=>{const g=e.resolveComponent("KSkeleton"),b=e.resolveComponent("KEmptyState"),w=e.resolveComponent("KAlert"),K=e.resolveComponent("KButton"),D=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(D,{class:"kong-ui-entity-base-form"},{body:e.withCtx(()=>[c.value?(e.openBlock(),e.createBlock(g,{key:0,type:"form"})):d.value?(e.openBlock(),e.createBlock(b,{key:1,"cta-text":e.unref(i)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":m,"is-error":!0},{message:e.withCtx(()=>[e.createElementVNode("h3",null,e.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(e.openBlock(),e.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:e.withModifiers(S,["prevent"]),onSubmit:e.withModifiers(k,["prevent"])},[e.renderSlot(f.$slots,"default",{},void 0,!0),t.errorMessage?(e.openBlock(),e.createBlock(w,{key:0,"alert-message":t.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):e.createCommentVNode("",!0),e.createElementVNode("div",Si,[e.renderSlot(f.$slots,"form-actions",{},()=>[e.createVNode(K,{appearance:"secondary","data-testid":"form-cancel",disabled:t.isReadonly,type:"reset"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),e.createVNode(K,{appearance:"primary","data-testid":"form-submit",disabled:p.value,type:"submit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,wi))]),_:3})}}}),[["__scopeId","data-v-81612aef"]]),Bi={key:0,"data-testid":"first-col"},Ni=X(e.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(t){const o=t,n=e.computed(()=>{var k;return((k=o.rowEl)==null?void 0:k.querySelector(`[data-testid="${o.keyName}"]`))||null}),r=e.computed(()=>{var k;return((k=n.value)==null?void 0:k.querySelector('[data-testid="first-col"]'))||null}),a=e.computed(()=>{var k,f;const h=(k=o.rowEl)==null?void 0:k.querySelectorAll("td");return h?((f=h[0])==null?void 0:f.getAttribute("data-testid"))===o.keyName:!1});let i;const l=()=>{i&&(i.disconnect(),i=void 0)},s=()=>{var k,f,h;d.value=((k=r.value)==null?void 0:k.getBoundingClientRect().width)||0,u.value=((f=n.value)==null?void 0:f.clientWidth)||0,p.value=((h=c.value)==null?void 0:h.innerText)||""},c=e.ref({}),d=e.ref(0),u=e.ref(0),p=e.ref(""),y=e.computed(()=>[r.value,n.value]),m=e.watch(y,k=>{if(a.value&&(l(),"ResizeObserver"in window&&window)){i=new ResizeObserver(f=>{window.requestAnimationFrame(()=>{!Array.isArray(f)||!f.length||s()})});for(const f of k)f&&i.observe(f)}},{immediate:!0,flush:"post",deep:!0}),S=e.computed(()=>a.value?d.value>u.value:!1);return e.onMounted(()=>{s()}),e.onUnmounted(()=>{m()}),(k,f)=>{const h=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[a.value?(e.openBlock(),e.createElementBlock("span",Bi,[e.createVNode(h,{label:S.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:e.withCtx(()=>[e.renderSlot(k.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):e.renderSlot(k.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-e42a20c9"]]),Ii={class:"toolbar-container"},Ai={key:0,class:"toolbar-button-container"},_i=["data-testid"],Ti=X(e.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(t,{emit:o}){const n=t,{i18n:{t:r}}=P.useI18n(),a=e.computed(()=>n.cacheIdentifier||n.preferencesStorageKey),i=b=>b.hasData||!!n.query,l=e.computed(()=>{const b=[];return Object.keys(n.tableHeaders).forEach(w=>{const K=n.tableHeaders[w];b.push({label:K.label??w,key:w,sortable:K.sortable??!1})}),n.enableEntityActions&&b.push({key:"actions",hideLabel:!0}),b}),s=b=>({"data-rowid":b.id,"data-testid":b.name,...n.rowAttributes(b)}),c=e.ref({}),d=b=>{var w;return(w=c.value)==null?void 0:w.$el.querySelector(`[data-rowid="${b.id}"]`)},u=b=>{const w={"data-testid":b.headerKey,...n.cellAttributes(b)};return b.colIndex===0&&(w.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),w},p=()=>{o("empty-state-cta-clicked"),y()},y=()=>{o("clear-search-input")},m=e.computed(()=>n.disableRowClick?void 0:(b,w)=>{o("click:row",w)}),S=b=>{o("sort",b)},{setTablePreferences:k,getTablePreferences:f}=Bn(),h=e.computed(()=>{const b=f(n.preferencesStorageKey);return{...n.initialFetcherParams,...b}}),g=b=>{n.preferencesStorageKey&&k(n.preferencesStorageKey,b)};return(b,w)=>{const K=e.resolveComponent("KIcon"),D=e.resolveComponent("KButton"),T=e.resolveComponent("KDropdown"),C=e.resolveComponent("KTable"),A=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(A,{class:"kong-ui-entity-base-table",title:t.title},{body:e.withCtx(()=>[e.createVNode(C,{ref_key:"tableRefs",ref:c,"cache-identifier":a.value,"cell-attrs":u,"disable-pagination-page-jump":t.disablePaginationPageJump,"disable-sorting":t.disableSorting,"empty-state-action-button-icon":t.query?"":"plus","empty-state-action-message":t.query?e.unref(r)("baseTable.emptyState.noSearchResultsCtaText"):t.emptyStateOptions.ctaText,"empty-state-action-route":t.query?"":t.emptyStateOptions.ctaPath,"empty-state-icon":t.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":t.query?e.unref(r)("baseTable.emptyState.noSearchResultsMessage"):t.emptyStateOptions.message,"empty-state-title":t.query?e.unref(r)("baseTable.emptyState.noSearchResultsTitle"):t.emptyStateOptions.title,"enable-client-sort":t.enableClientSort,"error-state-title":t.errorMessage,fetcher:t.fetcher,"fetcher-cache-key":String(t.fetcherCacheKey),"has-error":!!t.errorMessage,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":h.value,"is-loading":t.isLoading,"pagination-type":t.paginationType,"row-attrs":s,"search-input":t.query,onKtableEmptyStateCtaClicked:p,"onRow:click":m.value,onSort:w[0]||(w[0]=B=>S(B)),"onUpdate:tablePreferences":g},e.createSlots({toolbar:e.withCtx(({state:B})=>[e.withDirectives(e.createElementVNode("div",Ii,[e.renderSlot(b.$slots,"toolbar-filter",{},void 0,!0),b.$slots["toolbar-button"]?(e.openBlock(),e.createElementBlock("div",Ai,[e.renderSlot(b.$slots,"toolbar-button",{},void 0,!0)])):e.createCommentVNode("",!0)],512),[[e.vShow,i(B)]])]),actions:e.withCtx(({row:B,rowKey:N,rowValue:_})=>[e.createElementVNode("div",{class:"actions-container","data-testid":B.name},[e.createVNode(T,{"kpop-attributes":{placement:"bottomEnd"},width:t.dropdownMenuWidth},{items:e.withCtx(()=>[e.renderSlot(b.$slots,"actions",{row:B,rowKey:N,rowValue:_},void 0,!0)]),default:e.withCtx(()=>[e.createVNode(D,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:e.withCtx(()=>[e.createVNode(K,{color:e.unref(bo),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,_i)]),_:2},[e.renderList(t.tableHeaders,(B,N)=>({name:N,fn:e.withCtx(({row:_,rowKey:E,rowValue:$})=>[e.createVNode(Ni,{"key-name":String(N),"row-el":d(_)},{default:e.withCtx(()=>[e.renderSlot(b.$slots,N,{row:_,rowKey:E,rowValue:$},()=>[e.createTextVNode(e.toDisplayString($),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-86d2d2a3"]]),Ei={key:0,class:"kong-ui-entity-delete-error"},Vi={key:1,class:"description"},$i=X(e.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(t,{emit:o}){const n=t,{i18nT:r}=P.useI18n(),a=e.computed(()=>n.needConfirm?n.entityName:""),i=()=>{o("cancel")},l=()=>{o("proceed")};return(s,c)=>{const d=e.resolveComponent("KAlert"),u=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(u,{"action-button-text":"Yes, delete","action-pending":t.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":a.value,"is-visible":t.visible,title:t.title,type:"danger",onCanceled:i,onProceed:l},{"body-content":e.withCtx(()=>[t.error?(e.openBlock(),e.createElementBlock("div",Ei,[e.createVNode(d,{appearance:"danger"},{alertMessage:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.error),1)]),_:1})])):e.createCommentVNode("",!0),e.createVNode(e.unref(r),{class:"message",keypath:n.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},e.createSlots({entityType:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.entityType),1)]),_:2},[n.entityName?{name:"entityName",fn:e.withCtx(()=>[e.createElementVNode("strong",null,e.toDisplayString(n.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),n.description||s.$slots.description?(e.openBlock(),e.createElementBlock("div",Vi,[e.renderSlot(s.$slots,"description",{},()=>[e.createElementVNode("p",null,e.toDisplayString(n.description),1)],!0)])):e.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),ji={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Oi={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Fi=["fill"],Mi={mask:"url(#mask0_180_20349)"},Ki=["fill"],yn=e.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${ho})`}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",ji,[e.createElementVNode("mask",Oi,[e.createElementVNode("rect",{fill:t.color,height:"20",width:"20"},null,8,Fi)]),e.createElementVNode("g",Mi,[e.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:t.color},null,8,Ki)])]))}}),Di={key:1,class:"kong-ui-entity-filter"},Li={class:"menu-item-title"},qi={class:"menu-item-indicator"},vi={class:"menu-item-body"},Pi=["for"],Ri={class:"menu-item-buttons"},Ui={class:"filter-clear-button-container"},zi=X(e.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,{i18n:{t:r}}=P.useI18n(),a=e.ref(!1),i=e.ref({}),l=e.computed(()=>{const f=[];return new URLSearchParams(n.modelValue).forEach((h,g)=>{h!==""&&f.push(g)}),f}),s=e.computed(()=>{const f=n.config.fields;return Object.keys(f).filter(h=>f[h].searchable).map(h=>({label:f[h].label||h,value:h}))});e.watch(()=>n.modelValue,f=>{i.value={},new URLSearchParams(f).forEach((h,g)=>{i.value[g]=h})});const c=()=>{a.value=!a.value},d=f=>{o("update:modelValue",f)},u=f=>`filter-${f}`,p=f=>{var h,g;return(((g=(h=n.config.schema)==null?void 0:h[f])==null?void 0:g.values)??[]).map(b=>({value:b,label:b}))},y=f=>{var h,g;return((g=(h=n.config.schema)==null?void 0:h[f])==null?void 0:g.type)??"text"},m=f=>{i.value={...i.value,[f]:""},k()},S=()=>{i.value={},k(!0)},k=(f=!1)=>{const h=Object.keys(i.value).reduce((g,b)=>(i.value[b]&&(g[b]=`${i.value[b]}`),g),{});f&&(a.value=!1),o("update:modelValue",new URLSearchParams(h).toString())};return(f,h)=>{const g=e.resolveComponent("KInput"),b=e.resolveComponent("KButton"),w=e.resolveComponent("KSelect"),K=e.resolveComponent("KMenuItem"),D=e.resolveComponent("KMenu");return t.config.isExactMatch?(e.openBlock(),e.createBlock(g,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":t.modelValue,placeholder:t.config.placeholder,"onUpdate:modelValue":d},{before:e.withCtx(()=>[e.createVNode(yn)]),_:1},8,["model-value","placeholder"])):(e.openBlock(),e.createElementBlock("div",Di,[e.createVNode(b,{appearance:"tertiary","data-testid":"filter-button",onClick:c},{default:e.withCtx(()=>[e.createVNode(yn),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("filter.filterButtonText"))+" "+e.toDisplayString(l.value.length>0?`(${l.value.length})`:""),1)]),_:1}),e.withDirectives(e.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:c},null,512),[[e.vShow,a.value]]),e.withDirectives(e.createVNode(D,{class:"kong-ui-entity-filter-menu"},{body:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(T,C)=>(e.openBlock(),e.createBlock(K,{key:T.value,"data-testid":T.value,expandable:"","last-menu-item":C===s.value.length-1},{itemTitle:e.withCtx(()=>[e.createElementVNode("span",Li,[e.createTextVNode(e.toDisplayString(T.label)+" ",1),e.withDirectives(e.createElementVNode("span",qi,null,512),[[e.vShow,l.value.includes(T.value)]])])]),itemBody:e.withCtx(()=>{var A,B;return[e.createElementVNode("div",vi,[e.createElementVNode("label",{class:"menu-item-label",for:u(T.value)},e.toDisplayString(e.unref(r)("filter.fieldLabel")),9,Pi),((B=(A=t.config.schema)==null?void 0:A[T.value])==null?void 0:B.type)==="select"?(e.openBlock(),e.createBlock(w,{key:0,id:u(T.value),modelValue:i.value[T.value],"onUpdate:modelValue":N=>i.value[T.value]=N,appearance:"select",items:p(T.value),placeholder:e.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(e.openBlock(),e.createBlock(g,{key:1,id:u(T.value),modelValue:i.value[T.value],"onUpdate:modelValue":N=>i.value[T.value]=N,autocomplete:"off",placeholder:e.unref(r)("filter.inputPlaceholder"),type:y(T.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),e.createElementVNode("div",Ri,[e.createVNode(b,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:h[0]||(h[0]=N=>k(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.applyButtonText")),1)]),_:1}),e.createVNode(b,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:N=>m(T.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:e.withCtx(()=>[e.createElementVNode("div",Ui,[e.createVNode(b,{size:"small",onClick:S},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[e.vShow,a.value]])]))}}}),[["__scopeId","data-v-4ea260f0"]]),It=e.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(t){const o=t,n=e.ref(void 0),r=e.computed(()=>n.value===!0||n.value!==void 0&&o.forceShow===!0);return e.watch(()=>o.authFunction,async()=>{n.value=await o.authFunction()},{immediate:!0}),(a,i)=>r.value?e.renderSlot(a.$slots,"default",{key:0,isAllowed:n.value}):e.createCommentVNode("",!0)}}),Hi={class:"form-section-wrapper"},Ji={key:0,class:"form-section-title"},Yi={key:1,class:"form-section-description"},Wi={key:2,class:"form-section-footer"},Gi={class:"form-section-content"},Zi=X(e.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(t){const o=e.useSlots();return(n,r)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(["kong-ui-entity-form-section",{"has-divider":t.hasDivider}])},[e.createElementVNode("div",Hi,[t.hideInfoHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["form-section-info",{sticky:t.stickyInfoHeader}])},[t.title?(e.openBlock(),e.createElementBlock("h4",Ji,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description||e.unref(o).description?(e.openBlock(),e.createElementBlock("div",Yi,[e.renderSlot(n.$slots,"description",{},()=>[e.createElementVNode("p",null,e.toDisplayString(t.description),1)],!0)])):e.createCommentVNode("",!0),e.unref(o).footer?(e.openBlock(),e.createElementBlock("div",Wi,[e.renderSlot(n.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2)),e.createElementVNode("div",Gi,[e.renderSlot(n.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:gn,useDeleteUrlBuilder:Xi,useErrors:Qi,useExternalLinkCreator:Sl,useFetchUrlBuilder:xl,useFetcher:tl,useDebouncedFilter:Bl,useStringHelpers:Nl,useHelpers:Il,useGatewayFeatureSupported:Al,useTruncationDetector:_l}=P,Tl="",el={class:"kong-ui-entities-key-sets-list"},nl={key:1},ol=e.defineComponent({__name:"KeySetList",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||!t.createRoute||!t.getViewRoute||!t.getEditRoute||t.app==="kongManager"&&!t.isExactMatch&&!t.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0}},emits:["error","copy:success","copy:error","delete:success"],setup(t,{emit:o}){var Y;const n=t,{i18n:{t:r}}=_t.useI18n(),a=At.useRouter(),{axiosInstance:i}=gn({headers:(Y=n.config)==null?void 0:Y.requestHeaders}),l=e.ref(1),s=e.computed(()=>n.config.app!=="kongManager"||!!n.config.disableSorting),c={name:{label:r("keySets.list.table_headers.name"),searchable:!0,sortable:!0},tags:{label:r("keySets.list.table_headers.tags")},id:{label:r("keySets.list.table_headers.id"),sortable:!0}},d=c,u=e.computed(()=>{var V,z;let I=`${n.config.apiBaseUrl}${bt.list[n.config.app]}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((V=n.config)==null?void 0:V.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(z=n.config)!=null&&z.workspace?`/${n.config.workspace}`:"")),I}),p=e.ref(""),y=e.computed(()=>{const I=n.config.app==="konnect"||n.config.isExactMatch;if(I)return{isExactMatch:I,placeholder:r("keySets.search.placeholder")};const V={name:c.name};return{isExactMatch:I,fields:V,schema:n.config.filterSchema}}),{fetcher:m,fetcherState:S}=tl(n.config,u.value),k=()=>{p.value=""},f=()=>{l.value++},h=e.ref(""),g=(I,V)=>{const z=I.id;if(!V(z)){D(I,"id");return}K(I,"id")},b=(I,V)=>{const z=JSON.stringify(I);if(!V(z)){o("copy:error",{entity:I,message:r("keySets.errors.copy")});return}o("copy:success",{entity:I,message:r("keySets.copy.success_brief")})},w=(I,V,z)=>{const{type:it}=I;it==="success"?K(V,z):D(V,z)},K=(I,V)=>{o("copy:success",{entity:I,field:V,message:r("keySets.copy.success",{val:I[V]})})},D=(I,V)=>{o("copy:error",{entity:I,field:V,message:r("keySets.errors.copy")})},T=async I=>{var z;await((z=n.canRetrieve)==null?void 0:z.call(n,I))&&a.push(n.config.getViewRoute(I.id))},C=I=>({label:r("keySets.actions.view"),to:n.config.getViewRoute(I)}),A=I=>({label:r("keySets.actions.edit"),to:n.config.getEditRoute(I)}),B=e.ref(void 0),N=e.ref(!1),_=e.ref(!1),E=e.ref(""),$=Xi(n.config,u.value),v=I=>{B.value=I,N.value=!0},R=()=>{N.value=!1},L=async()=>{var I,V,z;if((I=B.value)!=null&&I.id){_.value=!0;try{await i.delete($(B.value.id)),_.value=!1,N.value=!1,l.value++,o("delete:success",B.value)}catch(it){E.value=((z=(V=it.response)==null?void 0:V.data)==null?void 0:z.message)||it.message||r("keySets.errors.delete"),o("error",it)}finally{_.value=!1}}};e.watch(S,I=>{if(I.status===rt.Error){h.value=r("keySets.errors.general"),o("error",I.error);return}h.value=""});const O=e.ref({ctaPath:n.config.createRoute,ctaText:void 0,message:r("keySets.list.empty_state.description"),title:r("keySets.title")});return e.onBeforeMount(async()=>{await n.canCreate()&&(O.value.title=r("keySets.list.empty_state.title"),O.value.ctaText=r("keySets.actions.create"))}),(I,V)=>{const z=e.resolveComponent("KButton"),it=e.resolveComponent("KBadge"),dl=e.resolveComponent("KTruncate"),pl=e.resolveComponent("CopyUuid"),kt=e.resolveComponent("KDropdownItem"),kn=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",el,[e.createVNode(e.unref(Ti),{"cache-identifier":t.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":s.value,"empty-state-options":O.value,"enable-entity-actions":"","error-message":h.value,fetcher:e.unref(m),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-key-sets-list",query:p.value,"table-headers":e.unref(d),onClearSearchInput:k,"onClick:row":V[2]||(V[2]=F=>T(F)),onSort:f},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(zi),{modelValue:p.value,"onUpdate:modelValue":V[0]||(V[0]=F=>p.value=F),config:y.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[e.createVNode(e.unref(It),{"auth-function":()=>t.canCreate()},{default:e.withCtx(()=>[e.createVNode(z,{appearance:"primary","data-testid":"toolbar-add-key-set",icon:"plus",to:t.config.createRoute},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("keySets.list.toolbar_actions.new_key_set")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),name:e.withCtx(({rowValue:F})=>[e.createElementVNode("b",null,e.toDisplayString(F??"-"),1)]),tags:e.withCtx(({rowValue:F})=>[(F==null?void 0:F.length)>0?(e.openBlock(),e.createBlock(dl,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F,et=>(e.openBlock(),e.createBlock(it,{key:et,onClick:V[1]||(V[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(et),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",nl,"-"))]),id:e.withCtx(({row:F,rowValue:et})=>[e.createVNode(pl,{notify:Yt=>w(Yt,F,"id"),truncated:!1,uuid:et},null,8,["notify","uuid"])]),actions:e.withCtx(({row:F})=>[e.createVNode(kn,null,{default:e.withCtx(({copyToClipboard:et})=>[e.createVNode(kt,{"data-testid":"action-entity-copy-id",onClick:Yt=>g(F,et)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("keySets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(kn,null,{default:e.withCtx(({copyToClipboard:et})=>[e.createVNode(kt,{"data-testid":"action-entity-copy-json",onClick:Yt=>b(F,et)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("keySets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(It),{"auth-function":()=>t.canRetrieve(F)},{default:e.withCtx(()=>[e.createVNode(kt,{"data-testid":"action-entity-view","has-divider":"",item:C(F.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(It),{"auth-function":()=>t.canEdit(F)},{default:e.withCtx(()=>[e.createVNode(kt,{"data-testid":"action-entity-edit",item:A(F.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(It),{"auth-function":()=>t.canDelete(F)},{default:e.withCtx(()=>[e.createVNode(kt,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:et=>v(F)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("keySets.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"]),e.createVNode(e.unref($i),{"action-pending":_.value,description:e.unref(r)("keySets.delete.description"),"entity-name":B.value&&(B.value.name||B.value.id),"entity-type":e.unref(Gt).KeySet,error:E.value,title:e.unref(r)("keySets.delete.title"),visible:N.value,onCancel:R,onProceed:L},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),El="",hn=(t,o)=>{const n=t.__vccOpts||t;for(const[r,a]of o)n[r]=a;return n},rl=hn(ol,[["__scopeId","data-v-82f21705"]]),al={class:"kong-ui-entities-key-sets-form"},il=e.defineComponent({__name:"KeySetForm",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.cancelRoute)},keySetId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(t,{emit:o}){var f;const n=t,r=At.useRouter(),{i18n:{t:a}}=_t.useI18n(),{getMessageFromError:i}=Qi(),{axiosInstance:l}=gn({headers:(f=n.config)==null?void 0:f.requestHeaders}),s=e.computed(()=>bt.form[n.config.app].edit),c=e.computed(()=>n.keySetId?Tt.Edit:Tt.Create),d=e.reactive({fields:{name:"",tags:""},isReadonly:!1,errorMessage:""}),u=e.reactive({name:"",tags:""}),p=e.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(u)&&!!d.fields.name),y=h=>{var g;d.fields.name=(h==null?void 0:h.name)||"",d.fields.tags=((g=h==null?void 0:h.tags)==null?void 0:g.join(", "))||"",Object.assign(u,d.fields)},m=()=>{r.push(n.config.cancelRoute)},S=e.computed(()=>{var g,b;let h=`${n.config.apiBaseUrl}${bt.form[n.config.app][c.value]}`;return n.config.app==="konnect"?h=h.replace(/{controlPlaneId}/gi,((g=n.config)==null?void 0:g.controlPlaneId)||""):n.config.app==="kongManager"&&(h=h.replace(/\/{workspace}/gi,(b=n.config)!=null&&b.workspace?`/${n.config.workspace}`:"")),h=h.replace(/{id}/gi,n.keySetId),h}),k=async()=>{var h,g,b,w,K;try{d.isReadonly=!0;const D={name:d.fields.name,tags:((b=(g=(h=d.fields.tags)==null?void 0:h.split(","))==null?void 0:g.map(C=>String(C||"").trim()))==null?void 0:b.filter(C=>C!==""))||""};let T;if(c.value==="create"?T=await l.post(S.value,D):c.value==="edit"&&(T=((w=n.config)==null?void 0:w.app)==="konnect"?await l.put(S.value,D):await l.patch(S.value,D)),T){const{data:C}=T;d.fields.name=(C==null?void 0:C.name)||"",d.fields.tags=((K=C==null?void 0:C.tags)==null?void 0:K.join(", "))||"",Object.assign(u,d.fields),o("update",T==null?void 0:T.data)}}catch(D){d.errorMessage=i(D),o("error",D)}finally{d.isReadonly=!1}};return(h,g)=>{const b=e.resolveComponent("KInput");return e.openBlock(),e.createElementBlock("div",al,[e.createVNode(e.unref(xi),{"can-submit":p.value,config:t.config,"edit-id":t.keySetId,"error-message":d.errorMessage,"fetch-url":s.value,"is-readonly":d.isReadonly,onCancel:m,"onFetch:error":g[2]||(g[2]=w=>h.$emit("error",w)),"onFetch:success":y,onLoading:g[3]||(g[3]=w=>h.$emit("loading",w)),onSubmit:k},{default:e.withCtx(()=>[e.createVNode(e.unref(Zi),{description:e.unref(a)("keySets.form.sections.general.description"),"has-divider":"",title:e.unref(a)("keySets.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(b,{modelValue:d.fields.name,"onUpdate:modelValue":g[0]||(g[0]=w=>d.fields.name=w),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-set-form-name",label:e.unref(a)("keySets.form.fields.name.label"),placeholder:e.unref(a)("keySets.form.fields.name.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(b,{modelValue:d.fields.tags,"onUpdate:modelValue":g[1]||(g[1]=w=>d.fields.tags=w),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-set-form-tags",help:e.unref(a)("keySets.form.fields.tags.help"),label:e.unref(a)("keySets.form.fields.tags.label"),"label-attributes":{info:e.unref(a)("keySets.form.fields.tags.tooltip")},placeholder:e.unref(a)("keySets.form.fields.tags.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),Vl="",ll=hn(il,[["__scopeId","data-v-29df09d7"]]),sl={class:"kong-ui-entities-keys-entity-config-card"},cl=e.defineComponent({__name:"KeySetConfigCard",props:{config:{type:Object,required:!0,validator:t=>!(!t||!["konnect","kongManager"].includes(t==null?void 0:t.app)||t.app==="konnect"&&!t.controlPlaneId||t.app==="kongManager"&&typeof t.workspace!="string"||!t.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(t){const o=t,{i18n:{t:n}}=_t.useI18n(),r=e.computed(()=>bt.form[o.config.app].edit),a=e.ref({id:{},name:{},last_updated:{},created:{},tags:{tooltip:n("keySets.form.fields.tags.tooltip")}});return(i,l)=>(e.openBlock(),e.createElementBlock("div",sl,[e.createVNode(e.unref(Ci),{config:t.config,"config-card-doc":t.configCardDoc,"config-schema":a.value,"fetch-url":r.value,"hide-title":t.hideTitle,"onCopy:success":l[0]||(l[0]=s=>i.$emit("copy:success",s)),"onFetch:error":l[1]||(l[1]=s=>i.$emit("fetch:error",s)),"onFetch:success":l[2]||(l[2]=s=>i.$emit("fetch:success",s)),onLoading:l[3]||(l[3]=s=>i.$emit("loading",s))},null,8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});G.KeySetConfigCard=cl,G.KeySetForm=ll,G.KeySetList=rl,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});