import{d as f,o as y,L as b,H as v,b as _,ev as g,f as l,w as r,u as s,bG as w,ar as m}from"./outputWidgets.9bb29762.js";import{W as x}from"./workspaces.53f8033a.js";import{E as i}from"./envVars.f8fed0f5.js";import{i as k}from"./icons.d08bf04b.js";import{C}from"./CrudView.8ffa6c50.js";import{A as h}from"./index.15996575.js";import"./runnerData.84b552ce.js";import"./url.c222fac4.js";import"./record.dd7b0559.js";import"./pubsub.90d4935e.js";import"./asyncComputed.ac1a0197.js";import"./Paragraph.9dbf4710.js";import"./Base.abff5e35.js";import"./Typography.184e8c0b.js";import"./Form.472b1af8.js";import"./hasIn.fa8167cd.js";import"./Modal.8f9ba470.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.79f00877.js";import"./router.f15646c4.js";import"./popupNotifcation.b12790e0.js";import"./index.fcc99b17.js";import"./Title.b342fcc9.js";import"./Text.5324981a.js";import"./index.b2ab466e.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]="cbe5f75b-3a84-4202-bf29-a3b533d437a7",a._sentryDebugIdIdentifier="sentry-dbid-cbe5f75b-3a84-4202-bf29-a3b533d437a7")}catch{}})();const E={style:{display:"flex","flex-direction":"column","justify-content":"center",padding:"40px 120px"}},R=f({__name:"EnvVarsEditor",setup(a){let o=null;y(()=>{o=setInterval(i.listComputed.refetch,2e3)}),b(()=>{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=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: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{R as default};
//# sourceMappingURL=EnvVarsEditor.b72ba553.js.map
