lightly-studio 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lightly-studio might be problematic. Click here for more details.
- lightly_studio/__init__.py +1 -2
- lightly_studio/api/db_tables.py +3 -0
- lightly_studio/api/routes/api/dataset.py +5 -3
- lightly_studio/api/routes/api/embeddings2d.py +4 -16
- lightly_studio/core/dataset_query/dataset_query.py +98 -2
- lightly_studio/core/dataset_query/sample_field.py +11 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.B-Bn8V7R.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/Samples.CTl60pQb.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.CxuTMeYy.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/transform.Bte-FZ4V.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{ChlxSwqI.js → 7XnHnNk_.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DthpwYR_.js → BDE1kT04.js} +2 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{D8ZGoCPm.js → BHoO7UL_.js} +2 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{BiGQqqJP.js → BTpMiPuk.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BbG6fgnL.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Bip0vTKl.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{BrNKoXwc.js → BzYRexN9.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{CP9M7pei.js → C5oezL0m.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CEPpkZIV.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/ChO13USc.js +96 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{ClzkJBWk.js → CmNXvs5e.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DUtlYNuP.js → D9WxTSWa.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DELrRF6e.js +4 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{BtXGzlpP.js → DFib3GIP.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DMJzr1NB.js → DeAqvaPB.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DgCXCApo.js +438 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DqhovIS0.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/{app.Y-sSoz5q.js → app.CED-eiXl.js} +2 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.D6UcpqyO.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{0.0Fm6E-5B.js → 0.waSqEGqm.js} +2 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{1.DB-0vkHb.js → 1.Bb_sKkYl.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{10.vaUePh5k.js → 10.D9Uicmfq.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{11.7i7ljNVT.js → 11.DKnK0EcJ.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/13.D7dGgxYC.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{2.Drwwdm7A.js → 2.BzK1sjoM.js} +138 -100
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{3.D3X_-Wan.js → 3.B08UPFst.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{4.C9TqY3tA.js → 4.C19_Nx95.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.B2cR7brs.js +39 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{6.fqfYR7dB.js → 6.C9Y2LZxG.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{7.C7gMM-gk.js → 7.CEbWmgIF.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.Con-GcPz.js +20 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{9.DbHcSiMn.js → 9.DW7FBNNH.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/version.json +1 -1
- lightly_studio/dist_lightly_studio_view_app/index.html +7 -8
- lightly_studio/models/annotation/annotation_base.py +9 -0
- lightly_studio/models/dataset.py +6 -0
- lightly_studio/models/sample.py +1 -1
- lightly_studio/models/two_dim_embedding.py +16 -0
- lightly_studio/resolvers/annotation_resolver/get_all.py +3 -1
- lightly_studio/resolvers/dataset_resolver.py +18 -1
- lightly_studio/resolvers/sample_embedding_resolver.py +44 -2
- lightly_studio/resolvers/sample_resolver.py +1 -3
- lightly_studio/resolvers/twodim_embedding_resolver.py +93 -3
- lightly_studio/selection/select.py +70 -1
- lightly_studio/selection/selection_config.py +1 -1
- {lightly_studio-0.4.0.dist-info → lightly_studio-0.4.1.dist-info}/METADATA +1 -1
- {lightly_studio-0.4.0.dist-info → lightly_studio-0.4.1.dist-info}/RECORD +58 -58
- lightly_studio/dataset/loader.py +0 -581
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.CN4hnTks.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/Samples.C0_eo9eP.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.kFFGI0zL.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/transform.sLzR40om.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BOmrKuMn.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BPpOWbDa.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BaFFwDFr.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BsaJCCG_.js +0 -96
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CWuDkrMZ.js +0 -436
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DyIcJj6J.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/WEyXQRi6.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.CvxVp0Cu.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/13.9qy3WtZv.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.iRw6HCWX.js +0 -39
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.C4v1w-oS.js +0 -20
- {lightly_studio-0.4.0.dist-info → lightly_studio-0.4.1.dist-info}/WHEEL +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var lt=e=>{throw TypeError(e)};var H=(e,t,s)=>t.has(e)||lt("Cannot "+s);var n=(e,t,s)=>(H(e,t,"read from private field"),s?s.call(e):t.get(e)),y=(e,t,s)=>t.has(e)?lt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),l=(e,t,s,a)=>(H(e,t,"write to private field"),a?a.call(e,s):t.set(e,s),s),f=(e,t,s)=>(H(e,t,"access private method"),s);import{d as Ct,e as St,g as Et,f as Qt,h as Ft,i as At,j as Mt,k as xt,l as Ut,u as Dt,m as qt,n as Tt,o as Lt,p as Kt}from"./BaFFwDFr.js";import{aN as jt,o as G,m as nt,w as Bt}from"./C3xJX0nD.js";import{u as rt}from"./BOmrKuMn.js";import{S as kt,p as ft,r as R,s as J,a as V,n as _t,i as yt,b as pt,t as Pt,f as Vt,c as zt,d as bt,e as wt,g as Nt,h as Wt}from"./CANX9QXL.js";var O,r,k,m,M,T,S,w,_,L,K,x,U,E,j,i,B,X,Y,Z,$,tt,et,st,Rt,vt,Ht=(vt=class extends kt{constructor(t,s){super();y(this,i);y(this,O);y(this,r);y(this,k);y(this,m);y(this,M);y(this,T);y(this,S);y(this,w);y(this,_);y(this,L);y(this,K);y(this,x);y(this,U);y(this,E);y(this,j,new Set);this.options=s,l(this,O,t),l(this,w,null),l(this,S,ft()),this.options.experimental_prefetchInRender||n(this,S).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(n(this,r).addObserver(this),mt(n(this,r),this.options)?f(this,i,B).call(this):this.updateResult(),f(this,i,$).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return at(n(this,r),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return at(n(this,r),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,f(this,i,tt).call(this),f(this,i,et).call(this),n(this,r).removeObserver(this)}setOptions(t,s){const a=this.options,o=n(this,r);if(this.options=n(this,O).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof R(this.options.enabled,n(this,r))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");f(this,i,st).call(this),n(this,r).setOptions(this.options),a._defaulted&&!J(this.options,a)&&n(this,O).getQueryCache().notify({type:"observerOptionsUpdated",query:n(this,r),observer:this});const u=this.hasListeners();u&&Ot(n(this,r),o,this.options,a)&&f(this,i,B).call(this),this.updateResult(s),u&&(n(this,r)!==o||R(this.options.enabled,n(this,r))!==R(a.enabled,n(this,r))||V(this.options.staleTime,n(this,r))!==V(a.staleTime,n(this,r)))&&f(this,i,X).call(this);const d=f(this,i,Y).call(this);u&&(n(this,r)!==o||R(this.options.enabled,n(this,r))!==R(a.enabled,n(this,r))||d!==n(this,E))&&f(this,i,Z).call(this,d)}getOptimisticResult(t){const s=n(this,O).getQueryCache().build(n(this,O),t),a=this.createResult(s,t);return Jt(this,a)&&(l(this,m,a),l(this,T,this.options),l(this,M,n(this,r).state)),a}getCurrentResult(){return n(this,m)}trackResult(t,s){const a={};return Object.keys(t).forEach(o=>{Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),s==null||s(o),t[o])})}),a}trackProp(t){n(this,j).add(t)}getCurrentQuery(){return n(this,r)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=n(this,O).defaultQueryOptions(t),a=n(this,O).getQueryCache().build(n(this,O),s);return a.fetch().then(()=>this.createResult(a,s))}fetch(t){return f(this,i,B).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),n(this,m)))}createResult(t,s){var dt;const a=n(this,r),o=this.options,u=n(this,m),d=n(this,M),p=n(this,T),I=t!==a?t.state:n(this,k),{state:c}=t;let h={...c},F=!1,g;if(s._optimisticResults){const b=this.hasListeners(),D=!b&&mt(t,s),q=b&&Ot(t,a,s,o);(D||q)&&(h={...h,...zt(c.data,t.options)}),s._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:ot,errorUpdatedAt:ut,status:A}=h;if(s.select&&h.data!==void 0)if(u&&h.data===(d==null?void 0:d.data)&&s.select===n(this,_))g=n(this,L);else try{l(this,_,s.select),g=s.select(h.data),g=bt(u==null?void 0:u.data,g,s),l(this,L,g),l(this,w,null)}catch(b){l(this,w,b)}else g=h.data;if(s.placeholderData!==void 0&&g===void 0&&A==="pending"){let b;if(u!=null&&u.isPlaceholderData&&s.placeholderData===(p==null?void 0:p.placeholderData))b=u.data;else if(b=typeof s.placeholderData=="function"?s.placeholderData((dt=n(this,K))==null?void 0:dt.state.data,n(this,K)):s.placeholderData,s.select&&b!==void 0)try{b=s.select(b),l(this,w,null)}catch(D){l(this,w,D)}b!==void 0&&(A="success",g=bt(u==null?void 0:u.data,b,s),F=!0)}n(this,w)&&(ot=n(this,w),g=n(this,L),ut=Date.now(),A="error");const z=h.fetchStatus==="fetching",N=A==="pending",W=A==="error",ct=N&&z,ht=g!==void 0,v={status:A,fetchStatus:h.fetchStatus,isPending:N,isSuccess:A==="success",isError:W,isInitialLoading:ct,isLoading:ct,data:g,dataUpdatedAt:h.dataUpdatedAt,error:ot,errorUpdatedAt:ut,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>I.dataUpdateCount||h.errorUpdateCount>I.errorUpdateCount,isFetching:z,isRefetching:z&&!N,isLoadingError:W&&!ht,isPaused:h.fetchStatus==="paused",isPlaceholderData:F,isRefetchError:W&&ht,isStale:it(t,s),refetch:this.refetch,promise:n(this,S)};if(this.options.experimental_prefetchInRender){const b=P=>{v.status==="error"?P.reject(v.error):v.data!==void 0&&P.resolve(v.data)},D=()=>{const P=l(this,S,v.promise=ft());b(P)},q=n(this,S);switch(q.status){case"pending":t.queryHash===a.queryHash&&b(q);break;case"fulfilled":(v.status==="error"||v.data!==q.value)&&D();break;case"rejected":(v.status!=="error"||v.error!==q.reason)&&D();break}}return v}updateResult(t){const s=n(this,m),a=this.createResult(n(this,r),this.options);if(l(this,M,n(this,r).state),l(this,T,this.options),n(this,M).data!==void 0&&l(this,K,n(this,r)),J(a,s))return;l(this,m,a);const o={},u=()=>{if(!s)return!0;const{notifyOnChangeProps:d}=this.options,p=typeof d=="function"?d():d;if(p==="all"||!p&&!n(this,j).size)return!0;const C=new Set(p??n(this,j));return this.options.throwOnError&&C.add("error"),Object.keys(n(this,m)).some(I=>{const c=I;return n(this,m)[c]!==s[c]&&C.has(c)})};(t==null?void 0:t.listeners)!==!1&&u()&&(o.listeners=!0),f(this,i,Rt).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&f(this,i,$).call(this)}},O=new WeakMap,r=new WeakMap,k=new WeakMap,m=new WeakMap,M=new WeakMap,T=new WeakMap,S=new WeakMap,w=new WeakMap,_=new WeakMap,L=new WeakMap,K=new WeakMap,x=new WeakMap,U=new WeakMap,E=new WeakMap,j=new WeakMap,i=new WeakSet,B=function(t){f(this,i,st).call(this);let s=n(this,r).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(_t)),s},X=function(){f(this,i,tt).call(this);const t=V(this.options.staleTime,n(this,r));if(yt||n(this,m).isStale||!pt(t))return;const a=Pt(n(this,m).dataUpdatedAt,t)+1;l(this,x,setTimeout(()=>{n(this,m).isStale||this.updateResult()},a))},Y=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(n(this,r)):this.options.refetchInterval)??!1},Z=function(t){f(this,i,et).call(this),l(this,E,t),!(yt||R(this.options.enabled,n(this,r))===!1||!pt(n(this,E))||n(this,E)===0)&&l(this,U,setInterval(()=>{(this.options.refetchIntervalInBackground||Vt.isFocused())&&f(this,i,B).call(this)},n(this,E)))},$=function(){f(this,i,X).call(this),f(this,i,Z).call(this,f(this,i,Y).call(this))},tt=function(){n(this,x)&&(clearTimeout(n(this,x)),l(this,x,void 0))},et=function(){n(this,U)&&(clearInterval(n(this,U)),l(this,U,void 0))},st=function(){const t=n(this,O).getQueryCache().build(n(this,O),this.options);if(t===n(this,r))return;const s=n(this,r);l(this,r,t),l(this,k,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},Rt=function(t){wt.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(n(this,m))}),n(this,O).getQueryCache().notify({query:n(this,r),type:"observerResultsUpdated"})})},vt);function Gt(e,t){return R(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mt(e,t){return Gt(e,t)||e.state.data!==void 0&&at(e,t,t.refetchOnMount)}function at(e,t,s){if(R(t.enabled,e)!==!1){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&it(e,t)}return!1}function Ot(e,t,s,a){return(e!==t||R(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&it(e,s)}function it(e,t){return R(t.enabled,e)!==!1&&e.isStaleByTime(V(t.staleTime,e))}function Jt(e,t){return!J(e.getCurrentResult(),t)}function Xt(){return Nt()}function Yt(e){return Wt()}function Zt(e){return"subscribe"in e&&typeof e.subscribe=="function"}function $t(){}function te(e,t,s){const a=Yt(),o=Xt(),u=Zt(e)?e:jt(e),d=G([u,o],([c,h])=>{const F=a.defaultQueryOptions(c);return F._optimisticResults=h?"isRestoring":"optimistic",F}),p=new t(a,nt(d));d.subscribe(c=>{p.setOptions(c,{listeners:!1})});const C=G(o,(c,h)=>{const F=c?$t:p.subscribe(wt.batchCalls(h));return p.updateResult(),F}),{subscribe:I}=G([C,d],([c,h])=>(c=p.getOptimisticResult(h),h.notifyOnChangeProps?c:p.trackResult(c)));return{subscribe:I}}function ee(e,t){return te(e,Ht)}function ge(e){return e}const Q=(e,t,s)=>{const a={_id:e,baseUrl:(t==null?void 0:t.baseUrl)||((t==null?void 0:t.client)??Ct).getConfig().baseUrl};return s&&(a._infinite=s),t!=null&&t.body&&(a.body=t.body),t!=null&&t.headers&&(a.headers=t.headers),t!=null&&t.path&&(a.path=t.path),t!=null&&t.query&&(a.query=t.query),[a]},It=(e,t)=>{const s={...e[0]};return t.body&&(s.body={...e[0].body,...t.body}),t.headers&&(s.headers={...e[0].headers,...t.headers}),t.path&&(s.path={...e[0].path,...t.path}),t.query&&(s.query={...e[0].query,...t.query}),s},se=e=>Q("readSample",e),ve=e=>({queryFn:async({queryKey:t,signal:s})=>{const{data:a}=await Mt({...e,...t[0],signal:s,throwOnError:!0});return a},queryKey:se(e)}),we=e=>({mutationFn:async s=>{const{data:a}=await Qt({...e,...s,throwOnError:!0});return a}}),ae=e=>Q("readAnnotationLabels",e),Re=e=>({queryFn:async({queryKey:t,signal:s})=>{const{data:a}=await xt({...e,...t[0],signal:s,throwOnError:!0});return a},queryKey:ae(e)}),Ie=e=>({mutationFn:async s=>{const{data:a}=await At({...e,...s,throwOnError:!0});return a}}),ne=e=>Q("readAnnotations",e,!0),Ce=e=>({queryFn:async({pageParam:t,queryKey:s,signal:a})=>{const u=It(s,typeof t=="object"?t:{query:{cursor:t}}),{data:d}=await Tt({...e,...u,signal:a,throwOnError:!0});return d},queryKey:ne(e)}),Se=e=>({mutationFn:async s=>{const{data:a}=await Ft({...e,...s,throwOnError:!0});return a}}),Ee=e=>({mutationFn:async s=>{const{data:a}=await Dt({...e,...s,throwOnError:!0});return a}}),re=e=>Q("countAnnotationsByDataset",e),Qe=e=>({queryFn:async({queryKey:t,signal:s})=>{const{data:a}=await Ut({...e,...t[0],signal:s,throwOnError:!0});return a},queryKey:re(e)}),Fe=e=>({mutationFn:async s=>{const{data:a}=await St({...e,...s,throwOnError:!0});return a}}),ie=e=>Q("getAnnotation",e),Ae=e=>({queryFn:async({queryKey:t,signal:s})=>{const{data:a}=await Lt({...e,...t[0],signal:s,throwOnError:!0});return a},queryKey:ie(e)}),oe=e=>Q("readCaptions",e,!0),Me=e=>({queryFn:async({pageParam:t,queryKey:s,signal:a})=>{const u=It(s,typeof t=="object"?t:{query:{cursor:t}}),{data:d}=await qt({...e,...u,signal:a,throwOnError:!0});return d},queryKey:oe(e)}),ue=e=>Q("get2dEmbeddings",e),xe=e=>({queryFn:async({queryKey:t,signal:s})=>{const{data:a}=await Kt({...e,...t[0],signal:s,throwOnError:!0});return a},queryKey:ue(e)}),ce=e=>Q("getMetadataInfo",e),he=e=>({queryFn:async({queryKey:t,signal:s})=>{const{data:a}=await Et({...e,...t[0],signal:s,throwOnError:!0});return a},queryKey:ce(e)}),gt=Bt(!1),de=async e=>{if(nt(gt))return;const t=he({path:{dataset_id:e}});ee(t).subscribe(a=>{if(a.data){const o=a.data,{updateMetadataBounds:u,updateMetadataValues:d,updateMetadataInfo:p}=rt(),C={},I={};o.forEach(c=>{(c.type==="integer"||c.type==="float")&&c.min!=null&&c.max!=null&&(C[c.name]={min:c.min,max:c.max},I[c.name]={min:c.min,max:c.max})}),u(C),d(I),p(o),gt.set(!0)}})},le=e=>{const t=[],{metadataBounds:s}=rt();for(const[a,o]of Object.entries(e)){const d=nt(s)[a];d&&(o.min>d.min&&t.push({key:a,value:o.min,op:">="}),o.max<d.max&&t.push({key:a,value:o.max,op:"<="}))}return t},Ue=e=>{e&&de(e);const{metadataBounds:t,metadataValues:s,metadataInfo:a,updateMetadataValues:o,updateMetadataBounds:u,updateMetadataInfo:d}=rt();return{metadataBounds:t,metadataValues:s,metadataInfo:a,updateMetadataValues:o,updateMetadataBounds:u,updateMetadataInfo:d,createMetadataFilters:le}};export{Ht as Q,Se as a,Ie as b,le as c,Fe as d,we as e,ve as f,ee as g,Ue as h,Qe as i,xe as j,te as k,Zt as l,Ee as m,$t as n,Ce as o,Re as p,Ae as q,Me as r,ge as s,Yt as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./CWj6FrbW.js";import"./69_IOA4Y.js";import{b as w}from"./D8ZGoCPm.js";import{p as X}from"./BPpOWbDa.js";import{m as H}from"./C3xJX0nD.js";let P;const D="en",k=["en","de"];let L=()=>D;const Q=t=>{typeof t=="function"?L=C(t):L=C(()=>t),P!==void 0&&P(L())};function C(t){return()=>{const n=t();if(!A(n))throw new Error("languageTag() didn't return a valid language tag. Check your setLanguageTag call");return n}}const Y=t=>{P=t};function A(t){return k.includes(t)}const q=Object.freeze(Object.defineProperty({__proto__:null,availableLanguageTags:k,isAvailableLanguageTag:A,get languageTag(){return L},onSetLanguageTag:Y,setLanguageTag:Q,sourceLanguageTag:D},Symbol.toStringTag,{value:"Module"}));function G(t,n){if(t==="")return"";const e=new URL(t,n).pathname;return e.endsWith("/")?e.slice(0,-1):e}function S(t,n){const e=V(t),o=J(e,n),[s,a]=Z(o);return[s,a]}const B=(t,n,e)=>[n,t,e??""].filter(o=>o!=="/").join("")||"/";function J(t,n){const e=t.replace(n,"");return e.startsWith("/")?e:`/${e}`}function Z(t){const e=["/.html__data.json","/__data.json"].find(o=>t.endsWith(o));return e?[t.slice(0,-e.length)||"/",e]:[t,void 0]}function V(t){try{return decodeURI(t)}catch{return t}}const tt=t=>({url:n})=>{try{const[e,o]=S(n.pathname,w),s=t.getLanguageFromLocalisedPath(e);if(!s)return n.pathname;const a=t.getCanonicalPath(e,s);return B(a,w,o)}catch{return n.pathname}};function et(t){return`/${t.split("/").filter(Boolean).join("/")}`}function nt(t){const n=t.map(e=>typeof e=="string"?o=>o===e:o=>e.test(o));return e=>n.some(o=>o(et(e)))}const T="rtl",R="ltr";function rt(t){try{const n=new Intl.Locale(t);return"textInfo"in n?n.textInfo.direction===T?T:R:n.getTextInfo().direction===T?T:R}catch{return R}}function ot(t){const n=t.map(e=>[e,rt(e)]);return Object.fromEntries(n)}const at=0,F=1,$=2,it=4,p=0,v=1,b=2;function st(t){const n=ct(ut);return t.sort((e,o)=>{var s,a,i,c,r,u;const f=z(e).map(n),l=z(o).map(n);for(let g=0;g<Math.max(f.length,l.length);g+=1){const m=f[g],x=l[g];if(!m)return-1;if(!x)return 1;for(let _=0;_<Math.max(m.length,x.length);_+=1){const h=m[_],d=x[_];if((h==null?void 0:h[p])||(d==null?void 0:d[p])){if(!h)return-1;if(!d)return 1;const y=((s=m[_+1])==null?void 0:s[v])||((i=(a=f[g+1])==null?void 0:a[0])==null?void 0:i[v]),I=((c=x[_+1])==null?void 0:c[v])||((u=(r=l[g+1])==null?void 0:r[0])==null?void 0:u[v]),K=y&&I,O=y&&!I,W=!y&&I;if((h[p]&&d[p])===$){if(K)continue;if(O)return-1;if(W)return 1}if(h[p]===$)return O?-1:1;if(d[p]===$)return W?1:-1;if(h[b]!==d[b])return(-1)**+h[b];if(h[p]!==d[p])return(-1)**+(h[p]>d[p])}else if((h==null?void 0:h[v])!==(d==null?void 0:d[v]))return lt(h[v],d[v])}}return e<o?1:-1})}function ct(t){const n=new Map;return e=>(n.has(e)||n.set(e,t(e)),n.get(e))}function ut(t){const n=[];let e=0;for(;e<=t.length;){const o=t.indexOf("[",e),s=o===-1;if(n.push([at,t.slice(e,s?void 0:o),!1]),s)break;const a=t[o+1]==="["?F:t[o+1]==="."?$:it,i=a===F?"]]":"]",c=t.indexOf(i,o);if(c===-1)throw new Error(`Invalid route definition ${t}`);const r=t.slice(o,e=c+i.length);n.push([a,r,r.includes("=")])}return n}const z=t=>t.replace(/\[\[[^\]]+\]\](?!$)/g,"").split("/").filter(Boolean);function lt(t,n){if(t===n)return 0;let e=0;for(;t[e]===n[e];)e++;return t[e]?n[e]?t[e]<n[e]?-1:1:-1:1}const ft=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function gt(t){const n=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${U(t).map(o=>{const s=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(o);if(s)return n.push({name:s[1],matcher:s[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const a=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(o);if(a)return n.push({name:a[1],matcher:a[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!o)return;const i=o.split(/\[(.+?)\](?!\])/);return"/"+i.map((r,u)=>{if(u%2){if(r.startsWith("x+"))return j(String.fromCharCode(parseInt(r.slice(2),16)));if(r.startsWith("u+"))return j(String.fromCharCode(...r.slice(2).split("-").map(_=>parseInt(_,16))));const f=ft.exec(r);if(!f)throw new Error(`Invalid param: ${r}`);const[,l,g,m,x]=f;return n.push({name:m,matcher:x,optional:!!l,rest:!!g,chained:g?u===1&&i[0]==="":!1}),g?"(.*?)":l?"([^/]*)?":"([^/]+?)"}return j(r)}).join("")}).join("")}/?$`),params:n}}function ht(t,n,e){const o={},s=t.slice(1),a=s.filter(c=>c!==void 0);let i=0;for(const[c,r]of n.entries()){let u=s[c-i];if(r.chained&&r.rest&&i&&(u=s.slice(c-i,c+1).filter(l=>l).join("/"),i=0),u===void 0){r.rest&&(o[r.name]="");continue}if(r.matcher&&!e[r.matcher])return;if((e[r.matcher]??(()=>!0))(u)){o[r.name]=u;const l=n[c+1],g=s[c+1];l&&!l.rest&&l.optional&&g&&r.chained&&(i=0),!l&&!g&&Object.keys(o).length===a.length&&(i=0);continue}if(r.optional&&r.chained){i++;continue}return}if(!i)return o}function j(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}const dt=/\[(\[)?(\.\.\.)?(\w+?)(?:=(\w+))?\]\]?/g;function M(t,n){return"/"+U(t).map(e=>e.replace(dt,(o,s,a,i)=>{const c=n[i];if(!c){if(s||a&&c!==void 0)return"";throw new Error(`Missing parameter '${i}' in route ${t}`)}if(c[0]=="/"||c.endsWith("/"))throw new Error(`Parameter '${i}' in route ${t} cannot start or end with a slash`);return c})).filter(Boolean).join("/")}function N(t,n,e){const o=st(n);for(const s of o){const a=gt(s),i=a.pattern.exec(pt(t));if(!i)continue;const c=ht(i,a.params,e);if(c)return{params:c,id:s}}}const pt=t=>t.endsWith("/")?t.slice(0,-1):t,U=t=>t.slice(1).split("/");function mt(t,n,e,o,s){function a(r){const f=r.split("/")[1];if(t.includes(f)&&(s==="always"||f!==n))return f;if(s==="never")return n}function i(r,u){const f=r.endsWith("/")&&r!=="/";r=f?r.slice(0,-1):r;let l=vt(r,u,e,o);return f&&(l+="/"),(s==="always"||u!==n)&&(l=`/${u}${l}`),l}function c(r,u){const f=r.endsWith("/")&&r!=="/";(s==="always"||u!==n)&&(r=r.replace(`/${u}`,"")||"/");const l=f;r=l?r.slice(0,-1):r;let g=_t(r,u,e,o);return l&&(g+="/"),g}return{getLanguageFromLocalisedPath:a,getLocalisedPath:i,getCanonicalPath:c}}function _t(t,n,e,o){for(const[s,a]of Object.entries(e)){if(!(n in a))continue;const i=a[n];if(!i)continue;const c=N(t,[i],o);if(c)return M(s,c.params)}return t}function vt(t,n,e,o){const s=N(t,Object.keys(e),o);if(!s)return t;const a=e[s.id];if(!a)return t;const i=a[n];return i?M(i,s.params):t}function xt(t,n){const e={},o=[],s=t.sourceLanguageTag,a={defaultLanguageTag:s,runtime:t,translations:e,matchers:{},exclude:nt(o),prefixDefaultLanguage:"never",textDirection:ot(t.availableLanguageTags),seo:{noAlternateLinks:!1}},i=mt(t.availableLanguageTags,s,a.translations,a.matchers,a.prefixDefaultLanguage);return Object.freeze(e),Object.freeze(a),{config:a,strategy:i,reroute:()=>tt(i),handle:()=>{throw new Error("")},getLanguageFromUrl(c){const r=E(w),[u]=S(c.pathname,r);return a.exclude(u)?a.defaultLanguageTag:i.getLanguageFromLocalisedPath(u)||a.defaultLanguageTag},resolveRoute(c,r=void 0){if(a.exclude(c))return c;const u=E(w),[f,l]=S(c,u);if(r=r??t.languageTag(),!c.startsWith(u))return c;const g=i.getLocalisedPath(f,r);return B(g,u,l)},route(c){const r=E(w),[u,f]=S(c,r),g=i.getLanguageFromLocalisedPath(u)||a.defaultLanguageTag,m=i.getCanonicalPath(u,g);return B(m,r,f)}}}function E(t){return t===""?"":t.startsWith("/")?t:G(t,new URL(H(X).url))}const It=xt(q);export{It as i,G as n,S as p,B as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,e as r}from"../chunks/D8ZGoCPm.js";export{o as load_css,r as start};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as I,m as r,p as $,f as j,a as y,$ as N,g as h,b as v}from"../chunks/C3xJX0nD.js";import{c as P}from"../chunks/BaFFwDFr.js";import{c as L}from"../chunks/DyIcJj6J.js";import{u as A}from"../chunks/BOmrKuMn.js";import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{e as k}from"../chunks/SiegjVo0.js";import{c as E,a as T}from"../chunks/CAPx0Bfm.js";import{i as D,a as O,s as F}from"../chunks/DmGM9V9Q.js";import{p as x}from"../chunks/DUtlYNuP.js";import{g as b}from"../chunks/D8ZGoCPm.js";import{r as w}from"../chunks/ChlxSwqI.js";import{S as M}from"../chunks/DNJnBfHs.js";const z=({dataset_id:n,sampleIndex:s,tagIds:a,annotationLabelIds:u,min_width:f,max_width:l,min_height:o,max_height:p,textEmbedding:m,metadataValues:c})=>{const i=I({isLoading:!1});return(async()=>{i.update(e=>({...e,isLoading:!0,error:void 0}));try{const{data:e}=await P({path:{dataset_id:n},body:{pagination:{offset:s<1?0:s-1,limit:3},filters:{annotation_label_ids:u,tag_ids:a,width:{min:f,max:l},height:{min:o,max:p},metadata_filters:c?L(c):void 0},text_embedding:m},throwOnError:!0}),{setSamplesTotalCount:t}=A();t(e==null?void 0:e.total_count);let d;const g=s>0?e.data[0]:void 0;e.data.length>2&&(d=s==0?e.data[1]:e.data[2]),i.update(S=>({...S,isLoading:!1,sampleNext:d,samplePrevious:g,error:void 0}))}catch(e){i.update(t=>({...t,isLoading:!1,error:e.message||"Failed to load adjacent samples"}))}})(),i},C=async({parent:n,params:{dataset_id:s,sampleId:a,sampleIndex:u}})=>{var _,e,t,d,g;const{samplesSelectedTagsIds:f,samplesSelectedAnnotationLabelsIds:l,samplesDimensions:o,samplesTextEmbedding:p}=await n(),m=parseInt(u,10),{metadataValues:c}=A();return{sampleAdjacents:z({dataset_id:s,sampleIndex:m,tagIds:Array.from(r(f)),annotationLabelIds:Array.from(r(l)),min_width:(_=r(o))==null?void 0:_.min_width,max_width:(e=r(o))==null?void 0:e.max_width,min_height:(t=r(o))==null?void 0:t.min_height,max_height:(d=r(o))==null?void 0:d.max_height,textEmbedding:(g=r(p))==null?void 0:g.embedding,metadataValues:r(c)}),sampleIndex:m}},ee=Object.freeze(Object.defineProperty({__proto__:null,load:C},Symbol.toStringTag,{value:"Module"}));function G(n,s){$(s,!0);const a=()=>F(h(o),"$sampleAdjacents",u),[u,f]=O(),l=v(()=>x.data.sampleIndex),o=v(()=>x.data.sampleAdjacents),p=()=>{a().sampleNext&&b(w.toSample({sampleId:a().sampleNext.sample_id,datasetId:a().sampleNext.dataset_id,sampleIndex:h(l)+1}),{invalidateAll:!0})},m=()=>{a().samplePrevious&&b(w.toSample({sampleId:a().samplePrevious.sample_id,datasetId:a().samplePrevious.dataset_id,sampleIndex:h(l)-1}),{invalidateAll:!0})},c=t=>{switch(t.key){case"ArrowRight":p();break;case"ArrowLeft":m();break}};var i=E();k("keydown",N,c);var _=j(i);{var e=t=>{{let d=v(()=>!!a().samplePrevious),g=v(()=>!!a().sampleNext);M(t,{get hasPrevious(){return h(d)},get hasNext(){return h(g)},onPrevious:m,onNext:p})}};D(_,t=>{a()&&t(e)})}T(n,i),y(),f()}function ae(n){G(n,{})}export{ae as component,ee as universal};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import"../chunks/CWj6FrbW.js";import{p as gt,f as _,n as le,a as ht,am as te,g as t,b as r,s as h,c as I,r as A,t as mt,m as ft,u as He,Z as s,al as $,ab as ee,$ as ae}from"../chunks/C3xJX0nD.js";import{c as Q,a as c,f as tt,t as ne,d as $t}from"../chunks/CAPx0Bfm.js";import{s as It}from"../chunks/DoEId1MK.js";import{i as Y,s as G,a as Nt}from"../chunks/DmGM9V9Q.js";import{p as yt}from"../chunks/DUtlYNuP.js";import{I as ie,o as Fe,p as ze,q as Ne,r as Xe,t as At,v as Ye,w as Ze,_ as Ue,x as Ke,y as Oe,z as je,C as Ge,B as Ve,D as We,R as qe,n as Je,E as Qe,F as ta}from"../chunks/CWuDkrMZ.js";import{u as de}from"../chunks/BOmrKuMn.js";import{u as ce,k as ea,t as ut,c as H,e as aa,b as na}from"../chunks/DthpwYR_.js";import"../chunks/ClzkJBWk.js";import"../chunks/BaFFwDFr.js";import"../chunks/69_IOA4Y.js";import{a as oa,g as sa}from"../chunks/D8ZGoCPm.js";import"../chunks/gBp1tBnA.js";import{e as oe}from"../chunks/SiegjVo0.js";import{s as ue,r as me,p as ra,b as se}from"../chunks/xQhUoIl9.js";import{S as la}from"../chunks/BiGQqqJP.js";import{r as St}from"../chunks/ChlxSwqI.js";import{s as re}from"../chunks/CpbA3HU7.js";import{B as ia,a as da,b as wt,c as Ft,H as ca,d as zt,D as ua,e as ma,u as ge,Z as ga,g as ha}from"../chunks/BsaJCCG_.js";import{a as va,b as fa,d as pa,e as _a}from"../chunks/DyIcJj6J.js";function ba(u,e){gt(e,!0);/**
|
|
2
|
-
* @license @lucide/svelte v0.482.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
7
|
-
*
|
|
8
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
10
|
-
* copyright notice and this permission notice appear in all copies.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
13
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
14
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
15
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
16
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
17
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
18
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
-
*
|
|
20
|
-
*/let m=me(e,["$$slots","$$events","$$legacy"]);const l=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["circle",{cx:"10",cy:"12",r:"2"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22"}]];ie(u,ue({name:"file-image"},()=>m,{get iconNode(){return l},children:(n,i)=>{var d=Q(),p=_(d);It(p,()=>e.children??le),c(n,d)},$$slots:{default:!0}})),ht()}function xa(u,e){gt(e,!0);/**
|
|
21
|
-
* @license @lucide/svelte v0.482.0 - ISC
|
|
22
|
-
*
|
|
23
|
-
* ISC License
|
|
24
|
-
*
|
|
25
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
26
|
-
*
|
|
27
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
28
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
29
|
-
* copyright notice and this permission notice appear in all copies.
|
|
30
|
-
*
|
|
31
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
32
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
33
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
34
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
35
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
36
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
37
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
38
|
-
*
|
|
39
|
-
*/let m=me(e,["$$slots","$$events","$$legacy"]);const l=[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18"}],["circle",{cx:"12",cy:"8",r:"2"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2"}]];ie(u,ue({name:"images"},()=>m,{get iconNode(){return l},children:(n,i)=>{var d=Q(),p=_(d);It(p,()=>e.children??le),c(n,d)},$$slots:{default:!0}})),ht()}var wa=tt('<!> <span class="hidden sm:inline">Home</span>',1),ya=tt('<!> <span class="max-w-[150px] truncate"> </span>',1),Sa=tt('<!> <span class="hidden sm:inline">Samples</span>',1),$a=tt('<!> <span class="max-w-[200px] truncate"><!></span>',1),Ia=tt("<!> <!> <!> <!> <!> <!> <!>",1);function Aa(u,e){gt(e,!0);const m=()=>G(i,"$samplesTotalCount",l),[l,n]=Nt(),{samplesTotalCount:i}=de();ia(u,{class:"mb-2","data-testid":"sample-details-breadcrumb",children:(d,p)=>{da(d,{children:(et,ot)=>{var F=Ia(),w=_(F);wt(w,{children:(P,V)=>{{let g=r(()=>St.toHome());Ft(P,{get href(){return t(g)},class:"flex items-center gap-2",children:(M,T)=>{var b=wa(),y=_(b);ca(y,{class:"h-4 w-4"}),te(2),c(M,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var z=h(w,2);zt(z,{});var C=h(z,2);wt(C,{children:(P,V)=>{{let g=r(()=>St.toSamples(e.dataset.dataset_id));Ft(P,{get href(){return t(g)},class:"flex items-center gap-2",children:(M,T)=>{var b=ya(),y=_(b);ua(y,{class:"h-4 w-4"});var B=h(y,2),at=I(B,!0);A(B),mt(()=>re(at,e.dataset.name)),c(M,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var Z=h(C,2);zt(Z,{});var N=h(Z,2);wt(N,{children:(P,V)=>{{let g=r(()=>St.toSamples(e.dataset.dataset_id));Ft(P,{get href(){return t(g)},class:"flex items-center gap-2",children:(M,T)=>{var b=Sa(),y=_(b);xa(y,{class:"h-4 w-4"}),te(2),c(M,b)},$$slots:{default:!0}})}},$$slots:{default:!0}});var st=h(N,2);zt(st,{});var rt=h(st,2);wt(rt,{children:(P,V)=>{ma(P,{class:"flex items-center gap-2",children:(g,M)=>{var T=$a(),b=_(T);ba(b,{class:"h-4 w-4"});var y=h(b,2),B=I(y);{var at=W=>{var lt=ne();mt(()=>re(lt,`Sample ${e.sampleIndex+1} of ${m()??""}`)),c(W,lt)},Pt=W=>{var lt=ne("Sample");c(W,lt)};Y(B,W=>{e.sampleIndex!==void 0?W(at):W(Pt,!1)})}A(y),c(g,T)},$$slots:{default:!0}})},$$slots:{default:!0}}),c(et,F)},$$slots:{default:!0}})},$$slots:{default:!0}}),ht(),n()}function Pa(u,e){gt(e,!0);const m=()=>G(t(F),"$annotationResp",i),l=()=>G(t(Z),"$sample",i),n=()=>G(et,"$showAnnotationTextLabelsStore",i),[i,d]=Nt(),p=ra(e,"isResizable",3,!1),{showAnnotationTextLabelsStore:et}=ce(),ot=r(()=>Xe({datasetId:e.datasetId,annotationId:e.annotationId})),F=r(()=>t(ot).annotation),w=r(()=>t(ot).updateAnnotation);let z=r(()=>m().data);const C=r(()=>ge({sampleId:e.sampleId,datasetId:e.datasetId})),Z=r(()=>t(C).sample);let N=r(()=>m().data?Fe(m().data):void 0);const st=g=>{(async()=>{try{await t(w)({annotation_id:e.annotationId,dataset_id:e.datasetId,bounding_box:g})}catch(T){console.error("Failed to update annotation:",T.message)}})()};var rt=Q(),P=_(rt);{var V=g=>{var M=Q(),T=_(M);ea(T,()=>t(N),b=>{ze(b,{get groupId(){return t(z).annotation_id},get onSelect(){return e.toggleAnnotationSelection},get box(){return t(N)},get isSelected(){return e.isSelected},children:(y,B)=>{{let at=r(()=>({x:0,y:0,width:l().data.width,height:l().data.height}));Ne(y,{get annotation(){return t(z)},get showLabel(){return n()},get imageWidth(){return l().data.width},get constraintBox(){return t(at)},get isResizable(){return p()},onBoundingBoxChanged:st})}},$$slots:{default:!0}})}),c(g,M)};Y(P,g=>{t(z)&&l().data&&t(N)&&g(V)})}c(u,rt),ht(),d()}const Ma=({datasetId:u})=>{const e=At(va());return e.subscribe(()=>{}),{createAnnotation:l=>new Promise((n,i)=>{ft(e).mutate({path:{dataset_id:u},body:l},{onSuccess:d=>{n(d)},onError:d=>{i(d)}})})}},Ba=()=>{const u=At(fa());return u.subscribe(()=>{}),{createLabel:m=>new Promise((l,n)=>{ft(u).mutate({body:m},{onSuccess:i=>{l(i)},onError:i=>{n(i)}})})}},ka=({datasetId:u})=>{const e=At(pa());return e.subscribe(()=>{}),{deleteAnnotation:l=>new Promise((n,i)=>{ft(e).mutate({path:{dataset_id:u,annotation_id:l}},{onSuccess:()=>{n()},onError:d=>{i(d)}})})}},Ea=({datasetId:u})=>{const e=At(_a());return e.subscribe(()=>{}),{removeTagFromSample:(l,n)=>new Promise((i,d)=>{ft(e).mutate({path:{dataset_id:u,sample_id:l,tag_id:n}},{onSuccess:()=>i(),onError:p=>d(p)})})}};var Ra=$t('<line x1="0" stroke-width="1" vector-effect="non-scaling-stroke" stroke-dasharray="5,5" opacity="0.6"></line><line y1="0" vector-effect="non-scaling-stroke" stroke-width="1" stroke-dasharray="5,5" opacity="0.6"></line>',1),Ca=$t('<rect class="select-none" fill="transparent" role="button" style="outline: 0;cursor: crosshair;" tabindex="0"></rect>'),Ta=$t("<g><!><!><!></g><!>",1),Da=$t("<image></image><!>",1),La=tt('<div class="h-full w-full overflow-hidden"><div class="sample relative h-full w-full"><div class="absolute right-4 top-2 z-30"><!></div> <!> <!></div></div>'),Ha=tt('<div class="flex h-full w-full flex-col space-y-4"><div class="flex w-full items-center"><!></div> <!> <div class="flex min-h-0 flex-1 gap-4"><div class="flex-1"><!></div> <div class="relative w-[375px]"><!></div></div></div>');function Fa(u,e){gt(e,!0);const m=()=>G(T,"$labels",p),l=()=>G(y,"$isEditingMode",p),n=()=>G(t(V),"$sample",p),i=()=>G(ot,"$selectedSampleIds",p),d=()=>G(z,"$isHidden",p),[p,et]=Nt(),{selectedSampleIds:ot,toggleSampleSelection:F}=de(),w=e.dataset.dataset_id,{isHidden:z,handleKeyEvent:C}=Ye(),{settingsStore:Z}=ce(),{deleteAnnotation:N}=ka({datasetId:w}),{removeTagFromSample:st}=Ea({datasetId:w}),rt=()=>{sa(St.toSamples(w))},P=r(()=>ge({sampleId:e.sampleId,datasetId:w})),V=r(()=>t(P).sample),g=r(()=>t(P).refetch),{createAnnotation:M}=Ma({datasetId:w}),T=Ze(),{createLabel:b}=Ba(),{isEditingMode:y}=yt.data.globalStorage;let B=$(!1);const at=async({x:a,y:o,width:k,height:D,labelName:v})=>{if(!m().data)return;let E=m().data.find(x=>x.annotation_label_name===v);E||(E=await b({annotation_label_name:v}));try{const x=await M({sample_id:e.sampleId,annotation_type:"object_detection",x:Math.round(a),y:Math.round(o),width:Math.round(k),height:Math.round(D),annotation_label_id:E.annotation_label_id});return t(g)(),s(U,x.annotation_id,!0),ut.success("Annotation created successfully"),x}catch(x){ut.error("Failed to create annotation. Please try again."),console.error("Error creating annotation:",x);return}},Pt=a=>{switch(a.key){case ft(Z).key_go_back:rt();break;case" ":a.preventDefault(),a.stopPropagation(),console.log("space pressed in sample details"),l()?s(B,!0):F(e.sampleId);break}C(a)},W=a=>{a.key===" "&&s(B,!1),C(a)};let lt=r(()=>ha(e.sampleId)),U=$(void 0),Xt=$(void 0);oa(()=>{var a;s(U,void 0),s(Zt,void 0),(a=t(Xt))==null||a(),s(vt,!1),s(O,void 0)});const Yt=a=>{t(B)||(t(U)===a?s(U,void 0):s(U,a,!0))};let Zt=$(void 0),it=$(!1),S=$(null),q=$(null),K=$(null);const he=()=>{s(it,!1),s(S,null),s(K,null)};let vt=$(!1);const Ut=10,ve=()=>{if(!t(q))return;const a=Oe(t(q));let o=null;const k=je().on("start",D=>{if(!t(vt))return;s(it,!0);const v=t(q).getBoundingClientRect(),E=D.sourceEvent.clientX,x=D.sourceEvent.clientY,L=(E-v.left)/v.width*n().data.width,R=(x-v.top)/v.height*n().data.height;o={x:L,y:R},s(S,{x:L,y:R,width:0,height:0},!0),s(K,{x:L,y:R},!0)}).on("drag",D=>{if(!t(S)||!t(it)||!o)return;const v=t(q).getBoundingClientRect(),E=D.sourceEvent.clientX,x=D.sourceEvent.clientY;let L=(E-v.left)/v.width*n().data.width,R=(x-v.top)/v.height*n().data.height;const Et=n().data.width,Rt=n().data.height;L=Math.max(0,Math.min(L,Et)),R=Math.max(0,Math.min(R,Rt));const nt=Math.min(o.x,L),dt=Math.min(o.y,R),Ct=Math.abs(L-o.x),jt=Math.abs(R-o.y);s(S,{x:nt,y:dt,width:Ct,height:jt},!0),s(K,{x:L,y:R},!0)}).on("end",()=>{!t(S)||!t(it)||(t(S).width>Ut&&t(S).height>Ut&&t(O)&&at({x:t(S).x,y:t(S).y,width:t(S).width,height:t(S).height,labelName:t(O).label}),he(),o=null)});return a.call(k),a.on("mousemove",pe),()=>{k.on("start",null).on("drag",null).on("end",null)}},fe=a=>{if(!t(q)||t(it))return;const o=t(q).getBoundingClientRect(),k=a.clientX,D=a.clientY,v=(k-o.left)/o.width*n().data.width,E=(D-o.top)/o.height*n().data.height;s(K,{x:v,y:E},!0),a.stopPropagation(),a.preventDefault()},pe=Ue.throttle(fe,50);He(()=>{ve(),t(V).subscribe(a=>{if(a.isSuccess&&a.data){let o=Ke(a.data);s(Mt,o,!0)}else s(Mt,[],!0)})});let O=$(void 0),Mt=$(ee([])),pt=$(ee(new Set));const _e=a=>{const o=new Set(t(pt));o.has(a)?o.delete(a):o.add(a),s(pt,o,!0)},be=r(()=>t(Mt).filter(a=>!t(pt).has(a.annotation_id))),Bt=r(()=>t(O)?Qe(t(O).label,1).color:"blue"),xe=async a=>{if(!n().data)return;(async()=>{try{await N(a),ut.success("Annotation deleted successfully"),t(g)(),t(U)===a&&s(U,void 0)}catch(k){ut.error("Failed to delete annotation. Please try again."),console.error("Error deleting annotation:",k)}})()},we=async a=>{try{await st(e.sampleId,a),ut.success("Tag removed successfully"),t(g)()}catch(o){ut.error("Failed to remove tag. Please try again."),console.error("Error removing tag from sample:",o)}},ye=r(()=>t(B)?"grab":t(kt)?"crosshair":"auto"),Se=r(()=>l()&&!t(B)),kt=r(()=>t(vt)&&!t(B)&&t(O)!==void 0);let Kt=$(null);var Ot=Q();oe("keydown",ae,Pt),oe("keyup",ae,W);var $e=_(Ot);{var Ie=a=>{var o=Ha(),k=I(o),D=I(k);Aa(D,{get dataset(){return e.dataset},get sampleIndex(){return e.sampleIndex}}),A(k);var v=h(k,2);la(v,{class:"mb-4 bg-border-hard"});var E=h(v,2),x=I(E),L=I(x);Ge(L,{className:"h-full",children:(nt,dt)=>{Ve(nt,{className:"h-full",children:(Ct,jt)=>{var Tt=La(),Dt=I(Tt),Lt=I(Dt),Pe=I(Lt);{let J=r(()=>i().has(e.sampleId));We(Pe,{onSelect:()=>F(e.sampleId),get isSelected(){return t(J)}})}A(Lt);var Gt=h(Lt,2);{var Me=J=>{var ct=Q(),_t=_(ct);It(_t,()=>e.children),c(J,ct)};Y(Gt,J=>{e.children&&J(Me)})}var Be=h(Gt,2);ga(Be,{get width(){return n().data.width},get height(){return n().data.height},get cursor(){return t(ye)},get boundingBox(){return t(Zt)},registerResetFn:ct=>s(Xt,ct,!0),zoomableContent:ct=>{var _t=Da(),Vt=_(_t),ke=h(Vt);{var Ee=Ht=>{var Wt=Ta(),bt=_(Wt);let qt;var Jt=I(bt);aa(Jt,17,()=>t(be),f=>f.annotation_id,(f,X)=>{{let j=r(()=>t(U)===t(X).annotation_id);Pa(f,{get annotationId(){return t(X).annotation_id},get sampleId(){return e.sampleId},get datasetId(){return w},get isResizable(){return t(Se)},get isSelected(){return t(j)},toggleAnnotationSelection:Yt})}});var Qt=h(Jt);{var Re=f=>{qe(f,{get bbox(){return t(S)},get colorStroke(){return t(Bt)},colorFill:"rgba(0, 123, 255, 0.1)",style:"outline: 0;",opacity:.8,scale:1})};Y(Qt,f=>{t(S)&&t(it)&&t(O)&&f(Re)})}var Ce=h(Qt);{var Te=f=>{var X=Ra(),j=_(X),xt=h(j);mt(()=>{H(j,"y1",t(K).y),H(j,"x2",n().data.width),H(j,"y2",t(K).y),H(j,"stroke",t(Bt)),H(xt,"x1",t(K).x),H(xt,"x2",t(K).x),H(xt,"y2",n().data.height),H(xt,"stroke",t(Bt))}),c(f,X)};Y(Ce,f=>{t(K)&&t(kt)&&f(Te)})}A(bt);var De=h(bt);{var Le=f=>{var X=Ca();se(X,j=>s(q,j),()=>t(q)),mt(()=>{H(X,"width",n().data.width),H(X,"height",n().data.height)}),c(f,X)};Y(De,f=>{t(kt)&&f(Le)})}mt(f=>qt=na(bt,0,"",null,qt,f),[()=>({invisible:d()})]),c(Ht,Wt)};Y(ke,Ht=>{n().data&&Ht(Ee)})}mt(()=>H(Vt,"href",t(lt))),c(ct,_t)},$$slots:{zoomableContent:!0}}),A(Dt),se(Dt,J=>s(Kt,J),()=>t(Kt)),A(Tt),c(Ct,Tt)},$$slots:{default:!0}})},$$slots:{default:!0}}),A(x);var R=h(x,2),Et=I(R);{var Rt=nt=>{ta(nt,{get sample(){return n().data},get annotationsIdsToHide(){return t(pt)},get selectedAnnotationId(){return t(U)},onAnnotationClick:Yt,onToggleShowAnnotation:_e,onDeleteAnnotation:xe,onRemoveTag:we,get onUpdate(){return t(g)},get addAnnotationEnabled(){return t(vt)},set addAnnotationEnabled(dt){s(vt,dt,!0)},get addAnnotationLabel(){return t(O)},set addAnnotationLabel(dt){s(O,dt,!0)}})};Y(Et,nt=>{n().data&&nt(Rt)})}A(R),A(E),A(o),c(a,o)},Ae=a=>{Je(a,{})};Y($e,a=>{n().data?a(Ie):a(Ae,!1)})}c(u,Ot),ht(),et()}var za=tt('<div class="flex h-full w-full space-x-4 px-4 pb-4" data-testid="sample-details"><div class="h-full w-full space-y-6 rounded-[1vw] bg-card p-4"><!></div></div>');function ln(u,e){gt(e,!0);const m=r(()=>yt.params.sampleId),l=yt.data.dataset,n=r(()=>Number(yt.params.sampleIndex));var i=za(),d=I(i),p=I(d);Fa(p,{get sampleId(){return t(m)},get dataset(){return l},get sampleIndex(){return t(n)},children:(et,ot)=>{var F=Q(),w=_(F);{var z=C=>{var Z=Q(),N=_(Z);It(N,()=>e.children),c(C,Z)};Y(w,C=>{e.children&&C(z)})}c(et,F)},$$slots:{default:!0}}),A(d),A(i),c(u,i),ht()}export{ln as component};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{p as z,f as E,n as Xt,a as F,w as Et,m as pt,$ as ht,g as t,b as n,c as p,r as g,s as M,t as q,am as Ct,u as ta,al as Bt,Z as at}from"../chunks/C3xJX0nD.js";import{n as aa}from"../chunks/BaFFwDFr.js";import{u as It}from"../chunks/BOmrKuMn.js";import"../chunks/CWj6FrbW.js";import{c as Q,a as u,f as B,t as Dt,d as ea}from"../chunks/CAPx0Bfm.js";import{i as H,s as j,a as W}from"../chunks/DmGM9V9Q.js";import{e as bt}from"../chunks/SiegjVo0.js";import{c as ot,e as na,g as oa,u as sa,k as ia,b as ra,t as da}from"../chunks/DthpwYR_.js";import{g as nt,c as la,a as ca}from"../chunks/D8ZGoCPm.js";import{I as ua,w as va,r as st,G as ma,H as fa,J as ga,K as _a,o as xt,M as Rt,N as pa,C as Lt,B as jt,O as ha,n as Tt,v as ba,D as xa,q as Ia}from"../chunks/CWuDkrMZ.js";import"../chunks/ClzkJBWk.js";import{p as U}from"../chunks/DUtlYNuP.js";import"../chunks/69_IOA4Y.js";import{S as Aa}from"../chunks/BiGQqqJP.js";import"../chunks/gBp1tBnA.js";import{r as K}from"../chunks/ChlxSwqI.js";import{B as $a,a as wa,b as et,c as gt,H as Sa,d as _t,D as ya,e as Ma,Z as ka,g as Pa,u as Na}from"../chunks/BsaJCCG_.js";import{S as Ca}from"../chunks/DNJnBfHs.js";import{s as V}from"../chunks/CpbA3HU7.js";import{C as Ba}from"../chunks/BtXGzlpP.js";import{s as Da}from"../chunks/DoEId1MK.js";import{s as Ra,r as Ea}from"../chunks/xQhUoIl9.js";function La(l,a){z(a,!0);/**
|
|
2
|
-
* @license @lucide/svelte v0.482.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
7
|
-
*
|
|
8
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
10
|
-
* copyright notice and this permission notice appear in all copies.
|
|
11
|
-
*
|
|
12
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
13
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
14
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
15
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
16
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
17
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
18
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
-
*
|
|
20
|
-
*/let e=Ea(a,["$$slots","$$events","$$legacy"]);const v=[["path",{d:"M5 3a2 2 0 0 0-2 2"}],["path",{d:"M19 3a2 2 0 0 1 2 2"}],["path",{d:"M21 19a2 2 0 0 1-2 2"}],["path",{d:"M5 21a2 2 0 0 1-2-2"}],["path",{d:"M9 3h1"}],["path",{d:"M9 21h1"}],["path",{d:"M14 3h1"}],["path",{d:"M14 21h1"}],["path",{d:"M3 9v1"}],["path",{d:"M21 9v1"}],["path",{d:"M3 14v1"}],["path",{d:"M21 14v1"}]];ua(l,Ra({name:"square-dashed"},()=>e,{get iconNode(){return v},children:(o,r)=>{var i=Q(),b=E(i);Da(b,()=>a.children??Xt),u(o,i)},$$slots:{default:!0}})),F()}const ja=({annotationIndex:l,...a})=>{const e=Et({isLoading:!1});return(async()=>{e.update(o=>({...o,isLoading:!0}));try{const{data:o}=await aa({path:{dataset_id:a.dataset_id},query:{cursor:l>0?l-1:0,limit:3,annotation_label_ids:a.annotation_label_ids,tag_ids:a.tag_ids}});if(!o){e.update(s=>({...s,isLoading:!1,error:"No annotations data received",data:void 0}));return}const{setAnnotationsTotalCount:r}=It();r(o.total_count);let i;const b=l>0?o.data[0]:void 0;o.data.length>1&&(i=l===0?o.data[1]:o.data[2]),e.update(s=>({...s,isLoading:!1,error:void 0,data:{annotationNext:i,annotationPrevious:b}}))}catch(o){e.update(r=>({...r,isLoading:!1,error:String(o)}))}})(),e},Ta=async({parent:l,params:{dataset_id:a,annotationId:e,annotationIndex:v}})=>{const{annotationsSelectedTagsIds:o,annotationsSelectedAnnotationLabelsIds:r,dataset:i}=await l(),b=parseInt(v,10),s=Et();if(!i)throw new Error("Dataset data not found");return ja({annotationIndex:b,dataset_id:a,currentAnnotationId:e,annotation_label_ids:Array.from(pt(r)),tag_ids:Array.from(pt(o))}).subscribe(({data:S})=>{s.set(S)}),{annotationAdjacents:s,annotationIndex:b,annotationId:e,dataset:i}},Be=Object.freeze(Object.defineProperty({__proto__:null,load:Ta},Symbol.toStringTag,{value:"Module"}));function Ha(l,a){z(a,!0);const e=()=>j(t(i),"$annotationAdjacents",v),[v,o]=W(),r=n(()=>U.data.annotationIndex),i=n(()=>U.data.annotationAdjacents),b=()=>{e().annotationNext&&nt(K.toSampleWithAnnotation({datasetId:e().annotationNext.dataset_id,sampleId:e().annotationNext.sample_id,annotationId:e().annotationNext.annotation_id,annotationIndex:t(r)+1}),{invalidateAll:!0})},s=()=>{e().annotationPrevious&&nt(K.toSampleWithAnnotation({datasetId:e().annotationPrevious.dataset_id,sampleId:e().annotationPrevious.sample_id,annotationId:e().annotationPrevious.annotation_id,annotationIndex:t(r)-1}),{invalidateAll:!0})},S=_=>{switch(_.key){case"ArrowRight":b();break;case"ArrowLeft":s();break}};var k=Q();bt("keydown",ht,S);var I=E(k);{var R=_=>{{let A=n(()=>!!e().annotationPrevious),$=n(()=>!!e().annotationNext);Ca(_,{get hasPrevious(){return t(A)},get hasNext(){return t($)},onPrevious:s,onNext:b})}};H(I,_=>{e()&&_(R)})}u(l,k),F(),o()}const Ua={object_detection:"Object Detection",instance_segmentation:"Instance Segmentation",semantic_segmentation:"Semantic Segmentation",classification:"Classification"};var za=B('<span class="text-sm"> </span> <span class="break-all text-sm"> </span>',1);function Fa(l,a){var e=za(),v=E(e),o=p(v,!0);g(v);var r=M(v,2),i=p(r,!0);g(r),q(()=>{V(o,a.label),ot(r,"data-testid",`annotation-metadata-${a.id}`),V(i,a.value)}),u(l,e)}var Oa=B('<span class="break-all text-sm"> </span>'),Ga=B('<span class="text-sm"> </span> <!>',1);function Ka(l,a){z(a,!0);const e=()=>j(i,"$result",o),v=()=>j(a.isEditingMode,"$isEditingMode",o),[o,r]=W(),i=va(),{updateAnnotation:b}=st({datasetId:a.datasetId,annotationId:a.annotationId,onUpdate:a.onUpdate}),s=n(()=>ga(e().data||[])),S=n(()=>{const w=t(s).find(d=>d.value===a.value);return w||{value:a.value,label:a.value}});var k=Ga(),I=E(k),R=p(I,!0);g(I);var _=M(I,2);{var A=w=>{{const d=(P,m)=>{let C=()=>m==null?void 0:m().inputValue;fa(P,{get label(){return C()}})};let h=n(()=>t(s).find(P=>{var m;return P.value===((m=t(S))==null?void 0:m.value)}));ma(w,{get items(){return t(s)},get selectedItem(){return t(h)},name:"annotation-label",placeholder:"Select or create a label",onSelect:P=>{b({annotation_id:a.annotationId,dataset_id:a.datasetId,label_name:P.value})},notFound:d,$$slots:{notFound:!0}})}},$=w=>{var d=Oa();ot(d,"data-testid","annotation-metadata-label");var h=p(d,!0);g(d),q(()=>V(h,a.value)),u(w,d)};H(_,w=>{v()?w(A):w($,!1)})}q(()=>V(R,a.label)),u(l,k),F(),r()}var qa=B('<div class="flex flex-col gap-4"><div class="grid grid-cols-[6rem_1fr] gap-y-3 text-diffuse-foreground"></div></div>');function Wa(l,a){z(a,!0);const e=()=>j(t(b),"$annotationResp",v),[v,o]=W(),{datasetId:r}=U.data,i=n(()=>st({datasetId:r,annotationId:a.annotationId})),b=n(()=>t(i).annotation);let s=n(()=>e().data);const S=n(()=>{var $,w;if(!t(s))return[];let A=[{id:"label",label:"Label:",value:(w=($=t(s))==null?void 0:$.annotation_label)==null?void 0:w.annotation_label_name},{id:"type",label:"Type:",value:Ua[t(s).annotation_type]||"Unknown"}];if(t(s)&&!_a(t(s))){const{height:d,width:h}=xt(t(s));A=[{id:"height",label:"Height:",value:Rt(Math.round(d))+"px"},{id:"width",label:"Width:",value:Rt(Math.round(h))+"px"},...A]}return A}),{isEditingMode:k}=U.data.globalStorage;var I=Q(),R=E(I);{var _=A=>{pa(A,{title:"Annotation details",children:($,w)=>{var d=qa(),h=p(d);na(h,21,()=>t(S),({label:P,value:m,id:C})=>P,(P,m)=>{let C=()=>t(m).label,y=()=>t(m).value,f=()=>t(m).id;var x=Q(),L=E(x);{var T=D=>{Ka(D,{get onUpdate(){return a.onUpdate},get annotationId(){return a.annotationId},get datasetId(){return r},get label(){return C()},get value(){return y()},get isEditingMode(){return k}})},c=D=>{Fa(D,{get label(){return C()},get id(){return f()},get value(){return y()}})};H(L,D=>{f()==="label"&&k?D(T):D(c,!1)})}u(P,x)}),g(h),g(d),u($,d)}})};H(R,A=>{t(S).length>0&&A(_)})}u(l,I),F(),o()}var Za=B('<!> <h2 class="py-2 text-lg font-semibold"><a>Check all sample annotations</a></h2>',1),Va=B('<div class="flex h-full w-full items-center justify-center"><!></div>'),Ja=B('<div class="flex h-full min-h-0 flex-col space-y-4 overflow-hidden dark:[color-scheme:dark]"><!> <!></div>');function Ya(l,a){z(a,!0);const e=()=>j(t(b),"$annotationResp",v),[v,o]=W(),{datasetId:r}=U.data,i=n(()=>st({datasetId:r,annotationId:a.annotationId})),b=n(()=>t(i).annotation);let s=n(()=>e().data),S=n(()=>{var _;return(_=t(s))==null?void 0:_.sample});const k=oa(),[I,R]=k;Lt(l,{className:"h-full",children:(_,A)=>{jt(_,{className:"h-full flex flex-col",children:($,w)=>{var d=Ja(),h=p(d);Wa(h,{get annotationId(){return a.annotationId},get onUpdate(){return a.onUpdate}});var P=M(h,2);{var m=y=>{var f=Za(),x=E(f);ha(x,{get sample(){return t(S)},showCustomMetadata:!1});var L=M(x,2),T=p(L);g(L),q(c=>ot(T,"href",c),[()=>I(K.toSample({sampleId:t(S).sample_id,datasetId:t(S).dataset_id}),void 0)]),u(y,f)},C=y=>{var f=Va(),x=p(f);Tt(x,{size:"large",align:"center"}),g(f),u(y,f)};H(P,y=>{t(S)?y(m):y(C,!1)})}g(d),u($,d)},$$slots:{default:!0}})},$$slots:{default:!0}}),F(),o()}var Qa=B('<!> <span class="hidden sm:inline">Home</span>',1),Xa=B('<!> <span class="max-w-[150px] truncate"> </span>',1),te=B('<!> <span class="hidden sm:inline">Annotations</span>',1),ae=B('<!> <span class="max-w-[200px] truncate"><!></span>',1),ee=B("<!> <!> <!> <!> <!> <!> <!>",1);function ne(l,a){z(a,!0);const e=()=>j(r,"$annotationsTotalCount",v),[v,o]=W(),{annotationsTotalCount:r}=It();$a(l,{class:"mb-2",children:(i,b)=>{wa(i,{children:(s,S)=>{var k=ee(),I=E(k);et(I,{children:(h,P)=>{{let m=n(()=>K.toHome());gt(h,{get href(){return t(m)},class:"flex items-center gap-2",children:(C,y)=>{var f=Qa(),x=E(f);Sa(x,{class:"h-4 w-4"}),Ct(2),u(C,f)},$$slots:{default:!0}})}},$$slots:{default:!0}});var R=M(I,2);_t(R,{});var _=M(R,2);et(_,{children:(h,P)=>{{let m=n(()=>K.toAnnotations(a.dataset.dataset_id));gt(h,{get href(){return t(m)},class:"flex items-center gap-2",children:(C,y)=>{var f=Xa(),x=E(f);ya(x,{class:"h-4 w-4"});var L=M(x,2),T=p(L,!0);g(L),q(()=>V(T,a.dataset.name)),u(C,f)},$$slots:{default:!0}})}},$$slots:{default:!0}});var A=M(_,2);_t(A,{});var $=M(A,2);et($,{children:(h,P)=>{{let m=n(()=>K.toAnnotations(a.dataset.dataset_id));gt(h,{get href(){return t(m)},class:"flex items-center gap-2",children:(C,y)=>{var f=te(),x=E(f);Ba(x,{class:"h-4 w-4"}),Ct(2),u(C,f)},$$slots:{default:!0}})}},$$slots:{default:!0}});var w=M($,2);_t(w,{});var d=M(w,2);et(d,{children:(h,P)=>{Ma(h,{class:"flex items-center gap-2",children:(m,C)=>{var y=ae(),f=E(y);La(f,{class:"h-4 w-4"});var x=M(f,2),L=p(x);{var T=D=>{var O=Dt();q(()=>V(O,`Annotation ${a.annotationIndex+1} of ${e()??""}`)),u(D,O)},c=D=>{var O=Dt("Annotation");u(D,O)};H(L,D=>{a.annotationIndex!==void 0?D(T):D(c,!1)})}g(x),u(m,y)},$$slots:{default:!0}})},$$slots:{default:!0}}),u(s,k)},$$slots:{default:!0}})},$$slots:{default:!0}}),F(),o()}var oe=ea("<image></image><g><!></g>",1),se=B('<div class="h-full w-full overflow-hidden"><div class="sample relative h-full w-full"><div class="absolute right-4 top-2 z-30"><!></div> <!> <!></div></div>'),ie=B('<div class="flex h-full w-full items-center justify-center"><!></div>'),re=B('<div class="flex h-full w-full flex-col space-y-4"><div class="flex w-full items-center"><!></div> <!> <div class="flex min-h-0 flex-1 gap-4"><div class="flex-1"><!></div> <div class="relative w-[375px]"><!></div></div></div>');function de(l,a){z(a,!0);const e=()=>j(Ht,"$isEditingMode",i),v=()=>j(t(f),"$annotationResp",i),o=()=>j(S,"$selectedSampleAnnotationCropIds",i),r=()=>j(R,"$isHidden",i),[i,b]=W(),{toggleSampleAnnotationCropSelection:s,selectedSampleAnnotationCropIds:S,clearReversibleActionsByGroupId:k,addReversibleAction:I}=It(),{isHidden:R,handleKeyEvent:_}=ba(),{settingsStore:A}=sa(),$=" ",w=pt(A).key_go_back;let d=Bt(!1);const h=()=>{var N;(N=a.sample)!=null&&N.dataset_id?nt(K.toAnnotations(a.sample.dataset_id)):nt("/")},P=N=>{switch(N.key){case w:h();break;case" ":N.preventDefault(),e()?at(d,!0):s(a.annotationId);break;case $:N.preventDefault(),s(a.annotationId);break}_(N)},m=N=>{N.key===" "&&at(d,!1),_(N)},C=U.data.datasetId,y=n(()=>st({datasetId:C,annotationId:a.annotationId})),f=n(()=>t(y).annotation),x=n(()=>t(y).updateAnnotation),L="bbox-change-annotation-details";la(()=>{k(L)});const T=N=>{if(t(c)){const J={annotation_id:t(c).annotation_id,dataset_id:t(c).dataset_id,bounding_box:N},lt=xt(t(c)),St=async()=>{const Y={annotation_id:t(c).annotation_id,dataset_id:t(c).dataset_id,bounding_box:lt};await t(x)(Y)};(async()=>{try{await t(x)(J),I({id:`bbox-change-${t(c).annotation_id}-${Date.now()}`,description:`Revert bounding box change for annotation ${t(c).annotation_id}`,execute:St,timestamp:new Date,groupId:L})}catch(Y){da.error("Failed to update annotations:"+Y.message)}})()}};let c=n(()=>v().data),D=n(()=>{var N,J;return Pa(((J=(N=t(c))==null?void 0:N.sample)==null?void 0:J.sample_id)||"")}),O=n(()=>t(c)?xt(t(c)):void 0);const{isEditingMode:Ht}=U.data.globalStorage,Ut=n(()=>t(d)?"grab":"auto"),zt=n(()=>e()&&!t(d));let X=Bt(void 0);ta(()=>{!t(X)&&t(O)&&at(X,t(O),!0)}),ca(()=>{at(X,void 0)});var it=re();bt("keydown",ht,P),bt("keyup",ht,m);var rt=p(it),Ft=p(rt);ne(Ft,{get dataset(){return a.dataset},get annotationIndex(){return a.annotationIndex}}),g(rt);var At=M(rt,2);Aa(At,{class:"mb-4 bg-border-hard"});var $t=M(At,2),dt=p($t),Ot=p(dt);Lt(Ot,{className:"h-full",children:(N,J)=>{jt(N,{className:"h-full",children:(lt,St)=>{var ct=Q(),Y=E(ct);{var Kt=Z=>{var G=se(),tt=p(G),ut=p(tt),Wt=p(ut);{let Mt=n(()=>o().has(a.annotationId));xa(Wt,{onSelect:()=>s(a.annotationId),get isSelected(){return t(Mt)}})}g(ut);var yt=M(ut,2);Ha(yt,{});var Zt=M(yt,2);ka(Zt,{get width(){return t(c).sample.width},get height(){return t(c).sample.height},get cursor(){return t(Ut)},get boundingBox(){return t(X)},zoomableContent:(Vt,vt)=>{let Jt=()=>vt==null?void 0:vt().scale;var kt=oe(),Pt=E(kt),mt=M(Pt);let Nt;var Yt=p(mt);ia(Yt,()=>v().dataUpdatedAt,ft=>{{let Qt=n(()=>({x:0,y:0,width:t(c).sample.width,height:t(c).sample.height}));Ia(ft,{get annotation(){return t(c)},showLabel:!0,get scale(){return Jt()},get imageWidth(){return t(c).sample.width},get isResizable(){return t(zt)},onBoundingBoxChanged:T,get constraintBox(){return t(Qt)}})}}),g(mt),q(ft=>{ot(Pt,"href",t(D)),Nt=ra(mt,0,"",null,Nt,ft)},[()=>({invisible:r()})]),u(Vt,kt)},$$slots:{zoomableContent:!0}}),g(tt),g(G),u(Z,G)},qt=Z=>{var G=ie(),tt=p(G);Tt(tt,{size:"large",align:"center"}),g(G),u(Z,G)};H(Y,Z=>{t(c)?Z(Kt):Z(qt,!1)})}u(lt,ct)},$$slots:{default:!0}})},$$slots:{default:!0}}),g(dt);var wt=M(dt,2),Gt=p(wt);Ya(Gt,{get annotationId(){return a.annotationId}}),g(wt),g($t),g(it),u(l,it),F(),b()}var le=B('<div class="flex h-full w-full space-x-4 px-4 pb-4" data-testid="annotation-details"><div class="h-full w-full space-y-6 rounded-[1vw] bg-card p-4"><!></div></div>');function De(l,a){z(a,!0);const e=()=>j(t(k),"$sample",v),[v,o]=W(),r=n(()=>a.data.annotationId),i=n(()=>a.data.dataset),b=n(()=>a.data.annotationIndex),s=n(()=>U.params.sampleId),S=n(()=>Na({sampleId:t(s),datasetId:t(i).dataset_id})),k=n(()=>t(S).sample);var I=le(),R=p(I),_=p(R);{var A=$=>{de($,{get annotationId(){return t(r)},get annotationIndex(){return t(b)},get dataset(){return t(i)},get sample(){return e().data}})};H(_,$=>{e().data&&t(r)&&t(i)&&$(A)})}g(R),g(I),u(l,I),F(),o()}export{De as component,Be as universal};
|
|
File without changes
|