import{d as y,o as f,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 p}from"./outputWidgets.b1e87772.js";import{W as k}from"./workspaces.56803bab.js";import{E as i}from"./envVars.205c1f47.js";import{C}from"./CrudView.cde29d2c.js";import{A as h}from"./index.0d1bf03c.js";import"./runnerData.95ea1f30.js";import"./url.105c4f84.js";import"./record.2f552fbf.js";import"./pubsub.8b7604ff.js";import"./asyncComputed.5830bf45.js";import"./Paragraph.72ff08f3.js";import"./Text.a2ac66f5.js";import"./Form.c64de99c.js";import"./hasIn.443af95b.js";import"./Modal.6f2aaf4e.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.370ccd6b.js";import"./router.a9e5af79.js";import"./popupNotifcation.6e758e81.js";import"./index.fae832ba.js";import"./Title.87ff1f7b.js";import"./index.78c9c56d.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]="ca417073-ab5a-4c99-89b1-c99dd7c6d1da",a._sentryDebugIdIdentifier="sentry-dbid-ca417073-ab5a-4c99-89b1-c99dd7c6d1da")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},J=y({__name:"EnvVarsEditor",setup(a){let o=null;f(()=>{o=setInterval(i.listComputed.refetch,2e3)}),b(()=>{o&&clearInterval(o)});function d(){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=>d())},{default:r(()=>[p("Open .env")]),_:1})]),extra:r(()=>[l(s(h),{"show-icon":"",style:{"margin-top":"20px"}},{message:r(()=>[p(" 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.bc730702.js.map
