import { _ as c, K as h, t as u, T as l, E as r } from "./index-DsKXfcyp.js"; import { C as I } from "./ContentMixin-BDLOq1Mp.js"; import { D as g, g as M } from "./style-DLxHSy8g.js"; import { resolveComponent as s, openBlock as p, createElementBlock as v, createVNode as y, createBlock as S, createCommentVNode as C } from "vue"; const F = { name: "Flatmap", mixins: [I, g], components: { FlatmapVuer: M, HelpModeDialog: h }, methods: { getState: function() { return this.$refs.flatmap.getState(); }, /** * Perform a local search on this contentvuer */ search: function(e) { return this.$refs.flatmap.searchAndShowResult(e); }, getFlatmapImp() { var e; return (e = this.$refs.flatmap) == null ? void 0 : e.mapImp; }, flatmaprResourceSelected: function(e, a) { if (this.resourceSelected(e, a), a.eventType === "click" && a.feature.type === "feature") { const n = { label: a.label || "", id: a.feature.id || "", featureId: a.feature.featureId || "", taxonomy: a.taxonomy || "", resources: a.resource.join(", ") }, t = u(n); l.sendEvent({ event: "interaction_event", event_name: "portal_maps_connectivity", category: t, location: e + " " + this.$refs.flatmap.viewingMode }); } }, flatmapReadyCall: function(e) { let a = { id: this.entry.id, prov: this.getFlatmapImp().provenance }; r.emit("mapImpProv", a), this.$emit("flatmap-provenance-ready", a), this.flatmapReadyForMarkerUpdates(e), r.emit("mapLoaded", e); }, onPathwaySelectionChanged: function(e) { const { label: a, property: n, checked: t, selectionsTitle: i } = e; l.sendEvent({ event: "interaction_event", event_name: "portal_maps_pathway_change", category: a + " [" + n + "] " + t, location: i }); }, highlightFeatures: function(e) { let a = e.name; const n = this.$refs.flatmap.mapImp; if (a) { const t = n.search(a); t.featureIds[0] && n.highlightFeatures([ n.modelForFeature(t.featureIds[0]) ]); } }, /** * Append the list of suggested terms to suggestions */ searchSuggestions: function(e, a) { if (e && this.$refs.flatmap.mapImp) { const n = this.$refs.flatmap.mapImp.search(e); (n.__featureIds || n.featureIds).forEach((i) => { const o = this.$refs.flatmap.mapImp.annotation(i); o && o.label && a.push(o.label); }); } }, zoomToFeatures: function(e, a) { let n = e.name; const t = this.$refs.flatmap.mapImp; if (n) { const i = t.search(n); if (i.featureIds.length) { let o = t.modelForFeature(i.featureIds[0]); o ? (a && t.selectFeatures(o), t.zoomToFeatures(o)) : t.clearSearchResults(); } } else t.clearSearchResults(); }, changeViewingMode: function(e) { this.$refs.flatmap.changeViewingMode(e); } }, computed: { facetSpecies() { return this.settingsStore.facets.species; } }, mounted: function() { r.on("annotation-close", (e) => { const a = this.$refs.flatmap; e != null && e.tabClose && a && this.$refs.flatmap.annotationEventCallback({}, { type: "aborted" }); }), r.on("markerUpdate", () => { this.flatmapMarkerUpdate(void 0); }), r.on("hoverUpdate", () => { this.mapHoverHighlight(this.$refs.flatmap.mapImp); }), r.on("show-connectivity", (e) => { const { featureIds: a, offset: n } = e, t = this.$refs.flatmap; t && t.moveMap(a, { offsetX: n ? -150 : 0, zoom: 4 }); }); } }, w = { class: "viewer-container" }; function b(e, a, n, t, i, o) { const m = s("FlatmapVuer"), f = s("HelpModeDialog"); return p(), v("div", w, [ y(m, { state: e.entry.state, entry: e.entry.resource, mapManager: e.mapManager, onResourceSelected: a[0] || (a[0] = (d) => o.flatmaprResourceSelected(e.entry.type, d)), 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, annotationSidebar: e.annotationSidebar, onConnectivityInfoOpen: e.onConnectivityInfoOpen, onConnectivityInfoClose: e.onConnectivityInfoClose, onConnectivityGraphError: e.onConnectivityGraphError, connectivityInfoSidebar: e.connectivityInfoSidebar, pathControls: !0, ref: "flatmap", onReady: o.flatmapReadyCall, displayMinimap: !1, displayWarning: !0, enableOpenMapUI: !0, flatmapAPI: e.flatmapAPI, sparcAPI: e.apiLocation, onOpenMap: e.openMap, onPathwaySelectionChanged: o.onPathwaySelectionChanged, onMapmanagerLoaded: e.onMapmanagerLoaded }, null, 8, ["state", "entry", "mapManager", "onPanZoomCallback", "name", "minZoom", "helpMode", "helpModeActiveItem", "helpModeDialog", "onHelpModeLastItem", "onShownTooltip", "onShownMapTooltip", "onAnnotationOpen", "onAnnotationClose", "annotationSidebar", "onConnectivityInfoOpen", "onConnectivityInfoClose", "onConnectivityGraphError", "connectivityInfoSidebar", "onReady", "flatmapAPI", "sparcAPI", "onOpenMap", "onPathwaySelectionChanged", "onMapmanagerLoaded"]), e.helpMode && e.useHelpModeDialog ? (p(), S(f, { key: 0, ref: "flatmapHelp", flatmapRef: e.flatmapRef, lastItem: e.helpModeLastItem, onShowNext: e.onHelpModeShowNext, onFinishHelpMode: e.onFinishHelpMode }, null, 8, ["flatmapRef", "lastItem", "onShowNext", "onFinishHelpMode"])) : C("", !0) ]); } const R = /* @__PURE__ */ c(F, [["render", b], ["__scopeId", "data-v-9e155ca8"]]); export { R as default };