@kong-ui-public/entities-upstreams-targets 2.1.11 → 2.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,32 @@
1
- (function(te,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@kong-ui-public/i18n","@kong/kongponents","vue-router"],t):(te=typeof globalThis<"u"?globalThis:te||self,t(te["kong-ui-entities-upstreams-targets"]={},te.Vue,te.axios,te["kong-ui-public-i18n"],te.Kongponents,te.VueRouter))})(this,function(te,t,pr,Be,ur,ze){"use strict";var Je=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(Je||{}),oe=(e=>(e.Edit="edit",e.Create="create",e))(oe||{}),he=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(he||{}),P=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(P||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function We(e={}){return{axiosInstance:pr.create({withCredentials:!0,timeout:3e4,...e})}}function fr(){return{debounce:(e,l)=>{let a;return(...r)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...r)},l)}}}}const Qe="khcp-user-table-preferences",mr={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function gr(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(r){console.error("useTablePreferences(tryParseJson)",r);return}},l=()=>{const a=e(localStorage.getItem(Qe));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,r)=>{try{const o=l();o.set(a,r),localStorage.setItem(Qe,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:a=>{const r=l();return(r==null?void 0:r.get(a))||void 0||mr},deleteAllTablePreferences:()=>{localStorage.removeItem(Qe)}}}const yr={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},kr={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},br={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Cr={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},wr={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"}},_r={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Sr={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},xr={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Nr={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"}},Vr={global:yr,deleteModal:kr,baseForm:br,baseTable:Cr,baseConfigCard:wr,filter:_r,debouncedFilter:Sr,errors:xr,toggleModal:Nr};function Ye(){const e=Be.createI18n("en-us",Vr);return{i18n:e,i18nT:Be.i18nTComponent(e)}}function bt(){const e=(a,r)=>(r==null?void 0:r[a])??void 0,l=(a,r)=>{if(a.length!==r.length)return!1;const o=new Set([...a,...r]);for(const s of o){const c=a.filter(i=>i===s).length,h=r.filter(i=>i===s).length;if(c!==h)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,r,o)=>{if(o){if(Object.keys(a).length===Object.keys(r).length)for(const s in a)if(Array.isArray(a[s])&&Array.isArray(r[s])){if(l(a[s],r[s]))continue;return!1}else{if(a[s]===r[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(r)}catch{return!1}},sortAlpha:a=>(r,o)=>{let s=r[a]===void 0||r[a]===null?"":r[a],c=o[a]===void 0||o[a]===null?"":o[a];return Array.isArray(r[a])&&(s=r[a][0]),Array.isArray(o[a])&&(c=o[a][0]),s.localeCompare(c)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function Br(e,l,a,r={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:o}=We({headers:e.requestHeaders}),{i18n:{t:s}}=Ye(),{debounce:c}=fr(),h=c(async V=>{await O(V)},200),i=t.ref(!1),d=t.ref(""),u=t.ref(""),p=t.ref([]),n=t.ref([]),k=t.ref(void 0),w=t.unref(l);let f=`${e.apiBaseUrl}${w}`;e.app==="konnect"?f=f.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(f=f.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=bt(),N=async()=>{try{i.value=!0;const{data:V}=await o.get(`${f}?size=${a}`);V!=null&&V.next||(k.value=r.fetchedItemsKey in V?V[r.fetchedItemsKey]:[]),n.value=r.fetchedItemsKey in V?V[r.fetchedItemsKey]:[],p.value=n.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{i.value=!1}},C=t.ref(""),O=async V=>{var S,q,A;if(C.value!==V)if(C.value=V||"",k.value===void 0)try{if(i.value=!0,d.value="",u.value="",e.app==="konnect"){let x=f+"";V&&(x+=`/${V}`);const{data:I}=await o.get(`${x}?size=${a}`);r.fetchedItemsKey in I?p.value=I[r.fetchedItemsKey]:I!=null&&I.id?p.value=[I]:p.value=[]}else if(V){const x=[];m(V)&&r.searchKeys.includes("id")?x.push((async()=>{const{data:T}=await o.get(`${f}/${V}`);return[T[r.fetchedItemsKey]??T]})()):x.push(...r.searchKeys.filter(T=>T!=="id").map(async T=>{const{data:H}=await o.get(`${f}?${T}=${V}`);return H[r.fetchedItemsKey]}));const I=await Promise.all(x),_=new Set;p.value=[],(S=I==null?void 0:I.forEach)==null||S.call(I,T=>{var H;(H=T==null?void 0:T.forEach)==null||H.call(T,v=>{_.has(v.id)||(_.add(v.id),p.value.push(v))})})}else p.value=n.value}catch(x){((q=x==null?void 0:x.response)==null?void 0:q.status)===404?u.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{i.value=!1}else i.value=!0,u.value="",V?(p.value=(A=k.value)==null?void 0:A.filter(x=>{var I;let _=!1;for(const T of r.searchKeys){const H=typeof x[T]=="string"?(I=x[T])==null?void 0:I.toLowerCase():x[T];H!=null&&H.includes(V.toLowerCase())&&(_=!0)}return _}),(!p.value||!p.value.length)&&(u.value=s("debouncedFilter.errors.invalid"))):p.value=k.value,i.value=!1};return{loading:i,error:d,validationError:u,results:p,allRecords:k,loadItems:N,debouncedQueryChange:h}}function Ir(e,l){const a=t.unref(l),r=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return r.value.search="",o=>`${r.value.href}/${o}`}function Tr(){const{i18n:{t:e}}=Ye();return{getMessageFromError:l=>{var a,r,o;if(!l)return e("errors.unexpected");if((a=l==null?void 0:l.response)!=null&&a.data){if(l.response.data.detail)return l.response.data.detail;if((r=l.response.data.details)!=null&&r.length)return l.response.data.details.map(s=>{let c=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(c=s.messages.join(", ")),s.field?`${s.field} - ${c}`:c}).join("; ");if(l.response.data.message){const{message:s}=l.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof l.response.data=="string")return l.response.data;if(typeof l.response.data=="object")return Object.keys(l.response.data).map(s=>`${s} ${l.response.data[s]}`).join(", ")}return l.message||e("errors.unexpected")}}}function Hr(e){const l=window.location.origin,a=l.endsWith("/")?l:`${l}/`;try{const r=e.join("/"),o=`${a}${r}`,s=e.some(c=>c.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${a}${r}`;throw new Error("Invalid url")}catch(r){return console.warn("Failed to build valid URL:",r),""}}function Ct(e,l){const a=t.ref(t.unref(e)),r=t.ref(t.unref(l)),o=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),s=t.computed(()=>r.value.startsWith("/")?new URL(`${window.location.origin}${r.value}`):new URL(r.value));return c=>{const{page:h,pageSize:i,offset:d,sortColumnKey:u,sortColumnOrder:p,query:n}=c;try{let k=new URL(s.value.href);return o.value&&n?(k.search="",k=a.value.app==="konnect"?new URL(`${k.href}?filter[name][contains]=${n}`):new URL(`${k.href}/${n}/`)):(o.value||new URLSearchParams(n).forEach((w,f)=>{k.searchParams.append(f,w)}),u&&k.searchParams.append("sort_by",u),p==="desc"&&k.searchParams.append("sort_desc","1"),k.searchParams.append("size",String(i))),d&&h!==1&&k.searchParams.append("offset",String(d)),k.href}catch(k){return console.error("RouteList(fetcher)",k),r.value}}}function Er(e,l,a="data"){const r=t.unref(l),{axiosInstance:o}=We({headers:e.requestHeaders}),s=Ct(e,r),c=t.ref({status:he.Idle});return{fetcher:async h=>{try{c.value={status:he.Loading};const i=s(h),{data:d}=await o.get(i),u=a&&a.replace(/[^\w-_]/gi,"");let p;d[u]&&Array.isArray(d[u])?p=d[u]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const n={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return c.value={status:he.Idle,response:n},n}catch(i){const d={data:[],total:0};return h.query&&i.response.status===404?(c.value={status:he.NoResults,response:d,error:i},d):(c.value={status:he.Error,response:d,error:i},d)}},fetcherState:c}}function Ar(){const e=(a,r="_")=>a?a.split(r).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",l=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(l,r=>r.toUpperCase()):"",convertKeyToTitle:e}}const wt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,_t=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const l=e.match(wt);if(!l)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return l.shift(),l},St=e=>e==="*"||e==="x"||e==="X",xt=e=>{const l=parseInt(e,10);return isNaN(l)?e:l},Fr=(e,l)=>typeof e!=typeof l?[String(e),String(l)]:[e,l],Or=(e,l)=>{if(St(e)||St(l))return 0;const[a,r]=Fr(xt(e),xt(l));return a>r?1:a<r?-1:0},Nt=(e,l)=>{for(let a=0;a<Math.max(e.length,l.length);a++){const r=Or(e[a]||"0",l[a]||"0");if(r!==0)return r}return 0},qr=(e,l)=>{const a=_t(e),r=_t(l),o=a.pop(),s=r.pop(),c=Nt(a,r);return c!==0?c:o&&s?Nt(o.split("."),s.split(".")):o||s?o?-1:1:0},Vt=(e,l,a)=>{Ur(a);const r=qr(e,l);return Bt[a].includes(r)},Bt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},It=Object.keys(Bt),Ur=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(It.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${It.join("|")}`)},$r=e=>typeof e=="string"&&/^[v\d]/.test(e)&&wt.test(e);function vr(e){const{gatewayInfo:l,supportedRange:a}=e;if(!l)return!0;const{edition:r,version:o}=l;if(!$r(o))return console.error("Invalid version"),!1;const s=a[r];if(!s)return!1;const[c,h]=s;return!(c&&Vt(o,c,"<")||h&&Vt(o,h,">"))}function Dr(e){const l=t.ref(0),a=t.ref(0),r=t.ref(!1);return t.watch(e,o=>{o&&!r.value&&(l.value=o.offsetWidth,a.value=o.scrollWidth,r.value=!0)}),{isTruncated:t.computed(()=>l.value<a.value)}}const Y={useAxios:We,useDebouncedFilter:Br,useDeleteUrlBuilder:Ir,useErrors:Tr,useExternalLinkCreator:Hr,useFetcher:Er,useFetchUrlBuilder:Ct,useHelpers:bt,useStringHelpers:Ar,useI18n:Ye,useGatewayFeatureSupported:vr,useTruncationDetector:Dr},Mr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},jr="Copy to clipboard",Kr={message:Mr,iconTitle:jr},Pr="kong-ui-copy-uuid-notify",Tt="24px",Lr=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Rr=e=>(t.pushScopeId("data-v-641e0aee"),e=e(),t.popScopeId(),e),zr=["aria-hidden"],Jr={key:0,"data-testid":"kui-icon-svg-title"},Wr=Rr(()=>t.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)),Qr=t.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:Tt,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Tt}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Jr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Wr],8,zr))]),_:1},8,["aria-hidden","style"]))}}),Yr=Lr(Qr,[["__scopeId","data-v-641e0aee"]]),Zr="16px",Gr={class:"kong-ui-copy-uuid"},Xr=["onClick"],Ht=15,eo=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:l}){const a=e,{t:r}=Be.createI18n("en-us",Kr),o=a.notify||t.inject(Pr,()=>{}),s=t.computed(()=>a.idTooltip?{label:a.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:a.uuid}),c=t.computed(()=>!!(a.tooltip&&a.successTooltip)),h=t.ref(a.tooltip),i=t.computed(()=>a.tooltip?{label:h.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),d=t.computed(()=>{var n;return a.format==="redacted"?"*****":a.format==="deleted"?`*${(n=a.uuid)==null?void 0:n.substring(0,5)}`:a.uuid}),u=n=>{h.value=n,setTimeout(()=>{h.value=a.tooltip},1800)},p=n=>{var k,w;if(!n(a.uuid)){typeof o=="function"&&o({type:"error",message:r("message.fail")}),c.value?u(r("message.fail")):l("error",a.uuid);return}const f=((k=a.uuid)==null?void 0:k.length)>Ht,m=a.format==="hidden"||a.format==="redacted"?r("message.success.prefix"):`"${((w=a.uuid)==null?void 0:w.substring(0,Ht))+(f?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${m}${r("message.success.content")}`}),c.value?u(a.successTooltip):l("success",a.uuid)};return(n,k)=>{const w=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Gr,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},s.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(d.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(i.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(w,null,{default:t.withCtx(({copyToClipboard:f})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(m=>p(f),["stop"])},[t.createVNode(t.unref(Yr),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(Zr),title:t.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Xr)]),_:1})]),_:1},16))])}}}),to=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},Et=to(eo,[["__scopeId","data-v-0c07874b"]]),ao={key:0,class:"config-card-fieldset-title"},lo=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const l=e,{i18n:{t:a}}=Y.useI18n(),{convertKeyToTitle:r}=Y.useStringHelpers(),o=t.computed(()=>l.item.key??"json-array-item"),s=t.computed(()=>l.item.value??l.item),c=t.computed(()=>{const i=JSON.parse(JSON.stringify(s.value));return l.isArrayItem&&delete i.name,i}),h=t.computed(()=>{var i;return l.isArrayItem?(i=s.value)!=null&&i.name?r(s.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:l.index}):""});return(i,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",ao,[t.createElementVNode("b",null,t.toDisplayString(h.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(c.value),(u,p)=>(t.openBlock(),t.createBlock(Ze,{key:`${o.value}-property-${p}`,item:{key:u,label:t.unref(r)(u),value:c.value[u]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),re=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},At=re(lo,[["__scopeId","data-v-68ca83ec"]]),ro=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:l}}=Y.useI18n();return(a,r)=>{const o=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:r[0]||(r[0]=s=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(l)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),oo=re(ro,[["__scopeId","data-v-c96811e5"]]),no=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:l}}=Y.useI18n();return(a,r)=>{const o=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(o,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(l)("baseConfigCard.statusBadge.enabledLabel"):t.unref(l)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),so="#0044f4",io="#e0e4ea",co="#3a3f51",ho="1px",po="20px",uo={class:"config-card-details-row"},fo=["data-testid"],mo=["data-testid"],go=["data-testid"],yo=["data-testid"],ko={key:1},bo=["data-testid"],Co=["data-testid"],wo=["data-testid"],_o=["data-testid"],So={name:"ConfigCardItem",components:{CopyUuid:Et,JsonCardItem:At,StatusBadge:no,InternalLinkItem:oo}},xo=t.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(e,{emit:l}){const a=e;t.useCssVars(k=>({"0da74440":d.value?"none":`solid ${t.unref(ho)} ${t.unref(io)}`,"02a039da":i.value&&c.value?"block":"flex","690f3ced":i.value&&c.value?"100%":a.slim?"50%":"25%","691182c8":i.value&&c.value?"100%":a.slim?"50%":"75%"}));const r=t.useSlots(),{i18n:{t:o,formatUnixTimeStamp:s}}=Y.useI18n(),c=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),h=t.computed(()=>!!(a.item.tooltip||r["label-tooltip"])),i=t.computed(()=>a.item.type===P.Json||a.item.type===P.JsonArray),d=t.computed(()=>a.item.type===P.JsonArray),u=t.computed(()=>{switch(a.item.type){case P.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case P.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case P.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case P.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case P.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:s(a.item.value)};case P.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case P.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case P.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case P.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:k=>{l("navigation-click",k)}}};case P.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case P.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case P.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),p=t.ref(),{isTruncated:n}=Y.useTruncationDetector(p);return(k,w)=>{const f=t.resolveComponent("KLabel"),m=t.resolveComponent("KBadge"),N=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",uo,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(k.$slots,"label",{item:e.item},()=>[t.createVNode(f,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[h.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(k.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,mo)]),key:"0"}:void 0]),1024)],!0)],8,fo),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(k.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(t.openBlock(),t.createElementBlock("div",ko,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(C,O)=>(t.openBlock(),t.createBlock(m,{key:`${e.item.key}-badge-tag-${O}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${O}`,tooltip:C,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(C),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,bo)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(C,O)=>(t.openBlock(),t.createBlock(t.unref(Et),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${O}`,"data-testid":`${e.item.key}-copy-uuid-${O}`,uuid:C}),null,16,["data-testid","uuid"]))),128))],8,Co)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(C,O)=>(t.openBlock(),t.createBlock(m,{key:`${e.item.key}-badge-method-${O}`,appearance:Object.values(t.unref(ur.BadgeMethodAppearances)).includes(C.toLowerCase())?C.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${O}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(C),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,wo)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${a.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(C,O)=>(t.openBlock(),t.createBlock(At,{key:`json-array-item-${O}`,index:O,"is-array-item":"",item:C},null,8,["index","item"]))),128))],8,_o)):(t.openBlock(),t.createBlock(N,{key:4,label:t.unref(n)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:p,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,yo))],!0)],8,go)])}}}),Ze=re(xo,[["__scopeId","data-v-9c87856b"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ft(e){return typeof e>"u"||e===null}function No(e){return typeof e=="object"&&e!==null}function Vo(e){return Array.isArray(e)?e:Ft(e)?[]:[e]}function Bo(e,l){var a,r,o,s;if(l)for(s=Object.keys(l),a=0,r=s.length;a<r;a+=1)o=s[a],e[o]=l[o];return e}function Io(e,l){var a="",r;for(r=0;r<l;r+=1)a+=e;return a}function To(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Ho=Ft,Eo=No,Ao=Vo,Fo=Io,Oo=To,qo=Bo,Q={isNothing:Ho,isObject:Eo,toArray:Ao,repeat:Fo,isNegativeZero:Oo,extend:qo};function Ot(e,l){var a="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!l&&e.mark.snippet&&(a+=`
1
+ (function(ae,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@kong-ui-public/i18n","@kong/kongponents","vue-router"],t):(ae=typeof globalThis<"u"?globalThis:ae||self,t(ae["kong-ui-entities-upstreams-targets"]={},ae.Vue,ae.axios,ae["kong-ui-public-i18n"],ae.Kongponents,ae.VueRouter))})(this,function(ae,t,pr,Be,ur,Je){"use strict";var We=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(We||{}),oe=(e=>(e.Edit="edit",e.Create="create",e))(oe||{}),pe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(pe||{}),L=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),W=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(W||{});function Qe(e={}){return{axiosInstance:pr.create({withCredentials:!0,timeout:3e4,...e})}}function fr(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const Ye="khcp-user-table-preferences",mr={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function gr(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(Ye));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(Ye,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||mr},deleteAllTablePreferences:()=>{localStorage.removeItem(Ye)}}}const yr={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},kr={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},br={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},Cr={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},wr={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"}},_r={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Sr={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},xr={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Nr={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"}},Vr={global:yr,deleteModal:kr,baseForm:br,baseTable:Cr,baseConfigCard:wr,filter:_r,debouncedFilter:Sr,errors:xr,toggleModal:Nr};function Ze(){const e=Be.createI18n("en-us",Vr);return{i18n:e,i18nT:Be.i18nTComponent(e)}}function Ct(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const s of n){const o=a.filter(c=>c===s).length,d=l.filter(c=>c===s).length;if(o!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const s in a)if(Array.isArray(a[s])&&Array.isArray(l[s])){if(r(a[s],l[s]))continue;return!1}else{if(a[s]===l[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let s=l[a]===void 0||l[a]===null?"":l[a],o=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(s=l[a][0]),Array.isArray(n[a])&&(o=n[a][0]),s.localeCompare(o)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function Ir(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:n}=Qe({headers:e.requestHeaders}),{i18n:{t:s}}=Ze(),{debounce:o}=fr(),d=o(async B=>{await I(B)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),f=t.ref([]),i=t.ref(void 0),S=t.unref(r);let b=`${e.apiBaseUrl}${S}`;e.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=Ct(),y=async()=>{try{c.value=!0;const{data:B}=await n.get(`${b}?size=${a}`);B!=null&&B.next||(i.value=l.fetchedItemsKey in B?B[l.fetchedItemsKey]:[]),f.value=l.fetchedItemsKey in B?B[l.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],h.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},_=t.ref(""),I=async B=>{var E,x,U;if(_.value!==B)if(_.value=B||"",i.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){let T=b+"";B&&(T+=`/${B}`);const{data:N}=await n.get(`${T}?size=${a}`);l.fetchedItemsKey in N?u.value=N[l.fetchedItemsKey]:N!=null&&N.id?u.value=[N]:u.value=[]}else if(B){const T=[];m(B)&&l.searchKeys.includes("id")?T.push((async()=>{const{data:w}=await n.get(`${b}/${B}`);return[w[l.fetchedItemsKey]??w]})()):T.push(...l.searchKeys.filter(w=>w!=="id").map(async w=>{const{data:A}=await n.get(`${b}?${w}=${B}`);return A[l.fetchedItemsKey]}));const N=await Promise.all(T),H=new Set;u.value=[],(E=N==null?void 0:N.forEach)==null||E.call(N,w=>{var A;(A=w==null?void 0:w.forEach)==null||A.call(w,F=>{H.has(F.id)||(H.add(F.id),u.value.push(F))})})}else u.value=f.value}catch(T){((x=T==null?void 0:T.response)==null?void 0:x.status)===404?p.value=s("debouncedFilter.errors.invalid"):(u.value=[],h.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",B?(u.value=(U=i.value)==null?void 0:U.filter(T=>{var N;let H=!1;for(const w of l.searchKeys){const A=typeof T[w]=="string"?(N=T[w])==null?void 0:N.toLowerCase():T[w];A!=null&&A.includes(B.toLowerCase())&&(H=!0)}return H}),(!u.value||!u.value.length)&&(p.value=s("debouncedFilter.errors.invalid"))):u.value=i.value,c.value=!1};return{loading:c,error:h,validationError:p,results:u,allRecords:i,loadItems:y,debouncedQueryChange:d}}function Br(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Tr(){const{i18n:{t:e}}=Ze();return{getMessageFromError:r=>{var a,l,n;if(!r)return e("errors.unexpected");if((a=r==null?void 0:r.response)!=null&&a.data){if(r.response.data.detail)return r.response.data.detail;if((l=r.response.data.details)!=null&&l.length)return r.response.data.details.map(s=>{let o=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(o=s.messages.join(", ")),s.field?`${s.field} - ${o}`:o}).join("; ");if(r.response.data.message){const{message:s}=r.response.data;return Array.isArray(s)?(n=s[0])!=null&&n.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(s=>`${s} ${r.response.data[s]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Hr(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,s=e.some(o=>o.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!s&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function wt(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),s=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return o=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:f}=o;try{let i=new URL(s.value.href);return n.value&&f?(i.search="",i=a.value.app==="konnect"?new URL(`${i.href}?filter[name][contains]=${f}`):new URL(`${i.href}/${f}/`)):(n.value||new URLSearchParams(f).forEach((S,b)=>{i.searchParams.append(b,S)}),p&&i.searchParams.append("sort_by",p),u==="desc"&&i.searchParams.append("sort_desc","1"),i.searchParams.append("size",String(c))),h&&d!==1&&i.searchParams.append("offset",String(h)),i.href}catch(i){return console.error("RouteList(fetcher)",i),l.value}}}function Ar(e,r,a="data"){const l=t.unref(r),{axiosInstance:n}=Qe({headers:e.requestHeaders}),s=wt(e,l),o=t.ref({status:pe.Idle});return{fetcher:async d=>{try{o.value={status:pe.Loading};const c=s(d),{data:h}=await n.get(c),p=a&&a.replace(/[^\w-_]/gi,"");let u;h[p]&&Array.isArray(h[p])?u=h[p]:Array.isArray(h)?u=h:u=Object.keys(h).length?[h]:[];const f={data:u,total:u.length,...h.offset?{pagination:{offset:h.offset}}:null};return o.value={status:pe.Idle,response:f},f}catch(c){const h={data:[],total:0};return d.query&&c.response.status===404?(o.value={status:pe.NoResults,response:h,error:c},h):(o.value={status:pe.Error,response:h,error:c},h)}},fetcherState:o}}function Er(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const _t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,St=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(_t);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},xt=e=>e==="*"||e==="x"||e==="X",Nt=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Fr=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Or=(e,r)=>{if(xt(e)||xt(r))return 0;const[a,l]=Fr(Nt(e),Nt(r));return a>l?1:a<l?-1:0},Vt=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Or(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},qr=(e,r)=>{const a=St(e),l=St(r),n=a.pop(),s=l.pop(),o=Vt(a,l);return o!==0?o:n&&s?Vt(n.split("."),s.split(".")):n||s?n?-1:1:0},It=(e,r,a)=>{Ur(a);const l=qr(e,r);return Bt[a].includes(l)},Bt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Tt=Object.keys(Bt),Ur=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Tt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Tt.join("|")}`)},vr=e=>typeof e=="string"&&/^[v\d]/.test(e)&&_t.test(e);function $r(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!vr(n))return console.error("Invalid version"),!1;const s=a[l];if(!s)return!1;const[o,d]=s;return!(o&&It(n,o,"<")||d&&It(n,d,">"))}function Dr(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}const Z={useAxios:Qe,useDebouncedFilter:Ir,useDeleteUrlBuilder:Br,useErrors:Tr,useExternalLinkCreator:Hr,useFetcher:Ar,useFetchUrlBuilder:wt,useHelpers:Ct,useStringHelpers:Er,useI18n:Ze,useGatewayFeatureSupported:$r,useTruncationDetector:Dr},Mr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Kr="Copy to clipboard",jr={message:Mr,iconTitle:Kr},Pr="kong-ui-copy-uuid-notify",Ht="24px",Lr=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Rr=e=>(t.pushScopeId("data-v-641e0aee"),e=e(),t.popScopeId(),e),zr=["aria-hidden"],Jr={key:0,"data-testid":"kui-icon-svg-title"},Wr=Rr(()=>t.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)),Qr=t.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:Ht,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Jr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Wr],8,zr))]),_:1},8,["aria-hidden","style"]))}}),Yr=Lr(Qr,[["__scopeId","data-v-641e0aee"]]),Zr="16px",Gr={class:"kong-ui-copy-uuid"},Xr=["onClick"],At=15,en=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:r}){const{t:a}=Be.createI18n("en-us",jr),l=e,n=r,s=l.notify||t.inject(Pr,()=>{}),o=t.computed(()=>l.idTooltip?{label:l.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:l.uuid}),d=t.computed(()=>!!(l.tooltip&&l.successTooltip)),c=t.ref(l.tooltip),h=t.computed(()=>l.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),p=t.computed(()=>{var i;return l.format==="redacted"?"*****":l.format==="deleted"?`*${(i=l.uuid)==null?void 0:i.substring(0,5)}`:l.uuid}),u=i=>{c.value=i,setTimeout(()=>{c.value=l.tooltip},1800)},f=i=>{var S,b;if(!i(l.uuid)){typeof s=="function"&&s({type:"error",message:a("message.fail")}),d.value?u(a("message.fail")):n("error",l.uuid);return}const m=((S=l.uuid)==null?void 0:S.length)>At,y=l.format==="hidden"||l.format==="redacted"?a("message.success.prefix"):`"${((b=l.uuid)==null?void 0:b.substring(0,At))+(m?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${y}${a("message.success.content")}`}),d.value?u(l.successTooltip):n("success",l.uuid)};return(i,S)=>{const b=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Gr,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},o.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(p.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(h.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(b,null,{default:t.withCtx(({copyToClipboard:m})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(y=>f(m),["stop"])},[t.createVNode(t.unref(Yr),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(Zr),title:t.unref(a)("iconTitle")},null,8,["color","decorative","size","title"])],8,Xr)]),_:1})]),_:1},16))])}}}),tn=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Et=tn(en,[["__scopeId","data-v-0c07874b"]]),an={key:0,class:"config-card-fieldset-title"},ln=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Z.useI18n(),{convertKeyToTitle:l}=Z.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),s=t.computed(()=>r.item.value??r.item),o=t.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=s.value)!=null&&c.name?l(s.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,h)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",an,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(o.value),(p,u)=>(t.openBlock(),t.createBlock(Ge,{key:`${n.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:o.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ne=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Ft=ne(ln,[["__scopeId","data-v-68ca83ec"]]),rn=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=s=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),nn=ne(rn,[["__scopeId","data-v-c96811e5"]]),on=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),sn="#0044f4",cn="#e0e4ea",dn="#3a3f51",hn="1px",pn="20px",un={class:"config-card-details-row"},fn=["data-testid"],mn=["data-testid"],gn=["data-testid"],yn=["data-testid"],kn={key:1},bn=["data-testid"],Cn=["data-testid"],wn=["data-testid"],_n=["data-testid"],Sn={name:"ConfigCardItem",components:{CopyUuid:Et,JsonCardItem:Ft,StatusBadge:on,InternalLinkItem:nn}},xn=t.defineComponent({...Sn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(S=>({"0da74440":p.value?"none":`solid ${t.unref(hn)} ${t.unref(cn)}`,"02a039da":h.value&&d.value?"block":"flex","690f3ced":h.value&&d.value?"100%":a.slim?"50%":"25%","691182c8":h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:s,formatUnixTimeStamp:o}}=Z.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),h=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),p=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:o(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:S=>{l("navigation-click",S)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),f=t.ref(),{isTruncated:i}=Z.useTruncationDetector(f);return(S,b)=>{const m=t.resolveComponent("KLabel"),y=t.resolveComponent("KBadge"),_=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",un,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(S.$slots,"label",{item:e.item},()=>[t.createVNode(m,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(S.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,mn)]),key:"0"}:void 0]),1024)],!0)],8,fn),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(S.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",kn,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(I,B)=>(t.openBlock(),t.createBlock(y,{key:`${e.item.key}-badge-tag-${B}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${B}`,tooltip:I,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(I),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,bn)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(I,B)=>(t.openBlock(),t.createBlock(t.unref(Et),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${B}`,"data-testid":`${e.item.key}-copy-uuid-${B}`,uuid:I}),null,16,["data-testid","uuid"]))),128))],8,Cn)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(I,B)=>(t.openBlock(),t.createBlock(y,{key:`${e.item.key}-badge-method-${B}`,appearance:Object.values(t.unref(ur.BadgeMethodAppearances)).includes(I.toLowerCase())?I.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${B}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(I),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,wn)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${a.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(I,B)=>(t.openBlock(),t.createBlock(Ft,{key:`json-array-item-${B}`,index:B,"is-array-item":"",item:I},null,8,["index","item"]))),128))],8,_n)):(t.openBlock(),t.createBlock(_,{key:4,label:t.unref(i)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:f,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,yn))],!0)],8,gn)])}}}),Ge=ne(xn,[["__scopeId","data-v-9c87856b"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ot(e){return typeof e>"u"||e===null}function Nn(e){return typeof e=="object"&&e!==null}function Vn(e){return Array.isArray(e)?e:Ot(e)?[]:[e]}function In(e,r){var a,l,n,s;if(r)for(s=Object.keys(r),a=0,l=s.length;a<l;a+=1)n=s[a],e[n]=r[n];return e}function Bn(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function Tn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Hn=Ot,An=Nn,En=Vn,Fn=Bn,On=Tn,qn=In,Y={isNothing:Hn,isObject:An,toArray:En,repeat:Fn,isNegativeZero:On,extend:qn};function qt(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
2
2
 
3
- `+e.mark.snippet),r+" "+a):r}function Ie(e,l){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=l,this.message=Ot(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ie.prototype=Object.create(Error.prototype),Ie.prototype.constructor=Ie,Ie.prototype.toString=function(e){return this.name+": "+Ot(this,e)};var ae=Ie;function Ge(e,l,a,r,o){var s="",c="",h=Math.floor(o/2)-1;return r-l>h&&(s=" ... ",l=r-h+s.length),a-r>h&&(c=" ...",a=r+h-c.length),{str:s+e.slice(l,a).replace(/\t/g,"→")+c,pos:r-l+s.length}}function Xe(e,l){return Q.repeat(" ",l-e.length)+e}function Uo(e,l){if(l=Object.create(l||null),!e.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);for(var a=/\r?\n|\r|\0/g,r=[0],o=[],s,c=-1;s=a.exec(e.buffer);)o.push(s.index),r.push(s.index+s[0].length),e.position<=s.index&&c<0&&(c=r.length-2);c<0&&(c=r.length-1);var h="",i,d,u=Math.min(e.line+l.linesAfter,o.length).toString().length,p=l.maxLength-(l.indent+u+3);for(i=1;i<=l.linesBefore&&!(c-i<0);i++)d=Ge(e.buffer,r[c-i],o[c-i],e.position-(r[c]-r[c-i]),p),h=Q.repeat(" ",l.indent)+Xe((e.line-i+1).toString(),u)+" | "+d.str+`
4
- `+h;for(d=Ge(e.buffer,r[c],o[c],e.position,p),h+=Q.repeat(" ",l.indent)+Xe((e.line+1).toString(),u)+" | "+d.str+`
5
- `,h+=Q.repeat("-",l.indent+u+3+d.pos)+`^
6
- `,i=1;i<=l.linesAfter&&!(c+i>=o.length);i++)d=Ge(e.buffer,r[c+i],o[c+i],e.position-(r[c]-r[c+i]),p),h+=Q.repeat(" ",l.indent)+Xe((e.line+i+1).toString(),u)+" | "+d.str+`
7
- `;return h.replace(/\n$/,"")}var $o=Uo,vo=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Do=["scalar","sequence","mapping"];function Mo(e){var l={};return e!==null&&Object.keys(e).forEach(function(a){e[a].forEach(function(r){l[String(r)]=a})}),l}function jo(e,l){if(l=l||{},Object.keys(l).forEach(function(a){if(vo.indexOf(a)===-1)throw new ae('Unknown option "'+a+'" is met in definition of "'+e+'" YAML type.')}),this.options=l,this.tag=e,this.kind=l.kind||null,this.resolve=l.resolve||function(){return!0},this.construct=l.construct||function(a){return a},this.instanceOf=l.instanceOf||null,this.predicate=l.predicate||null,this.represent=l.represent||null,this.representName=l.representName||null,this.defaultStyle=l.defaultStyle||null,this.multi=l.multi||!1,this.styleAliases=Mo(l.styleAliases||null),Do.indexOf(this.kind)===-1)throw new ae('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Z=jo;function qt(e,l){var a=[];return e[l].forEach(function(r){var o=a.length;a.forEach(function(s,c){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(o=c)}),a[o]=r}),a}function Ko(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},l,a;function r(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(l=0,a=arguments.length;l<a;l+=1)arguments[l].forEach(r);return e}function et(e){return this.extend(e)}et.prototype.extend=function(e){var l=[],a=[];if(e instanceof Z)a.push(e);else if(Array.isArray(e))a=a.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(l=l.concat(e.implicit)),e.explicit&&(a=a.concat(e.explicit));else throw new ae("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");l.forEach(function(o){if(!(o instanceof Z))throw new ae("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new ae("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new ae("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),a.forEach(function(o){if(!(o instanceof Z))throw new ae("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(et.prototype);return r.implicit=(this.implicit||[]).concat(l),r.explicit=(this.explicit||[]).concat(a),r.compiledImplicit=qt(r,"implicit"),r.compiledExplicit=qt(r,"explicit"),r.compiledTypeMap=Ko(r.compiledImplicit,r.compiledExplicit),r};var Ut=et,$t=new Z("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),vt=new Z("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Dt=new Z("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Mt=new Ut({explicit:[$t,vt,Dt]});function Po(e){if(e===null)return!0;var l=e.length;return l===1&&e==="~"||l===4&&(e==="null"||e==="Null"||e==="NULL")}function Lo(){return null}function Ro(e){return e===null}var jt=new Z("tag:yaml.org,2002:null",{kind:"scalar",resolve:Po,construct:Lo,predicate:Ro,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function zo(e){if(e===null)return!1;var l=e.length;return l===4&&(e==="true"||e==="True"||e==="TRUE")||l===5&&(e==="false"||e==="False"||e==="FALSE")}function Jo(e){return e==="true"||e==="True"||e==="TRUE"}function Wo(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Kt=new Z("tag:yaml.org,2002:bool",{kind:"scalar",resolve:zo,construct:Jo,predicate:Wo,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Qo(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Yo(e){return 48<=e&&e<=55}function Zo(e){return 48<=e&&e<=57}function Go(e){if(e===null)return!1;var l=e.length,a=0,r=!1,o;if(!l)return!1;if(o=e[a],(o==="-"||o==="+")&&(o=e[++a]),o==="0"){if(a+1===l)return!0;if(o=e[++a],o==="b"){for(a++;a<l;a++)if(o=e[a],o!=="_"){if(o!=="0"&&o!=="1")return!1;r=!0}return r&&o!=="_"}if(o==="x"){for(a++;a<l;a++)if(o=e[a],o!=="_"){if(!Qo(e.charCodeAt(a)))return!1;r=!0}return r&&o!=="_"}if(o==="o"){for(a++;a<l;a++)if(o=e[a],o!=="_"){if(!Yo(e.charCodeAt(a)))return!1;r=!0}return r&&o!=="_"}}if(o==="_")return!1;for(;a<l;a++)if(o=e[a],o!=="_"){if(!Zo(e.charCodeAt(a)))return!1;r=!0}return!(!r||o==="_")}function Xo(e){var l=e,a=1,r;if(l.indexOf("_")!==-1&&(l=l.replace(/_/g,"")),r=l[0],(r==="-"||r==="+")&&(r==="-"&&(a=-1),l=l.slice(1),r=l[0]),l==="0")return 0;if(r==="0"){if(l[1]==="b")return a*parseInt(l.slice(2),2);if(l[1]==="x")return a*parseInt(l.slice(2),16);if(l[1]==="o")return a*parseInt(l.slice(2),8)}return a*parseInt(l,10)}function en(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Q.isNegativeZero(e)}var Pt=new Z("tag:yaml.org,2002:int",{kind:"scalar",resolve:Go,construct:Xo,predicate:en,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),tn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function an(e){return!(e===null||!tn.test(e)||e[e.length-1]==="_")}function ln(e){var l,a;return l=e.replace(/_/g,"").toLowerCase(),a=l[0]==="-"?-1:1,"+-".indexOf(l[0])>=0&&(l=l.slice(1)),l===".inf"?a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:l===".nan"?NaN:a*parseFloat(l,10)}var rn=/^[-+]?[0-9]+e/;function on(e,l){var a;if(isNaN(e))switch(l){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(l){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(l){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Q.isNegativeZero(e))return"-0.0";return a=e.toString(10),rn.test(a)?a.replace("e",".e"):a}function nn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Q.isNegativeZero(e))}var Lt=new Z("tag:yaml.org,2002:float",{kind:"scalar",resolve:an,construct:ln,predicate:nn,represent:on,defaultStyle:"lowercase"}),Rt=Mt.extend({implicit:[jt,Kt,Pt,Lt]}),zt=Rt,Jt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Wt=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 sn(e){return e===null?!1:Jt.exec(e)!==null||Wt.exec(e)!==null}function cn(e){var l,a,r,o,s,c,h,i=0,d=null,u,p,n;if(l=Jt.exec(e),l===null&&(l=Wt.exec(e)),l===null)throw new Error("Date resolve error");if(a=+l[1],r=+l[2]-1,o=+l[3],!l[4])return new Date(Date.UTC(a,r,o));if(s=+l[4],c=+l[5],h=+l[6],l[7]){for(i=l[7].slice(0,3);i.length<3;)i+="0";i=+i}return l[9]&&(u=+l[10],p=+(l[11]||0),d=(u*60+p)*6e4,l[9]==="-"&&(d=-d)),n=new Date(Date.UTC(a,r,o,s,c,h,i)),d&&n.setTime(n.getTime()-d),n}function dn(e){return e.toISOString()}var Qt=new Z("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:sn,construct:cn,instanceOf:Date,represent:dn});function hn(e){return e==="<<"||e===null}var Yt=new Z("tag:yaml.org,2002:merge",{kind:"scalar",resolve:hn}),tt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
- \r`;function pn(e){if(e===null)return!1;var l,a,r=0,o=e.length,s=tt;for(a=0;a<o;a++)if(l=s.indexOf(e.charAt(a)),!(l>64)){if(l<0)return!1;r+=6}return r%8===0}function un(e){var l,a,r=e.replace(/[\r\n=]/g,""),o=r.length,s=tt,c=0,h=[];for(l=0;l<o;l++)l%4===0&&l&&(h.push(c>>16&255),h.push(c>>8&255),h.push(c&255)),c=c<<6|s.indexOf(r.charAt(l));return a=o%4*6,a===0?(h.push(c>>16&255),h.push(c>>8&255),h.push(c&255)):a===18?(h.push(c>>10&255),h.push(c>>2&255)):a===12&&h.push(c>>4&255),new Uint8Array(h)}function fn(e){var l="",a=0,r,o,s=e.length,c=tt;for(r=0;r<s;r++)r%3===0&&r&&(l+=c[a>>18&63],l+=c[a>>12&63],l+=c[a>>6&63],l+=c[a&63]),a=(a<<8)+e[r];return o=s%3,o===0?(l+=c[a>>18&63],l+=c[a>>12&63],l+=c[a>>6&63],l+=c[a&63]):o===2?(l+=c[a>>10&63],l+=c[a>>4&63],l+=c[a<<2&63],l+=c[64]):o===1&&(l+=c[a>>2&63],l+=c[a<<4&63],l+=c[64],l+=c[64]),l}function mn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Zt=new Z("tag:yaml.org,2002:binary",{kind:"scalar",resolve:pn,construct:un,predicate:mn,represent:fn}),gn=Object.prototype.hasOwnProperty,yn=Object.prototype.toString;function kn(e){if(e===null)return!0;var l=[],a,r,o,s,c,h=e;for(a=0,r=h.length;a<r;a+=1){if(o=h[a],c=!1,yn.call(o)!=="[object Object]")return!1;for(s in o)if(gn.call(o,s))if(!c)c=!0;else return!1;if(!c)return!1;if(l.indexOf(s)===-1)l.push(s);else return!1}return!0}function bn(e){return e!==null?e:[]}var Gt=new Z("tag:yaml.org,2002:omap",{kind:"sequence",resolve:kn,construct:bn}),Cn=Object.prototype.toString;function wn(e){if(e===null)return!0;var l,a,r,o,s,c=e;for(s=new Array(c.length),l=0,a=c.length;l<a;l+=1){if(r=c[l],Cn.call(r)!=="[object Object]"||(o=Object.keys(r),o.length!==1))return!1;s[l]=[o[0],r[o[0]]]}return!0}function _n(e){if(e===null)return[];var l,a,r,o,s,c=e;for(s=new Array(c.length),l=0,a=c.length;l<a;l+=1)r=c[l],o=Object.keys(r),s[l]=[o[0],r[o[0]]];return s}var Xt=new Z("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:wn,construct:_n}),Sn=Object.prototype.hasOwnProperty;function xn(e){if(e===null)return!0;var l,a=e;for(l in a)if(Sn.call(a,l)&&a[l]!==null)return!1;return!0}function Nn(e){return e!==null?e:{}}var ea=new Z("tag:yaml.org,2002:set",{kind:"mapping",resolve:xn,construct:Nn}),at=zt.extend({implicit:[Qt,Yt],explicit:[Zt,Gt,Xt,ea]}),pe=Object.prototype.hasOwnProperty,qe=1,ta=2,aa=3,Ue=4,lt=1,Vn=2,la=3,Bn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,In=/[\x85\u2028\u2029]/,Tn=/[,\[\]\{\}]/,ra=/^(?:!|!!|![a-z\-]+!)$/i,oa=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function na(e){return Object.prototype.toString.call(e)}function ne(e){return e===10||e===13}function fe(e){return e===9||e===32}function le(e){return e===9||e===32||e===10||e===13}function ge(e){return e===44||e===91||e===93||e===123||e===125}function Hn(e){var l;return 48<=e&&e<=57?e-48:(l=e|32,97<=l&&l<=102?l-97+10:-1)}function En(e){return e===120?2:e===117?4:e===85?8:0}function An(e){return 48<=e&&e<=57?e-48:-1}function sa(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Fn(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ia=new Array(256),ca=new Array(256),ye=0;ye<256;ye++)ia[ye]=sa(ye)?1:0,ca[ye]=sa(ye);function On(e,l){this.input=e,this.filename=l.filename||null,this.schema=l.schema||at,this.onWarning=l.onWarning||null,this.legacy=l.legacy||!1,this.json=l.json||!1,this.listener=l.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function da(e,l){var a={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return a.snippet=$o(a),new ae(l,a)}function E(e,l){throw da(e,l)}function $e(e,l){e.onWarning&&e.onWarning.call(null,da(e,l))}var ha={YAML:function(e,l,a){var r,o,s;e.version!==null&&E(e,"duplication of %YAML directive"),a.length!==1&&E(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(a[0]),r===null&&E(e,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&E(e,"unacceptable YAML version of the document"),e.version=a[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&$e(e,"unsupported YAML version of the document")},TAG:function(e,l,a){var r,o;a.length!==2&&E(e,"TAG directive accepts exactly two arguments"),r=a[0],o=a[1],ra.test(r)||E(e,"ill-formed tag handle (first argument) of the TAG directive"),pe.call(e.tagMap,r)&&E(e,'there is a previously declared suffix for "'+r+'" tag handle'),oa.test(o)||E(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{E(e,"tag prefix is malformed: "+o)}e.tagMap[r]=o}};function ue(e,l,a,r){var o,s,c,h;if(l<a){if(h=e.input.slice(l,a),r)for(o=0,s=h.length;o<s;o+=1)c=h.charCodeAt(o),c===9||32<=c&&c<=1114111||E(e,"expected valid JSON character");else Bn.test(h)&&E(e,"the stream contains non-printable characters");e.result+=h}}function pa(e,l,a,r){var o,s,c,h;for(Q.isObject(a)||E(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(a),c=0,h=o.length;c<h;c+=1)s=o[c],pe.call(l,s)||(l[s]=a[s],r[s]=!0)}function ke(e,l,a,r,o,s,c,h,i){var d,u;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),d=0,u=o.length;d<u;d+=1)Array.isArray(o[d])&&E(e,"nested arrays are not supported inside keys"),typeof o=="object"&&na(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&na(o)==="[object Object]"&&(o="[object Object]"),o=String(o),l===null&&(l={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,u=s.length;d<u;d+=1)pa(e,l,s[d],a);else pa(e,l,s,a);else!e.json&&!pe.call(a,o)&&pe.call(l,o)&&(e.line=c||e.line,e.lineStart=h||e.lineStart,e.position=i||e.position,E(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(l,o,{configurable:!0,enumerable:!0,writable:!0,value:s}):l[o]=s,delete a[o];return l}function rt(e){var l;l=e.input.charCodeAt(e.position),l===10?e.position++:l===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):E(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function W(e,l,a){for(var r=0,o=e.input.charCodeAt(e.position);o!==0;){for(;fe(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(l&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(ne(o))for(rt(e),o=e.input.charCodeAt(e.position),r++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return a!==-1&&r!==0&&e.lineIndent<a&&$e(e,"deficient indentation"),r}function ve(e){var l=e.position,a;return a=e.input.charCodeAt(l),!!((a===45||a===46)&&a===e.input.charCodeAt(l+1)&&a===e.input.charCodeAt(l+2)&&(l+=3,a=e.input.charCodeAt(l),a===0||le(a)))}function ot(e,l){l===1?e.result+=" ":l>1&&(e.result+=Q.repeat(`
10
- `,l-1))}function qn(e,l,a){var r,o,s,c,h,i,d,u,p=e.kind,n=e.result,k;if(k=e.input.charCodeAt(e.position),le(k)||ge(k)||k===35||k===38||k===42||k===33||k===124||k===62||k===39||k===34||k===37||k===64||k===96||(k===63||k===45)&&(o=e.input.charCodeAt(e.position+1),le(o)||a&&ge(o)))return!1;for(e.kind="scalar",e.result="",s=c=e.position,h=!1;k!==0;){if(k===58){if(o=e.input.charCodeAt(e.position+1),le(o)||a&&ge(o))break}else if(k===35){if(r=e.input.charCodeAt(e.position-1),le(r))break}else{if(e.position===e.lineStart&&ve(e)||a&&ge(k))break;if(ne(k))if(i=e.line,d=e.lineStart,u=e.lineIndent,W(e,!1,-1),e.lineIndent>=l){h=!0,k=e.input.charCodeAt(e.position);continue}else{e.position=c,e.line=i,e.lineStart=d,e.lineIndent=u;break}}h&&(ue(e,s,c,!1),ot(e,e.line-i),s=c=e.position,h=!1),fe(k)||(c=e.position+1),k=e.input.charCodeAt(++e.position)}return ue(e,s,c,!1),e.result?!0:(e.kind=p,e.result=n,!1)}function Un(e,l){var a,r,o;if(a=e.input.charCodeAt(e.position),a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(ue(e,r,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)r=e.position,e.position++,o=e.position;else return!0;else ne(a)?(ue(e,r,o,!0),ot(e,W(e,!1,l)),r=o=e.position):e.position===e.lineStart&&ve(e)?E(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);E(e,"unexpected end of the stream within a single quoted scalar")}function $n(e,l){var a,r,o,s,c,h;if(h=e.input.charCodeAt(e.position),h!==34)return!1;for(e.kind="scalar",e.result="",e.position++,a=r=e.position;(h=e.input.charCodeAt(e.position))!==0;){if(h===34)return ue(e,a,e.position,!0),e.position++,!0;if(h===92){if(ue(e,a,e.position,!0),h=e.input.charCodeAt(++e.position),ne(h))W(e,!1,l);else if(h<256&&ia[h])e.result+=ca[h],e.position++;else if((c=En(h))>0){for(o=c,s=0;o>0;o--)h=e.input.charCodeAt(++e.position),(c=Hn(h))>=0?s=(s<<4)+c:E(e,"expected hexadecimal character");e.result+=Fn(s),e.position++}else E(e,"unknown escape sequence");a=r=e.position}else ne(h)?(ue(e,a,r,!0),ot(e,W(e,!1,l)),a=r=e.position):e.position===e.lineStart&&ve(e)?E(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}E(e,"unexpected end of the stream within a double quoted scalar")}function vn(e,l){var a=!0,r,o,s,c=e.tag,h,i=e.anchor,d,u,p,n,k,w=Object.create(null),f,m,N,C;if(C=e.input.charCodeAt(e.position),C===91)u=93,k=!1,h=[];else if(C===123)u=125,k=!0,h={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),C=e.input.charCodeAt(++e.position);C!==0;){if(W(e,!0,l),C=e.input.charCodeAt(e.position),C===u)return e.position++,e.tag=c,e.anchor=i,e.kind=k?"mapping":"sequence",e.result=h,!0;a?C===44&&E(e,"expected the node content, but found ','"):E(e,"missed comma between flow collection entries"),m=f=N=null,p=n=!1,C===63&&(d=e.input.charCodeAt(e.position+1),le(d)&&(p=n=!0,e.position++,W(e,!0,l))),r=e.line,o=e.lineStart,s=e.position,be(e,l,qe,!1,!0),m=e.tag,f=e.result,W(e,!0,l),C=e.input.charCodeAt(e.position),(n||e.line===r)&&C===58&&(p=!0,C=e.input.charCodeAt(++e.position),W(e,!0,l),be(e,l,qe,!1,!0),N=e.result),k?ke(e,h,w,m,f,N,r,o,s):p?h.push(ke(e,null,w,m,f,N,r,o,s)):h.push(f),W(e,!0,l),C=e.input.charCodeAt(e.position),C===44?(a=!0,C=e.input.charCodeAt(++e.position)):a=!1}E(e,"unexpected end of the stream within a flow collection")}function Dn(e,l){var a,r,o=lt,s=!1,c=!1,h=l,i=0,d=!1,u,p;if(p=e.input.charCodeAt(e.position),p===124)r=!1;else if(p===62)r=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)lt===o?o=p===43?la:Vn:E(e,"repeat of a chomping mode identifier");else if((u=An(p))>=0)u===0?E(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?E(e,"repeat of an indentation width identifier"):(h=l+u-1,c=!0);else break;if(fe(p)){do p=e.input.charCodeAt(++e.position);while(fe(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!ne(p)&&p!==0)}for(;p!==0;){for(rt(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!c||e.lineIndent<h)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>h&&(h=e.lineIndent),ne(p)){i++;continue}if(e.lineIndent<h){o===la?e.result+=Q.repeat(`
11
- `,s?1+i:i):o===lt&&s&&(e.result+=`
12
- `);break}for(r?fe(p)?(d=!0,e.result+=Q.repeat(`
13
- `,s?1+i:i)):d?(d=!1,e.result+=Q.repeat(`
14
- `,i+1)):i===0?s&&(e.result+=" "):e.result+=Q.repeat(`
15
- `,i):e.result+=Q.repeat(`
16
- `,s?1+i:i),s=!0,c=!0,i=0,a=e.position;!ne(p)&&p!==0;)p=e.input.charCodeAt(++e.position);ue(e,a,e.position,!1)}return!0}function ua(e,l){var a,r=e.tag,o=e.anchor,s=[],c,h=!1,i;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),i=e.input.charCodeAt(e.position);i!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,E(e,"tab characters must not be used in indentation")),!(i!==45||(c=e.input.charCodeAt(e.position+1),!le(c))));){if(h=!0,e.position++,W(e,!0,-1)&&e.lineIndent<=l){s.push(null),i=e.input.charCodeAt(e.position);continue}if(a=e.line,be(e,l,aa,!1,!0),s.push(e.result),W(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>l)&&i!==0)E(e,"bad indentation of a sequence entry");else if(e.lineIndent<l)break}return h?(e.tag=r,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function Mn(e,l,a){var r,o,s,c,h,i,d=e.tag,u=e.anchor,p={},n=Object.create(null),k=null,w=null,f=null,m=!1,N=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),C=e.input.charCodeAt(e.position);C!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,E(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&le(r))C===63?(m&&(ke(e,p,n,k,w,null,c,h,i),k=w=f=null),N=!0,m=!0,o=!0):m?(m=!1,o=!0):E(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=r;else{if(c=e.line,h=e.lineStart,i=e.position,!be(e,a,ta,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);fe(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),le(C)||E(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(ke(e,p,n,k,w,null,c,h,i),k=w=f=null),N=!0,m=!1,o=!1,k=e.tag,w=e.result;else if(N)E(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=u,!0}else if(N)E(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=u,!0}if((e.line===s||e.lineIndent>l)&&(m&&(c=e.line,h=e.lineStart,i=e.position),be(e,l,Ue,!0,o)&&(m?w=e.result:f=e.result),m||(ke(e,p,n,k,w,f,c,h,i),k=w=f=null),W(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>l)&&C!==0)E(e,"bad indentation of a mapping entry");else if(e.lineIndent<l)break}return m&&ke(e,p,n,k,w,null,c,h,i),N&&(e.tag=d,e.anchor=u,e.kind="mapping",e.result=p),N}function jn(e){var l,a=!1,r=!1,o,s,c;if(c=e.input.charCodeAt(e.position),c!==33)return!1;if(e.tag!==null&&E(e,"duplication of a tag property"),c=e.input.charCodeAt(++e.position),c===60?(a=!0,c=e.input.charCodeAt(++e.position)):c===33?(r=!0,o="!!",c=e.input.charCodeAt(++e.position)):o="!",l=e.position,a){do c=e.input.charCodeAt(++e.position);while(c!==0&&c!==62);e.position<e.length?(s=e.input.slice(l,e.position),c=e.input.charCodeAt(++e.position)):E(e,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!le(c);)c===33&&(r?E(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(l-1,e.position+1),ra.test(o)||E(e,"named tag handle cannot contain such characters"),r=!0,l=e.position+1)),c=e.input.charCodeAt(++e.position);s=e.input.slice(l,e.position),Tn.test(s)&&E(e,"tag suffix cannot contain flow indicator characters")}s&&!oa.test(s)&&E(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{E(e,"tag name is malformed: "+s)}return a?e.tag=s:pe.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:E(e,'undeclared tag handle "'+o+'"'),!0}function Kn(e){var l,a;if(a=e.input.charCodeAt(e.position),a!==38)return!1;for(e.anchor!==null&&E(e,"duplication of an anchor property"),a=e.input.charCodeAt(++e.position),l=e.position;a!==0&&!le(a)&&!ge(a);)a=e.input.charCodeAt(++e.position);return e.position===l&&E(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(l,e.position),!0}function Pn(e){var l,a,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),l=e.position;r!==0&&!le(r)&&!ge(r);)r=e.input.charCodeAt(++e.position);return e.position===l&&E(e,"name of an alias node must contain at least one character"),a=e.input.slice(l,e.position),pe.call(e.anchorMap,a)||E(e,'unidentified alias "'+a+'"'),e.result=e.anchorMap[a],W(e,!0,-1),!0}function be(e,l,a,r,o){var s,c,h,i=1,d=!1,u=!1,p,n,k,w,f,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=c=h=Ue===a||aa===a,r&&W(e,!0,-1)&&(d=!0,e.lineIndent>l?i=1:e.lineIndent===l?i=0:e.lineIndent<l&&(i=-1)),i===1)for(;jn(e)||Kn(e);)W(e,!0,-1)?(d=!0,h=s,e.lineIndent>l?i=1:e.lineIndent===l?i=0:e.lineIndent<l&&(i=-1)):h=!1;if(h&&(h=d||o),(i===1||Ue===a)&&(qe===a||ta===a?f=l:f=l+1,m=e.position-e.lineStart,i===1?h&&(ua(e,m)||Mn(e,m,f))||vn(e,f)?u=!0:(c&&Dn(e,f)||Un(e,f)||$n(e,f)?u=!0:Pn(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&E(e,"alias node should not have any properties")):qn(e,f,qe===a)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):i===0&&(u=h&&ua(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&E(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,n=e.implicitTypes.length;p<n;p+=1)if(w=e.implicitTypes[p],w.resolve(e.result)){e.result=w.construct(e.result),e.tag=w.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(pe.call(e.typeMap[e.kind||"fallback"],e.tag))w=e.typeMap[e.kind||"fallback"][e.tag];else for(w=null,k=e.typeMap.multi[e.kind||"fallback"],p=0,n=k.length;p<n;p+=1)if(e.tag.slice(0,k[p].tag.length)===k[p].tag){w=k[p];break}w||E(e,"unknown tag !<"+e.tag+">"),e.result!==null&&w.kind!==e.kind&&E(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+w.kind+'", not "'+e.kind+'"'),w.resolve(e.result,e.tag)?(e.result=w.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):E(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function Ln(e){var l=e.position,a,r,o,s=!1,c;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(c=e.input.charCodeAt(e.position))!==0&&(W(e,!0,-1),c=e.input.charCodeAt(e.position),!(e.lineIndent>0||c!==37));){for(s=!0,c=e.input.charCodeAt(++e.position),a=e.position;c!==0&&!le(c);)c=e.input.charCodeAt(++e.position);for(r=e.input.slice(a,e.position),o=[],r.length<1&&E(e,"directive name must not be less than one character in length");c!==0;){for(;fe(c);)c=e.input.charCodeAt(++e.position);if(c===35){do c=e.input.charCodeAt(++e.position);while(c!==0&&!ne(c));break}if(ne(c))break;for(a=e.position;c!==0&&!le(c);)c=e.input.charCodeAt(++e.position);o.push(e.input.slice(a,e.position))}c!==0&&rt(e),pe.call(ha,r)?ha[r](e,r,o):$e(e,'unknown document directive "'+r+'"')}if(W(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,W(e,!0,-1)):s&&E(e,"directives end mark is expected"),be(e,e.lineIndent-1,Ue,!1,!0),W(e,!0,-1),e.checkLineBreaks&&In.test(e.input.slice(l,e.position))&&$e(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ve(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,W(e,!0,-1));return}if(e.position<e.length-1)E(e,"end of the stream or a document separator is expected");else return}function fa(e,l){e=String(e),l=l||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var a=new On(e,l),r=e.indexOf("\0");for(r!==-1&&(a.position=r,E(a,"null byte is not allowed in input")),a.input+="\0";a.input.charCodeAt(a.position)===32;)a.lineIndent+=1,a.position+=1;for(;a.position<a.length-1;)Ln(a);return a.documents}function Rn(e,l,a){l!==null&&typeof l=="object"&&typeof a>"u"&&(a=l,l=null);var r=fa(e,a);if(typeof l!="function")return r;for(var o=0,s=r.length;o<s;o+=1)l(r[o])}function zn(e,l){var a=fa(e,l);if(a.length!==0){if(a.length===1)return a[0];throw new ae("expected a single document in the stream, but found more")}}var Jn=Rn,Wn=zn,ma={loadAll:Jn,load:Wn},ga=Object.prototype.toString,ya=Object.prototype.hasOwnProperty,nt=65279,Qn=9,Te=10,Yn=13,Zn=32,Gn=33,Xn=34,st=35,es=37,ts=38,as=39,ls=42,ka=44,rs=45,De=58,os=61,ns=62,ss=63,is=64,ba=91,Ca=93,cs=96,wa=123,ds=124,_a=125,X={};X[0]="\\0",X[7]="\\a",X[8]="\\b",X[9]="\\t",X[10]="\\n",X[11]="\\v",X[12]="\\f",X[13]="\\r",X[27]="\\e",X[34]='\\"',X[92]="\\\\",X[133]="\\N",X[160]="\\_",X[8232]="\\L",X[8233]="\\P";var hs=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ps=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function us(e,l){var a,r,o,s,c,h,i;if(l===null)return{};for(a={},r=Object.keys(l),o=0,s=r.length;o<s;o+=1)c=r[o],h=String(l[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),i=e.compiledTypeMap.fallback[c],i&&ya.call(i.styleAliases,h)&&(h=i.styleAliases[h]),a[c]=h;return a}function fs(e){var l,a,r;if(l=e.toString(16).toUpperCase(),e<=255)a="x",r=2;else if(e<=65535)a="u",r=4;else if(e<=4294967295)a="U",r=8;else throw new ae("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+Q.repeat("0",r-l.length)+l}var ms=1,He=2;function gs(e){this.schema=e.schema||at,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Q.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=us(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?He:ms,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Sa(e,l){for(var a=Q.repeat(" ",l),r=0,o=-1,s="",c,h=e.length;r<h;)o=e.indexOf(`
18
- `,r),o===-1?(c=e.slice(r),r=h):(c=e.slice(r,o+1),r=o+1),c.length&&c!==`
19
- `&&(s+=a),s+=c;return s}function it(e,l){return`
20
- `+Q.repeat(" ",e.indent*l)}function ys(e,l){var a,r,o;for(a=0,r=e.implicitTypes.length;a<r;a+=1)if(o=e.implicitTypes[a],o.resolve(l))return!0;return!1}function Me(e){return e===Zn||e===Qn}function Ee(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==nt||65536<=e&&e<=1114111}function xa(e){return Ee(e)&&e!==nt&&e!==Yn&&e!==Te}function Na(e,l,a){var r=xa(e),o=r&&!Me(e);return(a?r:r&&e!==ka&&e!==ba&&e!==Ca&&e!==wa&&e!==_a)&&e!==st&&!(l===De&&!o)||xa(l)&&!Me(l)&&e===st||l===De&&o}function ks(e){return Ee(e)&&e!==nt&&!Me(e)&&e!==rs&&e!==ss&&e!==De&&e!==ka&&e!==ba&&e!==Ca&&e!==wa&&e!==_a&&e!==st&&e!==ts&&e!==ls&&e!==Gn&&e!==ds&&e!==os&&e!==ns&&e!==as&&e!==Xn&&e!==es&&e!==is&&e!==cs}function bs(e){return!Me(e)&&e!==De}function Ae(e,l){var a=e.charCodeAt(l),r;return a>=55296&&a<=56319&&l+1<e.length&&(r=e.charCodeAt(l+1),r>=56320&&r<=57343)?(a-55296)*1024+r-56320+65536:a}function Va(e){var l=/^\n* /;return l.test(e)}var Ba=1,ct=2,Ia=3,Ta=4,Ce=5;function Cs(e,l,a,r,o,s,c,h){var i,d=0,u=null,p=!1,n=!1,k=r!==-1,w=-1,f=ks(Ae(e,0))&&bs(Ae(e,e.length-1));if(l||c)for(i=0;i<e.length;d>=65536?i+=2:i++){if(d=Ae(e,i),!Ee(d))return Ce;f=f&&Na(d,u,h),u=d}else{for(i=0;i<e.length;d>=65536?i+=2:i++){if(d=Ae(e,i),d===Te)p=!0,k&&(n=n||i-w-1>r&&e[w+1]!==" ",w=i);else if(!Ee(d))return Ce;f=f&&Na(d,u,h),u=d}n=n||k&&i-w-1>r&&e[w+1]!==" "}return!p&&!n?f&&!c&&!o(e)?Ba:s===He?Ce:ct:a>9&&Va(e)?Ce:c?s===He?Ce:ct:n?Ta:Ia}function ws(e,l,a,r,o){e.dump=function(){if(l.length===0)return e.quotingType===He?'""':"''";if(!e.noCompatMode&&(hs.indexOf(l)!==-1||ps.test(l)))return e.quotingType===He?'"'+l+'"':"'"+l+"'";var s=e.indent*Math.max(1,a),c=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),h=r||e.flowLevel>-1&&a>=e.flowLevel;function i(d){return ys(e,d)}switch(Cs(l,h,e.indent,c,i,e.quotingType,e.forceQuotes&&!r,o)){case Ba:return l;case ct:return"'"+l.replace(/'/g,"''")+"'";case Ia:return"|"+Ha(l,e.indent)+Ea(Sa(l,s));case Ta:return">"+Ha(l,e.indent)+Ea(Sa(_s(l,c),s));case Ce:return'"'+Ss(l)+'"';default:throw new ae("impossible error: invalid scalar style")}}()}function Ha(e,l){var a=Va(e)?String(l):"",r=e[e.length-1]===`
21
- `,o=r&&(e[e.length-2]===`
3
+ `+e.mark.snippet),l+" "+a):l}function Te(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=qt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Te.prototype=Object.create(Error.prototype),Te.prototype.constructor=Te,Te.prototype.toString=function(e){return this.name+": "+qt(this,e)};var le=Te;function Xe(e,r,a,l,n){var s="",o="",d=Math.floor(n/2)-1;return l-r>d&&(s=" ... ",r=l-d+s.length),a-l>d&&(o=" ...",a=l+d-o.length),{str:s+e.slice(r,a).replace(/\t/g,"→")+o,pos:l-r+s.length}}function et(e,r){return Y.repeat(" ",r-e.length)+e}function Un(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var a=/\r?\n|\r|\0/g,l=[0],n=[],s,o=-1;s=a.exec(e.buffer);)n.push(s.index),l.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=l.length-2);o<0&&(o=l.length-1);var d="",c,h,p=Math.min(e.line+r.linesAfter,n.length).toString().length,u=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(o-c<0);c++)h=Xe(e.buffer,l[o-c],n[o-c],e.position-(l[o]-l[o-c]),u),d=Y.repeat(" ",r.indent)+et((e.line-c+1).toString(),p)+" | "+h.str+`
4
+ `+d;for(h=Xe(e.buffer,l[o],n[o],e.position,u),d+=Y.repeat(" ",r.indent)+et((e.line+1).toString(),p)+" | "+h.str+`
5
+ `,d+=Y.repeat("-",r.indent+p+3+h.pos)+`^
6
+ `,c=1;c<=r.linesAfter&&!(o+c>=n.length);c++)h=Xe(e.buffer,l[o+c],n[o+c],e.position-(l[o]-l[o+c]),u),d+=Y.repeat(" ",r.indent)+et((e.line+c+1).toString(),p)+" | "+h.str+`
7
+ `;return d.replace(/\n$/,"")}var vn=Un,$n=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Dn=["scalar","sequence","mapping"];function Mn(e){var r={};return e!==null&&Object.keys(e).forEach(function(a){e[a].forEach(function(l){r[String(l)]=a})}),r}function Kn(e,r){if(r=r||{},Object.keys(r).forEach(function(a){if($n.indexOf(a)===-1)throw new le('Unknown option "'+a+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(a){return a},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Mn(r.styleAliases||null),Dn.indexOf(this.kind)===-1)throw new le('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var G=Kn;function Ut(e,r){var a=[];return e[r].forEach(function(l){var n=a.length;a.forEach(function(s,o){s.tag===l.tag&&s.kind===l.kind&&s.multi===l.multi&&(n=o)}),a[n]=l}),a}function jn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,a;function l(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(r=0,a=arguments.length;r<a;r+=1)arguments[r].forEach(l);return e}function tt(e){return this.extend(e)}tt.prototype.extend=function(e){var r=[],a=[];if(e instanceof G)a.push(e);else if(Array.isArray(e))a=a.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(a=a.concat(e.explicit));else throw new le("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(n){if(!(n instanceof G))throw new le("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new le("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new le("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),a.forEach(function(n){if(!(n instanceof G))throw new le("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(tt.prototype);return l.implicit=(this.implicit||[]).concat(r),l.explicit=(this.explicit||[]).concat(a),l.compiledImplicit=Ut(l,"implicit"),l.compiledExplicit=Ut(l,"explicit"),l.compiledTypeMap=jn(l.compiledImplicit,l.compiledExplicit),l};var vt=tt,$t=new G("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Dt=new G("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Mt=new G("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Kt=new vt({explicit:[$t,Dt,Mt]});function Pn(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Ln(){return null}function Rn(e){return e===null}var jt=new G("tag:yaml.org,2002:null",{kind:"scalar",resolve:Pn,construct:Ln,predicate:Rn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function zn(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Jn(e){return e==="true"||e==="True"||e==="TRUE"}function Wn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Pt=new G("tag:yaml.org,2002:bool",{kind:"scalar",resolve:zn,construct:Jn,predicate:Wn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Qn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Yn(e){return 48<=e&&e<=55}function Zn(e){return 48<=e&&e<=57}function Gn(e){if(e===null)return!1;var r=e.length,a=0,l=!1,n;if(!r)return!1;if(n=e[a],(n==="-"||n==="+")&&(n=e[++a]),n==="0"){if(a+1===r)return!0;if(n=e[++a],n==="b"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(n!=="0"&&n!=="1")return!1;l=!0}return l&&n!=="_"}if(n==="x"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Qn(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}if(n==="o"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Yn(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}}if(n==="_")return!1;for(;a<r;a++)if(n=e[a],n!=="_"){if(!Zn(e.charCodeAt(a)))return!1;l=!0}return!(!l||n==="_")}function Xn(e){var r=e,a=1,l;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),l=r[0],(l==="-"||l==="+")&&(l==="-"&&(a=-1),r=r.slice(1),l=r[0]),r==="0")return 0;if(l==="0"){if(r[1]==="b")return a*parseInt(r.slice(2),2);if(r[1]==="x")return a*parseInt(r.slice(2),16);if(r[1]==="o")return a*parseInt(r.slice(2),8)}return a*parseInt(r,10)}function eo(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Y.isNegativeZero(e)}var Lt=new G("tag:yaml.org,2002:int",{kind:"scalar",resolve:Gn,construct:Xn,predicate:eo,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),to=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ao(e){return!(e===null||!to.test(e)||e[e.length-1]==="_")}function lo(e){var r,a;return r=e.replace(/_/g,"").toLowerCase(),a=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:a*parseFloat(r,10)}var ro=/^[-+]?[0-9]+e/;function no(e,r){var a;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Y.isNegativeZero(e))return"-0.0";return a=e.toString(10),ro.test(a)?a.replace("e",".e"):a}function oo(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Y.isNegativeZero(e))}var Rt=new G("tag:yaml.org,2002:float",{kind:"scalar",resolve:ao,construct:lo,predicate:oo,represent:no,defaultStyle:"lowercase"}),zt=Kt.extend({implicit:[jt,Pt,Lt,Rt]}),Jt=zt,Wt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Qt=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 so(e){return e===null?!1:Wt.exec(e)!==null||Qt.exec(e)!==null}function io(e){var r,a,l,n,s,o,d,c=0,h=null,p,u,f;if(r=Wt.exec(e),r===null&&(r=Qt.exec(e)),r===null)throw new Error("Date resolve error");if(a=+r[1],l=+r[2]-1,n=+r[3],!r[4])return new Date(Date.UTC(a,l,n));if(s=+r[4],o=+r[5],d=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(p=+r[10],u=+(r[11]||0),h=(p*60+u)*6e4,r[9]==="-"&&(h=-h)),f=new Date(Date.UTC(a,l,n,s,o,d,c)),h&&f.setTime(f.getTime()-h),f}function co(e){return e.toISOString()}var Yt=new G("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:so,construct:io,instanceOf:Date,represent:co});function ho(e){return e==="<<"||e===null}var Zt=new G("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ho}),at=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
+ \r`;function po(e){if(e===null)return!1;var r,a,l=0,n=e.length,s=at;for(a=0;a<n;a++)if(r=s.indexOf(e.charAt(a)),!(r>64)){if(r<0)return!1;l+=6}return l%8===0}function uo(e){var r,a,l=e.replace(/[\r\n=]/g,""),n=l.length,s=at,o=0,d=[];for(r=0;r<n;r++)r%4===0&&r&&(d.push(o>>16&255),d.push(o>>8&255),d.push(o&255)),o=o<<6|s.indexOf(l.charAt(r));return a=n%4*6,a===0?(d.push(o>>16&255),d.push(o>>8&255),d.push(o&255)):a===18?(d.push(o>>10&255),d.push(o>>2&255)):a===12&&d.push(o>>4&255),new Uint8Array(d)}function fo(e){var r="",a=0,l,n,s=e.length,o=at;for(l=0;l<s;l++)l%3===0&&l&&(r+=o[a>>18&63],r+=o[a>>12&63],r+=o[a>>6&63],r+=o[a&63]),a=(a<<8)+e[l];return n=s%3,n===0?(r+=o[a>>18&63],r+=o[a>>12&63],r+=o[a>>6&63],r+=o[a&63]):n===2?(r+=o[a>>10&63],r+=o[a>>4&63],r+=o[a<<2&63],r+=o[64]):n===1&&(r+=o[a>>2&63],r+=o[a<<4&63],r+=o[64],r+=o[64]),r}function mo(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Gt=new G("tag:yaml.org,2002:binary",{kind:"scalar",resolve:po,construct:uo,predicate:mo,represent:fo}),go=Object.prototype.hasOwnProperty,yo=Object.prototype.toString;function ko(e){if(e===null)return!0;var r=[],a,l,n,s,o,d=e;for(a=0,l=d.length;a<l;a+=1){if(n=d[a],o=!1,yo.call(n)!=="[object Object]")return!1;for(s in n)if(go.call(n,s))if(!o)o=!0;else return!1;if(!o)return!1;if(r.indexOf(s)===-1)r.push(s);else return!1}return!0}function bo(e){return e!==null?e:[]}var Xt=new G("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ko,construct:bo}),Co=Object.prototype.toString;function wo(e){if(e===null)return!0;var r,a,l,n,s,o=e;for(s=new Array(o.length),r=0,a=o.length;r<a;r+=1){if(l=o[r],Co.call(l)!=="[object Object]"||(n=Object.keys(l),n.length!==1))return!1;s[r]=[n[0],l[n[0]]]}return!0}function _o(e){if(e===null)return[];var r,a,l,n,s,o=e;for(s=new Array(o.length),r=0,a=o.length;r<a;r+=1)l=o[r],n=Object.keys(l),s[r]=[n[0],l[n[0]]];return s}var ea=new G("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:wo,construct:_o}),So=Object.prototype.hasOwnProperty;function xo(e){if(e===null)return!0;var r,a=e;for(r in a)if(So.call(a,r)&&a[r]!==null)return!1;return!0}function No(e){return e!==null?e:{}}var ta=new G("tag:yaml.org,2002:set",{kind:"mapping",resolve:xo,construct:No}),lt=Jt.extend({implicit:[Yt,Zt],explicit:[Gt,Xt,ea,ta]}),ue=Object.prototype.hasOwnProperty,Ue=1,aa=2,la=3,ve=4,rt=1,Vo=2,ra=3,Io=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Bo=/[\x85\u2028\u2029]/,To=/[,\[\]\{\}]/,na=/^(?:!|!!|![a-z\-]+!)$/i,oa=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function sa(e){return Object.prototype.toString.call(e)}function se(e){return e===10||e===13}function me(e){return e===9||e===32}function re(e){return e===9||e===32||e===10||e===13}function ye(e){return e===44||e===91||e===93||e===123||e===125}function Ho(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Ao(e){return e===120?2:e===117?4:e===85?8:0}function Eo(e){return 48<=e&&e<=57?e-48:-1}function ia(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Fo(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ca=new Array(256),da=new Array(256),ke=0;ke<256;ke++)ca[ke]=ia(ke)?1:0,da[ke]=ia(ke);function Oo(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||lt,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ha(e,r){var a={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return a.snippet=vn(a),new le(r,a)}function O(e,r){throw ha(e,r)}function $e(e,r){e.onWarning&&e.onWarning.call(null,ha(e,r))}var pa={YAML:function(e,r,a){var l,n,s;e.version!==null&&O(e,"duplication of %YAML directive"),a.length!==1&&O(e,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(a[0]),l===null&&O(e,"ill-formed argument of the YAML directive"),n=parseInt(l[1],10),s=parseInt(l[2],10),n!==1&&O(e,"unacceptable YAML version of the document"),e.version=a[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&$e(e,"unsupported YAML version of the document")},TAG:function(e,r,a){var l,n;a.length!==2&&O(e,"TAG directive accepts exactly two arguments"),l=a[0],n=a[1],na.test(l)||O(e,"ill-formed tag handle (first argument) of the TAG directive"),ue.call(e.tagMap,l)&&O(e,'there is a previously declared suffix for "'+l+'" tag handle'),oa.test(n)||O(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{O(e,"tag prefix is malformed: "+n)}e.tagMap[l]=n}};function fe(e,r,a,l){var n,s,o,d;if(r<a){if(d=e.input.slice(r,a),l)for(n=0,s=d.length;n<s;n+=1)o=d.charCodeAt(n),o===9||32<=o&&o<=1114111||O(e,"expected valid JSON character");else Io.test(d)&&O(e,"the stream contains non-printable characters");e.result+=d}}function ua(e,r,a,l){var n,s,o,d;for(Y.isObject(a)||O(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(a),o=0,d=n.length;o<d;o+=1)s=n[o],ue.call(r,s)||(r[s]=a[s],l[s]=!0)}function be(e,r,a,l,n,s,o,d,c){var h,p;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),h=0,p=n.length;h<p;h+=1)Array.isArray(n[h])&&O(e,"nested arrays are not supported inside keys"),typeof n=="object"&&sa(n[h])==="[object Object]"&&(n[h]="[object Object]");if(typeof n=="object"&&sa(n)==="[object Object]"&&(n="[object Object]"),n=String(n),r===null&&(r={}),l==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(h=0,p=s.length;h<p;h+=1)ua(e,r,s[h],a);else ua(e,r,s,a);else!e.json&&!ue.call(a,n)&&ue.call(r,n)&&(e.line=o||e.line,e.lineStart=d||e.lineStart,e.position=c||e.position,O(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(r,n,{configurable:!0,enumerable:!0,writable:!0,value:s}):r[n]=s,delete a[n];return r}function nt(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):O(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Q(e,r,a){for(var l=0,n=e.input.charCodeAt(e.position);n!==0;){for(;me(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(r&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(se(n))for(nt(e),n=e.input.charCodeAt(e.position),l++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return a!==-1&&l!==0&&e.lineIndent<a&&$e(e,"deficient indentation"),l}function De(e){var r=e.position,a;return a=e.input.charCodeAt(r),!!((a===45||a===46)&&a===e.input.charCodeAt(r+1)&&a===e.input.charCodeAt(r+2)&&(r+=3,a=e.input.charCodeAt(r),a===0||re(a)))}function ot(e,r){r===1?e.result+=" ":r>1&&(e.result+=Y.repeat(`
10
+ `,r-1))}function qo(e,r,a){var l,n,s,o,d,c,h,p,u=e.kind,f=e.result,i;if(i=e.input.charCodeAt(e.position),re(i)||ye(i)||i===35||i===38||i===42||i===33||i===124||i===62||i===39||i===34||i===37||i===64||i===96||(i===63||i===45)&&(n=e.input.charCodeAt(e.position+1),re(n)||a&&ye(n)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,d=!1;i!==0;){if(i===58){if(n=e.input.charCodeAt(e.position+1),re(n)||a&&ye(n))break}else if(i===35){if(l=e.input.charCodeAt(e.position-1),re(l))break}else{if(e.position===e.lineStart&&De(e)||a&&ye(i))break;if(se(i))if(c=e.line,h=e.lineStart,p=e.lineIndent,Q(e,!1,-1),e.lineIndent>=r){d=!0,i=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=h,e.lineIndent=p;break}}d&&(fe(e,s,o,!1),ot(e,e.line-c),s=o=e.position,d=!1),me(i)||(o=e.position+1),i=e.input.charCodeAt(++e.position)}return fe(e,s,o,!1),e.result?!0:(e.kind=u,e.result=f,!1)}function Uo(e,r){var a,l,n;if(a=e.input.charCodeAt(e.position),a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,l=n=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(fe(e,l,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)l=e.position,e.position++,n=e.position;else return!0;else se(a)?(fe(e,l,n,!0),ot(e,Q(e,!1,r)),l=n=e.position):e.position===e.lineStart&&De(e)?O(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);O(e,"unexpected end of the stream within a single quoted scalar")}function vo(e,r){var a,l,n,s,o,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,a=l=e.position;(d=e.input.charCodeAt(e.position))!==0;){if(d===34)return fe(e,a,e.position,!0),e.position++,!0;if(d===92){if(fe(e,a,e.position,!0),d=e.input.charCodeAt(++e.position),se(d))Q(e,!1,r);else if(d<256&&ca[d])e.result+=da[d],e.position++;else if((o=Ao(d))>0){for(n=o,s=0;n>0;n--)d=e.input.charCodeAt(++e.position),(o=Ho(d))>=0?s=(s<<4)+o:O(e,"expected hexadecimal character");e.result+=Fo(s),e.position++}else O(e,"unknown escape sequence");a=l=e.position}else se(d)?(fe(e,a,l,!0),ot(e,Q(e,!1,r)),a=l=e.position):e.position===e.lineStart&&De(e)?O(e,"unexpected end of the document within a double quoted scalar"):(e.position++,l=e.position)}O(e,"unexpected end of the stream within a double quoted scalar")}function $o(e,r){var a=!0,l,n,s,o=e.tag,d,c=e.anchor,h,p,u,f,i,S=Object.create(null),b,m,y,_;if(_=e.input.charCodeAt(e.position),_===91)p=93,i=!1,d=[];else if(_===123)p=125,i=!0,d={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),_=e.input.charCodeAt(++e.position);_!==0;){if(Q(e,!0,r),_=e.input.charCodeAt(e.position),_===p)return e.position++,e.tag=o,e.anchor=c,e.kind=i?"mapping":"sequence",e.result=d,!0;a?_===44&&O(e,"expected the node content, but found ','"):O(e,"missed comma between flow collection entries"),m=b=y=null,u=f=!1,_===63&&(h=e.input.charCodeAt(e.position+1),re(h)&&(u=f=!0,e.position++,Q(e,!0,r))),l=e.line,n=e.lineStart,s=e.position,Ce(e,r,Ue,!1,!0),m=e.tag,b=e.result,Q(e,!0,r),_=e.input.charCodeAt(e.position),(f||e.line===l)&&_===58&&(u=!0,_=e.input.charCodeAt(++e.position),Q(e,!0,r),Ce(e,r,Ue,!1,!0),y=e.result),i?be(e,d,S,m,b,y,l,n,s):u?d.push(be(e,null,S,m,b,y,l,n,s)):d.push(b),Q(e,!0,r),_=e.input.charCodeAt(e.position),_===44?(a=!0,_=e.input.charCodeAt(++e.position)):a=!1}O(e,"unexpected end of the stream within a flow collection")}function Do(e,r){var a,l,n=rt,s=!1,o=!1,d=r,c=0,h=!1,p,u;if(u=e.input.charCodeAt(e.position),u===124)l=!1;else if(u===62)l=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)rt===n?n=u===43?ra:Vo:O(e,"repeat of a chomping mode identifier");else if((p=Eo(u))>=0)p===0?O(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?O(e,"repeat of an indentation width identifier"):(d=r+p-1,o=!0);else break;if(me(u)){do u=e.input.charCodeAt(++e.position);while(me(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!se(u)&&u!==0)}for(;u!==0;){for(nt(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<d)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>d&&(d=e.lineIndent),se(u)){c++;continue}if(e.lineIndent<d){n===ra?e.result+=Y.repeat(`
11
+ `,s?1+c:c):n===rt&&s&&(e.result+=`
12
+ `);break}for(l?me(u)?(h=!0,e.result+=Y.repeat(`
13
+ `,s?1+c:c)):h?(h=!1,e.result+=Y.repeat(`
14
+ `,c+1)):c===0?s&&(e.result+=" "):e.result+=Y.repeat(`
15
+ `,c):e.result+=Y.repeat(`
16
+ `,s?1+c:c),s=!0,o=!0,c=0,a=e.position;!se(u)&&u!==0;)u=e.input.charCodeAt(++e.position);fe(e,a,e.position,!1)}return!0}function fa(e,r){var a,l=e.tag,n=e.anchor,s=[],o,d=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,O(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!re(o))));){if(d=!0,e.position++,Q(e,!0,-1)&&e.lineIndent<=r){s.push(null),c=e.input.charCodeAt(e.position);continue}if(a=e.line,Ce(e,r,la,!1,!0),s.push(e.result),Q(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>r)&&c!==0)O(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return d?(e.tag=l,e.anchor=n,e.kind="sequence",e.result=s,!0):!1}function Mo(e,r,a){var l,n,s,o,d,c,h=e.tag,p=e.anchor,u={},f=Object.create(null),i=null,S=null,b=null,m=!1,y=!1,_;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),_=e.input.charCodeAt(e.position);_!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,O(e,"tab characters must not be used in indentation")),l=e.input.charCodeAt(e.position+1),s=e.line,(_===63||_===58)&&re(l))_===63?(m&&(be(e,u,f,i,S,null,o,d,c),i=S=b=null),y=!0,m=!0,n=!0):m?(m=!1,n=!0):O(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,_=l;else{if(o=e.line,d=e.lineStart,c=e.position,!Ce(e,a,aa,!1,!0))break;if(e.line===s){for(_=e.input.charCodeAt(e.position);me(_);)_=e.input.charCodeAt(++e.position);if(_===58)_=e.input.charCodeAt(++e.position),re(_)||O(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(be(e,u,f,i,S,null,o,d,c),i=S=b=null),y=!0,m=!1,n=!1,i=e.tag,S=e.result;else if(y)O(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=p,!0}else if(y)O(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=h,e.anchor=p,!0}if((e.line===s||e.lineIndent>r)&&(m&&(o=e.line,d=e.lineStart,c=e.position),Ce(e,r,ve,!0,n)&&(m?S=e.result:b=e.result),m||(be(e,u,f,i,S,b,o,d,c),i=S=b=null),Q(e,!0,-1),_=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>r)&&_!==0)O(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return m&&be(e,u,f,i,S,null,o,d,c),y&&(e.tag=h,e.anchor=p,e.kind="mapping",e.result=u),y}function Ko(e){var r,a=!1,l=!1,n,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&O(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(a=!0,o=e.input.charCodeAt(++e.position)):o===33?(l=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",r=e.position,a){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(r,e.position),o=e.input.charCodeAt(++e.position)):O(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!re(o);)o===33&&(l?O(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(r-1,e.position+1),na.test(n)||O(e,"named tag handle cannot contain such characters"),l=!0,r=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(r,e.position),To.test(s)&&O(e,"tag suffix cannot contain flow indicator characters")}s&&!oa.test(s)&&O(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{O(e,"tag name is malformed: "+s)}return a?e.tag=s:ue.call(e.tagMap,n)?e.tag=e.tagMap[n]+s:n==="!"?e.tag="!"+s:n==="!!"?e.tag="tag:yaml.org,2002:"+s:O(e,'undeclared tag handle "'+n+'"'),!0}function jo(e){var r,a;if(a=e.input.charCodeAt(e.position),a!==38)return!1;for(e.anchor!==null&&O(e,"duplication of an anchor property"),a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!re(a)&&!ye(a);)a=e.input.charCodeAt(++e.position);return e.position===r&&O(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function Po(e){var r,a,l;if(l=e.input.charCodeAt(e.position),l!==42)return!1;for(l=e.input.charCodeAt(++e.position),r=e.position;l!==0&&!re(l)&&!ye(l);)l=e.input.charCodeAt(++e.position);return e.position===r&&O(e,"name of an alias node must contain at least one character"),a=e.input.slice(r,e.position),ue.call(e.anchorMap,a)||O(e,'unidentified alias "'+a+'"'),e.result=e.anchorMap[a],Q(e,!0,-1),!0}function Ce(e,r,a,l,n){var s,o,d,c=1,h=!1,p=!1,u,f,i,S,b,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=d=ve===a||la===a,l&&Q(e,!0,-1)&&(h=!0,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)),c===1)for(;Ko(e)||jo(e);)Q(e,!0,-1)?(h=!0,d=s,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)):d=!1;if(d&&(d=h||n),(c===1||ve===a)&&(Ue===a||aa===a?b=r:b=r+1,m=e.position-e.lineStart,c===1?d&&(fa(e,m)||Mo(e,m,b))||$o(e,b)?p=!0:(o&&Do(e,b)||Uo(e,b)||vo(e,b)?p=!0:Po(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&O(e,"alias node should not have any properties")):qo(e,b,Ue===a)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=d&&fa(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&O(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u<f;u+=1)if(S=e.implicitTypes[u],S.resolve(e.result)){e.result=S.construct(e.result),e.tag=S.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ue.call(e.typeMap[e.kind||"fallback"],e.tag))S=e.typeMap[e.kind||"fallback"][e.tag];else for(S=null,i=e.typeMap.multi[e.kind||"fallback"],u=0,f=i.length;u<f;u+=1)if(e.tag.slice(0,i[u].tag.length)===i[u].tag){S=i[u];break}S||O(e,"unknown tag !<"+e.tag+">"),e.result!==null&&S.kind!==e.kind&&O(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+S.kind+'", not "'+e.kind+'"'),S.resolve(e.result,e.tag)?(e.result=S.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):O(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function Lo(e){var r=e.position,a,l,n,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(Q(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),a=e.position;o!==0&&!re(o);)o=e.input.charCodeAt(++e.position);for(l=e.input.slice(a,e.position),n=[],l.length<1&&O(e,"directive name must not be less than one character in length");o!==0;){for(;me(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!se(o));break}if(se(o))break;for(a=e.position;o!==0&&!re(o);)o=e.input.charCodeAt(++e.position);n.push(e.input.slice(a,e.position))}o!==0&&nt(e),ue.call(pa,l)?pa[l](e,l,n):$e(e,'unknown document directive "'+l+'"')}if(Q(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Q(e,!0,-1)):s&&O(e,"directives end mark is expected"),Ce(e,e.lineIndent-1,ve,!1,!0),Q(e,!0,-1),e.checkLineBreaks&&Bo.test(e.input.slice(r,e.position))&&$e(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&De(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Q(e,!0,-1));return}if(e.position<e.length-1)O(e,"end of the stream or a document separator is expected");else return}function ma(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var a=new Oo(e,r),l=e.indexOf("\0");for(l!==-1&&(a.position=l,O(a,"null byte is not allowed in input")),a.input+="\0";a.input.charCodeAt(a.position)===32;)a.lineIndent+=1,a.position+=1;for(;a.position<a.length-1;)Lo(a);return a.documents}function Ro(e,r,a){r!==null&&typeof r=="object"&&typeof a>"u"&&(a=r,r=null);var l=ma(e,a);if(typeof r!="function")return l;for(var n=0,s=l.length;n<s;n+=1)r(l[n])}function zo(e,r){var a=ma(e,r);if(a.length!==0){if(a.length===1)return a[0];throw new le("expected a single document in the stream, but found more")}}var Jo=Ro,Wo=zo,ga={loadAll:Jo,load:Wo},ya=Object.prototype.toString,ka=Object.prototype.hasOwnProperty,st=65279,Qo=9,He=10,Yo=13,Zo=32,Go=33,Xo=34,it=35,es=37,ts=38,as=39,ls=42,ba=44,rs=45,Me=58,ns=61,os=62,ss=63,is=64,Ca=91,wa=93,cs=96,_a=123,ds=124,Sa=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var hs=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ps=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function us(e,r){var a,l,n,s,o,d,c;if(r===null)return{};for(a={},l=Object.keys(r),n=0,s=l.length;n<s;n+=1)o=l[n],d=String(r[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&ka.call(c.styleAliases,d)&&(d=c.styleAliases[d]),a[o]=d;return a}function fs(e){var r,a,l;if(r=e.toString(16).toUpperCase(),e<=255)a="x",l=2;else if(e<=65535)a="u",l=4;else if(e<=4294967295)a="U",l=8;else throw new le("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+Y.repeat("0",l-r.length)+r}var ms=1,Ae=2;function gs(e){this.schema=e.schema||lt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Y.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=us(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ae:ms,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function xa(e,r){for(var a=Y.repeat(" ",r),l=0,n=-1,s="",o,d=e.length;l<d;)n=e.indexOf(`
18
+ `,l),n===-1?(o=e.slice(l),l=d):(o=e.slice(l,n+1),l=n+1),o.length&&o!==`
19
+ `&&(s+=a),s+=o;return s}function ct(e,r){return`
20
+ `+Y.repeat(" ",e.indent*r)}function ys(e,r){var a,l,n;for(a=0,l=e.implicitTypes.length;a<l;a+=1)if(n=e.implicitTypes[a],n.resolve(r))return!0;return!1}function Ke(e){return e===Zo||e===Qo}function Ee(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==st||65536<=e&&e<=1114111}function Na(e){return Ee(e)&&e!==st&&e!==Yo&&e!==He}function Va(e,r,a){var l=Na(e),n=l&&!Ke(e);return(a?l:l&&e!==ba&&e!==Ca&&e!==wa&&e!==_a&&e!==Sa)&&e!==it&&!(r===Me&&!n)||Na(r)&&!Ke(r)&&e===it||r===Me&&n}function ks(e){return Ee(e)&&e!==st&&!Ke(e)&&e!==rs&&e!==ss&&e!==Me&&e!==ba&&e!==Ca&&e!==wa&&e!==_a&&e!==Sa&&e!==it&&e!==ts&&e!==ls&&e!==Go&&e!==ds&&e!==ns&&e!==os&&e!==as&&e!==Xo&&e!==es&&e!==is&&e!==cs}function bs(e){return!Ke(e)&&e!==Me}function Fe(e,r){var a=e.charCodeAt(r),l;return a>=55296&&a<=56319&&r+1<e.length&&(l=e.charCodeAt(r+1),l>=56320&&l<=57343)?(a-55296)*1024+l-56320+65536:a}function Ia(e){var r=/^\n* /;return r.test(e)}var Ba=1,dt=2,Ta=3,Ha=4,we=5;function Cs(e,r,a,l,n,s,o,d){var c,h=0,p=null,u=!1,f=!1,i=l!==-1,S=-1,b=ks(Fe(e,0))&&bs(Fe(e,e.length-1));if(r||o)for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=Fe(e,c),!Ee(h))return we;b=b&&Va(h,p,d),p=h}else{for(c=0;c<e.length;h>=65536?c+=2:c++){if(h=Fe(e,c),h===He)u=!0,i&&(f=f||c-S-1>l&&e[S+1]!==" ",S=c);else if(!Ee(h))return we;b=b&&Va(h,p,d),p=h}f=f||i&&c-S-1>l&&e[S+1]!==" "}return!u&&!f?b&&!o&&!n(e)?Ba:s===Ae?we:dt:a>9&&Ia(e)?we:o?s===Ae?we:dt:f?Ha:Ta}function ws(e,r,a,l,n){e.dump=function(){if(r.length===0)return e.quotingType===Ae?'""':"''";if(!e.noCompatMode&&(hs.indexOf(r)!==-1||ps.test(r)))return e.quotingType===Ae?'"'+r+'"':"'"+r+"'";var s=e.indent*Math.max(1,a),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),d=l||e.flowLevel>-1&&a>=e.flowLevel;function c(h){return ys(e,h)}switch(Cs(r,d,e.indent,o,c,e.quotingType,e.forceQuotes&&!l,n)){case Ba:return r;case dt:return"'"+r.replace(/'/g,"''")+"'";case Ta:return"|"+Aa(r,e.indent)+Ea(xa(r,s));case Ha:return">"+Aa(r,e.indent)+Ea(xa(_s(r,o),s));case we:return'"'+Ss(r)+'"';default:throw new le("impossible error: invalid scalar style")}}()}function Aa(e,r){var a=Ia(e)?String(r):"",l=e[e.length-1]===`
21
+ `,n=l&&(e[e.length-2]===`
22
22
  `||e===`
23
- `),s=o?"+":r?"":"-";return a+s+`
23
+ `),s=n?"+":l?"":"-";return a+s+`
24
24
  `}function Ea(e){return e[e.length-1]===`
25
- `?e.slice(0,-1):e}function _s(e,l){for(var a=/(\n+)([^\n]*)/g,r=function(){var d=e.indexOf(`
26
- `);return d=d!==-1?d:e.length,a.lastIndex=d,Aa(e.slice(0,d),l)}(),o=e[0]===`
27
- `||e[0]===" ",s,c;c=a.exec(e);){var h=c[1],i=c[2];s=i[0]===" ",r+=h+(!o&&!s&&i!==""?`
28
- `:"")+Aa(i,l),o=s}return r}function Aa(e,l){if(e===""||e[0]===" ")return e;for(var a=/ [^ ]/g,r,o=0,s,c=0,h=0,i="";r=a.exec(e);)h=r.index,h-o>l&&(s=c>o?c:h,i+=`
29
- `+e.slice(o,s),o=s+1),c=h;return i+=`
30
- `,e.length-o>l&&c>o?i+=e.slice(o,c)+`
31
- `+e.slice(c+1):i+=e.slice(o),i.slice(1)}function Ss(e){for(var l="",a=0,r,o=0;o<e.length;a>=65536?o+=2:o++)a=Ae(e,o),r=X[a],!r&&Ee(a)?(l+=e[o],a>=65536&&(l+=e[o+1])):l+=r||fs(a);return l}function xs(e,l,a){var r="",o=e.tag,s,c,h;for(s=0,c=a.length;s<c;s+=1)h=a[s],e.replacer&&(h=e.replacer.call(a,String(s),h)),(se(e,l,h,!1,!1)||typeof h>"u"&&se(e,l,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=o,e.dump="["+r+"]"}function Fa(e,l,a,r){var o="",s=e.tag,c,h,i;for(c=0,h=a.length;c<h;c+=1)i=a[c],e.replacer&&(i=e.replacer.call(a,String(c),i)),(se(e,l+1,i,!0,!0,!1,!0)||typeof i>"u"&&se(e,l+1,null,!0,!0,!1,!0))&&((!r||o!=="")&&(o+=it(e,l)),e.dump&&Te===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function Ns(e,l,a){var r="",o=e.tag,s=Object.keys(a),c,h,i,d,u;for(c=0,h=s.length;c<h;c+=1)u="",r!==""&&(u+=", "),e.condenseFlow&&(u+='"'),i=s[c],d=a[i],e.replacer&&(d=e.replacer.call(a,i,d)),se(e,l,i,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),se(e,l,d,!1,!1)&&(u+=e.dump,r+=u));e.tag=o,e.dump="{"+r+"}"}function Vs(e,l,a,r){var o="",s=e.tag,c=Object.keys(a),h,i,d,u,p,n;if(e.sortKeys===!0)c.sort();else if(typeof e.sortKeys=="function")c.sort(e.sortKeys);else if(e.sortKeys)throw new ae("sortKeys must be a boolean or a function");for(h=0,i=c.length;h<i;h+=1)n="",(!r||o!=="")&&(n+=it(e,l)),d=c[h],u=a[d],e.replacer&&(u=e.replacer.call(a,d,u)),se(e,l+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Te===e.dump.charCodeAt(0)?n+="?":n+="? "),n+=e.dump,p&&(n+=it(e,l)),se(e,l+1,u,!0,p)&&(e.dump&&Te===e.dump.charCodeAt(0)?n+=":":n+=": ",n+=e.dump,o+=n));e.tag=s,e.dump=o||"{}"}function Oa(e,l,a){var r,o,s,c,h,i;for(o=a?e.explicitTypes:e.implicitTypes,s=0,c=o.length;s<c;s+=1)if(h=o[s],(h.instanceOf||h.predicate)&&(!h.instanceOf||typeof l=="object"&&l instanceof h.instanceOf)&&(!h.predicate||h.predicate(l))){if(a?h.multi&&h.representName?e.tag=h.representName(l):e.tag=h.tag:e.tag="?",h.represent){if(i=e.styleMap[h.tag]||h.defaultStyle,ga.call(h.represent)==="[object Function]")r=h.represent(l,i);else if(ya.call(h.represent,i))r=h.represent[i](l,i);else throw new ae("!<"+h.tag+'> tag resolver accepts not "'+i+'" style');e.dump=r}return!0}return!1}function se(e,l,a,r,o,s,c){e.tag=null,e.dump=a,Oa(e,a,!1)||Oa(e,a,!0);var h=ga.call(e.dump),i=r,d;r&&(r=e.flowLevel<0||e.flowLevel>l);var u=h==="[object Object]"||h==="[object Array]",p,n;if(u&&(p=e.duplicates.indexOf(a),n=p!==-1),(e.tag!==null&&e.tag!=="?"||n||e.indent!==2&&l>0)&&(o=!1),n&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(u&&n&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),h==="[object Object]")r&&Object.keys(e.dump).length!==0?(Vs(e,l,e.dump,o),n&&(e.dump="&ref_"+p+e.dump)):(Ns(e,l,e.dump),n&&(e.dump="&ref_"+p+" "+e.dump));else if(h==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!c&&l>0?Fa(e,l-1,e.dump,o):Fa(e,l,e.dump,o),n&&(e.dump="&ref_"+p+e.dump)):(xs(e,l,e.dump),n&&(e.dump="&ref_"+p+" "+e.dump));else if(h==="[object String]")e.tag!=="?"&&ws(e,e.dump,l,s,i);else{if(h==="[object Undefined]"||e.skipInvalid)return!1;throw new ae("unacceptable kind of an object to dump "+h)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function Bs(e,l){var a=[],r=[],o,s;for(dt(e,a,r),o=0,s=r.length;o<s;o+=1)l.duplicates.push(a[r[o]]);l.usedDuplicates=new Array(s)}function dt(e,l,a){var r,o,s;if(e!==null&&typeof e=="object")if(o=l.indexOf(e),o!==-1)a.indexOf(o)===-1&&a.push(o);else if(l.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)dt(e[o],l,a);else for(r=Object.keys(e),o=0,s=r.length;o<s;o+=1)dt(e[r[o]],l,a)}function Is(e,l){l=l||{};var a=new gs(l);a.noRefs||Bs(e,a);var r=e;return a.replacer&&(r=a.replacer.call({"":r},"",r)),se(a,0,r,!0,!0)?a.dump+`
32
- `:""}var Ts=Is,Hs={dump:Ts};function ht(e,l){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+l+" instead, which is now safe by default.")}}var Es=Z,As=Ut,Fs=Mt,Os=Rt,qs=zt,Us=at,$s=ma.load,vs=ma.loadAll,Ds=Hs.dump,Ms=ae,js={binary:Zt,float:Lt,map:Dt,null:jt,pairs:Xt,set:ea,timestamp:Qt,bool:Kt,int:Pt,merge:Yt,omap:Gt,seq:vt,str:$t},Ks=ht("safeLoad","load"),Ps=ht("safeLoadAll","loadAll"),Ls=ht("safeDump","dump"),Rs={Type:Es,Schema:As,FAILSAFE_SCHEMA:Fs,JSON_SCHEMA:Os,CORE_SCHEMA:qs,DEFAULT_SCHEMA:Us,load:$s,loadAll:vs,dump:Ds,YAMLException:Ms,types:js,safeLoad:Ks,safeLoadAll:Ps,safeDump:Ls};const zs={key:0,class:"config-card-display-form"},Js=["data-testid"],Ws={key:0,class:"config-card-prop-section-title"},Qs={key:1,class:"config-card-display-json"},Ys={key:2,class:"config-card-display-yaml"},Zs=t.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null}},setup(e){const l=e,a=t.useSlots(),{i18n:{t:r}}=Y.useI18n(),o=h=>!!(h.tooltip||a[`${h.key}-label-tooltip`]),s=t.ref(""),c=t.ref("");return t.watch(()=>l.format,h=>{if(h!=="structured"){const i=JSON.parse(JSON.stringify(l.record));delete i.created_at,delete i.updated_at,h==="json"?s.value=JSON.stringify(i,null,2):h==="yaml"&&(c.value=Rs.dump(i))}},{immediate:!0}),(h,i)=>{const d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",zs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,u=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${u}-props`,class:t.normalizeClass(`config-card-details-${u}-props`),"data-testid":`config-card-details-${u}-props`},[u!=="basic"?(t.openBlock(),t.createElementBlock("div",Ws,t.toDisplayString(u==="advanced"?t.unref(r)("baseConfigCard.sections.advanced"):t.unref(r)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[u],p=>(t.openBlock(),t.createBlock(Ze,{key:p.key,item:p},t.createSlots({label:t.withCtx(()=>[t.renderSlot(h.$slots,`${p.key}-label`,{row:p},void 0,!0)]),[p.key]:t.withCtx(({rowValue:n})=>[t.renderSlot(h.$slots,p.key,{row:p,rowValue:n},void 0,!0)]),_:2},[o(p)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(h.$slots,`${p.key}-label-tooltip`,{row:p},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Js))),128))])):t.createCommentVNode("",!0),e.format==="json"?(t.openBlock(),t.createElementBlock("div",Qs,[t.createVNode(d,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),e.format==="yaml"?(t.openBlock(),t.createElementBlock("div",Ys,[t.createVNode(d,{id:"config-card-codeblock",code:c.value,language:"yaml",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0)],64)}}}),Gs=re(Zs,[["__scopeId","data-v-c914c7e4"]]),qa="24px",Xs=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},ei=e=>(t.pushScopeId("data-v-a53b73fd"),e=e(),t.popScopeId(),e),ti=["aria-hidden"],ai={key:0,"data-testid":"kui-icon-svg-title"},li=ei(()=>t.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)),ri=t.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:qa,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const l=String(e).replace(/px/gi,""),a=Number(l);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const l=e,a=t.computed(()=>{if(typeof l.size=="number"&&l.size>0)return`${l.size}px`;if(typeof l.size=="string"){const o=String(l.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return qa}),r=t.computed(()=>({boxSizing:"border-box",color:l.color,display:l.display,height:a.value,lineHeight:"0",width:a.value}));return(o,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ai,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),li],8,ti))]),_:1},8,["aria-hidden","style"]))}}),oi=Xs(ri,[["__scopeId","data-v-a53b73fd"]]),ni={"data-testid":"config-card-title"},si={class:"config-card-actions"},ii=["href"],ci={key:2,class:"config-card-details-section"},di={key:3,class:"config-card-details-section"},hi=["data-testid"],pi={key:0,class:"config-card-prop-section-title"},ui=t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:l}){var a;const r=e,o=t.useSlots(),{i18n:{t:s}}=Y.useI18n(),{getMessageFromError:c}=Y.useErrors(),{convertKeyToTitle:h}=Y.useStringHelpers(),{axiosInstance:i}=Y.useAxios({headers:(a=r.config)==null?void 0:a.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=t.ref("structured"),p=x=>{u.value=x==null?void 0:x.value},n={id:{type:P.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:P.BadgeStatus,order:2,section:J.Basic},updated_at:{type:P.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:P.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:P.BadgeTag,order:-1,section:J.Basic}},k=t.ref(!1),w=t.ref(!1),f=t.ref(""),m=t.ref(),N=t.computed(()=>{var x,I,_;if(!m.value)return[];const T=[],H=Object.keys(m.value).length;for(const v in m.value){const U=(I=(x=r.configSchema)==null?void 0:x[v])==null?void 0:I.order,F=(_=n[v])==null?void 0:_.order;let D=H;(F||F===0)&&(D=F===-1?H+1:F),U&&(D=U===-1?H+1:U),T.push([v,D])}return T.sort(function(v,U){return v[1]-U[1]}),T.map(v=>{var U,F;const D=v[0],M=(U=m.value)==null?void 0:U[D],B=((F=r.configSchema)==null?void 0:F[D])||{},$=n[D];return{key:D,value:M,hidden:B.hidden||!1,type:B.type??(($==null?void 0:$.type)||P.Text),label:B.label??(($==null?void 0:$.label)||h(D)),tooltip:B.tooltip??(($==null?void 0:$.tooltip)||void 0),section:B.section??(($==null?void 0:$.section)||J.Advanced)}}).filter(v=>!v.hidden&&v.key!==r.pluginConfigKey)}),C=t.computed(()=>{var x,I;if(!m.value||!r.pluginConfigKey)return[];const _=m.value[r.pluginConfigKey]||{},T=Object.keys(_).length,H=[];for(const v in _){const U=(I=(x=r.pluginConfigSchema)==null?void 0:x[v])==null?void 0:I.order,F=_[v];let D=F!=null&&F!==""?T-1:T;U&&(D=U===-1?T+1:U),H.push([v,D])}return H.sort(function(v,U){return v[1]-U[1]}),H.map(v=>{var U;const F=v[0],D=_[F],M=((U=r.pluginConfigSchema)==null?void 0:U[F])||{};return{key:F,value:D,hidden:M.hidden||!1,type:M.type??P.Text,label:M.label??h(F),tooltip:M.tooltip??void 0,section:J.Plugin}}).filter(v=>!v.hidden)}),O=t.computed(()=>{var x,I,_,T;return{basic:(x=N.value)==null?void 0:x.filter(H=>H.section===J.Basic),advanced:(I=N.value)==null?void 0:I.filter(H=>H.section===J.Advanced),plugin:(T=C.value)==null?void 0:T.concat((_=N.value)==null?void 0:_.filter(H=>H.section===J.Plugin))}}),V=t.computed(()=>{const x=[];return O.value.basic.length&&x.push("basic"),O.value.advanced.length&&x.push("advanced"),O.value.plugin.length&&x.push("plugin"),x}),S=x=>!!(x.tooltip||o[`${x.key}-label-tooltip`]),q=t.computed(()=>{var x,I;let _=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((x=r.config)==null?void 0:x.controlPlaneId)||""):r.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(I=r.config)!=null&&I.workspace?`/${r.config.workspace}`:"")),_=_.replace(/{id}/gi,r.config.entityId),_}),A=x=>{m.value&&x(JSON.stringify(m.value))?l("copy:success",m.value):l("copy:error")};return t.watch(k,x=>{l("loading",x)},{immediate:!0}),t.onBeforeMount(async()=>{w.value=!1,k.value=!0;try{const{data:x}=await i.get(q.value);if(r.dataKey)if(typeof x[r.dataKey]<"u")m.value={...x[r.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:r.dataKey}));else m.value={...x};Object.keys(r.configSchema).filter(I=>r.configSchema[I].forceShow).forEach(I=>{m.value&&typeof m.value[I]>"u"&&(m.value[I]=null)}),l("fetch:success",x)}catch(x){const I=c(x);f.value=I.startsWith("code")?s("baseConfigCard.errors.load"):I,w.value=!0,l("fetch:error",x)}finally{k.value=!1}}),(x,I)=>{const _=t.resolveComponent("KLabel"),T=t.resolveComponent("KSelect"),H=t.resolveComponent("KButton"),v=t.resolveComponent("KClipboardProvider"),U=t.resolveComponent("KSkeleton"),F=t.resolveComponent("KEmptyState"),D=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(D,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",si,[t.renderSlot(x.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(_,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(T,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:p})):t.createCommentVNode("",!0),r.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock(H,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(oi),{size:t.unref(po)},null,8,["size"])],8,ii)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(v,{key:3},{default:t.withCtx(({copyToClipboard:M})=>[!k.value&&!w.value?(t.openBlock(),t.createBlock(H,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:B=>A(M)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),default:t.withCtx(()=>[k.value?(t.openBlock(),t.createBlock(U,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):w.value?(t.openBlock(),t.createBlock(F,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(f.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",ci,[t.createVNode(Gs,{format:u.value,"prop-list-types":V.value,"property-collections":O.value,record:m.value},t.createSlots({_:2},[t.renderList(Object.keys(x.$slots),M=>({name:M,fn:t.withCtx(({row:B,rowValue:$})=>[t.renderSlot(x.$slots,M,{row:B,rowValue:$},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",di,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.value,M=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${M}-props`,class:t.normalizeClass(`config-card-details-${M}-props`),"data-testid":`config-card-details-${M}-props`},[M!=="basic"?(t.openBlock(),t.createElementBlock("div",pi,t.toDisplayString(M==="advanced"?t.unref(s)("baseConfigCard.sections.advanced"):t.unref(s)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.value[M],B=>(t.openBlock(),t.createBlock(Ze,{key:B.key,item:B},t.createSlots({label:t.withCtx(()=>[t.renderSlot(x.$slots,`${B.key}-label`,{row:B},void 0,!0)]),[B.key]:t.withCtx(({rowValue:$})=>[t.renderSlot(x.$slots,B.key,{row:B,rowValue:$},void 0,!0)]),_:2},[S(B)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(x.$slots,`${B.key}-label-tooltip`,{row:B},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,hi))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",ni,[t.renderSlot(x.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),fi=re(ui,[["__scopeId","data-v-bea4df63"]]),mi=["onReset","onSubmit"],gi={class:"form-actions","data-testid":"form-actions"},yi=t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:l}){var a;const r=e,o=ze.useRouter(),{i18n:{t:s}}=Y.useI18n(),{getMessageFromError:c}=Y.useErrors(),{axiosInstance:h}=Y.useAxios({headers:(a=r.config)==null?void 0:a.requestHeaders}),i=t.ref(!1),d=t.ref(!1),u=t.ref(""),p=t.computed(()=>r.canSubmit===!1||r.isReadonly),n=t.computed(()=>{var m,N;if(!r.editId)return"";let C=`${r.config.apiBaseUrl}${r.fetchUrl}`;return r.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(N=r.config)!=null&&N.workspace?`/${r.config.workspace}`:"")),C=C.replace(/{id}/gi,r.editId),C}),k=()=>{r.config.cancelRoute?o.push(r.config.cancelRoute):w()},w=()=>{l("cancel")},f=()=>{p.value||l("submit")};return t.watch(()=>i.value,m=>{l("loading",m)},{immediate:!0}),t.onBeforeMount(async()=>{if(r.editId)try{d.value=!1,i.value=!0;const{data:m}=await h.get(n.value);l("fetch:success",m)}catch(m){const N=c(m);u.value=N.startsWith("code")?s("baseForm.errors.edit"):N,d.value=!0,l("fetch:error",m)}finally{i.value=!1}}),(m,N)=>{const C=t.resolveComponent("KSkeleton"),O=t.resolveComponent("KEmptyState"),V=t.resolveComponent("KAlert"),S=t.resolveComponent("KButton"),q=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(q,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[i.value?(t.openBlock(),t.createBlock(C,{key:0,type:"form"})):d.value?(t.openBlock(),t.createBlock(O,{key:1,"cta-text":t.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":k,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(w,["prevent"]),onSubmit:t.withModifiers(f,["prevent"])},[t.renderSlot(m.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(V,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",gi,[t.renderSlot(m.$slots,"form-actions",{},()=>[t.createVNode(S,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(S,{appearance:"primary","data-testid":"form-submit",disabled:p.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,mi))]),_:3})}}}),Ua=re(yi,[["__scopeId","data-v-448d8512"]]),ki={key:0,"data-testid":"first-col"},bi=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const l=e,a=t.computed(()=>{var f;return((f=l.rowEl)==null?void 0:f.querySelector(`[data-testid="${l.keyName}"]`))||null}),r=t.computed(()=>{var f;return((f=a.value)==null?void 0:f.querySelector('[data-testid="first-col"]'))||null}),o=t.computed(()=>{var f,m;const N=(f=l.rowEl)==null?void 0:f.querySelectorAll("td");return N?((m=N[0])==null?void 0:m.getAttribute("data-testid"))===l.keyName:!1});let s;const c=()=>{s&&(s.disconnect(),s=void 0)},h=()=>{var f,m,N;d.value=((f=r.value)==null?void 0:f.getBoundingClientRect().width)||0,u.value=((m=a.value)==null?void 0:m.clientWidth)||0,p.value=((N=i.value)==null?void 0:N.innerText)||""},i=t.ref({}),d=t.ref(0),u=t.ref(0),p=t.ref(""),n=t.computed(()=>[r.value,a.value]),k=t.watch(n,f=>{if(o.value&&(c(),"ResizeObserver"in window&&window)){s=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||h()})});for(const m of f)m&&s.observe(m)}},{immediate:!0,flush:"post",deep:!0}),w=t.computed(()=>o.value?d.value>u.value:!1);return t.onMounted(()=>{h()}),t.onUnmounted(()=>{k()}),(f,m)=>{const N=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:i,class:"content-wrapper"},[o.value?(t.openBlock(),t.createElementBlock("span",ki,[t.createVNode(N,{label:w.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(f.$slots,"default",{key:1},void 0,!0)],512)}}}),Ci=re(bi,[["__scopeId","data-v-e42a20c9"]]),wi={class:"toolbar-container"},_i={key:0,class:"toolbar-button-container"},Si=["data-testid"],xi=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:l}){const a=e,{i18n:{t:r}}=Y.useI18n(),o=t.computed(()=>{var V,S;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(V=a.errorMessage)==null?void 0:V.title,message:(S=a.errorMessage)==null?void 0:S.message}}),s=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),c=V=>V.hasData||!!a.query,h=t.computed(()=>{const V=[];return Object.keys(a.tableHeaders).forEach(S=>{const q=a.tableHeaders[S];V.push({label:q.label??S,key:S,sortable:q.sortable??!1})}),a.enableEntityActions&&V.push({key:"actions",hideLabel:!0}),V}),i=V=>({"data-rowid":V.id,"data-testid":V.name,...a.rowAttributes(V)}),d=t.ref({}),u=V=>{var S;return(S=d.value)==null?void 0:S.$el.querySelector(`[data-rowid="${V.id}"]`)},p=V=>{const S={"data-testid":V.headerKey,...a.cellAttributes(V)};return V.colIndex===0&&(S.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),S},n=()=>{l("empty-state-cta-clicked"),k()},k=()=>{l("clear-search-input")},w=t.computed(()=>a.disableRowClick?void 0:(V,S)=>{l("click:row",S)}),f=V=>{l("sort",V)},{setTablePreferences:m,getTablePreferences:N}=gr(),C=t.computed(()=>{const V=N(a.preferencesStorageKey);return{...a.initialFetcherParams,...V}}),O=V=>{a.preferencesStorageKey&&m(a.preferencesStorageKey,V)};return(V,S)=>{const q=t.resolveComponent("KIcon"),A=t.resolveComponent("KButton"),x=t.resolveComponent("KDropdown"),I=t.resolveComponent("KTable"),_=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(_,{class:"kong-ui-entity-base-table",title:e.title},{default:t.withCtx(()=>[t.createVNode(I,{ref_key:"tableRefs",ref:d,"cache-identifier":s.value,"cell-attrs":p,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(r)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":o.value.message,"error-state-title":o.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":o.value.hasError,headers:h.value,"hide-pagination-when-optional":"","initial-fetcher-params":C.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":i,"search-input":e.query,onKtableEmptyStateCtaClicked:n,"onRow:click":w.value,onSort:S[0]||(S[0]=T=>f(T)),"onUpdate:tablePreferences":O},t.createSlots({toolbar:t.withCtx(({state:T})=>[t.withDirectives(t.createElementVNode("div",wi,[t.renderSlot(V.$slots,"toolbar-filter",{},void 0,!0),V.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",_i,[t.renderSlot(V.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,c(T)]])]),actions:t.withCtx(({row:T,rowKey:H,rowValue:v})=>[t.createElementVNode("div",{class:"actions-container","data-testid":T.name},[t.createVNode(x,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(V.$slots,"actions",{row:T,rowKey:H,rowValue:v},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(A,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(q,{color:t.unref(co),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,Si)]),_:2},[t.renderList(e.tableHeaders,(T,H)=>({name:H,fn:t.withCtx(({row:v,rowKey:U,rowValue:F})=>[t.createVNode(Ci,{"key-name":String(H),"row-el":u(v)},{default:t.withCtx(()=>[t.renderSlot(V.$slots,H,{row:v,rowKey:U,rowValue:F},()=>[t.createTextVNode(t.toDisplayString(F),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),$a=re(xi,[["__scopeId","data-v-57b5a97b"]]),Ni={key:0,class:"kong-ui-entity-delete-error"},Vi={key:1,class:"description"},Bi=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:l}){const a=e,{i18nT:r}=Y.useI18n(),o=t.computed(()=>a.needConfirm?a.entityName:""),s=()=>{l("cancel")},c=()=>{l("proceed")};return(h,i)=>{const d=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:s,onProceed:c},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Ni,[t.createVNode(d,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(r),{class:"message",keypath:a.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a.entityType),1)]),_:2},[a.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(a.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),a.description||h.$slots.description?(t.openBlock(),t.createElementBlock("div",Vi,[t.renderSlot(h.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(a.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),va=re(Bi,[["__scopeId","data-v-1c9a2a07"]]),Ii={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ti={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Hi=["fill"],Ei={mask:"url(#mask0_180_20349)"},Ai=["fill"],Da=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${so})`}},setup(e){return(l,a)=>(t.openBlock(),t.createElementBlock("svg",Ii,[t.createElementVNode("mask",Ti,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Hi)]),t.createElementVNode("g",Ei,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ai)])]))}}),Fi={key:1,class:"kong-ui-entity-filter"},Oi={class:"menu-item-title"},qi={class:"menu-item-indicator"},Ui={class:"menu-item-body"},$i=["for"],vi={class:"menu-item-buttons"},Di={class:"filter-clear-button-container"},Mi=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:l}){const a=e,{i18n:{t:r}}=Y.useI18n(),o=t.ref(!1),s=t.ref({}),c=t.computed(()=>{const m=[];return new URLSearchParams(a.modelValue).forEach((N,C)=>{N!==""&&m.push(C)}),m}),h=t.computed(()=>{const m=a.config.fields;return Object.keys(m).filter(N=>m[N].searchable).map(N=>({label:m[N].label||N,value:N}))});t.watch(()=>a.modelValue,m=>{s.value={},new URLSearchParams(m).forEach((N,C)=>{s.value[C]=N})});const i=()=>{o.value=!o.value},d=m=>{l("update:modelValue",m)},u=m=>`filter-${m}`,p=m=>{var N,C;return(((C=(N=a.config.schema)==null?void 0:N[m])==null?void 0:C.values)??[]).map(O=>({value:O,label:O}))},n=m=>{var N,C;return((C=(N=a.config.schema)==null?void 0:N[m])==null?void 0:C.type)??"text"},k=m=>{s.value={...s.value,[m]:""},f()},w=()=>{s.value={},f(!0)},f=(m=!1)=>{const N=Object.keys(s.value).reduce((C,O)=>(s.value[O]&&(C[O]=`${s.value[O]}`),C),{});m&&(o.value=!1),l("update:modelValue",new URLSearchParams(N).toString())};return(m,N)=>{const C=t.resolveComponent("KInput"),O=t.resolveComponent("KButton"),V=t.resolveComponent("KSelect"),S=t.resolveComponent("KMenuItem"),q=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{before:t.withCtx(()=>[t.createVNode(Da)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Fi,[t.createVNode(O,{appearance:"tertiary","data-testid":"filter-button",onClick:i},{default:t.withCtx(()=>[t.createVNode(Da),t.createTextVNode(" "+t.toDisplayString(t.unref(r)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:i},null,512),[[t.vShow,o.value]]),t.withDirectives(t.createVNode(q,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,(A,x)=>(t.openBlock(),t.createBlock(S,{key:A.value,"data-testid":A.value,expandable:"","last-menu-item":x===h.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",Oi,[t.createTextVNode(t.toDisplayString(A.label)+" ",1),t.withDirectives(t.createElementVNode("span",qi,null,512),[[t.vShow,c.value.includes(A.value)]])])]),itemBody:t.withCtx(()=>{var I,_;return[t.createElementVNode("div",Ui,[t.createElementVNode("label",{class:"menu-item-label",for:u(A.value)},t.toDisplayString(t.unref(r)("filter.fieldLabel")),9,$i),((_=(I=e.config.schema)==null?void 0:I[A.value])==null?void 0:_.type)==="select"?(t.openBlock(),t.createBlock(V,{key:0,id:u(A.value),modelValue:s.value[A.value],"onUpdate:modelValue":T=>s.value[A.value]=T,appearance:"select",items:p(A.value),placeholder:t.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(C,{key:1,id:u(A.value),modelValue:s.value[A.value],"onUpdate:modelValue":T=>s.value[A.value]=T,autocomplete:"off",placeholder:t.unref(r)("filter.inputPlaceholder"),type:n(A.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",vi,[t.createVNode(O,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:N[0]||(N[0]=T=>f(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.applyButtonText")),1)]),_:1}),t.createVNode(O,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:T=>k(A.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",Di,[t.createVNode(O,{appearance:"tertiary",size:"small",onClick:w},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,o.value]])]))}}}),ji=re(Mi,[["__scopeId","data-v-15962ee2"]]),ie=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const l=e,a=t.ref(void 0),r=t.computed(()=>a.value===!0||a.value!==void 0&&l.forceShow===!0);return t.watch(()=>l.authFunction,async()=>{a.value=await l.authFunction()},{immediate:!0}),(o,s)=>r.value?t.renderSlot(o.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Ki={class:"form-section-wrapper"},Pi={key:0,class:"form-section-title"},Li={key:1,class:"form-section-description"},Ri={key:2,class:"form-section-footer"},zi={class:"form-section-content"},Ji=t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const l=t.useSlots();return(a,r)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Ki,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createElementBlock("h4",Pi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(l).description?(t.openBlock(),t.createElementBlock("div",Li,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(l).footer?(t.openBlock(),t.createElementBlock("div",Ri,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",zi,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),Fe=re(Ji,[["__scopeId","data-v-8b6dc312"]]),{useAxios:je,useDeleteUrlBuilder:Ma,useErrors:ja,useExternalLinkCreator:Pc,useFetchUrlBuilder:Lc,useFetcher:Ka,useDebouncedFilter:Pa,useStringHelpers:Rc,useHelpers:Wi,useGatewayFeatureSupported:zc,useTruncationDetector:Jc}=Y,Qi={upstreams:{list:{table_headers:{id:"ID",name:"Name",slots:"Slots",tags:"Tags"},empty_state:{title:"Configure a New Upstream",description:"Upstreams are used to load balance incoming requests."},toolbar_actions:{new_upstream:"New Upstream"}},title:"Upstreams",search:{placeholder:"Filter by exact name or ID"},actions:{create:"New Upstream",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete an Upstream",description:"This action cannot be reversed so make sure to check upstream usage before deleting."},errors:{general:"Upstreams could not be retrieved",delete:"The upstream 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:{errors:{name_required:"Name is required",should_be_integer:"Field should contain an integer",in_range:"Accepts an integer in the range of 10 - 65536"},general_info:{title:"General Information",help:"General information will help identify and manage this Upstream."},load_balancing:{title:"Load Balancing",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},health_check:{title:"Health Checks & Circuit Breakers",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},active_health_check:{title:"Active Health Checks",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},passive_health_check:{title:"Passive Health Checks",help:"Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},buttons:{view_documentation:"View documentation"},algorithms:{round_robin_label:"Round Robin",least_connections_label:"Least Connections",consistent_hashing_label:"Consistent Hashing",latency_label:"Latency"},hash_labels:{none:"None",consumer:"Consumer",ip:"IP",header:"Header",cookie:"Cookie",path:"Path",query_argument:"Query Argument",uri_capture:"URI Capture"},hash_tooltips:{hash_on_header:{text:"The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",hash_on:"hash_on",header:"header"},hash_on_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",hash_on:"hash_on",uri_capture:"uri_capture"},hash_on_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",hash_on:"hash_on",query_arg:"query_arg"},hash_on_cookie:{text:"The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},hash_on_cookie_path:{text:"The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},slots:{text:"The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",algorithm:"algorithm",round_robin:"round-robin",consistent_hashing:"consistent-hashing"},tags:"An optional set of strings associated with the Upstream for grouping and filtering.",hash_fallback:{text:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",hash_on:"hash_on",cookie:"cookie"},hash_fallback_header:{text:"The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",hash_fallback:"hash_fallback",header:"header"},hash_fallback_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",hash_fallback:"hash_fallback",query_arg:"query_arg"},hash_fallback_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",hash_fallback:"hash_fallback",uri_capture:"uri_capture"},host_header:{text:"The hostname to be used as {host} header when proxying requests through Kong.",host:"Host"},client_certificate:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},healthcheck_type_labels:{http:"HTTP",https:"HTTPS",tcp:"TCP",grsp:"gRPC",grsps:"gRPCs"},healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},passive_healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},passive_unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},fields:{name:{label:"Name",placeholder:"Enter or select a host",tooltip:"This is a hostname, which must be equal to the {host} of a Service.",host:"host"},host_header:{label:"Host Header"},client_certificate:{label:"Client Certificate",placeholder:"Select or enter a Certificate ID",tooltip:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Upstream for grouping and filtering."},algorithm:{label:"Algorithm",tooltip:"Which load balancing algorithm to use."},slots:{label:"Slots",help:"Accepts an integer in the range of 10 - 65536"},hash_on:{label:"Hash on",help:"What to use as hashing input.",tooltip:"What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."},hash_fallback:{label:"Hash Fallback",help:"What to use as hashing input if the primary hash_on does not return a hash",tooltip:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",hash_on:"hash_on",cookie:"cookie"},active_health_checks:{label:"Active Health Checks",help:"Actively probe the targets for their health."},passive_health_checks:{label:"Passive Health Checks / Circuit Breakers",help:"Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},healthchecks_threshold:{label:"Healthchecks Threshold"},header:{label:"Header"},headers:{label:"Headers",tooltip_active:"Header values can be separated by commas (value1, value2, value3)."},cookie:{label:"Cookie"},cookie_path:{label:"Cookie Path"},query_argument:{label:"Query Argument"},uri_capture:{label:"URI Capture"},active_healthcheck_type:{label:"Active Health Check Type"},http_path:{label:"HTTP Path"},timeout:{label:"Timeout"},concurrency:{label:"Concurrency"},https_sni:{label:"HTTPS SNI"},verify_ssl:{label:"Verify the SSL certificate when performing active health checks using HTTPS"},interval:{label:"Interval",help:"A value of zero indicates that active probes for healthy targets are disabled."},successes:{label:"Successes"},http_statuses:{label:"HTTP Statuses"},http_failures:{label:"HTTP Failures"},tcp_failures:{label:"TCP Failures"},timeouts:{label:"Timeouts"},passive_health_check_type:{label:"Passive Health Check Type"}}},labels:{created_at:"Created at"}},targets:{list:{table_headers:{id:"ID",target_address:"Target Address",weight:"Weight",tags:"Tags"},empty_state:{title:"Configure a New Target",description:"A target is an IP address/hostname with a port that identifies an instance of a backend service."},toolbar_actions:{new_target:"New Target"}},title:"Targets",actions:{create:"New Target",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",mark_healthy:"Mark Healthy",mark_unhealthy:"Mark Unhealthy"},delete:{title:"Delete a Target",description:"This action cannot be reversed so make sure to check target usage before deleting."},errors:{general:"Targets could not be retrieved",delete:"The target could not be deleted at this time.",copy:"Failed to copy to clipboard",weight:"Value must be in range 0 to 65535"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{create:{title:"New Target"},edit:{title:"Edit Target"},buttons:{save:"Save",cancel:"Cancel"},fields:{target:{label:"Target Address",placeholder:"Enter IP/hostname and port",tooltip:"The target address (IP or hostname) and port. If omitted the port defaults to 8000."},weight:{label:"Weight",tooltip:"The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}}}}};function Yi(){const e=Be.createI18n("en-us",Qi);return{i18n:e,i18nT:Be.i18nTComponent(e)}}function Oe(e){const{replaceId:l=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(o,s)=>{if(s){const c={...o};l&&(c.value=o.label),a.value.push(c)}else a.value=a.value.filter(c=>c.value!==o.value)}}}const Ke=[{label:"100",value:"100"},{label:"101",value:"101"},{label:"102",value:"102"},{label:"103",value:"103"},{label:"200",value:"200"},{label:"201",value:"201"},{label:"202",value:"202"},{label:"203",value:"203"},{label:"204",value:"204"},{label:"205",value:"205"},{label:"206",value:"206"},{label:"207",value:"207"},{label:"208",value:"208"},{label:"226",value:"226"},{label:"300",value:"300"},{label:"301",value:"301"},{label:"302",value:"302"},{label:"303",value:"303"},{label:"304",value:"304"},{label:"305",value:"305"},{label:"306",value:"306"},{label:"307",value:"307"},{label:"308",value:"308"},{label:"400",value:"400"},{label:"401",value:"401"},{label:"402",value:"402"},{label:"403",value:"403"},{label:"404",value:"404"},{label:"405",value:"405"},{label:"406",value:"406"},{label:"407",value:"407"},{label:"408",value:"408"},{label:"409",value:"409"},{label:"410",value:"410"},{label:"411",value:"411"},{label:"412",value:"412"},{label:"413",value:"413"},{label:"414",value:"414"},{label:"415",value:"415"},{label:"416",value:"416"},{label:"417",value:"417"},{label:"418",value:"418"},{label:"419",value:"419"},{label:"420",value:"420"},{label:"421",value:"421"},{label:"422",value:"422"},{label:"423",value:"423"},{label:"424",value:"424"},{label:"425",value:"425"},{label:"426",value:"426"},{label:"428",value:"428"},{label:"429",value:"429"},{label:"430",value:"430"},{label:"431",value:"431"},{label:"440",value:"440"},{label:"444",value:"444"},{label:"449",value:"449"},{label:"450",value:"450"},{label:"451",value:"451"},{label:"460",value:"460"},{label:"463",value:"463"},{label:"494",value:"494"},{label:"495",value:"495"},{label:"496",value:"496"},{label:"497",value:"497"},{label:"498",value:"498"},{label:"499",value:"499"},{label:"500",value:"500"},{label:"501",value:"501"},{label:"502",value:"502"},{label:"503",value:"503"},{label:"504",value:"504"},{label:"505",value:"505"},{label:"506",value:"506"},{label:"507",value:"507"},{label:"508",value:"508"},{label:"509",value:"509"},{label:"510",value:"510"},{label:"511",value:"511"},{label:"520",value:"520"},{label:"521",value:"521"},{label:"522",value:"522"},{label:"523",value:"523"},{label:"524",value:"524"},{label:"525",value:"525"},{label:"526",value:"526"},{label:"527",value:"527"},{label:"529",value:"529"},{label:"530",value:"530"},{label:"561",value:"561"},{label:"598",value:"598"},{label:"599",value:"599"}],pt=10,ut=65536,Zi=0,Gi=65535,we=0,_e=255,La=0,Ra=255,Xi=0,ec=65535,za=0,Ja=65535,tc=0,ac=2**31,ft=["200","302"],mt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],gt=["429","404","500","501","502","503","504","505"],yt=["429","500","503"];function Pe(){const e=i=>/^\d+$/.test(i),l=(i,d,u)=>{if(e(i)){const p=Number(i);return p>=d&&p<=u}else return!1},a=i=>i.map(d=>Number(d)),r=i=>i.map(d=>d.toString()),o=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:ft,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:gt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:mt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:yt,tcpFailures:"5"}});return{isInteger:e,inRange:l,stringToNumberArray:a,numberToStringArray:r,upstreamsResponseToFields:i=>{var u,p,n,k,w,f,m,N,C,O,V,S,q,A,x,I,_,T,H,v,U,F,D,M,B,$,K,y,g,b,R,j,z,G,L,ee,me,Ve,Qa,Ya,Za,Ga,Xa,el,tl,al,ll,rl,ol,nl,sl,il,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,wl,_l,Sl,xl,Nl,Vl,Bl,Il,Tl,Hl,El,Al,Fl,Ol,ql,Ul,$l,vl,Dl,Ml,jl,Kl,Pl,Ll,Rl,zl,Jl,Wl,Ql,Yl,Zl,Gl,Xl,er,tr,ar,lr,rr,or,nr,sr,ir,cr,dr,hr;const d=o();return d.name=i.name||"",d.algorithm=i.algorithm||"round-robin",d.hostHeader=i.host_header||"",d.clientCertificate=i.client_certificate?(u=i.client_certificate)==null?void 0:u.id:"",d.tags=((p=i.tags)==null?void 0:p.join(", "))||"",d.slots=i.slots!==null&&i.slots!==void 0?i.slots.toString():"10000",d.hashOn=i.hash_on||"none",d.hashFallback=i.hash_fallback||"none",d.hashOnHeader=i.hash_on_header||"",d.hashOnCookie=i.hash_on_cookie||"",d.hashOnCookiePath=i.hash_on_cookie_path||"/",d.hashOnQueryArgument=i.hash_on_query_arg||"",d.hashOnUriCapture=i.hash_on_uri_capture||"",d.hashFallbackHeader=i.hash_fallback_header||"",d.hashFallbackQueryArgument=i.hash_fallback_query_arg||"",d.hashFallbackUriCapture=i.hash_fallback_uri_capture||"",d.healthchecksThreshold=i.healthchecks.threshold!==null&&i.healthchecks.threshold!==void 0?i.healthchecks.threshold.toString():"",d.activeHealthSwitch=((k=(n=i.healthchecks.active)==null?void 0:n.healthy)==null?void 0:k.interval)!==0||((f=(w=i.healthchecks.active)==null?void 0:w.unhealthy)==null?void 0:f.interval)!==0,d.activeHealthCheck.type=((m=i.healthchecks.active)==null?void 0:m.type)||"http",d.activeHealthCheck.httpPath=((N=i.healthchecks.active)==null?void 0:N.http_path)||"/",d.activeHealthCheck.timeout=((C=i.healthchecks.active)==null?void 0:C.timeout)!==null&&((O=i.healthchecks.active)==null?void 0:O.timeout)!==void 0?(S=(V=i.healthchecks.active)==null?void 0:V.timeout)==null?void 0:S.toString():"",d.activeHealthCheck.concurrency=((q=i.healthchecks.active)==null?void 0:q.concurrency)!==null&&((A=i.healthchecks.active)==null?void 0:A.concurrency)!==void 0?(I=(x=i.healthchecks.active)==null?void 0:x.concurrency)==null?void 0:I.toString():"",d.activeHealthCheck.httpsSni=((_=i.healthchecks.active)==null?void 0:_.https_sni)||"",d.activeHealthCheck.verifySsl=((T=i.healthchecks.active)==null?void 0:T.https_verify_certificate)||!1,d.activeHealthCheck.headers=(H=i.healthchecks.active)!=null&&H.headers&&Object.entries((v=i.healthchecks.active)==null?void 0:v.headers).length>0?Object.entries((U=i.healthchecks.active)==null?void 0:U.headers).map(([Kc,kt])=>({key:Kc,values:kt==null?void 0:kt.join(", ")})):[{key:"",values:""}],d.activeHealthCheck.interval=((D=(F=i.healthchecks.active)==null?void 0:F.healthy)==null?void 0:D.interval)!==null&&((B=(M=i.healthchecks.active)==null?void 0:M.healthy)==null?void 0:B.interval)!==void 0?(y=(K=($=i.healthchecks.active)==null?void 0:$.healthy)==null?void 0:K.interval)==null?void 0:y.toString():"0",d.activeHealthCheck.interval=((b=(g=i.healthchecks.active)==null?void 0:g.healthy)==null?void 0:b.interval)!==null&&((j=(R=i.healthchecks.active)==null?void 0:R.healthy)==null?void 0:j.interval)!==void 0?(L=(G=(z=i.healthchecks.active)==null?void 0:z.healthy)==null?void 0:G.interval)==null?void 0:L.toString():"0",d.activeHealthCheck.successes=((me=(ee=i.healthchecks.active)==null?void 0:ee.healthy)==null?void 0:me.successes)!==null&&((Qa=(Ve=i.healthchecks.active)==null?void 0:Ve.healthy)==null?void 0:Qa.successes)!==void 0?(Ga=(Za=(Ya=i.healthchecks.active)==null?void 0:Ya.healthy)==null?void 0:Za.successes)==null?void 0:Ga.toString():"0",d.activeHealthCheck.httpStatuses=(el=(Xa=i.healthchecks.active)==null?void 0:Xa.healthy)!=null&&el.http_statuses?r(((al=(tl=i.healthchecks.active)==null?void 0:tl.healthy)==null?void 0:al.http_statuses)||[]):ft,d.activeHealthCheck.unhealthyInterval=((rl=(ll=i.healthchecks.active)==null?void 0:ll.unhealthy)==null?void 0:rl.interval)!==null&&((nl=(ol=i.healthchecks.active)==null?void 0:ol.unhealthy)==null?void 0:nl.interval)!==void 0?(cl=(il=(sl=i.healthchecks.active)==null?void 0:sl.unhealthy)==null?void 0:il.interval)==null?void 0:cl.toString():"0",d.activeHealthCheck.httpFailures=((hl=(dl=i.healthchecks.active)==null?void 0:dl.unhealthy)==null?void 0:hl.http_failures)!==null&&((ul=(pl=i.healthchecks.active)==null?void 0:pl.unhealthy)==null?void 0:ul.http_failures)!==void 0?(gl=(ml=(fl=i.healthchecks.active)==null?void 0:fl.unhealthy)==null?void 0:ml.http_failures)==null?void 0:gl.toString():"0",d.activeHealthCheck.unhealthyTimeouts=((kl=(yl=i.healthchecks.active)==null?void 0:yl.unhealthy)==null?void 0:kl.timeouts)!==null&&((Cl=(bl=i.healthchecks.active)==null?void 0:bl.unhealthy)==null?void 0:Cl.timeouts)!==void 0?(Sl=(_l=(wl=i.healthchecks.active)==null?void 0:wl.unhealthy)==null?void 0:_l.timeouts)==null?void 0:Sl.toString():"0",d.activeHealthCheck.unhealthyHttpStatuses=(Nl=(xl=i.healthchecks.active)==null?void 0:xl.unhealthy)!=null&&Nl.http_statuses?r(((Bl=(Vl=i.healthchecks.active)==null?void 0:Vl.unhealthy)==null?void 0:Bl.http_statuses)||[]):gt,d.passiveHealthSwitch=((Tl=(Il=i.healthchecks.passive)==null?void 0:Il.healthy)==null?void 0:Tl.successes)!==0||((El=(Hl=i.healthchecks.passive)==null?void 0:Hl.unhealthy)==null?void 0:El.timeouts)!==0||((Fl=(Al=i.healthchecks.passive)==null?void 0:Al.unhealthy)==null?void 0:Fl.tcp_failures)!==0||((ql=(Ol=i.healthchecks.passive)==null?void 0:Ol.unhealthy)==null?void 0:ql.http_failures)!==0,d.passiveHealthCheck.type=((Ul=i.healthchecks.passive)==null?void 0:Ul.type)||"http",d.passiveHealthCheck.successes=((vl=($l=i.healthchecks.passive)==null?void 0:$l.healthy)==null?void 0:vl.successes)!==null&&((Ml=(Dl=i.healthchecks.passive)==null?void 0:Dl.healthy)==null?void 0:Ml.successes)!==void 0?(Pl=(Kl=(jl=i.healthchecks.passive)==null?void 0:jl.healthy)==null?void 0:Kl.successes)==null?void 0:Pl.toString():"0",d.passiveHealthCheck.httpStatuses=(Rl=(Ll=i.healthchecks.passive)==null?void 0:Ll.healthy)!=null&&Rl.http_statuses?r(((Jl=(zl=i.healthchecks.passive)==null?void 0:zl.healthy)==null?void 0:Jl.http_statuses)||[]):mt,d.passiveHealthCheck.timeouts=((Ql=(Wl=i.healthchecks.passive)==null?void 0:Wl.unhealthy)==null?void 0:Ql.timeouts)!==null&&((Zl=(Yl=i.healthchecks.passive)==null?void 0:Yl.unhealthy)==null?void 0:Zl.timeouts)!==void 0?(er=(Xl=(Gl=i.healthchecks.passive)==null?void 0:Gl.unhealthy)==null?void 0:Xl.timeouts)==null?void 0:er.toString():"0",d.passiveHealthCheck.tcpFailures=((ar=(tr=i.healthchecks.passive)==null?void 0:tr.unhealthy)==null?void 0:ar.tcp_failures)!==null&&((rr=(lr=i.healthchecks.passive)==null?void 0:lr.unhealthy)==null?void 0:rr.tcp_failures)!==void 0?(sr=(nr=(or=i.healthchecks.passive)==null?void 0:or.unhealthy)==null?void 0:nr.tcp_failures)==null?void 0:sr.toString():"",d.passiveHealthCheck.unhealthyHttpStatuses=(cr=(ir=i.healthchecks.passive)==null?void 0:ir.unhealthy)!=null&&cr.http_statuses?r(((hr=(dr=i.healthchecks.passive)==null?void 0:dr.unhealthy)==null?void 0:hr.http_statuses)||[]):yt,d},getDefaultUpstreamFields:o,objectsAreEqual:(i,d)=>{try{return JSON.stringify(i)===JSON.stringify(d)}catch{return!1}},cloneDeep:i=>JSON.parse(JSON.stringify(i))}}const ce={useI18n:Yi,useMultiselectCreation:Oe,useHelpers:Pe},Se="/api/runtime_groups/{controlPlaneId}",xe="/{workspace}",Ne={list:{konnect:`${Se}/upstreams`,kongManager:`${xe}/upstreams`},form:{konnect:{getServices:`${Se}/services`,getCertificates:`${Se}/certificates`,validate:`${Se}/v1/schemas/json/upstream/validate`,create:`${Se}/upstreams`,edit:`${Se}/upstreams/{id}`},kongManager:{getServices:`${xe}/services`,getCertificates:`${xe}/certificates`,validate:`${xe}/schemas/upstreams/validate`,create:`${xe}/upstreams`,edit:`${xe}/upstreams/{id}`}}},lc={class:"kong-ui-entities-upstreams-list"},rc={class:"upstream-name"},oc=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:l}){var M;const a=e,{i18n:{t:r}}=ce.useI18n(),o=ze.useRouter(),{axiosInstance:s}=je({headers:(M=a.config)==null?void 0:M.requestHeaders}),c=t.ref(1),h=t.computed(()=>a.config.app!=="kongManager"||!!a.config.disableSorting),i={name:{label:r("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:r("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:r("upstreams.list.table_headers.tags"),sortable:!1}},d=i,u=t.computed(()=>{var $,K;let B=`${a.config.apiBaseUrl}${Ne.list[a.config.app]}`;return a.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,(($=a.config)==null?void 0:$.controlPlaneId)||""):a.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(K=a.config)!=null&&K.workspace?`/${a.config.workspace}`:"")),B}),p=t.ref(""),n=t.computed(()=>{const B=a.config.app==="konnect"||a.config.isExactMatch;if(B)return{isExactMatch:B,placeholder:r("upstreams.search.placeholder")};const{name:$,slots:K}=i;return{isExactMatch:B,fields:{name:$,slots:K},schema:a.config.filterSchema}}),{fetcher:k,fetcherState:w}=Ka(a.config,u.value),f=()=>{p.value=""},m=()=>{c.value++},N=t.ref(null),C=(B,$)=>{const K=B.id;if(!$(K)){l("copy:error",{entity:B,field:"id",message:r("upstreams.errors.copy")});return}l("copy:success",{entity:B,field:"id",message:r("upstreams.copy.success",{val:K})})},O=(B,$)=>{const K=JSON.stringify(B);if(!$(K)){l("copy:error",{entity:B,message:r("upstreams.errors.copy")});return}l("copy:success",{entity:B,message:r("upstreams.copy.success_brief")})},V=async B=>{var K;await((K=a.canRetrieve)==null?void 0:K.call(a,B))&&o.push(a.config.getViewRoute(B.id))},S=B=>({label:r("upstreams.actions.view"),to:a.config.getViewRoute(B)}),q=B=>({label:r("upstreams.actions.edit"),to:a.config.getEditRoute(B)}),A=t.ref(void 0),x=t.ref(!1),I=t.ref(!1),_=t.ref(""),T=Ma(a.config,u.value),H=B=>{A.value=B,x.value=!0},v=()=>{x.value=!1},U=async()=>{var B,$,K;if((B=A.value)!=null&&B.id){I.value=!0;try{await s.delete(T(A.value.id)),I.value=!1,x.value=!1,c.value++,l("delete:success",A.value)}catch(y){_.value=((K=($=y.response)==null?void 0:$.data)==null?void 0:K.message)||y.message||r("upstreams.errors.delete"),l("error",y)}finally{I.value=!1}}},F=t.ref(!0);t.watch(w,B=>{var $,K,y,g;if(Array.isArray(($=B==null?void 0:B.response)==null?void 0:$.data)&&(F.value=B.response.data.length>0),B.status===he.Error){N.value={title:r("upstreams.errors.general")},(g=(y=(K=B.error)==null?void 0:K.response)==null?void 0:y.data)!=null&&g.message&&(N.value.message=B.error.response.data.message),l("error",B.error);return}N.value=null});const D=t.ref({ctaPath:a.config.createRoute,ctaText:void 0,message:r("upstreams.list.empty_state.description"),title:r("upstreams.title")});return t.onBeforeMount(async()=>{await a.canCreate()&&(D.value.title=r("upstreams.list.empty_state.title"),D.value.ctaText=r("upstreams.actions.create"))}),(B,$)=>{const K=t.resolveComponent("KButton"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KTruncate"),b=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",lc,[t.createVNode(t.unref($a),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":h.value,"empty-state-options":D.value,"enable-entity-actions":"","error-message":N.value,fetcher:t.unref(k),"fetcher-cache-key":c.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:p.value,"table-headers":t.unref(d),"use-action-outside":e.useActionOutside,onClearSearchInput:f,"onClick:row":$[1]||($[1]=j=>V(j)),onSort:m},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(ji),{modelValue:p.value,"onUpdate:modelValue":$[0]||($[0]=j=>p.value=j),config:n.value},null,8,["modelValue","config"])]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(ie),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,F.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:t.withCtx(({rowValue:j})=>[t.createElementVNode("span",rc,t.toDisplayString(j),1)]),tags:t.withCtx(({rowValue:j})=>[t.createVNode(g,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j,z=>(t.openBlock(),t.createBlock(y,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:j})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(b,{"data-testid":"action-entity-copy-id",onClick:G=>C(j,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(b,{"data-testid":"action-entity-copy-json",onClick:G=>O(j,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ie),{"auth-function":()=>e.canRetrieve(j)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-view","has-divider":"",item:S(j.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canEdit(j)},{default:t.withCtx(()=>[t.createVNode(b,{"data-testid":"action-entity-edit",item:q(j.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canDelete(j)},{default:t.withCtx(()=>[t.createVNode(b,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>H(j)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(va),{"action-pending":I.value,description:t.unref(r)("upstreams.delete.description"),"entity-name":A.value&&(A.value.name||A.value.id),"entity-type":t.unref(Je).Upstream,error:_.value,title:t.unref(r)("upstreams.delete.title"),visible:x.value,onCancel:v,onProceed:U},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),de=(e,l)=>{const a=e.__vccOpts||e;for(const[r,o]of l)a[r]=o;return a},nc=de(oc,[["__scopeId","data-v-1082fd6a"]]),Le={list:{konnect:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",kongManager:"/{workspace}/upstreams/{upstreamId}/targets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",edit:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/target/validate"},kongManager:{create:"/{workspace}/upstreams/{upstreamId}/targets",edit:"/{workspace}/upstreams/{upstreamId}/targets/{id}",validate:"/{workspace}/schemas/targets/validate"}}},sc={class:"kong-ui-entities-target-form"},ic={class:"target-form-container"},cc={key:0,class:"target-form-info"},Wa=de(t.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:l}){var V;const a=e;t.useCssVars(S=>({"2094a329":O.value}));const{i18n:{t:r}}=ce.useI18n(),{getMessageFromError:o}=ja(),{axiosInstance:s}=je({headers:(V=a.config)==null?void 0:V.requestHeaders}),c=t.computed(()=>{var S;return Le.form[a.config.app].edit.replace(/{upstreamId}/gi,((S=a.config)==null?void 0:S.upstreamId)||"")}),h=t.computed(()=>a.targetId?oe.Edit:oe.Create),i=t.computed(()=>h.value===oe.Edit?r("targets.form.edit.title"):r("targets.form.create.title")),d=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),p={target:"",weight:100,tags:""},n=t.computed(()=>{const S=parseInt(d.fields.weight.toString(),10);return S<0||S>65535}),k=t.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(u)&&!!d.fields.target&&!!d.fields.weight&&!n.value),w=S=>{var q;d.fields.target=(S==null?void 0:S.target)||"",d.fields.weight=(S==null?void 0:S.weight)??"",d.fields.tags=((q=S==null?void 0:S.tags)==null?void 0:q.join(", "))||"",Object.assign(u,d.fields)},f=()=>{d.errorMessage="",l("cancel")},m=t.computed(()=>{var q,A;let S=`${a.config.apiBaseUrl}${Le.form[a.config.app].validate}`;return a.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((q=a.config)==null?void 0:q.controlPlaneId)||""):a.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(A=a.config)!=null&&A.workspace?`/${a.config.workspace}`:"")),S=S.replace(/{id}/gi,a.targetId),S}),N=t.computed(()=>{var q,A,x,I;let S=`${a.config.apiBaseUrl}${Le.form[a.config.app][h.value]}`;return a.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((q=a.config)==null?void 0:q.controlPlaneId)||"").replace(/{upstreamId}/gi,((A=a.config)==null?void 0:A.upstreamId)||""):a.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(x=a.config)!=null&&x.workspace?`/${a.config.workspace}`:"").replace(/{upstreamId}/gi,((I=a.config)==null?void 0:I.upstreamId)||"")),S=S.replace(/{id}/gi,a.targetId),S}),C=async()=>{var S,q,A,x,I;try{d.isReadonly=!0,d.errorMessage="";const _={target:d.fields.target,weight:parseInt(d.fields.weight),tags:(A=(q=(S=d.fields.tags)==null?void 0:S.split(","))==null?void 0:q.map(H=>String(H||"").trim()))==null?void 0:A.filter(H=>H!==""),upstream:{id:a.config.upstreamId}};let T;if(await s.post(m.value,_),h.value==="create"?T=await s.post(N.value,_):h.value==="edit"&&(T=((x=a.config)==null?void 0:x.app)==="konnect"?await s.put(N.value,_):await s.patch(N.value,_)),T){const{data:H}=T;d.fields.target=(H==null?void 0:H.name)||"",d.fields.weight=(H==null?void 0:H.weight)??100,d.fields.tags=((I=H==null?void 0:H.tags)==null?void 0:I.join(", "))||"",l("update",H),Object.assign(d.fields,p)}}catch(_){d.errorMessage=o(_),l("error",_)}finally{d.isReadonly=!1}},O=t.computed(()=>d.isReadonly?"inline-flex":"none");return t.watch(()=>a.targetId,()=>{Object.assign(d.fields,p)}),(S,q)=>{const A=t.resolveComponent("KInput"),x=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(x,{"action-button-text":t.unref(r)("targets.form.buttons.save"),"action-pending":!k.value||d.isReadonly,"cancel-button-text":t.unref(r)("targets.form.buttons.cancel"),"is-visible":e.isVisible,title:i.value,onCanceled:f,onProceed:C},{"body-content":t.withCtx(()=>[t.createElementVNode("div",sc,[t.createVNode(t.unref(Ua),{config:e.config,"edit-id":e.targetId,"error-message":d.errorMessage,"fetch-url":c.value,"is-readonly":d.isReadonly,onCancel:f,"onFetch:error":q[3]||(q[3]=I=>S.$emit("error",I)),"onFetch:success":w,onLoading:q[4]||(q[4]=I=>S.$emit("loading",I))},{default:t.withCtx(()=>[t.createElementVNode("div",ic,[S.$slots.info?(t.openBlock(),t.createElementBlock("div",cc,[t.renderSlot(S.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(A,{modelValue:d.fields.target,"onUpdate:modelValue":q[0]||(q[0]=I=>d.fields.target=I),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(r)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(r)("targets.form.fields.target.tooltip")},placeholder:t.unref(r)("targets.form.fields.target.placeholder"),readonly:d.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(A,{modelValue:d.fields.weight,"onUpdate:modelValue":q[1]||(q[1]=I=>d.fields.weight=I),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:n.value,"error-message":t.unref(r)("targets.errors.weight"),label:t.unref(r)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(r)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:d.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(A,{modelValue:d.fields.tags,"onUpdate:modelValue":q[2]||(q[2]=I=>d.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(r)("targets.form.fields.tags.help"),label:t.unref(r)("targets.form.fields.tags.label"),placeholder:t.unref(r)("targets.form.fields.tags.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","is-readonly"])])]),_:3},8,["action-button-text","action-pending","cancel-button-text","is-visible","title"])}}}),[["__scopeId","data-v-45a3f9ee"]]),dc={class:"kong-ui-entities-targets-list"},hc={class:"target-address"},pc=de(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:l}){var K;const a=e,{i18n:{t:r}}=ce.useI18n(),{axiosInstance:o}=je({headers:(K=a.config)==null?void 0:K.requestHeaders}),s=t.ref(1),c=t.computed(()=>a.config.app!=="kongManager"||!!a.config.disableSorting),i={target:{label:r("targets.list.table_headers.target_address"),sortable:!0},weight:{label:r("targets.list.table_headers.weight"),sortable:!0},tags:{label:r("targets.list.table_headers.tags"),sortable:!1}},d=t.computed(()=>{var g,b,R,j;let y=`${a.config.apiBaseUrl}${Le.list[a.config.app]}`;return a.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((g=a.config)==null?void 0:g.controlPlaneId)||"").replace(/{upstreamId}/gi,((b=a.config)==null?void 0:b.upstreamId)||""):a.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(R=a.config)!=null&&R.workspace?`/${a.config.workspace}`:"").replace(/{upstreamId}/gi,((j=a.config)==null?void 0:j.upstreamId)||"")),y}),{fetcher:u,fetcherState:p}=Ka(a.config,d.value),n=()=>{s.value++},k=t.ref(null),w=()=>{D.value=!0},f=(y,g)=>{const b=y.id;if(!g(b)){l("copy:error",{entity:y,field:"id",message:r("targets.errors.copy")});return}l("copy:success",{entity:y,field:"id",message:r("targets.copy.success",{val:b})})},m=(y,g)=>{const b=JSON.stringify(y);if(!g(b)){l("copy:error",{entity:y,message:r("targets.errors.copy")});return}l("copy:success",{entity:y,message:r("targets.copy.success_brief")})},N=y=>{F.value=y,D.value=!0},C=y=>a.config.app==="konnect"?!1:a.config.canMarkHealthy(y),O=y=>a.config.app==="konnect"?!1:a.config.canMarkUnhealthy(y),V=t.ref(void 0),S=t.ref(!1),q=t.ref(!1),A=t.ref(""),x=Ma(a.config,d.value),I=y=>{V.value=y,S.value=!0},_=()=>{S.value=!1},T=async()=>{var y,g,b;if((y=V.value)!=null&&y.id){q.value=!0;try{await o.delete(x(V.value.id)),q.value=!1,S.value=!1,s.value++,l("delete:success",V.value)}catch(R){A.value=((b=(g=R.response)==null?void 0:g.data)==null?void 0:b.message)||R.message||r("targets.errors.delete"),l("error",R)}finally{q.value=!1}}},H=t.ref(!0);t.watch(p,y=>{var g,b,R,j;if(Array.isArray((g=y==null?void 0:y.response)==null?void 0:g.data)&&(H.value=y.response.data.length>0),y.status===he.Error){k.value={title:r("targets.errors.general")},(j=(R=(b=y.error)==null?void 0:b.response)==null?void 0:R.data)!=null&&j.message&&(k.value.message=y.error.response.data.message),l("error",y.error);return}k.value=null});const v=t.ref({ctaText:void 0,message:r("targets.list.empty_state.description"),title:r("targets.title"),...a.config.createRoute&&{ctaPath:a.config.createRoute}});t.onBeforeMount(async()=>{await a.canCreate()&&(v.value.title=r("targets.list.empty_state.title"),v.value.ctaText=r("targets.actions.create"))});const U=t.computed(()=>({app:a.config.app,apiBaseUrl:a.config.apiBaseUrl,upstreamId:a.config.upstreamId,...a.config.app==="konnect"&&{controlPlaneId:a.config.controlPlaneId},...a.config.app==="kongManager"&&{workspace:a.config.workspace,requestHeaders:a.config.requestHeaders}})),F=t.ref(""),D=t.ref(!1),M=y=>{F.value?l("update:target",y):l("create:target",y),B()},B=()=>{$(),s.value++},$=()=>{D.value=!1,F.value=""};return(y,g)=>{const b=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),j=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),G=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",dc,[t.createVNode(t.unref($a),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":v.value,"enable-entity-actions":"","error-message":k.value,fetcher:t.unref(u),"fetcher-cache-key":s.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(i),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:g[1]||(g[1]=()=>a.config.createRoute?void 0:w()),onSort:n},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(ie),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(b,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:a.config.createRoute?a.config.createRoute:void 0,onClick:g[0]||(g[0]=()=>a.config.createRoute?void 0:w())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,H.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:L})=>[t.createElementVNode("span",hc,t.toDisplayString(L),1)]),tags:t.withCtx(({rowValue:L})=>[t.createVNode(j,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(L,ee=>(t.openBlock(),t.createBlock(R,{key:ee,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ee),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:L})=>[t.createVNode(G,null,{default:t.withCtx(({copyToClipboard:ee})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:me=>f(L,ee)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(G,null,{default:t.withCtx(({copyToClipboard:ee})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:me=>m(L,ee)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ie),{"auth-function":()=>e.canEdit(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:ee=>N(L.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>C(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:ee=>l("health-actions:healthy",L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>O(L)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:ee=>l("health-actions:unhealthy",L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ie),{"auth-function":()=>e.canDelete(L)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ee=>I(L)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("targets.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","table-headers","use-action-outside"]),t.createVNode(t.unref(va),{"action-pending":q.value,description:t.unref(r)("targets.delete.description"),"entity-type":t.unref(Je).Target,error:A.value,"need-confirm":!1,title:t.unref(r)("targets.delete.title"),visible:S.value,onCancel:_,onProceed:T},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Wa,{config:U.value,"is-visible":D.value,"target-id":F.value,onCancel:$,onUpdate:M},t.createSlots({_:2},[y.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-268875d2"]]),uc={key:1},fc=de(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:l}){var _,T,H,v;const a=e,{i18nT:r,i18n:{t:o}}=ce.useI18n(),{debouncedQueryChange:s,loading:c,loadItems:h,results:i,allRecords:d}=Pa(a.config,(T=Ne.form[(_=a.config)==null?void 0:_.app])==null?void 0:T.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:p,loadItems:n,results:k}=Pa(a.config,(v=Ne.form[(H=a.config)==null?void 0:H.app])==null?void 0:v.getCertificates),w=t.ref(""),f=t.computed(()=>{var U;return!!a.name&&!((U=d.value)!=null&&U.some(F=>F.host===a.name))}),m=t.computed(()=>{var F,D,M;const U=f.value&&a.name.includes((F=w.value)==null?void 0:F.toLowerCase());return(M=i.value)==null?void 0:M.map(B=>({label:B.host,value:B.id})).concat(U?[{label:a.name,value:((D=O.value)==null?void 0:D.value)||a.name}]:[])}),N=t.computed(()=>{var U;return(U=k.value)==null?void 0:U.map(F=>({label:F.id,value:F.id}))}),C=t.ref(""),O=t.ref({value:"",label:""}),V=t.computed(()=>{var U,F;return((U=m.value.find(D=>D.value===C.value))==null?void 0:U.label)||((F=O.value)==null?void 0:F.label)}),S=U=>{w.value=U,s(U)},q=U=>{O.value=U},A=()=>{O.value={value:"",label:""}},x=U=>{C.value=U,l("update:name",V.value)},I=t.ref(!1);return t.onBeforeMount(async()=>{var U,F;try{I.value=!0,await h(),a.name&&(C.value=((F=(U=m.value.find(D=>D.label===a.name))==null?void 0:U.value)==null?void 0:F.toString())||a.name),await n()}finally{I.value=!1}}),(U,F)=>{const D=t.resolveComponent("KSkeleton"),M=t.resolveComponent("KSelect"),B=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(o)("upstreams.form.general_info.help"),title:t.unref(o)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[I.value?(t.openBlock(),t.createBlock(D,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",uc,[t.createVNode(M,{appearance:"select",autosuggest:"",class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"",items:m.value,label:t.unref(o)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(c),"model-value":C.value,placeholder:t.unref(o)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%","onItem:added":q,"onItem:removed":A,onQueryChange:S,"onUpdate:modelValue":x},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(o)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":F[0]||(F[0]=$=>l("update:host-header",$))},null,8,["label","model-value","readonly"]),t.createVNode(M,{appearance:"select",autosuggest:"",class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"",items:N.value,label:t.unref(o)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(o)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(p),"model-value":e.clientCertificate,placeholder:t.unref(o)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":F[1]||(F[1]=$=>l("update:client-certificate",$))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(B,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(o)("upstreams.form.fields.tags.help"),label:t.unref(o)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(o)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(o)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":F[2]||(F[2]=$=>l("update:tags",$))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-02065a3d"]]),Re={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},mc={class:"fields-group-title"},gc={class:"fields-group-text"},yc={class:"fields-group-title"},kc={class:"fields-group-text"},bc=de(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:l}){const a=e,{i18nT:r,i18n:{t:o}}=ce.useI18n(),{inRange:s}=Pe(),c=t.ref([{label:o("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:o("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:o("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:o("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),h=t.ref([{label:o("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:o("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:o("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:o("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:o("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:o("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:o("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:o("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>a.hashOn,(u,p)=>{p==="header"&&u!==p&&l("update:hash-on-header",""),p==="cookie"&&u!==p&&(l("update:hash-on-cookie",""),l("update:hash-on-cookie-path","/")),p==="query_arg"&&u!==p&&l("update:hash-on-query-argument",""),p==="uri_capture"&&u!==p&&l("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(l("update:hash-fallback","none"),l("update:hash-fallback-header",""),l("update:hash-fallback-query-argument",""),l("update:hash-fallback-uri-capture",""))}),t.watch(()=>a.hashFallback,(u,p)=>{p==="header"&&u!==p&&l("update:hash-fallback-header",""),p==="cookie"&&u!==p&&(l("update:hash-on-cookie",""),l("update:hash-on-cookie-path","/")),p==="query_arg"&&u!==p&&l("update:hash-fallback-query-argument",""),p==="uri_capture"&&u!==p&&l("update:hash-fallback-uri-capture","")});const i=t.computed(()=>a.hashOn==="cookie"||a.hashOn==="none"),d=t.computed(()=>a.slots?s(a.slots,pt,ut)?"":o("upstreams.form.errors.in_range"):"");return(u,p)=>{const n=t.resolveComponent("KExternalLink"),k=t.resolveComponent("KSelect"),w=t.resolveComponent("KInput"),f=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(o)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(n,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(k,{appearance:"select",class:"algorithm-select",items:c.value,label:t.unref(o)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=m=>l("update:algorithm",m))},null,8,["items","label","model-value","readonly"]),t.createVNode(w,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!d.value,"error-message":d.value,help:t.unref(o)("upstreams.form.fields.slots.help"),label:t.unref(o)("upstreams.form.fields.slots.label"),max:t.unref(ut),min:t.unref(pt),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=m=>l("update:slots",m))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(f,null,{default:t.withCtx(()=>[t.createElementVNode("h5",mc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",gc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_on.help")),1),t.createVNode(k,{appearance:"select",class:"hash-on-select",items:h.value,label:t.unref(o)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[2]||(p[2]=m=>l("update:hash-on",m))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(w,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(o)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[3]||(p[3]=m=>l("update:hash-on-header",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(w,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(o)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[4]||(p[4]=m=>l("update:hash-on-cookie",m))},null,8,["label","model-value","readonly"]),t.createVNode(w,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(o)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[5]||(p[5]=m=>l("update:hash-on-cookie-path",m))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(w,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(o)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[6]||(p[6]=m=>l("update:hash-on-query-argument",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(w,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(o)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[7]||(p[7]=m=>l("update:hash-on-uri-capture",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(f,null,{default:t.withCtx(()=>[t.createElementVNode("h5",yc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",kc,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(k,{appearance:"select",class:"hash-fallback-select",disabled:i.value,items:h.value,label:t.unref(o)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[8]||(p[8]=m=>l("update:hash-fallback",m))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(w,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(o)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[9]||(p[9]=m=>l("update:hash-fallback-header",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(w,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(o)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[10]||(p[10]=m=>l("update:hash-on-cookie",m))},null,8,["label","model-value","readonly"]),t.createVNode(w,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(o)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[11]||(p[11]=m=>l("update:hash-on-cookie-path",m))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(w,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(o)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[12]||(p[12]=m=>l("update:hash-fallback-query-argument",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(w,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(o)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":p[13]||(p[13]=m=>l("update:hash-fallback-uri-capture",m))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-3a210772"]]),Cc={class:"fields-group-title"},wc={class:"fields-group-text"},_c={class:"fields-group-title"},Sc={class:"fields-group-text"},xc=de(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:l}){const{i18n:{t:a}}=ce.useI18n();return(r,o)=>{const s=t.resolveComponent("KExternalLink"),c=t.resolveComponent("KInputSwitch"),h=t.resolveComponent("KCard"),i=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(Re).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(h,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Cc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",wc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(c,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:o[0]||(o[0]=d=>l("update:active-health-switch",d))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,null,{default:t.withCtx(()=>[t.createElementVNode("h5",_c,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",Sc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(c,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:o[1]||(o[1]=d=>l("update:passive-health-switch",d))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(i,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(Gi),min:t.unref(Zi),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":o[2]||(o[2]=d=>l("update:healthchecks-threshold",d))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),Nc={key:2},Vc={class:"fields-group-title"},Bc={class:"fields-group-text"},Ic={class:"fields-group-title"},Tc={class:"fields-group-text"},Hc=de(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:l}){const a=e,{i18n:{t:r}}=ce.useI18n(),{objectsAreEqual:o}=Pe(),s=t.ref([{label:r("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),c=t.computed(()=>a.type==="https"||a.type==="grpcs"),h=t.computed(()=>a.type==="tcp"),{trackNewItems:i}=Oe({replaceId:!0}),{trackNewItems:d}=Oe({replaceId:!0});t.watch(()=>a.type,(w,f)=>{f==="tcp"&&w!==f&&l("update:tcp-failures","5"),(f==="https"||f==="grpcs")&&w!==f&&(l("update:https-sni",""),l("update:verify-ssl",!1)),f!=="tcp"&&w==="tcp"&&(l("update:http-path","/"),l("update:http-statuses",ft),l("update:unhealthy-http-statuses",gt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>a.headers,w=>{o(u.value,w)||(u.value=[...w])},{immediate:!0,deep:!0});const p=()=>{l("update:headers",u.value)},n=()=>{u.value.push({key:"",values:""}),p()},k=w=>{w===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(w,1),p()};return(w,f)=>{const m=t.resolveComponent("KExternalLink"),N=t.resolveComponent("KSelect"),C=t.resolveComponent("KInput"),O=t.resolveComponent("KCheckbox"),V=t.resolveComponent("KLabel"),S=t.resolveComponent("KIcon"),q=t.resolveComponent("KButton"),A=t.resolveComponent("KMultiselect"),x=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(r)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(m,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var I;return[t.createVNode(N,{appearance:"select",class:"active-healthcheck-type-select",items:s.value,label:t.unref(r)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=_=>l("update:type",_))},null,8,["items","label","model-value","readonly"]),h.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(r)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":f[1]||(f[1]=_=>l("update:http-path",_))},null,8,["label","model-value","readonly"])),t.createVNode(C,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(r)("upstreams.form.fields.timeout.label"),max:t.unref(ec),min:t.unref(Xi),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":f[2]||(f[2]=_=>l("update:timeout",_))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(C,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(r)("upstreams.form.fields.concurrency.label"),max:t.unref(ac),min:t.unref(tc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":f[3]||(f[3]=_=>l("update:concurrency",_))},null,8,["label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(C,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(r)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":f[4]||(f[4]=_=>l("update:https-sni",_))},null,8,["label","model-value","readonly"]),t.createVNode(O,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(r)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":f[5]||(f[5]=_=>l("update:verify-ssl",_))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((I=e.config)==null?void 0:I.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",Nc,[t.createVNode(V,{info:t.unref(r)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(_,T)=>(t.openBlock(),t.createElementBlock("div",{key:`${_.header}_${T}`,class:t.normalizeClass(["headers-row",{"margin-top-6":T>0}])},[t.createVNode(C,{modelValue:u.value[T].key,"onUpdate:modelValue":H=>u.value[T].key=H,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${T+1}`,readonly:e.readonly,type:"text",onBlur:p},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(C,{modelValue:u.value[T].values,"onUpdate:modelValue":H=>u.value[T].values=H,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${T+1}`,readonly:e.readonly,type:"text",onBlur:p},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(q,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:H=>k(T)},{icon:t.withCtx(()=>[t.createVNode(S,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&T===u.value.length-1?(t.openBlock(),t.createBlock(q,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:n},{icon:t.withCtx(()=>[t.createVNode(S,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Vc,t.toDisplayString(t.unref(r)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Bc,t.toDisplayString(t.unref(r)("upstreams.form.healthy.help")),1),t.createVNode(C,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(r)("upstreams.form.fields.interval.help"),label:t.unref(r)("upstreams.form.fields.interval.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":f[6]||(f[6]=_=>l("update:interval",_))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(C,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(r)("upstreams.form.fields.successes.label"),max:t.unref(_e),min:t.unref(we),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":f[7]||(f[7]=_=>l("update:successes",_))},null,8,["label","max","min","model-value","readonly"]),h.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(A,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%","onItem:added":f[8]||(f[8]=_=>t.unref(i)(_,!0)),"onItem:removed":f[9]||(f[9]=_=>t.unref(i)(_,!1)),"onUpdate:modelValue":f[10]||(f[10]=_=>l("update:http-statuses",_))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(x,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Ic,t.toDisplayString(t.unref(r)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Tc,t.toDisplayString(t.unref(r)("upstreams.form.unhealthy.help")),1),t.createVNode(C,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(r)("upstreams.form.fields.interval.help"),label:t.unref(r)("upstreams.form.fields.interval.label"),max:t.unref(Ja),min:t.unref(za),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":f[11]||(f[11]=_=>l("update:unhealthy-interval",_))},null,8,["help","label","max","min","model-value","readonly"]),h.value?(t.openBlock(),t.createBlock(C,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(r)("upstreams.form.fields.tcp_failures.label"),max:t.unref(_e),min:t.unref(we),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":f[12]||(f[12]=_=>l("update:tcp-failures",_))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(C,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(r)("upstreams.form.fields.http_failures.label"),max:t.unref(_e),min:t.unref(we),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":f[13]||(f[13]=_=>l("update:http-failures",_))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(A,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%","onItem:added":f[14]||(f[14]=_=>t.unref(d)(_,!0)),"onItem:removed":f[15]||(f[15]=_=>t.unref(d)(_,!1)),"onUpdate:modelValue":f[16]||(f[16]=_=>l("update:unhealthy-http-statuses",_))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(C,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(r)("upstreams.form.fields.timeouts.label"),max:t.unref(Ra),min:t.unref(La),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":f[17]||(f[17]=_=>l("update:unhealthy-timeouts",_))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-305fcec9"]]),Ec={class:"fields-group-title"},Ac={class:"fields-group-text"},Fc={class:"fields-group-title"},Oc={class:"fields-group-text"},qc=de(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:l}){const a=e,{i18n:{t:r}}=ce.useI18n(),o=t.ref([{label:r("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:r("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),s=t.computed(()=>a.type==="tcp"),{trackNewItems:c}=Oe({replaceId:!0}),{trackNewItems:h}=Oe({replaceId:!0});return t.watch(()=>a.type,(i,d)=>{d==="tcp"&&i!==d&&l("update:tcp-failures","5"),d!=="tcp"&&i==="tcp"&&(l("update:http-statuses",mt),l("update:unhealthy-http-statuses",yt))}),(i,d)=>{const u=t.resolveComponent("KExternalLink"),p=t.resolveComponent("KSelect"),n=t.resolveComponent("KInput"),k=t.resolveComponent("KMultiselect"),w=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Fe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(r)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(Re).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(r)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(p,{appearance:"select",class:"passive-healthcheck-type-select",items:o.value,label:t.unref(r)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":d[0]||(d[0]=f=>l("update:type",f))},null,8,["items","label","model-value","readonly"]),t.createVNode(w,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Ec,t.toDisplayString(t.unref(r)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",Ac,t.toDisplayString(t.unref(r)("upstreams.form.passive_healthy.help")),1),t.createVNode(n,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(r)("upstreams.form.fields.successes.label"),max:t.unref(_e),min:t.unref(we),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":d[1]||(d[1]=f=>l("update:successes",f))},null,8,["label","max","min","model-value","readonly"]),s.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(k,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%","onItem:added":d[2]||(d[2]=f=>t.unref(c)(f,!0)),"onItem:removed":d[3]||(d[3]=f=>t.unref(c)(f,!1)),"onUpdate:modelValue":d[4]||(d[4]=f=>l("update:http-statuses",f))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(w,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Fc,t.toDisplayString(t.unref(r)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",Oc,t.toDisplayString(t.unref(r)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(n,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(r)("upstreams.form.fields.timeouts.label"),max:t.unref(Ra),min:t.unref(La),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":d[5]||(d[5]=f=>l("update:timeouts",f))},null,8,["label","max","min","model-value","readonly"]),s.value?(t.openBlock(),t.createBlock(n,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(r)("upstreams.form.fields.tcp_failures.label"),max:t.unref(_e),min:t.unref(we),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":d[6]||(d[6]=f=>l("update:tcp-failures",f))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(n,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(r)("upstreams.form.fields.http_failures.label"),max:t.unref(_e),min:t.unref(we),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":d[7]||(d[7]=f=>l("update:http-failures",f))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(k,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ke),label:t.unref(r)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%","onItem:added":d[8]||(d[8]=f=>t.unref(h)(f,!0)),"onItem:removed":d[9]||(d[9]=f=>t.unref(h)(f,!1)),"onUpdate:modelValue":d[10]||(d[10]=f=>l("update:unhealthy-http-statuses",f))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-43c4e55e"]]),Uc={class:"kong-ui-entities-upstreams-form"},$c=de(t.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:l}){var K;const a=e,{inRange:r,stringToNumberArray:o,upstreamsResponseToFields:s,getDefaultUpstreamFields:c,objectsAreEqual:h,cloneDeep:i}=Pe(),{axiosInstance:d}=je({headers:(K=a.config)==null?void 0:K.requestHeaders}),{getMessageFromError:u}=ja(),p=ze.useRouter(),n=t.reactive({fields:c(),readonly:!1,errorMessage:""}),k=t.reactive(c()),w=t.computed(()=>!h(n.fields,k)),f=y=>{n.fields.activeHealthCheck.interval=y?"5":"0",n.fields.activeHealthCheck.successes=y?"5":"0",n.fields.activeHealthCheck.httpFailures=y?"5":"0",n.fields.activeHealthCheck.unhealthyInterval=y?"5":"0"},m=y=>{n.fields.passiveHealthCheck.timeouts=y?"5":"0",n.fields.passiveHealthCheck.successes=y?"80":"0"},N=t.computed(()=>n.fields.slots?r(n.fields.slots,pt,ut):!0),C=t.computed(()=>n.fields.hashOn==="header"?!!n.fields.hashOnHeader:!0),O=t.computed(()=>n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie"?!!n.fields.hashOnCookie:!0),V=t.computed(()=>n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie"?!!n.fields.hashOnCookiePath:!0),S=t.computed(()=>n.fields.hashOn==="query_arg"?!!n.fields.hashOnQueryArgument:!0),q=t.computed(()=>n.fields.hashOn==="uri_capture"?!!n.fields.hashOnUriCapture:!0),A=t.computed(()=>n.fields.hashFallback==="header"?!!n.fields.hashFallbackHeader:!0),x=t.computed(()=>n.fields.hashFallback==="query_arg"?!!n.fields.hashFallbackQueryArgument:!0),I=t.computed(()=>n.fields.hashFallback==="uri_capture"?!!n.fields.hashFallbackUriCapture:!0),_=t.computed(()=>!!n.fields.name&&N.value&&C.value&&O.value&&V.value&&S.value&&q.value&&A.value&&x.value&&I.value),T=t.computed(()=>a.upstreamId?oe.Edit:oe.Create),H=t.computed(()=>{var y,g;return(g=Ne.form[(y=a.config)==null?void 0:y.app])==null?void 0:g.edit}),v=y=>{Object.assign(n.fields,s(y)),Object.assign(k,i(n.fields))},U=()=>{var y;p.push(((y=a.config)==null?void 0:y.cancelRoute)||{name:"upstreams-list"})},F=y=>{l("loading",y)},D=y=>{l("error",y)},M=()=>{var g,b,R,j,z;const y={name:n.fields.name,slots:Number(n.fields.slots),algorithm:n.fields.algorithm,hash_on:n.fields.hashOn,hash_fallback:n.fields.hashFallback,healthchecks:{}};return n.fields.hostHeader&&(y.host_header=n.fields.hostHeader),n.fields.clientCertificate&&(y.client_certificate={id:n.fields.clientCertificate}),n.fields.healthchecksThreshold&&(y.healthchecks.threshold=Number(n.fields.healthchecksThreshold)),n.fields.tags&&(y.tags=(b=(g=n.fields.tags.split(","))==null?void 0:g.map(G=>String(G||"").trim()))==null?void 0:b.filter(G=>G!=="")),n.fields.hashOn==="header"&&(y.hash_on_header=n.fields.hashOnHeader),(n.fields.hashOn==="cookie"||n.fields.hashFallback==="cookie")&&(y.hash_on_cookie=n.fields.hashOnCookie,y.hash_on_cookie_path=n.fields.hashOnCookiePath),n.fields.hashOn==="query_arg"&&(y.hash_on_query_arg=n.fields.hashOnQueryArgument),n.fields.hashOn==="uri_capture"&&(y.hash_on_uri_capture=n.fields.hashOnUriCapture),n.fields.hashFallback==="header"&&(y.hash_fallback_header=n.fields.hashFallbackHeader),n.fields.hashFallback==="query_arg"&&(y.hash_fallback_query_arg=n.fields.hashFallbackQueryArgument),n.fields.hashFallback==="uri_capture"&&(y.hash_fallback_uri_capture=n.fields.hashFallbackUriCapture),n.fields.activeHealthSwitch?(y.healthchecks.active={type:n.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},n.fields.activeHealthCheck.timeout&&(y.healthchecks.active.timeout=Number(n.fields.activeHealthCheck.timeout)),n.fields.activeHealthCheck.concurrency&&(y.healthchecks.active.concurrency=Number(n.fields.activeHealthCheck.concurrency)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpPath&&(y.healthchecks.active.http_path=n.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(n.fields.activeHealthCheck.headers.length===0?y.healthchecks.active.headers=[]:y.healthchecks.active.headers=n.fields.activeHealthCheck.headers.reduce((G,L)=>{var ee,me;return L.key?{...G,[L.key]:(me=(ee=L.values.split(","))==null?void 0:ee.map(Ve=>String(Ve||"").trim()))==null?void 0:me.filter(Ve=>Ve!=="")}:{...G}},{})),(n.fields.activeHealthCheck.type==="https"||n.fields.activeHealthCheck.type==="grpcs")&&n.fields.activeHealthCheck.httpsSni&&(y.healthchecks.active.https_sni=n.fields.activeHealthCheck.httpsSni),(n.fields.activeHealthCheck.type==="https"||n.fields.activeHealthCheck.type==="grpcs")&&(y.healthchecks.active.https_verify_certificate=n.fields.activeHealthCheck.verifySsl),n.fields.activeHealthCheck.interval&&(y.healthchecks.active.healthy.interval=Number(n.fields.activeHealthCheck.interval)),n.fields.activeHealthCheck.successes&&(y.healthchecks.active.healthy.successes=Number(n.fields.activeHealthCheck.successes)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpStatuses&&(y.healthchecks.active.healthy.http_statuses=o(n.fields.activeHealthCheck.httpStatuses)),n.fields.activeHealthCheck.unhealthyInterval&&(y.healthchecks.active.unhealthy.interval=Number(n.fields.activeHealthCheck.unhealthyInterval)),n.fields.activeHealthCheck.unhealthyTimeouts&&(y.healthchecks.active.unhealthy.timeouts=Number(n.fields.activeHealthCheck.unhealthyTimeouts)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.active.unhealthy.http_statuses=o(n.fields.activeHealthCheck.unhealthyHttpStatuses)),n.fields.activeHealthCheck.type!=="tcp"&&n.fields.activeHealthCheck.httpFailures&&(y.healthchecks.active.unhealthy.http_failures=Number(n.fields.activeHealthCheck.httpFailures)),n.fields.activeHealthCheck.type==="tcp"&&n.fields.activeHealthCheck.tcpFailures&&(y.healthchecks.active.unhealthy.tcp_failures=Number(n.fields.activeHealthCheck.tcpFailures))):((j=a.config)==null?void 0:j.app)==="kongManager"&&T.value===oe.Edit&&(y.healthchecks.active={type:n.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),n.fields.passiveHealthSwitch?(y.healthchecks.passive={type:n.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},n.fields.passiveHealthCheck.successes&&(y.healthchecks.passive.healthy.successes=Number(n.fields.passiveHealthCheck.successes)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.httpStatuses&&(y.healthchecks.passive.healthy.http_statuses=o(n.fields.passiveHealthCheck.httpStatuses)),n.fields.passiveHealthCheck.timeouts&&(y.healthchecks.passive.unhealthy.timeouts=Number(n.fields.passiveHealthCheck.timeouts)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.passive.unhealthy.http_statuses=o(n.fields.passiveHealthCheck.unhealthyHttpStatuses)),n.fields.passiveHealthCheck.type!=="tcp"&&n.fields.passiveHealthCheck.httpFailures&&(y.healthchecks.passive.unhealthy.http_failures=Number(n.fields.passiveHealthCheck.httpFailures)),n.fields.passiveHealthCheck.type==="tcp"&&n.fields.passiveHealthCheck.tcpFailures&&(y.healthchecks.passive.unhealthy.tcp_failures=Number(n.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&T.value===oe.Edit&&(y.healthchecks.passive={type:n.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),y},B=y=>{var b,R,j,z,G,L;let g=`${(b=a.config)==null?void 0:b.apiBaseUrl}${Ne.form[(R=a.config)==null?void 0:R.app][y]}`;return((j=a.config)==null?void 0:j.app)==="konnect"?g=g.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((G=a.config)==null?void 0:G.app)==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(L=a.config)!=null&&L.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.upstreamId),g},$=async()=>{var y;try{n.readonly=!0,await d.post(B("validate"),M());let g;T.value===oe.Create?g=await d.post(B("create"),M()):T.value===oe.Edit&&(g=((y=a.config)==null?void 0:y.app)==="konnect"?await d.put(B("edit"),M()):await d.patch(B("edit"),M())),l("update",g==null?void 0:g.data)}catch(g){n.errorMessage=u(g),l("error",g)}finally{n.readonly=!1}};return(y,g)=>(t.openBlock(),t.createElementBlock("div",Uc,[t.createVNode(t.unref(Ua),{"can-submit":_.value&&w.value,config:e.config,"edit-id":e.upstreamId,"error-message":n.errorMessage,"fetch-url":H.value,"is-readonly":n.readonly,onCancel:U,"onFetch:error":D,"onFetch:success":v,onLoading:F,onSubmit:$},{default:t.withCtx(()=>[t.createVNode(fc,{"client-certificate":n.fields.clientCertificate,"onUpdate:clientCertificate":g[0]||(g[0]=b=>n.fields.clientCertificate=b),"host-header":n.fields.hostHeader,"onUpdate:hostHeader":g[1]||(g[1]=b=>n.fields.hostHeader=b),name:n.fields.name,"onUpdate:name":g[2]||(g[2]=b=>n.fields.name=b),tags:n.fields.tags,"onUpdate:tags":g[3]||(g[3]=b=>n.fields.tags=b),config:e.config,readonly:n.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(bc,{algorithm:n.fields.algorithm,"onUpdate:algorithm":g[4]||(g[4]=b=>n.fields.algorithm=b),"hash-fallback":n.fields.hashFallback,"onUpdate:hashFallback":g[5]||(g[5]=b=>n.fields.hashFallback=b),"hash-fallback-header":n.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":g[6]||(g[6]=b=>n.fields.hashFallbackHeader=b),"hash-fallback-query-argument":n.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":g[7]||(g[7]=b=>n.fields.hashFallbackQueryArgument=b),"hash-fallback-uri-capture":n.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":g[8]||(g[8]=b=>n.fields.hashFallbackUriCapture=b),"hash-on":n.fields.hashOn,"onUpdate:hashOn":g[9]||(g[9]=b=>n.fields.hashOn=b),"hash-on-cookie":n.fields.hashOnCookie,"onUpdate:hashOnCookie":g[10]||(g[10]=b=>n.fields.hashOnCookie=b),"hash-on-cookie-path":n.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":g[11]||(g[11]=b=>n.fields.hashOnCookiePath=b),"hash-on-header":n.fields.hashOnHeader,"onUpdate:hashOnHeader":g[12]||(g[12]=b=>n.fields.hashOnHeader=b),"hash-on-query-argument":n.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":g[13]||(g[13]=b=>n.fields.hashOnQueryArgument=b),"hash-on-uri-capture":n.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":g[14]||(g[14]=b=>n.fields.hashOnUriCapture=b),slots:n.fields.slots,"onUpdate:slots":g[15]||(g[15]=b=>n.fields.slots=b),readonly:n.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(xc,{"active-health-switch":n.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[g[16]||(g[16]=b=>n.fields.activeHealthSwitch=b),f],"healthchecks-threshold":n.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":g[17]||(g[17]=b=>n.fields.healthchecksThreshold=b),"passive-health-switch":n.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[g[18]||(g[18]=b=>n.fields.passiveHealthSwitch=b),m],readonly:n.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),n.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Hc,{key:0,concurrency:n.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":g[19]||(g[19]=b=>n.fields.activeHealthCheck.concurrency=b),headers:n.fields.activeHealthCheck.headers,"onUpdate:headers":g[20]||(g[20]=b=>n.fields.activeHealthCheck.headers=b),"http-failures":n.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":g[21]||(g[21]=b=>n.fields.activeHealthCheck.httpFailures=b),"http-path":n.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":g[22]||(g[22]=b=>n.fields.activeHealthCheck.httpPath=b),"http-statuses":n.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[23]||(g[23]=b=>n.fields.activeHealthCheck.httpStatuses=b),"https-sni":n.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":g[24]||(g[24]=b=>n.fields.activeHealthCheck.httpsSni=b),interval:n.fields.activeHealthCheck.interval,"onUpdate:interval":g[25]||(g[25]=b=>n.fields.activeHealthCheck.interval=b),successes:n.fields.activeHealthCheck.successes,"onUpdate:successes":g[26]||(g[26]=b=>n.fields.activeHealthCheck.successes=b),"tcp-failures":n.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[27]||(g[27]=b=>n.fields.activeHealthCheck.tcpFailures=b),timeout:n.fields.activeHealthCheck.timeout,"onUpdate:timeout":g[28]||(g[28]=b=>n.fields.activeHealthCheck.timeout=b),type:n.fields.activeHealthCheck.type,"onUpdate:type":g[29]||(g[29]=b=>n.fields.activeHealthCheck.type=b),"unhealthy-http-statuses":n.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[30]||(g[30]=b=>n.fields.activeHealthCheck.unhealthyHttpStatuses=b),"unhealthy-interval":n.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":g[31]||(g[31]=b=>n.fields.activeHealthCheck.unhealthyInterval=b),"unhealthy-timeouts":n.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":g[32]||(g[32]=b=>n.fields.activeHealthCheck.unhealthyTimeouts=b),"verify-ssl":n.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":g[33]||(g[33]=b=>n.fields.activeHealthCheck.verifySsl=b),config:e.config,readonly:n.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),n.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(qc,{key:1,"http-failures":n.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":g[34]||(g[34]=b=>n.fields.passiveHealthCheck.httpFailures=b),"http-statuses":n.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[35]||(g[35]=b=>n.fields.passiveHealthCheck.httpStatuses=b),successes:n.fields.passiveHealthCheck.successes,"onUpdate:successes":g[36]||(g[36]=b=>n.fields.passiveHealthCheck.successes=b),"tcp-failures":n.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[37]||(g[37]=b=>n.fields.passiveHealthCheck.tcpFailures=b),timeouts:n.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":g[38]||(g[38]=b=>n.fields.passiveHealthCheck.timeouts=b),type:n.fields.passiveHealthCheck.type,"onUpdate:type":g[39]||(g[39]=b=>n.fields.passiveHealthCheck.type=b),"unhealthy-http-statuses":n.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[40]||(g[40]=b=>n.fields.passiveHealthCheck.unhealthyHttpStatuses=b),readonly:n.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])]))}}),[["__scopeId","data-v-810fb7b7"]]),vc=t.createElementVNode("code",null,"10",-1),Dc=t.createElementVNode("code",null,"65536",-1),Mc={"data-testid":"client_certificate-plain-text"},jc=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e){const l=e,{i18n:{t:a},i18nT:r}=ce.useI18n(),{getPropValue:o}=Wi(),s=t.computed(()=>Ne.form[l.config.app].edit),c=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:J.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:J.Basic},hash_on:{order:7,section:J.Basic},hash_on_header:{order:8,section:J.Basic},hash_on_uri_capture:{order:9,section:J.Basic},hash_on_query_arg:{order:10,section:J.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:J.Basic},hash_on_cookie_path:{order:12,section:J.Basic},healthchecks:{order:13,section:J.Basic,type:P.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(h,i)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(fi),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":c.value,"fetch-url":s.value,"hide-title":e.hideTitle,"onCopy:success":i[0]||(i[0]=d=>h.$emit("copy:success",d)),"onFetch:error":i[1]||(i[1]=d=>h.$emit("fetch:error",d)),"onFetch:success":i[2]||(i[2]=d=>h.$emit("fetch:success",d)),onLoading:i[3]||(i[3]=d=>h.$emit("loading",d))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:d})=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(d.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[vc]),max:t.withCtx(()=>[Dc]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(d=>{var u;return[t.createElementVNode("div",null,[t.createElementVNode("div",Mc,[t.createElementVNode("span",null,t.toDisplayString((u=t.unref(o)("rowValue",d))==null?void 0:u.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});te.TargetForm=Wa,te.TargetsList=pc,te.UpstreamsConfigCard=jc,te.UpstreamsForm=$c,te.UpstreamsList=nc,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})});
25
+ `?e.slice(0,-1):e}function _s(e,r){for(var a=/(\n+)([^\n]*)/g,l=function(){var h=e.indexOf(`
26
+ `);return h=h!==-1?h:e.length,a.lastIndex=h,Fa(e.slice(0,h),r)}(),n=e[0]===`
27
+ `||e[0]===" ",s,o;o=a.exec(e);){var d=o[1],c=o[2];s=c[0]===" ",l+=d+(!n&&!s&&c!==""?`
28
+ `:"")+Fa(c,r),n=s}return l}function Fa(e,r){if(e===""||e[0]===" ")return e;for(var a=/ [^ ]/g,l,n=0,s,o=0,d=0,c="";l=a.exec(e);)d=l.index,d-n>r&&(s=o>n?o:d,c+=`
29
+ `+e.slice(n,s),n=s+1),o=d;return c+=`
30
+ `,e.length-n>r&&o>n?c+=e.slice(n,o)+`
31
+ `+e.slice(o+1):c+=e.slice(n),c.slice(1)}function Ss(e){for(var r="",a=0,l,n=0;n<e.length;a>=65536?n+=2:n++)a=Fe(e,n),l=ee[a],!l&&Ee(a)?(r+=e[n],a>=65536&&(r+=e[n+1])):r+=l||fs(a);return r}function xs(e,r,a){var l="",n=e.tag,s,o,d;for(s=0,o=a.length;s<o;s+=1)d=a[s],e.replacer&&(d=e.replacer.call(a,String(s),d)),(ie(e,r,d,!1,!1)||typeof d>"u"&&ie(e,r,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=n,e.dump="["+l+"]"}function Oa(e,r,a,l){var n="",s=e.tag,o,d,c;for(o=0,d=a.length;o<d;o+=1)c=a[o],e.replacer&&(c=e.replacer.call(a,String(o),c)),(ie(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&ie(e,r+1,null,!0,!0,!1,!0))&&((!l||n!=="")&&(n+=ct(e,r)),e.dump&&He===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=s,e.dump=n||"[]"}function Ns(e,r,a){var l="",n=e.tag,s=Object.keys(a),o,d,c,h,p;for(o=0,d=s.length;o<d;o+=1)p="",l!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=s[o],h=a[c],e.replacer&&(h=e.replacer.call(a,c,h)),ie(e,r,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ie(e,r,h,!1,!1)&&(p+=e.dump,l+=p));e.tag=n,e.dump="{"+l+"}"}function Vs(e,r,a,l){var n="",s=e.tag,o=Object.keys(a),d,c,h,p,u,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new le("sortKeys must be a boolean or a function");for(d=0,c=o.length;d<c;d+=1)f="",(!l||n!=="")&&(f+=ct(e,r)),h=o[d],p=a[h],e.replacer&&(p=e.replacer.call(a,h,p)),ie(e,r+1,h,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&He===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=ct(e,r)),ie(e,r+1,p,!0,u)&&(e.dump&&He===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,n+=f));e.tag=s,e.dump=n||"{}"}function qa(e,r,a){var l,n,s,o,d,c;for(n=a?e.explicitTypes:e.implicitTypes,s=0,o=n.length;s<o;s+=1)if(d=n[s],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof r=="object"&&r instanceof d.instanceOf)&&(!d.predicate||d.predicate(r))){if(a?d.multi&&d.representName?e.tag=d.representName(r):e.tag=d.tag:e.tag="?",d.represent){if(c=e.styleMap[d.tag]||d.defaultStyle,ya.call(d.represent)==="[object Function]")l=d.represent(r,c);else if(ka.call(d.represent,c))l=d.represent[c](r,c);else throw new le("!<"+d.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function ie(e,r,a,l,n,s,o){e.tag=null,e.dump=a,qa(e,a,!1)||qa(e,a,!0);var d=ya.call(e.dump),c=l,h;l&&(l=e.flowLevel<0||e.flowLevel>r);var p=d==="[object Object]"||d==="[object Array]",u,f;if(p&&(u=e.duplicates.indexOf(a),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&r>0)&&(n=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")l&&Object.keys(e.dump).length!==0?(Vs(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(Ns(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?Oa(e,r-1,e.dump,n):Oa(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(xs(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&ws(e,e.dump,r,s,c);else{if(d==="[object Undefined]"||e.skipInvalid)return!1;throw new le("unacceptable kind of an object to dump "+d)}e.tag!==null&&e.tag!=="?"&&(h=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",e.dump=h+" "+e.dump)}return!0}function Is(e,r){var a=[],l=[],n,s;for(ht(e,a,l),n=0,s=l.length;n<s;n+=1)r.duplicates.push(a[l[n]]);r.usedDuplicates=new Array(s)}function ht(e,r,a){var l,n,s;if(e!==null&&typeof e=="object")if(n=r.indexOf(e),n!==-1)a.indexOf(n)===-1&&a.push(n);else if(r.push(e),Array.isArray(e))for(n=0,s=e.length;n<s;n+=1)ht(e[n],r,a);else for(l=Object.keys(e),n=0,s=l.length;n<s;n+=1)ht(e[l[n]],r,a)}function Bs(e,r){r=r||{};var a=new gs(r);a.noRefs||Is(e,a);var l=e;return a.replacer&&(l=a.replacer.call({"":l},"",l)),ie(a,0,l,!0,!0)?a.dump+`
32
+ `:""}var Ts=Bs,Hs={dump:Ts};function pt(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var As=G,Es=vt,Fs=Kt,Os=zt,qs=Jt,Us=lt,vs=ga.load,$s=ga.loadAll,Ds=Hs.dump,Ms=le,Ks={binary:Gt,float:Rt,map:Mt,null:jt,pairs:ea,set:ta,timestamp:Yt,bool:Pt,int:Lt,merge:Zt,omap:Xt,seq:Dt,str:$t},js=pt("safeLoad","load"),Ps=pt("safeLoadAll","loadAll"),Ls=pt("safeDump","dump"),Rs={Type:As,Schema:Es,FAILSAFE_SCHEMA:Fs,JSON_SCHEMA:Os,CORE_SCHEMA:qs,DEFAULT_SCHEMA:Us,load:vs,loadAll:$s,dump:Ds,YAMLException:Ms,types:Ks,safeLoad:js,safeLoadAll:Ps,safeDump:Ls};const zs={key:0,class:"config-card-display-form"},Js=["data-testid"],Ws={key:0,class:"config-card-prop-section-title"},Qs={key:1,class:"config-card-display-json"},Ys={key:2,class:"config-card-display-yaml"},Zs=t.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null}},setup(e){const r=e,a=t.useSlots(),{i18n:{t:l}}=Z.useI18n(),n=d=>!!(d.tooltip||a[`${d.key}-label-tooltip`]),s=t.ref(""),o=t.ref("");return t.watch(()=>r.format,d=>{if(d!=="structured"){const c=JSON.parse(JSON.stringify(r.record));delete c.created_at,delete c.updated_at,d==="json"?s.value=JSON.stringify(c,null,2):d==="yaml"&&(o.value=Rs.dump(c))}},{immediate:!0}),(d,c)=>{const h=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",zs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,p=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${p}-props`,class:t.normalizeClass(`config-card-details-${p}-props`),"data-testid":`config-card-details-${p}-props`},[p!=="basic"?(t.openBlock(),t.createElementBlock("div",Ws,t.toDisplayString(p==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[p],u=>(t.openBlock(),t.createBlock(Ge,{key:u.key,item:u},t.createSlots({label:t.withCtx(()=>[t.renderSlot(d.$slots,`${u.key}-label`,{row:u},void 0,!0)]),[u.key]:t.withCtx(({rowValue:f})=>[t.renderSlot(d.$slots,u.key,{row:u,rowValue:f},void 0,!0)]),_:2},[n(u)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(d.$slots,`${u.key}-label-tooltip`,{row:u},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Js))),128))])):t.createCommentVNode("",!0),e.format==="json"?(t.openBlock(),t.createElementBlock("div",Qs,[t.createVNode(h,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),e.format==="yaml"?(t.openBlock(),t.createElementBlock("div",Ys,[t.createVNode(h,{id:"config-card-codeblock",code:o.value,language:"yaml",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0)],64)}}}),Gs=ne(Zs,[["__scopeId","data-v-c914c7e4"]]),Ua="24px",Xs=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},ei=e=>(t.pushScopeId("data-v-a53b73fd"),e=e(),t.popScopeId(),e),ti=["aria-hidden"],ai={key:0,"data-testid":"kui-icon-svg-title"},li=ei(()=>t.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)),ri=t.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:Ua,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ua}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",ai,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),li],8,ti))]),_:1},8,["aria-hidden","style"]))}}),ni=Xs(ri,[["__scopeId","data-v-a53b73fd"]]),oi={"data-testid":"config-card-title"},si={class:"config-card-actions"},ii=["href"],ci={key:2,class:"config-card-details-section"},di={key:3,class:"config-card-details-section"},hi=["data-testid"],pi={key:0,class:"config-card-prop-section-title"},ui=t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:r}){var a;const l=r,n=e,s=t.useSlots(),{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{convertKeyToTitle:c}=Z.useStringHelpers(),{axiosInstance:h}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),p=[{label:o("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=t.ref("structured"),f=N=>{u.value=N==null?void 0:N.value},i={id:{type:L.ID,label:o("baseConfigCard.commonFields.id_label"),order:0,section:W.Basic},name:{order:1,section:W.Basic},enabled:{type:L.BadgeStatus,order:2,section:W.Basic},updated_at:{type:L.Date,label:o("baseConfigCard.commonFields.updated_at_label"),order:3,section:W.Basic},created_at:{type:L.Date,label:o("baseConfigCard.commonFields.created_at_label"),order:4,section:W.Basic},tags:{type:L.BadgeTag,order:-1,section:W.Basic}},S=t.ref(!1),b=t.ref(!1),m=t.ref(""),y=t.ref(),_=t.computed(()=>{var N,H,w;if(!y.value)return[];const A=[],F=Object.keys(y.value).length;for(const D in y.value){const v=(H=(N=n.configSchema)==null?void 0:N[D])==null?void 0:H.order,q=(w=i[D])==null?void 0:w.order;let M=F;(q||q===0)&&(M=q===-1?F+1:q),v&&(M=v===-1?F+1:v),A.push([D,M])}return A.sort(function(D,v){return D[1]-v[1]}),A.map(D=>{var v,q;const M=D[0],K=(v=y.value)==null?void 0:v[M],V=((q=n.configSchema)==null?void 0:q[M])||{},$=i[M];return{key:M,value:K,hidden:V.hidden||!1,type:V.type??(($==null?void 0:$.type)||L.Text),label:V.label??(($==null?void 0:$.label)||c(M)),tooltip:V.tooltip??(($==null?void 0:$.tooltip)||void 0),section:V.section??(($==null?void 0:$.section)||W.Advanced)}}).filter(D=>!D.hidden&&D.key!==n.pluginConfigKey)}),I=t.computed(()=>{var N,H;if(!y.value||!n.pluginConfigKey)return[];const w=y.value[n.pluginConfigKey]||{},A=Object.keys(w).length,F=[];for(const D in w){const v=(H=(N=n.pluginConfigSchema)==null?void 0:N[D])==null?void 0:H.order,q=w[D];let M=q!=null&&q!==""?A-1:A;v&&(M=v===-1?A+1:v),F.push([D,M])}return F.sort(function(D,v){return D[1]-v[1]}),F.map(D=>{var v;const q=D[0],M=w[q],K=((v=n.pluginConfigSchema)==null?void 0:v[q])||{};return{key:q,value:M,hidden:K.hidden||!1,type:K.type??L.Text,label:K.label??c(q),tooltip:K.tooltip??void 0,section:W.Plugin}}).filter(D=>!D.hidden)}),B=t.computed(()=>{var N,H,w,A;return{basic:(N=_.value)==null?void 0:N.filter(F=>F.section===W.Basic),advanced:(H=_.value)==null?void 0:H.filter(F=>F.section===W.Advanced),plugin:(A=I.value)==null?void 0:A.concat((w=_.value)==null?void 0:w.filter(F=>F.section===W.Plugin))}}),E=t.computed(()=>{const N=[];return B.value.basic.length&&N.push("basic"),B.value.advanced.length&&N.push("advanced"),B.value.plugin.length&&N.push("plugin"),N}),x=N=>!!(N.tooltip||s[`${N.key}-label-tooltip`]),U=t.computed(()=>{var N,H;let w=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((N=n.config)==null?void 0:N.controlPlaneId)||""):n.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(H=n.config)!=null&&H.workspace?`/${n.config.workspace}`:"")),w=w.replace(/{id}/gi,n.config.entityId),w}),T=N=>{y.value&&N(JSON.stringify(y.value))?l("copy:success",y.value):l("copy:error")};return t.watch(S,N=>{l("loading",N)},{immediate:!0}),t.onBeforeMount(async()=>{b.value=!1,S.value=!0;try{const{data:N}=await h.get(U.value);if(n.dataKey)if(typeof N[n.dataKey]<"u")y.value={...N[n.dataKey]};else throw new Error(o("errors.dataKeyUndefined",{dataKey:n.dataKey}));else y.value={...N};Object.keys(n.configSchema).filter(H=>n.configSchema[H].forceShow).forEach(H=>{y.value&&typeof y.value[H]>"u"&&(y.value[H]=null)}),l("fetch:success",N)}catch(N){const H=d(N);m.value=H.startsWith("code")?o("baseConfigCard.errors.load"):H,b.value=!0,l("fetch:error",N)}finally{S.value=!1}}),(N,H)=>{const w=t.resolveComponent("KLabel"),A=t.resolveComponent("KSelect"),F=t.resolveComponent("KButton"),D=t.resolveComponent("KClipboardProvider"),v=t.resolveComponent("KSkeleton"),q=t.resolveComponent("KEmptyState"),M=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(M,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",si,[t.renderSlot(N.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(w,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(A,{key:1,appearance:"select","data-testid":"select-config-format",items:p,onChange:f})):t.createCommentVNode("",!0),n.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock(F,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(ni),{size:t.unref(pn)},null,8,["size"])],8,ii)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(D,{key:3},{default:t.withCtx(({copyToClipboard:K})=>[!S.value&&!b.value?(t.openBlock(),t.createBlock(F,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:V=>T(K)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),default:t.withCtx(()=>[S.value?(t.openBlock(),t.createBlock(v,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):b.value?(t.openBlock(),t.createBlock(q,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(m.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",ci,[t.createVNode(Gs,{format:u.value,"prop-list-types":E.value,"property-collections":B.value,record:y.value},t.createSlots({_:2},[t.renderList(Object.keys(N.$slots),K=>({name:K,fn:t.withCtx(({row:V,rowValue:$})=>[t.renderSlot(N.$slots,K,{row:V,rowValue:$},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",di,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.value,K=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${K}-props`,class:t.normalizeClass(`config-card-details-${K}-props`),"data-testid":`config-card-details-${K}-props`},[K!=="basic"?(t.openBlock(),t.createElementBlock("div",pi,t.toDisplayString(K==="advanced"?t.unref(o)("baseConfigCard.sections.advanced"):t.unref(o)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value[K],V=>(t.openBlock(),t.createBlock(Ge,{key:V.key,item:V},t.createSlots({label:t.withCtx(()=>[t.renderSlot(N.$slots,`${V.key}-label`,{row:V},void 0,!0)]),[V.key]:t.withCtx(({rowValue:$})=>[t.renderSlot(N.$slots,V.key,{row:V,rowValue:$},void 0,!0)]),_:2},[x(V)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(N.$slots,`${V.key}-label-tooltip`,{row:V},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,hi))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",oi,[t.renderSlot(N.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),fi=ne(ui,[["__scopeId","data-v-bea4df63"]]),mi={class:"form-actions","data-testid":"form-actions"},gi=t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,s=Je.useRouter(),{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),f=t.computed(()=>n.canSubmit===!1||n.isReadonly),i=t.computed(()=>{var y,_;if(!n.editId)return"";let I=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((y=n.config)==null?void 0:y.controlPlaneId)||""):n.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(_=n.config)!=null&&_.workspace?`/${n.config.workspace}`:"")),I=I.replace(/{id}/gi,n.editId),I}),S=()=>{n.config.cancelRoute?s.push(n.config.cancelRoute):b()},b=()=>{l("cancel")},m=()=>{f.value||l("submit")};return t.watch(()=>h.value,y=>{l("loading",y)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{p.value=!1,h.value=!0;const{data:y}=await c.get(i.value);l("fetch:success",y)}catch(y){const _=d(y);u.value=_.startsWith("code")?o("baseForm.errors.edit"):_,p.value=!0,l("fetch:error",y)}finally{h.value=!1}}),(y,_)=>{const I=t.resolveComponent("KSkeleton"),B=t.resolveComponent("KEmptyState"),E=t.resolveComponent("KAlert"),x=t.resolveComponent("KButton"),U=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(U,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(I,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(B,{key:1,"cta-text":t.unref(o)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":S,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(b,["prevent"]),onSubmit:t.withModifiers(m,["prevent"])},[t.renderSlot(y.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(E,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",mi,[t.renderSlot(y.$slots,"form-actions",{},()=>[t.createVNode(x,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(x,{appearance:"primary","data-testid":"form-submit",disabled:f.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32))]),_:3})}}}),va=ne(gi,[["__scopeId","data-v-448d8512"]]),yi={key:0,"data-testid":"first-col"},ki=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const r=e,a=t.computed(()=>{var b;return((b=r.rowEl)==null?void 0:b.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var b;return((b=a.value)==null?void 0:b.querySelector('[data-testid="first-col"]'))||null}),n=t.computed(()=>{var b,m;const y=(b=r.rowEl)==null?void 0:b.querySelectorAll("td");return y?((m=y[0])==null?void 0:m.getAttribute("data-testid"))===r.keyName:!1});let s;const o=()=>{s&&(s.disconnect(),s=void 0)},d=()=>{var b,m,y;h.value=((b=l.value)==null?void 0:b.getBoundingClientRect().width)||0,p.value=((m=a.value)==null?void 0:m.clientWidth)||0,u.value=((y=c.value)==null?void 0:y.innerText)||""},c=t.ref({}),h=t.ref(0),p=t.ref(0),u=t.ref(""),f=t.computed(()=>[l.value,a.value]),i=t.watch(f,b=>{if(n.value&&(o(),"ResizeObserver"in window&&window)){s=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||d()})});for(const m of b)m&&s.observe(m)}},{immediate:!0,flush:"post",deep:!0}),S=t.computed(()=>n.value?h.value>p.value:!1);return t.onMounted(()=>{d()}),t.onUnmounted(()=>{i()}),(b,m)=>{const y=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[n.value?(t.openBlock(),t.createElementBlock("span",yi,[t.createVNode(y,{label:S.value?u.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),bi=ne(ki,[["__scopeId","data-v-e42a20c9"]]),Ci={class:"toolbar-container"},wi={key:0,class:"toolbar-button-container"},_i=["data-testid"],Si=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:r}){const a=e,l=r,{i18n:{t:n}}=Z.useI18n(),s=t.computed(()=>{var E,x;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(E=a.errorMessage)==null?void 0:E.title,message:(x=a.errorMessage)==null?void 0:x.message}}),o=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=E=>E.hasData||!!a.query,c=t.computed(()=>{const E=[];return Object.keys(a.tableHeaders).forEach(x=>{const U=a.tableHeaders[x];E.push({label:U.label??x,key:x,sortable:U.sortable??!1})}),a.enableEntityActions&&E.push({key:"actions",hideLabel:!0}),E}),h=E=>({"data-rowid":E.id,"data-testid":E.name,...a.rowAttributes(E)}),p=t.ref({}),u=E=>{var x;return(x=p.value)==null?void 0:x.$el.querySelector(`[data-rowid="${E.id}"]`)},f=E=>{const x={"data-testid":E.headerKey,...a.cellAttributes(E)};return E.colIndex===0&&(x.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),x},i=()=>{l("empty-state-cta-clicked"),S()},S=()=>{l("clear-search-input")},b=t.computed(()=>a.disableRowClick?void 0:(E,x)=>{l("click:row",x)}),m=E=>{l("sort",E)},{setTablePreferences:y,getTablePreferences:_}=gr(),I=t.computed(()=>{const E=_(a.preferencesStorageKey);return{...a.initialFetcherParams,...E}}),B=E=>{a.preferencesStorageKey&&y(a.preferencesStorageKey,E)};return(E,x)=>{const U=t.resolveComponent("KIcon"),T=t.resolveComponent("KButton"),N=t.resolveComponent("KDropdown"),H=t.resolveComponent("KTable"),w=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(w,{class:"kong-ui-entity-base-table",title:e.title},{default:t.withCtx(()=>[t.createVNode(H,{ref_key:"tableRefs",ref:p,"cache-identifier":o.value,"cell-attrs":f,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":I.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":h,"search-input":e.query,onKtableEmptyStateCtaClicked:i,"onRow:click":b.value,onSort:x[0]||(x[0]=A=>m(A)),"onUpdate:tablePreferences":B},t.createSlots({toolbar:t.withCtx(({state:A})=>[t.withDirectives(t.createElementVNode("div",Ci,[t.renderSlot(E.$slots,"toolbar-filter",{},void 0,!0),E.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",wi,[t.renderSlot(E.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(A)]])]),actions:t.withCtx(({row:A,rowKey:F,rowValue:D})=>[t.createElementVNode("div",{class:"actions-container","data-testid":A.name},[t.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(E.$slots,"actions",{row:A,rowKey:F,rowValue:D},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(T,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(U,{color:t.unref(dn),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,_i)]),_:2},[t.renderList(e.tableHeaders,(A,F)=>({name:F,fn:t.withCtx(({row:D,rowKey:v,rowValue:q})=>[t.createVNode(bi,{"key-name":String(F),"row-el":u(D)},{default:t.withCtx(()=>[t.renderSlot(E.$slots,F,{row:D,rowKey:v,rowValue:q},()=>[t.createTextVNode(t.toDisplayString(q),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),$a=ne(Si,[["__scopeId","data-v-57b5a97b"]]),xi={key:0,class:"kong-ui-entity-delete-error"},Ni={key:1,class:"description"},Vi=t.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:r}){const{i18nT:a}=Z.useI18n(),l=e,n=r,s=t.computed(()=>l.needConfirm?l.entityName:""),o=()=>{n("cancel")},d=()=>{n("proceed")};return(c,h)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":s.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:o,onProceed:d},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",xi,[t.createVNode(p,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Ni,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Da=ne(Vi,[["__scopeId","data-v-1c9a2a07"]]),Ii={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"},Ti=["fill"],Hi={mask:"url(#mask0_180_20349)"},Ai=["fill"],Ma=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${sn})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Ii,[t.createElementVNode("mask",Bi,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Ti)]),t.createElementVNode("g",Hi,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Ai)])]))}}),Ei={key:1,class:"kong-ui-entity-filter"},Fi={class:"menu-item-title"},Oi={class:"menu-item-indicator"},qi={class:"menu-item-body"},Ui=["for"],vi={class:"menu-item-buttons"},$i={class:"filter-clear-button-container"},Di=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:r}){const{i18n:{t:a}}=Z.useI18n(),l=e,n=r,s=t.ref(!1),o=t.ref({}),d=t.computed(()=>{const y=[];return new URLSearchParams(l.modelValue).forEach((_,I)=>{_!==""&&y.push(I)}),y}),c=t.computed(()=>{const y=l.config.fields;return Object.keys(y).filter(_=>y[_].searchable).map(_=>({label:y[_].label||_,value:_}))});t.watch(()=>l.modelValue,y=>{o.value={},new URLSearchParams(y).forEach((_,I)=>{o.value[I]=_})});const h=()=>{s.value=!s.value},p=y=>{n("update:modelValue",y)},u=y=>`filter-${y}`,f=y=>{var _,I;return(((I=(_=l.config.schema)==null?void 0:_[y])==null?void 0:I.values)??[]).map(B=>({value:B,label:B}))},i=y=>{var _,I;return((I=(_=l.config.schema)==null?void 0:_[y])==null?void 0:I.type)??"text"},S=y=>{o.value={...o.value,[y]:""},m()},b=()=>{o.value={},m(!0)},m=(y=!1)=>{const _=Object.keys(o.value).reduce((I,B)=>(o.value[B]&&(I[B]=`${o.value[B]}`),I),{});y&&(s.value=!1),n("update:modelValue",new URLSearchParams(_).toString())};return(y,_)=>{const I=t.resolveComponent("KInput"),B=t.resolveComponent("KButton"),E=t.resolveComponent("KSelect"),x=t.resolveComponent("KMenuItem"),U=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":p},{before:t.withCtx(()=>[t.createVNode(Ma)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Ei,[t.createVNode(B,{appearance:"tertiary","data-testid":"filter-button",onClick:h},{default:t.withCtx(()=>[t.createVNode(Ma),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(d.value.length>0?`(${d.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:h},null,512),[[t.vShow,s.value]]),t.withDirectives(t.createVNode(U,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(T,N)=>(t.openBlock(),t.createBlock(x,{key:T.value,"data-testid":T.value,expandable:"","last-menu-item":N===c.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",Fi,[t.createTextVNode(t.toDisplayString(T.label)+" ",1),t.withDirectives(t.createElementVNode("span",Oi,null,512),[[t.vShow,d.value.includes(T.value)]])])]),itemBody:t.withCtx(()=>{var H,w;return[t.createElementVNode("div",qi,[t.createElementVNode("label",{class:"menu-item-label",for:u(T.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,Ui),((w=(H=e.config.schema)==null?void 0:H[T.value])==null?void 0:w.type)==="select"?(t.openBlock(),t.createBlock(E,{key:0,id:u(T.value),modelValue:o.value[T.value],"onUpdate:modelValue":A=>o.value[T.value]=A,appearance:"select",items:f(T.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(I,{key:1,id:u(T.value),modelValue:o.value[T.value],"onUpdate:modelValue":A=>o.value[T.value]=A,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:i(T.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",vi,[t.createVNode(B,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:_[0]||(_[0]=A=>m(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(B,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:A=>S(T.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",$i,[t.createVNode(B,{appearance:"tertiary",size:"small",onClick:b},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,s.value]])]))}}}),Mi=ne(Di,[["__scopeId","data-v-15962ee2"]]),ce=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,s)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Ki={class:"form-section-wrapper"},ji={key:0,class:"form-section-title"},Pi={key:1,class:"form-section-description"},Li={key:2,class:"form-section-footer"},Ri={class:"form-section-content"},zi=t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const r=t.useSlots();return(a,l)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Ki,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createElementBlock("h4",ji,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",Pi,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",Li,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",Ri,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),Oe=ne(zi,[["__scopeId","data-v-8b6dc312"]]),{useAxios:je,useDeleteUrlBuilder:Ka,useErrors:ja,useExternalLinkCreator:jc,useFetchUrlBuilder:Pc,useFetcher:Pa,useDebouncedFilter:La,useStringHelpers:Lc,useHelpers:Ji,useGatewayFeatureSupported:Rc,useTruncationDetector:zc}=Z,Wi={upstreams:{list:{table_headers:{id:"ID",name:"Name",slots:"Slots",tags:"Tags"},empty_state:{title:"Configure a New Upstream",description:"Upstreams are used to load balance incoming requests."},toolbar_actions:{new_upstream:"New Upstream"}},title:"Upstreams",search:{placeholder:"Filter by exact name or ID"},actions:{create:"New Upstream",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete an Upstream",description:"This action cannot be reversed so make sure to check upstream usage before deleting."},errors:{general:"Upstreams could not be retrieved",delete:"The upstream 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:{errors:{name_required:"Name is required",should_be_integer:"Field should contain an integer",in_range:"Accepts an integer in the range of 10 - 65536"},general_info:{title:"General Information",help:"General information will help identify and manage this Upstream."},load_balancing:{title:"Load Balancing",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},health_check:{title:"Health Checks & Circuit Breakers",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},active_health_check:{title:"Active Health Checks",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},passive_health_check:{title:"Passive Health Checks",help:"Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},buttons:{view_documentation:"View documentation"},algorithms:{round_robin_label:"Round Robin",least_connections_label:"Least Connections",consistent_hashing_label:"Consistent Hashing",latency_label:"Latency"},hash_labels:{none:"None",consumer:"Consumer",ip:"IP",header:"Header",cookie:"Cookie",path:"Path",query_argument:"Query Argument",uri_capture:"URI Capture"},hash_tooltips:{hash_on_header:{text:"The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",hash_on:"hash_on",header:"header"},hash_on_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",hash_on:"hash_on",uri_capture:"uri_capture"},hash_on_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",hash_on:"hash_on",query_arg:"query_arg"},hash_on_cookie:{text:"The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},hash_on_cookie_path:{text:"The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},slots:{text:"The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",algorithm:"algorithm",round_robin:"round-robin",consistent_hashing:"consistent-hashing"},tags:"An optional set of strings associated with the Upstream for grouping and filtering.",hash_fallback:{text:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",hash_on:"hash_on",cookie:"cookie"},hash_fallback_header:{text:"The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",hash_fallback:"hash_fallback",header:"header"},hash_fallback_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",hash_fallback:"hash_fallback",query_arg:"query_arg"},hash_fallback_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",hash_fallback:"hash_fallback",uri_capture:"uri_capture"},host_header:{text:"The hostname to be used as {host} header when proxying requests through Kong.",host:"Host"},client_certificate:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},healthcheck_type_labels:{http:"HTTP",https:"HTTPS",tcp:"TCP",grsp:"gRPC",grsps:"gRPCs"},healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},passive_healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},passive_unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},fields:{name:{label:"Name",placeholder:"Enter or select a host",tooltip:"This is a hostname, which must be equal to the {host} of a Service.",host:"host"},host_header:{label:"Host Header"},client_certificate:{label:"Client Certificate",placeholder:"Select or enter a Certificate ID",tooltip:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Upstream for grouping and filtering."},algorithm:{label:"Algorithm",tooltip:"Which load balancing algorithm to use."},slots:{label:"Slots",help:"Accepts an integer in the range of 10 - 65536"},hash_on:{label:"Hash on",help:"What to use as hashing input.",tooltip:"What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."},hash_fallback:{label:"Hash Fallback",help:"What to use as hashing input if the primary hash_on does not return a hash",tooltip:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",hash_on:"hash_on",cookie:"cookie"},active_health_checks:{label:"Active Health Checks",help:"Actively probe the targets for their health."},passive_health_checks:{label:"Passive Health Checks / Circuit Breakers",help:"Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},healthchecks_threshold:{label:"Healthchecks Threshold"},header:{label:"Header"},headers:{label:"Headers",tooltip_active:"Header values can be separated by commas (value1, value2, value3)."},cookie:{label:"Cookie"},cookie_path:{label:"Cookie Path"},query_argument:{label:"Query Argument"},uri_capture:{label:"URI Capture"},active_healthcheck_type:{label:"Active Health Check Type"},http_path:{label:"HTTP Path"},timeout:{label:"Timeout"},concurrency:{label:"Concurrency"},https_sni:{label:"HTTPS SNI"},verify_ssl:{label:"Verify the SSL certificate when performing active health checks using HTTPS"},interval:{label:"Interval",help:"A value of zero indicates that active probes for healthy targets are disabled."},successes:{label:"Successes"},http_statuses:{label:"HTTP Statuses"},http_failures:{label:"HTTP Failures"},tcp_failures:{label:"TCP Failures"},timeouts:{label:"Timeouts"},passive_health_check_type:{label:"Passive Health Check Type"}}},labels:{created_at:"Created at"}},targets:{list:{table_headers:{id:"ID",target_address:"Target Address",weight:"Weight",tags:"Tags"},empty_state:{title:"Configure a New Target",description:"A target is an IP address/hostname with a port that identifies an instance of a backend service."},toolbar_actions:{new_target:"New Target"}},title:"Targets",actions:{create:"New Target",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",mark_healthy:"Mark Healthy",mark_unhealthy:"Mark Unhealthy"},delete:{title:"Delete a Target",description:"This action cannot be reversed so make sure to check target usage before deleting."},errors:{general:"Targets could not be retrieved",delete:"The target could not be deleted at this time.",copy:"Failed to copy to clipboard",weight:"Value must be in range 0 to 65535"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{create:{title:"New Target"},edit:{title:"Edit Target"},buttons:{save:"Save",cancel:"Cancel"},fields:{target:{label:"Target Address",placeholder:"Enter IP/hostname and port",tooltip:"The target address (IP or hostname) and port. If omitted the port defaults to 8000."},weight:{label:"Weight",tooltip:"The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}}}}};function Qi(){const e=Be.createI18n("en-us",Wi);return{i18n:e,i18nT:Be.i18nTComponent(e)}}function qe(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,s)=>{if(s){const o={...n};r&&(o.value=n.label),a.value.push(o)}else a.value=a.value.filter(o=>o.value!==n.value)}}}const Pe=[{label:"100",value:"100"},{label:"101",value:"101"},{label:"102",value:"102"},{label:"103",value:"103"},{label:"200",value:"200"},{label:"201",value:"201"},{label:"202",value:"202"},{label:"203",value:"203"},{label:"204",value:"204"},{label:"205",value:"205"},{label:"206",value:"206"},{label:"207",value:"207"},{label:"208",value:"208"},{label:"226",value:"226"},{label:"300",value:"300"},{label:"301",value:"301"},{label:"302",value:"302"},{label:"303",value:"303"},{label:"304",value:"304"},{label:"305",value:"305"},{label:"306",value:"306"},{label:"307",value:"307"},{label:"308",value:"308"},{label:"400",value:"400"},{label:"401",value:"401"},{label:"402",value:"402"},{label:"403",value:"403"},{label:"404",value:"404"},{label:"405",value:"405"},{label:"406",value:"406"},{label:"407",value:"407"},{label:"408",value:"408"},{label:"409",value:"409"},{label:"410",value:"410"},{label:"411",value:"411"},{label:"412",value:"412"},{label:"413",value:"413"},{label:"414",value:"414"},{label:"415",value:"415"},{label:"416",value:"416"},{label:"417",value:"417"},{label:"418",value:"418"},{label:"419",value:"419"},{label:"420",value:"420"},{label:"421",value:"421"},{label:"422",value:"422"},{label:"423",value:"423"},{label:"424",value:"424"},{label:"425",value:"425"},{label:"426",value:"426"},{label:"428",value:"428"},{label:"429",value:"429"},{label:"430",value:"430"},{label:"431",value:"431"},{label:"440",value:"440"},{label:"444",value:"444"},{label:"449",value:"449"},{label:"450",value:"450"},{label:"451",value:"451"},{label:"460",value:"460"},{label:"463",value:"463"},{label:"494",value:"494"},{label:"495",value:"495"},{label:"496",value:"496"},{label:"497",value:"497"},{label:"498",value:"498"},{label:"499",value:"499"},{label:"500",value:"500"},{label:"501",value:"501"},{label:"502",value:"502"},{label:"503",value:"503"},{label:"504",value:"504"},{label:"505",value:"505"},{label:"506",value:"506"},{label:"507",value:"507"},{label:"508",value:"508"},{label:"509",value:"509"},{label:"510",value:"510"},{label:"511",value:"511"},{label:"520",value:"520"},{label:"521",value:"521"},{label:"522",value:"522"},{label:"523",value:"523"},{label:"524",value:"524"},{label:"525",value:"525"},{label:"526",value:"526"},{label:"527",value:"527"},{label:"529",value:"529"},{label:"530",value:"530"},{label:"561",value:"561"},{label:"598",value:"598"},{label:"599",value:"599"}],ut=10,ft=65536,Yi=0,Zi=65535,_e=0,Se=255,Ra=0,za=255,Gi=0,Xi=65535,Ja=0,Wa=65535,ec=0,tc=2**31,mt=["200","302"],gt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],yt=["429","404","500","501","502","503","504","505"],kt=["429","500","503"];function Le(){const e=c=>/^\d+$/.test(c),r=(c,h,p)=>{if(e(c)){const u=Number(c);return u>=h&&u<=p}else return!1},a=c=>c.map(h=>Number(h)),l=c=>c.map(h=>h.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:mt,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:yt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:gt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:kt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,f,i,S,b,m,y,_,I,B,E,x,U,T,N,H,w,A,F,D,v,q,M,K,V,$,P,k,g,C,z,j,J,X,R,te,ge,Ie,Ya,Za,Ga,Xa,el,tl,al,ll,rl,nl,ol,sl,il,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,wl,_l,Sl,xl,Nl,Vl,Il,Bl,Tl,Hl,Al,El,Fl,Ol,ql,Ul,vl,$l,Dl,Ml,Kl,jl,Pl,Ll,Rl,zl,Jl,Wl,Ql,Yl,Zl,Gl,Xl,er,tr,ar,lr,rr,nr,or,sr,ir,cr,dr,hr;const h=n();return h.name=c.name||"",h.algorithm=c.algorithm||"round-robin",h.hostHeader=c.host_header||"",h.clientCertificate=c.client_certificate?(p=c.client_certificate)==null?void 0:p.id:"",h.tags=((u=c.tags)==null?void 0:u.join(", "))||"",h.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",h.hashOn=c.hash_on||"none",h.hashFallback=c.hash_fallback||"none",h.hashOnHeader=c.hash_on_header||"",h.hashOnCookie=c.hash_on_cookie||"",h.hashOnCookiePath=c.hash_on_cookie_path||"/",h.hashOnQueryArgument=c.hash_on_query_arg||"",h.hashOnUriCapture=c.hash_on_uri_capture||"",h.hashFallbackHeader=c.hash_fallback_header||"",h.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",h.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",h.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",h.activeHealthSwitch=((i=(f=c.healthchecks.active)==null?void 0:f.healthy)==null?void 0:i.interval)!==0||((b=(S=c.healthchecks.active)==null?void 0:S.unhealthy)==null?void 0:b.interval)!==0,h.activeHealthCheck.type=((m=c.healthchecks.active)==null?void 0:m.type)||"http",h.activeHealthCheck.httpPath=((y=c.healthchecks.active)==null?void 0:y.http_path)||"/",h.activeHealthCheck.timeout=((_=c.healthchecks.active)==null?void 0:_.timeout)!==null&&((I=c.healthchecks.active)==null?void 0:I.timeout)!==void 0?(E=(B=c.healthchecks.active)==null?void 0:B.timeout)==null?void 0:E.toString():"",h.activeHealthCheck.concurrency=((x=c.healthchecks.active)==null?void 0:x.concurrency)!==null&&((U=c.healthchecks.active)==null?void 0:U.concurrency)!==void 0?(N=(T=c.healthchecks.active)==null?void 0:T.concurrency)==null?void 0:N.toString():"",h.activeHealthCheck.httpsSni=((H=c.healthchecks.active)==null?void 0:H.https_sni)||"",h.activeHealthCheck.verifySsl=((w=c.healthchecks.active)==null?void 0:w.https_verify_certificate)||!1,h.activeHealthCheck.headers=(A=c.healthchecks.active)!=null&&A.headers&&Object.entries((F=c.healthchecks.active)==null?void 0:F.headers).length>0?Object.entries((D=c.healthchecks.active)==null?void 0:D.headers).map(([Kc,bt])=>({key:Kc,values:bt==null?void 0:bt.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((q=(v=c.healthchecks.active)==null?void 0:v.healthy)==null?void 0:q.interval)!==null&&((K=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:K.interval)!==void 0?(P=($=(V=c.healthchecks.active)==null?void 0:V.healthy)==null?void 0:$.interval)==null?void 0:P.toString():"0",h.activeHealthCheck.interval=((g=(k=c.healthchecks.active)==null?void 0:k.healthy)==null?void 0:g.interval)!==null&&((z=(C=c.healthchecks.active)==null?void 0:C.healthy)==null?void 0:z.interval)!==void 0?(X=(J=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:J.interval)==null?void 0:X.toString():"0",h.activeHealthCheck.successes=((te=(R=c.healthchecks.active)==null?void 0:R.healthy)==null?void 0:te.successes)!==null&&((Ie=(ge=c.healthchecks.active)==null?void 0:ge.healthy)==null?void 0:Ie.successes)!==void 0?(Ga=(Za=(Ya=c.healthchecks.active)==null?void 0:Ya.healthy)==null?void 0:Za.successes)==null?void 0:Ga.toString():"0",h.activeHealthCheck.httpStatuses=(el=(Xa=c.healthchecks.active)==null?void 0:Xa.healthy)!=null&&el.http_statuses?l(((al=(tl=c.healthchecks.active)==null?void 0:tl.healthy)==null?void 0:al.http_statuses)||[]):mt,h.activeHealthCheck.unhealthyInterval=((rl=(ll=c.healthchecks.active)==null?void 0:ll.unhealthy)==null?void 0:rl.interval)!==null&&((ol=(nl=c.healthchecks.active)==null?void 0:nl.unhealthy)==null?void 0:ol.interval)!==void 0?(cl=(il=(sl=c.healthchecks.active)==null?void 0:sl.unhealthy)==null?void 0:il.interval)==null?void 0:cl.toString():"0",h.activeHealthCheck.httpFailures=((hl=(dl=c.healthchecks.active)==null?void 0:dl.unhealthy)==null?void 0:hl.http_failures)!==null&&((ul=(pl=c.healthchecks.active)==null?void 0:pl.unhealthy)==null?void 0:ul.http_failures)!==void 0?(gl=(ml=(fl=c.healthchecks.active)==null?void 0:fl.unhealthy)==null?void 0:ml.http_failures)==null?void 0:gl.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((kl=(yl=c.healthchecks.active)==null?void 0:yl.unhealthy)==null?void 0:kl.timeouts)!==null&&((Cl=(bl=c.healthchecks.active)==null?void 0:bl.unhealthy)==null?void 0:Cl.timeouts)!==void 0?(Sl=(_l=(wl=c.healthchecks.active)==null?void 0:wl.unhealthy)==null?void 0:_l.timeouts)==null?void 0:Sl.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(Nl=(xl=c.healthchecks.active)==null?void 0:xl.unhealthy)!=null&&Nl.http_statuses?l(((Il=(Vl=c.healthchecks.active)==null?void 0:Vl.unhealthy)==null?void 0:Il.http_statuses)||[]):yt,h.passiveHealthSwitch=((Tl=(Bl=c.healthchecks.passive)==null?void 0:Bl.healthy)==null?void 0:Tl.successes)!==0||((Al=(Hl=c.healthchecks.passive)==null?void 0:Hl.unhealthy)==null?void 0:Al.timeouts)!==0||((Fl=(El=c.healthchecks.passive)==null?void 0:El.unhealthy)==null?void 0:Fl.tcp_failures)!==0||((ql=(Ol=c.healthchecks.passive)==null?void 0:Ol.unhealthy)==null?void 0:ql.http_failures)!==0,h.passiveHealthCheck.type=((Ul=c.healthchecks.passive)==null?void 0:Ul.type)||"http",h.passiveHealthCheck.successes=(($l=(vl=c.healthchecks.passive)==null?void 0:vl.healthy)==null?void 0:$l.successes)!==null&&((Ml=(Dl=c.healthchecks.passive)==null?void 0:Dl.healthy)==null?void 0:Ml.successes)!==void 0?(Pl=(jl=(Kl=c.healthchecks.passive)==null?void 0:Kl.healthy)==null?void 0:jl.successes)==null?void 0:Pl.toString():"0",h.passiveHealthCheck.httpStatuses=(Rl=(Ll=c.healthchecks.passive)==null?void 0:Ll.healthy)!=null&&Rl.http_statuses?l(((Jl=(zl=c.healthchecks.passive)==null?void 0:zl.healthy)==null?void 0:Jl.http_statuses)||[]):gt,h.passiveHealthCheck.timeouts=((Ql=(Wl=c.healthchecks.passive)==null?void 0:Wl.unhealthy)==null?void 0:Ql.timeouts)!==null&&((Zl=(Yl=c.healthchecks.passive)==null?void 0:Yl.unhealthy)==null?void 0:Zl.timeouts)!==void 0?(er=(Xl=(Gl=c.healthchecks.passive)==null?void 0:Gl.unhealthy)==null?void 0:Xl.timeouts)==null?void 0:er.toString():"0",h.passiveHealthCheck.tcpFailures=((ar=(tr=c.healthchecks.passive)==null?void 0:tr.unhealthy)==null?void 0:ar.tcp_failures)!==null&&((rr=(lr=c.healthchecks.passive)==null?void 0:lr.unhealthy)==null?void 0:rr.tcp_failures)!==void 0?(sr=(or=(nr=c.healthchecks.passive)==null?void 0:nr.unhealthy)==null?void 0:or.tcp_failures)==null?void 0:sr.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(cr=(ir=c.healthchecks.passive)==null?void 0:ir.unhealthy)!=null&&cr.http_statuses?l(((hr=(dr=c.healthchecks.passive)==null?void 0:dr.unhealthy)==null?void 0:hr.http_statuses)||[]):kt,h},getDefaultUpstreamFields:n,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const de={useI18n:Qi,useMultiselectCreation:qe,useHelpers:Le},xe="/api/runtime_groups/{controlPlaneId}",Ne="/{workspace}",Ve={list:{konnect:`${xe}/upstreams`,kongManager:`${Ne}/upstreams`},form:{konnect:{getServices:`${xe}/services`,getCertificates:`${xe}/certificates`,validate:`${xe}/v1/schemas/json/upstream/validate`,create:`${xe}/upstreams`,edit:`${xe}/upstreams/{id}`},kongManager:{getServices:`${Ne}/services`,getCertificates:`${Ne}/certificates`,validate:`${Ne}/schemas/upstreams/validate`,create:`${Ne}/upstreams`,edit:`${Ne}/upstreams/{id}`}}},ac={class:"kong-ui-entities-upstreams-list"},lc={class:"upstream-name"},rc=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:r}){var K;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),s=Je.useRouter(),{axiosInstance:o}=je({headers:(K=l.config)==null?void 0:K.requestHeaders}),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var $,P;let V=`${l.config.apiBaseUrl}${Ve.list[l.config.app]}`;return l.config.app==="konnect"?V=V.replace(/{controlPlaneId}/gi,(($=l.config)==null?void 0:$.controlPlaneId)||""):l.config.app==="kongManager"&&(V=V.replace(/\/{workspace}/gi,(P=l.config)!=null&&P.workspace?`/${l.config.workspace}`:"")),V}),f=t.ref(""),i=t.computed(()=>{const V=l.config.app==="konnect"||l.config.isExactMatch;if(V)return{isExactMatch:V,placeholder:n("upstreams.search.placeholder")};const{name:$,slots:P}=h;return{isExactMatch:V,fields:{name:$,slots:P},schema:l.config.filterSchema}}),{fetcher:S,fetcherState:b}=Pa(l.config,u.value),m=()=>{f.value=""},y=()=>{d.value++},_=t.ref(null),I=(V,$)=>{const P=V.id;if(!$(P)){a("copy:error",{entity:V,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:V,field:"id",message:n("upstreams.copy.success",{val:P})})},B=(V,$)=>{const P=JSON.stringify(V);if(!$(P)){a("copy:error",{entity:V,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:V,message:n("upstreams.copy.success_brief")})},E=async V=>{var P;await((P=l.canRetrieve)==null?void 0:P.call(l,V))&&s.push(l.config.getViewRoute(V.id))},x=V=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(V)}),U=V=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(V)}),T=t.ref(void 0),N=t.ref(!1),H=t.ref(!1),w=t.ref(""),A=Ka(l.config,u.value),F=V=>{T.value=V,N.value=!0},D=()=>{N.value=!1},v=async()=>{var V,$,P;if((V=T.value)!=null&&V.id){H.value=!0;try{await o.delete(A(T.value.id)),H.value=!1,N.value=!1,d.value++,a("delete:success",T.value)}catch(k){w.value=((P=($=k.response)==null?void 0:$.data)==null?void 0:P.message)||k.message||n("upstreams.errors.delete"),a("error",k)}finally{H.value=!1}}},q=t.ref(!0);t.watch(b,V=>{var $,P,k,g;if(Array.isArray(($=V==null?void 0:V.response)==null?void 0:$.data)&&(q.value=V.response.data.length>0),V.status===pe.Error){_.value={title:n("upstreams.errors.general")},(g=(k=(P=V.error)==null?void 0:P.response)==null?void 0:k.data)!=null&&g.message&&(_.value.message=V.error.response.data.message),a("error",V.error);return}_.value=null});const M=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:n("upstreams.list.empty_state.description"),title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(M.value.title=n("upstreams.list.empty_state.title"),M.value.ctaText=n("upstreams.actions.create"))}),(V,$)=>{const P=t.resolveComponent("KButton"),k=t.resolveComponent("KBadge"),g=t.resolveComponent("KTruncate"),C=t.resolveComponent("KDropdownItem"),z=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",ac,[t.createVNode(t.unref($a),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":M.value,"enable-entity-actions":"","error-message":_.value,fetcher:t.unref(S),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:f.value,"table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onClearSearchInput:m,"onClick:row":$[1]||($[1]=j=>E(j)),onSort:y},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Mi),{modelValue:f.value,"onUpdate:modelValue":$[0]||($[0]=j=>f.value=j),config:i.value},null,8,["modelValue","config"])]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(P,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,q.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:t.withCtx(({rowValue:j})=>[t.createElementVNode("span",lc,t.toDisplayString(j),1)]),tags:t.withCtx(({rowValue:j})=>[t.createVNode(g,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(j,J=>(t.openBlock(),t.createBlock(k,{key:J,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(J),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:j})=>[t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-id",onClick:X=>I(j,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-json",onClick:X=>B(j,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canRetrieve(j)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-view","has-divider":"",item:x(j.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(j)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-edit",item:U(j.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(j)},{default:t.withCtx(()=>[t.createVNode(C,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:J=>F(j)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(Da),{"action-pending":H.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":T.value&&(T.value.name||T.value.id),"entity-type":t.unref(We).Upstream,error:w.value,title:t.unref(n)("upstreams.delete.title"),visible:N.value,onCancel:D,onProceed:v},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),he=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},nc=he(rc,[["__scopeId","data-v-1082fd6a"]]),Re={list:{konnect:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",kongManager:"/{workspace}/upstreams/{upstreamId}/targets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",edit:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/target/validate"},kongManager:{create:"/{workspace}/upstreams/{upstreamId}/targets",edit:"/{workspace}/upstreams/{upstreamId}/targets/{id}",validate:"/{workspace}/schemas/targets/validate"}}},oc={class:"kong-ui-entities-target-form"},sc={class:"target-form-container"},ic={key:0,class:"target-form-info"},Qa=he(t.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var E;t.useCssVars(x=>({"2094a329":B.value}));const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{getMessageFromError:s}=ja(),{axiosInstance:o}=je({headers:(E=l.config)==null?void 0:E.requestHeaders}),d=t.computed(()=>{var x;return Re.form[l.config.app].edit.replace(/{upstreamId}/gi,((x=l.config)==null?void 0:x.upstreamId)||"")}),c=t.computed(()=>l.targetId?oe.Edit:oe.Create),h=t.computed(()=>c.value===oe.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),p=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),f={target:"",weight:100,tags:""},i=t.computed(()=>{const x=parseInt(p.fields.weight.toString(),10);return x<0||x>65535}),S=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!i.value),b=x=>{var U;p.fields.target=(x==null?void 0:x.target)||"",p.fields.weight=(x==null?void 0:x.weight)??"",p.fields.tags=((U=x==null?void 0:x.tags)==null?void 0:U.join(", "))||"",Object.assign(u,p.fields)},m=()=>{p.errorMessage="",a("cancel")},y=t.computed(()=>{var U,T;let x=`${l.config.apiBaseUrl}${Re.form[l.config.app].validate}`;return l.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((U=l.config)==null?void 0:U.controlPlaneId)||""):l.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(T=l.config)!=null&&T.workspace?`/${l.config.workspace}`:"")),x=x.replace(/{id}/gi,l.targetId),x}),_=t.computed(()=>{var U,T,N,H;let x=`${l.config.apiBaseUrl}${Re.form[l.config.app][c.value]}`;return l.config.app==="konnect"?x=x.replace(/{controlPlaneId}/gi,((U=l.config)==null?void 0:U.controlPlaneId)||"").replace(/{upstreamId}/gi,((T=l.config)==null?void 0:T.upstreamId)||""):l.config.app==="kongManager"&&(x=x.replace(/\/{workspace}/gi,(N=l.config)!=null&&N.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((H=l.config)==null?void 0:H.upstreamId)||"")),x=x.replace(/{id}/gi,l.targetId),x}),I=async()=>{var x,U,T,N,H;try{p.isReadonly=!0,p.errorMessage="";const w={target:p.fields.target,weight:parseInt(p.fields.weight),tags:(T=(U=(x=p.fields.tags)==null?void 0:x.split(","))==null?void 0:U.map(F=>String(F||"").trim()))==null?void 0:T.filter(F=>F!==""),upstream:{id:l.config.upstreamId}};let A;if(await o.post(y.value,w),c.value==="create"?A=await o.post(_.value,w):c.value==="edit"&&(A=((N=l.config)==null?void 0:N.app)==="konnect"?await o.put(_.value,w):await o.patch(_.value,w)),A){const{data:F}=A;p.fields.target=(F==null?void 0:F.name)||"",p.fields.weight=(F==null?void 0:F.weight)??100,p.fields.tags=((H=F==null?void 0:F.tags)==null?void 0:H.join(", "))||"",a("update",F),Object.assign(p.fields,f)}}catch(w){p.errorMessage=s(w),a("error",w)}finally{p.isReadonly=!1}},B=t.computed(()=>p.isReadonly?"inline-flex":"none");return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,f)}),(x,U)=>{const T=t.resolveComponent("KInput"),N=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(N,{"action-button-text":t.unref(n)("targets.form.buttons.save"),"action-pending":!S.value||p.isReadonly,"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),"is-visible":e.isVisible,title:h.value,onCanceled:m,onProceed:I},{"body-content":t.withCtx(()=>[t.createElementVNode("div",oc,[t.createVNode(t.unref(va),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":U[3]||(U[3]=H=>x.$emit("error",H)),"onFetch:success":b,onLoading:U[4]||(U[4]=H=>x.$emit("loading",H))},{default:t.withCtx(()=>[t.createElementVNode("div",sc,[x.$slots.info?(t.openBlock(),t.createElementBlock("div",ic,[t.renderSlot(x.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(T,{modelValue:p.fields.target,"onUpdate:modelValue":U[0]||(U[0]=H=>p.fields.target=H),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(T,{modelValue:p.fields.weight,"onUpdate:modelValue":U[1]||(U[1]=H=>p.fields.weight=H),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:i.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:p.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(T,{modelValue:p.fields.tags,"onUpdate:modelValue":U[2]||(U[2]=H=>p.fields.tags=H),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","is-readonly"])])]),_:3},8,["action-button-text","action-pending","cancel-button-text","is-visible","title"])}}}),[["__scopeId","data-v-45a3f9ee"]]),cc={class:"kong-ui-entities-targets-list"},dc={class:"target-address"},hc=he(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var P;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{axiosInstance:s}=je({headers:(P=l.config)==null?void 0:P.requestHeaders}),o=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:n("targets.list.table_headers.target_address"),sortable:!0},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var g,C,z,j;let k=`${l.config.apiBaseUrl}${Re.list[l.config.app]}`;return l.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((g=l.config)==null?void 0:g.controlPlaneId)||"").replace(/{upstreamId}/gi,((C=l.config)==null?void 0:C.upstreamId)||""):l.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(z=l.config)!=null&&z.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((j=l.config)==null?void 0:j.upstreamId)||"")),k}),{fetcher:u,fetcherState:f}=Pa(l.config,p.value),i=()=>{o.value++},S=t.ref(null),b=()=>{M.value=!0},m=(k,g)=>{const C=k.id;if(!g(C)){a("copy:error",{entity:k,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:k,field:"id",message:n("targets.copy.success",{val:C})})},y=(k,g)=>{const C=JSON.stringify(k);if(!g(C)){a("copy:error",{entity:k,message:n("targets.errors.copy")});return}a("copy:success",{entity:k,message:n("targets.copy.success_brief")})},_=k=>{q.value=k,M.value=!0},I=k=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(k),B=k=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(k),E=t.ref(void 0),x=t.ref(!1),U=t.ref(!1),T=t.ref(""),N=Ka(l.config,p.value),H=k=>{E.value=k,x.value=!0},w=()=>{x.value=!1},A=async()=>{var k,g,C;if((k=E.value)!=null&&k.id){U.value=!0;try{await s.delete(N(E.value.id)),U.value=!1,x.value=!1,o.value++,a("delete:success",E.value)}catch(z){T.value=((C=(g=z.response)==null?void 0:g.data)==null?void 0:C.message)||z.message||n("targets.errors.delete"),a("error",z)}finally{U.value=!1}}},F=t.ref(!0);t.watch(f,k=>{var g,C,z,j;if(Array.isArray((g=k==null?void 0:k.response)==null?void 0:g.data)&&(F.value=k.response.data.length>0),k.status===pe.Error){S.value={title:n("targets.errors.general")},(j=(z=(C=k.error)==null?void 0:C.response)==null?void 0:z.data)!=null&&j.message&&(S.value.message=k.error.response.data.message),a("error",k.error);return}S.value=null});const D=t.ref({ctaText:void 0,message:n("targets.list.empty_state.description"),title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(D.value.title=n("targets.list.empty_state.title"),D.value.ctaText=n("targets.actions.create"))});const v=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace,requestHeaders:l.config.requestHeaders}})),q=t.ref(""),M=t.ref(!1),K=k=>{q.value?a("update:target",k):a("create:target",k),V()},V=()=>{$(),o.value++},$=()=>{M.value=!1,q.value=""};return(k,g)=>{const C=t.resolveComponent("KButton"),z=t.resolveComponent("KBadge"),j=t.resolveComponent("KTruncate"),J=t.resolveComponent("KDropdownItem"),X=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",cc,[t.createVNode(t.unref($a),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":D.value,"enable-entity-actions":"","error-message":S.value,fetcher:t.unref(u),"fetcher-cache-key":o.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:g[1]||(g[1]=()=>l.config.createRoute?void 0:b()),onSort:i},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(C,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:l.config.createRoute?l.config.createRoute:void 0,onClick:g[0]||(g[0]=()=>l.config.createRoute?void 0:b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,F.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:R})=>[t.createElementVNode("span",dc,t.toDisplayString(R),1)]),tags:t.withCtx(({rowValue:R})=>[t.createVNode(j,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R,te=>(t.openBlock(),t.createBlock(z,{key:te,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(te),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:R})=>[t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:ge=>m(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:ge=>y(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-entity-edit","has-divider":"",onClick:te=>_(R.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>I(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-healthy",onClick:te=>a("health-actions:healthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>B(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-unhealthy",onClick:te=>a("health-actions:unhealthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(R)},{default:t.withCtx(()=>[t.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:te=>H(R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.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","table-headers","use-action-outside"]),t.createVNode(t.unref(Da),{"action-pending":U.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(We).Target,error:T.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:x.value,onCancel:w,onProceed:A},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Qa,{config:v.value,"is-visible":M.value,"target-id":q.value,onCancel:$,onUpdate:K},t.createSlots({_:2},[k.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(k.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-268875d2"]]),pc={key:1},uc=he(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var w,A,F,D;const{i18nT:a,i18n:{t:l}}=de.useI18n(),n=e,s=r,{debouncedQueryChange:o,loading:d,loadItems:c,results:h,allRecords:p}=La(n.config,(A=Ve.form[(w=n.config)==null?void 0:w.app])==null?void 0:A.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:i,results:S}=La(n.config,(D=Ve.form[(F=n.config)==null?void 0:F.app])==null?void 0:D.getCertificates),b=t.ref(""),m=t.computed(()=>{var v;return!!n.name&&!((v=p.value)!=null&&v.some(q=>q.host===n.name))}),y=t.computed(()=>{var q,M,K;const v=m.value&&n.name.includes((q=b.value)==null?void 0:q.toLowerCase());return(K=h.value)==null?void 0:K.map(V=>({label:V.host,value:V.id})).concat(v?[{label:n.name,value:((M=B.value)==null?void 0:M.value)||n.name}]:[])}),_=t.computed(()=>{var v;return(v=S.value)==null?void 0:v.map(q=>({label:q.id,value:q.id}))}),I=t.ref(""),B=t.ref({value:"",label:""}),E=t.computed(()=>{var v,q;return((v=y.value.find(M=>M.value===I.value))==null?void 0:v.label)||((q=B.value)==null?void 0:q.label)}),x=v=>{b.value=v,o(v)},U=v=>{B.value=v},T=()=>{B.value={value:"",label:""}},N=v=>{I.value=v,s("update:name",E.value)},H=t.ref(!1);return t.onBeforeMount(async()=>{var v,q;try{H.value=!0,await c(),n.name&&(I.value=((q=(v=y.value.find(M=>M.label===n.name))==null?void 0:v.value)==null?void 0:q.toString())||n.name),await i()}finally{H.value=!1}}),(v,q)=>{const M=t.resolveComponent("KSkeleton"),K=t.resolveComponent("KSelect"),V=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[H.value?(t.openBlock(),t.createBlock(M,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",pc,[t.createVNode(K,{appearance:"select",autosuggest:"",class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"",items:y.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":I.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%","onItem:added":U,"onItem:removed":T,onQueryChange:x,"onUpdate:modelValue":N},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(V,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":q[0]||(q[0]=$=>s("update:host-header",$))},null,8,["label","model-value","readonly"]),t.createVNode(K,{appearance:"select",autosuggest:"",class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"",items:_.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(f),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":q[1]||(q[1]=$=>s("update:client-certificate",$))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(V,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":q[2]||(q[2]=$=>s("update:tags",$))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-02065a3d"]]),ze={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},fc={class:"fields-group-title"},mc={class:"fields-group-text"},gc={class:"fields-group-title"},yc={class:"fields-group-text"},kc=he(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=de.useI18n(),{inRange:n}=Le(),s=e,o=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>s.hashOn,(u,f)=>{f==="header"&&u!==f&&o("update:hash-on-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(o("update:hash-fallback","none"),o("update:hash-fallback-header",""),o("update:hash-fallback-query-argument",""),o("update:hash-fallback-uri-capture",""))}),t.watch(()=>s.hashFallback,(u,f)=>{f==="header"&&u!==f&&o("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-fallback-uri-capture","")});const h=t.computed(()=>s.hashOn==="cookie"||s.hashOn==="none"),p=t.computed(()=>s.slots?n(s.slots,ut,ft)?"":l("upstreams.form.errors.in_range"):"");return(u,f)=>{const i=t.resolveComponent("KExternalLink"),S=t.resolveComponent("KSelect"),b=t.resolveComponent("KInput"),m=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(i,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(S,{appearance:"select",class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=y=>o("update:algorithm",y))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(ft),min:t.unref(ut),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":f[1]||(f[1]=y=>o("update:slots",y))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",fc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",mc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(S,{appearance:"select",class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[2]||(f[2]=y=>o("update:hash-on",y))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[3]||(f[3]=y=>o("update:hash-on-header",y))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[4]||(f[4]=y=>o("update:hash-on-cookie",y))},null,8,["label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[5]||(f[5]=y=>o("update:hash-on-cookie-path",y))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(b,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[6]||(f[6]=y=>o("update:hash-on-query-argument",y))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(b,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[7]||(f[7]=y=>o("update:hash-on-uri-capture",y))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",gc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",yc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(S,{appearance:"select",class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[8]||(f[8]=y=>o("update:hash-fallback",y))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[9]||(f[9]=y=>o("update:hash-fallback-header",y))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[10]||(f[10]=y=>o("update:hash-on-cookie",y))},null,8,["label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[11]||(f[11]=y=>o("update:hash-on-cookie-path",y))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(b,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[12]||(f[12]=y=>o("update:hash-fallback-query-argument",y))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(b,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[13]||(f[13]=y=>o("update:hash-fallback-uri-capture",y))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-3a210772"]]),bc={class:"fields-group-title"},Cc={class:"fields-group-text"},wc={class:"fields-group-title"},_c={class:"fields-group-text"},Sc=he(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=r;return(n,s)=>{const o=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(o,{"hide-icon":"",href:t.unref(ze).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",bc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",Cc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:s[0]||(s[0]=p=>l("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",wc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",_c,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:s[1]||(s[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(Zi),min:t.unref(Yi),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":s[2]||(s[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),xc={key:2},Nc={class:"fields-group-title"},Vc={class:"fields-group-text"},Ic={class:"fields-group-title"},Bc={class:"fields-group-text"},Tc=he(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),{objectsAreEqual:l}=Le(),n=e,s=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:h}=qe({replaceId:!0}),{trackNewItems:p}=qe({replaceId:!0});t.watch(()=>n.type,(b,m)=>{m==="tcp"&&b!==m&&s("update:tcp-failures","5"),(m==="https"||m==="grpcs")&&b!==m&&(s("update:https-sni",""),s("update:verify-ssl",!1)),m!=="tcp"&&b==="tcp"&&(s("update:http-path","/"),s("update:http-statuses",mt),s("update:unhealthy-http-statuses",yt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,b=>{l(u.value,b)||(u.value=[...b])},{immediate:!0,deep:!0});const f=()=>{s("update:headers",u.value)},i=()=>{u.value.push({key:"",values:""}),f()},S=b=>{b===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(b,1),f()};return(b,m)=>{const y=t.resolveComponent("KExternalLink"),_=t.resolveComponent("KSelect"),I=t.resolveComponent("KInput"),B=t.resolveComponent("KCheckbox"),E=t.resolveComponent("KLabel"),x=t.resolveComponent("KIcon"),U=t.resolveComponent("KButton"),T=t.resolveComponent("KMultiselect"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(y,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var H;return[t.createVNode(_,{appearance:"select",class:"active-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[0]||(m[0]=w=>s("update:type",w))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":m[1]||(m[1]=w=>s("update:http-path",w))},null,8,["label","model-value","readonly"])),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(Xi),min:t.unref(Gi),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":m[2]||(m[2]=w=>s("update:timeout",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(tc),min:t.unref(ec),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":m[3]||(m[3]=w=>s("update:concurrency",w))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":m[4]||(m[4]=w=>s("update:https-sni",w))},null,8,["label","model-value","readonly"]),t.createVNode(B,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":m[5]||(m[5]=w=>s("update:verify-ssl",w))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((H=e.config)==null?void 0:H.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",xc,[t.createVNode(E,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(w,A)=>(t.openBlock(),t.createElementBlock("div",{key:`${w.header}_${A}`,class:t.normalizeClass(["headers-row",{"margin-top-6":A>0}])},[t.createVNode(I,{modelValue:u.value[A].key,"onUpdate:modelValue":F=>u.value[A].key=F,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${A+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(I,{modelValue:u.value[A].values,"onUpdate:modelValue":F=>u.value[A].values=F,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${A+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(U,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:F=>S(A)},{icon:t.withCtx(()=>[t.createVNode(x,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&A===u.value.length-1?(t.openBlock(),t.createBlock(U,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:i},{icon:t.withCtx(()=>[t.createVNode(x,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Nc,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Vc,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Wa),min:t.unref(Ja),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[6]||(m[6]=w=>s("update:interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":m[7]||(m[7]=w=>s("update:successes",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(T,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%","onItem:added":m[8]||(m[8]=w=>t.unref(h)(w,!0)),"onItem:removed":m[9]||(m[9]=w=>t.unref(h)(w,!1)),"onUpdate:modelValue":m[10]||(m[10]=w=>s("update:http-statuses",w))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Ic,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Bc,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Wa),min:t.unref(Ja),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[11]||(m[11]=w=>s("update:unhealthy-interval",w))},null,8,["help","label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createBlock(I,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[12]||(m[12]=w=>s("update:tcp-failures",w))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[13]||(m[13]=w=>s("update:http-failures",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(T,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%","onItem:added":m[14]||(m[14]=w=>t.unref(p)(w,!0)),"onItem:removed":m[15]||(m[15]=w=>t.unref(p)(w,!1)),"onUpdate:modelValue":m[16]||(m[16]=w=>s("update:unhealthy-http-statuses",w))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(za),min:t.unref(Ra),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":m[17]||(m[17]=w=>s("update:unhealthy-timeouts",w))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-305fcec9"]]),Hc={class:"fields-group-title"},Ac={class:"fields-group-text"},Ec={class:"fields-group-title"},Fc={class:"fields-group-text"},Oc=he(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=e,n=r,s=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),o=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=qe({replaceId:!0}),{trackNewItems:c}=qe({replaceId:!0});return t.watch(()=>l.type,(h,p)=>{p==="tcp"&&h!==p&&n("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(n("update:http-statuses",gt),n("update:unhealthy-http-statuses",kt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),i=t.resolveComponent("KInput"),S=t.resolveComponent("KMultiselect"),b=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(f,{appearance:"select",class:"passive-healthcheck-type-select",items:s.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=m=>n("update:type",m))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Hc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",Ac,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(i,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=m=>n("update:successes",m))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%","onItem:added":p[2]||(p[2]=m=>t.unref(d)(m,!0)),"onItem:removed":p[3]||(p[3]=m=>t.unref(d)(m,!1)),"onUpdate:modelValue":p[4]||(p[4]=m=>n("update:http-statuses",m))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Ec,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",Fc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(i,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(za),min:t.unref(Ra),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=m=>n("update:timeouts",m))},null,8,["label","max","min","model-value","readonly"]),o.value?(t.openBlock(),t.createBlock(i,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=m=>n("update:tcp-failures",m))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(i,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=m=>n("update:http-failures",m))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(S,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%","onItem:added":p[8]||(p[8]=m=>t.unref(c)(m,!0)),"onItem:removed":p[9]||(p[9]=m=>t.unref(c)(m,!1)),"onUpdate:modelValue":p[10]||(p[10]=m=>n("update:unhealthy-http-statuses",m))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-43c4e55e"]]),qc={class:"kong-ui-entities-upstreams-form"},Uc=he(t.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:r}){var P;const a=e,l=r,{inRange:n,stringToNumberArray:s,upstreamsResponseToFields:o,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=Le(),{axiosInstance:p}=je({headers:(P=a.config)==null?void 0:P.requestHeaders}),{getMessageFromError:u}=ja(),f=Je.useRouter(),i=t.reactive({fields:d(),readonly:!1,errorMessage:""}),S=t.reactive(d()),b=t.computed(()=>!c(i.fields,S)),m=k=>{i.fields.activeHealthCheck.interval=k?"5":"0",i.fields.activeHealthCheck.successes=k?"5":"0",i.fields.activeHealthCheck.httpFailures=k?"5":"0",i.fields.activeHealthCheck.unhealthyInterval=k?"5":"0"},y=k=>{i.fields.passiveHealthCheck.timeouts=k?"5":"0",i.fields.passiveHealthCheck.successes=k?"80":"0"},_=t.computed(()=>i.fields.slots?n(i.fields.slots,ut,ft):!0),I=t.computed(()=>i.fields.hashOn==="header"?!!i.fields.hashOnHeader:!0),B=t.computed(()=>i.fields.hashOn==="cookie"||i.fields.hashFallback==="cookie"?!!i.fields.hashOnCookie:!0),E=t.computed(()=>i.fields.hashOn==="cookie"||i.fields.hashFallback==="cookie"?!!i.fields.hashOnCookiePath:!0),x=t.computed(()=>i.fields.hashOn==="query_arg"?!!i.fields.hashOnQueryArgument:!0),U=t.computed(()=>i.fields.hashOn==="uri_capture"?!!i.fields.hashOnUriCapture:!0),T=t.computed(()=>i.fields.hashFallback==="header"?!!i.fields.hashFallbackHeader:!0),N=t.computed(()=>i.fields.hashFallback==="query_arg"?!!i.fields.hashFallbackQueryArgument:!0),H=t.computed(()=>i.fields.hashFallback==="uri_capture"?!!i.fields.hashFallbackUriCapture:!0),w=t.computed(()=>!!i.fields.name&&_.value&&I.value&&B.value&&E.value&&x.value&&U.value&&T.value&&N.value&&H.value),A=t.computed(()=>a.upstreamId?oe.Edit:oe.Create),F=t.computed(()=>{var k,g;return(g=Ve.form[(k=a.config)==null?void 0:k.app])==null?void 0:g.edit}),D=k=>{Object.assign(i.fields,o(k)),Object.assign(S,h(i.fields))},v=()=>{var k;f.push(((k=a.config)==null?void 0:k.cancelRoute)||{name:"upstreams-list"})},q=k=>{l("loading",k)},M=k=>{l("error",k)},K=()=>{var g,C,z,j,J;const k={name:i.fields.name,slots:Number(i.fields.slots),algorithm:i.fields.algorithm,hash_on:i.fields.hashOn,hash_fallback:i.fields.hashFallback,healthchecks:{}};return i.fields.hostHeader&&(k.host_header=i.fields.hostHeader),i.fields.clientCertificate&&(k.client_certificate={id:i.fields.clientCertificate}),i.fields.healthchecksThreshold&&(k.healthchecks.threshold=Number(i.fields.healthchecksThreshold)),i.fields.tags&&(k.tags=(C=(g=i.fields.tags.split(","))==null?void 0:g.map(X=>String(X||"").trim()))==null?void 0:C.filter(X=>X!=="")),i.fields.hashOn==="header"&&(k.hash_on_header=i.fields.hashOnHeader),(i.fields.hashOn==="cookie"||i.fields.hashFallback==="cookie")&&(k.hash_on_cookie=i.fields.hashOnCookie,k.hash_on_cookie_path=i.fields.hashOnCookiePath),i.fields.hashOn==="query_arg"&&(k.hash_on_query_arg=i.fields.hashOnQueryArgument),i.fields.hashOn==="uri_capture"&&(k.hash_on_uri_capture=i.fields.hashOnUriCapture),i.fields.hashFallback==="header"&&(k.hash_fallback_header=i.fields.hashFallbackHeader),i.fields.hashFallback==="query_arg"&&(k.hash_fallback_query_arg=i.fields.hashFallbackQueryArgument),i.fields.hashFallback==="uri_capture"&&(k.hash_fallback_uri_capture=i.fields.hashFallbackUriCapture),i.fields.activeHealthSwitch?(k.healthchecks.active={type:i.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},i.fields.activeHealthCheck.timeout&&(k.healthchecks.active.timeout=Number(i.fields.activeHealthCheck.timeout)),i.fields.activeHealthCheck.concurrency&&(k.healthchecks.active.concurrency=Number(i.fields.activeHealthCheck.concurrency)),i.fields.activeHealthCheck.type!=="tcp"&&i.fields.activeHealthCheck.httpPath&&(k.healthchecks.active.http_path=i.fields.activeHealthCheck.httpPath),((z=a.config)==null?void 0:z.app)==="kongManager"&&(i.fields.activeHealthCheck.headers.length===0?k.healthchecks.active.headers=[]:k.healthchecks.active.headers=i.fields.activeHealthCheck.headers.reduce((X,R)=>{var te,ge;return R.key?{...X,[R.key]:(ge=(te=R.values.split(","))==null?void 0:te.map(Ie=>String(Ie||"").trim()))==null?void 0:ge.filter(Ie=>Ie!=="")}:{...X}},{})),(i.fields.activeHealthCheck.type==="https"||i.fields.activeHealthCheck.type==="grpcs")&&i.fields.activeHealthCheck.httpsSni&&(k.healthchecks.active.https_sni=i.fields.activeHealthCheck.httpsSni),(i.fields.activeHealthCheck.type==="https"||i.fields.activeHealthCheck.type==="grpcs")&&(k.healthchecks.active.https_verify_certificate=i.fields.activeHealthCheck.verifySsl),i.fields.activeHealthCheck.interval&&(k.healthchecks.active.healthy.interval=Number(i.fields.activeHealthCheck.interval)),i.fields.activeHealthCheck.successes&&(k.healthchecks.active.healthy.successes=Number(i.fields.activeHealthCheck.successes)),i.fields.activeHealthCheck.type!=="tcp"&&i.fields.activeHealthCheck.httpStatuses&&(k.healthchecks.active.healthy.http_statuses=s(i.fields.activeHealthCheck.httpStatuses)),i.fields.activeHealthCheck.unhealthyInterval&&(k.healthchecks.active.unhealthy.interval=Number(i.fields.activeHealthCheck.unhealthyInterval)),i.fields.activeHealthCheck.unhealthyTimeouts&&(k.healthchecks.active.unhealthy.timeouts=Number(i.fields.activeHealthCheck.unhealthyTimeouts)),i.fields.activeHealthCheck.type!=="tcp"&&i.fields.activeHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.active.unhealthy.http_statuses=s(i.fields.activeHealthCheck.unhealthyHttpStatuses)),i.fields.activeHealthCheck.type!=="tcp"&&i.fields.activeHealthCheck.httpFailures&&(k.healthchecks.active.unhealthy.http_failures=Number(i.fields.activeHealthCheck.httpFailures)),i.fields.activeHealthCheck.type==="tcp"&&i.fields.activeHealthCheck.tcpFailures&&(k.healthchecks.active.unhealthy.tcp_failures=Number(i.fields.activeHealthCheck.tcpFailures))):((j=a.config)==null?void 0:j.app)==="kongManager"&&A.value===oe.Edit&&(k.healthchecks.active={type:i.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),i.fields.passiveHealthSwitch?(k.healthchecks.passive={type:i.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},i.fields.passiveHealthCheck.successes&&(k.healthchecks.passive.healthy.successes=Number(i.fields.passiveHealthCheck.successes)),i.fields.passiveHealthCheck.type!=="tcp"&&i.fields.passiveHealthCheck.httpStatuses&&(k.healthchecks.passive.healthy.http_statuses=s(i.fields.passiveHealthCheck.httpStatuses)),i.fields.passiveHealthCheck.timeouts&&(k.healthchecks.passive.unhealthy.timeouts=Number(i.fields.passiveHealthCheck.timeouts)),i.fields.passiveHealthCheck.type!=="tcp"&&i.fields.passiveHealthCheck.unhealthyHttpStatuses&&(k.healthchecks.passive.unhealthy.http_statuses=s(i.fields.passiveHealthCheck.unhealthyHttpStatuses)),i.fields.passiveHealthCheck.type!=="tcp"&&i.fields.passiveHealthCheck.httpFailures&&(k.healthchecks.passive.unhealthy.http_failures=Number(i.fields.passiveHealthCheck.httpFailures)),i.fields.passiveHealthCheck.type==="tcp"&&i.fields.passiveHealthCheck.tcpFailures&&(k.healthchecks.passive.unhealthy.tcp_failures=Number(i.fields.passiveHealthCheck.tcpFailures))):((J=a.config)==null?void 0:J.app)==="kongManager"&&A.value===oe.Edit&&(k.healthchecks.passive={type:i.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),k},V=k=>{var C,z,j,J,X,R;let g=`${(C=a.config)==null?void 0:C.apiBaseUrl}${Ve.form[(z=a.config)==null?void 0:z.app][k]}`;return((j=a.config)==null?void 0:j.app)==="konnect"?g=g.replace(/{controlPlaneId}/gi,((J=a.config)==null?void 0:J.controlPlaneId)||""):((X=a.config)==null?void 0:X.app)==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(R=a.config)!=null&&R.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.upstreamId),g},$=async()=>{var k;try{i.readonly=!0,await p.post(V("validate"),K());let g;A.value===oe.Create?g=await p.post(V("create"),K()):A.value===oe.Edit&&(g=((k=a.config)==null?void 0:k.app)==="konnect"?await p.put(V("edit"),K()):await p.patch(V("edit"),K())),l("update",g==null?void 0:g.data)}catch(g){i.errorMessage=u(g),l("error",g)}finally{i.readonly=!1}};return(k,g)=>(t.openBlock(),t.createElementBlock("div",qc,[t.createVNode(t.unref(va),{"can-submit":w.value&&b.value,config:e.config,"edit-id":e.upstreamId,"error-message":i.errorMessage,"fetch-url":F.value,"is-readonly":i.readonly,onCancel:v,"onFetch:error":M,"onFetch:success":D,onLoading:q,onSubmit:$},{default:t.withCtx(()=>[t.createVNode(uc,{"client-certificate":i.fields.clientCertificate,"onUpdate:clientCertificate":g[0]||(g[0]=C=>i.fields.clientCertificate=C),"host-header":i.fields.hostHeader,"onUpdate:hostHeader":g[1]||(g[1]=C=>i.fields.hostHeader=C),name:i.fields.name,"onUpdate:name":g[2]||(g[2]=C=>i.fields.name=C),tags:i.fields.tags,"onUpdate:tags":g[3]||(g[3]=C=>i.fields.tags=C),config:e.config,readonly:i.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(kc,{algorithm:i.fields.algorithm,"onUpdate:algorithm":g[4]||(g[4]=C=>i.fields.algorithm=C),"hash-fallback":i.fields.hashFallback,"onUpdate:hashFallback":g[5]||(g[5]=C=>i.fields.hashFallback=C),"hash-fallback-header":i.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":g[6]||(g[6]=C=>i.fields.hashFallbackHeader=C),"hash-fallback-query-argument":i.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":g[7]||(g[7]=C=>i.fields.hashFallbackQueryArgument=C),"hash-fallback-uri-capture":i.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":g[8]||(g[8]=C=>i.fields.hashFallbackUriCapture=C),"hash-on":i.fields.hashOn,"onUpdate:hashOn":g[9]||(g[9]=C=>i.fields.hashOn=C),"hash-on-cookie":i.fields.hashOnCookie,"onUpdate:hashOnCookie":g[10]||(g[10]=C=>i.fields.hashOnCookie=C),"hash-on-cookie-path":i.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":g[11]||(g[11]=C=>i.fields.hashOnCookiePath=C),"hash-on-header":i.fields.hashOnHeader,"onUpdate:hashOnHeader":g[12]||(g[12]=C=>i.fields.hashOnHeader=C),"hash-on-query-argument":i.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":g[13]||(g[13]=C=>i.fields.hashOnQueryArgument=C),"hash-on-uri-capture":i.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":g[14]||(g[14]=C=>i.fields.hashOnUriCapture=C),slots:i.fields.slots,"onUpdate:slots":g[15]||(g[15]=C=>i.fields.slots=C),readonly:i.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(Sc,{"active-health-switch":i.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[g[16]||(g[16]=C=>i.fields.activeHealthSwitch=C),m],"healthchecks-threshold":i.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":g[17]||(g[17]=C=>i.fields.healthchecksThreshold=C),"passive-health-switch":i.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[g[18]||(g[18]=C=>i.fields.passiveHealthSwitch=C),y],readonly:i.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),i.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Tc,{key:0,concurrency:i.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":g[19]||(g[19]=C=>i.fields.activeHealthCheck.concurrency=C),headers:i.fields.activeHealthCheck.headers,"onUpdate:headers":g[20]||(g[20]=C=>i.fields.activeHealthCheck.headers=C),"http-failures":i.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":g[21]||(g[21]=C=>i.fields.activeHealthCheck.httpFailures=C),"http-path":i.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":g[22]||(g[22]=C=>i.fields.activeHealthCheck.httpPath=C),"http-statuses":i.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[23]||(g[23]=C=>i.fields.activeHealthCheck.httpStatuses=C),"https-sni":i.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":g[24]||(g[24]=C=>i.fields.activeHealthCheck.httpsSni=C),interval:i.fields.activeHealthCheck.interval,"onUpdate:interval":g[25]||(g[25]=C=>i.fields.activeHealthCheck.interval=C),successes:i.fields.activeHealthCheck.successes,"onUpdate:successes":g[26]||(g[26]=C=>i.fields.activeHealthCheck.successes=C),"tcp-failures":i.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[27]||(g[27]=C=>i.fields.activeHealthCheck.tcpFailures=C),timeout:i.fields.activeHealthCheck.timeout,"onUpdate:timeout":g[28]||(g[28]=C=>i.fields.activeHealthCheck.timeout=C),type:i.fields.activeHealthCheck.type,"onUpdate:type":g[29]||(g[29]=C=>i.fields.activeHealthCheck.type=C),"unhealthy-http-statuses":i.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[30]||(g[30]=C=>i.fields.activeHealthCheck.unhealthyHttpStatuses=C),"unhealthy-interval":i.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":g[31]||(g[31]=C=>i.fields.activeHealthCheck.unhealthyInterval=C),"unhealthy-timeouts":i.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":g[32]||(g[32]=C=>i.fields.activeHealthCheck.unhealthyTimeouts=C),"verify-ssl":i.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":g[33]||(g[33]=C=>i.fields.activeHealthCheck.verifySsl=C),config:e.config,readonly:i.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),i.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock(Oc,{key:1,"http-failures":i.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":g[34]||(g[34]=C=>i.fields.passiveHealthCheck.httpFailures=C),"http-statuses":i.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[35]||(g[35]=C=>i.fields.passiveHealthCheck.httpStatuses=C),successes:i.fields.passiveHealthCheck.successes,"onUpdate:successes":g[36]||(g[36]=C=>i.fields.passiveHealthCheck.successes=C),"tcp-failures":i.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[37]||(g[37]=C=>i.fields.passiveHealthCheck.tcpFailures=C),timeouts:i.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":g[38]||(g[38]=C=>i.fields.passiveHealthCheck.timeouts=C),type:i.fields.passiveHealthCheck.type,"onUpdate:type":g[39]||(g[39]=C=>i.fields.passiveHealthCheck.type=C),"unhealthy-http-statuses":i.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[40]||(g[40]=C=>i.fields.passiveHealthCheck.unhealthyHttpStatuses=C),readonly:i.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])]))}}),[["__scopeId","data-v-810fb7b7"]]),vc=t.createElementVNode("code",null,"10",-1),$c=t.createElementVNode("code",null,"65536",-1),Dc={"data-testid":"client_certificate-plain-text"},Mc=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=de.useI18n(),{getPropValue:n}=Ji(),s=t.computed(()=>Ve.form[r.config.app].edit),o=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:W.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:W.Basic},hash_on:{order:7,section:W.Basic},hash_on_header:{order:8,section:W.Basic},hash_on_uri_capture:{order:9,section:W.Basic},hash_on_query_arg:{order:10,section:W.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:W.Basic},hash_on_cookie_path:{order:12,section:W.Basic},healthchecks:{order:13,section:W.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(fi),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":o.value,"fetch-url":s.value,"hide-title":e.hideTitle,"onCopy:success":c[0]||(c[0]=h=>d.$emit("copy:success",h)),"onFetch:error":c[1]||(c[1]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[2]||(c[2]=h=>d.$emit("fetch:success",h)),onLoading:c[3]||(c[3]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(h.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[vc]),max:t.withCtx(()=>[$c]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",Dc,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(n)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});ae.TargetForm=Qa,ae.TargetsList=hc,ae.UpstreamsConfigCard=Mc,ae.UpstreamsForm=Uc,ae.UpstreamsList=nc,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});