var E=(e=>(e.DIRECTED="directed",e.UNDIRECTED="undirected",e))(E||{}),w=(e=>(e.IN="in",e.OUT="out",e))(w||{}),S=(e=>(e.node="node",e.link="link",e.backdrop="backdrop",e))(S||{}),c=(e=>(e.black="black",e.red="labels.red",e.orange="labels.orange",e.purple="labels.purple",e.blueShade1="labels.blueShade1",e.yellow="labels.yellow",e.yellowLight="labels.yellowShade2",e.green="labels.green",e.blue="labels.blue",e.redShade3="labels.redShade2",e.orangeShade3="labels.orangeShade2",e))(c||{}),l=(e=>(e.current="current",e.deleted="deleted",e.shared="shared",e.notAccessible="not accessible",e.faulty="faulty",e))(l||{}),r=(e=>(e.storageConnector="storage connector",e.featureGroup="feature group",e.externalFeatureGroup="external feature group",e.featureView="feature view",e.trainingDataset="training dataset",e.model="model",e.experiment="experiment",e.link="link",e))(r||{});function b(e){const n={id:e.id,type:e.type};return JSON.stringify(n)}const R={EXTERNAL_FEATURE_GROUP:r.externalFeatureGroup,FEATURE_GROUP:r.featureGroup,FEATURE_VIEW:r.featureView,TRAINING_DATASET:r.trainingDataset,MODEL:r.model,STORAGE_CONNECTOR:r.storageConnector},G={[r.storageConnector]:c.black,[r.featureGroup]:c.orange,[r.externalFeatureGroup]:c.blue,[r.featureView]:c.purple,[r.trainingDataset]:c.green,[r.model]:c.blueShade1,[r.experiment]:c.red,[r.link]:c.black},_=e=>{const n=i(e),a=[],u=[],o=new Set;h(n,e.upstream,a,u,o);const s=[],t=[],d=new Set;g(n,e.downstream,s,t,d);const p={nodes:a,links:u},f={nodes:s,links:t},k=p.nodes.length+f.nodes.length;return{root:n,upstream:p,downstream:f,count:k}},m=(e,n)=>({source:b(e),target:b(n),type:r.link,metaType:l.current}),i=e=>{var u,o;const n=s=>s.deleted?l.deleted:s.accessible?s.shared?l.shared:s.exceptionCause?l.faulty:l.current:l.notAccessible,a={id:e.node.artifact.id,name:e.node.artifact.name,deprecated:(u=e.node.artifact)==null?void 0:u.deprecated,version:e.node.artifact.version,project:"unknown",type:R[e.node.artifactType],metaType:n(e.node),artifact:{href:(o=e.node.artifact)==null?void 0:o.href},deleted:e.node.deleted,traversed:e.node.traversed};return e.node.accessible?a.project=e.node.artifact.featurestoreName:a.project=e.node.artifact.project,a},h=(e,n,a,u,o)=>{n.forEach(s=>{const t=i(s);o.has(`${t.id}_${t.type}`)||(o.add(`${t.id}_${t.type}`),a.push(t)),u.push(m(e,t)),h(t,s.upstream,a,u,o)})},g=(e,n,a,u,o)=>{n.forEach(s=>{const t=i(s);o.has(`${t.id}_${t.type}`)||(o.add(`${t.id}_${t.type}`),a.push(t));const d=m(e,t);u.push(d),g(t,s.downstream,a,u,o)})};export{S as E,E as G,w as N,r as a,l as b,G as c,_ as d,b as n};
