import{d as z,u as $,N as k,o as l,n as y,w as t,a as e,bj as B,c as n,r as V,F as d,c7 as D,l as C,f as p,t as S,cR as U,V as E,cS as q,c8 as j,b as L,s as T,x as M,v as g,b$ as A,cL as P,bg as W,cy as X,h as Y,m as G,g as I,q as H,e as h,aY as J,aV as K,i as N,j as O,cT as Q}from"./index-lT0LPxUj.js";const Z={class:"text-no-wrap"},le=z({__name:"ModelBar",props:{model:{}},setup(v){const r=$(),a=v,m=k(()=>a.model),s=k(()=>[{icon:"mdi:mdi-chart-scatter-plot",id:"modelExplorer",label:"Explore",title:"Explore activity",to:{name:r.state.simulator+"ModelExplorer",params:{modelId:m.value.id}}},{icon:"mdi:mdi-pencil",id:"modelEditor",label:"Edit",title:"Edit activity",to:{name:r.state.simulator+"ModelEditor",params:{modelId:m.value.id}}}]);return(i,b)=>(l(),y(q,{class:"d-print-none",flat:"",height:"48"},{default:t(()=>[e(D,{stacked:""},{default:t(()=>[B(i.$slots,"prependTabs"),(l(!0),n(d,null,V(s.value,(c,f)=>(l(),y(j,{key:f,title:c.title,to:c.to,size:"small"},{default:t(()=>[e(L,{icon:c.icon},null,8,["icon"]),T("span",Z,S(c.label),1)]),_:2},1032,["title","to"]))),128)),B(i.$slots,"appendTabs")]),_:3}),e(C),e(U,null,{default:t(()=>[p(S(m.value.id),1)]),_:1}),e(C),e(E,{variant:"outlined"},{default:t(()=>[p("Simulate")]),_:1})]),_:3}))}}),ee={style:{"font-size":"9px"}},oe=z({__name:"ModelController",props:{modelStore:{}},setup(v){const r=[{id:"defaults",icon:"mdi:mdi-format-list-numbered-rtl",title:"View defaults"},{id:"model",icon:"mdi:mdi-tune-variant",title:"Edit model"},{id:"code",icon:"mdi:mdi-xml"}];return(a,m)=>(l(),n(d,null,[e(M,{location:"right",permanent:"",rail:""},{default:t(()=>[e(D,{"model-value":a.modelStore.state.controller.view,mandatory:!1,color:"primary",direction:"vertical",stacked:""},{default:t(()=>[(l(),n(d,null,V(r,(s,i)=>e(j,{key:i,ripple:!1,value:a.modelStore.state.controller.open?s.id:null,class:"justify-center",height:"72","min-width":"0",onClick:A(b=>a.modelStore.toggle(s),["stop"])},{default:t(()=>[e(L,{icon:s.icon,class:"ma-1",size:"large"},null,8,["icon"]),T("span",ee,S(s.id),1)]),_:2},1032,["value","onClick"])),64))]),_:1},8,["model-value"])]),_:1}),e(M,{"model-value":a.modelStore.state.controller.open,location:"right",permanent:""},{default:t(()=>[a.modelStore.state.controller.view==="defaults"?(l(),n(d,{key:0},[p(" defaults ")],64)):g("",!0),a.modelStore.state.controller.view==="model"?(l(),n(d,{key:1},[p(" model ")],64)):g("",!0),a.modelStore.state.controller.view==="code"?(l(),n(d,{key:2},[p(" code ")],64)):g("",!0)]),_:1},8,["model-value"])],64))}}),te=z({__name:"ModelNav",props:{modelDBStore:{}},setup(v){const r=$(),a=P(),m=v,s=k(()=>m.modelDBStore.state.models.filter(w=>w.label.toLocaleLowerCase().includes(i.value.toLocaleLowerCase()))),i=W(""),b=[{title:"Upload",icon:"mdi:mdi-upload"},{title:"Download",icon:"mdi:mdi-download"},{title:"Reload",icon:"mdi:mdi-reload"},{title:"Delete",icon:"mdi:mdi-trash-can-outline"}],c=()=>{K(()=>window.dispatchEvent(new Event("resize")))},f=w=>{a.state.width=w.clientX-64},x=()=>{a.state.resizing=!1,window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",x)},F=()=>{a.state.resizing=!0,window.addEventListener("mousemove",f),window.addEventListener("mouseup",x)};return(w,u)=>(l(),y(M,{"model-value":h(a).state.open,style:J({transition:h(a).state.resizing?"initial":""}),width:h(a).state.width,onTransitionend:u[2]||(u[2]=o=>c()),permanent:""},{default:t(()=>[T("div",{onMousedown:F,class:"resize-handle"},null,32),e(H,{color:"transparent",density:"compact"},{default:t(()=>[e(X,{class:"mx-1",clearable:"",density:"compact","hide-details":"",placeholder:"Search model","prepend-inner-icon":"mdi:mdi-magnify",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=o=>i.value=o),variant:"outlined"},null,8,["modelValue"]),e(Y,null,{activator:t(({props:o})=>[e(E,G({icon:"mdi:mdi-dots-vertical",size:"small"},o),null,16)]),default:t(()=>[e(I,{density:"compact"},{default:t(()=>[(l(),n(d,null,V(b,(o,_)=>e(N,{key:_,value:_},{prepend:t(()=>[e(L,{icon:o.icon},null,8,["icon"])]),default:t(()=>[e(O,null,{default:t(()=>[p(S(o.title),1)]),_:2},1024)]),_:2},1032,["value"])),64))]),_:1})]),_:1})]),_:1}),e(I,{density:"compact",lines:"two",nav:""},{default:t(()=>[(l(!0),n(d,null,V(s.value,(o,_)=>(l(),y(N,{key:_,subtitle:o.elementType,title:o.label,to:{name:h(r).state.simulator+"Model",params:{modelId:o.id}}},{append:t(()=>[e(E,{onClick:u[1]||(u[1]=A(R=>R.preventDefault(),["stop"])),class:"list-item-menu",icon:"mdi:mdi-dots-vertical",size:"x-small",variant:"text"})]),_:2},1032,["subtitle","title","to"]))),128))]),_:1})]),_:1},8,["model-value","style","width"]))}}),se=Q(te,[["__scopeId","data-v-09f0fbaa"]]);export{se as M,le as _,oe as a};
