import{a as S}from"./asyncComputed.06ede41f.js";import{a as m}from"./router.4a0ba06b.js";import{d as _,r as I,eO as C,J as f,b as g,c as E,w as a,u as e,f as t,as as s,e as b,eH as v,bz as P,cC as B,eE as F,ew as T,ey as D}from"./outputWidgets.6e1c5425.js";import"./index.76daa7f6.js";import{P as h}from"./project.ba2bfaa1.js";import{_ as H}from"./SaveButton.vue_vue_type_script_setup_true_lang.054c75fa.js";import{A as j}from"./Title.dfd37452.js";import{A as N}from"./Paragraph.4ce326b3.js";import{A as u}from"./Text.b10c1140.js";import{A as U,F as V}from"./Form.b82a2cec.js";import"./popupNotifcation.76f4dd63.js";import"./record.c7d63161.js";import"./pubsub.4f3043c8.js";import"./Base.0277cf44.js";import"./hasIn.bf07751b.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]="4918dc8d-96c6-4089-8bee-cf0be06367a6",n._sentryDebugIdIdentifier="sentry-dbid-4918dc8d-96c6-4089-8bee-cf0be06367a6")}catch{}})();const x=_({__name:"SubdomainEditor",props:{project:{}},setup(n){const r=n,o=I(void 0),i=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",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 w(){r.project.resetChanges(),o.value=void 0}return(l,p)=>(g(),E(e(B),{direction:"vertical"},{default:a(()=>[t(e(j),{level:2},{default:a(()=>[s("Subdomain")]),_:1}),t(e(N),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(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]=A=>l.project.subdomain=A),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(H,{model:l.project,disabled:o.value!=="available",onError:w},null,8,["model","disabled"])]),_:1})]),_:1}))}}),R={key:0,class:"project-settings"},ae=_({__name:"ProjectSettings",setup(n){const o=F().params.projectId,{result:i}=S(()=>h.get(o));return(d,c)=>e(i)?(g(),T("div",R,[t(e(j),null,{default:a(()=>[s("Project Settings")]),_:1}),t(x,{project:e(i)},null,8,["project"])])):D("",!0)}});export{ae as default};
//# sourceMappingURL=ProjectSettings.d8c8f012.js.map
