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