import{a as S}from"./asyncComputed.78ec0807.js";import{a as f}from"./router.2245534d.js";import{d as _,r as I,eN as B,I as m,b as g,c as C,w as a,u as e,f as t,ar as s,e as b,eG as v,by as P,cB as D,eD as E,ev as F,ex as T}from"./outputWidgets.a321903e.js";import"./index.579b421e.js";import{P as h}from"./project.948c46ba.js";import{_ as N}from"./SaveButton.vue_vue_type_script_setup_true_lang.e7f41289.js";import{A as j}from"./Title.e1cf3e99.js";import{A as x}from"./Paragraph.53f5a9bc.js";import{A as u}from"./Text.b25e1b1d.js";import{A as U,F as V}from"./Form.e0cc6e8e.js";import"./popupNotifcation.43dee970.js";import"./record.d39119c8.js";import"./pubsub.df0290b2.js";import"./hasIn.62bbbac0.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]="ec6d888f-ae06-4aab-afb9-03349f6f49c3",n._sentryDebugIdIdentifier="sentry-dbid-ec6d888f-ae06-4aab-afb9-03349f6f49c3")}catch{}})();const H=_({__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=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 A(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),C(e(D),{direction:"vertical"},{default:a(()=>[t(e(j),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(x),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(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(f),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(V),null,{default:a(()=>[t(e(U),{"validate-status":c.value,help:y.value,"has-feedback":""},{default:a(()=>[t(e(P),{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(N,{model:l.project,disabled:o.value!=="available",onError:A},null,8,["model","disabled"])]),_:1})]),_:1}))}}),R={key:0,class:"project-settings"},ee=_({__name:"ProjectSettings",setup(n){const o=E().params.projectId,{result:i}=S(()=>h.get(o));return(d,c)=>e(i)?(g(),F("div",R,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(H,{project:e(i)},null,8,["project"])])):T("",!0)}});export{ee as default};
//# sourceMappingURL=ProjectSettings.2aadae08.js.map
