import{a as A}from"./asyncComputed.37a42e7b.js";import{d as _,e as I,em as B,f as b,c as C,w as a,u as e,o as g,b as t,aF as s,db as h,d9 as P,da as i,a as m,ec as v,cy as E,bK as F,cx as D,ed as T,X as x,R as N}from"./vue-router.36bc5188.js";import"./gateway.6a3fe533.js";import{P as j}from"./project.61147eb5.js";import"./tables.d43a3134.js";import{S as R}from"./SaveButton.71015be4.js";import{a as f}from"./router.748a95a3.js";import{A as U}from"./index.87f1e4b3.js";import"./popupNotifcation.a7b5eb5c.js";import"./record.2cf5df84.js";import"./string.8a83f3d1.js";import"./UnsavedChangesHandler.a5e4c106.js";import"./ExclamationCircleOutlined.fb50cf8b.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[r]="d188a045-c9b3-4e30-a362-cdb3b44ab0bc",n._sentryDebugIdIdentifier="sentry-dbid-d188a045-c9b3-4e30-a362-cdb3b44ab0bc")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),d=B.exports.debounce(async()=>{try{const{available:l}=await r.project.checkSubdomain();o.value=l?"available":"unavailable"}catch{o.value=void 0}},500);function u(){r.project.subdomain?(o.value="loading",d()):o.value="invalid"}const c=b(()=>{switch(o.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),y=b(()=>{switch(o.value){case"loading":return"Checking availability...";case"available":return"Available";case"unavailable":return"Unavailable";case"invalid":return"Invalid subdomain";default:return}}),k=()=>{r.project.subdomain=j.formatSubdomain(r.project.subdomain),u()};function w(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),C(e(U),{direction:"vertical"},{default:a(()=>[t(e(h),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(P),null,{default:a(()=>[s(" Every project in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. ")]),_:1}),t(e(f),null,{default:a(()=>[t(e(i),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(i),{code:""},{default:a(()=>[m("span",null,v(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(f),null,{default:a(()=>[t(e(i),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(i),{code:""},{default:a(()=>[m("span",null,v(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(D),null,{default:a(()=>[t(e(E),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(F),{value:l.project.subdomain,"onUpdate:value":p[0]||(p[0]=S=>l.project.subdomain=S),type:"text",loading:o.value==="loading",onBlur:k},{addonBefore:a(()=>[s("https://")]),addonAfter:a(()=>[s(".abstra.app")]),_:1},8,["value","loading"])]),_:1},8,["validate-status","help"]),t(R,{model:l.project,disabled:o.value!=="available",onError:w},null,8,["model","disabled"])]),_:1})]),_:1}))}}),H={key:0,class:"project-settings"},Z=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:d}=A(()=>j.get(o));return(u,c)=>e(d)?(g(),x("div",H,[t(e(h),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(d)},null,8,["project"])])):N("",!0)}});export{Z as default};
//# sourceMappingURL=ProjectSettings.39cf1c93.js.map
