import{g as A}from"./chunk-DV7LTUGD.js";import"./chunk-77YMVDAC.js";import"./chunk-ORHSDUMX.js";import{b as S,d as I}from"./chunk-XFS4SIQZ.js";import"./chunk-ZSSEAP7S.js";import{E as i,I as y,R as p,S as m,V as b,W as P,X as w,Y as a,Z as o,_ as g,ca as x,ea as u,ga as l,o as h,p as _,pa as c,q as v,qa as d,ra as f,x as C}from"./chunk-LH5Z5GGI.js";import"./chunk-C6Q5SG76.js";var E=(e,n)=>n.id;function k(e,n){if(e&1){let t=x();a(0,"div",2),g(1,"gt-icon",3),a(2,"p"),c(3),o(),a(4,"button",4),u("click",function(){_(t);let s=l();return v(s.reload())}),c(5),o()()}if(e&2){let t=l();i(3),d(t.store.syncError()),i(2),f(" ",t.i18n.t("common.retry")," ")}}function T(e,n){if(e&1&&(a(0,"div",2),g(1,"gt-icon",6),a(2,"p"),c(3),o()()),e&2){let t=l(2);i(3),d(t.i18n.t("proj.archived.empty"))}}function j(e,n){e&1&&g(0,"gt-icon",11)}function D(e,n){if(e&1){let t=x();a(0,"li",7)(1,"span",8),c(2),o(),a(3,"span",9),c(4),o(),a(5,"button",10),u("click",function(){let s=_(t).$implicit,O=l(3);return v(O.unarchive(s.id))}),p(6,j,1,0,"gt-icon",11),c(7),o()()}if(e&2){let t=n.$implicit,r=l(3);i(2),d(t.glyph),i(2),d(t.name),i(),w("disabled",r.unarchiving()===t.id),i(),m(r.unarchiving()===t.id?6:-1),i(),f(" ",r.i18n.t("proj.archived.unarchive")," ")}}function V(e,n){if(e&1&&(a(0,"ul",5),b(1,D,8,5,"li",7,E),o()),e&2){let t=l();i(),P(t)}}function F(e,n){e&1&&p(0,T,4,1,"div",2)(1,V,3,0,"ul",5),e&2&&m(n.length===0?0:1)}var M=class e{i18n=h(S);store=h(A);unarchiving=C(null);ngOnInit(){this.store.loadArchived()}reload(){this.store.loadArchived()}async unarchive(n){if(!this.unarchiving()){this.unarchiving.set(n);try{await this.store.unarchive(n)}finally{this.unarchiving.set(null)}}}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=y({type:e,selectors:[["page-archived"]],decls:8,vars:3,consts:[[1,"arch"],[1,"arch-head"],[1,"arch-empty"],["name","triangle-exclamation"],["type","button",1,"btn",3,"click"],[1,"arch-list"],["name","box-archive"],[1,"arch-item"],[1,"arch-glyph"],[1,"arch-name"],["type","button",1,"btn",3,"click","disabled"],["name","spinner",1,"spin"]],template:function(t,r){if(t&1&&(a(0,"section",0)(1,"header",1)(2,"h1"),c(3),o(),a(4,"p"),c(5),o()(),p(6,k,6,2,"div",2)(7,F,2,1),o()),t&2){let s;i(3),d(r.i18n.t("proj.archived.title")),i(2),d(r.i18n.t("proj.archived.lead")),i(),m(r.store.syncError()&&r.store.archivedList().length===0?6:(s=r.store.archivedList())?7:-1,s)}},dependencies:[I],styles:['.arch[_ngcontent-%COMP%]{max-width:760px;margin:0 auto;padding:28px 20px;width:100%}.arch-head[_ngcontent-%COMP%]   h1[_ngcontent-%COMP%]{font-family:var(--font-head, "Space Grotesk", sans-serif);font-size:var(--fs-xl, 24px);margin:0 0 4px}.arch-head[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{color:var(--fg-muted, #6b6b76);margin:0 0 22px}.arch-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:10px;padding:56px 20px;color:var(--fg-dim, #8c8c9c);text-align:center}.arch-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.arch-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--gl, rgba(0, 0, 0, .1));border-radius:var(--r-md, 12px);background:var(--glass-2, rgba(0, 0, 0, .02))}.arch-glyph[_ngcontent-%COMP%]{flex:none;width:28px;height:28px;display:grid;place-items:center;border-radius:8px;background:var(--glass-3, rgba(0, 0, 0, .04))}.arch-name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}'],changeDetection:0})};export{M as ArchivedPage};
