File size: 2,059 Bytes
36a9fc6
1
2
import{S as x,i as D,s as E,k as u,l as m,m as g,h as f,n as h,b as p,B as b,I as G,o as M,e as k,q as S,a as I,r as V,c as w,J as y,G as d,u as z}from"../../chunks/index-b346583a.js";function $(n,s,t){const e=n.slice();return e[2]=s[t],e}function j(n){let s,t,e=n[2].data.prompt+"",a,i,l,o,_;return{c(){s=u("div"),t=u("h1"),a=S(e),i=I(),l=u("img"),_=I(),this.h()},l(c){s=m(c,"DIV",{});var r=g(s);t=m(r,"H1",{class:!0});var v=g(t);a=V(v,e),v.forEach(f),i=w(r),l=m(r,"IMG",{loading:!0,src:!0,class:!0}),_=w(r),r.forEach(f),this.h()},h(){h(t,"class","text-black dark:text-white font-semibold p-2 min-h-[8ch] text-center"),h(l,"loading","lazy"),y(l.src,o=n[2].data.images[0])||h(l,"src",o),h(l,"class","")},m(c,r){p(c,s,r),d(s,t),d(t,a),d(s,i),d(s,l),d(s,_)},p(c,r){r&1&&e!==(e=c[2].data.prompt+"")&&z(a,e),r&1&&!y(l.src,o=c[2].data.images[0])&&h(l,"src",o)},d(c){c&&f(s)}}}function q(n){let s,t=n[2].data.images.length>0&&j(n);return{c(){t&&t.c(),s=k()},l(e){t&&t.l(e),s=k()},m(e,a){t&&t.m(e,a),p(e,s,a)},p(e,a){e[2].data.images.length>0?t?t.p(e,a):(t=j(e),t.c(),t.m(s.parentNode,s)):t&&(t.d(1),t=null)},d(e){t&&t.d(e),e&&f(s)}}}function B(n){let s,t=n[0],e=[];for(let a=0;a<t.length;a+=1)e[a]=q($(n,t,a));return{c(){s=u("div");for(let a=0;a<e.length;a+=1)e[a].c();this.h()},l(a){s=m(a,"DIV",{class:!0});var i=g(s);for(let l=0;l<e.length;l+=1)e[l].l(i);i.forEach(f),this.h()},h(){h(s,"class","grid grid-cols-4 gap-4 gap-4 p-3")},m(a,i){p(a,s,i);for(let l=0;l<e.length;l+=1)e[l].m(s,null)},p(a,[i]){if(i&1){t=a[0];let l;for(l=0;l<t.length;l+=1){const o=$(a,t,l);e[l]?e[l].p(o,i):(e[l]=q(o),e[l].c(),e[l].m(s,null))}for(;l<e.length;l+=1)e[l].d(1);e.length=t.length}},i:b,o:b,d(a){a&&f(s),G(e,a)}}}const C="https://huggingface.co/datasets/triple-t/dummy/raw/main/huggingface-projects_diffuse-the-rest.json";function H(n,s,t){let e=[];function a(){fetch(C).then(i=>i.json()).then(i=>{t(0,e=i)})}return M(()=>{a();const i=window.setInterval(a,2e3);return()=>{clearInterval(i)}}),[e]}class N extends x{constructor(s){super(),D(this,s,H,B,E,{})}}export{N as default};