import{a as S}from"./asyncComputed.8a644895.js";import{P as I}from"./project.9f45bccb.js";import"./gateway.6096f5a8.js";import{d as v,G as C,a as E,b as n,er as c,e as t,f as p,u as r,b0 as a,eA as _,eu as m,c as P,eB as f,eC as g,v as y,ey as D}from"./registerWidgets.1e9167ab.js";import"./index.11f5d4e4.js";import{n as x}from"./index.89742732.js";import{L as B}from"./CircularLoading.b699e65c.js";import{O as A,w as N,P as V}from"./icons.41af03d8.js";import"./activeRecord.60b6bd01.js";import"./pubsub.09eafe35.js";import"./passwordlessManager.b7f590c1.js";import"./storage.84fcb572.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]="8ab148ce-f234-456c-b675-fc901725a7c4",s._sentryDebugIdIdentifier="sentry-dbid-8ab148ce-f234-456c-b675-fc901725a7c4")}catch{}})();const i=s=>(f("data-v-73cc16b2"),s=s(),g(),s),$={class:"subdomain-editor"},H={class:"title"},L=i(()=>t("div",{class:"subtitle"}," Every project in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. ",-1)),T={key:0,class:"subdomain-presenter"},O={class:"link-item"},R=i(()=>t("div",{class:"link-title"},"Forms and Dashes available at:",-1)),z={class:"link"},F={class:"custom-subdomain"},G={class:"link-item"},M=i(()=>t("div",{class:"link-title"},"Hooks available at:",-1)),U={class:"link"},q={class:"custom-subdomain"},J={key:1,class:"subdomain-value-editor"},K={class:"subdomain-change-warning"},Q={class:"section-title"},W=i(()=>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=i(()=>t("span",null,"https://",-1)),tt=["value"],et=i(()=>t("span",null,".abstra.app",-1)),st={key:0,class:"error"},ot={class:"option-buttons"},at=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 n(),c("div",$,[t("h2",H,[p(u,{width:"22",height:"22",path:r(A),fill:"#414A58"},null,8,["path"]),a("Subdomain ")]),L,e.editing?(n(),c("div",J,[t("div",K,[t("div",Q,[p(u,{path:r(N),width:"12",height:"12",fill:"#D35249"},null,8,["path"]),a(" 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?(n(),c("div",st,[p(u,{path:r(V),fill:"#D35249",width:"12",height:"12"},null,8,["path"]),a(" "+_(e.error),1)])):m("",!0),t("div",ot,[t("button",{class:"cancel-button",onClick:h},"Cancel"),t("button",{class:"save-button",onClick:b},[a(" Save Changes "),e.loading?(n(),P(B,{key:0,size:"16"})):m("",!0)])])])])):(n(),c("div",T,[t("div",O,[R,t("div",z,[a(" https://"),t("span",F,_(l.project.subdomain),1),a(".abstra.app/[PATH] ")])]),t("div",G,[M,t("div",U,[a(" https://"),t("span",q,_(l.project.subdomain),1),a(".abstra.app/_hooks/[PATH] ")])]),t("button",{onClick:d},"Edit Subdomain")]))])}}});const nt=y(at,[["__scopeId","data-v-73cc16b2"]]),it=s=>(f("data-v-a75430c8"),s=s(),g(),s),ct={key:0,class:"project-settings"},rt=it(()=>t("div",{class:"header"},[t("div",{class:"title-wrapper"},[t("h1",null,"Project Settings")])],-1)),dt=v({__name:"ProjectSettings",setup(s){const e=D().params.projectId,{result:d}=S(()=>I.get(e));return(h,b)=>r(d)?(n(),c("div",ct,[rt,p(nt,{project:r(d)},null,8,["project"])])):m("",!0)}});const wt=y(dt,[["__scopeId","data-v-a75430c8"]]);export{wt as default};
//# sourceMappingURL=ProjectSettings.d25089b7.js.map
