import{a as A}from"./asyncComputed.c7982027.js";import"./gateway.34f2a318.js";import{d as _,q as I,Q as C,J as m,o as g,c as P,w as a,u as e,b as t,ar as s,cR as j,cP as B,cQ as i,a as v,eG as b,cj as E,bx as D,ci as F,eC as T,eu as x,ew as N}from"./vue-router.6b399b0b.js";import"./index.c3b84c4d.js";import{P as h}from"./project.ab1d5905.js";import{S as R}from"./SaveButton.cddcaf82.js";import{a as f}from"./router.ab3f179a.js";import{A as U}from"./index.2e72b67b.js";import"./popupNotifcation.17b9c327.js";import"./record.f5201a57.js";import"./string.79d7b0e1.js";import"./ExclamationCircleOutlined.0e03634b.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]="ed8132a8-499e-4390-9693-253448b50648",n._sentryDebugIdIdentifier="sentry-dbid-ed8132a8-499e-4390-9693-253448b50648")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),u=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",u()):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=h.formatSubdomain(r.project.subdomain),d()};function w(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),P(e(U),{direction:"vertical"},{default:a(()=>[t(e(j),{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(f),null,{default:a(()=>[t(e(i),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(i),{code:""},{default:a(()=>[v("span",null,b(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(()=>[v("span",null,b(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(F),null,{default:a(()=>[t(e(E),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(D),{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"},Y=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:u}=A(()=>h.get(o));return(d,c)=>e(u)?(g(),x("div",H,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(u)},null,8,["project"])])):N("",!0)}});export{Y as default};
//# sourceMappingURL=ProjectSettings.ea24c4b5.js.map
