import{a as S}from"./asyncComputed.9f78a6df.js";import{a as m}from"./router.5e7d449c.js";import{d as _,r as I,eM as B,H as f,b as g,c as C,w as a,u as e,f as t,ar as s,e as b,eD as v,bz as E,cE as P,eB as T,ev as D,ex as F}from"./outputWidgets.ed989e0a.js";import"./index.46777a19.js";import{P as h}from"./project.9f93cb4f.js";import{_ as x}from"./SaveButton.vue_vue_type_script_setup_true_lang.a8a7d09f.js";import{A as j}from"./Title.7eb91981.js";import{A as H}from"./Paragraph.4678e06b.js";import{A as u}from"./Text.8e13d454.js";import{A as N,F as U}from"./Form.fe660512.js";import"./popupNotifcation.c17802b7.js";import"./index.cf4c23b9.js";import"./record.f2e811cc.js";import"./pubsub.14278e58.js";import"./Base.42a4c5ca.js";import"./Typography.5e43ce25.js";import"./hasIn.264c6078.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]="5bffaafe-e144-4b1a-82ef-14011815cece",n._sentryDebugIdIdentifier="sentry-dbid-5bffaafe-e144-4b1a-82ef-14011815cece")}catch{}})();const V=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),i=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",i()):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=h.formatSubdomain(r.project.subdomain),d()};function A(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),C(e(P),{direction:"vertical"},{default:a(()=>[t(e(j),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(H),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(m),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[b("span",null,v(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(m),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[b("span",null,v(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(U),null,{default:a(()=>[t(e(N),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(E),{value:l.project.subdomain,"onUpdate:value":p[0]||(p[0]=w=>l.project.subdomain=w),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(x,{model:l.project,disabled:o.value!=="available",onError:A},null,8,["model","disabled"])]),_:1})]),_:1}))}}),R={key:0,class:"project-settings"},oe=_({__name:"ProjectSettings",setup(n){const o=T().params.projectId,{result:i}=S(()=>h.get(o));return(d,c)=>e(i)?(g(),D("div",R,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(V,{project:e(i)},null,8,["project"])])):F("",!0)}});export{oe as default};
//# sourceMappingURL=ProjectSettings.cd9c7a87.js.map
