import{a3 as h,U as _,a2 as g,p as de,s as l,c as s,R as f,a as p,b as ie,m as le,f as v,x as pe,cz as U,i as ce,a7 as ve,g as a,t as $,e as m,u as y,a8 as j,C as H,cA as ue,cB as me,z as xe,cC as fe}from"./index-B5w8gw75.js";var he=new Set(["$$slots","$$events","$$legacy"]);function _e(o,n){let d=g(n,he);const i=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];h(o,_({name:"circle-check-big"},()=>d,{get iconNode(){return i}}))}var ge=new Set(["$$slots","$$events","$$legacy"]);function be(o,n){let d=g(n,ge);const i=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];h(o,_({name:"download"},()=>d,{get iconNode(){return i}}))}var $e=new Set(["$$slots","$$events","$$legacy"]);function ye(o,n){let d=g(n,$e);const i=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}]];h(o,_({name:"shield"},()=>d,{get iconNode(){return i}}))}var ke=new Set(["$$slots","$$events","$$legacy"]);function we(o,n){let d=g(n,ke);const i=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];h(o,_({name:"trash"},()=>d,{get iconNode(){return i}}))}var Ae=v('

No apps available yet.

'),ze=v(' '),Ne=v(''),Se=v(''),Ie=v('
  • '),Me=v(''),Ce=v(`

    App Store

    Installable apps. Local bundles for now — a remote catalog + sandboxing is Phase 4.

    Installed apps appear on the desktop immediately. Uninstalling closes any open window for that app.

    `);function Le(o,n){de(n,!0);const d=()=>xe(fe,"$installedAppIds",i),[i,O]=le(),T=y(()=>new Set(d()));var k=Ce(),q=l(s(k),2),w=s(q);{var B=u=>{var x=Ae();p(u,x)},D=u=>{var x=Me();ce(x,21,()=>U,b=>b.manifest.id,(b,A)=>{const r=y(()=>a(A).manifest),E=y(()=>a(T).has(a(r).id));var z=Ie(),N=s(z),F=s(N);ve(F,()=>a(A).icon,(e,t)=>{t(e,{class:"size-5"})});var S=l(N,2),I=s(S),M=s(I),J=s(M),C=l(M,2),K=s(C),Q=l(C,2);{var W=e=>{var t=ze(),c=s(t);$(()=>m(c,`by ${a(r).author??""}`)),p(e,t)};f(Q,e=>{a(r).author&&e(W)})}var V=l(I,2),X=s(V),Y=l(V,2),L=s(Y);ye(L,{class:"size-3"});var Z=l(L,2),ee=s(Z);{var te=e=>{var t=j();$(c=>m(t,c),[()=>a(r).permissions.join(", ")]),p(e,t)},se=e=>{var t=j(`no permissions requested`);p(e,t)};f(ee,e=>{a(r).permissions.length?e(te):e(se,-1)})}var ae=l(S,2),re=s(ae);{var oe=e=>{var t=Ne(),c=s(t);we(c,{class:"size-3.5"}),H("click",t,()=>ue(a(r).id)),p(e,t)},ne=e=>{var t=Se(),c=s(t);be(c,{class:"size-3.5"}),H("click",t,()=>me(a(r).id)),p(e,t)};f(re,e=>{a(E)?e(oe):e(ne,-1)})}$(()=>{m(J,a(r).title),m(K,`v${a(r).version??""}`),m(X,a(r).description)}),p(b,z)}),p(u,x)};f(w,u=>{U.length===0?u(B):u(D,-1)})}var G=l(w,2),P=s(G),R=s(P);_e(R,{class:"size-3.5"}),p(o,k),ie(),O()}pe(["click"]);export{Le as default};