import{d as y,o as b,L as f,H as v,b as _,ev as g,f as l,w as r,u as s,bG as w,ar as d}from"./outputWidgets.3c3deba7.js";import{W as x}from"./workspaces.3c7e2f6c.js";import{E as i}from"./envVars.7d9f90ff.js";import{i as k}from"./icons.c5a369ef.js";import{C}from"./CrudView.44eff915.js";import{A as h}from"./index.288cdbc6.js";import"./runnerData.f4df2a42.js";import"./url.89508003.js";import"./record.e2163ce9.js";import"./pubsub.59f66cb7.js";import"./asyncComputed.41e37f4b.js";import"./Paragraph.d0a77c93.js";import"./Base.c0a62eaa.js";import"./Typography.828881b4.js";import"./Form.21b032af.js";import"./hasIn.26cab181.js";import"./Modal.ace70b58.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.86e502f6.js";import"./router.2687a12c.js";import"./index.c3c37865.js";import"./Title.ee2bfa7b.js";import"./Text.9ff37267.js";import"./index.66ff16a7.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="b72446ee-255b-4de8-a1a4-5b640d59d09b",n._sentryDebugIdIdentifier="sentry-dbid-b72446ee-255b-4de8-a1a4-5b640d59d09b")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},Q=y({__name:"EnvVarsEditor",setup(n){let o=null;b(()=>{o=setInterval(i.listComputed.refetch,2e3)}),f(()=>{o&&clearInterval(o)});function p(){var e;(e=x.computed.result.value)==null||e.openFile(".env")}const m=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],u=v(()=>{var e,t;return{columns:[{name:"Key"},{name:"Value"},{name:""}],rows:(t=(e=i.listComputed.result.value)==null?void 0:e.map(a=>({key:a.key,cells:[{type:"text",text:a.key},{text:a.value,type:"secret"},{type:"actions",actions:[{icon:k,label:"Delete",onClick:()=>a.delete(),dangerous:!0}]}]})))!=null?t:[]}});async function c({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:u.value,"create-button-text":"Add Environment Variable",fields:m,live:"",onCreate:c},{secondary:r(()=>[l(s(w),{onClick:t[0]||(t[0]=a=>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{Q as default};
//# sourceMappingURL=EnvVarsEditor.7353f79b.js.map
