import { mapStores as l } from "pinia"; import { u as o } from "./index-C7KKEuWJ.js"; const p = function(t) { return t ? [...new Set(t.map((e) => JSON.stringify(e)))].map( (e) => JSON.parse(e) ) : []; }, c = { computed: { ...l(o) }, methods: { flatmapPanZoomCallback: function(t) { if (this.mouseHovered) { const e = { paneIndex: this.entry.id, eventType: "panZoom", payload: t, type: this.entry.type }; this.$emit("resource-selected", e); } }, /** * Function used for updating the flatmap markers. * We set the markers based on what was searched and the flatmap clusters them. */ flatmapMarkerUpdate(t) { if (!this.flatmapReady) return; let e = t; if (e || (e = this.getFlatmapImp()), e) { let i = this.settingsStore.globalSettings.displayMarkers ? this.settingsStore.markers : []; i = p(i); let s = this.removeMarkersNotOnFlatmap(e, i); if (e.clearMarkers(), e.clearDatasetMarkers(), this.entry.resource === "FunctionalConnectivity") { let a = []; for (let r = 0; r < s.length; r++) a = a.concat(s[r].terms); e.addMarkers(Array.from(new Set(a)), { className: "standard-marker", cluster: !1 }); } else e.addDatasetMarkers(s); this.entry.type === "MultiFlatmap" && this.restoreFeaturedMarkers(e); } }, // removeMarkersNotOnFlatmap: rewrites the dataset marker list to only include markers that are on the flatmap removeMarkersNotOnFlatmap(t, e) { let i = t.anatomicalIdentifiers, s = []; for (let a = 0; a < e.length; a++) { let r = e[a], n = { id: r.id, terms: [] }; for (let m = 0; m < r.terms.length; m++) i.includes(r.terms[m]) && n.terms.push(r.terms[m]); s.push(n); } return s; }, flatmapReadyForMarkerUpdates: function(t) { if (t) { t.enablePanZoomEvents(!0), this.flatmapReady = !0; const e = t.mapImp; this.flatmapMarkerUpdate(e); } } } }; export { c as D };