@kong-ui-public/entities-upstreams-targets 3.12.10 → 3.12.11

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 +1 @@
1
- (function(W,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/entities-shared"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/entities-shared","vue-router","@kong/icons","@kong-ui-public/i18n"],e):(W=typeof globalThis<"u"?globalThis:W||self,e(W["kong-ui-entities-upstreams-targets"]={},W.Vue,W["kong-ui-public-entities-shared"],W.VueRouter,W.KongIcons,W["kong-ui-public-i18n"]))})(this,function(W,e,m,Ve,ee,we){"use strict";const Ze={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."},empty_state_v2:{title:"Configure your first upstream",description:"Upstreams route traffic to multiple backend services, handling load balancing, health checks, and circuit breaking for reliability.",create_cta:"New upstream",group:"Upstreams created in gateways within this group will automatically appear here.",learn_more:"Learn more"},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",sticky_sessions_label:"Sticky Sessions"},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."},sticky_sessions_cookie:{label:"Sticky Sessions Cookie",tooltip:"The cookie name to keep sticky sessions."},sticky_sessions_cookie_path:{label:"Sticky Sessions Cookie Path",tooltip:"A string representing a URL path, such as /path/to/resource. Must start with a forward slash (/) and must not contain empty segments (i.e., two consecutive forward slashes)."},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",target_type:"Target Type"},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"},failover:{label:"Failover Target",load_balance_target:"Load balance",failover_target:"Failover",help:"Whether to use this target only as backup.",unsupported:"The current load balance algorithm does not support failover."}}}}};function et(){const a=we.createI18n("en-us",Ze);return{i18n:a,i18nT:we.i18nTComponent(a)}}function ne(a){const{replaceId:E=!1}=a,o=e.ref([]);return{addedItems:o,trackNewItems:(n,k)=>{if(k){const f={...n};E&&(f.value=n.label),o.value.push(f)}else o.value=o.value.filter(f=>f.value!==n.value)}}}const he=[{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"}],Ce=10,_e=65536,tt=0,at=65535,le=0,se=255,Ne=0,xe=255,lt=0,st=65535,He=0,Te=65535,ot=0,rt=2**31,ce=["200","302"],de=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],ue=["429","404","500","501","502","503","504","505"],fe=["429","500","503"],it=["latency","least-connections","round-robin"];function pe(){const a=s=>/^\d+$/.test(s),E=(s,h,b)=>{if(a(s)){const u=Number(s);return u>=h&&u<=b}else return!1},o=s=>s.map(h=>Number(h)),l=s=>s.map(h=>h.toString()),n=s=>{var b,u,t,F,w,d,C,M,I,L,$,y,S,H,p,B,T,J,A,X,U,q,j,G,v,Q,_,O,g,V,x,K,c,r,i,P,R,z,te,ae,be,Ie,qe,Fe,Be,Ee,Oe,De,$e,Pe,Ae,Me,Ke,Re,Le,je,Qe,We,ve,Je,Ge,ze,Xe,Ye;return{name:(s==null?void 0:s.name)||"",hostHeader:(s==null?void 0:s.host_header)||"",clientCertificate:((b=s==null?void 0:s.client_certificate)==null?void 0:b.id)||"",tags:((u=s==null?void 0:s.tags)==null?void 0:u.join(", "))||"",algorithm:(s==null?void 0:s.algorithm)||"round-robin",stickySessionsCookie:(s==null?void 0:s.sticky_sessions_cookie)||"",stickySessionsCookiePath:(s==null?void 0:s.sticky_sessions_cookie_path)||"/",slots:((t=s==null?void 0:s.slots)==null?void 0:t.toString())||"10000",hashOn:(s==null?void 0:s.hash_on)||"none",hashFallback:(s==null?void 0:s.hash_fallback)||"none",hashOnHeader:(s==null?void 0:s.hash_on_header)||"",hashOnCookie:(s==null?void 0:s.hash_on_cookie)||"",hashOnCookiePath:(s==null?void 0:s.hash_on_cookie_path)||"/",hashOnQueryArgument:(s==null?void 0:s.hash_on_query_arg)||"",hashOnUriCapture:(s==null?void 0:s.hash_on_uri_capture)||"",hashFallbackHeader:(s==null?void 0:s.hash_fallback_header)||"",hashFallbackQueryArgument:(s==null?void 0:s.hash_fallback_query_arg)||"",hashFallbackUriCapture:(s==null?void 0:s.hash_fallback_uri_capture)||"",activeHealthSwitch:s?((w=(F=s.healthchecks.active)==null?void 0:F.healthy)==null?void 0:w.interval)!==0||((C=(d=s.healthchecks.active)==null?void 0:d.unhealthy)==null?void 0:C.interval)!==0:!1,passiveHealthSwitch:s?((I=(M=s.healthchecks.passive)==null?void 0:M.healthy)==null?void 0:I.successes)!==0||(($=(L=s.healthchecks.passive)==null?void 0:L.unhealthy)==null?void 0:$.timeouts)!==0||((S=(y=s.healthchecks.passive)==null?void 0:y.unhealthy)==null?void 0:S.tcp_failures)!==0||((p=(H=s.healthchecks.passive)==null?void 0:H.unhealthy)==null?void 0:p.http_failures)!==0:!1,healthchecksThreshold:((B=s==null?void 0:s.healthchecks.threshold)==null?void 0:B.toString())||"0",activeHealthCheck:{type:((T=s==null?void 0:s.healthchecks.active)==null?void 0:T.type)||"http",httpPath:((J=s==null?void 0:s.healthchecks.active)==null?void 0:J.http_path)||"/",timeout:((X=(A=s==null?void 0:s.healthchecks.active)==null?void 0:A.timeout)==null?void 0:X.toString())||"1",concurrency:((q=(U=s==null?void 0:s.healthchecks.active)==null?void 0:U.concurrency)==null?void 0:q.toString())||"10",httpsSni:((j=s==null?void 0:s.healthchecks.active)==null?void 0:j.https_sni)||"",verifySsl:((G=s==null?void 0:s.healthchecks.active)==null?void 0:G.https_verify_certificate)||!1,headers:(v=s==null?void 0:s.healthchecks.active)!=null&&v.headers&&Object.entries(s.healthchecks.active.headers).length>0?Object.entries(s.healthchecks.active.headers).map(([vt,Se])=>({key:vt,values:Se==null?void 0:Se.join(", ")})):[{key:"",values:""}],healthy:{interval:((O=(_=(Q=s==null?void 0:s.healthchecks.active)==null?void 0:Q.healthy)==null?void 0:_.interval)==null?void 0:O.toString())||"0",successes:((x=(V=(g=s==null?void 0:s.healthchecks.active)==null?void 0:g.healthy)==null?void 0:V.successes)==null?void 0:x.toString())||"5",httpStatuses:(c=(K=s==null?void 0:s.healthchecks.active)==null?void 0:K.healthy)!=null&&c.http_statuses?l(s.healthchecks.active.healthy.http_statuses):ce},unhealthy:{interval:((P=(i=(r=s==null?void 0:s.healthchecks.active)==null?void 0:r.unhealthy)==null?void 0:i.interval)==null?void 0:P.toString())||"0",httpFailures:((te=(z=(R=s==null?void 0:s.healthchecks.active)==null?void 0:R.unhealthy)==null?void 0:z.http_failures)==null?void 0:te.toString())||"5",tcpFailures:((Ie=(be=(ae=s==null?void 0:s.healthchecks.active)==null?void 0:ae.unhealthy)==null?void 0:be.tcp_failures)==null?void 0:Ie.toString())||"5",httpStatuses:(Fe=(qe=s==null?void 0:s.healthchecks.active)==null?void 0:qe.unhealthy)!=null&&Fe.http_statuses?l(s.healthchecks.active.unhealthy.http_statuses):ue,timeouts:((Oe=(Ee=(Be=s==null?void 0:s.healthchecks.active)==null?void 0:Be.unhealthy)==null?void 0:Ee.timeouts)==null?void 0:Oe.toString())||"0"}},passiveHealthCheck:{type:((De=s==null?void 0:s.healthchecks.passive)==null?void 0:De.type)||"http",healthy:{successes:((Ae=(Pe=($e=s==null?void 0:s.healthchecks.passive)==null?void 0:$e.healthy)==null?void 0:Pe.successes)==null?void 0:Ae.toString())||"5",httpStatuses:(Ke=(Me=s==null?void 0:s.healthchecks.passive)==null?void 0:Me.healthy)!=null&&Ke.http_statuses?l(s.healthchecks.passive.healthy.http_statuses):de},unhealthy:{timeouts:((je=(Le=(Re=s==null?void 0:s.healthchecks.passive)==null?void 0:Re.unhealthy)==null?void 0:Le.timeouts)==null?void 0:je.toString())||"0",httpFailures:((ve=(We=(Qe=s==null?void 0:s.healthchecks.passive)==null?void 0:Qe.unhealthy)==null?void 0:We.http_failures)==null?void 0:ve.toString())||"5",tcpFailures:((ze=(Ge=(Je=s==null?void 0:s.healthchecks.passive)==null?void 0:Je.unhealthy)==null?void 0:Ge.tcp_failures)==null?void 0:ze.toString())||"5",httpStatuses:(Ye=(Xe=s==null?void 0:s.healthchecks.passive)==null?void 0:Xe.unhealthy)!=null&&Ye.http_statuses?l(s.healthchecks.passive.unhealthy.http_statuses):fe}}}};return{isInteger:a,inRange:E,stringToNumberArray:o,numberToStringArray:l,upstreamsResponseToFields:s=>n(s),getDefaultUpstreamFields:()=>n(),objectsAreEqual:(s,h)=>{try{return JSON.stringify(s)===JSON.stringify(h)}catch{return!1}},cloneDeep:s=>JSON.parse(JSON.stringify(s))}}const Y={useI18n:et,useMultiselectCreation:ne,useHelpers:pe},oe="/v2/control-planes/{controlPlaneId}/core-entities",re="/{workspace}",ie={list:{konnect:`${oe}/upstreams`,kongManager:`${re}/upstreams`},form:{konnect:{getServices:`${oe}/services`,getCertificates:`${oe}/certificates`,validate:`${oe}/schemas/upstreams/validate`,create:`${oe}/upstreams`,edit:`${oe}/upstreams/{id}`},kongManager:{getServices:`${re}/services`,getCertificates:`${re}/certificates`,validate:`${re}/schemas/upstreams/validate`,create:`${re}/upstreams`,edit:`${re}/upstreams/{id}`}}},nt={class:"kong-ui-entities-upstreams-list"},ht={class:"button-row"},ct={class:"upstream-name"},dt=e.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||!a.createRoute||!a.getViewRoute||!a.getEditRoute||a.app==="kongManager"&&!a.isExactMatch&&!a.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","click:learn-more","copy:success","copy:error","delete:success"],setup(a,{emit:E}){var O;const o=E,l=a,{i18n:{t:n}}=Y.useI18n(),k=Ve.useRouter(),{axiosInstance:f}=m.useAxios((O=l.config)==null?void 0:O.axiosRequestConfig),{hasRecords:D,handleStateChange:N}=m.useTableState(()=>F.value),s=e.computed(()=>D.value&&l.config.app==="konnect"),h=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),b={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},u=b,t=e.computed(()=>{var V,x;let g=`${l.config.apiBaseUrl}${ie.list[l.config.app]}`;return l.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((V=l.config)==null?void 0:V.controlPlaneId)||""):l.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(x=l.config)!=null&&x.workspace?`/${l.config.workspace}`:"")),g}),F=e.ref(""),w=e.computed(()=>{const g=l.config.app==="konnect"||l.config.isExactMatch;if(g)return{isExactMatch:g,placeholder:n("upstreams.search.placeholder")};const{name:V,slots:x}=b;return{isExactMatch:g,fields:{name:V,slots:x},schema:l.config.filterSchema}}),{fetcher:d,fetcherState:C,fetcherCacheKey:M}=m.useFetcher(e.computed(()=>({...l.config,cacheIdentifier:l.cacheIdentifier})),t),I=()=>{F.value=""},L=()=>{M.value++},$=e.ref(null),y=async(g,V)=>{const x=g.id;if(!await V(x)){o("copy:error",{entity:g,field:"id",message:n("upstreams.errors.copy")});return}o("copy:success",{entity:g,field:"id",message:n("upstreams.copy.success",{val:x})})},S=async(g,V)=>{const x=JSON.stringify(g);if(!await V(x)){o("copy:error",{entity:g,message:n("upstreams.errors.copy")});return}o("copy:success",{entity:g,message:n("upstreams.copy.success_brief")})},H=async g=>{var x;await((x=l.canRetrieve)==null?void 0:x.call(l,g))&&k.push(l.config.getViewRoute(g.id))},p=g=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(g)}),B=g=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(g)}),T=e.ref(void 0),J=e.ref(!1),A=e.ref(!1),X=e.ref(""),U=m.useDeleteUrlBuilder(l.config,t.value),q=g=>{T.value=g,J.value=!0},j=()=>{J.value=!1},G=async()=>{var g,V,x;if((g=T.value)!=null&&g.id){A.value=!0;try{await f.delete(U(T.value.id)),A.value=!1,J.value=!1,M.value++,o("delete:success",T.value)}catch(K){X.value=((x=(V=K.response)==null?void 0:V.data)==null?void 0:x.message)||K.message||n("upstreams.errors.delete"),o("error",K)}finally{A.value=!1}}},v=()=>{k.push(l.config.createRoute)};e.watch(C,g=>{var V,x,K;if(g.status===m.FetcherStatus.Error){$.value={title:n("upstreams.errors.general")},(K=(x=(V=g.error)==null?void 0:V.response)==null?void 0:x.data)!=null&&K.message&&($.value.message=g.error.response.data.message),o("error",g.error);return}$.value=null});const Q=e.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")}),_=e.ref(!1);return e.onBeforeMount(async()=>{_.value=await l.canCreate(),_.value&&(Q.value.title=n("upstreams.list.empty_state.title"),Q.value.ctaText=n("upstreams.actions.create"))}),(g,V)=>{const x=e.resolveComponent("KButton"),K=e.resolveComponent("KEmptyState"),c=e.resolveComponent("KDropdownItem"),r=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(e.unref(m.EntityBaseTable),{"cache-identifier":a.cacheIdentifier,"disable-sorting":h.value,"empty-state-options":Q.value,"enable-entity-actions":"","error-message":$.value,fetcher:e.unref(d),"fetcher-cache-key":e.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:F.value,"table-headers":e.unref(u),onClearSearchInput:I,"onClick:row":V[3]||(V[3]=i=>H(i)),onSort:L,onState:e.unref(N)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(m.EntityFilter),{modelValue:F.value,"onUpdate:modelValue":V[0]||(V[0]=i=>F.value=i),config:w.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!a.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",ht,[s.value?(e.openBlock(),e.createBlock(x,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"upstream-learn-more-button",icon:"",onClick:V[1]||(V[1]=i=>g.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canCreate()},{default:e.withCtx(()=>[e.createVNode(x,{appearance:"primary","data-testid":"toolbar-add-upstream",size:a.useActionOutside?"medium":"large",to:a.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),name:e.withCtx(({rowValue:i})=>[e.createElementVNode("span",ct,e.toDisplayString(i),1)]),tags:e.withCtx(({rowValue:i})=>[e.createVNode(e.unref(m.TableTags),{"tag-max-width":"auto",tags:i},null,8,["tags"])]),actions:e.withCtx(({row:i})=>[e.createVNode(r,null,{default:e.withCtx(({copyToClipboard:P})=>[e.createVNode(c,{"data-testid":"action-entity-copy-id",onClick:R=>y(i,P)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(({copyToClipboard:P})=>[e.createVNode(c,{"data-testid":"action-entity-copy-json",onClick:R=>S(i,P)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canRetrieve(i)},{default:e.withCtx(()=>[e.createVNode(c,{"data-testid":"action-entity-view","has-divider":"",item:p(i.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canEdit(i)},{default:e.withCtx(()=>[e.createVNode(c,{"data-testid":"action-entity-edit",item:B(i.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canDelete(i)},{default:e.withCtx(()=>[e.createVNode(c,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:P=>q(i)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!F.value&&a.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var i;return[e.createVNode(K,{"data-testid":"upstreams-entity-empty-state","icon-background":"",message:e.unref(n)("upstreams.list.empty_state_v2.description"),title:e.unref(n)("upstreams.list.empty_state_v2.title")},e.createSlots({icon:e.withCtx(()=>[e.createVNode(e.unref(ee.CloudUploadIcon),{decorative:""})]),action:e.withCtx(()=>[_.value?(e.openBlock(),e.createBlock(x,{key:0,"data-testid":"entity-create-button",onClick:v},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon),{decorative:""}),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("upstreams.list.empty_state_v2.create_cta")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(x,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:V[2]||(V[2]=P=>g.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.BookIcon),{decorative:""}),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("upstreams.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(i=a.config)!=null&&i.isControlPlaneGroup?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("upstreams.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","title"])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),e.createVNode(e.unref(m.EntityDeleteModal),{"action-pending":A.value,description:e.unref(n)("upstreams.delete.description"),"entity-name":T.value&&(T.value.name||T.value.id),"entity-type":e.unref(m.EntityTypes).Upstream,error:X.value,title:e.unref(n)("upstreams.delete.title"),visible:J.value,onCancel:j,onProceed:G},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),Z=(a,E)=>{const o=a.__vccOpts||a;for(const[l,n]of E)o[l]=n;return o},ut=Z(dt,[["__scopeId","data-v-fd5b2677"]]),me="/v2/control-planes/{controlPlaneId}/core-entities",ye="/{workspace}",ge={list:{konnect:`${me}/upstreams/{upstreamId}/targets`,kongManager:`${ye}/upstreams/{upstreamId}/targets`},form:{konnect:{create:`${me}/upstreams/{upstreamId}/targets`,edit:`${me}/upstreams/{upstreamId}/targets/{id}`,validate:`${me}/v1/schemas/json/target/validate`},kongManager:{create:`${ye}/upstreams/{upstreamId}/targets`,edit:`${ye}/upstreams/{upstreamId}/targets/{id}`,validate:`${ye}/schemas/targets/validate`}}},ft={class:"kong-ui-entities-target-form"},pt={class:"target-form-container"},mt={key:0,class:"target-form-info"},yt={key:1,class:"failover-target"},Ue=Z(e.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""},failoverEnabled:{type:Boolean,required:!1,default:!1},failoverUnsupported:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading","cancel"],setup(a,{emit:E}){var $;const o=E,l=a,{i18n:{t:n}}=Y.useI18n(),{getMessageFromError:k}=m.useErrors(),{axiosInstance:f}=m.useAxios(($=l.config)==null?void 0:$.axiosRequestConfig),D=e.computed(()=>{var y;return ge.form[l.config.app].edit.replace(/{upstreamId}/gi,((y=l.config)==null?void 0:y.upstreamId)||"")}),N=e.computed(()=>l.targetId?m.EntityBaseFormType.Edit:m.EntityBaseFormType.Create),s=e.computed(()=>N.value===m.EntityBaseFormType.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),h=e.reactive({fields:{target:"",weight:100,tags:"",failover:!1},isReadonly:!1,errorMessage:""}),b=e.reactive({target:"",weight:100,tags:"",failover:!1}),u={target:"",weight:100,tags:""},t=e.computed(()=>{const y=parseInt(h.fields.weight.toString(),10);return y<0||y>65535}),F=e.computed(()=>JSON.stringify(h.fields)!==JSON.stringify(b)&&!!h.fields.target&&!!h.fields.weight&&!t.value),w=y=>{var S;h.fields.target=(y==null?void 0:y.target)||"",h.fields.weight=(y==null?void 0:y.weight)??"",h.fields.tags=((S=y==null?void 0:y.tags)==null?void 0:S.join(", "))||"",l.failoverEnabled&&(h.fields.failover=(y==null?void 0:y.failover)||!1),Object.assign(b,h.fields)},d=()=>{h.errorMessage="",o("cancel")},C=e.computed(()=>{var S,H;let y=`${l.config.apiBaseUrl}${ge.form[l.config.app].validate}`;return l.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((S=l.config)==null?void 0:S.controlPlaneId)||""):l.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(H=l.config)!=null&&H.workspace?`/${l.config.workspace}`:"")),y=y.replace(/{id}/gi,l.targetId),y}),M=e.computed(()=>{var S,H,p,B;let y=`${l.config.apiBaseUrl}${ge.form[l.config.app][N.value]}`;return l.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((S=l.config)==null?void 0:S.controlPlaneId)||"").replace(/{upstreamId}/gi,((H=l.config)==null?void 0:H.upstreamId)||""):l.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(p=l.config)!=null&&p.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((B=l.config)==null?void 0:B.upstreamId)||"")),y=y.replace(/{id}/gi,l.targetId),y}),I=e.computed(()=>{var y,S,H;return{target:h.fields.target,weight:parseInt(h.fields.weight),tags:(H=(S=(y=h.fields.tags)==null?void 0:y.split(","))==null?void 0:S.map(p=>String(p||"").trim()))==null?void 0:H.filter(p=>p!==""),upstream:{id:l.config.upstreamId},...l.failoverEnabled?{failover:h.fields.failover}:{}}}),L=async()=>{var y,S;try{h.isReadonly=!0,h.errorMessage="";let H;if(await f.post(C.value,I.value),N.value==="create"?H=await f.post(M.value,I.value):N.value==="edit"&&(H=((y=l.config)==null?void 0:y.app)==="konnect"?await f.put(M.value,I.value):await f.patch(M.value,I.value)),H){const{data:p}=H;h.fields.target=(p==null?void 0:p.name)||"",h.fields.weight=(p==null?void 0:p.weight)??100,h.fields.tags=((S=p==null?void 0:p.tags)==null?void 0:S.join(", "))||"",o("update",p),Object.assign(h.fields,u)}}catch(H){h.errorMessage=k(H),o("error",H)}finally{h.isReadonly=!1}};return e.watch(()=>l.targetId,()=>{Object.assign(h.fields,u)}),(y,S)=>{const H=e.resolveComponent("KInput"),p=e.resolveComponent("KCheckbox"),B=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(B,{"action-button-disabled":!F.value||h.isReadonly,"action-button-text":e.unref(n)("targets.form.buttons.save"),"cancel-button-text":e.unref(n)("targets.form.buttons.cancel"),title:s.value,visible:a.isVisible,onCancel:d,onProceed:L},{default:e.withCtx(()=>[e.createElementVNode("div",ft,[e.createVNode(e.unref(m.EntityBaseForm),{config:a.config,"edit-id":a.targetId,"entity-type":e.unref(m.SupportedEntityType).Target,"error-message":h.errorMessage,"fetch-url":D.value,"form-fields":I.value,"is-readonly":h.isReadonly,onCancel:d,"onFetch:error":S[4]||(S[4]=T=>y.$emit("error",T)),"onFetch:success":w,onLoading:S[5]||(S[5]=T=>y.$emit("loading",T))},{default:e.withCtx(()=>[e.createElementVNode("div",pt,[y.$slots.info?(e.openBlock(),e.createElementBlock("div",mt,[e.renderSlot(y.$slots,"info",{},void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(H,{modelValue:h.fields.target,"onUpdate:modelValue":S[0]||(S[0]=T=>h.fields.target=T),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:e.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:e.unref(n)("targets.form.fields.target.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(n)("targets.form.fields.target.placeholder"),readonly:h.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),e.createVNode(H,{modelValue:h.fields.weight,"onUpdate:modelValue":S[1]||(S[1]=T=>h.fields.weight=T),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:t.value,"error-message":e.unref(n)("targets.errors.weight"),label:e.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:e.unref(n)("targets.form.fields.weight.tooltip"),tooltipAttributes:{maxWidth:"400"}},max:"65535",min:"0",readonly:h.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),a.failoverEnabled?(e.openBlock(),e.createElementBlock("div",yt,[e.createVNode(p,{modelValue:h.fields.failover,"onUpdate:modelValue":S[2]||(S[2]=T=>h.fields.failover=T),disabled:a.failoverUnsupported,label:e.unref(n)("targets.form.fields.failover.label"),"label-attributes":{info:a.failoverUnsupported?e.unref(n)("targets.form.fields.failover.unsupported"):e.unref(n)("targets.form.fields.failover.help")}},null,8,["modelValue","disabled","label","label-attributes"])])):e.createCommentVNode("",!0),e.createVNode(H,{modelValue:h.fields.tags,"onUpdate:modelValue":S[3]||(S[3]=T=>h.fields.tags=T),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:e.unref(n)("targets.form.fields.tags.help"),label:e.unref(n)("targets.form.fields.tags.label"),placeholder:e.unref(n)("targets.form.fields.tags.placeholder"),readonly:h.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-eac3b1ad"]]),gt={class:"kong-ui-entities-targets-list"},kt={class:"target-address"},bt=Z(e.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||!a.upstreamId||a.app==="kongManager"&&(typeof a.canMarkHealthy>"u"||typeof a.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},failoverEnabled:{type:Boolean,default:!1},algorithm:{type:String,required:!1,default:""}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(a,{emit:E}){var Q;const o=E,l=a,{i18n:{t:n}}=Y.useI18n(),{axiosInstance:k}=m.useAxios((Q=l.config)==null?void 0:Q.axiosRequestConfig),f=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),N={target:{label:n("targets.list.table_headers.target_address"),sortable:!0,hidable:!1},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},...l.failoverEnabled?{failover:{label:n("targets.list.table_headers.target_type"),sortable:!1}}:{},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},s=e.computed(()=>{var O,g,V,x;let _=`${l.config.apiBaseUrl}${ge.list[l.config.app]}`;return l.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((O=l.config)==null?void 0:O.controlPlaneId)||"").replace(/{upstreamId}/gi,((g=l.config)==null?void 0:g.upstreamId)||""):l.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(V=l.config)!=null&&V.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((x=l.config)==null?void 0:x.upstreamId)||"")),_}),{fetcher:h,fetcherState:b,fetcherCacheKey:u}=m.useFetcher(e.computed(()=>({...l.config,cacheIdentifier:l.cacheIdentifier})),s),t=()=>{u.value++},F=e.ref(null),w=()=>{q.value=!0},d=async(_,O)=>{const g=_.id;if(!await O(g)){o("copy:error",{entity:_,field:"id",message:n("targets.errors.copy")});return}o("copy:success",{entity:_,field:"id",message:n("targets.copy.success",{val:g})})},C=async(_,O)=>{const g=JSON.stringify(_);if(!await O(g)){o("copy:error",{entity:_,message:n("targets.errors.copy")});return}o("copy:success",{entity:_,message:n("targets.copy.success_brief")})},M=_=>{U.value=_,q.value=!0},I=_=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(_),L=_=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(_),$=e.ref(void 0),y=e.ref(!1),S=e.ref(!1),H=e.ref(""),p=m.useDeleteUrlBuilder(l.config,s.value),B=_=>{$.value=_,y.value=!0},T=()=>{y.value=!1},J=async()=>{var _,O,g;if((_=$.value)!=null&&_.id){S.value=!0;try{await k.delete(p($.value.id)),S.value=!1,y.value=!1,u.value++,o("delete:success",$.value)}catch(V){H.value=((g=(O=V.response)==null?void 0:O.data)==null?void 0:g.message)||V.message||n("targets.errors.delete"),o("error",V)}finally{S.value=!1}}};e.watch(b,_=>{var O,g,V;if(_.status===m.FetcherStatus.Error){F.value={title:n("targets.errors.general")},(V=(g=(O=_.error)==null?void 0:O.response)==null?void 0:g.data)!=null&&V.message&&(F.value.message=_.error.response.data.message),o("error",_.error);return}F.value=null});const A=e.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});e.onBeforeMount(async()=>{await l.canCreate()&&(A.value.title=n("targets.list.empty_state.title"),A.value.ctaText=n("targets.actions.create"))});const X=e.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,axiosRequestConfig:l.config.axiosRequestConfig,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace}})),U=e.ref(""),q=e.ref(!1),j=_=>{U.value?o("update:target",_):o("create:target",_),G()},G=()=>{v(),u.value++},v=()=>{q.value=!1,U.value=""};return(_,O)=>{const g=e.resolveComponent("KButton"),V=e.resolveComponent("KBadge"),x=e.resolveComponent("KDropdownItem"),K=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",gt,[e.createVNode(e.unref(m.EntityBaseTable),{"cache-identifier":a.cacheIdentifier,"disable-sorting":f.value,"empty-state-options":A.value,"enable-entity-actions":"","error-message":F.value,fetcher:e.unref(h),"fetcher-cache-key":e.unref(u),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":e.unref(N),onEmptyStateCtaClicked:O[1]||(O[1]=()=>l.config.createRoute?void 0:w()),onSort:t},e.createSlots({"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!a.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canCreate()},{default:e.withCtx(()=>[e.createVNode(g,{appearance:"primary","data-testid":"toolbar-new-target",size:a.useActionOutside?"medium":"large",to:l.config.createRoute?l.config.createRoute:void 0,onClick:O[0]||(O[0]=()=>l.config.createRoute?void 0:w())},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:e.withCtx(({rowValue:c})=>[e.createElementVNode("span",kt,e.toDisplayString(c),1)]),tags:e.withCtx(({rowValue:c})=>[e.createVNode(e.unref(m.TableTags),{"tag-max-width":"auto",tags:c},null,8,["tags"])]),actions:e.withCtx(({row:c})=>[e.createVNode(K,null,{default:e.withCtx(({copyToClipboard:r})=>[e.createVNode(x,{"data-testid":"action-entity-copy-id",onClick:i=>d(c,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(K,null,{default:e.withCtx(({copyToClipboard:r})=>[e.createVNode(x,{"data-testid":"action-entity-copy-json",onClick:i=>C(c,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canEdit(c)},{default:e.withCtx(()=>[e.createVNode(x,{"data-testid":"action-entity-edit","has-divider":"",onClick:r=>M(c.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>I(c)},{default:e.withCtx(()=>[e.createVNode(x,{"data-testid":"action-target-mark-healthy",onClick:r=>o("health-actions:healthy",c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>L(c)},{default:e.withCtx(()=>[e.createVNode(x,{"data-testid":"action-target-mark-unhealthy",onClick:r=>o("health-actions:unhealthy",c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canDelete(c)},{default:e.withCtx(()=>[e.createVNode(x,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:r=>B(c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[a.failoverEnabled?{name:"failover",fn:e.withCtx(({rowValue:c})=>[e.createVNode(V,{appearance:"info",class:"upstream-failover"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c?e.unref(n)("targets.form.fields.failover.failover_target"):e.unref(n)("targets.form.fields.failover.load_balance_target")),1)]),_:2},1024)]),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers"]),e.createVNode(e.unref(m.EntityDeleteModal),{"action-pending":S.value,description:e.unref(n)("targets.delete.description"),"entity-type":e.unref(m.EntityTypes).Target,error:H.value,"need-confirm":!1,title:e.unref(n)("targets.delete.title"),visible:y.value,onCancel:T,onProceed:J},null,8,["action-pending","description","entity-type","error","title","visible"]),e.createVNode(Ue,{config:X.value,"failover-enabled":a.failoverEnabled,"failover-unsupported":a.failoverEnabled&&!e.unref(it).includes(a.algorithm),"is-visible":q.value,"target-id":U.value,onCancel:v,onUpdate:j},e.createSlots({_:2},[_.$slots["form-info"]?{name:"info",fn:e.withCtx(()=>[e.renderSlot(_.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","failover-enabled","failover-unsupported","is-visible","target-id"])])}}}),[["__scopeId","data-v-9fdfe77a"]]),Ct={key:1},_t=Z(e.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(a,{emit:E}){var T,J,A,X;const{i18nT:o,i18n:{t:l}}=Y.useI18n(),n=a,k=E,{debouncedQueryChange:f,loading:D,loadItems:N,results:s,allRecords:h}=m.useDebouncedFilter(n.config,(J=ie.form[(T=n.config)==null?void 0:T.app])==null?void 0:J.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:b,loading:u,loadItems:t,results:F}=m.useDebouncedFilter(n.config,(X=ie.form[(A=n.config)==null?void 0:A.app])==null?void 0:X.getCertificates),w=e.ref(""),d=e.computed(()=>{var U;return!!n.name&&!((U=h.value)!=null&&U.some(q=>q.host===n.name))}),C=e.computed(()=>{var q,j,G;const U=d.value&&n.name.includes((q=w.value)==null?void 0:q.toLowerCase());return(G=s.value)==null?void 0:G.map(v=>({label:v.host,value:v.id})).concat(U?[{label:n.name,value:((j=L.value)==null?void 0:j.value)||n.name}]:[])}),M=e.computed(()=>{var U;return(U=F.value)==null?void 0:U.map(q=>({label:q.id,value:q.id}))}),I=e.ref(""),L=e.ref({value:"",label:""}),$=e.computed(()=>{var U,q;return((U=C.value.find(j=>j.value===I.value))==null?void 0:U.label)||((q=L.value)==null?void 0:q.label)}),y=U=>{w.value=U,f(U)},S=U=>{L.value=U},H=()=>{L.value={value:"",label:""}},p=U=>{I.value=U,k("update:name",$.value)},B=e.ref(!1);return e.onBeforeMount(async()=>{var U,q;try{B.value=!0,await N(),n.name&&(I.value=((q=(U=C.value.find(j=>j.label===n.name))==null?void 0:U.value)==null?void 0:q.toString())||n.name),await t()}finally{B.value=!1}}),(U,q)=>{const j=e.resolveComponent("KSkeleton"),G=e.resolveComponent("KSelect"),v=e.resolveComponent("KInput");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-general-info",description:e.unref(l)("upstreams.form.general_info.help"),title:e.unref(l)("upstreams.form.general_info.title")},{default:e.withCtx(()=>[B.value?(e.openBlock(),e.createBlock(j,{key:0,type:"form"})):(e.openBlock(),e.createElementBlock("div",Ct,[e.createVNode(G,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:C.value,label:e.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},loading:e.unref(D),"model-value":I.value,placeholder:e.unref(l)("upstreams.form.fields.name.placeholder"),readonly:a.readonly,required:"",width:"100%",onItemAdded:S,onItemRemoved:H,onQueryChange:y,"onUpdate:modelValue":p},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),e.createVNode(v,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:e.unref(l)("upstreams.form.fields.host_header.label"),"model-value":a.hostHeader,readonly:a.readonly,type:"text","onUpdate:modelValue":q[0]||(q[0]=Q=>k("update:host-header",Q))},null,8,["label","model-value","readonly"]),e.createVNode(G,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:M.value,label:e.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:e.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"400"}},loading:e.unref(u),"model-value":a.clientCertificate,placeholder:e.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:a.readonly,width:"100%",onQueryChange:e.unref(b),"onUpdate:modelValue":q[1]||(q[1]=Q=>k("update:client-certificate",Q))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),e.createVNode(v,{autocomplete:"off","data-testid":"upstreams-form-tags",help:e.unref(l)("upstreams.form.fields.tags.help"),label:e.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:e.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},"model-value":a.tags,placeholder:e.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:a.readonly,type:"text","onUpdate:modelValue":q[2]||(q[2]=Q=>k("update:tags",Q))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-1a71740c"]]),ke={upstreamObject:"https://developer.konghq.com/gateway/entities/upstream/",loadBalancing:"https://developer.konghq.com/gateway/traffic-control/load-balancing-reference/"},St={class:"fields-group-title"},Vt={class:"fields-group-text"},wt={class:"fields-group-title"},Nt={class:"fields-group-text"},xt=Z(e.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{stickySessionsAvailable:{type:Boolean,required:!1,default:!1},algorithm:{type:String,required:!0},stickySessionsCookie:{type:String,required:!0},stickySessionsCookiePath:{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:sticky-sessions-cookie","update:sticky-sessions-cookie-path","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(a,{emit:E}){const{i18nT:o,i18n:{t:l}}=Y.useI18n(),{inRange:n}=pe(),k=a,f=E,D=e.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},...k.stickySessionsAvailable?[{label:l("upstreams.form.algorithms.sticky_sessions_label"),value:"sticky-sessions",selected:!1}]:[]]),N=e.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}]);e.watch(()=>k.hashOn,(b,u)=>{u==="header"&&b!==u&&f("update:hash-on-header",""),u==="cookie"&&b!==u&&(f("update:hash-on-cookie",""),f("update:hash-on-cookie-path","/")),u==="query_arg"&&b!==u&&f("update:hash-on-query-argument",""),u==="uri_capture"&&b!==u&&f("update:hash-on-uri-capture",""),(b==="cookie"||b==="none")&&(f("update:hash-fallback","none"),f("update:hash-fallback-header",""),f("update:hash-fallback-query-argument",""),f("update:hash-fallback-uri-capture",""))}),e.watch(()=>k.hashFallback,(b,u)=>{u==="header"&&b!==u&&f("update:hash-fallback-header",""),u==="cookie"&&b!==u&&(f("update:hash-on-cookie",""),f("update:hash-on-cookie-path","/")),u==="query_arg"&&b!==u&&f("update:hash-fallback-query-argument",""),u==="uri_capture"&&b!==u&&f("update:hash-fallback-uri-capture","")}),e.watch(()=>k.algorithm,b=>{b==="sticky-sessions"&&(f("update:slots","10000"),f("update:hash-on","none"),f("update:hash-fallback","none"),f("update:hash-on-header",""),f("update:hash-on-cookie",""),f("update:hash-on-cookie-path","/"),f("update:hash-on-query-argument",""),f("update:hash-on-uri-capture",""),f("update:hash-fallback-header",""),f("update:hash-fallback-query-argument",""),f("update:hash-fallback-uri-capture",""))},{immediate:!0});const s=e.computed(()=>k.hashOn==="cookie"||k.hashOn==="none"),h=e.computed(()=>k.slots?n(k.slots,Ce,_e)?"":l("upstreams.form.errors.in_range"):"");return(b,u)=>{const t=e.resolveComponent("KExternalLink"),F=e.resolveComponent("KSelect"),w=e.resolveComponent("KInput"),d=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-load-balancing",title:e.unref(l)("upstreams.form.load_balancing.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(l)("upstreams.form.load_balancing.help"))+" ",1),e.createVNode(t,{"hide-icon":"",href:e.unref(ke).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(F,{class:"algorithm-select",items:D.value,label:e.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":a.algorithm,readonly:a.readonly,width:"100%","onUpdate:modelValue":u[0]||(u[0]=C=>f("update:algorithm",C))},null,8,["items","label","model-value","readonly"]),a.algorithm==="sticky-sessions"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(w,{autocomplete:"off","data-testid":"upstreams-form-sticky-sessions-cookie",label:e.unref(l)("upstreams.form.fields.sticky_sessions_cookie.label"),"label-attributes":{info:e.unref(l)("upstreams.form.fields.sticky_sessions_cookie.tooltip"),tooltipAttributes:{maxWidth:"400"}},"model-value":a.stickySessionsCookie,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[1]||(u[1]=C=>f("update:sticky-sessions-cookie",C))},null,8,["label","label-attributes","model-value","readonly"]),e.createVNode(w,{autocomplete:"off","data-testid":"upstreams-form-sticky-sessions-cookie-path",label:e.unref(l)("upstreams.form.fields.sticky_sessions_cookie_path.label"),"label-attributes":{info:e.unref(l)("upstreams.form.fields.sticky_sessions_cookie_path.tooltip"),tooltipAttributes:{maxWidth:"400"}},"model-value":a.stickySessionsCookiePath,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[2]||(u[2]=C=>f("update:sticky-sessions-cookie-path",C))},null,8,["label","label-attributes","model-value","readonly"])],64)):e.createCommentVNode("",!0),a.algorithm!=="sticky-sessions"?(e.openBlock(),e.createBlock(w,{key:1,autocomplete:"off","data-testid":"upstreams-form-slots",error:!!h.value,"error-message":h.value,help:e.unref(l)("upstreams.form.fields.slots.help"),label:e.unref(l)("upstreams.form.fields.slots.label"),max:e.unref(_e),min:e.unref(Ce),"model-value":a.slots,readonly:a.readonly,type:"number","onUpdate:modelValue":u[3]||(u[3]=C=>f("update:slots",C))},null,8,["error","error-message","help","label","max","min","model-value","readonly"])):e.createCommentVNode("",!0),a.algorithm!=="sticky-sessions"?(e.openBlock(),e.createBlock(d,{key:2},{default:e.withCtx(()=>[e.createElementVNode("h5",St,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_on.label")),1),e.createElementVNode("p",Vt,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_on.help")),1),e.createVNode(F,{class:"hash-on-select",items:N.value,label:e.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":a.hashOn,readonly:a.readonly,width:"100%","onUpdate:modelValue":u[4]||(u[4]=C=>f("update:hash-on",C))},null,8,["items","label","model-value","readonly"]),a.hashOn==="header"?(e.openBlock(),e.createBlock(w,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:e.unref(l)("upstreams.form.fields.header.label"),"model-value":a.hashOnHeader,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[5]||(u[5]=C=>f("update:hash-on-header",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashOn==="cookie"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(w,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:e.unref(l)("upstreams.form.fields.cookie.label"),"model-value":a.hashOnCookie,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[6]||(u[6]=C=>f("update:hash-on-cookie",C))},null,8,["label","model-value","readonly"]),e.createVNode(w,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:e.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":a.hashOnCookiePath,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[7]||(u[7]=C=>f("update:hash-on-cookie-path",C))},null,8,["label","model-value","readonly"])],64)):e.createCommentVNode("",!0),a.hashOn==="query_arg"?(e.openBlock(),e.createBlock(w,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:e.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":a.hashOnQueryArgument,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[8]||(u[8]=C=>f("update:hash-on-query-argument",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashOn==="uri_capture"?(e.openBlock(),e.createBlock(w,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:e.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":a.hashOnUriCapture,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[9]||(u[9]=C=>f("update:hash-on-uri-capture",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),a.algorithm!=="sticky-sessions"?(e.openBlock(),e.createBlock(d,{key:3},{default:e.withCtx(()=>[e.createElementVNode("h5",wt,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_fallback.label")),1),e.createElementVNode("p",Nt,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_fallback.help")),1),e.createVNode(F,{class:"hash-fallback-select",disabled:s.value,items:N.value,label:e.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},"model-value":a.hashFallback,readonly:a.readonly,width:"100%","onUpdate:modelValue":u[10]||(u[10]=C=>f("update:hash-fallback",C))},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),a.hashFallback==="header"?(e.openBlock(),e.createBlock(w,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:e.unref(l)("upstreams.form.fields.header.label"),"model-value":a.hashFallbackHeader,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[11]||(u[11]=C=>f("update:hash-fallback-header",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashFallback==="cookie"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(w,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:e.unref(l)("upstreams.form.fields.cookie.label"),"model-value":a.hashOnCookie,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[12]||(u[12]=C=>f("update:hash-on-cookie",C))},null,8,["label","model-value","readonly"]),e.createVNode(w,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:e.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":a.hashOnCookiePath,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[13]||(u[13]=C=>f("update:hash-on-cookie-path",C))},null,8,["label","model-value","readonly"])],64)):e.createCommentVNode("",!0),a.hashFallback==="query_arg"?(e.openBlock(),e.createBlock(w,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:e.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":a.hashFallbackQueryArgument,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[14]||(u[14]=C=>f("update:hash-fallback-query-argument",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashFallback==="uri_capture"?(e.openBlock(),e.createBlock(w,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:e.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":a.hashFallbackUriCapture,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[15]||(u[15]=C=>f("update:hash-fallback-uri-capture",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["title"])}}}),[["__scopeId","data-v-656aa4f4"]]),Ht={class:"fields-group-title"},Tt={class:"fields-group-text"},Ut={class:"fields-group-title"},It={class:"fields-group-text"},qt=Z(e.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(a,{emit:E}){const{i18n:{t:o}}=Y.useI18n(),l=E;return(n,k)=>{const f=e.resolveComponent("KExternalLink"),D=e.resolveComponent("KInputSwitch"),N=e.resolveComponent("KCard"),s=e.resolveComponent("KInput");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-healthchecks",title:e.unref(o)("upstreams.form.health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.health_check.help"))+" ",1),e.createVNode(f,{"hide-icon":"",href:e.unref(ke).loadBalancing},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(N,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Ht,e.toDisplayString(e.unref(o)("upstreams.form.fields.active_health_checks.label")),1),e.createElementVNode("p",Tt,e.toDisplayString(e.unref(o)("upstreams.form.fields.active_health_checks.help")),1),e.createVNode(D,{class:"active-health-switch","data-testid":"active-health-switch",disabled:a.readonly,"model-value":a.activeHealthSwitch,onChange:k[0]||(k[0]=h=>l("update:active-health-switch",h))},null,8,["disabled","model-value"])]),_:1}),e.createVNode(N,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Ut,e.toDisplayString(e.unref(o)("upstreams.form.fields.passive_health_checks.label")),1),e.createElementVNode("p",It,e.toDisplayString(e.unref(o)("upstreams.form.fields.passive_health_checks.help")),1),e.createVNode(D,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:a.readonly,"model-value":a.passiveHealthSwitch,onChange:k[1]||(k[1]=h=>l("update:passive-health-switch",h))},null,8,["disabled","model-value"])]),_:1}),e.createVNode(s,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:e.unref(o)("upstreams.form.fields.healthchecks_threshold.label"),max:e.unref(at),min:e.unref(tt),"model-value":a.healthchecksThreshold,readonly:a.readonly,type:"number","onUpdate:modelValue":k[2]||(k[2]=h=>l("update:healthchecks-threshold",h))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-c2ff95ff"]]),Ft="#d60027",Bt={class:"fields-group-title"},Et={class:"fields-group-text"},Ot={class:"fields-group-title"},Dt={class:"fields-group-text"},$t=Z(e.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},healthyInterval:{type:String,required:!0},healthySuccesses:{type:String,required:!0},healthyHttpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},unhealthyHttpFailures:{type:String,required:!0},unhealthyTcpFailures:{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:healthy-interval","update:healthy-successes","update:healthy-http-statuses","update:unhealthy-interval","update:unhealthy-http-failures","update:unhealthy-tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(a,{emit:E}){const{i18n:{t:o}}=Y.useI18n(),{objectsAreEqual:l}=pe(),n=a,k=E,f=e.ref([{label:o("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),D=e.computed(()=>n.type==="https"||n.type==="grpcs"),N=e.computed(()=>n.type==="tcp"),{trackNewItems:s}=ne({replaceId:!0}),{trackNewItems:h}=ne({replaceId:!0});e.watch(()=>n.type,(w,d)=>{d==="tcp"&&w!==d&&k("update:unhealthy-tcp-failures","5"),(d==="https"||d==="grpcs")&&w!==d&&(k("update:https-sni",""),k("update:verify-ssl",!1)),d!=="tcp"&&w==="tcp"&&(k("update:http-path","/"),k("update:healthy-http-statuses",ce),k("update:unhealthy-http-statuses",ue))});const b=e.ref([{key:"",values:""}]);e.watch(()=>n.headers,w=>{l(b.value,w)||(b.value=[...w])},{immediate:!0,deep:!0});const u=()=>{k("update:headers",b.value)},t=()=>{b.value.push({key:"",values:""}),u()},F=w=>{w===0&&b.value.length===1?b.value[0]={key:"",values:""}:b.value.splice(w,1),u()};return(w,d)=>{const C=e.resolveComponent("KExternalLink"),M=e.resolveComponent("KSelect"),I=e.resolveComponent("KInput"),L=e.resolveComponent("KCheckbox"),$=e.resolveComponent("KLabel"),y=e.resolveComponent("KButton"),S=e.resolveComponent("KMultiselect"),H=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-active-healthcheck",title:e.unref(o)("upstreams.form.active_health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.active_health_check.help"))+" ",1),e.createVNode(C,{"hide-icon":"",href:e.unref(ke).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(M,{class:"active-healthcheck-type-select",items:f.value,label:e.unref(o)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":a.type,readonly:a.readonly,width:"100%","onUpdate:modelValue":d[0]||(d[0]=p=>k("update:type",p))},null,8,["items","label","model-value","readonly"]),N.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(I,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:e.unref(o)("upstreams.form.fields.http_path.label"),"model-value":a.httpPath,readonly:a.readonly,type:"text","onUpdate:modelValue":d[1]||(d[1]=p=>k("update:http-path",p))},null,8,["label","model-value","readonly"])),e.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:e.unref(o)("upstreams.form.fields.timeout.label"),max:e.unref(st),min:e.unref(lt),"model-value":a.timeout,readonly:a.readonly,type:"number","onUpdate:modelValue":d[2]||(d[2]=p=>k("update:timeout",p))},null,8,["label","max","min","model-value","readonly"]),e.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:e.unref(o)("upstreams.form.fields.concurrency.label"),max:e.unref(rt),min:e.unref(ot),"model-value":a.concurrency,readonly:a.readonly,type:"number","onUpdate:modelValue":d[3]||(d[3]=p=>k("update:concurrency",p))},null,8,["label","max","min","model-value","readonly"]),D.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:e.unref(o)("upstreams.form.fields.https_sni.label"),"model-value":a.httpsSni,readonly:a.readonly,type:"text","onUpdate:modelValue":d[4]||(d[4]=p=>k("update:https-sni",p))},null,8,["label","model-value","readonly"]),e.createVNode(L,{"data-testid":"active-healthcheck-verify-ssl",disabled:a.readonly,label:e.unref(o)("upstreams.form.fields.verify_ssl.label"),"model-value":a.verifySsl,"onUpdate:modelValue":d[5]||(d[5]=p=>k("update:verify-ssl",p))},null,8,["disabled","label","model-value"])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createVNode($,{info:e.unref(o)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(p,B)=>(e.openBlock(),e.createElementBlock("div",{key:`${p.header}_${B}`,class:e.normalizeClass(["headers-row",{"margin-top-6":B>0}])},[e.createVNode(I,{modelValue:b.value[B].key,"onUpdate:modelValue":T=>b.value[B].key=T,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${B+1}`,readonly:a.readonly,type:"text",onBlur:u},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),e.createVNode(I,{modelValue:b.value[B].values,"onUpdate:modelValue":T=>b.value[B].values=T,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${B+1}`,readonly:a.readonly,type:"text",onBlur:u},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),e.createVNode(y,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",disabled:b.value.length===1,icon:"",onClick:T=>F(B)},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.TrashIcon),{class:"delete-item",color:b.value.length>1?e.unref(Ft):void 0},null,8,["color"])]),_:2},1032,["disabled","onClick"]),b.value&&B===b.value.length-1?(e.openBlock(),e.createBlock(y,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",icon:"",onClick:t},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon))]),_:1})):e.createCommentVNode("",!0)],2))),128))])]),e.createVNode(H,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Bt,e.toDisplayString(e.unref(o)("upstreams.form.healthy.label")),1),e.createElementVNode("p",Et,e.toDisplayString(e.unref(o)("upstreams.form.healthy.help")),1),e.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-healthy-interval",help:e.unref(o)("upstreams.form.fields.interval.help"),label:e.unref(o)("upstreams.form.fields.interval.label"),max:e.unref(Te),min:e.unref(He),"model-value":a.healthyInterval,readonly:a.readonly,type:"number","onUpdate:modelValue":d[6]||(d[6]=p=>k("update:healthy-interval",p))},null,8,["help","label","max","min","model-value","readonly"]),e.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-healthy-successes",label:e.unref(o)("upstreams.form.fields.successes.label"),max:e.unref(se),min:e.unref(le),"model-value":a.healthySuccesses,readonly:a.readonly,type:"number","onUpdate:modelValue":d[7]||(d[7]=p=>k("update:healthy-successes",p))},null,8,["label","max","min","model-value","readonly"]),N.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(S,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-healthy-http-statuses","data-testid":"active-healthcheck-healthy-http-statuses","enable-item-creation":"",items:e.unref(he),label:e.unref(o)("upstreams.form.fields.http_statuses.label"),"model-value":a.healthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:d[8]||(d[8]=p=>e.unref(s)(p,!0)),onItemRemoved:d[9]||(d[9]=p=>e.unref(s)(p,!1)),"onUpdate:modelValue":d[10]||(d[10]=p=>k("update:healthy-http-statuses",p))},null,8,["items","label","model-value","readonly"]))]),_:1}),e.createVNode(H,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Ot,e.toDisplayString(e.unref(o)("upstreams.form.unhealthy.label")),1),e.createElementVNode("p",Dt,e.toDisplayString(e.unref(o)("upstreams.form.unhealthy.help")),1),e.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:e.unref(o)("upstreams.form.fields.interval.help"),label:e.unref(o)("upstreams.form.fields.interval.label"),max:e.unref(Te),min:e.unref(He),"model-value":a.unhealthyInterval,readonly:a.readonly,type:"number","onUpdate:modelValue":d[11]||(d[11]=p=>k("update:unhealthy-interval",p))},null,8,["help","label","max","min","model-value","readonly"]),e.createVNode(I,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-tcp-failures",label:e.unref(o)("upstreams.form.fields.tcp_failures.label"),max:e.unref(se),min:e.unref(le),"model-value":a.unhealthyTcpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":d[12]||(d[12]=p=>k("update:unhealthy-tcp-failures",p))},null,8,["label","max","min","model-value","readonly"]),N.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(I,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-http-failures",label:e.unref(o)("upstreams.form.fields.http_failures.label"),max:e.unref(se),min:e.unref(le),"model-value":a.unhealthyHttpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":d[13]||(d[13]=p=>k("update:unhealthy-http-failures",p))},null,8,["label","max","min","model-value","readonly"])),N.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(S,{key:1,autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","data-testid":"active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:e.unref(he),label:e.unref(o)("upstreams.form.fields.http_statuses.label"),"model-value":a.unhealthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:d[14]||(d[14]=p=>e.unref(h)(p,!0)),onItemRemoved:d[15]||(d[15]=p=>e.unref(h)(p,!1)),"onUpdate:modelValue":d[16]||(d[16]=p=>k("update:unhealthy-http-statuses",p))},null,8,["items","label","model-value","readonly"])),e.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:e.unref(o)("upstreams.form.fields.timeouts.label"),max:e.unref(xe),min:e.unref(Ne),"model-value":a.unhealthyTimeouts,readonly:a.readonly,type:"number","onUpdate:modelValue":d[17]||(d[17]=p=>k("update:unhealthy-timeouts",p))},null,8,["label","max","min","model-value","readonly"])]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-cfc70316"]]),Pt={class:"fields-group-title"},At={class:"fields-group-text"},Mt={class:"fields-group-title"},Kt={class:"fields-group-text"},Rt=Z(e.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},healthySuccesses:{type:String,required:!0},healthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},unhealthyHttpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:healthy-successes","update:healthy-http-statuses","update:unhealthy-timeouts","update:unhealthy-http-failures","update:unhealthy-http-statuses","update:unhealthy-tcp-failures"],setup(a,{emit:E}){const{i18n:{t:o}}=Y.useI18n(),l=a,n=E,k=e.ref([{label:o("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),f=e.computed(()=>l.type==="tcp"),{trackNewItems:D}=ne({replaceId:!0}),{trackNewItems:N}=ne({replaceId:!0});return e.watch(()=>l.type,(s,h)=>{h==="tcp"&&s!==h&&n("update:unhealthy-tcp-failures","5"),h!=="tcp"&&s==="tcp"&&(n("update:healthy-http-statuses",de),n("update:unhealthy-http-statuses",fe))}),(s,h)=>{const b=e.resolveComponent("KExternalLink"),u=e.resolveComponent("KSelect"),t=e.resolveComponent("KInput"),F=e.resolveComponent("KMultiselect"),w=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:e.unref(o)("upstreams.form.passive_health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.passive_health_check.help"))+" ",1),e.createVNode(b,{"hide-icon":"",href:e.unref(ke).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(u,{class:"passive-healthcheck-type-select",items:k.value,label:e.unref(o)("upstreams.form.fields.passive_health_check_type.label"),"model-value":a.type,readonly:a.readonly,width:"100%","onUpdate:modelValue":h[0]||(h[0]=d=>n("update:type",d))},null,8,["items","label","model-value","readonly"]),e.createVNode(w,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Pt,e.toDisplayString(e.unref(o)("upstreams.form.passive_healthy.label")),1),e.createElementVNode("p",At,e.toDisplayString(e.unref(o)("upstreams.form.passive_healthy.help")),1),e.createVNode(t,{autocomplete:"off","data-testid":"passive-healthcheck-healthy-successes",label:e.unref(o)("upstreams.form.fields.successes.label"),max:e.unref(se),min:e.unref(le),"model-value":a.healthySuccesses,readonly:a.readonly,type:"number","onUpdate:modelValue":h[1]||(h[1]=d=>n("update:healthy-successes",d))},null,8,["label","max","min","model-value","readonly"]),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(F,{key:0,class:"margin-top-6 passive-healthcheck-healthy-http-statuses","enable-item-creation":"",items:e.unref(he),label:e.unref(o)("upstreams.form.fields.http_statuses.label"),"model-value":a.healthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:h[2]||(h[2]=d=>e.unref(D)(d,!0)),onItemRemoved:h[3]||(h[3]=d=>e.unref(D)(d,!1)),"onUpdate:modelValue":h[4]||(h[4]=d=>n("update:healthy-http-statuses",d))},null,8,["items","label","model-value","readonly"]))]),_:1}),e.createVNode(w,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Mt,e.toDisplayString(e.unref(o)("upstreams.form.passive_unhealthy.label")),1),e.createElementVNode("p",Kt,e.toDisplayString(e.unref(o)("upstreams.form.passive_unhealthy.help")),1),e.createVNode(t,{autocomplete:"off","data-testid":"passive-healthcheck-unhealthy-timeouts",label:e.unref(o)("upstreams.form.fields.timeouts.label"),max:e.unref(xe),min:e.unref(Ne),"model-value":a.unhealthyTimeouts,readonly:a.readonly,type:"number","onUpdate:modelValue":h[5]||(h[5]=d=>n("update:unhealthy-timeouts",d))},null,8,["label","max","min","model-value","readonly"]),e.createVNode(t,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-unhealthy-tcp-failures",label:e.unref(o)("upstreams.form.fields.tcp_failures.label"),max:e.unref(se),min:e.unref(le),"model-value":a.unhealthyTcpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":h[6]||(h[6]=d=>n("update:unhealthy-tcp-failures",d))},null,8,["label","max","min","model-value","readonly"]),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(t,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-unhealthy-http-failures",label:e.unref(o)("upstreams.form.fields.http_failures.label"),max:e.unref(se),min:e.unref(le),"model-value":a.unhealthyHttpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":h[7]||(h[7]=d=>n("update:unhealthy-http-failures",d))},null,8,["label","max","min","model-value","readonly"])),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(F,{key:1,autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","data-testid":"passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:e.unref(he),label:e.unref(o)("upstreams.form.fields.http_statuses.label"),"model-value":a.unhealthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:h[8]||(h[8]=d=>e.unref(N)(d,!0)),onItemRemoved:h[9]||(h[9]=d=>e.unref(N)(d,!1)),"onUpdate:modelValue":h[10]||(h[10]=d=>n("update:unhealthy-http-statuses",d))},null,8,["items","label","model-value","readonly"]))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-7c20c5c5"]]),Lt={class:"kong-ui-entities-upstreams-form"},jt=Z(e.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||(a==null?void 0:a.app)==="konnect"&&!(a!=null&&a.controlPlaneId)||(a==null?void 0:a.app)==="kongManager"&&typeof(a==null?void 0:a.workspace)!="string"||!(a!=null&&a.cancelRoute))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(a,{emit:E}){var K;const o=a,l=E,{inRange:n,stringToNumberArray:k,upstreamsResponseToFields:f,getDefaultUpstreamFields:D,objectsAreEqual:N,cloneDeep:s}=pe(),{axiosInstance:h}=m.useAxios((K=o.config)==null?void 0:K.axiosRequestConfig),{getMessageFromError:b}=m.useErrors(),u=Ve.useRouter(),t=e.reactive({fields:D(),readonly:!1,errorMessage:""}),F=e.reactive(D()),w=e.computed(()=>!N(t.fields,F)),d=c=>{t.fields.activeHealthCheck.healthy.interval=c?"5":"0",t.fields.activeHealthCheck.healthy.successes=c?"5":"0",t.fields.activeHealthCheck.healthy.httpStatuses=c?ce:[],t.fields.activeHealthCheck.unhealthy.httpStatuses=c?ue:[],t.fields.activeHealthCheck.unhealthy.httpFailures=c?"5":"0",t.fields.activeHealthCheck.unhealthy.interval=c?"5":"0",t.fields.activeHealthCheck.unhealthy.tcpFailures=c?"5":"0",t.fields.activeHealthCheck.unhealthy.timeouts=c?"5":"0",t.fields.activeHealthCheck.timeout=c?"1":"0",t.fields.activeHealthCheck.concurrency=c?"10":"0",t.fields.activeHealthCheck.httpPath=c?"/":"",t.fields.activeHealthCheck.httpsSni="",t.fields.activeHealthCheck.type="http"},C=c=>{t.fields.passiveHealthCheck.healthy.successes=c?"80":"0",t.fields.passiveHealthCheck.healthy.httpStatuses=c?de:[],t.fields.passiveHealthCheck.unhealthy.timeouts=c?"5":"0",t.fields.passiveHealthCheck.unhealthy.tcpFailures=c?"5":"0",t.fields.passiveHealthCheck.unhealthy.httpFailures=c?"5":"0",t.fields.passiveHealthCheck.unhealthy.httpStatuses=c?fe:[],t.fields.passiveHealthCheck.type="http"},M=e.computed(()=>t.fields.algorithm!=="sticky-sessions"?!0:!!t.fields.stickySessionsCookie&&!!t.fields.stickySessionsCookiePath),I=e.computed(()=>t.fields.slots?n(t.fields.slots,Ce,_e):!0),L=e.computed(()=>t.fields.hashOn==="header"?!!t.fields.hashOnHeader:!0),$=e.computed(()=>t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie"?!!t.fields.hashOnCookie:!0),y=e.computed(()=>t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie"?!!t.fields.hashOnCookiePath:!0),S=e.computed(()=>t.fields.hashOn==="query_arg"?!!t.fields.hashOnQueryArgument:!0),H=e.computed(()=>t.fields.hashOn==="uri_capture"?!!t.fields.hashOnUriCapture:!0),p=e.computed(()=>t.fields.hashFallback==="header"?!!t.fields.hashFallbackHeader:!0),B=e.computed(()=>t.fields.hashFallback==="query_arg"?!!t.fields.hashFallbackQueryArgument:!0),T=e.computed(()=>t.fields.hashFallback==="uri_capture"?!!t.fields.hashFallbackUriCapture:!0),J=e.computed(()=>!!t.fields.name&&M.value&&I.value&&L.value&&$.value&&y.value&&S.value&&H.value&&p.value&&B.value&&T.value),A=e.computed(()=>o.upstreamId?m.EntityBaseFormType.Edit:m.EntityBaseFormType.Create),X=e.computed(()=>{var c,r;return(r=ie.form[(c=o.config)==null?void 0:c.app])==null?void 0:r.edit}),U=c=>{Object.assign(t.fields,f(c)),Object.assign(F,s(t.fields))},q=()=>{var c;u.push(((c=o.config)==null?void 0:c.cancelRoute)||{name:"upstreams-list"})},j=c=>{l("loading",c)},G=c=>{l("error",c)},v=e.computed(()=>{const c=o.config.stickySessionsAvailable?{sticky_sessions_cookie:null,sticky_sessions_cookie_path:null}:{};return t.fields.algorithm==="sticky-sessions"&&(c.sticky_sessions_cookie=t.fields.stickySessionsCookie||null,c.sticky_sessions_cookie_path=t.fields.stickySessionsCookiePath||null),c}),Q=e.computed(()=>{const c={};return t.fields.hashOn==="header"&&(c.hash_on_header=t.fields.hashOnHeader),(t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie")&&(c.hash_on_cookie=t.fields.hashOnCookie,c.hash_on_cookie_path=t.fields.hashOnCookiePath),t.fields.hashOn==="query_arg"&&(c.hash_on_query_arg=t.fields.hashOnQueryArgument),t.fields.hashOn==="uri_capture"&&(c.hash_on_uri_capture=t.fields.hashOnUriCapture),t.fields.hashFallback==="header"&&(c.hash_fallback_header=t.fields.hashFallbackHeader),t.fields.hashFallback==="query_arg"&&(c.hash_fallback_query_arg=t.fields.hashFallbackQueryArgument),t.fields.hashFallback==="uri_capture"&&(c.hash_fallback_uri_capture=t.fields.hashFallbackUriCapture),c}),_=e.computed(()=>{var r,i,P;if(!t.fields.activeHealthSwitch)return((r=o.config)==null?void 0:r.app)==="kongManager"&&A.value===m.EntityBaseFormType.Edit?{type:t.fields.activeHealthCheck.type,headers:{},healthy:{interval:0,successes:0},unhealthy:{interval:0,http_failures:0,tcp_failures:0,timeouts:0}}:void 0;const c={type:t.fields.activeHealthCheck.type,healthy:{interval:Number(t.fields.activeHealthCheck.healthy.interval||"0"),successes:Number(t.fields.activeHealthCheck.healthy.successes||"0")},unhealthy:{interval:Number(t.fields.activeHealthCheck.unhealthy.interval||"0"),timeouts:Number(t.fields.activeHealthCheck.unhealthy.timeouts||"0"),tcp_failures:Number(t.fields.activeHealthCheck.unhealthy.tcpFailures||"0")},timeout:Number(t.fields.activeHealthCheck.timeout||"1"),concurrency:Number(t.fields.activeHealthCheck.concurrency||"10")};if(t.fields.activeHealthCheck.type!=="tcp"){c.http_path=t.fields.activeHealthCheck.httpPath||"/",c.unhealthy.http_failures=Number(t.fields.activeHealthCheck.unhealthy.httpFailures||"5");const R=(i=t.fields.activeHealthCheck.unhealthy.httpStatuses)!=null&&i.length?t.fields.activeHealthCheck.unhealthy.httpStatuses:ue;c.unhealthy.http_statuses=k(R);const z=(P=t.fields.activeHealthCheck.healthy.httpStatuses)!=null&&P.length?t.fields.activeHealthCheck.healthy.httpStatuses:ce;c.healthy.http_statuses=k(z)}return["https","grpcs"].includes(t.fields.activeHealthCheck.type)&&(c.https_sni=t.fields.activeHealthCheck.httpsSni||null,c.https_verify_certificate=t.fields.activeHealthCheck.verifySsl),c.headers=t.fields.activeHealthCheck.headers.reduce((R,z)=>{var te,ae;return z.key?{...R,[z.key]:(ae=(te=z.values.split(","))==null?void 0:te.map(be=>be.trim()))==null?void 0:ae.filter(Boolean)}:R},{}),c}),O=e.computed(()=>{var r,i,P;if(!t.fields.passiveHealthSwitch)return((r=o.config)==null?void 0:r.app)==="kongManager"&&A.value===m.EntityBaseFormType.Edit?{type:t.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}:void 0;const c={type:t.fields.passiveHealthCheck.type,healthy:{successes:Number(t.fields.passiveHealthCheck.healthy.successes||"0")},unhealthy:{timeouts:Number(t.fields.passiveHealthCheck.unhealthy.timeouts||"0"),tcp_failures:Number(t.fields.passiveHealthCheck.unhealthy.tcpFailures||"5")}};if(t.fields.passiveHealthCheck.type!=="tcp"){c.unhealthy.http_failures=Number(t.fields.passiveHealthCheck.unhealthy.httpFailures||"5");const R=(i=t.fields.passiveHealthCheck.healthy.httpStatuses)!=null&&i.length?t.fields.passiveHealthCheck.healthy.httpStatuses:de;c.healthy.http_statuses=k(R);const z=(P=t.fields.passiveHealthCheck.unhealthy.httpStatuses)!=null&&P.length?t.fields.passiveHealthCheck.unhealthy.httpStatuses:fe;c.unhealthy.http_statuses=k(z)}return c}),g=e.computed(()=>{const c={name:t.fields.name,slots:Number(t.fields.slots),algorithm:t.fields.algorithm,hash_on:t.fields.hashOn,hash_fallback:t.fields.hashFallback,healthchecks:{threshold:Number(t.fields.healthchecksThreshold||"0")},host_header:t.fields.hostHeader||null,client_certificate:t.fields.clientCertificate?{id:t.fields.clientCertificate}:null},r=_.value,i=O.value,P={...c,...v.value,healthchecks:{...c.healthchecks,active:r||void 0,passive:i||void 0}};return P.tags=t.fields.tags?t.fields.tags.split(",").map(R=>String(R||"").trim()).filter(R=>R!==""):[],Object.assign(P,Q.value),P}),V=c=>{var i,P,R,z,te,ae;let r=`${(i=o.config)==null?void 0:i.apiBaseUrl}${ie.form[(P=o.config)==null?void 0:P.app][c]}`;return((R=o.config)==null?void 0:R.app)==="konnect"?r=r.replace(/{controlPlaneId}/gi,((z=o.config)==null?void 0:z.controlPlaneId)||""):((te=o.config)==null?void 0:te.app)==="kongManager"&&(r=r.replace(/\/{workspace}/gi,(ae=o.config)!=null&&ae.workspace?`/${o.config.workspace}`:"")),r=r.replace(/{id}/gi,o.upstreamId),r},x=async()=>{var c;try{t.readonly=!0,await h.post(V("validate"),g.value);let r;A.value===m.EntityBaseFormType.Create?r=await h.post(V("create"),g.value):A.value===m.EntityBaseFormType.Edit&&(r=((c=o.config)==null?void 0:c.app)==="konnect"?await h.put(V("edit"),g.value):await h.patch(V("edit"),g.value)),l("update",r==null?void 0:r.data)}catch(r){t.errorMessage=b(r),l("error",r)}finally{t.readonly=!1}};return(c,r)=>(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(m.EntityBaseForm),{"can-submit":J.value&&w.value,config:a.config,"edit-id":a.upstreamId,"entity-type":e.unref(m.SupportedEntityType).Upstream,"error-message":t.errorMessage,"fetch-url":X.value,"form-fields":g.value,"is-readonly":t.readonly,onCancel:q,"onFetch:error":G,"onFetch:success":U,onLoading:j,onSubmit:x},{default:e.withCtx(()=>[e.createVNode(_t,{"client-certificate":t.fields.clientCertificate,"onUpdate:clientCertificate":r[0]||(r[0]=i=>t.fields.clientCertificate=i),"host-header":t.fields.hostHeader,"onUpdate:hostHeader":r[1]||(r[1]=i=>t.fields.hostHeader=i),name:t.fields.name,"onUpdate:name":r[2]||(r[2]=i=>t.fields.name=i),tags:t.fields.tags,"onUpdate:tags":r[3]||(r[3]=i=>t.fields.tags=i),config:a.config,readonly:t.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),e.createVNode(xt,{algorithm:t.fields.algorithm,"onUpdate:algorithm":r[4]||(r[4]=i=>t.fields.algorithm=i),"hash-fallback":t.fields.hashFallback,"onUpdate:hashFallback":r[5]||(r[5]=i=>t.fields.hashFallback=i),"hash-fallback-header":t.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":r[6]||(r[6]=i=>t.fields.hashFallbackHeader=i),"hash-fallback-query-argument":t.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":r[7]||(r[7]=i=>t.fields.hashFallbackQueryArgument=i),"hash-fallback-uri-capture":t.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":r[8]||(r[8]=i=>t.fields.hashFallbackUriCapture=i),"hash-on":t.fields.hashOn,"onUpdate:hashOn":r[9]||(r[9]=i=>t.fields.hashOn=i),"hash-on-cookie":t.fields.hashOnCookie,"onUpdate:hashOnCookie":r[10]||(r[10]=i=>t.fields.hashOnCookie=i),"hash-on-cookie-path":t.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":r[11]||(r[11]=i=>t.fields.hashOnCookiePath=i),"hash-on-header":t.fields.hashOnHeader,"onUpdate:hashOnHeader":r[12]||(r[12]=i=>t.fields.hashOnHeader=i),"hash-on-query-argument":t.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":r[13]||(r[13]=i=>t.fields.hashOnQueryArgument=i),"hash-on-uri-capture":t.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":r[14]||(r[14]=i=>t.fields.hashOnUriCapture=i),slots:t.fields.slots,"onUpdate:slots":r[15]||(r[15]=i=>t.fields.slots=i),"sticky-sessions-cookie":t.fields.stickySessionsCookie,"onUpdate:stickySessionsCookie":r[16]||(r[16]=i=>t.fields.stickySessionsCookie=i),"sticky-sessions-cookie-path":t.fields.stickySessionsCookiePath,"onUpdate:stickySessionsCookiePath":r[17]||(r[17]=i=>t.fields.stickySessionsCookiePath=i),readonly:t.readonly,"sticky-sessions-available":a.config.stickySessionsAvailable},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","sticky-sessions-cookie","sticky-sessions-cookie-path","readonly","sticky-sessions-available"]),e.createVNode(qt,{"active-health-switch":t.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[r[18]||(r[18]=i=>t.fields.activeHealthSwitch=i),d],"healthchecks-threshold":t.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":r[19]||(r[19]=i=>t.fields.healthchecksThreshold=i),"passive-health-switch":t.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[r[20]||(r[20]=i=>t.fields.passiveHealthSwitch=i),C],readonly:t.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),t.fields.activeHealthSwitch?(e.openBlock(),e.createBlock($t,{key:0,concurrency:t.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":r[21]||(r[21]=i=>t.fields.activeHealthCheck.concurrency=i),headers:t.fields.activeHealthCheck.headers,"onUpdate:headers":r[22]||(r[22]=i=>t.fields.activeHealthCheck.headers=i),"healthy-http-statuses":t.fields.activeHealthCheck.healthy.httpStatuses,"onUpdate:healthyHttpStatuses":r[23]||(r[23]=i=>t.fields.activeHealthCheck.healthy.httpStatuses=i),"healthy-interval":t.fields.activeHealthCheck.healthy.interval,"onUpdate:healthyInterval":r[24]||(r[24]=i=>t.fields.activeHealthCheck.healthy.interval=i),"healthy-successes":t.fields.activeHealthCheck.healthy.successes,"onUpdate:healthySuccesses":r[25]||(r[25]=i=>t.fields.activeHealthCheck.healthy.successes=i),"http-path":t.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":r[26]||(r[26]=i=>t.fields.activeHealthCheck.httpPath=i),"https-sni":t.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":r[27]||(r[27]=i=>t.fields.activeHealthCheck.httpsSni=i),timeout:t.fields.activeHealthCheck.timeout,"onUpdate:timeout":r[28]||(r[28]=i=>t.fields.activeHealthCheck.timeout=i),type:t.fields.activeHealthCheck.type,"onUpdate:type":r[29]||(r[29]=i=>t.fields.activeHealthCheck.type=i),"unhealthy-http-failures":t.fields.activeHealthCheck.unhealthy.httpFailures,"onUpdate:unhealthyHttpFailures":r[30]||(r[30]=i=>t.fields.activeHealthCheck.unhealthy.httpFailures=i),"unhealthy-http-statuses":t.fields.activeHealthCheck.unhealthy.httpStatuses,"onUpdate:unhealthyHttpStatuses":r[31]||(r[31]=i=>t.fields.activeHealthCheck.unhealthy.httpStatuses=i),"unhealthy-interval":t.fields.activeHealthCheck.unhealthy.interval,"onUpdate:unhealthyInterval":r[32]||(r[32]=i=>t.fields.activeHealthCheck.unhealthy.interval=i),"unhealthy-tcp-failures":t.fields.activeHealthCheck.unhealthy.tcpFailures,"onUpdate:unhealthyTcpFailures":r[33]||(r[33]=i=>t.fields.activeHealthCheck.unhealthy.tcpFailures=i),"unhealthy-timeouts":t.fields.activeHealthCheck.unhealthy.timeouts,"onUpdate:unhealthyTimeouts":r[34]||(r[34]=i=>t.fields.activeHealthCheck.unhealthy.timeouts=i),"verify-ssl":t.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":r[35]||(r[35]=i=>t.fields.activeHealthCheck.verifySsl=i),config:a.config,readonly:t.readonly},null,8,["concurrency","headers","healthy-http-statuses","healthy-interval","healthy-successes","http-path","https-sni","timeout","type","unhealthy-http-failures","unhealthy-http-statuses","unhealthy-interval","unhealthy-tcp-failures","unhealthy-timeouts","verify-ssl","config","readonly"])):e.createCommentVNode("",!0),t.fields.passiveHealthSwitch?(e.openBlock(),e.createBlock(Rt,{key:1,"healthy-http-statuses":t.fields.passiveHealthCheck.healthy.httpStatuses,"onUpdate:healthyHttpStatuses":r[36]||(r[36]=i=>t.fields.passiveHealthCheck.healthy.httpStatuses=i),"healthy-successes":t.fields.passiveHealthCheck.healthy.successes,"onUpdate:healthySuccesses":r[37]||(r[37]=i=>t.fields.passiveHealthCheck.healthy.successes=i),type:t.fields.passiveHealthCheck.type,"onUpdate:type":r[38]||(r[38]=i=>t.fields.passiveHealthCheck.type=i),"unhealthy-http-failures":t.fields.passiveHealthCheck.unhealthy.httpFailures,"onUpdate:unhealthyHttpFailures":r[39]||(r[39]=i=>t.fields.passiveHealthCheck.unhealthy.httpFailures=i),"unhealthy-http-statuses":t.fields.passiveHealthCheck.unhealthy.httpStatuses,"onUpdate:unhealthyHttpStatuses":r[40]||(r[40]=i=>t.fields.passiveHealthCheck.unhealthy.httpStatuses=i),"unhealthy-tcp-failures":t.fields.passiveHealthCheck.unhealthy.tcpFailures,"onUpdate:unhealthyTcpFailures":r[41]||(r[41]=i=>t.fields.passiveHealthCheck.unhealthy.tcpFailures=i),"unhealthy-timeouts":t.fields.passiveHealthCheck.unhealthy.timeouts,"onUpdate:unhealthyTimeouts":r[42]||(r[42]=i=>t.fields.passiveHealthCheck.unhealthy.timeouts=i),readonly:t.readonly},null,8,["healthy-http-statuses","healthy-successes","type","unhealthy-http-failures","unhealthy-http-statuses","unhealthy-tcp-failures","unhealthy-timeouts","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-0d494630"]]),Qt={"data-testid":"client_certificate-plain-text"},Wt=e.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(a){const E=a,{i18n:{t:o},i18nT:l}=Y.useI18n(),{getPropValue:n}=m.useHelpers(),k=e.computed(()=>ie.form[E.config.app].edit),f=e.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:m.ConfigurationSchemaSection.Basic,tooltip:o("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:m.ConfigurationSchemaSection.Basic},hash_on:{order:7,section:m.ConfigurationSchemaSection.Basic},hash_on_header:{order:8,section:m.ConfigurationSchemaSection.Basic},hash_on_uri_capture:{order:9,section:m.ConfigurationSchemaSection.Basic},hash_on_query_arg:{order:10,section:m.ConfigurationSchemaSection.Basic,label:`${o("upstreams.form.fields.hash_on.label")} ${o("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:m.ConfigurationSchemaSection.Basic},hash_on_cookie_path:{order:12,section:m.ConfigurationSchemaSection.Basic},healthchecks:{order:13,section:m.ConfigurationSchemaSection.Basic,type:m.ConfigurationSchemaType.Json},tags:{order:14,tooltip:o("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${o("upstreams.form.fields.hash_fallback.label")} ${o("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:o("upstreams.form.hash_tooltips.client_certificate")}});return(D,N)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(m.EntityBaseConfigCard),{config:a.config,"config-card-doc":a.configCardDoc,"config-schema":f.value,"entity-type":e.unref(m.SupportedEntityType).Upstream,"fetch-url":k.value,"hide-title":a.hideTitle,"onFetch:error":N[0]||(N[0]=s=>D.$emit("fetch:error",s)),"onFetch:success":N[1]||(N[1]=s=>D.$emit("fetch:success",s)),onLoading:N[2]||(N[2]=s=>D.$emit("loading",s))},{"name-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":e.withCtx(({row:s})=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(s.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:e.withCtx(()=>N[3]||(N[3]=[e.createElementVNode("code",null,"10",-1)])),max:e.withCtx(()=>N[4]||(N[4]=[e.createElementVNode("code",null,"65536",-1)])),_:1})]),"hash_fallback-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:e.withCtx(s=>{var h;return[e.createElementVNode("div",null,[e.createElementVNode("div",Qt,[e.createElementVNode("span",null,e.toDisplayString((h=e.unref(n)("rowValue",s))==null?void 0:h.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});W.TargetForm=Ue,W.TargetsList=bt,W.UpstreamsConfigCard=Wt,W.UpstreamsForm=jt,W.UpstreamsList=ut,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
1
+ (function(W,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/entities-shared"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/entities-shared","vue-router","@kong/icons","@kong-ui-public/i18n"],e):(W=typeof globalThis<"u"?globalThis:W||self,e(W["kong-ui-entities-upstreams-targets"]={},W.Vue,W["kong-ui-public-entities-shared"],W.VueRouter,W.KongIcons,W["kong-ui-public-i18n"]))})(this,function(W,e,p,Ve,ee,Ne){"use strict";const Ze={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."},empty_state_v2:{title:"Configure your first upstream",description:"Upstreams route traffic to multiple backend services, handling load balancing, health checks, and circuit breaking for reliability.",create_cta:"New upstream",group:"Upstreams created in gateways within this group will automatically appear here.",learn_more:"Learn more"},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",sticky_sessions_label:"Sticky Sessions"},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."},sticky_sessions_cookie:{label:"Sticky Sessions Cookie",tooltip:"The cookie name to keep sticky sessions."},sticky_sessions_cookie_path:{label:"Sticky Sessions Cookie Path",tooltip:"A string representing a URL path, such as /path/to/resource. Must start with a forward slash (/) and must not contain empty segments (i.e., two consecutive forward slashes)."},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",target_type:"Target Type"},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"},failover:{label:"Failover Target",load_balance_target:"Load balance",failover_target:"Failover",help:"Whether to use this target only as backup.",unsupported:"The current load balance algorithm does not support failover."}}}}};function et(){const a=Ne.createI18n("en-us",Ze);return{i18n:a,i18nT:Ne.i18nTComponent(a)}}function re(a){const{replaceId:B=!1}=a,o=e.ref([]);return{addedItems:o,trackNewItems:(n,m)=>{if(m){const f={...n};B&&(f.value=n.label),o.value.push(f)}else o.value=o.value.filter(f=>f.value!==n.value)}}}const he=[{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"}],ge=10,ke=65536,tt=0,at=65535,le=0,se=255,we=0,xe=255,lt=0,st=65535,He=0,Te=65535,ot=0,rt=2**31,ce=["200","302"],de=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],ue=["429","404","500","501","502","503","504","505"],fe=["429","500","503"],it=["latency","least-connections","round-robin"];function pe(){const a=l=>/^\d+$/.test(l),B=(l,h,b)=>{if(a(l)){const u=Number(l);return u>=h&&u<=b}else return!1},o=l=>l.map(h=>Number(h)),s=l=>l.map(h=>h.toString()),n=l=>{var b,u,t,F,V,d,C,A,E,K,g,N,T,U,k,H,P,v,M,X,I,q,j,G,J,Q,_,O,y,S,x,R,c,r,i,$,L,z,te,ae,ye,Ie,qe,Fe,Ee,Be,Oe,De,Pe,$e,Ae,Me,Ke,Re,Le,je,Qe,We,Je,ve,Ge,ze,Xe,Ye;return{name:(l==null?void 0:l.name)||"",hostHeader:(l==null?void 0:l.host_header)||"",clientCertificate:((b=l==null?void 0:l.client_certificate)==null?void 0:b.id)||"",tags:((u=l==null?void 0:l.tags)==null?void 0:u.join(", "))||"",algorithm:(l==null?void 0:l.algorithm)||"round-robin",stickySessionsCookie:(l==null?void 0:l.sticky_sessions_cookie)||"",stickySessionsCookiePath:(l==null?void 0:l.sticky_sessions_cookie_path)||"/",slots:((t=l==null?void 0:l.slots)==null?void 0:t.toString())||"10000",hashOn:(l==null?void 0:l.hash_on)||"none",hashFallback:(l==null?void 0:l.hash_fallback)||"none",hashOnHeader:(l==null?void 0:l.hash_on_header)||"",hashOnCookie:(l==null?void 0:l.hash_on_cookie)||"",hashOnCookiePath:(l==null?void 0:l.hash_on_cookie_path)||"/",hashOnQueryArgument:(l==null?void 0:l.hash_on_query_arg)||"",hashOnUriCapture:(l==null?void 0:l.hash_on_uri_capture)||"",hashFallbackHeader:(l==null?void 0:l.hash_fallback_header)||"",hashFallbackQueryArgument:(l==null?void 0:l.hash_fallback_query_arg)||"",hashFallbackUriCapture:(l==null?void 0:l.hash_fallback_uri_capture)||"",activeHealthSwitch:l?((V=(F=l.healthchecks.active)==null?void 0:F.healthy)==null?void 0:V.interval)!==0||((C=(d=l.healthchecks.active)==null?void 0:d.unhealthy)==null?void 0:C.interval)!==0:!1,passiveHealthSwitch:l?((E=(A=l.healthchecks.passive)==null?void 0:A.healthy)==null?void 0:E.successes)!==0||((g=(K=l.healthchecks.passive)==null?void 0:K.unhealthy)==null?void 0:g.timeouts)!==0||((T=(N=l.healthchecks.passive)==null?void 0:N.unhealthy)==null?void 0:T.tcp_failures)!==0||((k=(U=l.healthchecks.passive)==null?void 0:U.unhealthy)==null?void 0:k.http_failures)!==0:!1,healthchecksThreshold:((H=l==null?void 0:l.healthchecks.threshold)==null?void 0:H.toString())||"0",activeHealthCheck:{type:((P=l==null?void 0:l.healthchecks.active)==null?void 0:P.type)||"http",httpPath:((v=l==null?void 0:l.healthchecks.active)==null?void 0:v.http_path)||"/",timeout:((X=(M=l==null?void 0:l.healthchecks.active)==null?void 0:M.timeout)==null?void 0:X.toString())||"1",concurrency:((q=(I=l==null?void 0:l.healthchecks.active)==null?void 0:I.concurrency)==null?void 0:q.toString())||"10",httpsSni:((j=l==null?void 0:l.healthchecks.active)==null?void 0:j.https_sni)||"",verifySsl:((G=l==null?void 0:l.healthchecks.active)==null?void 0:G.https_verify_certificate)||!1,headers:(J=l==null?void 0:l.healthchecks.active)!=null&&J.headers&&Object.entries(l.healthchecks.active.headers).length>0?Object.entries(l.healthchecks.active.headers).map(([Jt,Se])=>({key:Jt,values:Se==null?void 0:Se.join(", ")})):[{key:"",values:""}],healthy:{interval:((O=(_=(Q=l==null?void 0:l.healthchecks.active)==null?void 0:Q.healthy)==null?void 0:_.interval)==null?void 0:O.toString())||"0",successes:((x=(S=(y=l==null?void 0:l.healthchecks.active)==null?void 0:y.healthy)==null?void 0:S.successes)==null?void 0:x.toString())||"5",httpStatuses:(c=(R=l==null?void 0:l.healthchecks.active)==null?void 0:R.healthy)!=null&&c.http_statuses?s(l.healthchecks.active.healthy.http_statuses):ce},unhealthy:{interval:(($=(i=(r=l==null?void 0:l.healthchecks.active)==null?void 0:r.unhealthy)==null?void 0:i.interval)==null?void 0:$.toString())||"0",httpFailures:((te=(z=(L=l==null?void 0:l.healthchecks.active)==null?void 0:L.unhealthy)==null?void 0:z.http_failures)==null?void 0:te.toString())||"5",tcpFailures:((Ie=(ye=(ae=l==null?void 0:l.healthchecks.active)==null?void 0:ae.unhealthy)==null?void 0:ye.tcp_failures)==null?void 0:Ie.toString())||"5",httpStatuses:(Fe=(qe=l==null?void 0:l.healthchecks.active)==null?void 0:qe.unhealthy)!=null&&Fe.http_statuses?s(l.healthchecks.active.unhealthy.http_statuses):ue,timeouts:((Oe=(Be=(Ee=l==null?void 0:l.healthchecks.active)==null?void 0:Ee.unhealthy)==null?void 0:Be.timeouts)==null?void 0:Oe.toString())||"0"}},passiveHealthCheck:{type:((De=l==null?void 0:l.healthchecks.passive)==null?void 0:De.type)||"http",healthy:{successes:((Ae=($e=(Pe=l==null?void 0:l.healthchecks.passive)==null?void 0:Pe.healthy)==null?void 0:$e.successes)==null?void 0:Ae.toString())||"5",httpStatuses:(Ke=(Me=l==null?void 0:l.healthchecks.passive)==null?void 0:Me.healthy)!=null&&Ke.http_statuses?s(l.healthchecks.passive.healthy.http_statuses):de},unhealthy:{timeouts:((je=(Le=(Re=l==null?void 0:l.healthchecks.passive)==null?void 0:Re.unhealthy)==null?void 0:Le.timeouts)==null?void 0:je.toString())||"0",httpFailures:((Je=(We=(Qe=l==null?void 0:l.healthchecks.passive)==null?void 0:Qe.unhealthy)==null?void 0:We.http_failures)==null?void 0:Je.toString())||"5",tcpFailures:((ze=(Ge=(ve=l==null?void 0:l.healthchecks.passive)==null?void 0:ve.unhealthy)==null?void 0:Ge.tcp_failures)==null?void 0:ze.toString())||"5",httpStatuses:(Ye=(Xe=l==null?void 0:l.healthchecks.passive)==null?void 0:Xe.unhealthy)!=null&&Ye.http_statuses?s(l.healthchecks.passive.unhealthy.http_statuses):fe}}}};return{isInteger:a,inRange:B,stringToNumberArray:o,numberToStringArray:s,upstreamsResponseToFields:l=>n(l),getDefaultUpstreamFields:()=>n(),objectsAreEqual:(l,h)=>{try{return JSON.stringify(l)===JSON.stringify(h)}catch{return!1}},cloneDeep:l=>JSON.parse(JSON.stringify(l))}}const Y={useI18n:et,useMultiselectCreation:re,useHelpers:pe},ie="/v2/control-planes/{controlPlaneId}/core-entities",ne="/{workspace}",oe={list:{konnect:`${ie}/upstreams`,kongManager:`${ne}/upstreams`},form:{konnect:{getServices:`${ie}/services`,getCertificates:`${ie}/certificates`,create:`${ie}/upstreams`,edit:`${ie}/upstreams/{id}`},kongManager:{getServices:`${ne}/services`,getCertificates:`${ne}/certificates`,create:`${ne}/upstreams`,edit:`${ne}/upstreams/{id}`}}},nt={class:"kong-ui-entities-upstreams-list"},ht={class:"button-row"},ct={class:"upstream-name"},dt=e.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||!a.createRoute||!a.getViewRoute||!a.getEditRoute||a.app==="kongManager"&&!a.isExactMatch&&!a.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","click:learn-more","copy:success","copy:error","delete:success"],setup(a,{emit:B}){var O;const o=B,s=a,{i18n:{t:n}}=Y.useI18n(),m=Ve.useRouter(),{axiosInstance:f}=p.useAxios((O=s.config)==null?void 0:O.axiosRequestConfig),{hasRecords:D,handleStateChange:w}=p.useTableState(()=>F.value),l=e.computed(()=>D.value&&s.config.app==="konnect"),h=e.computed(()=>s.config.app!=="kongManager"||!!s.config.disableSorting),b={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},u=b,t=e.computed(()=>{var S,x;let y=`${s.config.apiBaseUrl}${oe.list[s.config.app]}`;return s.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((S=s.config)==null?void 0:S.controlPlaneId)||""):s.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(x=s.config)!=null&&x.workspace?`/${s.config.workspace}`:"")),y}),F=e.ref(""),V=e.computed(()=>{const y=s.config.app==="konnect"||s.config.isExactMatch;if(y)return{isExactMatch:y,placeholder:n("upstreams.search.placeholder")};const{name:S,slots:x}=b;return{isExactMatch:y,fields:{name:S,slots:x},schema:s.config.filterSchema}}),{fetcher:d,fetcherState:C,fetcherCacheKey:A}=p.useFetcher(e.computed(()=>({...s.config,cacheIdentifier:s.cacheIdentifier})),t),E=()=>{F.value=""},K=()=>{A.value++},g=e.ref(null),N=async(y,S)=>{const x=y.id;if(!await S(x)){o("copy:error",{entity:y,field:"id",message:n("upstreams.errors.copy")});return}o("copy:success",{entity:y,field:"id",message:n("upstreams.copy.success",{val:x})})},T=async(y,S)=>{const x=JSON.stringify(y);if(!await S(x)){o("copy:error",{entity:y,message:n("upstreams.errors.copy")});return}o("copy:success",{entity:y,message:n("upstreams.copy.success_brief")})},U=async y=>{var x;await((x=s.canRetrieve)==null?void 0:x.call(s,y))&&m.push(s.config.getViewRoute(y.id))},k=y=>({label:n("upstreams.actions.view"),to:s.config.getViewRoute(y)}),H=y=>({label:n("upstreams.actions.edit"),to:s.config.getEditRoute(y)}),P=e.ref(void 0),v=e.ref(!1),M=e.ref(!1),X=e.ref(""),I=p.useDeleteUrlBuilder(s.config,t.value),q=y=>{P.value=y,v.value=!0},j=()=>{v.value=!1},G=async()=>{var y,S,x;if((y=P.value)!=null&&y.id){M.value=!0;try{await f.delete(I(P.value.id)),M.value=!1,v.value=!1,A.value++,o("delete:success",P.value)}catch(R){X.value=((x=(S=R.response)==null?void 0:S.data)==null?void 0:x.message)||R.message||n("upstreams.errors.delete"),o("error",R)}finally{M.value=!1}}},J=()=>{m.push(s.config.createRoute)};e.watch(C,y=>{var S,x,R;if(y.status===p.FetcherStatus.Error){g.value={title:n("upstreams.errors.general")},(R=(x=(S=y.error)==null?void 0:S.response)==null?void 0:x.data)!=null&&R.message&&(g.value.message=y.error.response.data.message),o("error",y.error);return}g.value=null});const Q=e.ref({ctaPath:s.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${s.config.additionMessageForEmptyState?` ${s.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")}),_=e.ref(!1);return e.onBeforeMount(async()=>{_.value=await s.canCreate(),_.value&&(Q.value.title=n("upstreams.list.empty_state.title"),Q.value.ctaText=n("upstreams.actions.create"))}),(y,S)=>{const x=e.resolveComponent("KButton"),R=e.resolveComponent("KEmptyState"),c=e.resolveComponent("KDropdownItem"),r=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(e.unref(p.EntityBaseTable),{"cache-identifier":a.cacheIdentifier,"disable-sorting":h.value,"empty-state-options":Q.value,"enable-entity-actions":"","error-message":g.value,fetcher:e.unref(d),"fetcher-cache-key":e.unref(A),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:F.value,"table-headers":e.unref(u),onClearSearchInput:E,"onClick:row":S[3]||(S[3]=i=>U(i)),onSort:K,onState:e.unref(w)},e.createSlots({"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(p.EntityFilter),{modelValue:F.value,"onUpdate:modelValue":S[0]||(S[0]=i=>F.value=i),config:V.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!a.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createElementVNode("div",ht,[l.value?(e.openBlock(),e.createBlock(x,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"upstream-learn-more-button",icon:"",onClick:S[1]||(S[1]=i=>y.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.BookIcon),{decorative:""})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>a.canCreate()},{default:e.withCtx(()=>[e.createVNode(x,{appearance:"primary","data-testid":"toolbar-add-upstream",size:a.useActionOutside?"medium":"large",to:a.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])])],8,["disabled"]))]),name:e.withCtx(({rowValue:i})=>[e.createElementVNode("span",ct,e.toDisplayString(i),1)]),tags:e.withCtx(({rowValue:i})=>[e.createVNode(e.unref(p.TableTags),{"tag-max-width":"auto",tags:i},null,8,["tags"])]),actions:e.withCtx(({row:i})=>[e.createVNode(r,null,{default:e.withCtx(({copyToClipboard:$})=>[e.createVNode(c,{"data-testid":"action-entity-copy-id",onClick:L=>N(i,$)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(({copyToClipboard:$})=>[e.createVNode(c,{"data-testid":"action-entity-copy-json",onClick:L=>T(i,$)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>a.canRetrieve(i)},{default:e.withCtx(()=>[e.createVNode(c,{"data-testid":"action-entity-view","has-divider":"",item:k(i.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>a.canEdit(i)},{default:e.withCtx(()=>[e.createVNode(c,{"data-testid":"action-entity-edit",item:H(i.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>a.canDelete(i)},{default:e.withCtx(()=>[e.createVNode(c,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:$=>q(i)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!F.value&&a.config.app==="konnect"?{name:"empty-state",fn:e.withCtx(()=>{var i;return[e.createVNode(R,{"data-testid":"upstreams-entity-empty-state","icon-background":"",message:e.unref(n)("upstreams.list.empty_state_v2.description"),title:e.unref(n)("upstreams.list.empty_state_v2.title")},e.createSlots({icon:e.withCtx(()=>[e.createVNode(e.unref(ee.CloudUploadIcon),{decorative:""})]),action:e.withCtx(()=>[_.value?(e.openBlock(),e.createBlock(x,{key:0,"data-testid":"entity-create-button",onClick:J},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon),{decorative:""}),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("upstreams.list.empty_state_v2.create_cta")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(x,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:S[2]||(S[2]=$=>y.$emit("click:learn-more"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.BookIcon),{decorative:""}),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("upstreams.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(i=a.config)!=null&&i.isControlPlaneGroup?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("upstreams.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","title"])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),e.createVNode(e.unref(p.EntityDeleteModal),{"action-pending":M.value,description:e.unref(n)("upstreams.delete.description"),"entity-name":P.value&&(P.value.name||P.value.id),"entity-type":e.unref(p.EntityTypes).Upstream,error:X.value,title:e.unref(n)("upstreams.delete.title"),visible:v.value,onCancel:j,onProceed:G},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),Z=(a,B)=>{const o=a.__vccOpts||a;for(const[s,n]of B)o[s]=n;return o},ut=Z(dt,[["__scopeId","data-v-fd5b2677"]]),be="/v2/control-planes/{controlPlaneId}/core-entities",Ce="/{workspace}",_e={list:{konnect:`${be}/upstreams/{upstreamId}/targets`,kongManager:`${Ce}/upstreams/{upstreamId}/targets`},form:{konnect:{create:`${be}/upstreams/{upstreamId}/targets`,edit:`${be}/upstreams/{upstreamId}/targets/{id}`},kongManager:{create:`${Ce}/upstreams/{upstreamId}/targets`,edit:`${Ce}/upstreams/{upstreamId}/targets/{id}`}}},ft={class:"kong-ui-entities-target-form"},pt={class:"target-form-container"},mt={key:0,class:"target-form-info"},yt={key:1,class:"failover-target"},Ue=Z(e.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""},failoverEnabled:{type:Boolean,required:!1,default:!1},failoverUnsupported:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading","cancel"],setup(a,{emit:B}){var K;const o=B,s=a,{i18n:{t:n}}=Y.useI18n(),{getMessageFromError:m}=p.useErrors(),{axiosInstance:f}=p.useAxios((K=s.config)==null?void 0:K.axiosRequestConfig),D=e.computed(()=>{var g;return _e.form[s.config.app].edit.replace(/{upstreamId}/gi,((g=s.config)==null?void 0:g.upstreamId)||"")}),w=e.computed(()=>s.targetId?p.EntityBaseFormType.Edit:p.EntityBaseFormType.Create),l=e.computed(()=>w.value===p.EntityBaseFormType.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),h=e.reactive({fields:{target:"",weight:100,tags:"",failover:!1},isReadonly:!1,errorMessage:""}),b=e.reactive({target:"",weight:100,tags:"",failover:!1}),u={target:"",weight:100,tags:""},t=e.computed(()=>{const g=parseInt(h.fields.weight.toString(),10);return g<0||g>65535}),F=e.computed(()=>JSON.stringify(h.fields)!==JSON.stringify(b)&&!!h.fields.target&&!!h.fields.weight&&!t.value),V=g=>{var N;h.fields.target=(g==null?void 0:g.target)||"",h.fields.weight=(g==null?void 0:g.weight)??"",h.fields.tags=((N=g==null?void 0:g.tags)==null?void 0:N.join(", "))||"",s.failoverEnabled&&(h.fields.failover=(g==null?void 0:g.failover)||!1),Object.assign(b,h.fields)},d=()=>{h.errorMessage="",o("cancel")},C=e.computed(()=>{var N,T,U,k;let g=`${s.config.apiBaseUrl}${_e.form[s.config.app][w.value]}`;return s.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((N=s.config)==null?void 0:N.controlPlaneId)||"").replace(/{upstreamId}/gi,((T=s.config)==null?void 0:T.upstreamId)||""):s.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(U=s.config)!=null&&U.workspace?`/${s.config.workspace}`:"").replace(/{upstreamId}/gi,((k=s.config)==null?void 0:k.upstreamId)||"")),g=g.replace(/{id}/gi,s.targetId),g}),A=e.computed(()=>{var g,N,T;return{target:h.fields.target,weight:parseInt(h.fields.weight),tags:(T=(N=(g=h.fields.tags)==null?void 0:g.split(","))==null?void 0:N.map(U=>String(U||"").trim()))==null?void 0:T.filter(U=>U!==""),upstream:{id:s.config.upstreamId},...s.failoverEnabled?{failover:h.fields.failover}:{}}}),E=async()=>{var g,N;try{h.isReadonly=!0,h.errorMessage="";let T;if(w.value==="create"?T=await f.post(C.value,A.value):w.value==="edit"&&(T=((g=s.config)==null?void 0:g.app)==="konnect"?await f.put(C.value,A.value):await f.patch(C.value,A.value)),T){const{data:U}=T;h.fields.target=(U==null?void 0:U.name)||"",h.fields.weight=(U==null?void 0:U.weight)??100,h.fields.tags=((N=U==null?void 0:U.tags)==null?void 0:N.join(", "))||"",o("update",U),Object.assign(h.fields,u)}}catch(T){h.errorMessage=m(T),o("error",T)}finally{h.isReadonly=!1}};return e.watch(()=>s.targetId,()=>{Object.assign(h.fields,u)}),(g,N)=>{const T=e.resolveComponent("KInput"),U=e.resolveComponent("KCheckbox"),k=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(k,{"action-button-disabled":!F.value||h.isReadonly,"action-button-text":e.unref(n)("targets.form.buttons.save"),"cancel-button-text":e.unref(n)("targets.form.buttons.cancel"),title:l.value,visible:a.isVisible,onCancel:d,onProceed:E},{default:e.withCtx(()=>[e.createElementVNode("div",ft,[e.createVNode(e.unref(p.EntityBaseForm),{config:a.config,"edit-id":a.targetId,"entity-type":e.unref(p.SupportedEntityType).Target,"error-message":h.errorMessage,"fetch-url":D.value,"form-fields":A.value,"is-readonly":h.isReadonly,onCancel:d,"onFetch:error":N[4]||(N[4]=H=>g.$emit("error",H)),"onFetch:success":V,onLoading:N[5]||(N[5]=H=>g.$emit("loading",H))},{default:e.withCtx(()=>[e.createElementVNode("div",pt,[g.$slots.info?(e.openBlock(),e.createElementBlock("div",mt,[e.renderSlot(g.$slots,"info",{},void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(T,{modelValue:h.fields.target,"onUpdate:modelValue":N[0]||(N[0]=H=>h.fields.target=H),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:e.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:e.unref(n)("targets.form.fields.target.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(n)("targets.form.fields.target.placeholder"),readonly:h.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),e.createVNode(T,{modelValue:h.fields.weight,"onUpdate:modelValue":N[1]||(N[1]=H=>h.fields.weight=H),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:t.value,"error-message":e.unref(n)("targets.errors.weight"),label:e.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:e.unref(n)("targets.form.fields.weight.tooltip"),tooltipAttributes:{maxWidth:"400"}},max:"65535",min:"0",readonly:h.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),a.failoverEnabled?(e.openBlock(),e.createElementBlock("div",yt,[e.createVNode(U,{modelValue:h.fields.failover,"onUpdate:modelValue":N[2]||(N[2]=H=>h.fields.failover=H),disabled:a.failoverUnsupported,label:e.unref(n)("targets.form.fields.failover.label"),"label-attributes":{info:a.failoverUnsupported?e.unref(n)("targets.form.fields.failover.unsupported"):e.unref(n)("targets.form.fields.failover.help")}},null,8,["modelValue","disabled","label","label-attributes"])])):e.createCommentVNode("",!0),e.createVNode(T,{modelValue:h.fields.tags,"onUpdate:modelValue":N[3]||(N[3]=H=>h.fields.tags=H),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:e.unref(n)("targets.form.fields.tags.help"),label:e.unref(n)("targets.form.fields.tags.label"),placeholder:e.unref(n)("targets.form.fields.tags.placeholder"),readonly:h.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-dc1948b7"]]),gt={class:"kong-ui-entities-targets-list"},kt={class:"target-address"},bt=Z(e.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||!a.upstreamId||a.app==="kongManager"&&(typeof a.canMarkHealthy>"u"||typeof a.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},failoverEnabled:{type:Boolean,default:!1},algorithm:{type:String,required:!1,default:""}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(a,{emit:B}){var Q;const o=B,s=a,{i18n:{t:n}}=Y.useI18n(),{axiosInstance:m}=p.useAxios((Q=s.config)==null?void 0:Q.axiosRequestConfig),f=e.computed(()=>s.config.app!=="kongManager"||!!s.config.disableSorting),w={target:{label:n("targets.list.table_headers.target_address"),sortable:!0,hidable:!1},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},...s.failoverEnabled?{failover:{label:n("targets.list.table_headers.target_type"),sortable:!1}}:{},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},l=e.computed(()=>{var O,y,S,x;let _=`${s.config.apiBaseUrl}${_e.list[s.config.app]}`;return s.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((O=s.config)==null?void 0:O.controlPlaneId)||"").replace(/{upstreamId}/gi,((y=s.config)==null?void 0:y.upstreamId)||""):s.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(S=s.config)!=null&&S.workspace?`/${s.config.workspace}`:"").replace(/{upstreamId}/gi,((x=s.config)==null?void 0:x.upstreamId)||"")),_}),{fetcher:h,fetcherState:b,fetcherCacheKey:u}=p.useFetcher(e.computed(()=>({...s.config,cacheIdentifier:s.cacheIdentifier})),l),t=()=>{u.value++},F=e.ref(null),V=()=>{q.value=!0},d=async(_,O)=>{const y=_.id;if(!await O(y)){o("copy:error",{entity:_,field:"id",message:n("targets.errors.copy")});return}o("copy:success",{entity:_,field:"id",message:n("targets.copy.success",{val:y})})},C=async(_,O)=>{const y=JSON.stringify(_);if(!await O(y)){o("copy:error",{entity:_,message:n("targets.errors.copy")});return}o("copy:success",{entity:_,message:n("targets.copy.success_brief")})},A=_=>{I.value=_,q.value=!0},E=_=>s.config.app==="konnect"?!1:s.config.canMarkHealthy(_),K=_=>s.config.app==="konnect"?!1:s.config.canMarkUnhealthy(_),g=e.ref(void 0),N=e.ref(!1),T=e.ref(!1),U=e.ref(""),k=p.useDeleteUrlBuilder(s.config,l.value),H=_=>{g.value=_,N.value=!0},P=()=>{N.value=!1},v=async()=>{var _,O,y;if((_=g.value)!=null&&_.id){T.value=!0;try{await m.delete(k(g.value.id)),T.value=!1,N.value=!1,u.value++,o("delete:success",g.value)}catch(S){U.value=((y=(O=S.response)==null?void 0:O.data)==null?void 0:y.message)||S.message||n("targets.errors.delete"),o("error",S)}finally{T.value=!1}}};e.watch(b,_=>{var O,y,S;if(_.status===p.FetcherStatus.Error){F.value={title:n("targets.errors.general")},(S=(y=(O=_.error)==null?void 0:O.response)==null?void 0:y.data)!=null&&S.message&&(F.value.message=_.error.response.data.message),o("error",_.error);return}F.value=null});const M=e.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${s.config.additionMessageForEmptyState?` ${s.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...s.config.createRoute&&{ctaPath:s.config.createRoute}});e.onBeforeMount(async()=>{await s.canCreate()&&(M.value.title=n("targets.list.empty_state.title"),M.value.ctaText=n("targets.actions.create"))});const X=e.computed(()=>({app:s.config.app,apiBaseUrl:s.config.apiBaseUrl,upstreamId:s.config.upstreamId,axiosRequestConfig:s.config.axiosRequestConfig,...s.config.app==="konnect"&&{controlPlaneId:s.config.controlPlaneId},...s.config.app==="kongManager"&&{workspace:s.config.workspace}})),I=e.ref(""),q=e.ref(!1),j=_=>{I.value?o("update:target",_):o("create:target",_),G()},G=()=>{J(),u.value++},J=()=>{q.value=!1,I.value=""};return(_,O)=>{const y=e.resolveComponent("KButton"),S=e.resolveComponent("KBadge"),x=e.resolveComponent("KDropdownItem"),R=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",gt,[e.createVNode(e.unref(p.EntityBaseTable),{"cache-identifier":a.cacheIdentifier,"disable-sorting":f.value,"empty-state-options":M.value,"enable-entity-actions":"","error-message":F.value,fetcher:e.unref(h),"fetcher-cache-key":e.unref(u),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":e.unref(w),onEmptyStateCtaClicked:O[1]||(O[1]=()=>s.config.createRoute?void 0:V()),onSort:t},e.createSlots({"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!a.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>a.canCreate()},{default:e.withCtx(()=>[e.createVNode(y,{appearance:"primary","data-testid":"toolbar-new-target",size:a.useActionOutside?"medium":"large",to:s.config.createRoute?s.config.createRoute:void 0,onClick:O[0]||(O[0]=()=>s.config.createRoute?void 0:V())},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:e.withCtx(({rowValue:c})=>[e.createElementVNode("span",kt,e.toDisplayString(c),1)]),tags:e.withCtx(({rowValue:c})=>[e.createVNode(e.unref(p.TableTags),{"tag-max-width":"auto",tags:c},null,8,["tags"])]),actions:e.withCtx(({row:c})=>[e.createVNode(R,null,{default:e.withCtx(({copyToClipboard:r})=>[e.createVNode(x,{"data-testid":"action-entity-copy-id",onClick:i=>d(c,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(R,null,{default:e.withCtx(({copyToClipboard:r})=>[e.createVNode(x,{"data-testid":"action-entity-copy-json",onClick:i=>C(c,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>a.canEdit(c)},{default:e.withCtx(()=>[e.createVNode(x,{"data-testid":"action-entity-edit","has-divider":"",onClick:r=>A(c.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>E(c)},{default:e.withCtx(()=>[e.createVNode(x,{"data-testid":"action-target-mark-healthy",onClick:r=>o("health-actions:healthy",c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>K(c)},{default:e.withCtx(()=>[e.createVNode(x,{"data-testid":"action-target-mark-unhealthy",onClick:r=>o("health-actions:unhealthy",c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>a.canDelete(c)},{default:e.withCtx(()=>[e.createVNode(x,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:r=>H(c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[a.failoverEnabled?{name:"failover",fn:e.withCtx(({rowValue:c})=>[e.createVNode(S,{appearance:"info",class:"upstream-failover"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c?e.unref(n)("targets.form.fields.failover.failover_target"):e.unref(n)("targets.form.fields.failover.load_balance_target")),1)]),_:2},1024)]),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers"]),e.createVNode(e.unref(p.EntityDeleteModal),{"action-pending":T.value,description:e.unref(n)("targets.delete.description"),"entity-type":e.unref(p.EntityTypes).Target,error:U.value,"need-confirm":!1,title:e.unref(n)("targets.delete.title"),visible:N.value,onCancel:P,onProceed:v},null,8,["action-pending","description","entity-type","error","title","visible"]),e.createVNode(Ue,{config:X.value,"failover-enabled":a.failoverEnabled,"failover-unsupported":a.failoverEnabled&&!e.unref(it).includes(a.algorithm),"is-visible":q.value,"target-id":I.value,onCancel:J,onUpdate:j},e.createSlots({_:2},[_.$slots["form-info"]?{name:"info",fn:e.withCtx(()=>[e.renderSlot(_.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","failover-enabled","failover-unsupported","is-visible","target-id"])])}}}),[["__scopeId","data-v-9fdfe77a"]]),Ct={key:1},_t=Z(e.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(a,{emit:B}){var P,v,M,X;const{i18nT:o,i18n:{t:s}}=Y.useI18n(),n=a,m=B,{debouncedQueryChange:f,loading:D,loadItems:w,results:l,allRecords:h}=p.useDebouncedFilter(n.config,(v=oe.form[(P=n.config)==null?void 0:P.app])==null?void 0:v.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:b,loading:u,loadItems:t,results:F}=p.useDebouncedFilter(n.config,(X=oe.form[(M=n.config)==null?void 0:M.app])==null?void 0:X.getCertificates),V=e.ref(""),d=e.computed(()=>{var I;return!!n.name&&!((I=h.value)!=null&&I.some(q=>q.host===n.name))}),C=e.computed(()=>{var q,j,G;const I=d.value&&n.name.includes((q=V.value)==null?void 0:q.toLowerCase());return(G=l.value)==null?void 0:G.map(J=>({label:J.host,value:J.id})).concat(I?[{label:n.name,value:((j=K.value)==null?void 0:j.value)||n.name}]:[])}),A=e.computed(()=>{var I;return(I=F.value)==null?void 0:I.map(q=>({label:q.id,value:q.id}))}),E=e.ref(""),K=e.ref({value:"",label:""}),g=e.computed(()=>{var I,q;return((I=C.value.find(j=>j.value===E.value))==null?void 0:I.label)||((q=K.value)==null?void 0:q.label)}),N=I=>{V.value=I,f(I)},T=I=>{K.value=I},U=()=>{K.value={value:"",label:""}},k=I=>{E.value=I,m("update:name",g.value)},H=e.ref(!1);return e.onBeforeMount(async()=>{var I,q;try{H.value=!0,await w(),n.name&&(E.value=((q=(I=C.value.find(j=>j.label===n.name))==null?void 0:I.value)==null?void 0:q.toString())||n.name),await t()}finally{H.value=!1}}),(I,q)=>{const j=e.resolveComponent("KSkeleton"),G=e.resolveComponent("KSelect"),J=e.resolveComponent("KInput");return e.openBlock(),e.createBlock(e.unref(p.EntityFormSection),{class:"kong-ui-entities-upstreams-general-info",description:e.unref(s)("upstreams.form.general_info.help"),title:e.unref(s)("upstreams.form.general_info.title")},{default:e.withCtx(()=>[H.value?(e.openBlock(),e.createBlock(j,{key:0,type:"form"})):(e.openBlock(),e.createElementBlock("div",Ct,[e.createVNode(G,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:C.value,label:e.unref(s)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},loading:e.unref(D),"model-value":E.value,placeholder:e.unref(s)("upstreams.form.fields.name.placeholder"),readonly:a.readonly,required:"",width:"100%",onItemAdded:T,onItemRemoved:U,onQueryChange:N,"onUpdate:modelValue":k},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),e.createVNode(J,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:e.unref(s)("upstreams.form.fields.host_header.label"),"model-value":a.hostHeader,readonly:a.readonly,type:"text","onUpdate:modelValue":q[0]||(q[0]=Q=>m("update:host-header",Q))},null,8,["label","model-value","readonly"]),e.createVNode(G,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:A.value,label:e.unref(s)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:e.unref(s)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"400"}},loading:e.unref(u),"model-value":a.clientCertificate,placeholder:e.unref(s)("upstreams.form.fields.client_certificate.placeholder"),readonly:a.readonly,width:"100%",onQueryChange:e.unref(b),"onUpdate:modelValue":q[1]||(q[1]=Q=>m("update:client-certificate",Q))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),e.createVNode(J,{autocomplete:"off","data-testid":"upstreams-form-tags",help:e.unref(s)("upstreams.form.fields.tags.help"),label:e.unref(s)("upstreams.form.fields.tags.label"),"label-attributes":{info:e.unref(s)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},"model-value":a.tags,placeholder:e.unref(s)("upstreams.form.fields.tags.placeholder"),readonly:a.readonly,type:"text","onUpdate:modelValue":q[2]||(q[2]=Q=>m("update:tags",Q))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-1a71740c"]]),me={upstreamObject:"https://developer.konghq.com/gateway/entities/upstream/",loadBalancing:"https://developer.konghq.com/gateway/traffic-control/load-balancing-reference/"},St={class:"fields-group-title"},Vt={class:"fields-group-text"},Nt={class:"fields-group-title"},wt={class:"fields-group-text"},xt=Z(e.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{stickySessionsAvailable:{type:Boolean,required:!1,default:!1},algorithm:{type:String,required:!0},stickySessionsCookie:{type:String,required:!0},stickySessionsCookiePath:{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:sticky-sessions-cookie","update:sticky-sessions-cookie-path","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(a,{emit:B}){const{i18nT:o,i18n:{t:s}}=Y.useI18n(),{inRange:n}=pe(),m=a,f=B,D=e.ref([{label:s("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:s("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:s("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:s("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1},...m.stickySessionsAvailable?[{label:s("upstreams.form.algorithms.sticky_sessions_label"),value:"sticky-sessions",selected:!1}]:[]]),w=e.ref([{label:s("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:s("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:s("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:s("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:s("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:s("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:s("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:s("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);e.watch(()=>m.hashOn,(b,u)=>{u==="header"&&b!==u&&f("update:hash-on-header",""),u==="cookie"&&b!==u&&(f("update:hash-on-cookie",""),f("update:hash-on-cookie-path","/")),u==="query_arg"&&b!==u&&f("update:hash-on-query-argument",""),u==="uri_capture"&&b!==u&&f("update:hash-on-uri-capture",""),(b==="cookie"||b==="none")&&(f("update:hash-fallback","none"),f("update:hash-fallback-header",""),f("update:hash-fallback-query-argument",""),f("update:hash-fallback-uri-capture",""))}),e.watch(()=>m.hashFallback,(b,u)=>{u==="header"&&b!==u&&f("update:hash-fallback-header",""),u==="cookie"&&b!==u&&(f("update:hash-on-cookie",""),f("update:hash-on-cookie-path","/")),u==="query_arg"&&b!==u&&f("update:hash-fallback-query-argument",""),u==="uri_capture"&&b!==u&&f("update:hash-fallback-uri-capture","")}),e.watch(()=>m.algorithm,b=>{b==="sticky-sessions"&&(f("update:slots","10000"),f("update:hash-on","none"),f("update:hash-fallback","none"),f("update:hash-on-header",""),f("update:hash-on-cookie",""),f("update:hash-on-cookie-path","/"),f("update:hash-on-query-argument",""),f("update:hash-on-uri-capture",""),f("update:hash-fallback-header",""),f("update:hash-fallback-query-argument",""),f("update:hash-fallback-uri-capture",""))},{immediate:!0});const l=e.computed(()=>m.hashOn==="cookie"||m.hashOn==="none"),h=e.computed(()=>m.slots?n(m.slots,ge,ke)?"":s("upstreams.form.errors.in_range"):"");return(b,u)=>{const t=e.resolveComponent("KExternalLink"),F=e.resolveComponent("KSelect"),V=e.resolveComponent("KInput"),d=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(p.EntityFormSection),{class:"kong-ui-entities-upstreams-load-balancing",title:e.unref(s)("upstreams.form.load_balancing.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.load_balancing.help"))+" ",1),e.createVNode(t,{"hide-icon":"",href:e.unref(me).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(F,{class:"algorithm-select",items:D.value,label:e.unref(s)("upstreams.form.fields.algorithm.label"),"model-value":a.algorithm,readonly:a.readonly,width:"100%","onUpdate:modelValue":u[0]||(u[0]=C=>f("update:algorithm",C))},null,8,["items","label","model-value","readonly"]),a.algorithm==="sticky-sessions"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(V,{autocomplete:"off","data-testid":"upstreams-form-sticky-sessions-cookie",label:e.unref(s)("upstreams.form.fields.sticky_sessions_cookie.label"),"label-attributes":{info:e.unref(s)("upstreams.form.fields.sticky_sessions_cookie.tooltip"),tooltipAttributes:{maxWidth:"400"}},"model-value":a.stickySessionsCookie,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[1]||(u[1]=C=>f("update:sticky-sessions-cookie",C))},null,8,["label","label-attributes","model-value","readonly"]),e.createVNode(V,{autocomplete:"off","data-testid":"upstreams-form-sticky-sessions-cookie-path",label:e.unref(s)("upstreams.form.fields.sticky_sessions_cookie_path.label"),"label-attributes":{info:e.unref(s)("upstreams.form.fields.sticky_sessions_cookie_path.tooltip"),tooltipAttributes:{maxWidth:"400"}},"model-value":a.stickySessionsCookiePath,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[2]||(u[2]=C=>f("update:sticky-sessions-cookie-path",C))},null,8,["label","label-attributes","model-value","readonly"])],64)):e.createCommentVNode("",!0),a.algorithm!=="sticky-sessions"?(e.openBlock(),e.createBlock(V,{key:1,autocomplete:"off","data-testid":"upstreams-form-slots",error:!!h.value,"error-message":h.value,help:e.unref(s)("upstreams.form.fields.slots.help"),label:e.unref(s)("upstreams.form.fields.slots.label"),max:e.unref(ke),min:e.unref(ge),"model-value":a.slots,readonly:a.readonly,type:"number","onUpdate:modelValue":u[3]||(u[3]=C=>f("update:slots",C))},null,8,["error","error-message","help","label","max","min","model-value","readonly"])):e.createCommentVNode("",!0),a.algorithm!=="sticky-sessions"?(e.openBlock(),e.createBlock(d,{key:2},{default:e.withCtx(()=>[e.createElementVNode("h5",St,e.toDisplayString(e.unref(s)("upstreams.form.fields.hash_on.label")),1),e.createElementVNode("p",Vt,e.toDisplayString(e.unref(s)("upstreams.form.fields.hash_on.help")),1),e.createVNode(F,{class:"hash-on-select",items:w.value,label:e.unref(s)("upstreams.form.fields.hash_on.label"),"model-value":a.hashOn,readonly:a.readonly,width:"100%","onUpdate:modelValue":u[4]||(u[4]=C=>f("update:hash-on",C))},null,8,["items","label","model-value","readonly"]),a.hashOn==="header"?(e.openBlock(),e.createBlock(V,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:e.unref(s)("upstreams.form.fields.header.label"),"model-value":a.hashOnHeader,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[5]||(u[5]=C=>f("update:hash-on-header",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashOn==="cookie"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(V,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:e.unref(s)("upstreams.form.fields.cookie.label"),"model-value":a.hashOnCookie,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[6]||(u[6]=C=>f("update:hash-on-cookie",C))},null,8,["label","model-value","readonly"]),e.createVNode(V,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:e.unref(s)("upstreams.form.fields.cookie_path.label"),"model-value":a.hashOnCookiePath,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[7]||(u[7]=C=>f("update:hash-on-cookie-path",C))},null,8,["label","model-value","readonly"])],64)):e.createCommentVNode("",!0),a.hashOn==="query_arg"?(e.openBlock(),e.createBlock(V,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:e.unref(s)("upstreams.form.fields.query_argument.label"),"model-value":a.hashOnQueryArgument,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[8]||(u[8]=C=>f("update:hash-on-query-argument",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashOn==="uri_capture"?(e.openBlock(),e.createBlock(V,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:e.unref(s)("upstreams.form.fields.uri_capture.label"),"model-value":a.hashOnUriCapture,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[9]||(u[9]=C=>f("update:hash-on-uri-capture",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),a.algorithm!=="sticky-sessions"?(e.openBlock(),e.createBlock(d,{key:3},{default:e.withCtx(()=>[e.createElementVNode("h5",Nt,e.toDisplayString(e.unref(s)("upstreams.form.fields.hash_fallback.label")),1),e.createElementVNode("p",wt,e.toDisplayString(e.unref(s)("upstreams.form.fields.hash_fallback.help")),1),e.createVNode(F,{class:"hash-fallback-select",disabled:l.value,items:w.value,label:e.unref(s)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},"model-value":a.hashFallback,readonly:a.readonly,width:"100%","onUpdate:modelValue":u[10]||(u[10]=C=>f("update:hash-fallback",C))},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(o),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),a.hashFallback==="header"?(e.openBlock(),e.createBlock(V,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:e.unref(s)("upstreams.form.fields.header.label"),"model-value":a.hashFallbackHeader,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[11]||(u[11]=C=>f("update:hash-fallback-header",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashFallback==="cookie"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(V,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:e.unref(s)("upstreams.form.fields.cookie.label"),"model-value":a.hashOnCookie,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[12]||(u[12]=C=>f("update:hash-on-cookie",C))},null,8,["label","model-value","readonly"]),e.createVNode(V,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:e.unref(s)("upstreams.form.fields.cookie_path.label"),"model-value":a.hashOnCookiePath,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[13]||(u[13]=C=>f("update:hash-on-cookie-path",C))},null,8,["label","model-value","readonly"])],64)):e.createCommentVNode("",!0),a.hashFallback==="query_arg"?(e.openBlock(),e.createBlock(V,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:e.unref(s)("upstreams.form.fields.query_argument.label"),"model-value":a.hashFallbackQueryArgument,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[14]||(u[14]=C=>f("update:hash-fallback-query-argument",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashFallback==="uri_capture"?(e.openBlock(),e.createBlock(V,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:e.unref(s)("upstreams.form.fields.uri_capture.label"),"model-value":a.hashFallbackUriCapture,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":u[15]||(u[15]=C=>f("update:hash-fallback-uri-capture",C))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["title"])}}}),[["__scopeId","data-v-656aa4f4"]]),Ht={class:"fields-group-title"},Tt={class:"fields-group-text"},Ut={class:"fields-group-title"},It={class:"fields-group-text"},qt=Z(e.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(a,{emit:B}){const{i18n:{t:o}}=Y.useI18n(),s=B;return(n,m)=>{const f=e.resolveComponent("KExternalLink"),D=e.resolveComponent("KInputSwitch"),w=e.resolveComponent("KCard"),l=e.resolveComponent("KInput");return e.openBlock(),e.createBlock(e.unref(p.EntityFormSection),{class:"kong-ui-entities-upstreams-healthchecks",title:e.unref(o)("upstreams.form.health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.health_check.help"))+" ",1),e.createVNode(f,{"hide-icon":"",href:e.unref(me).loadBalancing},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Ht,e.toDisplayString(e.unref(o)("upstreams.form.fields.active_health_checks.label")),1),e.createElementVNode("p",Tt,e.toDisplayString(e.unref(o)("upstreams.form.fields.active_health_checks.help")),1),e.createVNode(D,{class:"active-health-switch","data-testid":"active-health-switch",disabled:a.readonly,"model-value":a.activeHealthSwitch,onChange:m[0]||(m[0]=h=>s("update:active-health-switch",h))},null,8,["disabled","model-value"])]),_:1}),e.createVNode(w,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Ut,e.toDisplayString(e.unref(o)("upstreams.form.fields.passive_health_checks.label")),1),e.createElementVNode("p",It,e.toDisplayString(e.unref(o)("upstreams.form.fields.passive_health_checks.help")),1),e.createVNode(D,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:a.readonly,"model-value":a.passiveHealthSwitch,onChange:m[1]||(m[1]=h=>s("update:passive-health-switch",h))},null,8,["disabled","model-value"])]),_:1}),e.createVNode(l,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:e.unref(o)("upstreams.form.fields.healthchecks_threshold.label"),max:e.unref(at),min:e.unref(tt),"model-value":a.healthchecksThreshold,readonly:a.readonly,type:"number","onUpdate:modelValue":m[2]||(m[2]=h=>s("update:healthchecks-threshold",h))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-c2ff95ff"]]),Ft="#d60027",Et={class:"fields-group-title"},Bt={class:"fields-group-text"},Ot={class:"fields-group-title"},Dt={class:"fields-group-text"},Pt=Z(e.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},healthyInterval:{type:String,required:!0},healthySuccesses:{type:String,required:!0},healthyHttpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},unhealthyHttpFailures:{type:String,required:!0},unhealthyTcpFailures:{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:healthy-interval","update:healthy-successes","update:healthy-http-statuses","update:unhealthy-interval","update:unhealthy-http-failures","update:unhealthy-tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(a,{emit:B}){const{i18n:{t:o}}=Y.useI18n(),{objectsAreEqual:s}=pe(),n=a,m=B,f=e.ref([{label:o("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),D=e.computed(()=>n.type==="https"||n.type==="grpcs"),w=e.computed(()=>n.type==="tcp"),{trackNewItems:l}=re({replaceId:!0}),{trackNewItems:h}=re({replaceId:!0});e.watch(()=>n.type,(V,d)=>{d==="tcp"&&V!==d&&m("update:unhealthy-tcp-failures","5"),(d==="https"||d==="grpcs")&&V!==d&&(m("update:https-sni",""),m("update:verify-ssl",!1)),d!=="tcp"&&V==="tcp"&&(m("update:http-path","/"),m("update:healthy-http-statuses",ce),m("update:unhealthy-http-statuses",ue))});const b=e.ref([{key:"",values:""}]);e.watch(()=>n.headers,V=>{s(b.value,V)||(b.value=[...V])},{immediate:!0,deep:!0});const u=()=>{m("update:headers",b.value)},t=()=>{b.value.push({key:"",values:""}),u()},F=V=>{V===0&&b.value.length===1?b.value[0]={key:"",values:""}:b.value.splice(V,1),u()};return(V,d)=>{const C=e.resolveComponent("KExternalLink"),A=e.resolveComponent("KSelect"),E=e.resolveComponent("KInput"),K=e.resolveComponent("KCheckbox"),g=e.resolveComponent("KLabel"),N=e.resolveComponent("KButton"),T=e.resolveComponent("KMultiselect"),U=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(p.EntityFormSection),{class:"kong-ui-entities-upstreams-active-healthcheck",title:e.unref(o)("upstreams.form.active_health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.active_health_check.help"))+" ",1),e.createVNode(C,{"hide-icon":"",href:e.unref(me).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(A,{class:"active-healthcheck-type-select",items:f.value,label:e.unref(o)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":a.type,readonly:a.readonly,width:"100%","onUpdate:modelValue":d[0]||(d[0]=k=>m("update:type",k))},null,8,["items","label","model-value","readonly"]),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:e.unref(o)("upstreams.form.fields.http_path.label"),"model-value":a.httpPath,readonly:a.readonly,type:"text","onUpdate:modelValue":d[1]||(d[1]=k=>m("update:http-path",k))},null,8,["label","model-value","readonly"])),e.createVNode(E,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:e.unref(o)("upstreams.form.fields.timeout.label"),max:e.unref(st),min:e.unref(lt),"model-value":a.timeout,readonly:a.readonly,type:"number","onUpdate:modelValue":d[2]||(d[2]=k=>m("update:timeout",k))},null,8,["label","max","min","model-value","readonly"]),e.createVNode(E,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:e.unref(o)("upstreams.form.fields.concurrency.label"),max:e.unref(rt),min:e.unref(ot),"model-value":a.concurrency,readonly:a.readonly,type:"number","onUpdate:modelValue":d[3]||(d[3]=k=>m("update:concurrency",k))},null,8,["label","max","min","model-value","readonly"]),D.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(E,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:e.unref(o)("upstreams.form.fields.https_sni.label"),"model-value":a.httpsSni,readonly:a.readonly,type:"text","onUpdate:modelValue":d[4]||(d[4]=k=>m("update:https-sni",k))},null,8,["label","model-value","readonly"]),e.createVNode(K,{"data-testid":"active-healthcheck-verify-ssl",disabled:a.readonly,label:e.unref(o)("upstreams.form.fields.verify_ssl.label"),"model-value":a.verifySsl,"onUpdate:modelValue":d[5]||(d[5]=k=>m("update:verify-ssl",k))},null,8,["disabled","label","model-value"])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createVNode(g,{info:e.unref(o)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(k,H)=>(e.openBlock(),e.createElementBlock("div",{key:`${k.header}_${H}`,class:e.normalizeClass(["headers-row",{"margin-top-6":H>0}])},[e.createVNode(E,{modelValue:b.value[H].key,"onUpdate:modelValue":P=>b.value[H].key=P,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${H+1}`,readonly:a.readonly,type:"text",onBlur:u},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),e.createVNode(E,{modelValue:b.value[H].values,"onUpdate:modelValue":P=>b.value[H].values=P,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${H+1}`,readonly:a.readonly,type:"text",onBlur:u},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),e.createVNode(N,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",disabled:b.value.length===1,icon:"",onClick:P=>F(H)},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.TrashIcon),{class:"delete-item",color:b.value.length>1?e.unref(Ft):void 0},null,8,["color"])]),_:2},1032,["disabled","onClick"]),b.value&&H===b.value.length-1?(e.openBlock(),e.createBlock(N,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",icon:"",onClick:t},{default:e.withCtx(()=>[e.createVNode(e.unref(ee.AddIcon))]),_:1})):e.createCommentVNode("",!0)],2))),128))])]),e.createVNode(U,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Et,e.toDisplayString(e.unref(o)("upstreams.form.healthy.label")),1),e.createElementVNode("p",Bt,e.toDisplayString(e.unref(o)("upstreams.form.healthy.help")),1),e.createVNode(E,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-healthy-interval",help:e.unref(o)("upstreams.form.fields.interval.help"),label:e.unref(o)("upstreams.form.fields.interval.label"),max:e.unref(Te),min:e.unref(He),"model-value":a.healthyInterval,readonly:a.readonly,type:"number","onUpdate:modelValue":d[6]||(d[6]=k=>m("update:healthy-interval",k))},null,8,["help","label","max","min","model-value","readonly"]),e.createVNode(E,{autocomplete:"off","data-testid":"active-healthcheck-healthy-successes",label:e.unref(o)("upstreams.form.fields.successes.label"),max:e.unref(se),min:e.unref(le),"model-value":a.healthySuccesses,readonly:a.readonly,type:"number","onUpdate:modelValue":d[7]||(d[7]=k=>m("update:healthy-successes",k))},null,8,["label","max","min","model-value","readonly"]),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-healthy-http-statuses","data-testid":"active-healthcheck-healthy-http-statuses","enable-item-creation":"",items:e.unref(he),label:e.unref(o)("upstreams.form.fields.http_statuses.label"),"model-value":a.healthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:d[8]||(d[8]=k=>e.unref(l)(k,!0)),onItemRemoved:d[9]||(d[9]=k=>e.unref(l)(k,!1)),"onUpdate:modelValue":d[10]||(d[10]=k=>m("update:healthy-http-statuses",k))},null,8,["items","label","model-value","readonly"]))]),_:1}),e.createVNode(U,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Ot,e.toDisplayString(e.unref(o)("upstreams.form.unhealthy.label")),1),e.createElementVNode("p",Dt,e.toDisplayString(e.unref(o)("upstreams.form.unhealthy.help")),1),e.createVNode(E,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:e.unref(o)("upstreams.form.fields.interval.help"),label:e.unref(o)("upstreams.form.fields.interval.label"),max:e.unref(Te),min:e.unref(He),"model-value":a.unhealthyInterval,readonly:a.readonly,type:"number","onUpdate:modelValue":d[11]||(d[11]=k=>m("update:unhealthy-interval",k))},null,8,["help","label","max","min","model-value","readonly"]),e.createVNode(E,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-tcp-failures",label:e.unref(o)("upstreams.form.fields.tcp_failures.label"),max:e.unref(se),min:e.unref(le),"model-value":a.unhealthyTcpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":d[12]||(d[12]=k=>m("update:unhealthy-tcp-failures",k))},null,8,["label","max","min","model-value","readonly"]),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-http-failures",label:e.unref(o)("upstreams.form.fields.http_failures.label"),max:e.unref(se),min:e.unref(le),"model-value":a.unhealthyHttpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":d[13]||(d[13]=k=>m("update:unhealthy-http-failures",k))},null,8,["label","max","min","model-value","readonly"])),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(T,{key:1,autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","data-testid":"active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:e.unref(he),label:e.unref(o)("upstreams.form.fields.http_statuses.label"),"model-value":a.unhealthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:d[14]||(d[14]=k=>e.unref(h)(k,!0)),onItemRemoved:d[15]||(d[15]=k=>e.unref(h)(k,!1)),"onUpdate:modelValue":d[16]||(d[16]=k=>m("update:unhealthy-http-statuses",k))},null,8,["items","label","model-value","readonly"])),e.createVNode(E,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:e.unref(o)("upstreams.form.fields.timeouts.label"),max:e.unref(xe),min:e.unref(we),"model-value":a.unhealthyTimeouts,readonly:a.readonly,type:"number","onUpdate:modelValue":d[17]||(d[17]=k=>m("update:unhealthy-timeouts",k))},null,8,["label","max","min","model-value","readonly"])]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-cfc70316"]]),$t={class:"fields-group-title"},At={class:"fields-group-text"},Mt={class:"fields-group-title"},Kt={class:"fields-group-text"},Rt=Z(e.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},healthySuccesses:{type:String,required:!0},healthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},unhealthyHttpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:healthy-successes","update:healthy-http-statuses","update:unhealthy-timeouts","update:unhealthy-http-failures","update:unhealthy-http-statuses","update:unhealthy-tcp-failures"],setup(a,{emit:B}){const{i18n:{t:o}}=Y.useI18n(),s=a,n=B,m=e.ref([{label:o("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:o("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),f=e.computed(()=>s.type==="tcp"),{trackNewItems:D}=re({replaceId:!0}),{trackNewItems:w}=re({replaceId:!0});return e.watch(()=>s.type,(l,h)=>{h==="tcp"&&l!==h&&n("update:unhealthy-tcp-failures","5"),h!=="tcp"&&l==="tcp"&&(n("update:healthy-http-statuses",de),n("update:unhealthy-http-statuses",fe))}),(l,h)=>{const b=e.resolveComponent("KExternalLink"),u=e.resolveComponent("KSelect"),t=e.resolveComponent("KInput"),F=e.resolveComponent("KMultiselect"),V=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(p.EntityFormSection),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:e.unref(o)("upstreams.form.passive_health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.passive_health_check.help"))+" ",1),e.createVNode(b,{"hide-icon":"",href:e.unref(me).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(u,{class:"passive-healthcheck-type-select",items:m.value,label:e.unref(o)("upstreams.form.fields.passive_health_check_type.label"),"model-value":a.type,readonly:a.readonly,width:"100%","onUpdate:modelValue":h[0]||(h[0]=d=>n("update:type",d))},null,8,["items","label","model-value","readonly"]),e.createVNode(V,null,{default:e.withCtx(()=>[e.createElementVNode("h5",$t,e.toDisplayString(e.unref(o)("upstreams.form.passive_healthy.label")),1),e.createElementVNode("p",At,e.toDisplayString(e.unref(o)("upstreams.form.passive_healthy.help")),1),e.createVNode(t,{autocomplete:"off","data-testid":"passive-healthcheck-healthy-successes",label:e.unref(o)("upstreams.form.fields.successes.label"),max:e.unref(se),min:e.unref(le),"model-value":a.healthySuccesses,readonly:a.readonly,type:"number","onUpdate:modelValue":h[1]||(h[1]=d=>n("update:healthy-successes",d))},null,8,["label","max","min","model-value","readonly"]),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(F,{key:0,class:"margin-top-6 passive-healthcheck-healthy-http-statuses","enable-item-creation":"",items:e.unref(he),label:e.unref(o)("upstreams.form.fields.http_statuses.label"),"model-value":a.healthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:h[2]||(h[2]=d=>e.unref(D)(d,!0)),onItemRemoved:h[3]||(h[3]=d=>e.unref(D)(d,!1)),"onUpdate:modelValue":h[4]||(h[4]=d=>n("update:healthy-http-statuses",d))},null,8,["items","label","model-value","readonly"]))]),_:1}),e.createVNode(V,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Mt,e.toDisplayString(e.unref(o)("upstreams.form.passive_unhealthy.label")),1),e.createElementVNode("p",Kt,e.toDisplayString(e.unref(o)("upstreams.form.passive_unhealthy.help")),1),e.createVNode(t,{autocomplete:"off","data-testid":"passive-healthcheck-unhealthy-timeouts",label:e.unref(o)("upstreams.form.fields.timeouts.label"),max:e.unref(xe),min:e.unref(we),"model-value":a.unhealthyTimeouts,readonly:a.readonly,type:"number","onUpdate:modelValue":h[5]||(h[5]=d=>n("update:unhealthy-timeouts",d))},null,8,["label","max","min","model-value","readonly"]),e.createVNode(t,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-unhealthy-tcp-failures",label:e.unref(o)("upstreams.form.fields.tcp_failures.label"),max:e.unref(se),min:e.unref(le),"model-value":a.unhealthyTcpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":h[6]||(h[6]=d=>n("update:unhealthy-tcp-failures",d))},null,8,["label","max","min","model-value","readonly"]),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(t,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-unhealthy-http-failures",label:e.unref(o)("upstreams.form.fields.http_failures.label"),max:e.unref(se),min:e.unref(le),"model-value":a.unhealthyHttpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":h[7]||(h[7]=d=>n("update:unhealthy-http-failures",d))},null,8,["label","max","min","model-value","readonly"])),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(F,{key:1,autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","data-testid":"passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:e.unref(he),label:e.unref(o)("upstreams.form.fields.http_statuses.label"),"model-value":a.unhealthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:h[8]||(h[8]=d=>e.unref(w)(d,!0)),onItemRemoved:h[9]||(h[9]=d=>e.unref(w)(d,!1)),"onUpdate:modelValue":h[10]||(h[10]=d=>n("update:unhealthy-http-statuses",d))},null,8,["items","label","model-value","readonly"]))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-7c20c5c5"]]),Lt={class:"kong-ui-entities-upstreams-form"},jt=Z(e.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||(a==null?void 0:a.app)==="konnect"&&!(a!=null&&a.controlPlaneId)||(a==null?void 0:a.app)==="kongManager"&&typeof(a==null?void 0:a.workspace)!="string"||!(a!=null&&a.cancelRoute))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(a,{emit:B}){var R;const o=a,s=B,{inRange:n,stringToNumberArray:m,upstreamsResponseToFields:f,getDefaultUpstreamFields:D,objectsAreEqual:w,cloneDeep:l}=pe(),{axiosInstance:h}=p.useAxios((R=o.config)==null?void 0:R.axiosRequestConfig),{getMessageFromError:b}=p.useErrors(),u=Ve.useRouter(),t=e.reactive({fields:D(),readonly:!1,errorMessage:""}),F=e.reactive(D()),V=e.computed(()=>!w(t.fields,F)),d=c=>{t.fields.activeHealthCheck.healthy.interval=c?"5":"0",t.fields.activeHealthCheck.healthy.successes=c?"5":"0",t.fields.activeHealthCheck.healthy.httpStatuses=c?ce:[],t.fields.activeHealthCheck.unhealthy.httpStatuses=c?ue:[],t.fields.activeHealthCheck.unhealthy.httpFailures=c?"5":"0",t.fields.activeHealthCheck.unhealthy.interval=c?"5":"0",t.fields.activeHealthCheck.unhealthy.tcpFailures=c?"5":"0",t.fields.activeHealthCheck.unhealthy.timeouts=c?"5":"0",t.fields.activeHealthCheck.timeout=c?"1":"0",t.fields.activeHealthCheck.concurrency=c?"10":"0",t.fields.activeHealthCheck.httpPath=c?"/":"",t.fields.activeHealthCheck.httpsSni="",t.fields.activeHealthCheck.type="http"},C=c=>{t.fields.passiveHealthCheck.healthy.successes=c?"80":"0",t.fields.passiveHealthCheck.healthy.httpStatuses=c?de:[],t.fields.passiveHealthCheck.unhealthy.timeouts=c?"5":"0",t.fields.passiveHealthCheck.unhealthy.tcpFailures=c?"5":"0",t.fields.passiveHealthCheck.unhealthy.httpFailures=c?"5":"0",t.fields.passiveHealthCheck.unhealthy.httpStatuses=c?fe:[],t.fields.passiveHealthCheck.type="http"},A=e.computed(()=>t.fields.algorithm!=="sticky-sessions"?!0:!!t.fields.stickySessionsCookie&&!!t.fields.stickySessionsCookiePath),E=e.computed(()=>t.fields.slots?n(t.fields.slots,ge,ke):!0),K=e.computed(()=>t.fields.hashOn==="header"?!!t.fields.hashOnHeader:!0),g=e.computed(()=>t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie"?!!t.fields.hashOnCookie:!0),N=e.computed(()=>t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie"?!!t.fields.hashOnCookiePath:!0),T=e.computed(()=>t.fields.hashOn==="query_arg"?!!t.fields.hashOnQueryArgument:!0),U=e.computed(()=>t.fields.hashOn==="uri_capture"?!!t.fields.hashOnUriCapture:!0),k=e.computed(()=>t.fields.hashFallback==="header"?!!t.fields.hashFallbackHeader:!0),H=e.computed(()=>t.fields.hashFallback==="query_arg"?!!t.fields.hashFallbackQueryArgument:!0),P=e.computed(()=>t.fields.hashFallback==="uri_capture"?!!t.fields.hashFallbackUriCapture:!0),v=e.computed(()=>!!t.fields.name&&A.value&&E.value&&K.value&&g.value&&N.value&&T.value&&U.value&&k.value&&H.value&&P.value),M=e.computed(()=>o.upstreamId?p.EntityBaseFormType.Edit:p.EntityBaseFormType.Create),X=e.computed(()=>{var c,r;return(r=oe.form[(c=o.config)==null?void 0:c.app])==null?void 0:r.edit}),I=c=>{Object.assign(t.fields,f(c)),Object.assign(F,l(t.fields))},q=()=>{var c;u.push(((c=o.config)==null?void 0:c.cancelRoute)||{name:"upstreams-list"})},j=c=>{s("loading",c)},G=c=>{s("error",c)},J=e.computed(()=>{const c=o.config.stickySessionsAvailable?{sticky_sessions_cookie:null,sticky_sessions_cookie_path:null}:{};return t.fields.algorithm==="sticky-sessions"&&(c.sticky_sessions_cookie=t.fields.stickySessionsCookie||null,c.sticky_sessions_cookie_path=t.fields.stickySessionsCookiePath||null),c}),Q=e.computed(()=>{const c={};return t.fields.hashOn==="header"&&(c.hash_on_header=t.fields.hashOnHeader),(t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie")&&(c.hash_on_cookie=t.fields.hashOnCookie,c.hash_on_cookie_path=t.fields.hashOnCookiePath),t.fields.hashOn==="query_arg"&&(c.hash_on_query_arg=t.fields.hashOnQueryArgument),t.fields.hashOn==="uri_capture"&&(c.hash_on_uri_capture=t.fields.hashOnUriCapture),t.fields.hashFallback==="header"&&(c.hash_fallback_header=t.fields.hashFallbackHeader),t.fields.hashFallback==="query_arg"&&(c.hash_fallback_query_arg=t.fields.hashFallbackQueryArgument),t.fields.hashFallback==="uri_capture"&&(c.hash_fallback_uri_capture=t.fields.hashFallbackUriCapture),c}),_=e.computed(()=>{var r,i,$;if(!t.fields.activeHealthSwitch)return((r=o.config)==null?void 0:r.app)==="kongManager"&&M.value===p.EntityBaseFormType.Edit?{type:t.fields.activeHealthCheck.type,headers:{},healthy:{interval:0,successes:0},unhealthy:{interval:0,http_failures:0,tcp_failures:0,timeouts:0}}:void 0;const c={type:t.fields.activeHealthCheck.type,healthy:{interval:Number(t.fields.activeHealthCheck.healthy.interval||"0"),successes:Number(t.fields.activeHealthCheck.healthy.successes||"0")},unhealthy:{interval:Number(t.fields.activeHealthCheck.unhealthy.interval||"0"),timeouts:Number(t.fields.activeHealthCheck.unhealthy.timeouts||"0"),tcp_failures:Number(t.fields.activeHealthCheck.unhealthy.tcpFailures||"0")},timeout:Number(t.fields.activeHealthCheck.timeout||"1"),concurrency:Number(t.fields.activeHealthCheck.concurrency||"10")};if(t.fields.activeHealthCheck.type!=="tcp"){c.http_path=t.fields.activeHealthCheck.httpPath||"/",c.unhealthy.http_failures=Number(t.fields.activeHealthCheck.unhealthy.httpFailures||"5");const L=(i=t.fields.activeHealthCheck.unhealthy.httpStatuses)!=null&&i.length?t.fields.activeHealthCheck.unhealthy.httpStatuses:ue;c.unhealthy.http_statuses=m(L);const z=($=t.fields.activeHealthCheck.healthy.httpStatuses)!=null&&$.length?t.fields.activeHealthCheck.healthy.httpStatuses:ce;c.healthy.http_statuses=m(z)}return["https","grpcs"].includes(t.fields.activeHealthCheck.type)&&(c.https_sni=t.fields.activeHealthCheck.httpsSni||null,c.https_verify_certificate=t.fields.activeHealthCheck.verifySsl),c.headers=t.fields.activeHealthCheck.headers.reduce((L,z)=>{var te,ae;return z.key?{...L,[z.key]:(ae=(te=z.values.split(","))==null?void 0:te.map(ye=>ye.trim()))==null?void 0:ae.filter(Boolean)}:L},{}),c}),O=e.computed(()=>{var r,i,$;if(!t.fields.passiveHealthSwitch)return((r=o.config)==null?void 0:r.app)==="kongManager"&&M.value===p.EntityBaseFormType.Edit?{type:t.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}:void 0;const c={type:t.fields.passiveHealthCheck.type,healthy:{successes:Number(t.fields.passiveHealthCheck.healthy.successes||"0")},unhealthy:{timeouts:Number(t.fields.passiveHealthCheck.unhealthy.timeouts||"0"),tcp_failures:Number(t.fields.passiveHealthCheck.unhealthy.tcpFailures||"5")}};if(t.fields.passiveHealthCheck.type!=="tcp"){c.unhealthy.http_failures=Number(t.fields.passiveHealthCheck.unhealthy.httpFailures||"5");const L=(i=t.fields.passiveHealthCheck.healthy.httpStatuses)!=null&&i.length?t.fields.passiveHealthCheck.healthy.httpStatuses:de;c.healthy.http_statuses=m(L);const z=($=t.fields.passiveHealthCheck.unhealthy.httpStatuses)!=null&&$.length?t.fields.passiveHealthCheck.unhealthy.httpStatuses:fe;c.unhealthy.http_statuses=m(z)}return c}),y=e.computed(()=>{const c={name:t.fields.name,slots:Number(t.fields.slots),algorithm:t.fields.algorithm,hash_on:t.fields.hashOn,hash_fallback:t.fields.hashFallback,healthchecks:{threshold:Number(t.fields.healthchecksThreshold||"0")},host_header:t.fields.hostHeader||null,client_certificate:t.fields.clientCertificate?{id:t.fields.clientCertificate}:null},r=_.value,i=O.value,$={...c,...J.value,healthchecks:{...c.healthchecks,active:r||void 0,passive:i||void 0}};return $.tags=t.fields.tags?t.fields.tags.split(",").map(L=>String(L||"").trim()).filter(L=>L!==""):[],Object.assign($,Q.value),$}),S=c=>{var i,$,L,z,te,ae;let r=`${(i=o.config)==null?void 0:i.apiBaseUrl}${oe.form[($=o.config)==null?void 0:$.app][c]}`;return((L=o.config)==null?void 0:L.app)==="konnect"?r=r.replace(/{controlPlaneId}/gi,((z=o.config)==null?void 0:z.controlPlaneId)||""):((te=o.config)==null?void 0:te.app)==="kongManager"&&(r=r.replace(/\/{workspace}/gi,(ae=o.config)!=null&&ae.workspace?`/${o.config.workspace}`:"")),r=r.replace(/{id}/gi,o.upstreamId),r},x=async()=>{var c;try{t.readonly=!0;let r;M.value===p.EntityBaseFormType.Create?r=await h.post(S("create"),y.value):M.value===p.EntityBaseFormType.Edit&&(r=((c=o.config)==null?void 0:c.app)==="konnect"?await h.put(S("edit"),y.value):await h.patch(S("edit"),y.value)),s("update",r==null?void 0:r.data)}catch(r){t.errorMessage=b(r),s("error",r)}finally{t.readonly=!1}};return(c,r)=>(e.openBlock(),e.createElementBlock("div",Lt,[e.createVNode(e.unref(p.EntityBaseForm),{"can-submit":v.value&&V.value,config:a.config,"edit-id":a.upstreamId,"entity-type":e.unref(p.SupportedEntityType).Upstream,"error-message":t.errorMessage,"fetch-url":X.value,"form-fields":y.value,"is-readonly":t.readonly,onCancel:q,"onFetch:error":G,"onFetch:success":I,onLoading:j,onSubmit:x},{default:e.withCtx(()=>[e.createVNode(_t,{"client-certificate":t.fields.clientCertificate,"onUpdate:clientCertificate":r[0]||(r[0]=i=>t.fields.clientCertificate=i),"host-header":t.fields.hostHeader,"onUpdate:hostHeader":r[1]||(r[1]=i=>t.fields.hostHeader=i),name:t.fields.name,"onUpdate:name":r[2]||(r[2]=i=>t.fields.name=i),tags:t.fields.tags,"onUpdate:tags":r[3]||(r[3]=i=>t.fields.tags=i),config:a.config,readonly:t.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),e.createVNode(xt,{algorithm:t.fields.algorithm,"onUpdate:algorithm":r[4]||(r[4]=i=>t.fields.algorithm=i),"hash-fallback":t.fields.hashFallback,"onUpdate:hashFallback":r[5]||(r[5]=i=>t.fields.hashFallback=i),"hash-fallback-header":t.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":r[6]||(r[6]=i=>t.fields.hashFallbackHeader=i),"hash-fallback-query-argument":t.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":r[7]||(r[7]=i=>t.fields.hashFallbackQueryArgument=i),"hash-fallback-uri-capture":t.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":r[8]||(r[8]=i=>t.fields.hashFallbackUriCapture=i),"hash-on":t.fields.hashOn,"onUpdate:hashOn":r[9]||(r[9]=i=>t.fields.hashOn=i),"hash-on-cookie":t.fields.hashOnCookie,"onUpdate:hashOnCookie":r[10]||(r[10]=i=>t.fields.hashOnCookie=i),"hash-on-cookie-path":t.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":r[11]||(r[11]=i=>t.fields.hashOnCookiePath=i),"hash-on-header":t.fields.hashOnHeader,"onUpdate:hashOnHeader":r[12]||(r[12]=i=>t.fields.hashOnHeader=i),"hash-on-query-argument":t.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":r[13]||(r[13]=i=>t.fields.hashOnQueryArgument=i),"hash-on-uri-capture":t.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":r[14]||(r[14]=i=>t.fields.hashOnUriCapture=i),slots:t.fields.slots,"onUpdate:slots":r[15]||(r[15]=i=>t.fields.slots=i),"sticky-sessions-cookie":t.fields.stickySessionsCookie,"onUpdate:stickySessionsCookie":r[16]||(r[16]=i=>t.fields.stickySessionsCookie=i),"sticky-sessions-cookie-path":t.fields.stickySessionsCookiePath,"onUpdate:stickySessionsCookiePath":r[17]||(r[17]=i=>t.fields.stickySessionsCookiePath=i),readonly:t.readonly,"sticky-sessions-available":a.config.stickySessionsAvailable},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","sticky-sessions-cookie","sticky-sessions-cookie-path","readonly","sticky-sessions-available"]),e.createVNode(qt,{"active-health-switch":t.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[r[18]||(r[18]=i=>t.fields.activeHealthSwitch=i),d],"healthchecks-threshold":t.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":r[19]||(r[19]=i=>t.fields.healthchecksThreshold=i),"passive-health-switch":t.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[r[20]||(r[20]=i=>t.fields.passiveHealthSwitch=i),C],readonly:t.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),t.fields.activeHealthSwitch?(e.openBlock(),e.createBlock(Pt,{key:0,concurrency:t.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":r[21]||(r[21]=i=>t.fields.activeHealthCheck.concurrency=i),headers:t.fields.activeHealthCheck.headers,"onUpdate:headers":r[22]||(r[22]=i=>t.fields.activeHealthCheck.headers=i),"healthy-http-statuses":t.fields.activeHealthCheck.healthy.httpStatuses,"onUpdate:healthyHttpStatuses":r[23]||(r[23]=i=>t.fields.activeHealthCheck.healthy.httpStatuses=i),"healthy-interval":t.fields.activeHealthCheck.healthy.interval,"onUpdate:healthyInterval":r[24]||(r[24]=i=>t.fields.activeHealthCheck.healthy.interval=i),"healthy-successes":t.fields.activeHealthCheck.healthy.successes,"onUpdate:healthySuccesses":r[25]||(r[25]=i=>t.fields.activeHealthCheck.healthy.successes=i),"http-path":t.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":r[26]||(r[26]=i=>t.fields.activeHealthCheck.httpPath=i),"https-sni":t.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":r[27]||(r[27]=i=>t.fields.activeHealthCheck.httpsSni=i),timeout:t.fields.activeHealthCheck.timeout,"onUpdate:timeout":r[28]||(r[28]=i=>t.fields.activeHealthCheck.timeout=i),type:t.fields.activeHealthCheck.type,"onUpdate:type":r[29]||(r[29]=i=>t.fields.activeHealthCheck.type=i),"unhealthy-http-failures":t.fields.activeHealthCheck.unhealthy.httpFailures,"onUpdate:unhealthyHttpFailures":r[30]||(r[30]=i=>t.fields.activeHealthCheck.unhealthy.httpFailures=i),"unhealthy-http-statuses":t.fields.activeHealthCheck.unhealthy.httpStatuses,"onUpdate:unhealthyHttpStatuses":r[31]||(r[31]=i=>t.fields.activeHealthCheck.unhealthy.httpStatuses=i),"unhealthy-interval":t.fields.activeHealthCheck.unhealthy.interval,"onUpdate:unhealthyInterval":r[32]||(r[32]=i=>t.fields.activeHealthCheck.unhealthy.interval=i),"unhealthy-tcp-failures":t.fields.activeHealthCheck.unhealthy.tcpFailures,"onUpdate:unhealthyTcpFailures":r[33]||(r[33]=i=>t.fields.activeHealthCheck.unhealthy.tcpFailures=i),"unhealthy-timeouts":t.fields.activeHealthCheck.unhealthy.timeouts,"onUpdate:unhealthyTimeouts":r[34]||(r[34]=i=>t.fields.activeHealthCheck.unhealthy.timeouts=i),"verify-ssl":t.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":r[35]||(r[35]=i=>t.fields.activeHealthCheck.verifySsl=i),config:a.config,readonly:t.readonly},null,8,["concurrency","headers","healthy-http-statuses","healthy-interval","healthy-successes","http-path","https-sni","timeout","type","unhealthy-http-failures","unhealthy-http-statuses","unhealthy-interval","unhealthy-tcp-failures","unhealthy-timeouts","verify-ssl","config","readonly"])):e.createCommentVNode("",!0),t.fields.passiveHealthSwitch?(e.openBlock(),e.createBlock(Rt,{key:1,"healthy-http-statuses":t.fields.passiveHealthCheck.healthy.httpStatuses,"onUpdate:healthyHttpStatuses":r[36]||(r[36]=i=>t.fields.passiveHealthCheck.healthy.httpStatuses=i),"healthy-successes":t.fields.passiveHealthCheck.healthy.successes,"onUpdate:healthySuccesses":r[37]||(r[37]=i=>t.fields.passiveHealthCheck.healthy.successes=i),type:t.fields.passiveHealthCheck.type,"onUpdate:type":r[38]||(r[38]=i=>t.fields.passiveHealthCheck.type=i),"unhealthy-http-failures":t.fields.passiveHealthCheck.unhealthy.httpFailures,"onUpdate:unhealthyHttpFailures":r[39]||(r[39]=i=>t.fields.passiveHealthCheck.unhealthy.httpFailures=i),"unhealthy-http-statuses":t.fields.passiveHealthCheck.unhealthy.httpStatuses,"onUpdate:unhealthyHttpStatuses":r[40]||(r[40]=i=>t.fields.passiveHealthCheck.unhealthy.httpStatuses=i),"unhealthy-tcp-failures":t.fields.passiveHealthCheck.unhealthy.tcpFailures,"onUpdate:unhealthyTcpFailures":r[41]||(r[41]=i=>t.fields.passiveHealthCheck.unhealthy.tcpFailures=i),"unhealthy-timeouts":t.fields.passiveHealthCheck.unhealthy.timeouts,"onUpdate:unhealthyTimeouts":r[42]||(r[42]=i=>t.fields.passiveHealthCheck.unhealthy.timeouts=i),readonly:t.readonly},null,8,["healthy-http-statuses","healthy-successes","type","unhealthy-http-failures","unhealthy-http-statuses","unhealthy-tcp-failures","unhealthy-timeouts","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-ee1ce06f"]]),Qt={"data-testid":"client_certificate-plain-text"},Wt=e.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(a){const B=a,{i18n:{t:o},i18nT:s}=Y.useI18n(),{getPropValue:n}=p.useHelpers(),m=e.computed(()=>oe.form[B.config.app].edit),f=e.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:p.ConfigurationSchemaSection.Basic,tooltip:o("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:p.ConfigurationSchemaSection.Basic},hash_on:{order:7,section:p.ConfigurationSchemaSection.Basic},hash_on_header:{order:8,section:p.ConfigurationSchemaSection.Basic},hash_on_uri_capture:{order:9,section:p.ConfigurationSchemaSection.Basic},hash_on_query_arg:{order:10,section:p.ConfigurationSchemaSection.Basic,label:`${o("upstreams.form.fields.hash_on.label")} ${o("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:p.ConfigurationSchemaSection.Basic},hash_on_cookie_path:{order:12,section:p.ConfigurationSchemaSection.Basic},healthchecks:{order:13,section:p.ConfigurationSchemaSection.Basic,type:p.ConfigurationSchemaType.Json},tags:{order:14,tooltip:o("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${o("upstreams.form.fields.hash_fallback.label")} ${o("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:o("upstreams.form.hash_tooltips.client_certificate")}});return(D,w)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(p.EntityBaseConfigCard),{config:a.config,"config-card-doc":a.configCardDoc,"config-schema":f.value,"entity-type":e.unref(p.SupportedEntityType).Upstream,"fetch-url":m.value,"hide-title":a.hideTitle,"onFetch:error":w[0]||(w[0]=l=>D.$emit("fetch:error",l)),"onFetch:success":w[1]||(w[1]=l=>D.$emit("fetch:success",l)),onLoading:w[2]||(w[2]=l=>D.$emit("loading",l))},{"name-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":e.withCtx(({row:l})=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(l.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:e.withCtx(()=>w[3]||(w[3]=[e.createElementVNode("code",null,"10",-1)])),max:e.withCtx(()=>w[4]||(w[4]=[e.createElementVNode("code",null,"65536",-1)])),_:1})]),"hash_fallback-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(o)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:e.withCtx(l=>{var h;return[e.createElementVNode("div",null,[e.createElementVNode("div",Qt,[e.createElementVNode("span",null,e.toDisplayString((h=e.unref(n)("rowValue",l))==null?void 0:h.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])]))}});W.TargetForm=Ue,W.TargetsList=bt,W.UpstreamsConfigCard=Wt,W.UpstreamsForm=jt,W.UpstreamsList=ut,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});