import{d as y,o as f,L as v,H as b,b as _,ev as g,f as l,w as r,u as s,bV as w,ar as m}from"./outputWidgets.6bfc0239.js";import{W as x}from"./workspaces.aee677ed.js";import{E as i}from"./envVars.75d5e3af.js";import{i as k}from"./icons.5f4f8713.js";import{C}from"./CrudView.26794284.js";import{A as h}from"./index.eba2f742.js";import"./runnerData.218d57bf.js";import"./url.c2408bab.js";import"./record.dbb754fe.js";import"./pubsub.56f48661.js";import"./asyncComputed.21831dee.js";import"./Paragraph.100fbd75.js";import"./Base.3f4f4c87.js";import"./Typography.7fe49268.js";import"./Form.7d1a8597.js";import"./hasIn.42df2c7d.js";import"./Modal.9595e4e0.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.77240f7b.js";import"./router.979769f7.js";import"./index.60dad040.js";import"./Title.84d6428e.js";import"./Text.3be64ce1.js";import"./index.ecc37a00.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]="6a406519-e8ce-4580-85a1-7ee2d852ea73",a._sentryDebugIdIdentifier="sentry-dbid-6a406519-e8ce-4580-85a1-7ee2d852ea73")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},Q=y({__name:"EnvVarsEditor",setup(a){let o=null;f(()=>{o=setInterval(i.listComputed.refetch,2e3)}),v(()=>{o&&clearInterval(o)});function p(){var e;(e=x.computed.result.value)==null||e.openFile(".env")}const d=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],u=b(()=>{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:k,label:"Delete",onClick:()=>n.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:d,live:"",onCreate:c},{secondary:r(()=>[l(s(w),{onClick:t[0]||(t[0]=n=>p())},{default:r(()=>[m("Open .env")]),_:1})]),extra:r(()=>[l(s(h),{"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"])]))}});export{Q as default};
//# sourceMappingURL=EnvVarsEditor.c062ef1d.js.map
