import { _ as c, q as h, a as g, t as y, T as r, E as l } from "./index-C7KKEuWJ.js"; import { C as M } from "./ContentMixin-DksfeIll.js"; import { D as v } from "./style-DQQ2HZHE.js"; import { MultiFlatmapVuer as C } from "@abi-software/flatmapvuer"; import { resolveComponent as p, openBlock as m, createElementBlock as S, createVNode as I, createBlock as F, createCommentVNode as w } from "vue"; const k = '', f = (e) => [ { display: "Open AC Map", key: "AC" }, { display: "Open FC Map", key: "FC" }, { display: "Open 3D Human Map", key: "3D" } ], b = { name: "MultiFlatmap", mixins: [M, v], components: { MultiFlatmapVuer: C, HelpModeDialog: h }, data: function() { return { zoomLevel: 6, flatmapReady: !1, availableSpecies: g(), scaffoldResource: {}, showStarInLegend: !1, openMapOptions: f() }; }, methods: { getState: function() { if (this.flatmapReady) return this.$refs.multiflatmap.getState(); }, flatmapPanZoomCallback: function(e) { if (this.mouseHovered) { const t = { paneIndex: this.entry.id, eventType: "panZoom", payload: e, type: this.entry.type }; this.$emit("resource-selected", t); } }, /** * Perform a local search on this contentvuer */ search: function(e) { return this.$refs.multiflatmap.getCurrentFlatmap().searchAndShowResult(e, !0, !0); }, /** * Append the list of suggested terms to suggestions */ searchSuggestions: function(e, t) { const a = this.$refs.multiflatmap.getCurrentFlatmap(); if (e && a.mapImp) { const n = a.mapImp.search(e); (n.__featureIds || n.featureIds).forEach((s) => { const i = a.mapImp.annotation(s); i && i.label && t.push(i.label); }); } }, flatmapResourceSelected: function(e, t) { const a = this.$refs.multiflatmap.getCurrentFlatmap(); if (this.resourceSelected(e, t), t.eventType === "click" && t.feature.type === "feature") { const n = { label: t.label || "", id: t.feature.id || "", featureId: t.feature.featureId || "", taxonomy: t.taxonomy || "", resources: t.resource.join(", ") }, o = y(n); r.sendEvent({ event: "interaction_event", event_name: "portal_maps_connectivity", category: o, location: e + " " + a.viewingMode }); } }, onPathwaySelectionChanged: function(e) { const { label: t, property: a, checked: n, selectionsTitle: o } = e; r.sendEvent({ event: "interaction_event", event_name: "portal_maps_pathway_change", category: t + " [" + a + "] " + n, location: o }); }, onSidebarAnnotationClose: function() { this.flatmapReady && this.$refs.multiflatmap.getCurrentFlatmap().annotationEventCallback({}, { type: "aborted" }); }, onOpenPubmedUrl: function(e) { r.sendEvent({ event: "interaction_event", event_name: "portal_maps_pubmed_url", file_path: e, location: "map_popup_button" }); }, zoomToFeatures: function(e, t) { let a = e.name; const n = this.$refs.multiflatmap.getCurrentFlatmap().mapImp; if (a) { const o = n.search(a); o.featureIds.length > 0 ? (t && n.selectFeatures(o.featureIds), n.zoomToFeatures(o.featureIds)) : n.clearSearchResults(); } else n.clearSearchResults(); }, updateProvCard: function() { const e = this.getFlatmapImp(); if (e) { let t = { id: this.entry.id, prov: e.provenance }; l.emit("mapImpProv", t), this.$emit("flatmap-provenance-ready", t); } }, flatmapChanged: async function(e) { this.activeSpecies = e, this.openMapOptions = f(); const t = this.getFlatmapImp(); t && (this.updateProvCard(), this.flatmapMarkerUpdate(t), this.updateViewerSettings()), this.$emit("species-changed", e), r.sendEvent({ event: "interaction_event", event_name: "portal_maps_species_change", category: this.activeSpecies }); }, multiFlatmapReady: function(e) { if (e) { e.enablePanZoomEvents(!0), this.flatmapReady = !0; const t = e.mapImp; this.flatmapMarkerUpdate(t), this.updateProvCard(), this.updateViewerSettings(), this.loadConnectivityExplorerConfig(e), l.emit("mapLoaded", e); } }, getFlatmapImp: function() { if (this.entry.type === "MultiFlatmap" && this.flatmapReady && this.$refs.multiflatmap) return this.$refs.multiflatmap.getCurrentFlatmap().mapImp; }, flatmapAreaSearch() { let a = { type: "Facets", label: "Unused", val: this.getFlatmapImp().visibleMarkerAnatomicalIds().map((n) => this.idNamePair[n]) }; l.emit("PopoverActionClick", a); }, restoreFeaturedMarkers: function(e) { this.settingsStore.resetFeaturedMarkerIdentifier(); const t = this.settingsStore.featuredMarkers; this.updateFeaturedMarkers(t, e); }, // updateFeaturedMarkers will step through the featured markers and add them to the map updateFeaturedMarkers: function(e, t) { this.showStarInLegend = !1; for (let a = 0; a < e.length; ++a) e[a] && (this.settingsStore.featuredMarkerIdentifiers[a] || this.addFeaturedMarker(e[a], a, t) && (this.showStarInLegend = !0)); }, // addFeaturedMarker: add a featured marker to the map at the specified uberon location addFeaturedMarker: function(e, t, a) { const n = this.settingsStore.featuredMarkerSpecies[t]; if (n && !this.activeSpecies.startsWith(n)) return !1; let o = a; if (o || (o = this.getFlatmapImp()), o) { let s = document.createElement("div"); s.innerHTML = k; const i = o.addMarker(e, { element: s, className: "highlight-marker", cluster: !1 }); return this.settingsStore.updateFeaturedMarkerIdentifier({ index: t, markerIdentifier: i }), !0; } return !1; }, /** * Change the view mode of the current flatmap */ changeViewingMode: function(e) { this.$refs.multiflatmap.getCurrentFlatmap().changeViewingMode(e); }, showConnectivity: function(e) { if (this != null && this.alive && this.flatmapReady && this.$refs.multiflatmap) { const { featureIds: t, offset: a } = e, n = this.$refs.multiflatmap.getCurrentFlatmap(); n && n.moveMap(t, { offsetX: a ? -150 : 0, zoom: 4 }); } }, showConnectivityTooltips: function(e) { this != null && this.alive && this.flatmapReady && this.$refs.multiflatmap.getCurrentFlatmap().showConnectivityTooltips(e); }, showConnectivitiesByReference: function(e) { if (this != null && this.alive && this.flatmapReady && this.$refs.multiflatmap) { const t = this.$refs.multiflatmap.getCurrentFlatmap(); t && t.showConnectivitiesByReference(e); } }, changeConnectivitySource: function(e) { this != null && this.alive && this.flatmapReady && this.$refs.multiflatmap.getCurrentFlatmap().changeConnectivitySource(e); }, updateViewerSettings: function() { const { backgroundDisplay: e, viewingMode: t, flightPathDisplay: a, organsDisplay: n, outlinesDisplay: o, connectionType: s } = this.settingsStore.globalSettings; if (this.flatmapReady) { const i = this.$refs.multiflatmap.getCurrentFlatmap(); i.changeViewingMode(t), i.setFlightPath3D(a), i.setColour(n), i.setOutlines(o), i.backgroundChangeCallback(e), i.setConnectionType(s); } }, setVisibilityFilter: function(e) { if (this != null && this.alive && this.flatmapReady && this.$refs.multiflatmap) { const t = this.$refs.multiflatmap.getCurrentFlatmap(); t && t.setVisibilityFilter(e); } }, getKnowledgeTooltip: async function(e) { if (this != null && this.alive && this.flatmapReady) { const t = e.data[0]; this.$refs.multiflatmap.getCurrentFlatmap().searchAndShowResult(t.id, !0, !1); } } }, computed: { facetSpecies() { return this.settingsStore.facets.species; }, featuredMarkers() { return this.settingsStore.featuredMarkers; } }, watch: { featuredMarkers: function(e) { this.flatmapReady && this.updateFeaturedMarkers(e, void 0); } }, mounted: function() { this.getFeaturedDatasets(); } }, O = { class: "viewer-container" }; function L(e, t, a, n, o, s) { const i = p("MultiFlatmapVuer"), d = p("HelpModeDialog"); return m(), S("div", O, [ I(i, { availableSpecies: e.availableSpecies, onFlatmapChanged: s.flatmapChanged, onReady: s.multiFlatmapReady, state: e.entry.state, mapManager: e.mapManager, onResourceSelected: t[0] || (t[0] = (u) => s.flatmapResourceSelected(e.entry.type, u)), style: { height: "100%", width: "100%" }, initial: e.entry.resource, helpMode: e.helpMode, helpModeActiveItem: e.helpModeActiveItem, helpModeDialog: e.useHelpModeDialog, onHelpModeLastItem: e.onHelpModeLastItem, onShownTooltip: e.onTooltipShown, onShownMapTooltip: e.onMapTooltipShown, onAnnotationOpen: e.onAnnotationOpen, onAnnotationClose: e.onAnnotationClose, onUpdateOfflineAnnotationEnabled: e.updateOfflineAnnotationEnabled, annotationSidebar: e.annotationSidebar, onConnectivityInfoOpen: e.onConnectivityInfoOpen, onConnectivityError: e.onConnectivityError, onConnectivityInfoClose: e.onConnectivityInfoClose, onNeuronConnectionFeatureClick: e.onNeuronConnectionFeatureClick, connectivityInfoSidebar: e.connectivityInfoSidebar, ref: "multiflatmap", displayMinimap: !0, showStarInLegend: e.showStarInLegend, enableOpenMapUI: !0, openMapOptions: e.openMapOptions, flatmapAPI: e.flatmapAPI, sparcAPI: e.apiLocation, showLocalSettings: e.showLocalSettings, showOpenMapButton: e.showOpenMapButton, onPanZoomCallback: s.flatmapPanZoomCallback, onOpenMap: e.openMap, onFinishHelpMode: e.endHelp, onPathwaySelectionChanged: s.onPathwaySelectionChanged, onOpenPubmedUrl: s.onOpenPubmedUrl, onMapmanagerLoaded: e.onMapmanagerLoaded, showPathwayFilter: !1, onTrackEvent: e.trackEvent }, null, 8, ["availableSpecies", "onFlatmapChanged", "onReady", "state", "mapManager", "initial", "helpMode", "helpModeActiveItem", "helpModeDialog", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "onAnnotationOpen", "onAnnotationClose", "onUpdateOfflineAnnotationEnabled", "annotationSidebar", "onConnectivityInfoOpen", "onConnectivityError", "onConnectivityInfoClose", "onNeuronConnectionFeatureClick", "connectivityInfoSidebar", "showStarInLegend", "openMapOptions", "flatmapAPI", "sparcAPI", "showLocalSettings", "showOpenMapButton", "onPanZoomCallback", "onOpenMap", "onFinishHelpMode", "onPathwaySelectionChanged", "onOpenPubmedUrl", "onMapmanagerLoaded", "onTrackEvent"]), e.helpMode && e.useHelpModeDialog ? (m(), F(d, { key: 0, ref: "multiflatmapHelp", multiflatmapRef: e.multiflatmapRef, lastItem: e.helpModeLastItem, onShowNext: e.onHelpModeShowNext, onFinishHelpMode: e.onFinishHelpMode }, null, 8, ["multiflatmapRef", "lastItem", "onShowNext", "onFinishHelpMode"])) : w("", !0) ]); } const $ = /* @__PURE__ */ c(b, [["render", L], ["__scopeId", "data-v-be8627cd"]]); export { $ as default };