var g=Object.defineProperty;var _=(a,t,e)=>t in a?g(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var u=(a,t,e)=>(_(a,typeof t!="symbol"?t+"":t,e),e);import{d as w,K as b,b as $,t as f,w as v,z as p,J as x,O as I,Q as C,x as l,S as h,q as j}from"./registerWidgets.7452ec0b.js";import{a as A}from"./asyncComputed.23d75013.js";import{A as P,C as s}from"./utils.e51f765d.js";import{C as B}from"./CrudView.2c6fede3.js";import"./passwordlessManager.abb9ad15.js";import"./pubsub.a0411919.js";import"./DropdownMenu.e6caac19.js";import"./CircularLoading.6725993e.js";import"./Modal.f31beab2.js";class S{constructor(){u(this,"urlPath","builds")}async create(t){return s.post(`projects/${t.projectId}/${this.urlPath}`,{})}async delete(t){await s.delete(`${this.urlPath}/${t}`)}async list(t){return s.get(`projects/${t}/${this.urlPath}`)}async get(t){return s.get(`${this.urlPath}/${t}`)}async update(t,e){return s.patch(`${this.urlPath}/${t}`,e)}async duplicate(t){return s.post(`${this.urlPath}/${t}/duplicate`,{})}}const r=new S;class o{constructor(t){u(this,"record");this.record=new P(r,t,"id")}static async list(t){return(await r.list(t)).map(i=>new o(i))}static async create(t){const e=await r.create({projectId:t});return new o(e)}static async get(t){const e=await r.get(t);return new o(e)}async delete(){await r.delete(this.id)}async save(){this.record.save()}hasChanges(){return this.record.hasChanges()}get id(){return this.record.get("id")}set id(t){this.record.set("id",t)}async duplicate(){return await r.duplicate(this.id)}get name(){return this.record.get("name")}set name(t){this.record.set("name",t)}get projectId(){return this.record.get("projectId")}get createdAt(){return this.record.get("createdAt")}get status(){return this.record.get("status")}}const k=a=>(I("data-v-1b7a68a8"),a=a(),C(),a),N=k(()=>l("div",{class:"instructions"},[h(" Get started with the local editor in seconds: "),l("pre",null,`    $ pip install abstra --upgrade
    $ abstra serve ./your-project-directory
    `),h(" And you're done! Explore the local editor and start building apps. ")],-1)),V=w({__name:"Builds",setup(a){const e=x().params.projectId,{loading:i,result:m}=A(()=>o.list(e)),y=b(()=>{var n,d;return{columns:[{name:"Id"},{name:"Creation date"},{name:"Status"}],rows:(d=(n=m.value)==null?void 0:n.map(c=>({key:c.id,cells:[{text:c.id,classes:["title","centered"]},{text:c.createdAt.toLocaleString(),classes:[]},{text:c.status,classes:["centered"]}]})))!=null?d:[]}});return(n,d)=>($(),f(B,{"entity-name":"build",loading:p(i),title:"Builds",description:"Each build is a version of your app. You can create a new build by deploying your app from the local editor.","empty-title":"No builds here yet",table:p(y)},{"empty-description":v(()=>[N]),_:1},8,["loading","table"]))}});const T=j(V,[["__scopeId","data-v-1b7a68a8"]]);export{T as default};
//# sourceMappingURL=Builds.e7a2f54f.js.map
