import{a as y}from"./asyncComputed.1364aaa9.js";import{P as j}from"./project.7c905308.js";import"./utils.acbba3b4.js";import{d as v,v as w,b as i,c,x as t,e as u,z as r,S as e,N as l,D as p,t as S,a as C,O as I,Q as x,q as E,J as N}from"./registerWidgets.802bba2f.js";import{a as O}from"./index.7eb978ee.js";import{L as B}from"./CircularLoading.5c7f2ad7.js";import{N as D,e as H,O as P}from"./icons.97625e56.js";import"./passwordlessManager.d5134797.js";import"./pubsub.a0411919.js";const n=o=>(I("data-v-334134e4"),o=o(),x(),o),V={class:"subdomain-editor"},A={class:"title"},T=n(()=>t("div",{class:"subtitle"}," Every workspace in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. Only the workspace\u2019s owner can edit the subdomain. ",-1)),z={key:0,class:"subdomain-presenter"},F={class:"link-item"},L=n(()=>t("div",{class:"link-title"},"Home available at:",-1)),M={class:"link"},R={class:"custom-subdomain"},$={class:"link-item"},q=n(()=>t("div",{class:"link-title"},"Smart Forms available at:",-1)),J={class:"link"},K={class:"custom-subdomain"},Q={class:"link-item"},G=n(()=>t("div",{class:"link-title"},"Hooks available at:",-1)),U={class:"link"},W={class:"custom-subdomain"},X={key:1,class:"subdomain-value-editor"},Y={class:"subdomain-change-warning"},Z={class:"section-title"},tt=n(()=>t("div",{class:"section-body"}," Changing the workspace subdomain affects any links you've previously shared. The user wont be able to access old links. ",-1)),st={class:"input-section"},et={class:"subdomain-value-input"},ot=n(()=>t("span",null,"https://",-1)),at=["value"],nt=n(()=>t("span",null,".abstra.run",-1)),it={key:0,class:"error"},ct={class:"option-buttons"},rt=v({__name:"SubdomainEditor",props:{project:null},setup(o){const a=o,s=w({name:a.project.subdomain,error:"",editing:!1,loading:!1}),d=()=>s.editing=!0,m=()=>{f(),s.editing=!1,s.error=""},h=async()=>{s.error="",s.loading=!0,await g(),s.error||(s.editing=!1),s.loading=!1},g=async()=>{if(!(!a.project||a.project.subdomain===s.name)){if(!s.name){s.error="Subdomain cannot be empty";return}a.project.subdomain=s.name,await a.project.save()}},f=()=>s.name=a.project.subdomain,k=b=>{s.name=O(b.target.value,{replacement:"-",lower:!0,strict:!0})};return(b,ut)=>{const _=C("icon");return i(),c("div",V,[t("h2",A,[u(_,{width:"22",height:"22",path:r(D),fill:"#414A58"},null,8,["path"]),e("Subdomain ")]),T,s.editing?(i(),c("div",X,[t("div",Y,[t("div",Z,[u(_,{path:r(H),width:"12",height:"12",fill:"#D35249"},null,8,["path"]),e(" Be careful ")]),tt]),t("div",st,[t("div",et,[ot,t("input",{value:s.name,type:"text",onInput:k},null,40,at),nt]),s.error?(i(),c("div",it,[u(_,{path:r(P),fill:"#D35249",width:"12",height:"12"},null,8,["path"]),e(" "+l(s.error),1)])):p("",!0),t("div",ct,[t("button",{class:"cancel-button",onClick:m},"Cancel"),t("button",{class:"save-button",onClick:h},[e(" Save Changes "),s.loading?(i(),S(B,{key:0,size:"16"})):p("",!0)])])])])):(i(),c("div",z,[t("div",F,[L,t("div",M,[e(" https://"),t("span",R,l(o.project.subdomain),1),e(".abstra.run/ ")])]),t("div",$,[q,t("div",J,[e(" https://"),t("span",K,l(o.project.subdomain),1),e(".abstra.run/[FORM ID] ")])]),t("div",Q,[G,t("div",U,[e(" https://hooks.abstra.cloud/"),t("span",W,l(o.project.subdomain),1),e("/[HOOK PATH] ")])]),t("button",{onClick:d},"Edit Subdomain")]))])}}});const dt=E(rt,[["__scopeId","data-v-334134e4"]]),lt={key:0,class:"project-settings"},yt=v({__name:"ProjectSettings",setup(o){const s=N().params.projectId,{result:d}=y(()=>j.get(s));return(m,h)=>r(d)?(i(),c("div",lt,[u(dt,{project:r(d)},null,8,["project"])])):p("",!0)}});export{yt as default};
//# sourceMappingURL=ProjectSettings.daead6cb.js.map
