@abi-software/mapintegratedvuer 1.13.0 → 1.13.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/{ContentMixin-DE9Pk_KF.js → ContentMixin-Cf4ti-Vc.js} +116 -102
- package/dist/{Flatmap-BdSINIH3.js → Flatmap-DRaM5H0L.js} +11 -10
- package/dist/{Iframe-DL3E0cnI.js → Iframe-DMyBLdD3.js} +2 -2
- package/dist/{MultiFlatmap-DKPBFc_Y.js → MultiFlatmap-CgvcY__u.js} +30 -27
- package/dist/{Plot-_ca3lFZI.js → Plot-BDAChTio.js} +2 -2
- package/dist/{Scaffold-DxH7TMFn.js → Scaffold-CXo37tTA.js} +2 -2
- package/dist/{Simulation-ewRVK6sW.js → Simulation-B4f-ubkl.js} +2 -2
- package/dist/{index-BHZwLSRu.js → index-CDhuA6QJ.js} +31 -8
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +4 -4
- package/dist/{style-IHXUSXDX.js → style-BeNQcAFm.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/ContentVuer.vue +3 -0
- package/src/components/ContextCard.vue +3 -0
- package/src/components/SplitDialog.vue +27 -0
- package/src/components/SplitFlow.vue +8 -0
- package/src/components/viewers/Flatmap.vue +2 -1
- package/src/components/viewers/MultiFlatmap.vue +4 -1
- package/src/mixins/ContentMixin.js +20 -0
- package/src/stores/settings.js +4 -0
|
@@ -486,7 +486,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
|
486
486
|
`)}</ul>`,a="<div><strong>References</strong></div>";this.referecesListContent=a+`
|
|
487
487
|
`+o}this.$emit("references-loaded",{style:t,list:n})},replaceLinkInText:function(e){const t="https://";let n=e.split(t)[1];if(n){n=n.split(" ")[0],n=n.trim(),n.endsWith(".")&&(n=n.substring(0,n.length-1));const o=t+n,a=`<a href="${o}" target="_blank">${o}</a>`;return e.replace(o,a)}return e},searchPMID:async function(e){const t=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${e}&format=json`;return await this.fetchData(t)},getCitationTextByDOI:async function(e){const t=`${this.crosscite_host}/format?doi=${e}&style=${this.citationType}&lang=en-US`;return await this.fetchData(t,"text")},getDOIFromPubMedID:async function(e){const t=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${e}&format=json`;return await this.fetchData(t)},formatOpenLibReferences:function(){this.openLibReferences.forEach(e=>{const{bookId:t}=e;this.getBookData(t).then(n=>{const{title:o,authors:a,publish_date:i}=n;o&&(e.title=o),i&&(e.date=i),a&&(e.authors=[],a.forEach(s=>{this.getBookAuthor(s.key).then(l=>{const{name:c}=l;c&&(e.authors.push(c),this.updateCopyContents())})})),this.updateCopyContents()})})},getBookData:async function(e){const t=`https://openlibrary.org/books/${e}.json`;return await this.fetchData(t)},getBookAuthor:async function(e){const t=`https://openlibrary.org${e}.json`;return await this.fetchData(t)},formatCopyReference:function(e){const t=[],{title:n,date:o,authors:a,url:i}=e;return n&&t.push(n),o&&t.push(`(${o})`),a&&t.push(`- ${a.join(", ")}`),t.push(`<div><a href="${i}" target="_blank">${i}</a></div>`),t.join(" ")},fetchData:async function(e,t){try{const n=await fetch(e);if(!n.ok)throw new Error(`Response status: ${n.status}`);return t==="text"?await n.text():await n.json()}catch(n){throw new Error(n)}},onCopied:function(e,t){let n="Reference List",o="",a=this.citationType;t?(n=t.resource,o=t.type==="doi"?t.id:""):n=[...this.pubMedReferences,...this.openLibReferences,...this.isbnDBReferences].map(s=>s.type==="doi"?s.id:s.resource).join(", ");const i={event:"interaction_event",event_name:"portal_maps_copy_citation",category:n,doi:o,citation_type:a,location:"map_connectivity_references"};this.$emit("trackEvent",i)}}},Bl=e=>(r.pushScopeId("data-v-e4259096"),e=e(),r.popScopeId(),e),BSe={class:"resource-container"},NSe={class:"attribute-title-container"},MSe=Bl(()=>r.createElementVNode("div",{class:"attribute-title"},"References",-1)),OSe={class:"copy-button"},LSe={key:0,class:"citation-tabs"},ISe={class:"citation-list"},RSe=Bl(()=>r.createElementVNode("span",null,"Internal Server Error",-1)),PSe=Bl(()=>r.createElementVNode("br",null,null,-1)),VSe=Bl(()=>r.createElementVNode("br",null,null,-1)),DSe=["href"],zSe=Bl(()=>r.createElementVNode("br",null,null,-1)),jSe=Bl(()=>r.createElementVNode("span",null,"Sorry, something went wrong.",-1)),HSe=Bl(()=>r.createElementVNode("br",null,null,-1)),USe=["onClick"],qSe=["innerHTML"],KSe=["innerHTML"],GSe=["href"];function WSe(e,t,n,o,a,i){const s=dl,l=yo,c=QP;return r.openBlock(),r.createElementBlock("div",BSe,[r.createElementVNode("div",NSe,[MSe,r.createElementVNode("div",OSe,[r.createVNode(s,{onCopied:t[0]||(t[0]=d=>i.onCopied(d,"")),label:"Copy list to clipboard",content:e.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(r.openBlock(),r.createElementBlock("div",LSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.citationOptions,d=>(r.openBlock(),r.createBlock(l,{link:"",key:d.value,type:e.citationType===d.value?"primary":"",onClick:u=>i.onCitationFormatChange(d.value)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(d.label),1)]),_:2},1032,["type","onClick"]))),128))])):r.createCommentVNode("",!0),r.createElementVNode("ul",ISe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.pubMedReferences,d=>{var u,f,p,m;return r.openBlock(),r.createElementBlock("li",{key:d.id,class:r.normalizeClass({loading:i.isCitationLoading(d.citation),error:i.isCitationError(d.citation)})},[d.citation?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[((u=d.citation.error)==null?void 0:u.ref)==="doi"&&((f=d.citation.error)==null?void 0:f.type)===e.citationType?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[RSe,PSe,r.createTextVNode(" Sorry, something went wrong."),VSe,r.createTextVNode(" The dataset citation generator ("),r.createElementVNode("a",{href:e.crosscite_host,target:"_blank"},r.toDisplayString(e.crosscite_host),9,DSe),r.createTextVNode(") encountered an internal error and was unable to complete your request."),zSe,r.createTextVNode(" Please come back later. ")],64)):((p=d.citation.error)==null?void 0:p.ref)==="pubmed"&&((m=d.citation.error)==null?void 0:m.type)===e.citationType?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[jSe,HSe,r.createTextVNode(" Please try again. "),r.createElementVNode("span",{class:"reload-button",onClick:h=>i.reloadCitation(d)},"Reload",8,USe)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createElementVNode("span",{innerHTML:d.citation[e.citationType]},null,8,qSe),r.createVNode(c,{resource:d.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),r.createVNode(s,{onCopied:h=>i.onCopied(h,d),content:d.citation[e.citationType]},null,8,["onCopied","content"])],64))],64)):r.createCommentVNode("",!0)],2)}),128)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.openLibReferences,d=>(r.openBlock(),r.createElementBlock("li",{key:d.id},[r.createElementVNode("div",{innerHTML:i.formatCopyReference(d)},null,8,KSe),r.createVNode(c,{resource:d.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),r.createVNode(s,{onCopied:u=>i.onCopied(u,d),content:i.formatCopyReference(d)},null,8,["onCopied","content"])]))),128)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.isbnDBReferences,d=>(r.openBlock(),r.createElementBlock("li",{key:d.id},[r.createElementVNode("a",{href:d.url,target:"_blank"},r.toDisplayString(d.url),9,GSe),r.createVNode(c,{resource:d.resource,onShowRelatedConnectivities:i.showRelatedConnectivities},null,8,["resource","onShowRelatedConnectivities"]),r.createVNode(s,{onCopied:u=>i.onCopied(u,d),content:d.url},null,8,["onCopied","content"])]))),128))])])}const XSe=os(TSe,[["render",WSe],["__scopeId","data-v-e4259096"]]);async function YSe(e,t){try{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`API Error: ${n.status} ${n.statusText}`);return await n.json()}catch(n){throw console.error("Request failed:",n),n}}async function Eg(e){const{flatmapAPI:t,knowledgeSource:n,queryId:o,parameters:a,orderId:i}=e,s=`${t}competency/query`,l=Array.isArray(a)?[...a]:[];l.push({column:"source_id",value:n});let c;if(typeof o=="number")c=o.toString();else if(typeof o=="string")c=o;else throw new TypeError("queryId must be a string or a number convertible to string.");const d={query_id:c,parameters:l};return i&&(d.order=[i]),YSe(s,d)}async function e9(e,t,n){var o,a;const i=Array.isArray(n)?n:[n],s=i[0].startsWith("ilxtr:"),l=s?23:1,c=s?"path_id":"feature_id",d=s?i:[],u=await Eg({flatmapAPI:e,knowledgeSource:t,queryId:l,parameters:[{column:c,value:i}]}),f=((a=(o=u==null?void 0:u.results)==null?void 0:o.values)==null?void 0:a.map(h=>h[1]))||[],p=[...new Set([...d,...f])];let m=[];return p.length&&(m=await t9(e,t,p)),[...new Set([...p,...m])]}function CS(e){const t=[];for(const n of e){const o=JSON.parse(n);Array.isArray(o)&&o.length>=2&&Array.isArray(o[1])&&o[1].length===0&&t.push(o[0])}return t}async function t9(e,t,n){var o;const a=await Eg({flatmapAPI:e,knowledgeSource:t,queryId:26,parameters:[{column:"path_id",value:n}]});if((o=a==null?void 0:a.results)!=null&&o.values){const i=a.results.values.map(s=>s[2]);return[...new Set(i)]}return[]}async function JSe({flatmapAPI:e,knowledgeSource:t,origins:n,destinations:o,vias:a}){var i,s,l,c;const d=CS(n),u=CS(o),f=CS(a),p=[{column:"source_feature_id",value:d},{column:"via_feature_id",value:f},{column:"dest_feature_id",value:u}],m=[{column:"source_node_id",value:n},{column:"via_node_id",value:a},{column:"dest_node_id",value:o}],h=p.some(C=>Array.isArray(C.value)&&C.value.length>0),g=[Eg({flatmapAPI:e,knowledgeSource:t,queryId:24,parameters:m})];h&&g.push(Eg({flatmapAPI:e,knowledgeSource:t,queryId:25,parameters:p}));const v=await Promise.all(g);let y=[],b;if(h){const C=v[0];b=v[1],y=((s=(i=C==null?void 0:C.results)==null?void 0:i.values)==null?void 0:s.map(S=>S[1]))||[]}else b=v[0];const x=((c=(l=b==null?void 0:b.results)==null?void 0:l.values)==null?void 0:c.map(C=>C[1]))||[],w=[...new Set([...y,...x])];let k=[];return w.length&&(k=await t9(e,t,w)),[...new Set([...w,...k])]}const SS=[];async function ZSe(e,t){const n=t.filter(i=>SS.some(s=>s.taxon===i)),o=SS.filter(i=>n.includes(i.taxon)),a=t.filter(i=>!n.includes(i));if(a.length){const i=await e.queryLabels(a);if(i.length)return i.forEach(s=>{let{entity:l,label:c}=s;c==="Mammalia"&&(c="Mammalia not otherwise specified");const d={taxon:l,label:c};o.push(d),SS.push(d)}),o}else return o}async function QSe(e,t,n){const o=`${e}knowledge/query/`,a={sql:t,params:n};try{const i=await fetch(o,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Content-Type":"application/json"},body:JSON.stringify(a)});if(!i.ok)throw new Error(`Cannot access ${o}`);return await i.json()}catch{return{values:[]}}}async function eEe(e,t){return t.length?await(await QSe(e,`select entity, knowledge from knowledge
|
|
488
488
|
where entity in (?${", ?".repeat(t.length-1)})
|
|
489
|
-
order by source desc`,[...t])).values:[]}function ES(e){if(!Array.isArray(e.connectivity))return[];const t=new Set;return e.connectivity.forEach(n=>{Array.isArray(n)&&n.length&&n.forEach(o=>{if(Array.isArray(o)&&typeof o[0]=="string"){const a=JSON.stringify(o);t.add(a)}})}),Array.from(t)}function Bf(e,t){var n;const o=(n=e["node-phenotypes"])==null?void 0:n[t];return Array.isArray(o)?o:[]}async function _S(e,t,n){const o=Array.from(new Map(n.map(c=>[JSON.stringify(c),c])).values()),a=o.flat(1/0),i=[...new Set(a)],s=(await eEe(e,i)).reduce((c,d)=>{const u=d[0],f=JSON.parse(d[1]);return c.push({id:u,label:f.label,source:f.source}),c},[]);s.sort((c,d)=>c.id===d.id?c.source===t&&d.source!==t?-1:c.source!==t&&d.source===t?1:0:c.id.localeCompare(d.id));const l=[];return[...o.map(c=>{const d=c.flat(),u=[];for(let f=0;f<d.length;f++){const p=s.find(m=>m.id===d[f]);p&&(u.push(p.label),f>0&&l.push({key:[d[f],[]],label:p.label}))}return{key:c,label:u.join(", ")}}),...l].filter((c,d,u)=>d===u.findIndex(f=>f.label===c.label))}async function tEe(e,t,n){const o=[];return n.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(ES(a));Bf(a,"ilxtr:hasSomaLocatedIn").forEach(s=>{const l=JSON.stringify(s);i.has(l)&&o.push(s)})}),await _S(e,t,o)}async function nEe(e,t,n){const o=[];return n.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(ES(a));[...Bf(a,"ilxtr:hasAxonPresynapticElementIn"),...Bf(a,"ilxtr:hasAxonSensorySubcellularElementIn")].forEach(s=>{const l=JSON.stringify(s);i.has(l)&&o.push(s)})}),await _S(e,t,o)}async function rEe(e,t,n){const o=[];return n.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(ES(a));[...Bf(a,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Bf(a,"ilxtr:hasAxonLocatedIn")].forEach(s=>{const l=JSON.stringify(s);i.has(l)&&o.push(s)})}),await _S(e,t,o)}async function oEe(e,t,n,o){let a=[];const i=[];if(t){if(t&&typeof t.featureFilterRanges=="function"){const m=t.featureFilterRanges();for(const[h,g]of Object.entries(m)){let v={key:`flatmap.connectivity.${h}`,label:"",children:[]},y=[];if(h==="kind"){v.label="Pathways";for(const b of g){const x=o.find(w=>w.type===b);x&&y.push({key:`${v.key}.${b}`,label:x.label,colour:x.colour,colourStyle:"line",dashed:x.dashed})}}else if(h==="taxons"){v.label="Studied in";const b=await ZSe(t,t.taxonIdentifiers);if(b.length)for(const x of g){const w=b.find(k=>k.taxon===x);w&&y.push({key:`${v.key}.${x}`,label:`${w.label} `})}}else if(h==="alert"){v.label="Alert";for(const b of["with","without"])y.push({key:`${v.key}.${b}`,label:`${b} alerts`})}v.children=y.sort((b,x)=>b.label.localeCompare(x.label)),v.label&&v.children.length&&a.push(v)}}const s=t.pathways.paths,l=[];for(const m of n){const h=m.id;if(h){const g=s[h];if(g&&g.connectivity&&g["node-phenotypes"]){const v=g.connectivity,y=g["node-phenotypes"];m.connectivity=[...v];for(let b in m["node-phenotypes"])y[b]&&(m["node-phenotypes"][b]=[...y[b]]);l.push(JSON.parse(JSON.stringify(m)))}}}const c=t.knowledgeSource,d=await tEe(e,c,l),u=await rEe(e,c,l),f=await nEe(e,c,l),p=(m,h)=>{const g=JSON.stringify(h.key);return{key:`flatmap.connectivity.source.${m}.${g}`,label:h.label||g}};for(const m of["origin","via","destination","all"]){let h=[];if(m==="origin")h=d.map(g=>p(m,g));else if(m==="via")h=u.map(g=>p(m,g));else if(m==="destination")h=f.map(g=>p(m,g));else{const g=[...d.map(y=>p(m,y)),...u.map(y=>p(m,y)),...f.map(y=>p(m,y))],v=new Set;h=g.filter(y=>v.has(y.key)?!1:(v.add(y.key),!0))}h=h.sort((g,v)=>{const y=w=>/^[a-zA-Z]/.test(w),b=y(g.label),x=y(v.label);return b&&!x?-1:!b&&x?1:g.label.localeCompare(v.label)}),h.length&&i.push({key:`flatmap.connectivity.source.${m}`,label:m,children:h})}i.length&&a.push(...i)}return a}function aEe(e){return{all:e=e||new Map,on:function(t,n){var o=e.get(t);o?o.push(n):e.set(t,[n])},off:function(t,n){var o=e.get(t);o&&(n?o.splice(o.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var o=e.get(t);o&&o.slice().map(function(a){a(n)}),(o=e.get("*"))&&o.slice().map(function(a){a(t,n)})}}}const $e=new aEe,Tt={sendEvent:function(e){const t={event:e.event||"",event_name:e.event_name||"",files:e.files||"",file_name:e.file_name||"",file_path:e.file_path||"",file_type:e.file_type||"",category:e.category||"",dataset_id:e.dataset_id||"",version_id:e.version_id||"",doi:e.doi||"",citation_type:e.citation_type||"",location:e.location||""};localStorage.getItem("debugTagging")==="yes"&&console.table(t),$e.emit("trackEvent",t)}},iEe={name:"S3Bucket",data(){return{s3Bucket:void 0,s3Prefix:""}},methods:{updateS3Bucket:function(e){if(this.s3Bucket=void 0,e){const t=e.split("//")[1];if(t){this.s3Bucket=t.split("/")[0];const n=t.indexOf("/");this.s3Prefix=t.substring(n+1);return}}},getS3Args:function(){return this.s3Bucket?`?s3BucketName=${this.s3Bucket}`:""},getS3Prefix:function(){return this.s3Prefix}}},vi=Mt.defineStore("settings",{state:()=>({shareLink:void 0,sparcApi:void 0,algoliaIndex:"k-core_dev_published_time_desc",algoliaKey:void 0,algoliaId:void 0,pennsieveApi:void 0,flatmapAPI:void 0,nlLinkPrefix:void 0,mapManager:void 0,rootUrl:void 0,facets:{species:[],gender:[],organ:[]},appliedFacets:[],numberOfDatasetsForFacets:[],markers:[],hoverAnatomies:[],hoverOrgans:[],hoverDOI:"",hoverConnectivity:[],featuredMarkers:[],featuredMarkerIdentifiers:[],featuredMarkerDois:[],featuredMarkerSpecies:[],featuredDatasetIdentifiers:[],helpDelay:0,useHelpModeDialog:!1,connectivityInfoSidebar:!0,annotationSidebar:!0,allClosable:!0,offlineAnnotationEnabled:!1,globalSettings:{displayMarkers:!0,interactiveMode:"dataset",viewingMode:"Exploration",flightPathDisplay:!1,organsDisplay:!0,outlinesDisplay:!0,backgroundDisplay:"white",connectionType:"All"}}),getters:{isFeaturedMarkerIdentifier:e=>t=>e.featuredMarkerIdentifiers.flat(1/0).includes(t),featuredMarkerDoi:e=>t=>{const n=e.featuredMarkerIdentifiers.findIndex(o=>o==t);return e.featuredMarkerDois[n]},getGlobalSettings:e=>()=>{const t={};for(const[n,o]of Object.entries(e.globalSettings))t[n]=o;return t},getUpdatedGlobalSettingsKey:e=>t=>{let n=[];for(const[o,a]of Object.entries(t)){const i=e.globalSettings[o];(i===void 0||i!==a)&&n.push(o)}return n},hasAppliedFacets:e=>t=>{for(const n of t)for(const o of e.appliedFacets)if(n&&o&&n.toLowerCase()===o.toLowerCase())return!0;return!1}},actions:{updateShareLink(e){this.shareLink=e},updateSparcAPI(e){this.sparcApi=e},updateAlgoliaIndex(e){this.algoliaIndex=e},updateAlgoliaKey(e){this.algoliaKey=e},updateAlgoliaId(e){this.algoliaId=e},updatePennsieveApi(e){this.pennsieveApi=e},updateFlatmapAPI(e){this.flatmapAPI=e},updateMapManager(e){this.mapManager=e},updateNLLinkPrefix(e){this.nlLinkPrefix=e},updateRootUrl(e){this.rootUrl=e},updateMarkers(e){this.markers=e},updateHoverFeatures(e,t,n,o){this.hoverAnatomies=e,this.hoverOrgans=t,this.hoverDOI=n,this.hoverConnectivity=o},updateFeatured(e){this.featuredMarkerIdentifiers=new Array(e.length),this.featuredMarkers=new Array(e.length),this.featuredMarkerDois=new Array(e.length),this.featuredMarkerSpecies=new Array(e.length),this.featuredDatasetIdentifiers=e},updateFeaturedMarker(e){const t=this.featuredDatasetIdentifiers.findIndex(n=>n==e.identifier);this.featuredMarkers[t]=e.marker,this.featuredMarkerDois[t]=e.doi,this.featuredMarkerSpecies[t]=e.species},updateFeaturedMarkerIdentifier(e){this.featuredMarkerIdentifiers[e.index]=e.markerIdentifier},resetFeaturedMarkerIdentifier(){this.featuredMarkerIdentifiers=new Array(this.featuredDatasetIdentifiers.length)},updateAppliedFacets(e){this.appliedFacets=e},updateFacets(e){let t={species:[],gender:[],organ:[]};if(e){e.forEach(n=>{switch(n.term.toLowerCase()){case"species":n.facet.toLowerCase()!=="show all"?(t.species.push(n.facet),this.facets.species.includes(n.facet)||this.facets.species.push(n.facet)):this.facets.species=[];break;case"gender":n.facet.toLowerCase()!=="show all"&&(t.gender.push(n.facet),this.facets.species.includes(n.facet)||this.facets.gender.push(n.facet));break;case"organ":n.facet.toLowerCase()!=="show all"&&(t.organ.push(n.facet),this.facets.species.includes(n.facet)||this.facets.organ.push(n.facet));break}});for(const[n,o]of Object.entries(this.facets)){let a=0;for(a=o.length-1;a>=0;a-=1)t[n].indexOf(o[a])==-1&&o.splice(a,1)}}},updateNumberOfDatasetsForFacets(e){this.numberOfDatasetsForFacets=e},updateUseHelpModeDialog(e){this.useHelpModeDialog=e},updateConnectivityInfoSidebar(e){this.connectivityInfoSidebar=e},updateAnnotationSidebar(e){this.annotationSidebar=e},updateAllClosable(e){this.allClosable=e},updateOfflineAnnotationEnabled(e){this.offlineAnnotationEnabled=e},updateGlobalSettings(e){for(const[t,n]of Object.entries(e))this.globalSettings[t]=n;localStorage.setItem("mapviewer.globalSettings",JSON.stringify(this.globalSettings))}}});function n9(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Nl=n9();function sEe(e){Nl=e}const r9=/[&<>"']/,lEe=new RegExp(r9.source,"g"),o9=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cEe=new RegExp(o9.source,"g"),dEe={"&":"&","<":"<",">":">",'"':""","'":"'"},a9=e=>dEe[e];function ur(e,t){if(t){if(r9.test(e))return e.replace(lEe,a9)}else if(o9.test(e))return e.replace(cEe,a9);return e}const uEe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i9(e){return e.replace(uEe,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const fEe=/(^|[^\[])\^/g;function Lt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(o,a)=>(a=a.source||a,a=a.replace(fEe,"$1"),e=e.replace(o,a),n),getRegex:()=>new RegExp(e,t)};return n}const pEe=/[^\w:]/g,hEe=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function s9(e,t,n){if(e){let o;try{o=decodeURIComponent(i9(n)).replace(pEe,"").toLowerCase()}catch{return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}t&&!hEe.test(n)&&(n=vEe(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const _g={},mEe=/^[^:]+:\/*[^/]*$/,gEe=/^([^:]+:)[\s\S]*$/,yEe=/^([^:]+:\/*[^/]*)[\s\S]*$/;function vEe(e,t){_g[" "+e]||(mEe.test(e)?_g[" "+e]=e+"/":_g[" "+e]=Fg(e,"/",!0)),e=_g[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(gEe,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(yEe,"$1")+t:e+t}const $g={exec:function(){}};function l9(e,t){const n=e.replace(/\|/g,(i,s,l)=>{let c=!1,d=s;for(;--d>=0&&l[d]==="\\";)c=!c;return c?"|":" |"}),o=n.split(/ \|/);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),o.length>t)o.splice(t);else for(;o.length<t;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(/\\\|/g,"|");return o}function Fg(e,t,n){const o=e.length;if(o===0)return"";let a=0;for(;a<o;){const i=e.charAt(o-a-1);if(i===t&&!n)a++;else if(i!==t&&n)a++;else break}return e.slice(0,o-a)}function bEe(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let o=0,a=0;for(;a<n;a++)if(e[a]==="\\")a++;else if(e[a]===t[0])o++;else if(e[a]===t[1]&&(o--,o<0))return a;return-1}function wEe(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function c9(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function d9(e,t,n,o){const a=t.href,i=t.title?ur(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){o.state.inLink=!0;const l={type:"link",raw:n,href:a,title:i,text:s,tokens:o.inlineTokens(s)};return o.state.inLink=!1,l}return{type:"image",raw:n,href:a,title:i,text:ur(s)}}function xEe(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const o=n[1];return t.split(`
|
|
489
|
+
order by source desc`,[...t])).values:[]}function ES(e){if(!Array.isArray(e.connectivity))return[];const t=new Set;return e.connectivity.forEach(n=>{Array.isArray(n)&&n.length&&n.forEach(o=>{if(Array.isArray(o)&&typeof o[0]=="string"){const a=JSON.stringify(o);t.add(a)}})}),Array.from(t)}function Bf(e,t){var n;const o=(n=e["node-phenotypes"])==null?void 0:n[t];return Array.isArray(o)?o:[]}async function _S(e,t,n){const o=Array.from(new Map(n.map(c=>[JSON.stringify(c),c])).values()),a=o.flat(1/0),i=[...new Set(a)],s=(await eEe(e,i)).reduce((c,d)=>{const u=d[0],f=JSON.parse(d[1]);return c.push({id:u,label:f.label,source:f.source}),c},[]);s.sort((c,d)=>c.id===d.id?c.source===t&&d.source!==t?-1:c.source!==t&&d.source===t?1:0:c.id.localeCompare(d.id));const l=[];return[...o.map(c=>{const d=c.flat(),u=[];for(let f=0;f<d.length;f++){const p=s.find(m=>m.id===d[f]);p&&(u.push(p.label),f>0&&l.push({key:[d[f],[]],label:p.label}))}return{key:c,label:u.join(", ")}}),...l].filter((c,d,u)=>d===u.findIndex(f=>f.label===c.label))}async function tEe(e,t,n){const o=[];return n.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(ES(a));Bf(a,"ilxtr:hasSomaLocatedIn").forEach(s=>{const l=JSON.stringify(s);i.has(l)&&o.push(s)})}),await _S(e,t,o)}async function nEe(e,t,n){const o=[];return n.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(ES(a));[...Bf(a,"ilxtr:hasAxonPresynapticElementIn"),...Bf(a,"ilxtr:hasAxonSensorySubcellularElementIn")].forEach(s=>{const l=JSON.stringify(s);i.has(l)&&o.push(s)})}),await _S(e,t,o)}async function rEe(e,t,n){const o=[];return n.forEach(a=>{if(!Array.isArray(a.connectivity)||a.connectivity.length===0)return;const i=new Set(ES(a));[...Bf(a,"ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),...Bf(a,"ilxtr:hasAxonLocatedIn")].forEach(s=>{const l=JSON.stringify(s);i.has(l)&&o.push(s)})}),await _S(e,t,o)}async function oEe(e,t,n,o){let a=[];const i=[];if(t){if(t&&typeof t.featureFilterRanges=="function"){const m=t.featureFilterRanges();for(const[h,g]of Object.entries(m)){let v={key:`flatmap.connectivity.${h}`,label:"",children:[]},y=[];if(h==="kind"){v.label="Pathways";for(const b of g){const x=o.find(w=>w.type===b);x&&y.push({key:`${v.key}.${b}`,label:x.label,colour:x.colour,colourStyle:"line",dashed:x.dashed})}}else if(h==="taxons"){v.label="Studied in";const b=await ZSe(t,t.taxonIdentifiers);if(b.length)for(const x of g){const w=b.find(k=>k.taxon===x);w&&y.push({key:`${v.key}.${x}`,label:`${w.label} `})}}else if(h==="alert"){v.label="Alert";for(const b of["with","without"])y.push({key:`${v.key}.${b}`,label:`${b} alerts`})}v.children=y.sort((b,x)=>b.label.localeCompare(x.label)),v.label&&v.children.length&&a.push(v)}}const s=t.pathways.paths,l=[];for(const m of n){const h=m.id;if(h){const g=s[h];if(g&&g.connectivity&&g["node-phenotypes"]){const v=g.connectivity,y=g["node-phenotypes"];m.connectivity=[...v];for(let b in m["node-phenotypes"])y[b]&&(m["node-phenotypes"][b]=[...y[b]]);l.push(JSON.parse(JSON.stringify(m)))}}}const c=t.knowledgeSource,d=await tEe(e,c,l),u=await rEe(e,c,l),f=await nEe(e,c,l),p=(m,h)=>{const g=JSON.stringify(h.key);return{key:`flatmap.connectivity.source.${m}.${g}`,label:h.label||g}};for(const m of["origin","via","destination","all"]){let h=[];if(m==="origin")h=d.map(g=>p(m,g));else if(m==="via")h=u.map(g=>p(m,g));else if(m==="destination")h=f.map(g=>p(m,g));else{const g=[...d.map(y=>p(m,y)),...u.map(y=>p(m,y)),...f.map(y=>p(m,y))],v=new Set;h=g.filter(y=>v.has(y.key)?!1:(v.add(y.key),!0))}h=h.sort((g,v)=>{const y=w=>/^[a-zA-Z]/.test(w),b=y(g.label),x=y(v.label);return b&&!x?-1:!b&&x?1:g.label.localeCompare(v.label)}),h.length&&i.push({key:`flatmap.connectivity.source.${m}`,label:m,children:h})}i.length&&a.push(...i)}return a}function aEe(e){return{all:e=e||new Map,on:function(t,n){var o=e.get(t);o?o.push(n):e.set(t,[n])},off:function(t,n){var o=e.get(t);o&&(n?o.splice(o.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var o=e.get(t);o&&o.slice().map(function(a){a(n)}),(o=e.get("*"))&&o.slice().map(function(a){a(t,n)})}}}const $e=new aEe,Tt={sendEvent:function(e){const t={event:e.event||"",event_name:e.event_name||"",files:e.files||"",file_name:e.file_name||"",file_path:e.file_path||"",file_type:e.file_type||"",category:e.category||"",dataset_id:e.dataset_id||"",version_id:e.version_id||"",doi:e.doi||"",citation_type:e.citation_type||"",location:e.location||""};localStorage.getItem("debugTagging")==="yes"&&console.table(t),$e.emit("trackEvent",t)}},iEe={name:"S3Bucket",data(){return{s3Bucket:void 0,s3Prefix:""}},methods:{updateS3Bucket:function(e){if(this.s3Bucket=void 0,e){const t=e.split("//")[1];if(t){this.s3Bucket=t.split("/")[0];const n=t.indexOf("/");this.s3Prefix=t.substring(n+1);return}}},getS3Args:function(){return this.s3Bucket?`?s3BucketName=${this.s3Bucket}`:""},getS3Prefix:function(){return this.s3Prefix}}},vi=Mt.defineStore("settings",{state:()=>({shareLink:void 0,sparcApi:void 0,algoliaIndex:"k-core_dev_published_time_desc",algoliaKey:void 0,algoliaId:void 0,pennsieveApi:void 0,flatmapAPI:void 0,nlLinkPrefix:void 0,mapManager:void 0,rootUrl:void 0,facets:{species:[],gender:[],organ:[]},appliedFacets:[],numberOfDatasetsForFacets:[],markers:[],hoverAnatomies:[],hoverOrgans:[],hoverDOI:"",hoverConnectivity:[],featuredMarkers:[],featuredMarkerIdentifiers:[],featuredMarkerDois:[],featuredMarkerSpecies:[],featuredDatasetIdentifiers:[],helpDelay:0,useHelpModeDialog:!1,connectivityInfoSidebar:!0,annotationSidebar:!0,allClosable:!0,offlineAnnotationEnabled:!1,displayMinimap:!0,globalSettings:{displayMarkers:!0,interactiveMode:"dataset",viewingMode:"Exploration",flightPathDisplay:!1,organsDisplay:!0,outlinesDisplay:!0,backgroundDisplay:"white",connectionType:"All"}}),getters:{isFeaturedMarkerIdentifier:e=>t=>e.featuredMarkerIdentifiers.flat(1/0).includes(t),featuredMarkerDoi:e=>t=>{const n=e.featuredMarkerIdentifiers.findIndex(o=>o==t);return e.featuredMarkerDois[n]},getGlobalSettings:e=>()=>{const t={};for(const[n,o]of Object.entries(e.globalSettings))t[n]=o;return t},getUpdatedGlobalSettingsKey:e=>t=>{let n=[];for(const[o,a]of Object.entries(t)){const i=e.globalSettings[o];(i===void 0||i!==a)&&n.push(o)}return n},hasAppliedFacets:e=>t=>{for(const n of t)for(const o of e.appliedFacets)if(n&&o&&n.toLowerCase()===o.toLowerCase())return!0;return!1}},actions:{updateShareLink(e){this.shareLink=e},updateSparcAPI(e){this.sparcApi=e},updateAlgoliaIndex(e){this.algoliaIndex=e},updateAlgoliaKey(e){this.algoliaKey=e},updateAlgoliaId(e){this.algoliaId=e},updatePennsieveApi(e){this.pennsieveApi=e},updateFlatmapAPI(e){this.flatmapAPI=e},updateMapManager(e){this.mapManager=e},updateNLLinkPrefix(e){this.nlLinkPrefix=e},updateRootUrl(e){this.rootUrl=e},updateMarkers(e){this.markers=e},updateHoverFeatures(e,t,n,o){this.hoverAnatomies=e,this.hoverOrgans=t,this.hoverDOI=n,this.hoverConnectivity=o},updateFeatured(e){this.featuredMarkerIdentifiers=new Array(e.length),this.featuredMarkers=new Array(e.length),this.featuredMarkerDois=new Array(e.length),this.featuredMarkerSpecies=new Array(e.length),this.featuredDatasetIdentifiers=e},updateFeaturedMarker(e){const t=this.featuredDatasetIdentifiers.findIndex(n=>n==e.identifier);this.featuredMarkers[t]=e.marker,this.featuredMarkerDois[t]=e.doi,this.featuredMarkerSpecies[t]=e.species},updateFeaturedMarkerIdentifier(e){this.featuredMarkerIdentifiers[e.index]=e.markerIdentifier},resetFeaturedMarkerIdentifier(){this.featuredMarkerIdentifiers=new Array(this.featuredDatasetIdentifiers.length)},updateAppliedFacets(e){this.appliedFacets=e},updateFacets(e){let t={species:[],gender:[],organ:[]};if(e){e.forEach(n=>{switch(n.term.toLowerCase()){case"species":n.facet.toLowerCase()!=="show all"?(t.species.push(n.facet),this.facets.species.includes(n.facet)||this.facets.species.push(n.facet)):this.facets.species=[];break;case"gender":n.facet.toLowerCase()!=="show all"&&(t.gender.push(n.facet),this.facets.species.includes(n.facet)||this.facets.gender.push(n.facet));break;case"organ":n.facet.toLowerCase()!=="show all"&&(t.organ.push(n.facet),this.facets.species.includes(n.facet)||this.facets.organ.push(n.facet));break}});for(const[n,o]of Object.entries(this.facets)){let a=0;for(a=o.length-1;a>=0;a-=1)t[n].indexOf(o[a])==-1&&o.splice(a,1)}}},updateNumberOfDatasetsForFacets(e){this.numberOfDatasetsForFacets=e},updateUseHelpModeDialog(e){this.useHelpModeDialog=e},updateConnectivityInfoSidebar(e){this.connectivityInfoSidebar=e},updateAnnotationSidebar(e){this.annotationSidebar=e},updateAllClosable(e){this.allClosable=e},updateOfflineAnnotationEnabled(e){this.offlineAnnotationEnabled=e},updateDisplayMinimap(e){this.displayMinimap=e},updateGlobalSettings(e){for(const[t,n]of Object.entries(e))this.globalSettings[t]=n;localStorage.setItem("mapviewer.globalSettings",JSON.stringify(this.globalSettings))}}});function n9(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Nl=n9();function sEe(e){Nl=e}const r9=/[&<>"']/,lEe=new RegExp(r9.source,"g"),o9=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cEe=new RegExp(o9.source,"g"),dEe={"&":"&","<":"<",">":">",'"':""","'":"'"},a9=e=>dEe[e];function ur(e,t){if(t){if(r9.test(e))return e.replace(lEe,a9)}else if(o9.test(e))return e.replace(cEe,a9);return e}const uEe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i9(e){return e.replace(uEe,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const fEe=/(^|[^\[])\^/g;function Lt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(o,a)=>(a=a.source||a,a=a.replace(fEe,"$1"),e=e.replace(o,a),n),getRegex:()=>new RegExp(e,t)};return n}const pEe=/[^\w:]/g,hEe=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function s9(e,t,n){if(e){let o;try{o=decodeURIComponent(i9(n)).replace(pEe,"").toLowerCase()}catch{return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}t&&!hEe.test(n)&&(n=vEe(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const _g={},mEe=/^[^:]+:\/*[^/]*$/,gEe=/^([^:]+:)[\s\S]*$/,yEe=/^([^:]+:\/*[^/]*)[\s\S]*$/;function vEe(e,t){_g[" "+e]||(mEe.test(e)?_g[" "+e]=e+"/":_g[" "+e]=Fg(e,"/",!0)),e=_g[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(gEe,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(yEe,"$1")+t:e+t}const $g={exec:function(){}};function l9(e,t){const n=e.replace(/\|/g,(i,s,l)=>{let c=!1,d=s;for(;--d>=0&&l[d]==="\\";)c=!c;return c?"|":" |"}),o=n.split(/ \|/);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),o.length>t)o.splice(t);else for(;o.length<t;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(/\\\|/g,"|");return o}function Fg(e,t,n){const o=e.length;if(o===0)return"";let a=0;for(;a<o;){const i=e.charAt(o-a-1);if(i===t&&!n)a++;else if(i!==t&&n)a++;else break}return e.slice(0,o-a)}function bEe(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let o=0,a=0;for(;a<n;a++)if(e[a]==="\\")a++;else if(e[a]===t[0])o++;else if(e[a]===t[1]&&(o--,o<0))return a;return-1}function wEe(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function c9(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function d9(e,t,n,o){const a=t.href,i=t.title?ur(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){o.state.inLink=!0;const l={type:"link",raw:n,href:a,title:i,text:s,tokens:o.inlineTokens(s)};return o.state.inLink=!1,l}return{type:"image",raw:n,href:a,title:i,text:ur(s)}}function xEe(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const o=n[1];return t.split(`
|
|
490
490
|
`).map(a=>{const i=a.match(/^\s+/);if(i===null)return a;const[s]=i;return s.length>=o.length?a.slice(o.length):a}).join(`
|
|
491
491
|
`)}class $S{constructor(t){this.options=t||Nl}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const o=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Fg(o,`
|
|
492
492
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const o=n[0],a=xEe(o,n[3]||"");return{type:"code",raw:o,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:a}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let o=n[2].trim();if(/#$/.test(o)){const a=Fg(o,"#");(this.options.pedantic||!a||/ $/.test(a))&&(o=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const o=n[0].replace(/^ *>[ \t]?/gm,""),a=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(o);return this.lexer.state.top=a,{type:"blockquote",raw:n[0],tokens:i,text:o}}}list(t){let n=this.rules.block.list.exec(t);if(n){let o,a,i,s,l,c,d,u,f,p,m,h,g=n[1].trim();const v=g.length>1,y={type:"list",raw:"",ordered:v,start:v?+g.slice(0,-1):"",loose:!1,items:[]};g=v?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=v?g:"[*+-]");const b=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(h=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(o=n[0],t=t.substring(o.length),u=n[2].split(`
|
|
@@ -553,7 +553,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const a="<p>An err
|
|
|
553
553
|
`,o+=`<ul>${a.join(`
|
|
554
554
|
`)}</ul>`,e.push(o)}return e.join(`
|
|
555
555
|
|
|
556
|
-
<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=y_e(e),e=g_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=m_e(Ye.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;Tt.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()}},gd=e=>(r.pushScopeId("data-v-f927a0df"),e=e(),r.popScopeId(),e),b_e={class:"context-card-container",ref:"container"},w_e={key:0,class:"context-card"},x_e={class:"card-left"},k_e=["src"],C_e={class:"card-right scrollbar"},S_e={class:"title"},E_e=["innerHTML"],__e={class:"card-bottom"},$_e={class:"source-data-list"},F_e=["href"],A_e={key:0,class:"flatmap-entry"},T_e={class:"source-data-list"},B_e=["onClick"],N_e={key:0,class:"subtitle"},M_e=["onClick"],O_e=["src"],L_e={class:"view-description"},I_e=gd(()=>r.createElementVNode("div",{class:"padding"},null,-1)),R_e=gd(()=>r.createElementVNode("div",{style:{"margin-bottom":"16px"}},null,-1)),P_e={key:1,class:"subtitle"},V_e=["onClick"],D_e=["src"],z_e=gd(()=>r.createElementVNode("i",{class:"el-icon-warning-outline info"},null,-1)),j_e=["innerHTML"],H_e=["href"],U_e=gd(()=>r.createElementVNode("div",{class:"padding"},null,-1)),q_e={key:0,class:"subtitle"},K_e=["onClick"],G_e=["src"],W_e={class:"view-description"},X_e=gd(()=>r.createElementVNode("i",{class:"el-icon-warning-outline info"},null,-1)),Y_e=["innerHTML"],J_e=["href"],Z_e=gd(()=>r.createElementVNode("div",{class:"padding"},null,-1)),Q_e={key:2,class:"padding"},e5e={class:"float-button-container"};function t5e(e,t,n,o,a,i){const s=Qne,l=Zne,c=r.resolveComponent("CopyToClipboard"),d=wc;return r.openBlock(),r.createElementBlock("div",b_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",x_e,[r.createElementVNode("img",{src:i.banner,class:"context-image"},null,8,k_e)]),r.createElementVNode("div",C_e,[r.createElementVNode("div",null,[r.createElementVNode("div",S_e,r.toDisplayString(e.contextData.heading),1),r.createElementVNode("div",{innerHTML:i.parseMarkdown(e.contextData.description)},null,8,E_e)])]),r.createElementVNode("div",__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]=u=>e.activeName=u)},{default:r.withCtx(()=>[r.createVNode(s,{title:"View/Hide source data links",name:"sourceDataLinks"},{default:r.withCtx(()=>[r.createElementVNode("ul",$_e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.originalSource,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:"source-"+f},[u&&u.path?(r.openBlock(),r.createElementBlock("a",{key:0,href:i.generateFileLink(u),target:"_blank"},"View "+r.toDisplayString(u.name),9,F_e)):r.createCommentVNode("",!0)]))),128))])]),_:1})]),_:1},8,["modelValue"])):r.createCommentVNode("",!0)])),[[d,e.loadingOriginalSource]]),e.flatmapSource&&e.flatmapSource.length?(r.openBlock(),r.createElementBlock("div",A_e,[r.createTextVNode(" Associated flatmaps from source: "),r.createElementVNode("ul",T_e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.flatmapSource,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:"flatmap-"+f},[r.createElementVNode("span",{onClick:p=>i.flatmapClick(u)}," For "+r.toDisplayString(u.name),9,B_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",q_e,"Scaffold Views")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.views,(u,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_1"},[r.createElementVNode("span",{onClick:p=>i.viewClicked(u,f),class:"context-card-view"},[r.createElementVNode("img",{class:"view-image",src:i.getFileFromPath(u.thumbnail)},null,8,G_e),r.createElementVNode("div",W_e,[r.createTextVNode(r.toDisplayString(u.description),1),X_e])],8,K_e),e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:i.samplesMatching(u.id).description},null,8,Y_e)):r.createCommentVNode("",!0),e.sampleDetails[f]&&i.samplesMatching(u.id).path?(r.openBlock(),r.createElementBlock("a",{key:f+"_5",href:i.generateFileLink(i.samplesMatching(u.id)),target:"_blank"},"View Source",8,J_e)):r.createCommentVNode("",!0),Z_e,e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",Q_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",N_e,"Scaffold Views")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.views,(u,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_1"},[r.createElementVNode("div",{onClick:p=>i.openViewFile(u),class:"context-card-view"},[r.createElementVNode("img",{class:"view-image",src:i.getFileFromPath(u.thumbnail)},null,8,O_e),r.createElementVNode("div",L_e,r.toDisplayString(u.description),1)],8,M_e),I_e],64))),128)),R_e,e.contextData.samples&&e.contextData.samples.length>0?(r.openBlock(),r.createElementBlock("div",P_e,"Samples on Scaffold")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.samples,(u,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"}},[u.color?(r.openBlock(),r.createElementBlock("div",{key:0,class:"color-box",style:r.normalizeStyle("background-color:"+u.color)},null,4)):u.thumbnail?(r.openBlock(),r.createElementBlock("img",{key:1,class:"key-image",src:i.getFileFromPath(u.thumbnail)},null,8,D_e)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(u.heading)+" ",1),z_e]))],8,V_e),e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:u.description},null,8,j_e)):r.createCommentVNode("",!0),e.sampleDetails[f]&&u.path?(r.openBlock(),r.createElementBlock("a",{key:1,href:i.generateFileLink(u),target:"_blank"},"View Source",8,H_e)):r.createCommentVNode("",!0),U_e],64))),128))],64))])])])),[[d,e.loading]]):r.createCommentVNode("",!0),r.createElementVNode("div",e5e,[r.createVNode(c,{content:e.copyContent,onCopied:i.onCopied,theme:"light"},null,8,["content","onCopied"])])],512),[[r.vShow,e.showContextCard]])],512)}const M9=tr(v_e,[["render",t5e],["__scopeId","data-v-f927a0df"]]),n5e={name:"FlatmapContextCard",components:{Loading:J3,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+=`
|
|
556
|
+
<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=y_e(e),e=g_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=m_e(Ye.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;Tt.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()}},gd=e=>(r.pushScopeId("data-v-b9c1056b"),e=e(),r.popScopeId(),e),b_e={class:"context-card-container",ref:"container"},w_e={key:0,class:"context-card"},x_e={class:"card-left"},k_e=["src"],C_e={class:"card-right scrollbar"},S_e={class:"title"},E_e=["innerHTML"],__e={class:"card-bottom"},$_e={class:"source-data-list"},F_e=["href"],A_e={key:0,class:"flatmap-entry"},T_e={class:"source-data-list"},B_e=["onClick"],N_e={key:0,class:"subtitle"},M_e=["onClick"],O_e=["src"],L_e={class:"view-description"},I_e=gd(()=>r.createElementVNode("div",{class:"padding"},null,-1)),R_e=gd(()=>r.createElementVNode("div",{style:{"margin-bottom":"16px"}},null,-1)),P_e={key:1,class:"subtitle"},V_e=["onClick"],D_e=["src"],z_e=gd(()=>r.createElementVNode("i",{class:"el-icon-warning-outline info"},null,-1)),j_e=["innerHTML"],H_e=["href"],U_e=gd(()=>r.createElementVNode("div",{class:"padding"},null,-1)),q_e={key:0,class:"subtitle"},K_e=["onClick"],G_e=["src"],W_e={class:"view-description"},X_e=gd(()=>r.createElementVNode("i",{class:"el-icon-warning-outline info"},null,-1)),Y_e=["innerHTML"],J_e=["href"],Z_e=gd(()=>r.createElementVNode("div",{class:"padding"},null,-1)),Q_e={key:2,class:"padding"},e5e={class:"float-button-container"};function t5e(e,t,n,o,a,i){const s=Qne,l=Zne,c=r.resolveComponent("CopyToClipboard"),d=wc;return r.openBlock(),r.createElementBlock("div",b_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",x_e,[r.createElementVNode("img",{src:i.banner,class:"context-image"},null,8,k_e)]),r.createElementVNode("div",C_e,[r.createElementVNode("div",null,[r.createElementVNode("div",S_e,r.toDisplayString(e.contextData.heading),1),r.createElementVNode("div",{innerHTML:i.parseMarkdown(e.contextData.description)},null,8,E_e)])]),r.createElementVNode("div",__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]=u=>e.activeName=u)},{default:r.withCtx(()=>[r.createVNode(s,{title:"View/Hide source data links",name:"sourceDataLinks"},{default:r.withCtx(()=>[r.createElementVNode("ul",$_e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.originalSource,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:"source-"+f},[u&&u.path?(r.openBlock(),r.createElementBlock("a",{key:0,href:i.generateFileLink(u),target:"_blank"},"View "+r.toDisplayString(u.name),9,F_e)):r.createCommentVNode("",!0)]))),128))])]),_:1})]),_:1},8,["modelValue"])):r.createCommentVNode("",!0)])),[[d,e.loadingOriginalSource]]),e.flatmapSource&&e.flatmapSource.length?(r.openBlock(),r.createElementBlock("div",A_e,[r.createTextVNode(" Associated flatmaps from source: "),r.createElementVNode("ul",T_e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.flatmapSource,(u,f)=>(r.openBlock(),r.createElementBlock("li",{key:"flatmap-"+f},[r.createElementVNode("span",{onClick:p=>i.flatmapClick(u)}," For "+r.toDisplayString(u.name),9,B_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",q_e,"Scaffold Views")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.views,(u,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_1"},[r.createElementVNode("span",{onClick:p=>i.viewClicked(u,f),class:"context-card-view"},[r.createElementVNode("img",{class:"view-image",src:i.getFileFromPath(u.thumbnail)},null,8,G_e),r.createElementVNode("div",W_e,[r.createTextVNode(r.toDisplayString(u.description),1),X_e])],8,K_e),e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:i.samplesMatching(u.id).description},null,8,Y_e)):r.createCommentVNode("",!0),e.sampleDetails[f]&&i.samplesMatching(u.id).path?(r.openBlock(),r.createElementBlock("a",{key:f+"_5",href:i.generateFileLink(i.samplesMatching(u.id)),target:"_blank"},"View Source",8,J_e)):r.createCommentVNode("",!0),Z_e,e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",Q_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",N_e,"Scaffold Views")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.views,(u,f)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:f+"_1"},[r.createElementVNode("div",{onClick:p=>i.openViewFile(u),class:"context-card-view"},[r.createElementVNode("img",{class:"view-image",src:i.getFileFromPath(u.thumbnail)},null,8,O_e),r.createElementVNode("div",L_e,r.toDisplayString(u.description),1)],8,M_e),I_e],64))),128)),R_e,e.contextData.samples&&e.contextData.samples.length>0?(r.openBlock(),r.createElementBlock("div",P_e,"Samples on Scaffold")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.contextData.samples,(u,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"}},[u.color?(r.openBlock(),r.createElementBlock("div",{key:0,class:"color-box",style:r.normalizeStyle("background-color:"+u.color)},null,4)):u.thumbnail?(r.openBlock(),r.createElementBlock("img",{key:1,class:"key-image",src:i.getFileFromPath(u.thumbnail)},null,8,D_e)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(u.heading)+" ",1),z_e]))],8,V_e),e.sampleDetails[f]?(r.openBlock(),r.createElementBlock("div",{key:0,innerHTML:u.description},null,8,j_e)):r.createCommentVNode("",!0),e.sampleDetails[f]&&u.path?(r.openBlock(),r.createElementBlock("a",{key:1,href:i.generateFileLink(u),target:"_blank"},"View Source",8,H_e)):r.createCommentVNode("",!0),U_e],64))),128))],64))])])])),[[d,e.loading]]):r.createCommentVNode("",!0),r.createElementVNode("div",e5e,[r.createVNode(c,{content:e.copyContent,onCopied:i.onCopied,theme:"light"},null,8,["content","onCopied"])])],512),[[r.vShow,e.showContextCard]])],512)}const M9=tr(v_e,[["render",t5e],["__scopeId","data-v-b9c1056b"]]),n5e={name:"FlatmapContextCard",components:{Loading:J3,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+=`
|
|
557
557
|
`,t+=`<div><a href="${this.sckanReleaseLink}">${this.sckanReleaseLink}</a></div>`,e.push(t);let n="<div>Published on:</div>";n+=`
|
|
558
558
|
`,n+=`<div>${this.flatmapPublishedDisplay}</div>`,e.push(n);let o="<div>View publication:</div>";return o+=`
|
|
559
559
|
`,o+=`<div><a href="${this.flatmapSource}">${this.flatmapSource}</a></div>`,e.push(o),e.join(`
|
|
@@ -973,7 +973,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const a="<p>An err
|
|
|
973
973
|
where source="${Rg(e)}" and
|
|
974
974
|
knowledge like "%${t}%" order by source desc`;return(await n.queryKnowledge(a)).map(c=>JSON.parse(c)).map(c=>c.id)}function Rg(e){return wV(e.mapMetadata)}function wV(e){let t="";if(e!=null&&e.connectivity){const n=e.connectivity;"knowledge-source"in n?t=n["knowledge-source"]:"npo"in n&&(t=`${n.npo.release}-npo`)}return t}async function A5e(e,t){const n=Rg(e),o=`select knowledge from knowledge
|
|
975
975
|
where source="${n}"
|
|
976
|
-
order by source desc`;N5e();const a=sessionStorage.getItem("flatmap-knowledge"),i=sessionStorage.getItem("flatmap-knowledge-source");if(!a||i!==n){const l=(await t.queryKnowledge(o)).map(c=>JSON.parse(c));return sessionStorage.setItem("flatmap-knowledge",JSON.stringify(l)),sessionStorage.setItem("flatmap-knowledge-source",n),T5e(),l}return JSON.parse(a)}function T5e(){const n=new Date().getTime()+864e5;sessionStorage.setItem("flatmap-knowledge-expiry",n)}function B5e(){["flatmap-knowledge","flatmap-knowledge-expiry","flatmap-knowledge-source"].forEach(t=>{sessionStorage.removeItem(t)})}function N5e(){const e=sessionStorage.getItem("flatmap-knowledge-expiry");new Date().getTime()>e&&B5e()}const Mf=Mt.defineStore("entries",{state:()=>IS(),getters:{findIndexOfId:e=>t=>{for(let n=0;n<e.entries.length;n++)if(e.entries[n].id==t)return n;return-1}},actions:{addNewEntry(e){this.entries.push(e)},destroyEntry(e){e>-1&&this.entries.splice(e,1)},setAll(e){this.entries=[],Object.assign(this.entries,e)},updateViewForEntry({id:e,viewUrl:t}){const n=this.entries.find(o=>o.id===e);n.viewUrl=t},updateMapForEntry(e,t){if(e.id===t.id){const n=wV(t.prov);e.uuid=t.prov.uuid,e.sckanVersion=n}},updateLabelForEntry(e,t){const n=this.entries.find(o=>o.id===e.id);n&&(n.label=t)},updateTitleForEntry(e,t){const n=this.entries.find(o=>o.id===e.id);n&&(n.title=t)}}}),Of=[{id:"ilxtr:neuron-type-keast-13",centrelines:["n_71"]},{id:"ilxtr:neuron-type-keast-2",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-3",centrelines:["bladder_n","hypogastric_n"]},{id:"ilxtr:neuron-type-keast-15",centrelines:["n_73"]},{id:"ilxtr:neuron-type-keast-1",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-7",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-9",centrelines:["L6_spinal_n-1","L6_ventral_root","pudendal_n","L5_spinal_n","L5_ventral_root"]},{id:"ilxtr:neuron-type-keast-10",centrelines:["S1_dorsal_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_dorsal_root","bladder_n"]},{id:"ilxtr:neuron-type-keast-11",centrelines:["lumbar_splanchnic_n","L2_spinal_n","L1_spinal_n-1","hypogastric_n","bladder_n","L1_dorsal_root","L2_dorsal_root"]},{id:"ilxtr:neuron-type-keast-12",centrelines:["L6_spinal_n-1","L6_dorsal_root","pudendal_n","S1_spinal_n-1","S1_dorsal_root"]},{id:"ilxtr:neuron-type-keast-8",centrelines:["L1_ventral_root_paravertebral_ganglion","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","L2_ventral_root_paravertebral_ganglion","sympathetic_trunk_L2-L3","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_L5-L6","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-20",centrelines:["T1_T2_cns","C8_T1_cns","T2_T3_cns","T10_T11_cns","T9_T10_cns","T11_T12_cns","T8_T9_cns","C7_C8_cns","C6_C7_cns","C4_C5_cns","C3_C4_cns","C5_C6_cns","medulla_C1_cns","pons_medulla_cns","C1_C2_cns","T5_T6_cns","T4_T5_cns","T6_T7_cns","L3_L4_cns","L2_L3_cns","L4_L5_cns","L5_L6_cns","T13_L1_cns","T12_T13_cns","L1_L2_cns","T3_T4_cns","n_69","C2_C3_cns","T7_T8_cns"]},{id:"ilxtr:neuron-type-keast-16",centrelines:["n_74"]},{id:"ilxtr:neuron-type-keast-4",centrelines:["sympathetic_trunk_L6-S1","L6_gray_ramus-spinal_n","sympathetic_trunk_L5-L6","S1_gray_ramus-spinal_n","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","sympathetic_trunk_L2-L3","bladder_n","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-17",centrelines:["n_75"]},{id:"ilxtr:neuron-type-keast-5",centrelines:["S1_ventral_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_ventral_root"]},{id:"ilxtr:neuron-type-keast-18",centrelines:["n_70"]},{id:"ilxtr:neuron-type-keast-6",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","hypogastric_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-19",centrelines:["n_69"]},{id:"ilxtr:neuron-type-keast-14",centrelines:["n_72"]}];function M5e(){return[{id:"UBERON:0000948",name:"Heart",type:"simulation"},{id:"UBERON:0001156",name:"Colon",type:"simulation"},{id:"UBERON:0001255",name:"Bladder",type:"simulation"},{id:"UBERON:0000945",name:"Stomach",type:"simulation"},{id:"UBERON:0001759",name:"Vagus nerve",type:"simulation"},{id:"UBERON:0002108",name:"Small intestines",type:"simulation"},{id:"UBERON:0002107",name:"Liver",type:"simulation"}]}function O5e(){return M5e()}function xV(e){if(e)for(let t=0;t<Of.length;t++){if(Of[t].id==e)return Of[t].centrelines;if(Of[t].centrelines.find(o=>o===e))return[Of[t].id]}return[]}function L5e(e){if(e){const t=e.toLowerCase();if(t.includes("heart"))return{id:"UBERON:0000948",name:"Heart"};if(t.includes("liver"))return{id:"UBERON:0002107",name:"Liver"};if(t.includes("stomach"))return{id:"UBERON:0000945",name:"Stomach"};if(t.includes("colon"))return{id:"UBERON:0001156",name:"Colon"};if(t.includes("bladder"))return{id:"UBERON:0001255",name:"Bladder"}}}const PS=e=>{switch(e){case"2horpanel":return{"split-1":{content:!1,horizontal:!0,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"2vertpanel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"3panel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3}};case"4panel":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4}};case"5panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-5"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5}};case"6panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"6panelVertical":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"singlepanel":default:return{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}}}},I5e=(e,t)=>{const n=[],o=[];for(const[a,i]of Object.entries(t))i.content&&(1>i.id||n.includes(i.id)?o.push(a):n.push(i.id));o.forEach(a=>{let i=!1;for(let s=0;s<e.length&&!i;s++)n.includes(e[s].id)||(t[a].id=e[s].id,n.push(e.id),i=!0)})},R5e=e=>{const t={};for(const[n,o]of Object.entries(e))o.content&&(t[n]=o);return t},kV=(e,t)=>{const n=R5e(e),o=PS(t);for(const[a,i]of Object.entries(n))o[a]=i;return o},yd=(e,t)=>Object.keys(e).find(n=>e[n].id===t),CV=()=>({activeView:"singlepanel",idNamePair:{},viewIcons:[{icon:"singlepanel",name:"Single view",min:1},{icon:"2horpanel",name:"Horizontal split",min:2},{icon:"2vertpanel",name:"Vertical split",min:2},{icon:"3panel",name:"Three panes",min:3},{icon:"4panel",name:"Four panes",min:4},{icon:"5panel",name:"Five panes",min:5},{icon:"6panel",name:"Six (horizontal)",min:6},{icon:"6panelVertical",name:"Six (vertical)",min:6}],customLayout:{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}},splitters:{first:50,second:50,third:50}}),Ss=Mt.defineStore("splitFlow",{state:()=>CV(),getters:{getActivePaneIds:e=>()=>{const t=[];let n;for(const o in e.customLayout)e.customLayout[o].id&&t.push(e.customLayout[o].id);switch(e.activeView){case"singlepanel":n=t.slice(0,1);break;case"2horpanel":case"2vertpanel":n=t.slice(0,2);break;case"3panel":n=t.slice(0,3);break;case"4panel":n=t.slice(0,4);break;case"5panel":n=t.slice(0,5);break;case"6panelVertical":case"6panel":n=t.slice(0,6);break;default:n=[];break}return n},getPaneNameById:e=>t=>yd(e.customLayout,t),getState:e=>()=>({activeView:e.activeView,splitters:e.splitters,customLayout:e.customLayout}),isPaneActive:e=>t=>{const n=PS(e.activeView);return Object.keys(n).includes(t)}},actions:{assignOrSwapPaneWithIds(e){let t=yd(this.customLayout,e.source),n=yd(this.customLayout,e.target);n&&(this.customLayout[n].id=e.source),t&&(this.customLayout[t].id=e.target),this.updateSplitPanels()},getAvailableTerms(e){let t=O5e();for(let n=0;n<t.length;n++)this.idNamePair[t[n].id]=t[n].name;if(e){this._controller&&this._controller.abort(),this._controller=new AbortController;let n=this._controller.signal;fetch(`${e}get-organ-curies`,{signal:n}).then(o=>o.json()).then(o=>{this._controller=void 0,o.uberon.array.forEach(a=>{this.idNamePair[a.id.toUpperCase()]=a.name.charAt(0).toUpperCase()+a.name.slice(1)})})}},updateActiveView(e){this.activeView=e.view;const t=kV(this.customLayout,this.activeView);I5e(e.entries,t);for(const[n,o]of Object.entries(t))this.customLayout[n]=o;this.updateSplitPanels()},setSplitter(e){this.splitters[e.name]&&(this.splitters[e.name]=e.value)},setState(e){if(e){let t;if(e.activeView&&(this.activeView=e.activeView),e.customLayout)t=e.customLayout;else if(t=PS(this.activeView),e.slotInfo)for(let n=0;n<e.slotInfo.length;n++)switch(e.slotInfo[n].name){case"first":t["pane-1"].id=e.slotInfo[n].id;break;case"second":"pane-2"in t&&(t["pane-2"].id=e.slotInfo[n].id);break;case"thrid":"pane-3"in t&&(t["pane-3"].id=e.slotInfo[n].id);break;case"fourth":"pane-4"in t&&(t["pane-4"].id=e.slotInfo[n].id);break;case"fifth":"pane-5"in t&&(t["pane-5"].id=e.slotInfo[n].id);break;case"sixth":"pane-6"in t&&(t["pane-6"].id=e.slotInfo[n].id);break}for(const[n,o]of Object.entries(t))this.customLayout[n]=o;for(const[n,o]of Object.entries(e.splitters))this.splitters[n]=o}},setIdToPrimaryPane(e){const t=yd(this.customLayout,e),n=this.customLayout["pane-1"].id;this.customLayout["pane-1"].id=e,t&&(this.customLayout[t].id=n)},reset(){const e=CV();this.activeView=e.activeView,this.customLayout=e.customLayout,this.splitters=e.splitters},closeSlot(e){if(e){let t=0;if(e.entries)for(let n=0;n<e.entries.length&&t==0;n++)e.entries[n].id!==e.id&&yd(this.customLayout,e.entries[n].id)===void 0&&(t=e.entries[n].id);if(this.activeView!=="customise"){const n=this.activeView;switch(this.activeView){case"2horpanel":case"2vertpanel":this.activeView="singlepanel";break;case"3panel":this.activeView="2vertpanel";break;case"4panel":this.activeView="3panel";break;case"5panel":this.activeView="4panel";break;case"6panelVertical":case"6panel":this.activeView="5panel";break}const o=kV(this.customLayout,this.activeView);switch(yd(this.customLayout,e.id)){case"pane-1":switch(n){case"2horpanel":case"2vertpanel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=t;break;case"3panel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=t;break;case"4panel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=t;break;case"5panel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-2":switch(n){case"2horpanel":case"2vertpanel":o["pane-2"].id=t;break;case"3panel":o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=t;break;case"4panel":o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=t;break;case"5panel":o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-3":switch(n){case"3panel":o["pane-3"].id=t;break;case"4panel":o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=t;break;case"5panel":o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-4":switch(n){case"4panel":o["pane-4"].id=t;break;case"5panel":o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-5":switch(n){case"5panel":o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-6":switch(n){case"6panelVertical":case"6panel":o["pane-6"].id=t;break}break}for(const[i,s]of Object.entries(o))this.customLayout[i]=s}}},updateSplitPanels(){$e.emit("species-layout-connectivity-update")}}}),P5e={name:"ContentBar",components:{ElIconArrowDown:lo,ElIconArrowUp:W1,ElIconInfoFilled:Z1,Input:ph,Option:G3,Popover:Eh,Row:xh,Select:K3,ContextCard:M9,FlatmapContextCard:O9,MapSvgIcon:MS},props:{entry:Object},data:function(){return{contextCardVisible:!1,slot:{},boundariesElement:null,showDetails:!0,contextCardEntry:void 0,titles:[]}},computed:{...Mt.mapStores(Mf,vi,Ss),allClosable(){return this.settingsStore.allClosable},helpDelay(){return this.settingsStore.helpDelay},activeView:function(){return this.splitFlowStore.activeView},envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},popperOptions:function(){return{modifiers:[{name:"preventOverflow",options:{boundary:this.boundariesElement}},{name:"flip",options:{boundary:this.boundariesElement,flipVariations:!1,allowedAutoPlacements:["bottom"]}}]}},entries:function(){return this.titles=[],this.entriesStore.entries.map(e=>{const t=this.getEntryTitle(e);return this.titles.push({id:e.id,title:t}),{...e,title:t}})}},methods:{closeAndRemove:function(){this.splitFlowStore.closeSlot({id:this.entry.id,entries:this.entries}),$e.emit("RemoveEntryRequest",this.entry.id),this.$nextTick(()=>{this.splitFlowStore.updateSplitPanels()})},getEntryTitle:function(e){if(e){let t=e.label?e.label+" ":"",n=e.type;return n=="Scaffold"&&(n="3D Scaffold"),t+=n,e.datasetId?t+=" - "+e.datasetId:e.discoverId&&(t+=" - "+e.discoverId),t}return"Viewer"},getTitle:function(e){const{id:t,title:n}=e,o=this.titles.filter(a=>a.title===n);if(o.length>1){const a=[];for(let s=0;s<o.length;s++){const l=this.getCharById(s);a.push({id:o[s].id,title:o[s].title+l})}const i=a.find(s=>s.id===t);if(i)return i.title}return n},getCharById:function(e){return" ("+String.fromCharCode(65+e)+")"},viewerChanged:function(e){if(this.entry.id&&this.entry.id!=e){this.splitFlowStore.assignOrSwapPaneWithIds({source:this.entry.id,target:e}),this.$nextTick(()=>{setTimeout(()=>{this.$emit("chooser-changed")},1200)});const t=this.entries.find(n=>n.id===e);Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_viewer_changed",category:(t==null?void 0:t.title)||"",location:"map_toolbar"})}},setPopperWidth:function(e){let t=this.entries.find(n=>n.id===e);if(t)return t.type=="Flatmap"||t.type=="MultiFlatmap"?"240px":"440px"},setBoundary:function(e){this.boundariesElement=e},setupFlatmapContextCard:function(e){this.contextCardVisible=!1;let t=Object.assign({mapImpProv:e.prov},this.entry);this.contextCardEntry=t},setupScaffoldContextCard:function(){this.entry.contextCardUrl&&(this.contextCardEntry={...this.entry})}},mounted:function(){this.setupScaffoldContextCard()}},V5e={class:"toolbar-flex-container"},D5e={key:1,class:"toolbar-title"};function z5e(e,t,n,o,a,i){const s=G3,l=K3,c=O9,d=M9,u=W1,f=Un,p=lo,m=Eh,h=r.resolveComponent("map-svg-icon"),g=xh;return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",V5e,[i.entries.length>1?(r.openBlock(),r.createBlock(l,{key:0,teleported:!1,"model-value":n.entry.id,placeholder:"Select",class:"select-box","popper-class":"viewer_dropdown",onChange:t[0]||(t[0]=v=>i.viewerChanged(v))},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.entries,v=>(r.openBlock(),r.createBlock(s,{key:v.id,label:i.getTitle(v),value:v.id},null,8,["label","value"]))),128))]),_:1},8,["model-value"])):(r.openBlock(),r.createElementBlock("div",D5e,r.toDisplayString(i.getEntryTitle(n.entry)),1))]),r.createVNode(g,{class:"icon-group"},{default:r.withCtx(()=>[r.createVNode(m,{placement:"bottom",teleported:!1,trigger:"manual",width:i.setPopperWidth(e.slot.id),offset:0,"popper-class":"context-card-popover","popper-options":i.popperOptions,visible:e.contextCardVisible},r.createSlots({reference:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",null,[r.withDirectives(r.createElementVNode("div",{class:"hide",onClick:t[3]||(t[3]=v=>e.contextCardVisible=!1)},[r.createTextVNode(" Hide information "),r.createVNode(f,null,{default:r.withCtx(()=>[r.createVNode(u)]),_:1})],512),[[r.vShow,e.contextCardVisible]]),r.withDirectives(r.createElementVNode("div",{class:"hide",onClick:t[4]||(t[4]=v=>e.contextCardVisible=!0)},[r.createTextVNode(" Show information "),r.createVNode(f,null,{default:r.withCtx(()=>[r.createVNode(p)]),_:1})],512),[[r.vShow,!e.contextCardVisible]])],512),[[r.vShow,e.contextCardEntry]])]),_:2},[e.contextCardEntry?{name:"default",fn:r.withCtx(()=>[e.contextCardEntry.type=="Flatmap"||e.contextCardEntry.type=="MultiFlatmap"?(r.openBlock(),r.createBlock(c,{key:0,class:"flatmap-context-card",mapImpProv:e.contextCardEntry.mapImpProv},null,8,["mapImpProv"])):r.createCommentVNode("",!0),e.contextCardEntry.type.toLowerCase()=="scaffold"?(r.openBlock(),r.createBlock(d,{key:1,entry:e.contextCardEntry,envVars:i.envVars,class:"context-card",onContextReady:t[1]||(t[1]=v=>e.contextCardVisible=!0),onScaffoldViewClicked:t[2]||(t[2]=v=>e.$emit("scaffold-view-clicked",v))},null,8,["entry","envVars"])):r.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["width","popper-options","visible"]),r.createVNode(m,{class:"tooltip",content:"Close and remove",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(h,{icon:"close",class:"header-icon",onClick:t[5]||(t[5]=v=>i.closeAndRemove())},null,512),[[r.vShow,i.activeView!=="singlepanel"&&(n.entry.mode!=="main"||i.allClosable)]])]),_:1},8,["show-after"])]),_:1})])}const SV=tr(P5e,[["render",z5e],["__scopeId","data-v-61f2f88c"]]),j5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>yGe)),H5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>kGe)),U5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>$Ge)),q5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>TGe)),K5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>OGe)),G5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>RGe)),W5e={name:"ContentVuer",props:{entry:Object,visible:{type:Boolean,default:!0}},components:{Button:wu,ContentBar:SV,Flatmap:j5e,Iframe:H5e,MultiFlatmap:U5e,Plot:q5e,Scaffold:K5e,Simulation:G5e},methods:{flatmapProvenanceReady:function(e){var t;(t=this.$refs.contentBar)==null||t.setupFlatmapContextCard(e),this.entriesStore.updateMapForEntry(this.entry,e)},getId:function(){return this.entry.id},getState:function(){var e;return(e=this.$refs.viewer)==null?void 0:e.getState()},resourceSelected:function(e){this.$emit("resource-selected",e)},scaffoldViewClicked:function(e){var t;this.entry.viewUrl!==e?this.entriesStore.updateViewForEntry({id:this.entry.id,viewUrl:e}):(t=this.$refs.viewer)==null||t.updateWithViewUrl(e)},search:function(e){var t;return(t=this.$refs.viewer)==null?void 0:t.search(e)},searchSuggestions:function(e,t){var n;(n=this.$refs.viewer)==null||n.searchSuggestions(e,t)},setPanesBoundary:function(){var e;(e=this.$refs.contentBar)==null||e.setBoundary(this.$refs.container)},speciesChanged:function(e){this.activeSpecies=e,this.$emit("species-changed",e)},isVisible:function(){const e=this.splitFlowStore.getPaneNameById(this.entry.id);let t=!1;return e!==void 0&&(t=this.splitFlowStore.isPaneActive(e)),t},onResize:function(){var e;(e=this.$refs.viewer)==null||e.onResize()},onConnectivityItemClose:function(){var e;(e=this.$refs.viewer)==null||e.onConnectivityItemClose()},onConnectivitySourceChange:function(e){var t;(t=this.$refs.viewer)==null||t.changeConnectivitySource(e)},onFlatmapMarkerUpdate:function(){var e;(e=this.$refs.viewer)==null||e.flatmapMarkerUpdate()},onGlobalViewerSettingsUpdate:function(){var e;(e=this.$refs.viewer)==null||e.updateViewerSettings()},onHoverUpdate:function(e){var t;(t=this.$refs.viewer)==null||t.sidebarHoverHighlight(e)},onShowConnectivity:function(e){var t;(t=this.$refs.viewer)==null||t.showConnectivity(e)},onShowConnectivityTooltips:function(e){var t;(t=this.$refs.viewer)==null||t.showConnectivityTooltips(e)},onShowReferenceConnectivity:function(e){var t;(t=this.$refs.viewer)==null||t.showConnectivitiesByReference(e)},onSidebarAnnotationClose:function(){var e;(e=this.$refs.viewer)==null||e.onSidebarAnnotationClose()},onStartHelp:function(){var e;(e=this.$refs.viewer)==null||e.startHelp()},onFilterVisibility:function(e){var t;(t=this.$refs.viewer)==null||t.setVisibilityFilter(e)},onLoadConnectivityDetail:function(e){var t;(t=this.$refs.viewer)==null||t.getKnowledgeTooltip(e)}},data:function(){return{mouseHovered:!1,activeSpecies:"Rat"}},computed:{...Mt.mapStores(Mf,Ss),viewerType(){switch(this.entry.type){case"Biolucida":case"Iframe":case"Segmentation":return"Iframe";default:return this.entry.type}}}},X5e={class:"component-container",ref:"container"};function Y5e(e,t,n,o,a,i){const s=SV;return r.openBlock(),r.createElementBlock("div",{class:"content-container",onMouseover:t[0]||(t[0]=l=>e.mouseHovered=!0),onMouseleave:t[1]||(t[1]=l=>e.mouseHovered=!1)},[r.createVNode(s,{class:"toolbar",entry:n.entry,ref:"contentBar",onChooserChanged:i.onResize,onScaffoldViewClicked:i.scaffoldViewClicked,onVnodeMounted:i.setPanesBoundary},null,8,["entry","onChooserChanged","onScaffoldViewClicked","onVnodeMounted"]),r.createElementVNode("div",X5e,[(r.openBlock(),r.createBlock(r.Suspense,null,{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.viewerType),{entry:n.entry,mouseHovered:e.mouseHovered,visible:n.visible,lazy:!0,ref:"viewer",onFlatmapProvenanceReady:i.flatmapProvenanceReady,onResourceSelected:i.resourceSelected,onSpeciesChanged:i.speciesChanged},null,40,["entry","mouseHovered","visible","onFlatmapProvenanceReady","onResourceSelected","onSpeciesChanged"]))]),_:1}))],512)],32)}const EV=tr(W5e,[["render",Y5e],["__scopeId","data-v-b017dd1e"]]);var _V={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(typeof window<"u"?window:Yte,function(){if(typeof window>"u")return null;var n=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),o=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||function(u){return n.setTimeout(u,20)},a=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||function(u){n.clearTimeout(u)};function i(u,f){var p=Object.prototype.toString.call(u),m=p==="[object Array]"||p==="[object NodeList]"||p==="[object HTMLCollection]"||p==="[object Object]"||typeof jQuery<"u"&&u instanceof jQuery||typeof Elements<"u"&&u instanceof Elements,h=0,g=u.length;if(m)for(;h<g;h++)f(u[h]);else f(u)}function s(u){if(!u.getBoundingClientRect)return{width:u.offsetWidth,height:u.offsetHeight};var f=u.getBoundingClientRect();return{width:Math.round(f.width),height:Math.round(f.height)}}function l(u,f){Object.keys(f).forEach(function(p){u.style[p]=f[p]})}var c=function(u,f){var p=0;function m(){var g=[];this.add=function(b){g.push(b)};var v,y;this.call=function(b){for(v=0,y=g.length;v<y;v++)g[v].call(this,b)},this.remove=function(b){var x=[];for(v=0,y=g.length;v<y;v++)g[v]!==b&&x.push(g[v]);g=x},this.length=function(){return g.length}}function h(g,v){if(g){if(g.resizedAttached){g.resizedAttached.add(v);return}g.resizedAttached=new m,g.resizedAttached.add(v),g.resizeSensor=document.createElement("div"),g.resizeSensor.dir="ltr",g.resizeSensor.className="resize-sensor";var y={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},b={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(g.resizeSensor,y);var x=document.createElement("div");x.className="resize-sensor-expand",l(x,y);var w=document.createElement("div");l(w,b),x.appendChild(w);var k=document.createElement("div");k.className="resize-sensor-shrink",l(k,y);var C=document.createElement("div");l(C,b),l(C,{width:"200%",height:"200%"}),k.appendChild(C),g.resizeSensor.appendChild(x),g.resizeSensor.appendChild(k),g.appendChild(g.resizeSensor);var S=window.getComputedStyle(g),E=S?S.getPropertyValue("position"):null;E!=="absolute"&&E!=="relative"&&E!=="fixed"&&E!=="sticky"&&(g.style.position="relative");var _=!1,$=0,A=s(g),F=0,N=0,M=!0;p=0;var L=function(){var Y=g.offsetWidth,W=g.offsetHeight;w.style.width=Y+10+"px",w.style.height=W+10+"px",x.scrollLeft=Y+10,x.scrollTop=W+10,k.scrollLeft=Y+10,k.scrollTop=W+10},B=function(){if(M){var Y=g.offsetWidth===0&&g.offsetHeight===0;if(Y){p||(p=o(function(){p=0,B()}));return}else M=!1}L()};g.resizeSensor.resetSensor=B;var I=function(){$=0,_&&(F=A.width,N=A.height,g.resizedAttached&&g.resizedAttached.call(A))},R=function(){A=s(g),_=A.width!==F||A.height!==N,_&&!$&&($=o(I)),B()},V=function(Y,W,Q){Y.attachEvent?Y.attachEvent("on"+W,Q):Y.addEventListener(W,Q)};V(x,"scroll",R),V(k,"scroll",R),p=o(function(){p=0,B()})}}i(u,function(g){h(g,f)}),this.detach=function(g){p||(a(p),p=0),c.detach(u,g)},this.reset=function(){u.resizeSensor.resetSensor()}};if(c.reset=function(u){i(u,function(f){f.resizeSensor.resetSensor()})},c.detach=function(u,f){i(u,function(p){p&&(p.resizedAttached&&typeof f=="function"&&(p.resizedAttached.remove(f),p.resizedAttached.length())||p.resizeSensor&&(p.contains(p.resizeSensor)&&p.removeChild(p.resizeSensor),delete p.resizeSensor,delete p.resizedAttached))})},typeof MutationObserver<"u"){var d=new MutationObserver(function(u){for(var f in u)if(u.hasOwnProperty(f))for(var p=u[f].addedNodes,m=0;m<p.length;m++)p[m].resizeSensor&&c.reset(p[m])});document.addEventListener("DOMContentLoaded",function(u){d.observe(document.body,{childList:!0,subtree:!0})})}return c})})(_V);var J5e=_V.exports;const Z5e=a3(J5e),Q5e={name:"ResizeSensor",methods:{activate:function(){this._sensor||(this._sensor=new Z5e(this.$refs.display,this.displayResize),this.displayResize())},deactivate:function(){this._sensor&&(this._sensor.detach(this.$refs.display,this.displayResize),delete this._sensor,this._sensor=void 0,this.displayResize())},displayResize:function(){this.$emit("resize")}},unmounted(){this.deactivate()},activated(){this.activate()},deactivated(){this.deactivate()},mounted:function(){this.activate()}},e$e={style:{height:"100%",width:"100%",position:"absolute"},ref:"display"};function t$e(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("div",e$e,null,512)}const $V=tr(Q5e,[["render",t$e]]),n$e={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((o,a)=>(o.size=a===t?o.max:o.min,a!==t&&(n+=o.min),o)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t]),this.$emit("resized",this.panes.map(o=>({min:o.min,max:o.max,size:o.size})))},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:o-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),e*100/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:n.prevPanesSize),a=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(e),a),o);let s=[t,t+1],l=this.panes[s[0]]||null,c=this.panes[s[1]]||null;const d=l.max<100&&i>=l.max+n.prevPanesSize,u=c.max<100&&i<=100-(c.max+this.sumNextPanesSize(t+1));if(d||u){d?(l.size=l.max,c.size=Math.max(100-l.max-n.prevPanesSize-n.nextPanesSize,0)):(l.size=Math.max(100-c.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),c.size=c.max);return}if(this.pushOtherPanes){const f=this.doPushOtherPanes(n,i);if(!f)return;({sums:n,panesToResize:s}=f),l=this.panes[s[0]]||null,c=this.panes[s[1]]||null}l!==null&&(l.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,l.min),l.max)),c!==null&&(c.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,c.min),c.max))},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,o=[n,n+1];return t<e.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((a,i)=>{i>o[0]&&i<=n&&(a.size=a.min,e.prevReachedMinPanes+=a.min)}),e.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((a,i)=>{i>0&&i<=n&&(a.size=a.min,e.prevReachedMinPanes+=a.min)}),this.panes[o[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((a,i)=>{i>n&&i<o[1]&&(a.size=a.min,e.nextReachedMinPanes+=a.min)}),e.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((a,i)=>{i<this.panesCount-1&&i>=n+1&&(a.size=a.min,e.nextReachedMinPanes+=a.min)}),this.panes[o[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:o}},sumPrevPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),n=e.classList.contains("splitpanes__splitter");!t&&!n&&(e.parentNode.removeChild(e),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))})},addSplitter(e,t,n=!1){const o=e-1,a=document.createElement("div");a.classList.add("splitpanes__splitter"),n||(a.onmousedown=i=>this.onMouseDown(i,o),typeof window<"u"&&"ontouchstart"in window&&(a.ontouchstart=i=>this.onMouseDown(i,o)),a.onclick=i=>this.onSplitterClick(i,o+1)),this.dblClickSplitter&&(a.ondblclick=i=>this.onSplitterDblClick(i,o+1)),t.parentNode.insertBefore(a,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate({target:e,...t}){const n=this.indexedPanes[e._.uid];Object.entries(t).forEach(([o,a])=>n[o]=a)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(a=>(a.className.includes("splitpanes__pane")&&t++,a===e.$el));const n=parseFloat(e.minSize),o=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((a,i)=>a.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(a=>({min:a.min,max:a.max,size:a.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(o=>o.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((o,a)=>o.index=a),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(e={}){!e.addedPane&&!e.removedPane?this.initialPanesSizing():this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const n=[],o=[];this.panes.forEach(a=>{a.size=Math.max(Math.min(e,a.max),a.min),t-=a.size,a.size>=a.max&&n.push(a.id),a.size<=a.min&&o.push(a.id)}),t>.1&&this.readjustSizes(t,n,o)},initialPanesSizing(){let e=100;const t=[],n=[];let o=0;this.panes.forEach(i=>{e-=i.size,i.size!==null&&o++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id)});let a=100;e>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(e/(this.panesCount-o),i.max),i.min)),a-=i.size}),a>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e,removedPane:t}={}){let n=100/this.panesCount,o=0;const a=[],i=[];e&&e.givenSize!==null&&(n=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(s=>{o-=s.size,s.size>=s.max&&a.push(s.id),s.size<=s.min&&i.push(s.id)}),!(Math.abs(o)<.1)&&(this.panes.forEach(s=>{e&&e.givenSize!==null&&e.id===s.id||(s.size=Math.max(Math.min(n,s.max),s.min)),o-=s.size,s.size>=s.max&&a.push(s.id),s.size<=s.min&&i.push(s.id)}),o>.1&&this.readjustSizes(o,a,i))},readjustSizes(e,t,n){let o;e>0?o=e/(this.panesCount-t.length):o=e/(this.panesCount-n.length),this.panes.forEach((a,i)=>{if(e>0&&!t.includes(a.id)){const s=Math.max(Math.min(a.size+o,a.max),a.min),l=s-a.size;e-=l,a.size=s}else if(!n.includes(a.id)){const s=Math.max(Math.min(a.size+o,a.max),a.min),l=s-a.size;e-=l,a.size=s}a.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[a.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,n)=>{t.ondblclick=e?o=>this.onSplitterDblClick(o,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return r.h("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},r$e=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},o$e={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function a$e(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>i.onPaneClick(s,e._.uid)),style:r.normalizeStyle(e.style)},[r.renderSlot(e.$slots,"default")],4)}const i$e={name:"CustomSplitter",components:{Splitpanes:n$e,Pane:r$e(o$e,[["render",a$e]]),ResizeSensor:$V},props:{index:{type:String,default:function(){return"split-1"}}},methods:{requestStylesUpdate:function(e){if(this.$refs&&e in this.$refs&&this.$refs[e]&&this.$refs[e][0]&&this.$refs[e][0].$el){const n=this.$refs[e][0].$el.getBoundingClientRect();$e.emit("PaneResize",{refName:e,rect:n})}},calculateStyles:function(e){this.$refs&&(e.startsWith("pane")?this.requestStylesUpdate(e):e.startsWith("split")&&this.customLayout[e].children.forEach(t=>{t.startsWith("pane")&&this.requestStylesUpdate(t)}))},childUnmounted:function(e){$e.emit("PaneUnmounted",{refName:e})}},computed:{...Mt.mapStores(Ss),children(){return this.customLayout[this.index].children},customLayout(){return this.splitFlowStore.customLayout},isHorizontal(){return this.customLayout[this.index].horizontal}}},s$e={style:{height:"100%",width:"100%"}};function l$e(e,t,n,o,a,i){const s=$V,l=r.resolveComponent("custom-splitter",!0),c=r.resolveComponent("pane"),d=r.resolveComponent("splitpanes");return r.openBlock(),r.createElementBlock("div",s$e,[r.createVNode(s,{onResize:t[0]||(t[0]=u=>i.calculateStyles(n.index))}),r.createVNode(d,{class:"default-theme",horizontal:i.isHorizontal,"dbl-click-splitter":!1},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.children,u=>(r.openBlock(),r.createBlock(c,{key:u,ref_for:!0,ref:u,onVnodeBeforeUnmount:f=>i.childUnmounted(u)},{default:r.withCtx(()=>[i.customLayout[u].content?(r.openBlock(),r.createBlock(s,{key:0,onResize:f=>i.calculateStyles(u)},null,8,["onResize"])):(r.openBlock(),r.createBlock(l,{key:u,index:u},null,8,["index"]))]),_:2},1032,["onVnodeBeforeUnmount"]))),128))]),_:1},8,["horizontal"])])}const FV=tr(i$e,[["render",l$e],["__scopeId","data-v-0667e71f"]]),AV=Mt.defineStore("connectivities",{state:()=>({activeConnectivityKeys:[],globalConnectivities:{},filterOptions:{},filterSources:{}}),getters:{getUniqueConnectivitiesByKeys:e=>{const t=e.activeConnectivityKeys.reduce((n,o)=>{const a=e.globalConnectivities[o];if(!a)return n;for(const i of a){const s=i.id;n[s]=n[s]?{...n[s],...i}:{...i}}return n},{});return Object.values(t).sort((n,o)=>n.label.localeCompare(o.label))},getUniqueFilterOptionsByKeys:e=>{const t=e.activeConnectivityKeys.reduce((n,o)=>{const a=e.filterOptions[o];if(!a)return n;for(const i of a)if(n[i.key]){const s=[...n[i.key].children,...i.children],l=Array.from(new Map(s.map(c=>[c.key,c])).values());n[i.key].children=l}else n[i.key]={...i};return n},{});return Object.values(t)},getUniqueFilterSourcesByKeys:e=>e.activeConnectivityKeys.reduce((n,o)=>{const a=e.filterSources[o];if(!a)return n;for(const[i,s]of Object.entries(a)){n[i]||(n[i]={});for(const[l,c]of Object.entries(s))n[i][l]=n[i][l]?Array.from(new Set([...n[i][l],...c])):[...c]}return n},{})},actions:{updateActiveConnectivityKeys(e){this.activeConnectivityKeys=e},updateGlobalConnectivities(e){this.globalConnectivities=e},updateFilterOptions(e){this.filterOptions=e},updateFilterSources(e){this.filterSources=e}}}),c$e={name:"SplitDialog",components:{ContentVuer:EV,CustomSplitter:FV},props:{entries:{type:Array,default:function(){return[]}}},data:function(){return{styles:{},query:"",filter:[]}},methods:{resourceSelected:function(e){this.$emit("resource-selected",e)},speciesChanged:function(e){this.$emit("species-changed",e)},getClass:function(e){return this.isIdVisible(e)?this.getRefsName(e):"inactive"},getRefsName:function(e){const t=this.splitFlowStore.getPaneNameById(e);return t&&(t in this.styles||(this.styles[t]={})),t},getStyle:function(e){const t=this.getRefsName(e);return t&&t in this.styles&&this.styles[t]?this.styles[t]:{}},getActiveContents:function(){const e=[],t=this.$refs.content;return t&&t.forEach(n=>{n.isVisible()&&e.push(n)}),e},isIdVisible:function(e){return this.splitFlowStore.getPaneNameById(e)!==void 0},getContentsWithId:function(e){let t=this.$refs.content;for(let n=0;n<t.length;n++)if(t[n].getId()==e)return t[n]},getContentsState:function(){let e=[],t=this.$refs.content;for(let n=0;n<t.length;n++)e.push(t[n].getState());return e},setStyles:function(e,t){if(this.$refs&&this.$refs.tabContainer){const n=this.$refs.tabContainer.getBoundingClientRect(),o={};o.width=`${t.width}px`,o.left=`${t.left-n.left}px`,o.height=`${t.height}px`,o.top=`${t.top-n.top}px`,o.display="block",this.styles[e]=o}},hidePane:function(e){if(this.$refs&&"tabContainer"in this.$refs){const t={};t.display="none",this.styles[e]=t}},resize:function(){this.__userResize__=!0},resized:function(e,t){this.__userResize__&&this.splitFlowStore.setSplitter({name:e,value:t[0].size}),this.__userResize__=!1},onSpeciesLayoutConnectivityUpdate:function(){let e=this.splitFlowStore.getActivePaneIds();const t=[307,"307"],n=Object.keys(this.connectivitiesStore.globalConnectivities).find(a=>a.includes("sckan")),o=Array.from(new Set(this.entries.filter(a=>e.includes(a.id)&&(a.uuid&&(a.type==="Flatmap"||a.type==="MultiFlatmap")||a.type==="Scaffold"&&a.resource&&(a.isBodyScaffold||t.includes(a.discoverId)))).map(a=>{if(a.type==="Flatmap"||a.type==="MultiFlatmap")return a.uuid;if(a.type==="Scaffold")return a.resource})));if(o.length){this.connectivitiesStore.updateActiveConnectivityKeys(o);const a=this.connectivitiesStore.getUniqueFilterOptionsByKeys;$e.emit("connectivity-filter-options",a)}else{const a=this.connectivitiesStore.globalConnectivities[n]||[];$e.emit("connectivity-knowledge",{data:a,highlight:[],processed:!1}),$e.emit("connectivity-filter-options",[]),this.connectivitiesStore.updateActiveConnectivityKeys([n])}},getGeneralSearchedId:function(e,t,n="query"){const o=[];return e.forEach(a=>{let i=[JSON.stringify(a["nerve-label"])];(n="query")&&(i=[...i,a.id,a.label,a["long-label"],JSON.stringify(a.nerves)]),i.some(l=>l==null?void 0:l.toLowerCase().includes(t.toLowerCase()))&&!o.includes(a.id)&&o.push(a.id)}),o},getFlatmapSearchedId:function(e,t){const n=[],o=e.mapImp.search(t);return(o.__featureIds||o.featureIds).forEach(i=>{const s=e.mapImp.annotation(i);[s.id,s.name,s.label,s.models,s.source].some(d=>d&&d.toLowerCase().includes(t.toLowerCase()))&&s.models&&!n.includes(s.models)&&n.push(s.models)}),n},getLatestFlatmapUUID:async function(e,t){return(await(await fetch(e)).json()).filter(s=>s.id===t).sort((s,l)=>l.created.localeCompare(s.created))[0].uuid},connectivityQueryFilter:async function(e){this.query="",this.filter=[];const t=this.getActiveContents(),n=this.settingsStore.flatmapAPI,o=[],a=[];let i=[],s=!1,l=[],c=[],d="";const u=this.connectivitiesStore.getUniqueFilterOptionsByKeys,f=this.connectivitiesStore.getUniqueFilterSourcesByKeys;let p=this.connectivitiesStore.getUniqueConnectivitiesByKeys;for(const b of t){const x=b.$refs.viewer;if(x){const w=x.$refs.multiflatmap,k=x.$refs.flatmap,C=x.$refs.scaffold,S=x.$refs.iframe,E=x.$refs.plot,_=x.$refs.simulation;let $=null;if(w){const F=w.getCurrentFlatmap();F&&F.mapImp&&($=F,d=$.mapImp.uuid)}else k&&k.mapImp?($=k,d=$.mapImp.uuid):($=C||S||E||_,d=await this.getLatestFlatmapUUID(n,"human-flatmap_male"));const A=k||w;if(e){if(this.query=e.query,e.query){const B=this.query.replace(/["']/g,"").split(",").map(V=>V.trim()).filter(V=>V),I=[];for(let V=0;V<B.length;V++)A?I.push(this.getFlatmapSearchedId($,B[V])):I.push(this.getGeneralSearchedId(p,B[V],"query"));const R=[...new Set(I.flat())];if(R.length){o.push(...R);const V=A?await e9(n,d,R):R;l.push(...V)}}const F={origins:[],vias:[],destinations:[],all:[]};let N={};if(C&&x.syncFilter(e.filter),e.filter.forEach(B=>{var V,Y;const I=B.facetPropPath.split(".").pop(),R=B.facetPropPath.includes("flatmap.connectivity.source");if(R&&((V=B.facet)==null?void 0:V.toLowerCase())!=="show all"){const W=B.facet.replace(",[",", ["),Q=B.facetPropPath.split(".").pop();if(Q==="origin")F.origins.push(W);else if(Q==="destination")F.destinations.push(W);else if(Q==="via")F.vias.push(W);else{const re=JSON.parse(W).flat(1/0);F.all.push(...re)}}if(C)!R&&((Y=B.facet)==null?void 0:Y.toLowerCase())!=="show all"&&(I in N||(N[I]=[]),N[I].push(...this.getGeneralSearchedId(p,B.facet,"facet")));else if(A&&!R){const W=u.find(Q=>Q.key.includes(I));W&&W.children.forEach(Q=>{if(Q.label===B.facet&&Q.key){const re=Q.key.split(".").pop();I in N||(N[I]=[]),N[I].push(...f[I][re])}})}}),F.origins.length||F.destinations.length||F.vias.length){const B={flatmapAPI:n,knowledgeSource:d,origins:F.origins,destinations:F.destinations,vias:F.vias};"ovd"in N||(N.ovd=[]),N.ovd.push(...await JSe(B))}else F.all.length&&("all"in N||(N.all=[]),N.all.push(...await e9(n,d,F.all)));const M=Object.values(N);this.filter=[...this.filter,...M];const L=this.filter.length?this.filter.reduce((B,I)=>B.filter(R=>I.includes(R))):[];c.push(...L)}}}let m;this.query&&!this.filter.length?m=l:!this.query&&this.filter.length?m=c:this.query&&this.filter.length&&(m=l.filter(b=>c.includes(b))),m&&(i.push(...m),p=p.filter(b=>m.includes(b.id)),s=!0),a.push(...p);const h=[...new Set(o)],g=[...new Set(i)];let v=Array.from(new Map(a.map(b=>[b.id,b])).values());v=[...v.filter(b=>h.includes(b.id)),...v.filter(b=>!h.includes(b.id))];const y={data:v,highlight:g,processed:s};$e.emit("connectivity-knowledge",y)}},computed:{...Mt.mapStores(Ss,AV,vi),horizontal(){return this.splitFlowStore.activeView==="2horpanel"},splitters(){return this.splitFlowStore.splitters}},mounted:function(){$e.on("PaneResize",e=>{this.setStyles(e.refName,e.rect)}),$e.on("PaneUnmounted",e=>{this.hidePane(e.refName)}),$e.on("species-layout-connectivity-update",()=>{this.onSpeciesLayoutConnectivityUpdate()}),$e.on("connectivity-query-filter",e=>{this.connectivityQueryFilter(e)}),$e.on("hoverUpdate",e=>{this.getActiveContents().forEach(n=>{n.onHoverUpdate(e)})}),$e.on("startHelp",()=>{this.getActiveContents().forEach(t=>{t.onStartHelp()})}),$e.on("connectivity-item-close",()=>{this.getActiveContents().forEach(t=>{t.onConnectivityItemClose()})}),$e.on("sidebar-annotation-close",()=>{this.getActiveContents().forEach(t=>{t.onSidebarAnnotationClose()})}),$e.on("globalViewerSettingsUpdate",()=>{this.$refs.content.forEach(t=>{t.onGlobalViewerSettingsUpdate()})}),$e.on("markerUpdate",()=>{this.$refs.content.forEach(t=>{t.onFlatmapMarkerUpdate()})}),$e.on("connectivity-hovered",e=>{this.getActiveContents().forEach(n=>{n.onShowConnectivityTooltips(e)})}),$e.on("connectivity-source-change",e=>{this.getActiveContents().forEach(n=>{n.onConnectivitySourceChange(e)})}),$e.on("show-connectivity",e=>{this.getActiveContents().forEach(n=>{n.onShowConnectivity(e)})}),$e.on("show-reference-connectivities",e=>{this.getActiveContents().forEach(n=>{n.onShowReferenceConnectivity(e)})}),$e.on("filter-visibility",e=>{this.getActiveContents().forEach(n=>{n.onFilterVisibility(e)})})}},d$e={class:"tab-container",ref:"tabContainer"};function u$e(e,t,n,o,a,i){const s=FV,l=EV;return r.openBlock(),r.createElementBlock("div",d$e,[r.createVNode(s,{index:"split-1",key:"split-1"}),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.entries,c=>(r.openBlock(),r.createElementBlock("div",{key:c.id,style:r.normalizeStyle(i.getStyle(c.id)),class:r.normalizeClass([i.getClass(c.id),"contentvuer"])},[(r.openBlock(),r.createBlock(l,{key:c.id,entry:c,ref_for:!0,ref:"content",onResourceSelected:i.resourceSelected,onSpeciesChanged:i.speciesChanged,visible:i.isIdVisible(c.id)},null,8,["entry","onResourceSelected","onSpeciesChanged","visible"]))],6))),128))],512)}const TV=tr(c$e,[["render",u$e],["__scopeId","data-v-6ae338da"]]),f$e={name:"SearchControls",props:{failedSearch:void 0},components:{Autocomplete:JF,MapSvgIcon:MS},methods:{fetchSuggestions:function(e,t){e===""?t([]):this.$emit("fetch-suggestions",{term:e,cb:t})}},data:function(){return{searchText:""}}},p$e=e=>(r.pushScopeId("data-v-eb3db1ae"),e=e(),r.popScopeId(),e),h$e={class:"search-container"},m$e=p$e(()=>r.createElementVNode("div",{class:"text search-text"}," Search within display ",-1)),g$e={key:0,class:"text not-found-text"};function y$e(e,t,n,o,a,i){const s=JF,l=r.resolveComponent("map-svg-icon");return r.openBlock(),r.createElementBlock("div",h$e,[m$e,r.createVNode(s,{class:"search-box",placeholder:"Search",modelValue:e.searchText,"onUpdate:modelValue":t[0]||(t[0]=c=>e.searchText=c),"fetch-suggestions":i.fetchSuggestions,onKeyup:t[1]||(t[1]=r.withKeys(c=>e.$emit("search",e.searchText),["enter"])),onSelect:t[2]||(t[2]=c=>e.$emit("search",c.value)),teleported:!1,"popper-class":"autocomplete-popper"},null,8,["modelValue","fetch-suggestions"]),r.createVNode(l,{icon:"magnifyingGlass",class:"magnify",onClick:t[3]||(t[3]=c=>e.$emit("search",e.searchText))}),n.failedSearch?(r.openBlock(),r.createElementBlock("div",g$e," '"+r.toDisplayString(n.failedSearch)+"' not found ",1)):r.createCommentVNode("",!0)])}const BV=tr(f$e,[["render",y$e],["__scopeId","data-v-eb3db1ae"]]),v$e={name:"DialogToolbarContent",components:{Button:wu,Checkbox:f3,Col:k3,Icon:Un,Input:ph,Popover:Eh,Radio:b3,RadioGroup:w3,Row:xh,MapSvgIcon:MS,MapSvgSpriteColor:yV,SearchControls:BV,ElIconCopyDocument:Y1},props:{numberOfEntries:{type:Number,default:0},showIcons:{type:Boolean,default:!1}},inject:["showGlobalSettings"],computed:{...Mt.mapStores(Mf,vi,Ss),activeView(){return this.splitFlowStore.activeView},helpDelay(){return this.settingsStore.helpDelay},shareLink(){return this.settingsStore.shareLink},offlineAnnotationEnabled(){return this.settingsStore.offlineAnnotationEnabled},viewIcons(){return this.splitFlowStore.viewIcons}},watch:{shareLink:function(){this.loadingLink=!1}},data:function(){return{activeViewRef:void 0,displayShareOptions:!1,ElIconCopyDocument:r.shallowRef(Y1),exportAnnotation:!1,failedSearch:void 0,globalSettings:{},globalSettingRef:void 0,isFullscreen:!1,loadingLink:!0,permalinkRef:void 0,viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover neuron connections by selecting a feature and viewing its associated network connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},authorisedUser:!1,mapLoaded:!1}},methods:{loadGlobalSettings:function(){this.globalSettings={...this.globalSettings,...this.settingsStore.globalSettings}},updateViewingMode:function(e,t){const{target:n}=e;n.closest(".el-checkbox")||(this.globalSettings.viewingMode=t,t==="Exploration"?(this.globalSettings.displayMarkers=!0,this.globalSettings.interactiveMode="dataset"):t==="Annotation"?(this.globalSettings.displayMarkers=!1,this.globalSettings.interactiveMode="dataset"):(this.globalSettings.displayMarkers=!1,this.globalSettings.interactiveMode="connectivity"),this.updateGlobalSettings("viewingMode"))},updateGlobalSettings:function(e){const t=this.settingsStore.getUpdatedGlobalSettingsKey(this.globalSettings);this.settingsStore.updateGlobalSettings(this.globalSettings),t.includes("displayMarkers")&&$e.emit("markerUpdate"),t.includes("interactiveMode")&&$e.emit("modeUpdate",this.globalSettings.interactiveMode),(t.includes("viewingMode")||t.includes("connectionType")||t.includes("flightPathDisplay")||t.includes("organsDisplay")||t.includes("outlinesDisplay")||t.includes("backgroundDisplay"))&&$e.emit("globalViewerSettingsUpdate");let n=this.globalSettings[e];e==="flightPathDisplay"&&(n=this.globalSettings.flightPathDisplay?"3D":"2D"),e==="organsDisplay"&&(n=this.globalSettings.organsDisplay?"Color":"Grayscale"),e==="outlinesDisplay"&&(n=this.globalSettings.outlinesDisplay?"Show":"Hide"),t.length&&Tt.sendEvent({event:"interaction_event",event_name:`portal_maps_settings_${e}`,category:n,location:"map_toolbar"})},titleClicked:function(e){this.$emit("titleClicked",e)},startHelp:function(){$e.emit("startHelp"),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_help",category:"help_mode_start",location:"map_toolbar"})},onFullscreen:function(){this.$emit("onFullscreen"),this.isFullscreen=!this.isFullscreen,this.isFullscreen&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_fullscreen",category:this.isFullscreen?"enter":"exit",location:"map_toolbar"})},onFullscreenEsc:function(){document.fullscreenElement||(this.isFullscreen=!1,Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_fullscreen",category:this.isFullscreen?"enter":"exit",location:"map_toolbar"}))},close:function(){this.$emit("close")},copyShareLink:function(){document&&(this.$refs.linkInput.$el.querySelector("input").select(),document.execCommand("copy"),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_permalink",category:"permalink_copy",location:"map_toolbar"}))},setFailedSearch:function(e){this.failedSearch=e},requestShareLink:function(){sessionStorage.getItem("anonymous-annotation")?this.displayShareOptions=!0:this.getShareLink(!1)},getShareLink:function(e){this.displayShareOptions=!1,this.loadingLink=!0,$e.emit("updateShareLinkRequested",e),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_permalink",category:"permalink_generate",location:"map_toolbar"})},viewClicked:function(e){const t=this.activeView;if(this.splitFlowStore.updateActiveView({view:e,entries:this.entriesStore.entries}),e!==t){const n=this.viewIcons.find(o=>o.icon===e);Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_split_view",category:(n==null?void 0:n.name)||"",location:"map_toolbar"})}this.$refs.viewPopover&&this.$refs.viewPopover.hide()}},mounted:function(){this.activeViewRef=r.shallowRef(this.$refs.activeViewRef),this.permalinkRef=r.shallowRef(this.$refs.permalinkRef),this.globalSettingRef=r.shallowRef(this.$refs.globalSettingRef),$e.on("mapLoaded",e=>{this.mapLoaded=!0}),document.addEventListener("fullscreenchange",this.onFullscreenEsc),this.loadGlobalSettings()},unmounted:function(){document.removeEventListener("fullscreenchange",this.onFullscreenEsc)}},ea=e=>(r.pushScopeId("data-v-1cc10ca9"),e=e(),r.popScopeId(),e),b$e={class:"header"},w$e={class:"viewing-mode-selector"},x$e={class:"el-dropdown-link"},k$e={class:"toolbar-dropdown-badge"},C$e=ea(()=>r.createElementVNode("h4",null,"Viewing Mode:",-1)),S$e={class:"el-option__description"},E$e={key:0,class:"setting-popover-block"},_$e={class:"el-radio__description"},$$e={key:0},F$e={key:1},A$e={key:2},T$e={key:3},B$e=ea(()=>r.createElementVNode("br",null,null,-1)),N$e=ea(()=>r.createElementVNode("br",null,null,-1)),M$e={class:"setting-popover-inner"},O$e=ea(()=>r.createElementVNode("h4",null,"Display options:",-1)),L$e={key:0,class:"setting-popover-block"},I$e=ea(()=>r.createElementVNode("h5",null,"Flight path",-1)),R$e={key:1,class:"setting-popover-block"},P$e=ea(()=>r.createElementVNode("h5",null,"Organs",-1)),V$e={key:2,class:"setting-popover-block"},D$e=ea(()=>r.createElementVNode("h5",null,"Apply outlines",-1)),z$e={key:3,class:"setting-popover-block"},j$e=ea(()=>r.createElementVNode("h5",null,"Background color",-1)),H$e=ea(()=>r.createElementVNode("span",{style:{"--bg-color":"white"}},"white",-1)),U$e=ea(()=>r.createElementVNode("span",{style:{"--bg-color":"lightskyblue"}},"lightskyblue",-1)),q$e=ea(()=>r.createElementVNode("span",{style:{"--bg-color":"black"}},"black",-1));function K$e(e,t,n,o,a,i){const s=r.resolveComponent("map-svg-sprite-color"),l=BV,c=RJ,d=Un,u=aZ,f=qJ,p=lo,m=kne,h=w3,g=eoe,v=toe,y=Qre,b=r.resolveComponent("map-svg-icon"),x=k3,w=xh,k=Eh,C=wu,S=f3,E=ph,_=b3,$=Q1,A=wc;return r.openBlock(),r.createElementBlock("div",b$e,[r.createVNode(s),r.createVNode(l,{onSearch:t[0]||(t[0]=F=>{e.$emit("local-search",{term:F})}),onFetchSuggestions:t[1]||(t[1]=F=>{e.$emit("fetch-suggestions",{data:F})}),failedSearch:e.failedSearch},null,8,["failedSearch"]),r.createVNode(w,{class:"icon-group"},{default:r.withCtx(()=>[r.createElementVNode("div",w$e,[r.createTextVNode(" Viewing Mode: "),r.createVNode(y,{teleported:!1,trigger:"hover",class:"toolbar-dropdown","popper-class":"toolbar-dropdown-popper","hide-on-click":!1,disabled:!e.mapLoaded,placement:"bottom-end"},{dropdown:r.withCtx(()=>[C$e,r.createVNode(v,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.viewingModes,(F,N,M)=>(r.openBlock(),r.createBlock(g,{key:N,onClick:L=>i.updateViewingMode(L,N),class:r.normalizeClass({"is-selected":e.globalSettings.viewingMode===N})},{default:r.withCtx(()=>[r.createElementVNode("h5",null,[N==="Exploration"?(r.openBlock(),r.createBlock(d,{key:0,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(c)]),_:1})):r.createCommentVNode("",!0),N==="Neuron Connection"?(r.openBlock(),r.createBlock(d,{key:1,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(u)]),_:1})):r.createCommentVNode("",!0),N==="Annotation"?(r.openBlock(),r.createBlock(d,{key:2,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(f)]),_:1})):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(N),1)]),r.createElementVNode("small",S$e,[N==="Annotation"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[e.authorisedUser?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(F[1]),1)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(F[0]),1)],64)),i.offlineAnnotationEnabled?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createTextVNode(" (Anonymous annotate) ")],64)):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(F),1)],64))]),N==="Neuron Connection"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},["connectionType"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",E$e,[r.createVNode(h,{modelValue:e.globalSettings.connectionType,"onUpdate:modelValue":t[2]||(t[2]=L=>e.globalSettings.connectionType=L),onChange:t[3]||(t[3]=L=>i.updateGlobalSettings("connectionType"))},{default:r.withCtx(()=>[r.createVNode(m,{value:"Origin",size:"small"},{default:r.withCtx(()=>[r.createTextVNode("Origin")]),_:1}),r.createVNode(m,{value:"Via",size:"small"},{default:r.withCtx(()=>[r.createTextVNode("Via")]),_:1}),r.createVNode(m,{value:"Destination",size:"small"},{default:r.withCtx(()=>[r.createTextVNode("Destination")]),_:1}),r.createVNode(m,{value:"All",size:"small"},{default:r.withCtx(()=>[r.createTextVNode("All")]),_:1})]),_:1},8,["modelValue"]),r.createElementVNode("div",_$e,[e.globalSettings.connectionType==="Origin"?(r.openBlock(),r.createElementBlock("small",$$e," Neuron populations beginning at a location. ")):e.globalSettings.connectionType==="Via"?(r.openBlock(),r.createElementBlock("small",F$e," Neuron populations that run through a location. ")):e.globalSettings.connectionType==="Destination"?(r.openBlock(),r.createElementBlock("small",A$e," Neuron populations terminating at a location. ")):(r.openBlock(),r.createElementBlock("small",T$e," Neuron populations associated with a location (or) Neuron populations that share at least one edge with another neuron population. "))])])):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0)]),_:2},1032,["onClick","class"]))),128))]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("span",x$e,[e.globalSettings.viewingMode==="Exploration"?(r.openBlock(),r.createBlock(d,{key:0,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(c)]),_:1})):r.createCommentVNode("",!0),e.globalSettings.viewingMode==="Neuron Connection"?(r.openBlock(),r.createBlock(d,{key:1,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(u)]),_:1})):r.createCommentVNode("",!0),e.globalSettings.viewingMode==="Annotation"?(r.openBlock(),r.createBlock(d,{key:2,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(f)]),_:1})):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(e.globalSettings.viewingMode)+" ",1),e.globalSettings.viewingMode==="Neuron Connection"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:3},[r.createTextVNode(" "),r.createElementVNode("small",k$e,[r.createElementVNode("em",null,r.toDisplayString(e.globalSettings.connectionType),1)])],64)):r.createCommentVNode("",!0),r.createVNode(d,{class:"el-icon--right"},{default:r.withCtx(()=>[r.createVNode(p)]),_:1})])]),_:1},8,["disabled"])]),e.activeViewRef?(r.openBlock(),r.createBlock(k,{key:0,"virtual-ref":e.activeViewRef,ref:"viewPopover",placement:"bottom",width:"133",teleported:!1,trigger:"click","popper-class":"view-icon-popover","virtual-triggering":""},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.viewIcons,F=>(r.openBlock(),r.createBlock(w,{gutter:20,key:F.name,class:r.normalizeClass([{active:F.icon==i.activeView},{disabled:F.min>n.numberOfEntries},"view-icon-row"]),onClick:N=>i.viewClicked(F.icon)},{default:r.withCtx(()=>[r.createVNode(x,{span:4},{default:r.withCtx(()=>[r.createVNode(b,{icon:F.icon,class:"view-icon"},null,8,["icon"])]),_:2},1024),r.createVNode(x,{offset:2,span:18,class:"view-text"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(F.name),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["virtual-ref"])):r.createCommentVNode("",!0),r.createVNode(k,{class:"tooltip",content:"Split screen",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.createVNode(b,{icon:i.activeView,ref:"activeViewRef",class:r.normalizeClass([{disabled:1>=n.numberOfEntries},"header-icon","splitscreen-icon"])},null,8,["icon","class"])]),_:1},8,["show-after"]),r.createVNode(k,{class:"tooltip",content:"Help",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.createVNode(b,{icon:"tooltips",class:"header-icon",onClick:t[4]||(t[4]=F=>i.startHelp())})]),_:1},8,["show-after"]),r.createVNode(k,{class:"tooltip",content:"Fullscreen",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(b,{icon:"fullScreen",class:"header-icon",onClick:i.onFullscreen},null,8,["onClick"]),[[r.vShow,!e.isFullscreen]])]),_:1},8,["show-after"]),r.createVNode(k,{class:"tooltip",content:"Exit fullscreen",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(b,{icon:"closeFullScreen",class:"header-icon",onClick:i.onFullscreen},null,8,["onClick"]),[[r.vShow,e.isFullscreen]])]),_:1},8,["show-after"]),e.permalinkRef?(r.openBlock(),r.createBlock(k,{key:1,ref:"linkPopover","virtual-ref":e.permalinkRef,placement:"bottom-end",width:"400",teleported:!1,trigger:"click","popper-class":"link-popover","virtual-triggering":""},{default:r.withCtx(()=>[e.displayShareOptions?(r.openBlock(),r.createBlock(w,{key:0},{default:r.withCtx(()=>[r.createVNode(x,{offset:3,span:8},{default:r.withCtx(()=>[r.createVNode(C,{type:"primary",size:"small",onClick:t[5]||(t[5]=F=>i.getShareLink(e.exportAnnotation)),class:"share-options"},{default:r.withCtx(()=>[r.createTextVNode(" Create Permalink ")]),_:1})]),_:1}),r.createVNode(x,{span:10},{default:r.withCtx(()=>[r.createVNode(k,{class:"tooltip",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.createVNode(S,{modelValue:e.exportAnnotation,"onUpdate:modelValue":t[6]||(t[6]=F=>e.exportAnnotation=F),size:"small"},{default:r.withCtx(()=>[r.createTextVNode(" Export Annotations ")]),_:1},8,["modelValue"])]),default:r.withCtx(()=>[r.createTextVNode(" Create a permalink with anonymous annotations. "),B$e,r.createTextVNode(" NOTE: Annotations will only be stored for "),N$e,r.createTextVNode(" 30 days on the server. ")]),_:1},8,["show-after"])]),_:1})]),_:1})):r.withDirectives((r.openBlock(),r.createBlock(w,{key:1,gutter:20,"element-loading-text":"Creating link..."},{default:r.withCtx(()=>[r.createVNode(x,{span:20},{default:r.withCtx(()=>[r.createVNode(E,{class:"link-input",size:"small",placeholder:"Permanant Link Here",readonly:!0,modelValue:i.shareLink,"onUpdate:modelValue":t[7]||(t[7]=F=>i.shareLink=F),ref:"linkInput"},null,8,["modelValue"])]),_:1}),r.createVNode(x,{span:4},{default:r.withCtx(()=>[r.createVNode(k,{class:"tooltip",content:"Copy link",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.createVNode(C,{class:"copy-button",icon:e.ElIconCopyDocument,size:"small",onClick:i.copyShareLink},null,8,["icon","onClick"])]),_:1},8,["show-after"])]),_:1})]),_:1})),[[A,e.loadingLink]])]),_:1},8,["virtual-ref"])):r.createCommentVNode("",!0),r.createVNode(k,{class:"tooltip",content:"Get permalink",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(b,{icon:"permalink",ref:"permalinkRef",class:"header-icon",onClick:i.requestShareLink},null,8,["onClick"]),[[r.vShow,i.shareLink]])]),_:1},8,["show-after"]),r.createVNode(k,{class:"tooltip",content:"Close",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(b,{icon:"close",class:"header-icon",onClick:i.close},null,8,["onClick"]),[[r.vShow,n.showIcons]])]),_:1},8,["show-after"]),e.globalSettingRef?(r.openBlock(),r.createBlock(k,{key:2,"virtual-ref":e.globalSettingRef,ref:"settingPopover",placement:"bottom",width:"230",teleported:!1,trigger:"click","popper-class":"setting-popover","virtual-triggering":"",disabled:!e.mapLoaded},{default:r.withCtx(()=>[r.createElementVNode("div",M$e,[O$e,"flightPathDisplay"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",L$e,[I$e,r.createVNode(h,{modelValue:e.globalSettings.flightPathDisplay,"onUpdate:modelValue":t[8]||(t[8]=F=>e.globalSettings.flightPathDisplay=F),onChange:t[9]||(t[9]=F=>i.updateGlobalSettings("flightPathDisplay"))},{default:r.withCtx(()=>[r.createVNode(_,{value:!1},{default:r.withCtx(()=>[r.createTextVNode("2D")]),_:1}),r.createVNode(_,{value:!0},{default:r.withCtx(()=>[r.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue"])])):r.createCommentVNode("",!0),"organsDisplay"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",R$e,[P$e,r.createVNode(h,{modelValue:e.globalSettings.organsDisplay,"onUpdate:modelValue":t[10]||(t[10]=F=>e.globalSettings.organsDisplay=F),onChange:t[11]||(t[11]=F=>i.updateGlobalSettings("organsDisplay"))},{default:r.withCtx(()=>[r.createVNode(_,{value:!0},{default:r.withCtx(()=>[r.createTextVNode("Color")]),_:1}),r.createVNode(_,{value:!1},{default:r.withCtx(()=>[r.createTextVNode("Grayscale")]),_:1})]),_:1},8,["modelValue"])])):r.createCommentVNode("",!0),"outlinesDisplay"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",V$e,[D$e,r.createVNode(h,{modelValue:e.globalSettings.outlinesDisplay,"onUpdate:modelValue":t[12]||(t[12]=F=>e.globalSettings.outlinesDisplay=F),onChange:t[13]||(t[13]=F=>i.updateGlobalSettings("outlinesDisplay"))},{default:r.withCtx(()=>[r.createVNode(_,{value:!0},{default:r.withCtx(()=>[r.createTextVNode("Show")]),_:1}),r.createVNode(_,{value:!1},{default:r.withCtx(()=>[r.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue"])])):r.createCommentVNode("",!0),"backgroundDisplay"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",z$e,[j$e,r.createVNode(h,{class:"bg-color-radio-group",modelValue:e.globalSettings.backgroundDisplay,"onUpdate:modelValue":t[14]||(t[14]=F=>e.globalSettings.backgroundDisplay=F),onChange:t[15]||(t[15]=F=>i.updateGlobalSettings("backgroundDisplay"))},{default:r.withCtx(()=>[r.createVNode(_,{value:"white",class:"bg-color-radio"},{default:r.withCtx(()=>[H$e]),_:1}),r.createVNode(_,{value:"lightskyblue",class:"bg-color-radio"},{default:r.withCtx(()=>[U$e]),_:1}),r.createVNode(_,{value:"black",class:"bg-color-radio"},{default:r.withCtx(()=>[q$e]),_:1})]),_:1},8,["modelValue"])])):r.createCommentVNode("",!0)])]),_:1},8,["virtual-ref","disabled"])):r.createCommentVNode("",!0),i.showGlobalSettings?(r.openBlock(),r.createBlock(k,{key:3,class:"tooltip",content:"Global Settings",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper",disabled:!e.mapLoaded},{reference:r.withCtx(()=>[r.createVNode(d,{ref:"globalSettingRef",disabled:!e.mapLoaded,class:r.normalizeClass(["header-icon",{disabled:!e.mapLoaded}])},{default:r.withCtx(()=>[r.createVNode($)]),_:1},8,["disabled","class"])]),_:1},8,["show-after","disabled"])):r.createCommentVNode("",!0)]),_:1})])}const NV=tr(v$e,[["render",K$e],["__scopeId","data-v-1cc10ca9"]]),MV=e=>!e.getAttribute("aria-owns"),OV=(e,t,n)=>{const{parentNode:o}=e;if(!o)return null;const a=o.querySelectorAll(n),i=Array.prototype.indexOf.call(a,e);return a[i+t]||null},Pg=e=>{e&&(e.focus(),!MV(e)&&e.click())},bn=(e,t,{checkForDefaultPrevented:n=!0}={})=>o=>{const a=e==null?void 0:e(o);if(n===!1||!a)return t==null?void 0:t(o)},LV=e=>t=>t.pointerType==="mouse"?e(t):void 0;var IV;const It=typeof window<"u",G$e=e=>typeof e=="string",RV=()=>{},VS=It&&((IV=window==null?void 0:window.navigator)==null?void 0:IV.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Lf(e){return typeof e=="function"?e():r.unref(e)}function W$e(e){return e}function If(e){return r.getCurrentScope()?(r.onScopeDispose(e),!0):!1}function X$e(e,t=!0){r.getCurrentInstance()?r.onMounted(e):t?e():r.nextTick(e)}function DS(e,t,n={}){const{immediate:o=!0}=n,a=r.ref(!1);let i=null;function s(){i&&(clearTimeout(i),i=null)}function l(){a.value=!1,s()}function c(...d){s(),a.value=!0,i=setTimeout(()=>{a.value=!1,i=null,e(...d)},Lf(t))}return o&&(a.value=!0,It&&c()),If(l),{isPending:r.readonly(a),start:c,stop:l}}function Ba(e){var t;const n=Lf(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Rf=It?window:void 0;function Qr(...e){let t,n,o,a;if(G$e(e[0])||Array.isArray(e[0])?([n,o,a]=e,t=Rf):[t,n,o,a]=e,!t)return RV;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(u=>u()),i.length=0},l=(u,f,p,m)=>(u.addEventListener(f,p,m),()=>u.removeEventListener(f,p,m)),c=r.watch(()=>[Ba(t),Lf(a)],([u,f])=>{s(),u&&i.push(...n.flatMap(p=>o.map(m=>l(u,p,m,f))))},{immediate:!0,flush:"post"}),d=()=>{c(),s()};return If(d),d}let PV=!1;function Y$e(e,t,n={}){const{window:o=Rf,ignore:a=[],capture:i=!0,detectIframe:s=!1}=n;if(!o)return;VS&&!PV&&(PV=!0,Array.from(o.document.body.children).forEach(u=>u.addEventListener("click",RV)));let l=!0;const c=u=>a.some(f=>{if(typeof f=="string")return Array.from(o.document.querySelectorAll(f)).some(p=>p===u.target||u.composedPath().includes(p));{const p=Ba(f);return p&&(u.target===p||u.composedPath().includes(p))}}),d=[Qr(o,"click",u=>{const f=Ba(e);if(!(!f||f===u.target||u.composedPath().includes(f))){if(u.detail===0&&(l=!c(u)),!l){l=!0;return}t(u)}},{passive:!0,capture:i}),Qr(o,"pointerdown",u=>{const f=Ba(e);f&&(l=!u.composedPath().includes(f)&&!c(u))},{passive:!0}),s&&Qr(o,"blur",u=>{var f;const p=Ba(e);((f=o.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!(p!=null&&p.contains(o.document.activeElement))&&t(u)})].filter(Boolean);return()=>d.forEach(u=>u())}function VV(e,t=!1){const n=r.ref(),o=()=>n.value=!!e();return o(),X$e(o,t),n}const DV=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},zV="__vueuse_ssr_handlers__";DV[zV]=DV[zV]||{};function J$e(e,t,{window:n=Rf,initialValue:o=""}={}){const a=r.ref(o),i=r.computed(()=>{var s;return Ba(t)||((s=n==null?void 0:n.document)==null?void 0:s.documentElement)});return r.watch([i,()=>Lf(e)],([s,l])=>{var c;if(s&&n){const d=(c=n.getComputedStyle(s).getPropertyValue(l))==null?void 0:c.trim();a.value=d||o}},{immediate:!0}),r.watch(a,s=>{var l;(l=i.value)!=null&&l.style&&i.value.style.setProperty(Lf(e),s)}),a}var jV=Object.getOwnPropertySymbols,Z$e=Object.prototype.hasOwnProperty,Q$e=Object.prototype.propertyIsEnumerable,eFe=(e,t)=>{var n={};for(var o in e)Z$e.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&jV)for(var o of jV(e))t.indexOf(o)<0&&Q$e.call(e,o)&&(n[o]=e[o]);return n};function ta(e,t,n={}){const o=n,{window:a=Rf}=o,i=eFe(o,["window"]);let s;const l=VV(()=>a&&"ResizeObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},d=r.watch(()=>Ba(e),f=>{c(),l.value&&a&&f&&(s=new ResizeObserver(t),s.observe(f,i))},{immediate:!0,flush:"post"}),u=()=>{c(),d()};return If(u),{isSupported:l,stop:u}}var HV=Object.getOwnPropertySymbols,tFe=Object.prototype.hasOwnProperty,nFe=Object.prototype.propertyIsEnumerable,rFe=(e,t)=>{var n={};for(var o in e)tFe.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&HV)for(var o of HV(e))t.indexOf(o)<0&&nFe.call(e,o)&&(n[o]=e[o]);return n};function oFe(e,t,n={}){const o=n,{window:a=Rf}=o,i=rFe(o,["window"]);let s;const l=VV(()=>a&&"MutationObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},d=r.watch(()=>Ba(e),f=>{c(),l.value&&a&&f&&(s=new MutationObserver(t),s.observe(f,i))},{immediate:!0}),u=()=>{c(),d()};return If(u),{isSupported:l,stop:u}}var UV;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(UV||(UV={}));var aFe=Object.defineProperty,qV=Object.getOwnPropertySymbols,iFe=Object.prototype.hasOwnProperty,sFe=Object.prototype.propertyIsEnumerable,KV=(e,t,n)=>t in e?aFe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lFe=(e,t)=>{for(var n in t||(t={}))iFe.call(t,n)&&KV(e,n,t[n]);if(qV)for(var n of qV(t))sFe.call(t,n)&&KV(e,n,t[n]);return e};lFe({linear:W$e},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const cFe=()=>It&&/firefox/i.test(window.navigator.userAgent);/**
|
|
976
|
+
order by source desc`;N5e();const a=sessionStorage.getItem("flatmap-knowledge"),i=sessionStorage.getItem("flatmap-knowledge-source");if(!a||i!==n){const l=(await t.queryKnowledge(o)).map(c=>JSON.parse(c));return sessionStorage.setItem("flatmap-knowledge",JSON.stringify(l)),sessionStorage.setItem("flatmap-knowledge-source",n),T5e(),l}return JSON.parse(a)}function T5e(){const n=new Date().getTime()+864e5;sessionStorage.setItem("flatmap-knowledge-expiry",n)}function B5e(){["flatmap-knowledge","flatmap-knowledge-expiry","flatmap-knowledge-source"].forEach(t=>{sessionStorage.removeItem(t)})}function N5e(){const e=sessionStorage.getItem("flatmap-knowledge-expiry");new Date().getTime()>e&&B5e()}const Mf=Mt.defineStore("entries",{state:()=>IS(),getters:{findIndexOfId:e=>t=>{for(let n=0;n<e.entries.length;n++)if(e.entries[n].id==t)return n;return-1}},actions:{addNewEntry(e){this.entries.push(e)},destroyEntry(e){e>-1&&this.entries.splice(e,1)},setAll(e){this.entries=[],Object.assign(this.entries,e)},updateViewForEntry({id:e,viewUrl:t}){const n=this.entries.find(o=>o.id===e);n.viewUrl=t},updateMapForEntry(e,t){if(e.id===t.id){const n=wV(t.prov);e.uuid=t.prov.uuid,e.sckanVersion=n}},updateLabelForEntry(e,t){const n=this.entries.find(o=>o.id===e.id);n&&(n.label=t)},updateTitleForEntry(e,t){const n=this.entries.find(o=>o.id===e.id);n&&(n.title=t)}}}),Of=[{id:"ilxtr:neuron-type-keast-13",centrelines:["n_71"]},{id:"ilxtr:neuron-type-keast-2",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-3",centrelines:["bladder_n","hypogastric_n"]},{id:"ilxtr:neuron-type-keast-15",centrelines:["n_73"]},{id:"ilxtr:neuron-type-keast-1",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-7",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-9",centrelines:["L6_spinal_n-1","L6_ventral_root","pudendal_n","L5_spinal_n","L5_ventral_root"]},{id:"ilxtr:neuron-type-keast-10",centrelines:["S1_dorsal_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_dorsal_root","bladder_n"]},{id:"ilxtr:neuron-type-keast-11",centrelines:["lumbar_splanchnic_n","L2_spinal_n","L1_spinal_n-1","hypogastric_n","bladder_n","L1_dorsal_root","L2_dorsal_root"]},{id:"ilxtr:neuron-type-keast-12",centrelines:["L6_spinal_n-1","L6_dorsal_root","pudendal_n","S1_spinal_n-1","S1_dorsal_root"]},{id:"ilxtr:neuron-type-keast-8",centrelines:["L1_ventral_root_paravertebral_ganglion","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","L2_ventral_root_paravertebral_ganglion","sympathetic_trunk_L2-L3","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_L5-L6","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-20",centrelines:["T1_T2_cns","C8_T1_cns","T2_T3_cns","T10_T11_cns","T9_T10_cns","T11_T12_cns","T8_T9_cns","C7_C8_cns","C6_C7_cns","C4_C5_cns","C3_C4_cns","C5_C6_cns","medulla_C1_cns","pons_medulla_cns","C1_C2_cns","T5_T6_cns","T4_T5_cns","T6_T7_cns","L3_L4_cns","L2_L3_cns","L4_L5_cns","L5_L6_cns","T13_L1_cns","T12_T13_cns","L1_L2_cns","T3_T4_cns","n_69","C2_C3_cns","T7_T8_cns"]},{id:"ilxtr:neuron-type-keast-16",centrelines:["n_74"]},{id:"ilxtr:neuron-type-keast-4",centrelines:["sympathetic_trunk_L6-S1","L6_gray_ramus-spinal_n","sympathetic_trunk_L5-L6","S1_gray_ramus-spinal_n","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","sympathetic_trunk_L2-L3","bladder_n","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-17",centrelines:["n_75"]},{id:"ilxtr:neuron-type-keast-5",centrelines:["S1_ventral_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_ventral_root"]},{id:"ilxtr:neuron-type-keast-18",centrelines:["n_70"]},{id:"ilxtr:neuron-type-keast-6",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","hypogastric_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-19",centrelines:["n_69"]},{id:"ilxtr:neuron-type-keast-14",centrelines:["n_72"]}];function M5e(){return[{id:"UBERON:0000948",name:"Heart",type:"simulation"},{id:"UBERON:0001156",name:"Colon",type:"simulation"},{id:"UBERON:0001255",name:"Bladder",type:"simulation"},{id:"UBERON:0000945",name:"Stomach",type:"simulation"},{id:"UBERON:0001759",name:"Vagus nerve",type:"simulation"},{id:"UBERON:0002108",name:"Small intestines",type:"simulation"},{id:"UBERON:0002107",name:"Liver",type:"simulation"}]}function O5e(){return M5e()}function xV(e){if(e)for(let t=0;t<Of.length;t++){if(Of[t].id==e)return Of[t].centrelines;if(Of[t].centrelines.find(o=>o===e))return[Of[t].id]}return[]}function L5e(e){if(e){const t=e.toLowerCase();if(t.includes("heart"))return{id:"UBERON:0000948",name:"Heart"};if(t.includes("liver"))return{id:"UBERON:0002107",name:"Liver"};if(t.includes("stomach"))return{id:"UBERON:0000945",name:"Stomach"};if(t.includes("colon"))return{id:"UBERON:0001156",name:"Colon"};if(t.includes("bladder"))return{id:"UBERON:0001255",name:"Bladder"}}}const PS=e=>{switch(e){case"2horpanel":return{"split-1":{content:!1,horizontal:!0,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"2vertpanel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"3panel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3}};case"4panel":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4}};case"5panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-5"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5}};case"6panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"6panelVertical":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"singlepanel":default:return{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}}}},I5e=(e,t)=>{const n=[],o=[];for(const[a,i]of Object.entries(t))i.content&&(1>i.id||n.includes(i.id)?o.push(a):n.push(i.id));o.forEach(a=>{let i=!1;for(let s=0;s<e.length&&!i;s++)n.includes(e[s].id)||(t[a].id=e[s].id,n.push(e.id),i=!0)})},R5e=e=>{const t={};for(const[n,o]of Object.entries(e))o.content&&(t[n]=o);return t},kV=(e,t)=>{const n=R5e(e),o=PS(t);for(const[a,i]of Object.entries(n))o[a]=i;return o},yd=(e,t)=>Object.keys(e).find(n=>e[n].id===t),CV=()=>({activeView:"singlepanel",idNamePair:{},viewIcons:[{icon:"singlepanel",name:"Single view",min:1},{icon:"2horpanel",name:"Horizontal split",min:2},{icon:"2vertpanel",name:"Vertical split",min:2},{icon:"3panel",name:"Three panes",min:3},{icon:"4panel",name:"Four panes",min:4},{icon:"5panel",name:"Five panes",min:5},{icon:"6panel",name:"Six (horizontal)",min:6},{icon:"6panelVertical",name:"Six (vertical)",min:6}],customLayout:{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}},splitters:{first:50,second:50,third:50}}),Ss=Mt.defineStore("splitFlow",{state:()=>CV(),getters:{getActivePaneIds:e=>()=>{const t=[];let n;for(const o in e.customLayout)e.customLayout[o].id&&t.push(e.customLayout[o].id);switch(e.activeView){case"singlepanel":n=t.slice(0,1);break;case"2horpanel":case"2vertpanel":n=t.slice(0,2);break;case"3panel":n=t.slice(0,3);break;case"4panel":n=t.slice(0,4);break;case"5panel":n=t.slice(0,5);break;case"6panelVertical":case"6panel":n=t.slice(0,6);break;default:n=[];break}return n},getPaneNameById:e=>t=>yd(e.customLayout,t),getState:e=>()=>({activeView:e.activeView,splitters:e.splitters,customLayout:e.customLayout}),isPaneActive:e=>t=>{const n=PS(e.activeView);return Object.keys(n).includes(t)}},actions:{assignOrSwapPaneWithIds(e){let t=yd(this.customLayout,e.source),n=yd(this.customLayout,e.target);n&&(this.customLayout[n].id=e.source),t&&(this.customLayout[t].id=e.target),this.updateSplitPanels()},getAvailableTerms(e){let t=O5e();for(let n=0;n<t.length;n++)this.idNamePair[t[n].id]=t[n].name;if(e){this._controller&&this._controller.abort(),this._controller=new AbortController;let n=this._controller.signal;fetch(`${e}get-organ-curies`,{signal:n}).then(o=>o.json()).then(o=>{this._controller=void 0,o.uberon.array.forEach(a=>{this.idNamePair[a.id.toUpperCase()]=a.name.charAt(0).toUpperCase()+a.name.slice(1)})})}},updateActiveView(e){this.activeView=e.view;const t=kV(this.customLayout,this.activeView);I5e(e.entries,t);for(const[n,o]of Object.entries(t))this.customLayout[n]=o;this.updateSplitPanels()},setSplitter(e){this.splitters[e.name]&&(this.splitters[e.name]=e.value)},setState(e){if(e){let t;if(e.activeView&&(this.activeView=e.activeView),e.customLayout)t=e.customLayout;else if(t=PS(this.activeView),e.slotInfo)for(let n=0;n<e.slotInfo.length;n++)switch(e.slotInfo[n].name){case"first":t["pane-1"].id=e.slotInfo[n].id;break;case"second":"pane-2"in t&&(t["pane-2"].id=e.slotInfo[n].id);break;case"thrid":"pane-3"in t&&(t["pane-3"].id=e.slotInfo[n].id);break;case"fourth":"pane-4"in t&&(t["pane-4"].id=e.slotInfo[n].id);break;case"fifth":"pane-5"in t&&(t["pane-5"].id=e.slotInfo[n].id);break;case"sixth":"pane-6"in t&&(t["pane-6"].id=e.slotInfo[n].id);break}for(const[n,o]of Object.entries(t))this.customLayout[n]=o;for(const[n,o]of Object.entries(e.splitters))this.splitters[n]=o}},setIdToPrimaryPane(e){const t=yd(this.customLayout,e),n=this.customLayout["pane-1"].id;this.customLayout["pane-1"].id=e,t&&(this.customLayout[t].id=n)},reset(){const e=CV();this.activeView=e.activeView,this.customLayout=e.customLayout,this.splitters=e.splitters},closeSlot(e){if(e){let t=0;if(e.entries)for(let n=0;n<e.entries.length&&t==0;n++)e.entries[n].id!==e.id&&yd(this.customLayout,e.entries[n].id)===void 0&&(t=e.entries[n].id);if(this.activeView!=="customise"){const n=this.activeView;switch(this.activeView){case"2horpanel":case"2vertpanel":this.activeView="singlepanel";break;case"3panel":this.activeView="2vertpanel";break;case"4panel":this.activeView="3panel";break;case"5panel":this.activeView="4panel";break;case"6panelVertical":case"6panel":this.activeView="5panel";break}const o=kV(this.customLayout,this.activeView);switch(yd(this.customLayout,e.id)){case"pane-1":switch(n){case"2horpanel":case"2vertpanel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=t;break;case"3panel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=t;break;case"4panel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=t;break;case"5panel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-1"].id=o["pane-2"].id,o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-2":switch(n){case"2horpanel":case"2vertpanel":o["pane-2"].id=t;break;case"3panel":o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=t;break;case"4panel":o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=t;break;case"5panel":o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-2"].id=o["pane-3"].id,o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-3":switch(n){case"3panel":o["pane-3"].id=t;break;case"4panel":o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=t;break;case"5panel":o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-3"].id=o["pane-4"].id,o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-4":switch(n){case"4panel":o["pane-4"].id=t;break;case"5panel":o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-4"].id=o["pane-5"].id,o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-5":switch(n){case"5panel":o["pane-5"].id=t;break;case"6panelVertical":case"6panel":o["pane-5"].id=o["pane-6"].id,o["pane-6"].id=t;break}break;case"pane-6":switch(n){case"6panelVertical":case"6panel":o["pane-6"].id=t;break}break}for(const[i,s]of Object.entries(o))this.customLayout[i]=s}}},updateSplitPanels(){$e.emit("species-layout-connectivity-update")}}}),P5e={name:"ContentBar",components:{ElIconArrowDown:lo,ElIconArrowUp:W1,ElIconInfoFilled:Z1,Input:ph,Option:G3,Popover:Eh,Row:xh,Select:K3,ContextCard:M9,FlatmapContextCard:O9,MapSvgIcon:MS},props:{entry:Object},data:function(){return{contextCardVisible:!1,slot:{},boundariesElement:null,showDetails:!0,contextCardEntry:void 0,titles:[]}},computed:{...Mt.mapStores(Mf,vi,Ss),allClosable(){return this.settingsStore.allClosable},helpDelay(){return this.settingsStore.helpDelay},activeView:function(){return this.splitFlowStore.activeView},envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},popperOptions:function(){return{modifiers:[{name:"preventOverflow",options:{boundary:this.boundariesElement}},{name:"flip",options:{boundary:this.boundariesElement,flipVariations:!1,allowedAutoPlacements:["bottom"]}}]}},entries:function(){return this.titles=[],this.entriesStore.entries.map(e=>{const t=this.getEntryTitle(e);return this.titles.push({id:e.id,title:t}),{...e,title:t}})}},methods:{closeAndRemove:function(){this.splitFlowStore.closeSlot({id:this.entry.id,entries:this.entries}),$e.emit("RemoveEntryRequest",this.entry.id),this.$nextTick(()=>{this.splitFlowStore.updateSplitPanels()})},getEntryTitle:function(e){if(e){let t=e.label?e.label+" ":"",n=e.type;return n=="Scaffold"&&(n="3D Scaffold"),t+=n,e.datasetId?t+=" - "+e.datasetId:e.discoverId&&(t+=" - "+e.discoverId),t}return"Viewer"},getTitle:function(e){const{id:t,title:n}=e,o=this.titles.filter(a=>a.title===n);if(o.length>1){const a=[];for(let s=0;s<o.length;s++){const l=this.getCharById(s);a.push({id:o[s].id,title:o[s].title+l})}const i=a.find(s=>s.id===t);if(i)return i.title}return n},getCharById:function(e){return" ("+String.fromCharCode(65+e)+")"},viewerChanged:function(e){if(this.entry.id&&this.entry.id!=e){this.splitFlowStore.assignOrSwapPaneWithIds({source:this.entry.id,target:e}),this.$nextTick(()=>{setTimeout(()=>{this.$emit("chooser-changed")},1200)});const t=this.entries.find(n=>n.id===e);Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_viewer_changed",category:(t==null?void 0:t.title)||"",location:"map_toolbar"})}},setPopperWidth:function(e){let t=this.entries.find(n=>n.id===e);if(t)return t.type=="Flatmap"||t.type=="MultiFlatmap"?"240px":"440px"},setBoundary:function(e){this.boundariesElement=e},setupFlatmapContextCard:function(e){this.contextCardVisible=!1;let t=Object.assign({mapImpProv:e.prov},this.entry);this.contextCardEntry=t},setupScaffoldContextCard:function(){this.entry.contextCardUrl&&(this.contextCardEntry={...this.entry})}},mounted:function(){this.setupScaffoldContextCard()}},V5e={class:"toolbar-flex-container"},D5e={key:1,class:"toolbar-title"};function z5e(e,t,n,o,a,i){const s=G3,l=K3,c=O9,d=M9,u=W1,f=Un,p=lo,m=Eh,h=r.resolveComponent("map-svg-icon"),g=xh;return r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",V5e,[i.entries.length>1?(r.openBlock(),r.createBlock(l,{key:0,teleported:!1,"model-value":n.entry.id,placeholder:"Select",class:"select-box","popper-class":"viewer_dropdown",onChange:t[0]||(t[0]=v=>i.viewerChanged(v))},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.entries,v=>(r.openBlock(),r.createBlock(s,{key:v.id,label:i.getTitle(v),value:v.id},null,8,["label","value"]))),128))]),_:1},8,["model-value"])):(r.openBlock(),r.createElementBlock("div",D5e,r.toDisplayString(i.getEntryTitle(n.entry)),1))]),r.createVNode(g,{class:"icon-group"},{default:r.withCtx(()=>[r.createVNode(m,{placement:"bottom",teleported:!1,trigger:"manual",width:i.setPopperWidth(e.slot.id),offset:0,"popper-class":"context-card-popover","popper-options":i.popperOptions,visible:e.contextCardVisible},r.createSlots({reference:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",null,[r.withDirectives(r.createElementVNode("div",{class:"hide",onClick:t[3]||(t[3]=v=>e.contextCardVisible=!1)},[r.createTextVNode(" Hide information "),r.createVNode(f,null,{default:r.withCtx(()=>[r.createVNode(u)]),_:1})],512),[[r.vShow,e.contextCardVisible]]),r.withDirectives(r.createElementVNode("div",{class:"hide",onClick:t[4]||(t[4]=v=>e.contextCardVisible=!0)},[r.createTextVNode(" Show information "),r.createVNode(f,null,{default:r.withCtx(()=>[r.createVNode(p)]),_:1})],512),[[r.vShow,!e.contextCardVisible]])],512),[[r.vShow,e.contextCardEntry]])]),_:2},[e.contextCardEntry?{name:"default",fn:r.withCtx(()=>[e.contextCardEntry.type=="Flatmap"||e.contextCardEntry.type=="MultiFlatmap"?(r.openBlock(),r.createBlock(c,{key:0,class:"flatmap-context-card",mapImpProv:e.contextCardEntry.mapImpProv},null,8,["mapImpProv"])):r.createCommentVNode("",!0),e.contextCardEntry.type.toLowerCase()=="scaffold"?(r.openBlock(),r.createBlock(d,{key:1,entry:e.contextCardEntry,envVars:i.envVars,class:"context-card",onContextReady:t[1]||(t[1]=v=>e.contextCardVisible=!0),onScaffoldViewClicked:t[2]||(t[2]=v=>e.$emit("scaffold-view-clicked",v))},null,8,["entry","envVars"])):r.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["width","popper-options","visible"]),r.createVNode(m,{class:"tooltip",content:"Close and remove",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(h,{icon:"close",class:"header-icon",onClick:t[5]||(t[5]=v=>i.closeAndRemove())},null,512),[[r.vShow,i.activeView!=="singlepanel"&&(n.entry.mode!=="main"||i.allClosable)]])]),_:1},8,["show-after"])]),_:1})])}const SV=tr(P5e,[["render",z5e],["__scopeId","data-v-61f2f88c"]]),j5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>yGe)),H5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>kGe)),U5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>$Ge)),q5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>TGe)),K5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>OGe)),G5e=r.defineAsyncComponent(()=>Promise.resolve().then(()=>RGe)),W5e={name:"ContentVuer",props:{entry:Object,visible:{type:Boolean,default:!0}},components:{Button:wu,ContentBar:SV,Flatmap:j5e,Iframe:H5e,MultiFlatmap:U5e,Plot:q5e,Scaffold:K5e,Simulation:G5e},methods:{flatmapProvenanceReady:function(e){var t;(t=this.$refs.contentBar)==null||t.setupFlatmapContextCard(e),this.entriesStore.updateMapForEntry(this.entry,e)},getId:function(){return this.entry.id},getState:function(){var e;return(e=this.$refs.viewer)==null?void 0:e.getState()},resourceSelected:function(e){this.$emit("resource-selected",e)},scaffoldViewClicked:function(e){var t;this.entry.viewUrl!==e?this.entriesStore.updateViewForEntry({id:this.entry.id,viewUrl:e}):(t=this.$refs.viewer)==null||t.updateWithViewUrl(e)},search:function(e){var t;return(t=this.$refs.viewer)==null?void 0:t.search(e)},searchSuggestions:function(e,t){var n;(n=this.$refs.viewer)==null||n.searchSuggestions(e,t)},setPanesBoundary:function(){var e;(e=this.$refs.contentBar)==null||e.setBoundary(this.$refs.container)},speciesChanged:function(e){this.activeSpecies=e,this.$emit("species-changed",e)},isVisible:function(){const e=this.splitFlowStore.getPaneNameById(this.entry.id);let t=!1;return e!==void 0&&(t=this.splitFlowStore.isPaneActive(e)),t},onResize:function(){var e;(e=this.$refs.viewer)==null||e.onResize()},onConnectivityItemClose:function(){var e;(e=this.$refs.viewer)==null||e.onConnectivityItemClose()},onConnectivitySourceChange:function(e){var t;(t=this.$refs.viewer)==null||t.changeConnectivitySource(e)},onFlatmapMarkerUpdate:function(){var e;(e=this.$refs.viewer)==null||e.flatmapMarkerUpdate()},onGlobalViewerSettingsUpdate:function(){var e;(e=this.$refs.viewer)==null||e.updateViewerSettings()},onHoverUpdate:function(e){var t;(t=this.$refs.viewer)==null||t.sidebarHoverHighlight(e)},onShowConnectivity:function(e){var t;(t=this.$refs.viewer)==null||t.showConnectivity(e)},onShowConnectivityTooltips:function(e){var t;(t=this.$refs.viewer)==null||t.showConnectivityTooltips(e)},onShowReferenceConnectivity:function(e){var t;(t=this.$refs.viewer)==null||t.showConnectivitiesByReference(e)},onSidebarAnnotationClose:function(){var e;(e=this.$refs.viewer)==null||e.onSidebarAnnotationClose()},onStartHelp:function(){var e;(e=this.$refs.viewer)==null||e.startHelp()},onFilterVisibility:function(e){var t;(t=this.$refs.viewer)==null||t.setVisibilityFilter(e)},onLoadConnectivityDetail:function(e){var t;(t=this.$refs.viewer)==null||t.getKnowledgeTooltip(e)},toggleMinimap:function(e,t){var n;(n=this.$refs.viewer)==null||n.toggleMinimap(e,t)}},data:function(){return{mouseHovered:!1,activeSpecies:"Rat"}},computed:{...Mt.mapStores(Mf,Ss),viewerType(){switch(this.entry.type){case"Biolucida":case"Iframe":case"Segmentation":return"Iframe";default:return this.entry.type}}}},X5e={class:"component-container",ref:"container"};function Y5e(e,t,n,o,a,i){const s=SV;return r.openBlock(),r.createElementBlock("div",{class:"content-container",onMouseover:t[0]||(t[0]=l=>e.mouseHovered=!0),onMouseleave:t[1]||(t[1]=l=>e.mouseHovered=!1)},[r.createVNode(s,{class:"toolbar",entry:n.entry,ref:"contentBar",onChooserChanged:i.onResize,onScaffoldViewClicked:i.scaffoldViewClicked,onVnodeMounted:i.setPanesBoundary},null,8,["entry","onChooserChanged","onScaffoldViewClicked","onVnodeMounted"]),r.createElementVNode("div",X5e,[(r.openBlock(),r.createBlock(r.Suspense,null,{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.viewerType),{entry:n.entry,mouseHovered:e.mouseHovered,visible:n.visible,lazy:!0,ref:"viewer",onFlatmapProvenanceReady:i.flatmapProvenanceReady,onResourceSelected:i.resourceSelected,onSpeciesChanged:i.speciesChanged},null,40,["entry","mouseHovered","visible","onFlatmapProvenanceReady","onResourceSelected","onSpeciesChanged"]))]),_:1}))],512)],32)}const EV=tr(W5e,[["render",Y5e],["__scopeId","data-v-46587974"]]);var _V={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(typeof window<"u"?window:Yte,function(){if(typeof window>"u")return null;var n=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),o=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||function(u){return n.setTimeout(u,20)},a=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||function(u){n.clearTimeout(u)};function i(u,f){var p=Object.prototype.toString.call(u),m=p==="[object Array]"||p==="[object NodeList]"||p==="[object HTMLCollection]"||p==="[object Object]"||typeof jQuery<"u"&&u instanceof jQuery||typeof Elements<"u"&&u instanceof Elements,h=0,g=u.length;if(m)for(;h<g;h++)f(u[h]);else f(u)}function s(u){if(!u.getBoundingClientRect)return{width:u.offsetWidth,height:u.offsetHeight};var f=u.getBoundingClientRect();return{width:Math.round(f.width),height:Math.round(f.height)}}function l(u,f){Object.keys(f).forEach(function(p){u.style[p]=f[p]})}var c=function(u,f){var p=0;function m(){var g=[];this.add=function(b){g.push(b)};var v,y;this.call=function(b){for(v=0,y=g.length;v<y;v++)g[v].call(this,b)},this.remove=function(b){var x=[];for(v=0,y=g.length;v<y;v++)g[v]!==b&&x.push(g[v]);g=x},this.length=function(){return g.length}}function h(g,v){if(g){if(g.resizedAttached){g.resizedAttached.add(v);return}g.resizedAttached=new m,g.resizedAttached.add(v),g.resizeSensor=document.createElement("div"),g.resizeSensor.dir="ltr",g.resizeSensor.className="resize-sensor";var y={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},b={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(g.resizeSensor,y);var x=document.createElement("div");x.className="resize-sensor-expand",l(x,y);var w=document.createElement("div");l(w,b),x.appendChild(w);var k=document.createElement("div");k.className="resize-sensor-shrink",l(k,y);var C=document.createElement("div");l(C,b),l(C,{width:"200%",height:"200%"}),k.appendChild(C),g.resizeSensor.appendChild(x),g.resizeSensor.appendChild(k),g.appendChild(g.resizeSensor);var S=window.getComputedStyle(g),E=S?S.getPropertyValue("position"):null;E!=="absolute"&&E!=="relative"&&E!=="fixed"&&E!=="sticky"&&(g.style.position="relative");var _=!1,$=0,A=s(g),F=0,N=0,M=!0;p=0;var L=function(){var Y=g.offsetWidth,W=g.offsetHeight;w.style.width=Y+10+"px",w.style.height=W+10+"px",x.scrollLeft=Y+10,x.scrollTop=W+10,k.scrollLeft=Y+10,k.scrollTop=W+10},B=function(){if(M){var Y=g.offsetWidth===0&&g.offsetHeight===0;if(Y){p||(p=o(function(){p=0,B()}));return}else M=!1}L()};g.resizeSensor.resetSensor=B;var I=function(){$=0,_&&(F=A.width,N=A.height,g.resizedAttached&&g.resizedAttached.call(A))},R=function(){A=s(g),_=A.width!==F||A.height!==N,_&&!$&&($=o(I)),B()},V=function(Y,W,Q){Y.attachEvent?Y.attachEvent("on"+W,Q):Y.addEventListener(W,Q)};V(x,"scroll",R),V(k,"scroll",R),p=o(function(){p=0,B()})}}i(u,function(g){h(g,f)}),this.detach=function(g){p||(a(p),p=0),c.detach(u,g)},this.reset=function(){u.resizeSensor.resetSensor()}};if(c.reset=function(u){i(u,function(f){f.resizeSensor.resetSensor()})},c.detach=function(u,f){i(u,function(p){p&&(p.resizedAttached&&typeof f=="function"&&(p.resizedAttached.remove(f),p.resizedAttached.length())||p.resizeSensor&&(p.contains(p.resizeSensor)&&p.removeChild(p.resizeSensor),delete p.resizeSensor,delete p.resizedAttached))})},typeof MutationObserver<"u"){var d=new MutationObserver(function(u){for(var f in u)if(u.hasOwnProperty(f))for(var p=u[f].addedNodes,m=0;m<p.length;m++)p[m].resizeSensor&&c.reset(p[m])});document.addEventListener("DOMContentLoaded",function(u){d.observe(document.body,{childList:!0,subtree:!0})})}return c})})(_V);var J5e=_V.exports;const Z5e=a3(J5e),Q5e={name:"ResizeSensor",methods:{activate:function(){this._sensor||(this._sensor=new Z5e(this.$refs.display,this.displayResize),this.displayResize())},deactivate:function(){this._sensor&&(this._sensor.detach(this.$refs.display,this.displayResize),delete this._sensor,this._sensor=void 0,this.displayResize())},displayResize:function(){this.$emit("resize")}},unmounted(){this.deactivate()},activated(){this.activate()},deactivated(){this.deactivate()},mounted:function(){this.activate()}},e$e={style:{height:"100%",width:"100%",position:"absolute"},ref:"display"};function t$e(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("div",e$e,null,512)}const $V=tr(Q5e,[["render",t$e]]),n$e={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((o,a)=>(o.size=a===t?o.max:o.min,a!==t&&(n+=o.min),o)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t]),this.$emit("resized",this.panes.map(o=>({min:o.min,max:o.max,size:o.size})))},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:o-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),e*100/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:n.prevPanesSize),a=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(e),a),o);let s=[t,t+1],l=this.panes[s[0]]||null,c=this.panes[s[1]]||null;const d=l.max<100&&i>=l.max+n.prevPanesSize,u=c.max<100&&i<=100-(c.max+this.sumNextPanesSize(t+1));if(d||u){d?(l.size=l.max,c.size=Math.max(100-l.max-n.prevPanesSize-n.nextPanesSize,0)):(l.size=Math.max(100-c.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),c.size=c.max);return}if(this.pushOtherPanes){const f=this.doPushOtherPanes(n,i);if(!f)return;({sums:n,panesToResize:s}=f),l=this.panes[s[0]]||null,c=this.panes[s[1]]||null}l!==null&&(l.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,l.min),l.max)),c!==null&&(c.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,c.min),c.max))},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,o=[n,n+1];return t<e.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((a,i)=>{i>o[0]&&i<=n&&(a.size=a.min,e.prevReachedMinPanes+=a.min)}),e.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((a,i)=>{i>0&&i<=n&&(a.size=a.min,e.prevReachedMinPanes+=a.min)}),this.panes[o[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((a,i)=>{i>n&&i<o[1]&&(a.size=a.min,e.nextReachedMinPanes+=a.min)}),e.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((a,i)=>{i<this.panesCount-1&&i>=n+1&&(a.size=a.min,e.nextReachedMinPanes+=a.min)}),this.panes[o[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:o}},sumPrevPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),n=e.classList.contains("splitpanes__splitter");!t&&!n&&(e.parentNode.removeChild(e),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))})},addSplitter(e,t,n=!1){const o=e-1,a=document.createElement("div");a.classList.add("splitpanes__splitter"),n||(a.onmousedown=i=>this.onMouseDown(i,o),typeof window<"u"&&"ontouchstart"in window&&(a.ontouchstart=i=>this.onMouseDown(i,o)),a.onclick=i=>this.onSplitterClick(i,o+1)),this.dblClickSplitter&&(a.ondblclick=i=>this.onSplitterDblClick(i,o+1)),t.parentNode.insertBefore(a,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate({target:e,...t}){const n=this.indexedPanes[e._.uid];Object.entries(t).forEach(([o,a])=>n[o]=a)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(a=>(a.className.includes("splitpanes__pane")&&t++,a===e.$el));const n=parseFloat(e.minSize),o=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((a,i)=>a.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(a=>({min:a.min,max:a.max,size:a.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(o=>o.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((o,a)=>o.index=a),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(e={}){!e.addedPane&&!e.removedPane?this.initialPanesSizing():this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const n=[],o=[];this.panes.forEach(a=>{a.size=Math.max(Math.min(e,a.max),a.min),t-=a.size,a.size>=a.max&&n.push(a.id),a.size<=a.min&&o.push(a.id)}),t>.1&&this.readjustSizes(t,n,o)},initialPanesSizing(){let e=100;const t=[],n=[];let o=0;this.panes.forEach(i=>{e-=i.size,i.size!==null&&o++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id)});let a=100;e>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(e/(this.panesCount-o),i.max),i.min)),a-=i.size}),a>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e,removedPane:t}={}){let n=100/this.panesCount,o=0;const a=[],i=[];e&&e.givenSize!==null&&(n=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(s=>{o-=s.size,s.size>=s.max&&a.push(s.id),s.size<=s.min&&i.push(s.id)}),!(Math.abs(o)<.1)&&(this.panes.forEach(s=>{e&&e.givenSize!==null&&e.id===s.id||(s.size=Math.max(Math.min(n,s.max),s.min)),o-=s.size,s.size>=s.max&&a.push(s.id),s.size<=s.min&&i.push(s.id)}),o>.1&&this.readjustSizes(o,a,i))},readjustSizes(e,t,n){let o;e>0?o=e/(this.panesCount-t.length):o=e/(this.panesCount-n.length),this.panes.forEach((a,i)=>{if(e>0&&!t.includes(a.id)){const s=Math.max(Math.min(a.size+o,a.max),a.min),l=s-a.size;e-=l,a.size=s}else if(!n.includes(a.id)){const s=Math.max(Math.min(a.size+o,a.max),a.min),l=s-a.size;e-=l,a.size=s}a.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[a.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,n)=>{t.ondblclick=e?o=>this.onSplitterDblClick(o,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return r.h("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},r$e=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},o$e={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function a$e(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>i.onPaneClick(s,e._.uid)),style:r.normalizeStyle(e.style)},[r.renderSlot(e.$slots,"default")],4)}const i$e={name:"CustomSplitter",components:{Splitpanes:n$e,Pane:r$e(o$e,[["render",a$e]]),ResizeSensor:$V},props:{index:{type:String,default:function(){return"split-1"}}},methods:{requestStylesUpdate:function(e){if(this.$refs&&e in this.$refs&&this.$refs[e]&&this.$refs[e][0]&&this.$refs[e][0].$el){const n=this.$refs[e][0].$el.getBoundingClientRect();$e.emit("PaneResize",{refName:e,rect:n})}},calculateStyles:function(e){this.$refs&&(e.startsWith("pane")?this.requestStylesUpdate(e):e.startsWith("split")&&this.customLayout[e].children.forEach(t=>{t.startsWith("pane")&&this.requestStylesUpdate(t)}))},childUnmounted:function(e){$e.emit("PaneUnmounted",{refName:e})}},computed:{...Mt.mapStores(Ss),children(){return this.customLayout[this.index].children},customLayout(){return this.splitFlowStore.customLayout},isHorizontal(){return this.customLayout[this.index].horizontal}}},s$e={style:{height:"100%",width:"100%"}};function l$e(e,t,n,o,a,i){const s=$V,l=r.resolveComponent("custom-splitter",!0),c=r.resolveComponent("pane"),d=r.resolveComponent("splitpanes");return r.openBlock(),r.createElementBlock("div",s$e,[r.createVNode(s,{onResize:t[0]||(t[0]=u=>i.calculateStyles(n.index))}),r.createVNode(d,{class:"default-theme",horizontal:i.isHorizontal,"dbl-click-splitter":!1},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.children,u=>(r.openBlock(),r.createBlock(c,{key:u,ref_for:!0,ref:u,onVnodeBeforeUnmount:f=>i.childUnmounted(u)},{default:r.withCtx(()=>[i.customLayout[u].content?(r.openBlock(),r.createBlock(s,{key:0,onResize:f=>i.calculateStyles(u)},null,8,["onResize"])):(r.openBlock(),r.createBlock(l,{key:u,index:u},null,8,["index"]))]),_:2},1032,["onVnodeBeforeUnmount"]))),128))]),_:1},8,["horizontal"])])}const FV=tr(i$e,[["render",l$e],["__scopeId","data-v-0667e71f"]]),AV=Mt.defineStore("connectivities",{state:()=>({activeConnectivityKeys:[],globalConnectivities:{},filterOptions:{},filterSources:{}}),getters:{getUniqueConnectivitiesByKeys:e=>{const t=e.activeConnectivityKeys.reduce((n,o)=>{const a=e.globalConnectivities[o];if(!a)return n;for(const i of a){const s=i.id;n[s]=n[s]?{...n[s],...i}:{...i}}return n},{});return Object.values(t).sort((n,o)=>n.label.localeCompare(o.label))},getUniqueFilterOptionsByKeys:e=>{const t=e.activeConnectivityKeys.reduce((n,o)=>{const a=e.filterOptions[o];if(!a)return n;for(const i of a)if(n[i.key]){const s=[...n[i.key].children,...i.children],l=Array.from(new Map(s.map(c=>[c.key,c])).values());n[i.key].children=l}else n[i.key]={...i};return n},{});return Object.values(t)},getUniqueFilterSourcesByKeys:e=>e.activeConnectivityKeys.reduce((n,o)=>{const a=e.filterSources[o];if(!a)return n;for(const[i,s]of Object.entries(a)){n[i]||(n[i]={});for(const[l,c]of Object.entries(s))n[i][l]=n[i][l]?Array.from(new Set([...n[i][l],...c])):[...c]}return n},{})},actions:{updateActiveConnectivityKeys(e){this.activeConnectivityKeys=e},updateGlobalConnectivities(e){this.globalConnectivities=e},updateFilterOptions(e){this.filterOptions=e},updateFilterSources(e){this.filterSources=e}}}),c$e={name:"SplitDialog",components:{ContentVuer:EV,CustomSplitter:FV},props:{entries:{type:Array,default:function(){return[]}}},data:function(){return{styles:{},query:"",filter:[]}},methods:{resourceSelected:function(e){this.$emit("resource-selected",e)},speciesChanged:function(e){this.$emit("species-changed",e)},getClass:function(e){return this.isIdVisible(e)?this.getRefsName(e):"inactive"},getRefsName:function(e){const t=this.splitFlowStore.getPaneNameById(e);return t&&(t in this.styles||(this.styles[t]={})),t},getStyle:function(e){const t=this.getRefsName(e);return t&&t in this.styles&&this.styles[t]?this.styles[t]:{}},getActiveContents:function(){const e=[],t=this.$refs.content;return t&&t.forEach(n=>{n.isVisible()&&e.push(n)}),e},isIdVisible:function(e){return this.splitFlowStore.getPaneNameById(e)!==void 0},getContentsWithId:function(e){let t=this.$refs.content;for(let n=0;n<t.length;n++)if(t[n].getId()==e)return t[n]},getContentsState:function(){let e=[],t=this.$refs.content;for(let n=0;n<t.length;n++)e.push(t[n].getState());return e},setStyles:function(e,t){if(this.$refs&&this.$refs.tabContainer){const n=this.$refs.tabContainer.getBoundingClientRect(),o={};o.width=`${t.width}px`,o.left=`${t.left-n.left}px`,o.height=`${t.height}px`,o.top=`${t.top-n.top}px`,o.display="block",this.styles[e]=o}},hidePane:function(e){if(this.$refs&&"tabContainer"in this.$refs){const t={};t.display="none",this.styles[e]=t}},resize:function(){this.__userResize__=!0},resized:function(e,t){this.__userResize__&&this.splitFlowStore.setSplitter({name:e,value:t[0].size}),this.__userResize__=!1},onSpeciesLayoutConnectivityUpdate:function(){let e=this.splitFlowStore.getActivePaneIds();const t=[307,"307"],n=Object.keys(this.connectivitiesStore.globalConnectivities).find(a=>a.includes("sckan")),o=Array.from(new Set(this.entries.filter(a=>e.includes(a.id)&&(a.uuid&&(a.type==="Flatmap"||a.type==="MultiFlatmap")||a.type==="Scaffold"&&a.resource&&(a.isBodyScaffold||t.includes(a.discoverId)))).map(a=>{if(a.type==="Flatmap"||a.type==="MultiFlatmap")return a.uuid;if(a.type==="Scaffold")return a.resource})));if(o.length){this.connectivitiesStore.updateActiveConnectivityKeys(o);const a=this.connectivitiesStore.getUniqueFilterOptionsByKeys;$e.emit("connectivity-filter-options",a)}else{const a=this.connectivitiesStore.globalConnectivities[n]||[];$e.emit("connectivity-knowledge",{data:a,highlight:[],processed:!1}),$e.emit("connectivity-filter-options",[]),this.connectivitiesStore.updateActiveConnectivityKeys([n])}},getGeneralSearchedId:function(e,t,n="query"){const o=[];return e.forEach(a=>{let i=[JSON.stringify(a["nerve-label"])];(n="query")&&(i=[...i,a.id,a.label,a["long-label"],JSON.stringify(a.nerves)]),i.some(l=>l==null?void 0:l.toLowerCase().includes(t.toLowerCase()))&&!o.includes(a.id)&&o.push(a.id)}),o},getFlatmapSearchedId:function(e,t){const n=[],o=e.mapImp.search(t);return(o.__featureIds||o.featureIds).forEach(i=>{const s=e.mapImp.annotation(i);[s.id,s.name,s.label,s.models,s.source].some(d=>d&&d.toLowerCase().includes(t.toLowerCase()))&&s.models&&!n.includes(s.models)&&n.push(s.models)}),n},getLatestFlatmapUUID:async function(e,t){return(await(await fetch(e)).json()).filter(s=>s.id===t).sort((s,l)=>l.created.localeCompare(s.created))[0].uuid},connectivityQueryFilter:async function(e){this.query="",this.filter=[];const t=this.getActiveContents(),n=this.settingsStore.flatmapAPI,o=[],a=[];let i=[],s=!1,l=[],c=[],d="";const u=this.connectivitiesStore.getUniqueFilterOptionsByKeys,f=this.connectivitiesStore.getUniqueFilterSourcesByKeys;let p=this.connectivitiesStore.getUniqueConnectivitiesByKeys;for(const b of t){const x=b.$refs.viewer;if(x){const w=x.$refs.multiflatmap,k=x.$refs.flatmap,C=x.$refs.scaffold,S=x.$refs.iframe,E=x.$refs.plot,_=x.$refs.simulation;let $=null;if(w){const F=w.getCurrentFlatmap();F&&F.mapImp&&($=F,d=$.mapImp.uuid)}else k&&k.mapImp?($=k,d=$.mapImp.uuid):($=C||S||E||_,d=await this.getLatestFlatmapUUID(n,"human-flatmap_male"));const A=k||w;if(e){if(this.query=e.query,e.query){const B=this.query.replace(/["']/g,"").split(",").map(V=>V.trim()).filter(V=>V),I=[];for(let V=0;V<B.length;V++)A?I.push(this.getFlatmapSearchedId($,B[V])):I.push(this.getGeneralSearchedId(p,B[V],"query"));const R=[...new Set(I.flat())];if(R.length){o.push(...R);const V=A?await e9(n,d,R):R;l.push(...V)}}const F={origins:[],vias:[],destinations:[],all:[]};let N={};if(C&&x.syncFilter(e.filter),e.filter.forEach(B=>{var V,Y;const I=B.facetPropPath.split(".").pop(),R=B.facetPropPath.includes("flatmap.connectivity.source");if(R&&((V=B.facet)==null?void 0:V.toLowerCase())!=="show all"){const W=B.facet.replace(",[",", ["),Q=B.facetPropPath.split(".").pop();if(Q==="origin")F.origins.push(W);else if(Q==="destination")F.destinations.push(W);else if(Q==="via")F.vias.push(W);else{const re=JSON.parse(W).flat(1/0);F.all.push(...re)}}if(C)!R&&((Y=B.facet)==null?void 0:Y.toLowerCase())!=="show all"&&(I in N||(N[I]=[]),N[I].push(...this.getGeneralSearchedId(p,B.facet,"facet")));else if(A&&!R){const W=u.find(Q=>Q.key.includes(I));W&&W.children.forEach(Q=>{if(Q.label===B.facet&&Q.key){const re=Q.key.split(".").pop();I in N||(N[I]=[]),N[I].push(...f[I][re])}})}}),F.origins.length||F.destinations.length||F.vias.length){const B={flatmapAPI:n,knowledgeSource:d,origins:F.origins,destinations:F.destinations,vias:F.vias};"ovd"in N||(N.ovd=[]),N.ovd.push(...await JSe(B))}else F.all.length&&("all"in N||(N.all=[]),N.all.push(...await e9(n,d,F.all)));const M=Object.values(N);this.filter=[...this.filter,...M];const L=this.filter.length?this.filter.reduce((B,I)=>B.filter(R=>I.includes(R))):[];c.push(...L)}}}let m;this.query&&!this.filter.length?m=l:!this.query&&this.filter.length?m=c:this.query&&this.filter.length&&(m=l.filter(b=>c.includes(b))),m&&(i.push(...m),p=p.filter(b=>m.includes(b.id)),s=!0),a.push(...p);const h=[...new Set(o)],g=[...new Set(i)];let v=Array.from(new Map(a.map(b=>[b.id,b])).values());v=[...v.filter(b=>h.includes(b.id)),...v.filter(b=>!h.includes(b.id))];const y={data:v,highlight:g,processed:s};$e.emit("connectivity-knowledge",y)},updateFlatmapMinimap:function(){const e=this.splitFlowStore.getActivePaneIds();let t=this.$refs.content,n=[];for(let i=0;i<t.length;i++)t[i].viewerType==="MultiFlatmap"&&n.push(t[i]);n.sort((i,s)=>s.isVisible()-i.isVisible());const o=!(e.length>4),a=this.settingsStore.displayMinimap;this.settingsStore.updateDisplayMinimap(o),n.forEach(i=>{i.toggleMinimap(o,a)})}},computed:{...Mt.mapStores(Ss,AV,vi),horizontal(){return this.splitFlowStore.activeView==="2horpanel"},splitters(){return this.splitFlowStore.splitters}},mounted:function(){$e.on("PaneResize",e=>{this.setStyles(e.refName,e.rect),this.updateFlatmapMinimap()}),$e.on("PaneUnmounted",e=>{this.hidePane(e.refName)}),$e.on("species-layout-connectivity-update",()=>{this.onSpeciesLayoutConnectivityUpdate()}),$e.on("connectivity-query-filter",e=>{this.connectivityQueryFilter(e)}),$e.on("hoverUpdate",e=>{this.getActiveContents().forEach(n=>{n.onHoverUpdate(e)})}),$e.on("startHelp",()=>{this.getActiveContents().forEach(t=>{t.onStartHelp()})}),$e.on("connectivity-item-close",()=>{this.getActiveContents().forEach(t=>{t.onConnectivityItemClose()})}),$e.on("sidebar-annotation-close",()=>{this.getActiveContents().forEach(t=>{t.onSidebarAnnotationClose()})}),$e.on("globalViewerSettingsUpdate",()=>{this.$refs.content.forEach(t=>{t.onGlobalViewerSettingsUpdate()})}),$e.on("markerUpdate",()=>{this.$refs.content.forEach(t=>{t.onFlatmapMarkerUpdate()})}),$e.on("connectivity-hovered",e=>{this.getActiveContents().forEach(n=>{n.onShowConnectivityTooltips(e)})}),$e.on("connectivity-source-change",e=>{this.getActiveContents().forEach(n=>{n.onConnectivitySourceChange(e)})}),$e.on("show-connectivity",e=>{this.getActiveContents().forEach(n=>{n.onShowConnectivity(e)})}),$e.on("show-reference-connectivities",e=>{this.getActiveContents().forEach(n=>{n.onShowReferenceConnectivity(e)})}),$e.on("filter-visibility",e=>{this.getActiveContents().forEach(n=>{n.onFilterVisibility(e)})})}},d$e={class:"tab-container",ref:"tabContainer"};function u$e(e,t,n,o,a,i){const s=FV,l=EV;return r.openBlock(),r.createElementBlock("div",d$e,[r.createVNode(s,{index:"split-1",key:"split-1"}),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.entries,c=>(r.openBlock(),r.createElementBlock("div",{key:c.id,style:r.normalizeStyle(i.getStyle(c.id)),class:r.normalizeClass([i.getClass(c.id),"contentvuer"])},[(r.openBlock(),r.createBlock(l,{key:c.id,entry:c,ref_for:!0,ref:"content",onResourceSelected:i.resourceSelected,onSpeciesChanged:i.speciesChanged,visible:i.isIdVisible(c.id)},null,8,["entry","onResourceSelected","onSpeciesChanged","visible"]))],6))),128))],512)}const TV=tr(c$e,[["render",u$e],["__scopeId","data-v-fc2eb9d9"]]),f$e={name:"SearchControls",props:{failedSearch:void 0},components:{Autocomplete:JF,MapSvgIcon:MS},methods:{fetchSuggestions:function(e,t){e===""?t([]):this.$emit("fetch-suggestions",{term:e,cb:t})}},data:function(){return{searchText:""}}},p$e=e=>(r.pushScopeId("data-v-eb3db1ae"),e=e(),r.popScopeId(),e),h$e={class:"search-container"},m$e=p$e(()=>r.createElementVNode("div",{class:"text search-text"}," Search within display ",-1)),g$e={key:0,class:"text not-found-text"};function y$e(e,t,n,o,a,i){const s=JF,l=r.resolveComponent("map-svg-icon");return r.openBlock(),r.createElementBlock("div",h$e,[m$e,r.createVNode(s,{class:"search-box",placeholder:"Search",modelValue:e.searchText,"onUpdate:modelValue":t[0]||(t[0]=c=>e.searchText=c),"fetch-suggestions":i.fetchSuggestions,onKeyup:t[1]||(t[1]=r.withKeys(c=>e.$emit("search",e.searchText),["enter"])),onSelect:t[2]||(t[2]=c=>e.$emit("search",c.value)),teleported:!1,"popper-class":"autocomplete-popper"},null,8,["modelValue","fetch-suggestions"]),r.createVNode(l,{icon:"magnifyingGlass",class:"magnify",onClick:t[3]||(t[3]=c=>e.$emit("search",e.searchText))}),n.failedSearch?(r.openBlock(),r.createElementBlock("div",g$e," '"+r.toDisplayString(n.failedSearch)+"' not found ",1)):r.createCommentVNode("",!0)])}const BV=tr(f$e,[["render",y$e],["__scopeId","data-v-eb3db1ae"]]),v$e={name:"DialogToolbarContent",components:{Button:wu,Checkbox:f3,Col:k3,Icon:Un,Input:ph,Popover:Eh,Radio:b3,RadioGroup:w3,Row:xh,MapSvgIcon:MS,MapSvgSpriteColor:yV,SearchControls:BV,ElIconCopyDocument:Y1},props:{numberOfEntries:{type:Number,default:0},showIcons:{type:Boolean,default:!1}},inject:["showGlobalSettings"],computed:{...Mt.mapStores(Mf,vi,Ss),activeView(){return this.splitFlowStore.activeView},helpDelay(){return this.settingsStore.helpDelay},shareLink(){return this.settingsStore.shareLink},offlineAnnotationEnabled(){return this.settingsStore.offlineAnnotationEnabled},viewIcons(){return this.splitFlowStore.viewIcons}},watch:{shareLink:function(){this.loadingLink=!1}},data:function(){return{activeViewRef:void 0,displayShareOptions:!1,ElIconCopyDocument:r.shallowRef(Y1),exportAnnotation:!1,failedSearch:void 0,globalSettings:{},globalSettingRef:void 0,isFullscreen:!1,loadingLink:!0,permalinkRef:void 0,viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover neuron connections by selecting a feature and viewing its associated network connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},authorisedUser:!1,mapLoaded:!1}},methods:{loadGlobalSettings:function(){this.globalSettings={...this.globalSettings,...this.settingsStore.globalSettings}},updateViewingMode:function(e,t){const{target:n}=e;n.closest(".el-checkbox")||(this.globalSettings.viewingMode=t,t==="Exploration"?(this.globalSettings.displayMarkers=!0,this.globalSettings.interactiveMode="dataset"):t==="Annotation"?(this.globalSettings.displayMarkers=!1,this.globalSettings.interactiveMode="dataset"):(this.globalSettings.displayMarkers=!1,this.globalSettings.interactiveMode="connectivity"),this.updateGlobalSettings("viewingMode"))},updateGlobalSettings:function(e){const t=this.settingsStore.getUpdatedGlobalSettingsKey(this.globalSettings);this.settingsStore.updateGlobalSettings(this.globalSettings),t.includes("displayMarkers")&&$e.emit("markerUpdate"),t.includes("interactiveMode")&&$e.emit("modeUpdate",this.globalSettings.interactiveMode),(t.includes("viewingMode")||t.includes("connectionType")||t.includes("flightPathDisplay")||t.includes("organsDisplay")||t.includes("outlinesDisplay")||t.includes("backgroundDisplay"))&&$e.emit("globalViewerSettingsUpdate");let n=this.globalSettings[e];e==="flightPathDisplay"&&(n=this.globalSettings.flightPathDisplay?"3D":"2D"),e==="organsDisplay"&&(n=this.globalSettings.organsDisplay?"Color":"Grayscale"),e==="outlinesDisplay"&&(n=this.globalSettings.outlinesDisplay?"Show":"Hide"),t.length&&Tt.sendEvent({event:"interaction_event",event_name:`portal_maps_settings_${e}`,category:n,location:"map_toolbar"})},titleClicked:function(e){this.$emit("titleClicked",e)},startHelp:function(){$e.emit("startHelp"),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_help",category:"help_mode_start",location:"map_toolbar"})},onFullscreen:function(){this.$emit("onFullscreen"),this.isFullscreen=!this.isFullscreen,this.isFullscreen&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_fullscreen",category:this.isFullscreen?"enter":"exit",location:"map_toolbar"})},onFullscreenEsc:function(){document.fullscreenElement||(this.isFullscreen=!1,Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_fullscreen",category:this.isFullscreen?"enter":"exit",location:"map_toolbar"}))},close:function(){this.$emit("close")},copyShareLink:function(){document&&(this.$refs.linkInput.$el.querySelector("input").select(),document.execCommand("copy"),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_permalink",category:"permalink_copy",location:"map_toolbar"}))},setFailedSearch:function(e){this.failedSearch=e},requestShareLink:function(){sessionStorage.getItem("anonymous-annotation")?this.displayShareOptions=!0:this.getShareLink(!1)},getShareLink:function(e){this.displayShareOptions=!1,this.loadingLink=!0,$e.emit("updateShareLinkRequested",e),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_permalink",category:"permalink_generate",location:"map_toolbar"})},viewClicked:function(e){const t=this.activeView;if(this.splitFlowStore.updateActiveView({view:e,entries:this.entriesStore.entries}),e!==t){const n=this.viewIcons.find(o=>o.icon===e);Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_toolbar_split_view",category:(n==null?void 0:n.name)||"",location:"map_toolbar"})}this.$refs.viewPopover&&this.$refs.viewPopover.hide()}},mounted:function(){this.activeViewRef=r.shallowRef(this.$refs.activeViewRef),this.permalinkRef=r.shallowRef(this.$refs.permalinkRef),this.globalSettingRef=r.shallowRef(this.$refs.globalSettingRef),$e.on("mapLoaded",e=>{this.mapLoaded=!0}),document.addEventListener("fullscreenchange",this.onFullscreenEsc),this.loadGlobalSettings()},unmounted:function(){document.removeEventListener("fullscreenchange",this.onFullscreenEsc)}},ea=e=>(r.pushScopeId("data-v-1cc10ca9"),e=e(),r.popScopeId(),e),b$e={class:"header"},w$e={class:"viewing-mode-selector"},x$e={class:"el-dropdown-link"},k$e={class:"toolbar-dropdown-badge"},C$e=ea(()=>r.createElementVNode("h4",null,"Viewing Mode:",-1)),S$e={class:"el-option__description"},E$e={key:0,class:"setting-popover-block"},_$e={class:"el-radio__description"},$$e={key:0},F$e={key:1},A$e={key:2},T$e={key:3},B$e=ea(()=>r.createElementVNode("br",null,null,-1)),N$e=ea(()=>r.createElementVNode("br",null,null,-1)),M$e={class:"setting-popover-inner"},O$e=ea(()=>r.createElementVNode("h4",null,"Display options:",-1)),L$e={key:0,class:"setting-popover-block"},I$e=ea(()=>r.createElementVNode("h5",null,"Flight path",-1)),R$e={key:1,class:"setting-popover-block"},P$e=ea(()=>r.createElementVNode("h5",null,"Organs",-1)),V$e={key:2,class:"setting-popover-block"},D$e=ea(()=>r.createElementVNode("h5",null,"Apply outlines",-1)),z$e={key:3,class:"setting-popover-block"},j$e=ea(()=>r.createElementVNode("h5",null,"Background color",-1)),H$e=ea(()=>r.createElementVNode("span",{style:{"--bg-color":"white"}},"white",-1)),U$e=ea(()=>r.createElementVNode("span",{style:{"--bg-color":"lightskyblue"}},"lightskyblue",-1)),q$e=ea(()=>r.createElementVNode("span",{style:{"--bg-color":"black"}},"black",-1));function K$e(e,t,n,o,a,i){const s=r.resolveComponent("map-svg-sprite-color"),l=BV,c=RJ,d=Un,u=aZ,f=qJ,p=lo,m=kne,h=w3,g=eoe,v=toe,y=Qre,b=r.resolveComponent("map-svg-icon"),x=k3,w=xh,k=Eh,C=wu,S=f3,E=ph,_=b3,$=Q1,A=wc;return r.openBlock(),r.createElementBlock("div",b$e,[r.createVNode(s),r.createVNode(l,{onSearch:t[0]||(t[0]=F=>{e.$emit("local-search",{term:F})}),onFetchSuggestions:t[1]||(t[1]=F=>{e.$emit("fetch-suggestions",{data:F})}),failedSearch:e.failedSearch},null,8,["failedSearch"]),r.createVNode(w,{class:"icon-group"},{default:r.withCtx(()=>[r.createElementVNode("div",w$e,[r.createTextVNode(" Viewing Mode: "),r.createVNode(y,{teleported:!1,trigger:"hover",class:"toolbar-dropdown","popper-class":"toolbar-dropdown-popper","hide-on-click":!1,disabled:!e.mapLoaded,placement:"bottom-end"},{dropdown:r.withCtx(()=>[C$e,r.createVNode(v,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.viewingModes,(F,N,M)=>(r.openBlock(),r.createBlock(g,{key:N,onClick:L=>i.updateViewingMode(L,N),class:r.normalizeClass({"is-selected":e.globalSettings.viewingMode===N})},{default:r.withCtx(()=>[r.createElementVNode("h5",null,[N==="Exploration"?(r.openBlock(),r.createBlock(d,{key:0,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(c)]),_:1})):r.createCommentVNode("",!0),N==="Neuron Connection"?(r.openBlock(),r.createBlock(d,{key:1,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(u)]),_:1})):r.createCommentVNode("",!0),N==="Annotation"?(r.openBlock(),r.createBlock(d,{key:2,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(f)]),_:1})):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(N),1)]),r.createElementVNode("small",S$e,[N==="Annotation"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[e.authorisedUser?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(F[1]),1)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(F[0]),1)],64)),i.offlineAnnotationEnabled?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createTextVNode(" (Anonymous annotate) ")],64)):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(F),1)],64))]),N==="Neuron Connection"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},["connectionType"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",E$e,[r.createVNode(h,{modelValue:e.globalSettings.connectionType,"onUpdate:modelValue":t[2]||(t[2]=L=>e.globalSettings.connectionType=L),onChange:t[3]||(t[3]=L=>i.updateGlobalSettings("connectionType"))},{default:r.withCtx(()=>[r.createVNode(m,{value:"Origin",size:"small"},{default:r.withCtx(()=>[r.createTextVNode("Origin")]),_:1}),r.createVNode(m,{value:"Via",size:"small"},{default:r.withCtx(()=>[r.createTextVNode("Via")]),_:1}),r.createVNode(m,{value:"Destination",size:"small"},{default:r.withCtx(()=>[r.createTextVNode("Destination")]),_:1}),r.createVNode(m,{value:"All",size:"small"},{default:r.withCtx(()=>[r.createTextVNode("All")]),_:1})]),_:1},8,["modelValue"]),r.createElementVNode("div",_$e,[e.globalSettings.connectionType==="Origin"?(r.openBlock(),r.createElementBlock("small",$$e," Neuron populations beginning at a location. ")):e.globalSettings.connectionType==="Via"?(r.openBlock(),r.createElementBlock("small",F$e," Neuron populations that run through a location. ")):e.globalSettings.connectionType==="Destination"?(r.openBlock(),r.createElementBlock("small",A$e," Neuron populations terminating at a location. ")):(r.openBlock(),r.createElementBlock("small",T$e," Neuron populations associated with a location (or) Neuron populations that share at least one edge with another neuron population. "))])])):r.createCommentVNode("",!0)],64)):r.createCommentVNode("",!0)]),_:2},1032,["onClick","class"]))),128))]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("span",x$e,[e.globalSettings.viewingMode==="Exploration"?(r.openBlock(),r.createBlock(d,{key:0,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(c)]),_:1})):r.createCommentVNode("",!0),e.globalSettings.viewingMode==="Neuron Connection"?(r.openBlock(),r.createBlock(d,{key:1,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(u)]),_:1})):r.createCommentVNode("",!0),e.globalSettings.viewingMode==="Annotation"?(r.openBlock(),r.createBlock(d,{key:2,class:"el-icon--left"},{default:r.withCtx(()=>[r.createVNode(f)]),_:1})):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(e.globalSettings.viewingMode)+" ",1),e.globalSettings.viewingMode==="Neuron Connection"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:3},[r.createTextVNode(" "),r.createElementVNode("small",k$e,[r.createElementVNode("em",null,r.toDisplayString(e.globalSettings.connectionType),1)])],64)):r.createCommentVNode("",!0),r.createVNode(d,{class:"el-icon--right"},{default:r.withCtx(()=>[r.createVNode(p)]),_:1})])]),_:1},8,["disabled"])]),e.activeViewRef?(r.openBlock(),r.createBlock(k,{key:0,"virtual-ref":e.activeViewRef,ref:"viewPopover",placement:"bottom",width:"133",teleported:!1,trigger:"click","popper-class":"view-icon-popover","virtual-triggering":""},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.viewIcons,F=>(r.openBlock(),r.createBlock(w,{gutter:20,key:F.name,class:r.normalizeClass([{active:F.icon==i.activeView},{disabled:F.min>n.numberOfEntries},"view-icon-row"]),onClick:N=>i.viewClicked(F.icon)},{default:r.withCtx(()=>[r.createVNode(x,{span:4},{default:r.withCtx(()=>[r.createVNode(b,{icon:F.icon,class:"view-icon"},null,8,["icon"])]),_:2},1024),r.createVNode(x,{offset:2,span:18,class:"view-text"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(F.name),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["virtual-ref"])):r.createCommentVNode("",!0),r.createVNode(k,{class:"tooltip",content:"Split screen",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.createVNode(b,{icon:i.activeView,ref:"activeViewRef",class:r.normalizeClass([{disabled:1>=n.numberOfEntries},"header-icon","splitscreen-icon"])},null,8,["icon","class"])]),_:1},8,["show-after"]),r.createVNode(k,{class:"tooltip",content:"Help",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.createVNode(b,{icon:"tooltips",class:"header-icon",onClick:t[4]||(t[4]=F=>i.startHelp())})]),_:1},8,["show-after"]),r.createVNode(k,{class:"tooltip",content:"Fullscreen",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(b,{icon:"fullScreen",class:"header-icon",onClick:i.onFullscreen},null,8,["onClick"]),[[r.vShow,!e.isFullscreen]])]),_:1},8,["show-after"]),r.createVNode(k,{class:"tooltip",content:"Exit fullscreen",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(b,{icon:"closeFullScreen",class:"header-icon",onClick:i.onFullscreen},null,8,["onClick"]),[[r.vShow,e.isFullscreen]])]),_:1},8,["show-after"]),e.permalinkRef?(r.openBlock(),r.createBlock(k,{key:1,ref:"linkPopover","virtual-ref":e.permalinkRef,placement:"bottom-end",width:"400",teleported:!1,trigger:"click","popper-class":"link-popover","virtual-triggering":""},{default:r.withCtx(()=>[e.displayShareOptions?(r.openBlock(),r.createBlock(w,{key:0},{default:r.withCtx(()=>[r.createVNode(x,{offset:3,span:8},{default:r.withCtx(()=>[r.createVNode(C,{type:"primary",size:"small",onClick:t[5]||(t[5]=F=>i.getShareLink(e.exportAnnotation)),class:"share-options"},{default:r.withCtx(()=>[r.createTextVNode(" Create Permalink ")]),_:1})]),_:1}),r.createVNode(x,{span:10},{default:r.withCtx(()=>[r.createVNode(k,{class:"tooltip",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.createVNode(S,{modelValue:e.exportAnnotation,"onUpdate:modelValue":t[6]||(t[6]=F=>e.exportAnnotation=F),size:"small"},{default:r.withCtx(()=>[r.createTextVNode(" Export Annotations ")]),_:1},8,["modelValue"])]),default:r.withCtx(()=>[r.createTextVNode(" Create a permalink with anonymous annotations. "),B$e,r.createTextVNode(" NOTE: Annotations will only be stored for "),N$e,r.createTextVNode(" 30 days on the server. ")]),_:1},8,["show-after"])]),_:1})]),_:1})):r.withDirectives((r.openBlock(),r.createBlock(w,{key:1,gutter:20,"element-loading-text":"Creating link..."},{default:r.withCtx(()=>[r.createVNode(x,{span:20},{default:r.withCtx(()=>[r.createVNode(E,{class:"link-input",size:"small",placeholder:"Permanant Link Here",readonly:!0,modelValue:i.shareLink,"onUpdate:modelValue":t[7]||(t[7]=F=>i.shareLink=F),ref:"linkInput"},null,8,["modelValue"])]),_:1}),r.createVNode(x,{span:4},{default:r.withCtx(()=>[r.createVNode(k,{class:"tooltip",content:"Copy link",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.createVNode(C,{class:"copy-button",icon:e.ElIconCopyDocument,size:"small",onClick:i.copyShareLink},null,8,["icon","onClick"])]),_:1},8,["show-after"])]),_:1})]),_:1})),[[A,e.loadingLink]])]),_:1},8,["virtual-ref"])):r.createCommentVNode("",!0),r.createVNode(k,{class:"tooltip",content:"Get permalink",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(b,{icon:"permalink",ref:"permalinkRef",class:"header-icon",onClick:i.requestShareLink},null,8,["onClick"]),[[r.vShow,i.shareLink]])]),_:1},8,["show-after"]),r.createVNode(k,{class:"tooltip",content:"Close",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:r.withCtx(()=>[r.withDirectives(r.createVNode(b,{icon:"close",class:"header-icon",onClick:i.close},null,8,["onClick"]),[[r.vShow,n.showIcons]])]),_:1},8,["show-after"]),e.globalSettingRef?(r.openBlock(),r.createBlock(k,{key:2,"virtual-ref":e.globalSettingRef,ref:"settingPopover",placement:"bottom",width:"230",teleported:!1,trigger:"click","popper-class":"setting-popover","virtual-triggering":"",disabled:!e.mapLoaded},{default:r.withCtx(()=>[r.createElementVNode("div",M$e,[O$e,"flightPathDisplay"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",L$e,[I$e,r.createVNode(h,{modelValue:e.globalSettings.flightPathDisplay,"onUpdate:modelValue":t[8]||(t[8]=F=>e.globalSettings.flightPathDisplay=F),onChange:t[9]||(t[9]=F=>i.updateGlobalSettings("flightPathDisplay"))},{default:r.withCtx(()=>[r.createVNode(_,{value:!1},{default:r.withCtx(()=>[r.createTextVNode("2D")]),_:1}),r.createVNode(_,{value:!0},{default:r.withCtx(()=>[r.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue"])])):r.createCommentVNode("",!0),"organsDisplay"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",R$e,[P$e,r.createVNode(h,{modelValue:e.globalSettings.organsDisplay,"onUpdate:modelValue":t[10]||(t[10]=F=>e.globalSettings.organsDisplay=F),onChange:t[11]||(t[11]=F=>i.updateGlobalSettings("organsDisplay"))},{default:r.withCtx(()=>[r.createVNode(_,{value:!0},{default:r.withCtx(()=>[r.createTextVNode("Color")]),_:1}),r.createVNode(_,{value:!1},{default:r.withCtx(()=>[r.createTextVNode("Grayscale")]),_:1})]),_:1},8,["modelValue"])])):r.createCommentVNode("",!0),"outlinesDisplay"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",V$e,[D$e,r.createVNode(h,{modelValue:e.globalSettings.outlinesDisplay,"onUpdate:modelValue":t[12]||(t[12]=F=>e.globalSettings.outlinesDisplay=F),onChange:t[13]||(t[13]=F=>i.updateGlobalSettings("outlinesDisplay"))},{default:r.withCtx(()=>[r.createVNode(_,{value:!0},{default:r.withCtx(()=>[r.createTextVNode("Show")]),_:1}),r.createVNode(_,{value:!1},{default:r.withCtx(()=>[r.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue"])])):r.createCommentVNode("",!0),"backgroundDisplay"in e.globalSettings?(r.openBlock(),r.createElementBlock("div",z$e,[j$e,r.createVNode(h,{class:"bg-color-radio-group",modelValue:e.globalSettings.backgroundDisplay,"onUpdate:modelValue":t[14]||(t[14]=F=>e.globalSettings.backgroundDisplay=F),onChange:t[15]||(t[15]=F=>i.updateGlobalSettings("backgroundDisplay"))},{default:r.withCtx(()=>[r.createVNode(_,{value:"white",class:"bg-color-radio"},{default:r.withCtx(()=>[H$e]),_:1}),r.createVNode(_,{value:"lightskyblue",class:"bg-color-radio"},{default:r.withCtx(()=>[U$e]),_:1}),r.createVNode(_,{value:"black",class:"bg-color-radio"},{default:r.withCtx(()=>[q$e]),_:1})]),_:1},8,["modelValue"])])):r.createCommentVNode("",!0)])]),_:1},8,["virtual-ref","disabled"])):r.createCommentVNode("",!0),i.showGlobalSettings?(r.openBlock(),r.createBlock(k,{key:3,class:"tooltip",content:"Global Settings",placement:"bottom-end","show-after":i.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper",disabled:!e.mapLoaded},{reference:r.withCtx(()=>[r.createVNode(d,{ref:"globalSettingRef",disabled:!e.mapLoaded,class:r.normalizeClass(["header-icon",{disabled:!e.mapLoaded}])},{default:r.withCtx(()=>[r.createVNode($)]),_:1},8,["disabled","class"])]),_:1},8,["show-after","disabled"])):r.createCommentVNode("",!0)]),_:1})])}const NV=tr(v$e,[["render",K$e],["__scopeId","data-v-1cc10ca9"]]),MV=e=>!e.getAttribute("aria-owns"),OV=(e,t,n)=>{const{parentNode:o}=e;if(!o)return null;const a=o.querySelectorAll(n),i=Array.prototype.indexOf.call(a,e);return a[i+t]||null},Pg=e=>{e&&(e.focus(),!MV(e)&&e.click())},bn=(e,t,{checkForDefaultPrevented:n=!0}={})=>o=>{const a=e==null?void 0:e(o);if(n===!1||!a)return t==null?void 0:t(o)},LV=e=>t=>t.pointerType==="mouse"?e(t):void 0;var IV;const It=typeof window<"u",G$e=e=>typeof e=="string",RV=()=>{},VS=It&&((IV=window==null?void 0:window.navigator)==null?void 0:IV.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Lf(e){return typeof e=="function"?e():r.unref(e)}function W$e(e){return e}function If(e){return r.getCurrentScope()?(r.onScopeDispose(e),!0):!1}function X$e(e,t=!0){r.getCurrentInstance()?r.onMounted(e):t?e():r.nextTick(e)}function DS(e,t,n={}){const{immediate:o=!0}=n,a=r.ref(!1);let i=null;function s(){i&&(clearTimeout(i),i=null)}function l(){a.value=!1,s()}function c(...d){s(),a.value=!0,i=setTimeout(()=>{a.value=!1,i=null,e(...d)},Lf(t))}return o&&(a.value=!0,It&&c()),If(l),{isPending:r.readonly(a),start:c,stop:l}}function Ba(e){var t;const n=Lf(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Rf=It?window:void 0;function Qr(...e){let t,n,o,a;if(G$e(e[0])||Array.isArray(e[0])?([n,o,a]=e,t=Rf):[t,n,o,a]=e,!t)return RV;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(u=>u()),i.length=0},l=(u,f,p,m)=>(u.addEventListener(f,p,m),()=>u.removeEventListener(f,p,m)),c=r.watch(()=>[Ba(t),Lf(a)],([u,f])=>{s(),u&&i.push(...n.flatMap(p=>o.map(m=>l(u,p,m,f))))},{immediate:!0,flush:"post"}),d=()=>{c(),s()};return If(d),d}let PV=!1;function Y$e(e,t,n={}){const{window:o=Rf,ignore:a=[],capture:i=!0,detectIframe:s=!1}=n;if(!o)return;VS&&!PV&&(PV=!0,Array.from(o.document.body.children).forEach(u=>u.addEventListener("click",RV)));let l=!0;const c=u=>a.some(f=>{if(typeof f=="string")return Array.from(o.document.querySelectorAll(f)).some(p=>p===u.target||u.composedPath().includes(p));{const p=Ba(f);return p&&(u.target===p||u.composedPath().includes(p))}}),d=[Qr(o,"click",u=>{const f=Ba(e);if(!(!f||f===u.target||u.composedPath().includes(f))){if(u.detail===0&&(l=!c(u)),!l){l=!0;return}t(u)}},{passive:!0,capture:i}),Qr(o,"pointerdown",u=>{const f=Ba(e);f&&(l=!u.composedPath().includes(f)&&!c(u))},{passive:!0}),s&&Qr(o,"blur",u=>{var f;const p=Ba(e);((f=o.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!(p!=null&&p.contains(o.document.activeElement))&&t(u)})].filter(Boolean);return()=>d.forEach(u=>u())}function VV(e,t=!1){const n=r.ref(),o=()=>n.value=!!e();return o(),X$e(o,t),n}const DV=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},zV="__vueuse_ssr_handlers__";DV[zV]=DV[zV]||{};function J$e(e,t,{window:n=Rf,initialValue:o=""}={}){const a=r.ref(o),i=r.computed(()=>{var s;return Ba(t)||((s=n==null?void 0:n.document)==null?void 0:s.documentElement)});return r.watch([i,()=>Lf(e)],([s,l])=>{var c;if(s&&n){const d=(c=n.getComputedStyle(s).getPropertyValue(l))==null?void 0:c.trim();a.value=d||o}},{immediate:!0}),r.watch(a,s=>{var l;(l=i.value)!=null&&l.style&&i.value.style.setProperty(Lf(e),s)}),a}var jV=Object.getOwnPropertySymbols,Z$e=Object.prototype.hasOwnProperty,Q$e=Object.prototype.propertyIsEnumerable,eFe=(e,t)=>{var n={};for(var o in e)Z$e.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&jV)for(var o of jV(e))t.indexOf(o)<0&&Q$e.call(e,o)&&(n[o]=e[o]);return n};function ta(e,t,n={}){const o=n,{window:a=Rf}=o,i=eFe(o,["window"]);let s;const l=VV(()=>a&&"ResizeObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},d=r.watch(()=>Ba(e),f=>{c(),l.value&&a&&f&&(s=new ResizeObserver(t),s.observe(f,i))},{immediate:!0,flush:"post"}),u=()=>{c(),d()};return If(u),{isSupported:l,stop:u}}var HV=Object.getOwnPropertySymbols,tFe=Object.prototype.hasOwnProperty,nFe=Object.prototype.propertyIsEnumerable,rFe=(e,t)=>{var n={};for(var o in e)tFe.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&HV)for(var o of HV(e))t.indexOf(o)<0&&nFe.call(e,o)&&(n[o]=e[o]);return n};function oFe(e,t,n={}){const o=n,{window:a=Rf}=o,i=rFe(o,["window"]);let s;const l=VV(()=>a&&"MutationObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},d=r.watch(()=>Ba(e),f=>{c(),l.value&&a&&f&&(s=new MutationObserver(t),s.observe(f,i))},{immediate:!0}),u=()=>{c(),d()};return If(u),{isSupported:l,stop:u}}var UV;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(UV||(UV={}));var aFe=Object.defineProperty,qV=Object.getOwnPropertySymbols,iFe=Object.prototype.hasOwnProperty,sFe=Object.prototype.propertyIsEnumerable,KV=(e,t,n)=>t in e?aFe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lFe=(e,t)=>{for(var n in t||(t={}))iFe.call(t,n)&&KV(e,n,t[n]);if(qV)for(var n of qV(t))sFe.call(t,n)&&KV(e,n,t[n]);return e};lFe({linear:W$e},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const cFe=()=>It&&/firefox/i.test(window.navigator.userAgent);/**
|
|
977
977
|
* @vue/shared v3.5.13
|
|
978
978
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
979
979
|
* @license MIT
|
|
@@ -1442,4 +1442,4 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:o,curr
|
|
|
1442
1442
|
`;const p=e.list.map(m=>`<li>${m}</li>`).join(`
|
|
1443
1443
|
`);f+=`<ul>${p}</ul>`,s.push(f)}return s.join(`
|
|
1444
1444
|
|
|
1445
|
-
<br>`)},getConnectivityDatasets:function(e){const t=[...this.componentsWithDatasets,...this.destinationsWithDatasets,...this.originsWithDatasets],n=e.split(",");let o=[];return n.forEach(a=>{const i=t.find(s=>s.name.toLowerCase().trim()===a.toLowerCase().trim());i&&o.push({id:i.id,label:i.name})}),o},onConnectivityHovered:function(e){const t={connectivityInfo:this.entry,label:e,data:e?this.getConnectivityDatasets(e):[]};this.$emit("connectivity-hovered",t)},onConnectivityClicked:function(e){const t={query:e,filter:[]};this.$emit("connectivity-clicked",t)},getConnectivityError:function(e){const{errorData:t,errorMessage:n}=e;return{errorConnectivities:t.map(o=>Lp(o.label)).join(", ").replace(/, ([^,]*)$/," and $1"),errorMessage:n}},onConnectivitySourceChange:function(e){this.connectivityLoading=!0,this.activeView!=="graphView"&&(this.graphViewLoaded=!1),this.updateGraphConnectivity(),lt.emit("connectivity-source-change",{entry:this.entry,connectivitySource:e}),lt.emit("trackEvent",{event_name:"portal_maps_connectivity_source_change",category:e,location:"map_sidebar_connectivity"})},updateGraphConnectivity:function(){this.connectivitySource==="map"?this.getConnectionsFromMap().then(e=>{var t;this.connectivityFromMap=null,(t=e==null?void 0:e.connectivity)!=null&&t.length&&(this.connectivityFromMap=e),this.connectivityLoading=!1}):(this.connectivityFromMap=null,this.connectivityLoading=!1)},getConnectionsFromMap:async function(){if(this.entry.mapuuid){const e=this.flatmapApi+`flatmap/${this.entry.mapuuid}/connectivity/${this.entry.featureId[0]}`;try{const t=await fetch(e);if(!t.ok)throw new Error(`Response status: ${t.status}`);return await t.json()}catch(t){throw lt.emit("connectivity-source-change",{entry:this.entry,connectivitySource:"sckan"}),new Error(t)}}},onConnectivityActionClick:function(e){lt.emit("onConnectivityActionClick",e)},closeConnectivity:function(){this.$emit("close-connectivity"),lt.emit("trackEvent",{event_name:"portal_maps_connectivity_close",category:this.entry.id||"",location:"map_sidebar_connectivity"})},onTrackEvent:function(e){lt.emit("trackEvent",e)}},mounted:function(){this.updatedCopyContent=this.getUpdateCopyContent(),lt.on("connectivity-error",e=>{const t=this.getConnectivityError(e);this.connectivityError={...t}})}},nKe={key:0,class:"main"},rKe={class:"connectivity-info-title"},oKe={class:"title-content"},aKe={key:0,class:"block"},iKe={class:"title"},sKe={style:{"word-break":"keep-all"}},lKe={class:"subtitle"},cKe={key:0,class:"subtitle"},dKe={key:1,class:"block"},uKe={class:"title"},fKe={class:"title-buttons"},pKe={class:"content-container population-display"},hKe={class:"block attribute-title-container"},mKe={class:"block buttons-row"},gKe={key:0,class:"block"},yKe=["origin-item-label"],vKe=["origin-item-label","onMouseenter"],bKe={class:"content-container content-container-connectivity"},wKe={class:"content-container content-container-connectivity"},xKe={key:1,class:"content-container content-container-references"};function kKe(e,t,n,o,a,i){const s=uZ,l=kt,c=ip,d=P$,u=Cr,f=r.resolveComponent("CopyToClipboard"),p=Wr,m=rh,h=R7,g=BOe,v=th,y=r.resolveComponent("connectivity-list"),b=r.resolveComponent("connectivity-graph"),x=r.resolveComponent("ExternalResourceCard"),w=Nd;return i.entry?(r.openBlock(),r.createElementBlock("div",nKe,[r.createElementVNode("div",rKe,[r.createElementVNode("div",oKe,[i.entry.title?(r.openBlock(),r.createElementBlock("div",aKe,[r.createElementVNode("div",iKe,[r.createElementVNode("span",null,r.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.featuresAlert?(r.openBlock(),r.createBlock(c,{key:0,width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:r.withCtx(()=>[r.createVNode(l,{class:"alert"},{default:r.withCtx(()=>[r.createVNode(s)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("span",sKe,r.toDisplayString(i.entry.featuresAlert),1)]),_:1})):r.createCommentVNode("",!0)]),r.createElementVNode("div",lKe,[t[4]||(t[4]=r.createElementVNode("strong",null,"id: ",-1)),r.createTextVNode(r.toDisplayString(i.entry.featureId[0]),1)]),i.hasProvenanceTaxonomyLabel?(r.openBlock(),r.createElementBlock("div",cKe,r.toDisplayString(i.provSpeciesDescription),1)):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",dKe,[r.createElementVNode("div",uKe,r.toDisplayString(i.entry.featureId),1)]))]),r.createElementVNode("div",fKe,[r.createVNode(c,{width:"auto",trigger:"hover",teleported:!1,"popper-class":"popover-map-pin"},{reference:r.withCtx(()=>[r.createVNode(u,{class:"button-circle secondary",circle:"",onClick:i.showConnectivity},{default:r.withCtx(()=>[r.createVNode(l,{color:"#8300bf"},{default:r.withCtx(()=>[r.createVNode(d)]),_:1})]),_:1},8,["onClick"])]),default:r.withCtx(()=>[t[5]||(t[5]=r.createElementVNode("span",null," Show connectivity on map ",-1))]),_:1}),r.createVNode(f,{onCopied:i.onCopied,content:e.updatedCopyContent},null,8,["onCopied","content"]),n.withCloseButton?(r.openBlock(),r.createBlock(c,{key:0,width:"auto",trigger:"hover",teleported:!1,"popper-class":"popover-map-pin"},{reference:r.withCtx(()=>[r.createVNode(u,{class:"button-circle",circle:"",onClick:i.closeConnectivity},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[r.createVNode(p)]),_:1})]),_:1},8,["onClick"])]),default:r.withCtx(()=>[t[6]||(t[6]=r.createElementVNode("span",null,"Close",-1))]),_:1})):r.createCommentVNode("",!0)])]),r.createElementVNode("div",pKe,[r.createElementVNode("div",hKe,[t[8]||(t[8]=r.createElementVNode("span",{class:"attribute-title"},"Population Display",-1)),e.activeView==="listView"?(r.openBlock(),r.createBlock(c,{key:0,width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:r.withCtx(()=>[r.createVNode(l,{class:"info"},{default:r.withCtx(()=>[r.createVNode(m)]),_:1})]),default:r.withCtx(()=>[t[7]||(t[7]=r.createElementVNode("span",{style:{"word-break":"keep-all"}}," This list is ordered alphabetically, switch to graph view for path details. ",-1))]),_:1})):r.createCommentVNode("",!0)]),r.createElementVNode("div",mKe,[t[13]||(t[13]=r.createElementVNode("span",null,"Connectivity from:",-1)),r.createVNode(g,{modelValue:e.connectivitySource,"onUpdate:modelValue":t[0]||(t[0]=k=>e.connectivitySource=k),onChange:i.onConnectivitySourceChange},{default:r.withCtx(()=>[r.createVNode(h,{value:"map",disabled:e.noMapConnectivity},{default:r.withCtx(()=>t[9]||(t[9]=[r.createTextVNode("Map")])),_:1},8,["disabled"]),r.createVNode(h,{value:"sckan"},{default:r.withCtx(()=>t[10]||(t[10]=[r.createTextVNode("SCKAN")])),_:1})]),_:1},8,["modelValue","onChange"]),r.createVNode(u,{class:r.normalizeClass(e.activeView==="listView"?"button":"el-button-secondary"),onClick:t[1]||(t[1]=k=>i.switchConnectivityView("listView"))},{default:r.withCtx(()=>t[11]||(t[11]=[r.createTextVNode(" List view ")])),_:1},8,["class"]),r.createVNode(u,{class:r.normalizeClass(e.activeView==="graphView"?"button":"el-button-secondary"),onClick:t[2]||(t[2]=k=>i.switchConnectivityView("graphView"))},{default:r.withCtx(()=>t[12]||(t[12]=[r.createTextVNode(" Graph view ")])),_:1},8,["class"])])]),i.entry["nerve-label"]?(r.openBlock(),r.createElementBlock("div",gKe,[t[15]||(t[15]=r.createElementVNode("div",{class:"attribute-title-container"},[r.createElementVNode("span",{class:"attribute-title"},"Nerves")],-1)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.entry["nerve-label"],(k,C)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createElementBlock("div",{class:"attribute-content","origin-item-label":k.nerve,key:k.nerve},[r.createElementVNode("span",null,r.toDisplayString(i.capitalise(k.nerve)),1)],8,yKe)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.subNerves,(S,E)=>(r.openBlock(),r.createElementBlock("div",{class:"attribute-content",style:{"margin-left":"1rem"},"origin-item-label":S,key:S,onMouseenter:_=>i.onConnectivityHovered(S),onMouseleave:t[3]||(t[3]=_=>i.onConnectivityHovered())},[r.createVNode(c,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:r.withCtx(()=>[r.createVNode(l,{class:"magnify-glass",onClick:_=>i.onConnectivityClicked(S)},{default:r.withCtx(()=>[r.createVNode(v)]),_:2},1032,["onClick"])]),default:r.withCtx(()=>[t[14]||(t[14]=r.createElementVNode("span",null,"Search sub nerve",-1))]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(i.capitalise(S)),1)],40,vKe))),128))]))),256))])):r.createCommentVNode("",!0),r.withDirectives(r.createElementVNode("div",bKe,[r.withDirectives((r.openBlock(),r.createBlock(y,{key:`${i.connectivityKey}list`,entry:i.entry,origins:i.origins,components:i.components,destinations:i.destinations,originsWithDatasets:i.originsWithDatasets,componentsWithDatasets:i.componentsWithDatasets,destinationsWithDatasets:i.destinationsWithDatasets,availableAnatomyFacets:n.availableAnatomyFacets,connectivityError:e.connectivityError,onConnectivityHovered:i.onConnectivityHovered,onConnectivityClicked:i.onConnectivityClicked,onConnectivityActionClick:i.onConnectivityActionClick},null,8,["entry","origins","components","destinations","originsWithDatasets","componentsWithDatasets","destinationsWithDatasets","availableAnatomyFacets","connectivityError","onConnectivityHovered","onConnectivityClicked","onConnectivityActionClick"])),[[w,e.connectivityLoading]])],512),[[r.vShow,e.activeView==="listView"]]),r.withDirectives(r.createElementVNode("div",wKe,[e.graphViewLoaded?r.withDirectives((r.openBlock(),r.createBlock(b,{key:`${i.connectivityKey}graph`,entry:i.entry.featureId[0],mapServer:i.flatmapApi,sckanVersion:i.sckanVersion,connectivityFromMap:e.connectivityFromMap,connectivityError:e.connectivityError,onTapNode:i.onTapNode},null,8,["entry","mapServer","sckanVersion","connectivityFromMap","connectivityError","onTapNode"])),[[w,e.connectivityLoading]]):r.createCommentVNode("",!0)],512),[[r.vShow,e.activeView==="graphView"]]),i.resources.length?(r.openBlock(),r.createElementBlock("div",xKe,[r.createVNode(x,{resources:i.resources,onReferencesLoaded:i.onReferencesLoaded,onShowReferenceConnectivities:i.onShowReferenceConnectivities,onTrackEvent:i.onTrackEvent},null,8,["resources","onReferencesLoaded","onShowReferenceConnectivities","onTrackEvent"])])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)}const VK=Ao(tKe,[["render",kKe],["__scopeId","data-v-589e4c5c"]]),CKe={name:"ConnectivityCard",data(){return{displayFields:["id","nerve-label"]}},props:{entry:{type:Object,default:()=>{}},connectivityEntry:{type:Array,default:()=>[]}},computed:{loading:function(){if("ready"in this.entry)return!this.entry.ready;const e=this.connectivityEntry.find(t=>t.id===this.entry.id);return e?!e.ready:!1}},methods:{capitalise:function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},cardClicked:function(e){this.loading||(this.$emit("open-connectivity",e),lt.emit("trackEvent",{event_name:"portal_maps_connectivity_open",category:e.id||"",location:"map_sidebar_connectivity"}))}}},SKe={class:"connectivity-card-container",ref:"container"},EKe={class:"connectivity-card",ref:"card"},_Ke={class:"card-title"},$Ke={key:0,class:"card-details"},FKe={key:0,class:"card-tags"},AKe={key:1};function TKe(e,t,n,o,a,i){const s=jl,l=Nd;return r.openBlock(),r.createElementBlock("div",SKe,[r.createElementVNode("div",EKe,[t[1]||(t[1]=r.createElementVNode("div",{class:"seperator-path"},null,-1)),r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:"card-content",onClick:t[0]||(t[0]=c=>i.cardClicked(n.entry))},[r.createElementVNode("div",_Ke,r.toDisplayString(i.capitalise(n.entry.label)),1),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.displayFields,c=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:c},[n.entry[c]?(r.openBlock(),r.createElementBlock("div",$Ke,[r.createElementVNode("strong",null,r.toDisplayString(c)+":",1),c==="nerve-label"?(r.openBlock(),r.createElementBlock("div",FKe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.entry[c],d=>(r.openBlock(),r.createElementBlock("div",{key:d.nerve},[r.createVNode(s,{type:"primary",size:"small"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(d.nerve),1)]),_:2},1024),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.subNerves,u=>(r.openBlock(),r.createBlock(s,{type:"primary",size:"small"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(u),1)]),_:2},1024))),256))]))),128))])):(r.openBlock(),r.createElementBlock("span",AKe,r.toDisplayString(n.entry[c]),1))])):r.createCommentVNode("",!0)],64))),128))])),[[l,i.loading]])],512)],512)}const DK=Ao(CKe,[["render",TKe],["__scopeId","data-v-4c16c9d7"]]);var BKe={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,start:0};const NKe={components:{SearchFilters:x1,SearchHistory:w1,ConnectivityCard:DK,ConnectivityInfo:VK,Button:Cr,Card:m0,Checkbox:VE,Icon:kt,Input:$d,Pagination:w0,MapSvgIcon:Wq,MapSvgSpriteColor:BK},name:"ConnectivityExplorer",props:{connectivityKnowledge:{type:Array,default:[]},entry:{type:Object,default:()=>BKe},envVars:{type:Object,default:()=>{}},connectivityEntry:{type:Array,default:[]},availableAnatomyFacets:{type:Object,default:[]},connectivityFilterOptions:{type:Array,default:[]},showVisibilityFilter:{type:Boolean,default:!1}},data:function(){return{...this.entry,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1,freezeTimeout:void 0,freezed:!1,initLoading:!0,expanded:"",filterVisibility:!0,expandedData:null}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter,options:this.connectivityFilterOptions,showFilters:!0,helper:{within:"'CNS' OR 'Local circuit neuron'",between:"'Somatic lower motor' AND 'Human'"}}},paginatedResults:function(){return this.results.slice(this.start,this.start+this.numberPerPage)}},watch:{connectivityKnowledge:function(e,t){this.expanded="",this.expandedData=null,this.loadingCards=!1,JSON.stringify(e)!==JSON.stringify(t)&&(this.results=e,this.initLoading=!1,this.numberOfHits=this.results.length,this.numberOfHits>0&&"ready"in this.results[0]&&(this.$refs.filtersRef.checkShowAllBoxes(),this.searchInput="",this.filter=[]))},connectivityEntry:function(e,t){if(JSON.stringify(e)!==JSON.stringify(t)&&e.length===1&&e[0].ready){const n=this.filter.some(o=>o.facet!=="Show all");if(this.numberOfHits===1&&!this.searchInput&&!n||(e[0].connectivitySource!==t[0].connectivitySource||e[0].mapId!==t[0].mapId)&&t[0].ready)return;this.collapseChange(e[0])}},paginatedResults:function(){this.loadingCards=!1},filterVisibility:function(e){this.filterVisibility=e,this.$emit("filter-visibility",this.filterVisibility)}},methods:{freezeHoverChange:function(){this.freezed=!0,this.freezeTimeout&&clearTimeout(this.freezeTimeout),this.freezeTimeout=setTimeout(()=>{this.freezed=!1},3e3)},onShowConnectivity:function(e){this.freezeHoverChange(),this.$emit("show-connectivity",e)},onShowReferenceConnectivities:function(e){this.freezeHoverChange(),this.$emit("show-reference-connectivities",e)},onConnectivityClicked:function(e){this.searchInput=e.query,this.searchAndFilterUpdate()},collapseChange:function(e){this.expanded=this.expanded===e.id?"":e.id,this.expandedData=this.expanded?e:null},closeConnectivity:function(){this.expanded||this.$emit("connectivity-item-close")},onConnectivityCollapseChange:function(e){this.connectivityEntry.find(t=>t.featureId[0]===e.id)?(this.collapseChange(e),this.closeConnectivity()):(this.expanded="",this.expandedData=null,this.$nextTick(()=>{this.$emit("connectivity-collapse-change",e)}))},onHoverChanged:function(e,t){const{target:n}=e;(t||n&&n.checkVisibility())&&this.hoverChanged(t)},hoverChanged:function(e){if(!this.freezed){let t={tabType:"connectivity"};e?t={...t,...e}:this.expandedData&&(t={...t,...this.expandedData}),this.$emit("hover-changed",t)}},resetSearch:function(){this.numberOfHits=0,this.results=[],this.loadingCards=!1},resetSearchIfNoActiveSearch:function(){const e=this.filter.some(t=>t.facet!=="Show all");!this.searchInput&&!e&&this.openSearch([],"")},onResetClick:function(){this.openSearch([],""),this.$emit("search-changed",{value:[],tabType:"dataset",type:"reset-update"}),lt.emit("trackEvent",{event_name:"portal_maps_action_filter",category:"reset",location:"map_sidebar_connectivity"})},openSearch:function(e,t=""){if(this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady){const n=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),o=n.notFound?n.notFound.filter(a=>a.facet.toLowerCase()!=="show all"):[];this.filter=n.result,o.forEach(a=>{const i=a.tagLabel||a.facet,s=i.charAt(0).toLowerCase()+i.slice(1);let l="";a.term.toLowerCase()==="origin"?l=`There are no neuron populations beginning at <strong>${s}</strong>.`:a.term.toLowerCase()==="via"?l=`There are no neuron populations that run through <strong>${s}</strong>.`:a.term.toLowerCase()==="destination"?l=`There are no neuron populations terminating at <strong>${s}</strong>.`:l=`There are no neuron populations beginning, terminating, or running through <strong>${s}</strong>.`,pj({dangerouslyUseHTMLString:!0,message:l,appendTo:this.$el,showClose:!0,offset:113})}),o.length&&this.$emit("search-changed",{value:o,tabType:"dataset",type:"reset-update"}),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchKnowledge(this.filter,t),this.$refs.filtersRef.setCascader(this.filter),this.searchHistoryUpdate(this.filter,t))}else this.filter=e,(!e||e.length==0)&&(this.searchKnowledge(this.filter,t),this.searchHistoryUpdate(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.searchAndFilterUpdate()},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filter=[...e],this.searchAndFilterUpdate()},searchAndFilterUpdate:function(){this.resetPageNavigation(),this.searchKnowledge(this.filter,this.searchInput),this.searchHistoryUpdate(this.filter,this.searchInput)},searchHistoryUpdate:function(e,t){this.$refs.searchHistory.selectValue="Search history",(e.length||t!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(this.filter,t)},searchKnowledge:function(e,t=""){this.expanded="",this.expandedData=null,this.loadingCards=!0,this.scrollToTop(),this.$emit("search-changed",{query:t,filter:e,tabType:"connectivity"}),this.lastSearch=t},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,lt.emit("trackEvent",{event_name:"portal_maps_connectivity_perPage",category:e+"",location:"map_sidebar_connectivity"});const t=this.page===1;this.pageChange(1,t)},pageChange:function(e,t=!1){this.start=(e-1)*this.numberPerPage,this.page=e,this.expanded="",this.expandedData=null,this.scrollToTop(),t||lt.emit("trackEvent",{event_name:"portal_maps_connectivity_pagination",category:`page_${this.page}`,location:"map_sidebar_connectivity"})},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},searchHistorySearch:function(e){this.searchInput=e.search,this.filter=e.filters,this.openSearch([...e.filters],e.search)},onConnectivityInfoLoaded:function(e){const t=this.$refs["stepItem-"+e.id],n=this.$refs.content;this.$nextTick(()=>{n&&t&&t[0]&&(n.scrollTop=t[0].offsetTop)})},getSearch:function(){return this.searchInput},getFilters:function(){return this.filter.some(e=>e.facet.toLowerCase()!=="show all")?this.filter:[]}},mounted:function(){localStorage.removeItem("connectivity-active-view"),this.openSearch(this.filter,this.searchInput),lt.on("close-connectivity",()=>{this.expanded="",this.expandedData=null})}},MKe={class:"header"},OKe={key:0,class:"visibility-filter"},LKe={key:0,class:"error-feedback"},IKe=["onMouseenter"];function RKe(e,t,n,o,a,i){const s=r.resolveComponent("MapSvgSpriteColor"),l=$d,c=Cr,d=VE,u=r.resolveComponent("MapSvgIcon"),f=ip,p=x1,m=w1,h=DK,g=VK,v=w0,y=m0,b=Nd;return r.openBlock(),r.createBlock(y,{"body-style":e.bodyStyle,class:"content-card"},{header:r.withCtx(()=>[r.createElementVNode("div",MKe,[r.createVNode(l,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=x=>e.searchInput=x),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),r.createVNode(c,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:r.withCtx(()=>t[5]||(t[5]=[r.createTextVNode(" Search ")])),_:1},8,["onClick"]),r.createVNode(c,{link:"",class:"el-button-link",onClick:i.onResetClick,size:"large"},{default:r.withCtx(()=>t[6]||(t[6]=[r.createTextVNode(" Reset ")])),_:1},8,["onClick"]),n.showVisibilityFilter?(r.openBlock(),r.createElementBlock("div",OKe,[r.createVNode(d,{modelValue:e.filterVisibility,"onUpdate:modelValue":t[1]||(t[1]=x=>e.filterVisibility=x)},{default:r.withCtx(()=>t[7]||(t[7]=[r.createTextVNode(" Focused ")])),_:1},8,["modelValue"]),r.createVNode(f,{title:"How does focused checkbox work?",width:"250",trigger:"hover","popper-class":"filter-help-popover"},{reference:r.withCtx(()=>[r.createVNode(u,{icon:"help",class:"help"})]),default:r.withCtx(()=>[t[8]||(t[8]=r.createElementVNode("div",null,[r.createElementVNode("strong",null,"Checked:"),r.createElementVNode("br"),r.createTextVNode(" Display listed or highlighted items only. "),r.createElementVNode("br"),r.createElementVNode("br"),r.createElementVNode("strong",null,"Unchecked:"),r.createElementVNode("br"),r.createTextVNode(" Display listed or highlighted items in full colour and non-listed items in greyscale. ")],-1))]),_:1})])):r.createCommentVNode("",!0)])]),default:r.withCtx(()=>[r.createVNode(s),r.createVNode(p,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:n.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),r.createVNode(m,{ref:"searchHistory",localStorageKey:"sparc.science-connectivity-search-history",onSearch:i.searchHistorySearch},null,8,["onSearch"]),r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:"content scrollbar",ref:"content",onMouseleave:t[4]||(t[4]=x=>i.onHoverChanged(x,void 0))},[e.results.length===0&&!e.loadingCards?(r.openBlock(),r.createElementBlock("div",LKe," No results found - Please change your search / filter criteria. ")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.paginatedResults,x=>(r.openBlock(),r.createElementBlock("div",{key:x.id,ref_for:!0,ref:"stepItem-"+x.id,class:"step-item",onMouseenter:w=>i.onHoverChanged(w,x)},[r.withDirectives(r.createVNode(h,{class:"connectivity-card",entry:x,connectivityEntry:n.connectivityEntry,onOpenConnectivity:i.onConnectivityCollapseChange},null,8,["entry","connectivityEntry","onOpenConnectivity"]),[[r.vShow,e.expanded!==x.id]]),e.expanded===x.id?(r.openBlock(),r.createBlock(g,{key:0,class:"connectivity-info",entryId:x.id,connectivityEntry:n.connectivityEntry,availableAnatomyFacets:n.availableAnatomyFacets,envVars:n.envVars,withCloseButton:!0,onShowConnectivity:i.onShowConnectivity,onShowReferenceConnectivities:i.onShowReferenceConnectivities,onConnectivityClicked:i.onConnectivityClicked,onConnectivityHovered:t[2]||(t[2]=w=>e.$emit("connectivity-hovered",w)),onLoaded:w=>i.onConnectivityInfoLoaded(x),onCloseConnectivity:w=>i.onConnectivityCollapseChange(x)},null,8,["entryId","connectivityEntry","availableAnatomyFacets","envVars","onShowConnectivity","onShowReferenceConnectivities","onConnectivityClicked","onLoaded","onCloseConnectivity"])):r.createCommentVNode("",!0)],40,IKe))),128)),r.createVNode(v,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[3]||(t[3]=x=>e.page=x),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])],32)),[[b,e.loadingCards||e.initLoading]])]),_:1},8,["body-style"])}const zK=Ao(NKe,[["render",RKe],["__scopeId","data-v-d9061656"]]),PKe={name:"AnnotationTool",components:{AnnotationPopup:mme,Button:Cr,CreateTooltipContent:wme,Col:HE,ElIconDelete:eh,Icon:kt,Row:jE},props:{annotationEntry:{type:Array},createData:{type:Object,default:{}}},data:function(){return{ElIconDelete:r.shallowRef(eh),annotationPopupData:null}}},VKe={class:"annotation-tool scrollbar"},DKe={key:1,class:"delete-container"};function zKe(e,t,n,o,a,i){const s=r.resolveComponent("CreateTooltipContent"),l=r.resolveComponent("annotation-popup"),c=HE,d=Cr,u=jE;return r.openBlock(),r.createElementBlock("div",VKe,[r.withDirectives(r.createVNode(s,{createData:n.createData,onConfirmCreate:t[0]||(t[0]=f=>e.$emit("confirm-create",f)),onCancelCreate:t[1]||(t[1]=f=>e.$emit("cancel-create")),class:"create-tooltip-content"},null,8,["createData"]),[[r.vShow,n.createData&&n.createData.toBeConfirmed]]),n.annotationEntry&&(!n.createData||!n.createData.toBeConfirmed)?(r.openBlock(),r.createBlock(l,{key:0,class:"annotation-popup",annotationEntry:n.annotationEntry,onAnnotation:t[2]||(t[2]=f=>e.$emit("annotation",f)),onHoverChanged:t[3]||(t[3]=f=>e.$emit("hover-changed",f)),onTrackEvent:t[4]||(t[4]=f=>e.$emit("trackEvent",f))},null,8,["annotationEntry"])):r.createCommentVNode("",!0),n.createData&&n.createData.toBeDeleted?(r.openBlock(),r.createElementBlock("div",DKe,[r.createVNode(u,null,{default:r.withCtx(()=>[r.createVNode(c,{offset:1,span:6},{default:r.withCtx(()=>t[7]||(t[7]=[r.createTextVNode("Delete this feature?")])),_:1}),r.createVNode(c,{offset:1,span:3},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",icon:e.ElIconDelete,onClick:t[5]||(t[5]=f=>e.$emit("confirm-delete"))},{default:r.withCtx(()=>t[8]||(t[8]=[r.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),r.createVNode(c,{offset:1,span:2},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",onClick:t[6]||(t[6]=f=>e.$emit("cancel-create"))},{default:r.withCtx(()=>t[9]||(t[9]=[r.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):r.createCommentVNode("",!0)])}const jK=Ao(PKe,[["render",zKe],["__scopeId","data-v-7acfbf0c"]]),jKe={name:"Tabs",components:{ElIconClose:Wr},props:{tabEntries:{type:Array,default:()=>[]},activeId:{type:Number,default:1},contextArray:{type:Array,default:()=>[]}},computed:{tabs:function(){const e=this.tabEntries.filter(o=>!o.closable),t=this.tabEntries.filter(o=>o.closable);let n=e.concat(t);if(this.contextArray.length)for(let o in n)n[o].contextCard=this.contextArray[o];return n}},methods:{tabClicked:function(e){this.$emit("tabClicked",{id:e.id,type:e.type}),this.$emit("trackEvent",{event:"interaction_event",event_name:"portal_maps_sidebar_open_tab",category:e.type,location:"map_sidebar_tabs"})},tabClosed:function(e){this.$emit("tabClosed",{id:e.id,type:e.type})}}},HKe={class:"tabs-container"},UKe=["onClick"],qKe={class:"tab-title"};function KKe(e,t,n,o,a,i){const s=Wr,l=kt;return r.openBlock(),r.createElementBlock("div",HKe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.tabs,c=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["tab",{"active-tab":c.id==n.activeId}]),key:c.id,onClick:d=>i.tabClicked(c)},[r.createElementVNode("span",qKe,r.toDisplayString(c.title),1),c.closable?(r.openBlock(),r.createBlock(l,{key:0,onClick:r.withModifiers(d=>i.tabClosed(c),["stop"]),class:"tab-close-icon"},{default:r.withCtx(()=>[r.createVNode(s)]),_:2},1032,["onClick"])):r.createCommentVNode("",!0)],10,UKe))),128))])}const HK=Ao(jKe,[["render",KKe],["__scopeId","data-v-744b6365"]]),GKe={components:{DatasetExplorer:PK,Tabs:HK,ElIconArrowLeft:G1,ElIconArrowRight:cu,Drawer:UE,Icon:kt,AnnotationTool:jK,ConnectivityExplorer:zK},name:"SideBar",props:{tabs:{type:Array,default:[{title:"Dataset Explorer",id:1,type:"datasetExplorer",closable:!1},{title:"Connectivity Explorer",id:2,type:"connectivityExplorer",closable:!1},{title:"Annotation",id:3,type:"annotation",closable:!0}]},visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},openAtStart:{type:Boolean,default:!1},connectivityEntry:{type:Array,default:[]},annotationEntry:{type:Array,default:[]},createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},connectivityKnowledge:{type:Array,default:[]},filterOptions:{type:Array,default:[]},showVisibilityFilter:{type:Boolean,default:!1}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[],activeTabId:1,activeAnnotationData:{tabType:"annotation"},activeConnectivityData:{tabType:"connectivity"},state:{dataset:{search:"",filters:[]},connectivity:{search:"",filters:[]},connectivityEntries:[],annotationEntries:[],activeTabId:this.activeTabId}}},methods:{onConnectivityCollapseChange:function(e){this.$emit("connectivity-collapse-change",e)},onConnectivityItemClose:function(){this.$emit("connectivity-item-close")},hoverChanged:function(e,t){this.$emit("hover-changed",{...t,tabId:e});const n=this.getActiveTabTypeById(e);n==="connectivityExplorer"&&(this.activeConnectivityData=t),n==="annotation"&&(this.activeAnnotationData=t)},showConnectivity:function(e){this.$emit("show-connectivity",e)},onShowReferenceConnectivities:function(e){this.$emit("show-reference-connectivities",e)},onConnectivityHovered:function(e){this.$emit("connectivity-hovered",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,tabId:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openConnectivitySearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getTabRef(void 0,"connectivityExplorer",!0).openSearch(e,t)})},resetConnectivitySearch:function(){this.$nextTick(()=>{this.getTabRef(void 0,"connectivityExplorer",!1).resetSearchIfNoActiveSearch()})},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getTabRef(void 0,"datasetExplorer",!0).openSearch(e,t)})},getTabRef:function(e,t,n=!1){const o=this.tabEntries.filter(s=>(e===void 0||s.id===e)&&(t===void 0||s.type===t)),a=o.length?o:this.tabEntries,i=a[0].type+"Tab_"+a[0].id;return n&&this.setActiveTab({id:a[0].id,type:a[0].type}),!this.$refs[i]||this.$refs[i].length===0?null:this.$refs[i][0]},addFilter:function(e){if(e){this.drawerOpen=!0;let t=e;Array.isArray(e)?t.forEach(n=>n.AND=!0):(e.AND=!0,t=[e]),this.$nextTick(()=>{this.getTabRef(void 0,"datasetExplorer",!0).addFilter(t)})}},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getTabRef(void 0,"datasetExplorer",!0).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getTabRef(void 0,"datasetExplorer").getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},setActiveTab:function(e){const t=this.tabs.filter(o=>o.id===e.id&&o.type===e.type),n=t.length?t:this.tabEntries;this.activeTabId=n[0].id},getActiveTabTypeById:function(e){const t=this.tabs.find(n=>n.id===e);return t?t.type:""},highlightActiveTabData:function(e){let t=null;if(e.type==="connectivityExplorer"){const n=this.getTabRef(void 0,"connectivityExplorer",!0);n&&!n.expanded?t={tabType:"connectivity"}:t={...this.activeConnectivityData}}else e.type==="annotation"&&(t={...this.activeAnnotationData});t&&this.$emit("hover-changed",{...t,tabId:e.id})},tabClicked:function(e){this.setActiveTab(e),this.$emit("tabClicked",e),this.highlightActiveTabData(e)},tabClosed:function(e){this.$emit("tabClosed",e)},updateConnectivityError:function(e){lt.emit("connectivity-error",e)},storeAvailableAnatomyFacets:function(e){localStorage.setItem("available-anatomy-facets",JSON.stringify(e))},closeConnectivity:function(){lt.emit("close-connectivity")},updateState:function(){this.state.activeTabId=this.activeTabId;const e=this.getTabRef(void 0,"datasetExplorer");e&&(this.state.dataset.search=e.getSearch(),this.state.dataset.filters=IK(e.getFilters()));const t=this.getTabRef(void 0,"connectivityExplorer");t&&(this.state.connectivity.search=t.getSearch(),this.state.connectivity.filters=t.getFilters()),this.connectivityEntry&&this.connectivityEntry.length>0&&(this.state.connectivityEntries=this.connectivityEntry.map(n=>n.id)),this.annotationEntry&&this.annotationEntry.length>0&&(this.state.annotationEntries=this.annotationEntry.map(n=>n.models))},getState:function(){return this.updateState(),this.state},setState:function(e){if(!e||!e.dataset||!e.connectivity)return;this.state=JSON.parse(JSON.stringify(e));const t=e.dataset.filters,n=e.connectivity.filters,o=e.dataset.search,a=e.connectivity.search;(t.length||o)&&this.openSearch(t,o),(n.length||a)&&this.openConnectivitySearch(n,a),e.activeTabId&&this.$nextTick(()=>{this.tabEntries.find(i=>i.id===e.activeTabId)&&(this.activeTabId=e.activeTabId)})},trackEvent:function(e){const t={event:"interaction_event",location:"map_sidebar",...e};this.$emit("trackEvent",t)}},computed:{tabEntries:function(){return this.tabs.filter(e=>e.type==="datasetExplorer"||e.type==="connectivityExplorer"||e.type==="annotation"&&this.annotationEntry&&this.annotationEntry.length>0)}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){lt.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),lt.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),lt.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),lt.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),lt.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),lt.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"datasetExplorer"}),this.$emit("actionClick",e)}),lt.on("connectivity-source-change",e=>{this.$emit("connectivity-source-change",e)}),lt.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children,this.storeAvailableAnatomyFacets(this.availableAnatomyFacets)}),lt.on("trackEvent",e=>{this.trackEvent(e)})}},WKe={ref:"container"},XKe={class:"box-card"},YKe={class:"sidebar-container"};function JKe(e,t,n,o,a,i){const s=G1,l=kt,c=cu,d=HK,u=jK,f=zK,p=PK,m=UE;return r.openBlock(),r.createElementBlock("div",WKe,[e.drawerOpen?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...h)=>i.toggleDrawer&&i.toggleDrawer(...h)),class:"open-tab"},[r.createVNode(l,null,{default:r.withCtx(()=>[r.createVNode(s)]),_:1})])),r.createVNode(m,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[7]||(t[7]=h=>e.drawerOpen=h),teleported:!1,"modal-append-to-body":!1,size:"584","with-header":!1,wrapperClosable:!1,modal:!1,"modal-class":"sidebar-body","z-index":10,"lock-scroll":!1},{default:r.withCtx(()=>[r.createElementVNode("div",XKe,[e.drawerOpen?(r.openBlock(),r.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...h)=>i.close&&i.close(...h)),class:"close-tab"},[r.createVNode(l,null,{default:r.withCtx(()=>[r.createVNode(c)]),_:1})])):r.createCommentVNode("",!0),r.createElementVNode("div",YKe,[i.tabEntries.length>1?(r.openBlock(),r.createBlock(d,{key:0,tabEntries:i.tabEntries,activeId:e.activeTabId,onTabClicked:i.tabClicked,onTabClosed:i.tabClosed,onTrackEvent:i.trackEvent},null,8,["tabEntries","activeId","onTabClicked","onTabClosed","onTrackEvent"])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.tabs,h=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:"tab.id"},[h.type==="annotation"?r.withDirectives((r.openBlock(),r.createBlock(u,{key:0,ref_for:!0,ref:"annotationTab_"+h.id,annotationEntry:n.annotationEntry,createData:n.createData,onAnnotation:t[2]||(t[2]=g=>e.$emit("annotation-submitted",g)),onConfirmCreate:t[3]||(t[3]=g=>e.$emit("confirm-create",g)),onCancelCreate:t[4]||(t[4]=g=>e.$emit("cancel-create")),onConfirmDelete:t[5]||(t[5]=g=>e.$emit("confirm-delete",g)),onHoverChanged:g=>i.hoverChanged(h.id,g),onTrackEvent:i.trackEvent},null,8,["annotationEntry","createData","onHoverChanged","onTrackEvent"])),[[r.vShow,h.id===e.activeTabId]]):h.type==="connectivityExplorer"?r.withDirectives((r.openBlock(),r.createBlock(f,{key:1,ref_for:!0,ref:"connectivityExplorerTab_"+h.id,connectivityKnowledge:n.connectivityKnowledge,envVars:n.envVars,connectivityEntry:n.connectivityEntry,availableAnatomyFacets:e.availableAnatomyFacets,onFilterVisibility:t[6]||(t[6]=g=>e.$emit("filter-visibility",g)),connectivityFilterOptions:n.filterOptions,showVisibilityFilter:n.showVisibilityFilter,onSearchChanged:g=>i.searchChanged(h.id,g),onHoverChanged:g=>i.hoverChanged(h.id,g),onShowConnectivity:i.showConnectivity,onShowReferenceConnectivities:i.onShowReferenceConnectivities,onConnectivityHovered:i.onConnectivityHovered,onConnectivityCollapseChange:i.onConnectivityCollapseChange,onConnectivityItemClose:i.onConnectivityItemClose},null,8,["connectivityKnowledge","envVars","connectivityEntry","availableAnatomyFacets","connectivityFilterOptions","showVisibilityFilter","onSearchChanged","onHoverChanged","onShowConnectivity","onShowReferenceConnectivities","onConnectivityHovered","onConnectivityCollapseChange","onConnectivityItemClose"])),[[r.vShow,h.id===e.activeTabId]]):r.withDirectives((r.openBlock(),r.createBlock(p,{key:2,class:"sidebar-content-container",contextCardEntry:h.contextCard,envVars:n.envVars,ref_for:!0,ref:"datasetExplorerTab_"+h.id,onSearchChanged:g=>i.searchChanged(h.id,g),onHoverChanged:g=>i.hoverChanged(h.id,g)},null,8,["contextCardEntry","envVars","onSearchChanged","onHoverChanged"])),[[r.vShow,h.id===e.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const ZKe=Ao(GKe,[["render",JKe],["__scopeId","data-v-353bb9df"]]);/*! js-cookie v3.0.5 | MIT */function k1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var QKe={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function g5(e,t){function n(a,i,s){if(!(typeof document>"u")){s=k1({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in s)s[c]&&(l+="; "+c,s[c]!==!0&&(l+="="+s[c].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+l}}function o(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],s={},l=0;l<i.length;l++){var c=i[l].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(s[u]=e.read(d,u),a===u)break}catch{}}return a?s[a]:s}}return Object.create({set:n,get:o,remove:function(a,i){n(a,"",k1({},i,{expires:-1}))},withAttributes:function(a){return g5(this.converter,k1({},this.attributes,a))},withConverter:function(a){return g5(k1({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var y5=g5(QKe,{path:"/"}),Ha=function(e,t,n,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},dn=function(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)},Mi,Ip,Ua,yr,Vs;const eGe=1e4;class tGe{constructor(t){Mi.add(this),Ip.set(this,void 0),Ua.set(this,null),yr.set(this,null),t.slice(-1)==="/"?Ha(this,Ip,t.slice(0,-1),"f"):Ha(this,Ip,t,"f")}get currentUser(){return dn(this,Ua,"f")}get currentError(){return dn(this,yr,"f")}async authenticate(t){Ha(this,yr,null,"f"),Ha(this,Ua,null,"f");const n=await dn(this,Mi,"m",Vs).call(this,t,"authenticate");return"error"in n?(y5.remove("annotation-key"),Promise.resolve(dn(this,yr,"f"))):(y5.set("annotation-key",n.session,{secure:!0,expires:1}),Ha(this,Ua,n.data,"f"),Promise.resolve(dn(this,Ua,"f")))}async unauthenticate(t){Ha(this,yr,null,"f"),Ha(this,Ua,null,"f");const n=await dn(this,Mi,"m",Vs).call(this,t,"unauthenticate");return"success"in n?Promise.resolve(n):Promise.resolve(dn(this,yr,"f"))}async annotatedItemIds(t,n,o,a){const i={resource:n};o!==void 0&&(i.user=o),a!==void 0&&(i.participated=a);const s=await dn(this,Mi,"m",Vs).call(this,t,"items/","GET",i);return"error"in s?Promise.resolve(dn(this,yr,"f")):Promise.resolve(s)}async drawnFeatures(t,n,o){const a={resource:n};o!==void 0&&(a.items=o);const i=await dn(this,Mi,"m",Vs).call(this,t,"features/","GET",a);return"error"in i?Promise.resolve(dn(this,yr,"f")):Promise.resolve(i)}async itemAnnotations(t,n,o){const a=await dn(this,Mi,"m",Vs).call(this,t,"annotations/","GET",{resource:n,item:o});return"error"in a?Promise.resolve(dn(this,yr,"f")):Promise.resolve(a)}async annotation(t,n){const o=await dn(this,Mi,"m",Vs).call(this,t,"annotation/","GET",{annotation:n});return"error"in o?Promise.resolve(dn(this,yr,"f")):Promise.resolve(o)}async addAnnotation(t,n){if(dn(this,Ua,"f")&&dn(this,Ua,"f").canUpdate){const o=Object.assign({creator:dn(this,Ua,"f"),created:new Date().toISOString()},n),a=await dn(this,Mi,"m",Vs).call(this,t,"annotation/","POST",{data:o});if(!("error"in a))return Promise.resolve(a);Ha(this,yr,a,"f")}else Ha(this,yr,{error:"user cannot add annotation"},"f");return Promise.resolve(dn(this,yr,"f"))}}Ip=new WeakMap,Ua=new WeakMap,yr=new WeakMap,Mi=new WeakSet,Vs=async function(t,n,o="GET",a={}){let i=!0;const s=new AbortController;setTimeout(()=>{i&&(console.log("Annotation server timeout..."),s.abort())},eGe);const l={method:o,signal:s.signal};let c=`${dn(this,Ip,"f")}/${n}`;const d=y5.get("annotation-key")||"";if(o==="GET"){const f=[];for(const[p,m]of Object.entries(a))f.push(`${p}=${encodeURIComponent(JSON.stringify(m))}`);f.push(`key=${encodeURIComponent(t)}`),f.push(`session=${encodeURIComponent(d)}`),c+="?"+f.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(o==="POST"){const f=Object.assign({key:t,session:d},a);l.body=JSON.stringify(f),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const u=await fetch(c,l);return i=!1,u.ok?Promise.resolve(await u.json()):(Ha(this,yr,{error:`${u.status} ${u.statusText}`},"f"),Promise.resolve(dn(this,yr,"f")))};const nGe=Mt.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}}),UK=e=>{const t=[];return e&&e.forEach(n=>{n.label&&t.push(n.label.toLowerCase()),t.push(...UK(n.children))}),t},qK=(e,t)=>{const n=[];for(const o of e.facets)o in t?n.push(t[o]):n.push(o);return n},rGe={name:"SplitFlow",components:{Container:T3,Header:B3,Main:N3,DialogToolbarContent:NV,SplitDialog:TV,SideBar:ZKe},setup(){const e=nGe();r.provide("userApiKey",e.userToken);const t=vi();let n=r.markRaw(new tGe(`${t.flatmapAPI}annotator`));return r.provide("$annotator",n),{annotator:n}},props:{state:{type:Object,default:void 0}},data:function(){return{availableFacets:void 0,availableNameCurieMapping:void 0,sideBarVisibility:!0,startUp:!0,sidebarStateRestored:!1,sidebarAnnotationState:!1,search:"",expanded:"",filterTriggered:!1,connectivityEntry:[],annotationEntry:[],annotationCallback:void 0,confirmCreateCallback:void 0,cancelCreateCallback:void 0,confirmDeleteCallback:void 0,confirmCommentCallback:void 0,createData:{},connectivityProcessed:!1,connectivityHighlight:[],connectivityKnowledge:[],connectivityExplorerClicked:[],showVisibilityFilter:!1,filterVisibility:!0,filterOptions:[],annotationHighlight:[]}},watch:{state:{handler:function(e){e&&(this._externalStateSet||this.setState(e),this._externalStateSet=!0,this.updateGlobalSettingsFromState(e))},immediate:!0},connectivityHighlight:{handler:function(){this.hoverChanged({tabType:"connectivity"}),this.onFilterVisibility(this.filterVisibility)}},annotationHighlight:{handler:function(){this.hoverChanged({tabType:"annotation"})}}},methods:{onFilterVisibility:function(e){this.filterVisibility=e;const t={OR:[{NOT:{"tile-layer":"pathways"}},{AND:[{"tile-layer":"pathways"},{models:this.connectivityHighlight}]}]},o=this.filterVisibility&&this.connectivityProcessed?t:void 0;$e.emit("filter-visibility",o)},onConnectivityCollapseChange:function(e){this.expanded=e.id;const t=this.$refs.splitdialog;if(t){const n=t.getActiveContents(),o=n.find(s=>s.viewerType.includes("Flatmap")),a=n.find(s=>s.activeSpecies==="Human Male");let i=!1;n.forEach(s=>{const l=s.viewerType==="Flatmap"||s.viewerType==="MultiFlatmap";(o&&l||o&&!a&&!l&&!i||!o&&!i)&&(this.connectivityExplorerClicked.push(!0),s.onLoadConnectivityDetail({data:[e]}),l||(i=!0))})}},onConnectivityItemClose:function(){$e.emit("connectivity-item-close")},getActiveFlatmaps:function(){const e=[];let t=this.$refs.splitdialog;return t&&t.getActiveContents().forEach(o=>{if(o!=null&&o.$refs.viewer){const a=o.$refs.viewer,i=a.flatmapRef,s=a.multiflatmapRef;let l=null;i&&(l=i),s&&(l=s.getCurrentFlatmap()),l&&e.push(l)}}),e},actionClick:function(e){if(e){if(!this.availableFacets||this.availableFacets.length===0){const t=localStorage.getItem("available-anatomy-facets"),n=t?JSON.parse(t):[];this.availableFacets=r.markRaw([...new Set(UK(n))])}if(!this.availableNameCurieMapping||Object.keys(this.availableNameCurieMapping).length===0){const t=localStorage.getItem("available-name-curie-mapping"),n=t?JSON.parse(t):{};this.availableNameCurieMapping=r.markRaw(n)}if(e.type=="Search")if(e.nervePath)this.openSearch([e.filter],e.label);else{this.openSearch([],e.term);const t=e.featuredDataset?"portal_maps_featured_dataset_search":"portal_maps_action_search";Tt.sendEvent({event:"interaction_event",event_name:t,category:e.term||"filter",location:"map_location_pin"}),this.filterTriggered=!0}else if(e.type=="URL")window.open(e.resource,"_blank");else if(e.type=="Facet"){if(this.$refs.sideBar){const t={facetPropPath:"anatomy.organ.category.name",facetSubPropPath:"anatomy.organ.name",term:"Anatomical structure"},n=[],o=qK(e,this.availableNameCurieMapping),a=e.facets.join(", ");o.forEach(i=>n.push({...t,facet:i})),this.$refs.sideBar.addFilter(n),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:a||"filter_reset",location:"map_location_pin"}),this.filterTriggered=!0}}else if(e.type=="Facets"){const t=[],n=qK(e,this.availableNameCurieMapping),o=_5e(this.availableFacets,n),a=o.join(", ");this.settingsStore.facets.species.forEach(i=>{t.push({facet:vV(i),term:"Species",facetPropPath:"organisms.primary.species.name"})}),t.push(...o.map(i=>({facet:vV(i),term:"Anatomical structure",facetPropPath:"anatomy.organ.category.name",facetSubPropPath:"anatomy.organ.name"}))),this.openSearch(t,""),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:a||"filter_reset",location:"map_popup_button"}),this.filterTriggered=!0}else this.trackGalleryClick(e),this.createNewEntry(e)}},trackGalleryClick:function(e){const t=[],{label:n,type:o,datasetId:a,discoverId:i,resource:s}=e;let l="",c=a||i;n&&t.push(n),o&&t.push(o),a&&t.push("("+c+")"),s&&(o==="Plot"?l=s.dataSource.url:l=typeof s=="string"?s:s.share_link),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t.join(" "),location:"map_sidebar_gallery",dataset_id:c?c+"":"",file_path:l})},onDisplaySearch:function(e,t=!0){let n=!1,o=this.$refs.splitdialog;o&&o.getActiveContents().forEach(i=>{i.search(e.term)&&(n=!0)}),this.$refs.dialogToolbar.setFailedSearch(n?void 0:e.term),t&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_display_search",category:e.term,location:"map_toolbar"})},fetchSuggestions:function(e){const t=[];this.$refs.splitdialog.getActiveContents().forEach(s=>s.searchSuggestions(e.data.term,t));const a=[];t.forEach(s=>{a.push(s.replaceAll('"',""))});const i=new Set(a);t.length=0;for(const s of i)t.push({value:'"'+s+'"'});e.data.cb(t)},onShowConnectivity:function(e){if(e.length){const t=this.splitFlowStore.getState(),n=(t==null?void 0:t.activeView)||"";$e.emit("show-connectivity",{featureIds:e,offset:n==="singlepanel"||n==="2horpanel"})}},openConnectivityInfo:function(e){const t=e.some(n=>n.featureId[0]===this.expanded);if(this.expanded&&this.connectivityExplorerClicked.length&&!t){this.connectivityExplorerClicked.pop();return}this.connectivityEntry=e.map(n=>{let o={...n,label:n.title,id:n.featureId[0]};const a=this.connectivityKnowledge.find(i=>i.id===o.id);return n.ready&&(o["nerve-label"]=n["nerve-label"]||a["nerve-label"]),o}),this.connectivityExplorerClicked.length?this.connectivityEntry.every(n=>n.ready)&&this.connectivityExplorerClicked.pop():(this.connectivityKnowledge=this.connectivityEntry,this.connectivityKnowledge.every(n=>n.ready)&&(this.connectivityHighlight=this.connectivityKnowledge.map(n=>n.id),this.connectivityProcessed=!0),this.$refs.sideBar&&(this.$refs.sideBar.tabClicked({id:2,type:"connectivityExplorer"}),this.$refs.sideBar.setDrawerOpen(!0)))},openAnnotation:function(e){this.annotationEntry=e.annotationEntry,this.annotationHighlight=this.annotationEntry.map(t=>t.models).filter(Boolean),e.commitCallback&&(this.annotationCallback=r.markRaw(e.commitCallback)),e.createData?this.createData=r.markRaw(e.createData):this.createData=r.markRaw({}),e.confirmCreate&&(this.confirmCreateCallback=r.markRaw(e.confirmCreate)),e.cancelCreate&&(this.cancelCreateCallback=r.markRaw(e.cancelCreate)),e.confirmDelete&&(this.confirmDeleteCallback=r.markRaw(e.confirmDelete)),e.confirmComment&&(this.confirmCommentCallback=r.markRaw(e.confirmComment)),this.$refs.sideBar&&(this.$refs.sideBar.tabClicked({id:3,type:"annotation"}),this.$refs.sideBar.setDrawerOpen(!0))},onShowReferenceConnectivities:function(e){$e.emit("show-reference-connectivities",e)},onConnectivityHovered:function(e){$e.emit("connectivity-hovered",e)},onConnectivitySourceChange:function(e){this.connectivityExplorerClicked.push(!0),$e.emit("connectivity-source-change",e)},hoverChanged:function(e){let t=[],n=[],o="",a=[];e.tabType==="dataset"?(t=e.anatomy?e.anatomy:[],n=e.organs?e.organs:[],o=e.doi?e.doi:""):e.tabType==="connectivity"?(a=e.id?[e.id]:this.connectivityHighlight,n=e["nerve-label"]?e["nerve-label"].flatMap(i=>i.subNerves):[]):e.tabType==="annotation"&&(a=e.models?[e.models]:this.annotationHighlight),this.settingsStore.updateHoverFeatures(t,n,o,a),$e.emit("hoverUpdate",{connectivityProcessed:this.connectivityProcessed})},searchChanged:function(e){if(e.tabType==="dataset"){if(e&&e.type=="reset-update"&&this.settingsStore.updateAppliedFacets([]),e&&e.type=="query-update"&&(this.search=e.value,this.search&&!this.filterTriggered&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:this.search,location:"map_sidebar_dataset_search"}),this.filterTriggered=!1),e&&e.type=="filter-update"){if(this.settingsStore.updateFacets(e.value),!this.filterTriggered){const t=e.value.filter(i=>i.facet&&i.facet.toLowerCase()!=="show all").map(i=>i.facet),n=t.map(i=>i.toLowerCase()),o=[...new Set([...n])];this.settingsStore.updateAppliedFacets(o);const a=t.join(", ");Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:a||"filter_reset",location:"map_sidebar_dataset_filter"})}this.filterTriggered=!1}}else if(e.tabType==="connectivity")if(e&&e.type=="reset-update")this.getActiveFlatmaps().forEach(n=>{n.resetConnectivityfilters(e.value)});else{this.expanded="",this.connectivityEntry=[],this.getActiveFlatmaps().forEach(a=>{a.updateConnectivityFilters(e.filter)}),$e.emit("connectivity-query-filter",e);const n=e.filter.filter(a=>a.facet&&a.facet.toLowerCase()!=="show all").map(a=>a.tagLabel).join(", "),o=e.query;n&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n,location:"map_sidebar_connectivity_filter"}),o&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:o,location:"map_sidebar_connectivity_search"})}},updateMarkers:function(e){this.settingsStore.updateMarkers(e),$e.emit("markerUpdate")},updateScaffoldMarkers:function(e){this.settingsStore.updateNumberOfDatasetsForFacets(e)},getNewEntryId:function(){return this.entries.length?this.entries[this.entries.length-1].id+1:1},createNewEntry:function(e){let t={};return t.viewUrl=void 0,t.state=void 0,Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.discoverId=e.discoverId,this.entriesStore.addNewEntry(t),this.splitFlowStore.setIdToPrimaryPane(t.id),this.$refs.sideBar&&this.$refs.sideBar.setDrawerOpen(!1),t.id},openNewMap:async function(e){const t=await k5e(e,this.settingsStore.sparcApi);this.createNewEntry(t),t.contextCard&&$e.emit("contextUpdate",t.contextCard)},openSearch:function(e,t){this.search=t,this._facets=e,this.$refs&&this.$refs.sideBar&&(this.$refs.sideBar.openSearch(e,t),this.$refs.sideBar.tabClicked({id:1,type:"datasetExplorer"})),this.startUp=!1},onFullscreen:function(e){this.$emit("onFullscreen",e)},resetApp:function(){this.setState(IS())},setIdToPrimaryPane:function(e){this.splitFlowStore.setIdToPrimaryPane(e)},restoreConnectivityEntries:function(e){this.getActiveFlatmaps().forEach(n=>{const o=e.map(a=>{const i=n.mapImp.modelFeatureIds(a)[0],s=n.mapImp.featureProperties(i);return{resource:[s.models],feature:s,label:s.label,provenanceTaxonomy:s.taxons,alert:s.alert}});n.checkAndCreatePopups(o,!0)})},restoreSidebarState:function(e){var n,o,a;const t=e==null?void 0:e.sidebar;!this.sidebarStateRestored&&t&&this.$refs.sideBar&&((n=this.connectivityKnowledge)!=null&&n.length)&&((o=t.connectivityEntries)!=null&&o.length?this.restoreConnectivityEntries(t.connectivityEntries):(a=t.annotationEntries)!=null&&a.length&&e.annotationId?(this.restoreConnectivityEntries(t.annotationEntries),this.sidebarAnnotationState=!0):this.$refs.sideBar.setState(t),this.sidebarStateRestored=!0)},setState:function(e){this.entriesStore.setAll(e.entries),e.splitFlow?this.splitFlowStore.setState(e.splitFlow):this.entries.forEach(t=>this.splitFlowStore.setIdToPrimaryPane(t.id)),this.restoreSidebarState(e),this.updateGlobalSettingsFromState(e)},getState:function(e=!1){var a,i,s;let t=JSON.parse(JSON.stringify(this.entriesStore.$state)),o=this.$refs.splitdialog.getContentsState();if(t.entries.length===o.length)for(let l=0;l<o.length;l++){const c=t.entries[l];c.state=o[l],c.type==="Scaffold"&&"viewUrl"in c&&delete c.viewUrl,c.type==="MultiFlatmap"&&"uberonId"in c&&delete c.uberonId,e===!1&&(c.type==="Scaffold"&&((a=c==null?void 0:c.state)!=null&&a.offlineAnnotations)?delete c.state.offlineAnnotations:(s=(i=c==null?void 0:c.state)==null?void 0:i.state)!=null&&s.offlineAnnotations&&delete c.state.state.offlineAnnotations)}return t.splitFlow=this.splitFlowStore.getState(),t.globalSettings=this.settingsStore.getGlobalSettings(),this.$refs.sideBar&&(t.sidebar=this.$refs.sideBar.getState()),t},removeEntry:function(e){let t=this.entriesStore.findIndexOfId(e);this.entriesStore.destroyEntry(t)},resourceSelected:function(e){this.$emit("resource-selected",e)},speciesChanged:function(e){this.$refs.sideBar&&this.$nextTick(()=>{$e.emit("species-layout-connectivity-update"),this.$refs.sideBar.close()})},contextUpdate:function(e){$e.emit("contextUpdate",e)},datalinkClicked:function(e){const t=e||"",n="datasets/",a=t.substring(t.indexOf(n)+n.length,t.indexOf("?type=dataset"));Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t,location:"map_sidebar_gallery",dataset_id:a||""})},onAnnotationSubmitted:function(e){this.annotationCallback?this.annotationCallback(e):this.confirmCommentCallback&&this.confirmCommentCallback(e)},onConfirmCreate:function(e){this.confirmCreateCallback&&this.confirmCreateCallback(e)},onCancelCreate:function(){this.cancelCreateCallback&&this.cancelCreateCallback()},onConfirmDelete:function(e){this.confirmDeleteCallback&&this.confirmDeleteCallback(e)},onSidebarTabClicked:function(e){let t={...this.settingsStore.globalSettings};"interactiveMode"in t&&(e.id===1&&e.type==="datasetExplorer"?t.interactiveMode="dataset":e.id===2&&e.type==="connectivityExplorer"&&(t.interactiveMode="connectivity"),this.settingsStore.updateGlobalSettings(t)),this.$refs.dialogToolbar.loadGlobalSettings()},onSidebarTabClosed:function(e){e.id===3&&e.type==="annotation"&&$e.emit("sidebar-annotation-close")},updateGlobalSettingsFromStorage:function(){const e=localStorage.getItem("mapviewer.globalSettings");e&&this.settingsStore.updateGlobalSettings(JSON.parse(e))},updateGlobalSettingsFromState:function(e){e!=null&&e.globalSettings&&this.settingsStore.updateGlobalSettings(e.globalSettings)},trackEvent:function(e){Tt.sendEvent(e)}},created:function(){this._facets=[],this._externalStateSet=!1},mounted:function(){$e.on("CreateNewEntry",e=>{this.createNewEntry(e)}),$e.on("RemoveEntryRequest",e=>{this.removeEntry(e)}),$e.on("PopoverActionClick",e=>{this.actionClick(e)}),$e.on("annotation-open",e=>{this.openAnnotation(e)}),$e.on("sidebar-annotation-close",()=>{const e={...this.settingsStore.globalSettings},{interactiveMode:t,viewingMode:n}=e;if(this.sidebarAnnotationState&&n==="Annotation"){this.sidebarAnnotationState=!1,this.$refs.sideBar.tabClicked({id:3,type:"annotation"});return}this.annotationEntry=[],this.createData={},this.$refs.sideBar&&(t==="dataset"?this.$refs.sideBar.tabClicked({id:1,type:"datasetExplorer"}):t==="connectivity"&&this.$refs.sideBar.tabClicked({id:2,type:"connectivityExplorer"}),this.$refs.sideBar.closeConnectivity(),$e.emit("connectivity-item-close"))}),$e.on("update-offline-annotation-enabled",e=>{this.settingsStore.updateOfflineAnnotationEnabled(e)}),$e.on("connectivity-info-open",e=>{this.openConnectivityInfo(e)}),$e.on("connectivity-info-close",e=>{this.$refs.sideBar&&(this.connectivityProcessed=!1,this.$refs.sideBar.resetConnectivitySearch())}),$e.on("connectivity-error",e=>{this.$refs.sideBar&&this.$refs.sideBar.updateConnectivityError(e.data)}),$e.on("neuron-connection-feature-click",e=>{if(this.$refs.sideBar){const{filters:t,search:n}=e;this.$refs.sideBar.openConnectivitySearch(t,n),this.$refs.sideBar.tabClicked({id:2,type:"connectivityExplorer"}),this.$refs.sideBar.setDrawerOpen(!0)}}),$e.on("OpenNewMap",e=>{this.openNewMap(e)}),$e.on("startHelp",()=>{this.$refs.sideBar&&this.$refs.sideBar.close()}),$e.on("connectivity-knowledge",e=>{this.connectivityKnowledge=e.data,this.connectivityHighlight=e.highlight,this.connectivityProcessed=e.processed,this.restoreSidebarState(this.state)}),$e.on("modeUpdate",e=>{e==="dataset"?this.$refs.sideBar.tabClicked({id:1,type:"datasetExplorer"}):e==="connectivity"&&this.$refs.sideBar.tabClicked({id:2,type:"connectivityExplorer"})}),this.updateGlobalSettingsFromStorage(),$e.on("connectivity-filter-options",e=>{this.filterOptions=e}),this.$nextTick(()=>{this.search===""&&this._facets.length===0?(this.$refs.sideBar&&this.$refs.sideBar.close(),setTimeout(()=>{this.startUp=!1},2e3)):this.openSearch(this._facets,this.search)})},computed:{...Mt.mapStores(Mf,vi,Ss),envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl,FLATMAPAPI_LOCATION:this.settingsStore.flatmapAPI}},entries:function(){return this.entriesStore.entries}}},oGe={style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}};function aGe(e,t,n,o,a,i){const s=NV,l=B3,c=r.resolveComponent("SideBar"),d=TV,u=N3,f=T3;return r.openBlock(),r.createBlock(f,{style:{height:"100%",background:"white"}},{default:r.withCtx(()=>[r.createVNode(l,{ref:"header",style:{"text-align":"left","font-size":"14px",padding:"0"},height:"32px",class:"dialog-header"},{default:r.withCtx(()=>[r.createVNode(s,{numberOfEntries:i.entries.length,onOnFullscreen:i.onFullscreen,onLocalSearch:i.onDisplaySearch,onFetchSuggestions:i.fetchSuggestions,ref:"dialogToolbar"},null,8,["numberOfEntries","onOnFullscreen","onLocalSearch","onFetchSuggestions"])]),_:1},512),r.createVNode(u,{class:"dialog-main"},{default:r.withCtx(()=>[r.createElementVNode("div",oGe,[r.createVNode(c,{ref:"sideBar",envVars:i.envVars,visible:e.sideBarVisibility,class:r.normalizeClass(["side-bar",{"start-up":e.startUp}]),"open-at-start":e.startUp,annotationEntry:e.annotationEntry,createData:e.createData,connectivityEntry:e.connectivityEntry,connectivityKnowledge:e.connectivityKnowledge,filterOptions:e.filterOptions,showVisibilityFilter:e.showVisibilityFilter,onTabClicked:i.onSidebarTabClicked,onTabClosed:i.onSidebarTabClosed,onActionClick:i.actionClick,onSearchChanged:t[0]||(t[0]=p=>i.searchChanged(p)),onAnatomyInDatasets:t[1]||(t[1]=p=>i.updateMarkers(p)),onAnnotationSubmitted:i.onAnnotationSubmitted,onConfirmCreate:i.onConfirmCreate,onCancelCreate:i.onCancelCreate,onConfirmDelete:i.onConfirmDelete,onNumberOfDatasetsForAnatomies:t[2]||(t[2]=p=>i.updateScaffoldMarkers(p)),onHoverChanged:t[3]||(t[3]=p=>i.hoverChanged(p)),onContextUpdate:t[4]||(t[4]=p=>i.contextUpdate(p)),onDatalinkClicked:t[5]||(t[5]=p=>i.datalinkClicked(p)),onShowConnectivity:i.onShowConnectivity,onShowReferenceConnectivities:i.onShowReferenceConnectivities,onConnectivityHovered:i.onConnectivityHovered,onConnectivityCollapseChange:i.onConnectivityCollapseChange,onConnectivitySourceChange:i.onConnectivitySourceChange,onFilterVisibility:i.onFilterVisibility,onConnectivityItemClose:i.onConnectivityItemClose,onTrackEvent:i.trackEvent},null,8,["envVars","visible","class","open-at-start","annotationEntry","createData","connectivityEntry","connectivityKnowledge","filterOptions","showVisibilityFilter","onTabClicked","onTabClosed","onActionClick","onAnnotationSubmitted","onConfirmCreate","onCancelCreate","onConfirmDelete","onShowConnectivity","onShowReferenceConnectivities","onConnectivityHovered","onConnectivityCollapseChange","onConnectivitySourceChange","onFilterVisibility","onConnectivityItemClose","onTrackEvent"]),r.createVNode(d,{entries:i.entries,ref:"splitdialog",onResourceSelected:i.resourceSelected,onSpeciesChanged:i.speciesChanged},null,8,["entries","onResourceSelected","onSpeciesChanged"])])]),_:1})]),_:1})}const KK=tr(rGe,[["render",aGe],["__scopeId","data-v-df8c6d28"]]),iGe={name:"MapContent",components:{MapSvgSpriteColor:yV,Loading:J3,SplitFlow:KK},mixins:[{methods:{retrieveContextCardFromUrl:async function(e){const[t,n,o,a]=this.splitInfoFromUrl(e),i=await this.getContextFileFromScicrunch(t,o);if(!i.success)return{};const s=n+i.contextFile+a;return{s3uri:i.s3uri,contextCardUrl:s}},splitInfoFromUrl:function(e){let t=e.split("s3-resource")[1],n=e.split("files/")[0]+"files/",o=e.split("files/")[1].split("?")[0],a="?"+e.split("?")[1];const i=t.split("/");return i.shift(),[i[0],n,o,a]},getContextFileFromScicrunch:async function(e,t){return await fetch(`${this.settingsStore.sparcApi}/dataset_info/using_multiple_discoverIds/?discoverIds=${e}`).then(o=>o.json()).then(o=>{if(o.numberOfHits===1){const a=o.results[0]["abi-contextual-information"];if(a&&a.length===1)return{success:!0,contextFile:a[0],s3uri:o.results[0].s3uri};if(a&&a.length>1){let i=this.findContextInforForFilePath(o.results[0]["abi-context-file"],t);if(i)return{success:!0,contextFile:i,s3uri:o.results[0].s3uri}}}return{success:!1}}).catch(o=>(console.error("Error:",o),{success:!1}))},findContextInforForFilePath:function(e,t){var o;let n=e.find(a=>a.datacite.isDerivedFrom.path.includes(t));return(o=n==null?void 0:n.dataset)==null?void 0:o.path}}}],props:{shareLink:{type:String,default:void 0},state:{type:Object,default:void 0},options:{type:Object,default:()=>({}),required:!0},startingMap:{type:String,default:"AC"},useHelpModeDialog:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!0},annotationSidebar:{type:Boolean,default:!0},allClosable:{type:Boolean,default:!0},showGlobalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0}},provide:function(){return{showGlobalSettings:this.showGlobalSettings,showOpenMapButton:this.showOpenMapButton}},data:function(){return{isReady:!1,initialState:void 0,displaySearchFromQuery:""}},methods:{isFullscreen:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},onFullscreen:function(e){e!==void 0?(e&&!this.isFullscreen()&&this.goFullscreen(),!e&&this.isFullscreen()&&this.leaveFullscreen()):this.isFullscreen()?this.leaveFullscreen():this.goFullscreen()},leaveFullscreen:function(){if(this.isFullscreen()){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen();let e=this.$refs.MapApp;this.replacePopupsOnFullscreen(e,document.body)}},goFullscreen:function(){let e=this.$refs.MapApp;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():parent.msRequestFullscreen&&e.msRequestFullscreen(),this.replacePopupsOnFullscreen(document.body,e)},replacePopupsOnFullscreen:function(e,t){e.querySelectorAll('[id^="el-popper-container"]').forEach(o=>{t.append(o)})},setState:function(e){return this.$refs.flow.setState(e)},getState:function(e=!1){return this.$refs.flow.getState(e)},setCurrentEntry:async function(e){if(e&&e.type){if(e.type==="Scaffold"&&(e.url||e.isBodyScaffold)){let t={type:e.type,label:e.label,region:e.region,resource:e.url,state:e.state,viewUrl:e.viewUrl,discoverId:e.dataset_id,version:e.dataset_version};if(e.isBodyScaffold){const n=await RS(this.options.sparcApi,e.label);t={...t,...n.datasetInfo,resource:n.url}}else{const n=await this.retrieveContextCardFromUrl(e.url);t={...t,...n}}this.$refs.flow.createNewEntry(t)}else if(e.type==="MultiFlatmap")if(e.resource){const t={type:e.type,resource:e.resource,state:e.state,label:e.label,discoverId:e.dataset_id,version:e.dataset_version};this.$refs.flow.createNewEntry(t)}else{const t=S5e(e);if(t){const n=this.getState();if(n&&n.entries)for(let o=0;o<n.entries.length;o++){const a=n.entries[o];if(a.type==="MultiFlatmap"){a.resource=t,a.state={species:t},(e.organ||e.uuid)&&(a.state.state={searchTerm:e.organ,uuid:e.uuid},e.uuid&&(a.state.state.entry=e.taxo)),e.organ&&(this.displaySearchFromQuery=e.organ),this.$refs.flow.setState(n),this.$refs.flow.setIdToPrimaryPane(a.id);break}}}}else if(e.type==="Flatmap"){const t={type:e.type,resource:e.resource,state:e.state,label:e.label,discoverId:e.dataset_id,version:e.dataset_version};this.$refs.flow.createNewEntry(t)}}},openSearch:function(e,t){return this.$refs.flow.openSearch(e,t)},flowMounted:function(){this._flowMounted=!0,this.$emit("isReady"),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_page_view",category:this.startingMap})}},computed:{...Mt.mapStores(vi,Ss),stateToSet(){return this.state?this.state:this.initialState}},watch:{shareLink:{handler:function(e){this.settingsStore.updateShareLink(e)},immediate:!0}},beforeMount:function(){var e,t;this.options&&(this.options.sparcApi&&this.settingsStore.updateSparcAPI(this.options.sparcApi),this.options.algoliaIndex&&this.settingsStore.updateAlgoliaIndex(this.options.algoliaIndex),this.options.algoliaKey&&this.settingsStore.updateAlgoliaKey(this.options.algoliaKey),this.options.algoliaId&&this.settingsStore.updateAlgoliaId(this.options.algoliaId),this.options.pennsieveApi&&this.settingsStore.updatePennsieveApi(this.options.pennsieveApi),this.options.flatmapAPI&&this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI),this.options.nlLinkPrefix&&this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix),this.options.rootUrl&&this.settingsStore.updateRootUrl(this.options.rootUrl)),this.settingsStore.updateAllClosable(this.allClosable),(e=this.splitFlowStore)==null||e.reset(),(t=this.splitFlowStore)==null||t.getAvailableTerms(this.settingsStore.sparcApi)},mounted:async function(){$e.on("updateShareLinkRequested",e=>{this.$emit("updateShareLinkRequested",e)}),$e.on("trackEvent",e=>{this.$emit("trackEvent",e)}),this.state||(this.initialState=await C5e(this.startingMap,this.options.sparcApi)),$e.on("mapLoaded",e=>{this.displaySearchFromQuery&&setTimeout(()=>{this.$refs.flow.onDisplaySearch({term:this.displaySearchFromQuery}),this.displaySearchFromQuery=""}),this.$emit("mapLoaded",e)}),this.isReady=!0,this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog),this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar),this.settingsStore.updateAnnotationSidebar(this.annotationSidebar)}},sGe={ref:"MapApp",class:"mapcontent","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"};function lGe(e,t,n,o,a,i){const s=r.resolveComponent("map-svg-sprite-color"),l=KK,c=wc;return r.withDirectives((r.openBlock(),r.createElementBlock("div",sGe,[r.createVNode(s),e.isReady?(r.openBlock(),r.createBlock(l,{key:0,onOnFullscreen:i.onFullscreen,state:i.stateToSet,ref:"flow",onVnodeMounted:i.flowMounted},null,8,["onOnFullscreen","state","onVnodeMounted"])):r.createCommentVNode("",!0)])),[[c,!e.isReady]])}const cGe=tr(iGe,[["render",lGe],["__scopeId","data-v-5b0fdea8"]]),Rp=function(e){return e?[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t)):[]},v5=[],GK=async function(e,t){const n=t.filter(i=>v5.some(s=>s.taxon===i)),o=v5.filter(i=>n.includes(i.taxon)),a=t.filter(i=>!n.includes(i));if(a.length){const i=await e.queryLabels(a);if(i.length)return i.forEach(s=>{let{entity:l,label:c}=s;c==="Mammalia"&&(c="Mammalia not otherwise specified");const d={taxon:l,label:c};o.push(d),v5.push(d)}),o}else return o},b5=function(e,t){if(!e||!t)return!1;let n=JSON.stringify(e),o=JSON.stringify(t);return n.indexOf(o)!==-1},Yd=(e,t)=>{const n=e.name??e,o=t.name??t,a=n.toUpperCase(),i=o.toUpperCase();return a<i?-1:a>i?1:0};let WK=function(){this.initialise=function(e){this.flatmapAPI=e,this.destinations=[],this.origins=[],this.components=[],this.rawURLs=[],this.controller=void 0,this.uberons=[],this.lookUp=[],this.connectivitySource="map",this.noMapConnectivity=!1},this.createTooltipData=async function(e,t){let n=[];t.feature.hyperlinks&&t.feature.hyperlinks.length>0?n=t.feature.hyperlinks:n=this.rawURLs;let o;if(t.provenanceTaxonomy){o=[];try{const i=await GK(e,t.provenanceTaxonomy);i.length&&i.forEach(s=>{const{label:l}=s;o.push(l)})}catch(i){console.log(i)}}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:t.label,featureId:t.resource,hyperlinks:n,provenanceTaxonomy:t.provenanceTaxonomy,provenanceTaxonomyLabel:o,connectivitySource:this.connectivitySource,noMapConnectivity:this.noMapConnectivity}},this.updateTooltipData=function(e){return{...e,origins:this.origins,originsWithDatasets:this.originsWithDatasets,components:this.components,componentsWithDatasets:this.componentsWithDatasets,destinations:this.destinations,destinationsWithDatasets:this.destinationsWithDatasets,connectivitySource:this.connectivitySource,noMapConnectivity:this.noMapConnectivity}},this.createComponentsLabelList=function(e,t){let n=[];return e.forEach(o=>{n.push(this.createLabelFromNeuralNode(o[0]),t),o.length===2&&n.push(this.createLabelFromNeuralNode(o[1]),t)}),n},this.createLabelLookup=function(e,t){return new Promise(async n=>{let o={};this.uberons=[];const a=await GK(e,t);a.length&&(a.forEach(i=>{const{taxon:s,label:l}=i;o[s]=l,this.uberons.push({id:s,name:l})}),n(o))})},this.buildConnectivitySqlStatement=function(e){let t="select knowledge from knowledge where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let n in e)t+=`'${e[n]}'${n>=e.length-1?")":","} `;return t},this.buildLabelSqlStatement=function(e){let t="select entity, label from labels where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let n in e)t+=`'${e[n]}'${n>=e.length-1?")":","} `;return t},this.findAllIdsFromConnectivity=function(e){let t=e.connectivity.flat(),n=[...new Set(t)],o=[];return n.forEach(a=>{Array.isArray(a)?o.push(a.flat()):o.push(a)}),[...new Set(o.flat())]},this.flattenConnectivity=function(e){let t=e.flat(),n=[...new Set(t)],o=[];return n.forEach(a=>{Array.isArray(a)?o.push(a.flat()):o.push(a)}),o.flat()},this.findComponents=function(e,t,n,o){let a=e.connectivity.flat(),i=Rp(a),s=[],l=!1;return i.forEach(c=>{l=!1,b5(t,c)&&(l=!0),o&&b5(o,c)&&(l=!0),b5(n,c)&&(l=!0),l||s.push(c)}),s},this.retrieveFlatmapKnowledgeForEvent=async function(e,t){this.controller&&this.controller.abort(),this.controller=new AbortController,this.controller.signal;const n=t.resource;if(this.destinations=[],this.origins=[],this.components=[],this.rawURLs=[],!n||n.length===0||!n[0])return;let o=this.queryForConnectivityNew(e,n[0]);return await Promise.all([o])},this.queryForConnectivityNew=function(e,t,n="map",o=!0){return this.connectivitySource=n,new Promise(a=>{(n==="map"?this.queryMapConnectivity(e.mapMetadata.uuid,t):e.queryKnowledge(t)).then(s=>{if(this.checkConnectivityExists(s)){n==="map"&&(this.noMapConnectivity=!1);let l=s;o?this.processConnectivity(e,l).then(c=>{s.references&&(this.rawURLs=[...s.references]),a(c)}):a(l)}else n==="map"?(this.connectivitySource="sckan",this.noMapConnectivity=!0,e.queryKnowledge(t).then(l=>{if(this.checkConnectivityExists(l)){let c=l;o?this.processConnectivity(e,c).then(d=>{l.references&&(this.rawURLs=[...l.references]),a(d)}):a(c)}else a(!1)}).catch(()=>a(!1))):a(!1)}).catch(s=>{s.name==="AbortError"||console.warn(`Unable to get the knowledge for the entity ${t}.`),a(!1)})})},this.queryMapConnectivity=async function(e,t){const n=this.flatmapAPI+`flatmap/${e}/connectivity/${t}`;try{const o=await fetch(n);if(!o.ok)throw new Error(`Response status: ${o.status}`);return await o.json()}catch(o){throw new Error(o)}},this.queryForConnectivity=function(e,t,n,o=!0){const a={sql:this.buildConnectivitySqlStatement(t)},i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a),...n?{signal:n}:{}};return new Promise(s=>{fetch(`${this.flatmapAPI}knowledge/query/`,i).then(l=>l.json()).then(l=>{if(this.connectivityExists(l)){let c=JSON.parse(l.values[0][0]);o?this.processConnectivity(e,c).then(d=>{s(d)}):s(c)}else s(!1)}).catch(l=>{l.name==="AbortError"||console.error("Error:",l),s(!1)})})},this.checkConnectivityExists=function(e){var t;return e&&((t=e.connectivity)==null?void 0:t.length)},this.connectivityExists=function(e){return!!(e.values&&e.values.length>0&&JSON.parse(e.values[0][0]).connectivity&&JSON.parse(e.values[0][0]).connectivity.length>0)},this.findIfNodeIsSingle=function(e){return e.length===1?(console.error("Server returns a single node",e),e[0]):e.length===2&&e[1].length===0?e[0]:!1},this.createLabelFromNeuralNode=function(e,t){let n=this.findIfNodeIsSingle(e);if(n)return t[n];let o=t[e[0]];return e.length===2&&e[1].length>0&&e[1].forEach(a=>{t[a]==null?o+=`, ${a}`:o+=`, ${t[a]}`}),o},this.flattenAndFindDatasets=function(e,t,n){let o=this.flattenConnectivity(e),a=this.flattenConnectivity(t),i=this.flattenConnectivity(n);this.originsWithDatasets=this.uberons.filter(s=>o.indexOf(s.id)!==-1).sort(Yd),this.componentsWithDatasets=this.uberons.filter(s=>a.indexOf(s.id)!==-1).sort(Yd),this.destinationsWithDatasets=this.uberons.filter(s=>i.indexOf(s.id)!==-1).sort(Yd)},this.processConnectivity=function(e,t){return new Promise(n=>{let o=[],a=[],i;if(t&&t["node-phenotypes"]){const c=["ilxtr:hasSomaLocatedIn"],d=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"];c.forEach(u=>{u in t["node-phenotypes"]&&o.push(...t["node-phenotypes"][u])}),o=Rp(o),d.forEach(u=>{u in t["node-phenotypes"]&&a.push(...t["node-phenotypes"][u])}),a=Rp(a)}else a=Rp(t.axons),t.somas&&t.somas.length>0&&o.push(...t.somas),t.dendrites&&t.dendrites.length>0&&o.push(...t.dendrites),o=Rp(o),i=t.somas;const s=this.findComponents(t,a,o,i),l=this.findAllIdsFromConnectivity(t);this.createLabelLookup(e,l).then(c=>{this.origins=o.map(d=>this.createLabelFromNeuralNode(d,c)).sort(Yd),this.components=s.map(d=>this.createLabelFromNeuralNode(d,c)).sort(Yd),this.destinations=a.map(d=>this.createLabelFromNeuralNode(d,c)).sort(Yd),this.flattenAndFindDatasets(o,s,a),n({ids:{dendrites:o,components:s,axons:a},labels:{origins:this.origins,components:this.components,destinations:this.destinations}})})})},this.buildPubmedSqlStatement=function(e){let t="select distinct publication from publications where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let n in e)t+=`'${e[n]}'${n>=e.length-1?")":","} `;return t},this.buildPubmedSqlStatementForModels=function(e){return`select distinct publication from publications where entity = '${e}'`},this.queryKnowledge=async(e,t)=>{const n=`${this.flatmapAPI}/knowledge/query/`,a=await fetch(n,{method:"POST",headers:{Accept:"application/json"},body:JSON.stringify({sql:e,params:t})});if(!a.ok)throw new Error(`Cannot access ${n}`);const i=await a.json();if("error"in i)throw new TypeError(i.error);return i.values}};const XK=[{id:0,nerve_id:"ILX:0793723",label:"Auriculotemporal nerve","FMA subclasses (in human nerves)":["FMA:53002","FMA:53001"],"subclass labels":["Left auriculotemporal nerve","Right auriculotemporal nerve"]},{id:1,nerve_id:"ILX:0792409",label:"gray communicating ramus of tenth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6895","FMA:6894"],"subclass labels":["Left T10 grey ramus communicans","Right T10 grey ramus communicans"]},{id:2,nerve_id:"UBERON:0011326",label:"superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53530","FMA:53536"],"subclass labels":["Right superior laryngeal nerve","Left superior laryngeal nerve"]},{id:3,nerve_id:"ILX:0793220",label:"white communicating ramus of first lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:4,nerve_id:"ILX:0787082",label:"gray communicating ramus of the first thoracic nerve","FMA subclasses (in human nerves)":["FMA:6082","FMA:6084"],"subclass labels":["Right T1 grey ramus communicans","Left T1 grey ramus communicans"]},{id:5,nerve_id:"ILX:0793809",label:"Clitoral cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:6,nerve_id:"UBERON:0011096",label:"lacrimal nerve","FMA subclasses (in human nerves)":["FMA:52630","FMA:52629"],"subclass labels":["Left lacrimal nerve","Right lacrimal nerve"]},{id:7,nerve_id:"ILX:0793215",label:"white communicating ramus of ninth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:8,nerve_id:"ILX:0795005",label:"Posterior cutaneous nerve of arm","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:9,nerve_id:"UBERON:0001649",label:"glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:50894","FMA:50892"],"subclass labels":[]},{id:10,nerve_id:"UBERON:0022302",label:"short ciliary nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:11,nerve_id:"ILX:0785932",label:"gray communicating ramus of third lumbar nerve","FMA subclasses (in human nerves)":["FMA:65920","FMA:65919"],"subclass labels":["Left L3 grey ramus communicans","Right L3 grey ramus communicans"]},{id:12,nerve_id:"ILX:0738293",label:"Ganglioglomerular nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:13,nerve_id:"ILX:0739298",label:"gray communicating ramus of twelfth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:14,nerve_id:"UBERON:0001492",label:"radial nerve","FMA subclasses (in human nerves)":["FMA:37070","FMA:37071"],"subclass labels":["Right radial nerve","Left radial nerve"]},{id:15,nerve_id:"ILX:0793214",label:"white communicating ramus of eighth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:16,nerve_id:"UBERON:0018681",label:"lesser splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6957","FMA:6958"],"subclass labels":["Right lesser splanchnic nerve","Left lesser splanchnic nerve"]},{id:17,nerve_id:"ILX:0794476",label:"abdominal branch of vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:18,nerve_id:"ILX:0791105",label:"gray communicating ramus of the second thoracic nerve","FMA subclasses (in human nerves)":["FMA:6122","FMA:6757"],"subclass labels":["Right T2 grey ramus communicans","Left T2 grey ramus communicans"]},{id:19,nerve_id:"ILX:0794853",label:"esophageal vagus trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:20,nerve_id:"ILX:0793210",label:"white communicating ramus of fourth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:21,nerve_id:"UBERON:0001759",label:"vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:22,nerve_id:"UBERON:0009675",label:"chorda tympani branch of facial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:23,nerve_id:"ILX:0794949",label:"recurrent branch of the median nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:24,nerve_id:"ILX:0789339",label:"Pharyngeal branch of glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:53495","FMA:53494"],"subclass labels":["Pharyngeal branch of left glossopharyngeal nerve","Pharyngeal branch of right glossopharyngeal nerve"]},{id:25,nerve_id:"ILX:0793712",label:"Zygomatic nerve","FMA subclasses (in human nerves)":["FMA:52968","FMA:52969"],"subclass labels":["Right zygomatic nerve","Left zygomatic nerve"]},{id:26,nerve_id:"ILX:0788536",label:"gray communicating ramus of fourth lumbar nerve","FMA subclasses (in human nerves)":["FMA:65917","FMA:65918"],"subclass labels":["Right L4 grey ramus communicans","Left L4 grey ramus communicans"]},{id:27,nerve_id:"UBERON:0018680",label:"greater splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6956","FMA:6955"],"subclass labels":["Right greater splanchnic nerve","Left greater splanchnic nerve"]},{id:28,nerve_id:"UBERON:0001322",label:"sciatic nerve","FMA subclasses (in human nerves)":["FMA:22111","FMA:22112"],"subclass labels":["Right sciatic nerve","Left sciatic nerve"]},{id:29,nerve_id:"ILX:0793209",label:"white communicating ramus of third thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:30,nerve_id:"UBERON:0011391",label:"perineal nerve","FMA subclasses (in human nerves)":["FMA:21874","FMA:21873"],"subclass labels":["Left perineal nerve","Right perineal nerve"]},{id:31,nerve_id:"ILX:0788945",label:"gray communicating ramus of the fourth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6759","FMA:6758"],"subclass labels":["Right T4 grey ramus communicans","Left T4 grey ramus communicans"]},{id:32,nerve_id:"ILX:0790497",label:"Gray communicating ramus of cervicothoracic ganglion to first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:33,nerve_id:"UBERON:0001323",label:"tibial nerve","FMA subclasses (in human nerves)":["FMA:22109","FMA:22110"],"subclass labels":["Right tibial nerve","Left tibial nerve"]},{id:34,nerve_id:"ILX:0794969",label:"deep branch of ulnar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:35,nerve_id:"ILX:0793227",label:"gray communicating ramus of thirteenth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:36,nerve_id:"ILX:0793228",label:"gray communicating ramus of first sacral nerve","FMA subclasses (in human nerves)":["FMA:65992","FMA:65991"],"subclass labels":["Left S1 grey ramus communicans","Right S1 grey ramus communicans"]},{id:37,nerve_id:"UBERON:0035111",label:"medial plantar nerve","FMA subclasses (in human nerves)":["FMA:45435","FMA:45434"],"subclass labels":["Left medial plantar nerve","Right medial plantar nerve"]},{id:38,nerve_id:"UBERON:0001780",label:"spinal nerve","FMA subclasses (in human nerves)":["FMA:6117","FMA:6435","FMA:6295","FMA:6422","FMA:6417","FMA:6421","FMA:6038","FMA:6292","FMA:6439","FMA:6313","FMA:6410","FMA:6412","FMA:6088","FMA:6298","FMA:6433","FMA:6411","FMA:6438","FMA:6314","FMA:6291","FMA:6420","FMA:6116","FMA:6413","FMA:6310","FMA:6432","FMA:6305","FMA:6182","FMA:6297","FMA:6436","FMA:6418","FMA:6039","FMA:6089","FMA:6301","FMA:6294","FMA:6303","FMA:6183","FMA:6434","FMA:6429","FMA:6308","FMA:6300","FMA:6430","FMA:6428","FMA:6419","FMA:6437","FMA:6307","FMA:6311","FMA:6431"],"subclass labels":["Left T3 spinal nerve","Left S4 spinal nerve","Left T5 spinal nerve","Left L5 spinal nerve","Right L3 spinal nerve","Right L5 spinal nerve","Right T1 spinal nerve","Left T4 spinal nerve","Left coccygeal spinal nerve","Right T11 spinal nerve","Right L1 spinal nerve","Right L2 spinal nerve","Right T2 spinal nerve","Left T6 spinal nerve","Left S3 spinal nerve","Left L1 spinal nerve","Right coccygeal spinal nerve","Left T11 spinal nerve","Right T4 spinal nerve","Left L4 spinal nerve","Right T3 spinal nerve","Left L2 spinal nerve","Right T10 spinal nerve","Right S3 spinal nerve","Left T8 spinal nerve","Right T12 spinal nerve","Right T6 spinal nerve","Right S5 spinal nerve","Left L3 spinal nerve","Left T1 spinal nerve","Left T2 spinal nerve","Left T7 spinal nerve","Right T5 spinal nerve","Right T8 spinal nerve","Left T12 spinal nerve","Right S4 spinal nerve","Left S1 spinal nerve","Left T9 spinal nerve","Right T7 spinal nerve","Right S2 spinal nerve","Right S1 spinal nerve","Right L4 spinal nerve","Left S5 spinal nerve","Right T9 spinal nerve","Left T10 spinal nerve","Left S2 spinal nerve"]},{id:39,nerve_id:"UBERON:0018683",label:"lumbar splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6925","FMA:6930","FMA:6927","FMA:6926"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Left first lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left second lumbar splanchnic nerve","Right second lumbar splanchnic nerve"]},{id:40,nerve_id:"UBERON:0001643",label:"oculomotor nerve","FMA subclasses (in human nerves)":["FMA:50880","FMA:50879"],"subclass labels":["Left oculomotor nerve","Right oculomotor nerve"]},{id:41,nerve_id:"ILX:0793212",label:"white communicating ramus of sixth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:42,nerve_id:"UBERON:0003724",label:"musculocutaneous nerve","FMA subclasses (in human nerves)":["FMA:37066","FMA:37065"],"subclass labels":["Left musculocutaneous nerve","Right musculocutaneous nerve"]},{id:43,nerve_id:"ILX:0738372",label:"white communicating ramus of first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:44,nerve_id:"ILX:0793563",label:"splenic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:45,nerve_id:"UBERON:0035526",label:"superficial fibular nerve","FMA subclasses (in human nerves)":["FMA:45363","FMA:45364"],"subclass labels":["Right superficial fibular nerve","Left superficial fibular nerve"]},{id:46,nerve_id:"ILX:0791560",label:"gray communicating ramus of eighth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6891","FMA:6890"],"subclass labels":["Left T8 grey ramus communicans","Right T8 grey ramus communicans"]},{id:47,nerve_id:"ILX:0793827",label:"posterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:48,nerve_id:"ILX:0794141",label:"right cervical vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:49,nerve_id:"ILX:0793714",label:"Mesenteric nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:50,nerve_id:"UBERON:0001964",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:51,nerve_id:"UBERON:0001267",label:"femoral nerve","FMA subclasses (in human nerves)":["FMA:16499","FMA:16500"],"subclass labels":["Right femoral nerve","Left femoral nerve"]},{id:52,nerve_id:"UBERON:0034984",label:"nerve to quadratus femoris","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:53,nerve_id:"UBERON:0003721",label:"lingual nerve","FMA subclasses (in human nerves)":["FMA:53219","FMA:53220"],"subclass labels":["Right lingual nerve","Left lingual nerve"]},{id:54,nerve_id:"UBERON:0036216",label:"tympanic nerve","FMA subclasses (in human nerves)":["FMA:53481","FMA:53482"],"subclass labels":["Right tympanic nerve","Left tympanic nerve"]},{id:55,nerve_id:"ILX:0793216",label:"white communicating ramus of tenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:56,nerve_id:"ILX:0793362",label:"White communicating ramus of fourth lumbar anterior ramus","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:57,nerve_id:"ILX:0793561",label:"Internal branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53539","FMA:53540"],"subclass labels":["Right internal laryngeal nerve","Left internal laryngeal nerve"]},{id:58,nerve_id:"ILX:0738312",label:"Aortic arch depressor nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:59,nerve_id:"ILX:0793218",label:"white communicating ramus of twelfth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:60,nerve_id:"ILX:0738308",label:"External branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:61,nerve_id:"ILX:0739299",label:"gray communicating ramus of sixth lumbar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:62,nerve_id:"ILX:0793559",label:"bladder nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:63,nerve_id:"ILX:0793822",label:"Superior ovarian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:64,nerve_id:"ILX:0793807",label:"Penile cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:65,nerve_id:"UBERON:0011390",label:"pudendal nerve","FMA subclasses (in human nerves)":["FMA:21863","FMA:21864"],"subclass labels":["Right pudendal nerve","Left pudendal nerve"]},{id:66,nerve_id:"UBERON:0008810",label:"nasopalatine nerve","FMA subclasses (in human nerves)":["FMA:52799","FMA:52798"],"subclass labels":["Left nasopalatine nerve","Right nasopalatine nerve"]},{id:67,nerve_id:"ILX:0793219",label:"white communicating ramus of thirteenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:68,nerve_id:"ILX:0793632",label:"lumbar colonic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:69,nerve_id:"ILX:0784439",label:"gray communicating ramus of the fifth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6760","FMA:6761"],"subclass labels":["Left T5 grey ramus communicans","Right T5 grey ramus communicans"]},{id:70,nerve_id:"ILX:0794977",label:"deep branch of radial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:71,nerve_id:"UBERON:0001884",label:"phrenic nerve","FMA subclasses (in human nerves)":["FMA:6193","FMA:6192"],"subclass labels":["Left phrenic nerve","Right phrenic nerve"]},{id:72,nerve_id:"UBERON:0035110",label:"lateral plantar nerve","FMA subclasses (in human nerves)":["FMA:45450","FMA:45451"],"subclass labels":["Right lateral plantar nerve","Left lateral plantar nerve"]},{id:73,nerve_id:"ILX:0793711",label:"Communicating branch of zygomatic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:74,nerve_id:"ILX:0793560",label:"External branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53537","FMA:53538"],"subclass labels":["Right external laryngeal nerve","Left external laryngeal nerve"]},{id:75,nerve_id:"ILX:0738309",label:"Internal branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:76,nerve_id:"UBERON:0001021",label:"nerve","FMA subclasses (in human nerves)":["FMA:6775","FMA:6894","FMA:6784","FMA:6728","FMA:65325","FMA:21873","FMA:45429","FMA:6844","FMA:53609","FMA:7116","FMA:44770","FMA:8916","FMA:52995","FMA:6071","FMA:45309","FMA:6122","FMA:6892","FMA:6767","FMA:16405","FMA:53560","FMA:6092","FMA:65343","FMA:37066","FMA:8894","FMA:8868","FMA:65341","FMA:53559","FMA:8897","FMA:82956","FMA:20633","FMA:6763","FMA:65339","FMA:8829","FMA:16493","FMA:8817","FMA:8821","FMA:11757","FMA:45456","FMA:45422","FMA:11261","FMA:65388","FMA:6192","FMA:65347","FMA:37068","FMA:65995","FMA:6764","FMA:39081","FMA:45338","FMA:53402","FMA:11210","FMA:52644","FMA:37067","FMA:65313","FMA:11153","FMA:6155","FMA:8797","FMA:53302","FMA:8883","FMA:53067","FMA:52939","FMA:53301","FMA:292889","FMA:45423","FMA:8791","FMA:45380","FMA:11759","FMA:7305","FMA:8830","FMA:78650","FMA:65389","FMA:45387","FMA:8827","FMA:8912","FMA:52941","FMA:6743","FMA:7126","FMA:53485","FMA:16492","FMA:53399","FMA:65337","FMA:11209","FMA:6772","FMA:52726","FMA:6121","FMA:52627","FMA:52974","FMA:53571","FMA:6729","FMA:8729","FMA:53606","FMA:80025","FMA:53481","FMA:53575","FMA:45451","FMA:11218","FMA:22109","FMA:6852","FMA:8909","FMA:11751","FMA:65991","FMA:8836","FMA:65350","FMA:53423","FMA:65569","FMA:65314","FMA:82957","FMA:65438","FMA:39146","FMA:8911","FMA:22111","FMA:65916","FMA:65739","FMA:65917","FMA:6779","FMA:8889","FMA:65924","FMA:65316","FMA:53002","FMA:16887","FMA:53366","FMA:6890","FMA:8790","FMA:6730","FMA:45358","FMA:52716","FMA:53494","FMA:7115","FMA:53561","FMA:78655","FMA:45366","FMA:11219","FMA:11555","FMA:7092","FMA:53220","FMA:45428","FMA:6193","FMA:20604","FMA:45433","FMA:21874","FMA:21875","FMA:53244","FMA:45432","FMA:6770","FMA:52640","FMA:11249","FMA:20630","FMA:53308","FMA:11216","FMA:65399","FMA:78649","FMA:11084","FMA:6897","FMA:53633","FMA:6085","FMA:6851","FMA:45457","FMA:6757","FMA:8732","FMA:8824","FMA:20632","FMA:6137","FMA:52730","FMA:7301","FMA:52699","FMA:53607","FMA:7300","FMA:53576","FMA:44904","FMA:65342","FMA:7127","FMA:6737","FMA:52669","FMA:21876","FMA:45425","FMA:65999","FMA:8728","FMA:21871","FMA:55172","FMA:6149","FMA:45453","FMA:44932","FMA:292832","FMA:6744","FMA:6781","FMA:44769","FMA:45326","FMA:6760","FMA:53634","FMA:53605","FMA:53530","FMA:6821","FMA:52968","FMA:53001","FMA:11552","FMA:45264","FMA:8835","FMA:6888","FMA:55160","FMA:44899","FMA:52979","FMA:45333","FMA:45310","FMA:6084","FMA:11781","FMA:82962","FMA:53280","FMA:52715","FMA:53311","FMA:16491","FMA:21880","FMA:44952","FMA:11687","FMA:11212","FMA:65335","FMA:52940","FMA:6774","FMA:8823","FMA:45388","FMA:6666","FMA:6072","FMA:16886","FMA:53312","FMA:65915","FMA:45357","FMA:11262","FMA:65921","FMA:0328826","FMA:81290","FMA:53279","FMA:11551","FMA:7293","FMA:6677","FMA:11756","FMA:53598","FMA:52732","FMA:44902","FMA:53545","FMA:6740","FMA:53502","FMA:53562","FMA:52700","FMA:7122","FMA:6118","FMA:65918","FMA:8814","FMA:16403","FMA:65346","FMA:6667","FMA:52630","FMA:52629","FMA:8871","FMA:16500","FMA:52725","FMA:6108","FMA:45363","FMA:65340","FMA:8872","FMA:11760","FMA:53604","FMA:11214","FMA:52777","FMA:21864","FMA:53503","FMA:6738","FMA:66000","FMA:6776","FMA:6777","FMA:6765","FMA:6111","FMA:8890","FMA:20607","FMA:52643","FMA:8908","FMA:65437","FMA:6762","FMA:11154","FMA:65344","FMA:52937","FMA:8919","FMA:45354","FMA:6766","FMA:53424","FMA:6145","FMA:65568","FMA:20634","FMA:6732","FMA:8893","FMA:11758","FMA:6889","FMA:11554","FMA:65922","FMA:7118","FMA:16884","FMA:45308","FMA:7290","FMA:6758","FMA:65743","FMA:11063","FMA:16885","FMA:8882","FMA:65286","FMA:291238","FMA:53482","FMA:52976","FMA:11308","FMA:53432","FMA:53540","FMA:45379","FMA:44871","FMA:6714","FMA:82955","FMA:65993","FMA:45452","FMA:52626","FMA:6083","FMA:53582","FMA:65919","FMA:52936","FMA:53506","FMA:8918","FMA:44901","FMA:6073","FMA:65315","FMA:53219","FMA:11194","FMA:6792","FMA:7119","FMA:52785","FMA:7296","FMA:53068","FMA:6845","FMA:52677","FMA:53504","FMA:53548","FMA:52698","FMA:53570","FMA:6771","FMA:7078","FMA:65997","FMA:65338","FMA:52969","FMA:16401","FMA:65416","FMA:6835","FMA:39082","FMA:8726","FMA:45254","FMA:8879","FMA:11250","FMA:53049","FMA:45382","FMA:8795","FMA:53495","FMA:45434","FMA:82963","FMA:0328827","FMA:52656","FMA:82961","FMA:11753","FMA:39147","FMA:45339","FMA:20605","FMA:20631","FMA:8898","FMA:6070","FMA:44892","FMA:16404","FMA:52942","FMA:6082","FMA:8861","FMA:82953","FMA:8808","FMA:8805","FMA:52994","FMA:65348","FMA:55173","FMA:7129","FMA:52674","FMA:44894","FMA:55159","FMA:65327","FMA:37320","FMA:6761","FMA:65349","FMA:11253","FMA:53507","FMA:11213","FMA:7307","FMA:6769","FMA:6759","FMA:55155","FMA:53675","FMA:53599","FMA:65282","FMA:53251","FMA:6731","FMA:11111","FMA:16497","FMA:8878","FMA:11211","FMA:65740","FMA:45367","FMA:53588","FMA:45365","UBERON:0011766","FMA:16502","FMA:6891","FMA:6091","FMA:11018","FMA:6090","FMA:292887","FMA:65401","FMA:65326","FMA:11215","FMA:44735","FMA:8735","FMA:53538","FMA:6849","FMA:53608","FMA:11217","FMA:8860","FMA:6134","FMA:6893","FMA:53534","FMA:45361","FMA:37321","FMA:82734","FMA:22112","FMA:7294","FMA:52987","FMA:65247","FMA:53535","FMA:6895","FMA:52787","FMA:53635","FMA:65920","FMA:55156","FMA:16498","FMA:53569","FMA:6739","FMA:8807","FMA:22110","FMA:81294","FMA:45450","FMA:8922","FMA:8725","FMA:20608","FMA:7308","FMA:65281","FMA:39084","FMA:78656","FMA:6133","FMA:53581","FMA:16494","FMA:53252","FMA:11789","FMA:45364","FMA:65345","FMA:44870","FMA:39083","FMA:45355","FMA:11193","FMA:16400","FMA:81287","FMA:52776","FMA:65747","FMA:8900","UBERON:0011767","FMA:45424","FMA:292830","FMA:44734","FMA:45381","FMA:82960","FMA:0328831","FMA:6689","FMA:7077","FMA:291236","FMA:8886","FMA:276381","FMA:6124","FMA:65336","FMA:65328","FMA:52670","FMA:53537","FMA:53636","FMA:6896","FMA:21879","FMA:8798","FMA:81288","FMA:53542","FMA:45368","FMA:53547","FMA:55157","FMA:65415","FMA:53309","FMA:65744","FMA:53367","FMA:53590","FMA:65923","FMA:53048","FMA:16499","FMA:53610","FMA:44951","FMA:44953","FMA:8832","FMA:45426","FMA:6114","FMA:52799","FMA:11039","FMA:53546","FMA:53589","FMA:8901","FMA:11681","FMA:52639","FMA:8905","FMA:52733","FMA:65992","FMA:52807","FMA:45435","FMA:53484","FMA:52975","FMA:7289","FMA:44905","FMA:37071","FMA:7130","FMA:65996","FMA:6132","FMA:8826","FMA:6741","FMA:11252","FMA:8917","FMA:82954","FMA:6832","FMA:37073","FMA:37074","FMA:44893","FMA:82959","FMA:20635","FMA:6093","FMA:65248","FMA:45362","FMA:52622","FMA:53508","FMA:11755","FMA:82958","FMA:52997","FMA:16501","FMA:65402","FMA:45427","FMA:52803","FMA:16402","FMA:8734","FMA:52784","FMA:45454","FMA:6736","FMA:7304","FMA:6742","FMA:52998","FMA:52804","FMA:11788","FMA:6713","FMA:52623","FMA:53536","FMA:11780","FMA:45334","FMA:52701","FMA:65998","FMA:11092","FMA:6684","FMA:52779","FMA:52778","FMA:78652","FMA:0328830","FMA:6733","FMA:44950","FMA:78653","FMA:45455","FMA:8864","FMA:8833","FMA:8876","FMA:8867","FMA:11752","FMA:53541","FMA:53611","FMA:8904","FMA:6745","FMA:21863","FMA:7297","FMA:52676","FMA:52798","FMA:8818","FMA:82735","FMA:52657","FMA:52786","FMA:6773","FMA:45253","FMA:6127","FMA:45263","FMA:8875","FMA:81295","FMA:11754","FMA:8812","FMA:45311","FMA:53568","FMA:276379","FMA:6842","FMA:8794","FMA:8820","FMA:53572","FMA:53409","FMA:37070","FMA:6119","FMA:53433","FMA:7123","FMA:8811","FMA:65444","FMA:52806","FMA:53245","FMA:65285","FMA:6768","FMA:8731","FMA:11220","FMA:6778","FMA:53509","FMA:55158","FMA:53567","FMA:65994","FMA:53539","FMA:45327","FMA:8865","FMA:44898","FMA:52673","FMA:80026","FMA:52980","FMA:53505","FMA:82952","FMA:21872","FMA:37065","FMA:52988","FMA:8815","FMA:53398","FMA:52729","FMA:81289","FMA:65398","FMA:52977","FMA:8887"],"subclass labels":["Left T9 white ramus communicans","Right T10 grey ramus communicans","Right T4 spinal nerve posterior ramus","Right fourth intercostal nerve","Right anterior interosseous nerve","Right perineal nerve","Left lateral calcaneal branch A of left sural nerve","Right C3 spinal nerve posterior ramus medial branch","Oesophageal branch of left recurrent laryngeal nerve","Anterior branch of lateral cutaneous branch of left third intercostal nerve","Left common plantar digital nerve F","Anterior cutaneous branch of right subcostal nerve","Left superior labial branch of infraorbital nerve","Left T1 spinal nerve posterior ramus","Anterior branch of left obturator nerve","Right T2 grey ramus communicans","Right T9 grey ramus communicans","Left T5 white ramus communicans","Left L3 spinal nerve posterior ramus lateral branch","Communicating branch of left vagus nerve with left glossopharyngeal nerve","Right second intercostal nerve","Right proper palmar digital nerve G","Left musculocutaneous nerve","Anterior cutaneous branch of left ninth intercostal nerve","Posterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve H","Communicating branch of right vagus nerve with right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right proper plantar digital nerve C","Left genital branch of genitofemoral nerve","Left T6 grey ramus communicans","Right proper palmar digital nerve I","Right T12 spinal nerve posterior ramus","Right ilioinguinal nerve","Right T8 spinal nerve posterior ramus","Left T9 spinal nerve posterior ramus","Right T11 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve J","Right medial sural cutaneous nerve","Right T6 spinal nerve posterior ramus medial branch","Right lesser occipital nerve","Right phrenic nerve","Right proper palmar digital nerve E","Left median nerve","Right S3 grey ramus communicans","Right T4 white ramus communicans","Right medial cutaneous nerve of forearm","Right posterior femoral cutaneous nerve","Right vestibular nerve","Lateral cutaneous branch of left sixth intercostal nerve","Left supratrochlear nerve","Right median nerve","Anterior branch of right medial cutaneous nerve of forearm","Right T5 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of right third intercostal nerve","Right C6 spinal nerve posterior ramus","Temporal branch of left facial nerve","Anterior cutaneous branch of left eighth intercostal nerve","Right buccal nerve","Right middle superior alveolar nerve","Temporal branch of right facial nerve","Left superficial branch of radial nerve","Left medial sural cutaneous nerve","Left C4 spinal nerve posterior ramus","Left lateral dorsal digital nerve of the third toe","Right T12 spinal nerve posterior ramus lateral branch","Anterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Left T12 spinal nerve posterior ramus","Left anterior supraclavicular nerve","Left lesser occipital nerve","Right deep fibular nerve","Left T11 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right anterior superior alveolar nerve","Left tenth intercostal nerve","Anterior branch of lateral cutaneous branch of right fourth intercostal nerve","Communicating branch of left glossopharyngeal nerve with auricular branch of left vagus nerve","Left iliohypogastric nerve","Cervical branch of left facial nerve","Right proper palmar digital nerve J","Lateral cutaneous branch of right sixth intercostal nerve","Right T8 white ramus communicans","Left maxillary nerve","Left intercostobrachial nerve","Left tentorial nerve","Right zygomaticotemporal nerve","Communicating branch of right internal laryngeal nerve with right recurrent laryngeal nerve","Left fourth intercostal nerve","Brachial plexus left C7 root","Vagal branch to right carotid body","Right proper plantar digital nerve G","Right tympanic nerve","Left lateral plantar nerve","Lateral cutaneous branch of left tenth intercostal nerve","Right tibial nerve","Left third occipital nerve","Anterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right T8 spinal nerve posterior ramus lateral branch","Right S1 grey ramus communicans","Left L3 spinal nerve posterior ramus","Palmar cutaneous branch of left ulnar nerve","Right greater petrosal nerve","Left subcostal nerve","Anterior branch of left medial cutaneous nerve of forearm","Left proper plantar digital nerve C","Left C3 spinal nerve branch to left supraclavicular nerve","Right posterior cutaneous nerve of forearm","Posterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right sciatic nerve","Left L5 grey ramus communicans","Right C4 spinal nerve posterior ramus medial branch","Right L4 grey ramus communicans","Left T11 white ramus communicans","Posterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left L1 grey ramus communicans","Posterior branch of left medial cutaneous nerve of forearm","Left auriculotemporal nerve","Left L2 white ramus communicans","Marginal mandibular branch of right facial nerve","Right T8 grey ramus communicans","Right C4 spinal nerve posterior ramus","Right fifth intercostal nerve","Left common fibular nerve","Left posterior ethmoidal nerve","Pharyngeal branch of right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right third intercostal nerve","Communicating branch of right external laryngeal nerve with right superior cardiac nerve","Right posterior supraclavicular nerve","Left medial dorsal cutaneous nerve","Lateral cutaneous branch of right eleventh intercostal nerve","Posterior branch of lateral cutaneous branch of left subcostal nerve","Anterior cutaneous branch of left second intercostal nerve","Left lingual nerve","Right lateral calcaneal branch A of right sural nerve","Left phrenic nerve","Right hypogastric nerve","Medial calcaneal branch A of left tibial nerve","Left perineal nerve","Right posterior scrotal nerve","Right inferior alveolar nerve","Medial calcaneal branch A of right tibial nerve","Right T7 white ramus communicans","Left frontal nerve","Right T1 spinal nerve posterior ramus medial branch","Right genitofemoral nerve","Zygomatic branch of right facial nerve","Lateral cutaneous branch of left ninth intercostal nerve","Left C2 spinal nerve branch to left great auricular nerve","Right anterior supraclavicular nerve","Lateral cutaneous branch of right fourth intercostal nerve","Left T11 grey ramus communicans","Lingual branch of right vagus nerve","Left T1 white ramus communicans","Left C3 spinal nerve posterior ramus medial branch","Left proper plantar digital nerve J","Left T2 grey ramus communicans","Brachial plexus left C6 root","Left T10 spinal nerve posterior ramus","Right genital branch of genitofemoral nerve","Anterior cutaneous branch of right first intercostal nerve","Left middle meningeal nerve","Anterior cutaneous branch of left eleventh intercostal nerve","Left infratrochlear nerve","Vagal branch to left carotid body","Anterior cutaneous branch of right eleventh intercostal nerve","Right proper palmar digital nerve B","Left proper palmar digital nerve H","Anterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left seventh intercostal nerve","Right nasociliary nerve","Left posterior scrotal nerve","Left sural nerve","Right S5 grey ramus communicans","Brachial plexus right C7 root","Right inferior rectal nerve","Right transverse cervical nerve","Anterior cutaneous branch of left third intercostal nerve","Left proper plantar digital nerve H","Superficial branch of left ulnar nerve","Dorsal branch of left ulnar nerve","Right eleventh intercostal nerve","Right T2 white ramus communicans","Right common plantar digital nerve F","Infrapatellar branch of right saphenous nerve","Left T5 grey ramus communicans","Lingual branch of left vagus nerve","Thoracic cardiac branch of left vagus nerve","Right superior laryngeal nerve","Right C2 spinal nerve posterior ramus","Right zygomatic nerve","Right auriculotemporal nerve","Anterior branch of lateral cutaneous branch of left subcostal nerve","Left saphenous nerve","Right L3 spinal nerve posterior ramus","Right T7 grey ramus communicans","Left great auricular nerve posterior branch","Left proper palmar digital nerve A","Right infraorbital nerve","Cutaneous branch of right obturator nerve","Posterior branch of right obturator nerve","Left T1 grey ramus communicans","Right T12 white ramus communicans","Right proper plantar digital nerve F","Left posterior auricular nerve","Right posterior ethmoidal nerve","Buccal branch of right facial nerve","Right iliohypogastric nerve","Left dorsal nerve of penis","Right inferior lateral cutaneous nerve of arm","Left T7 spinal nerve posterior ramus lateral branch","Lateral cutaneous branch of left seventh intercostal nerve","Right posterior interosseous nerve","Left middle superior alveolar nerve","Right T9 white ramus communicans","Right T10 spinal nerve posterior ramus","Left deep fibular nerve","Hepatic branch of anterior vagal trunk","Left first intercostal nerve","Right L2 white ramus communicans","Buccal branch of left facial nerve","Right L5 grey ramus communicans","Right common fibular nerve","Left T6 spinal nerve posterior ramus medial branch","Right L2 grey ramus communicans","Right deep petrosal nerve","Left axillary nerve posterior branch","Right posterior auricular nerve","Anterior branch of lateral cutaneous branch of right subcostal nerve","Anterior branch of lateral cutaneous branch of right fifth intercostal nerve","Pyloric branch of greater posterior gastric nerve","Left T10 spinal nerve posterior ramus lateral branch","Superior cervical cardiac branch of right vagus nerve","Ganglionic branch of right maxillary nerve to pterygopalatine ganglion","Left proper palmar digital nerve C","Right superior cervical cardiac nerve","Right ninth intercostal nerve","Right lesser petrosal nerve","Communicating branch of left external laryngeal nerve with left superior cardiac nerve","Right long ciliary nerve B","Anterior cutaneous branch of right fourth intercostal nerve","Right third intercostal nerve","Left L4 grey ramus communicans","Right T7 spinal nerve posterior ramus","Left L2 spinal nerve posterior ramus lateral branch","Left proper palmar digital nerve F","Coeliac branch of posterior vagal trunk","Left lacrimal nerve","Right lacrimal nerve","Anterior cutaneous branch of right seventh intercostal nerve","Left femoral nerve","Right maxillary nerve","Lateral cutaneous branch of right third intercostal nerve","Right superficial fibular nerve","Left proper palmar digital nerve I","Anterior cutaneous branch of left seventh intercostal nerve","Left T12 spinal nerve posterior ramus lateral branch","Thoracic cardiac branch of right vagus nerve","Lateral cutaneous branch of left eighth intercostal nerve","Orbital branch of left maxillary nerve to left ethmoidal sinus","Left pudendal nerve","Left lesser petrosal nerve","Right eighth intercostal nerve","Left S5 grey ramus communicans","Right T10 white ramus communicans","Left T10 white ramus communicans","Left T4 white ramus communicans","Lateral cutaneous branch of left third intercostal nerve","Posterior branch of lateral cutaneous branch of left eighth intercostal nerve","Lateral cutaneous branch of right iliohypogastric nerve","Right supratrochlear nerve","Anterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right C3 spinal nerve branch to right supraclavicular nerve","Right T6 grey ramus communicans","Left T5 spinal nerve posterior ramus medial branch","Left proper palmar digital nerve G","Left posterior superior alveolar nerve","Lateral cutaneous branch of left subcostal nerve","Gluteal branch A of right posterior femoral cutaneous nerve","Right T5 white ramus communicans","Left greater petrosal nerve","Left T3 spinal nerve posterior ramus","Right subcostal nerve","Right femoral branch of genitofemoral nerve","Right sixth intercostal nerve","Anterior cutaneous branch of right ninth intercostal nerve","Left T11 spinal nerve posterior ramus lateral branch","Left T7 grey ramus communicans","Posterior branch of lateral cutaneous branch of right subcostal nerve","Left L2 grey ramus communicans","Posterior branch of lateral cutaneous branch of right third intercostal nerve","Right L1 white ramus communicans","Anterior branch of right obturator nerve","Anterior cutaneous branch of left fifth intercostal nerve","Left T4 grey ramus communicans","Right C5 spinal nerve posterior ramus medial branch","Right T4 spinal nerve posterior ramus medial branch","Left L1 white ramus communicans","Anterior cutaneous branch of right eighth intercostal nerve","Left subclavian nerve","Pericardial branch of left phrenic nerve","Left tympanic nerve","Right zygomaticofacial nerve","Right intercostobrachial nerve","Right cochlear nerve","Left internal laryngeal nerve","Right lateral dorsal digital nerve of the third toe","Left proper palmar digital nerve D","Inferior cervical cardiac branch of left vagus nerve","Left proper plantar digital nerve B","Right S2 grey ramus communicans","Right proper plantar digital nerve H","Right tentorial nerve","Right T1 white ramus communicans","Inferior ramus of left internal laryngeal nerve","Right L3 grey ramus communicans","Right posterior superior alveolar nerve","Tonsillar branch of right glossopharyngeal nerve","Lateral cutaneous branch of right subcostal nerve","Right proper palmar digital nerve C","Right first intercostal nerve","Posterior branch of right medial cutaneous nerve of forearm","Right lingual nerve","Lateral cutaneous branch of right fifth intercostal nerve","Left T4 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left third intercostal nerve","Right posterior superior lateral nasal branch of maxillary nerve","Posterior branch of lateral cutaneous branch of right fifth intercostal nerve","Left buccal nerve","Right third occipital nerve","Left anterior ethmoidal nerve","Right lingual branch of glossopharyngeal nerve","Left laryngopharyngeal branch of superior cervical ganglion","Right infratrochlear nerve","Left external laryngeal nerve branch to pharyngeal plexus","Left T7 white ramus communicans","Left L1 spinal nerve posterior ramus","Right S4 grey ramus communicans","Left proper palmar digital nerve J","Left zygomatic nerve","Left L1 spinal nerve posterior ramus lateral branch","Left greater occipital nerve","Left medial cutaneous nerve of forearm","Brachial plexus left C8 root","Left anterior femoral cutaneous branch A","Posterior branch of lateral cutaneous branch of left seventh intercostal nerve","Left T1 spinal nerve posterior ramus medial branch","Left meningeal branch of mandibular nerve","Left medial dorsal digital nerve of the fourth toe","Left C5 spinal nerve posterior ramus","Pharyngeal branch of left glossopharyngeal nerve","Right medial plantar nerve","Left proper plantar digital nerve F","Left deep petrosal nerve","Right supraorbital nerve","Left proper plantar digital nerve E","Right T9 spinal nerve posterior ramus lateral branch","Left posterior cutaneous nerve of forearm","Left posterior femoral cutaneous nerve","Left hypogastric nerve","Left genitofemoral nerve","Anterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T1 spinal nerve posterior ramus","Right common palmar digital nerve A","Right L3 spinal nerve posterior ramus lateral branch","Left anterior superior alveolar nerve","Right T1 grey ramus communicans","Anterior cutaneous branch of left sixth intercostal nerve","Left proper plantar digital nerve A","Left T5 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus","Right superior labial branch of infraorbital nerve","Left proper palmar digital nerve E","Left transverse cervical nerve","Posterior branch of lateral cutaneous branch of right fourth intercostal nerve","Left communicating branch of nasociliary nerve with ciliary ganglion","Superficial branch of right ulnar nerve","Right great auricular nerve posterior branch","Palmar branch of right median nerve","Right ulnar nerve","Right T5 grey ramus communicans","Palmar cutaneous branch of right ulnar nerve","Left T2 spinal nerve posterior ramus medial branch","Tonsillar branch of left glossopharyngeal nerve","Lateral cutaneous branch of right eighth intercostal nerve","Posterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Left T6 white ramus communicans","Right T4 grey ramus communicans","Branch of right vagus nerve to oesophageal nerve plexus","Superior cervical cardiac branch of left vagus nerve","Left long thoracic nerve","Right mental nerve","Left fifth intercostal nerve","Lateral cutaneous branch of left fourth intercostal nerve","Right lateral femoral cutaneous nerve","Posterior branch of lateral cutaneous branch of right seventh intercostal nerve","Lateral cutaneous branch of right seventh intercostal nerve","Left C4 spinal nerve posterior ramus medial branch","Right intermediate dorsal cutaneous nerve","Right medial dorsal cutaneous nerve","Left recurrent laryngeal nerve","Left obturator nerve","Left T8 grey ramus communicans","Right T2 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus medial branch","Left T2 spinal nerve posterior ramus","Right superficial branch of radial nerve","Right C3 spinal nerve branch to right great auricular nerve","Left anterior interosseous nerve","Lateral cutaneous branch of right ninth intercostal nerve","Left common plantar digital nerve E","Brachial plexus left C5 root","Left external laryngeal nerve","Left C3 spinal nerve posterior ramus","Oesophageal branch of right recurrent laryngeal nerve","Lateral cutaneous branch of right tenth intercostal nerve","Anterior cutaneous branch of right sixth intercostal nerve","Right T3 white ramus communicans","Left T9 grey ramus communicans","Auricular branch of right vagus nerve","Right lateral sural cutaneous nerve","Left ulnar nerve","Right long ciliary nerve A","Left sciatic nerve","Anterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right inferior palpebral branch of infraorbital nerve","Right medial cutaneous nerve of arm","Auricular branch of left vagus nerve","Left T10 grey ramus communicans","Left medial posterior superior nasal nerve","Pharyngeal branch of right vagus nerve to pharyngeal nerve plexus","Left L3 grey ramus communicans","Left lateral femoral cutaneous nerve","Right external laryngeal nerve branch to pharyngeal plexus","Left eighth intercostal nerve","Right T5 spinal nerve posterior ramus","Left tibial nerve","Right superior lateral cutaneous nerve of arm","Right lateral plantar nerve","Anterior cutaneous branch of left first intercostal nerve","Brachial plexus right C8 root","Lateral cutaneous branch of left iliohypogastric nerve","Posterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Right long thoracic nerve","Left lateral cutaneous nerve of forearm","Left posterior supraclavicular nerve","Left T3 grey ramus communicans","Left ilioinguinal nerve","Left mental nerve","Left T12 white ramus communicans","Left superficial fibular nerve","Right proper palmar digital nerve F","Right proper palmar digital nerve D","Right lateral cutaneous nerve of forearm","Gluteal branch A of left posterior femoral cutaneous nerve","Lateral cutaneous branch of left fifth intercostal nerve","Right L1 spinal nerve posterior ramus lateral branch","Right axillary nerve anterior branch","Orbital branch of right maxillary nerve to right ethmoidal sinus","Right C6 spinal nerve posterior ramus medial branch","Posterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right recurrent laryngeal nerve","Right sural nerve","Dorsal branch of right ulnar nerve","Right common plantar digital nerve E","Right medial dorsal digital nerve of the fourth toe","Right proper plantar digital nerve E","Left caroticotympanic nerve","Greater posterior gastric nerve","Right L1 spinal nerve posterior ramus","Pericardial branch of right phrenic nerve","Anterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left incisive branch of inferior alveolar nerve","Right T3 grey ramus communicans","Left posterior interosseous nerve","Palmar branch of left median nerve","Left nasociliary nerve","Right external laryngeal nerve","Pharyngeal branch of left vagus nerve to pharyngeal nerve plexus","Right T11 grey ramus communicans","Right dorsal nerve of penis","Left C6 spinal nerve posterior ramus","Left axillary nerve anterior branch","Meningeal branch of left vagus nerve","Left intermediate dorsal cutaneous nerve","Right laryngopharyngeal branch of superior cervical ganglion","Right great auricular nerve anterior branch","Zygomatic branch of left facial nerve","Left C5 spinal nerve posterior ramus medial branch","Marginal mandibular branch of left facial nerve","Right L1 grey ramus communicans","Right meningeal branch of mandibular nerve","Right femoral nerve","Tracheal branch of right recurrent laryngeal nerve","Left posterior cutaneous nerve of arm","Left inferior lateral cutaneous nerve of arm","Right L2 spinal nerve posterior ramus","Right lateral dorsal cutaneous nerve","Anterior cutaneous branch of right second intercostal nerve","Left nasopalatine nerve","Left T3 spinal nerve posterior ramus medial branch","Left superior cervical cardiac nerve","Posterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T7 spinal nerve posterior ramus lateral branch","Right frontal nerve","Anterior cutaneous branch of left tenth intercostal nerve","Ganglionic branch of left maxillary nerve to pterygopalatine ganglion","Left S1 grey ramus communicans","Left lesser palatine nerve","Left medial plantar nerve","Communicating branch of right glossopharyngeal nerve with auricular branch of right vagus nerve","Left zygomaticotemporal nerve","Anterior cutaneous branch of right fifth intercostal nerve","Left proper palmar digital nerve B","Left radial nerve","Posterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left S3 grey ramus communicans","Left T3 white ramus communicans","Right T11 spinal nerve posterior ramus","Left ninth intercostal nerve","Right T2 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of left subcostal nerve","Right proper plantar digital nerve B","Left C2 spinal nerve posterior ramus","Right axillary nerve","Left axillary nerve","Left common palmar digital nerve A","Left proper plantar digital nerve D","Left femoral branch of genitofemoral nerve","Left second intercostal nerve","Left medial cutaneous nerve of arm","Left lateral sural cutaneous nerve","Right ophthalmic nerve","Right carotid sinus nerve","Right T10 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve D","Right mandibular nerve","Right obturator nerve","Left C3 spinal nerve branch to left great auricular nerve","Left lateral dorsal cutaneous nerve","Right greater palatine nerve","Right L2 spinal nerve posterior ramus lateral branch","Brachial plexus right C5 root","Left posterior superior lateral nasal branch of maxillary nerve","Right proper plantar digital nerve I","Right seventh intercostal nerve","Anterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Right tenth intercostal nerve","Left mandibular nerve","Left greater palatine nerve","Left T12 grey ramus communicans","Inferior cervical cardiac branch of right vagus nerve","Left ophthalmic nerve","Left superior laryngeal nerve","Right T12 grey ramus communicans","Cutaneous branch of left obturator nerve","Left long ciliary nerve B","Left S4 grey ramus communicans","Left T4 spinal nerve posterior ramus medial branch","Greater anterior gastric nerve","Orbital branch of left maxillary nerve to left sphenoidal sinus","Orbital branch of right maxillary nerve to right sphenoidal sinus","Right middle supraclavicular nerve","Right caroticotympanic nerve","Left sixth intercostal nerve","Right posterior cutaneous nerve of arm","Left middle supraclavicular nerve","Left proper plantar digital nerve I","Anterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left L2 spinal nerve posterior ramus","Anterior branch of lateral cutaneous branch of left seventh intercostal nerve","Posterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left T8 spinal nerve posterior ramus lateral branch","Meningeal branch of right vagus nerve","Tracheal branch of left recurrent laryngeal nerve","Anterior cutaneous branch of right tenth intercostal nerve","Left eleventh intercostal nerve","Right pudendal nerve","Posterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right anterior ethmoidal nerve","Right nasopalatine nerve","Left T8 spinal nerve posterior ramus","Left long ciliary nerve A","Left supraorbital nerve","Right medial posterior superior nasal nerve","Left T8 white ramus communicans","Right anterior femoral cutaneous branch A","Left T2 white ramus communicans","Right saphenous nerve","Anterior branch of lateral cutaneous branch of right seventh intercostal nerve","Left superior lateral cutaneous nerve of arm","Left T9 spinal nerve posterior ramus lateral branch","Left T6 spinal nerve posterior ramus","Posterior branch of left obturator nerve","Left external laryngeal nerve branch to inferior pharyngeal constrictor","Right incisive branch of inferior alveolar nerve","Right C3 spinal nerve posterior ramus","Right C5 spinal nerve posterior ramus","Right T9 spinal nerve posterior ramus","Communicating branch of left internal laryngeal nerve with left recurrent laryngeal nerve","Left vestibular nerve","Right radial nerve","Left third intercostal nerve","Left cochlear nerve","Anterior cutaneous branch of left fourth intercostal nerve","Right T6 spinal nerve posterior ramus","Right greater occipital nerve","Right lesser palatine nerve","Left inferior alveolar nerve","Right subclavian nerve","Right T6 white ramus communicans","Brachial plexus right C6 root","Lateral cutaneous branch of left eleventh intercostal nerve","Right T11 white ramus communicans","Left carotid sinus nerve","Left great auricular nerve anterior branch","Right external laryngeal nerve branch to inferior pharyngeal constrictor","Left S2 grey ramus communicans","Right internal laryngeal nerve","Infrapatellar branch of left saphenous nerve","Anterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve A","Right communicating branch of nasociliary nerve with ciliary ganglion","Left proper plantar digital nerve G","Left infraorbital nerve","Left lingual branch of glossopharyngeal nerve","Right proper plantar digital nerve A","Left inferior rectal nerve","Right musculocutaneous nerve","Left inferior palpebral branch of infraorbital nerve","Left T7 spinal nerve posterior ramus","Cervical branch of right facial nerve","Right middle meningeal nerve","Right axillary nerve posterior branch","Right C2 spinal nerve branch to right great auricular nerve","Left zygomaticofacial nerve","Anterior branch of lateral cutaneous branch of left eighth intercostal nerve"]},{id:77,nerve_id:"UBERON:0001647",label:"facial nerve","FMA subclasses (in human nerves)":["FMA:50888","FMA:50889"],"subclass labels":["Right facial nerve","Left facial nerve"]},{id:78,nerve_id:"UBERON:0001148",label:"median nerve","FMA subclasses (in human nerves)":["FMA:37067","FMA:37068"],"subclass labels":["Right median nerve","Left median nerve"]},{id:79,nerve_id:"UBERON:0009009",label:"carotid sinus nerve","FMA subclasses (in human nerves)":["FMA:53508","FMA:53509"],"subclass labels":["Right carotid sinus nerve","Left carotid sinus nerve"]},{id:80,nerve_id:"UBERON:0003715",label:"splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6930","FMA:6960","FMA:6958","FMA:6959","FMA:6925","FMA:6956","FMA:6927","FMA:6955","FMA:6926","FMA:6957"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left least splanchnic nerve","Left lesser splanchnic nerve","Right least splanchnic nerve","Left first lumbar splanchnic nerve","Right greater splanchnic nerve","Left second lumbar splanchnic nerve","Left greater splanchnic nerve","Right second lumbar splanchnic nerve","Right lesser splanchnic nerve"]},{id:81,nerve_id:"ILX:0793826",label:"anterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:82,nerve_id:"UBERON:0001650",label:"hypoglossal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:83,nerve_id:"ILX:0794967",label:"posterior interosseous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:84,nerve_id:"ILX:0793713",label:"Deep petrosal nerve","FMA subclasses (in human nerves)":["FMA:0328827","FMA:0328826"],"subclass labels":["Left deep petrosal nerve","Right deep petrosal nerve"]},{id:85,nerve_id:"ILX:0793361",label:"white communicating ramus of third lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:86,nerve_id:"ILX:0787562",label:"gray communicating ramus of the third thoracic nerve","FMA subclasses (in human nerves)":["FMA:6133","FMA:6124"],"subclass labels":["Left T3 grey ramus communicans","Right T3 grey ramus communicans"]},{id:87,nerve_id:"ILX:0793211",label:"white communicating ramus of fifth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:88,nerve_id:"UBERON:0018679",label:"thoracic splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6958","FMA:6960","FMA:6955","FMA:6959","FMA:6957","FMA:6956"],"subclass labels":["Left lesser splanchnic nerve","Left least splanchnic nerve","Left greater splanchnic nerve","Right least splanchnic nerve","Right lesser splanchnic nerve","Right greater splanchnic nerve"]},{id:89,nerve_id:"ILX:0731969",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:90,nerve_id:"ILX:0788771",label:"gray communicating ramus of seventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6888","FMA:6889"],"subclass labels":["Right T7 grey ramus communicans","Left T7 grey ramus communicans"]},{id:91,nerve_id:"UBERON:0022301",label:"long ciliary nerve","FMA subclasses (in human nerves)":["FMA:52701","FMA:52700","FMA:82734","FMA:82735"],"subclass labels":["Left long ciliary nerve B","Right long ciliary nerve B","Right long ciliary nerve A","Left long ciliary nerve A"]},{id:92,nerve_id:"ILX:0793221",label:"white communicating ramus of second lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:93,nerve_id:"ILX:0785825",label:"gray communicating ramus of first lumbar nerve","FMA subclasses (in human nerves)":["FMA:65924","FMA:65923"],"subclass labels":["Left L1 grey ramus communicans","Right L1 grey ramus communicans"]},{id:94,nerve_id:"ILX:0793208",label:"white communicating ramus of second thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:95,nerve_id:"UBERON:0018412",label:"vidian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:96,nerve_id:"ILX:0739303",label:"gray communicating ramus of second thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:97,nerve_id:"ILX:0795006",label:"Suboccipital nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:98,nerve_id:"ILX:0785733",label:"gray communicating ramus of second lumbar nerve","FMA subclasses (in human nerves)":["FMA:65921","FMA:65922"],"subclass labels":["Right L2 grey ramus communicans","Left L2 grey ramus communicans"]},{id:99,nerve_id:"UBERON:0035207",label:"deep fibular nerve","FMA subclasses (in human nerves)":["FMA:45387","FMA:45388"],"subclass labels":["Right deep fibular nerve","Left deep fibular nerve"]},{id:100,nerve_id:"ILX:0739304",label:"gray communicating ramus of third thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:101,nerve_id:"UBERON:0002019",label:"accessory XI nerve","FMA subclasses (in human nerves)":["FMA:50899","FMA:50897"],"subclass labels":["Left accessory nerve","Right accessory nerve"]},{id:102,nerve_id:"ILX:0793217",label:"white communicating ramus of eleventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:103,nerve_id:"ILX:0793722",label:"Lesser petrosal nerve","FMA subclasses (in human nerves)":["FMA:53503","FMA:53502"],"subclass labels":["Left lesser petrosal nerve","Right lesser petrosal nerve"]},{id:104,nerve_id:"UBERON:0018675",label:"pelvic splanchnic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:105,nerve_id:"ILX:0793702",label:"Greater petrosal nerve","FMA subclasses (in human nerves)":["FMA:53423","FMA:53424"],"subclass labels":["Right greater petrosal nerve","Left greater petrosal nerve"]},{id:106,nerve_id:"ILX:0794916",label:"white ramus communicans","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:107,nerve_id:"UBERON:0003716",label:"Recurrent Laryngeal Nerve","FMA subclasses (in human nerves)":["UBERON:0011766","UBERON:0011767"],"subclass labels":["Left recurrent laryngeal nerve","Right recurrent laryngeal nerve"]},{id:108,nerve_id:"UBERON:0005465",label:"obturator nerve","FMA subclasses (in human nerves)":["FMA:16501","FMA:16502"],"subclass labels":["Right obturator nerve","Left obturator nerve"]},{id:109,nerve_id:"ILX:0793213",label:"white communicating ramus of seventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:110,nerve_id:"ILX:0785067",label:"gray communicating ramus of eleventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6897","FMA:6896"],"subclass labels":["Left T11 grey ramus communicans","Right T11 grey ramus communicans"]},{id:111,nerve_id:"UBERON:0001494",label:"ulnar nerve","FMA subclasses (in human nerves)":["FMA:37320","FMA:37321"],"subclass labels":["Right ulnar nerve","Left ulnar nerve"]},{id:112,nerve_id:"ILX:0794959",label:"posterior rami lower cervical nerves","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:113,nerve_id:"UBERON:0001493",label:"axillary nerve","FMA subclasses (in human nerves)":["FMA:37074","FMA:37073"],"subclass labels":["Left axillary nerve","Right axillary nerve"]},{id:114,nerve_id:"ILX:0787946",label:"gray communicating ramus of sixth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6762","FMA:6763"],"subclass labels":["Right T6 grey ramus communicans","Left T6 grey ramus communicans"]},{id:115,nerve_id:"ILX:0785542",label:"gray communicating ramus of ninth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6892","FMA:6893"],"subclass labels":["Right T9 grey ramus communicans","Left T9 grey ramus communicans"]}],dGe=()=>{const e={};return XK.forEach(t=>{const n=t.nerve_id,o=t.label.toLowerCase(),a=t["subclass labels"];if(n&&o!=="nerve"){if(!a.length)return;n in e||(e[n]={});const i=a.map(s=>s.toLowerCase()).sort();e[n]={nerve:o,subNerves:i}}}),e},uGe=()=>{let e=[],t={key:"scaffold.connectivity.nerve",label:"Nerves",children:[]},n=[];for(const o of XK){if(o.label==="nerve")continue;let a={facetPropPath:"scaffold.connectivity.nerve",label:"",children:[]},i=[];for(const[s,l]of Object.entries(o))if(s==="label"&&(a.label=l),s==="subclass labels")for(const c of l)i.push({facetPropPath:"scaffold.connectivity.subnerve",label:c});i.length&&(a.children=i.sort((s,l)=>s.label.localeCompare(l.label)),n.push(a))}return n.length&&(t.children=n.sort((o,a)=>o.label.localeCompare(a.label)),e.push(t)),e};function fGe(e){return e[0].toUpperCase()+e.substring(1)}const Jd={emits:["flatmap-provenance-ready","resource-selected","species-changed"],props:{entry:Object,visible:{type:Boolean,default:!0},mouseHovered:{type:Boolean,default:!1}},inject:["showGlobalSettings","showOpenMapButton"],computed:{...Mt.mapStores(Mf,vi,Ss,AV),idNamePair(){return this.splitFlowStore.idNamePair},useHelpModeDialog(){return this.settingsStore.useHelpModeDialog},connectivityInfoSidebar(){return this.settingsStore.connectivityInfoSidebar},annotationSidebar(){return this.settingsStore.annotationSidebar},showLocalSettings(){return!this.showGlobalSettings}},beforeUnmount:function(){this.alive=!1},mounted:function(){this.multiflatmapRef=this.$refs.multiflatmap,this.flatmapRef=this.$refs.flatmap,this.scaffoldRef=this.$refs.scaffold,this.iframeRef=this.$refs.iframe,this.plotRef=this.$refs.plot,this.simulationRef=this.$refs.simulation,(this.scaffoldRef||this.iframeRef||this.plotRef||this.simulationRef)&&this.loadExplorerConfig(),this.connectivityKnowledge=this.connectivitiesStore.globalConnectivities,this.connectivityFilterOptions=this.connectivitiesStore.filterOptions,this.connectivityFilterSources=this.connectivitiesStore.filterSources},methods:{onConnectivityItemClose(){if(this!=null&&this.alive){if(this.multiflatmapRef){const e=this.multiflatmapRef.getCurrentFlatmap();e&&e.closeTooltip()}this.flatmapRef&&this.flatmapRef.closeTooltip()}},getState:function(){},openMap:function(e){$e.emit("OpenNewMap",e),this.trackOpenMap(`open_new_${e}_map`)},onMapmanagerLoaded:function(e){this.settingsStore.updateMapManager(e)},trackOpenMap:function(e){Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_open_map",category:e,location:"open_new_map"})},updateEntryLabel:function(e){e&&this.entriesStore.updateLabelForEntry(this.entry,e)},updateEntryTitle:function(e){e&&this.entriesStore.updateTitleForEntry(this.entry,e)},updateWithViewUrl:function(){},search:function(){return!1},searchSuggestions:function(){},resourceSelected:function(e,t){var s,l,c,d;const n=t[0];if(this.resourceHasAction(n)){$e.emit("PopoverActionClick",n);return}let o,a=!1;const i={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0,eventType:void 0};if(e=="MultiFlatmap"||e=="Flatmap")if(i.internalName=(s=n==null?void 0:n.feature)!=null&&s.label?n.feature.label:this.idNamePair[n.feature.models],n.eventType=="click"){if(i.eventType="selected",n.feature.type=="marker"){let u=i.internalName;if(this.settingsStore.isFeaturedMarkerIdentifier(n.feature.id))o={type:"Search",term:this.settingsStore.featuredMarkerDoi(n.feature.id),featuredDataset:!0};else{o={type:"Facet",facets:[u]};let f=new Set;if(n.feature["dataset-terms"].forEach(p=>{f.add(p.label?p.label:p.term)}),f.size===0&&f.add(u),o.facets=[...f],this.settingsStore.hasAppliedFacets(f)&&this.settingsStore.appliedFacets.length<=f.size)return;if(this.settingsStore.appliedFacets.length){if(!this.settingsStore.hasAppliedFacets(f)){const p=[...new Set([...this.settingsStore.appliedFacets,...f])];this.settingsStore.updateAppliedFacets(p)}}else f.size>1&&(o.type="Facets"),this.settingsStore.updateAppliedFacets(o.facets)}a=!0,e=="MultiFlatmap"&&this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}}else n.eventType=="mouseenter"&&(i.eventType="highlighted",a=!0);else e=="Scaffold"&&(n&&((((l=n.data)==null?void 0:l.id)===void 0||((c=n.data)==null?void 0:c.id)==="")&&(n.data.id=(d=n.data)==null?void 0:d.group),i.internalName=n.data.id,n.data.lastActionOnMarker===!0&&(o={type:"Facet",facets:[fGe(n.data.id)]})),i.eventType="selected",a=!0);o&&$e.emit("PopoverActionClick",o),a&&this.$emit("resource-selected",i)},resourceHasAction:function(e){return e&&(e.type==="URL"||e.type==="Search"||e.type==="Neuron Search"||e.type=="Facet"||e.type=="Facets")},isVisible:function(){return this.splitFlowStore.getPaneNameById(this.entry.id)!==void 0},getNameAndIdFromSyncData:async function(e){let t=e.internalName;t===void 0&&e.resource&&(t=e.resource.label);let n;if(e.resource&&e.resource.resource&&(n=e.resource.resource[0]),this.entry.type==="Scaffold"){if(this.$refs.scaffold.findObjectsWithGroupName(t).length===0){if(e.resource&&e.resource.feature){const i=xV(e.resource.feature.models);if(i.length>0)return i}let a=L5e(t);if(a)return a;if(n&&e.eventType==="selected")return fetch(`${this.apiLocation}get-related-terms/${n}`).then(i=>i.json()).then(i=>{var s;if(((s=i.uberon)==null?void 0:s.array.length)>0)return t=i.uberon.array[0].name.charAt(0).toUpperCase()+i.uberon.array[0].name.slice(1),n=i.uberon.array[0].id.toUpperCase(),{id:n,name:t}})}}else if(this.entry.type==="MultiFlatmap")if(t==="Bladder")t="Urinary Bladder";else{const o=xV(t);o.length>0&&(t=o[0])}return{id:n,name:t}},getDatasetAnatomyInfo:function(e){fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then(t=>t.json()).then(t=>{const n=t.result[0];let o;try{o=n.anatomy.organ[0].curie}catch{o=void 0}let a;try{a=n.item.curie}catch{a=void 0}let i;try{let s=0,l=!1;for(;!l&&s<n.organisms.subject.length;){const c=n.organisms.subject[s];c.species&&(i=c.species.name,l=!0),s+=1}}catch{i=void 0}this.settingsStore.updateFeaturedMarker({identifier:e,marker:o,doi:a,species:i})})},oldFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();return!t.identifiers||t.identifiers.length==0?!1:t.identifiers},newFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_dataset`)).json();return!t.datasets||t.datasets.length==0?!1:t.datasets.map(n=>n.id)},flatmapResourceSelected:function(e,t){var s;this.resourceSelected(e,t);const n=t[0],{eventType:o,feature:a}=n,{viewingMode:i}=this.settingsStore.globalSettings;if(o==="click"&&a.type==="feature"&&((s=a.models)!=null&&s.startsWith("ilxtr:"))){const l=[];t.forEach(c=>{const{models:d}=c.feature;l.push(d)}),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_connectivity",category:l.join(", "),location:e+" "+i})}},getFeaturedDatasets:async function(){let e=[],t=await this.oldFeaturedDatasetApiHasInfo();if(t)e=t;else{let n=await this.newFeaturedDatasetApiHasInfo();n&&(e=n)}this.settingsStore.updateFeatured(e),e.forEach(n=>{this.getDatasetAnatomyInfo(n)})},flatmapMarkerUpdate(){},onResize:function(){},updateViewerSettings:function(){},startHelp:function(){this!=null&&this.alive&&this.isInHelp===!1&&(this.helpMode=!0,window.addEventListener("mousedown",this.checkEndHelpMouseDown),this.isInHelp=!0)},endHelp:function(){window.removeEventListener("mousedown",this.checkEndHelpMouseDown),this.helpMode=!1,setTimeout(()=>{this.isInHelp=!1},200)},onHelpModeShowNext:function(){this.helpModeActiveItem+=1},onHelpModeLastItem:function(e){e&&(this.helpModeLastItem=!0)},onFinishHelpMode:function(){this.helpMode=!1,this.helpModeActiveItem=0,this.helpModeLastItem=!1},onTooltipShown:function(){this.$refs.multiflatmap&&this.$refs.multiflatmapHelp&&this.$refs.multiflatmapHelp.toggleTooltipHighlight(),this.$refs.flatmap&&this.$refs.flatmapHelp&&this.$refs.flatmapHelp.toggleTooltipHighlight(),this.$refs.scaffold&&this.$refs.scaffoldHelp&&this.$refs.scaffoldHelp.toggleTooltipHighlight()},onMapTooltipShown:function(){this.$refs.multiflatmap&&this.$refs.multiflatmapHelp&&this.$refs.multiflatmapHelp.toggleTooltipPinHighlight(),this.$refs.flatmap&&this.$refs.flatmapHelp&&this.$refs.flatmapHelp.toggleTooltipPinHighlight(),this.$refs.scaffold&&this.$refs.scaffoldHelp&&this.$refs.scaffoldHelp.toggleTooltipPinHighlight()},checkEndHelpMouseDown:function(e){e.target.closest(".help-mode-dialog")||this.endHelp()},flatmapHighlight:async function(e,t,n,o){let a=[...t,...o];const i=this.settingsStore.globalSettings;if(i.highlightConnectedPaths){const s=t.length?t:o.length?o:[],l=await e.retrieveConnectedPaths(s);l&&a.push(...l)}if(i.highlightDOIPaths){const s=await e.searchConnectivitiesByReference(n);s&&a.push(...s)}return a=[...new Set(a)],a},sidebarHoverHighlight:function(e){var t,n;if(this.visible&&((this.flatmapRef||this.multiflatmapRef)&&this.flatmapReady||this.scaffoldRef&&this.scaffoldLoaded)){const o=this.settingsStore.hoverAnatomies,a=this.settingsStore.hoverOrgans,i=this.settingsStore.hoverDOI,s=this.settingsStore.hoverConnectivity;let l=null,c=null;this.flatmapRef&&(l=this.flatmapRef),this.multiflatmapRef&&(l=this.multiflatmapRef.getCurrentFlatmap()),this.scaffoldRef&&(c=this.scaffoldRef),clearTimeout(this.highlightDelay),!o.length&&!a.length&&!i&&!s.length&&((this.multiflatmapRef||this.flatmapRef)&&l?((t=l.mapImp)==null||t.clearSearchResults(),e.connectivityProcessed&&((n=l.mapImp)==null||n.setPaint({dimmed:!0}))):this.scaffoldRef&&c&&c.changeHighlightedByName(a,"",!1)),this.highlightDelay=setTimeout(()=>{(o.length||a.length||i||s.length)&&((this.multiflatmapRef||this.flatmapRef)&&l?this.flatmapHighlight(l,o,i,s).then(d=>{try{l.showConnectivityTooltips({connectivityInfo:{featureId:d},data:[]})}catch(u){if(console.log(u),s.length&&l.mapImp){const f=l.mapImp.uuid;d.every(m=>this.connectivityKnowledge[f].some(h=>h.id===m))||l.mapImp.clearSearchResults()}}}):this.scaffoldRef&&c&&c.changeHighlightedByName(a,"",!1))},100)}},onAnnotationOpen:function(e){$e.emit("annotation-open",e)},onAnnotationClose:function(){$e.emit("sidebar-annotation-close")},updateOfflineAnnotationEnabled:function(e){$e.emit("update-offline-annotation-enabled",e)},onConnectivityInfoOpen:function(e){$e.emit("connectivity-info-open",e)},onConnectivityError:function(e){$e.emit("connectivity-error",e)},onConnectivityInfoClose:function(){$e.emit("connectivity-info-close")},onSidebarAnnotationClose:function(){},onNeuronConnectionFeatureClick:function(e){$e.emit("neuron-connection-feature-click",e)},showConnectivity:function(){},showConnectivityTooltips:function(){},setVisibilityFilter:function(){},loadExplorerConfig:async function(){this.flatmapService=await this.mockUpFlatmapService(),this.loadConnectivityExplorerConfig(this.flatmapService)},mockUpFlatmapService:async function(){const n=(await(await fetch(this.flatmapAPI)).json()).filter(u=>u.id==="human-flatmap_male").sort((u,f)=>f.created.localeCompare(u.created))[0],o=n.uuid,a=n.sckan["knowledge-source"],s=await(await fetch(`${this.flatmapAPI}/flatmap/${o}/pathways`)).json();this.flatmapQueries=r.markRaw(new WK),this.flatmapQueries.initialise(this.flatmapAPI);const l={mapMetadata:{uuid:o,connectivity:{...n.sckan}},pathways:s,resource:this.entry.resource,knowledgeSource:a,queryKnowledge:async u=>{const f="select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc",p=[a,u],m=await this.flatmapQueries.queryKnowledge(f,p);return JSON.parse(m)},queryLabels:async u=>{const f=`select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(u.length-1)}) order by entity, source desc`,p=[a,...u],m=await this.flatmapQueries.queryKnowledge(f,p),h=[];let g;for(const v of m)if(v[1]!==g){const y=JSON.parse(v[2]);h.push({entity:v[1],label:y.label||v[1]}),g=v[1]}return h}},c=uGe();return{mockup:!0,getFilterOptions:async(u,f)=>{const m=await oEe(this.flatmapAPI,u,f,void 0);return[...c,...m]},getTermNerveMaps:dGe,mapImp:l}},loadConnectivityExplorerConfig:async function(e){var i;const t=e.mapImp,n=Rg(t),o=e.mockup?t.resource:t.uuid;let a=[];if(!this.connectivityKnowledge[n]){this.flatmapQueries=r.markRaw(new WK),this.flatmapQueries.initialise(this.flatmapAPI);const s=await A5e(t,this.flatmapQueries);this.connectivityKnowledge[n]=s.filter(l=>{var c;return(c=l.connectivity)==null?void 0:c.length}).sort((l,c)=>l.label.localeCompare(c.label))}if(!this.connectivityKnowledge[o]){const s=((i=t.pathways)==null?void 0:i.paths)||{};this.connectivityKnowledge[o]=this.connectivityKnowledge[n].filter(l=>l.id in s)}if(!this.connectivityFilterOptions[o]&&!e.mockup&&(this.connectivityFilterOptions[o]=await e.getFilterOptions(t,this.connectivityKnowledge[o])),e.mockup){const s=e.getTermNerveMaps()||{},l=JSON.parse(JSON.stringify(this.connectivityKnowledge[o]));this.connectivityKnowledge[o]=l.map(d=>{var f;let u=d;if((f=d.nerves)!=null&&f.length){const m=d.nerves.flat(1/0).reduce((h,g)=>(g in s&&h.push(s[g]),h),[]);m!=null&&m.length&&(a.push(...m),u["nerve-label"]=m.sort((h,g)=>h.nerve.localeCompare(g.nerve)))}return u}).filter(d=>d["nerve-label"]),this.connectivityFilterOptions[o]||(this.connectivityFilterOptions[o]=await e.getFilterOptions(t,this.connectivityKnowledge[o])),a=a.map(d=>d.nerve.toLowerCase());const c=JSON.parse(JSON.stringify(this.connectivityFilterOptions[o]));this.connectivityFilterOptions[o]=c.map(d=>{if(d.key==="scaffold.connectivity.nerve"){const u=d.children.filter(f=>a.includes(f.label.toLowerCase()));return{...d,children:u}}else return d})}else this.connectivityFilterSources[o]||(this.connectivityFilterSources[o]=e.getFilterSources()),this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions),this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge),$e.emit("species-layout-connectivity-update")},knowledgeTooltipQuery:async function(e){await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.flatmapService.mapImp,{resource:[e.id]});let t=await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp,{resource:[e.id],label:e.label,provenanceTaxonomy:e.taxons,feature:[]});return t.knowledgeSource=Rg(this.flatmapService.mapImp),t.mapId=this.flatmapService.mapImp.mapMetadata.id,t.mapuuid=this.flatmapService.mapImp.mapMetadata.uuid,t["nerve-label"]=e["nerve-label"],t.ready=!0,t},getKnowledgeTooltip:async function(e){this.tooltipEntry=[],e.data.forEach(o=>this.tooltipEntry.push({title:o.label,featureId:[o.id],ready:!1})),$e.emit("connectivity-info-open",this.tooltipEntry);let t=[];for(let o=0;o<e.data.length;o++)t.push(await this.knowledgeTooltipQuery(e.data[o]));this.tooltipEntry=await Promise.all(t),this.tooltipEntry.map(o=>o.featureId[0]).length>0&&$e.emit("connectivity-info-open",this.tooltipEntry)},changeConnectivitySource:async function(e){const{entry:t,connectivitySource:n}=e;await this.flatmapQueries.queryForConnectivityNew(this.flatmapService.mapImp,t.featureId[0],n),this.tooltipEntry=this.tooltipEntry.map(o=>o.featureId[0]===t.featureId[0]?this.flatmapQueries.updateTooltipData(o):o),$e.emit("connectivity-info-open",this.tooltipEntry)},trackEvent:function(e){Tt.sendEvent(e)}},data:function(){return{apiLocation:void 0,activeSpecies:"Human Male",scaffoldCamera:void 0,mainStyle:{height:this.entry.datasetTitle?"calc(100% - 30px)":"100%",width:"100%",bottom:"0px"},helpMode:!1,helpModeActiveItem:0,helpModeLastItem:!1,multiflatmapRef:null,flatmapRef:null,scaffoldRef:null,scaffoldLoaded:!1,isInHelp:!1,mapManager:void 0,connectivityKnowledge:{},connectivityFilterOptions:{},connectivityFilterSources:{},highlightDelay:void 0,alive:!0,flatmapService:void 0,flatmapQueries:void 0,tooltipEntry:[]}},created:function(){this.flatmapAPI=void 0,this.apiLocation=void 0,this.settingsStore.flatmapAPI&&(this.flatmapAPI=this.settingsStore.flatmapAPI),this.settingsStore.sparcApi&&(this.apiLocation=this.settingsStore.sparcApi),this.settingsStore.mapManager&&(this.mapManager=this.settingsStore.mapManager)},watch:{helpMode:function(e){e||(this.helpModeActiveItem=0)}}},pGe=function(e){return e?[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t)):[]},YK={computed:{...Mt.mapStores(vi)},methods:{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)}},flatmapMarkerUpdate(e){if(!this.flatmapReady)return;let t=e;if(t||(t=this.getFlatmapImp()),t){let n=this.settingsStore.globalSettings.displayMarkers?this.settingsStore.markers:[];n=pGe(n),t.clearMarkers(),t.clearDatasetMarkers(),t.addDatasetMarkers(n),this.entry.type==="MultiFlatmap"&&this.restoreFeaturedMarkers(t)}},removeMarkersNotOnFlatmap(e,t){let n=e.anatomicalIdentifiers,o=[];for(let a=0;a<t.length;a++){let i=t[a],s={id:i.id,terms:[]};for(let l=0;l<i.terms.length;l++)n.includes(i.terms[l])&&s.terms.push(i.terms[l]);o.push(s)}return o},flatmapReadyForMarkerUpdates:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerUpdate(t)}}}},hGe={name:"Flatmap",mixins:[Jd,YK],components:{FlatmapVuer:_5.FlatmapVuer,HelpModeDialog:xS},data:function(){return{flatmapReady:!1}},methods:{getState:function(){return this.$refs.flatmap.getState()},search:function(e){return this.$refs.flatmap.searchAndShowResult(e,!0,!0)},getFlatmapImp(){var e;return(e=this.$refs.flatmap)==null?void 0:e.mapImp},flatmapReadyCall:function(e){var o,a,i;this.flatmapReady=!0;const t=this.getFlatmapImp();(o=t==null?void 0:t.mapMetadata)!=null&&o.name&&(this.updateEntryLabel((a=t==null?void 0:t.mapMetadata)==null?void 0:a.name),this.updateEntryTitle((i=t==null?void 0:t.mapMetadata)==null?void 0:i.name));let n={id:this.entry.id,prov:t.mapMetadata};$e.emit("mapImpProv",n),this.$emit("flatmap-provenance-ready",n),this.flatmapReadyForMarkerUpdates(e),this.updateViewerSettings(),this.loadConnectivityExplorerConfig(e).then(()=>{$e.emit("mapLoaded",e)})},onPathwaySelectionChanged:function(e){const{label:t,property:n,checked:o,selectionsTitle:a}=e;Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_pathway_change",category:t+" ["+n+"] "+o,location:a})},onSidebarAnnotationClose:function(){this.flatmapReady&&this.$refs.flatmap&&this.$refs.flatmap.annotationEventCallback({},{type:"aborted"})},searchSuggestions:function(e,t){if(e&&this.$refs.flatmap.mapImp){const n=this.$refs.flatmap.mapImp.search(e);(n.__featureIds||n.featureIds).forEach(a=>{const i=this.$refs.flatmap.mapImp.annotation(a);i&&i.label&&t.push(i.label)})}},showConnectivity:function(e){if(this!=null&&this.alive){const{featureIds:t,offset:n}=e,o=this.$refs.flatmap;o&&o.moveMap(t,{offsetX:n?-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 n=e.name;const o=this.$refs.flatmap.mapImp;if(n){const a=o.search(n);if(a.featureIds.length){let i=o.modelForFeature(a.featureIds[0]);i?(t&&o.selectFeatures(i),o.zoomToFeatures(i)):o.clearSearchResults()}}else o.clearSearchResults()},changeViewingMode:function(e){this.$refs.flatmap.changeViewingMode(e)},updateViewerSettings:function(){const{backgroundDisplay:e,viewingMode:t,flightPathDisplay:n,organsDisplay:o,outlinesDisplay:a,connectionType:i}=this.settingsStore.globalSettings,s=this.$refs.flatmap;s.changeViewingMode(t),s.setFlightPath3D(n),s.setColour(o),s.setOutlines(a),s.backgroundChangeCallback(e),s.setConnectionType(i)},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 n=e.data[0];t.searchAndShowResult(n.id,!0,!1)}}}},computed:{facetSpecies(){return this.settingsStore.facets.species}}},mGe={class:"viewer-container"};function gGe(e,t,n,o,a,i){const s=r.resolveComponent("FlatmapVuer"),l=r.resolveComponent("HelpModeDialog");return r.openBlock(),r.createElementBlock("div",mGe,[r.createVNode(s,{state:e.entry.state,entry:e.entry.resource,mapManager:e.mapManager,onResourceSelected:t[0]||(t[0]=c=>e.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:i.flatmapReadyCall,displayMinimap:!1,displayWarning:!0,enableOpenMapUI:!0,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,showLocalSettings:e.showLocalSettings,showOpenMapButton:e.showOpenMapButton,onOpenMap:e.openMap,onPathwaySelectionChanged:i.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?(r.openBlock(),r.createBlock(l,{key:0,ref:"flatmapHelp",flatmapRef:e.flatmapRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["flatmapRef","lastItem","onShowNext","onFinishHelpMode"])):r.createCommentVNode("",!0)])}const yGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(hGe,[["render",gGe],["__scopeId","data-v-c6a04569"]])},Symbol.toStringTag,{value:"Module"})),vGe={name:"Iframe",mixins:[Jd]},bGe={class:"map-iframe-container"},wGe=["src"];function xGe(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("div",bGe,[r.createElementVNode("iframe",{class:"my-iframe",src:e.entry.resource.share_link,ref:"iframe"},null,8,wGe)])}const kGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(vGe,[["render",xGe],["__scopeId","data-v-fde9a2bb"]])},Symbol.toStringTag,{value:"Module"})),CGe='<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>',JK=e=>[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}],SGe={name:"MultiFlatmap",mixins:[Jd,YK],components:{MultiFlatmapVuer:_5.MultiFlatmapVuer,HelpModeDialog:xS},data:function(){return{zoomLevel:6,flatmapReady:!1,availableSpecies:bV(),scaffoldResource:{},showStarInLegend:!1,openMapOptions:JK()}},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)}},search:function(e){return this.$refs.multiflatmap.getCurrentFlatmap().searchAndShowResult(e,!0,!0)},searchSuggestions:function(e,t){const n=this.$refs.multiflatmap.getCurrentFlatmap();if(e&&n.mapImp){const o=n.mapImp.search(e);(o.__featureIds||o.featureIds).forEach(i=>{const s=n.mapImp.annotation(i);s&&s.label&&t.push(s.label)})}},onPathwaySelectionChanged:function(e){const{label:t,property:n,checked:o,selectionsTitle:a}=e;Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_pathway_change",category:t+" ["+n+"] "+o,location:a})},onSidebarAnnotationClose:function(){this.flatmapReady&&this.$refs.multiflatmap.getCurrentFlatmap().annotationEventCallback({},{type:"aborted"})},onOpenPubmedUrl:function(e){Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_pubmed_url",file_path:e,location:"map_popup_button"})},zoomToFeatures:function(e,t){let n=e.name;const o=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(n){const a=o.search(n);a.featureIds.length>0?(t&&o.selectFeatures(a.featureIds),o.zoomToFeatures(a.featureIds)):o.clearSearchResults()}else o.clearSearchResults()},updateProvCard:function(){const e=this.getFlatmapImp();if(e){let t={id:this.entry.id,prov:e.mapMetadata};$e.emit("mapImpProv",t),this.$emit("flatmap-provenance-ready",t)}},flatmapChanged:async function(e){this.activeSpecies=e,this.openMapOptions=JK();const t=this.getFlatmapImp();t&&(this.updateProvCard(),this.flatmapMarkerUpdate(t),this.updateViewerSettings()),this.$emit("species-changed",e),Tt.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).then(()=>{$e.emit("mapLoaded",e)})}},getFlatmapImp:function(){if(this.entry.type==="MultiFlatmap"&&this.flatmapReady&&this.$refs.multiflatmap)return this.$refs.multiflatmap.getCurrentFlatmap().mapImp},flatmapAreaSearch(){let n={type:"Facets",label:"Unused",val:this.getFlatmapImp().visibleMarkerAnatomicalIds().map(o=>this.idNamePair[o])};$e.emit("PopoverActionClick",n)},restoreFeaturedMarkers:function(e){this.settingsStore.resetFeaturedMarkerIdentifier();const t=this.settingsStore.featuredMarkers;this.updateFeaturedMarkers(t,e)},updateFeaturedMarkers:function(e,t){this.showStarInLegend=!1;for(let n=0;n<e.length;++n)e[n]&&(this.settingsStore.featuredMarkerIdentifiers[n]||this.addFeaturedMarker(e[n],n,t)&&(this.showStarInLegend=!0))},addFeaturedMarker:function(e,t,n){const o=this.settingsStore.featuredMarkerSpecies[t];if(o&&!this.activeSpecies.startsWith(o))return!1;let a=n;if(a||(a=this.getFlatmapImp()),a){let i=document.createElement("div");i.innerHTML=CGe;const s=a.addMarker(e,{element:i,className:"highlight-marker",cluster:!1});return this.settingsStore.updateFeaturedMarkerIdentifier({index:t,markerIdentifier:s}),!0}return!1},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:n}=e,o=this.$refs.multiflatmap.getCurrentFlatmap();o&&o.moveMap(t,{offsetX:n?-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:n,organsDisplay:o,outlinesDisplay:a,connectionType:i}=this.settingsStore.globalSettings;if(this.flatmapReady){const s=this.$refs.multiflatmap.getCurrentFlatmap();s.changeViewingMode(t),s.setFlightPath3D(n),s.setColour(o),s.setOutlines(a),s.backgroundChangeCallback(e),s.setConnectionType(i)}},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()}},EGe={class:"viewer-container"};function _Ge(e,t,n,o,a,i){const s=r.resolveComponent("MultiFlatmapVuer"),l=r.resolveComponent("HelpModeDialog");return r.openBlock(),r.createElementBlock("div",EGe,[r.createVNode(s,{availableSpecies:e.availableSpecies,onFlatmapChanged:i.flatmapChanged,onReady:i.multiFlatmapReady,state:e.entry.state,mapManager:e.mapManager,onResourceSelected:t[0]||(t[0]=c=>e.flatmapResourceSelected(e.entry.type,c)),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:i.flatmapPanZoomCallback,onOpenMap:e.openMap,onFinishHelpMode:e.endHelp,onPathwaySelectionChanged:i.onPathwaySelectionChanged,onOpenPubmedUrl:i.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?(r.openBlock(),r.createBlock(l,{key:0,ref:"multiflatmapHelp",multiflatmapRef:e.multiflatmapRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["multiflatmapRef","lastItem","onShowNext","onFinishHelpMode"])):r.createCommentVNode("",!0)])}const $Ge=Object.freeze(Object.defineProperty({__proto__:null,default:tr(SGe,[["render",_Ge],["__scopeId","data-v-bf8bcff8"]])},Symbol.toStringTag,{value:"Module"})),FGe={name:"Plot",mixins:[Jd],components:{PlotVuer:oG.PlotVuer}};function AGe(e,t,n,o,a,i){const s=r.resolveComponent("PlotVuer");return r.openBlock(),r.createBlock(s,{"data-source":e.entry.resource.dataSource,metadata:e.entry.resource.metadata,"supplemental-data":e.entry.resource.supplementalData,style:{overflow:"hidden"},ref:"plot"},null,8,["data-source","metadata","supplemental-data"])}const TGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(FGe,[["render",AGe]])},Symbol.toStringTag,{value:"Module"})),BGe={name:"Scaffold",mixins:[Jd],components:{ScaffoldVuer:aG.ScaffoldVuer,HelpModeDialog:xS},methods:{showConnectivitiesByReference:async function(e){const t=sessionStorage.getItem("flatmap-knowledge");let n=[];t?n=await $5e(e):n=await F5e(this.flatmapService.mapImp,e,this.flatmapService.flatmapQueries);const o=[];for(const a of n){const i=this.nervesKnowledge.find(l=>l.id===a);if(!i)continue;const s=i["nerve-label"];if(s){const l=s.flatMap(c=>c.subNerves);o.push(...l)}}this.$refs.scaffold.changeHighlightedByName(o,"",!1)},setNerveGreyScale:function(){if(this.nervesKnowledge.length){const t=this.nervesKnowledge.reduce((n,o)=>n.concat(o["nerve-label"]||[]),[]).reduce((n,o)=>n.concat(o.subNerves||[]),[]);this.$refs.scaffold.setGreyScale(!0,t)}},setVisibilityFilter:function(e){let t=[];const n=!!e;if(e){const o=e.OR[1].AND[1].models;for(const a of o){const i=this.nervesKnowledge.find(s=>s.id===a);if(i){const s=i["nerve-label"].map(l=>l.subNerves).flat(1/0);t.push(...s)}}}this.$refs.scaffold.zoomToNerves(t,n)},syncFilter:function(e){this.$refs.scaffold.viewingMode==="Neuron Connection"&&(this.filter=e.filter(t=>{var n;return((n=t.facet)==null?void 0:n.toLowerCase())!=="show all"}))},scaffoldResourceSelected:async function(e,t){if(this.resourceSelected(e,t,!0),t.length===1){if(this.clickedObject=t[0].data,this.clickedObject.isNerves||this.clickedObject.anatomicalId){const n=this.clickedObject.id.toLowerCase();if(this.$refs.scaffold.viewingMode==="Neuron Connection"){const o=this.settingsStore.globalSettings.connectionType;if(this.clickedObject.isNerves)this.filter.push({facet:n,term:"Nerves",facetPropPath:"scaffold.connectivity.nerve"});else{const a=o.toLowerCase();let i=this.clickedObject.anatomicalId||"";if(i)this.filter.push({facet:`["${i}",[]]`,facetPropPath:`flatmap.connectivity.source.${a}`,tagLabel:n.charAt(0).toUpperCase()+n.slice(1),term:o});else{const l=this.connectivitiesStore.filterOptions[this.entry.resource].find(d=>d.key===`flatmap.connectivity.source.${a}`);let c;l==null||l.children.forEach(d=>{var u;d.label.toLowerCase()===n&&(c=d),(u=d.children)==null||u.forEach(f=>{f.label.toLowerCase()===n&&(c=f)})}),c&&(i=c.key.replace(`flatmap.connectivity.source.${a}.`,""),this.filter.push({facet:i,facetPropPath:`flatmap.connectivity.source.${a}`,tagLabel:c.tagLabel,term:o}))}}$e.emit("neuron-connection-feature-click",{filters:this.filter,search:this.filter.length?"":n})}else if(this.$refs.scaffold.viewingMode==="Exploration"){const o=this.nervesKnowledge.filter(a=>JSON.stringify(a["nerve-label"]).includes(n));o.length&&this.getKnowledgeTooltip({data:o,type:this.entry})}}}else t.length>1?this.$refs.scaffold.viewingMode==="Exploration"&&this.clickedObject&&this.$refs.scaffold.$module.setIgnorePicking(!1):(this.clickedObject=void 0,$e.emit("connectivity-info-close"))},onResize:function(){this.scaffoldCamera.onResize()},getState:function(){return this.$refs.scaffold.getState()},search:function(e){return this.$refs.scaffold.search(e,!0)},searchSuggestions:function(e,t){if(e===""||!this.$refs.scaffold)return t;this.$refs.scaffold.fetchSuggestions(e).forEach(o=>{o.suggestion&&t.push(o.suggestion)})},showConnectivityTooltips:function(e){if(e.label)this.$refs.scaffold.changeHighlightedByName([e.label],"",!1),this.$refs.scaffold.showRegionTooltip(e.label,!1,!1);else{const t=e.connectivityInfo["nerve-label"];if(t){const n=t.flatMap(o=>o.subNerves);this.$refs.scaffold.changeHighlightedByName(n,"",!1)}this.$refs.scaffold.hideRegionTooltip()}},zoomToFeatures:function(e,t){let n;Array.isArray(e)?n=e:n=[e.name],t&&this.$refs.scaffold.changeActiveByName(n,"",!1),this.$refs.scaffold.viewRegion(n)},scaffoldIsReady:function(){this.scaffoldLoaded=!0,this.$refs.scaffold.$module.graphicsHighlight.highlightColour=[1,0,1],this.isVisible()&&this.entry.rotation&&this.entry.rotation,this.updateViewerSettings(),$e.emit("mapLoaded",this.$refs.scaffold),setTimeout(()=>{this.setNerveGreyScale()},500)},scaffoldHighlighted:function(e,t){var o,a,i;const n={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0};t&&t[0]&&((((o=t[0].data)==null?void 0:o.id)===void 0||((a=t[0].data)==null?void 0:a.id)==="")&&(t[0].data.id=(i=t[0].data)==null?void 0:i.group),n.internalName=t[0].data.id,n.eventType="highlighted"),this.$emit("resource-selected",n)},scaffoldNavigated:function(e,t){if(this.mouseHovered){const n={paneIndex:this.entry.id,eventType:"panZoom",payload:t,type:e};this.$emit("resource-selected",n)}},updateWithViewUrl:function(e){this.$refs.scaffold.updateViewURL(e)},changeViewingMode:function(e){this.$refs.scaffold.changeViewingMode(e)},updateViewerSettings:function(){const{backgroundDisplay:e,organsDisplay:t,outlinesDisplay:n,viewingMode:o}=this.settingsStore.globalSettings;this.$refs.scaffold.backgroundChangeCallback(e),this.$refs.scaffold.changeViewingMode(o),this.$refs.scaffold.setColour(t),this.$refs.scaffold.setOutlines(n)}},computed:{warningMessage:function(){return this.entry.isBodyScaffold?"This map displays the anatomical location and connectivity of nerves, through which the neuron populations from the ApiNATOMY models available in SCKAN can be routed.":"Under active development"},markerLabels:function(){return this.settingsStore.globalSettings.displayMarkers?this.settingsStore.numberOfDatasetsForFacets:{}}},watch:{connectivityKnowledge:{handler(e,t){if(this.entry.resource in e){const n=e[this.entry.resource];n.length!==this.nervesKnowledge.length&&(this.nervesKnowledge=n,this.scaffoldLoaded&&this.setNerveGreyScale())}},deep:!0,immediate:!0}},data:function(){return{apiLocation:process.env.VUE_APP_API_LOCATION,scaffoldCamera:void 0,scaffoldLoaded:!1,nervesKnowledge:[],clickedObject:void 0,filter:[],query:""}},mounted:function(){this.scaffoldCamera=this.$refs.scaffold.$module.scene.getZincCameraControls()}},NGe={class:"viewer-container"};function MGe(e,t,n,o,a,i){const s=r.resolveComponent("ScaffoldVuer"),l=r.resolveComponent("HelpModeDialog");return r.openBlock(),r.createElementBlock("div",NGe,[r.createVNode(s,{state:e.entry.state,url:e.entry.resource,region:e.entry.region,onScaffoldSelected:t[0]||(t[0]=c=>i.scaffoldResourceSelected(e.entry.type,c)),onScaffoldHighlighted:t[1]||(t[1]=c=>i.scaffoldHighlighted(e.entry.type,c)),onScaffoldNavigated:t[2]||(t[2]=c=>i.scaffoldNavigated(e.entry.type,c)),onOnReady:i.scaffoldIsReady,onOpenMap:e.openMap,ref:"scaffold","background-toggle":!0,traditional:!0,helpMode:e.helpMode,helpModeActiveItem:e.helpModeActiveItem,helpModeDialog:e.useHelpModeDialog,onAnnotationOpen:e.onAnnotationOpen,onAnnotationClose:e.onAnnotationClose,onUpdateOfflineAnnotationEnabled:e.updateOfflineAnnotationEnabled,annotationSidebar:e.annotationSidebar,onHelpModeLastItem:e.onHelpModeLastItem,onShownTooltip:e.onTooltipShown,onShownMapTooltip:e.onMapTooltipShown,render:e.visible,"display-latest-message":!0,"warning-message":i.warningMessage,"display-minimap":!1,"display-markers":!1,enableOpenMapUI:!0,"view-u-r-l":e.entry.viewUrl,markerCluster:!0,markerLabels:i.markerLabels,flatmapAPI:e.flatmapAPI,showLocalSettings:e.showLocalSettings,showOpenMapButton:e.showOpenMapButton,usageConfig:{showTubeLinesControls:!1,tubeLines:e.entry.discoverId==="307"}},null,8,["state","url","region","onOnReady","onOpenMap","helpMode","helpModeActiveItem","helpModeDialog","onAnnotationOpen","onAnnotationClose","onUpdateOfflineAnnotationEnabled","annotationSidebar","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","render","warning-message","view-u-r-l","markerLabels","flatmapAPI","showLocalSettings","showOpenMapButton","usageConfig"]),e.helpMode&&e.useHelpModeDialog?(r.openBlock(),r.createBlock(l,{key:0,ref:"scaffoldHelp",scaffoldRef:e.scaffoldRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["scaffoldRef","lastItem","onShowNext","onFinishHelpMode"])):r.createCommentVNode("",!0)])}const OGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(BGe,[["render",MGe],["__scopeId","data-v-c1c53a77"]])},Symbol.toStringTag,{value:"Module"})),LGe={name:"Simulation",mixins:[Jd],components:{SimulationVuer:iG.SimulationVuer},computed:{id:function(){return this.entry.resource?this.entry.resource:this.entry.discoverId}}};function IGe(e,t,n,o,a,i){const s=r.resolveComponent("SimulationVuer");return r.openBlock(),r.createBlock(s,{apiLocation:e.apiLocation,id:i.id,ref:"simulation"},null,8,["apiLocation","id"])}const RGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(LGe,[["render",IGe]])},Symbol.toStringTag,{value:"Module"}));Qe.MapContent=cGe,Object.defineProperty(Qe,Symbol.toStringTag,{value:"Module"})});
|
|
1445
|
+
<br>`)},getConnectivityDatasets:function(e){const t=[...this.componentsWithDatasets,...this.destinationsWithDatasets,...this.originsWithDatasets],n=e.split(",");let o=[];return n.forEach(a=>{const i=t.find(s=>s.name.toLowerCase().trim()===a.toLowerCase().trim());i&&o.push({id:i.id,label:i.name})}),o},onConnectivityHovered:function(e){const t={connectivityInfo:this.entry,label:e,data:e?this.getConnectivityDatasets(e):[]};this.$emit("connectivity-hovered",t)},onConnectivityClicked:function(e){const t={query:e,filter:[]};this.$emit("connectivity-clicked",t)},getConnectivityError:function(e){const{errorData:t,errorMessage:n}=e;return{errorConnectivities:t.map(o=>Lp(o.label)).join(", ").replace(/, ([^,]*)$/," and $1"),errorMessage:n}},onConnectivitySourceChange:function(e){this.connectivityLoading=!0,this.activeView!=="graphView"&&(this.graphViewLoaded=!1),this.updateGraphConnectivity(),lt.emit("connectivity-source-change",{entry:this.entry,connectivitySource:e}),lt.emit("trackEvent",{event_name:"portal_maps_connectivity_source_change",category:e,location:"map_sidebar_connectivity"})},updateGraphConnectivity:function(){this.connectivitySource==="map"?this.getConnectionsFromMap().then(e=>{var t;this.connectivityFromMap=null,(t=e==null?void 0:e.connectivity)!=null&&t.length&&(this.connectivityFromMap=e),this.connectivityLoading=!1}):(this.connectivityFromMap=null,this.connectivityLoading=!1)},getConnectionsFromMap:async function(){if(this.entry.mapuuid){const e=this.flatmapApi+`flatmap/${this.entry.mapuuid}/connectivity/${this.entry.featureId[0]}`;try{const t=await fetch(e);if(!t.ok)throw new Error(`Response status: ${t.status}`);return await t.json()}catch(t){throw lt.emit("connectivity-source-change",{entry:this.entry,connectivitySource:"sckan"}),new Error(t)}}},onConnectivityActionClick:function(e){lt.emit("onConnectivityActionClick",e)},closeConnectivity:function(){this.$emit("close-connectivity"),lt.emit("trackEvent",{event_name:"portal_maps_connectivity_close",category:this.entry.id||"",location:"map_sidebar_connectivity"})},onTrackEvent:function(e){lt.emit("trackEvent",e)}},mounted:function(){this.updatedCopyContent=this.getUpdateCopyContent(),lt.on("connectivity-error",e=>{const t=this.getConnectivityError(e);this.connectivityError={...t}})}},nKe={key:0,class:"main"},rKe={class:"connectivity-info-title"},oKe={class:"title-content"},aKe={key:0,class:"block"},iKe={class:"title"},sKe={style:{"word-break":"keep-all"}},lKe={class:"subtitle"},cKe={key:0,class:"subtitle"},dKe={key:1,class:"block"},uKe={class:"title"},fKe={class:"title-buttons"},pKe={class:"content-container population-display"},hKe={class:"block attribute-title-container"},mKe={class:"block buttons-row"},gKe={key:0,class:"block"},yKe=["origin-item-label"],vKe=["origin-item-label","onMouseenter"],bKe={class:"content-container content-container-connectivity"},wKe={class:"content-container content-container-connectivity"},xKe={key:1,class:"content-container content-container-references"};function kKe(e,t,n,o,a,i){const s=uZ,l=kt,c=ip,d=P$,u=Cr,f=r.resolveComponent("CopyToClipboard"),p=Wr,m=rh,h=R7,g=BOe,v=th,y=r.resolveComponent("connectivity-list"),b=r.resolveComponent("connectivity-graph"),x=r.resolveComponent("ExternalResourceCard"),w=Nd;return i.entry?(r.openBlock(),r.createElementBlock("div",nKe,[r.createElementVNode("div",rKe,[r.createElementVNode("div",oKe,[i.entry.title?(r.openBlock(),r.createElementBlock("div",aKe,[r.createElementVNode("div",iKe,[r.createElementVNode("span",null,r.toDisplayString(i.capitalise(i.entry.title)),1),i.entry.featuresAlert?(r.openBlock(),r.createBlock(c,{key:0,width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:r.withCtx(()=>[r.createVNode(l,{class:"alert"},{default:r.withCtx(()=>[r.createVNode(s)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("span",sKe,r.toDisplayString(i.entry.featuresAlert),1)]),_:1})):r.createCommentVNode("",!0)]),r.createElementVNode("div",lKe,[t[4]||(t[4]=r.createElementVNode("strong",null,"id: ",-1)),r.createTextVNode(r.toDisplayString(i.entry.featureId[0]),1)]),i.hasProvenanceTaxonomyLabel?(r.openBlock(),r.createElementBlock("div",cKe,r.toDisplayString(i.provSpeciesDescription),1)):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",dKe,[r.createElementVNode("div",uKe,r.toDisplayString(i.entry.featureId),1)]))]),r.createElementVNode("div",fKe,[r.createVNode(c,{width:"auto",trigger:"hover",teleported:!1,"popper-class":"popover-map-pin"},{reference:r.withCtx(()=>[r.createVNode(u,{class:"button-circle secondary",circle:"",onClick:i.showConnectivity},{default:r.withCtx(()=>[r.createVNode(l,{color:"#8300bf"},{default:r.withCtx(()=>[r.createVNode(d)]),_:1})]),_:1},8,["onClick"])]),default:r.withCtx(()=>[t[5]||(t[5]=r.createElementVNode("span",null," Show connectivity on map ",-1))]),_:1}),r.createVNode(f,{onCopied:i.onCopied,content:e.updatedCopyContent},null,8,["onCopied","content"]),n.withCloseButton?(r.openBlock(),r.createBlock(c,{key:0,width:"auto",trigger:"hover",teleported:!1,"popper-class":"popover-map-pin"},{reference:r.withCtx(()=>[r.createVNode(u,{class:"button-circle",circle:"",onClick:i.closeConnectivity},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[r.createVNode(p)]),_:1})]),_:1},8,["onClick"])]),default:r.withCtx(()=>[t[6]||(t[6]=r.createElementVNode("span",null,"Close",-1))]),_:1})):r.createCommentVNode("",!0)])]),r.createElementVNode("div",pKe,[r.createElementVNode("div",hKe,[t[8]||(t[8]=r.createElementVNode("span",{class:"attribute-title"},"Population Display",-1)),e.activeView==="listView"?(r.openBlock(),r.createBlock(c,{key:0,width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:r.withCtx(()=>[r.createVNode(l,{class:"info"},{default:r.withCtx(()=>[r.createVNode(m)]),_:1})]),default:r.withCtx(()=>[t[7]||(t[7]=r.createElementVNode("span",{style:{"word-break":"keep-all"}}," This list is ordered alphabetically, switch to graph view for path details. ",-1))]),_:1})):r.createCommentVNode("",!0)]),r.createElementVNode("div",mKe,[t[13]||(t[13]=r.createElementVNode("span",null,"Connectivity from:",-1)),r.createVNode(g,{modelValue:e.connectivitySource,"onUpdate:modelValue":t[0]||(t[0]=k=>e.connectivitySource=k),onChange:i.onConnectivitySourceChange},{default:r.withCtx(()=>[r.createVNode(h,{value:"map",disabled:e.noMapConnectivity},{default:r.withCtx(()=>t[9]||(t[9]=[r.createTextVNode("Map")])),_:1},8,["disabled"]),r.createVNode(h,{value:"sckan"},{default:r.withCtx(()=>t[10]||(t[10]=[r.createTextVNode("SCKAN")])),_:1})]),_:1},8,["modelValue","onChange"]),r.createVNode(u,{class:r.normalizeClass(e.activeView==="listView"?"button":"el-button-secondary"),onClick:t[1]||(t[1]=k=>i.switchConnectivityView("listView"))},{default:r.withCtx(()=>t[11]||(t[11]=[r.createTextVNode(" List view ")])),_:1},8,["class"]),r.createVNode(u,{class:r.normalizeClass(e.activeView==="graphView"?"button":"el-button-secondary"),onClick:t[2]||(t[2]=k=>i.switchConnectivityView("graphView"))},{default:r.withCtx(()=>t[12]||(t[12]=[r.createTextVNode(" Graph view ")])),_:1},8,["class"])])]),i.entry["nerve-label"]?(r.openBlock(),r.createElementBlock("div",gKe,[t[15]||(t[15]=r.createElementVNode("div",{class:"attribute-title-container"},[r.createElementVNode("span",{class:"attribute-title"},"Nerves")],-1)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.entry["nerve-label"],(k,C)=>(r.openBlock(),r.createElementBlock("div",null,[(r.openBlock(),r.createElementBlock("div",{class:"attribute-content","origin-item-label":k.nerve,key:k.nerve},[r.createElementVNode("span",null,r.toDisplayString(i.capitalise(k.nerve)),1)],8,yKe)),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.subNerves,(S,E)=>(r.openBlock(),r.createElementBlock("div",{class:"attribute-content",style:{"margin-left":"1rem"},"origin-item-label":S,key:S,onMouseenter:_=>i.onConnectivityHovered(S),onMouseleave:t[3]||(t[3]=_=>i.onConnectivityHovered())},[r.createVNode(c,{width:"150",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:r.withCtx(()=>[r.createVNode(l,{class:"magnify-glass",onClick:_=>i.onConnectivityClicked(S)},{default:r.withCtx(()=>[r.createVNode(v)]),_:2},1032,["onClick"])]),default:r.withCtx(()=>[t[14]||(t[14]=r.createElementVNode("span",null,"Search sub nerve",-1))]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(i.capitalise(S)),1)],40,vKe))),128))]))),256))])):r.createCommentVNode("",!0),r.withDirectives(r.createElementVNode("div",bKe,[r.withDirectives((r.openBlock(),r.createBlock(y,{key:`${i.connectivityKey}list`,entry:i.entry,origins:i.origins,components:i.components,destinations:i.destinations,originsWithDatasets:i.originsWithDatasets,componentsWithDatasets:i.componentsWithDatasets,destinationsWithDatasets:i.destinationsWithDatasets,availableAnatomyFacets:n.availableAnatomyFacets,connectivityError:e.connectivityError,onConnectivityHovered:i.onConnectivityHovered,onConnectivityClicked:i.onConnectivityClicked,onConnectivityActionClick:i.onConnectivityActionClick},null,8,["entry","origins","components","destinations","originsWithDatasets","componentsWithDatasets","destinationsWithDatasets","availableAnatomyFacets","connectivityError","onConnectivityHovered","onConnectivityClicked","onConnectivityActionClick"])),[[w,e.connectivityLoading]])],512),[[r.vShow,e.activeView==="listView"]]),r.withDirectives(r.createElementVNode("div",wKe,[e.graphViewLoaded?r.withDirectives((r.openBlock(),r.createBlock(b,{key:`${i.connectivityKey}graph`,entry:i.entry.featureId[0],mapServer:i.flatmapApi,sckanVersion:i.sckanVersion,connectivityFromMap:e.connectivityFromMap,connectivityError:e.connectivityError,onTapNode:i.onTapNode},null,8,["entry","mapServer","sckanVersion","connectivityFromMap","connectivityError","onTapNode"])),[[w,e.connectivityLoading]]):r.createCommentVNode("",!0)],512),[[r.vShow,e.activeView==="graphView"]]),i.resources.length?(r.openBlock(),r.createElementBlock("div",xKe,[r.createVNode(x,{resources:i.resources,onReferencesLoaded:i.onReferencesLoaded,onShowReferenceConnectivities:i.onShowReferenceConnectivities,onTrackEvent:i.onTrackEvent},null,8,["resources","onReferencesLoaded","onShowReferenceConnectivities","onTrackEvent"])])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)}const VK=Ao(tKe,[["render",kKe],["__scopeId","data-v-589e4c5c"]]),CKe={name:"ConnectivityCard",data(){return{displayFields:["id","nerve-label"]}},props:{entry:{type:Object,default:()=>{}},connectivityEntry:{type:Array,default:()=>[]}},computed:{loading:function(){if("ready"in this.entry)return!this.entry.ready;const e=this.connectivityEntry.find(t=>t.id===this.entry.id);return e?!e.ready:!1}},methods:{capitalise:function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},cardClicked:function(e){this.loading||(this.$emit("open-connectivity",e),lt.emit("trackEvent",{event_name:"portal_maps_connectivity_open",category:e.id||"",location:"map_sidebar_connectivity"}))}}},SKe={class:"connectivity-card-container",ref:"container"},EKe={class:"connectivity-card",ref:"card"},_Ke={class:"card-title"},$Ke={key:0,class:"card-details"},FKe={key:0,class:"card-tags"},AKe={key:1};function TKe(e,t,n,o,a,i){const s=jl,l=Nd;return r.openBlock(),r.createElementBlock("div",SKe,[r.createElementVNode("div",EKe,[t[1]||(t[1]=r.createElementVNode("div",{class:"seperator-path"},null,-1)),r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:"card-content",onClick:t[0]||(t[0]=c=>i.cardClicked(n.entry))},[r.createElementVNode("div",_Ke,r.toDisplayString(i.capitalise(n.entry.label)),1),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.displayFields,c=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:c},[n.entry[c]?(r.openBlock(),r.createElementBlock("div",$Ke,[r.createElementVNode("strong",null,r.toDisplayString(c)+":",1),c==="nerve-label"?(r.openBlock(),r.createElementBlock("div",FKe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.entry[c],d=>(r.openBlock(),r.createElementBlock("div",{key:d.nerve},[r.createVNode(s,{type:"primary",size:"small"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(d.nerve),1)]),_:2},1024),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.subNerves,u=>(r.openBlock(),r.createBlock(s,{type:"primary",size:"small"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(u),1)]),_:2},1024))),256))]))),128))])):(r.openBlock(),r.createElementBlock("span",AKe,r.toDisplayString(n.entry[c]),1))])):r.createCommentVNode("",!0)],64))),128))])),[[l,i.loading]])],512)],512)}const DK=Ao(CKe,[["render",TKe],["__scopeId","data-v-4c16c9d7"]]);var BKe={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,start:0};const NKe={components:{SearchFilters:x1,SearchHistory:w1,ConnectivityCard:DK,ConnectivityInfo:VK,Button:Cr,Card:m0,Checkbox:VE,Icon:kt,Input:$d,Pagination:w0,MapSvgIcon:Wq,MapSvgSpriteColor:BK},name:"ConnectivityExplorer",props:{connectivityKnowledge:{type:Array,default:[]},entry:{type:Object,default:()=>BKe},envVars:{type:Object,default:()=>{}},connectivityEntry:{type:Array,default:[]},availableAnatomyFacets:{type:Object,default:[]},connectivityFilterOptions:{type:Array,default:[]},showVisibilityFilter:{type:Boolean,default:!1}},data:function(){return{...this.entry,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1,freezeTimeout:void 0,freezed:!1,initLoading:!0,expanded:"",filterVisibility:!0,expandedData:null}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter,options:this.connectivityFilterOptions,showFilters:!0,helper:{within:"'CNS' OR 'Local circuit neuron'",between:"'Somatic lower motor' AND 'Human'"}}},paginatedResults:function(){return this.results.slice(this.start,this.start+this.numberPerPage)}},watch:{connectivityKnowledge:function(e,t){this.expanded="",this.expandedData=null,this.loadingCards=!1,JSON.stringify(e)!==JSON.stringify(t)&&(this.results=e,this.initLoading=!1,this.numberOfHits=this.results.length,this.numberOfHits>0&&"ready"in this.results[0]&&(this.$refs.filtersRef.checkShowAllBoxes(),this.searchInput="",this.filter=[]))},connectivityEntry:function(e,t){if(JSON.stringify(e)!==JSON.stringify(t)&&e.length===1&&e[0].ready){const n=this.filter.some(o=>o.facet!=="Show all");if(this.numberOfHits===1&&!this.searchInput&&!n||(e[0].connectivitySource!==t[0].connectivitySource||e[0].mapId!==t[0].mapId)&&t[0].ready)return;this.collapseChange(e[0])}},paginatedResults:function(){this.loadingCards=!1},filterVisibility:function(e){this.filterVisibility=e,this.$emit("filter-visibility",this.filterVisibility)}},methods:{freezeHoverChange:function(){this.freezed=!0,this.freezeTimeout&&clearTimeout(this.freezeTimeout),this.freezeTimeout=setTimeout(()=>{this.freezed=!1},3e3)},onShowConnectivity:function(e){this.freezeHoverChange(),this.$emit("show-connectivity",e)},onShowReferenceConnectivities:function(e){this.freezeHoverChange(),this.$emit("show-reference-connectivities",e)},onConnectivityClicked:function(e){this.searchInput=e.query,this.searchAndFilterUpdate()},collapseChange:function(e){this.expanded=this.expanded===e.id?"":e.id,this.expandedData=this.expanded?e:null},closeConnectivity:function(){this.expanded||this.$emit("connectivity-item-close")},onConnectivityCollapseChange:function(e){this.connectivityEntry.find(t=>t.featureId[0]===e.id)?(this.collapseChange(e),this.closeConnectivity()):(this.expanded="",this.expandedData=null,this.$nextTick(()=>{this.$emit("connectivity-collapse-change",e)}))},onHoverChanged:function(e,t){const{target:n}=e;(t||n&&n.checkVisibility())&&this.hoverChanged(t)},hoverChanged:function(e){if(!this.freezed){let t={tabType:"connectivity"};e?t={...t,...e}:this.expandedData&&(t={...t,...this.expandedData}),this.$emit("hover-changed",t)}},resetSearch:function(){this.numberOfHits=0,this.results=[],this.loadingCards=!1},resetSearchIfNoActiveSearch:function(){const e=this.filter.some(t=>t.facet!=="Show all");!this.searchInput&&!e&&this.openSearch([],"")},onResetClick:function(){this.openSearch([],""),this.$emit("search-changed",{value:[],tabType:"dataset",type:"reset-update"}),lt.emit("trackEvent",{event_name:"portal_maps_action_filter",category:"reset",location:"map_sidebar_connectivity"})},openSearch:function(e,t=""){if(this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady){const n=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),o=n.notFound?n.notFound.filter(a=>a.facet.toLowerCase()!=="show all"):[];this.filter=n.result,o.forEach(a=>{const i=a.tagLabel||a.facet,s=i.charAt(0).toLowerCase()+i.slice(1);let l="";a.term.toLowerCase()==="origin"?l=`There are no neuron populations beginning at <strong>${s}</strong>.`:a.term.toLowerCase()==="via"?l=`There are no neuron populations that run through <strong>${s}</strong>.`:a.term.toLowerCase()==="destination"?l=`There are no neuron populations terminating at <strong>${s}</strong>.`:l=`There are no neuron populations beginning, terminating, or running through <strong>${s}</strong>.`,pj({dangerouslyUseHTMLString:!0,message:l,appendTo:this.$el,showClose:!0,offset:113})}),o.length&&this.$emit("search-changed",{value:o,tabType:"dataset",type:"reset-update"}),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchKnowledge(this.filter,t),this.$refs.filtersRef.setCascader(this.filter),this.searchHistoryUpdate(this.filter,t))}else this.filter=e,(!e||e.length==0)&&(this.searchKnowledge(this.filter,t),this.searchHistoryUpdate(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.searchAndFilterUpdate()},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filter=[...e],this.searchAndFilterUpdate()},searchAndFilterUpdate:function(){this.resetPageNavigation(),this.searchKnowledge(this.filter,this.searchInput),this.searchHistoryUpdate(this.filter,this.searchInput)},searchHistoryUpdate:function(e,t){this.$refs.searchHistory.selectValue="Search history",(e.length||t!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(this.filter,t)},searchKnowledge:function(e,t=""){this.expanded="",this.expandedData=null,this.loadingCards=!0,this.scrollToTop(),this.$emit("search-changed",{query:t,filter:e,tabType:"connectivity"}),this.lastSearch=t},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,lt.emit("trackEvent",{event_name:"portal_maps_connectivity_perPage",category:e+"",location:"map_sidebar_connectivity"});const t=this.page===1;this.pageChange(1,t)},pageChange:function(e,t=!1){this.start=(e-1)*this.numberPerPage,this.page=e,this.expanded="",this.expandedData=null,this.scrollToTop(),t||lt.emit("trackEvent",{event_name:"portal_maps_connectivity_pagination",category:`page_${this.page}`,location:"map_sidebar_connectivity"})},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},searchHistorySearch:function(e){this.searchInput=e.search,this.filter=e.filters,this.openSearch([...e.filters],e.search)},onConnectivityInfoLoaded:function(e){const t=this.$refs["stepItem-"+e.id],n=this.$refs.content;this.$nextTick(()=>{n&&t&&t[0]&&(n.scrollTop=t[0].offsetTop)})},getSearch:function(){return this.searchInput},getFilters:function(){return this.filter.some(e=>e.facet.toLowerCase()!=="show all")?this.filter:[]}},mounted:function(){localStorage.removeItem("connectivity-active-view"),this.openSearch(this.filter,this.searchInput),lt.on("close-connectivity",()=>{this.expanded="",this.expandedData=null})}},MKe={class:"header"},OKe={key:0,class:"visibility-filter"},LKe={key:0,class:"error-feedback"},IKe=["onMouseenter"];function RKe(e,t,n,o,a,i){const s=r.resolveComponent("MapSvgSpriteColor"),l=$d,c=Cr,d=VE,u=r.resolveComponent("MapSvgIcon"),f=ip,p=x1,m=w1,h=DK,g=VK,v=w0,y=m0,b=Nd;return r.openBlock(),r.createBlock(y,{"body-style":e.bodyStyle,class:"content-card"},{header:r.withCtx(()=>[r.createElementVNode("div",MKe,[r.createVNode(l,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=x=>e.searchInput=x),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),r.createVNode(c,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:r.withCtx(()=>t[5]||(t[5]=[r.createTextVNode(" Search ")])),_:1},8,["onClick"]),r.createVNode(c,{link:"",class:"el-button-link",onClick:i.onResetClick,size:"large"},{default:r.withCtx(()=>t[6]||(t[6]=[r.createTextVNode(" Reset ")])),_:1},8,["onClick"]),n.showVisibilityFilter?(r.openBlock(),r.createElementBlock("div",OKe,[r.createVNode(d,{modelValue:e.filterVisibility,"onUpdate:modelValue":t[1]||(t[1]=x=>e.filterVisibility=x)},{default:r.withCtx(()=>t[7]||(t[7]=[r.createTextVNode(" Focused ")])),_:1},8,["modelValue"]),r.createVNode(f,{title:"How does focused checkbox work?",width:"250",trigger:"hover","popper-class":"filter-help-popover"},{reference:r.withCtx(()=>[r.createVNode(u,{icon:"help",class:"help"})]),default:r.withCtx(()=>[t[8]||(t[8]=r.createElementVNode("div",null,[r.createElementVNode("strong",null,"Checked:"),r.createElementVNode("br"),r.createTextVNode(" Display listed or highlighted items only. "),r.createElementVNode("br"),r.createElementVNode("br"),r.createElementVNode("strong",null,"Unchecked:"),r.createElementVNode("br"),r.createTextVNode(" Display listed or highlighted items in full colour and non-listed items in greyscale. ")],-1))]),_:1})])):r.createCommentVNode("",!0)])]),default:r.withCtx(()=>[r.createVNode(s),r.createVNode(p,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:n.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),r.createVNode(m,{ref:"searchHistory",localStorageKey:"sparc.science-connectivity-search-history",onSearch:i.searchHistorySearch},null,8,["onSearch"]),r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:"content scrollbar",ref:"content",onMouseleave:t[4]||(t[4]=x=>i.onHoverChanged(x,void 0))},[e.results.length===0&&!e.loadingCards?(r.openBlock(),r.createElementBlock("div",LKe," No results found - Please change your search / filter criteria. ")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.paginatedResults,x=>(r.openBlock(),r.createElementBlock("div",{key:x.id,ref_for:!0,ref:"stepItem-"+x.id,class:"step-item",onMouseenter:w=>i.onHoverChanged(w,x)},[r.withDirectives(r.createVNode(h,{class:"connectivity-card",entry:x,connectivityEntry:n.connectivityEntry,onOpenConnectivity:i.onConnectivityCollapseChange},null,8,["entry","connectivityEntry","onOpenConnectivity"]),[[r.vShow,e.expanded!==x.id]]),e.expanded===x.id?(r.openBlock(),r.createBlock(g,{key:0,class:"connectivity-info",entryId:x.id,connectivityEntry:n.connectivityEntry,availableAnatomyFacets:n.availableAnatomyFacets,envVars:n.envVars,withCloseButton:!0,onShowConnectivity:i.onShowConnectivity,onShowReferenceConnectivities:i.onShowReferenceConnectivities,onConnectivityClicked:i.onConnectivityClicked,onConnectivityHovered:t[2]||(t[2]=w=>e.$emit("connectivity-hovered",w)),onLoaded:w=>i.onConnectivityInfoLoaded(x),onCloseConnectivity:w=>i.onConnectivityCollapseChange(x)},null,8,["entryId","connectivityEntry","availableAnatomyFacets","envVars","onShowConnectivity","onShowReferenceConnectivities","onConnectivityClicked","onLoaded","onCloseConnectivity"])):r.createCommentVNode("",!0)],40,IKe))),128)),r.createVNode(v,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[3]||(t[3]=x=>e.page=x),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])],32)),[[b,e.loadingCards||e.initLoading]])]),_:1},8,["body-style"])}const zK=Ao(NKe,[["render",RKe],["__scopeId","data-v-d9061656"]]),PKe={name:"AnnotationTool",components:{AnnotationPopup:mme,Button:Cr,CreateTooltipContent:wme,Col:HE,ElIconDelete:eh,Icon:kt,Row:jE},props:{annotationEntry:{type:Array},createData:{type:Object,default:{}}},data:function(){return{ElIconDelete:r.shallowRef(eh),annotationPopupData:null}}},VKe={class:"annotation-tool scrollbar"},DKe={key:1,class:"delete-container"};function zKe(e,t,n,o,a,i){const s=r.resolveComponent("CreateTooltipContent"),l=r.resolveComponent("annotation-popup"),c=HE,d=Cr,u=jE;return r.openBlock(),r.createElementBlock("div",VKe,[r.withDirectives(r.createVNode(s,{createData:n.createData,onConfirmCreate:t[0]||(t[0]=f=>e.$emit("confirm-create",f)),onCancelCreate:t[1]||(t[1]=f=>e.$emit("cancel-create")),class:"create-tooltip-content"},null,8,["createData"]),[[r.vShow,n.createData&&n.createData.toBeConfirmed]]),n.annotationEntry&&(!n.createData||!n.createData.toBeConfirmed)?(r.openBlock(),r.createBlock(l,{key:0,class:"annotation-popup",annotationEntry:n.annotationEntry,onAnnotation:t[2]||(t[2]=f=>e.$emit("annotation",f)),onHoverChanged:t[3]||(t[3]=f=>e.$emit("hover-changed",f)),onTrackEvent:t[4]||(t[4]=f=>e.$emit("trackEvent",f))},null,8,["annotationEntry"])):r.createCommentVNode("",!0),n.createData&&n.createData.toBeDeleted?(r.openBlock(),r.createElementBlock("div",DKe,[r.createVNode(u,null,{default:r.withCtx(()=>[r.createVNode(c,{offset:1,span:6},{default:r.withCtx(()=>t[7]||(t[7]=[r.createTextVNode("Delete this feature?")])),_:1}),r.createVNode(c,{offset:1,span:3},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",icon:e.ElIconDelete,onClick:t[5]||(t[5]=f=>e.$emit("confirm-delete"))},{default:r.withCtx(()=>t[8]||(t[8]=[r.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),r.createVNode(c,{offset:1,span:2},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",onClick:t[6]||(t[6]=f=>e.$emit("cancel-create"))},{default:r.withCtx(()=>t[9]||(t[9]=[r.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):r.createCommentVNode("",!0)])}const jK=Ao(PKe,[["render",zKe],["__scopeId","data-v-7acfbf0c"]]),jKe={name:"Tabs",components:{ElIconClose:Wr},props:{tabEntries:{type:Array,default:()=>[]},activeId:{type:Number,default:1},contextArray:{type:Array,default:()=>[]}},computed:{tabs:function(){const e=this.tabEntries.filter(o=>!o.closable),t=this.tabEntries.filter(o=>o.closable);let n=e.concat(t);if(this.contextArray.length)for(let o in n)n[o].contextCard=this.contextArray[o];return n}},methods:{tabClicked:function(e){this.$emit("tabClicked",{id:e.id,type:e.type}),this.$emit("trackEvent",{event:"interaction_event",event_name:"portal_maps_sidebar_open_tab",category:e.type,location:"map_sidebar_tabs"})},tabClosed:function(e){this.$emit("tabClosed",{id:e.id,type:e.type})}}},HKe={class:"tabs-container"},UKe=["onClick"],qKe={class:"tab-title"};function KKe(e,t,n,o,a,i){const s=Wr,l=kt;return r.openBlock(),r.createElementBlock("div",HKe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.tabs,c=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["tab",{"active-tab":c.id==n.activeId}]),key:c.id,onClick:d=>i.tabClicked(c)},[r.createElementVNode("span",qKe,r.toDisplayString(c.title),1),c.closable?(r.openBlock(),r.createBlock(l,{key:0,onClick:r.withModifiers(d=>i.tabClosed(c),["stop"]),class:"tab-close-icon"},{default:r.withCtx(()=>[r.createVNode(s)]),_:2},1032,["onClick"])):r.createCommentVNode("",!0)],10,UKe))),128))])}const HK=Ao(jKe,[["render",KKe],["__scopeId","data-v-744b6365"]]),GKe={components:{DatasetExplorer:PK,Tabs:HK,ElIconArrowLeft:G1,ElIconArrowRight:cu,Drawer:UE,Icon:kt,AnnotationTool:jK,ConnectivityExplorer:zK},name:"SideBar",props:{tabs:{type:Array,default:[{title:"Dataset Explorer",id:1,type:"datasetExplorer",closable:!1},{title:"Connectivity Explorer",id:2,type:"connectivityExplorer",closable:!1},{title:"Annotation",id:3,type:"annotation",closable:!0}]},visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},openAtStart:{type:Boolean,default:!1},connectivityEntry:{type:Array,default:[]},annotationEntry:{type:Array,default:[]},createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},connectivityKnowledge:{type:Array,default:[]},filterOptions:{type:Array,default:[]},showVisibilityFilter:{type:Boolean,default:!1}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[],activeTabId:1,activeAnnotationData:{tabType:"annotation"},activeConnectivityData:{tabType:"connectivity"},state:{dataset:{search:"",filters:[]},connectivity:{search:"",filters:[]},connectivityEntries:[],annotationEntries:[],activeTabId:this.activeTabId}}},methods:{onConnectivityCollapseChange:function(e){this.$emit("connectivity-collapse-change",e)},onConnectivityItemClose:function(){this.$emit("connectivity-item-close")},hoverChanged:function(e,t){this.$emit("hover-changed",{...t,tabId:e});const n=this.getActiveTabTypeById(e);n==="connectivityExplorer"&&(this.activeConnectivityData=t),n==="annotation"&&(this.activeAnnotationData=t)},showConnectivity:function(e){this.$emit("show-connectivity",e)},onShowReferenceConnectivities:function(e){this.$emit("show-reference-connectivities",e)},onConnectivityHovered:function(e){this.$emit("connectivity-hovered",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,tabId:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openConnectivitySearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getTabRef(void 0,"connectivityExplorer",!0).openSearch(e,t)})},resetConnectivitySearch:function(){this.$nextTick(()=>{this.getTabRef(void 0,"connectivityExplorer",!1).resetSearchIfNoActiveSearch()})},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getTabRef(void 0,"datasetExplorer",!0).openSearch(e,t)})},getTabRef:function(e,t,n=!1){const o=this.tabEntries.filter(s=>(e===void 0||s.id===e)&&(t===void 0||s.type===t)),a=o.length?o:this.tabEntries,i=a[0].type+"Tab_"+a[0].id;return n&&this.setActiveTab({id:a[0].id,type:a[0].type}),!this.$refs[i]||this.$refs[i].length===0?null:this.$refs[i][0]},addFilter:function(e){if(e){this.drawerOpen=!0;let t=e;Array.isArray(e)?t.forEach(n=>n.AND=!0):(e.AND=!0,t=[e]),this.$nextTick(()=>{this.getTabRef(void 0,"datasetExplorer",!0).addFilter(t)})}},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getTabRef(void 0,"datasetExplorer",!0).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getTabRef(void 0,"datasetExplorer").getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},setActiveTab:function(e){const t=this.tabs.filter(o=>o.id===e.id&&o.type===e.type),n=t.length?t:this.tabEntries;this.activeTabId=n[0].id},getActiveTabTypeById:function(e){const t=this.tabs.find(n=>n.id===e);return t?t.type:""},highlightActiveTabData:function(e){let t=null;if(e.type==="connectivityExplorer"){const n=this.getTabRef(void 0,"connectivityExplorer",!0);n&&!n.expanded?t={tabType:"connectivity"}:t={...this.activeConnectivityData}}else e.type==="annotation"&&(t={...this.activeAnnotationData});t&&this.$emit("hover-changed",{...t,tabId:e.id})},tabClicked:function(e){this.setActiveTab(e),this.$emit("tabClicked",e),this.highlightActiveTabData(e)},tabClosed:function(e){this.$emit("tabClosed",e)},updateConnectivityError:function(e){lt.emit("connectivity-error",e)},storeAvailableAnatomyFacets:function(e){localStorage.setItem("available-anatomy-facets",JSON.stringify(e))},closeConnectivity:function(){lt.emit("close-connectivity")},updateState:function(){this.state.activeTabId=this.activeTabId;const e=this.getTabRef(void 0,"datasetExplorer");e&&(this.state.dataset.search=e.getSearch(),this.state.dataset.filters=IK(e.getFilters()));const t=this.getTabRef(void 0,"connectivityExplorer");t&&(this.state.connectivity.search=t.getSearch(),this.state.connectivity.filters=t.getFilters()),this.connectivityEntry&&this.connectivityEntry.length>0&&(this.state.connectivityEntries=this.connectivityEntry.map(n=>n.id)),this.annotationEntry&&this.annotationEntry.length>0&&(this.state.annotationEntries=this.annotationEntry.map(n=>n.models))},getState:function(){return this.updateState(),this.state},setState:function(e){if(!e||!e.dataset||!e.connectivity)return;this.state=JSON.parse(JSON.stringify(e));const t=e.dataset.filters,n=e.connectivity.filters,o=e.dataset.search,a=e.connectivity.search;(t.length||o)&&this.openSearch(t,o),(n.length||a)&&this.openConnectivitySearch(n,a),e.activeTabId&&this.$nextTick(()=>{this.tabEntries.find(i=>i.id===e.activeTabId)&&(this.activeTabId=e.activeTabId)})},trackEvent:function(e){const t={event:"interaction_event",location:"map_sidebar",...e};this.$emit("trackEvent",t)}},computed:{tabEntries:function(){return this.tabs.filter(e=>e.type==="datasetExplorer"||e.type==="connectivityExplorer"||e.type==="annotation"&&this.annotationEntry&&this.annotationEntry.length>0)}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){lt.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),lt.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),lt.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),lt.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),lt.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),lt.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"datasetExplorer"}),this.$emit("actionClick",e)}),lt.on("connectivity-source-change",e=>{this.$emit("connectivity-source-change",e)}),lt.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children,this.storeAvailableAnatomyFacets(this.availableAnatomyFacets)}),lt.on("trackEvent",e=>{this.trackEvent(e)})}},WKe={ref:"container"},XKe={class:"box-card"},YKe={class:"sidebar-container"};function JKe(e,t,n,o,a,i){const s=G1,l=kt,c=cu,d=HK,u=jK,f=zK,p=PK,m=UE;return r.openBlock(),r.createElementBlock("div",WKe,[e.drawerOpen?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...h)=>i.toggleDrawer&&i.toggleDrawer(...h)),class:"open-tab"},[r.createVNode(l,null,{default:r.withCtx(()=>[r.createVNode(s)]),_:1})])),r.createVNode(m,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[7]||(t[7]=h=>e.drawerOpen=h),teleported:!1,"modal-append-to-body":!1,size:"584","with-header":!1,wrapperClosable:!1,modal:!1,"modal-class":"sidebar-body","z-index":10,"lock-scroll":!1},{default:r.withCtx(()=>[r.createElementVNode("div",XKe,[e.drawerOpen?(r.openBlock(),r.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...h)=>i.close&&i.close(...h)),class:"close-tab"},[r.createVNode(l,null,{default:r.withCtx(()=>[r.createVNode(c)]),_:1})])):r.createCommentVNode("",!0),r.createElementVNode("div",YKe,[i.tabEntries.length>1?(r.openBlock(),r.createBlock(d,{key:0,tabEntries:i.tabEntries,activeId:e.activeTabId,onTabClicked:i.tabClicked,onTabClosed:i.tabClosed,onTrackEvent:i.trackEvent},null,8,["tabEntries","activeId","onTabClicked","onTabClosed","onTrackEvent"])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.tabs,h=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:"tab.id"},[h.type==="annotation"?r.withDirectives((r.openBlock(),r.createBlock(u,{key:0,ref_for:!0,ref:"annotationTab_"+h.id,annotationEntry:n.annotationEntry,createData:n.createData,onAnnotation:t[2]||(t[2]=g=>e.$emit("annotation-submitted",g)),onConfirmCreate:t[3]||(t[3]=g=>e.$emit("confirm-create",g)),onCancelCreate:t[4]||(t[4]=g=>e.$emit("cancel-create")),onConfirmDelete:t[5]||(t[5]=g=>e.$emit("confirm-delete",g)),onHoverChanged:g=>i.hoverChanged(h.id,g),onTrackEvent:i.trackEvent},null,8,["annotationEntry","createData","onHoverChanged","onTrackEvent"])),[[r.vShow,h.id===e.activeTabId]]):h.type==="connectivityExplorer"?r.withDirectives((r.openBlock(),r.createBlock(f,{key:1,ref_for:!0,ref:"connectivityExplorerTab_"+h.id,connectivityKnowledge:n.connectivityKnowledge,envVars:n.envVars,connectivityEntry:n.connectivityEntry,availableAnatomyFacets:e.availableAnatomyFacets,onFilterVisibility:t[6]||(t[6]=g=>e.$emit("filter-visibility",g)),connectivityFilterOptions:n.filterOptions,showVisibilityFilter:n.showVisibilityFilter,onSearchChanged:g=>i.searchChanged(h.id,g),onHoverChanged:g=>i.hoverChanged(h.id,g),onShowConnectivity:i.showConnectivity,onShowReferenceConnectivities:i.onShowReferenceConnectivities,onConnectivityHovered:i.onConnectivityHovered,onConnectivityCollapseChange:i.onConnectivityCollapseChange,onConnectivityItemClose:i.onConnectivityItemClose},null,8,["connectivityKnowledge","envVars","connectivityEntry","availableAnatomyFacets","connectivityFilterOptions","showVisibilityFilter","onSearchChanged","onHoverChanged","onShowConnectivity","onShowReferenceConnectivities","onConnectivityHovered","onConnectivityCollapseChange","onConnectivityItemClose"])),[[r.vShow,h.id===e.activeTabId]]):r.withDirectives((r.openBlock(),r.createBlock(p,{key:2,class:"sidebar-content-container",contextCardEntry:h.contextCard,envVars:n.envVars,ref_for:!0,ref:"datasetExplorerTab_"+h.id,onSearchChanged:g=>i.searchChanged(h.id,g),onHoverChanged:g=>i.hoverChanged(h.id,g)},null,8,["contextCardEntry","envVars","onSearchChanged","onHoverChanged"])),[[r.vShow,h.id===e.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const ZKe=Ao(GKe,[["render",JKe],["__scopeId","data-v-353bb9df"]]);/*! js-cookie v3.0.5 | MIT */function k1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var QKe={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function g5(e,t){function n(a,i,s){if(!(typeof document>"u")){s=k1({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in s)s[c]&&(l+="; "+c,s[c]!==!0&&(l+="="+s[c].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+l}}function o(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],s={},l=0;l<i.length;l++){var c=i[l].split("="),d=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(s[u]=e.read(d,u),a===u)break}catch{}}return a?s[a]:s}}return Object.create({set:n,get:o,remove:function(a,i){n(a,"",k1({},i,{expires:-1}))},withAttributes:function(a){return g5(this.converter,k1({},this.attributes,a))},withConverter:function(a){return g5(k1({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var y5=g5(QKe,{path:"/"}),Ha=function(e,t,n,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n},dn=function(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)},Mi,Ip,Ua,yr,Vs;const eGe=1e4;class tGe{constructor(t){Mi.add(this),Ip.set(this,void 0),Ua.set(this,null),yr.set(this,null),t.slice(-1)==="/"?Ha(this,Ip,t.slice(0,-1),"f"):Ha(this,Ip,t,"f")}get currentUser(){return dn(this,Ua,"f")}get currentError(){return dn(this,yr,"f")}async authenticate(t){Ha(this,yr,null,"f"),Ha(this,Ua,null,"f");const n=await dn(this,Mi,"m",Vs).call(this,t,"authenticate");return"error"in n?(y5.remove("annotation-key"),Promise.resolve(dn(this,yr,"f"))):(y5.set("annotation-key",n.session,{secure:!0,expires:1}),Ha(this,Ua,n.data,"f"),Promise.resolve(dn(this,Ua,"f")))}async unauthenticate(t){Ha(this,yr,null,"f"),Ha(this,Ua,null,"f");const n=await dn(this,Mi,"m",Vs).call(this,t,"unauthenticate");return"success"in n?Promise.resolve(n):Promise.resolve(dn(this,yr,"f"))}async annotatedItemIds(t,n,o,a){const i={resource:n};o!==void 0&&(i.user=o),a!==void 0&&(i.participated=a);const s=await dn(this,Mi,"m",Vs).call(this,t,"items/","GET",i);return"error"in s?Promise.resolve(dn(this,yr,"f")):Promise.resolve(s)}async drawnFeatures(t,n,o){const a={resource:n};o!==void 0&&(a.items=o);const i=await dn(this,Mi,"m",Vs).call(this,t,"features/","GET",a);return"error"in i?Promise.resolve(dn(this,yr,"f")):Promise.resolve(i)}async itemAnnotations(t,n,o){const a=await dn(this,Mi,"m",Vs).call(this,t,"annotations/","GET",{resource:n,item:o});return"error"in a?Promise.resolve(dn(this,yr,"f")):Promise.resolve(a)}async annotation(t,n){const o=await dn(this,Mi,"m",Vs).call(this,t,"annotation/","GET",{annotation:n});return"error"in o?Promise.resolve(dn(this,yr,"f")):Promise.resolve(o)}async addAnnotation(t,n){if(dn(this,Ua,"f")&&dn(this,Ua,"f").canUpdate){const o=Object.assign({creator:dn(this,Ua,"f"),created:new Date().toISOString()},n),a=await dn(this,Mi,"m",Vs).call(this,t,"annotation/","POST",{data:o});if(!("error"in a))return Promise.resolve(a);Ha(this,yr,a,"f")}else Ha(this,yr,{error:"user cannot add annotation"},"f");return Promise.resolve(dn(this,yr,"f"))}}Ip=new WeakMap,Ua=new WeakMap,yr=new WeakMap,Mi=new WeakSet,Vs=async function(t,n,o="GET",a={}){let i=!0;const s=new AbortController;setTimeout(()=>{i&&(console.log("Annotation server timeout..."),s.abort())},eGe);const l={method:o,signal:s.signal};let c=`${dn(this,Ip,"f")}/${n}`;const d=y5.get("annotation-key")||"";if(o==="GET"){const f=[];for(const[p,m]of Object.entries(a))f.push(`${p}=${encodeURIComponent(JSON.stringify(m))}`);f.push(`key=${encodeURIComponent(t)}`),f.push(`session=${encodeURIComponent(d)}`),c+="?"+f.join("&"),l.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(o==="POST"){const f=Object.assign({key:t,session:d},a);l.body=JSON.stringify(f),l.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const u=await fetch(c,l);return i=!1,u.ok?Promise.resolve(await u.json()):(Ha(this,yr,{error:`${u.status} ${u.statusText}`},"f"),Promise.resolve(dn(this,yr,"f")))};const nGe=Mt.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}}),UK=e=>{const t=[];return e&&e.forEach(n=>{n.label&&t.push(n.label.toLowerCase()),t.push(...UK(n.children))}),t},qK=(e,t)=>{const n=[];for(const o of e.facets)o in t?n.push(t[o]):n.push(o);return n},rGe={name:"SplitFlow",components:{Container:T3,Header:B3,Main:N3,DialogToolbarContent:NV,SplitDialog:TV,SideBar:ZKe},setup(){const e=nGe();r.provide("userApiKey",e.userToken);const t=vi();let n=r.markRaw(new tGe(`${t.flatmapAPI}annotator`));return r.provide("$annotator",n),{annotator:n}},props:{state:{type:Object,default:void 0}},data:function(){return{availableFacets:void 0,availableNameCurieMapping:void 0,sideBarVisibility:!0,startUp:!0,sidebarStateRestored:!1,sidebarAnnotationState:!1,search:"",expanded:"",filterTriggered:!1,connectivityEntry:[],annotationEntry:[],annotationCallback:void 0,confirmCreateCallback:void 0,cancelCreateCallback:void 0,confirmDeleteCallback:void 0,confirmCommentCallback:void 0,createData:{},connectivityProcessed:!1,connectivityHighlight:[],connectivityKnowledge:[],connectivityExplorerClicked:[],showVisibilityFilter:!1,filterVisibility:!0,filterOptions:[],annotationHighlight:[]}},watch:{state:{handler:function(e){e&&(this._externalStateSet||this.setState(e),this._externalStateSet=!0,this.updateGlobalSettingsFromState(e))},immediate:!0},connectivityHighlight:{handler:function(){this.hoverChanged({tabType:"connectivity"}),this.onFilterVisibility(this.filterVisibility)}},annotationHighlight:{handler:function(){this.hoverChanged({tabType:"annotation"})}}},methods:{onFilterVisibility:function(e){this.filterVisibility=e;const t={OR:[{NOT:{"tile-layer":"pathways"}},{AND:[{"tile-layer":"pathways"},{models:this.connectivityHighlight}]}]},o=this.filterVisibility&&this.connectivityProcessed?t:void 0;$e.emit("filter-visibility",o)},onConnectivityCollapseChange:function(e){this.expanded=e.id;const t=this.$refs.splitdialog;if(t){const n=t.getActiveContents(),o=n.find(s=>s.viewerType.includes("Flatmap")),a=n.find(s=>s.activeSpecies==="Human Male");let i=!1;n.forEach(s=>{const l=s.viewerType==="Flatmap"||s.viewerType==="MultiFlatmap";(o&&l||o&&!a&&!l&&!i||!o&&!i)&&(this.connectivityExplorerClicked.push(!0),s.onLoadConnectivityDetail({data:[e]}),l||(i=!0))})}},onConnectivityItemClose:function(){$e.emit("connectivity-item-close")},getActiveFlatmaps:function(){const e=[];let t=this.$refs.splitdialog;return t&&t.getActiveContents().forEach(o=>{if(o!=null&&o.$refs.viewer){const a=o.$refs.viewer,i=a.flatmapRef,s=a.multiflatmapRef;let l=null;i&&(l=i),s&&(l=s.getCurrentFlatmap()),l&&e.push(l)}}),e},actionClick:function(e){if(e){if(!this.availableFacets||this.availableFacets.length===0){const t=localStorage.getItem("available-anatomy-facets"),n=t?JSON.parse(t):[];this.availableFacets=r.markRaw([...new Set(UK(n))])}if(!this.availableNameCurieMapping||Object.keys(this.availableNameCurieMapping).length===0){const t=localStorage.getItem("available-name-curie-mapping"),n=t?JSON.parse(t):{};this.availableNameCurieMapping=r.markRaw(n)}if(e.type=="Search")if(e.nervePath)this.openSearch([e.filter],e.label);else{this.openSearch([],e.term);const t=e.featuredDataset?"portal_maps_featured_dataset_search":"portal_maps_action_search";Tt.sendEvent({event:"interaction_event",event_name:t,category:e.term||"filter",location:"map_location_pin"}),this.filterTriggered=!0}else if(e.type=="URL")window.open(e.resource,"_blank");else if(e.type=="Facet"){if(this.$refs.sideBar){const t={facetPropPath:"anatomy.organ.category.name",facetSubPropPath:"anatomy.organ.name",term:"Anatomical structure"},n=[],o=qK(e,this.availableNameCurieMapping),a=e.facets.join(", ");o.forEach(i=>n.push({...t,facet:i})),this.$refs.sideBar.addFilter(n),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:a||"filter_reset",location:"map_location_pin"}),this.filterTriggered=!0}}else if(e.type=="Facets"){const t=[],n=qK(e,this.availableNameCurieMapping),o=_5e(this.availableFacets,n),a=o.join(", ");this.settingsStore.facets.species.forEach(i=>{t.push({facet:vV(i),term:"Species",facetPropPath:"organisms.primary.species.name"})}),t.push(...o.map(i=>({facet:vV(i),term:"Anatomical structure",facetPropPath:"anatomy.organ.category.name",facetSubPropPath:"anatomy.organ.name"}))),this.openSearch(t,""),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:a||"filter_reset",location:"map_popup_button"}),this.filterTriggered=!0}else this.trackGalleryClick(e),this.createNewEntry(e)}},trackGalleryClick:function(e){const t=[],{label:n,type:o,datasetId:a,discoverId:i,resource:s}=e;let l="",c=a||i;n&&t.push(n),o&&t.push(o),a&&t.push("("+c+")"),s&&(o==="Plot"?l=s.dataSource.url:l=typeof s=="string"?s:s.share_link),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t.join(" "),location:"map_sidebar_gallery",dataset_id:c?c+"":"",file_path:l})},onDisplaySearch:function(e,t=!0){let n=!1,o=this.$refs.splitdialog;o&&o.getActiveContents().forEach(i=>{i.search(e.term)&&(n=!0)}),this.$refs.dialogToolbar.setFailedSearch(n?void 0:e.term),t&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_display_search",category:e.term,location:"map_toolbar"})},fetchSuggestions:function(e){const t=[];this.$refs.splitdialog.getActiveContents().forEach(s=>s.searchSuggestions(e.data.term,t));const a=[];t.forEach(s=>{a.push(s.replaceAll('"',""))});const i=new Set(a);t.length=0;for(const s of i)t.push({value:'"'+s+'"'});e.data.cb(t)},onShowConnectivity:function(e){if(e.length){const t=this.splitFlowStore.getState(),n=(t==null?void 0:t.activeView)||"";$e.emit("show-connectivity",{featureIds:e,offset:n==="singlepanel"||n==="2horpanel"})}},openConnectivityInfo:function(e){const t=e.some(n=>n.featureId[0]===this.expanded);if(this.expanded&&this.connectivityExplorerClicked.length&&!t){this.connectivityExplorerClicked.pop();return}this.connectivityEntry=e.map(n=>{let o={...n,label:n.title,id:n.featureId[0]};const a=this.connectivityKnowledge.find(i=>i.id===o.id);return n.ready&&(o["nerve-label"]=n["nerve-label"]||a["nerve-label"]),o}),this.connectivityExplorerClicked.length?this.connectivityEntry.every(n=>n.ready)&&this.connectivityExplorerClicked.pop():(this.connectivityKnowledge=this.connectivityEntry,this.connectivityKnowledge.every(n=>n.ready)&&(this.connectivityHighlight=this.connectivityKnowledge.map(n=>n.id),this.connectivityProcessed=!0),this.$refs.sideBar&&(this.$refs.sideBar.tabClicked({id:2,type:"connectivityExplorer"}),this.$refs.sideBar.setDrawerOpen(!0)))},openAnnotation:function(e){this.annotationEntry=e.annotationEntry,this.annotationHighlight=this.annotationEntry.map(t=>t.models).filter(Boolean),e.commitCallback&&(this.annotationCallback=r.markRaw(e.commitCallback)),e.createData?this.createData=r.markRaw(e.createData):this.createData=r.markRaw({}),e.confirmCreate&&(this.confirmCreateCallback=r.markRaw(e.confirmCreate)),e.cancelCreate&&(this.cancelCreateCallback=r.markRaw(e.cancelCreate)),e.confirmDelete&&(this.confirmDeleteCallback=r.markRaw(e.confirmDelete)),e.confirmComment&&(this.confirmCommentCallback=r.markRaw(e.confirmComment)),this.$refs.sideBar&&(this.$refs.sideBar.tabClicked({id:3,type:"annotation"}),this.$refs.sideBar.setDrawerOpen(!0))},onShowReferenceConnectivities:function(e){$e.emit("show-reference-connectivities",e)},onConnectivityHovered:function(e){$e.emit("connectivity-hovered",e)},onConnectivitySourceChange:function(e){this.connectivityExplorerClicked.push(!0),$e.emit("connectivity-source-change",e)},hoverChanged:function(e){let t=[],n=[],o="",a=[];e.tabType==="dataset"?(t=e.anatomy?e.anatomy:[],n=e.organs?e.organs:[],o=e.doi?e.doi:""):e.tabType==="connectivity"?(a=e.id?[e.id]:this.connectivityHighlight,n=e["nerve-label"]?e["nerve-label"].flatMap(i=>i.subNerves):[]):e.tabType==="annotation"&&(a=e.models?[e.models]:this.annotationHighlight),this.settingsStore.updateHoverFeatures(t,n,o,a),$e.emit("hoverUpdate",{connectivityProcessed:this.connectivityProcessed})},searchChanged:function(e){if(e.tabType==="dataset"){if(e&&e.type=="reset-update"&&this.settingsStore.updateAppliedFacets([]),e&&e.type=="query-update"&&(this.search=e.value,this.search&&!this.filterTriggered&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:this.search,location:"map_sidebar_dataset_search"}),this.filterTriggered=!1),e&&e.type=="filter-update"){if(this.settingsStore.updateFacets(e.value),!this.filterTriggered){const t=e.value.filter(i=>i.facet&&i.facet.toLowerCase()!=="show all").map(i=>i.facet),n=t.map(i=>i.toLowerCase()),o=[...new Set([...n])];this.settingsStore.updateAppliedFacets(o);const a=t.join(", ");Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:a||"filter_reset",location:"map_sidebar_dataset_filter"})}this.filterTriggered=!1}}else if(e.tabType==="connectivity")if(e&&e.type=="reset-update")this.getActiveFlatmaps().forEach(n=>{n.resetConnectivityfilters(e.value)});else{this.expanded="",this.connectivityEntry=[],this.getActiveFlatmaps().forEach(a=>{a.updateConnectivityFilters(e.filter)}),$e.emit("connectivity-query-filter",e);const n=e.filter.filter(a=>a.facet&&a.facet.toLowerCase()!=="show all").map(a=>a.tagLabel).join(", "),o=e.query;n&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n,location:"map_sidebar_connectivity_filter"}),o&&Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:o,location:"map_sidebar_connectivity_search"})}},updateMarkers:function(e){this.settingsStore.updateMarkers(e),$e.emit("markerUpdate")},updateScaffoldMarkers:function(e){this.settingsStore.updateNumberOfDatasetsForFacets(e)},getNewEntryId:function(){return this.entries.length?this.entries[this.entries.length-1].id+1:1},createNewEntry:function(e){let t={};return t.viewUrl=void 0,t.state=void 0,Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.discoverId=e.discoverId,this.entriesStore.addNewEntry(t),this.splitFlowStore.setIdToPrimaryPane(t.id),this.$refs.sideBar&&this.$refs.sideBar.setDrawerOpen(!1),t.id},openNewMap:async function(e){const t=await k5e(e,this.settingsStore.sparcApi);this.createNewEntry(t),t.contextCard&&$e.emit("contextUpdate",t.contextCard)},openSearch:function(e,t){this.search=t,this._facets=e,this.$refs&&this.$refs.sideBar&&(this.$refs.sideBar.openSearch(e,t),this.$refs.sideBar.tabClicked({id:1,type:"datasetExplorer"})),this.startUp=!1},onFullscreen:function(e){this.$emit("onFullscreen",e)},resetApp:function(){this.setState(IS())},setIdToPrimaryPane:function(e){this.splitFlowStore.setIdToPrimaryPane(e)},restoreConnectivityEntries:function(e){this.getActiveFlatmaps().forEach(n=>{const o=e.map(a=>{const i=n.mapImp.modelFeatureIds(a)[0],s=n.mapImp.featureProperties(i);return{resource:[s.models],feature:s,label:s.label,provenanceTaxonomy:s.taxons,alert:s.alert}});n.checkAndCreatePopups(o,!0)})},restoreSidebarState:function(e){var n,o,a;const t=e==null?void 0:e.sidebar;!this.sidebarStateRestored&&t&&this.$refs.sideBar&&((n=this.connectivityKnowledge)!=null&&n.length)&&((o=t.connectivityEntries)!=null&&o.length?this.restoreConnectivityEntries(t.connectivityEntries):(a=t.annotationEntries)!=null&&a.length&&e.annotationId?(this.restoreConnectivityEntries(t.annotationEntries),this.sidebarAnnotationState=!0):this.$refs.sideBar.setState(t),this.sidebarStateRestored=!0)},setState:function(e){this.entriesStore.setAll(e.entries),e.splitFlow?this.splitFlowStore.setState(e.splitFlow):this.entries.forEach(t=>this.splitFlowStore.setIdToPrimaryPane(t.id)),this.restoreSidebarState(e),this.updateGlobalSettingsFromState(e)},getState:function(e=!1){var a,i,s;let t=JSON.parse(JSON.stringify(this.entriesStore.$state)),o=this.$refs.splitdialog.getContentsState();if(t.entries.length===o.length)for(let l=0;l<o.length;l++){const c=t.entries[l];c.state=o[l],c.type==="Scaffold"&&"viewUrl"in c&&delete c.viewUrl,c.type==="MultiFlatmap"&&"uberonId"in c&&delete c.uberonId,e===!1&&(c.type==="Scaffold"&&((a=c==null?void 0:c.state)!=null&&a.offlineAnnotations)?delete c.state.offlineAnnotations:(s=(i=c==null?void 0:c.state)==null?void 0:i.state)!=null&&s.offlineAnnotations&&delete c.state.state.offlineAnnotations)}return t.splitFlow=this.splitFlowStore.getState(),t.globalSettings=this.settingsStore.getGlobalSettings(),this.$refs.sideBar&&(t.sidebar=this.$refs.sideBar.getState()),t},removeEntry:function(e){let t=this.entriesStore.findIndexOfId(e);this.entriesStore.destroyEntry(t)},resourceSelected:function(e){this.$emit("resource-selected",e)},speciesChanged:function(e){this.$refs.sideBar&&this.$nextTick(()=>{$e.emit("species-layout-connectivity-update"),this.$refs.sideBar.close()})},contextUpdate:function(e){$e.emit("contextUpdate",e)},datalinkClicked:function(e){const t=e||"",n="datasets/",a=t.substring(t.indexOf(n)+n.length,t.indexOf("?type=dataset"));Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t,location:"map_sidebar_gallery",dataset_id:a||""})},onAnnotationSubmitted:function(e){this.annotationCallback?this.annotationCallback(e):this.confirmCommentCallback&&this.confirmCommentCallback(e)},onConfirmCreate:function(e){this.confirmCreateCallback&&this.confirmCreateCallback(e)},onCancelCreate:function(){this.cancelCreateCallback&&this.cancelCreateCallback()},onConfirmDelete:function(e){this.confirmDeleteCallback&&this.confirmDeleteCallback(e)},onSidebarTabClicked:function(e){let t={...this.settingsStore.globalSettings};"interactiveMode"in t&&(e.id===1&&e.type==="datasetExplorer"?t.interactiveMode="dataset":e.id===2&&e.type==="connectivityExplorer"&&(t.interactiveMode="connectivity"),this.settingsStore.updateGlobalSettings(t)),this.$refs.dialogToolbar.loadGlobalSettings()},onSidebarTabClosed:function(e){e.id===3&&e.type==="annotation"&&$e.emit("sidebar-annotation-close")},updateGlobalSettingsFromStorage:function(){const e=localStorage.getItem("mapviewer.globalSettings");e&&this.settingsStore.updateGlobalSettings(JSON.parse(e))},updateGlobalSettingsFromState:function(e){e!=null&&e.globalSettings&&this.settingsStore.updateGlobalSettings(e.globalSettings)},trackEvent:function(e){Tt.sendEvent(e)},updateFlatmapMinimap:function(){const e=this.$refs.splitdialog;e&&e.updateFlatmapMinimap()}},created:function(){this._facets=[],this._externalStateSet=!1},mounted:function(){$e.on("CreateNewEntry",e=>{this.createNewEntry(e)}),$e.on("RemoveEntryRequest",e=>{this.removeEntry(e)}),$e.on("PopoverActionClick",e=>{this.actionClick(e)}),$e.on("annotation-open",e=>{this.openAnnotation(e)}),$e.on("sidebar-annotation-close",()=>{const e={...this.settingsStore.globalSettings},{interactiveMode:t,viewingMode:n}=e;if(this.sidebarAnnotationState&&n==="Annotation"){this.sidebarAnnotationState=!1,this.$refs.sideBar.tabClicked({id:3,type:"annotation"});return}this.annotationEntry=[],this.createData={},this.$refs.sideBar&&(t==="dataset"?this.$refs.sideBar.tabClicked({id:1,type:"datasetExplorer"}):t==="connectivity"&&this.$refs.sideBar.tabClicked({id:2,type:"connectivityExplorer"}),this.$refs.sideBar.closeConnectivity(),$e.emit("connectivity-item-close"))}),$e.on("update-offline-annotation-enabled",e=>{this.settingsStore.updateOfflineAnnotationEnabled(e)}),$e.on("connectivity-info-open",e=>{this.openConnectivityInfo(e)}),$e.on("connectivity-info-close",e=>{this.$refs.sideBar&&(this.connectivityProcessed=!1,this.$refs.sideBar.resetConnectivitySearch())}),$e.on("connectivity-error",e=>{this.$refs.sideBar&&this.$refs.sideBar.updateConnectivityError(e.data)}),$e.on("neuron-connection-feature-click",e=>{if(this.$refs.sideBar){const{filters:t,search:n}=e;this.$refs.sideBar.openConnectivitySearch(t,n),this.$refs.sideBar.tabClicked({id:2,type:"connectivityExplorer"}),this.$refs.sideBar.setDrawerOpen(!0)}}),$e.on("OpenNewMap",e=>{this.updateFlatmapMinimap(),this.openNewMap(e)}),$e.on("startHelp",()=>{this.$refs.sideBar&&this.$refs.sideBar.close()}),$e.on("connectivity-knowledge",e=>{this.connectivityKnowledge=e.data,this.connectivityHighlight=e.highlight,this.connectivityProcessed=e.processed,this.restoreSidebarState(this.state)}),$e.on("modeUpdate",e=>{e==="dataset"?this.$refs.sideBar.tabClicked({id:1,type:"datasetExplorer"}):e==="connectivity"&&this.$refs.sideBar.tabClicked({id:2,type:"connectivityExplorer"})}),this.updateGlobalSettingsFromStorage(),$e.on("connectivity-filter-options",e=>{this.filterOptions=e}),this.$nextTick(()=>{this.search===""&&this._facets.length===0?(this.$refs.sideBar&&this.$refs.sideBar.close(),setTimeout(()=>{this.startUp=!1},2e3)):this.openSearch(this._facets,this.search)})},computed:{...Mt.mapStores(Mf,vi,Ss),envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl,FLATMAPAPI_LOCATION:this.settingsStore.flatmapAPI}},entries:function(){return this.entriesStore.entries}}},oGe={style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}};function aGe(e,t,n,o,a,i){const s=NV,l=B3,c=r.resolveComponent("SideBar"),d=TV,u=N3,f=T3;return r.openBlock(),r.createBlock(f,{style:{height:"100%",background:"white"}},{default:r.withCtx(()=>[r.createVNode(l,{ref:"header",style:{"text-align":"left","font-size":"14px",padding:"0"},height:"32px",class:"dialog-header"},{default:r.withCtx(()=>[r.createVNode(s,{numberOfEntries:i.entries.length,onOnFullscreen:i.onFullscreen,onLocalSearch:i.onDisplaySearch,onFetchSuggestions:i.fetchSuggestions,ref:"dialogToolbar"},null,8,["numberOfEntries","onOnFullscreen","onLocalSearch","onFetchSuggestions"])]),_:1},512),r.createVNode(u,{class:"dialog-main"},{default:r.withCtx(()=>[r.createElementVNode("div",oGe,[r.createVNode(c,{ref:"sideBar",envVars:i.envVars,visible:e.sideBarVisibility,class:r.normalizeClass(["side-bar",{"start-up":e.startUp}]),"open-at-start":e.startUp,annotationEntry:e.annotationEntry,createData:e.createData,connectivityEntry:e.connectivityEntry,connectivityKnowledge:e.connectivityKnowledge,filterOptions:e.filterOptions,showVisibilityFilter:e.showVisibilityFilter,onTabClicked:i.onSidebarTabClicked,onTabClosed:i.onSidebarTabClosed,onActionClick:i.actionClick,onSearchChanged:t[0]||(t[0]=p=>i.searchChanged(p)),onAnatomyInDatasets:t[1]||(t[1]=p=>i.updateMarkers(p)),onAnnotationSubmitted:i.onAnnotationSubmitted,onConfirmCreate:i.onConfirmCreate,onCancelCreate:i.onCancelCreate,onConfirmDelete:i.onConfirmDelete,onNumberOfDatasetsForAnatomies:t[2]||(t[2]=p=>i.updateScaffoldMarkers(p)),onHoverChanged:t[3]||(t[3]=p=>i.hoverChanged(p)),onContextUpdate:t[4]||(t[4]=p=>i.contextUpdate(p)),onDatalinkClicked:t[5]||(t[5]=p=>i.datalinkClicked(p)),onShowConnectivity:i.onShowConnectivity,onShowReferenceConnectivities:i.onShowReferenceConnectivities,onConnectivityHovered:i.onConnectivityHovered,onConnectivityCollapseChange:i.onConnectivityCollapseChange,onConnectivitySourceChange:i.onConnectivitySourceChange,onFilterVisibility:i.onFilterVisibility,onConnectivityItemClose:i.onConnectivityItemClose,onTrackEvent:i.trackEvent},null,8,["envVars","visible","class","open-at-start","annotationEntry","createData","connectivityEntry","connectivityKnowledge","filterOptions","showVisibilityFilter","onTabClicked","onTabClosed","onActionClick","onAnnotationSubmitted","onConfirmCreate","onCancelCreate","onConfirmDelete","onShowConnectivity","onShowReferenceConnectivities","onConnectivityHovered","onConnectivityCollapseChange","onConnectivitySourceChange","onFilterVisibility","onConnectivityItemClose","onTrackEvent"]),r.createVNode(d,{entries:i.entries,ref:"splitdialog",onResourceSelected:i.resourceSelected,onSpeciesChanged:i.speciesChanged},null,8,["entries","onResourceSelected","onSpeciesChanged"])])]),_:1})]),_:1})}const KK=tr(rGe,[["render",aGe],["__scopeId","data-v-0888bb31"]]),iGe={name:"MapContent",components:{MapSvgSpriteColor:yV,Loading:J3,SplitFlow:KK},mixins:[{methods:{retrieveContextCardFromUrl:async function(e){const[t,n,o,a]=this.splitInfoFromUrl(e),i=await this.getContextFileFromScicrunch(t,o);if(!i.success)return{};const s=n+i.contextFile+a;return{s3uri:i.s3uri,contextCardUrl:s}},splitInfoFromUrl:function(e){let t=e.split("s3-resource")[1],n=e.split("files/")[0]+"files/",o=e.split("files/")[1].split("?")[0],a="?"+e.split("?")[1];const i=t.split("/");return i.shift(),[i[0],n,o,a]},getContextFileFromScicrunch:async function(e,t){return await fetch(`${this.settingsStore.sparcApi}/dataset_info/using_multiple_discoverIds/?discoverIds=${e}`).then(o=>o.json()).then(o=>{if(o.numberOfHits===1){const a=o.results[0]["abi-contextual-information"];if(a&&a.length===1)return{success:!0,contextFile:a[0],s3uri:o.results[0].s3uri};if(a&&a.length>1){let i=this.findContextInforForFilePath(o.results[0]["abi-context-file"],t);if(i)return{success:!0,contextFile:i,s3uri:o.results[0].s3uri}}}return{success:!1}}).catch(o=>(console.error("Error:",o),{success:!1}))},findContextInforForFilePath:function(e,t){var o;let n=e.find(a=>a.datacite.isDerivedFrom.path.includes(t));return(o=n==null?void 0:n.dataset)==null?void 0:o.path}}}],props:{shareLink:{type:String,default:void 0},state:{type:Object,default:void 0},options:{type:Object,default:()=>({}),required:!0},startingMap:{type:String,default:"AC"},useHelpModeDialog:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!0},annotationSidebar:{type:Boolean,default:!0},allClosable:{type:Boolean,default:!0},showGlobalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0}},provide:function(){return{showGlobalSettings:this.showGlobalSettings,showOpenMapButton:this.showOpenMapButton}},data:function(){return{isReady:!1,initialState:void 0,displaySearchFromQuery:""}},methods:{isFullscreen:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},onFullscreen:function(e){e!==void 0?(e&&!this.isFullscreen()&&this.goFullscreen(),!e&&this.isFullscreen()&&this.leaveFullscreen()):this.isFullscreen()?this.leaveFullscreen():this.goFullscreen()},leaveFullscreen:function(){if(this.isFullscreen()){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen();let e=this.$refs.MapApp;this.replacePopupsOnFullscreen(e,document.body)}},goFullscreen:function(){let e=this.$refs.MapApp;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():parent.msRequestFullscreen&&e.msRequestFullscreen(),this.replacePopupsOnFullscreen(document.body,e)},replacePopupsOnFullscreen:function(e,t){e.querySelectorAll('[id^="el-popper-container"]').forEach(o=>{t.append(o)})},setState:function(e){return this.$refs.flow.setState(e)},getState:function(e=!1){return this.$refs.flow.getState(e)},setCurrentEntry:async function(e){if(e&&e.type){if(e.type==="Scaffold"&&(e.url||e.isBodyScaffold)){let t={type:e.type,label:e.label,region:e.region,resource:e.url,state:e.state,viewUrl:e.viewUrl,discoverId:e.dataset_id,version:e.dataset_version};if(e.isBodyScaffold){const n=await RS(this.options.sparcApi,e.label);t={...t,...n.datasetInfo,resource:n.url}}else{const n=await this.retrieveContextCardFromUrl(e.url);t={...t,...n}}this.$refs.flow.createNewEntry(t)}else if(e.type==="MultiFlatmap")if(e.resource){const t={type:e.type,resource:e.resource,state:e.state,label:e.label,discoverId:e.dataset_id,version:e.dataset_version};this.$refs.flow.createNewEntry(t)}else{const t=S5e(e);if(t){const n=this.getState();if(n&&n.entries)for(let o=0;o<n.entries.length;o++){const a=n.entries[o];if(a.type==="MultiFlatmap"){a.resource=t,a.state={species:t},(e.organ||e.uuid)&&(a.state.state={searchTerm:e.organ,uuid:e.uuid},e.uuid&&(a.state.state.entry=e.taxo)),e.organ&&(this.displaySearchFromQuery=e.organ),this.$refs.flow.setState(n),this.$refs.flow.setIdToPrimaryPane(a.id);break}}}}else if(e.type==="Flatmap"){const t={type:e.type,resource:e.resource,state:e.state,label:e.label,discoverId:e.dataset_id,version:e.dataset_version};this.$refs.flow.createNewEntry(t)}}},openSearch:function(e,t){return this.$refs.flow.openSearch(e,t)},flowMounted:function(){this._flowMounted=!0,this.$emit("isReady"),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_page_view",category:this.startingMap})}},computed:{...Mt.mapStores(vi,Ss),stateToSet(){return this.state?this.state:this.initialState}},watch:{shareLink:{handler:function(e){this.settingsStore.updateShareLink(e)},immediate:!0}},beforeMount:function(){var e,t;this.options&&(this.options.sparcApi&&this.settingsStore.updateSparcAPI(this.options.sparcApi),this.options.algoliaIndex&&this.settingsStore.updateAlgoliaIndex(this.options.algoliaIndex),this.options.algoliaKey&&this.settingsStore.updateAlgoliaKey(this.options.algoliaKey),this.options.algoliaId&&this.settingsStore.updateAlgoliaId(this.options.algoliaId),this.options.pennsieveApi&&this.settingsStore.updatePennsieveApi(this.options.pennsieveApi),this.options.flatmapAPI&&this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI),this.options.nlLinkPrefix&&this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix),this.options.rootUrl&&this.settingsStore.updateRootUrl(this.options.rootUrl)),this.settingsStore.updateAllClosable(this.allClosable),(e=this.splitFlowStore)==null||e.reset(),(t=this.splitFlowStore)==null||t.getAvailableTerms(this.settingsStore.sparcApi)},mounted:async function(){$e.on("updateShareLinkRequested",e=>{this.$emit("updateShareLinkRequested",e)}),$e.on("trackEvent",e=>{this.$emit("trackEvent",e)}),this.state||(this.initialState=await C5e(this.startingMap,this.options.sparcApi)),$e.on("mapLoaded",e=>{this.displaySearchFromQuery&&setTimeout(()=>{this.$refs.flow.onDisplaySearch({term:this.displaySearchFromQuery}),this.displaySearchFromQuery=""}),this.$emit("mapLoaded",e)}),this.isReady=!0,this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog),this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar),this.settingsStore.updateAnnotationSidebar(this.annotationSidebar)}},sGe={ref:"MapApp",class:"mapcontent","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"};function lGe(e,t,n,o,a,i){const s=r.resolveComponent("map-svg-sprite-color"),l=KK,c=wc;return r.withDirectives((r.openBlock(),r.createElementBlock("div",sGe,[r.createVNode(s),e.isReady?(r.openBlock(),r.createBlock(l,{key:0,onOnFullscreen:i.onFullscreen,state:i.stateToSet,ref:"flow",onVnodeMounted:i.flowMounted},null,8,["onOnFullscreen","state","onVnodeMounted"])):r.createCommentVNode("",!0)])),[[c,!e.isReady]])}const cGe=tr(iGe,[["render",lGe],["__scopeId","data-v-5b0fdea8"]]),Rp=function(e){return e?[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t)):[]},v5=[],GK=async function(e,t){const n=t.filter(i=>v5.some(s=>s.taxon===i)),o=v5.filter(i=>n.includes(i.taxon)),a=t.filter(i=>!n.includes(i));if(a.length){const i=await e.queryLabels(a);if(i.length)return i.forEach(s=>{let{entity:l,label:c}=s;c==="Mammalia"&&(c="Mammalia not otherwise specified");const d={taxon:l,label:c};o.push(d),v5.push(d)}),o}else return o},b5=function(e,t){if(!e||!t)return!1;let n=JSON.stringify(e),o=JSON.stringify(t);return n.indexOf(o)!==-1},Yd=(e,t)=>{const n=e.name??e,o=t.name??t,a=n.toUpperCase(),i=o.toUpperCase();return a<i?-1:a>i?1:0};let WK=function(){this.initialise=function(e){this.flatmapAPI=e,this.destinations=[],this.origins=[],this.components=[],this.rawURLs=[],this.controller=void 0,this.uberons=[],this.lookUp=[],this.connectivitySource="map",this.noMapConnectivity=!1},this.createTooltipData=async function(e,t){let n=[];t.feature.hyperlinks&&t.feature.hyperlinks.length>0?n=t.feature.hyperlinks:n=this.rawURLs;let o;if(t.provenanceTaxonomy){o=[];try{const i=await GK(e,t.provenanceTaxonomy);i.length&&i.forEach(s=>{const{label:l}=s;o.push(l)})}catch(i){console.log(i)}}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:t.label,featureId:t.resource,hyperlinks:n,provenanceTaxonomy:t.provenanceTaxonomy,provenanceTaxonomyLabel:o,connectivitySource:this.connectivitySource,noMapConnectivity:this.noMapConnectivity}},this.updateTooltipData=function(e){return{...e,origins:this.origins,originsWithDatasets:this.originsWithDatasets,components:this.components,componentsWithDatasets:this.componentsWithDatasets,destinations:this.destinations,destinationsWithDatasets:this.destinationsWithDatasets,connectivitySource:this.connectivitySource,noMapConnectivity:this.noMapConnectivity}},this.createComponentsLabelList=function(e,t){let n=[];return e.forEach(o=>{n.push(this.createLabelFromNeuralNode(o[0]),t),o.length===2&&n.push(this.createLabelFromNeuralNode(o[1]),t)}),n},this.createLabelLookup=function(e,t){return new Promise(async n=>{let o={};this.uberons=[];const a=await GK(e,t);a.length&&(a.forEach(i=>{const{taxon:s,label:l}=i;o[s]=l,this.uberons.push({id:s,name:l})}),n(o))})},this.buildConnectivitySqlStatement=function(e){let t="select knowledge from knowledge where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let n in e)t+=`'${e[n]}'${n>=e.length-1?")":","} `;return t},this.buildLabelSqlStatement=function(e){let t="select entity, label from labels where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let n in e)t+=`'${e[n]}'${n>=e.length-1?")":","} `;return t},this.findAllIdsFromConnectivity=function(e){let t=e.connectivity.flat(),n=[...new Set(t)],o=[];return n.forEach(a=>{Array.isArray(a)?o.push(a.flat()):o.push(a)}),[...new Set(o.flat())]},this.flattenConnectivity=function(e){let t=e.flat(),n=[...new Set(t)],o=[];return n.forEach(a=>{Array.isArray(a)?o.push(a.flat()):o.push(a)}),o.flat()},this.findComponents=function(e,t,n,o){let a=e.connectivity.flat(),i=Rp(a),s=[],l=!1;return i.forEach(c=>{l=!1,b5(t,c)&&(l=!0),o&&b5(o,c)&&(l=!0),b5(n,c)&&(l=!0),l||s.push(c)}),s},this.retrieveFlatmapKnowledgeForEvent=async function(e,t){this.controller&&this.controller.abort(),this.controller=new AbortController,this.controller.signal;const n=t.resource;if(this.destinations=[],this.origins=[],this.components=[],this.rawURLs=[],!n||n.length===0||!n[0])return;let o=this.queryForConnectivityNew(e,n[0]);return await Promise.all([o])},this.queryForConnectivityNew=function(e,t,n="map",o=!0){return this.connectivitySource=n,new Promise(a=>{(n==="map"?this.queryMapConnectivity(e.mapMetadata.uuid,t):e.queryKnowledge(t)).then(s=>{if(this.checkConnectivityExists(s)){n==="map"&&(this.noMapConnectivity=!1);let l=s;o?this.processConnectivity(e,l).then(c=>{s.references&&(this.rawURLs=[...s.references]),a(c)}):a(l)}else n==="map"?(this.connectivitySource="sckan",this.noMapConnectivity=!0,e.queryKnowledge(t).then(l=>{if(this.checkConnectivityExists(l)){let c=l;o?this.processConnectivity(e,c).then(d=>{l.references&&(this.rawURLs=[...l.references]),a(d)}):a(c)}else a(!1)}).catch(()=>a(!1))):a(!1)}).catch(s=>{s.name==="AbortError"||console.warn(`Unable to get the knowledge for the entity ${t}.`),a(!1)})})},this.queryMapConnectivity=async function(e,t){const n=this.flatmapAPI+`flatmap/${e}/connectivity/${t}`;try{const o=await fetch(n);if(!o.ok)throw new Error(`Response status: ${o.status}`);return await o.json()}catch(o){throw new Error(o)}},this.queryForConnectivity=function(e,t,n,o=!0){const a={sql:this.buildConnectivitySqlStatement(t)},i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a),...n?{signal:n}:{}};return new Promise(s=>{fetch(`${this.flatmapAPI}knowledge/query/`,i).then(l=>l.json()).then(l=>{if(this.connectivityExists(l)){let c=JSON.parse(l.values[0][0]);o?this.processConnectivity(e,c).then(d=>{s(d)}):s(c)}else s(!1)}).catch(l=>{l.name==="AbortError"||console.error("Error:",l),s(!1)})})},this.checkConnectivityExists=function(e){var t;return e&&((t=e.connectivity)==null?void 0:t.length)},this.connectivityExists=function(e){return!!(e.values&&e.values.length>0&&JSON.parse(e.values[0][0]).connectivity&&JSON.parse(e.values[0][0]).connectivity.length>0)},this.findIfNodeIsSingle=function(e){return e.length===1?(console.error("Server returns a single node",e),e[0]):e.length===2&&e[1].length===0?e[0]:!1},this.createLabelFromNeuralNode=function(e,t){let n=this.findIfNodeIsSingle(e);if(n)return t[n];let o=t[e[0]];return e.length===2&&e[1].length>0&&e[1].forEach(a=>{t[a]==null?o+=`, ${a}`:o+=`, ${t[a]}`}),o},this.flattenAndFindDatasets=function(e,t,n){let o=this.flattenConnectivity(e),a=this.flattenConnectivity(t),i=this.flattenConnectivity(n);this.originsWithDatasets=this.uberons.filter(s=>o.indexOf(s.id)!==-1).sort(Yd),this.componentsWithDatasets=this.uberons.filter(s=>a.indexOf(s.id)!==-1).sort(Yd),this.destinationsWithDatasets=this.uberons.filter(s=>i.indexOf(s.id)!==-1).sort(Yd)},this.processConnectivity=function(e,t){return new Promise(n=>{let o=[],a=[],i;if(t&&t["node-phenotypes"]){const c=["ilxtr:hasSomaLocatedIn"],d=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"];c.forEach(u=>{u in t["node-phenotypes"]&&o.push(...t["node-phenotypes"][u])}),o=Rp(o),d.forEach(u=>{u in t["node-phenotypes"]&&a.push(...t["node-phenotypes"][u])}),a=Rp(a)}else a=Rp(t.axons),t.somas&&t.somas.length>0&&o.push(...t.somas),t.dendrites&&t.dendrites.length>0&&o.push(...t.dendrites),o=Rp(o),i=t.somas;const s=this.findComponents(t,a,o,i),l=this.findAllIdsFromConnectivity(t);this.createLabelLookup(e,l).then(c=>{this.origins=o.map(d=>this.createLabelFromNeuralNode(d,c)).sort(Yd),this.components=s.map(d=>this.createLabelFromNeuralNode(d,c)).sort(Yd),this.destinations=a.map(d=>this.createLabelFromNeuralNode(d,c)).sort(Yd),this.flattenAndFindDatasets(o,s,a),n({ids:{dendrites:o,components:s,axons:a},labels:{origins:this.origins,components:this.components,destinations:this.destinations}})})})},this.buildPubmedSqlStatement=function(e){let t="select distinct publication from publications where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let n in e)t+=`'${e[n]}'${n>=e.length-1?")":","} `;return t},this.buildPubmedSqlStatementForModels=function(e){return`select distinct publication from publications where entity = '${e}'`},this.queryKnowledge=async(e,t)=>{const n=`${this.flatmapAPI}/knowledge/query/`,a=await fetch(n,{method:"POST",headers:{Accept:"application/json"},body:JSON.stringify({sql:e,params:t})});if(!a.ok)throw new Error(`Cannot access ${n}`);const i=await a.json();if("error"in i)throw new TypeError(i.error);return i.values}};const XK=[{id:0,nerve_id:"ILX:0793723",label:"Auriculotemporal nerve","FMA subclasses (in human nerves)":["FMA:53002","FMA:53001"],"subclass labels":["Left auriculotemporal nerve","Right auriculotemporal nerve"]},{id:1,nerve_id:"ILX:0792409",label:"gray communicating ramus of tenth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6895","FMA:6894"],"subclass labels":["Left T10 grey ramus communicans","Right T10 grey ramus communicans"]},{id:2,nerve_id:"UBERON:0011326",label:"superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53530","FMA:53536"],"subclass labels":["Right superior laryngeal nerve","Left superior laryngeal nerve"]},{id:3,nerve_id:"ILX:0793220",label:"white communicating ramus of first lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:4,nerve_id:"ILX:0787082",label:"gray communicating ramus of the first thoracic nerve","FMA subclasses (in human nerves)":["FMA:6082","FMA:6084"],"subclass labels":["Right T1 grey ramus communicans","Left T1 grey ramus communicans"]},{id:5,nerve_id:"ILX:0793809",label:"Clitoral cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:6,nerve_id:"UBERON:0011096",label:"lacrimal nerve","FMA subclasses (in human nerves)":["FMA:52630","FMA:52629"],"subclass labels":["Left lacrimal nerve","Right lacrimal nerve"]},{id:7,nerve_id:"ILX:0793215",label:"white communicating ramus of ninth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:8,nerve_id:"ILX:0795005",label:"Posterior cutaneous nerve of arm","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:9,nerve_id:"UBERON:0001649",label:"glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:50894","FMA:50892"],"subclass labels":[]},{id:10,nerve_id:"UBERON:0022302",label:"short ciliary nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:11,nerve_id:"ILX:0785932",label:"gray communicating ramus of third lumbar nerve","FMA subclasses (in human nerves)":["FMA:65920","FMA:65919"],"subclass labels":["Left L3 grey ramus communicans","Right L3 grey ramus communicans"]},{id:12,nerve_id:"ILX:0738293",label:"Ganglioglomerular nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:13,nerve_id:"ILX:0739298",label:"gray communicating ramus of twelfth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:14,nerve_id:"UBERON:0001492",label:"radial nerve","FMA subclasses (in human nerves)":["FMA:37070","FMA:37071"],"subclass labels":["Right radial nerve","Left radial nerve"]},{id:15,nerve_id:"ILX:0793214",label:"white communicating ramus of eighth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:16,nerve_id:"UBERON:0018681",label:"lesser splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6957","FMA:6958"],"subclass labels":["Right lesser splanchnic nerve","Left lesser splanchnic nerve"]},{id:17,nerve_id:"ILX:0794476",label:"abdominal branch of vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:18,nerve_id:"ILX:0791105",label:"gray communicating ramus of the second thoracic nerve","FMA subclasses (in human nerves)":["FMA:6122","FMA:6757"],"subclass labels":["Right T2 grey ramus communicans","Left T2 grey ramus communicans"]},{id:19,nerve_id:"ILX:0794853",label:"esophageal vagus trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:20,nerve_id:"ILX:0793210",label:"white communicating ramus of fourth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:21,nerve_id:"UBERON:0001759",label:"vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:22,nerve_id:"UBERON:0009675",label:"chorda tympani branch of facial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:23,nerve_id:"ILX:0794949",label:"recurrent branch of the median nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:24,nerve_id:"ILX:0789339",label:"Pharyngeal branch of glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:53495","FMA:53494"],"subclass labels":["Pharyngeal branch of left glossopharyngeal nerve","Pharyngeal branch of right glossopharyngeal nerve"]},{id:25,nerve_id:"ILX:0793712",label:"Zygomatic nerve","FMA subclasses (in human nerves)":["FMA:52968","FMA:52969"],"subclass labels":["Right zygomatic nerve","Left zygomatic nerve"]},{id:26,nerve_id:"ILX:0788536",label:"gray communicating ramus of fourth lumbar nerve","FMA subclasses (in human nerves)":["FMA:65917","FMA:65918"],"subclass labels":["Right L4 grey ramus communicans","Left L4 grey ramus communicans"]},{id:27,nerve_id:"UBERON:0018680",label:"greater splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6956","FMA:6955"],"subclass labels":["Right greater splanchnic nerve","Left greater splanchnic nerve"]},{id:28,nerve_id:"UBERON:0001322",label:"sciatic nerve","FMA subclasses (in human nerves)":["FMA:22111","FMA:22112"],"subclass labels":["Right sciatic nerve","Left sciatic nerve"]},{id:29,nerve_id:"ILX:0793209",label:"white communicating ramus of third thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:30,nerve_id:"UBERON:0011391",label:"perineal nerve","FMA subclasses (in human nerves)":["FMA:21874","FMA:21873"],"subclass labels":["Left perineal nerve","Right perineal nerve"]},{id:31,nerve_id:"ILX:0788945",label:"gray communicating ramus of the fourth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6759","FMA:6758"],"subclass labels":["Right T4 grey ramus communicans","Left T4 grey ramus communicans"]},{id:32,nerve_id:"ILX:0790497",label:"Gray communicating ramus of cervicothoracic ganglion to first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:33,nerve_id:"UBERON:0001323",label:"tibial nerve","FMA subclasses (in human nerves)":["FMA:22109","FMA:22110"],"subclass labels":["Right tibial nerve","Left tibial nerve"]},{id:34,nerve_id:"ILX:0794969",label:"deep branch of ulnar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:35,nerve_id:"ILX:0793227",label:"gray communicating ramus of thirteenth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:36,nerve_id:"ILX:0793228",label:"gray communicating ramus of first sacral nerve","FMA subclasses (in human nerves)":["FMA:65992","FMA:65991"],"subclass labels":["Left S1 grey ramus communicans","Right S1 grey ramus communicans"]},{id:37,nerve_id:"UBERON:0035111",label:"medial plantar nerve","FMA subclasses (in human nerves)":["FMA:45435","FMA:45434"],"subclass labels":["Left medial plantar nerve","Right medial plantar nerve"]},{id:38,nerve_id:"UBERON:0001780",label:"spinal nerve","FMA subclasses (in human nerves)":["FMA:6117","FMA:6435","FMA:6295","FMA:6422","FMA:6417","FMA:6421","FMA:6038","FMA:6292","FMA:6439","FMA:6313","FMA:6410","FMA:6412","FMA:6088","FMA:6298","FMA:6433","FMA:6411","FMA:6438","FMA:6314","FMA:6291","FMA:6420","FMA:6116","FMA:6413","FMA:6310","FMA:6432","FMA:6305","FMA:6182","FMA:6297","FMA:6436","FMA:6418","FMA:6039","FMA:6089","FMA:6301","FMA:6294","FMA:6303","FMA:6183","FMA:6434","FMA:6429","FMA:6308","FMA:6300","FMA:6430","FMA:6428","FMA:6419","FMA:6437","FMA:6307","FMA:6311","FMA:6431"],"subclass labels":["Left T3 spinal nerve","Left S4 spinal nerve","Left T5 spinal nerve","Left L5 spinal nerve","Right L3 spinal nerve","Right L5 spinal nerve","Right T1 spinal nerve","Left T4 spinal nerve","Left coccygeal spinal nerve","Right T11 spinal nerve","Right L1 spinal nerve","Right L2 spinal nerve","Right T2 spinal nerve","Left T6 spinal nerve","Left S3 spinal nerve","Left L1 spinal nerve","Right coccygeal spinal nerve","Left T11 spinal nerve","Right T4 spinal nerve","Left L4 spinal nerve","Right T3 spinal nerve","Left L2 spinal nerve","Right T10 spinal nerve","Right S3 spinal nerve","Left T8 spinal nerve","Right T12 spinal nerve","Right T6 spinal nerve","Right S5 spinal nerve","Left L3 spinal nerve","Left T1 spinal nerve","Left T2 spinal nerve","Left T7 spinal nerve","Right T5 spinal nerve","Right T8 spinal nerve","Left T12 spinal nerve","Right S4 spinal nerve","Left S1 spinal nerve","Left T9 spinal nerve","Right T7 spinal nerve","Right S2 spinal nerve","Right S1 spinal nerve","Right L4 spinal nerve","Left S5 spinal nerve","Right T9 spinal nerve","Left T10 spinal nerve","Left S2 spinal nerve"]},{id:39,nerve_id:"UBERON:0018683",label:"lumbar splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6925","FMA:6930","FMA:6927","FMA:6926"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Left first lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left second lumbar splanchnic nerve","Right second lumbar splanchnic nerve"]},{id:40,nerve_id:"UBERON:0001643",label:"oculomotor nerve","FMA subclasses (in human nerves)":["FMA:50880","FMA:50879"],"subclass labels":["Left oculomotor nerve","Right oculomotor nerve"]},{id:41,nerve_id:"ILX:0793212",label:"white communicating ramus of sixth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:42,nerve_id:"UBERON:0003724",label:"musculocutaneous nerve","FMA subclasses (in human nerves)":["FMA:37066","FMA:37065"],"subclass labels":["Left musculocutaneous nerve","Right musculocutaneous nerve"]},{id:43,nerve_id:"ILX:0738372",label:"white communicating ramus of first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:44,nerve_id:"ILX:0793563",label:"splenic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:45,nerve_id:"UBERON:0035526",label:"superficial fibular nerve","FMA subclasses (in human nerves)":["FMA:45363","FMA:45364"],"subclass labels":["Right superficial fibular nerve","Left superficial fibular nerve"]},{id:46,nerve_id:"ILX:0791560",label:"gray communicating ramus of eighth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6891","FMA:6890"],"subclass labels":["Left T8 grey ramus communicans","Right T8 grey ramus communicans"]},{id:47,nerve_id:"ILX:0793827",label:"posterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:48,nerve_id:"ILX:0794141",label:"right cervical vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:49,nerve_id:"ILX:0793714",label:"Mesenteric nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:50,nerve_id:"UBERON:0001964",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:51,nerve_id:"UBERON:0001267",label:"femoral nerve","FMA subclasses (in human nerves)":["FMA:16499","FMA:16500"],"subclass labels":["Right femoral nerve","Left femoral nerve"]},{id:52,nerve_id:"UBERON:0034984",label:"nerve to quadratus femoris","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:53,nerve_id:"UBERON:0003721",label:"lingual nerve","FMA subclasses (in human nerves)":["FMA:53219","FMA:53220"],"subclass labels":["Right lingual nerve","Left lingual nerve"]},{id:54,nerve_id:"UBERON:0036216",label:"tympanic nerve","FMA subclasses (in human nerves)":["FMA:53481","FMA:53482"],"subclass labels":["Right tympanic nerve","Left tympanic nerve"]},{id:55,nerve_id:"ILX:0793216",label:"white communicating ramus of tenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:56,nerve_id:"ILX:0793362",label:"White communicating ramus of fourth lumbar anterior ramus","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:57,nerve_id:"ILX:0793561",label:"Internal branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53539","FMA:53540"],"subclass labels":["Right internal laryngeal nerve","Left internal laryngeal nerve"]},{id:58,nerve_id:"ILX:0738312",label:"Aortic arch depressor nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:59,nerve_id:"ILX:0793218",label:"white communicating ramus of twelfth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:60,nerve_id:"ILX:0738308",label:"External branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:61,nerve_id:"ILX:0739299",label:"gray communicating ramus of sixth lumbar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:62,nerve_id:"ILX:0793559",label:"bladder nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:63,nerve_id:"ILX:0793822",label:"Superior ovarian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:64,nerve_id:"ILX:0793807",label:"Penile cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:65,nerve_id:"UBERON:0011390",label:"pudendal nerve","FMA subclasses (in human nerves)":["FMA:21863","FMA:21864"],"subclass labels":["Right pudendal nerve","Left pudendal nerve"]},{id:66,nerve_id:"UBERON:0008810",label:"nasopalatine nerve","FMA subclasses (in human nerves)":["FMA:52799","FMA:52798"],"subclass labels":["Left nasopalatine nerve","Right nasopalatine nerve"]},{id:67,nerve_id:"ILX:0793219",label:"white communicating ramus of thirteenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:68,nerve_id:"ILX:0793632",label:"lumbar colonic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:69,nerve_id:"ILX:0784439",label:"gray communicating ramus of the fifth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6760","FMA:6761"],"subclass labels":["Left T5 grey ramus communicans","Right T5 grey ramus communicans"]},{id:70,nerve_id:"ILX:0794977",label:"deep branch of radial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:71,nerve_id:"UBERON:0001884",label:"phrenic nerve","FMA subclasses (in human nerves)":["FMA:6193","FMA:6192"],"subclass labels":["Left phrenic nerve","Right phrenic nerve"]},{id:72,nerve_id:"UBERON:0035110",label:"lateral plantar nerve","FMA subclasses (in human nerves)":["FMA:45450","FMA:45451"],"subclass labels":["Right lateral plantar nerve","Left lateral plantar nerve"]},{id:73,nerve_id:"ILX:0793711",label:"Communicating branch of zygomatic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:74,nerve_id:"ILX:0793560",label:"External branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53537","FMA:53538"],"subclass labels":["Right external laryngeal nerve","Left external laryngeal nerve"]},{id:75,nerve_id:"ILX:0738309",label:"Internal branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:76,nerve_id:"UBERON:0001021",label:"nerve","FMA subclasses (in human nerves)":["FMA:6775","FMA:6894","FMA:6784","FMA:6728","FMA:65325","FMA:21873","FMA:45429","FMA:6844","FMA:53609","FMA:7116","FMA:44770","FMA:8916","FMA:52995","FMA:6071","FMA:45309","FMA:6122","FMA:6892","FMA:6767","FMA:16405","FMA:53560","FMA:6092","FMA:65343","FMA:37066","FMA:8894","FMA:8868","FMA:65341","FMA:53559","FMA:8897","FMA:82956","FMA:20633","FMA:6763","FMA:65339","FMA:8829","FMA:16493","FMA:8817","FMA:8821","FMA:11757","FMA:45456","FMA:45422","FMA:11261","FMA:65388","FMA:6192","FMA:65347","FMA:37068","FMA:65995","FMA:6764","FMA:39081","FMA:45338","FMA:53402","FMA:11210","FMA:52644","FMA:37067","FMA:65313","FMA:11153","FMA:6155","FMA:8797","FMA:53302","FMA:8883","FMA:53067","FMA:52939","FMA:53301","FMA:292889","FMA:45423","FMA:8791","FMA:45380","FMA:11759","FMA:7305","FMA:8830","FMA:78650","FMA:65389","FMA:45387","FMA:8827","FMA:8912","FMA:52941","FMA:6743","FMA:7126","FMA:53485","FMA:16492","FMA:53399","FMA:65337","FMA:11209","FMA:6772","FMA:52726","FMA:6121","FMA:52627","FMA:52974","FMA:53571","FMA:6729","FMA:8729","FMA:53606","FMA:80025","FMA:53481","FMA:53575","FMA:45451","FMA:11218","FMA:22109","FMA:6852","FMA:8909","FMA:11751","FMA:65991","FMA:8836","FMA:65350","FMA:53423","FMA:65569","FMA:65314","FMA:82957","FMA:65438","FMA:39146","FMA:8911","FMA:22111","FMA:65916","FMA:65739","FMA:65917","FMA:6779","FMA:8889","FMA:65924","FMA:65316","FMA:53002","FMA:16887","FMA:53366","FMA:6890","FMA:8790","FMA:6730","FMA:45358","FMA:52716","FMA:53494","FMA:7115","FMA:53561","FMA:78655","FMA:45366","FMA:11219","FMA:11555","FMA:7092","FMA:53220","FMA:45428","FMA:6193","FMA:20604","FMA:45433","FMA:21874","FMA:21875","FMA:53244","FMA:45432","FMA:6770","FMA:52640","FMA:11249","FMA:20630","FMA:53308","FMA:11216","FMA:65399","FMA:78649","FMA:11084","FMA:6897","FMA:53633","FMA:6085","FMA:6851","FMA:45457","FMA:6757","FMA:8732","FMA:8824","FMA:20632","FMA:6137","FMA:52730","FMA:7301","FMA:52699","FMA:53607","FMA:7300","FMA:53576","FMA:44904","FMA:65342","FMA:7127","FMA:6737","FMA:52669","FMA:21876","FMA:45425","FMA:65999","FMA:8728","FMA:21871","FMA:55172","FMA:6149","FMA:45453","FMA:44932","FMA:292832","FMA:6744","FMA:6781","FMA:44769","FMA:45326","FMA:6760","FMA:53634","FMA:53605","FMA:53530","FMA:6821","FMA:52968","FMA:53001","FMA:11552","FMA:45264","FMA:8835","FMA:6888","FMA:55160","FMA:44899","FMA:52979","FMA:45333","FMA:45310","FMA:6084","FMA:11781","FMA:82962","FMA:53280","FMA:52715","FMA:53311","FMA:16491","FMA:21880","FMA:44952","FMA:11687","FMA:11212","FMA:65335","FMA:52940","FMA:6774","FMA:8823","FMA:45388","FMA:6666","FMA:6072","FMA:16886","FMA:53312","FMA:65915","FMA:45357","FMA:11262","FMA:65921","FMA:0328826","FMA:81290","FMA:53279","FMA:11551","FMA:7293","FMA:6677","FMA:11756","FMA:53598","FMA:52732","FMA:44902","FMA:53545","FMA:6740","FMA:53502","FMA:53562","FMA:52700","FMA:7122","FMA:6118","FMA:65918","FMA:8814","FMA:16403","FMA:65346","FMA:6667","FMA:52630","FMA:52629","FMA:8871","FMA:16500","FMA:52725","FMA:6108","FMA:45363","FMA:65340","FMA:8872","FMA:11760","FMA:53604","FMA:11214","FMA:52777","FMA:21864","FMA:53503","FMA:6738","FMA:66000","FMA:6776","FMA:6777","FMA:6765","FMA:6111","FMA:8890","FMA:20607","FMA:52643","FMA:8908","FMA:65437","FMA:6762","FMA:11154","FMA:65344","FMA:52937","FMA:8919","FMA:45354","FMA:6766","FMA:53424","FMA:6145","FMA:65568","FMA:20634","FMA:6732","FMA:8893","FMA:11758","FMA:6889","FMA:11554","FMA:65922","FMA:7118","FMA:16884","FMA:45308","FMA:7290","FMA:6758","FMA:65743","FMA:11063","FMA:16885","FMA:8882","FMA:65286","FMA:291238","FMA:53482","FMA:52976","FMA:11308","FMA:53432","FMA:53540","FMA:45379","FMA:44871","FMA:6714","FMA:82955","FMA:65993","FMA:45452","FMA:52626","FMA:6083","FMA:53582","FMA:65919","FMA:52936","FMA:53506","FMA:8918","FMA:44901","FMA:6073","FMA:65315","FMA:53219","FMA:11194","FMA:6792","FMA:7119","FMA:52785","FMA:7296","FMA:53068","FMA:6845","FMA:52677","FMA:53504","FMA:53548","FMA:52698","FMA:53570","FMA:6771","FMA:7078","FMA:65997","FMA:65338","FMA:52969","FMA:16401","FMA:65416","FMA:6835","FMA:39082","FMA:8726","FMA:45254","FMA:8879","FMA:11250","FMA:53049","FMA:45382","FMA:8795","FMA:53495","FMA:45434","FMA:82963","FMA:0328827","FMA:52656","FMA:82961","FMA:11753","FMA:39147","FMA:45339","FMA:20605","FMA:20631","FMA:8898","FMA:6070","FMA:44892","FMA:16404","FMA:52942","FMA:6082","FMA:8861","FMA:82953","FMA:8808","FMA:8805","FMA:52994","FMA:65348","FMA:55173","FMA:7129","FMA:52674","FMA:44894","FMA:55159","FMA:65327","FMA:37320","FMA:6761","FMA:65349","FMA:11253","FMA:53507","FMA:11213","FMA:7307","FMA:6769","FMA:6759","FMA:55155","FMA:53675","FMA:53599","FMA:65282","FMA:53251","FMA:6731","FMA:11111","FMA:16497","FMA:8878","FMA:11211","FMA:65740","FMA:45367","FMA:53588","FMA:45365","UBERON:0011766","FMA:16502","FMA:6891","FMA:6091","FMA:11018","FMA:6090","FMA:292887","FMA:65401","FMA:65326","FMA:11215","FMA:44735","FMA:8735","FMA:53538","FMA:6849","FMA:53608","FMA:11217","FMA:8860","FMA:6134","FMA:6893","FMA:53534","FMA:45361","FMA:37321","FMA:82734","FMA:22112","FMA:7294","FMA:52987","FMA:65247","FMA:53535","FMA:6895","FMA:52787","FMA:53635","FMA:65920","FMA:55156","FMA:16498","FMA:53569","FMA:6739","FMA:8807","FMA:22110","FMA:81294","FMA:45450","FMA:8922","FMA:8725","FMA:20608","FMA:7308","FMA:65281","FMA:39084","FMA:78656","FMA:6133","FMA:53581","FMA:16494","FMA:53252","FMA:11789","FMA:45364","FMA:65345","FMA:44870","FMA:39083","FMA:45355","FMA:11193","FMA:16400","FMA:81287","FMA:52776","FMA:65747","FMA:8900","UBERON:0011767","FMA:45424","FMA:292830","FMA:44734","FMA:45381","FMA:82960","FMA:0328831","FMA:6689","FMA:7077","FMA:291236","FMA:8886","FMA:276381","FMA:6124","FMA:65336","FMA:65328","FMA:52670","FMA:53537","FMA:53636","FMA:6896","FMA:21879","FMA:8798","FMA:81288","FMA:53542","FMA:45368","FMA:53547","FMA:55157","FMA:65415","FMA:53309","FMA:65744","FMA:53367","FMA:53590","FMA:65923","FMA:53048","FMA:16499","FMA:53610","FMA:44951","FMA:44953","FMA:8832","FMA:45426","FMA:6114","FMA:52799","FMA:11039","FMA:53546","FMA:53589","FMA:8901","FMA:11681","FMA:52639","FMA:8905","FMA:52733","FMA:65992","FMA:52807","FMA:45435","FMA:53484","FMA:52975","FMA:7289","FMA:44905","FMA:37071","FMA:7130","FMA:65996","FMA:6132","FMA:8826","FMA:6741","FMA:11252","FMA:8917","FMA:82954","FMA:6832","FMA:37073","FMA:37074","FMA:44893","FMA:82959","FMA:20635","FMA:6093","FMA:65248","FMA:45362","FMA:52622","FMA:53508","FMA:11755","FMA:82958","FMA:52997","FMA:16501","FMA:65402","FMA:45427","FMA:52803","FMA:16402","FMA:8734","FMA:52784","FMA:45454","FMA:6736","FMA:7304","FMA:6742","FMA:52998","FMA:52804","FMA:11788","FMA:6713","FMA:52623","FMA:53536","FMA:11780","FMA:45334","FMA:52701","FMA:65998","FMA:11092","FMA:6684","FMA:52779","FMA:52778","FMA:78652","FMA:0328830","FMA:6733","FMA:44950","FMA:78653","FMA:45455","FMA:8864","FMA:8833","FMA:8876","FMA:8867","FMA:11752","FMA:53541","FMA:53611","FMA:8904","FMA:6745","FMA:21863","FMA:7297","FMA:52676","FMA:52798","FMA:8818","FMA:82735","FMA:52657","FMA:52786","FMA:6773","FMA:45253","FMA:6127","FMA:45263","FMA:8875","FMA:81295","FMA:11754","FMA:8812","FMA:45311","FMA:53568","FMA:276379","FMA:6842","FMA:8794","FMA:8820","FMA:53572","FMA:53409","FMA:37070","FMA:6119","FMA:53433","FMA:7123","FMA:8811","FMA:65444","FMA:52806","FMA:53245","FMA:65285","FMA:6768","FMA:8731","FMA:11220","FMA:6778","FMA:53509","FMA:55158","FMA:53567","FMA:65994","FMA:53539","FMA:45327","FMA:8865","FMA:44898","FMA:52673","FMA:80026","FMA:52980","FMA:53505","FMA:82952","FMA:21872","FMA:37065","FMA:52988","FMA:8815","FMA:53398","FMA:52729","FMA:81289","FMA:65398","FMA:52977","FMA:8887"],"subclass labels":["Left T9 white ramus communicans","Right T10 grey ramus communicans","Right T4 spinal nerve posterior ramus","Right fourth intercostal nerve","Right anterior interosseous nerve","Right perineal nerve","Left lateral calcaneal branch A of left sural nerve","Right C3 spinal nerve posterior ramus medial branch","Oesophageal branch of left recurrent laryngeal nerve","Anterior branch of lateral cutaneous branch of left third intercostal nerve","Left common plantar digital nerve F","Anterior cutaneous branch of right subcostal nerve","Left superior labial branch of infraorbital nerve","Left T1 spinal nerve posterior ramus","Anterior branch of left obturator nerve","Right T2 grey ramus communicans","Right T9 grey ramus communicans","Left T5 white ramus communicans","Left L3 spinal nerve posterior ramus lateral branch","Communicating branch of left vagus nerve with left glossopharyngeal nerve","Right second intercostal nerve","Right proper palmar digital nerve G","Left musculocutaneous nerve","Anterior cutaneous branch of left ninth intercostal nerve","Posterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve H","Communicating branch of right vagus nerve with right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right proper plantar digital nerve C","Left genital branch of genitofemoral nerve","Left T6 grey ramus communicans","Right proper palmar digital nerve I","Right T12 spinal nerve posterior ramus","Right ilioinguinal nerve","Right T8 spinal nerve posterior ramus","Left T9 spinal nerve posterior ramus","Right T11 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve J","Right medial sural cutaneous nerve","Right T6 spinal nerve posterior ramus medial branch","Right lesser occipital nerve","Right phrenic nerve","Right proper palmar digital nerve E","Left median nerve","Right S3 grey ramus communicans","Right T4 white ramus communicans","Right medial cutaneous nerve of forearm","Right posterior femoral cutaneous nerve","Right vestibular nerve","Lateral cutaneous branch of left sixth intercostal nerve","Left supratrochlear nerve","Right median nerve","Anterior branch of right medial cutaneous nerve of forearm","Right T5 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of right third intercostal nerve","Right C6 spinal nerve posterior ramus","Temporal branch of left facial nerve","Anterior cutaneous branch of left eighth intercostal nerve","Right buccal nerve","Right middle superior alveolar nerve","Temporal branch of right facial nerve","Left superficial branch of radial nerve","Left medial sural cutaneous nerve","Left C4 spinal nerve posterior ramus","Left lateral dorsal digital nerve of the third toe","Right T12 spinal nerve posterior ramus lateral branch","Anterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Left T12 spinal nerve posterior ramus","Left anterior supraclavicular nerve","Left lesser occipital nerve","Right deep fibular nerve","Left T11 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right anterior superior alveolar nerve","Left tenth intercostal nerve","Anterior branch of lateral cutaneous branch of right fourth intercostal nerve","Communicating branch of left glossopharyngeal nerve with auricular branch of left vagus nerve","Left iliohypogastric nerve","Cervical branch of left facial nerve","Right proper palmar digital nerve J","Lateral cutaneous branch of right sixth intercostal nerve","Right T8 white ramus communicans","Left maxillary nerve","Left intercostobrachial nerve","Left tentorial nerve","Right zygomaticotemporal nerve","Communicating branch of right internal laryngeal nerve with right recurrent laryngeal nerve","Left fourth intercostal nerve","Brachial plexus left C7 root","Vagal branch to right carotid body","Right proper plantar digital nerve G","Right tympanic nerve","Left lateral plantar nerve","Lateral cutaneous branch of left tenth intercostal nerve","Right tibial nerve","Left third occipital nerve","Anterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right T8 spinal nerve posterior ramus lateral branch","Right S1 grey ramus communicans","Left L3 spinal nerve posterior ramus","Palmar cutaneous branch of left ulnar nerve","Right greater petrosal nerve","Left subcostal nerve","Anterior branch of left medial cutaneous nerve of forearm","Left proper plantar digital nerve C","Left C3 spinal nerve branch to left supraclavicular nerve","Right posterior cutaneous nerve of forearm","Posterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right sciatic nerve","Left L5 grey ramus communicans","Right C4 spinal nerve posterior ramus medial branch","Right L4 grey ramus communicans","Left T11 white ramus communicans","Posterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left L1 grey ramus communicans","Posterior branch of left medial cutaneous nerve of forearm","Left auriculotemporal nerve","Left L2 white ramus communicans","Marginal mandibular branch of right facial nerve","Right T8 grey ramus communicans","Right C4 spinal nerve posterior ramus","Right fifth intercostal nerve","Left common fibular nerve","Left posterior ethmoidal nerve","Pharyngeal branch of right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right third intercostal nerve","Communicating branch of right external laryngeal nerve with right superior cardiac nerve","Right posterior supraclavicular nerve","Left medial dorsal cutaneous nerve","Lateral cutaneous branch of right eleventh intercostal nerve","Posterior branch of lateral cutaneous branch of left subcostal nerve","Anterior cutaneous branch of left second intercostal nerve","Left lingual nerve","Right lateral calcaneal branch A of right sural nerve","Left phrenic nerve","Right hypogastric nerve","Medial calcaneal branch A of left tibial nerve","Left perineal nerve","Right posterior scrotal nerve","Right inferior alveolar nerve","Medial calcaneal branch A of right tibial nerve","Right T7 white ramus communicans","Left frontal nerve","Right T1 spinal nerve posterior ramus medial branch","Right genitofemoral nerve","Zygomatic branch of right facial nerve","Lateral cutaneous branch of left ninth intercostal nerve","Left C2 spinal nerve branch to left great auricular nerve","Right anterior supraclavicular nerve","Lateral cutaneous branch of right fourth intercostal nerve","Left T11 grey ramus communicans","Lingual branch of right vagus nerve","Left T1 white ramus communicans","Left C3 spinal nerve posterior ramus medial branch","Left proper plantar digital nerve J","Left T2 grey ramus communicans","Brachial plexus left C6 root","Left T10 spinal nerve posterior ramus","Right genital branch of genitofemoral nerve","Anterior cutaneous branch of right first intercostal nerve","Left middle meningeal nerve","Anterior cutaneous branch of left eleventh intercostal nerve","Left infratrochlear nerve","Vagal branch to left carotid body","Anterior cutaneous branch of right eleventh intercostal nerve","Right proper palmar digital nerve B","Left proper palmar digital nerve H","Anterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left seventh intercostal nerve","Right nasociliary nerve","Left posterior scrotal nerve","Left sural nerve","Right S5 grey ramus communicans","Brachial plexus right C7 root","Right inferior rectal nerve","Right transverse cervical nerve","Anterior cutaneous branch of left third intercostal nerve","Left proper plantar digital nerve H","Superficial branch of left ulnar nerve","Dorsal branch of left ulnar nerve","Right eleventh intercostal nerve","Right T2 white ramus communicans","Right common plantar digital nerve F","Infrapatellar branch of right saphenous nerve","Left T5 grey ramus communicans","Lingual branch of left vagus nerve","Thoracic cardiac branch of left vagus nerve","Right superior laryngeal nerve","Right C2 spinal nerve posterior ramus","Right zygomatic nerve","Right auriculotemporal nerve","Anterior branch of lateral cutaneous branch of left subcostal nerve","Left saphenous nerve","Right L3 spinal nerve posterior ramus","Right T7 grey ramus communicans","Left great auricular nerve posterior branch","Left proper palmar digital nerve A","Right infraorbital nerve","Cutaneous branch of right obturator nerve","Posterior branch of right obturator nerve","Left T1 grey ramus communicans","Right T12 white ramus communicans","Right proper plantar digital nerve F","Left posterior auricular nerve","Right posterior ethmoidal nerve","Buccal branch of right facial nerve","Right iliohypogastric nerve","Left dorsal nerve of penis","Right inferior lateral cutaneous nerve of arm","Left T7 spinal nerve posterior ramus lateral branch","Lateral cutaneous branch of left seventh intercostal nerve","Right posterior interosseous nerve","Left middle superior alveolar nerve","Right T9 white ramus communicans","Right T10 spinal nerve posterior ramus","Left deep fibular nerve","Hepatic branch of anterior vagal trunk","Left first intercostal nerve","Right L2 white ramus communicans","Buccal branch of left facial nerve","Right L5 grey ramus communicans","Right common fibular nerve","Left T6 spinal nerve posterior ramus medial branch","Right L2 grey ramus communicans","Right deep petrosal nerve","Left axillary nerve posterior branch","Right posterior auricular nerve","Anterior branch of lateral cutaneous branch of right subcostal nerve","Anterior branch of lateral cutaneous branch of right fifth intercostal nerve","Pyloric branch of greater posterior gastric nerve","Left T10 spinal nerve posterior ramus lateral branch","Superior cervical cardiac branch of right vagus nerve","Ganglionic branch of right maxillary nerve to pterygopalatine ganglion","Left proper palmar digital nerve C","Right superior cervical cardiac nerve","Right ninth intercostal nerve","Right lesser petrosal nerve","Communicating branch of left external laryngeal nerve with left superior cardiac nerve","Right long ciliary nerve B","Anterior cutaneous branch of right fourth intercostal nerve","Right third intercostal nerve","Left L4 grey ramus communicans","Right T7 spinal nerve posterior ramus","Left L2 spinal nerve posterior ramus lateral branch","Left proper palmar digital nerve F","Coeliac branch of posterior vagal trunk","Left lacrimal nerve","Right lacrimal nerve","Anterior cutaneous branch of right seventh intercostal nerve","Left femoral nerve","Right maxillary nerve","Lateral cutaneous branch of right third intercostal nerve","Right superficial fibular nerve","Left proper palmar digital nerve I","Anterior cutaneous branch of left seventh intercostal nerve","Left T12 spinal nerve posterior ramus lateral branch","Thoracic cardiac branch of right vagus nerve","Lateral cutaneous branch of left eighth intercostal nerve","Orbital branch of left maxillary nerve to left ethmoidal sinus","Left pudendal nerve","Left lesser petrosal nerve","Right eighth intercostal nerve","Left S5 grey ramus communicans","Right T10 white ramus communicans","Left T10 white ramus communicans","Left T4 white ramus communicans","Lateral cutaneous branch of left third intercostal nerve","Posterior branch of lateral cutaneous branch of left eighth intercostal nerve","Lateral cutaneous branch of right iliohypogastric nerve","Right supratrochlear nerve","Anterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right C3 spinal nerve branch to right supraclavicular nerve","Right T6 grey ramus communicans","Left T5 spinal nerve posterior ramus medial branch","Left proper palmar digital nerve G","Left posterior superior alveolar nerve","Lateral cutaneous branch of left subcostal nerve","Gluteal branch A of right posterior femoral cutaneous nerve","Right T5 white ramus communicans","Left greater petrosal nerve","Left T3 spinal nerve posterior ramus","Right subcostal nerve","Right femoral branch of genitofemoral nerve","Right sixth intercostal nerve","Anterior cutaneous branch of right ninth intercostal nerve","Left T11 spinal nerve posterior ramus lateral branch","Left T7 grey ramus communicans","Posterior branch of lateral cutaneous branch of right subcostal nerve","Left L2 grey ramus communicans","Posterior branch of lateral cutaneous branch of right third intercostal nerve","Right L1 white ramus communicans","Anterior branch of right obturator nerve","Anterior cutaneous branch of left fifth intercostal nerve","Left T4 grey ramus communicans","Right C5 spinal nerve posterior ramus medial branch","Right T4 spinal nerve posterior ramus medial branch","Left L1 white ramus communicans","Anterior cutaneous branch of right eighth intercostal nerve","Left subclavian nerve","Pericardial branch of left phrenic nerve","Left tympanic nerve","Right zygomaticofacial nerve","Right intercostobrachial nerve","Right cochlear nerve","Left internal laryngeal nerve","Right lateral dorsal digital nerve of the third toe","Left proper palmar digital nerve D","Inferior cervical cardiac branch of left vagus nerve","Left proper plantar digital nerve B","Right S2 grey ramus communicans","Right proper plantar digital nerve H","Right tentorial nerve","Right T1 white ramus communicans","Inferior ramus of left internal laryngeal nerve","Right L3 grey ramus communicans","Right posterior superior alveolar nerve","Tonsillar branch of right glossopharyngeal nerve","Lateral cutaneous branch of right subcostal nerve","Right proper palmar digital nerve C","Right first intercostal nerve","Posterior branch of right medial cutaneous nerve of forearm","Right lingual nerve","Lateral cutaneous branch of right fifth intercostal nerve","Left T4 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left third intercostal nerve","Right posterior superior lateral nasal branch of maxillary nerve","Posterior branch of lateral cutaneous branch of right fifth intercostal nerve","Left buccal nerve","Right third occipital nerve","Left anterior ethmoidal nerve","Right lingual branch of glossopharyngeal nerve","Left laryngopharyngeal branch of superior cervical ganglion","Right infratrochlear nerve","Left external laryngeal nerve branch to pharyngeal plexus","Left T7 white ramus communicans","Left L1 spinal nerve posterior ramus","Right S4 grey ramus communicans","Left proper palmar digital nerve J","Left zygomatic nerve","Left L1 spinal nerve posterior ramus lateral branch","Left greater occipital nerve","Left medial cutaneous nerve of forearm","Brachial plexus left C8 root","Left anterior femoral cutaneous branch A","Posterior branch of lateral cutaneous branch of left seventh intercostal nerve","Left T1 spinal nerve posterior ramus medial branch","Left meningeal branch of mandibular nerve","Left medial dorsal digital nerve of the fourth toe","Left C5 spinal nerve posterior ramus","Pharyngeal branch of left glossopharyngeal nerve","Right medial plantar nerve","Left proper plantar digital nerve F","Left deep petrosal nerve","Right supraorbital nerve","Left proper plantar digital nerve E","Right T9 spinal nerve posterior ramus lateral branch","Left posterior cutaneous nerve of forearm","Left posterior femoral cutaneous nerve","Left hypogastric nerve","Left genitofemoral nerve","Anterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T1 spinal nerve posterior ramus","Right common palmar digital nerve A","Right L3 spinal nerve posterior ramus lateral branch","Left anterior superior alveolar nerve","Right T1 grey ramus communicans","Anterior cutaneous branch of left sixth intercostal nerve","Left proper plantar digital nerve A","Left T5 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus","Right superior labial branch of infraorbital nerve","Left proper palmar digital nerve E","Left transverse cervical nerve","Posterior branch of lateral cutaneous branch of right fourth intercostal nerve","Left communicating branch of nasociliary nerve with ciliary ganglion","Superficial branch of right ulnar nerve","Right great auricular nerve posterior branch","Palmar branch of right median nerve","Right ulnar nerve","Right T5 grey ramus communicans","Palmar cutaneous branch of right ulnar nerve","Left T2 spinal nerve posterior ramus medial branch","Tonsillar branch of left glossopharyngeal nerve","Lateral cutaneous branch of right eighth intercostal nerve","Posterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Left T6 white ramus communicans","Right T4 grey ramus communicans","Branch of right vagus nerve to oesophageal nerve plexus","Superior cervical cardiac branch of left vagus nerve","Left long thoracic nerve","Right mental nerve","Left fifth intercostal nerve","Lateral cutaneous branch of left fourth intercostal nerve","Right lateral femoral cutaneous nerve","Posterior branch of lateral cutaneous branch of right seventh intercostal nerve","Lateral cutaneous branch of right seventh intercostal nerve","Left C4 spinal nerve posterior ramus medial branch","Right intermediate dorsal cutaneous nerve","Right medial dorsal cutaneous nerve","Left recurrent laryngeal nerve","Left obturator nerve","Left T8 grey ramus communicans","Right T2 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus medial branch","Left T2 spinal nerve posterior ramus","Right superficial branch of radial nerve","Right C3 spinal nerve branch to right great auricular nerve","Left anterior interosseous nerve","Lateral cutaneous branch of right ninth intercostal nerve","Left common plantar digital nerve E","Brachial plexus left C5 root","Left external laryngeal nerve","Left C3 spinal nerve posterior ramus","Oesophageal branch of right recurrent laryngeal nerve","Lateral cutaneous branch of right tenth intercostal nerve","Anterior cutaneous branch of right sixth intercostal nerve","Right T3 white ramus communicans","Left T9 grey ramus communicans","Auricular branch of right vagus nerve","Right lateral sural cutaneous nerve","Left ulnar nerve","Right long ciliary nerve A","Left sciatic nerve","Anterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right inferior palpebral branch of infraorbital nerve","Right medial cutaneous nerve of arm","Auricular branch of left vagus nerve","Left T10 grey ramus communicans","Left medial posterior superior nasal nerve","Pharyngeal branch of right vagus nerve to pharyngeal nerve plexus","Left L3 grey ramus communicans","Left lateral femoral cutaneous nerve","Right external laryngeal nerve branch to pharyngeal plexus","Left eighth intercostal nerve","Right T5 spinal nerve posterior ramus","Left tibial nerve","Right superior lateral cutaneous nerve of arm","Right lateral plantar nerve","Anterior cutaneous branch of left first intercostal nerve","Brachial plexus right C8 root","Lateral cutaneous branch of left iliohypogastric nerve","Posterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Right long thoracic nerve","Left lateral cutaneous nerve of forearm","Left posterior supraclavicular nerve","Left T3 grey ramus communicans","Left ilioinguinal nerve","Left mental nerve","Left T12 white ramus communicans","Left superficial fibular nerve","Right proper palmar digital nerve F","Right proper palmar digital nerve D","Right lateral cutaneous nerve of forearm","Gluteal branch A of left posterior femoral cutaneous nerve","Lateral cutaneous branch of left fifth intercostal nerve","Right L1 spinal nerve posterior ramus lateral branch","Right axillary nerve anterior branch","Orbital branch of right maxillary nerve to right ethmoidal sinus","Right C6 spinal nerve posterior ramus medial branch","Posterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right recurrent laryngeal nerve","Right sural nerve","Dorsal branch of right ulnar nerve","Right common plantar digital nerve E","Right medial dorsal digital nerve of the fourth toe","Right proper plantar digital nerve E","Left caroticotympanic nerve","Greater posterior gastric nerve","Right L1 spinal nerve posterior ramus","Pericardial branch of right phrenic nerve","Anterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left incisive branch of inferior alveolar nerve","Right T3 grey ramus communicans","Left posterior interosseous nerve","Palmar branch of left median nerve","Left nasociliary nerve","Right external laryngeal nerve","Pharyngeal branch of left vagus nerve to pharyngeal nerve plexus","Right T11 grey ramus communicans","Right dorsal nerve of penis","Left C6 spinal nerve posterior ramus","Left axillary nerve anterior branch","Meningeal branch of left vagus nerve","Left intermediate dorsal cutaneous nerve","Right laryngopharyngeal branch of superior cervical ganglion","Right great auricular nerve anterior branch","Zygomatic branch of left facial nerve","Left C5 spinal nerve posterior ramus medial branch","Marginal mandibular branch of left facial nerve","Right L1 grey ramus communicans","Right meningeal branch of mandibular nerve","Right femoral nerve","Tracheal branch of right recurrent laryngeal nerve","Left posterior cutaneous nerve of arm","Left inferior lateral cutaneous nerve of arm","Right L2 spinal nerve posterior ramus","Right lateral dorsal cutaneous nerve","Anterior cutaneous branch of right second intercostal nerve","Left nasopalatine nerve","Left T3 spinal nerve posterior ramus medial branch","Left superior cervical cardiac nerve","Posterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T7 spinal nerve posterior ramus lateral branch","Right frontal nerve","Anterior cutaneous branch of left tenth intercostal nerve","Ganglionic branch of left maxillary nerve to pterygopalatine ganglion","Left S1 grey ramus communicans","Left lesser palatine nerve","Left medial plantar nerve","Communicating branch of right glossopharyngeal nerve with auricular branch of right vagus nerve","Left zygomaticotemporal nerve","Anterior cutaneous branch of right fifth intercostal nerve","Left proper palmar digital nerve B","Left radial nerve","Posterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left S3 grey ramus communicans","Left T3 white ramus communicans","Right T11 spinal nerve posterior ramus","Left ninth intercostal nerve","Right T2 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of left subcostal nerve","Right proper plantar digital nerve B","Left C2 spinal nerve posterior ramus","Right axillary nerve","Left axillary nerve","Left common palmar digital nerve A","Left proper plantar digital nerve D","Left femoral branch of genitofemoral nerve","Left second intercostal nerve","Left medial cutaneous nerve of arm","Left lateral sural cutaneous nerve","Right ophthalmic nerve","Right carotid sinus nerve","Right T10 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve D","Right mandibular nerve","Right obturator nerve","Left C3 spinal nerve branch to left great auricular nerve","Left lateral dorsal cutaneous nerve","Right greater palatine nerve","Right L2 spinal nerve posterior ramus lateral branch","Brachial plexus right C5 root","Left posterior superior lateral nasal branch of maxillary nerve","Right proper plantar digital nerve I","Right seventh intercostal nerve","Anterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Right tenth intercostal nerve","Left mandibular nerve","Left greater palatine nerve","Left T12 grey ramus communicans","Inferior cervical cardiac branch of right vagus nerve","Left ophthalmic nerve","Left superior laryngeal nerve","Right T12 grey ramus communicans","Cutaneous branch of left obturator nerve","Left long ciliary nerve B","Left S4 grey ramus communicans","Left T4 spinal nerve posterior ramus medial branch","Greater anterior gastric nerve","Orbital branch of left maxillary nerve to left sphenoidal sinus","Orbital branch of right maxillary nerve to right sphenoidal sinus","Right middle supraclavicular nerve","Right caroticotympanic nerve","Left sixth intercostal nerve","Right posterior cutaneous nerve of arm","Left middle supraclavicular nerve","Left proper plantar digital nerve I","Anterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left L2 spinal nerve posterior ramus","Anterior branch of lateral cutaneous branch of left seventh intercostal nerve","Posterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left T8 spinal nerve posterior ramus lateral branch","Meningeal branch of right vagus nerve","Tracheal branch of left recurrent laryngeal nerve","Anterior cutaneous branch of right tenth intercostal nerve","Left eleventh intercostal nerve","Right pudendal nerve","Posterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right anterior ethmoidal nerve","Right nasopalatine nerve","Left T8 spinal nerve posterior ramus","Left long ciliary nerve A","Left supraorbital nerve","Right medial posterior superior nasal nerve","Left T8 white ramus communicans","Right anterior femoral cutaneous branch A","Left T2 white ramus communicans","Right saphenous nerve","Anterior branch of lateral cutaneous branch of right seventh intercostal nerve","Left superior lateral cutaneous nerve of arm","Left T9 spinal nerve posterior ramus lateral branch","Left T6 spinal nerve posterior ramus","Posterior branch of left obturator nerve","Left external laryngeal nerve branch to inferior pharyngeal constrictor","Right incisive branch of inferior alveolar nerve","Right C3 spinal nerve posterior ramus","Right C5 spinal nerve posterior ramus","Right T9 spinal nerve posterior ramus","Communicating branch of left internal laryngeal nerve with left recurrent laryngeal nerve","Left vestibular nerve","Right radial nerve","Left third intercostal nerve","Left cochlear nerve","Anterior cutaneous branch of left fourth intercostal nerve","Right T6 spinal nerve posterior ramus","Right greater occipital nerve","Right lesser palatine nerve","Left inferior alveolar nerve","Right subclavian nerve","Right T6 white ramus communicans","Brachial plexus right C6 root","Lateral cutaneous branch of left eleventh intercostal nerve","Right T11 white ramus communicans","Left carotid sinus nerve","Left great auricular nerve anterior branch","Right external laryngeal nerve branch to inferior pharyngeal constrictor","Left S2 grey ramus communicans","Right internal laryngeal nerve","Infrapatellar branch of left saphenous nerve","Anterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve A","Right communicating branch of nasociliary nerve with ciliary ganglion","Left proper plantar digital nerve G","Left infraorbital nerve","Left lingual branch of glossopharyngeal nerve","Right proper plantar digital nerve A","Left inferior rectal nerve","Right musculocutaneous nerve","Left inferior palpebral branch of infraorbital nerve","Left T7 spinal nerve posterior ramus","Cervical branch of right facial nerve","Right middle meningeal nerve","Right axillary nerve posterior branch","Right C2 spinal nerve branch to right great auricular nerve","Left zygomaticofacial nerve","Anterior branch of lateral cutaneous branch of left eighth intercostal nerve"]},{id:77,nerve_id:"UBERON:0001647",label:"facial nerve","FMA subclasses (in human nerves)":["FMA:50888","FMA:50889"],"subclass labels":["Right facial nerve","Left facial nerve"]},{id:78,nerve_id:"UBERON:0001148",label:"median nerve","FMA subclasses (in human nerves)":["FMA:37067","FMA:37068"],"subclass labels":["Right median nerve","Left median nerve"]},{id:79,nerve_id:"UBERON:0009009",label:"carotid sinus nerve","FMA subclasses (in human nerves)":["FMA:53508","FMA:53509"],"subclass labels":["Right carotid sinus nerve","Left carotid sinus nerve"]},{id:80,nerve_id:"UBERON:0003715",label:"splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6930","FMA:6960","FMA:6958","FMA:6959","FMA:6925","FMA:6956","FMA:6927","FMA:6955","FMA:6926","FMA:6957"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left least splanchnic nerve","Left lesser splanchnic nerve","Right least splanchnic nerve","Left first lumbar splanchnic nerve","Right greater splanchnic nerve","Left second lumbar splanchnic nerve","Left greater splanchnic nerve","Right second lumbar splanchnic nerve","Right lesser splanchnic nerve"]},{id:81,nerve_id:"ILX:0793826",label:"anterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:82,nerve_id:"UBERON:0001650",label:"hypoglossal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:83,nerve_id:"ILX:0794967",label:"posterior interosseous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:84,nerve_id:"ILX:0793713",label:"Deep petrosal nerve","FMA subclasses (in human nerves)":["FMA:0328827","FMA:0328826"],"subclass labels":["Left deep petrosal nerve","Right deep petrosal nerve"]},{id:85,nerve_id:"ILX:0793361",label:"white communicating ramus of third lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:86,nerve_id:"ILX:0787562",label:"gray communicating ramus of the third thoracic nerve","FMA subclasses (in human nerves)":["FMA:6133","FMA:6124"],"subclass labels":["Left T3 grey ramus communicans","Right T3 grey ramus communicans"]},{id:87,nerve_id:"ILX:0793211",label:"white communicating ramus of fifth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:88,nerve_id:"UBERON:0018679",label:"thoracic splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6958","FMA:6960","FMA:6955","FMA:6959","FMA:6957","FMA:6956"],"subclass labels":["Left lesser splanchnic nerve","Left least splanchnic nerve","Left greater splanchnic nerve","Right least splanchnic nerve","Right lesser splanchnic nerve","Right greater splanchnic nerve"]},{id:89,nerve_id:"ILX:0731969",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:90,nerve_id:"ILX:0788771",label:"gray communicating ramus of seventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6888","FMA:6889"],"subclass labels":["Right T7 grey ramus communicans","Left T7 grey ramus communicans"]},{id:91,nerve_id:"UBERON:0022301",label:"long ciliary nerve","FMA subclasses (in human nerves)":["FMA:52701","FMA:52700","FMA:82734","FMA:82735"],"subclass labels":["Left long ciliary nerve B","Right long ciliary nerve B","Right long ciliary nerve A","Left long ciliary nerve A"]},{id:92,nerve_id:"ILX:0793221",label:"white communicating ramus of second lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:93,nerve_id:"ILX:0785825",label:"gray communicating ramus of first lumbar nerve","FMA subclasses (in human nerves)":["FMA:65924","FMA:65923"],"subclass labels":["Left L1 grey ramus communicans","Right L1 grey ramus communicans"]},{id:94,nerve_id:"ILX:0793208",label:"white communicating ramus of second thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:95,nerve_id:"UBERON:0018412",label:"vidian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:96,nerve_id:"ILX:0739303",label:"gray communicating ramus of second thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:97,nerve_id:"ILX:0795006",label:"Suboccipital nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:98,nerve_id:"ILX:0785733",label:"gray communicating ramus of second lumbar nerve","FMA subclasses (in human nerves)":["FMA:65921","FMA:65922"],"subclass labels":["Right L2 grey ramus communicans","Left L2 grey ramus communicans"]},{id:99,nerve_id:"UBERON:0035207",label:"deep fibular nerve","FMA subclasses (in human nerves)":["FMA:45387","FMA:45388"],"subclass labels":["Right deep fibular nerve","Left deep fibular nerve"]},{id:100,nerve_id:"ILX:0739304",label:"gray communicating ramus of third thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:101,nerve_id:"UBERON:0002019",label:"accessory XI nerve","FMA subclasses (in human nerves)":["FMA:50899","FMA:50897"],"subclass labels":["Left accessory nerve","Right accessory nerve"]},{id:102,nerve_id:"ILX:0793217",label:"white communicating ramus of eleventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:103,nerve_id:"ILX:0793722",label:"Lesser petrosal nerve","FMA subclasses (in human nerves)":["FMA:53503","FMA:53502"],"subclass labels":["Left lesser petrosal nerve","Right lesser petrosal nerve"]},{id:104,nerve_id:"UBERON:0018675",label:"pelvic splanchnic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:105,nerve_id:"ILX:0793702",label:"Greater petrosal nerve","FMA subclasses (in human nerves)":["FMA:53423","FMA:53424"],"subclass labels":["Right greater petrosal nerve","Left greater petrosal nerve"]},{id:106,nerve_id:"ILX:0794916",label:"white ramus communicans","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:107,nerve_id:"UBERON:0003716",label:"Recurrent Laryngeal Nerve","FMA subclasses (in human nerves)":["UBERON:0011766","UBERON:0011767"],"subclass labels":["Left recurrent laryngeal nerve","Right recurrent laryngeal nerve"]},{id:108,nerve_id:"UBERON:0005465",label:"obturator nerve","FMA subclasses (in human nerves)":["FMA:16501","FMA:16502"],"subclass labels":["Right obturator nerve","Left obturator nerve"]},{id:109,nerve_id:"ILX:0793213",label:"white communicating ramus of seventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:110,nerve_id:"ILX:0785067",label:"gray communicating ramus of eleventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6897","FMA:6896"],"subclass labels":["Left T11 grey ramus communicans","Right T11 grey ramus communicans"]},{id:111,nerve_id:"UBERON:0001494",label:"ulnar nerve","FMA subclasses (in human nerves)":["FMA:37320","FMA:37321"],"subclass labels":["Right ulnar nerve","Left ulnar nerve"]},{id:112,nerve_id:"ILX:0794959",label:"posterior rami lower cervical nerves","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:113,nerve_id:"UBERON:0001493",label:"axillary nerve","FMA subclasses (in human nerves)":["FMA:37074","FMA:37073"],"subclass labels":["Left axillary nerve","Right axillary nerve"]},{id:114,nerve_id:"ILX:0787946",label:"gray communicating ramus of sixth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6762","FMA:6763"],"subclass labels":["Right T6 grey ramus communicans","Left T6 grey ramus communicans"]},{id:115,nerve_id:"ILX:0785542",label:"gray communicating ramus of ninth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6892","FMA:6893"],"subclass labels":["Right T9 grey ramus communicans","Left T9 grey ramus communicans"]}],dGe=()=>{const e={};return XK.forEach(t=>{const n=t.nerve_id,o=t.label.toLowerCase(),a=t["subclass labels"];if(n&&o!=="nerve"){if(!a.length)return;n in e||(e[n]={});const i=a.map(s=>s.toLowerCase()).sort();e[n]={nerve:o,subNerves:i}}}),e},uGe=()=>{let e=[],t={key:"scaffold.connectivity.nerve",label:"Nerves",children:[]},n=[];for(const o of XK){if(o.label==="nerve")continue;let a={facetPropPath:"scaffold.connectivity.nerve",label:"",children:[]},i=[];for(const[s,l]of Object.entries(o))if(s==="label"&&(a.label=l),s==="subclass labels")for(const c of l)i.push({facetPropPath:"scaffold.connectivity.subnerve",label:c});i.length&&(a.children=i.sort((s,l)=>s.label.localeCompare(l.label)),n.push(a))}return n.length&&(t.children=n.sort((o,a)=>o.label.localeCompare(a.label)),e.push(t)),e};function fGe(e){return e[0].toUpperCase()+e.substring(1)}const Jd={emits:["flatmap-provenance-ready","resource-selected","species-changed"],props:{entry:Object,visible:{type:Boolean,default:!0},mouseHovered:{type:Boolean,default:!1}},inject:["showGlobalSettings","showOpenMapButton"],computed:{...Mt.mapStores(Mf,vi,Ss,AV),idNamePair(){return this.splitFlowStore.idNamePair},useHelpModeDialog(){return this.settingsStore.useHelpModeDialog},connectivityInfoSidebar(){return this.settingsStore.connectivityInfoSidebar},annotationSidebar(){return this.settingsStore.annotationSidebar},showLocalSettings(){return!this.showGlobalSettings}},beforeUnmount:function(){this.alive=!1},mounted:function(){this.multiflatmapRef=this.$refs.multiflatmap,this.flatmapRef=this.$refs.flatmap,this.scaffoldRef=this.$refs.scaffold,this.iframeRef=this.$refs.iframe,this.plotRef=this.$refs.plot,this.simulationRef=this.$refs.simulation,(this.scaffoldRef||this.iframeRef||this.plotRef||this.simulationRef)&&this.loadExplorerConfig(),this.connectivityKnowledge=this.connectivitiesStore.globalConnectivities,this.connectivityFilterOptions=this.connectivitiesStore.filterOptions,this.connectivityFilterSources=this.connectivitiesStore.filterSources},methods:{toggleMinimap:function(e,t){var n;if(this.multiflatmapRef){const o=this.multiflatmapRef.getCurrentFlatmap(),a=o==null?void 0:o.mapImp;if(a)if(e===!0){if(t===!1){const i=((n=a.options)==null?void 0:n.minimap)||{position:"top-right"};a.createMinimap(i),o.addResizeButtonToMinimap(),o.minimapSmall=!1}}else a.closeMinimap()}},onConnectivityItemClose(){if(this!=null&&this.alive){if(this.multiflatmapRef){const e=this.multiflatmapRef.getCurrentFlatmap();e&&e.closeTooltip()}this.flatmapRef&&this.flatmapRef.closeTooltip()}},getState:function(){},openMap:function(e){$e.emit("OpenNewMap",e),this.trackOpenMap(`open_new_${e}_map`)},onMapmanagerLoaded:function(e){this.settingsStore.updateMapManager(e)},trackOpenMap:function(e){Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_open_map",category:e,location:"open_new_map"})},updateEntryLabel:function(e){e&&this.entriesStore.updateLabelForEntry(this.entry,e)},updateEntryTitle:function(e){e&&this.entriesStore.updateTitleForEntry(this.entry,e)},updateWithViewUrl:function(){},search:function(){return!1},searchSuggestions:function(){},resourceSelected:function(e,t){var s,l,c,d;const n=t[0];if(this.resourceHasAction(n)){$e.emit("PopoverActionClick",n);return}let o,a=!1;const i={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0,eventType:void 0};if(e=="MultiFlatmap"||e=="Flatmap")if(i.internalName=(s=n==null?void 0:n.feature)!=null&&s.label?n.feature.label:this.idNamePair[n.feature.models],n.eventType=="click"){if(i.eventType="selected",n.feature.type=="marker"){let u=i.internalName;if(this.settingsStore.isFeaturedMarkerIdentifier(n.feature.id))o={type:"Search",term:this.settingsStore.featuredMarkerDoi(n.feature.id),featuredDataset:!0};else{o={type:"Facet",facets:[u]};let f=new Set;if(n.feature["dataset-terms"].forEach(p=>{f.add(p.label?p.label:p.term)}),f.size===0&&f.add(u),o.facets=[...f],this.settingsStore.hasAppliedFacets(f)&&this.settingsStore.appliedFacets.length<=f.size)return;if(this.settingsStore.appliedFacets.length){if(!this.settingsStore.hasAppliedFacets(f)){const p=[...new Set([...this.settingsStore.appliedFacets,...f])];this.settingsStore.updateAppliedFacets(p)}}else f.size>1&&(o.type="Facets"),this.settingsStore.updateAppliedFacets(o.facets)}a=!0,e=="MultiFlatmap"&&this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}}else n.eventType=="mouseenter"&&(i.eventType="highlighted",a=!0);else e=="Scaffold"&&(n&&((((l=n.data)==null?void 0:l.id)===void 0||((c=n.data)==null?void 0:c.id)==="")&&(n.data.id=(d=n.data)==null?void 0:d.group),i.internalName=n.data.id,n.data.lastActionOnMarker===!0&&(o={type:"Facet",facets:[fGe(n.data.id)]})),i.eventType="selected",a=!0);o&&$e.emit("PopoverActionClick",o),a&&this.$emit("resource-selected",i)},resourceHasAction:function(e){return e&&(e.type==="URL"||e.type==="Search"||e.type==="Neuron Search"||e.type=="Facet"||e.type=="Facets")},isVisible:function(){return this.splitFlowStore.getPaneNameById(this.entry.id)!==void 0},getNameAndIdFromSyncData:async function(e){let t=e.internalName;t===void 0&&e.resource&&(t=e.resource.label);let n;if(e.resource&&e.resource.resource&&(n=e.resource.resource[0]),this.entry.type==="Scaffold"){if(this.$refs.scaffold.findObjectsWithGroupName(t).length===0){if(e.resource&&e.resource.feature){const i=xV(e.resource.feature.models);if(i.length>0)return i}let a=L5e(t);if(a)return a;if(n&&e.eventType==="selected")return fetch(`${this.apiLocation}get-related-terms/${n}`).then(i=>i.json()).then(i=>{var s;if(((s=i.uberon)==null?void 0:s.array.length)>0)return t=i.uberon.array[0].name.charAt(0).toUpperCase()+i.uberon.array[0].name.slice(1),n=i.uberon.array[0].id.toUpperCase(),{id:n,name:t}})}}else if(this.entry.type==="MultiFlatmap")if(t==="Bladder")t="Urinary Bladder";else{const o=xV(t);o.length>0&&(t=o[0])}return{id:n,name:t}},getDatasetAnatomyInfo:function(e){fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then(t=>t.json()).then(t=>{const n=t.result[0];let o;try{o=n.anatomy.organ[0].curie}catch{o=void 0}let a;try{a=n.item.curie}catch{a=void 0}let i;try{let s=0,l=!1;for(;!l&&s<n.organisms.subject.length;){const c=n.organisms.subject[s];c.species&&(i=c.species.name,l=!0),s+=1}}catch{i=void 0}this.settingsStore.updateFeaturedMarker({identifier:e,marker:o,doi:a,species:i})})},oldFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();return!t.identifiers||t.identifiers.length==0?!1:t.identifiers},newFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_dataset`)).json();return!t.datasets||t.datasets.length==0?!1:t.datasets.map(n=>n.id)},flatmapResourceSelected:function(e,t){var s;this.resourceSelected(e,t);const n=t[0],{eventType:o,feature:a}=n,{viewingMode:i}=this.settingsStore.globalSettings;if(o==="click"&&a.type==="feature"&&((s=a.models)!=null&&s.startsWith("ilxtr:"))){const l=[];t.forEach(c=>{const{models:d}=c.feature;l.push(d)}),Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_connectivity",category:l.join(", "),location:e+" "+i})}},getFeaturedDatasets:async function(){let e=[],t=await this.oldFeaturedDatasetApiHasInfo();if(t)e=t;else{let n=await this.newFeaturedDatasetApiHasInfo();n&&(e=n)}this.settingsStore.updateFeatured(e),e.forEach(n=>{this.getDatasetAnatomyInfo(n)})},flatmapMarkerUpdate(){},onResize:function(){},updateViewerSettings:function(){},startHelp:function(){this!=null&&this.alive&&this.isInHelp===!1&&(this.helpMode=!0,window.addEventListener("mousedown",this.checkEndHelpMouseDown),this.isInHelp=!0)},endHelp:function(){window.removeEventListener("mousedown",this.checkEndHelpMouseDown),this.helpMode=!1,setTimeout(()=>{this.isInHelp=!1},200)},onHelpModeShowNext:function(){this.helpModeActiveItem+=1},onHelpModeLastItem:function(e){e&&(this.helpModeLastItem=!0)},onFinishHelpMode:function(){this.helpMode=!1,this.helpModeActiveItem=0,this.helpModeLastItem=!1},onTooltipShown:function(){this.$refs.multiflatmap&&this.$refs.multiflatmapHelp&&this.$refs.multiflatmapHelp.toggleTooltipHighlight(),this.$refs.flatmap&&this.$refs.flatmapHelp&&this.$refs.flatmapHelp.toggleTooltipHighlight(),this.$refs.scaffold&&this.$refs.scaffoldHelp&&this.$refs.scaffoldHelp.toggleTooltipHighlight()},onMapTooltipShown:function(){this.$refs.multiflatmap&&this.$refs.multiflatmapHelp&&this.$refs.multiflatmapHelp.toggleTooltipPinHighlight(),this.$refs.flatmap&&this.$refs.flatmapHelp&&this.$refs.flatmapHelp.toggleTooltipPinHighlight(),this.$refs.scaffold&&this.$refs.scaffoldHelp&&this.$refs.scaffoldHelp.toggleTooltipPinHighlight()},checkEndHelpMouseDown:function(e){e.target.closest(".help-mode-dialog")||this.endHelp()},flatmapHighlight:async function(e,t,n,o){let a=[...t,...o];const i=this.settingsStore.globalSettings;if(i.highlightConnectedPaths){const s=t.length?t:o.length?o:[],l=await e.retrieveConnectedPaths(s);l&&a.push(...l)}if(i.highlightDOIPaths){const s=await e.searchConnectivitiesByReference(n);s&&a.push(...s)}return a=[...new Set(a)],a},sidebarHoverHighlight:function(e){var t,n;if(this.visible&&((this.flatmapRef||this.multiflatmapRef)&&this.flatmapReady||this.scaffoldRef&&this.scaffoldLoaded)){const o=this.settingsStore.hoverAnatomies,a=this.settingsStore.hoverOrgans,i=this.settingsStore.hoverDOI,s=this.settingsStore.hoverConnectivity;let l=null,c=null;this.flatmapRef&&(l=this.flatmapRef),this.multiflatmapRef&&(l=this.multiflatmapRef.getCurrentFlatmap()),this.scaffoldRef&&(c=this.scaffoldRef),clearTimeout(this.highlightDelay),!o.length&&!a.length&&!i&&!s.length&&((this.multiflatmapRef||this.flatmapRef)&&l?((t=l.mapImp)==null||t.clearSearchResults(),e.connectivityProcessed&&((n=l.mapImp)==null||n.setPaint({dimmed:!0}))):this.scaffoldRef&&c&&c.changeHighlightedByName(a,"",!1)),this.highlightDelay=setTimeout(()=>{(o.length||a.length||i||s.length)&&((this.multiflatmapRef||this.flatmapRef)&&l?this.flatmapHighlight(l,o,i,s).then(d=>{try{l.showConnectivityTooltips({connectivityInfo:{featureId:d},data:[]})}catch(u){if(console.log(u),s.length&&l.mapImp){const f=l.mapImp.uuid;d.every(m=>this.connectivityKnowledge[f].some(h=>h.id===m))||l.mapImp.clearSearchResults()}}}):this.scaffoldRef&&c&&c.changeHighlightedByName(a,"",!1))},100)}},onAnnotationOpen:function(e){$e.emit("annotation-open",e)},onAnnotationClose:function(){$e.emit("sidebar-annotation-close")},updateOfflineAnnotationEnabled:function(e){$e.emit("update-offline-annotation-enabled",e)},onConnectivityInfoOpen:function(e){$e.emit("connectivity-info-open",e)},onConnectivityError:function(e){$e.emit("connectivity-error",e)},onConnectivityInfoClose:function(){$e.emit("connectivity-info-close")},onSidebarAnnotationClose:function(){},onNeuronConnectionFeatureClick:function(e){$e.emit("neuron-connection-feature-click",e)},showConnectivity:function(){},showConnectivityTooltips:function(){},setVisibilityFilter:function(){},loadExplorerConfig:async function(){this.flatmapService=await this.mockUpFlatmapService(),this.loadConnectivityExplorerConfig(this.flatmapService)},mockUpFlatmapService:async function(){const n=(await(await fetch(this.flatmapAPI)).json()).filter(u=>u.id==="human-flatmap_male").sort((u,f)=>f.created.localeCompare(u.created))[0],o=n.uuid,a=n.sckan["knowledge-source"],s=await(await fetch(`${this.flatmapAPI}/flatmap/${o}/pathways`)).json();this.flatmapQueries=r.markRaw(new WK),this.flatmapQueries.initialise(this.flatmapAPI);const l={mapMetadata:{uuid:o,connectivity:{...n.sckan}},pathways:s,resource:this.entry.resource,knowledgeSource:a,queryKnowledge:async u=>{const f="select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc",p=[a,u],m=await this.flatmapQueries.queryKnowledge(f,p);return JSON.parse(m)},queryLabels:async u=>{const f=`select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(u.length-1)}) order by entity, source desc`,p=[a,...u],m=await this.flatmapQueries.queryKnowledge(f,p),h=[];let g;for(const v of m)if(v[1]!==g){const y=JSON.parse(v[2]);h.push({entity:v[1],label:y.label||v[1]}),g=v[1]}return h}},c=uGe();return{mockup:!0,getFilterOptions:async(u,f)=>{const m=await oEe(this.flatmapAPI,u,f,void 0);return[...c,...m]},getTermNerveMaps:dGe,mapImp:l}},loadConnectivityExplorerConfig:async function(e){var i;const t=e.mapImp,n=Rg(t),o=e.mockup?t.resource:t.uuid;let a=[];if(!this.connectivityKnowledge[n]){this.flatmapQueries=r.markRaw(new WK),this.flatmapQueries.initialise(this.flatmapAPI);const s=await A5e(t,this.flatmapQueries);this.connectivityKnowledge[n]=s.filter(l=>{var c;return(c=l.connectivity)==null?void 0:c.length}).sort((l,c)=>l.label.localeCompare(c.label))}if(!this.connectivityKnowledge[o]){const s=((i=t.pathways)==null?void 0:i.paths)||{};this.connectivityKnowledge[o]=this.connectivityKnowledge[n].filter(l=>l.id in s)}if(!this.connectivityFilterOptions[o]&&!e.mockup&&(this.connectivityFilterOptions[o]=await e.getFilterOptions(t,this.connectivityKnowledge[o])),e.mockup){const s=e.getTermNerveMaps()||{},l=JSON.parse(JSON.stringify(this.connectivityKnowledge[o]));this.connectivityKnowledge[o]=l.map(d=>{var f;let u=d;if((f=d.nerves)!=null&&f.length){const m=d.nerves.flat(1/0).reduce((h,g)=>(g in s&&h.push(s[g]),h),[]);m!=null&&m.length&&(a.push(...m),u["nerve-label"]=m.sort((h,g)=>h.nerve.localeCompare(g.nerve)))}return u}).filter(d=>d["nerve-label"]),this.connectivityFilterOptions[o]||(this.connectivityFilterOptions[o]=await e.getFilterOptions(t,this.connectivityKnowledge[o])),a=a.map(d=>d.nerve.toLowerCase());const c=JSON.parse(JSON.stringify(this.connectivityFilterOptions[o]));this.connectivityFilterOptions[o]=c.map(d=>{if(d.key==="scaffold.connectivity.nerve"){const u=d.children.filter(f=>a.includes(f.label.toLowerCase()));return{...d,children:u}}else return d})}else this.connectivityFilterSources[o]||(this.connectivityFilterSources[o]=e.getFilterSources()),this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions),this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge),$e.emit("species-layout-connectivity-update")},knowledgeTooltipQuery:async function(e){await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.flatmapService.mapImp,{resource:[e.id]});let t=await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp,{resource:[e.id],label:e.label,provenanceTaxonomy:e.taxons,feature:[]});return t.knowledgeSource=Rg(this.flatmapService.mapImp),t.mapId=this.flatmapService.mapImp.mapMetadata.id,t.mapuuid=this.flatmapService.mapImp.mapMetadata.uuid,t["nerve-label"]=e["nerve-label"],t.ready=!0,t},getKnowledgeTooltip:async function(e){this.tooltipEntry=[],e.data.forEach(o=>this.tooltipEntry.push({title:o.label,featureId:[o.id],ready:!1})),$e.emit("connectivity-info-open",this.tooltipEntry);let t=[];for(let o=0;o<e.data.length;o++)t.push(await this.knowledgeTooltipQuery(e.data[o]));this.tooltipEntry=await Promise.all(t),this.tooltipEntry.map(o=>o.featureId[0]).length>0&&$e.emit("connectivity-info-open",this.tooltipEntry)},changeConnectivitySource:async function(e){const{entry:t,connectivitySource:n}=e;await this.flatmapQueries.queryForConnectivityNew(this.flatmapService.mapImp,t.featureId[0],n),this.tooltipEntry=this.tooltipEntry.map(o=>o.featureId[0]===t.featureId[0]?this.flatmapQueries.updateTooltipData(o):o),$e.emit("connectivity-info-open",this.tooltipEntry)},trackEvent:function(e){Tt.sendEvent(e)}},data:function(){return{apiLocation:void 0,activeSpecies:"Human Male",scaffoldCamera:void 0,mainStyle:{height:this.entry.datasetTitle?"calc(100% - 30px)":"100%",width:"100%",bottom:"0px"},helpMode:!1,helpModeActiveItem:0,helpModeLastItem:!1,multiflatmapRef:null,flatmapRef:null,scaffoldRef:null,scaffoldLoaded:!1,isInHelp:!1,mapManager:void 0,connectivityKnowledge:{},connectivityFilterOptions:{},connectivityFilterSources:{},highlightDelay:void 0,alive:!0,flatmapService:void 0,flatmapQueries:void 0,tooltipEntry:[]}},created:function(){this.flatmapAPI=void 0,this.apiLocation=void 0,this.settingsStore.flatmapAPI&&(this.flatmapAPI=this.settingsStore.flatmapAPI),this.settingsStore.sparcApi&&(this.apiLocation=this.settingsStore.sparcApi),this.settingsStore.mapManager&&(this.mapManager=this.settingsStore.mapManager)},watch:{helpMode:function(e){e||(this.helpModeActiveItem=0)}}},pGe=function(e){return e?[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t)):[]},YK={computed:{...Mt.mapStores(vi)},methods:{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)}},flatmapMarkerUpdate(e){if(!this.flatmapReady)return;let t=e;if(t||(t=this.getFlatmapImp()),t){let n=this.settingsStore.globalSettings.displayMarkers?this.settingsStore.markers:[];n=pGe(n),t.clearMarkers(),t.clearDatasetMarkers(),t.addDatasetMarkers(n),this.entry.type==="MultiFlatmap"&&this.restoreFeaturedMarkers(t)}},removeMarkersNotOnFlatmap(e,t){let n=e.anatomicalIdentifiers,o=[];for(let a=0;a<t.length;a++){let i=t[a],s={id:i.id,terms:[]};for(let l=0;l<i.terms.length;l++)n.includes(i.terms[l])&&s.terms.push(i.terms[l]);o.push(s)}return o},flatmapReadyForMarkerUpdates:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerUpdate(t)}}}},hGe={name:"Flatmap",mixins:[Jd,YK],components:{FlatmapVuer:_5.FlatmapVuer,HelpModeDialog:xS},data:function(){return{flatmapReady:!1,displayMinimap:!1}},methods:{getState:function(){return this.$refs.flatmap.getState()},search:function(e){return this.$refs.flatmap.searchAndShowResult(e,!0,!0)},getFlatmapImp(){var e;return(e=this.$refs.flatmap)==null?void 0:e.mapImp},flatmapReadyCall:function(e){var o,a,i;this.flatmapReady=!0;const t=this.getFlatmapImp();(o=t==null?void 0:t.mapMetadata)!=null&&o.name&&(this.updateEntryLabel((a=t==null?void 0:t.mapMetadata)==null?void 0:a.name),this.updateEntryTitle((i=t==null?void 0:t.mapMetadata)==null?void 0:i.name));let n={id:this.entry.id,prov:t.mapMetadata};$e.emit("mapImpProv",n),this.$emit("flatmap-provenance-ready",n),this.flatmapReadyForMarkerUpdates(e),this.updateViewerSettings(),this.loadConnectivityExplorerConfig(e).then(()=>{$e.emit("mapLoaded",e)})},onPathwaySelectionChanged:function(e){const{label:t,property:n,checked:o,selectionsTitle:a}=e;Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_pathway_change",category:t+" ["+n+"] "+o,location:a})},onSidebarAnnotationClose:function(){this.flatmapReady&&this.$refs.flatmap&&this.$refs.flatmap.annotationEventCallback({},{type:"aborted"})},searchSuggestions:function(e,t){if(e&&this.$refs.flatmap.mapImp){const n=this.$refs.flatmap.mapImp.search(e);(n.__featureIds||n.featureIds).forEach(a=>{const i=this.$refs.flatmap.mapImp.annotation(a);i&&i.label&&t.push(i.label)})}},showConnectivity:function(e){if(this!=null&&this.alive){const{featureIds:t,offset:n}=e,o=this.$refs.flatmap;o&&o.moveMap(t,{offsetX:n?-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 n=e.name;const o=this.$refs.flatmap.mapImp;if(n){const a=o.search(n);if(a.featureIds.length){let i=o.modelForFeature(a.featureIds[0]);i?(t&&o.selectFeatures(i),o.zoomToFeatures(i)):o.clearSearchResults()}}else o.clearSearchResults()},changeViewingMode:function(e){this.$refs.flatmap.changeViewingMode(e)},updateViewerSettings:function(){const{backgroundDisplay:e,viewingMode:t,flightPathDisplay:n,organsDisplay:o,outlinesDisplay:a,connectionType:i}=this.settingsStore.globalSettings,s=this.$refs.flatmap;s.changeViewingMode(t),s.setFlightPath3D(n),s.setColour(o),s.setOutlines(a),s.backgroundChangeCallback(e),s.setConnectionType(i)},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 n=e.data[0];t.searchAndShowResult(n.id,!0,!1)}}}},computed:{facetSpecies(){return this.settingsStore.facets.species}}},mGe={class:"viewer-container"};function gGe(e,t,n,o,a,i){const s=r.resolveComponent("FlatmapVuer"),l=r.resolveComponent("HelpModeDialog");return r.openBlock(),r.createElementBlock("div",mGe,[r.createVNode(s,{state:e.entry.state,entry:e.entry.resource,mapManager:e.mapManager,onResourceSelected:t[0]||(t[0]=c=>e.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:i.flatmapReadyCall,displayMinimap:e.displayMinimap,displayWarning:!0,enableOpenMapUI:!0,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,showLocalSettings:e.showLocalSettings,showOpenMapButton:e.showOpenMapButton,onOpenMap:e.openMap,onPathwaySelectionChanged:i.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","displayMinimap","flatmapAPI","sparcAPI","showLocalSettings","showOpenMapButton","onOpenMap","onPathwaySelectionChanged","onMapmanagerLoaded","onTrackEvent"]),e.helpMode&&e.useHelpModeDialog?(r.openBlock(),r.createBlock(l,{key:0,ref:"flatmapHelp",flatmapRef:e.flatmapRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["flatmapRef","lastItem","onShowNext","onFinishHelpMode"])):r.createCommentVNode("",!0)])}const yGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(hGe,[["render",gGe],["__scopeId","data-v-be4a55a2"]])},Symbol.toStringTag,{value:"Module"})),vGe={name:"Iframe",mixins:[Jd]},bGe={class:"map-iframe-container"},wGe=["src"];function xGe(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("div",bGe,[r.createElementVNode("iframe",{class:"my-iframe",src:e.entry.resource.share_link,ref:"iframe"},null,8,wGe)])}const kGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(vGe,[["render",xGe],["__scopeId","data-v-fde9a2bb"]])},Symbol.toStringTag,{value:"Module"})),CGe='<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>',JK=e=>[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}],SGe={name:"MultiFlatmap",mixins:[Jd,YK],components:{MultiFlatmapVuer:_5.MultiFlatmapVuer,HelpModeDialog:xS},data:function(){return{zoomLevel:6,flatmapReady:!1,availableSpecies:bV(),scaffoldResource:{},showStarInLegend:!1,openMapOptions:JK()}},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)}},search:function(e){return this.$refs.multiflatmap.getCurrentFlatmap().searchAndShowResult(e,!0,!0)},searchSuggestions:function(e,t){const n=this.$refs.multiflatmap.getCurrentFlatmap();if(e&&n.mapImp){const o=n.mapImp.search(e);(o.__featureIds||o.featureIds).forEach(i=>{const s=n.mapImp.annotation(i);s&&s.label&&t.push(s.label)})}},onPathwaySelectionChanged:function(e){const{label:t,property:n,checked:o,selectionsTitle:a}=e;Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_pathway_change",category:t+" ["+n+"] "+o,location:a})},onSidebarAnnotationClose:function(){this.flatmapReady&&this.$refs.multiflatmap.getCurrentFlatmap().annotationEventCallback({},{type:"aborted"})},onOpenPubmedUrl:function(e){Tt.sendEvent({event:"interaction_event",event_name:"portal_maps_pubmed_url",file_path:e,location:"map_popup_button"})},zoomToFeatures:function(e,t){let n=e.name;const o=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(n){const a=o.search(n);a.featureIds.length>0?(t&&o.selectFeatures(a.featureIds),o.zoomToFeatures(a.featureIds)):o.clearSearchResults()}else o.clearSearchResults()},updateProvCard:function(){const e=this.getFlatmapImp();if(e){let t={id:this.entry.id,prov:e.mapMetadata};$e.emit("mapImpProv",t),this.$emit("flatmap-provenance-ready",t)}},flatmapChanged:async function(e){this.activeSpecies=e,this.openMapOptions=JK();const t=this.getFlatmapImp();t&&(this.updateProvCard(),this.flatmapMarkerUpdate(t),this.updateViewerSettings()),this.$emit("species-changed",e),Tt.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).then(()=>{$e.emit("mapLoaded",e)})}},getFlatmapImp:function(){if(this.entry.type==="MultiFlatmap"&&this.flatmapReady&&this.$refs.multiflatmap)return this.$refs.multiflatmap.getCurrentFlatmap().mapImp},flatmapAreaSearch(){let n={type:"Facets",label:"Unused",val:this.getFlatmapImp().visibleMarkerAnatomicalIds().map(o=>this.idNamePair[o])};$e.emit("PopoverActionClick",n)},restoreFeaturedMarkers:function(e){this.settingsStore.resetFeaturedMarkerIdentifier();const t=this.settingsStore.featuredMarkers;this.updateFeaturedMarkers(t,e)},updateFeaturedMarkers:function(e,t){this.showStarInLegend=!1;for(let n=0;n<e.length;++n)e[n]&&(this.settingsStore.featuredMarkerIdentifiers[n]||this.addFeaturedMarker(e[n],n,t)&&(this.showStarInLegend=!0))},addFeaturedMarker:function(e,t,n){const o=this.settingsStore.featuredMarkerSpecies[t];if(o&&!this.activeSpecies.startsWith(o))return!1;let a=n;if(a||(a=this.getFlatmapImp()),a){let i=document.createElement("div");i.innerHTML=CGe;const s=a.addMarker(e,{element:i,className:"highlight-marker",cluster:!1});return this.settingsStore.updateFeaturedMarkerIdentifier({index:t,markerIdentifier:s}),!0}return!1},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:n}=e,o=this.$refs.multiflatmap.getCurrentFlatmap();o&&o.moveMap(t,{offsetX:n?-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:n,organsDisplay:o,outlinesDisplay:a,connectionType:i}=this.settingsStore.globalSettings;if(this.flatmapReady){const s=this.$refs.multiflatmap.getCurrentFlatmap();s.changeViewingMode(t),s.setFlightPath3D(n),s.setColour(o),s.setOutlines(a),s.backgroundChangeCallback(e),s.setConnectionType(i)}},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},displayMinimap(){return this.settingsStore.displayMinimap}},watch:{featuredMarkers:function(e){this.flatmapReady&&this.updateFeaturedMarkers(e,void 0)}},mounted:function(){this.getFeaturedDatasets()}},EGe={class:"viewer-container"};function _Ge(e,t,n,o,a,i){const s=r.resolveComponent("MultiFlatmapVuer"),l=r.resolveComponent("HelpModeDialog");return r.openBlock(),r.createElementBlock("div",EGe,[r.createVNode(s,{availableSpecies:e.availableSpecies,onFlatmapChanged:i.flatmapChanged,onReady:i.multiFlatmapReady,state:e.entry.state,mapManager:e.mapManager,onResourceSelected:t[0]||(t[0]=c=>e.flatmapResourceSelected(e.entry.type,c)),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:i.displayMinimap,showStarInLegend:e.showStarInLegend,enableOpenMapUI:!0,openMapOptions:e.openMapOptions,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,showLocalSettings:e.showLocalSettings,showOpenMapButton:e.showOpenMapButton,onPanZoomCallback:i.flatmapPanZoomCallback,onOpenMap:e.openMap,onFinishHelpMode:e.endHelp,onPathwaySelectionChanged:i.onPathwaySelectionChanged,onOpenPubmedUrl:i.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","displayMinimap","showStarInLegend","openMapOptions","flatmapAPI","sparcAPI","showLocalSettings","showOpenMapButton","onPanZoomCallback","onOpenMap","onFinishHelpMode","onPathwaySelectionChanged","onOpenPubmedUrl","onMapmanagerLoaded","onTrackEvent"]),e.helpMode&&e.useHelpModeDialog?(r.openBlock(),r.createBlock(l,{key:0,ref:"multiflatmapHelp",multiflatmapRef:e.multiflatmapRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["multiflatmapRef","lastItem","onShowNext","onFinishHelpMode"])):r.createCommentVNode("",!0)])}const $Ge=Object.freeze(Object.defineProperty({__proto__:null,default:tr(SGe,[["render",_Ge],["__scopeId","data-v-f14fe234"]])},Symbol.toStringTag,{value:"Module"})),FGe={name:"Plot",mixins:[Jd],components:{PlotVuer:oG.PlotVuer}};function AGe(e,t,n,o,a,i){const s=r.resolveComponent("PlotVuer");return r.openBlock(),r.createBlock(s,{"data-source":e.entry.resource.dataSource,metadata:e.entry.resource.metadata,"supplemental-data":e.entry.resource.supplementalData,style:{overflow:"hidden"},ref:"plot"},null,8,["data-source","metadata","supplemental-data"])}const TGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(FGe,[["render",AGe]])},Symbol.toStringTag,{value:"Module"})),BGe={name:"Scaffold",mixins:[Jd],components:{ScaffoldVuer:aG.ScaffoldVuer,HelpModeDialog:xS},methods:{showConnectivitiesByReference:async function(e){const t=sessionStorage.getItem("flatmap-knowledge");let n=[];t?n=await $5e(e):n=await F5e(this.flatmapService.mapImp,e,this.flatmapService.flatmapQueries);const o=[];for(const a of n){const i=this.nervesKnowledge.find(l=>l.id===a);if(!i)continue;const s=i["nerve-label"];if(s){const l=s.flatMap(c=>c.subNerves);o.push(...l)}}this.$refs.scaffold.changeHighlightedByName(o,"",!1)},setNerveGreyScale:function(){if(this.nervesKnowledge.length){const t=this.nervesKnowledge.reduce((n,o)=>n.concat(o["nerve-label"]||[]),[]).reduce((n,o)=>n.concat(o.subNerves||[]),[]);this.$refs.scaffold.setGreyScale(!0,t)}},setVisibilityFilter:function(e){let t=[];const n=!!e;if(e){const o=e.OR[1].AND[1].models;for(const a of o){const i=this.nervesKnowledge.find(s=>s.id===a);if(i){const s=i["nerve-label"].map(l=>l.subNerves).flat(1/0);t.push(...s)}}}this.$refs.scaffold.zoomToNerves(t,n)},syncFilter:function(e){this.$refs.scaffold.viewingMode==="Neuron Connection"&&(this.filter=e.filter(t=>{var n;return((n=t.facet)==null?void 0:n.toLowerCase())!=="show all"}))},scaffoldResourceSelected:async function(e,t){if(this.resourceSelected(e,t,!0),t.length===1){if(this.clickedObject=t[0].data,this.clickedObject.isNerves||this.clickedObject.anatomicalId){const n=this.clickedObject.id.toLowerCase();if(this.$refs.scaffold.viewingMode==="Neuron Connection"){const o=this.settingsStore.globalSettings.connectionType;if(this.clickedObject.isNerves)this.filter.push({facet:n,term:"Nerves",facetPropPath:"scaffold.connectivity.nerve"});else{const a=o.toLowerCase();let i=this.clickedObject.anatomicalId||"";if(i)this.filter.push({facet:`["${i}",[]]`,facetPropPath:`flatmap.connectivity.source.${a}`,tagLabel:n.charAt(0).toUpperCase()+n.slice(1),term:o});else{const l=this.connectivitiesStore.filterOptions[this.entry.resource].find(d=>d.key===`flatmap.connectivity.source.${a}`);let c;l==null||l.children.forEach(d=>{var u;d.label.toLowerCase()===n&&(c=d),(u=d.children)==null||u.forEach(f=>{f.label.toLowerCase()===n&&(c=f)})}),c&&(i=c.key.replace(`flatmap.connectivity.source.${a}.`,""),this.filter.push({facet:i,facetPropPath:`flatmap.connectivity.source.${a}`,tagLabel:c.tagLabel,term:o}))}}$e.emit("neuron-connection-feature-click",{filters:this.filter,search:this.filter.length?"":n})}else if(this.$refs.scaffold.viewingMode==="Exploration"){const o=this.nervesKnowledge.filter(a=>JSON.stringify(a["nerve-label"]).includes(n));o.length&&this.getKnowledgeTooltip({data:o,type:this.entry})}}}else t.length>1?this.$refs.scaffold.viewingMode==="Exploration"&&this.clickedObject&&this.$refs.scaffold.$module.setIgnorePicking(!1):(this.clickedObject=void 0,$e.emit("connectivity-info-close"))},onResize:function(){this.scaffoldCamera.onResize()},getState:function(){return this.$refs.scaffold.getState()},search:function(e){return this.$refs.scaffold.search(e,!0)},searchSuggestions:function(e,t){if(e===""||!this.$refs.scaffold)return t;this.$refs.scaffold.fetchSuggestions(e).forEach(o=>{o.suggestion&&t.push(o.suggestion)})},showConnectivityTooltips:function(e){if(e.label)this.$refs.scaffold.changeHighlightedByName([e.label],"",!1),this.$refs.scaffold.showRegionTooltip(e.label,!1,!1);else{const t=e.connectivityInfo["nerve-label"];if(t){const n=t.flatMap(o=>o.subNerves);this.$refs.scaffold.changeHighlightedByName(n,"",!1)}this.$refs.scaffold.hideRegionTooltip()}},zoomToFeatures:function(e,t){let n;Array.isArray(e)?n=e:n=[e.name],t&&this.$refs.scaffold.changeActiveByName(n,"",!1),this.$refs.scaffold.viewRegion(n)},scaffoldIsReady:function(){this.scaffoldLoaded=!0,this.$refs.scaffold.$module.graphicsHighlight.highlightColour=[1,0,1],this.isVisible()&&this.entry.rotation&&this.entry.rotation,this.updateViewerSettings(),$e.emit("mapLoaded",this.$refs.scaffold),setTimeout(()=>{this.setNerveGreyScale()},500)},scaffoldHighlighted:function(e,t){var o,a,i;const n={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0};t&&t[0]&&((((o=t[0].data)==null?void 0:o.id)===void 0||((a=t[0].data)==null?void 0:a.id)==="")&&(t[0].data.id=(i=t[0].data)==null?void 0:i.group),n.internalName=t[0].data.id,n.eventType="highlighted"),this.$emit("resource-selected",n)},scaffoldNavigated:function(e,t){if(this.mouseHovered){const n={paneIndex:this.entry.id,eventType:"panZoom",payload:t,type:e};this.$emit("resource-selected",n)}},updateWithViewUrl:function(e){this.$refs.scaffold.updateViewURL(e)},changeViewingMode:function(e){this.$refs.scaffold.changeViewingMode(e)},updateViewerSettings:function(){const{backgroundDisplay:e,organsDisplay:t,outlinesDisplay:n,viewingMode:o}=this.settingsStore.globalSettings;this.$refs.scaffold.backgroundChangeCallback(e),this.$refs.scaffold.changeViewingMode(o),this.$refs.scaffold.setColour(t),this.$refs.scaffold.setOutlines(n)}},computed:{warningMessage:function(){return this.entry.isBodyScaffold?"This map displays the anatomical location and connectivity of nerves, through which the neuron populations from the ApiNATOMY models available in SCKAN can be routed.":"Under active development"},markerLabels:function(){return this.settingsStore.globalSettings.displayMarkers?this.settingsStore.numberOfDatasetsForFacets:{}}},watch:{connectivityKnowledge:{handler(e,t){if(this.entry.resource in e){const n=e[this.entry.resource];n.length!==this.nervesKnowledge.length&&(this.nervesKnowledge=n,this.scaffoldLoaded&&this.setNerveGreyScale())}},deep:!0,immediate:!0}},data:function(){return{apiLocation:process.env.VUE_APP_API_LOCATION,scaffoldCamera:void 0,scaffoldLoaded:!1,nervesKnowledge:[],clickedObject:void 0,filter:[],query:""}},mounted:function(){this.scaffoldCamera=this.$refs.scaffold.$module.scene.getZincCameraControls()}},NGe={class:"viewer-container"};function MGe(e,t,n,o,a,i){const s=r.resolveComponent("ScaffoldVuer"),l=r.resolveComponent("HelpModeDialog");return r.openBlock(),r.createElementBlock("div",NGe,[r.createVNode(s,{state:e.entry.state,url:e.entry.resource,region:e.entry.region,onScaffoldSelected:t[0]||(t[0]=c=>i.scaffoldResourceSelected(e.entry.type,c)),onScaffoldHighlighted:t[1]||(t[1]=c=>i.scaffoldHighlighted(e.entry.type,c)),onScaffoldNavigated:t[2]||(t[2]=c=>i.scaffoldNavigated(e.entry.type,c)),onOnReady:i.scaffoldIsReady,onOpenMap:e.openMap,ref:"scaffold","background-toggle":!0,traditional:!0,helpMode:e.helpMode,helpModeActiveItem:e.helpModeActiveItem,helpModeDialog:e.useHelpModeDialog,onAnnotationOpen:e.onAnnotationOpen,onAnnotationClose:e.onAnnotationClose,onUpdateOfflineAnnotationEnabled:e.updateOfflineAnnotationEnabled,annotationSidebar:e.annotationSidebar,onHelpModeLastItem:e.onHelpModeLastItem,onShownTooltip:e.onTooltipShown,onShownMapTooltip:e.onMapTooltipShown,render:e.visible,"display-latest-message":!0,"warning-message":i.warningMessage,"display-minimap":!1,"display-markers":!1,enableOpenMapUI:!0,"view-u-r-l":e.entry.viewUrl,markerCluster:!0,markerLabels:i.markerLabels,flatmapAPI:e.flatmapAPI,showLocalSettings:e.showLocalSettings,showOpenMapButton:e.showOpenMapButton,usageConfig:{showTubeLinesControls:!1,tubeLines:e.entry.discoverId==="307"}},null,8,["state","url","region","onOnReady","onOpenMap","helpMode","helpModeActiveItem","helpModeDialog","onAnnotationOpen","onAnnotationClose","onUpdateOfflineAnnotationEnabled","annotationSidebar","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","render","warning-message","view-u-r-l","markerLabels","flatmapAPI","showLocalSettings","showOpenMapButton","usageConfig"]),e.helpMode&&e.useHelpModeDialog?(r.openBlock(),r.createBlock(l,{key:0,ref:"scaffoldHelp",scaffoldRef:e.scaffoldRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["scaffoldRef","lastItem","onShowNext","onFinishHelpMode"])):r.createCommentVNode("",!0)])}const OGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(BGe,[["render",MGe],["__scopeId","data-v-c1c53a77"]])},Symbol.toStringTag,{value:"Module"})),LGe={name:"Simulation",mixins:[Jd],components:{SimulationVuer:iG.SimulationVuer},computed:{id:function(){return this.entry.resource?this.entry.resource:this.entry.discoverId}}};function IGe(e,t,n,o,a,i){const s=r.resolveComponent("SimulationVuer");return r.openBlock(),r.createBlock(s,{apiLocation:e.apiLocation,id:i.id,ref:"simulation"},null,8,["apiLocation","id"])}const RGe=Object.freeze(Object.defineProperty({__proto__:null,default:tr(LGe,[["render",IGe]])},Symbol.toStringTag,{value:"Module"}));Qe.MapContent=cGe,Object.defineProperty(Qe,Symbol.toStringTag,{value:"Module"})});
|