import{d as f,o as y,K as b,H as v,b as _,eu as g,f as l,w as r,u as s,eP as w,bF as x,aq as d}from"./outputWidgets.225dd371.js";import{W as k}from"./workspaces.57178210.js";import{E as i}from"./envVars.fa2414d6.js";import{C}from"./CrudView.72bd6d5e.js";import{A as h}from"./index.480feb65.js";import"./runnerData.6fca8fdf.js";import"./url.29c1f37b.js";import"./record.b805ac15.js";import"./pubsub.3bce7ea8.js";import"./asyncComputed.8a54909a.js";import"./Paragraph.253f2b2e.js";import"./Text.a0f2d781.js";import"./Form.12e2d16e.js";import"./hasIn.1e38e049.js";import"./Modal.0a797886.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.c28d2d29.js";import"./router.8e23138d.js";import"./popupNotifcation.6873325b.js";import"./index.8e2737d3.js";import"./Title.bbb77099.js";import"./index.42c8bfb7.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]="deab45a9-8202-43ed-8ca3-8522a6ccffc8",a._sentryDebugIdIdentifier="sentry-dbid-deab45a9-8202-43ed-8ca3-8522a6ccffc8")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},J=f({__name:"EnvVarsEditor",setup(a){let o=null;y(()=>{o=setInterval(i.listComputed.refetch,2e3)}),b(()=>{o&&clearInterval(o)});function p(){var e;(e=k.computed.result.value)==null||e.openFile(".env")}const m=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],c=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=i.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:w,label:"Delete",onClick:()=>n.delete(),dangerous:!0}]}]})))!=null?t:[]}});async function u({key:e,value:t}){await i.create(e,t)}return(e,t)=>(_(),g("div",E,[l(C,{"entity-name":"Env var",loading:s(i).listComputed.loading.value,title:"Environment Variables",description:"Set environment variables for your project.","empty-title":"No environment variables set",table:c.value,"create-button-text":"Add Environment Variable",fields:m,live:"",onCreate:u},{secondary:r(()=>[l(s(x),{onClick:t[0]||(t[0]=n=>p())},{default:r(()=>[d("Open .env")]),_:1})]),extra:r(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[d(" 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"])]))}});export{J as default};
//# sourceMappingURL=EnvVarsEditor.47d5b8af.js.map
