import{a as A}from"./asyncComputed.f77117da.js";import"./gateway.46301256.js";import{d as _,e as I,eF as B,f,c as C,w as a,u as e,o as g,b as t,ax as s,cY as h,cW as P,cX as i,a as m,et as v,co as D,bD as E,cn as F,eu as T,W as x,R as N}from"./vue-router.6a68d184.js";import{P as j}from"./project.6cb4e0a0.js";import"./tables.97d8f468.js";import{S as R}from"./SaveButton.c903b3a1.js";import{a as b}from"./router.2b01b91e.js";import{A as U}from"./index.4be87654.js";import"./popupNotifcation.782e5078.js";import"./record.048ae4ac.js";import"./string.1c036a5c.js";import"./ExclamationCircleOutlined.e3ccd28d.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]="fe4ee30e-a0a0-4eff-9d73-c659b608acef",n._sentryDebugIdIdentifier="sentry-dbid-fe4ee30e-a0a0-4eff-9d73-c659b608acef")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),u=B.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=f(()=>{switch(o.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),y=f(()=>{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(),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(b),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(b),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(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]=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"},Q=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:u}=A(()=>j.get(o));return(d,c)=>e(u)?(g(),x("div",H,[t(e(h),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(u)},null,8,["project"])])):N("",!0)}});export{Q as default};
//# sourceMappingURL=ProjectSettings.727ea55b.js.map
