@abi-software/mapintegratedvuer 1.18.4-beta.0 → 1.18.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConnectivityGraph-DLFptXBx.js → ConnectivityGraph-2udNFLIF.js} +2 -2
- package/dist/{ContentMixin-mlgJKWSV.js → ContentMixin-CNjL9TTP.js} +1 -1
- package/dist/{Flatmap-C_dxdPoG.js → Flatmap-B_ca6idg.js} +3 -3
- package/dist/{Iframe-DSs4fYFg.js → Iframe-ba2kWoQp.js} +2 -2
- package/dist/{MultiFlatmap-CR4VErZA.js → MultiFlatmap-CS6SZ-le.js} +3 -3
- package/dist/{Plot-DR5LbEyP.js → Plot-BQtVooP8.js} +2 -2
- package/dist/{Scaffold-BWpF_Rpf.js → Scaffold-pMqcYh1l.js} +2 -2
- package/dist/{Simulation-CVXo2IEG.js → Simulation-ChMh8Nmk.js} +2 -2
- package/dist/{index-CMkLXnxB.js → index-DfylWmCz.js} +26 -7
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +1 -1
- package/dist/{style-BQwr0Nf9.js → style-Bxxbwgzs.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/ContextCard.vue +40 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as c, N as h, E as m } from "./index-
|
|
2
|
-
import { C as y } from "./ContentMixin-
|
|
1
|
+
import { _ as c, N as h, E as m } from "./index-DfylWmCz.js";
|
|
2
|
+
import { C as y } from "./ContentMixin-CNjL9TTP.js";
|
|
3
3
|
import { resolveComponent as p, openBlock as d, createElementBlock as l, createVNode as v } from "vue";
|
|
4
4
|
const g = {
|
|
5
5
|
name: "ConnectivityGraph",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { markRaw as A } from "vue";
|
|
2
|
-
import { H as _, c as E, u as O, d as N, e as x, f as P, T as L, E as m, h as w, l as B, Q as X } from "./index-
|
|
2
|
+
import { H as _, c as E, u as O, d as N, e as x, f as P, T as L, E as m, h as w, l as B, Q as X } from "./index-DfylWmCz.js";
|
|
3
3
|
import { mapStores as U } from "pinia";
|
|
4
4
|
const d = function(e) {
|
|
5
5
|
return e ? [...new Set(e.map((n) => JSON.stringify(n)))].map(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as d, q as c, T as h, E as l } from "./index-
|
|
2
|
-
import { C as u } from "./ContentMixin-
|
|
3
|
-
import { D as y } from "./style-
|
|
1
|
+
import { _ as d, q as c, T as h, E as l } from "./index-DfylWmCz.js";
|
|
2
|
+
import { C as u } from "./ContentMixin-CNjL9TTP.js";
|
|
3
|
+
import { D as y } from "./style-Bxxbwgzs.js";
|
|
4
4
|
import { FlatmapVuer as g } from "@abi-software/flatmapvuer";
|
|
5
5
|
import { resolveComponent as r, openBlock as p, createElementBlock as M, createVNode as C, createBlock as v, createCommentVNode as I } from "vue";
|
|
6
6
|
const S = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as r } from "./ContentMixin-
|
|
1
|
+
import { C as r } from "./ContentMixin-CNjL9TTP.js";
|
|
2
2
|
import { openBlock as o, createElementBlock as t, createElementVNode as a } from "vue";
|
|
3
|
-
import { _ as s } from "./index-
|
|
3
|
+
import { _ as s } from "./index-DfylWmCz.js";
|
|
4
4
|
const n = {
|
|
5
5
|
name: "Iframe",
|
|
6
6
|
mixins: [r]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as c, q as h, E as r, T as l, a as g } from "./index-
|
|
2
|
-
import { C as M } from "./ContentMixin-
|
|
3
|
-
import { D as y } from "./style-
|
|
1
|
+
import { _ as c, q as h, E as r, T as l, a as g } from "./index-DfylWmCz.js";
|
|
2
|
+
import { C as M } from "./ContentMixin-CNjL9TTP.js";
|
|
3
|
+
import { D as y } from "./style-Bxxbwgzs.js";
|
|
4
4
|
import { MultiFlatmapVuer as C } from "@abi-software/flatmapvuer";
|
|
5
5
|
import { resolveComponent as p, openBlock as m, createElementBlock as v, createVNode as I, createBlock as S, createCommentVNode as F } from "vue";
|
|
6
6
|
const w = '<svg width="72px" height="72px" viewBox="0 0 24 24" fill="yellow"><path d="M11.0748 3.25583C11.4141 2.42845 12.5859 2.42845 12.9252 3.25583L14.6493 7.45955C14.793 7.80979 15.1221 8.04889 15.4995 8.07727L20.0303 8.41798C20.922 8.48504 21.2841 9.59942 20.6021 10.1778L17.1369 13.1166C16.8482 13.3614 16.7225 13.7483 16.8122 14.1161L17.8882 18.5304C18.1 19.3992 17.152 20.0879 16.3912 19.618L12.5255 17.2305C12.2034 17.0316 11.7966 17.0316 11.4745 17.2305L7.60881 19.618C6.84796 20.0879 5.90001 19.3992 6.1118 18.5304L7.18785 14.1161C7.2775 13.7483 7.1518 13.3614 6.86309 13.1166L3.3979 10.1778C2.71588 9.59942 3.07796 8.48504 3.96971 8.41798L8.50046 8.07727C8.87794 8.04889 9.20704 7.80979 9.35068 7.45955L11.0748 3.25583Z" stroke="#000000" stroke-width="2"/></svg>', d = (e) => [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PlotVuer as o } from "@abi-software/plotvuer";
|
|
2
|
-
import { C as r } from "./ContentMixin-
|
|
2
|
+
import { C as r } from "./ContentMixin-CNjL9TTP.js";
|
|
3
3
|
import { resolveComponent as a, openBlock as n, createBlock as s } from "vue";
|
|
4
|
-
import { _ as p } from "./index-
|
|
4
|
+
import { _ as p } from "./index-DfylWmCz.js";
|
|
5
5
|
const l = {
|
|
6
6
|
name: "Plot",
|
|
7
7
|
mixins: [r],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveComponent as g, openBlock as c, createElementBlock as y, createBlock as m, createCommentVNode as v, markRaw as d } from "vue";
|
|
2
|
-
import { _ as w, q as b, E as h, g as S, b as $ } from "./index-
|
|
3
|
-
import { C as M } from "./ContentMixin-
|
|
2
|
+
import { _ as w, q as b, E as h, g as S, b as $ } from "./index-DfylWmCz.js";
|
|
3
|
+
import { C as M } from "./ContentMixin-CNjL9TTP.js";
|
|
4
4
|
import { ScaffoldVuer as C } from "@abi-software/scaffoldvuer";
|
|
5
5
|
const O = {
|
|
6
6
|
name: "Scaffold",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as n } from "./ContentMixin-
|
|
1
|
+
import { C as n } from "./ContentMixin-CNjL9TTP.js";
|
|
2
2
|
import { SimulationVuer as e } from "@abi-software/simulationvuer";
|
|
3
3
|
import { resolveComponent as r, openBlock as a, createBlock as c } from "vue";
|
|
4
|
-
import { _ as m } from "./index-
|
|
4
|
+
import { _ as m } from "./index-DfylWmCz.js";
|
|
5
5
|
const s = {
|
|
6
6
|
name: "Simulation",
|
|
7
7
|
mixins: [n],
|
|
@@ -47729,9 +47729,9 @@ const x5e = /* @__PURE__ */ iM(w5e), Ya = (e, t) => {
|
|
|
47729
47729
|
return e.split("https://doi.org/").pop();
|
|
47730
47730
|
},
|
|
47731
47731
|
generateFileLink(e) {
|
|
47732
|
-
const t = this.processPathForUrl(e.path);
|
|
47733
|
-
let
|
|
47734
|
-
return
|
|
47732
|
+
const t = this.processPathForUrl(e.path), n = e.version || "";
|
|
47733
|
+
let r = "";
|
|
47734
|
+
return e.datasetURL ? r = `${e.datasetURL.replace(/datasets\/(\d+)\/version\/(\d+)/, "datasets/file/$1/$2")}?path=${t}` : e.discoverId && (r = `${this.envVars.ROOT_URL}/datasets/file/${e.discoverId}/${n}?path=${t}`), r;
|
|
47735
47735
|
},
|
|
47736
47736
|
parseMarkdown(e) {
|
|
47737
47737
|
const t = x5e(St.parse(e));
|
|
@@ -47741,6 +47741,21 @@ const x5e = /* @__PURE__ */ iM(w5e), Ya = (e, t) => {
|
|
|
47741
47741
|
const t = this.getFileFromPath(e.path);
|
|
47742
47742
|
this.$emit("scaffold-view-clicked", t);
|
|
47743
47743
|
},
|
|
47744
|
+
fetchDOIURL: async function(e) {
|
|
47745
|
+
var r;
|
|
47746
|
+
const n = `https://doi.org/api/handles/${e.includes("https://doi.org/") ? this.splitDoiFromUrl(e) : e}?noredirect`;
|
|
47747
|
+
try {
|
|
47748
|
+
const o = await fetch(n);
|
|
47749
|
+
if (!o.ok)
|
|
47750
|
+
throw new Error(`Response status: ${o.status}`);
|
|
47751
|
+
const i = (r = (await o.json()).values) == null ? void 0 : r.find((s) => s.type === "URL");
|
|
47752
|
+
if (i && i.data && i.data.value)
|
|
47753
|
+
return i.data.value;
|
|
47754
|
+
throw new Error("Redirect URL not found in DOI metadata");
|
|
47755
|
+
} catch (o) {
|
|
47756
|
+
throw new Error(o);
|
|
47757
|
+
}
|
|
47758
|
+
},
|
|
47744
47759
|
getOriginalSource: function() {
|
|
47745
47760
|
const e = this.entry.discoverId, n = this.entry.resource.substring(
|
|
47746
47761
|
this.entry.resource.indexOf("files/") + 6,
|
|
@@ -47754,7 +47769,11 @@ const x5e = /* @__PURE__ */ iM(w5e), Ya = (e, t) => {
|
|
|
47754
47769
|
return a.json();
|
|
47755
47770
|
throw Error(a.statusText);
|
|
47756
47771
|
}).then((a) => {
|
|
47757
|
-
this.loadingOriginalSource = !1, a.result && (a.result.forEach((i) => {
|
|
47772
|
+
this.loadingOriginalSource = !1, a.result && (a.result.forEach(async (i) => {
|
|
47773
|
+
if (i.doi) {
|
|
47774
|
+
const s = await this.fetchDOIURL(i.doi);
|
|
47775
|
+
i.datasetURL = s, i.name = i.name || i.path.split("/").pop();
|
|
47776
|
+
}
|
|
47758
47777
|
i.flatmapUUID ? this.flatmapSource.push(i) : this.originalSource.push(i);
|
|
47759
47778
|
}), (this.flatmapSource.length || this.originalSource.length) && (this.copyContent = this.updateCopyContent())), this.loadingOriginalSource = !1;
|
|
47760
47779
|
}).catch((a) => {
|
|
@@ -47775,7 +47794,7 @@ const x5e = /* @__PURE__ */ iM(w5e), Ya = (e, t) => {
|
|
|
47775
47794
|
mounted: function() {
|
|
47776
47795
|
this.copyContent = this.updateCopyContent(), this.getOriginalSource();
|
|
47777
47796
|
}
|
|
47778
|
-
}, zd = (e) => (Ha("data-v-
|
|
47797
|
+
}, zd = (e) => (Ha("data-v-f8e7ebb6"), e = e(), Ua(), e), _5e = {
|
|
47779
47798
|
class: "context-card-container",
|
|
47780
47799
|
ref: "container"
|
|
47781
47800
|
}, $5e = {
|
|
@@ -47964,7 +47983,7 @@ function s3e(e, t, n, r, o, a) {
|
|
|
47964
47983
|
])
|
|
47965
47984
|
], 512);
|
|
47966
47985
|
}
|
|
47967
|
-
const gV = /* @__PURE__ */ Ya(S5e, [["render", s3e], ["__scopeId", "data-v-
|
|
47986
|
+
const gV = /* @__PURE__ */ Ya(S5e, [["render", s3e], ["__scopeId", "data-v-f8e7ebb6"]]), l3e = {
|
|
47968
47987
|
name: "FlatmapContextCard",
|
|
47969
47988
|
components: {
|
|
47970
47989
|
Loading: UM,
|
|
@@ -49551,7 +49570,7 @@ function K3e(e, t, n, r, o, a) {
|
|
|
49551
49570
|
])
|
|
49552
49571
|
]);
|
|
49553
49572
|
}
|
|
49554
|
-
const rH = /* @__PURE__ */ Ya(H3e, [["render", K3e], ["__scopeId", "data-v-511f5d36"]]), W3e = Ou(() => import("./Flatmap-
|
|
49573
|
+
const rH = /* @__PURE__ */ Ya(H3e, [["render", K3e], ["__scopeId", "data-v-511f5d36"]]), W3e = Ou(() => import("./Flatmap-B_ca6idg.js")), Y3e = Ou(() => import("./Iframe-ba2kWoQp.js")), Z3e = Ou(() => import("./MultiFlatmap-CS6SZ-le.js")), X3e = Ou(() => import("./ConnectivityGraph-2udNFLIF.js")), J3e = Ou(() => import("./Plot-BQtVooP8.js")), Q3e = Ou(() => import("./Scaffold-pMqcYh1l.js")), e4e = Ou(() => import("./Simulation-ChMh8Nmk.js")), t4e = {
|
|
49555
49574
|
name: "ContentVuer",
|
|
49556
49575
|
props: {
|
|
49557
49576
|
/**
|
|
@@ -557,7 +557,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const a="<p>An err
|
|
|
557
557
|
`,o+=`<ul>${a.join(`
|
|
558
558
|
`)}</ul>`,e.push(o)}return e.join(`
|
|
559
559
|
|
|
560
|
-
<br>`)},samplesMatching:function(e){return this.contextData&&this.contextData.samples?this.contextData.samples.filter(t=>t.view==e)[0]:[]},viewClicked:function(e,t){this.openViewFile(e),this.toggleSampleDetails(t)},getContextFile:function(e){this.loading=!0,fetch(e).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.contextData=t,this.loading=!1,this.addDiscoverIdsToContextData()}).catch(t=>{console.error("caught error!",t),this.loading=!1})},removeDoubleFilesPath:function(e){if(e)return e.includes("files/")?e.replace("files/",""):e.includes("files\\")?e.replace("files\\",""):e},toggleSampleDetails:function(e){this.sampleDetails[e]===void 0?this.sampleDetails[e]=!0:this.sampleDetails[e]=!this.sampleDetails[e]},getFileFromPath:function(e){return this.entry.contextCardUrl===!0?e:(e=this.removeDoubleFilesPath(e),`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${e}${this.getS3Args()}`)},addDiscoverIdsToContextData(){this.contextData.samples.forEach((e,t)=>{e&&e.doi&&e.doi!==""?fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${this.splitDoiFromUrl(e.doi)}`).then(n=>n.json()).then(n=>{this.contextData.samples[t].discoverId=n.id,this.contextData.samples[t].version=n.version}):(this.contextData.samples[t].discoverId=this.entry.discoverId,this.contextData.samples[t].version=this.entry.version)})},processPathForUrl(e){return e=q_e(e),e=U_e(e),encodeURIComponent(e)},splitDoiFromUrl(e){return e.split("https://doi.org/").pop()},generateFileLink(e){const t=this.processPathForUrl(e.path);let n=`${this.envVars.ROOT_URL}/datasets/file/${e.discoverId}/${e.version}?path=`;return n=n+t,n},parseMarkdown(e){const t=H_e(Ze.parse(e));return this.$emit("context-ready"),t},openViewFile:function(e){const t=this.getFileFromPath(e.path);this.$emit("scaffold-view-clicked",t)},getOriginalSource:function(){const e=this.entry.discoverId,n=this.entry.resource.substring(this.entry.resource.indexOf("files/")+6,this.entry.resource.lastIndexOf("?")),o=new URLSearchParams({discoverId:e,path:n}),a=`${this.envVars.API_LOCATION}/file_info/get_original_source?${o.toString()}`;fetch(a).then(i=>{if(i.ok)return i.json();throw Error(i.statusText)}).then(i=>{this.loadingOriginalSource=!1,i.result&&(i.result.forEach(s=>{s.flatmapUUID?this.flatmapSource.push(s):this.originalSource.push(s)}),(this.flatmapSource.length||this.originalSource.length)&&(this.copyContent=this.updateCopyContent())),this.loadingOriginalSource=!1}).catch(i=>{console.error("caught error!",i),this.loadingOriginalSource=!1})},onCopied:function(){const{label:e,type:t,discoverId:n}=this.entry,o=t?`${e} ${t}`:e;Nt.sendEvent({event:"interaction_event",event_name:"portal_maps_context_card_copy",category:o||"",location:"map_toolbar",dataset_id:n?n+"":""})}},mounted:function(){this.copyContent=this.updateCopyContent(),this.getOriginalSource()}},Su=e=>(r.pushScopeId("data-v-b9c1056b"),e=e(),r.popScopeId(),e),G_e={class:"context-card-container",ref:"container"},W_e={key:0,class:"context-card"},Y_e={class:"card-left"},X_e=["src"],Z_e={class:"card-right scrollbar"},J_e={class:"title"},Q_e=["innerHTML"],e$e={class:"card-bottom"},t$e={class:"source-data-list"},n$e=["href"],r$e={key:0,class:"flatmap-entry"},o$e={class:"source-data-list"},a$e=["onClick"],i$e={key:0,class:"subtitle"},s$e=["onClick"],l$e=["src"],c$e={class:"view-description"},u$e=Su(()=>r.createElementVNode("div",{class:"padding"},null,-1)),d$e=Su(()=>r.createElementVNode("div",{style:{"margin-bottom":"16px"}},null,-1)),f$e={key:1,class:"subtitle"},p$e=["onClick"],h$e=["src"],m$e=Su(()=>r.createElementVNode("i",{class:"el-icon-warning-outline info"},null,-1)),g$e=["innerHTML"],y$e=["href"],v$e=Su(()=>r.createElementVNode("div",{class:"padding"},null,-1)),b$e={key:0,class:"subtitle"},w$e=["onClick"],x$e=["src"],C$e={class:"view-description"},k$e=Su(()=>r.createElementVNode("i",{class:"el-icon-warning-outline info"},null,-1)),S$e=["innerHTML"],E$e=["href"],_$e=Su(()=>r.createElementVNode("div",{class:"padding"},null,-1)),$$e={key:2,class:"padding"},F$e={class:"float-button-container"};function A$e(e,t,n,o,a,i){const s=Yne,l=Wne,c=r.resolveComponent("CopyToClipboard"),u=Sc;return r.openBlock(),r.createElementBlock("div",G_e,[r.withDirectives(r.createElementVNode("div",null,[e.showDetails&&Object.keys(e.contextData).length!==0?r.withDirectives((r.openBlock(),r.createElementBlock("div",W_e,[r.createElementVNode("div",Y_e,[r.createElementVNode("img",{src:i.banner,class:"context-image"},null,8,X_e)]),r.createElementVNode("div",Z_e,[r.createElementVNode("div",null,[r.createElementVNode("div",J_e,r.toDisplayString(e.contextData.heading),1),r.createElementVNode("div",{innerHTML:i.parseMarkdown(e.contextData.description)},null,8,Q_e)])]),r.createElementVNode("div",e$e,[r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[e.originalSource&&e.originalSource.length?(r.openBlock(),r.createBlock(l,{key:0,modelValue:e.activeName,"onUpdate:modelValue":t[0]||(t[0]=d=>e.activeName=d)},{default:r.withCtx(()=>[r.createVNode(s,{title:"View/Hide source data links",name:"sourceDataLinks"},{default:r.withCtx(()=>[r.createElementVNode("ul",t$e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.originalSource,(d,f)=>(r.openBlock(),r.createElementBlock("li",{key:"source-"+f},[d&&d.path?(r.openBlock(),r.createElementBlock("a",{key:0,href:i.generateFileLink(d),target:"_blank"},"View "+r.toDisplayString(d.name),9,n$e)):r.createCommentVNode("",!0)]))),128))])]),_:1})]),_:1},8,["modelValue"])):r.createCommentVNode("",!0)])),[[u,e.loadingOriginalSource]]),e.flatmapSource&&e.flatmapSource.length?(r.openBlock(),r.createElementBlock("div",r$e,[r.createTextVNode(" Associated flatmaps from source: "),r.createElementVNode("ul",o$e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.flatmapSource,(d,f)=>(r.openBlock(),r.createElementBlock("li",{key:"flatmap-"+f},[r.createElementVNode("span",{onClick:p=>i.flatmapClick(d)}," For "+r.toDisplayString(d.name),9,a$e)]))),128))])])):r.createCommentVNode("",!0),r.createElementVNode("div",null,[i.samplesUnderViews?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[e.contextData.views&&e.contextData.views.length>0?(r.openBlock(),r.createElementBlock("div",b$e,"Scaffold Views")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.views,(d,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_1"},[r.createElementVNode("span",{onClick:p=>i.viewClicked(d,f),class:"context-card-view"},[r.createElementVNode("img",{class:"view-image",src:i.getFileFromPath(d.thumbnail)},null,8,x$e),r.createElementVNode("div",C$e,[r.createTextVNode(r.toDisplayString(d.description),1),k$e])],8,w$e),e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:i.samplesMatching(d.id).description},null,8,S$e)):r.createCommentVNode("",!0),e.sampleDetails[f]&&i.samplesMatching(d.id).path?(r.openBlock(),r.createElementBlock("a",{key:f+"_5",href:i.generateFileLink(i.samplesMatching(d.id)),target:"_blank"},"View Source",8,E$e)):r.createCommentVNode("",!0),_$e,e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",$$e)):r.createCommentVNode("",!0)],64))),128))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[e.contextData.views&&e.contextData.views.length>0?(r.openBlock(),r.createElementBlock("div",i$e,"Scaffold Views")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.views,(d,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_1"},[r.createElementVNode("div",{onClick:p=>i.openViewFile(d),class:"context-card-view"},[r.createElementVNode("img",{class:"view-image",src:i.getFileFromPath(d.thumbnail)},null,8,l$e),r.createElementVNode("div",c$e,r.toDisplayString(d.description),1)],8,s$e),u$e],64))),128)),d$e,e.contextData.samples&&e.contextData.samples.length>0?(r.openBlock(),r.createElementBlock("div",f$e,"Samples on Scaffold")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.samples,(d,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_3"},[r.createElementVNode("span",{class:"context-card-item cursor-pointer",onClick:p=>i.toggleSampleDetails(f)},[(r.openBlock(),r.createElementBlock("div",{key:f+"_6",style:{display:"flex"}},[d.color?(r.openBlock(),r.createElementBlock("div",{key:0,class:"color-box",style:r.normalizeStyle("background-color:"+d.color)},null,4)):d.thumbnail?(r.openBlock(),r.createElementBlock("img",{key:1,class:"key-image",src:i.getFileFromPath(d.thumbnail)},null,8,h$e)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(d.heading)+" ",1),m$e]))],8,p$e),e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:d.description},null,8,g$e)):r.createCommentVNode("",!0),e.sampleDetails[f]&&d.path?(r.openBlock(),r.createElementBlock("a",{key:1,href:i.generateFileLink(d),target:"_blank"},"View Source",8,y$e)):r.createCommentVNode("",!0),v$e],64))),128))],64))])])])),[[u,e.loading]]):r.createCommentVNode("",!0),r.createElementVNode("div",F$e,[r.createVNode(c,{content:e.copyContent,onCopied:i.onCopied,theme:"light"},null,8,["content","onCopied"])])],512),[[r.vShow,e.showContextCard]])],512)}const WP=Hn(K_e,[["render",A$e],["__scopeId","data-v-b9c1056b"]]),N$e={name:"FlatmapContextCard",components:{Loading:X3,CopyToClipboard:dl},props:{mapImpProv:Object},data:function(){return{contextData:{},showDetails:!0,showContextCard:!0,sampleDetails:{},loading:!1}},computed:{flatmapPublishedDisplay:function(){let e="Unknown";return this.mapImpProv&&(e=new Date(this.mapImpProv.created).toLocaleDateString("en-US",{day:"2-digit",month:"long",year:"numeric"})),e},sckanReleaseDisplay:function(){var t,n,o;let e="Unknown";if(this.mapImpProv){if(e=(n=(t=this.mapImpProv.connectivity)==null?void 0:t.npo)==null?void 0:n.date,!e){let a=(o=this.mapImpProv.sckan)!=null&&o.created?this.mapImpProv.sckan.created:this.mapImpProv.sckan;if(a){let i=a.replace(",",".");e=new Date(i).toLocaleDateString("en-US",{day:"2-digit",month:"long",year:"numeric"})}}e||(e="Unknown")}return e},sckanReleaseLink:function(){var t,n,o;let e="Unknown";return this.mapImpProv&&(e=(n=(t=this.mapImpProv.connectivity)==null?void 0:t.npo)==null?void 0:n.path,e||(e=(o=this.mapImpProv.sckan)==null?void 0:o.release),e||(e="Unknown")),e},flatmapSource:function(){let e="Unknown";return this.mapImpProv&&(e=this.mapImpProv.source),e},updatedCopyContent:function(){const e=[];e.push("<div><strong>Flatmap Provenance</strong></div>");let t="<div>SCKAN version:</div>";t+=`
|
|
560
|
+
<br>`)},samplesMatching:function(e){return this.contextData&&this.contextData.samples?this.contextData.samples.filter(t=>t.view==e)[0]:[]},viewClicked:function(e,t){this.openViewFile(e),this.toggleSampleDetails(t)},getContextFile:function(e){this.loading=!0,fetch(e).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.contextData=t,this.loading=!1,this.addDiscoverIdsToContextData()}).catch(t=>{console.error("caught error!",t),this.loading=!1})},removeDoubleFilesPath:function(e){if(e)return e.includes("files/")?e.replace("files/",""):e.includes("files\\")?e.replace("files\\",""):e},toggleSampleDetails:function(e){this.sampleDetails[e]===void 0?this.sampleDetails[e]=!0:this.sampleDetails[e]=!this.sampleDetails[e]},getFileFromPath:function(e){return this.entry.contextCardUrl===!0?e:(e=this.removeDoubleFilesPath(e),`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${e}${this.getS3Args()}`)},addDiscoverIdsToContextData(){this.contextData.samples.forEach((e,t)=>{e&&e.doi&&e.doi!==""?fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${this.splitDoiFromUrl(e.doi)}`).then(n=>n.json()).then(n=>{this.contextData.samples[t].discoverId=n.id,this.contextData.samples[t].version=n.version}):(this.contextData.samples[t].discoverId=this.entry.discoverId,this.contextData.samples[t].version=this.entry.version)})},processPathForUrl(e){return e=q_e(e),e=U_e(e),encodeURIComponent(e)},splitDoiFromUrl(e){return e.split("https://doi.org/").pop()},generateFileLink(e){const t=this.processPathForUrl(e.path),n=e.version||"";let o="";return e.datasetURL?o=`${e.datasetURL.replace(/datasets\/(\d+)\/version\/(\d+)/,"datasets/file/$1/$2")}?path=${t}`:e.discoverId&&(o=`${this.envVars.ROOT_URL}/datasets/file/${e.discoverId}/${n}?path=${t}`),o},parseMarkdown(e){const t=H_e(Ze.parse(e));return this.$emit("context-ready"),t},openViewFile:function(e){const t=this.getFileFromPath(e.path);this.$emit("scaffold-view-clicked",t)},fetchDOIURL:async function(e){var o;const n=`https://doi.org/api/handles/${e.includes("https://doi.org/")?this.splitDoiFromUrl(e):e}?noredirect`;try{const a=await fetch(n);if(!a.ok)throw new Error(`Response status: ${a.status}`);const s=(o=(await a.json()).values)==null?void 0:o.find(l=>l.type==="URL");if(s&&s.data&&s.data.value)return s.data.value;throw new Error("Redirect URL not found in DOI metadata")}catch(a){throw new Error(a)}},getOriginalSource:function(){const e=this.entry.discoverId,n=this.entry.resource.substring(this.entry.resource.indexOf("files/")+6,this.entry.resource.lastIndexOf("?")),o=new URLSearchParams({discoverId:e,path:n}),a=`${this.envVars.API_LOCATION}/file_info/get_original_source?${o.toString()}`;fetch(a).then(i=>{if(i.ok)return i.json();throw Error(i.statusText)}).then(i=>{this.loadingOriginalSource=!1,i.result&&(i.result.forEach(async s=>{if(s.doi){const l=await this.fetchDOIURL(s.doi);s.datasetURL=l,s.name=s.name||s.path.split("/").pop()}s.flatmapUUID?this.flatmapSource.push(s):this.originalSource.push(s)}),(this.flatmapSource.length||this.originalSource.length)&&(this.copyContent=this.updateCopyContent())),this.loadingOriginalSource=!1}).catch(i=>{console.error("caught error!",i),this.loadingOriginalSource=!1})},onCopied:function(){const{label:e,type:t,discoverId:n}=this.entry,o=t?`${e} ${t}`:e;Nt.sendEvent({event:"interaction_event",event_name:"portal_maps_context_card_copy",category:o||"",location:"map_toolbar",dataset_id:n?n+"":""})}},mounted:function(){this.copyContent=this.updateCopyContent(),this.getOriginalSource()}},Su=e=>(r.pushScopeId("data-v-f8e7ebb6"),e=e(),r.popScopeId(),e),G_e={class:"context-card-container",ref:"container"},W_e={key:0,class:"context-card"},Y_e={class:"card-left"},X_e=["src"],Z_e={class:"card-right scrollbar"},J_e={class:"title"},Q_e=["innerHTML"],e$e={class:"card-bottom"},t$e={class:"source-data-list"},n$e=["href"],r$e={key:0,class:"flatmap-entry"},o$e={class:"source-data-list"},a$e=["onClick"],i$e={key:0,class:"subtitle"},s$e=["onClick"],l$e=["src"],c$e={class:"view-description"},u$e=Su(()=>r.createElementVNode("div",{class:"padding"},null,-1)),d$e=Su(()=>r.createElementVNode("div",{style:{"margin-bottom":"16px"}},null,-1)),f$e={key:1,class:"subtitle"},p$e=["onClick"],h$e=["src"],m$e=Su(()=>r.createElementVNode("i",{class:"el-icon-warning-outline info"},null,-1)),g$e=["innerHTML"],y$e=["href"],v$e=Su(()=>r.createElementVNode("div",{class:"padding"},null,-1)),b$e={key:0,class:"subtitle"},w$e=["onClick"],x$e=["src"],C$e={class:"view-description"},k$e=Su(()=>r.createElementVNode("i",{class:"el-icon-warning-outline info"},null,-1)),S$e=["innerHTML"],E$e=["href"],_$e=Su(()=>r.createElementVNode("div",{class:"padding"},null,-1)),$$e={key:2,class:"padding"},F$e={class:"float-button-container"};function A$e(e,t,n,o,a,i){const s=Yne,l=Wne,c=r.resolveComponent("CopyToClipboard"),u=Sc;return r.openBlock(),r.createElementBlock("div",G_e,[r.withDirectives(r.createElementVNode("div",null,[e.showDetails&&Object.keys(e.contextData).length!==0?r.withDirectives((r.openBlock(),r.createElementBlock("div",W_e,[r.createElementVNode("div",Y_e,[r.createElementVNode("img",{src:i.banner,class:"context-image"},null,8,X_e)]),r.createElementVNode("div",Z_e,[r.createElementVNode("div",null,[r.createElementVNode("div",J_e,r.toDisplayString(e.contextData.heading),1),r.createElementVNode("div",{innerHTML:i.parseMarkdown(e.contextData.description)},null,8,Q_e)])]),r.createElementVNode("div",e$e,[r.withDirectives((r.openBlock(),r.createElementBlock("div",null,[e.originalSource&&e.originalSource.length?(r.openBlock(),r.createBlock(l,{key:0,modelValue:e.activeName,"onUpdate:modelValue":t[0]||(t[0]=d=>e.activeName=d)},{default:r.withCtx(()=>[r.createVNode(s,{title:"View/Hide source data links",name:"sourceDataLinks"},{default:r.withCtx(()=>[r.createElementVNode("ul",t$e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.originalSource,(d,f)=>(r.openBlock(),r.createElementBlock("li",{key:"source-"+f},[d&&d.path?(r.openBlock(),r.createElementBlock("a",{key:0,href:i.generateFileLink(d),target:"_blank"},"View "+r.toDisplayString(d.name),9,n$e)):r.createCommentVNode("",!0)]))),128))])]),_:1})]),_:1},8,["modelValue"])):r.createCommentVNode("",!0)])),[[u,e.loadingOriginalSource]]),e.flatmapSource&&e.flatmapSource.length?(r.openBlock(),r.createElementBlock("div",r$e,[r.createTextVNode(" Associated flatmaps from source: "),r.createElementVNode("ul",o$e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.flatmapSource,(d,f)=>(r.openBlock(),r.createElementBlock("li",{key:"flatmap-"+f},[r.createElementVNode("span",{onClick:p=>i.flatmapClick(d)}," For "+r.toDisplayString(d.name),9,a$e)]))),128))])])):r.createCommentVNode("",!0),r.createElementVNode("div",null,[i.samplesUnderViews?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[e.contextData.views&&e.contextData.views.length>0?(r.openBlock(),r.createElementBlock("div",b$e,"Scaffold Views")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.views,(d,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_1"},[r.createElementVNode("span",{onClick:p=>i.viewClicked(d,f),class:"context-card-view"},[r.createElementVNode("img",{class:"view-image",src:i.getFileFromPath(d.thumbnail)},null,8,x$e),r.createElementVNode("div",C$e,[r.createTextVNode(r.toDisplayString(d.description),1),k$e])],8,w$e),e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:i.samplesMatching(d.id).description},null,8,S$e)):r.createCommentVNode("",!0),e.sampleDetails[f]&&i.samplesMatching(d.id).path?(r.openBlock(),r.createElementBlock("a",{key:f+"_5",href:i.generateFileLink(i.samplesMatching(d.id)),target:"_blank"},"View Source",8,E$e)):r.createCommentVNode("",!0),_$e,e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",$$e)):r.createCommentVNode("",!0)],64))),128))],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[e.contextData.views&&e.contextData.views.length>0?(r.openBlock(),r.createElementBlock("div",i$e,"Scaffold Views")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.views,(d,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_1"},[r.createElementVNode("div",{onClick:p=>i.openViewFile(d),class:"context-card-view"},[r.createElementVNode("img",{class:"view-image",src:i.getFileFromPath(d.thumbnail)},null,8,l$e),r.createElementVNode("div",c$e,r.toDisplayString(d.description),1)],8,s$e),u$e],64))),128)),d$e,e.contextData.samples&&e.contextData.samples.length>0?(r.openBlock(),r.createElementBlock("div",f$e,"Samples on Scaffold")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.samples,(d,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_3"},[r.createElementVNode("span",{class:"context-card-item cursor-pointer",onClick:p=>i.toggleSampleDetails(f)},[(r.openBlock(),r.createElementBlock("div",{key:f+"_6",style:{display:"flex"}},[d.color?(r.openBlock(),r.createElementBlock("div",{key:0,class:"color-box",style:r.normalizeStyle("background-color:"+d.color)},null,4)):d.thumbnail?(r.openBlock(),r.createElementBlock("img",{key:1,class:"key-image",src:i.getFileFromPath(d.thumbnail)},null,8,h$e)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(d.heading)+" ",1),m$e]))],8,p$e),e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:d.description},null,8,g$e)):r.createCommentVNode("",!0),e.sampleDetails[f]&&d.path?(r.openBlock(),r.createElementBlock("a",{key:1,href:i.generateFileLink(d),target:"_blank"},"View Source",8,y$e)):r.createCommentVNode("",!0),v$e],64))),128))],64))])])])),[[u,e.loading]]):r.createCommentVNode("",!0),r.createElementVNode("div",F$e,[r.createVNode(c,{content:e.copyContent,onCopied:i.onCopied,theme:"light"},null,8,["content","onCopied"])])],512),[[r.vShow,e.showContextCard]])],512)}const WP=Hn(K_e,[["render",A$e],["__scopeId","data-v-f8e7ebb6"]]),N$e={name:"FlatmapContextCard",components:{Loading:X3,CopyToClipboard:dl},props:{mapImpProv:Object},data:function(){return{contextData:{},showDetails:!0,showContextCard:!0,sampleDetails:{},loading:!1}},computed:{flatmapPublishedDisplay:function(){let e="Unknown";return this.mapImpProv&&(e=new Date(this.mapImpProv.created).toLocaleDateString("en-US",{day:"2-digit",month:"long",year:"numeric"})),e},sckanReleaseDisplay:function(){var t,n,o;let e="Unknown";if(this.mapImpProv){if(e=(n=(t=this.mapImpProv.connectivity)==null?void 0:t.npo)==null?void 0:n.date,!e){let a=(o=this.mapImpProv.sckan)!=null&&o.created?this.mapImpProv.sckan.created:this.mapImpProv.sckan;if(a){let i=a.replace(",",".");e=new Date(i).toLocaleDateString("en-US",{day:"2-digit",month:"long",year:"numeric"})}}e||(e="Unknown")}return e},sckanReleaseLink:function(){var t,n,o;let e="Unknown";return this.mapImpProv&&(e=(n=(t=this.mapImpProv.connectivity)==null?void 0:t.npo)==null?void 0:n.path,e||(e=(o=this.mapImpProv.sckan)==null?void 0:o.release),e||(e="Unknown")),e},flatmapSource:function(){let e="Unknown";return this.mapImpProv&&(e=this.mapImpProv.source),e},updatedCopyContent:function(){const e=[];e.push("<div><strong>Flatmap Provenance</strong></div>");let t="<div>SCKAN version:</div>";t+=`
|
|
561
561
|
`,t+=`<div><a href="${this.sckanReleaseLink}">${this.sckanReleaseLink}</a></div>`,e.push(t);let n="<div>Published on:</div>";n+=`
|
|
562
562
|
`,n+=`<div>${this.flatmapPublishedDisplay}</div>`,e.push(n);let o="<div>View publication:</div>";return o+=`
|
|
563
563
|
`,o+=`<div><a href="${this.flatmapSource}">${this.flatmapSource}</a></div>`,e.push(o),e.join(`
|