import{a as D}from"./asyncComputed.fe6ca61b.js";import"./gateway.d1bcadc7.js";import{b as t,e6 as E,f4 as T,d as y,f as B,ei as F,g as p,c as x,w as l,u as n,o as j,az as u,d6 as S,d4 as N,d5 as c,a as v,eb as g,cs as U,da as V,bE as H,aP as R,cr as $,e4 as q,K as z,F as M}from"./index.6b1213c6.js";import{a as C}from"./project.b277ffd0.js";import"./columns.5cccb454.js";import{S as G}from"./SaveButton.f443a4e0.js";import{a as h}from"./index.1783fa94.js";import{A as J}from"./index.6b776599.js";import"./popupNotifcation.97dc9547.js";import"./record.9f32285a.js";import"./string.8a712bbd.js";import"./UnsavedChangesHandler.2bc8785e.js";import"./ExclamationCircleOutlined.e92280ca.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[o]="d1585bae-6fec-4156-91dc-8d38bd2a7fe5",r._sentryDebugIdIdentifier="sentry-dbid-d1585bae-6fec-4156-91dc-8d38bd2a7fe5")}catch{}})();function _(r){for(var o=1;o<arguments.length;o++){var e=arguments[o]!=null?Object(arguments[o]):{},a=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(a=a.concat(Object.getOwnPropertySymbols(e).filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),a.forEach(function(i){L(r,i,e[i])})}return r}function L(r,o,e){return o in r?Object.defineProperty(r,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[o]=e,r}var m=function(o,e){var a=_({},o,e.attrs);return t(E,_({},a,{icon:T}),null)};m.displayName="CopyOutlined";m.inheritAttrs=!1;const Q=m,W=y({__name:"SubdomainEditor",props:{project:{}},emits:["change-subdomain"],setup(r,{emit:o}){const e=r,a=B(void 0),i=F.exports.debounce(async()=>{try{const{available:s}=await e.project.checkSubdomain();a.value=s?"available":"unavailable"}catch{a.value=void 0}},500);function d(){if(!e.project.hasChangesDeep("subdomain")){a.value=void 0;return}e.project.subdomain?(a.value="loading",i()):a.value="invalid"}const f=p(()=>a.value!=="available"||!e.project.hasChangesDeep("subdomain")),w=async()=>{await navigator.clipboard.writeText(e.project.getUrl())},A=p(()=>{switch(a.value){case"invalid":return"error";case"loading":return"validating";case"available":return"success";case"unavailable":return"error";default:return}}),k=p(()=>{switch(a.value){case"loading":return"Checking availability...";case"available":return"Available";case"unavailable":return"Unavailable";case"invalid":return"Invalid subdomain";default:return}}),O=()=>{const s=C.formatSubdomain(e.project.subdomain);o("change-subdomain",s),d()};function P(){e.project.resetChanges(),a.value=void 0}return(s,b)=>(j(),x(n(J),{direction:"vertical"},{default:l(()=>[t(n(S),{level:2},{default:l(()=>[u("Subdomain")]),_:1}),t(n(N),null,{default:l(()=>[u(" Every project in Abstra Cloud comes with a default subdomain, which will appear on all shared project links. ")]),_:1}),t(n(h),null,{default:l(()=>[t(n(c),null,{default:l(()=>[u("Forms available at:")]),_:1}),t(n(c),{code:""},{default:l(()=>[v("span",null,g(s.project.getUrl("[PATH]")),1)]),_:1})]),_:1}),t(n(h),null,{default:l(()=>[t(n(c),null,{default:l(()=>[u("Hooks available at:")]),_:1}),t(n(c),{code:""},{default:l(()=>[v("span",null,g(s.project.getUrl("_hooks/[PATH]")),1)]),_:1})]),_:1}),t(n($),null,{default:l(()=>[t(n(U),{"validate-status":A.value,help:k.value,"has-feedback":""},{default:l(()=>[t(n(V),{gap:"middle"},{default:l(()=>[t(n(H),{value:s.project.subdomain,type:"text",loading:a.value==="loading",onBlur:O,onChange:b[0]||(b[0]=I=>o("change-subdomain",I.target.value))},{addonBefore:l(()=>[u("https://")]),addonAfter:l(()=>[u(".abstra.app/")]),_:1},8,["value","loading"]),t(n(R),{placement:"top",title:"Copy"},{default:l(()=>[t(n(Q),{color:"red",onClick:w})]),_:1})]),_:1})]),_:1},8,["validate-status","help"]),t(G,{model:s.project,disabled:f.value,onError:P},null,8,["model","disabled"])]),_:1})]),_:1}))}}),X={key:0,class:"project-settings"},de=y({__name:"ProjectSettings",setup(r){const e=q().params.projectId,{result:a}=D(()=>C.get(e)),i=d=>{a.value.subdomain=d};return(d,f)=>n(a)?(j(),z("div",X,[t(n(S),null,{default:l(()=>[u("Project Settings")]),_:1}),t(W,{project:n(a),onChangeSubdomain:i},null,8,["project"])])):M("",!0)}});export{de as default};
//# sourceMappingURL=ProjectSettings.7b616613.js.map
