import{s as ie,n as oe,d as g,a as V,z as $e,w as d,i as H,b as c,A as Ve,c as y,e as $,f as b,g as O,B as ke,h as N,t as w,j as C,C as De,D as ze,q as Se,E as Me,F as Ae,o as x,k as Oe}from"../chunks/BeJwflgO.js";import{S as ce,i as fe,t as T,a as k,g as ue,c as de,d as me,m as pe,e as _e,b as he}from"../chunks/CXBIDK6p.js";import{W as z,e as Ee,c as Ce,d as Le,a as Ue,b as Fe}from"../chunks/B81L-OfO.js";import{r as Be,m as Ge,s as Pe,p as qe}from"../chunks/BU7plhYt.js";import{g as We}from"../chunks/CyVEvHZA.js";import{a as Qe,L as He}from"../chunks/8RsWtykp.js";import{p as Ie}from"../chunks/B9u33kEZ.js";import{g as Ke}from"../chunks/BQqikIAS.js";const Xe=!1,Ye=!1,pt=Object.freeze(Object.defineProperty({__proto__:null,prerender:Xe,ssr:Ye},Symbol.toStringTag,{value:"Module"}));function ye(r){let s,a=r[3](r[0].workspace)+"",e;return{c(){s=N("div"),e=w(a),this.h()},l(t){s=y(t,"DIV",{class:!0});var o=$(s);e=b(o,a),o.forEach(g),this.h()},h(){d(s,"class","mt-auto mb-2 mx-auto flex items-center justify-center h-10 px-6 border rounded-full")},m(t,o){H(t,s,o),c(s,e)},p(t,o){o&1&&a!==(a=t[3](t[0].workspace)+"")&&V(e,a)},d(t){t&&g(s)}}}function Je(r){let s,a,e,t=r[0].name+"",o,n,i=r[0].description+"",l,f,v=r[1]?`

${r[1]}`:"",M,j,m,p,S,P=r[0].name+"",K,ee,D,q=r[0].num_items+"",X,te,W=r[0].num_items>1?"s":"",Y,se,Q=r[0].size&&r[0].size!="Unknown"&&r[0].size!="N/A"?" - "+r[0].size:"",J,ae,E,L,ne,U,I,R,Z,re,le,ge,h=r[0].workspace!=z.UNDEFINED&&ye(r);return{c(){s=N("div"),a=N("div"),e=w("Name: "),o=w(t),n=w(`
    Description: `),l=w(i),f=C(),M=w(v),j=C(),m=N("button"),p=N("div"),S=N("h3"),K=w(P),ee=C(),D=N("p"),X=w(q),te=w(" item"),Y=w(W),se=C(),J=w(Q),ae=C(),E=De("svg"),L=De("path"),ne=C(),U=N("div"),I=N("img"),re=C(),h&&h.c(),this.h()},l(u){s=y(u,"DIV",{class:!0});var _=$(s);a=y(_,"DIV",{class:!0});var A=$(a);e=b(A,"Name: "),o=b(A,t),n=b(A,`
    Description: `),l=b(A,i),f=O(A),M=b(A,v),A.forEach(g),j=O(_),m=y(_,"BUTTON",{class:!0});var F=$(m);p=y(F,"DIV",{class:!0});var B=$(p);S=y(B,"H3",{class:!0});var ve=$(S);K=b(ve,P),ve.forEach(g),ee=O(B),D=y(B,"P",{class:!0});var G=$(D);X=b(G,q),te=b(G," item"),Y=b(G,W),se=O(G),J=b(G,Q),G.forEach(g),ae=O(B),E=ke(B,"svg",{xmlns:!0,height:!0,viewBox:!0,width:!0,class:!0});var be=$(E);L=ke(be,"path",{d:!0,fill:!0}),$(L).forEach(g),be.forEach(g),B.forEach(g),ne=O(F),U=y(F,"DIV",{class:!0});var we=$(U);I=y(we,"IMG",{src:!0,alt:!0,class:!0}),we.forEach(g),re=O(F),h&&h.l(F),F.forEach(g),_.forEach(g),this.h()},h(){d(a,"class","absolute bottom-full mb-2 w-96 bg-gray-800 text-white text-sm rounded-md px-4 py-2 shadow-lg whitespace-pre-line hidden group-hover:block z-10"),d(S,"class","text-lg w-5/6 font-semibold truncate text-primary"),d(D,"class","text-sm text-slate-500 font-medium"),d(L,"d",Qe),d(L,"fill","currentcolor"),d(E,"xmlns","http://www.w3.org/2000/svg"),d(E,"height","48"),d(E,"viewBox","0 -960 960 960"),d(E,"width","48"),d(E,"class","absolute right-5 h-8 w-8 mx-auto p-1 border text-slate-800 rounded-full border-slate-300 transition-colors hover:bg-slate-200"),d(p,"class","w-full h-1/4 pt-4 px-4 flex flex-col justify-center relative"),$e(I.src,R=r[0].preview?r[0].preview:Ie)||d(I,"src",R),d(I,"alt",Z=r[0].name+" thumbnail"),d(I,"class","w-[350px] h-[150px] rounded-sm object-contain object-center"),d(U,"class","m-4 bg-slate-50 flex items-center justify-center"),d(m,"class","w-96 h-72 flex flex-col text-left font-Montserrat bg-white rounded-sm shadow shadow-slate-300 transition-shadow hover:shadow-xl"),d(s,"class","relative group w-96")},m(u,_){H(u,s,_),c(s,a),c(a,e),c(a,o),c(a,n),c(a,l),c(a,f),c(a,M),c(s,j),c(s,m),c(m,p),c(p,S),c(S,K),c(p,ee),c(p,D),c(D,X),c(D,te),c(D,Y),c(D,se),c(D,J),c(p,ae),c(p,E),c(E,L),c(m,ne),c(m,U),c(U,I),c(m,re),h&&h.m(m,null),le||(ge=Ve(m,"click",r[2]),le=!0)},p(u,[_]){_&1&&t!==(t=u[0].name+"")&&V(o,t),_&1&&i!==(i=u[0].description+"")&&V(l,i),_&2&&v!==(v=u[1]?`

${u[1]}`:"")&&V(M,v),_&1&&P!==(P=u[0].name+"")&&V(K,P),_&1&&q!==(q=u[0].num_items+"")&&V(X,q),_&1&&W!==(W=u[0].num_items>1?"s":"")&&V(Y,W),_&1&&Q!==(Q=u[0].size&&u[0].size!="Unknown"&&u[0].size!="N/A"?" - "+u[0].size:"")&&V(J,Q),_&1&&!$e(I.src,R=u[0].preview?u[0].preview:Ie)&&d(I,"src",R),_&1&&Z!==(Z=u[0].name+" thumbnail")&&d(I,"alt",Z),u[0].workspace!=z.UNDEFINED?h?h.p(u,_):(h=ye(u),h.c(),h.m(m,null)):h&&(h.d(1),h=null)},i:oe,o:oe,d(u){u&&g(s),h&&h.d(),le=!1,ge()}}}function Re(r,s,a){let{dataset:e}=s,t;const o=new AbortController,n=ze();function i(){n("selectDataset")}function l(f){switch(f){case z.IMAGE:return"Image";case z.VIDEO:return"Video";case z.IMAGE_VQA:return"VQA";case z.IMAGE_TEXT_ENTITY_LINKING:return"Entity Linking";case z.PCL_3D:return"3D";case z.UNDEFINED:return"Undefined"}}return Se(()=>{We(e.id,null,{signal:o.signal}).then(f=>{if(o.signal.aborted)return;let v=0,M=0,j={};for(const m of f){if(v=Math.max(v,Object.keys(m.info.views).length),"info"in m&&"entities"in m.info)for(const p of Object.values(m.info.entities))M+=p.count;for(const[p,S]of Object.entries(m.info.annotations))p in j||(j[p]=0),j[p]+=S.count}a(1,t=`Maximum number of views: ${v}
        Total number of entities: ${M}
        Total annotation counts:`);for(const[m,p]of Object.entries(j))a(1,t+=`
${" ".repeat(6)}${m}: ${p}`)}).catch(f=>{console.log("Error collecting additional dataset infos",f)})}),Me(()=>{o.abort("aborted")}),r.$$set=f=>{"dataset"in f&&a(0,e=f.dataset)},[e,t,i,l]}class Ze extends ce{constructor(s){super(),fe(this,s,Re,Je,ie,{dataset:0})}}function Ne(r,s,a){const e=r.slice();return e[3]=s[a],e}function xe(r){let s,a;return s=new He({props:{class:"animate-spin"}}),{c(){he(s.$$.fragment)},l(e){_e(s.$$.fragment,e)},m(e,t){pe(s,e,t),a=!0},p:oe,i(e){a||(k(s.$$.fragment,e),a=!0)},o(e){T(s.$$.fragment,e),a=!1},d(e){me(s,e)}}}function et(r){let s,a,e=Ee(r[0]),t=[];for(let n=0;n<e.length;n+=1)t[n]=je(Ne(r,e,n));const o=n=>T(t[n],1,1,()=>{t[n]=null});return{c(){for(let n=0;n<t.length;n+=1)t[n].c();s=x()},l(n){for(let i=0;i<t.length;i+=1)t[i].l(n);s=x()},m(n,i){for(let l=0;l<t.length;l+=1)t[l]&&t[l].m(n,i);H(n,s,i),a=!0},p(n,i){if(i&3){e=Ee(n[0]);let l;for(l=0;l<e.length;l+=1){const f=Ne(n,e,l);t[l]?(t[l].p(f,i),k(t[l],1)):(t[l]=je(f),t[l].c(),k(t[l],1),t[l].m(s.parentNode,s))}for(ue(),l=e.length;l<t.length;l+=1)o(l);de()}},i(n){if(!a){for(let i=0;i<e.length;i+=1)k(t[i]);a=!0}},o(n){t=t.filter(Boolean);for(let i=0;i<t.length;i+=1)T(t[i]);a=!1},d(n){n&&g(s),Ae(t,n)}}}function Te(r){let s,a;function e(){return r[2](r[3])}return s=new Ze({props:{dataset:r[3]}}),s.$on("selectDataset",e),{c(){he(s.$$.fragment)},l(t){_e(s.$$.fragment,t)},m(t,o){pe(s,t,o),a=!0},p(t,o){r=t;const n={};o&1&&(n.dataset=r[3]),s.$set(n)},i(t){a||(k(s.$$.fragment,t),a=!0)},o(t){T(s.$$.fragment,t),a=!1},d(t){me(s,t)}}}function je(r){let s,a,e=!r[3].isFiltered&&Te(r);return{c(){e&&e.c(),s=x()},l(t){e&&e.l(t),s=x()},m(t,o){e&&e.m(t,o),H(t,s,o),a=!0},p(t,o){t[3].isFiltered?e&&(ue(),T(e,1,1,()=>{e=null}),de()):e?(e.p(t,o),o&1&&k(e,1)):(e=Te(t),e.c(),k(e,1),e.m(s.parentNode,s))},i(t){a||(k(e),a=!0)},o(t){T(e),a=!1},d(t){t&&g(s),e&&e.d(t)}}}function tt(r){let s,a,e,t;const o=[et,xe],n=[];function i(l,f){return l[0]?0:1}return a=i(r),e=n[a]=o[a](r),{c(){s=N("div"),e.c(),this.h()},l(l){s=y(l,"DIV",{class:!0});var f=$(s);e.l(f),f.forEach(g),this.h()},h(){d(s,"class","flex flex-wrap justify-center gap-6 py-12")},m(l,f){H(l,s,f),n[a].m(s,null),t=!0},p(l,[f]){let v=a;a=i(l),a===v?n[a].p(l,f):(ue(),T(n[v],1,1,()=>{n[v]=null}),de(),e=n[a],e?e.p(l,f):(e=n[a]=o[a](l),e.c()),k(e,1),e.m(s,null))},i(l){t||(k(e),t=!0)},o(l){T(e),t=!1},d(l){l&&g(s),n[a].d()}}}function st(r,s,a){let{datasets:e}=s;const t=async n=>{Ce.set(n),Le.set(Ue),await Ke(`${n.id}/dataset`)};Se(()=>{Be(),Ge.set({currentModalOpen:"none",selectedModelName:"",selectedTableName:"",yetToLoadEmbedding:!0}),Pe.set(qe)});const o=n=>t(n);return r.$$set=n=>{"datasets"in n&&a(0,e=n.datasets)},[e,t,o]}class at extends ce{constructor(s){super(),fe(this,s,st,tt,ie,{datasets:0})}}function nt(r){let s,a;return s=new at({props:{datasets:r[0]}}),{c(){he(s.$$.fragment)},l(e){_e(s.$$.fragment,e)},m(e,t){pe(s,e,t),a=!0},p(e,[t]){const o={};t&1&&(o.datasets=e[0]),s.$set(o)},i(e){a||(k(s.$$.fragment,e),a=!0)},o(e){T(s.$$.fragment,e),a=!1},d(e){me(s,e)}}}function rt(r,s,a){let e;return Oe(r,Fe,t=>a(0,e=t)),[e]}class _t extends ce{constructor(s){super(),fe(this,s,rt,nt,ie,{})}}export{_t as component,pt as universal};
