import{a as S}from"./asyncComputed.2c363ccc.js";import{P as I}from"./project.7c73974a.js";import"./console.526446d9.js";import{d as v,H as C,a as E,b as a,et as c,e as t,f as p,u as r,b2 as i,eC as _,ew as m,c as D,eD as f,eE as g,x as y,eA as P}from"./outputWidgets.d6897520.js";import"./index.a8a303e6.js";import{n as x}from"./index.40bea6c2.js";import{L as A}from"./CircularLoading.74c5b113.js";import{Q as B,w as N,R as H}from"./icons.20b5fc8a.js";import"./gateway.c13063b9.js";import"./activeRecord.e97440b4.js";import"./pubsub.e0b33cd4.js";import"./Form.a2bccbf0.js";import"./Title.9e102f51.js";import"./index.65fddafd.js";import"./index.dcf9fd0a.js";import"./index.09e1dc09.js";import"./dayjs.dccbdd6f.js";import"./index.0f5fc52a.js";import"./index.fd09b35e.js";import"./TabPane.c8258ec5.js";import"./index.b11f642a.js";import"./index.7c1a9101.js";import"./index.e63bacfa.js";import"./index.30191c77.js";import"./index.33e7eca5.js";import"./index.16598f32.js";import"./index.a2784b6b.js";import"./index.59123055.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[o]="d422f39e-2c1c-4258-81ba-413038960064",s._sentryDebugIdIdentifier="sentry-dbid-d422f39e-2c1c-4258-81ba-413038960064")}catch{}})();const n=s=>(f("data-v-73cc16b2"),s=s(),g(),s),V={class:"subdomain-editor"},$={class:"title"},L=n(()=>t("div",{class:"subtitle"}," Every project in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. ",-1)),R={key:0,class:"subdomain-presenter"},T={class:"link-item"},z=n(()=>t("div",{class:"link-title"},"Forms and Dashes available at:",-1)),F={class:"link"},M={class:"custom-subdomain"},O={class:"link-item"},Q=n(()=>t("div",{class:"link-title"},"Hooks available at:",-1)),U={class:"link"},q={class:"custom-subdomain"},G={key:1,class:"subdomain-value-editor"},J={class:"subdomain-change-warning"},K={class:"section-title"},W=n(()=>t("div",{class:"section-body"}," Changing the project's subdomain will result in the replacement of the previous URL, which may break any links you've shared previously. ",-1)),X={class:"input-section"},Y={class:"subdomain-value-input"},Z=n(()=>t("span",null,"https://",-1)),tt=["value"],et=n(()=>t("span",null,".abstra.app",-1)),st={key:0,class:"error"},ot={class:"option-buttons"},it=v({__name:"SubdomainEditor",props:{project:{}},setup(s){const o=s,e=C({name:o.project.subdomain,error:"",editing:!1,loading:!1}),d=()=>e.editing=!0,h=()=>{k(),e.editing=!1,e.error=""},b=async()=>{e.error="",e.loading=!0,await j(),e.error||(e.editing=!1),e.loading=!1},j=async()=>{if(!(!o.project||o.project.subdomain===e.name)){if(!e.name){e.error="Subdomain cannot be empty";return}o.project.subdomain=e.name,await o.project.save()}},k=()=>e.name=o.project.subdomain,w=l=>{e.name=x(l.target.value,{replacement:"-",lower:!0,strict:!0})};return(l,lt)=>{const u=E("icon");return a(),c("div",V,[t("h2",$,[p(u,{width:"22",height:"22",path:r(B),fill:"#414A58"},null,8,["path"]),i("Subdomain ")]),L,e.editing?(a(),c("div",G,[t("div",J,[t("div",K,[p(u,{path:r(N),width:"12",height:"12",fill:"#D35249"},null,8,["path"]),i(" Be careful ")]),W]),t("div",X,[t("div",Y,[Z,t("input",{value:e.name,type:"text",onInput:w},null,40,tt),et]),e.error?(a(),c("div",st,[p(u,{path:r(H),fill:"#D35249",width:"12",height:"12"},null,8,["path"]),i(" "+_(e.error),1)])):m("",!0),t("div",ot,[t("button",{class:"cancel-button",onClick:h},"Cancel"),t("button",{class:"save-button",onClick:b},[i(" Save Changes "),e.loading?(a(),D(A,{key:0,size:"16"})):m("",!0)])])])])):(a(),c("div",R,[t("div",T,[z,t("div",F,[i(" https://"),t("span",M,_(l.project.subdomain),1),i(".abstra.app/[PATH] ")])]),t("div",O,[Q,t("div",U,[i(" https://"),t("span",q,_(l.project.subdomain),1),i(".abstra.app/_hooks/[PATH] ")])]),t("button",{onClick:d},"Edit Subdomain")]))])}}});const at=y(it,[["__scopeId","data-v-73cc16b2"]]),nt=s=>(f("data-v-a75430c8"),s=s(),g(),s),ct={key:0,class:"project-settings"},rt=nt(()=>t("div",{class:"header"},[t("div",{class:"title-wrapper"},[t("h1",null,"Project Settings")])],-1)),dt=v({__name:"ProjectSettings",setup(s){const e=P().params.projectId,{result:d}=S(()=>I.get(e));return(h,b)=>r(d)?(a(),c("div",ct,[rt,p(at,{project:r(d)},null,8,["project"])])):m("",!0)}});const Tt=y(dt,[["__scopeId","data-v-a75430c8"]]);export{Tt as default};
//# sourceMappingURL=ProjectSettings.ca685df4.js.map
