import{d as y,o as b,R as f,y as v,b as k,c as _,w as r,eL as g,f as i,u as s,bz as w,ak as m}from"./outputWidgets.f7b80e9f.js";import{E as l,W as C}from"./workspaces.9eccf428.js";import{C as x}from"./ContentLayout.129025ab.js";import{C as h}from"./CrudView.858975e6.js";import{A as E}from"./index.9a5a7c1a.js";import"./asyncComputed.bd2b6e70.js";import"./runnerData.5347d4ed.js";import"./url.882128c4.js";import"./record.188928bf.js";import"./pubsub.10df5fd2.js";import"./router.6fb3acdf.js";import"./gateway.58b63376.js";import"./popupNotifcation.6f5b518c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.b36f7510.js";import"./BookOutlined.12f9401e.js";import"./index.288a68e3.js";import"./index.86fdb625.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="400ae1d9-4395-4f75-b9d3-955b5c76ba67",a._sentryDebugIdIdentifier="sentry-dbid-400ae1d9-4395-4f75-b9d3-955b5c76ba67")}catch{}})();const S=y({__name:"EnvVarsEditor",setup(a){let o=null;b(()=>{o=setInterval(l.listComputed.refetch,2e3)}),f(()=>{o&&clearInterval(o)});function d(){var e;(e=C.computed.result.value)==null||e.openFile(".env")}const p=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"multiline-text"}],u=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=l.listComputed.result.value)==null?void 0:e.map(n=>({key:n.key,cells:[{type:"text",text:n.key},{text:n.value,type:"secret"},{type:"actions",actions:[{icon:g,label:"Delete",onClick:()=>n.delete(),dangerous:!0}]}]})))!=null?t:[]}});async function c({key:e,value:t}){await l.create(e,t)}return(e,t)=>(k(),_(x,null,{default:r(()=>[i(h,{"entity-name":"Env var",loading:s(l).listComputed.loading.value,title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:u.value,"create-button-text":"Add Environment Variable",fields:p,live:"",onCreate:c},{secondary:r(()=>[i(s(w),{onClick:t[0]||(t[0]=n=>d())},{default:r(()=>[m("Open .env")]),_:1})]),extra:r(()=>[i(s(E),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[m(" This is simply a helper to manage your environment variables locally. The variables set here will not be deployed to Cloud with your project. ")]),_:1})]),_:1},8,["loading","table"])]),_:1}))}});export{S as default};
//# sourceMappingURL=EnvVarsEditor.e53b0e00.js.map
