import{a as S}from"./asyncComputed.a50f21d4.js";import{a as m}from"./router.7bb92c0e.js";import{d as _,r as I,B,D as f,b as g,c as C,w as a,u as e,f as t,au as s,e as v,eJ as b,bB as P,cG as D,eG as E,ey as F,eA as T}from"./outputWidgets.7323a17d.js";import"./index.c9f11f2b.js";import{P as h}from"./project.dfdecc43.js";import{_ as N}from"./SaveButton.vue_vue_type_script_setup_true_lang.09f71e51.js";import{A as j}from"./Title.88a7d0e4.js";import{A as U}from"./Paragraph.1e67eefb.js";import{A as d}from"./Text.a0b69008.js";import{A as V,F as x}from"./Form.4d35a934.js";import"./popupNotifcation.4e57751c.js";import"./record.1f033572.js";import"./pubsub.2c3883f4.js";import"./Base.003f7172.js";import"./hasIn.adc00278.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]="74020af7-d546-44d8-a00e-bc3c5edf282c",n._sentryDebugIdIdentifier="sentry-dbid-74020af7-d546-44d8-a00e-bc3c5edf282c")}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 u(){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}}),A=()=>{r.project.subdomain=h.formatSubdomain(r.project.subdomain),u()};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(m),null,{default:a(()=>[t(e(d),null,{default:a(()=>[s("Forms available at:")]),_:1}),t(e(d),{code:""},{default:a(()=>[v("span",null,b(l.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(e(m),null,{default:a(()=>[t(e(d),null,{default:a(()=>[s("Hooks available at:")]),_:1}),t(e(d),{code:""},{default:a(()=>[v("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"},ae=_({__name:"ProjectSettings",setup(n){const o=E().params.projectId,{result:i}=S(()=>h.get(o));return(u,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{ae as default};
//# sourceMappingURL=ProjectSettings.6ae8723c.js.map
