import{bl as M}from"./navigation-BzNQiq4W.js";import{z as N,j as D,o as V,g as w,r as W,h as b,v as j}from"./ReferenceContentLoader-Z8YmHBVJ.js";import{w as z}from"./ScalarToggle.vue-DCof8PDJ.js";import{d as B,e as F,i as r,o as d,h as l,n,l as t,F as u,Z as y,t as L,g as k}from"./index-DPl1iiyq.js";import{w as O}from"./DeleteSidebarListElement.vue-BDbPRHND.js";import"./__vite-browser-external-D7Ct-6yo.js";const R={class:"flex h-full w-full flex-col gap-12 px-1.5 pt-8"},T={class:"flex flex-col gap-2"},A={class:"bg-b-2 rounded-lg border text-sm"},I={class:"bg-b-1 flex items-center justify-between gap-4 rounded-t-lg p-3"},P={class:"text-c-1 flex items-center overflow-x-auto border-t py-1.5 whitespace-nowrap"},S={class:"flex items-center"},Z=["href"],E={class:"flex flex-col gap-4"},q={class:"flex items-center justify-between rounded-lg border p-3 text-sm"},G=B({__name:"CollectionSettings",setup(H){const{activeCollection:a,activeWorkspace:c,activeWorkspaceCollections:C}=N(),{collectionMutators:m}=D(),{replace:U}=F(),s=V();function _(){var o,e;a.value&&(o=a.value)!=null&&o.documentUrl&&m.edit(a.value.uid,"watchMode",!((e=a.value)!=null&&e.watchMode))}function $(){if(!a.value||!c.value)return;m.delete(a.value,c.value);const o=C.value[0];o&&U({name:"collection",params:{[b.Workspace]:c.value.uid,[b.Collection]:o.uid}}),s.hide()}return(o,e)=>{var p,f,v,h,x;return d(),r(u,null,[l("div",R,[l("div",T,[e[5]||(e[5]=l("div",{class:"flex h-8 items-center"},[l("h3",{class:"font-bold"},"Features")],-1)),l("div",A,[l("div",I,[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(z),{class:"w-4",disabled:!((p=t(a))!=null&&p.documentUrl),modelValue:((f=t(a))==null?void 0:f.watchMode)??!1,"onUpdate:modelValue":_},null,8,["disabled","modelValue"])]),l("div",P,[l("div",S,[(v=t(a))!=null&&v.documentUrl?(d(),r(u,{key:0},[e[3]||(e[3]=l("span",{class:"bg-b-2 sticky left-0 pr-2 pl-3"},"Source",-1)),l("a",{class:"text-c-2 group rounded pr-3 no-underline hover:underline",href:t(a).documentUrl,target:"_blank"},[y(L(t(a).documentUrl)+" ",1),n(t(w),{class:"ml-1 hidden w-2.5 group-hover:inline",icon:"ExternalLink"})],8,Z)],64)):(d(),r(u,{key:1},[n(t(w),{class:"text-c-2 mr-2 ml-3 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",E,[e[8]||(e[8]=l("h3",{class:"font-bold"},"Danger Zone",-1)),l("div",q,[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(M),{class:"custom-scroll h-8 gap-1.5 px-2.5 font-medium whitespace-nowrap 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,__:[6]})])])]),n(t(W),{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,g;return[n(O,{variableName:((g=(i=t(a))==null?void 0:i.info)==null?void 0:g.title)??"",warningMessage:"This action cannot be undone.",onClose:e[1]||(e[1]=J=>t(s).hide()),onDelete:$},null,8,["variableName"])]}),_:1},8,["state","title"])],64)}}}),te=j(G,[["__scopeId","data-v-5170f3be"]]);export{te as default};
