import{aa as T,r,J as g,ak as k,u as o,o as a,g as n,F as H,D as y,i as N,b as w,w as x,f as C,t as V,h as d}from"./app-BYcXwl4U.js";import{u as b}from"./app-a6cKceqE.js";import{T as B}from"./app-BbPGXKj1.js";const D={key:0,class:"inline-block label-group"},F=["onClick"],M={key:0},J={__name:"HTTPHeaderAssistant",props:["v-type","v-value"],emits:["select"],setup(m,{emit:p}){const f=b(),h=T("$Tea"),c=m,_=p,{allHeaders:l,matchedHeaders:t,selectedHeaderName:s}=function(){return{allHeaders:r([]),matchedHeaders:r([]),selectedHeaderName:r("")}}(),v=function(e){_("select",e),s.value=e};return g(()=>c.vValue,function(e){if(e!=s.value&&(s.value=""),e.length==0){t.value=[];return}t.value=l.value.filter(function(i){return f.match(i,e)}).slice(0,10)}),k(()=>{h.action("/servers/headers/options?type="+c.vType).post().success(function(e){l.value=e.data.headers})}),(e,i)=>o(s).length==0?(a(),n("span",D,[(a(!0),n(H,null,y(o(t),u=>(a(),n("a",{href:"",onClick:N($=>v(u),["prevent"])},[w(B,null,{default:x(()=>[C(V(u),1)]),_:2},1024)],8,F))),256)),o(t).length>0?(a(),n("span",M,"   ")):d("",!0)])):d("",!0)}};export{J as _};
