import{a as S}from"./asyncComputed.bd2b6e70.js";import"./gateway.58b63376.js";import{d as _,r as I,D as C,y as m,b as g,c as P,w as a,u as e,f as t,ak as s,cM as h,cK as B,cL as u,e as f,eC as v,ce as D,bq as E,cd as F,ey as T,eq as N,es as U}from"./outputWidgets.f7b80e9f.js";import"./index.f21af923.js";import{P as j}from"./project.4ecb704a.js";import{_ as V}from"./SaveButton.vue_vue_type_script_setup_true_lang.1abdfcbd.js";import{a as b}from"./router.6fb3acdf.js";import{A as q}from"./index.86fdb625.js";import"./popupNotifcation.6f5b518c.js";import"./record.188928bf.js";import"./pubsub.10df5fd2.js";import"./string.18a9daee.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]="c08a0a39-f8b6-4407-894a-f1ae517ac338",n._sentryDebugIdIdentifier="sentry-dbid-c08a0a39-f8b6-4407-894a-f1ae517ac338")}catch{}})();const x=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),i=C.exports.debounce(async()=>{try{const{available:l}=await r.project.checkSubdomain();o.value=l?"available":"unavailable"}catch{o.value=void 0}},500);function d(){r.project.subdomain?(o.value="loading",i()):o.value="invalid"}const c=m(()=>{switch(o.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),y=m(()=>{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),d()};function w(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),P(e(q),{direction:"vertical"},{default:a(()=>[t(e(h),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(B),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(b),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[f("span",null,v(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(b),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[f("span",null,v(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(F),null,{default:a(()=>[t(e(D),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(E),{value:l.project.subdomain,"onUpdate:value":p[0]||(p[0]=A=>l.project.subdomain=A),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(V,{model:l.project,disabled:o.value!=="available",onError:w},null,8,["model","disabled"])]),_:1})]),_:1}))}}),H={key:0,class:"project-settings"},Y=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:i}=S(()=>j.get(o));return(d,c)=>e(i)?(g(),N("div",H,[t(e(h),null,{default:a(()=>[s("Project Settings")]),_:1}),t(x,{project:e(i)},null,8,["project"])])):U("",!0)}});export{Y as default};
//# sourceMappingURL=ProjectSettings.198cf1f5.js.map
