import { _ as d, q as h, t as u, T as s, E as r } from "./index-C7KKEuWJ.js"; import { C as y } from "./ContentMixin-DksfeIll.js"; import { D as g } from "./style-DQQ2HZHE.js"; import { FlatmapVuer as v } from "@abi-software/flatmapvuer"; import { resolveComponent as p, openBlock as f, createElementBlock as C, createVNode as M, createBlock as I, createCommentVNode as S } from "vue"; const w = { name: "Flatmap", mixins: [y, g], components: { FlatmapVuer: v, HelpModeDialog: h }, data: function() { return { flatmapReady: !1 }; }, methods: { getState: function() { return this.$refs.flatmap.getState(); }, /** * Perform a local search on this contentvuer * This is similar to directly clicking onthe map */ search: function(e) { return this.$refs.flatmap.searchAndShowResult(e, !0, !0); }, getFlatmapImp() { var e; return (e = this.$refs.flatmap) == null ? void 0 : e.mapImp; }, flatmapResourceSelected: function(e, t) { if (this.resourceSelected(e, t), t.eventType === "click" && t.feature.type === "feature") { const a = { label: t.label || "", id: t.feature.id || "", featureId: t.feature.featureId || "", taxonomy: t.taxonomy || "", resources: t.resource.join(", ") }, n = u(a); s.sendEvent({ event: "interaction_event", event_name: "portal_maps_connectivity", category: n, location: e + " " + this.$refs.flatmap.viewingMode }); } }, flatmapReadyCall: function(e) { this.flatmapReady = !0; let t = { id: this.entry.id, prov: this.getFlatmapImp().provenance }; e.mapImp, r.emit("mapImpProv", t), this.$emit("flatmap-provenance-ready", t), this.flatmapReadyForMarkerUpdates(e), this.updateViewerSettings(), this.loadConnectivityExplorerConfig(e), r.emit("mapLoaded", e); }, onPathwaySelectionChanged: function(e) { const { label: t, property: a, checked: n, selectionsTitle: i } = e; s.sendEvent({ event: "interaction_event", event_name: "portal_maps_pathway_change", category: t + " [" + a + "] " + n, location: i }); }, onSidebarAnnotationClose: function() { this.flatmapReady && this.$refs.flatmap && this.$refs.flatmap.annotationEventCallback({}, { type: "aborted" }); }, /** * Append the list of suggested terms to suggestions */ searchSuggestions: function(e, t) { if (e && this.$refs.flatmap.mapImp) { const a = this.$refs.flatmap.mapImp.search(e); (a.__featureIds || a.featureIds).forEach((i) => { const o = this.$refs.flatmap.mapImp.annotation(i); o && o.label && t.push(o.label); }); } }, showConnectivity: function(e) { if (this != null && this.alive) { const { featureIds: t, offset: a } = e, n = this.$refs.flatmap; 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) { const t = this.$refs.flatmap; t && t.showConnectivitiesByReference(e); } }, changeConnectivitySource: function(e) { this != null && this.alive && this.flatmapReady && this.$refs.multiflatmap.getCurrentFlatmap().changeConnectivitySource(e); }, zoomToFeatures: function(e, t) { let a = e.name; const n = this.$refs.flatmap.mapImp; if (a) { const i = n.search(a); if (i.featureIds.length) { let o = n.modelForFeature(i.featureIds[0]); o ? (t && n.selectFeatures(o), n.zoomToFeatures(o)) : n.clearSearchResults(); } } else n.clearSearchResults(); }, changeViewingMode: function(e) { this.$refs.flatmap.changeViewingMode(e); }, updateViewerSettings: function() { const { backgroundDisplay: e, viewingMode: t, flightPathDisplay: a, organsDisplay: n, outlinesDisplay: i, connectionType: o } = this.settingsStore.globalSettings, l = this.$refs.flatmap; l.changeViewingMode(t), l.setFlightPath3D(a), l.setColour(n), l.setOutlines(i), l.backgroundChangeCallback(e), l.setConnectionType(o); }, setVisibilityFilter: function(e) { if (this != null && this.alive) { const t = this.$refs.flatmap; t && t.setVisibilityFilter(e); } }, getKnowledgeTooltip: async function(e) { if (this != null && this.alive) { const t = this.$refs.flatmap; if (t) { const a = e.data[0]; t.searchAndShowResult(a.id, !0, !1); } } } }, computed: { facetSpecies() { return this.settingsStore.facets.species; } } }, F = { class: "viewer-container" }; function b(e, t, a, n, i, o) { const l = p("FlatmapVuer"), m = p("HelpModeDialog"); return f(), C("div", F, [ M(l, { state: e.entry.state, entry: e.entry.resource, mapManager: e.mapManager, onResourceSelected: t[0] || (t[0] = (c) => o.flatmapResourceSelected(e.entry.type, c)), onPanZoomCallback: e.flatmapPanZoomCallback, name: e.entry.resource, style: { height: "100%", width: "100%" }, minZoom: e.entry.minZoom, helpMode: e.helpMode, helpModeActiveItem: e.helpModeActiveItem, helpModeInitialIndex: -1, 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, pathControls: !0, ref: "flatmap", onReady: o.flatmapReadyCall, displayMinimap: !1, displayWarning: !0, enableOpenMapUI: !0, flatmapAPI: e.flatmapAPI, sparcAPI: e.apiLocation, showLocalSettings: e.showLocalSettings, showOpenMapButton: e.showOpenMapButton, onOpenMap: e.openMap, onPathwaySelectionChanged: o.onPathwaySelectionChanged, onMapmanagerLoaded: e.onMapmanagerLoaded, showPathwayFilter: !1, onTrackEvent: e.trackEvent }, null, 8, ["state", "entry", "mapManager", "onPanZoomCallback", "name", "minZoom", "helpMode", "helpModeActiveItem", "helpModeDialog", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "onAnnotationOpen", "onAnnotationClose", "onUpdateOfflineAnnotationEnabled", "annotationSidebar", "onConnectivityInfoOpen", "onConnectivityError", "onConnectivityInfoClose", "onNeuronConnectionFeatureClick", "connectivityInfoSidebar", "onReady", "flatmapAPI", "sparcAPI", "showLocalSettings", "showOpenMapButton", "onOpenMap", "onPathwaySelectionChanged", "onMapmanagerLoaded", "onTrackEvent"]), e.helpMode && e.useHelpModeDialog ? (f(), I(m, { key: 0, ref: "flatmapHelp", flatmapRef: e.flatmapRef, lastItem: e.helpModeLastItem, onShowNext: e.onHelpModeShowNext, onFinishHelpMode: e.onFinishHelpMode }, null, 8, ["flatmapRef", "lastItem", "onShowNext", "onFinishHelpMode"])) : S("", !0) ]); } const E = /* @__PURE__ */ d(w, [["render", b], ["__scopeId", "data-v-a09a66dc"]]); export { E as default };