import{F as M,j as N,W,q as g,$ as _,D as F,A as w,E as V}from"./ReferenceContentLoader-jQeEHBuo.js";import"./navigation-BK47qCFk.js";import{w as j}from"./ScalarToggle.vue-BsLILHDc.js";import{d as A,E as B,c as r,o as d,b as l,f as n,u as t,F as u,W as y,t as E,A as k}from"./index-D86EVCbM.js";import{w as L}from"./DeleteSidebarListElement.vue-DU9GbhpY.js";import"./__vite-browser-external-D7Ct-6yo.js";const O={class:"flex h-full w-full flex-col gap-12 px-1.5 pt-8"},R={class:"flex flex-col gap-2"},T={class:"bg-b-2 rounded-lg border text-sm"},z={class:"bg-b-1 -m-1/2 flex items-center justify-between gap-4 rounded-t-lg border-l p-3"},I={class:"text-c-1 flex items-center overflow-x-auto whitespace-nowrap border-t py-1.5"},P={class:"flex items-center"},S=["href"],q={class:"flex flex-col gap-4"},Z={class:"flex items-center justify-between rounded-lg border p-3 text-sm"},G=A({__name:"CollectionSettings",setup(H){const{activeCollection:a,activeWorkspace:c,activeWorkspaceCollections:C}=M(),{collectionMutators:m}=N(),{replace:$}=B(),s=W();function U(){var o,e;a.value&&(o=a.value)!=null&&o.documentUrl&&m.edit(a.value.uid,"watchMode",!((e=a.value)!=null&&e.watchMode))}function D(){if(!a.value||!c.value)return;m.delete(a.value,c.value);const o=C.value[0];o&&$({name:"collection",params:{[w.Workspace]:c.value.uid,[w.Collection]:o.uid}}),s.hide()}return(o,e)=>{var p,f,v,h,x;return d(),r(u,null,[l("div",O,[l("div",R,[e[5]||(e[5]=l("div",{class:"flex h-8 items-center"},[l("h3",{class:"font-bold"},"Features")],-1)),l("div",T,[l("div",z,[e[2]||(e[2]=l("div",null,[l("h4",null,"Watch Mode"),l("p",{class:"text-c-2 mt-1"}," When enabled, the OpenAPI document will be polled for changes. The collection will be updated automatically. ")],-1)),n(t(j),{class:"w-4",disabled:!((p=t(a))!=null&&p.documentUrl),modelValue:((f=t(a))==null?void 0:f.watchMode)??!1,"onUpdate:modelValue":U},null,8,["disabled","modelValue"])]),l("div",I,[l("div",P,[(v=t(a))!=null&&v.documentUrl?(d(),r(u,{key:0},[e[3]||(e[3]=l("span",{class:"bg-b-2 sticky left-0 pl-3 pr-2"},"Source",-1)),l("a",{class:"text-c-2 group rounded pr-3 no-underline hover:underline",href:t(a).documentUrl,target:"_blank"},[y(E(t(a).documentUrl)+" ",1),n(t(g),{class:"ml-1 hidden w-2.5 group-hover:inline",icon:"ExternalLink"})],8,S)],64)):(d(),r(u,{key:1},[n(t(g),{class:"text-c-2 ml-3 mr-2 w-4",icon:"NotAllowed",size:"sm"}),e[4]||(e[4]=l("span",{class:"text-c-2 pr-3"}," No URL configured. Try importing an OpenAPI document from an URL. ",-1))],64))])])])]),l("div",q,[e[8]||(e[8]=l("h3",{class:"font-bold"},"Danger Zone",-1)),l("div",Z,[e[7]||(e[7]=l("div",null,[l("h4",null,"Delete Collection"),l("p",{class:"text-c-2 mt-1"}," Be careful, my friend. Once deleted, there is no way to recover the collection. ")],-1)),n(t(_),{class:"custom-scroll h-8 gap-1.5 whitespace-nowrap px-2.5 font-medium shadow-none focus:outline-none",variant:"danger",onClick:e[0]||(e[0]=i=>t(s).show())},{default:k(()=>e[6]||(e[6]=[y(" Delete Collection ")])),_:1})])])]),n(t(F),{size:"xxs",state:t(s),title:`Delete ${(x=(h=t(a))==null?void 0:h.info)==null?void 0:x.title}`},{default:k(()=>{var i,b;return[n(L,{variableName:((b=(i=t(a))==null?void 0:i.info)==null?void 0:b.title)??"",warningMessage:"This action cannot be undone.",onClose:e[1]||(e[1]=J=>t(s).hide()),onDelete:D},null,8,["variableName"])]}),_:1},8,["state","title"])],64)}}}),te=V(G,[["__scopeId","data-v-00fdb693"]]);export{te as default};
