"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("./DashboardPlugin-2958aeef.cjs"),v=require("./index-9889d479.cjs");class m{constructor(t={}){this.id=t.id||""}clone(){const t=new m;return t.id=this.id,t}}class S{constructor(t){this.id=t.image_id,this.name=t.image_id,this.size=(Math.random()*10).toFixed(2)+"mb",this.path=t.share_link}}class N{constructor(t={}){this.SparcImageArray=[],t.forEach(a=>this.SparcImageArray.push(new S(a))),this.MBFImageObject=[],t.forEach(a=>this.MBFImageObject.push(new m(a)))}buildTableMBF(){let t=[];return this.MBFImageObject.forEach(a=>{let c={name:a.id,size:(Math.random()*10).toFixed(2)+"mb",path:""};t.push(c)}),t}buildTableSPARC(){let t=[];return this.SparcImageArray.forEach(a=>{let c={name:a.id,size:(Math.random()*10).toFixed(2)+"mb",path:a.path};t.push(c)}),t}}const x={class:"fill"},I=["src"],V={class:"tw-p-1"},w=Object.assign({inheritAttrs:!1},{__name:"ImageSelector",setup(d){const t=e.inject("emitter"),a=e.ref(null),c=e.ref(null);e.ref("");const n=e.ref(),u=e.ref("MUSE Image Selector");function _(o){let r=n.value[o].path;t.emit("ImageSelector-mbfImageSelected",r)}t.on("locationSelect-MBFImageArrayUpdate",o=>{p()});const p=async o=>{o=353,n.value=[];let r={},l={};try{await v.Api.biolucida.searchDataset(o).then(s=>{l=s}),l.status===200&&(r=l,c.value=new N(r.data.dataset_images),n.value=c.value.buildTableSPARC())}catch{console.error("couldn't fetch images from dataset")}};return t.on("selectSubject",o=>{a.value=o,imgPath2.value="./imgs/imgSel.png",imgPath3.value="./imgs/imgSel2.png"}),(o,r)=>{const l=e.resolveComponent("el-option"),s=e.resolveComponent("el-select"),i=e.resolveComponent("el-table-column"),h=e.resolveComponent("el-button"),g=e.resolveComponent("el-table");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(o.$slots,"default",{widgetName:u.value},void 0,!0),e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(o.$attrs)),[e.createElementVNode("div",x,[e.createElementVNode("img",{src:a.value},null,8,I)]),e.createElementVNode("div",V,[e.createVNode(s,{placeholder:"Select Subject"},{default:e.withCtx(()=>[e.createVNode(l,{value:0},{default:e.withCtx(()=>[e.createTextVNode("sub 1 ")]),_:1}),e.createTextVNode(),e.createVNode(l,{value:1},{default:e.withCtx(()=>[e.createTextVNode("sub 2")]),_:1}),e.createVNode(l,{value:2},{default:e.withCtx(()=>[e.createTextVNode("sub 3")]),_:1})]),_:1})]),e.createVNode(g,{data:n.value,class:"table-of-images tw-text-sm"},{default:e.withCtx(()=>[e.createVNode(i,{prop:"name",label:"Name"}),e.createVNode(i,{prop:"size",label:"Size"}),e.createVNode(i,{fixed:"right",label:"Img"},{default:e.withCtx(b=>[e.createVNode(h,{link:"",type:"primary",size:"small",onClick:y=>_(b.$index)},{default:e.withCtx(()=>[e.createTextVNode("Open")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])],16)],64)}}}),C=f._export_sfc(w,[["__scopeId","data-v-622f48dc"]]);exports.default=C;
