var u=Object.defineProperty;var y=(r,e,t)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var i=(r,e,t)=>(y(r,typeof e!="symbol"?e+"":e,t),t);import{d as b,ez as f,H as g,b as w,c as _,u as h}from"./outputWidgets.4420c31f.js";import"./router.141c8be7.js";import"./columns.d0453565.js";import{C as k}from"./gateway.c8298b74.js";import{A as v}from"./activeRecord.a89b1253.js";import{a as I}from"./asyncComputed.937eb3b8.js";import{C as D}from"./CrudView.4a9e50e2.js";import"./Title.f4c9dd29.js";import"./index.1ba1c343.js";import"./index.f4ac7424.js";import"./pubsub.1ac087cf.js";import"./icons.2ee60219.js";import"./index.6f566923.js";import"./Form.6825d217.js";import"./url.14f2bdd6.js";import"./index.32966139.js";import"./index.f4ff3772.js";import"./index.afb0f92e.js";import"./index.f792c329.js";import"./index.adf86569.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="0d877e51-736c-4554-ab9c-eabc4b2f8292",r._sentryDebugIdIdentifier="sentry-dbid-0d877e51-736c-4554-ab9c-eabc4b2f8292")}catch{}})();class C{constructor(){i(this,"urlPath","files")}async create(e){throw new Error("Not implemented")}async delete(e,t){throw new Error("Not implemented")}async get(e){throw new Error("Not implemented")}async update(e,t){throw new Error("Not implemented")}async list(e){return k.get(`projects/${e}/${this.urlPath}`)}}const l=new C;class c{constructor(e,t){i(this,"record");this.projectId=e,this.record=v.create(l,t,"id")}static async list(e){return(await l.list(e)).map(a=>new c(e,a))}get key(){return this.record.get("name")}get name(){return this.record.get("name")}get size(){return this.record.get("size")}get date(){return new Date(this.record.get("date"))}}const Q=b({__name:"Files",setup(r){const t=f().params.projectId,{loading:a,result:m}=I(()=>c.list(t)),d=[{label:"Variable name",key:"key"},{label:"Variable value",key:"value",type:"password"}],p=g(()=>{var s,n;return{columns:[{name:"Name"},{name:"Size"},{name:"Date"}],rows:(n=(s=m.value)==null?void 0:s.map(o=>({key:o.key,cells:[{text:o.key},{text:o.size.toString()},{text:o.date.toDateString()}]})))!=null?n:[]}});return(s,n)=>(w(),_(D,{"entity-name":"File",loading:h(a),title:"Files",description:"Persist files on your projects.","empty-title":"No environment variables set",table:p.value,fields:d},null,8,["loading","table"]))}});export{Q as default};
//# sourceMappingURL=Files.add223ac.js.map
