import{a as S}from"./asyncComputed.2a2a1288.js";import"./gateway.9b472f57.js";import{d as _,r as I,D as B,y as m,b as g,c as C,w as a,u as e,f as t,au as s,e as f,eJ as b,bB as P,cG as D,eG as E,ey as F,eA as T}from"./outputWidgets.52571dac.js";import"./index.803d0576.js";import{P as h}from"./project.048e4ccc.js";import{_ as N}from"./SaveButton.vue_vue_type_script_setup_true_lang.533d4f42.js";import{A as j}from"./Title.8fbc2e7d.js";import{A as U}from"./Paragraph.7aa2ce32.js";import{A as u}from"./Text.0586c869.js";import{a as v}from"./router.0ae1ef4a.js";import{A as V,F as x}from"./Form.9e43a28b.js";import"./popupNotifcation.e85fac74.js";import"./record.2a93f29c.js";import"./pubsub.be7004e9.js";import"./Base.e64db743.js";import"./hasIn.f1c353ba.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]="f7e3418f-1b52-4809-805c-a49888727b62",n._sentryDebugIdIdentifier="sentry-dbid-f7e3418f-1b52-4809-805c-a49888727b62")}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}}),A=()=>{r.project.subdomain=h.formatSubdomain(r.project.subdomain),d()};function k(){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(U),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(v),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[f("span",null,b(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(v),null,{default:a(()=>[t(e(u),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(u),{code:""},{default:a(()=>[f("span",null,b(l.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(e(x),null,{default:a(()=>[t(e(V),{"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:A},{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:k},null,8,["model","disabled"])]),_:1})]),_:1}))}}),R={key:0,class:"project-settings"},te=_({__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{te as default};
//# sourceMappingURL=ProjectSettings.132e1c62.js.map
